@aws-sdk/client-s3 3.1068.0 → 3.1069.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 +15 -19
- package/dist-cjs/endpoint/bdd.js +2 -5
- package/dist-cjs/endpoint/endpointResolver.js +7 -11
- package/dist-cjs/index.js +514 -534
- package/dist-cjs/models/S3ServiceException.js +4 -8
- package/dist-cjs/models/errors.js +31 -49
- package/dist-cjs/runtimeConfig.browser.js +29 -33
- package/dist-cjs/runtimeConfig.js +43 -47
- package/dist-cjs/runtimeConfig.native.js +4 -7
- package/dist-cjs/runtimeConfig.shared.js +25 -29
- package/dist-cjs/schemas/schemas_0.js +983 -646
- package/package.json +20 -20
|
@@ -1,12 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
exports.S3ServiceException =
|
|
4
|
-
const client_1 = require("@smithy/core/client");
|
|
5
|
-
Object.defineProperty(exports, "__ServiceException", { enumerable: true, get: function () { return client_1.ServiceException; } });
|
|
6
|
-
class S3ServiceException extends client_1.ServiceException {
|
|
1
|
+
const { ServiceException: __ServiceException } = require("@smithy/core/client");
|
|
2
|
+
exports.__ServiceException = __ServiceException;
|
|
3
|
+
exports.S3ServiceException = class S3ServiceException extends __ServiceException {
|
|
7
4
|
constructor(options) {
|
|
8
5
|
super(options);
|
|
9
6
|
Object.setPrototypeOf(this, S3ServiceException.prototype);
|
|
10
7
|
}
|
|
11
|
-
}
|
|
12
|
-
exports.S3ServiceException = S3ServiceException;
|
|
8
|
+
};
|
|
@@ -1,8 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
exports.ObjectAlreadyInActiveTierError = exports.IdempotencyParameterMismatch = exports.TooManyParts = exports.InvalidWriteOffset = exports.InvalidRequest = exports.EncryptionTypeMismatch = exports.NotFound = exports.NoSuchKey = exports.InvalidObjectState = exports.NoSuchBucket = exports.BucketAlreadyOwnedByYou = exports.BucketAlreadyExists = exports.ObjectNotInActiveTierError = exports.AccessDenied = exports.NoSuchUpload = void 0;
|
|
4
|
-
const S3ServiceException_1 = require("./S3ServiceException");
|
|
5
|
-
class NoSuchUpload extends S3ServiceException_1.S3ServiceException {
|
|
1
|
+
const { S3ServiceException: __BaseException } = require("./S3ServiceException");
|
|
2
|
+
exports.NoSuchUpload = class NoSuchUpload extends __BaseException {
|
|
6
3
|
name = "NoSuchUpload";
|
|
7
4
|
$fault = "client";
|
|
8
5
|
constructor(opts) {
|
|
@@ -13,9 +10,8 @@ class NoSuchUpload extends S3ServiceException_1.S3ServiceException {
|
|
|
13
10
|
});
|
|
14
11
|
Object.setPrototypeOf(this, NoSuchUpload.prototype);
|
|
15
12
|
}
|
|
16
|
-
}
|
|
17
|
-
exports.
|
|
18
|
-
class AccessDenied extends S3ServiceException_1.S3ServiceException {
|
|
13
|
+
};
|
|
14
|
+
exports.AccessDenied = class AccessDenied extends __BaseException {
|
|
19
15
|
name = "AccessDenied";
|
|
20
16
|
$fault = "client";
|
|
21
17
|
constructor(opts) {
|
|
@@ -26,9 +22,8 @@ class AccessDenied extends S3ServiceException_1.S3ServiceException {
|
|
|
26
22
|
});
|
|
27
23
|
Object.setPrototypeOf(this, AccessDenied.prototype);
|
|
28
24
|
}
|
|
29
|
-
}
|
|
30
|
-
exports.
|
|
31
|
-
class ObjectNotInActiveTierError extends S3ServiceException_1.S3ServiceException {
|
|
25
|
+
};
|
|
26
|
+
exports.ObjectNotInActiveTierError = class ObjectNotInActiveTierError extends __BaseException {
|
|
32
27
|
name = "ObjectNotInActiveTierError";
|
|
33
28
|
$fault = "client";
|
|
34
29
|
constructor(opts) {
|
|
@@ -39,9 +34,8 @@ class ObjectNotInActiveTierError extends S3ServiceException_1.S3ServiceException
|
|
|
39
34
|
});
|
|
40
35
|
Object.setPrototypeOf(this, ObjectNotInActiveTierError.prototype);
|
|
41
36
|
}
|
|
42
|
-
}
|
|
43
|
-
exports.
|
|
44
|
-
class BucketAlreadyExists extends S3ServiceException_1.S3ServiceException {
|
|
37
|
+
};
|
|
38
|
+
exports.BucketAlreadyExists = class BucketAlreadyExists extends __BaseException {
|
|
45
39
|
name = "BucketAlreadyExists";
|
|
46
40
|
$fault = "client";
|
|
47
41
|
constructor(opts) {
|
|
@@ -52,9 +46,8 @@ class BucketAlreadyExists extends S3ServiceException_1.S3ServiceException {
|
|
|
52
46
|
});
|
|
53
47
|
Object.setPrototypeOf(this, BucketAlreadyExists.prototype);
|
|
54
48
|
}
|
|
55
|
-
}
|
|
56
|
-
exports.
|
|
57
|
-
class BucketAlreadyOwnedByYou extends S3ServiceException_1.S3ServiceException {
|
|
49
|
+
};
|
|
50
|
+
exports.BucketAlreadyOwnedByYou = class BucketAlreadyOwnedByYou extends __BaseException {
|
|
58
51
|
name = "BucketAlreadyOwnedByYou";
|
|
59
52
|
$fault = "client";
|
|
60
53
|
constructor(opts) {
|
|
@@ -65,9 +58,8 @@ class BucketAlreadyOwnedByYou extends S3ServiceException_1.S3ServiceException {
|
|
|
65
58
|
});
|
|
66
59
|
Object.setPrototypeOf(this, BucketAlreadyOwnedByYou.prototype);
|
|
67
60
|
}
|
|
68
|
-
}
|
|
69
|
-
exports.
|
|
70
|
-
class NoSuchBucket extends S3ServiceException_1.S3ServiceException {
|
|
61
|
+
};
|
|
62
|
+
exports.NoSuchBucket = class NoSuchBucket extends __BaseException {
|
|
71
63
|
name = "NoSuchBucket";
|
|
72
64
|
$fault = "client";
|
|
73
65
|
constructor(opts) {
|
|
@@ -78,9 +70,8 @@ class NoSuchBucket extends S3ServiceException_1.S3ServiceException {
|
|
|
78
70
|
});
|
|
79
71
|
Object.setPrototypeOf(this, NoSuchBucket.prototype);
|
|
80
72
|
}
|
|
81
|
-
}
|
|
82
|
-
exports.
|
|
83
|
-
class InvalidObjectState extends S3ServiceException_1.S3ServiceException {
|
|
73
|
+
};
|
|
74
|
+
exports.InvalidObjectState = class InvalidObjectState extends __BaseException {
|
|
84
75
|
name = "InvalidObjectState";
|
|
85
76
|
$fault = "client";
|
|
86
77
|
StorageClass;
|
|
@@ -95,9 +86,8 @@ class InvalidObjectState extends S3ServiceException_1.S3ServiceException {
|
|
|
95
86
|
this.StorageClass = opts.StorageClass;
|
|
96
87
|
this.AccessTier = opts.AccessTier;
|
|
97
88
|
}
|
|
98
|
-
}
|
|
99
|
-
exports.
|
|
100
|
-
class NoSuchKey extends S3ServiceException_1.S3ServiceException {
|
|
89
|
+
};
|
|
90
|
+
exports.NoSuchKey = class NoSuchKey extends __BaseException {
|
|
101
91
|
name = "NoSuchKey";
|
|
102
92
|
$fault = "client";
|
|
103
93
|
constructor(opts) {
|
|
@@ -108,9 +98,8 @@ class NoSuchKey extends S3ServiceException_1.S3ServiceException {
|
|
|
108
98
|
});
|
|
109
99
|
Object.setPrototypeOf(this, NoSuchKey.prototype);
|
|
110
100
|
}
|
|
111
|
-
}
|
|
112
|
-
exports.
|
|
113
|
-
class NotFound extends S3ServiceException_1.S3ServiceException {
|
|
101
|
+
};
|
|
102
|
+
exports.NotFound = class NotFound extends __BaseException {
|
|
114
103
|
name = "NotFound";
|
|
115
104
|
$fault = "client";
|
|
116
105
|
constructor(opts) {
|
|
@@ -121,9 +110,8 @@ class NotFound extends S3ServiceException_1.S3ServiceException {
|
|
|
121
110
|
});
|
|
122
111
|
Object.setPrototypeOf(this, NotFound.prototype);
|
|
123
112
|
}
|
|
124
|
-
}
|
|
125
|
-
exports.
|
|
126
|
-
class EncryptionTypeMismatch extends S3ServiceException_1.S3ServiceException {
|
|
113
|
+
};
|
|
114
|
+
exports.EncryptionTypeMismatch = class EncryptionTypeMismatch extends __BaseException {
|
|
127
115
|
name = "EncryptionTypeMismatch";
|
|
128
116
|
$fault = "client";
|
|
129
117
|
constructor(opts) {
|
|
@@ -134,9 +122,8 @@ class EncryptionTypeMismatch extends S3ServiceException_1.S3ServiceException {
|
|
|
134
122
|
});
|
|
135
123
|
Object.setPrototypeOf(this, EncryptionTypeMismatch.prototype);
|
|
136
124
|
}
|
|
137
|
-
}
|
|
138
|
-
exports.
|
|
139
|
-
class InvalidRequest extends S3ServiceException_1.S3ServiceException {
|
|
125
|
+
};
|
|
126
|
+
exports.InvalidRequest = class InvalidRequest extends __BaseException {
|
|
140
127
|
name = "InvalidRequest";
|
|
141
128
|
$fault = "client";
|
|
142
129
|
constructor(opts) {
|
|
@@ -147,9 +134,8 @@ class InvalidRequest extends S3ServiceException_1.S3ServiceException {
|
|
|
147
134
|
});
|
|
148
135
|
Object.setPrototypeOf(this, InvalidRequest.prototype);
|
|
149
136
|
}
|
|
150
|
-
}
|
|
151
|
-
exports.
|
|
152
|
-
class InvalidWriteOffset extends S3ServiceException_1.S3ServiceException {
|
|
137
|
+
};
|
|
138
|
+
exports.InvalidWriteOffset = class InvalidWriteOffset extends __BaseException {
|
|
153
139
|
name = "InvalidWriteOffset";
|
|
154
140
|
$fault = "client";
|
|
155
141
|
constructor(opts) {
|
|
@@ -160,9 +146,8 @@ class InvalidWriteOffset extends S3ServiceException_1.S3ServiceException {
|
|
|
160
146
|
});
|
|
161
147
|
Object.setPrototypeOf(this, InvalidWriteOffset.prototype);
|
|
162
148
|
}
|
|
163
|
-
}
|
|
164
|
-
exports.
|
|
165
|
-
class TooManyParts extends S3ServiceException_1.S3ServiceException {
|
|
149
|
+
};
|
|
150
|
+
exports.TooManyParts = class TooManyParts extends __BaseException {
|
|
166
151
|
name = "TooManyParts";
|
|
167
152
|
$fault = "client";
|
|
168
153
|
constructor(opts) {
|
|
@@ -173,9 +158,8 @@ class TooManyParts extends S3ServiceException_1.S3ServiceException {
|
|
|
173
158
|
});
|
|
174
159
|
Object.setPrototypeOf(this, TooManyParts.prototype);
|
|
175
160
|
}
|
|
176
|
-
}
|
|
177
|
-
exports.
|
|
178
|
-
class IdempotencyParameterMismatch extends S3ServiceException_1.S3ServiceException {
|
|
161
|
+
};
|
|
162
|
+
exports.IdempotencyParameterMismatch = class IdempotencyParameterMismatch extends __BaseException {
|
|
179
163
|
name = "IdempotencyParameterMismatch";
|
|
180
164
|
$fault = "client";
|
|
181
165
|
constructor(opts) {
|
|
@@ -186,9 +170,8 @@ class IdempotencyParameterMismatch extends S3ServiceException_1.S3ServiceExcepti
|
|
|
186
170
|
});
|
|
187
171
|
Object.setPrototypeOf(this, IdempotencyParameterMismatch.prototype);
|
|
188
172
|
}
|
|
189
|
-
}
|
|
190
|
-
exports.
|
|
191
|
-
class ObjectAlreadyInActiveTierError extends S3ServiceException_1.S3ServiceException {
|
|
173
|
+
};
|
|
174
|
+
exports.ObjectAlreadyInActiveTierError = class ObjectAlreadyInActiveTierError extends __BaseException {
|
|
192
175
|
name = "ObjectAlreadyInActiveTierError";
|
|
193
176
|
$fault = "client";
|
|
194
177
|
constructor(opts) {
|
|
@@ -199,5 +182,4 @@ class ObjectAlreadyInActiveTierError extends S3ServiceException_1.S3ServiceExcep
|
|
|
199
182
|
});
|
|
200
183
|
Object.setPrototypeOf(this, ObjectAlreadyInActiveTierError.prototype);
|
|
201
184
|
}
|
|
202
|
-
}
|
|
203
|
-
exports.ObjectAlreadyInActiveTierError = ObjectAlreadyInActiveTierError;
|
|
185
|
+
};
|
|
@@ -1,43 +1,39 @@
|
|
|
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 fetch_http_handler_1 = require("@smithy/fetch-http-handler");
|
|
16
|
-
const runtimeConfig_shared_1 = require("./runtimeConfig.shared");
|
|
1
|
+
const packageInfo = require("../package.json");
|
|
2
|
+
const { Sha1 } = require("@aws-crypto/sha1-browser");
|
|
3
|
+
const { Sha256 } = require("@aws-crypto/sha256-browser");
|
|
4
|
+
const { createDefaultUserAgentProvider } = require("@aws-sdk/core/client");
|
|
5
|
+
const { blobHasher: streamHasher, Md5 } = require("@smithy/core/checksum");
|
|
6
|
+
const { invalidProvider, loadConfigsForDefaultMode } = require("@smithy/core/client");
|
|
7
|
+
const { DEFAULT_USE_DUALSTACK_ENDPOINT, DEFAULT_USE_FIPS_ENDPOINT, resolveDefaultsModeConfig } = require("@smithy/core/config");
|
|
8
|
+
const { eventStreamSerdeProvider } = require("@smithy/core/event-streams");
|
|
9
|
+
const { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } = require("@smithy/core/retry");
|
|
10
|
+
const { calculateBodyLength } = require("@smithy/core/serde");
|
|
11
|
+
const { FetchHttpHandler: RequestHandler, streamCollector } = require("@smithy/fetch-http-handler");
|
|
12
|
+
const { getRuntimeConfig: getSharedRuntimeConfig } = require("./runtimeConfig.shared");
|
|
17
13
|
const getRuntimeConfig = (config) => {
|
|
18
|
-
const defaultsMode =
|
|
19
|
-
const defaultConfigProvider = () => defaultsMode().then(
|
|
20
|
-
const clientSharedValues = (
|
|
14
|
+
const defaultsMode = resolveDefaultsModeConfig(config);
|
|
15
|
+
const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode);
|
|
16
|
+
const clientSharedValues = getSharedRuntimeConfig(config);
|
|
21
17
|
return {
|
|
22
18
|
...clientSharedValues,
|
|
23
19
|
...config,
|
|
24
20
|
runtime: "browser",
|
|
25
21
|
defaultsMode,
|
|
26
|
-
bodyLengthChecker: config?.bodyLengthChecker ??
|
|
22
|
+
bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength,
|
|
27
23
|
credentialDefaultProvider: config?.credentialDefaultProvider ?? ((_) => () => Promise.reject(new Error("Credential is missing"))),
|
|
28
|
-
defaultUserAgentProvider: config?.defaultUserAgentProvider ??
|
|
29
|
-
eventStreamSerdeProvider: config?.eventStreamSerdeProvider ??
|
|
30
|
-
maxAttempts: config?.maxAttempts ??
|
|
31
|
-
md5: config?.md5 ??
|
|
32
|
-
region: config?.region ??
|
|
33
|
-
requestHandler:
|
|
34
|
-
retryMode: config?.retryMode ?? (async () => (await defaultConfigProvider()).retryMode ||
|
|
35
|
-
sha1: config?.sha1 ??
|
|
36
|
-
sha256: config?.sha256 ??
|
|
37
|
-
streamCollector: config?.streamCollector ??
|
|
38
|
-
streamHasher: config?.streamHasher ??
|
|
39
|
-
useDualstackEndpoint: config?.useDualstackEndpoint ?? (() => Promise.resolve(
|
|
40
|
-
useFipsEndpoint: config?.useFipsEndpoint ?? (() => Promise.resolve(
|
|
24
|
+
defaultUserAgentProvider: config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }),
|
|
25
|
+
eventStreamSerdeProvider: config?.eventStreamSerdeProvider ?? eventStreamSerdeProvider,
|
|
26
|
+
maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS,
|
|
27
|
+
md5: config?.md5 ?? Md5,
|
|
28
|
+
region: config?.region ?? invalidProvider("Region is missing"),
|
|
29
|
+
requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider),
|
|
30
|
+
retryMode: config?.retryMode ?? (async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE),
|
|
31
|
+
sha1: config?.sha1 ?? Sha1,
|
|
32
|
+
sha256: config?.sha256 ?? Sha256,
|
|
33
|
+
streamCollector: config?.streamCollector ?? streamCollector,
|
|
34
|
+
streamHasher: config?.streamHasher ?? streamHasher,
|
|
35
|
+
useDualstackEndpoint: config?.useDualstackEndpoint ?? (() => Promise.resolve(DEFAULT_USE_DUALSTACK_ENDPOINT)),
|
|
36
|
+
useFipsEndpoint: config?.useFipsEndpoint ?? (() => Promise.resolve(DEFAULT_USE_FIPS_ENDPOINT)),
|
|
41
37
|
};
|
|
42
38
|
};
|
|
43
39
|
exports.getRuntimeConfig = getRuntimeConfig;
|
|
@@ -1,27 +1,23 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
const
|
|
5
|
-
const
|
|
6
|
-
const
|
|
7
|
-
const
|
|
8
|
-
const
|
|
9
|
-
const
|
|
10
|
-
const
|
|
11
|
-
const
|
|
12
|
-
const
|
|
13
|
-
const
|
|
14
|
-
const
|
|
15
|
-
const retry_1 = require("@smithy/core/retry");
|
|
16
|
-
const serde_1 = require("@smithy/core/serde");
|
|
17
|
-
const node_http_handler_1 = require("@smithy/node-http-handler");
|
|
18
|
-
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, NODE_SIGV4A_CONFIG_OPTIONS } = require("@aws-sdk/core/httpAuthSchemes");
|
|
4
|
+
const { defaultProvider: credentialDefaultProvider } = require("@aws-sdk/credential-provider-node");
|
|
5
|
+
const { NODE_REQUEST_CHECKSUM_CALCULATION_CONFIG_OPTIONS, NODE_RESPONSE_CHECKSUM_VALIDATION_CONFIG_OPTIONS } = require("@aws-sdk/middleware-flexible-checksums");
|
|
6
|
+
const { NODE_DISABLE_S3_EXPRESS_SESSION_AUTH_OPTIONS, NODE_USE_ARN_REGION_CONFIG_OPTIONS } = require("@aws-sdk/middleware-sdk-s3/s3");
|
|
7
|
+
const { readableStreamHasher: streamHasher } = require("@smithy/core/checksum");
|
|
8
|
+
const { emitWarningIfUnsupportedVersion, loadConfigsForDefaultMode } = require("@smithy/core/client");
|
|
9
|
+
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");
|
|
10
|
+
const { eventStreamSerdeProvider } = require("@smithy/core/event-streams");
|
|
11
|
+
const { DEFAULT_RETRY_MODE, NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } = require("@smithy/core/retry");
|
|
12
|
+
const { calculateBodyLength, Hash } = require("@smithy/core/serde");
|
|
13
|
+
const { NodeHttpHandler: RequestHandler, streamCollector } = require("@smithy/node-http-handler");
|
|
14
|
+
const { getRuntimeConfig: getSharedRuntimeConfig } = require("./runtimeConfig.shared");
|
|
19
15
|
const getRuntimeConfig = (config) => {
|
|
20
|
-
|
|
21
|
-
const defaultsMode =
|
|
22
|
-
const defaultConfigProvider = () => defaultsMode().then(
|
|
23
|
-
const clientSharedValues = (
|
|
24
|
-
(
|
|
16
|
+
emitWarningIfUnsupportedVersion(process.version);
|
|
17
|
+
const defaultsMode = resolveDefaultsModeConfig(config);
|
|
18
|
+
const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode);
|
|
19
|
+
const clientSharedValues = getSharedRuntimeConfig(config);
|
|
20
|
+
awsCheckVersion(process.version);
|
|
25
21
|
const loaderConfig = {
|
|
26
22
|
profile: config?.profile,
|
|
27
23
|
logger: clientSharedValues.logger,
|
|
@@ -31,32 +27,32 @@ const getRuntimeConfig = (config) => {
|
|
|
31
27
|
...config,
|
|
32
28
|
runtime: "node",
|
|
33
29
|
defaultsMode,
|
|
34
|
-
authSchemePreference: config?.authSchemePreference ?? (
|
|
35
|
-
bodyLengthChecker: config?.bodyLengthChecker ??
|
|
36
|
-
credentialDefaultProvider: config?.credentialDefaultProvider ??
|
|
37
|
-
defaultUserAgentProvider: config?.defaultUserAgentProvider ??
|
|
38
|
-
disableS3ExpressSessionAuth: config?.disableS3ExpressSessionAuth ?? (
|
|
39
|
-
eventStreamSerdeProvider: config?.eventStreamSerdeProvider ??
|
|
40
|
-
maxAttempts: config?.maxAttempts ?? (
|
|
41
|
-
md5: config?.md5 ??
|
|
42
|
-
region: config?.region ?? (
|
|
43
|
-
requestChecksumCalculation: config?.requestChecksumCalculation ?? (
|
|
44
|
-
requestHandler:
|
|
45
|
-
responseChecksumValidation: config?.responseChecksumValidation ?? (
|
|
30
|
+
authSchemePreference: config?.authSchemePreference ?? loadNodeConfig(NODE_AUTH_SCHEME_PREFERENCE_OPTIONS, loaderConfig),
|
|
31
|
+
bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength,
|
|
32
|
+
credentialDefaultProvider: config?.credentialDefaultProvider ?? credentialDefaultProvider,
|
|
33
|
+
defaultUserAgentProvider: config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }),
|
|
34
|
+
disableS3ExpressSessionAuth: config?.disableS3ExpressSessionAuth ?? loadNodeConfig(NODE_DISABLE_S3_EXPRESS_SESSION_AUTH_OPTIONS, loaderConfig),
|
|
35
|
+
eventStreamSerdeProvider: config?.eventStreamSerdeProvider ?? eventStreamSerdeProvider,
|
|
36
|
+
maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config),
|
|
37
|
+
md5: config?.md5 ?? Hash.bind(null, "md5"),
|
|
38
|
+
region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...loaderConfig }),
|
|
39
|
+
requestChecksumCalculation: config?.requestChecksumCalculation ?? loadNodeConfig(NODE_REQUEST_CHECKSUM_CALCULATION_CONFIG_OPTIONS, loaderConfig),
|
|
40
|
+
requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider),
|
|
41
|
+
responseChecksumValidation: config?.responseChecksumValidation ?? loadNodeConfig(NODE_RESPONSE_CHECKSUM_VALIDATION_CONFIG_OPTIONS, loaderConfig),
|
|
46
42
|
retryMode: config?.retryMode ??
|
|
47
|
-
(
|
|
48
|
-
...
|
|
49
|
-
default: async () => (await defaultConfigProvider()).retryMode ||
|
|
43
|
+
loadNodeConfig({
|
|
44
|
+
...NODE_RETRY_MODE_CONFIG_OPTIONS,
|
|
45
|
+
default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE,
|
|
50
46
|
}, config),
|
|
51
|
-
sha1: config?.sha1 ??
|
|
52
|
-
sha256: config?.sha256 ??
|
|
53
|
-
sigv4aSigningRegionSet: config?.sigv4aSigningRegionSet ?? (
|
|
54
|
-
streamCollector: config?.streamCollector ??
|
|
55
|
-
streamHasher: config?.streamHasher ??
|
|
56
|
-
useArnRegion: config?.useArnRegion ?? (
|
|
57
|
-
useDualstackEndpoint: config?.useDualstackEndpoint ?? (
|
|
58
|
-
useFipsEndpoint: config?.useFipsEndpoint ?? (
|
|
59
|
-
userAgentAppId: config?.userAgentAppId ?? (
|
|
47
|
+
sha1: config?.sha1 ?? Hash.bind(null, "sha1"),
|
|
48
|
+
sha256: config?.sha256 ?? Hash.bind(null, "sha256"),
|
|
49
|
+
sigv4aSigningRegionSet: config?.sigv4aSigningRegionSet ?? loadNodeConfig(NODE_SIGV4A_CONFIG_OPTIONS, loaderConfig),
|
|
50
|
+
streamCollector: config?.streamCollector ?? streamCollector,
|
|
51
|
+
streamHasher: config?.streamHasher ?? streamHasher,
|
|
52
|
+
useArnRegion: config?.useArnRegion ?? loadNodeConfig(NODE_USE_ARN_REGION_CONFIG_OPTIONS, loaderConfig),
|
|
53
|
+
useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, loaderConfig),
|
|
54
|
+
useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, loaderConfig),
|
|
55
|
+
userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS, loaderConfig),
|
|
60
56
|
};
|
|
61
57
|
};
|
|
62
58
|
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,54 +1,50 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
const
|
|
5
|
-
const
|
|
6
|
-
const
|
|
7
|
-
const
|
|
8
|
-
const
|
|
9
|
-
const
|
|
10
|
-
|
|
11
|
-
const endpointResolver_1 = require("./endpoint/endpointResolver");
|
|
12
|
-
const schemas_0_1 = require("./schemas/schemas_0");
|
|
13
|
-
const getRuntimeConfig = (config) => {
|
|
1
|
+
const { AwsSdkSigV4ASigner, AwsSdkSigV4Signer } = require("@aws-sdk/core/httpAuthSchemes");
|
|
2
|
+
const { S3RestXmlProtocol } = require("@aws-sdk/middleware-sdk-s3/s3");
|
|
3
|
+
const { SignatureV4MultiRegion } = require("@aws-sdk/signature-v4-multi-region");
|
|
4
|
+
const { NoOpLogger } = require("@smithy/core/client");
|
|
5
|
+
const { parseUrl } = require("@smithy/core/protocols");
|
|
6
|
+
const { fromBase64, fromUtf8, getAwsChunkedEncodingStream, sdkStreamMixin, toBase64, toUtf8 } = require("@smithy/core/serde");
|
|
7
|
+
const { defaultS3HttpAuthSchemeProvider } = require("./auth/httpAuthSchemeProvider");
|
|
8
|
+
const { defaultEndpointResolver } = require("./endpoint/endpointResolver");
|
|
9
|
+
const { errorTypeRegistries } = require("./schemas/schemas_0");
|
|
10
|
+
exports.getRuntimeConfig = (config) => {
|
|
14
11
|
return {
|
|
15
12
|
apiVersion: "2006-03-01",
|
|
16
|
-
base64Decoder: config?.base64Decoder ??
|
|
17
|
-
base64Encoder: config?.base64Encoder ??
|
|
13
|
+
base64Decoder: config?.base64Decoder ?? fromBase64,
|
|
14
|
+
base64Encoder: config?.base64Encoder ?? toBase64,
|
|
18
15
|
disableHostPrefix: config?.disableHostPrefix ?? false,
|
|
19
|
-
endpointProvider: config?.endpointProvider ??
|
|
16
|
+
endpointProvider: config?.endpointProvider ?? defaultEndpointResolver,
|
|
20
17
|
extensions: config?.extensions ?? [],
|
|
21
|
-
getAwsChunkedEncodingStream: config?.getAwsChunkedEncodingStream ??
|
|
22
|
-
httpAuthSchemeProvider: config?.httpAuthSchemeProvider ??
|
|
18
|
+
getAwsChunkedEncodingStream: config?.getAwsChunkedEncodingStream ?? getAwsChunkedEncodingStream,
|
|
19
|
+
httpAuthSchemeProvider: config?.httpAuthSchemeProvider ?? defaultS3HttpAuthSchemeProvider,
|
|
23
20
|
httpAuthSchemes: config?.httpAuthSchemes ?? [
|
|
24
21
|
{
|
|
25
22
|
schemeId: "aws.auth#sigv4",
|
|
26
23
|
identityProvider: (ipc) => ipc.getIdentityProvider("aws.auth#sigv4"),
|
|
27
|
-
signer: new
|
|
24
|
+
signer: new AwsSdkSigV4Signer(),
|
|
28
25
|
},
|
|
29
26
|
{
|
|
30
27
|
schemeId: "aws.auth#sigv4a",
|
|
31
28
|
identityProvider: (ipc) => ipc.getIdentityProvider("aws.auth#sigv4a"),
|
|
32
|
-
signer: new
|
|
29
|
+
signer: new AwsSdkSigV4ASigner(),
|
|
33
30
|
},
|
|
34
31
|
],
|
|
35
|
-
logger: config?.logger ?? new
|
|
36
|
-
protocol: config?.protocol ??
|
|
32
|
+
logger: config?.logger ?? new NoOpLogger(),
|
|
33
|
+
protocol: config?.protocol ?? S3RestXmlProtocol,
|
|
37
34
|
protocolSettings: config?.protocolSettings ?? {
|
|
38
35
|
defaultNamespace: "com.amazonaws.s3",
|
|
39
|
-
errorTypeRegistries
|
|
36
|
+
errorTypeRegistries,
|
|
40
37
|
xmlNamespace: "http://s3.amazonaws.com/doc/2006-03-01/",
|
|
41
38
|
version: "2006-03-01",
|
|
42
39
|
serviceTarget: "AmazonS3",
|
|
43
40
|
},
|
|
44
|
-
sdkStreamMixin: config?.sdkStreamMixin ??
|
|
41
|
+
sdkStreamMixin: config?.sdkStreamMixin ?? sdkStreamMixin,
|
|
45
42
|
serviceId: config?.serviceId ?? "S3",
|
|
46
|
-
signerConstructor: config?.signerConstructor ??
|
|
43
|
+
signerConstructor: config?.signerConstructor ?? SignatureV4MultiRegion,
|
|
47
44
|
signingEscapePath: config?.signingEscapePath ?? false,
|
|
48
|
-
urlParser: config?.urlParser ??
|
|
45
|
+
urlParser: config?.urlParser ?? parseUrl,
|
|
49
46
|
useArnRegion: config?.useArnRegion ?? undefined,
|
|
50
|
-
utf8Decoder: config?.utf8Decoder ??
|
|
51
|
-
utf8Encoder: config?.utf8Encoder ??
|
|
47
|
+
utf8Decoder: config?.utf8Decoder ?? fromUtf8,
|
|
48
|
+
utf8Encoder: config?.utf8Encoder ?? toUtf8,
|
|
52
49
|
};
|
|
53
50
|
};
|
|
54
|
-
exports.getRuntimeConfig = getRuntimeConfig;
|