@aws-sdk/client-s3-control 3.1068.0 → 3.1070.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/auth/httpAuthSchemeProvider.js +9 -15
- package/dist-cjs/endpoint/bdd.js +2 -5
- package/dist-cjs/endpoint/endpointResolver.js +7 -11
- package/dist-cjs/index.js +481 -501
- package/dist-cjs/models/S3ControlServiceException.js +4 -8
- package/dist-cjs/models/errors.js +25 -40
- package/dist-cjs/runtimeConfig.browser.js +25 -29
- package/dist-cjs/runtimeConfig.js +35 -39
- package/dist-cjs/runtimeConfig.native.js +4 -7
- package/dist-cjs/runtimeConfig.shared.js +20 -24
- package/dist-cjs/schemas/schemas_0.js +870 -563
- package/package.json +15 -15
|
@@ -1,12 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
exports.S3ControlServiceException =
|
|
4
|
-
const client_1 = require("@smithy/core/client");
|
|
5
|
-
Object.defineProperty(exports, "__ServiceException", { enumerable: true, get: function () { return client_1.ServiceException; } });
|
|
6
|
-
class S3ControlServiceException extends client_1.ServiceException {
|
|
1
|
+
const { ServiceException: __ServiceException } = require("@smithy/core/client");
|
|
2
|
+
exports.__ServiceException = __ServiceException;
|
|
3
|
+
exports.S3ControlServiceException = class S3ControlServiceException extends __ServiceException {
|
|
7
4
|
constructor(options) {
|
|
8
5
|
super(options);
|
|
9
6
|
Object.setPrototypeOf(this, S3ControlServiceException.prototype);
|
|
10
7
|
}
|
|
11
|
-
}
|
|
12
|
-
exports.S3ControlServiceException = S3ControlServiceException;
|
|
8
|
+
};
|
|
@@ -1,8 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
exports.JobStatusException = exports.TooManyTagsException = exports.InvalidRequestException = exports.InvalidNextTokenException = exports.NoSuchPublicAccessBlockConfiguration = exports.NotFoundException = exports.TooManyRequestsException = exports.InternalServiceException = exports.IdempotencyException = exports.BadRequestException = exports.BucketAlreadyOwnedByYou = exports.BucketAlreadyExists = void 0;
|
|
4
|
-
const S3ControlServiceException_1 = require("./S3ControlServiceException");
|
|
5
|
-
class BucketAlreadyExists extends S3ControlServiceException_1.S3ControlServiceException {
|
|
1
|
+
const { S3ControlServiceException: __BaseException } = require("./S3ControlServiceException");
|
|
2
|
+
exports.BucketAlreadyExists = class BucketAlreadyExists extends __BaseException {
|
|
6
3
|
name = "BucketAlreadyExists";
|
|
7
4
|
$fault = "client";
|
|
8
5
|
constructor(opts) {
|
|
@@ -13,9 +10,8 @@ class BucketAlreadyExists extends S3ControlServiceException_1.S3ControlServiceEx
|
|
|
13
10
|
});
|
|
14
11
|
Object.setPrototypeOf(this, BucketAlreadyExists.prototype);
|
|
15
12
|
}
|
|
16
|
-
}
|
|
17
|
-
exports.
|
|
18
|
-
class BucketAlreadyOwnedByYou extends S3ControlServiceException_1.S3ControlServiceException {
|
|
13
|
+
};
|
|
14
|
+
exports.BucketAlreadyOwnedByYou = class BucketAlreadyOwnedByYou extends __BaseException {
|
|
19
15
|
name = "BucketAlreadyOwnedByYou";
|
|
20
16
|
$fault = "client";
|
|
21
17
|
constructor(opts) {
|
|
@@ -26,9 +22,8 @@ class BucketAlreadyOwnedByYou extends S3ControlServiceException_1.S3ControlServi
|
|
|
26
22
|
});
|
|
27
23
|
Object.setPrototypeOf(this, BucketAlreadyOwnedByYou.prototype);
|
|
28
24
|
}
|
|
29
|
-
}
|
|
30
|
-
exports.
|
|
31
|
-
class BadRequestException extends S3ControlServiceException_1.S3ControlServiceException {
|
|
25
|
+
};
|
|
26
|
+
exports.BadRequestException = class BadRequestException extends __BaseException {
|
|
32
27
|
name = "BadRequestException";
|
|
33
28
|
$fault = "client";
|
|
34
29
|
Message;
|
|
@@ -41,9 +36,8 @@ class BadRequestException extends S3ControlServiceException_1.S3ControlServiceEx
|
|
|
41
36
|
Object.setPrototypeOf(this, BadRequestException.prototype);
|
|
42
37
|
this.Message = opts.Message;
|
|
43
38
|
}
|
|
44
|
-
}
|
|
45
|
-
exports.
|
|
46
|
-
class IdempotencyException extends S3ControlServiceException_1.S3ControlServiceException {
|
|
39
|
+
};
|
|
40
|
+
exports.IdempotencyException = class IdempotencyException extends __BaseException {
|
|
47
41
|
name = "IdempotencyException";
|
|
48
42
|
$fault = "client";
|
|
49
43
|
Message;
|
|
@@ -56,9 +50,8 @@ class IdempotencyException extends S3ControlServiceException_1.S3ControlServiceE
|
|
|
56
50
|
Object.setPrototypeOf(this, IdempotencyException.prototype);
|
|
57
51
|
this.Message = opts.Message;
|
|
58
52
|
}
|
|
59
|
-
}
|
|
60
|
-
exports.
|
|
61
|
-
class InternalServiceException extends S3ControlServiceException_1.S3ControlServiceException {
|
|
53
|
+
};
|
|
54
|
+
exports.InternalServiceException = class InternalServiceException extends __BaseException {
|
|
62
55
|
name = "InternalServiceException";
|
|
63
56
|
$fault = "server";
|
|
64
57
|
Message;
|
|
@@ -71,9 +64,8 @@ class InternalServiceException extends S3ControlServiceException_1.S3ControlServ
|
|
|
71
64
|
Object.setPrototypeOf(this, InternalServiceException.prototype);
|
|
72
65
|
this.Message = opts.Message;
|
|
73
66
|
}
|
|
74
|
-
}
|
|
75
|
-
exports.
|
|
76
|
-
class TooManyRequestsException extends S3ControlServiceException_1.S3ControlServiceException {
|
|
67
|
+
};
|
|
68
|
+
exports.TooManyRequestsException = class TooManyRequestsException extends __BaseException {
|
|
77
69
|
name = "TooManyRequestsException";
|
|
78
70
|
$fault = "client";
|
|
79
71
|
Message;
|
|
@@ -86,9 +78,8 @@ class TooManyRequestsException extends S3ControlServiceException_1.S3ControlServ
|
|
|
86
78
|
Object.setPrototypeOf(this, TooManyRequestsException.prototype);
|
|
87
79
|
this.Message = opts.Message;
|
|
88
80
|
}
|
|
89
|
-
}
|
|
90
|
-
exports.
|
|
91
|
-
class NotFoundException extends S3ControlServiceException_1.S3ControlServiceException {
|
|
81
|
+
};
|
|
82
|
+
exports.NotFoundException = class NotFoundException extends __BaseException {
|
|
92
83
|
name = "NotFoundException";
|
|
93
84
|
$fault = "client";
|
|
94
85
|
Message;
|
|
@@ -101,9 +92,8 @@ class NotFoundException extends S3ControlServiceException_1.S3ControlServiceExce
|
|
|
101
92
|
Object.setPrototypeOf(this, NotFoundException.prototype);
|
|
102
93
|
this.Message = opts.Message;
|
|
103
94
|
}
|
|
104
|
-
}
|
|
105
|
-
exports.
|
|
106
|
-
class NoSuchPublicAccessBlockConfiguration extends S3ControlServiceException_1.S3ControlServiceException {
|
|
95
|
+
};
|
|
96
|
+
exports.NoSuchPublicAccessBlockConfiguration = class NoSuchPublicAccessBlockConfiguration extends __BaseException {
|
|
107
97
|
name = "NoSuchPublicAccessBlockConfiguration";
|
|
108
98
|
$fault = "client";
|
|
109
99
|
Message;
|
|
@@ -116,9 +106,8 @@ class NoSuchPublicAccessBlockConfiguration extends S3ControlServiceException_1.S
|
|
|
116
106
|
Object.setPrototypeOf(this, NoSuchPublicAccessBlockConfiguration.prototype);
|
|
117
107
|
this.Message = opts.Message;
|
|
118
108
|
}
|
|
119
|
-
}
|
|
120
|
-
exports.
|
|
121
|
-
class InvalidNextTokenException extends S3ControlServiceException_1.S3ControlServiceException {
|
|
109
|
+
};
|
|
110
|
+
exports.InvalidNextTokenException = class InvalidNextTokenException extends __BaseException {
|
|
122
111
|
name = "InvalidNextTokenException";
|
|
123
112
|
$fault = "client";
|
|
124
113
|
Message;
|
|
@@ -131,9 +120,8 @@ class InvalidNextTokenException extends S3ControlServiceException_1.S3ControlSer
|
|
|
131
120
|
Object.setPrototypeOf(this, InvalidNextTokenException.prototype);
|
|
132
121
|
this.Message = opts.Message;
|
|
133
122
|
}
|
|
134
|
-
}
|
|
135
|
-
exports.
|
|
136
|
-
class InvalidRequestException extends S3ControlServiceException_1.S3ControlServiceException {
|
|
123
|
+
};
|
|
124
|
+
exports.InvalidRequestException = class InvalidRequestException extends __BaseException {
|
|
137
125
|
name = "InvalidRequestException";
|
|
138
126
|
$fault = "client";
|
|
139
127
|
Message;
|
|
@@ -146,9 +134,8 @@ class InvalidRequestException extends S3ControlServiceException_1.S3ControlServi
|
|
|
146
134
|
Object.setPrototypeOf(this, InvalidRequestException.prototype);
|
|
147
135
|
this.Message = opts.Message;
|
|
148
136
|
}
|
|
149
|
-
}
|
|
150
|
-
exports.
|
|
151
|
-
class TooManyTagsException extends S3ControlServiceException_1.S3ControlServiceException {
|
|
137
|
+
};
|
|
138
|
+
exports.TooManyTagsException = class TooManyTagsException extends __BaseException {
|
|
152
139
|
name = "TooManyTagsException";
|
|
153
140
|
$fault = "client";
|
|
154
141
|
Message;
|
|
@@ -161,9 +148,8 @@ class TooManyTagsException extends S3ControlServiceException_1.S3ControlServiceE
|
|
|
161
148
|
Object.setPrototypeOf(this, TooManyTagsException.prototype);
|
|
162
149
|
this.Message = opts.Message;
|
|
163
150
|
}
|
|
164
|
-
}
|
|
165
|
-
exports.
|
|
166
|
-
class JobStatusException extends S3ControlServiceException_1.S3ControlServiceException {
|
|
151
|
+
};
|
|
152
|
+
exports.JobStatusException = class JobStatusException extends __BaseException {
|
|
167
153
|
name = "JobStatusException";
|
|
168
154
|
$fault = "client";
|
|
169
155
|
Message;
|
|
@@ -176,5 +162,4 @@ class JobStatusException extends S3ControlServiceException_1.S3ControlServiceExc
|
|
|
176
162
|
Object.setPrototypeOf(this, JobStatusException.prototype);
|
|
177
163
|
this.Message = opts.Message;
|
|
178
164
|
}
|
|
179
|
-
}
|
|
180
|
-
exports.JobStatusException = JobStatusException;
|
|
165
|
+
};
|
|
@@ -1,39 +1,35 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
const
|
|
5
|
-
const
|
|
6
|
-
const
|
|
7
|
-
const
|
|
8
|
-
const
|
|
9
|
-
const
|
|
10
|
-
const
|
|
11
|
-
const retry_1 = require("@smithy/core/retry");
|
|
12
|
-
const serde_1 = require("@smithy/core/serde");
|
|
13
|
-
const fetch_http_handler_1 = require("@smithy/fetch-http-handler");
|
|
14
|
-
const runtimeConfig_shared_1 = require("./runtimeConfig.shared");
|
|
1
|
+
const packageInfo = require("../package.json");
|
|
2
|
+
const { Sha256 } = require("@aws-crypto/sha256-browser");
|
|
3
|
+
const { createDefaultUserAgentProvider } = require("@aws-sdk/core/client");
|
|
4
|
+
const { blobHasher: streamHasher, Md5 } = require("@smithy/core/checksum");
|
|
5
|
+
const { invalidProvider, loadConfigsForDefaultMode } = require("@smithy/core/client");
|
|
6
|
+
const { DEFAULT_USE_DUALSTACK_ENDPOINT, DEFAULT_USE_FIPS_ENDPOINT, resolveDefaultsModeConfig } = require("@smithy/core/config");
|
|
7
|
+
const { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } = require("@smithy/core/retry");
|
|
8
|
+
const { calculateBodyLength } = require("@smithy/core/serde");
|
|
9
|
+
const { FetchHttpHandler: RequestHandler, streamCollector } = require("@smithy/fetch-http-handler");
|
|
10
|
+
const { getRuntimeConfig: getSharedRuntimeConfig } = require("./runtimeConfig.shared");
|
|
15
11
|
const getRuntimeConfig = (config) => {
|
|
16
|
-
const defaultsMode =
|
|
17
|
-
const defaultConfigProvider = () => defaultsMode().then(
|
|
18
|
-
const clientSharedValues = (
|
|
12
|
+
const defaultsMode = resolveDefaultsModeConfig(config);
|
|
13
|
+
const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode);
|
|
14
|
+
const clientSharedValues = getSharedRuntimeConfig(config);
|
|
19
15
|
return {
|
|
20
16
|
...clientSharedValues,
|
|
21
17
|
...config,
|
|
22
18
|
runtime: "browser",
|
|
23
19
|
defaultsMode,
|
|
24
|
-
bodyLengthChecker: config?.bodyLengthChecker ??
|
|
20
|
+
bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength,
|
|
25
21
|
credentialDefaultProvider: config?.credentialDefaultProvider ?? ((_) => () => Promise.reject(new Error("Credential is missing"))),
|
|
26
|
-
defaultUserAgentProvider: config?.defaultUserAgentProvider ??
|
|
27
|
-
maxAttempts: config?.maxAttempts ??
|
|
28
|
-
md5: config?.md5 ??
|
|
29
|
-
region: config?.region ??
|
|
30
|
-
requestHandler:
|
|
31
|
-
retryMode: config?.retryMode ?? (async () => (await defaultConfigProvider()).retryMode ||
|
|
32
|
-
sha256: config?.sha256 ??
|
|
33
|
-
streamCollector: config?.streamCollector ??
|
|
34
|
-
streamHasher: config?.streamHasher ??
|
|
35
|
-
useDualstackEndpoint: config?.useDualstackEndpoint ?? (() => Promise.resolve(
|
|
36
|
-
useFipsEndpoint: config?.useFipsEndpoint ?? (() => Promise.resolve(
|
|
22
|
+
defaultUserAgentProvider: config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }),
|
|
23
|
+
maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS,
|
|
24
|
+
md5: config?.md5 ?? Md5,
|
|
25
|
+
region: config?.region ?? invalidProvider("Region is missing"),
|
|
26
|
+
requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider),
|
|
27
|
+
retryMode: config?.retryMode ?? (async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE),
|
|
28
|
+
sha256: config?.sha256 ?? Sha256,
|
|
29
|
+
streamCollector: config?.streamCollector ?? streamCollector,
|
|
30
|
+
streamHasher: config?.streamHasher ?? streamHasher,
|
|
31
|
+
useDualstackEndpoint: config?.useDualstackEndpoint ?? (() => Promise.resolve(DEFAULT_USE_DUALSTACK_ENDPOINT)),
|
|
32
|
+
useFipsEndpoint: config?.useFipsEndpoint ?? (() => Promise.resolve(DEFAULT_USE_FIPS_ENDPOINT)),
|
|
37
33
|
};
|
|
38
34
|
};
|
|
39
35
|
exports.getRuntimeConfig = getRuntimeConfig;
|
|
@@ -1,25 +1,21 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
const
|
|
5
|
-
const
|
|
6
|
-
const
|
|
7
|
-
const
|
|
8
|
-
const
|
|
9
|
-
const
|
|
10
|
-
const
|
|
11
|
-
const
|
|
12
|
-
const
|
|
13
|
-
const retry_1 = require("@smithy/core/retry");
|
|
14
|
-
const serde_1 = require("@smithy/core/serde");
|
|
15
|
-
const node_http_handler_1 = require("@smithy/node-http-handler");
|
|
16
|
-
const runtimeConfig_shared_1 = require("./runtimeConfig.shared");
|
|
1
|
+
const packageInfo = require("../package.json");
|
|
2
|
+
const { createDefaultUserAgentProvider, emitWarningIfUnsupportedVersion: awsCheckVersion, NODE_APP_ID_CONFIG_OPTIONS } = require("@aws-sdk/core/client");
|
|
3
|
+
const { NODE_AUTH_SCHEME_PREFERENCE_OPTIONS } = require("@aws-sdk/core/httpAuthSchemes");
|
|
4
|
+
const { defaultProvider: credentialDefaultProvider } = require("@aws-sdk/credential-provider-node");
|
|
5
|
+
const { NODE_USE_ARN_REGION_CONFIG_OPTIONS } = require("@aws-sdk/middleware-sdk-s3/s3");
|
|
6
|
+
const { fileStreamHasher: streamHasher } = require("@smithy/core/checksum");
|
|
7
|
+
const { emitWarningIfUnsupportedVersion, loadConfigsForDefaultMode } = require("@smithy/core/client");
|
|
8
|
+
const { loadConfig: loadNodeConfig, NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS, NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, resolveDefaultsModeConfig } = require("@smithy/core/config");
|
|
9
|
+
const { DEFAULT_RETRY_MODE, NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } = require("@smithy/core/retry");
|
|
10
|
+
const { calculateBodyLength, Hash } = require("@smithy/core/serde");
|
|
11
|
+
const { NodeHttpHandler: RequestHandler, streamCollector } = require("@smithy/node-http-handler");
|
|
12
|
+
const { getRuntimeConfig: getSharedRuntimeConfig } = require("./runtimeConfig.shared");
|
|
17
13
|
const getRuntimeConfig = (config) => {
|
|
18
|
-
|
|
19
|
-
const defaultsMode =
|
|
20
|
-
const defaultConfigProvider = () => defaultsMode().then(
|
|
21
|
-
const clientSharedValues = (
|
|
22
|
-
(
|
|
14
|
+
emitWarningIfUnsupportedVersion(process.version);
|
|
15
|
+
const defaultsMode = resolveDefaultsModeConfig(config);
|
|
16
|
+
const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode);
|
|
17
|
+
const clientSharedValues = getSharedRuntimeConfig(config);
|
|
18
|
+
awsCheckVersion(process.version);
|
|
23
19
|
const loaderConfig = {
|
|
24
20
|
profile: config?.profile,
|
|
25
21
|
logger: clientSharedValues.logger,
|
|
@@ -29,26 +25,26 @@ const getRuntimeConfig = (config) => {
|
|
|
29
25
|
...config,
|
|
30
26
|
runtime: "node",
|
|
31
27
|
defaultsMode,
|
|
32
|
-
authSchemePreference: config?.authSchemePreference ?? (
|
|
33
|
-
bodyLengthChecker: config?.bodyLengthChecker ??
|
|
34
|
-
credentialDefaultProvider: config?.credentialDefaultProvider ??
|
|
35
|
-
defaultUserAgentProvider: config?.defaultUserAgentProvider ??
|
|
36
|
-
maxAttempts: config?.maxAttempts ?? (
|
|
37
|
-
md5: config?.md5 ??
|
|
38
|
-
region: config?.region ?? (
|
|
39
|
-
requestHandler:
|
|
28
|
+
authSchemePreference: config?.authSchemePreference ?? loadNodeConfig(NODE_AUTH_SCHEME_PREFERENCE_OPTIONS, loaderConfig),
|
|
29
|
+
bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength,
|
|
30
|
+
credentialDefaultProvider: config?.credentialDefaultProvider ?? credentialDefaultProvider,
|
|
31
|
+
defaultUserAgentProvider: config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }),
|
|
32
|
+
maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config),
|
|
33
|
+
md5: config?.md5 ?? Hash.bind(null, "md5"),
|
|
34
|
+
region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...loaderConfig }),
|
|
35
|
+
requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider),
|
|
40
36
|
retryMode: config?.retryMode ??
|
|
41
|
-
(
|
|
42
|
-
...
|
|
43
|
-
default: async () => (await defaultConfigProvider()).retryMode ||
|
|
37
|
+
loadNodeConfig({
|
|
38
|
+
...NODE_RETRY_MODE_CONFIG_OPTIONS,
|
|
39
|
+
default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE,
|
|
44
40
|
}, config),
|
|
45
|
-
sha256: config?.sha256 ??
|
|
46
|
-
streamCollector: config?.streamCollector ??
|
|
47
|
-
streamHasher: config?.streamHasher ??
|
|
48
|
-
useArnRegion: config?.useArnRegion ?? (
|
|
49
|
-
useDualstackEndpoint: config?.useDualstackEndpoint ?? (
|
|
50
|
-
useFipsEndpoint: config?.useFipsEndpoint ?? (
|
|
51
|
-
userAgentAppId: config?.userAgentAppId ?? (
|
|
41
|
+
sha256: config?.sha256 ?? Hash.bind(null, "sha256"),
|
|
42
|
+
streamCollector: config?.streamCollector ?? streamCollector,
|
|
43
|
+
streamHasher: config?.streamHasher ?? streamHasher,
|
|
44
|
+
useArnRegion: config?.useArnRegion ?? loadNodeConfig(NODE_USE_ARN_REGION_CONFIG_OPTIONS, loaderConfig),
|
|
45
|
+
useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, loaderConfig),
|
|
46
|
+
useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, loaderConfig),
|
|
47
|
+
userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS, loaderConfig),
|
|
52
48
|
};
|
|
53
49
|
};
|
|
54
50
|
exports.getRuntimeConfig = getRuntimeConfig;
|
|
@@ -1,15 +1,12 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
exports.getRuntimeConfig = void 0;
|
|
4
|
-
const sha256_js_1 = require("@aws-crypto/sha256-js");
|
|
5
|
-
const runtimeConfig_browser_1 = require("./runtimeConfig.browser");
|
|
1
|
+
const { Sha256 } = require("@aws-crypto/sha256-js");
|
|
2
|
+
const { getRuntimeConfig: getBrowserRuntimeConfig } = require("./runtimeConfig.browser");
|
|
6
3
|
const getRuntimeConfig = (config) => {
|
|
7
|
-
const browserDefaults = (
|
|
4
|
+
const browserDefaults = getBrowserRuntimeConfig(config);
|
|
8
5
|
return {
|
|
9
6
|
...browserDefaults,
|
|
10
7
|
...config,
|
|
11
8
|
runtime: "react-native",
|
|
12
|
-
sha256: config?.sha256 ??
|
|
9
|
+
sha256: config?.sha256 ?? Sha256,
|
|
13
10
|
};
|
|
14
11
|
};
|
|
15
12
|
exports.getRuntimeConfig = getRuntimeConfig;
|
|
@@ -1,45 +1,41 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
const
|
|
5
|
-
const
|
|
6
|
-
const
|
|
7
|
-
const
|
|
8
|
-
const
|
|
9
|
-
|
|
10
|
-
const endpointResolver_1 = require("./endpoint/endpointResolver");
|
|
11
|
-
const schemas_0_1 = require("./schemas/schemas_0");
|
|
12
|
-
const getRuntimeConfig = (config) => {
|
|
1
|
+
const { AwsSdkSigV4Signer } = require("@aws-sdk/core/httpAuthSchemes");
|
|
2
|
+
const { AwsRestXmlProtocol } = require("@aws-sdk/core/protocols");
|
|
3
|
+
const { NoOpLogger } = require("@smithy/core/client");
|
|
4
|
+
const { parseUrl } = require("@smithy/core/protocols");
|
|
5
|
+
const { fromBase64, fromUtf8, toBase64, toUtf8 } = require("@smithy/core/serde");
|
|
6
|
+
const { defaultS3ControlHttpAuthSchemeProvider } = require("./auth/httpAuthSchemeProvider");
|
|
7
|
+
const { defaultEndpointResolver } = require("./endpoint/endpointResolver");
|
|
8
|
+
const { errorTypeRegistries } = require("./schemas/schemas_0");
|
|
9
|
+
exports.getRuntimeConfig = (config) => {
|
|
13
10
|
return {
|
|
14
11
|
apiVersion: "2018-08-20",
|
|
15
|
-
base64Decoder: config?.base64Decoder ??
|
|
16
|
-
base64Encoder: config?.base64Encoder ??
|
|
12
|
+
base64Decoder: config?.base64Decoder ?? fromBase64,
|
|
13
|
+
base64Encoder: config?.base64Encoder ?? toBase64,
|
|
17
14
|
disableHostPrefix: config?.disableHostPrefix ?? false,
|
|
18
|
-
endpointProvider: config?.endpointProvider ??
|
|
15
|
+
endpointProvider: config?.endpointProvider ?? defaultEndpointResolver,
|
|
19
16
|
extensions: config?.extensions ?? [],
|
|
20
|
-
httpAuthSchemeProvider: config?.httpAuthSchemeProvider ??
|
|
17
|
+
httpAuthSchemeProvider: config?.httpAuthSchemeProvider ?? defaultS3ControlHttpAuthSchemeProvider,
|
|
21
18
|
httpAuthSchemes: config?.httpAuthSchemes ?? [
|
|
22
19
|
{
|
|
23
20
|
schemeId: "aws.auth#sigv4",
|
|
24
21
|
identityProvider: (ipc) => ipc.getIdentityProvider("aws.auth#sigv4"),
|
|
25
|
-
signer: new
|
|
22
|
+
signer: new AwsSdkSigV4Signer(),
|
|
26
23
|
},
|
|
27
24
|
],
|
|
28
|
-
logger: config?.logger ?? new
|
|
29
|
-
protocol: config?.protocol ??
|
|
25
|
+
logger: config?.logger ?? new NoOpLogger(),
|
|
26
|
+
protocol: config?.protocol ?? AwsRestXmlProtocol,
|
|
30
27
|
protocolSettings: config?.protocolSettings ?? {
|
|
31
28
|
defaultNamespace: "com.amazonaws.s3control",
|
|
32
|
-
errorTypeRegistries
|
|
29
|
+
errorTypeRegistries,
|
|
33
30
|
xmlNamespace: "http://awss3control.amazonaws.com/doc/2018-08-20/",
|
|
34
31
|
version: "2018-08-20",
|
|
35
32
|
serviceTarget: "AWSS3ControlServiceV20180820",
|
|
36
33
|
},
|
|
37
34
|
serviceId: config?.serviceId ?? "S3 Control",
|
|
38
35
|
signingEscapePath: config?.signingEscapePath ?? false,
|
|
39
|
-
urlParser: config?.urlParser ??
|
|
36
|
+
urlParser: config?.urlParser ?? parseUrl,
|
|
40
37
|
useArnRegion: config?.useArnRegion ?? undefined,
|
|
41
|
-
utf8Decoder: config?.utf8Decoder ??
|
|
42
|
-
utf8Encoder: config?.utf8Encoder ??
|
|
38
|
+
utf8Decoder: config?.utf8Decoder ?? fromUtf8,
|
|
39
|
+
utf8Encoder: config?.utf8Encoder ?? toUtf8,
|
|
43
40
|
};
|
|
44
41
|
};
|
|
45
|
-
exports.getRuntimeConfig = getRuntimeConfig;
|