@smithy/core 3.33.2 → 3.34.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/CHANGELOG.md +17 -0
- package/dist-cjs/index.js +3 -1
- package/dist-cjs/submodules/cbor/index.js +126 -39
- package/dist-cjs/submodules/client/index.js +14 -3
- package/dist-cjs/submodules/endpoints/index.browser.js +3 -1
- package/dist-cjs/submodules/endpoints/index.js +3 -1
- package/dist-cjs/submodules/errors/index.js +20 -0
- package/dist-cjs/submodules/event-streams/index.browser.js +10 -1
- package/dist-cjs/submodules/event-streams/index.js +10 -1
- package/dist-cjs/submodules/protocols/index.js +16 -2
- package/dist-cjs/submodules/retry/index.browser.js +15 -11
- package/dist-cjs/submodules/retry/index.js +15 -11
- package/dist-cjs/submodules/serde/index.browser.js +4 -1
- package/dist-cjs/submodules/serde/index.js +4 -1
- package/dist-cjs/submodules/serde/index.native.js +4 -1
- package/dist-cjs/submodules/transport/index.js +7 -0
- package/dist-es/legacy-root-exports/util-identity-and-auth/DefaultIdentityProviderConfig.js +3 -0
- package/dist-es/submodules/cbor/cbor-decode.js +29 -13
- package/dist-es/submodules/cbor/cbor-encode.js +12 -4
- package/dist-es/submodules/cbor/codec-v1/CborShapeDeserializer.js +9 -0
- package/dist-es/submodules/cbor/codec-v1/CborShapeSerializer.js +7 -0
- package/dist-es/submodules/cbor/codec-v2/CborShapeDeserializer2.js +44 -15
- package/dist-es/submodules/cbor/codec-v2/CborShapeSerializer2.js +22 -4
- package/dist-es/submodules/cbor/parseCborBody.js +5 -0
- package/dist-es/submodules/client/smithy-client/extensions/checksum.js +3 -0
- package/dist-es/submodules/client/smithy-client/get-value-from-text-node.js +4 -1
- package/dist-es/submodules/client/smithy-client/object-mapping.js +6 -1
- package/dist-es/submodules/client/smithy-client/serde-json.js +4 -1
- package/dist-es/submodules/endpoints/util-endpoints/resolveEndpoint.js +3 -0
- package/dist-es/submodules/errors/errors.js +18 -0
- package/dist-es/submodules/errors/index.js +1 -0
- package/dist-es/submodules/event-streams/EventStreamSerde.js +7 -0
- package/dist-es/submodules/event-streams/eventstream-codec/HeaderMarshaller.js +4 -1
- package/dist-es/submodules/protocols/HttpBindingProtocol.js +9 -0
- package/dist-es/submodules/protocols/HttpProtocol.js +5 -0
- package/dist-es/submodules/protocols/RpcProtocol.js +3 -0
- package/dist-es/submodules/retry/middleware-retry/parseRetryAfterHeader.js +4 -1
- package/dist-es/submodules/retry/service-error-classification/service-error-classification.js +11 -10
- package/dist-es/submodules/serde/index.browser.js +1 -0
- package/dist-es/submodules/serde/index.js +1 -0
- package/dist-es/submodules/serde/index.native.js +1 -0
- package/dist-es/submodules/serde/parse-utils.js +3 -0
- package/dist-es/submodules/transport/hasOwn.js +3 -0
- package/dist-es/submodules/transport/index.js +1 -0
- package/dist-es/submodules/transport/toEndpointV1.js +3 -0
- package/dist-types/submodules/errors/errors.d.ts +44 -0
- package/dist-types/submodules/errors/index.d.ts +1 -0
- package/dist-types/submodules/retry/service-error-classification/service-error-classification.d.ts +4 -0
- package/dist-types/submodules/serde/index.browser.d.ts +1 -0
- package/dist-types/submodules/serde/index.d.ts +1 -0
- package/dist-types/submodules/serde/index.native.d.ts +1 -0
- package/dist-types/submodules/transport/hasOwn.d.ts +4 -0
- package/dist-types/submodules/transport/index.d.ts +1 -0
- package/dist-types/ts3.4/submodules/errors/errors.d.ts +44 -0
- package/dist-types/ts3.4/submodules/errors/index.d.ts +1 -0
- package/dist-types/ts3.4/submodules/retry/service-error-classification/service-error-classification.d.ts +4 -0
- package/dist-types/ts3.4/submodules/serde/index.browser.d.ts +1 -0
- package/dist-types/ts3.4/submodules/serde/index.d.ts +1 -0
- package/dist-types/ts3.4/submodules/serde/index.native.d.ts +1 -0
- package/dist-types/ts3.4/submodules/transport/hasOwn.d.ts +4 -0
- package/dist-types/ts3.4/submodules/transport/index.d.ts +1 -0
- package/errors.d.ts +5 -0
- package/errors.js +5 -0
- package/package.json +11 -2
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { hasOwn } from "@smithy/core/transport";
|
|
1
2
|
import { TypeRegistry } from "@smithy/core/schema";
|
|
2
3
|
import { fromUtf8, toUtf8 } from "@smithy/core/serde";
|
|
3
4
|
export class EventStreamSerde {
|
|
@@ -52,6 +53,8 @@ export class EventStreamSerde {
|
|
|
52
53
|
}
|
|
53
54
|
let unionMember = "";
|
|
54
55
|
for (const key in event) {
|
|
56
|
+
if (!hasOwn(event, key))
|
|
57
|
+
continue;
|
|
55
58
|
if (key !== "__type") {
|
|
56
59
|
unionMember = key;
|
|
57
60
|
break;
|
|
@@ -79,6 +82,8 @@ export class EventStreamSerde {
|
|
|
79
82
|
const asyncIterable = marshaller.deserialize(response.body, async (event) => {
|
|
80
83
|
let unionMember = "";
|
|
81
84
|
for (const key in event) {
|
|
85
|
+
if (!hasOwn(event, key))
|
|
86
|
+
continue;
|
|
82
87
|
if (key !== "__type") {
|
|
83
88
|
unionMember = key;
|
|
84
89
|
break;
|
|
@@ -153,6 +158,8 @@ export class EventStreamSerde {
|
|
|
153
158
|
throw new Error("@smithy::core/protocols - initial-response event encountered in event stream but no response schema given.");
|
|
154
159
|
}
|
|
155
160
|
for (const key in firstEvent.value) {
|
|
161
|
+
if (!hasOwn(firstEvent.value, key))
|
|
162
|
+
continue;
|
|
156
163
|
initialResponseContainer[key] = firstEvent.value[key];
|
|
157
164
|
}
|
|
158
165
|
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { hasOwn } from "@smithy/core/transport";
|
|
1
2
|
import { fromHex, toHex } from "@smithy/core/serde";
|
|
2
3
|
import { Int64 } from "./Int64";
|
|
3
4
|
export class HeaderMarshaller {
|
|
@@ -9,7 +10,9 @@ export class HeaderMarshaller {
|
|
|
9
10
|
}
|
|
10
11
|
format(headers) {
|
|
11
12
|
const chunks = [];
|
|
12
|
-
for (const headerName
|
|
13
|
+
for (const headerName in headers) {
|
|
14
|
+
if (!hasOwn(headers, headerName))
|
|
15
|
+
continue;
|
|
13
16
|
const bytes = this.fromUtf8(headerName);
|
|
14
17
|
chunks.push(Uint8Array.from([bytes.byteLength]), bytes, this.formatHeaderValue(headers[headerName]));
|
|
15
18
|
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { hasOwn } from "@smithy/core/transport";
|
|
1
2
|
import { NormalizedSchema, translateTraits } from "@smithy/core/schema";
|
|
2
3
|
import { sdkStreamMixin, splitEvery, splitHeader } from "@smithy/core/serde";
|
|
3
4
|
import { HttpRequest } from "@smithy/core/transport";
|
|
@@ -93,6 +94,8 @@ export class HttpBindingProtocol extends HttpProtocol {
|
|
|
93
94
|
}
|
|
94
95
|
else if (typeof memberTraits.httpPrefixHeaders === "string") {
|
|
95
96
|
for (const key in inputMemberValue) {
|
|
97
|
+
if (!hasOwn(inputMemberValue, key))
|
|
98
|
+
continue;
|
|
96
99
|
const val = inputMemberValue[key];
|
|
97
100
|
const amalgam = memberTraits.httpPrefixHeaders + key;
|
|
98
101
|
serializer.write([memberNs.getValueSchema(), { httpHeader: amalgam }], val);
|
|
@@ -139,6 +142,8 @@ export class HttpBindingProtocol extends HttpProtocol {
|
|
|
139
142
|
const traits = ns.getMergedTraits();
|
|
140
143
|
if (traits.httpQueryParams) {
|
|
141
144
|
for (const key in data) {
|
|
145
|
+
if (!hasOwn(data, key))
|
|
146
|
+
continue;
|
|
142
147
|
if (!(key in query)) {
|
|
143
148
|
const val = data[key];
|
|
144
149
|
const valueSchema = ns.getValueSchema();
|
|
@@ -182,6 +187,8 @@ export class HttpBindingProtocol extends HttpProtocol {
|
|
|
182
187
|
throw new Error("@smithy/core/protocols - HTTP Protocol error handler failed to throw.");
|
|
183
188
|
}
|
|
184
189
|
for (const header in response.headers) {
|
|
190
|
+
if (!hasOwn(response.headers, header))
|
|
191
|
+
continue;
|
|
185
192
|
const value = response.headers[header];
|
|
186
193
|
delete response.headers[header];
|
|
187
194
|
response.headers[header.toLowerCase()] = value;
|
|
@@ -269,6 +276,8 @@ export class HttpBindingProtocol extends HttpProtocol {
|
|
|
269
276
|
else if (memberTraits.httpPrefixHeaders !== undefined) {
|
|
270
277
|
dataObject[memberName] = {};
|
|
271
278
|
for (const header in response.headers) {
|
|
279
|
+
if (!hasOwn(response.headers, header))
|
|
280
|
+
continue;
|
|
272
281
|
if (header.startsWith(memberTraits.httpPrefixHeaders)) {
|
|
273
282
|
const value = response.headers[header];
|
|
274
283
|
const valueSchema = memberSchema.getValueSchema();
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { hasOwn } from "@smithy/core/transport";
|
|
1
2
|
import { NormalizedSchema, TypeRegistry, translateTraits } from "@smithy/core/schema";
|
|
2
3
|
import { HttpRequest, HttpResponse, isValidHostname } from "@smithy/core/transport";
|
|
3
4
|
import { SerdeContext } from "./SerdeContext";
|
|
@@ -43,6 +44,8 @@ export class HttpProtocol extends SerdeContext {
|
|
|
43
44
|
}
|
|
44
45
|
if (endpoint.headers) {
|
|
45
46
|
for (const name in endpoint.headers) {
|
|
47
|
+
if (!hasOwn(endpoint.headers, name))
|
|
48
|
+
continue;
|
|
46
49
|
request.headers[name] = endpoint.headers[name].join(", ");
|
|
47
50
|
}
|
|
48
51
|
}
|
|
@@ -58,6 +61,8 @@ export class HttpProtocol extends SerdeContext {
|
|
|
58
61
|
};
|
|
59
62
|
if (endpoint.headers) {
|
|
60
63
|
for (const name in endpoint.headers) {
|
|
64
|
+
if (!hasOwn(endpoint.headers, name))
|
|
65
|
+
continue;
|
|
61
66
|
request.headers[name] = endpoint.headers[name];
|
|
62
67
|
}
|
|
63
68
|
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { hasOwn } from "@smithy/core/transport";
|
|
1
2
|
import { NormalizedSchema } from "@smithy/core/schema";
|
|
2
3
|
import { HttpRequest } from "@smithy/core/transport";
|
|
3
4
|
import { HttpProtocol } from "./HttpProtocol";
|
|
@@ -67,6 +68,8 @@ export class RpcProtocol extends HttpProtocol {
|
|
|
67
68
|
throw new Error("@smithy/core/protocols - RPC Protocol error handler failed to throw.");
|
|
68
69
|
}
|
|
69
70
|
for (const header in response.headers) {
|
|
71
|
+
if (!hasOwn(response.headers, header))
|
|
72
|
+
continue;
|
|
70
73
|
const value = response.headers[header];
|
|
71
74
|
delete response.headers[header];
|
|
72
75
|
response.headers[header.toLowerCase()] = value;
|
|
@@ -1,10 +1,13 @@
|
|
|
1
|
+
import { hasOwn } from "@smithy/core/transport";
|
|
1
2
|
import { HttpResponse } from "@smithy/core/protocols";
|
|
2
3
|
import { parseRfc7231DateTime } from "@smithy/core/serde";
|
|
3
4
|
export function parseRetryAfterHeader(response, logger) {
|
|
4
5
|
if (!HttpResponse.isInstance(response)) {
|
|
5
6
|
return;
|
|
6
7
|
}
|
|
7
|
-
for (const header
|
|
8
|
+
for (const header in response.headers) {
|
|
9
|
+
if (!hasOwn(response.headers, header))
|
|
10
|
+
continue;
|
|
8
11
|
const h = header.toLowerCase();
|
|
9
12
|
if (h === "retry-after") {
|
|
10
13
|
const retryAfter = response.headers[header];
|
package/dist-es/submodules/retry/service-error-classification/service-error-classification.js
CHANGED
|
@@ -19,16 +19,17 @@ export const isBrowserNetworkError = (error) => {
|
|
|
19
19
|
export const isThrottlingError = (error) => error.$metadata?.httpStatusCode === 429 ||
|
|
20
20
|
THROTTLING_ERROR_CODES.includes(error.name) ||
|
|
21
21
|
error.$retryable?.throttling == true;
|
|
22
|
-
export const isTransientError = (error, depth = 0) =>
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
22
|
+
export const isTransientError = (error, depth = 0) => error?.name !== "AbortError" &&
|
|
23
|
+
(isRetryableByTrait(error) ||
|
|
24
|
+
isClockSkewCorrectedError(error) ||
|
|
25
|
+
(error.name === "InvalidSignatureException" && error.message?.includes("Signature expired")) ||
|
|
26
|
+
TRANSIENT_ERROR_CODES.includes(error.name) ||
|
|
27
|
+
NODEJS_TIMEOUT_ERROR_CODES.includes(error?.code || "") ||
|
|
28
|
+
NODEJS_NETWORK_ERROR_CODES.includes(error?.code || "") ||
|
|
29
|
+
TRANSIENT_ERROR_STATUS_CODES.includes(error.$metadata?.httpStatusCode || 0) ||
|
|
30
|
+
isBrowserNetworkError(error) ||
|
|
31
|
+
isNodeJsHttp2TransientError(error) ||
|
|
32
|
+
(error.cause !== undefined && depth <= 10 && isTransientError(error.cause, depth + 1)));
|
|
32
33
|
export const isServerError = (error) => {
|
|
33
34
|
if (error.$metadata?.httpStatusCode !== undefined) {
|
|
34
35
|
const statusCode = error.$metadata.httpStatusCode;
|
|
@@ -41,3 +41,4 @@ export { streamCollector } from "./util-stream/stream-collector.browser";
|
|
|
41
41
|
const _getRandomValues = (array) => crypto.getRandomValues(array);
|
|
42
42
|
export const v4 = bindV4(_getRandomValues);
|
|
43
43
|
export const generateIdempotencyToken = v4;
|
|
44
|
+
export { hasOwn } from "@smithy/core/transport";
|
|
@@ -43,3 +43,4 @@ export { streamCollector } from "./util-stream/stream-collector.browser";
|
|
|
43
43
|
const _getRandomValues = (array) => crypto.getRandomValues(array);
|
|
44
44
|
export const v4 = bindV4(_getRandomValues);
|
|
45
45
|
export const generateIdempotencyToken = v4;
|
|
46
|
+
export { hasOwn } from "@smithy/core/transport";
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { hasOwn } from "@smithy/core/transport";
|
|
1
2
|
export const parseBoolean = (value) => {
|
|
2
3
|
switch (value) {
|
|
3
4
|
case "true":
|
|
@@ -137,6 +138,8 @@ export const expectUnion = (value) => {
|
|
|
137
138
|
const asObject = expectObject(value);
|
|
138
139
|
const setKeys = [];
|
|
139
140
|
for (const k in asObject) {
|
|
141
|
+
if (!hasOwn(asObject, k))
|
|
142
|
+
continue;
|
|
140
143
|
if (asObject[k] != null) {
|
|
141
144
|
setKeys.push(k);
|
|
142
145
|
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { hasOwn } from "./hasOwn";
|
|
1
2
|
import { parseUrl } from "./parseUrl";
|
|
2
3
|
export const toEndpointV1 = (endpoint) => {
|
|
3
4
|
if (typeof endpoint === "object") {
|
|
@@ -6,6 +7,8 @@ export const toEndpointV1 = (endpoint) => {
|
|
|
6
7
|
if (endpoint.headers) {
|
|
7
8
|
v1Endpoint.headers = {};
|
|
8
9
|
for (const name in endpoint.headers) {
|
|
10
|
+
if (!hasOwn(endpoint.headers, name))
|
|
11
|
+
continue;
|
|
9
12
|
v1Endpoint.headers[name.toLowerCase()] = endpoint.headers[name].join(", ");
|
|
10
13
|
}
|
|
11
14
|
}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A general SDK error that does not fall into a more specific category.
|
|
3
|
+
*
|
|
4
|
+
* @public
|
|
5
|
+
*/
|
|
6
|
+
export declare class SmithyError extends Error {
|
|
7
|
+
name: string;
|
|
8
|
+
readonly $source: string;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* A value had the wrong type or could not be interpreted as the expected type.
|
|
12
|
+
*
|
|
13
|
+
* @public
|
|
14
|
+
*/
|
|
15
|
+
export declare class SmithyTypeError extends TypeError {
|
|
16
|
+
name: string;
|
|
17
|
+
readonly $source: string;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* A value was the correct type but fell outside its allowed range or bounds.
|
|
21
|
+
*
|
|
22
|
+
* @public
|
|
23
|
+
*/
|
|
24
|
+
export declare class SmithyRangeError extends RangeError {
|
|
25
|
+
name: string;
|
|
26
|
+
readonly $source: string;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* @public
|
|
30
|
+
*/
|
|
31
|
+
export type ErrorConstructor<E extends Error = Error> = new (message?: string) => E;
|
|
32
|
+
/**
|
|
33
|
+
* @public
|
|
34
|
+
*/
|
|
35
|
+
export interface ErrorContainer {
|
|
36
|
+
readonly $source: string;
|
|
37
|
+
readonly Error: ErrorConstructor<SmithyError>;
|
|
38
|
+
readonly TypeError: ErrorConstructor<SmithyTypeError>;
|
|
39
|
+
readonly RangeError: ErrorConstructor<SmithyRangeError>;
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* @public
|
|
43
|
+
*/
|
|
44
|
+
export declare const errors: ErrorContainer;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { errors, type SmithyError, type SmithyRangeError, type SmithyTypeError } from "./errors";
|
package/dist-types/submodules/retry/service-error-classification/service-error-classification.d.ts
CHANGED
|
@@ -19,6 +19,10 @@ export declare const isThrottlingError: (error: SdkError) => boolean;
|
|
|
19
19
|
* included here because there is an error scenario with unknown root
|
|
20
20
|
* cause where the NodeHttpHandler does not decorate the Error with
|
|
21
21
|
* the name "TimeoutError" to be checked by the TRANSIENT_ERROR_CODES condition.
|
|
22
|
+
*
|
|
23
|
+
* Errors named "AbortError" are considered terminal. AbortSignal.timeout()
|
|
24
|
+
* produces an underlying cause which would otherwise be considered retryable as
|
|
25
|
+
* a TimeoutError.
|
|
22
26
|
*/
|
|
23
27
|
export declare const isTransientError: (error: SdkError, depth?: number) => boolean;
|
|
24
28
|
export declare const isServerError: (error: SdkError) => boolean;
|
|
@@ -39,3 +39,4 @@ export { isReadableStream, isBlob } from "./util-stream/stream-type-check";
|
|
|
39
39
|
export { streamCollector } from "./util-stream/stream-collector.browser";
|
|
40
40
|
export declare const v4: () => string;
|
|
41
41
|
export declare const generateIdempotencyToken: () => string;
|
|
42
|
+
export { hasOwn } from "@smithy/core/transport";
|
|
@@ -37,3 +37,4 @@ export { isReadableStream, isBlob } from "./util-stream/stream-type-check";
|
|
|
37
37
|
export { streamCollector } from "./util-stream/stream-collector";
|
|
38
38
|
export declare const v4: () => string;
|
|
39
39
|
export declare const generateIdempotencyToken: () => string;
|
|
40
|
+
export { hasOwn } from "@smithy/core/transport";
|
|
@@ -37,3 +37,4 @@ export { isReadableStream, isBlob } from "./util-stream/stream-type-check";
|
|
|
37
37
|
export { streamCollector } from "./util-stream/stream-collector.browser";
|
|
38
38
|
export declare const v4: () => string;
|
|
39
39
|
export declare const generateIdempotencyToken: () => string;
|
|
40
|
+
export { hasOwn } from "@smithy/core/transport";
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A general SDK error that does not fall into a more specific category.
|
|
3
|
+
*
|
|
4
|
+
* @public
|
|
5
|
+
*/
|
|
6
|
+
export declare class SmithyError extends Error {
|
|
7
|
+
name: string;
|
|
8
|
+
readonly $source: string;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* A value had the wrong type or could not be interpreted as the expected type.
|
|
12
|
+
*
|
|
13
|
+
* @public
|
|
14
|
+
*/
|
|
15
|
+
export declare class SmithyTypeError extends TypeError {
|
|
16
|
+
name: string;
|
|
17
|
+
readonly $source: string;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* A value was the correct type but fell outside its allowed range or bounds.
|
|
21
|
+
*
|
|
22
|
+
* @public
|
|
23
|
+
*/
|
|
24
|
+
export declare class SmithyRangeError extends RangeError {
|
|
25
|
+
name: string;
|
|
26
|
+
readonly $source: string;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* @public
|
|
30
|
+
*/
|
|
31
|
+
export type ErrorConstructor<E extends Error = Error> = new (message?: string) => E;
|
|
32
|
+
/**
|
|
33
|
+
* @public
|
|
34
|
+
*/
|
|
35
|
+
export interface ErrorContainer {
|
|
36
|
+
readonly $source: string;
|
|
37
|
+
readonly Error: ErrorConstructor<SmithyError>;
|
|
38
|
+
readonly TypeError: ErrorConstructor<SmithyTypeError>;
|
|
39
|
+
readonly RangeError: ErrorConstructor<SmithyRangeError>;
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* @public
|
|
43
|
+
*/
|
|
44
|
+
export declare const errors: ErrorContainer;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { errors, SmithyError, SmithyRangeError, SmithyTypeError } from "./errors";
|
|
@@ -19,6 +19,10 @@ export declare const isThrottlingError: (error: SdkError) => boolean;
|
|
|
19
19
|
* included here because there is an error scenario with unknown root
|
|
20
20
|
* cause where the NodeHttpHandler does not decorate the Error with
|
|
21
21
|
* the name "TimeoutError" to be checked by the TRANSIENT_ERROR_CODES condition.
|
|
22
|
+
*
|
|
23
|
+
* Errors named "AbortError" are considered terminal. AbortSignal.timeout()
|
|
24
|
+
* produces an underlying cause which would otherwise be considered retryable as
|
|
25
|
+
* a TimeoutError.
|
|
22
26
|
*/
|
|
23
27
|
export declare const isTransientError: (error: SdkError, depth?: number) => boolean;
|
|
24
28
|
export declare const isServerError: (error: SdkError) => boolean;
|
|
@@ -39,3 +39,4 @@ export { isReadableStream, isBlob } from "./util-stream/stream-type-check";
|
|
|
39
39
|
export { streamCollector } from "./util-stream/stream-collector.browser";
|
|
40
40
|
export declare const v4: () => string;
|
|
41
41
|
export declare const generateIdempotencyToken: () => string;
|
|
42
|
+
export { hasOwn } from "@smithy/core/transport";
|
|
@@ -37,3 +37,4 @@ export { isReadableStream, isBlob } from "./util-stream/stream-type-check";
|
|
|
37
37
|
export { streamCollector } from "./util-stream/stream-collector";
|
|
38
38
|
export declare const v4: () => string;
|
|
39
39
|
export declare const generateIdempotencyToken: () => string;
|
|
40
|
+
export { hasOwn } from "@smithy/core/transport";
|
|
@@ -37,3 +37,4 @@ export { isReadableStream, isBlob } from "./util-stream/stream-type-check";
|
|
|
37
37
|
export { streamCollector } from "./util-stream/stream-collector.browser";
|
|
38
38
|
export declare const v4: () => string;
|
|
39
39
|
export declare const generateIdempotencyToken: () => string;
|
|
40
|
+
export { hasOwn } from "@smithy/core/transport";
|
package/errors.d.ts
ADDED
package/errors.js
ADDED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@smithy/core",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.34.0",
|
|
4
4
|
"homepage": "https://github.com/smithy-lang/smithy-typescript/tree/main/packages/core",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"author": {
|
|
@@ -24,6 +24,8 @@
|
|
|
24
24
|
"./config.js",
|
|
25
25
|
"./endpoints.d.ts",
|
|
26
26
|
"./endpoints.js",
|
|
27
|
+
"./errors.d.ts",
|
|
28
|
+
"./errors.js",
|
|
27
29
|
"./event-streams.d.ts",
|
|
28
30
|
"./event-streams.js",
|
|
29
31
|
"./protocols.d.ts",
|
|
@@ -212,6 +214,13 @@
|
|
|
212
214
|
"node": "./dist-cjs/submodules/transport/index.js",
|
|
213
215
|
"import": "./dist-es/submodules/transport/index.js",
|
|
214
216
|
"require": "./dist-cjs/submodules/transport/index.js"
|
|
217
|
+
},
|
|
218
|
+
"./errors": {
|
|
219
|
+
"types": "./dist-types/submodules/errors/index.d.ts",
|
|
220
|
+
"module": "./dist-es/submodules/errors/index.js",
|
|
221
|
+
"node": "./dist-cjs/submodules/errors/index.js",
|
|
222
|
+
"import": "./dist-es/submodules/errors/index.js",
|
|
223
|
+
"require": "./dist-cjs/submodules/errors/index.js"
|
|
215
224
|
}
|
|
216
225
|
},
|
|
217
226
|
"scripts": {
|
|
@@ -232,7 +241,7 @@
|
|
|
232
241
|
"test:integration:watch": "yarn g:vitest watch -c vitest.config.integ.mts"
|
|
233
242
|
},
|
|
234
243
|
"dependencies": {
|
|
235
|
-
"@smithy/types": "^4.
|
|
244
|
+
"@smithy/types": "^4.18.0",
|
|
236
245
|
"tslib": "^2.6.2"
|
|
237
246
|
},
|
|
238
247
|
"devDependencies": {
|