@aws-sdk/middleware-location-constraint 3.972.12 → 3.972.14
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/index.js +6 -27
- package/dist-es/index.js +1 -24
- package/dist-types/index.d.ts +1 -10
- package/package.json +4 -19
- package/dist-es/configuration.js +0 -3
- package/dist-types/configuration.d.ts +0 -17
- package/dist-types/ts3.4/configuration.d.ts +0 -12
- package/dist-types/ts3.4/index.d.ts +0 -13
package/dist-cjs/index.js
CHANGED
|
@@ -1,30 +1,9 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
return (next) => async (args) => {
|
|
5
|
-
const { CreateBucketConfiguration } = args.input;
|
|
6
|
-
const region = await options.region();
|
|
7
|
-
if (!CreateBucketConfiguration?.LocationConstraint && !CreateBucketConfiguration?.Location) {
|
|
8
|
-
if (region !== "us-east-1") {
|
|
9
|
-
args.input.CreateBucketConfiguration = args.input.CreateBucketConfiguration ?? {};
|
|
10
|
-
args.input.CreateBucketConfiguration.LocationConstraint = region;
|
|
11
|
-
}
|
|
12
|
-
}
|
|
13
|
-
return next(args);
|
|
14
|
-
};
|
|
15
|
-
}
|
|
16
|
-
const locationConstraintMiddlewareOptions = {
|
|
17
|
-
step: "initialize",
|
|
18
|
-
tags: ["LOCATION_CONSTRAINT", "CREATE_BUCKET_CONFIGURATION"],
|
|
19
|
-
name: "locationConstraintMiddleware",
|
|
20
|
-
override: true,
|
|
21
|
-
};
|
|
22
|
-
const getLocationConstraintPlugin = (config) => ({
|
|
23
|
-
applyToStack: (clientStack) => {
|
|
24
|
-
clientStack.add(locationConstraintMiddleware(config), locationConstraintMiddlewareOptions);
|
|
25
|
-
},
|
|
26
|
-
});
|
|
3
|
+
var s3 = require('@aws-sdk/middleware-sdk-s3/s3');
|
|
27
4
|
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
exports.
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
exports.getLocationConstraintPlugin = s3.getLocationConstraintPlugin;
|
|
8
|
+
exports.locationConstraintMiddleware = s3.locationConstraintMiddleware;
|
|
9
|
+
exports.locationConstraintMiddlewareOptions = s3.locationConstraintMiddlewareOptions;
|
package/dist-es/index.js
CHANGED
|
@@ -1,24 +1 @@
|
|
|
1
|
-
export
|
|
2
|
-
return (next) => async (args) => {
|
|
3
|
-
const { CreateBucketConfiguration } = args.input;
|
|
4
|
-
const region = await options.region();
|
|
5
|
-
if (!CreateBucketConfiguration?.LocationConstraint && !CreateBucketConfiguration?.Location) {
|
|
6
|
-
if (region !== "us-east-1") {
|
|
7
|
-
args.input.CreateBucketConfiguration = args.input.CreateBucketConfiguration ?? {};
|
|
8
|
-
args.input.CreateBucketConfiguration.LocationConstraint = region;
|
|
9
|
-
}
|
|
10
|
-
}
|
|
11
|
-
return next(args);
|
|
12
|
-
};
|
|
13
|
-
}
|
|
14
|
-
export const locationConstraintMiddlewareOptions = {
|
|
15
|
-
step: "initialize",
|
|
16
|
-
tags: ["LOCATION_CONSTRAINT", "CREATE_BUCKET_CONFIGURATION"],
|
|
17
|
-
name: "locationConstraintMiddleware",
|
|
18
|
-
override: true,
|
|
19
|
-
};
|
|
20
|
-
export const getLocationConstraintPlugin = (config) => ({
|
|
21
|
-
applyToStack: (clientStack) => {
|
|
22
|
-
clientStack.add(locationConstraintMiddleware(config), locationConstraintMiddlewareOptions);
|
|
23
|
-
},
|
|
24
|
-
});
|
|
1
|
+
export { locationConstraintMiddleware, locationConstraintMiddlewareOptions, getLocationConstraintPlugin, } from "@aws-sdk/middleware-sdk-s3/s3";
|
package/dist-types/index.d.ts
CHANGED
|
@@ -1,10 +1 @@
|
|
|
1
|
-
|
|
2
|
-
import type { LocationConstraintResolvedConfig } from "./configuration";
|
|
3
|
-
/**
|
|
4
|
-
* This middleware modifies the input on S3 CreateBucket requests. If the LocationConstraint has not been set, this
|
|
5
|
-
* middleware will set a LocationConstraint to match the configured region. The CreateBucketConfiguration will be
|
|
6
|
-
* removed entirely on requests to the us-east-1 region.
|
|
7
|
-
*/
|
|
8
|
-
export declare function locationConstraintMiddleware(options: LocationConstraintResolvedConfig): InitializeMiddleware<any, any>;
|
|
9
|
-
export declare const locationConstraintMiddlewareOptions: InitializeHandlerOptions;
|
|
10
|
-
export declare const getLocationConstraintPlugin: (config: LocationConstraintResolvedConfig) => Pluggable<any, any>;
|
|
1
|
+
export { locationConstraintMiddleware, locationConstraintMiddlewareOptions, getLocationConstraintPlugin, } from "@aws-sdk/middleware-sdk-s3/s3";
|
package/package.json
CHANGED
|
@@ -1,18 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aws-sdk/middleware-location-constraint",
|
|
3
|
-
"version": "3.972.
|
|
3
|
+
"version": "3.972.14",
|
|
4
4
|
"scripts": {
|
|
5
5
|
"build": "concurrently 'yarn:build:types' 'yarn:build:es' && yarn build:cjs",
|
|
6
6
|
"build:cjs": "node ../../scripts/compilation/inline middleware-location-constraint",
|
|
7
7
|
"build:es": "tsc -p tsconfig.es.json",
|
|
8
8
|
"build:include:deps": "yarn g:turbo run build -F=\"$npm_package_name\"",
|
|
9
9
|
"build:types": "tsc -p tsconfig.types.json",
|
|
10
|
-
"
|
|
11
|
-
"clean": "premove dist-cjs dist-es dist-types tsconfig.cjs.tsbuildinfo tsconfig.es.tsbuildinfo tsconfig.types.tsbuildinfo",
|
|
12
|
-
"test": "yarn g:vitest run",
|
|
13
|
-
"test:integration": "yarn g:vitest run -c vitest.config.integ.mts",
|
|
14
|
-
"test:watch": "yarn g:vitest watch",
|
|
15
|
-
"test:integration:watch": "yarn g:vitest watch -c vitest.config.integ.mts"
|
|
10
|
+
"clean": "premove dist-cjs dist-es dist-types tsconfig.cjs.tsbuildinfo tsconfig.es.tsbuildinfo tsconfig.types.tsbuildinfo"
|
|
16
11
|
},
|
|
17
12
|
"main": "./dist-cjs/index.js",
|
|
18
13
|
"module": "./dist-es/index.js",
|
|
@@ -20,24 +15,16 @@
|
|
|
20
15
|
"sideEffects": false,
|
|
21
16
|
"author": {
|
|
22
17
|
"name": "AWS SDK for JavaScript Team",
|
|
23
|
-
"url": "https://aws.amazon.com/javascript/"
|
|
18
|
+
"url": "https://aws.amazon.com/sdk-for-javascript/"
|
|
24
19
|
},
|
|
25
20
|
"license": "Apache-2.0",
|
|
26
21
|
"dependencies": {
|
|
27
|
-
"@aws-sdk/
|
|
28
|
-
"@smithy/types": "^4.14.3",
|
|
22
|
+
"@aws-sdk/middleware-sdk-s3": "^3.972.48",
|
|
29
23
|
"tslib": "^2.6.2"
|
|
30
24
|
},
|
|
31
25
|
"engines": {
|
|
32
26
|
"node": ">=20.0.0"
|
|
33
27
|
},
|
|
34
|
-
"typesVersions": {
|
|
35
|
-
"<4.5": {
|
|
36
|
-
"dist-types/*": [
|
|
37
|
-
"dist-types/ts3.4/*"
|
|
38
|
-
]
|
|
39
|
-
}
|
|
40
|
-
},
|
|
41
28
|
"files": [
|
|
42
29
|
"dist-*/**"
|
|
43
30
|
],
|
|
@@ -48,9 +35,7 @@
|
|
|
48
35
|
"directory": "packages-internal/middleware-location-constraint"
|
|
49
36
|
},
|
|
50
37
|
"devDependencies": {
|
|
51
|
-
"@tsconfig/recommended": "1.0.1",
|
|
52
38
|
"concurrently": "7.0.0",
|
|
53
|
-
"downlevel-dts": "0.10.1",
|
|
54
39
|
"premove": "4.0.0",
|
|
55
40
|
"typescript": "~5.8.3"
|
|
56
41
|
}
|
package/dist-es/configuration.js
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import type { Provider } from "@smithy/types";
|
|
2
|
-
/**
|
|
3
|
-
* @public
|
|
4
|
-
*/
|
|
5
|
-
export interface LocationConstraintInputConfig {
|
|
6
|
-
}
|
|
7
|
-
interface PreviouslyResolved {
|
|
8
|
-
region: Provider<string>;
|
|
9
|
-
}
|
|
10
|
-
export interface LocationConstraintResolvedConfig {
|
|
11
|
-
/**
|
|
12
|
-
* Resolved value for input config {@link RegionInputConfig.region}
|
|
13
|
-
*/
|
|
14
|
-
region: Provider<string>;
|
|
15
|
-
}
|
|
16
|
-
export declare function resolveLocationConstraintConfig<T>(input: T & LocationConstraintInputConfig & PreviouslyResolved): T & LocationConstraintResolvedConfig;
|
|
17
|
-
export {};
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { Provider } from "@smithy/types";
|
|
2
|
-
export interface LocationConstraintInputConfig {}
|
|
3
|
-
interface PreviouslyResolved {
|
|
4
|
-
region: Provider<string>;
|
|
5
|
-
}
|
|
6
|
-
export interface LocationConstraintResolvedConfig {
|
|
7
|
-
region: Provider<string>;
|
|
8
|
-
}
|
|
9
|
-
export declare function resolveLocationConstraintConfig<T>(
|
|
10
|
-
input: T & LocationConstraintInputConfig & PreviouslyResolved
|
|
11
|
-
): T & LocationConstraintResolvedConfig;
|
|
12
|
-
export {};
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
InitializeHandlerOptions,
|
|
3
|
-
InitializeMiddleware,
|
|
4
|
-
Pluggable,
|
|
5
|
-
} from "@smithy/types";
|
|
6
|
-
import { LocationConstraintResolvedConfig } from "./configuration";
|
|
7
|
-
export declare function locationConstraintMiddleware(
|
|
8
|
-
options: LocationConstraintResolvedConfig
|
|
9
|
-
): InitializeMiddleware<any, any>;
|
|
10
|
-
export declare const locationConstraintMiddlewareOptions: InitializeHandlerOptions;
|
|
11
|
-
export declare const getLocationConstraintPlugin: (
|
|
12
|
-
config: LocationConstraintResolvedConfig
|
|
13
|
-
) => Pluggable<any, any>;
|