@aws-sdk/middleware-location-constraint 3.485.0 → 3.495.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist-cjs/configuration.js +1 -7
- package/dist-cjs/index.js +56 -27
- package/package.json +4 -4
|
@@ -1,7 +1 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.resolveLocationConstraintConfig = void 0;
|
|
4
|
-
function resolveLocationConstraintConfig(input) {
|
|
5
|
-
return { ...input };
|
|
6
|
-
}
|
|
7
|
-
exports.resolveLocationConstraintConfig = resolveLocationConstraintConfig;
|
|
1
|
+
module.exports = require("./index.js");
|
package/dist-cjs/index.js
CHANGED
|
@@ -1,32 +1,61 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
|
|
20
|
+
// src/index.ts
|
|
21
|
+
var src_exports = {};
|
|
22
|
+
__export(src_exports, {
|
|
23
|
+
getLocationConstraintPlugin: () => getLocationConstraintPlugin,
|
|
24
|
+
locationConstraintMiddleware: () => locationConstraintMiddleware,
|
|
25
|
+
locationConstraintMiddlewareOptions: () => locationConstraintMiddlewareOptions
|
|
26
|
+
});
|
|
27
|
+
module.exports = __toCommonJS(src_exports);
|
|
4
28
|
function locationConstraintMiddleware(options) {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
},
|
|
15
|
-
};
|
|
29
|
+
return (next) => async (args) => {
|
|
30
|
+
const { CreateBucketConfiguration } = args.input;
|
|
31
|
+
const region = await options.region();
|
|
32
|
+
if (!(CreateBucketConfiguration == null ? void 0 : CreateBucketConfiguration.LocationConstraint) && !(CreateBucketConfiguration == null ? void 0 : CreateBucketConfiguration.Location)) {
|
|
33
|
+
args = {
|
|
34
|
+
...args,
|
|
35
|
+
input: {
|
|
36
|
+
...args.input,
|
|
37
|
+
CreateBucketConfiguration: region === "us-east-1" ? void 0 : { LocationConstraint: region }
|
|
16
38
|
}
|
|
17
|
-
|
|
18
|
-
}
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
return next(args);
|
|
42
|
+
};
|
|
19
43
|
}
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
44
|
+
__name(locationConstraintMiddleware, "locationConstraintMiddleware");
|
|
45
|
+
var locationConstraintMiddlewareOptions = {
|
|
46
|
+
step: "initialize",
|
|
47
|
+
tags: ["LOCATION_CONSTRAINT", "CREATE_BUCKET_CONFIGURATION"],
|
|
48
|
+
name: "locationConstraintMiddleware",
|
|
49
|
+
override: true
|
|
26
50
|
};
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
51
|
+
var getLocationConstraintPlugin = /* @__PURE__ */ __name((config) => ({
|
|
52
|
+
applyToStack: (clientStack) => {
|
|
53
|
+
clientStack.add(locationConstraintMiddleware(config), locationConstraintMiddlewareOptions);
|
|
54
|
+
}
|
|
55
|
+
}), "getLocationConstraintPlugin");
|
|
56
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
57
|
+
0 && (module.exports = {
|
|
58
|
+
getLocationConstraintPlugin,
|
|
59
|
+
locationConstraintMiddleware,
|
|
60
|
+
locationConstraintMiddlewareOptions
|
|
31
61
|
});
|
|
32
|
-
exports.getLocationConstraintPlugin = getLocationConstraintPlugin;
|
package/package.json
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aws-sdk/middleware-location-constraint",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.495.0",
|
|
4
4
|
"scripts": {
|
|
5
5
|
"build": "concurrently 'yarn:build:cjs' 'yarn:build:es' 'yarn:build:types'",
|
|
6
|
-
"build:cjs": "
|
|
6
|
+
"build:cjs": "node ../../scripts/compilation/inline middleware-location-constraint",
|
|
7
7
|
"build:es": "tsc -p tsconfig.es.json",
|
|
8
8
|
"build:include:deps": "lerna run --scope $npm_package_name --include-dependencies build",
|
|
9
9
|
"build:types": "tsc -p tsconfig.types.json",
|
|
@@ -21,8 +21,8 @@
|
|
|
21
21
|
},
|
|
22
22
|
"license": "Apache-2.0",
|
|
23
23
|
"dependencies": {
|
|
24
|
-
"@aws-sdk/types": "3.
|
|
25
|
-
"@smithy/types": "^2.
|
|
24
|
+
"@aws-sdk/types": "3.495.0",
|
|
25
|
+
"@smithy/types": "^2.9.0",
|
|
26
26
|
"tslib": "^2.5.0"
|
|
27
27
|
},
|
|
28
28
|
"engines": {
|