@aws-sdk/core 3.896.0 → 3.899.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/submodules/protocols/index.js +13 -7
- package/dist-es/submodules/protocols/ProtocolLib.js +3 -2
- package/dist-es/submodules/protocols/cbor/AwsSmithyRpcV2CborProtocol.js +3 -2
- package/dist-es/submodules/protocols/json/AwsJsonRpcProtocol.js +3 -2
- package/dist-es/submodules/protocols/json/AwsRestJsonProtocol.js +3 -2
- package/dist-es/submodules/protocols/query/AwsQueryProtocol.js +3 -2
- package/dist-es/submodules/protocols/xml/AwsRestXmlProtocol.js +3 -2
- package/package.json +3 -3
|
@@ -116,9 +116,10 @@ var ProtocolLib = class {
|
|
|
116
116
|
return { errorSchema, errorMetadata };
|
|
117
117
|
} catch (e) {
|
|
118
118
|
dataObject.message = dataObject.message ?? dataObject.Message ?? "UnknownError";
|
|
119
|
-
const
|
|
119
|
+
const synthetic = import_schema.TypeRegistry.for("smithy.ts.sdk.synthetic." + namespace);
|
|
120
|
+
const baseExceptionSchema = synthetic.getBaseException();
|
|
120
121
|
if (baseExceptionSchema) {
|
|
121
|
-
const ErrorCtor = baseExceptionSchema
|
|
122
|
+
const ErrorCtor = synthetic.getErrorCtor(baseExceptionSchema) ?? Error;
|
|
122
123
|
throw Object.assign(new ErrorCtor({ name: errorName }), errorMetadata, dataObject);
|
|
123
124
|
}
|
|
124
125
|
throw Object.assign(new Error(errorName), errorMetadata, dataObject);
|
|
@@ -206,7 +207,8 @@ var AwsSmithyRpcV2CborProtocol = class extends import_cbor.SmithyRpcV2CborProtoc
|
|
|
206
207
|
);
|
|
207
208
|
const ns = import_schema2.NormalizedSchema.of(errorSchema);
|
|
208
209
|
const message = dataObject.message ?? dataObject.Message ?? "Unknown";
|
|
209
|
-
const
|
|
210
|
+
const ErrorCtor = import_schema2.TypeRegistry.for(errorSchema.namespace).getErrorCtor(errorSchema) ?? Error;
|
|
211
|
+
const exception = new ErrorCtor(message);
|
|
210
212
|
const output = {};
|
|
211
213
|
for (const [name, member] of ns.structIterator()) {
|
|
212
214
|
output[name] = this.deserializer.readValue(member, dataObject[name]);
|
|
@@ -781,7 +783,8 @@ var AwsJsonRpcProtocol = class extends import_protocols3.RpcProtocol {
|
|
|
781
783
|
);
|
|
782
784
|
const ns = import_schema5.NormalizedSchema.of(errorSchema);
|
|
783
785
|
const message = dataObject.message ?? dataObject.Message ?? "Unknown";
|
|
784
|
-
const
|
|
786
|
+
const ErrorCtor = import_schema5.TypeRegistry.for(errorSchema.namespace).getErrorCtor(errorSchema) ?? Error;
|
|
787
|
+
const exception = new ErrorCtor(message);
|
|
785
788
|
const output = {};
|
|
786
789
|
for (const [name, member] of ns.structIterator()) {
|
|
787
790
|
const target = member.getMergedTraits().jsonName ?? name;
|
|
@@ -924,7 +927,8 @@ var AwsRestJsonProtocol = class extends import_protocols4.HttpBindingProtocol {
|
|
|
924
927
|
);
|
|
925
928
|
const ns = import_schema6.NormalizedSchema.of(errorSchema);
|
|
926
929
|
const message = dataObject.message ?? dataObject.Message ?? "Unknown";
|
|
927
|
-
const
|
|
930
|
+
const ErrorCtor = import_schema6.TypeRegistry.for(errorSchema.namespace).getErrorCtor(errorSchema) ?? Error;
|
|
931
|
+
const exception = new ErrorCtor(message);
|
|
928
932
|
await this.deserializeHttpMessage(errorSchema, context, response, dataObject);
|
|
929
933
|
const output = {};
|
|
930
934
|
for (const [name, member] of ns.structIterator()) {
|
|
@@ -1365,7 +1369,8 @@ var AwsQueryProtocol = class extends import_protocols7.RpcProtocol {
|
|
|
1365
1369
|
)
|
|
1366
1370
|
);
|
|
1367
1371
|
const ns = import_schema9.NormalizedSchema.of(errorSchema);
|
|
1368
|
-
const
|
|
1372
|
+
const ErrorCtor = import_schema9.TypeRegistry.for(errorSchema.namespace).getErrorCtor(errorSchema) ?? Error;
|
|
1373
|
+
const exception = new ErrorCtor(message);
|
|
1369
1374
|
const output = {
|
|
1370
1375
|
Error: errorData.Error
|
|
1371
1376
|
};
|
|
@@ -1846,7 +1851,8 @@ var AwsRestXmlProtocol = class extends import_protocols9.HttpBindingProtocol {
|
|
|
1846
1851
|
);
|
|
1847
1852
|
const ns = import_schema11.NormalizedSchema.of(errorSchema);
|
|
1848
1853
|
const message = dataObject.Error?.message ?? dataObject.Error?.Message ?? dataObject.message ?? dataObject.Message ?? "Unknown";
|
|
1849
|
-
const
|
|
1854
|
+
const ErrorCtor = import_schema11.TypeRegistry.for(errorSchema.namespace).getErrorCtor(errorSchema) ?? Error;
|
|
1855
|
+
const exception = new ErrorCtor(message);
|
|
1850
1856
|
await this.deserializeHttpMessage(errorSchema, context, response, dataObject);
|
|
1851
1857
|
const output = {};
|
|
1852
1858
|
for (const [name, member] of ns.structIterator()) {
|
|
@@ -49,9 +49,10 @@ export class ProtocolLib {
|
|
|
49
49
|
}
|
|
50
50
|
catch (e) {
|
|
51
51
|
dataObject.message = dataObject.message ?? dataObject.Message ?? "UnknownError";
|
|
52
|
-
const
|
|
52
|
+
const synthetic = TypeRegistry.for("smithy.ts.sdk.synthetic." + namespace);
|
|
53
|
+
const baseExceptionSchema = synthetic.getBaseException();
|
|
53
54
|
if (baseExceptionSchema) {
|
|
54
|
-
const ErrorCtor = baseExceptionSchema
|
|
55
|
+
const ErrorCtor = synthetic.getErrorCtor(baseExceptionSchema) ?? Error;
|
|
55
56
|
throw Object.assign(new ErrorCtor({ name: errorName }), errorMetadata, dataObject);
|
|
56
57
|
}
|
|
57
58
|
throw Object.assign(new Error(errorName), errorMetadata, dataObject);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { loadSmithyRpcV2CborErrorCode, SmithyRpcV2CborProtocol } from "@smithy/core/cbor";
|
|
2
|
-
import { NormalizedSchema } from "@smithy/core/schema";
|
|
2
|
+
import { NormalizedSchema, TypeRegistry } from "@smithy/core/schema";
|
|
3
3
|
import { ProtocolLib } from "../ProtocolLib";
|
|
4
4
|
export class AwsSmithyRpcV2CborProtocol extends SmithyRpcV2CborProtocol {
|
|
5
5
|
awsQueryCompatible;
|
|
@@ -23,7 +23,8 @@ export class AwsSmithyRpcV2CborProtocol extends SmithyRpcV2CborProtocol {
|
|
|
23
23
|
const { errorSchema, errorMetadata } = await this.mixin.getErrorSchemaOrThrowBaseException(errorName, this.options.defaultNamespace, response, dataObject, metadata);
|
|
24
24
|
const ns = NormalizedSchema.of(errorSchema);
|
|
25
25
|
const message = dataObject.message ?? dataObject.Message ?? "Unknown";
|
|
26
|
-
const
|
|
26
|
+
const ErrorCtor = TypeRegistry.for(errorSchema.namespace).getErrorCtor(errorSchema) ?? Error;
|
|
27
|
+
const exception = new ErrorCtor(message);
|
|
27
28
|
const output = {};
|
|
28
29
|
for (const [name, member] of ns.structIterator()) {
|
|
29
30
|
output[name] = this.deserializer.readValue(member, dataObject[name]);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { RpcProtocol } from "@smithy/core/protocols";
|
|
2
|
-
import { deref, NormalizedSchema, SCHEMA } from "@smithy/core/schema";
|
|
2
|
+
import { deref, NormalizedSchema, SCHEMA, TypeRegistry } from "@smithy/core/schema";
|
|
3
3
|
import { ProtocolLib } from "../ProtocolLib";
|
|
4
4
|
import { JsonCodec } from "./JsonCodec";
|
|
5
5
|
import { loadRestJsonErrorCode } from "./parseJsonBody";
|
|
@@ -54,7 +54,8 @@ export class AwsJsonRpcProtocol extends RpcProtocol {
|
|
|
54
54
|
const { errorSchema, errorMetadata } = await this.mixin.getErrorSchemaOrThrowBaseException(errorIdentifier, this.options.defaultNamespace, response, dataObject, metadata);
|
|
55
55
|
const ns = NormalizedSchema.of(errorSchema);
|
|
56
56
|
const message = dataObject.message ?? dataObject.Message ?? "Unknown";
|
|
57
|
-
const
|
|
57
|
+
const ErrorCtor = TypeRegistry.for(errorSchema.namespace).getErrorCtor(errorSchema) ?? Error;
|
|
58
|
+
const exception = new ErrorCtor(message);
|
|
58
59
|
const output = {};
|
|
59
60
|
for (const [name, member] of ns.structIterator()) {
|
|
60
61
|
const target = member.getMergedTraits().jsonName ?? name;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { HttpBindingProtocol, HttpInterceptingShapeDeserializer, HttpInterceptingShapeSerializer, } from "@smithy/core/protocols";
|
|
2
|
-
import { NormalizedSchema, SCHEMA } from "@smithy/core/schema";
|
|
2
|
+
import { NormalizedSchema, SCHEMA, TypeRegistry } from "@smithy/core/schema";
|
|
3
3
|
import { ProtocolLib } from "../ProtocolLib";
|
|
4
4
|
import { JsonCodec } from "./JsonCodec";
|
|
5
5
|
import { loadRestJsonErrorCode } from "./parseJsonBody";
|
|
@@ -53,7 +53,8 @@ export class AwsRestJsonProtocol extends HttpBindingProtocol {
|
|
|
53
53
|
const { errorSchema, errorMetadata } = await this.mixin.getErrorSchemaOrThrowBaseException(errorIdentifier, this.options.defaultNamespace, response, dataObject, metadata);
|
|
54
54
|
const ns = NormalizedSchema.of(errorSchema);
|
|
55
55
|
const message = dataObject.message ?? dataObject.Message ?? "Unknown";
|
|
56
|
-
const
|
|
56
|
+
const ErrorCtor = TypeRegistry.for(errorSchema.namespace).getErrorCtor(errorSchema) ?? Error;
|
|
57
|
+
const exception = new ErrorCtor(message);
|
|
57
58
|
await this.deserializeHttpMessage(errorSchema, context, response, dataObject);
|
|
58
59
|
const output = {};
|
|
59
60
|
for (const [name, member] of ns.structIterator()) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { collectBody, RpcProtocol } from "@smithy/core/protocols";
|
|
2
|
-
import { deref, NormalizedSchema, SCHEMA } from "@smithy/core/schema";
|
|
2
|
+
import { deref, NormalizedSchema, SCHEMA, TypeRegistry } from "@smithy/core/schema";
|
|
3
3
|
import { ProtocolLib } from "../ProtocolLib";
|
|
4
4
|
import { XmlShapeDeserializer } from "../xml/XmlShapeDeserializer";
|
|
5
5
|
import { QueryShapeSerializer } from "./QueryShapeSerializer";
|
|
@@ -97,7 +97,8 @@ export class AwsQueryProtocol extends RpcProtocol {
|
|
|
97
97
|
};
|
|
98
98
|
const { errorSchema, errorMetadata } = await this.mixin.getErrorSchemaOrThrowBaseException(errorIdentifier, this.options.defaultNamespace, response, errorData, metadata, (registry, errorName) => registry.find((schema) => NormalizedSchema.of(schema).getMergedTraits().awsQueryError?.[0] === errorName));
|
|
99
99
|
const ns = NormalizedSchema.of(errorSchema);
|
|
100
|
-
const
|
|
100
|
+
const ErrorCtor = TypeRegistry.for(errorSchema.namespace).getErrorCtor(errorSchema) ?? Error;
|
|
101
|
+
const exception = new ErrorCtor(message);
|
|
101
102
|
const output = {
|
|
102
103
|
Error: errorData.Error,
|
|
103
104
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { HttpBindingProtocol, HttpInterceptingShapeDeserializer, HttpInterceptingShapeSerializer, } from "@smithy/core/protocols";
|
|
2
|
-
import { NormalizedSchema, SCHEMA } from "@smithy/core/schema";
|
|
2
|
+
import { NormalizedSchema, SCHEMA, TypeRegistry } from "@smithy/core/schema";
|
|
3
3
|
import { ProtocolLib } from "../ProtocolLib";
|
|
4
4
|
import { loadRestXmlErrorCode } from "./parseXmlBody";
|
|
5
5
|
import { XmlCodec } from "./XmlCodec";
|
|
@@ -53,7 +53,8 @@ export class AwsRestXmlProtocol extends HttpBindingProtocol {
|
|
|
53
53
|
const { errorSchema, errorMetadata } = await this.mixin.getErrorSchemaOrThrowBaseException(errorIdentifier, this.options.defaultNamespace, response, dataObject, metadata);
|
|
54
54
|
const ns = NormalizedSchema.of(errorSchema);
|
|
55
55
|
const message = dataObject.Error?.message ?? dataObject.Error?.Message ?? dataObject.message ?? dataObject.Message ?? "Unknown";
|
|
56
|
-
const
|
|
56
|
+
const ErrorCtor = TypeRegistry.for(errorSchema.namespace).getErrorCtor(errorSchema) ?? Error;
|
|
57
|
+
const exception = new ErrorCtor(message);
|
|
57
58
|
await this.deserializeHttpMessage(errorSchema, context, response, dataObject);
|
|
58
59
|
const output = {};
|
|
59
60
|
for (const [name, member] of ns.structIterator()) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aws-sdk/core",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.899.0",
|
|
4
4
|
"description": "Core functions & classes shared by multiple AWS SDK clients.",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"build": "yarn lint && concurrently 'yarn:build:cjs' 'yarn:build:es' 'yarn:build:types'",
|
|
@@ -83,12 +83,12 @@
|
|
|
83
83
|
"dependencies": {
|
|
84
84
|
"@aws-sdk/types": "3.893.0",
|
|
85
85
|
"@aws-sdk/xml-builder": "3.894.0",
|
|
86
|
-
"@smithy/core": "^3.
|
|
86
|
+
"@smithy/core": "^3.13.0",
|
|
87
87
|
"@smithy/node-config-provider": "^4.2.2",
|
|
88
88
|
"@smithy/property-provider": "^4.1.1",
|
|
89
89
|
"@smithy/protocol-http": "^5.2.1",
|
|
90
90
|
"@smithy/signature-v4": "^5.2.1",
|
|
91
|
-
"@smithy/smithy-client": "^4.6.
|
|
91
|
+
"@smithy/smithy-client": "^4.6.5",
|
|
92
92
|
"@smithy/types": "^4.5.0",
|
|
93
93
|
"@smithy/util-base64": "^4.1.0",
|
|
94
94
|
"@smithy/util-middleware": "^4.1.1",
|