@aws-sdk/middleware-location-constraint
Advanced tools
Comparing version 3.186.0 to 3.188.0
@@ -6,2 +6,10 @@ # Change Log | ||
# [3.188.0](https://github.com/aws/aws-sdk-js-v3/compare/v3.187.0...v3.188.0) (2022-10-13) | ||
**Note:** Version bump only for package @aws-sdk/middleware-location-constraint | ||
# [3.186.0](https://github.com/aws/aws-sdk-js-v3/compare/v3.185.0...v3.186.0) (2022-10-06) | ||
@@ -8,0 +16,0 @@ |
@@ -1,4 +0,3 @@ | ||
import { __assign } from "tslib"; | ||
export function resolveLocationConstraintConfig(input) { | ||
return __assign({}, input); | ||
return { ...input }; | ||
} |
@@ -1,24 +0,18 @@ | ||
import { __assign, __awaiter, __generator } from "tslib"; | ||
export function locationConstraintMiddleware(options) { | ||
var _this = this; | ||
return function (next) { | ||
return function (args) { return __awaiter(_this, void 0, void 0, function () { | ||
var CreateBucketConfiguration, region; | ||
return __generator(this, function (_a) { | ||
switch (_a.label) { | ||
case 0: | ||
CreateBucketConfiguration = args.input.CreateBucketConfiguration; | ||
return [4, options.region()]; | ||
case 1: | ||
region = _a.sent(); | ||
if (!CreateBucketConfiguration || !CreateBucketConfiguration.LocationConstraint) { | ||
args = __assign(__assign({}, args), { input: __assign(__assign({}, args.input), { CreateBucketConfiguration: region === "us-east-1" ? undefined : { LocationConstraint: region } }) }); | ||
} | ||
return [2, next(args)]; | ||
} | ||
}); | ||
}); }; | ||
return (next) => async (args) => { | ||
const { CreateBucketConfiguration } = args.input; | ||
const region = await options.region(); | ||
if (!CreateBucketConfiguration || !CreateBucketConfiguration.LocationConstraint) { | ||
args = { | ||
...args, | ||
input: { | ||
...args.input, | ||
CreateBucketConfiguration: region === "us-east-1" ? undefined : { LocationConstraint: region }, | ||
}, | ||
}; | ||
} | ||
return next(args); | ||
}; | ||
} | ||
export var locationConstraintMiddlewareOptions = { | ||
export const locationConstraintMiddlewareOptions = { | ||
step: "initialize", | ||
@@ -29,6 +23,6 @@ tags: ["LOCATION_CONSTRAINT", "CREATE_BUCKET_CONFIGURATION"], | ||
}; | ||
export var getLocationConstraintPlugin = function (config) { return ({ | ||
applyToStack: function (clientStack) { | ||
export const getLocationConstraintPlugin = (config) => ({ | ||
applyToStack: (clientStack) => { | ||
clientStack.add(locationConstraintMiddleware(config), locationConstraintMiddlewareOptions); | ||
}, | ||
}); }; | ||
}); |
{ | ||
"name": "@aws-sdk/middleware-location-constraint", | ||
"version": "3.186.0", | ||
"version": "3.188.0", | ||
"scripts": { | ||
@@ -23,3 +23,3 @@ "build": "concurrently 'yarn:build:cjs' 'yarn:build:es' 'yarn:build:types'", | ||
"dependencies": { | ||
"@aws-sdk/types": "3.186.0", | ||
"@aws-sdk/types": "3.188.0", | ||
"tslib": "^2.3.1" | ||
@@ -26,0 +26,0 @@ }, |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
49754
118
+ Added@aws-sdk/types@3.188.0(transitive)
- Removed@aws-sdk/types@3.186.0(transitive)
Updated@aws-sdk/types@3.188.0