diff --git a/dist/index.js b/dist/index.js index 17716455..aafcec4f 100644 --- a/dist/index.js +++ b/dist/index.js @@ -2854,11 +2854,11 @@ class AWSBuildEnvironment { await task_service_1.TaskService.getLogGroups(); return ''; } - async garbageCollect(filter, previewOnly, + async garbageCollect(filter, previewOnly, // eslint-disable-next-line no-unused-vars - olderThan, + olderThan, // eslint-disable-next-line no-unused-vars - fullCache, + fullCache, // eslint-disable-next-line no-unused-vars baseDependencies) { await garbage_collection_service_1.GarbageCollectionService.cleanup(!previewOnly); @@ -2866,18 +2866,18 @@ class AWSBuildEnvironment { } async cleanupWorkflow( // eslint-disable-next-line no-unused-vars - buildParameters, + buildParameters, // eslint-disable-next-line no-unused-vars - branchName, + branchName, // eslint-disable-next-line no-unused-vars defaultSecretsArray) { } async setupWorkflow( // eslint-disable-next-line no-unused-vars - buildGuid, + buildGuid, // eslint-disable-next-line no-unused-vars - buildParameters, + buildParameters, // eslint-disable-next-line no-unused-vars - branchName, + branchName, // eslint-disable-next-line no-unused-vars defaultSecretsArray) { process.env.AWS_REGION = __1.Input.region; @@ -3230,20 +3230,20 @@ class LocalDockerCloudRunner { } garbageCollect( // eslint-disable-next-line no-unused-vars - filter, + filter, // eslint-disable-next-line no-unused-vars - previewOnly, + previewOnly, // eslint-disable-next-line no-unused-vars - olderThan, + olderThan, // eslint-disable-next-line no-unused-vars - fullCache, + fullCache, // eslint-disable-next-line no-unused-vars baseDependencies) { return new Promise((result) => result(``)); } - async cleanupWorkflow(buildParameters, + async cleanupWorkflow(buildParameters, // eslint-disable-next-line no-unused-vars - branchName, + branchName, // eslint-disable-next-line no-unused-vars defaultSecretsArray) { const { workspace } = __1.Action; @@ -3252,9 +3252,9 @@ class LocalDockerCloudRunner { await cloud_runner_system_1.CloudRunnerSystem.Run(`rm -r ${workspace}/cloud-runner-cache/cache/build/build-${buildParameters.buildGuid}.tar${cloud_runner_1.default.buildParameters.useCompressionStrategy ? '.lz4' : ''}`); } } - setupWorkflow(buildGuid, buildParameters, + setupWorkflow(buildGuid, buildParameters, // eslint-disable-next-line no-unused-vars - branchName, + branchName, // eslint-disable-next-line no-unused-vars defaultSecretsArray) { this.buildParameters = buildParameters; @@ -3435,20 +3435,20 @@ class Kubernetes { } garbageCollect( // eslint-disable-next-line no-unused-vars - filter, + filter, // eslint-disable-next-line no-unused-vars - previewOnly, + previewOnly, // eslint-disable-next-line no-unused-vars - olderThan, + olderThan, // eslint-disable-next-line no-unused-vars - fullCache, + fullCache, // eslint-disable-next-line no-unused-vars baseDependencies) { return new Promise((result) => result(``)); } - async setupWorkflow(buildGuid, buildParameters, + async setupWorkflow(buildGuid, buildParameters, // eslint-disable-next-line no-unused-vars - branchName, + branchName, // eslint-disable-next-line no-unused-vars defaultSecretsArray) { try { @@ -3568,9 +3568,9 @@ class Kubernetes { cloud_runner_logger_1.default.log('cleaned up Secret, Job and Pod'); cloud_runner_logger_1.default.log('cleaning up finished'); } - async cleanupWorkflow(buildParameters, + async cleanupWorkflow(buildParameters, // eslint-disable-next-line no-unused-vars - branchName, + branchName, // eslint-disable-next-line no-unused-vars defaultSecretsArray) { if (__1.BuildParameters && __1.BuildParameters.shouldUseRetainedWorkspaceMode(buildParameters)) { @@ -4169,40 +4169,40 @@ class LocalCloudRunner { } garbageCollect( // eslint-disable-next-line no-unused-vars - filter, + filter, // eslint-disable-next-line no-unused-vars - previewOnly, + previewOnly, // eslint-disable-next-line no-unused-vars - olderThan, + olderThan, // eslint-disable-next-line no-unused-vars - fullCache, + fullCache, // eslint-disable-next-line no-unused-vars baseDependencies) { throw new Error('Method not implemented.'); } cleanupWorkflow( // eslint-disable-next-line no-unused-vars - buildParameters, + buildParameters, // eslint-disable-next-line no-unused-vars - branchName, + branchName, // eslint-disable-next-line no-unused-vars defaultSecretsArray) { } setupWorkflow( // eslint-disable-next-line no-unused-vars - buildGuid, + buildGuid, // eslint-disable-next-line no-unused-vars - buildParameters, + buildParameters, // eslint-disable-next-line no-unused-vars - branchName, + branchName, // eslint-disable-next-line no-unused-vars defaultSecretsArray) { } - async runTaskInWorkflow(buildGuid, image, commands, + async runTaskInWorkflow(buildGuid, image, commands, // eslint-disable-next-line no-unused-vars - mountdir, + mountdir, // eslint-disable-next-line no-unused-vars - workingdir, + workingdir, // eslint-disable-next-line no-unused-vars - environment, + environment, // eslint-disable-next-line no-unused-vars secrets) { cloud_runner_logger_1.default.log(image); @@ -4238,34 +4238,34 @@ class TestCloudRunner { } garbageCollect( // eslint-disable-next-line no-unused-vars - filter, + filter, // eslint-disable-next-line no-unused-vars previewOnly) { throw new Error('Method not implemented.'); } cleanupWorkflow( // eslint-disable-next-line no-unused-vars - buildParameters, + buildParameters, // eslint-disable-next-line no-unused-vars - branchName, + branchName, // eslint-disable-next-line no-unused-vars defaultSecretsArray) { } setupWorkflow( // eslint-disable-next-line no-unused-vars - buildGuid, + buildGuid, // eslint-disable-next-line no-unused-vars - buildParameters, + buildParameters, // eslint-disable-next-line no-unused-vars - branchName, + branchName, // eslint-disable-next-line no-unused-vars defaultSecretsArray) { } - async runTaskInWorkflow(commands, buildGuid, image, + async runTaskInWorkflow(commands, buildGuid, image, // eslint-disable-next-line no-unused-vars - mountdir, + mountdir, // eslint-disable-next-line no-unused-vars - workingdir, + workingdir, // eslint-disable-next-line no-unused-vars - environment, + environment, // eslint-disable-next-line no-unused-vars secrets) { cloud_runner_logger_1.default.log(image); @@ -4849,7 +4849,7 @@ class CloudRunnerSystem { return lineValues[lineValues.length - 1]; }); } - static async Run(command, suppressError = false, suppressLogs = false, + static async Run(command, suppressError = false, suppressLogs = false, // eslint-disable-next-line no-unused-vars outputCallback) { for (const element of command.split(`\n`)) { @@ -7544,7 +7544,7 @@ class ValidateWindows { const hasLicensingCredentials = process.env.UNITY_EMAIL && process.env.UNITY_PASSWORD; const hasValidLicensingStrategy = hasLicensingCredentials || unityLicensingServer; if (!hasValidLicensingStrategy) { - throw new Error(`Unity email and password or alternatively a Unity licensing server url must be set for + throw new Error(`Unity email and password or alternatively a Unity licensing server url must be set for Windows based builds to authenticate the license. Make sure to set them inside UNITY_EMAIL and UNITY_PASSWORD in Github Secrets and pass them into the environment.`); } @@ -11363,7 +11363,7 @@ function retry(name, method, getStatusCode, maxAttempts = constants_1.DefaultRet exports.retry = retry; function retryTypedResponse(name, method, maxAttempts = constants_1.DefaultRetryAttempts, delay = constants_1.DefaultRetryDelay) { return __awaiter(this, void 0, void 0, function* () { - return yield retry(name, method, (response) => response.statusCode, maxAttempts, delay, + return yield retry(name, method, (response) => response.statusCode, maxAttempts, delay, // If the error object contains the statusCode property, extract it and return // an TypedResponse so it can be processed by the retry logic. (error) => { @@ -14454,8 +14454,8 @@ class OidcClient { const res = yield httpclient .getJson(id_token_url) .catch(error => { - throw new Error(`Failed to get ID Token. \n - Error Code : ${error.statusCode}\n + throw new Error(`Failed to get ID Token. \n + Error Code : ${error.statusCode}\n Error Message: ${error.message}`); }); const id_token = (_a = res.result) === null || _a === void 0 ? void 0 : _a.value; @@ -17350,8 +17350,8 @@ class OidcClient { const res = yield httpclient .getJson(id_token_url) .catch(error => { - throw new Error(`Failed to get ID Token. \n - Error Code : ${error.statusCode}\n + throw new Error(`Failed to get ID Token. \n + Error Code : ${error.statusCode}\n Error Message: ${error.result.message}`); }); const id_token = (_a = res.result) === null || _a === void 0 ? void 0 : _a.value; @@ -20331,9 +20331,7 @@ const defaultCloudFormationHttpAuthSchemeProvider = (authParameters) => { exports.defaultCloudFormationHttpAuthSchemeProvider = defaultCloudFormationHttpAuthSchemeProvider; const resolveHttpAuthSchemeConfig = (config) => { const config_0 = (0, core_1.resolveAwsSdkSigV4Config)(config); - return Object.assign(config_0, { - authSchemePreference: (0, util_middleware_1.normalizeProvider)(config.authSchemePreference ?? []), - }); + return Object.assign(config_0, {}); }; exports.resolveHttpAuthSchemeConfig = resolveHttpAuthSchemeConfig; @@ -32993,7 +32991,6 @@ const getRuntimeConfig = (config) => { ...config, runtime: "node", defaultsMode, - authSchemePreference: config?.authSchemePreference ?? (0, node_config_provider_1.loadConfig)(core_1.NODE_AUTH_SCHEME_PREFERENCE_OPTIONS, profileConfig), bodyLengthChecker: config?.bodyLengthChecker ?? util_body_length_node_1.calculateBodyLength, credentialDefaultProvider: config?.credentialDefaultProvider ?? credential_provider_node_1.defaultProvider, defaultUserAgentProvider: config?.defaultUserAgentProvider ?? @@ -33788,9 +33785,7 @@ const defaultCloudWatchLogsHttpAuthSchemeProvider = (authParameters) => { exports.defaultCloudWatchLogsHttpAuthSchemeProvider = defaultCloudWatchLogsHttpAuthSchemeProvider; const resolveHttpAuthSchemeConfig = (config) => { const config_0 = (0, core_1.resolveAwsSdkSigV4Config)(config); - return Object.assign(config_0, { - authSchemePreference: (0, util_middleware_1.normalizeProvider)(config.authSchemePreference ?? []), - }); + return Object.assign(config_0, {}); }; exports.resolveHttpAuthSchemeConfig = resolveHttpAuthSchemeConfig; @@ -34457,7 +34452,6 @@ var ResourceAlreadyExistsException = class _ResourceAlreadyExistsException exten } }; var LogGroupClass = { - DELIVERY: "DELIVERY", INFREQUENT_ACCESS: "INFREQUENT_ACCESS", STANDARD: "STANDARD" }; @@ -38317,7 +38311,6 @@ const getRuntimeConfig = (config) => { ...config, runtime: "node", defaultsMode, - authSchemePreference: config?.authSchemePreference ?? (0, node_config_provider_1.loadConfig)(core_1.NODE_AUTH_SCHEME_PREFERENCE_OPTIONS, profileConfig), bodyLengthChecker: config?.bodyLengthChecker ?? util_body_length_node_1.calculateBodyLength, credentialDefaultProvider: config?.credentialDefaultProvider ?? credential_provider_node_1.defaultProvider, defaultUserAgentProvider: config?.defaultUserAgentProvider ?? @@ -39113,9 +39106,7 @@ const defaultECSHttpAuthSchemeProvider = (authParameters) => { exports.defaultECSHttpAuthSchemeProvider = defaultECSHttpAuthSchemeProvider; const resolveHttpAuthSchemeConfig = (config) => { const config_0 = (0, core_1.resolveAwsSdkSigV4Config)(config); - return Object.assign(config_0, { - authSchemePreference: (0, util_middleware_1.normalizeProvider)(config.authSchemePreference ?? []), - }); + return Object.assign(config_0, {}); }; exports.resolveHttpAuthSchemeConfig = resolveHttpAuthSchemeConfig; @@ -39303,7 +39294,6 @@ __export(index_exports, { SchedulingStrategy: () => SchedulingStrategy, Scope: () => Scope, ServerException: () => ServerException, - ServiceDeploymentNotFoundException: () => ServiceDeploymentNotFoundException, ServiceDeploymentRollbackMonitorsStatus: () => ServiceDeploymentRollbackMonitorsStatus, ServiceDeploymentStatus: () => ServiceDeploymentStatus, ServiceField: () => ServiceField, @@ -39315,8 +39305,6 @@ __export(index_exports, { SortOrder: () => SortOrder, StabilityStatus: () => StabilityStatus, StartTaskCommand: () => StartTaskCommand, - StopServiceDeploymentCommand: () => StopServiceDeploymentCommand, - StopServiceDeploymentStopType: () => StopServiceDeploymentStopType, StopTaskCommand: () => StopTaskCommand, SubmitAttachmentStateChangesCommand: () => SubmitAttachmentStateChangesCommand, SubmitContainerStateChangeCommand: () => SubmitContainerStateChangeCommand, @@ -39887,7 +39875,6 @@ var SettingName = { AWSVPC_TRUNKING: "awsvpcTrunking", CONTAINER_INSIGHTS: "containerInsights", CONTAINER_INSTANCE_LONG_ARN_FORMAT: "containerInstanceLongArnFormat", - DEFAULT_LOG_DRIVER_MODE: "defaultLogDriverMode", FARGATE_FIPS_MODE: "fargateFIPSMode", FARGATE_TASK_RETIREMENT_WAIT_PERIOD: "fargateTaskRetirementWaitPeriod", GUARD_DUTY_ACTIVATE: "guardDutyActivate", @@ -40135,7 +40122,6 @@ var ServiceDeploymentStatus = { PENDING: "PENDING", ROLLBACK_FAILED: "ROLLBACK_FAILED", ROLLBACK_IN_PROGRESS: "ROLLBACK_IN_PROGRESS", - ROLLBACK_REQUESTED: "ROLLBACK_REQUESTED", ROLLBACK_SUCCESSFUL: "ROLLBACK_SUCCESSFUL", STOPPED: "STOPPED", STOP_REQUESTED: "STOP_REQUESTED", @@ -40312,28 +40298,6 @@ var ConflictException = class _ConflictException extends ECSServiceException { this.resourceIds = opts.resourceIds; } }; -var ServiceDeploymentNotFoundException = class _ServiceDeploymentNotFoundException extends ECSServiceException { - static { - __name(this, "ServiceDeploymentNotFoundException"); - } - name = "ServiceDeploymentNotFoundException"; - $fault = "client"; - /** - * @internal - */ - constructor(opts) { - super({ - name: "ServiceDeploymentNotFoundException", - $fault: "client", - ...opts - }); - Object.setPrototypeOf(this, _ServiceDeploymentNotFoundException.prototype); - } -}; -var StopServiceDeploymentStopType = { - ABORT: "ABORT", - ROLLBACK: "ROLLBACK" -}; var SessionFilterSensitiveLog = /* @__PURE__ */ __name((obj) => ({ ...obj, ...obj.tokenValue && { tokenValue: import_smithy_client.SENSITIVE_STRING } @@ -40646,12 +40610,6 @@ var se_StartTaskCommand = /* @__PURE__ */ __name(async (input, context) => { body = JSON.stringify((0, import_smithy_client._json)(input)); return buildHttpRpcRequest(context, headers, "/", void 0, body); }, "se_StartTaskCommand"); -var se_StopServiceDeploymentCommand = /* @__PURE__ */ __name(async (input, context) => { - const headers = sharedHeaders("StopServiceDeployment"); - let body; - body = JSON.stringify((0, import_smithy_client._json)(input)); - return buildHttpRpcRequest(context, headers, "/", void 0, body); -}, "se_StopServiceDeploymentCommand"); var se_StopTaskCommand = /* @__PURE__ */ __name(async (input, context) => { const headers = sharedHeaders("StopTask"); let body; @@ -41314,19 +41272,6 @@ var de_StartTaskCommand = /* @__PURE__ */ __name(async (output, context) => { }; return response; }, "de_StartTaskCommand"); -var de_StopServiceDeploymentCommand = /* @__PURE__ */ __name(async (output, context) => { - if (output.statusCode >= 300) { - return de_CommandError(output, context); - } - const data = await (0, import_core2.parseJsonBody)(output.body, context); - let contents = {}; - contents = (0, import_smithy_client._json)(data); - const response = { - $metadata: deserializeMetadata(output), - ...contents - }; - return response; -}, "de_StopServiceDeploymentCommand"); var de_StopTaskCommand = /* @__PURE__ */ __name(async (output, context) => { if (output.statusCode >= 300) { return de_CommandError(output, context); @@ -41601,9 +41546,6 @@ var de_CommandError = /* @__PURE__ */ __name(async (output, context) => { case "ConflictException": case "com.amazonaws.ecs#ConflictException": throw await de_ConflictExceptionRes(parsedOutput, context); - case "ServiceDeploymentNotFoundException": - case "com.amazonaws.ecs#ServiceDeploymentNotFoundException": - throw await de_ServiceDeploymentNotFoundExceptionRes(parsedOutput, context); case "MissingVersionException": case "com.amazonaws.ecs#MissingVersionException": throw await de_MissingVersionExceptionRes(parsedOutput, context); @@ -41790,15 +41732,6 @@ var de_ServerExceptionRes = /* @__PURE__ */ __name(async (parsedOutput, context) }); return (0, import_smithy_client.decorateServiceException)(exception, body); }, "de_ServerExceptionRes"); -var de_ServiceDeploymentNotFoundExceptionRes = /* @__PURE__ */ __name(async (parsedOutput, context) => { - const body = parsedOutput.body; - const deserialized = (0, import_smithy_client._json)(body); - const exception = new ServiceDeploymentNotFoundException({ - $metadata: deserializeMetadata(parsedOutput), - ...deserialized - }); - return (0, import_smithy_client.decorateServiceException)(exception, body); -}, "de_ServiceDeploymentNotFoundExceptionRes"); var de_ServiceNotActiveExceptionRes = /* @__PURE__ */ __name(async (parsedOutput, context) => { const body = parsedOutput.body; const deserialized = (0, import_smithy_client._json)(body); @@ -43221,21 +43154,6 @@ var StartTaskCommand = class extends import_smithy_client.Command.classBuilder() } }; -// src/commands/StopServiceDeploymentCommand.ts - - - -var StopServiceDeploymentCommand = 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("AmazonEC2ContainerServiceV20141113", "StopServiceDeployment", {}).n("ECSClient", "StopServiceDeploymentCommand").f(void 0, void 0).ser(se_StopServiceDeploymentCommand).de(de_StopServiceDeploymentCommand).build() { - static { - __name(this, "StopServiceDeploymentCommand"); - } -}; - // src/commands/StopTaskCommand.ts @@ -43507,7 +43425,6 @@ var commands = { RegisterTaskDefinitionCommand, RunTaskCommand, StartTaskCommand, - StopServiceDeploymentCommand, StopTaskCommand, SubmitAttachmentStateChangesCommand, SubmitContainerStateChangeCommand, @@ -43848,7 +43765,6 @@ const getRuntimeConfig = (config) => { ...config, runtime: "node", defaultsMode, - authSchemePreference: config?.authSchemePreference ?? (0, node_config_provider_1.loadConfig)(core_1.NODE_AUTH_SCHEME_PREFERENCE_OPTIONS, profileConfig), bodyLengthChecker: config?.bodyLengthChecker ?? util_body_length_node_1.calculateBodyLength, credentialDefaultProvider: config?.credentialDefaultProvider ?? credential_provider_node_1.defaultProvider, defaultUserAgentProvider: config?.defaultUserAgentProvider ?? @@ -44643,9 +44559,7 @@ const defaultKinesisHttpAuthSchemeProvider = (authParameters) => { exports.defaultKinesisHttpAuthSchemeProvider = defaultKinesisHttpAuthSchemeProvider; const resolveHttpAuthSchemeConfig = (config) => { const config_0 = (0, core_1.resolveAwsSdkSigV4Config)(config); - return Object.assign(config_0, { - authSchemePreference: (0, util_middleware_1.normalizeProvider)(config.authSchemePreference ?? []), - }); + return Object.assign(config_0, {}); }; exports.resolveHttpAuthSchemeConfig = resolveHttpAuthSchemeConfig; @@ -44756,7 +44670,6 @@ __export(index_exports, { ListShardsCommand: () => ListShardsCommand, ListStreamConsumersCommand: () => ListStreamConsumersCommand, ListStreamsCommand: () => ListStreamsCommand, - ListTagsForResourceCommand: () => ListTagsForResourceCommand, ListTagsForStreamCommand: () => ListTagsForStreamCommand, MergeShardsCommand: () => MergeShardsCommand, MetricsName: () => MetricsName, @@ -44780,8 +44693,6 @@ __export(index_exports, { SubscribeToShardEventStream: () => SubscribeToShardEventStream, SubscribeToShardEventStreamFilterSensitiveLog: () => SubscribeToShardEventStreamFilterSensitiveLog, SubscribeToShardOutputFilterSensitiveLog: () => SubscribeToShardOutputFilterSensitiveLog, - TagResourceCommand: () => TagResourceCommand, - UntagResourceCommand: () => UntagResourceCommand, UpdateShardCountCommand: () => UpdateShardCountCommand, UpdateStreamModeCommand: () => UpdateStreamModeCommand, ValidationException: () => ValidationException, @@ -45122,24 +45033,6 @@ var ExpiredNextTokenException = class _ExpiredNextTokenException extends Kinesis Object.setPrototypeOf(this, _ExpiredNextTokenException.prototype); } }; -var InternalFailureException = class _InternalFailureException extends KinesisServiceException { - static { - __name(this, "InternalFailureException"); - } - name = "InternalFailureException"; - $fault = "server"; - /** - * @internal - */ - constructor(opts) { - super({ - name: "InternalFailureException", - $fault: "server", - ...opts - }); - Object.setPrototypeOf(this, _InternalFailureException.prototype); - } -}; var KMSAccessDeniedException = class _KMSAccessDeniedException extends KinesisServiceException { static { __name(this, "KMSAccessDeniedException"); @@ -45273,6 +45166,24 @@ var ShardIteratorType = { LATEST: "LATEST", TRIM_HORIZON: "TRIM_HORIZON" }; +var InternalFailureException = class _InternalFailureException extends KinesisServiceException { + static { + __name(this, "InternalFailureException"); + } + name = "InternalFailureException"; + $fault = "server"; + /** + * @internal + */ + constructor(opts) { + super({ + name: "InternalFailureException", + $fault: "server", + ...opts + }); + Object.setPrototypeOf(this, _InternalFailureException.prototype); + } +}; var ShardFilterType = { AFTER_SHARD_ID: "AFTER_SHARD_ID", AT_LATEST: "AT_LATEST", @@ -45455,12 +45366,6 @@ var se_ListStreamsCommand = /* @__PURE__ */ __name(async (input, context) => { body = JSON.stringify((0, import_smithy_client._json)(input)); return buildHttpRpcRequest(context, headers, "/", void 0, body); }, "se_ListStreamsCommand"); -var se_ListTagsForResourceCommand = /* @__PURE__ */ __name(async (input, context) => { - const headers = sharedHeaders("ListTagsForResource"); - let body; - body = JSON.stringify((0, import_smithy_client._json)(input)); - return buildHttpRpcRequest(context, headers, "/", void 0, body); -}, "se_ListTagsForResourceCommand"); var se_ListTagsForStreamCommand = /* @__PURE__ */ __name(async (input, context) => { const headers = sharedHeaders("ListTagsForStream"); let body; @@ -45527,18 +45432,6 @@ var se_SubscribeToShardCommand = /* @__PURE__ */ __name(async (input, context) = body = JSON.stringify(se_SubscribeToShardInput(input, context)); return buildHttpRpcRequest(context, headers, "/", void 0, body); }, "se_SubscribeToShardCommand"); -var se_TagResourceCommand = /* @__PURE__ */ __name(async (input, context) => { - const headers = sharedHeaders("TagResource"); - let body; - body = JSON.stringify((0, import_smithy_client._json)(input)); - return buildHttpRpcRequest(context, headers, "/", void 0, body); -}, "se_TagResourceCommand"); -var se_UntagResourceCommand = /* @__PURE__ */ __name(async (input, context) => { - const headers = sharedHeaders("UntagResource"); - let body; - body = JSON.stringify((0, import_smithy_client._json)(input)); - return buildHttpRpcRequest(context, headers, "/", void 0, body); -}, "se_UntagResourceCommand"); var se_UpdateShardCountCommand = /* @__PURE__ */ __name(async (input, context) => { const headers = sharedHeaders("UpdateShardCount"); let body; @@ -45777,19 +45670,6 @@ var de_ListStreamsCommand = /* @__PURE__ */ __name(async (output, context) => { }; return response; }, "de_ListStreamsCommand"); -var de_ListTagsForResourceCommand = /* @__PURE__ */ __name(async (output, context) => { - if (output.statusCode >= 300) { - return de_CommandError(output, context); - } - const data = await (0, import_core2.parseJsonBody)(output.body, context); - let contents = {}; - contents = (0, import_smithy_client._json)(data); - const response = { - $metadata: deserializeMetadata(output), - ...contents - }; - return response; -}, "de_ListTagsForResourceCommand"); var de_ListTagsForStreamCommand = /* @__PURE__ */ __name(async (output, context) => { if (output.statusCode >= 300) { return de_CommandError(output, context); @@ -45913,26 +45793,6 @@ var de_SubscribeToShardCommand = /* @__PURE__ */ __name(async (output, context) }; return response; }, "de_SubscribeToShardCommand"); -var de_TagResourceCommand = /* @__PURE__ */ __name(async (output, context) => { - if (output.statusCode >= 300) { - return de_CommandError(output, context); - } - await (0, import_smithy_client.collectBody)(output.body, context); - const response = { - $metadata: deserializeMetadata(output) - }; - return response; -}, "de_TagResourceCommand"); -var de_UntagResourceCommand = /* @__PURE__ */ __name(async (output, context) => { - if (output.statusCode >= 300) { - return de_CommandError(output, context); - } - await (0, import_smithy_client.collectBody)(output.body, context); - const response = { - $metadata: deserializeMetadata(output) - }; - return response; -}, "de_UntagResourceCommand"); var de_UpdateShardCountCommand = /* @__PURE__ */ __name(async (output, context) => { if (output.statusCode >= 300) { return de_CommandError(output, context); @@ -45981,9 +45841,6 @@ var de_CommandError = /* @__PURE__ */ __name(async (output, context) => { case "ExpiredIteratorException": case "com.amazonaws.kinesis#ExpiredIteratorException": throw await de_ExpiredIteratorExceptionRes(parsedOutput, context); - case "InternalFailureException": - case "com.amazonaws.kinesis#InternalFailureException": - throw await de_InternalFailureExceptionRes(parsedOutput, context); case "KMSAccessDeniedException": case "com.amazonaws.kinesis#KMSAccessDeniedException": throw await de_KMSAccessDeniedExceptionRes(parsedOutput, context); @@ -46047,15 +45904,6 @@ var de_ExpiredNextTokenExceptionRes = /* @__PURE__ */ __name(async (parsedOutput }); return (0, import_smithy_client.decorateServiceException)(exception, body); }, "de_ExpiredNextTokenExceptionRes"); -var de_InternalFailureExceptionRes = /* @__PURE__ */ __name(async (parsedOutput, context) => { - const body = parsedOutput.body; - const deserialized = (0, import_smithy_client._json)(body); - const exception = new InternalFailureException({ - $metadata: deserializeMetadata(parsedOutput), - ...deserialized - }); - return (0, import_smithy_client.decorateServiceException)(exception, body); -}, "de_InternalFailureExceptionRes"); var de_InvalidArgumentExceptionRes = /* @__PURE__ */ __name(async (parsedOutput, context) => { const body = parsedOutput.body; const deserialized = (0, import_smithy_client._json)(body); @@ -46291,6 +46139,15 @@ var de_SubscribeToShardEvent_event = /* @__PURE__ */ __name(async (output, conte Object.assign(contents, de_SubscribeToShardEvent(data, context)); return contents; }, "de_SubscribeToShardEvent_event"); +var de_InternalFailureExceptionRes = /* @__PURE__ */ __name(async (parsedOutput, context) => { + const body = parsedOutput.body; + const deserialized = (0, import_smithy_client._json)(body); + const exception = new InternalFailureException({ + $metadata: deserializeMetadata(parsedOutput), + ...deserialized + }); + return (0, import_smithy_client.decorateServiceException)(exception, body); +}, "de_InternalFailureExceptionRes"); var se_GetShardIteratorInput = /* @__PURE__ */ __name((input, context) => { return (0, import_smithy_client.take)(input, { ShardId: [], @@ -46884,25 +46741,6 @@ var ListStreamsCommand = class extends import_smithy_client.Command.classBuilder } }; -// src/commands/ListTagsForResourceCommand.ts - - - -var ListTagsForResourceCommand = class extends import_smithy_client.Command.classBuilder().ep({ - ...commonParams, - OperationType: { type: "staticContextParams", value: `control` }, - ResourceARN: { type: "contextParams", name: "ResourceARN" } -}).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("Kinesis_20131202", "ListTagsForResource", {}).n("KinesisClient", "ListTagsForResourceCommand").f(void 0, void 0).ser(se_ListTagsForResourceCommand).de(de_ListTagsForResourceCommand).build() { - static { - __name(this, "ListTagsForResourceCommand"); - } -}; - // src/commands/ListTagsForStreamCommand.ts @@ -47119,44 +46957,6 @@ var SubscribeToShardCommand = class extends import_smithy_client.Command.classBu } }; -// src/commands/TagResourceCommand.ts - - - -var TagResourceCommand = class extends import_smithy_client.Command.classBuilder().ep({ - ...commonParams, - OperationType: { type: "staticContextParams", value: `control` }, - ResourceARN: { type: "contextParams", name: "ResourceARN" } -}).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("Kinesis_20131202", "TagResource", {}).n("KinesisClient", "TagResourceCommand").f(void 0, void 0).ser(se_TagResourceCommand).de(de_TagResourceCommand).build() { - static { - __name(this, "TagResourceCommand"); - } -}; - -// src/commands/UntagResourceCommand.ts - - - -var UntagResourceCommand = class extends import_smithy_client.Command.classBuilder().ep({ - ...commonParams, - OperationType: { type: "staticContextParams", value: `control` }, - ResourceARN: { type: "contextParams", name: "ResourceARN" } -}).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("Kinesis_20131202", "UntagResource", {}).n("KinesisClient", "UntagResourceCommand").f(void 0, void 0).ser(se_UntagResourceCommand).de(de_UntagResourceCommand).build() { - static { - __name(this, "UntagResourceCommand"); - } -}; - // src/commands/UpdateShardCountCommand.ts @@ -47216,7 +47016,6 @@ var commands = { ListShardsCommand, ListStreamConsumersCommand, ListStreamsCommand, - ListTagsForResourceCommand, ListTagsForStreamCommand, MergeShardsCommand, PutRecordCommand, @@ -47228,8 +47027,6 @@ var commands = { StartStreamEncryptionCommand, StopStreamEncryptionCommand, SubscribeToShardCommand, - TagResourceCommand, - UntagResourceCommand, UpdateShardCountCommand, UpdateStreamModeCommand }; @@ -47347,7 +47144,6 @@ const getRuntimeConfig = (config) => { ...config, runtime: "node", defaultsMode, - authSchemePreference: config?.authSchemePreference ?? (0, node_config_provider_1.loadConfig)(core_1.NODE_AUTH_SCHEME_PREFERENCE_OPTIONS, profileConfig), bodyLengthChecker: config?.bodyLengthChecker ?? util_body_length_node_1.calculateBodyLength, credentialDefaultProvider: config?.credentialDefaultProvider ?? credential_provider_node_1.defaultProvider, defaultUserAgentProvider: config?.defaultUserAgentProvider ?? @@ -47542,9 +47338,7 @@ exports.defaultS3HttpAuthSchemeProvider = createEndpointRuleSetHttpAuthSchemePro const resolveHttpAuthSchemeConfig = (config) => { const config_0 = (0, core_1.resolveAwsSdkSigV4Config)(config); const config_1 = (0, core_1.resolveAwsSdkSigV4AConfig)(config_0); - return Object.assign(config_1, { - authSchemePreference: (0, util_middleware_1.normalizeProvider)(config.authSchemePreference ?? []), - }); + return Object.assign(config_1, {}); }; exports.resolveHttpAuthSchemeConfig = resolveHttpAuthSchemeConfig; @@ -48867,10 +48661,6 @@ var se_CompleteMultipartUploadCommand = /* @__PURE__ */ __name(async (input, con var se_CopyObjectCommand = /* @__PURE__ */ __name(async (input, context) => { const b = (0, import_core2.requestBuilder)(input, context); const headers = (0, import_smithy_client.map)({}, import_smithy_client.isSerializableHeaderValue, { - ...input.Metadata !== void 0 && Object.keys(input.Metadata).reduce((acc, suffix) => { - acc[`x-amz-meta-${suffix.toLowerCase()}`] = input.Metadata[suffix]; - return acc; - }, {}), [_xaa]: input[_ACL], [_cc]: input[_CC], [_xaca]: input[_CA], @@ -48908,7 +48698,11 @@ var se_CopyObjectCommand = /* @__PURE__ */ __name(async (input, context) => { [_xaolrud]: [() => (0, import_smithy_client.isSerializableHeaderValue)(input[_OLRUD]), () => (0, import_smithy_client.serializeDateTime)(input[_OLRUD]).toString()], [_xaollh]: input[_OLLHS], [_xaebo]: input[_EBO], - [_xasebo]: input[_ESBO] + [_xasebo]: input[_ESBO], + ...input.Metadata !== void 0 && Object.keys(input.Metadata).reduce((acc, suffix) => { + acc[`x-amz-meta-${suffix.toLowerCase()}`] = input.Metadata[suffix]; + return acc; + }, {}) }); b.bp("/{Key+}"); b.p("Bucket", () => input.Bucket, "{Bucket}", false); @@ -48973,10 +48767,6 @@ var se_CreateBucketMetadataTableConfigurationCommand = /* @__PURE__ */ __name(as var se_CreateMultipartUploadCommand = /* @__PURE__ */ __name(async (input, context) => { const b = (0, import_core2.requestBuilder)(input, context); const headers = (0, import_smithy_client.map)({}, import_smithy_client.isSerializableHeaderValue, { - ...input.Metadata !== void 0 && Object.keys(input.Metadata).reduce((acc, suffix) => { - acc[`x-amz-meta-${suffix.toLowerCase()}`] = input.Metadata[suffix]; - return acc; - }, {}), [_xaa]: input[_ACL], [_cc]: input[_CC], [_cd]: input[_CD], @@ -49004,7 +48794,11 @@ var se_CreateMultipartUploadCommand = /* @__PURE__ */ __name(async (input, conte [_xaollh]: input[_OLLHS], [_xaebo]: input[_EBO], [_xaca]: input[_CA], - [_xact]: input[_CT] + [_xact]: input[_CT], + ...input.Metadata !== void 0 && Object.keys(input.Metadata).reduce((acc, suffix) => { + acc[`x-amz-meta-${suffix.toLowerCase()}`] = input.Metadata[suffix]; + return acc; + }, {}) }); b.bp("/{Key+}"); b.p("Bucket", () => input.Bucket, "{Bucket}", false); @@ -50452,10 +50246,6 @@ var se_PutBucketWebsiteCommand = /* @__PURE__ */ __name(async (input, context) = var se_PutObjectCommand = /* @__PURE__ */ __name(async (input, context) => { const b = (0, import_core2.requestBuilder)(input, context); const headers = (0, import_smithy_client.map)({}, import_smithy_client.isSerializableHeaderValue, { - ...input.Metadata !== void 0 && Object.keys(input.Metadata).reduce((acc, suffix) => { - acc[`x-amz-meta-${suffix.toLowerCase()}`] = input.Metadata[suffix]; - return acc; - }, {}), [_ct]: input[_CTo] || "application/octet-stream", [_xaa]: input[_ACL], [_cc]: input[_CC], @@ -50492,7 +50282,11 @@ var se_PutObjectCommand = /* @__PURE__ */ __name(async (input, context) => { [_xaolm]: input[_OLM], [_xaolrud]: [() => (0, import_smithy_client.isSerializableHeaderValue)(input[_OLRUD]), () => (0, import_smithy_client.serializeDateTime)(input[_OLRUD]).toString()], [_xaollh]: input[_OLLHS], - [_xaebo]: input[_EBO] + [_xaebo]: input[_EBO], + ...input.Metadata !== void 0 && Object.keys(input.Metadata).reduce((acc, suffix) => { + acc[`x-amz-meta-${suffix.toLowerCase()}`] = input.Metadata[suffix]; + return acc; + }, {}) }); b.bp("/{Key+}"); b.p("Bucket", () => input.Bucket, "{Bucket}", false); @@ -50810,10 +50604,6 @@ var se_WriteGetObjectResponseCommand = /* @__PURE__ */ __name(async (input, cont const b = (0, import_core2.requestBuilder)(input, context); const headers = (0, import_smithy_client.map)({}, import_smithy_client.isSerializableHeaderValue, { "x-amz-content-sha256": "UNSIGNED-PAYLOAD", - ...input.Metadata !== void 0 && Object.keys(input.Metadata).reduce((acc, suffix) => { - acc[`x-amz-meta-${suffix.toLowerCase()}`] = input.Metadata[suffix]; - return acc; - }, {}), "content-type": "application/octet-stream", [_xarr]: input[_RR], [_xart]: input[_RT], @@ -50856,7 +50646,11 @@ var se_WriteGetObjectResponseCommand = /* @__PURE__ */ __name(async (input, cont [_xafhxasc]: input[_SC], [_xafhxatc]: [() => (0, import_smithy_client.isSerializableHeaderValue)(input[_TC]), () => input[_TC].toString()], [_xafhxavi]: input[_VI], - [_xafhxassebke]: [() => (0, import_smithy_client.isSerializableHeaderValue)(input[_BKE]), () => input[_BKE].toString()] + [_xafhxassebke]: [() => (0, import_smithy_client.isSerializableHeaderValue)(input[_BKE]), () => input[_BKE].toString()], + ...input.Metadata !== void 0 && Object.keys(input.Metadata).reduce((acc, suffix) => { + acc[`x-amz-meta-${suffix.toLowerCase()}`] = input.Metadata[suffix]; + return acc; + }, {}) }); b.bp("/WriteGetObjectResponse"); let body; @@ -58843,7 +58637,6 @@ const getRuntimeConfig = (config) => { ...config, runtime: "node", defaultsMode, - authSchemePreference: config?.authSchemePreference ?? (0, node_config_provider_1.loadConfig)(core_1.NODE_AUTH_SCHEME_PREFERENCE_OPTIONS, profileConfig), bodyLengthChecker: config?.bodyLengthChecker ?? util_body_length_node_1.calculateBodyLength, credentialDefaultProvider: config?.credentialDefaultProvider ?? credential_provider_node_1.defaultProvider, defaultUserAgentProvider: config?.defaultUserAgentProvider ?? @@ -59002,9 +58795,7 @@ const defaultSSOHttpAuthSchemeProvider = (authParameters) => { exports.defaultSSOHttpAuthSchemeProvider = defaultSSOHttpAuthSchemeProvider; const resolveHttpAuthSchemeConfig = (config) => { const config_0 = (0, core_1.resolveAwsSdkSigV4Config)(config); - return Object.assign(config_0, { - authSchemePreference: (0, util_middleware_1.normalizeProvider)(config.authSchemePreference ?? []), - }); + return Object.assign(config_0, {}); }; exports.resolveHttpAuthSchemeConfig = resolveHttpAuthSchemeConfig; @@ -59697,7 +59488,6 @@ const getRuntimeConfig = (config) => { ...config, runtime: "node", defaultsMode, - authSchemePreference: config?.authSchemePreference ?? (0, node_config_provider_1.loadConfig)(core_1.NODE_AUTH_SCHEME_PREFERENCE_OPTIONS, profileConfig), 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 }), @@ -59895,7 +59685,6 @@ __export(index_exports, { AWSSDKSigV4Signer: () => AWSSDKSigV4Signer, AwsSdkSigV4ASigner: () => AwsSdkSigV4ASigner, AwsSdkSigV4Signer: () => AwsSdkSigV4Signer, - NODE_AUTH_SCHEME_PREFERENCE_OPTIONS: () => NODE_AUTH_SCHEME_PREFERENCE_OPTIONS, NODE_SIGV4A_CONFIG_OPTIONS: () => NODE_SIGV4A_CONFIG_OPTIONS, resolveAWSSDKSigV4Config: () => resolveAWSSDKSigV4Config, resolveAwsSdkSigV4AConfig: () => resolveAwsSdkSigV4AConfig, @@ -60031,37 +59820,6 @@ var AwsSdkSigV4ASigner = class extends AwsSdkSigV4Signer { } }; -// src/submodules/httpAuthSchemes/utils/getArrayForCommaSeparatedString.ts -var getArrayForCommaSeparatedString = /* @__PURE__ */ __name((str) => typeof str === "string" && str.length > 0 ? str.split(",").map((item) => item.trim()) : [], "getArrayForCommaSeparatedString"); - -// src/submodules/httpAuthSchemes/aws_sdk/NODE_AUTH_SCHEME_PREFERENCE_OPTIONS.ts -var NODE_AUTH_SCHEME_PREFERENCE_ENV_KEY = "AWS_AUTH_SCHEME_PREFERENCE"; -var NODE_AUTH_SCHEME_PREFERENCE_CONFIG_KEY = "auth_scheme_preference"; -var NODE_AUTH_SCHEME_PREFERENCE_OPTIONS = { - /** - * Retrieves auth scheme preference from environment variables - * @param env - Node process environment object - * @returns Array of auth scheme strings if preference is set, undefined otherwise - */ - environmentVariableSelector: /* @__PURE__ */ __name((env) => { - if (!(NODE_AUTH_SCHEME_PREFERENCE_ENV_KEY in env)) return void 0; - return getArrayForCommaSeparatedString(env[NODE_AUTH_SCHEME_PREFERENCE_ENV_KEY]); - }, "environmentVariableSelector"), - /** - * Retrieves auth scheme preference from config file - * @param profile - Config profile object - * @returns Array of auth scheme strings if preference is set, undefined otherwise - */ - configFileSelector: /* @__PURE__ */ __name((profile) => { - if (!(NODE_AUTH_SCHEME_PREFERENCE_CONFIG_KEY in profile)) return void 0; - return getArrayForCommaSeparatedString(profile[NODE_AUTH_SCHEME_PREFERENCE_CONFIG_KEY]); - }, "configFileSelector"), - /** - * Default auth scheme preference if not specified in environment or config - */ - default: [] -}; - // src/submodules/httpAuthSchemes/aws_sdk/resolveAwsSdkSigV4AConfig.ts var import_core = __nccwpck_require__(55829); var import_property_provider = __nccwpck_require__(79721); @@ -60681,8 +60439,7 @@ exports.fromHttp = fromHttp; "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.createGetRequest = createGetRequest; -exports.getCredentials = getCredentials; +exports.getCredentials = exports.createGetRequest = void 0; const property_provider_1 = __nccwpck_require__(79721); const protocol_http_1 = __nccwpck_require__(64418); const smithy_client_1 = __nccwpck_require__(63570); @@ -60700,6 +60457,7 @@ function createGetRequest(url) { 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(); @@ -60732,6 +60490,7 @@ async function getCredentials(response, logger) { } throw new property_provider_1.CredentialsProviderError(`Server responded with status: ${response.statusCode}`, { logger }); } +exports.getCredentials = getCredentials; /***/ }), @@ -61136,10 +60895,10 @@ var defaultProvider = /* @__PURE__ */ __name((init = {}) => (0, import_property_ 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: + 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. @@ -61638,23 +61397,13 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? ( }) : function(o, v) { o["default"] = v; }); -var __importStar = (this && this.__importStar) || (function () { - var ownKeys = function(o) { - ownKeys = Object.getOwnPropertyNames || function (o) { - var ar = []; - for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; - return ar; - }; - return ownKeys(o); - }; - return function (mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); - __setModuleDefault(result, mod); - return result; - }; -})(); +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) => { @@ -62521,8 +62270,8 @@ var selectChecksumAlgorithmFunction = /* @__PURE__ */ __name((checksumAlgorithm, case "CRC64NVME" /* CRC64NVME */: if (typeof crc64NvmeCrtContainer.CrtCrc64Nvme !== "function") { throw new Error( - `Please check whether you have installed the "@aws-sdk/crc64-nvme-crt" package explicitly. -You must also register the package by calling [require("@aws-sdk/crc64-nvme-crt");] or an ESM equivalent such as [import "@aws-sdk/crc64-nvme-crt";]. + `Please check whether you have installed the "@aws-sdk/crc64-nvme-crt" package explicitly. +You must also register the package by calling [require("@aws-sdk/crc64-nvme-crt");] or an ESM equivalent such as [import "@aws-sdk/crc64-nvme-crt";]. For more information please go to https://github.com/aws/aws-sdk-js-v3#functionality-requiring-aws-common-runtime-crt` ); } @@ -64182,9 +63931,7 @@ const defaultSSOOIDCHttpAuthSchemeProvider = (authParameters) => { exports.defaultSSOOIDCHttpAuthSchemeProvider = defaultSSOOIDCHttpAuthSchemeProvider; const resolveHttpAuthSchemeConfig = (config) => { const config_0 = (0, core_1.resolveAwsSdkSigV4Config)(config); - return Object.assign(config_0, { - authSchemePreference: (0, util_middleware_1.normalizeProvider)(config.authSchemePreference ?? []), - }); + return Object.assign(config_0, {}); }; exports.resolveHttpAuthSchemeConfig = resolveHttpAuthSchemeConfig; @@ -65126,7 +64873,6 @@ const getRuntimeConfig = (config) => { ...config, runtime: "node", defaultsMode, - authSchemePreference: config?.authSchemePreference ?? (0, node_config_provider_1.loadConfig)(core_1.NODE_AUTH_SCHEME_PREFERENCE_OPTIONS, profileConfig), 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 }), @@ -65371,9 +65117,7 @@ exports.resolveStsAuthConfig = resolveStsAuthConfig; const resolveHttpAuthSchemeConfig = (config) => { const config_0 = (0, exports.resolveStsAuthConfig)(config); const config_1 = (0, core_1.resolveAwsSdkSigV4Config)(config_0); - return Object.assign(config_1, { - authSchemePreference: (0, util_middleware_1.normalizeProvider)(config.authSchemePreference ?? []), - }); + return Object.assign(config_1, {}); }; exports.resolveHttpAuthSchemeConfig = resolveHttpAuthSchemeConfig; @@ -66421,7 +66165,6 @@ const getRuntimeConfig = (config) => { ...config, runtime: "node", defaultsMode, - authSchemePreference: config?.authSchemePreference ?? (0, node_config_provider_1.loadConfig)(core_1.NODE_AUTH_SCHEME_PREFERENCE_OPTIONS, profileConfig), 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 }), @@ -66667,7 +66410,6 @@ module.exports = __toCommonJS(index_exports); // src/SignatureV4MultiRegion.ts var import_middleware_sdk_s3 = __nccwpck_require__(81139); -var import_signature_v4 = __nccwpck_require__(11528); // src/signature-v4-crt-container.ts var signatureV4CrtContainer = { @@ -66688,43 +66430,28 @@ var SignatureV4MultiRegion = class { } async sign(requestToSign, options = {}) { if (options.signingRegion === "*") { + if (this.signerOptions.runtime !== "node") + throw new Error("This request requires signing with SigV4Asymmetric algorithm. It's only available in Node.js"); return this.getSigv4aSigner().sign(requestToSign, options); } return this.sigv4Signer.sign(requestToSign, options); } /** * Sign with alternate credentials to the ones provided in the constructor. - * Note: This is only supported for SigV4a when using the CRT implementation. */ async signWithCredentials(requestToSign, credentials, options = {}) { if (options.signingRegion === "*") { - const signer = this.getSigv4aSigner(); - const CrtSignerV4 = signatureV4CrtContainer.CrtSignerV4; - if (CrtSignerV4 && signer instanceof CrtSignerV4) { - return signer.signWithCredentials(requestToSign, credentials, options); - } else { - throw new Error( - `signWithCredentials with signingRegion '*' is only supported when using the CRT dependency @aws-sdk/signature-v4-crt. Please check whether you have installed the "@aws-sdk/signature-v4-crt" package explicitly. You must also register the package by calling [require("@aws-sdk/signature-v4-crt");] or an ESM equivalent such as [import "@aws-sdk/signature-v4-crt";]. For more information please go to https://github.com/aws/aws-sdk-js-v3#functionality-requiring-aws-common-runtime-crt` - ); - } + if (this.signerOptions.runtime !== "node") + throw new Error("This request requires signing with SigV4Asymmetric algorithm. It's only available in Node.js"); + return this.getSigv4aSigner().signWithCredentials(requestToSign, credentials, options); } return this.sigv4Signer.signWithCredentials(requestToSign, credentials, options); } - /** - * Presign a request. - * Note: This is only supported for SigV4a when using the CRT implementation. - */ async presign(originalRequest, options = {}) { if (options.signingRegion === "*") { - const signer = this.getSigv4aSigner(); - const CrtSignerV4 = signatureV4CrtContainer.CrtSignerV4; - if (CrtSignerV4 && signer instanceof CrtSignerV4) { - return signer.presign(originalRequest, options); - } else { - throw new Error( - `presign with signingRegion '*' is only supported when using the CRT dependency @aws-sdk/signature-v4-crt. Please check whether you have installed the "@aws-sdk/signature-v4-crt" package explicitly. You must also register the package by calling [require("@aws-sdk/signature-v4-crt");] or an ESM equivalent such as [import "@aws-sdk/signature-v4-crt";]. For more information please go to https://github.com/aws/aws-sdk-js-v3#functionality-requiring-aws-common-runtime-crt` - ); - } + if (this.signerOptions.runtime !== "node") + throw new Error("This request requires signing with SigV4Asymmetric algorithm. It's only available in Node.js"); + return this.getSigv4aSigner().presign(originalRequest, options); } return this.sigv4Signer.presign(originalRequest, options); } @@ -66736,38 +66463,21 @@ var SignatureV4MultiRegion = class { } getSigv4aSigner() { if (!this.sigv4aSigner) { - const CrtSignerV4 = signatureV4CrtContainer.CrtSignerV4; - const JsSigV4aSigner = import_signature_v4.signatureV4aContainer.SignatureV4a; - if (this.signerOptions.runtime === "node") { - if (!CrtSignerV4 && !JsSigV4aSigner) { - throw new Error( - "Neither CRT nor JS SigV4a implementation is available. Please load either @aws-sdk/signature-v4-crt or @aws-sdk/signature-v4a. For more information please go to https://github.com/aws/aws-sdk-js-v3#functionality-requiring-aws-common-runtime-crt" - ); - } - if (CrtSignerV4 && typeof CrtSignerV4 === "function") { - this.sigv4aSigner = new CrtSignerV4({ - ...this.signerOptions, - signingAlgorithm: 1 - }); - } else if (JsSigV4aSigner && typeof JsSigV4aSigner === "function") { - this.sigv4aSigner = new JsSigV4aSigner({ - ...this.signerOptions - }); - } else { - throw new Error( - "Available SigV4a implementation is not a valid constructor. Please ensure you've properly imported @aws-sdk/signature-v4-crt or @aws-sdk/signature-v4a.For more information please go to https://github.com/aws/aws-sdk-js-v3#functionality-requiring-aws-common-runtime-crt" - ); - } - } else { - if (!JsSigV4aSigner || typeof JsSigV4aSigner !== "function") { - throw new Error( - "JS SigV4a implementation is not available or not a valid constructor. Please check whether you have installed the @aws-sdk/signature-v4a package explicitly. The CRT implementation is not available for browsers. You must also register the package by calling [require('@aws-sdk/signature-v4a');] or an ESM equivalent such as [import '@aws-sdk/signature-v4a';]. For more information please go to https://github.com/aws/aws-sdk-js-v3#using-javascript-non-crt-implementation-of-sigv4a" - ); - } - this.sigv4aSigner = new JsSigV4aSigner({ - ...this.signerOptions - }); + let CrtSignerV4 = null; + try { + CrtSignerV4 = signatureV4CrtContainer.CrtSignerV4; + if (typeof CrtSignerV4 !== "function") throw new Error(); + } catch (e) { + e.message = `${e.message} +Please check whether you have installed the "@aws-sdk/signature-v4-crt" package explicitly. +You must also register the package by calling [require("@aws-sdk/signature-v4-crt");] or an ESM equivalent such as [import "@aws-sdk/signature-v4-crt";]. +For more information please go to https://github.com/aws/aws-sdk-js-v3#functionality-requiring-aws-common-runtime-crt`; + throw e; } + this.sigv4aSigner = new CrtSignerV4({ + ...this.signerOptions, + signingAlgorithm: 1 + }); } return this.sigv4aSigner; } @@ -67026,17 +66736,18 @@ var __copyProps = (to, from, except, desc) => { var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); // src/index.ts -var index_exports = {}; -__export(index_exports, { +var src_exports = {}; +__export(src_exports, { build: () => build, parse: () => parse, validate: () => validate }); -module.exports = __toCommonJS(index_exports); +module.exports = __toCommonJS(src_exports); var validate = /* @__PURE__ */ __name((str) => typeof str === "string" && str.indexOf("arn:") === 0 && str.split(":").length >= 6, "validate"); var parse = /* @__PURE__ */ __name((arn) => { const segments = arn.split(":"); - if (segments.length < 6 || segments[0] !== "arn") throw new Error("Malformed ARN"); + if (segments.length < 6 || segments[0] !== "arn") + throw new Error("Malformed ARN"); const [ , //Skip "arn" literal @@ -67390,9 +67101,6 @@ var partitions_default = { }, regionRegex: "^eu\\-isoe\\-\\w+\\-\\d+$", regions: { - "aws-iso-e-global": { - description: "AWS ISOE (Europe) global region" - }, "eu-isoe-west-1": { description: "EU ISOE West" } @@ -67419,22 +67127,6 @@ var partitions_default = { description: "US ISOF SOUTH" } } - }, { - id: "aws-eusc", - outputs: { - dnsSuffix: "amazonaws.eu", - dualStackDnsSuffix: "amazonaws.eu", - implicitGlobalRegion: "eusc-de-east-1", - name: "aws-eusc", - supportsDualStack: false, - supportsFIPS: true - }, - regionRegex: "^eusc\\-(de)\\-\\w+\\-\\d+$", - regions: { - "eusc-de-east-1": { - description: "EU (Germany)" - } - } }], version: "1.1" }; @@ -68753,7 +68445,7 @@ class Serializer { /** * The provided model mapper. */ - modelMappers = {}, + modelMappers = {}, /** * Whether the contents are XML or not. */ @@ -70869,7 +70561,7 @@ class NodeFetchHttpClient { body = uploadReportStream; } const platformSpecificRequestInit = await this.prepareRequest(httpRequest); - const requestInit = Object.assign({ body: body, headers: httpRequest.headers.rawHeaders(), method: httpRequest.method, + const requestInit = Object.assign({ body: body, headers: httpRequest.headers.rawHeaders(), method: httpRequest.method, // the types for RequestInit are from the browser, which expects AbortSignal to // have `reason` and `throwIfAborted`, but these don't exist on our polyfill // for Node. @@ -71068,7 +70760,7 @@ class BaseRequestPolicy { /** * The next policy in the pipeline. Each policy is responsible for executing the next one if the request is to continue through the pipeline. */ - _nextPolicy, + _nextPolicy, /** * The options that can be passed to a given request policy. */ @@ -72046,7 +71738,7 @@ function createTokenCycler(credential, scopes, tokenCyclerOptions) { const tryGetAccessToken = () => credential.getToken(scopes, getTokenOptions); // Take advantage of promise chaining to insert an assignment to `token` // before the refresh can be considered done. - refreshWorker = beginRefresh(tryGetAccessToken, options.retryIntervalInMs, + refreshWorker = beginRefresh(tryGetAccessToken, options.retryIntervalInMs, // If we don't have a token, then we should timeout immediately (_a = token === null || token === void 0 ? void 0 : token.expiresOnTimestamp) !== null && _a !== void 0 ? _a : Date.now()) .then((_token) => { @@ -72853,7 +72545,7 @@ class ServiceClient { * @param credentials - The credentials used for authentication with the service. * @param options - The service client options that govern the behavior of the client. */ - constructor(credentials, + constructor(credentials, /* eslint-disable-next-line @azure/azure-sdk/ts-naming-options */ options) { if (!options) { @@ -92663,7 +92355,7 @@ function createTokenCycler(credential, scopes, tokenCyclerOptions) { const tryGetAccessToken = () => credential.getToken(scopes, getTokenOptions); // Take advantage of promise chaining to insert an assignment to `token` // before the refresh can be considered done. - refreshWorker = beginRefresh(tryGetAccessToken, options.retryIntervalInMs, + refreshWorker = beginRefresh(tryGetAccessToken, options.retryIntervalInMs, // If we don't have a token, then we should timeout immediately (_a = token === null || token === void 0 ? void 0 : token.expiresOnTimestamp) !== null && _a !== void 0 ? _a : Date.now()) .then((_token) => { @@ -97083,7 +96775,7 @@ const fsCreateReadStream = fs__namespace.createReadStream; * append blob, or page blob. */ class BlobClient extends StorageClient { - constructor(urlOrConnectionString, credentialOrPipelineOrContainerName, blobNameOrOptions, + constructor(urlOrConnectionString, credentialOrPipelineOrContainerName, blobNameOrOptions, // Legacy, no fix for eslint error without breaking. Disable it for this interface. /* eslint-disable-next-line @azure/azure-sdk/ts-naming-options*/ options) { @@ -98131,7 +97823,7 @@ class BlobClient extends StorageClient { * AppendBlobClient defines a set of operations applicable to append blobs. */ class AppendBlobClient extends BlobClient { - constructor(urlOrConnectionString, credentialOrPipelineOrContainerName, blobNameOrOptions, + constructor(urlOrConnectionString, credentialOrPipelineOrContainerName, blobNameOrOptions, // Legacy, no fix for eslint error without breaking. Disable it for this interface. /* eslint-disable-next-line @azure/azure-sdk/ts-naming-options*/ options) { @@ -98387,7 +98079,7 @@ class AppendBlobClient extends BlobClient { * BlockBlobClient defines a set of operations applicable to block blobs. */ class BlockBlobClient extends BlobClient { - constructor(urlOrConnectionString, credentialOrPipelineOrContainerName, blobNameOrOptions, + constructor(urlOrConnectionString, credentialOrPipelineOrContainerName, blobNameOrOptions, // Legacy, no fix for eslint error without breaking. Disable it for this interface. /* eslint-disable-next-line @azure/azure-sdk/ts-naming-options*/ options) { @@ -99016,7 +98708,7 @@ class BlockBlobClient extends BlobClient { if (options.onProgress) { options.onProgress({ loadedBytes: transferProgress }); } - }, + }, // concurrency should set a smaller value than maxConcurrency, which is helpful to // reduce the possibility when a outgoing handler waits for stream data, in // this situation, outgoing handlers are blocked. @@ -99041,7 +98733,7 @@ class BlockBlobClient extends BlobClient { * PageBlobClient defines a set of operations applicable to page blobs. */ class PageBlobClient extends BlobClient { - constructor(urlOrConnectionString, credentialOrPipelineOrContainerName, blobNameOrOptions, + constructor(urlOrConnectionString, credentialOrPipelineOrContainerName, blobNameOrOptions, // Legacy, no fix for eslint error without breaking. Disable it for this interface. /* eslint-disable-next-line @azure/azure-sdk/ts-naming-options*/ options) { @@ -100299,7 +99991,7 @@ class BatchHeaderFilterPolicyFactory { * @see https://docs.microsoft.com/en-us/rest/api/storageservices/blob-batch */ class BlobBatchClient { - constructor(url, credentialOrPipeline, + constructor(url, credentialOrPipeline, // Legacy, no fix for eslint error without breaking. Disable it for this interface. /* eslint-disable-next-line @azure/azure-sdk/ts-naming-options*/ options) { @@ -100331,7 +100023,7 @@ class BlobBatchClient { createBatch() { return new BlobBatch(); } - async deleteBlobs(urlsOrBlobClients, credentialOrOptions, + async deleteBlobs(urlsOrBlobClients, credentialOrOptions, // Legacy, no fix for eslint error without breaking. Disable it for this interface. /* eslint-disable-next-line @azure/azure-sdk/ts-naming-options*/ options) { @@ -100346,7 +100038,7 @@ class BlobBatchClient { } return this.submitBatch(batch); } - async setBlobsAccessTier(urlsOrBlobClients, credentialOrTier, tierOrOptions, + async setBlobsAccessTier(urlsOrBlobClients, credentialOrTier, tierOrOptions, // Legacy, no fix for eslint error without breaking. Disable it for this interface. /* eslint-disable-next-line @azure/azure-sdk/ts-naming-options*/ options) { @@ -100438,7 +100130,7 @@ class BlobBatchClient { * A ContainerClient represents a URL to the Azure Storage container allowing you to manipulate its blobs. */ class ContainerClient extends StorageClient { - constructor(urlOrConnectionString, credentialOrPipelineOrContainerName, + constructor(urlOrConnectionString, credentialOrPipelineOrContainerName, // Legacy, no fix for eslint error without breaking. Disable it for this interface. /* eslint-disable-next-line @azure/azure-sdk/ts-naming-options*/ options) { @@ -102150,7 +101842,7 @@ function generateAccountSASQueryParameters(accountSASSignatureValues, sharedKeyC * to manipulate blob containers. */ class BlobServiceClient extends StorageClient { - constructor(url, credentialOrPipeline, + constructor(url, credentialOrPipeline, // Legacy, no fix for eslint error without breaking. Disable it for this interface. /* eslint-disable-next-line @azure/azure-sdk/ts-naming-options*/ options) { @@ -102182,7 +101874,7 @@ class BlobServiceClient extends StorageClient { * `BlobEndpoint=https://myaccount.blob.core.windows.net/;QueueEndpoint=https://myaccount.queue.core.windows.net/;FileEndpoint=https://myaccount.file.core.windows.net/;TableEndpoint=https://myaccount.table.core.windows.net/;SharedAccessSignature=sasString` * @param options - Optional. Options to configure the HTTP pipeline. */ - static fromConnectionString(connectionString, + static fromConnectionString(connectionString, // Legacy, no fix for eslint error without breaking. Disable it for this interface. /* eslint-disable-next-line @azure/azure-sdk/ts-naming-options*/ options) { @@ -105291,7 +104983,7 @@ const listen = function listen(options) { throw new Error("Deno.listen is only implemented for transport: tcp"); } const server = (0, net_1.createServer)(); - const waitFor = new Promise((resolve) => + const waitFor = new Promise((resolve) => // server._handle.fd is assigned immediately on .listen() server.listen(port, hostname, resolve)); // @ts-expect-error undocumented socket._handle property @@ -105348,7 +105040,7 @@ const listenTls = function listen({ port, hostname = "0.0.0.0", transport = "tcp } const [cert, key] = [certFile, keyFile].map((f) => f == null ? undefined : (0, readTextFileSync_js_1.readTextFileSync)(f)); const server = (0, tls_1.createServer)({ cert, key }); - const waitFor = new Promise((resolve) => + const waitFor = new Promise((resolve) => // server._handle.fd is assigned immediately on .listen() server.listen(port, hostname, resolve)); // @ts-expect-error undocumented socket._handle property @@ -232524,7 +232216,7 @@ class BinaryWriter { * Write a `sint64` value, a signed, zig-zag-encoded 64-bit varint. */ sint64(value) { - let long = pb_long_1.PbLong.from(value), + let long = pb_long_1.PbLong.from(value), // zigzag encode sign = long.hi >> 31, lo = (long.lo << 1) ^ sign, hi = ((long.hi << 1) | (long.lo >>> 31)) ^ sign; goog_varint_1.varint64write(lo, hi, this.buf); @@ -235804,30 +235496,6 @@ var getSmithyContext = /* @__PURE__ */ __name((context) => context[import_types. // src/middleware-http-auth-scheme/httpAuthSchemeMiddleware.ts var import_util_middleware = __nccwpck_require__(2390); - -// src/middleware-http-auth-scheme/resolveAuthOptions.ts -var resolveAuthOptions = /* @__PURE__ */ __name((candidateAuthOptions, authSchemePreference) => { - if (!authSchemePreference || authSchemePreference.length === 0) { - return candidateAuthOptions; - } - const preferredAuthOptions = []; - for (const preferredSchemeName of authSchemePreference) { - for (const candidateAuthOption of candidateAuthOptions) { - const candidateAuthSchemeName = candidateAuthOption.schemeId.split("#")[1]; - if (candidateAuthSchemeName === preferredSchemeName) { - preferredAuthOptions.push(candidateAuthOption); - } - } - } - for (const candidateAuthOption of candidateAuthOptions) { - if (!preferredAuthOptions.find(({ schemeId }) => schemeId === candidateAuthOption.schemeId)) { - preferredAuthOptions.push(candidateAuthOption); - } - } - return preferredAuthOptions; -}, "resolveAuthOptions"); - -// src/middleware-http-auth-scheme/httpAuthSchemeMiddleware.ts function convertHttpAuthSchemesToMap(httpAuthSchemes) { const map = /* @__PURE__ */ new Map(); for (const scheme of httpAuthSchemes) { @@ -235840,12 +235508,10 @@ var httpAuthSchemeMiddleware = /* @__PURE__ */ __name((config, mwOptions) => (ne const options = config.httpAuthSchemeProvider( await mwOptions.httpAuthSchemeParametersProvider(config, context, args.input) ); - const authSchemePreference = config.authSchemePreference ? await config.authSchemePreference() : []; - const resolvedOptions = resolveAuthOptions(options, authSchemePreference); const authSchemes = convertHttpAuthSchemesToMap(config.httpAuthSchemes); const smithyContext = (0, import_util_middleware.getSmithyContext)(context); const failureReasons = []; - for (const option of resolvedOptions) { + for (const option of options) { const scheme = authSchemes.get(option.schemeId); if (!scheme) { failureReasons.push(`HttpAuthScheme \`${option.schemeId}\` was not enabled for this service.`); @@ -241503,7 +241169,6 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru // src/index.ts var src_exports = {}; __export(src_exports, { - isBrowserNetworkError: () => isBrowserNetworkError, isClockSkewCorrectedError: () => isClockSkewCorrectedError, isClockSkewError: () => isClockSkewError, isRetryableByTrait: () => isRetryableByTrait, @@ -241547,27 +241212,8 @@ var NODEJS_TIMEOUT_ERROR_CODES = ["ECONNRESET", "ECONNREFUSED", "EPIPE", "ETIMED 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) => error.$metadata?.clockSkewCorrected, "isClockSkewCorrectedError"); -var isBrowserNetworkError = /* @__PURE__ */ __name((error) => { - const errorMessages = /* @__PURE__ */ new Set([ - "Failed to fetch", - // Chrome - "NetworkError when attempting to fetch resource", - // Firefox - "The Internet connection appears to be offline", - // Safari 16 - "Load failed", - // Safari 17+ - "Network request failed" - // `cross-fetch` - ]); - const isValid = error && error instanceof TypeError; - if (!isValid) { - return false; - } - return errorMessages.has(error.message); -}, "isBrowserNetworkError"); 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) || isBrowserNetworkError(error) || error.cause !== void 0 && depth <= 10 && isTransientError(error.cause, depth + 1), "isTransientError"); +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) => { if (error.$metadata?.httpStatusCode !== void 0) { const statusCode = error.$metadata.httpStatusCode; @@ -241908,51 +241554,23 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru // src/index.ts var src_exports = {}; __export(src_exports, { - ALGORITHM_IDENTIFIER: () => ALGORITHM_IDENTIFIER, - ALGORITHM_IDENTIFIER_V4A: () => ALGORITHM_IDENTIFIER_V4A, - ALGORITHM_QUERY_PARAM: () => ALGORITHM_QUERY_PARAM, - ALWAYS_UNSIGNABLE_HEADERS: () => ALWAYS_UNSIGNABLE_HEADERS, - AMZ_DATE_HEADER: () => AMZ_DATE_HEADER, - AMZ_DATE_QUERY_PARAM: () => AMZ_DATE_QUERY_PARAM, - AUTH_HEADER: () => AUTH_HEADER, - CREDENTIAL_QUERY_PARAM: () => CREDENTIAL_QUERY_PARAM, - DATE_HEADER: () => DATE_HEADER, - EVENT_ALGORITHM_IDENTIFIER: () => EVENT_ALGORITHM_IDENTIFIER, - EXPIRES_QUERY_PARAM: () => EXPIRES_QUERY_PARAM, - GENERATED_HEADERS: () => GENERATED_HEADERS, - HOST_HEADER: () => HOST_HEADER, - KEY_TYPE_IDENTIFIER: () => KEY_TYPE_IDENTIFIER, - MAX_CACHE_SIZE: () => MAX_CACHE_SIZE, - MAX_PRESIGNED_TTL: () => MAX_PRESIGNED_TTL, - PROXY_HEADER_PATTERN: () => PROXY_HEADER_PATTERN, - REGION_SET_PARAM: () => REGION_SET_PARAM, - SEC_HEADER_PATTERN: () => SEC_HEADER_PATTERN, - SHA256_HEADER: () => SHA256_HEADER, - SIGNATURE_HEADER: () => SIGNATURE_HEADER, - SIGNATURE_QUERY_PARAM: () => SIGNATURE_QUERY_PARAM, - SIGNED_HEADERS_QUERY_PARAM: () => SIGNED_HEADERS_QUERY_PARAM, SignatureV4: () => SignatureV4, - SignatureV4Base: () => SignatureV4Base, - TOKEN_HEADER: () => TOKEN_HEADER, - TOKEN_QUERY_PARAM: () => TOKEN_QUERY_PARAM, - UNSIGNABLE_PATTERNS: () => UNSIGNABLE_PATTERNS, - UNSIGNED_PAYLOAD: () => UNSIGNED_PAYLOAD, clearCredentialCache: () => clearCredentialCache, createScope: () => createScope, getCanonicalHeaders: () => getCanonicalHeaders, getCanonicalQuery: () => getCanonicalQuery, getPayloadHash: () => getPayloadHash, getSigningKey: () => getSigningKey, - hasHeader: () => hasHeader, moveHeadersToQuery: () => moveHeadersToQuery, - prepareRequest: () => prepareRequest, - signatureV4aContainer: () => signatureV4aContainer + prepareRequest: () => prepareRequest }); module.exports = __toCommonJS(src_exports); // src/SignatureV4.ts -var import_util_utf85 = __nccwpck_require__(41895); +var import_util_middleware = __nccwpck_require__(2390); + +var import_util_utf84 = __nccwpck_require__(41895); // src/constants.ts var ALGORITHM_QUERY_PARAM = "X-Amz-Algorithm"; @@ -241962,7 +241580,6 @@ var SIGNED_HEADERS_QUERY_PARAM = "X-Amz-SignedHeaders"; var EXPIRES_QUERY_PARAM = "X-Amz-Expires"; var SIGNATURE_QUERY_PARAM = "X-Amz-Signature"; var TOKEN_QUERY_PARAM = "X-Amz-Security-Token"; -var REGION_SET_PARAM = "X-Amz-Region-Set"; var AUTH_HEADER = "authorization"; var AMZ_DATE_HEADER = AMZ_DATE_QUERY_PARAM.toLowerCase(); var DATE_HEADER = "date"; @@ -241970,7 +241587,6 @@ var GENERATED_HEADERS = [AUTH_HEADER, AMZ_DATE_HEADER, DATE_HEADER]; var SIGNATURE_HEADER = SIGNATURE_QUERY_PARAM.toLowerCase(); var SHA256_HEADER = "x-amz-content-sha256"; var TOKEN_HEADER = TOKEN_QUERY_PARAM.toLowerCase(); -var HOST_HEADER = "host"; var ALWAYS_UNSIGNABLE_HEADERS = { authorization: true, "cache-control": true, @@ -241990,9 +241606,7 @@ var ALWAYS_UNSIGNABLE_HEADERS = { }; var PROXY_HEADER_PATTERN = /^proxy-/; var SEC_HEADER_PATTERN = /^sec-/; -var UNSIGNABLE_PATTERNS = [/^proxy-/i, /^sec-/i]; var ALGORITHM_IDENTIFIER = "AWS4-HMAC-SHA256"; -var ALGORITHM_IDENTIFIER_V4A = "AWS4-ECDSA-P256-SHA256"; var EVENT_ALGORITHM_IDENTIFIER = "AWS4-HMAC-SHA256-PAYLOAD"; var UNSIGNED_PAYLOAD = "UNSIGNED-PAYLOAD"; var MAX_CACHE_SIZE = 50; @@ -242051,6 +241665,27 @@ var getCanonicalHeaders = /* @__PURE__ */ __name(({ headers }, unsignableHeaders return canonical; }, "getCanonicalHeaders"); +// src/getCanonicalQuery.ts +var import_util_uri_escape = __nccwpck_require__(54197); +var getCanonicalQuery = /* @__PURE__ */ __name(({ query = {} }) => { + const keys = []; + const serialized = {}; + for (const key of Object.keys(query)) { + if (key.toLowerCase() === SIGNATURE_HEADER) { + continue; + } + const encodedKey = (0, import_util_uri_escape.escapeUri)(key); + keys.push(encodedKey); + const value = query[key]; + if (typeof value === "string") { + serialized[encodedKey] = `${encodedKey}=${(0, import_util_uri_escape.escapeUri)(value)}`; + } else if (Array.isArray(value)) { + serialized[encodedKey] = value.slice(0).reduce((encoded, value2) => encoded.concat([`${encodedKey}=${(0, import_util_uri_escape.escapeUri)(value2)}`]), []).sort().join("&"); + } + } + return keys.sort().map((key) => serialized[key]).filter((serialized2) => serialized2).join("&"); +}, "getCanonicalQuery"); + // src/getPayloadHash.ts var import_is_array_buffer = __nccwpck_require__(10780); @@ -242236,33 +241871,6 @@ var prepareRequest = /* @__PURE__ */ __name((request) => { return request; }, "prepareRequest"); -// src/SignatureV4Base.ts - -var import_util_middleware = __nccwpck_require__(2390); - -var import_util_utf84 = __nccwpck_require__(41895); - -// src/getCanonicalQuery.ts -var import_util_uri_escape = __nccwpck_require__(54197); -var getCanonicalQuery = /* @__PURE__ */ __name(({ query = {} }) => { - const keys = []; - const serialized = {}; - for (const key of Object.keys(query)) { - if (key.toLowerCase() === SIGNATURE_HEADER) { - continue; - } - const encodedKey = (0, import_util_uri_escape.escapeUri)(key); - keys.push(encodedKey); - const value = query[key]; - if (typeof value === "string") { - serialized[encodedKey] = `${encodedKey}=${(0, import_util_uri_escape.escapeUri)(value)}`; - } else if (Array.isArray(value)) { - serialized[encodedKey] = value.slice(0).reduce((encoded, value2) => encoded.concat([`${encodedKey}=${(0, import_util_uri_escape.escapeUri)(value2)}`]), []).sort().join("&"); - } - } - return keys.sort().map((key) => serialized[key]).filter((serialized2) => serialized2).join("&"); -}, "getCanonicalQuery"); - // src/utilDate.ts var iso8601 = /* @__PURE__ */ __name((time) => toDate(time).toISOString().replace(/\.\d{3}Z$/, "Z"), "iso8601"); var toDate = /* @__PURE__ */ __name((time) => { @@ -242278,11 +241886,8 @@ var toDate = /* @__PURE__ */ __name((time) => { return time; }, "toDate"); -// src/SignatureV4Base.ts -var SignatureV4Base = class { - static { - __name(this, "SignatureV4Base"); - } +// src/SignatureV4.ts +var SignatureV4 = class { constructor({ applyChecksum, credentials, @@ -242291,6 +241896,7 @@ var SignatureV4Base = class { sha256, uriEscapePath = true }) { + this.headerFormatter = new HeaderFormatter(); this.service = service; this.sha256 = sha256; this.uriEscapePath = uriEscapePath; @@ -242298,84 +241904,6 @@ var SignatureV4Base = class { this.regionProvider = (0, import_util_middleware.normalizeProvider)(region); this.credentialProvider = (0, import_util_middleware.normalizeProvider)(credentials); } - createCanonicalRequest(request, canonicalHeaders, payloadHash) { - const sortedHeaders = Object.keys(canonicalHeaders).sort(); - return `${request.method} -${this.getCanonicalPath(request)} -${getCanonicalQuery(request)} -${sortedHeaders.map((name) => `${name}:${canonicalHeaders[name]}`).join("\n")} - -${sortedHeaders.join(";")} -${payloadHash}`; - } - async createStringToSign(longDate, credentialScope, canonicalRequest, algorithmIdentifier) { - const hash = new this.sha256(); - hash.update((0, import_util_utf84.toUint8Array)(canonicalRequest)); - const hashedRequest = await hash.digest(); - return `${algorithmIdentifier} -${longDate} -${credentialScope} -${(0, import_util_hex_encoding.toHex)(hashedRequest)}`; - } - getCanonicalPath({ path }) { - if (this.uriEscapePath) { - const normalizedPathSegments = []; - for (const pathSegment of path.split("/")) { - if (pathSegment?.length === 0) - continue; - if (pathSegment === ".") - continue; - if (pathSegment === "..") { - normalizedPathSegments.pop(); - } else { - normalizedPathSegments.push(pathSegment); - } - } - 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, "/"); - } - return path; - } - validateResolvedCredentials(credentials) { - if (typeof credentials !== "object" || // @ts-expect-error: Property 'accessKeyId' does not exist on type 'object'.ts(2339) - typeof credentials.accessKeyId !== "string" || // @ts-expect-error: Property 'secretAccessKey' does not exist on type 'object'.ts(2339) - typeof credentials.secretAccessKey !== "string") { - throw new Error("Resolved credential object is not valid"); - } - } - formatDate(now) { - const longDate = iso8601(now).replace(/[\-:]/g, ""); - return { - longDate, - shortDate: longDate.slice(0, 8) - }; - } - getCanonicalHeaderList(headers) { - return Object.keys(headers).sort().join(";"); - } -}; - -// src/SignatureV4.ts -var SignatureV4 = class extends SignatureV4Base { - constructor({ - applyChecksum, - credentials, - region, - service, - sha256, - uriEscapePath = true - }) { - super({ - applyChecksum, - credentials, - region, - service, - sha256, - uriEscapePath - }); - this.headerFormatter = new HeaderFormatter(); - } static { __name(this, "SignatureV4"); } @@ -242393,7 +241921,7 @@ var SignatureV4 = class extends SignatureV4Base { const credentials = await this.credentialProvider(); this.validateResolvedCredentials(credentials); const region = signingRegion ?? await this.regionProvider(); - const { longDate, shortDate } = this.formatDate(signingDate); + const { longDate, shortDate } = formatDate(signingDate); if (expiresIn > MAX_PRESIGNED_TTL) { return Promise.reject( "Signature version 4 presigned URLs must have an expiration date less than one week in the future" @@ -242409,7 +241937,7 @@ var SignatureV4 = class extends SignatureV4Base { request.query[AMZ_DATE_QUERY_PARAM] = longDate; request.query[EXPIRES_QUERY_PARAM] = expiresIn.toString(10); const canonicalHeaders = getCanonicalHeaders(request, unsignableHeaders, signableHeaders); - request.query[SIGNED_HEADERS_QUERY_PARAM] = this.getCanonicalHeaderList(canonicalHeaders); + request.query[SIGNED_HEADERS_QUERY_PARAM] = getCanonicalHeaderList(canonicalHeaders); request.query[SIGNATURE_QUERY_PARAM] = await this.getSignature( longDate, scope, @@ -242431,7 +241959,7 @@ var SignatureV4 = class extends SignatureV4Base { } async signEvent({ headers, payload }, { signingDate = /* @__PURE__ */ new Date(), priorSignature, signingRegion, signingService }) { const region = signingRegion ?? await this.regionProvider(); - const { shortDate, longDate } = this.formatDate(signingDate); + const { shortDate, longDate } = formatDate(signingDate); const scope = createScope(shortDate, region, signingService ?? this.service); const hashedPayload = await getPayloadHash({ headers: {}, body: payload }, this.sha256); const hash = new this.sha256(); @@ -242468,9 +241996,9 @@ var SignatureV4 = class extends SignatureV4Base { const credentials = await this.credentialProvider(); this.validateResolvedCredentials(credentials); const region = signingRegion ?? await this.regionProvider(); - const { shortDate } = this.formatDate(signingDate); + const { shortDate } = formatDate(signingDate); const hash = new this.sha256(await this.getSigningKey(credentials, region, shortDate, signingService)); - hash.update((0, import_util_utf85.toUint8Array)(stringToSign)); + hash.update((0, import_util_utf84.toUint8Array)(stringToSign)); return (0, import_util_hex_encoding.toHex)(await hash.digest()); } async signRequest(requestToSign, { @@ -242484,7 +242012,7 @@ var SignatureV4 = class extends SignatureV4Base { this.validateResolvedCredentials(credentials); const region = signingRegion ?? await this.regionProvider(); const request = prepareRequest(requestToSign); - const { longDate, shortDate } = this.formatDate(signingDate); + const { longDate, shortDate } = formatDate(signingDate); const scope = createScope(shortDate, region, signingService ?? this.service); request.headers[AMZ_DATE_HEADER] = longDate; if (credentials.sessionToken) { @@ -242501,29 +242029,73 @@ var SignatureV4 = class extends SignatureV4Base { this.getSigningKey(credentials, region, shortDate, signingService), this.createCanonicalRequest(request, canonicalHeaders, payloadHash) ); - request.headers[AUTH_HEADER] = `${ALGORITHM_IDENTIFIER} Credential=${credentials.accessKeyId}/${scope}, SignedHeaders=${this.getCanonicalHeaderList(canonicalHeaders)}, Signature=${signature}`; + request.headers[AUTH_HEADER] = `${ALGORITHM_IDENTIFIER} Credential=${credentials.accessKeyId}/${scope}, SignedHeaders=${getCanonicalHeaderList(canonicalHeaders)}, Signature=${signature}`; return request; } + createCanonicalRequest(request, canonicalHeaders, payloadHash) { + const sortedHeaders = Object.keys(canonicalHeaders).sort(); + return `${request.method} +${this.getCanonicalPath(request)} +${getCanonicalQuery(request)} +${sortedHeaders.map((name) => `${name}:${canonicalHeaders[name]}`).join("\n")} + +${sortedHeaders.join(";")} +${payloadHash}`; + } + async createStringToSign(longDate, credentialScope, canonicalRequest) { + const hash = new this.sha256(); + hash.update((0, import_util_utf84.toUint8Array)(canonicalRequest)); + const hashedRequest = await hash.digest(); + return `${ALGORITHM_IDENTIFIER} +${longDate} +${credentialScope} +${(0, import_util_hex_encoding.toHex)(hashedRequest)}`; + } + getCanonicalPath({ path }) { + if (this.uriEscapePath) { + const normalizedPathSegments = []; + for (const pathSegment of path.split("/")) { + if (pathSegment?.length === 0) + continue; + if (pathSegment === ".") + continue; + if (pathSegment === "..") { + normalizedPathSegments.pop(); + } else { + normalizedPathSegments.push(pathSegment); + } + } + 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, "/"); + } + return path; + } async getSignature(longDate, credentialScope, keyPromise, canonicalRequest) { - const stringToSign = await this.createStringToSign( - longDate, - credentialScope, - canonicalRequest, - ALGORITHM_IDENTIFIER - ); + const stringToSign = await this.createStringToSign(longDate, credentialScope, canonicalRequest); const hash = new this.sha256(await keyPromise); - hash.update((0, import_util_utf85.toUint8Array)(stringToSign)); + hash.update((0, import_util_utf84.toUint8Array)(stringToSign)); return (0, import_util_hex_encoding.toHex)(await hash.digest()); } getSigningKey(credentials, region, shortDate, service) { return getSigningKey(this.sha256, credentials, shortDate, region, service || this.service); } + validateResolvedCredentials(credentials) { + if (typeof credentials !== "object" || // @ts-expect-error: Property 'accessKeyId' does not exist on type 'object'.ts(2339) + typeof credentials.accessKeyId !== "string" || // @ts-expect-error: Property 'secretAccessKey' does not exist on type 'object'.ts(2339) + typeof credentials.secretAccessKey !== "string") { + throw new Error("Resolved credential object is not valid"); + } + } }; - -// src/signature-v4a-container.ts -var signatureV4aContainer = { - SignatureV4a: null -}; +var formatDate = /* @__PURE__ */ __name((now) => { + const longDate = iso8601(now).replace(/[\-:]/g, ""); + return { + longDate, + shortDate: longDate.slice(0, 8) + }; +}, "formatDate"); +var getCanonicalHeaderList = /* @__PURE__ */ __name((headers) => Object.keys(headers).sort().join(";"), "getCanonicalHeaderList"); // Annotate the CommonJS export names for ESM import in node: 0 && (0); @@ -253558,7 +253130,7 @@ var crypto = __nccwpck_require__(6113) * Valid keys. */ -var keys = +var keys = [ 'acl' , 'location' , 'logging' @@ -253597,7 +253169,7 @@ module.exports.authorization = authorization * @param {Object} options * @return {String} * @api private - */ + */ function hmacSha1 (options) { return crypto.createHmac('sha1', options.secret).update(options.message).digest('base64') @@ -253606,8 +253178,8 @@ function hmacSha1 (options) { module.exports.hmacSha1 = hmacSha1 /** - * Create a base64 sha1 HMAC for `options`. - * + * Create a base64 sha1 HMAC for `options`. + * * @param {Object} options * @return {String} * @api private @@ -253620,10 +253192,10 @@ function sign (options) { module.exports.sign = sign /** - * Create a base64 sha1 HMAC for `options`. + * Create a base64 sha1 HMAC for `options`. * * Specifically to be used with S3 presigned URLs - * + * * @param {Object} options * @return {String} * @api private @@ -253639,7 +253211,7 @@ module.exports.signQuery= signQuery * Return a string for sign() with the given `options`. * * Spec: - * + * * \n * \n * \n @@ -253655,7 +253227,7 @@ module.exports.signQuery= signQuery function stringToSign (options) { var headers = options.amazonHeaders || '' if (headers) headers += '\n' - var r = + var r = [ options.verb , options.md5 , options.contentType @@ -253671,7 +253243,7 @@ module.exports.stringToSign = stringToSign * for S3 presigned URLs * * Spec: - * + * * \n * * @@ -255442,10 +255014,10 @@ function expand(str, isTop) { // 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 @@ -255523,7 +255095,7 @@ util.inherits(LineStream, stream.Transform); LineStream.prototype._transform = function(chunk, encoding, done) { // decode binary chunks as UTF-8 encoding = encoding || 'utf8'; - + if (Buffer.isBuffer(chunk)) { if (encoding == 'buffer') { chunk = chunk.toString(); // utf8 @@ -255534,15 +255106,15 @@ LineStream.prototype._transform = function(chunk, encoding, done) { } } this._chunkEncoding = encoding; - + // see: http://www.unicode.org/reports/tr18/#Line_Boundaries var lines = chunk.split(/\r\n|[\n\v\f\r\x85\u2028\u2029]/g); - + // don't split CRLF which spans chunks if (this._lastChunkEndedWithCR && chunk[0] == '\n') { lines.shift(); } - + if (this._lineBuffer.length > 0) { this._lineBuffer[this._lineBuffer.length - 1] += lines[0]; lines.shift(); @@ -258488,11 +258060,11 @@ exports.ECKey = function(curve, key, isPublic) // var y = key.slice(bytes+1); // this.P = new ECPointFp(curve, // curve.fromBigInteger(new BigInteger(x.toString("hex"), 16)), -// curve.fromBigInteger(new BigInteger(y.toString("hex"), 16))); +// curve.fromBigInteger(new BigInteger(y.toString("hex"), 16))); this.P = curve.decodePointHex(key.toString("hex")); }else{ if(key.length != bytes) return false; - priv = new BigInteger(key.toString("hex"), 16); + priv = new BigInteger(key.toString("hex"), 16); } }else{ var n1 = n.subtract(BigInteger.ONE); @@ -258514,7 +258086,7 @@ exports.ECKey = function(curve, key, isPublic) if(!key || !key.P) return false; var S = key.P.multiply(priv); return Buffer.from(unstupid(S.getX().toBigInteger().toString(16),bytes*2),"hex"); - } + } } } @@ -258961,7 +258533,7 @@ ECFieldElementFp.prototype.modReduce = function(x) { u = u.multiply(this.getR()); } - x = u.add(v); + x = u.add(v); } while (x.compareTo(q) >= 0) { @@ -259932,7 +259504,7 @@ exports.validate = function (xmlData, options) { // check for byte order mark (BOM) xmlData = xmlData.substr(1); } - + for (let i = 0; i < xmlData.length; i++) { if (xmlData[i] === '<' && xmlData[i+1] === '?') { @@ -259944,7 +259516,7 @@ exports.validate = function (xmlData, options) { //read until you reach to '>' avoiding any '>' in attribute value let tagStartPos = i; i++; - + if (xmlData[i] === '!') { i = readCommentAndCDATA(xmlData, i); continue; @@ -260532,12 +260104,12 @@ Builder.prototype.buildObjectNode = function(val, key, attrStr, level) { let tagEndExp = '' + val + tagEndExp ); @@ -260582,11 +260154,11 @@ Builder.prototype.buildTextValNode = function(val, key, attrStr, level) { }else if (this.options.commentPropName !== false && key === this.options.commentPropName) { return this.indentate(level) + `` + this.newLine; }else if(key[0] === "?") {//PI tag - return this.indentate(level) + '<' + key + attrStr+ '?' + this.tagEndChar; + return this.indentate(level) + '<' + key + attrStr+ '?' + this.tagEndChar; }else{ let textValue = this.options.tagValueProcessor(key, val); textValue = this.replaceEntitiesValue(textValue); - + if( textValue === ''){ return this.indentate(level) + '<' + key + attrStr + this.closeTag(key) + this.tagEndChar; }else{ @@ -260630,10 +260202,10 @@ module.exports = Builder; const EOL = "\n"; /** - * - * @param {array} jArray - * @param {any} options - * @returns + * + * @param {array} jArray + * @param {any} options + * @returns */ function toXml(jArray, options) { let indentation = ""; @@ -260773,7 +260345,7 @@ const util = __nccwpck_require__(38280); //TODO: handle comments function readDocType(xmlData, i){ - + const entities = {}; if( xmlData[i + 3] === 'O' && xmlData[i + 4] === 'C' && @@ -260781,7 +260353,7 @@ function readDocType(xmlData, i){ xmlData[i + 6] === 'Y' && xmlData[i + 7] === 'P' && xmlData[i + 8] === 'E') - { + { i = i+9; let angleBracketsCount = 1; let hasBody = false, comment = false; @@ -260789,7 +260361,7 @@ function readDocType(xmlData, i){ for(;i - + //read EntityName let entityName = ""; for (; i < xmlData.length && (xmlData[i] !== "'" && xmlData[i] !== '"' ); i++) { // if(xmlData[i] === " ") continue; - // else + // else entityName += xmlData[i]; } entityName = entityName.trim(); @@ -260969,7 +260541,7 @@ const defaultOptions = { }, // skipEmptyListItem: false }; - + const buildOptions = function(options) { return Object.assign({}, defaultOptions, options); }; @@ -261069,7 +260641,7 @@ function parseTextData(val, tagName, jPath, dontTrim, hasAttributes, isLeafNode, } if(val.length > 0){ if(!escapeEntities) val = this.replaceEntitiesValue(val); - + const newval = this.options.tagValueProcessor(tagName, val, jPath, hasAttributes, isLeafNode); if(newval === null || newval === undefined){ //don't parse @@ -261219,10 +260791,10 @@ const parseXml = function(xmlData) { if( (this.options.ignoreDeclaration && tagData.tagName === "?xml") || this.options.ignorePiTags){ }else{ - + const childNode = new xmlNode(tagData.tagName); childNode.add(this.options.textNodeName, ""); - + if(tagData.tagName !== tagData.tagExp && tagData.attrExpPresent){ childNode[":@"] = this.buildAttributesMap(tagData.tagExp, jPath, tagData.tagName); } @@ -261261,7 +260833,7 @@ const parseXml = function(xmlData) { }else{ currentNode.add(this.options.textNodeName, val); } - + i = closeIndex + 2; }else {//Opening tag let result = readTagExp(xmlData,i, this.options.removeNSPrefix); @@ -261274,7 +260846,7 @@ const parseXml = function(xmlData) { if (this.options.transformTagName) { tagName = this.options.transformTagName(tagName); } - + //save text as child node if (currentNode && textData) { if(currentNode.tagname !== '!xml'){ @@ -261307,7 +260879,7 @@ const parseXml = function(xmlData) { } //unpaired tag else if(this.options.unpairedTags.indexOf(tagName) !== -1){ - + i = result.closeIndex; } //normal tag @@ -261326,10 +260898,10 @@ const parseXml = function(xmlData) { if(tagContent) { tagContent = this.parseTextData(tagContent, tagName, jPath, true, attrExpPresent, true, true); } - + jPath = jPath.substr(0, jPath.lastIndexOf(".")); childNode.add(this.options.textNodeName, tagContent); - + this.addChild(currentNode, childNode, jPath) }else{ //selfClosing tag @@ -261341,7 +260913,7 @@ const parseXml = function(xmlData) { }else{ tagExp = tagExp.substr(0, tagExp.length - 1); } - + if(this.options.transformTagName) { tagName = this.options.transformTagName(tagName); } @@ -261357,7 +260929,7 @@ const parseXml = function(xmlData) { else{ const childNode = new xmlNode( tagName); this.tagsNodeStack.push(currentNode); - + if(tagName !== tagExp && attrExpPresent){ childNode[":@"] = this.buildAttributesMap(tagExp, jPath, tagName); } @@ -261410,7 +260982,7 @@ const replaceEntitiesValue = function(val){ function saveTextToParentTag(textData, currentNode, jPath, isLeafNode) { if (textData) { //store previously collected data as textNode if(isLeafNode === undefined) isLeafNode = Object.keys(currentNode.child).length === 0 - + textData = this.parseTextData(textData, currentNode.tagname, jPath, @@ -261427,10 +260999,10 @@ function saveTextToParentTag(textData, currentNode, jPath, isLeafNode) { //TODO: use jPath to simplify the logic /** - * - * @param {string[]} stopNodes + * + * @param {string[]} stopNodes * @param {string} jPath - * @param {string} currentTagName + * @param {string} currentTagName */ function isItStopNode(stopNodes, jPath, currentTagName){ const allNodesExp = "*." + currentTagName; @@ -261443,9 +261015,9 @@ function isItStopNode(stopNodes, jPath, currentTagName){ /** * Returns the tag Expression and where it is ending handling single-double quotes situation - * @param {string} xmlData + * @param {string} xmlData * @param {number} i starting index - * @returns + * @returns */ function tagExpWithClosingIndex(xmlData, i, closingChar = ">"){ let attrBoundary; @@ -261518,9 +261090,9 @@ function readTagExp(xmlData,i, removeNSPrefix, closingChar = ">"){ } /** * find paired tag for a stop node - * @param {string} xmlData - * @param {string} tagName - * @param {number} i + * @param {string} xmlData + * @param {string} tagName + * @param {number} i */ function readStopNodeData(xmlData, tagName, i){ const startIndex = i; @@ -261528,7 +261100,7 @@ function readStopNodeData(xmlData, tagName, i){ let openTagCount = 1; for (; i < xmlData.length; i++) { - if( xmlData[i] === "<"){ + if( xmlData[i] === "<"){ if (xmlData[i+1] === "/") {//close tag const closeIndex = findClosingIndex(xmlData, ">", i, `${tagName} is not closed`); let closeTagName = xmlData.substring(i+2,closeIndex).trim(); @@ -261542,13 +261114,13 @@ function readStopNodeData(xmlData, tagName, i){ } } i=closeIndex; - } else if(xmlData[i+1] === '?') { + } else if(xmlData[i+1] === '?') { const closeIndex = findClosingIndex(xmlData, "?>", i+1, "StopNode is not closed.") i=closeIndex; - } else if(xmlData.substr(i + 1, 3) === '!--') { + } else if(xmlData.substr(i + 1, 3) === '!--') { const closeIndex = findClosingIndex(xmlData, "-->", i+3, "StopNode is not closed.") i=closeIndex; - } else if(xmlData.substr(i + 1, 2) === '![') { + } else if(xmlData.substr(i + 1, 2) === '![') { const closeIndex = findClosingIndex(xmlData, "]]>", i, "StopNode is not closed.") - 2; i=closeIndex; } else { @@ -261597,16 +261169,16 @@ const { prettify} = __nccwpck_require__(42882); const validator = __nccwpck_require__(61739); class XMLParser{ - + constructor(options){ this.externalEntities = {}; this.options = buildOptions(options); - + } /** - * Parse XML dats to JS object - * @param {string|Buffer} xmlData - * @param {boolean|Object} validationOption + * Parse XML dats to JS object + * @param {string|Buffer} xmlData + * @param {boolean|Object} validationOption */ parse(xmlData,validationOption){ if(typeof xmlData === "string"){ @@ -261617,7 +261189,7 @@ class XMLParser{ } if( validationOption){ if(validationOption === true) validationOption = {}; //validate with default options - + const result = validator.validate(xmlData, validationOption); if (result !== true) { throw Error( `${result.err.msg}:${result.err.line}:${result.err.col}` ) @@ -261632,8 +261204,8 @@ class XMLParser{ /** * Add Entity which is not by default supported by this library - * @param {string} key - * @param {string} value + * @param {string} key + * @param {string} value */ addEntity(key, value){ if(value.indexOf("&") !== -1){ @@ -261659,20 +261231,20 @@ module.exports = XMLParser; /** - * - * @param {array} node - * @param {any} options - * @returns + * + * @param {array} node + * @param {any} options + * @returns */ function prettify(node, options){ return compress( node, options); } /** - * - * @param {array} arr - * @param {object} options - * @param {string} jPath + * + * @param {array} arr + * @param {object} options + * @param {string} jPath * @returns object */ function compress(arr, options, jPath){ @@ -261691,7 +261263,7 @@ function compress(arr, options, jPath){ }else if(property === undefined){ continue; }else if(tagObj[property]){ - + let val = compress(tagObj[property], options, newJpath); const isLeaf = isLeafTag(val, options); @@ -261719,7 +261291,7 @@ function compress(arr, options, jPath){ } } } - + } // if(text && text.length > 0) compressedObj[options.textNodeName] = text; if(typeof text === "string"){ @@ -261754,7 +261326,7 @@ function assignAttributes(obj, attrMap, jpath, options){ function isLeafTag(obj, options){ const { textNodeName } = options; const propCount = Object.keys(obj).length; - + if (propCount === 0) { return true; } @@ -261816,8 +261388,8 @@ var util = __nccwpck_require__(73837) , net = __nccwpck_require__(41808) , tls = __nccwpck_require__(24404) , AgentSSL = (__nccwpck_require__(95687).Agent) - -function getConnectionName(host, port) { + +function getConnectionName(host, port) { var name = '' if (typeof host === 'string') { name = host + ':' + port @@ -261826,7 +261398,7 @@ function getConnectionName(host, port) { name = host.host + ':' + host.port + ':' + (host.localAddress ? (host.localAddress + ':') : ':') } return name -} +} function ForeverAgent(options) { var self = this @@ -261844,7 +261416,7 @@ function ForeverAgent(options) { } else if (self.sockets[name].length < self.minSockets) { if (!self.freeSockets[name]) self.freeSockets[name] = [] self.freeSockets[name].push(socket) - + // if an error happens while we don't use the socket anyway, meh, throw the socket away var onIdleError = function() { socket.destroy() @@ -261870,7 +261442,7 @@ ForeverAgent.prototype.createConnection = net.createConnection ForeverAgent.prototype.addRequestNoreuse = Agent.prototype.addRequest ForeverAgent.prototype.addRequest = function(req, host, port) { var name = getConnectionName(host, port) - + if (typeof host !== 'string') { var options = host port = options.port @@ -261899,7 +261471,7 @@ ForeverAgent.prototype.removeSocket = function(s, name, host, port) { delete this.sockets[name] delete this.requests[name] } - + if (this.freeSockets[name]) { var index = this.freeSockets[name].indexOf(s) if (index !== -1) { @@ -268378,7 +267950,7 @@ exports.parse = function (s) { if(/^:base64:/.test(value)) return Buffer.from(value.substring(8), 'base64') else - return /^:/.test(value) ? value.substring(1) : value + return /^:/.test(value) ? value.substring(1) : value } return value }) @@ -269173,7 +268745,7 @@ const understoodStatuses = new Set([ const errorStatusCodes = new Set([ 500, 502, - 503, + 503, 504, ]); @@ -278985,8 +278557,8 @@ var validate = exports._validate = function(/*Any*/instance,/*Object*/schema,/*O if(typeof instance != 'object' || instance instanceof Array){ errors.push({property:path,message:"an object is required"}); } - - for(var i in objTypeDef){ + + for(var i in objTypeDef){ if(objTypeDef.hasOwnProperty(i) && i != '__proto__' && i != 'constructor'){ var value = instance.hasOwnProperty(i) ? instance[i] : undefined; // skip _not_ specified properties @@ -287962,7 +287534,7 @@ function compare (a, b) { } function generateBase (httpMethod, base_uri, params) { - // adapted from https://dev.twitter.com/docs/auth/oauth and + // adapted from https://dev.twitter.com/docs/auth/oauth and // https://dev.twitter.com/docs/auth/creating-signature // Parameter normalization @@ -295751,6 +295323,1578 @@ if (!safer.constants) { module.exports = safer +/***/ }), + +/***/ 72043: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +;(function (sax) { // wrapper for non-node envs + sax.parser = function (strict, opt) { return new SAXParser(strict, opt) } + sax.SAXParser = SAXParser + sax.SAXStream = SAXStream + sax.createStream = createStream + + // When we pass the MAX_BUFFER_LENGTH position, start checking for buffer overruns. + // When we check, schedule the next check for MAX_BUFFER_LENGTH - (max(buffer lengths)), + // since that's the earliest that a buffer overrun could occur. This way, checks are + // as rare as required, but as often as necessary to ensure never crossing this bound. + // Furthermore, buffers are only tested at most once per write(), so passing a very + // large string into write() might have undesirable effects, but this is manageable by + // the caller, so it is assumed to be safe. Thus, a call to write() may, in the extreme + // edge case, result in creating at most one complete copy of the string passed in. + // Set to Infinity to have unlimited buffers. + sax.MAX_BUFFER_LENGTH = 64 * 1024 + + var buffers = [ + 'comment', 'sgmlDecl', 'textNode', 'tagName', 'doctype', + 'procInstName', 'procInstBody', 'entity', 'attribName', + 'attribValue', 'cdata', 'script' + ] + + sax.EVENTS = [ + 'text', + 'processinginstruction', + 'sgmldeclaration', + 'doctype', + 'comment', + 'opentagstart', + 'attribute', + 'opentag', + 'closetag', + 'opencdata', + 'cdata', + 'closecdata', + 'error', + 'end', + 'ready', + 'script', + 'opennamespace', + 'closenamespace' + ] + + function SAXParser (strict, opt) { + if (!(this instanceof SAXParser)) { + return new SAXParser(strict, opt) + } + + var parser = this + clearBuffers(parser) + parser.q = parser.c = '' + parser.bufferCheckPosition = sax.MAX_BUFFER_LENGTH + parser.opt = opt || {} + parser.opt.lowercase = parser.opt.lowercase || parser.opt.lowercasetags + parser.looseCase = parser.opt.lowercase ? 'toLowerCase' : 'toUpperCase' + parser.tags = [] + parser.closed = parser.closedRoot = parser.sawRoot = false + parser.tag = parser.error = null + parser.strict = !!strict + parser.noscript = !!(strict || parser.opt.noscript) + parser.state = S.BEGIN + parser.strictEntities = parser.opt.strictEntities + parser.ENTITIES = parser.strictEntities ? Object.create(sax.XML_ENTITIES) : Object.create(sax.ENTITIES) + parser.attribList = [] + + // namespaces form a prototype chain. + // it always points at the current tag, + // which protos to its parent tag. + if (parser.opt.xmlns) { + parser.ns = Object.create(rootNS) + } + + // mostly just for error reporting + parser.trackPosition = parser.opt.position !== false + if (parser.trackPosition) { + parser.position = parser.line = parser.column = 0 + } + emit(parser, 'onready') + } + + if (!Object.create) { + Object.create = function (o) { + function F () {} + F.prototype = o + var newf = new F() + return newf + } + } + + if (!Object.keys) { + Object.keys = function (o) { + var a = [] + for (var i in o) if (o.hasOwnProperty(i)) a.push(i) + return a + } + } + + function checkBufferLength (parser) { + var maxAllowed = Math.max(sax.MAX_BUFFER_LENGTH, 10) + var maxActual = 0 + for (var i = 0, l = buffers.length; i < l; i++) { + var len = parser[buffers[i]].length + if (len > maxAllowed) { + // Text/cdata nodes can get big, and since they're buffered, + // we can get here under normal conditions. + // Avoid issues by emitting the text node now, + // so at least it won't get any bigger. + switch (buffers[i]) { + case 'textNode': + closeText(parser) + break + + case 'cdata': + emitNode(parser, 'oncdata', parser.cdata) + parser.cdata = '' + break + + case 'script': + emitNode(parser, 'onscript', parser.script) + parser.script = '' + break + + default: + error(parser, 'Max buffer length exceeded: ' + buffers[i]) + } + } + maxActual = Math.max(maxActual, len) + } + // schedule the next check for the earliest possible buffer overrun. + var m = sax.MAX_BUFFER_LENGTH - maxActual + parser.bufferCheckPosition = m + parser.position + } + + function clearBuffers (parser) { + for (var i = 0, l = buffers.length; i < l; i++) { + parser[buffers[i]] = '' + } + } + + function flushBuffers (parser) { + closeText(parser) + if (parser.cdata !== '') { + emitNode(parser, 'oncdata', parser.cdata) + parser.cdata = '' + } + if (parser.script !== '') { + emitNode(parser, 'onscript', parser.script) + parser.script = '' + } + } + + SAXParser.prototype = { + end: function () { end(this) }, + write: write, + resume: function () { this.error = null; return this }, + close: function () { return this.write(null) }, + flush: function () { flushBuffers(this) } + } + + var Stream + try { + Stream = (__nccwpck_require__(12781).Stream) + } catch (ex) { + Stream = function () {} + } + + var streamWraps = sax.EVENTS.filter(function (ev) { + return ev !== 'error' && ev !== 'end' + }) + + function createStream (strict, opt) { + return new SAXStream(strict, opt) + } + + function SAXStream (strict, opt) { + if (!(this instanceof SAXStream)) { + return new SAXStream(strict, opt) + } + + Stream.apply(this) + + this._parser = new SAXParser(strict, opt) + this.writable = true + this.readable = true + + var me = this + + this._parser.onend = function () { + me.emit('end') + } + + this._parser.onerror = function (er) { + me.emit('error', er) + + // if didn't throw, then means error was handled. + // go ahead and clear error, so we can write again. + me._parser.error = null + } + + this._decoder = null + + streamWraps.forEach(function (ev) { + Object.defineProperty(me, 'on' + ev, { + get: function () { + return me._parser['on' + ev] + }, + set: function (h) { + if (!h) { + me.removeAllListeners(ev) + me._parser['on' + ev] = h + return h + } + me.on(ev, h) + }, + enumerable: true, + configurable: false + }) + }) + } + + SAXStream.prototype = Object.create(Stream.prototype, { + constructor: { + value: SAXStream + } + }) + + SAXStream.prototype.write = function (data) { + if (typeof Buffer === 'function' && + typeof Buffer.isBuffer === 'function' && + Buffer.isBuffer(data)) { + if (!this._decoder) { + var SD = (__nccwpck_require__(71576).StringDecoder) + this._decoder = new SD('utf8') + } + data = this._decoder.write(data) + } + + this._parser.write(data.toString()) + this.emit('data', data) + return true + } + + SAXStream.prototype.end = function (chunk) { + if (chunk && chunk.length) { + this.write(chunk) + } + this._parser.end() + return true + } + + SAXStream.prototype.on = function (ev, handler) { + var me = this + if (!me._parser['on' + ev] && streamWraps.indexOf(ev) !== -1) { + me._parser['on' + ev] = function () { + var args = arguments.length === 1 ? [arguments[0]] : Array.apply(null, arguments) + args.splice(0, 0, ev) + me.emit.apply(me, args) + } + } + + return Stream.prototype.on.call(me, ev, handler) + } + + // this really needs to be replaced with character classes. + // XML allows all manner of ridiculous numbers and digits. + var CDATA = '[CDATA[' + var DOCTYPE = 'DOCTYPE' + var XML_NAMESPACE = 'http://www.w3.org/XML/1998/namespace' + var XMLNS_NAMESPACE = 'http://www.w3.org/2000/xmlns/' + var rootNS = { xml: XML_NAMESPACE, xmlns: XMLNS_NAMESPACE } + + // http://www.w3.org/TR/REC-xml/#NT-NameStartChar + // This implementation works on strings, a single character at a time + // as such, it cannot ever support astral-plane characters (10000-EFFFF) + // without a significant breaking change to either this parser, or the + // JavaScript language. Implementation of an emoji-capable xml parser + // is left as an exercise for the reader. + var nameStart = /[:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/ + + var nameBody = /[:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\u00B7\u0300-\u036F\u203F-\u2040.\d-]/ + + var entityStart = /[#:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/ + var entityBody = /[#:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\u00B7\u0300-\u036F\u203F-\u2040.\d-]/ + + function isWhitespace (c) { + return c === ' ' || c === '\n' || c === '\r' || c === '\t' + } + + function isQuote (c) { + return c === '"' || c === '\'' + } + + function isAttribEnd (c) { + return c === '>' || isWhitespace(c) + } + + function isMatch (regex, c) { + return regex.test(c) + } + + function notMatch (regex, c) { + return !isMatch(regex, c) + } + + var S = 0 + sax.STATE = { + BEGIN: S++, // leading byte order mark or whitespace + BEGIN_WHITESPACE: S++, // leading whitespace + TEXT: S++, // general stuff + TEXT_ENTITY: S++, // & and such. + OPEN_WAKA: S++, // < + SGML_DECL: S++, // + SCRIPT: S++, //