@jjrawlins/cdk-diff-pr-github-action 1.9.17 → 1.9.19

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.
Files changed (110) hide show
  1. package/.jsii +4 -4
  2. package/cdkdiffprgithubaction/jsii/jsii.go +2 -2
  3. package/cdkdiffprgithubaction/version +1 -1
  4. package/lib/CdkDiffIamTemplate.js +2 -2
  5. package/lib/CdkDiffIamTemplateStackSet.js +2 -2
  6. package/lib/CdkDiffStackWorkflow.js +1 -1
  7. package/lib/CdkDriftDetectionWorkflow.js +1 -1
  8. package/lib/CdkDriftIamTemplate.js +2 -2
  9. package/node_modules/@aws-sdk/client-cloudformation/package.json +5 -5
  10. package/node_modules/@aws-sdk/core/dist-cjs/index.js +54 -21
  11. package/node_modules/@aws-sdk/core/dist-cjs/submodules/protocols/index.js +54 -21
  12. package/node_modules/@aws-sdk/core/dist-es/submodules/protocols/ProtocolLib.js +24 -6
  13. package/node_modules/@aws-sdk/core/dist-es/submodules/protocols/cbor/AwsSmithyRpcV2CborProtocol.js +6 -5
  14. package/node_modules/@aws-sdk/core/dist-es/submodules/protocols/json/AwsJson1_0Protocol.js +2 -1
  15. package/node_modules/@aws-sdk/core/dist-es/submodules/protocols/json/AwsJson1_1Protocol.js +2 -1
  16. package/node_modules/@aws-sdk/core/dist-es/submodules/protocols/json/AwsJsonRpcProtocol.js +6 -4
  17. package/node_modules/@aws-sdk/core/dist-es/submodules/protocols/json/AwsRestJsonProtocol.js +6 -4
  18. package/node_modules/@aws-sdk/core/dist-es/submodules/protocols/query/AwsQueryProtocol.js +4 -2
  19. package/node_modules/@aws-sdk/core/dist-es/submodules/protocols/xml/AwsRestXmlProtocol.js +9 -3
  20. package/node_modules/@aws-sdk/core/dist-types/submodules/protocols/ProtocolLib.d.ts +13 -0
  21. package/node_modules/@aws-sdk/core/dist-types/submodules/protocols/cbor/AwsSmithyRpcV2CborProtocol.d.ts +3 -1
  22. package/node_modules/@aws-sdk/core/dist-types/submodules/protocols/json/AwsJson1_0Protocol.d.ts +3 -1
  23. package/node_modules/@aws-sdk/core/dist-types/submodules/protocols/json/AwsJson1_1Protocol.d.ts +3 -1
  24. package/node_modules/@aws-sdk/core/dist-types/submodules/protocols/json/AwsJsonRpcProtocol.d.ts +3 -1
  25. package/node_modules/@aws-sdk/core/dist-types/submodules/protocols/json/AwsRestJsonProtocol.d.ts +3 -1
  26. package/node_modules/@aws-sdk/core/dist-types/submodules/protocols/query/AwsEc2QueryProtocol.d.ts +3 -0
  27. package/node_modules/@aws-sdk/core/dist-types/submodules/protocols/query/AwsQueryProtocol.d.ts +3 -0
  28. package/node_modules/@aws-sdk/core/dist-types/submodules/protocols/xml/AwsRestXmlProtocol.d.ts +2 -0
  29. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/ProtocolLib.d.ts +6 -0
  30. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/cbor/AwsSmithyRpcV2CborProtocol.d.ts +3 -0
  31. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/json/AwsJson1_0Protocol.d.ts +3 -0
  32. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/json/AwsJson1_1Protocol.d.ts +3 -0
  33. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/json/AwsJsonRpcProtocol.d.ts +3 -0
  34. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/json/AwsRestJsonProtocol.d.ts +8 -1
  35. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/query/AwsEc2QueryProtocol.d.ts +3 -0
  36. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/query/AwsQueryProtocol.d.ts +3 -0
  37. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/xml/AwsRestXmlProtocol.d.ts +6 -1
  38. package/node_modules/@aws-sdk/core/package.json +1 -1
  39. package/node_modules/@aws-sdk/credential-provider-env/package.json +2 -2
  40. package/node_modules/@aws-sdk/credential-provider-http/package.json +2 -2
  41. package/node_modules/@aws-sdk/credential-provider-ini/package.json +9 -9
  42. package/node_modules/@aws-sdk/credential-provider-login/package.json +3 -3
  43. package/node_modules/@aws-sdk/credential-provider-node/package.json +7 -7
  44. package/node_modules/@aws-sdk/credential-provider-process/package.json +2 -2
  45. package/node_modules/@aws-sdk/credential-provider-sso/package.json +4 -4
  46. package/node_modules/@aws-sdk/credential-provider-web-identity/package.json +3 -3
  47. package/node_modules/@aws-sdk/middleware-user-agent/package.json +2 -2
  48. package/node_modules/@aws-sdk/nested-clients/package.json +4 -4
  49. package/node_modules/@aws-sdk/token-providers/package.json +3 -3
  50. package/node_modules/@aws-sdk/util-user-agent-node/package.json +2 -2
  51. package/node_modules/strnum/CHANGELOG.md +4 -0
  52. package/node_modules/strnum/package.json +1 -1
  53. package/node_modules/strnum/strnum.js +3 -2
  54. package/node_modules/strnum/tests/strnum_test.js +1 -0
  55. package/package.json +2 -2
  56. /package/node_modules/{fast-xml-parser → @aws-sdk/xml-builder/node_modules/fast-xml-parser}/CHANGELOG.md +0 -0
  57. /package/node_modules/{fast-xml-parser → @aws-sdk/xml-builder/node_modules/fast-xml-parser}/LICENSE +0 -0
  58. /package/node_modules/{fast-xml-parser → @aws-sdk/xml-builder/node_modules/fast-xml-parser}/README.md +0 -0
  59. /package/node_modules/{fast-xml-parser → @aws-sdk/xml-builder/node_modules/fast-xml-parser}/lib/fxbuilder.min.js +0 -0
  60. /package/node_modules/{fast-xml-parser → @aws-sdk/xml-builder/node_modules/fast-xml-parser}/lib/fxbuilder.min.js.map +0 -0
  61. /package/node_modules/{fast-xml-parser → @aws-sdk/xml-builder/node_modules/fast-xml-parser}/lib/fxp.cjs +0 -0
  62. /package/node_modules/{fast-xml-parser → @aws-sdk/xml-builder/node_modules/fast-xml-parser}/lib/fxp.d.cts +0 -0
  63. /package/node_modules/{fast-xml-parser → @aws-sdk/xml-builder/node_modules/fast-xml-parser}/lib/fxp.min.js +0 -0
  64. /package/node_modules/{fast-xml-parser → @aws-sdk/xml-builder/node_modules/fast-xml-parser}/lib/fxp.min.js.map +0 -0
  65. /package/node_modules/{fast-xml-parser → @aws-sdk/xml-builder/node_modules/fast-xml-parser}/lib/fxparser.min.js +0 -0
  66. /package/node_modules/{fast-xml-parser → @aws-sdk/xml-builder/node_modules/fast-xml-parser}/lib/fxparser.min.js.map +0 -0
  67. /package/node_modules/{fast-xml-parser → @aws-sdk/xml-builder/node_modules/fast-xml-parser}/lib/fxvalidator.min.js +0 -0
  68. /package/node_modules/{fast-xml-parser → @aws-sdk/xml-builder/node_modules/fast-xml-parser}/lib/fxvalidator.min.js.map +0 -0
  69. /package/node_modules/{fast-xml-parser → @aws-sdk/xml-builder/node_modules/fast-xml-parser}/lib/pem.d.cts +0 -0
  70. /package/node_modules/{fast-xml-parser → @aws-sdk/xml-builder/node_modules/fast-xml-parser}/package.json +0 -0
  71. /package/node_modules/{fast-xml-parser → @aws-sdk/xml-builder/node_modules/fast-xml-parser}/src/cli/cli.js +0 -0
  72. /package/node_modules/{fast-xml-parser → @aws-sdk/xml-builder/node_modules/fast-xml-parser}/src/cli/man.js +0 -0
  73. /package/node_modules/{fast-xml-parser → @aws-sdk/xml-builder/node_modules/fast-xml-parser}/src/cli/read.js +0 -0
  74. /package/node_modules/{fast-xml-parser → @aws-sdk/xml-builder/node_modules/fast-xml-parser}/src/fxp.d.ts +0 -0
  75. /package/node_modules/{fast-xml-parser → @aws-sdk/xml-builder/node_modules/fast-xml-parser}/src/fxp.js +0 -0
  76. /package/node_modules/{fast-xml-parser → @aws-sdk/xml-builder/node_modules/fast-xml-parser}/src/ignoreAttributes.js +0 -0
  77. /package/node_modules/{fast-xml-parser → @aws-sdk/xml-builder/node_modules/fast-xml-parser}/src/pem.d.ts +0 -0
  78. /package/node_modules/{fast-xml-parser → @aws-sdk/xml-builder/node_modules/fast-xml-parser}/src/util.js +0 -0
  79. /package/node_modules/{fast-xml-parser → @aws-sdk/xml-builder/node_modules/fast-xml-parser}/src/v6/CharsSymbol.js +0 -0
  80. /package/node_modules/{fast-xml-parser → @aws-sdk/xml-builder/node_modules/fast-xml-parser}/src/v6/EntitiesParser.js +0 -0
  81. /package/node_modules/{fast-xml-parser → @aws-sdk/xml-builder/node_modules/fast-xml-parser}/src/v6/OptionsBuilder.js +0 -0
  82. /package/node_modules/{fast-xml-parser → @aws-sdk/xml-builder/node_modules/fast-xml-parser}/src/v6/OutputBuilders/BaseOutputBuilder.js +0 -0
  83. /package/node_modules/{fast-xml-parser → @aws-sdk/xml-builder/node_modules/fast-xml-parser}/src/v6/OutputBuilders/JsArrBuilder.js +0 -0
  84. /package/node_modules/{fast-xml-parser → @aws-sdk/xml-builder/node_modules/fast-xml-parser}/src/v6/OutputBuilders/JsMinArrBuilder.js +0 -0
  85. /package/node_modules/{fast-xml-parser → @aws-sdk/xml-builder/node_modules/fast-xml-parser}/src/v6/OutputBuilders/JsObjBuilder.js +0 -0
  86. /package/node_modules/{fast-xml-parser → @aws-sdk/xml-builder/node_modules/fast-xml-parser}/src/v6/OutputBuilders/ParserOptionsBuilder.js +0 -0
  87. /package/node_modules/{fast-xml-parser → @aws-sdk/xml-builder/node_modules/fast-xml-parser}/src/v6/Report.js +0 -0
  88. /package/node_modules/{fast-xml-parser → @aws-sdk/xml-builder/node_modules/fast-xml-parser}/src/v6/TagPath.js +0 -0
  89. /package/node_modules/{fast-xml-parser → @aws-sdk/xml-builder/node_modules/fast-xml-parser}/src/v6/TagPathMatcher.js +0 -0
  90. /package/node_modules/{fast-xml-parser → @aws-sdk/xml-builder/node_modules/fast-xml-parser}/src/v6/XMLParser.js +0 -0
  91. /package/node_modules/{fast-xml-parser → @aws-sdk/xml-builder/node_modules/fast-xml-parser}/src/v6/Xml2JsParser.js +0 -0
  92. /package/node_modules/{fast-xml-parser → @aws-sdk/xml-builder/node_modules/fast-xml-parser}/src/v6/XmlPartReader.js +0 -0
  93. /package/node_modules/{fast-xml-parser → @aws-sdk/xml-builder/node_modules/fast-xml-parser}/src/v6/XmlSpecialTagsReader.js +0 -0
  94. /package/node_modules/{fast-xml-parser → @aws-sdk/xml-builder/node_modules/fast-xml-parser}/src/v6/inputSource/BufferSource.js +0 -0
  95. /package/node_modules/{fast-xml-parser → @aws-sdk/xml-builder/node_modules/fast-xml-parser}/src/v6/inputSource/StringSource.js +0 -0
  96. /package/node_modules/{fast-xml-parser → @aws-sdk/xml-builder/node_modules/fast-xml-parser}/src/v6/valueParsers/EntitiesParser.js +0 -0
  97. /package/node_modules/{fast-xml-parser → @aws-sdk/xml-builder/node_modules/fast-xml-parser}/src/v6/valueParsers/booleanParser.js +0 -0
  98. /package/node_modules/{fast-xml-parser → @aws-sdk/xml-builder/node_modules/fast-xml-parser}/src/v6/valueParsers/booleanParserExt.js +0 -0
  99. /package/node_modules/{fast-xml-parser → @aws-sdk/xml-builder/node_modules/fast-xml-parser}/src/v6/valueParsers/currency.js +0 -0
  100. /package/node_modules/{fast-xml-parser → @aws-sdk/xml-builder/node_modules/fast-xml-parser}/src/v6/valueParsers/join.js +0 -0
  101. /package/node_modules/{fast-xml-parser → @aws-sdk/xml-builder/node_modules/fast-xml-parser}/src/v6/valueParsers/number.js +0 -0
  102. /package/node_modules/{fast-xml-parser → @aws-sdk/xml-builder/node_modules/fast-xml-parser}/src/v6/valueParsers/trim.js +0 -0
  103. /package/node_modules/{fast-xml-parser → @aws-sdk/xml-builder/node_modules/fast-xml-parser}/src/validator.js +0 -0
  104. /package/node_modules/{fast-xml-parser → @aws-sdk/xml-builder/node_modules/fast-xml-parser}/src/xmlbuilder/json2xml.js +0 -0
  105. /package/node_modules/{fast-xml-parser → @aws-sdk/xml-builder/node_modules/fast-xml-parser}/src/xmlparser/DocTypeReader.js +0 -0
  106. /package/node_modules/{fast-xml-parser → @aws-sdk/xml-builder/node_modules/fast-xml-parser}/src/xmlparser/OptionsBuilder.js +0 -0
  107. /package/node_modules/{fast-xml-parser → @aws-sdk/xml-builder/node_modules/fast-xml-parser}/src/xmlparser/OrderedObjParser.js +0 -0
  108. /package/node_modules/{fast-xml-parser → @aws-sdk/xml-builder/node_modules/fast-xml-parser}/src/xmlparser/XMLParser.js +0 -0
  109. /package/node_modules/{fast-xml-parser → @aws-sdk/xml-builder/node_modules/fast-xml-parser}/src/xmlparser/node2json.js +0 -0
  110. /package/node_modules/{fast-xml-parser → @aws-sdk/xml-builder/node_modules/fast-xml-parser}/src/xmlparser/xmlNode.js +0 -0
@@ -11,6 +11,7 @@ var xmlBuilder = require('@aws-sdk/xml-builder');
11
11
 
12
12
  class ProtocolLib {
13
13
  queryCompat;
14
+ errorRegistry;
14
15
  constructor(queryCompat = false) {
15
16
  this.queryCompat = queryCompat;
16
17
  }
@@ -46,30 +47,47 @@ class ProtocolLib {
46
47
  }
47
48
  }
48
49
  async getErrorSchemaOrThrowBaseException(errorIdentifier, defaultNamespace, response, dataObject, metadata, getErrorSchema) {
49
- let namespace = defaultNamespace;
50
50
  let errorName = errorIdentifier;
51
51
  if (errorIdentifier.includes("#")) {
52
- [namespace, errorName] = errorIdentifier.split("#");
52
+ [, errorName] = errorIdentifier.split("#");
53
53
  }
54
54
  const errorMetadata = {
55
55
  $metadata: metadata,
56
56
  $fault: response.statusCode < 500 ? "client" : "server",
57
57
  };
58
- const registry = schema.TypeRegistry.for(namespace);
58
+ if (!this.errorRegistry) {
59
+ throw new Error("@aws-sdk/core/protocols - error handler not initialized.");
60
+ }
59
61
  try {
60
- const errorSchema = getErrorSchema?.(registry, errorName) ?? registry.getSchema(errorIdentifier);
62
+ const errorSchema = getErrorSchema?.(this.errorRegistry, errorName) ??
63
+ this.errorRegistry.getSchema(errorIdentifier);
61
64
  return { errorSchema, errorMetadata };
62
65
  }
63
66
  catch (e) {
64
67
  dataObject.message = dataObject.message ?? dataObject.Message ?? "UnknownError";
65
- const synthetic = schema.TypeRegistry.for("smithy.ts.sdk.synthetic." + namespace);
68
+ const synthetic = this.errorRegistry;
66
69
  const baseExceptionSchema = synthetic.getBaseException();
67
70
  if (baseExceptionSchema) {
68
71
  const ErrorCtor = synthetic.getErrorCtor(baseExceptionSchema) ?? Error;
69
72
  throw this.decorateServiceException(Object.assign(new ErrorCtor({ name: errorName }), errorMetadata), dataObject);
70
73
  }
71
- throw this.decorateServiceException(Object.assign(new Error(errorName), errorMetadata), dataObject);
74
+ const d = dataObject;
75
+ const message = d?.message ?? d?.Message ?? d?.Error?.Message ?? d?.Error?.message;
76
+ throw this.decorateServiceException(Object.assign(new Error(message), {
77
+ name: errorName,
78
+ }, errorMetadata), dataObject);
79
+ }
80
+ }
81
+ compose(composite, errorIdentifier, defaultNamespace) {
82
+ let namespace = defaultNamespace;
83
+ if (errorIdentifier.includes("#")) {
84
+ [namespace] = errorIdentifier.split("#");
72
85
  }
86
+ const staticRegistry = schema.TypeRegistry.for(namespace);
87
+ const defaultSyntheticRegistry = schema.TypeRegistry.for("smithy.ts.sdk.synthetic." + defaultNamespace);
88
+ composite.copyFrom(staticRegistry);
89
+ composite.copyFrom(defaultSyntheticRegistry);
90
+ this.errorRegistry = composite;
73
91
  }
74
92
  decorateServiceException(exception, additions = {}) {
75
93
  if (this.queryCompat) {
@@ -133,8 +151,8 @@ class ProtocolLib {
133
151
  class AwsSmithyRpcV2CborProtocol extends cbor.SmithyRpcV2CborProtocol {
134
152
  awsQueryCompatible;
135
153
  mixin;
136
- constructor({ defaultNamespace, awsQueryCompatible, }) {
137
- super({ defaultNamespace });
154
+ constructor({ defaultNamespace, errorTypeRegistries, awsQueryCompatible, }) {
155
+ super({ defaultNamespace, errorTypeRegistries });
138
156
  this.awsQueryCompatible = !!awsQueryCompatible;
139
157
  this.mixin = new ProtocolLib(this.awsQueryCompatible);
140
158
  }
@@ -156,10 +174,11 @@ class AwsSmithyRpcV2CborProtocol extends cbor.SmithyRpcV2CborProtocol {
156
174
  }
157
175
  return cbor.loadSmithyRpcV2CborErrorCode(response, dataObject) ?? "Unknown";
158
176
  })();
177
+ this.mixin.compose(this.compositeErrorRegistry, errorName, this.options.defaultNamespace);
159
178
  const { errorSchema, errorMetadata } = await this.mixin.getErrorSchemaOrThrowBaseException(errorName, this.options.defaultNamespace, response, dataObject, metadata, this.awsQueryCompatible ? this.mixin.findQueryCompatibleError : undefined);
160
179
  const ns = schema.NormalizedSchema.of(errorSchema);
161
- const message = dataObject.message ?? dataObject.Message ?? "Unknown";
162
- const ErrorCtor = schema.TypeRegistry.for(errorSchema[1]).getErrorCtor(errorSchema) ?? Error;
180
+ const message = dataObject.message ?? dataObject.Message ?? "UnknownError";
181
+ const ErrorCtor = this.compositeErrorRegistry.getErrorCtor(errorSchema) ?? Error;
163
182
  const exception = new ErrorCtor(message);
164
183
  const output = {};
165
184
  for (const [name, member] of ns.structIterator()) {
@@ -716,9 +735,10 @@ class AwsJsonRpcProtocol extends protocols.RpcProtocol {
716
735
  codec;
717
736
  mixin;
718
737
  awsQueryCompatible;
719
- constructor({ defaultNamespace, serviceTarget, awsQueryCompatible, jsonCodec, }) {
738
+ constructor({ defaultNamespace, errorTypeRegistries, serviceTarget, awsQueryCompatible, jsonCodec, }) {
720
739
  super({
721
740
  defaultNamespace,
741
+ errorTypeRegistries,
722
742
  });
723
743
  this.serviceTarget = serviceTarget;
724
744
  this.codec =
@@ -760,10 +780,11 @@ class AwsJsonRpcProtocol extends protocols.RpcProtocol {
760
780
  this.mixin.setQueryCompatError(dataObject, response);
761
781
  }
762
782
  const errorIdentifier = loadRestJsonErrorCode(response, dataObject) ?? "Unknown";
783
+ this.mixin.compose(this.compositeErrorRegistry, errorIdentifier, this.options.defaultNamespace);
763
784
  const { errorSchema, errorMetadata } = await this.mixin.getErrorSchemaOrThrowBaseException(errorIdentifier, this.options.defaultNamespace, response, dataObject, metadata, this.awsQueryCompatible ? this.mixin.findQueryCompatibleError : undefined);
764
785
  const ns = schema.NormalizedSchema.of(errorSchema);
765
- const message = dataObject.message ?? dataObject.Message ?? "Unknown";
766
- const ErrorCtor = schema.TypeRegistry.for(errorSchema[1]).getErrorCtor(errorSchema) ?? Error;
786
+ const message = dataObject.message ?? dataObject.Message ?? "UnknownError";
787
+ const ErrorCtor = this.compositeErrorRegistry.getErrorCtor(errorSchema) ?? Error;
767
788
  const exception = new ErrorCtor(message);
768
789
  const output = {};
769
790
  for (const [name, member] of ns.structIterator()) {
@@ -782,9 +803,10 @@ class AwsJsonRpcProtocol extends protocols.RpcProtocol {
782
803
  }
783
804
 
784
805
  class AwsJson1_0Protocol extends AwsJsonRpcProtocol {
785
- constructor({ defaultNamespace, serviceTarget, awsQueryCompatible, jsonCodec, }) {
806
+ constructor({ defaultNamespace, errorTypeRegistries, serviceTarget, awsQueryCompatible, jsonCodec, }) {
786
807
  super({
787
808
  defaultNamespace,
809
+ errorTypeRegistries,
788
810
  serviceTarget,
789
811
  awsQueryCompatible,
790
812
  jsonCodec,
@@ -802,9 +824,10 @@ class AwsJson1_0Protocol extends AwsJsonRpcProtocol {
802
824
  }
803
825
 
804
826
  class AwsJson1_1Protocol extends AwsJsonRpcProtocol {
805
- constructor({ defaultNamespace, serviceTarget, awsQueryCompatible, jsonCodec, }) {
827
+ constructor({ defaultNamespace, errorTypeRegistries, serviceTarget, awsQueryCompatible, jsonCodec, }) {
806
828
  super({
807
829
  defaultNamespace,
830
+ errorTypeRegistries,
808
831
  serviceTarget,
809
832
  awsQueryCompatible,
810
833
  jsonCodec,
@@ -826,9 +849,10 @@ class AwsRestJsonProtocol extends protocols.HttpBindingProtocol {
826
849
  deserializer;
827
850
  codec;
828
851
  mixin = new ProtocolLib();
829
- constructor({ defaultNamespace }) {
852
+ constructor({ defaultNamespace, errorTypeRegistries, }) {
830
853
  super({
831
854
  defaultNamespace,
855
+ errorTypeRegistries,
832
856
  });
833
857
  const settings = {
834
858
  timestampFormat: {
@@ -878,10 +902,11 @@ class AwsRestJsonProtocol extends protocols.HttpBindingProtocol {
878
902
  }
879
903
  async handleError(operationSchema, context, response, dataObject, metadata) {
880
904
  const errorIdentifier = loadRestJsonErrorCode(response, dataObject) ?? "Unknown";
905
+ this.mixin.compose(this.compositeErrorRegistry, errorIdentifier, this.options.defaultNamespace);
881
906
  const { errorSchema, errorMetadata } = await this.mixin.getErrorSchemaOrThrowBaseException(errorIdentifier, this.options.defaultNamespace, response, dataObject, metadata);
882
907
  const ns = schema.NormalizedSchema.of(errorSchema);
883
- const message = dataObject.message ?? dataObject.Message ?? "Unknown";
884
- const ErrorCtor = schema.TypeRegistry.for(errorSchema[1]).getErrorCtor(errorSchema) ?? Error;
908
+ const message = dataObject.message ?? dataObject.Message ?? "UnknownError";
909
+ const ErrorCtor = this.compositeErrorRegistry.getErrorCtor(errorSchema) ?? Error;
885
910
  const exception = new ErrorCtor(message);
886
911
  await this.deserializeHttpMessage(errorSchema, context, response, dataObject);
887
912
  const output = {};
@@ -1247,6 +1272,7 @@ class AwsQueryProtocol extends protocols.RpcProtocol {
1247
1272
  constructor(options) {
1248
1273
  super({
1249
1274
  defaultNamespace: options.defaultNamespace,
1275
+ errorTypeRegistries: options.errorTypeRegistries,
1250
1276
  });
1251
1277
  this.options = options;
1252
1278
  const settings = {
@@ -1323,6 +1349,7 @@ class AwsQueryProtocol extends protocols.RpcProtocol {
1323
1349
  }
1324
1350
  async handleError(operationSchema, context, response, dataObject, metadata) {
1325
1351
  const errorIdentifier = this.loadQueryErrorCode(response, dataObject) ?? "Unknown";
1352
+ this.mixin.compose(this.compositeErrorRegistry, errorIdentifier, this.options.defaultNamespace);
1326
1353
  const errorData = this.loadQueryError(dataObject) ?? {};
1327
1354
  const message = this.loadQueryErrorMessage(dataObject);
1328
1355
  errorData.message = message;
@@ -1333,7 +1360,7 @@ class AwsQueryProtocol extends protocols.RpcProtocol {
1333
1360
  };
1334
1361
  const { errorSchema, errorMetadata } = await this.mixin.getErrorSchemaOrThrowBaseException(errorIdentifier, this.options.defaultNamespace, response, errorData, metadata, this.mixin.findQueryCompatibleError);
1335
1362
  const ns = schema.NormalizedSchema.of(errorSchema);
1336
- const ErrorCtor = schema.TypeRegistry.for(errorSchema[1]).getErrorCtor(errorSchema) ?? Error;
1363
+ const ErrorCtor = this.compositeErrorRegistry.getErrorCtor(errorSchema) ?? Error;
1337
1364
  const exception = new ErrorCtor(message);
1338
1365
  const output = {
1339
1366
  Type: errorData.Error.Type,
@@ -1762,6 +1789,7 @@ class AwsRestXmlProtocol extends protocols.HttpBindingProtocol {
1762
1789
  this.codec = new XmlCodec(settings);
1763
1790
  this.serializer = new protocols.HttpInterceptingShapeSerializer(this.codec.createSerializer(), settings);
1764
1791
  this.deserializer = new protocols.HttpInterceptingShapeDeserializer(this.codec.createDeserializer(), settings);
1792
+ this.compositeErrorRegistry;
1765
1793
  }
1766
1794
  getPayloadCodec() {
1767
1795
  return this.codec;
@@ -1791,6 +1819,7 @@ class AwsRestXmlProtocol extends protocols.HttpBindingProtocol {
1791
1819
  }
1792
1820
  async handleError(operationSchema, context, response, dataObject, metadata) {
1793
1821
  const errorIdentifier = loadRestXmlErrorCode(response, dataObject) ?? "Unknown";
1822
+ this.mixin.compose(this.compositeErrorRegistry, errorIdentifier, this.options.defaultNamespace);
1794
1823
  if (dataObject.Error && typeof dataObject.Error === "object") {
1795
1824
  for (const key of Object.keys(dataObject.Error)) {
1796
1825
  dataObject[key] = dataObject.Error[key];
@@ -1804,8 +1833,12 @@ class AwsRestXmlProtocol extends protocols.HttpBindingProtocol {
1804
1833
  }
1805
1834
  const { errorSchema, errorMetadata } = await this.mixin.getErrorSchemaOrThrowBaseException(errorIdentifier, this.options.defaultNamespace, response, dataObject, metadata);
1806
1835
  const ns = schema.NormalizedSchema.of(errorSchema);
1807
- const message = dataObject.Error?.message ?? dataObject.Error?.Message ?? dataObject.message ?? dataObject.Message ?? "Unknown";
1808
- const ErrorCtor = schema.TypeRegistry.for(errorSchema[1]).getErrorCtor(errorSchema) ?? Error;
1836
+ const message = dataObject.Error?.message ??
1837
+ dataObject.Error?.Message ??
1838
+ dataObject.message ??
1839
+ dataObject.Message ??
1840
+ "UnknownError";
1841
+ const ErrorCtor = this.compositeErrorRegistry.getErrorCtor(errorSchema) ?? Error;
1809
1842
  const exception = new ErrorCtor(message);
1810
1843
  await this.deserializeHttpMessage(errorSchema, context, response, dataObject);
1811
1844
  const output = {};
@@ -2,6 +2,7 @@ import { NormalizedSchema, TypeRegistry } from "@smithy/core/schema";
2
2
  import { decorateServiceException } from "@smithy/smithy-client";
3
3
  export class ProtocolLib {
4
4
  queryCompat;
5
+ errorRegistry;
5
6
  constructor(queryCompat = false) {
6
7
  this.queryCompat = queryCompat;
7
8
  }
@@ -37,30 +38,47 @@ export class ProtocolLib {
37
38
  }
38
39
  }
39
40
  async getErrorSchemaOrThrowBaseException(errorIdentifier, defaultNamespace, response, dataObject, metadata, getErrorSchema) {
40
- let namespace = defaultNamespace;
41
41
  let errorName = errorIdentifier;
42
42
  if (errorIdentifier.includes("#")) {
43
- [namespace, errorName] = errorIdentifier.split("#");
43
+ [, errorName] = errorIdentifier.split("#");
44
44
  }
45
45
  const errorMetadata = {
46
46
  $metadata: metadata,
47
47
  $fault: response.statusCode < 500 ? "client" : "server",
48
48
  };
49
- const registry = TypeRegistry.for(namespace);
49
+ if (!this.errorRegistry) {
50
+ throw new Error("@aws-sdk/core/protocols - error handler not initialized.");
51
+ }
50
52
  try {
51
- const errorSchema = getErrorSchema?.(registry, errorName) ?? registry.getSchema(errorIdentifier);
53
+ const errorSchema = getErrorSchema?.(this.errorRegistry, errorName) ??
54
+ this.errorRegistry.getSchema(errorIdentifier);
52
55
  return { errorSchema, errorMetadata };
53
56
  }
54
57
  catch (e) {
55
58
  dataObject.message = dataObject.message ?? dataObject.Message ?? "UnknownError";
56
- const synthetic = TypeRegistry.for("smithy.ts.sdk.synthetic." + namespace);
59
+ const synthetic = this.errorRegistry;
57
60
  const baseExceptionSchema = synthetic.getBaseException();
58
61
  if (baseExceptionSchema) {
59
62
  const ErrorCtor = synthetic.getErrorCtor(baseExceptionSchema) ?? Error;
60
63
  throw this.decorateServiceException(Object.assign(new ErrorCtor({ name: errorName }), errorMetadata), dataObject);
61
64
  }
62
- throw this.decorateServiceException(Object.assign(new Error(errorName), errorMetadata), dataObject);
65
+ const d = dataObject;
66
+ const message = d?.message ?? d?.Message ?? d?.Error?.Message ?? d?.Error?.message;
67
+ throw this.decorateServiceException(Object.assign(new Error(message), {
68
+ name: errorName,
69
+ }, errorMetadata), dataObject);
70
+ }
71
+ }
72
+ compose(composite, errorIdentifier, defaultNamespace) {
73
+ let namespace = defaultNamespace;
74
+ if (errorIdentifier.includes("#")) {
75
+ [namespace] = errorIdentifier.split("#");
63
76
  }
77
+ const staticRegistry = TypeRegistry.for(namespace);
78
+ const defaultSyntheticRegistry = TypeRegistry.for("smithy.ts.sdk.synthetic." + defaultNamespace);
79
+ composite.copyFrom(staticRegistry);
80
+ composite.copyFrom(defaultSyntheticRegistry);
81
+ this.errorRegistry = composite;
64
82
  }
65
83
  decorateServiceException(exception, additions = {}) {
66
84
  if (this.queryCompat) {
@@ -1,11 +1,11 @@
1
1
  import { loadSmithyRpcV2CborErrorCode, SmithyRpcV2CborProtocol } from "@smithy/core/cbor";
2
- import { NormalizedSchema, TypeRegistry } from "@smithy/core/schema";
2
+ import { NormalizedSchema } from "@smithy/core/schema";
3
3
  import { ProtocolLib } from "../ProtocolLib";
4
4
  export class AwsSmithyRpcV2CborProtocol extends SmithyRpcV2CborProtocol {
5
5
  awsQueryCompatible;
6
6
  mixin;
7
- constructor({ defaultNamespace, awsQueryCompatible, }) {
8
- super({ defaultNamespace });
7
+ constructor({ defaultNamespace, errorTypeRegistries, awsQueryCompatible, }) {
8
+ super({ defaultNamespace, errorTypeRegistries });
9
9
  this.awsQueryCompatible = !!awsQueryCompatible;
10
10
  this.mixin = new ProtocolLib(this.awsQueryCompatible);
11
11
  }
@@ -27,10 +27,11 @@ export class AwsSmithyRpcV2CborProtocol extends SmithyRpcV2CborProtocol {
27
27
  }
28
28
  return loadSmithyRpcV2CborErrorCode(response, dataObject) ?? "Unknown";
29
29
  })();
30
+ this.mixin.compose(this.compositeErrorRegistry, errorName, this.options.defaultNamespace);
30
31
  const { errorSchema, errorMetadata } = await this.mixin.getErrorSchemaOrThrowBaseException(errorName, this.options.defaultNamespace, response, dataObject, metadata, this.awsQueryCompatible ? this.mixin.findQueryCompatibleError : undefined);
31
32
  const ns = NormalizedSchema.of(errorSchema);
32
- const message = dataObject.message ?? dataObject.Message ?? "Unknown";
33
- const ErrorCtor = TypeRegistry.for(errorSchema[1]).getErrorCtor(errorSchema) ?? Error;
33
+ const message = dataObject.message ?? dataObject.Message ?? "UnknownError";
34
+ const ErrorCtor = this.compositeErrorRegistry.getErrorCtor(errorSchema) ?? Error;
34
35
  const exception = new ErrorCtor(message);
35
36
  const output = {};
36
37
  for (const [name, member] of ns.structIterator()) {
@@ -1,8 +1,9 @@
1
1
  import { AwsJsonRpcProtocol } from "./AwsJsonRpcProtocol";
2
2
  export class AwsJson1_0Protocol extends AwsJsonRpcProtocol {
3
- constructor({ defaultNamespace, serviceTarget, awsQueryCompatible, jsonCodec, }) {
3
+ constructor({ defaultNamespace, errorTypeRegistries, serviceTarget, awsQueryCompatible, jsonCodec, }) {
4
4
  super({
5
5
  defaultNamespace,
6
+ errorTypeRegistries,
6
7
  serviceTarget,
7
8
  awsQueryCompatible,
8
9
  jsonCodec,
@@ -1,8 +1,9 @@
1
1
  import { AwsJsonRpcProtocol } from "./AwsJsonRpcProtocol";
2
2
  export class AwsJson1_1Protocol extends AwsJsonRpcProtocol {
3
- constructor({ defaultNamespace, serviceTarget, awsQueryCompatible, jsonCodec, }) {
3
+ constructor({ defaultNamespace, errorTypeRegistries, serviceTarget, awsQueryCompatible, jsonCodec, }) {
4
4
  super({
5
5
  defaultNamespace,
6
+ errorTypeRegistries,
6
7
  serviceTarget,
7
8
  awsQueryCompatible,
8
9
  jsonCodec,
@@ -1,5 +1,5 @@
1
1
  import { RpcProtocol } from "@smithy/core/protocols";
2
- import { deref, NormalizedSchema, TypeRegistry } from "@smithy/core/schema";
2
+ import { deref, NormalizedSchema } from "@smithy/core/schema";
3
3
  import { ProtocolLib } from "../ProtocolLib";
4
4
  import { JsonCodec } from "./JsonCodec";
5
5
  import { loadRestJsonErrorCode } from "./parseJsonBody";
@@ -10,9 +10,10 @@ export class AwsJsonRpcProtocol extends RpcProtocol {
10
10
  codec;
11
11
  mixin;
12
12
  awsQueryCompatible;
13
- constructor({ defaultNamespace, serviceTarget, awsQueryCompatible, jsonCodec, }) {
13
+ constructor({ defaultNamespace, errorTypeRegistries, serviceTarget, awsQueryCompatible, jsonCodec, }) {
14
14
  super({
15
15
  defaultNamespace,
16
+ errorTypeRegistries,
16
17
  });
17
18
  this.serviceTarget = serviceTarget;
18
19
  this.codec =
@@ -54,10 +55,11 @@ export class AwsJsonRpcProtocol extends RpcProtocol {
54
55
  this.mixin.setQueryCompatError(dataObject, response);
55
56
  }
56
57
  const errorIdentifier = loadRestJsonErrorCode(response, dataObject) ?? "Unknown";
58
+ this.mixin.compose(this.compositeErrorRegistry, errorIdentifier, this.options.defaultNamespace);
57
59
  const { errorSchema, errorMetadata } = await this.mixin.getErrorSchemaOrThrowBaseException(errorIdentifier, this.options.defaultNamespace, response, dataObject, metadata, this.awsQueryCompatible ? this.mixin.findQueryCompatibleError : undefined);
58
60
  const ns = NormalizedSchema.of(errorSchema);
59
- const message = dataObject.message ?? dataObject.Message ?? "Unknown";
60
- const ErrorCtor = TypeRegistry.for(errorSchema[1]).getErrorCtor(errorSchema) ?? Error;
61
+ const message = dataObject.message ?? dataObject.Message ?? "UnknownError";
62
+ const ErrorCtor = this.compositeErrorRegistry.getErrorCtor(errorSchema) ?? Error;
61
63
  const exception = new ErrorCtor(message);
62
64
  const output = {};
63
65
  for (const [name, member] of ns.structIterator()) {
@@ -1,5 +1,5 @@
1
1
  import { HttpBindingProtocol, HttpInterceptingShapeDeserializer, HttpInterceptingShapeSerializer, } from "@smithy/core/protocols";
2
- import { NormalizedSchema, TypeRegistry } from "@smithy/core/schema";
2
+ import { NormalizedSchema } from "@smithy/core/schema";
3
3
  import { ProtocolLib } from "../ProtocolLib";
4
4
  import { JsonCodec } from "./JsonCodec";
5
5
  import { loadRestJsonErrorCode } from "./parseJsonBody";
@@ -8,9 +8,10 @@ export class AwsRestJsonProtocol extends HttpBindingProtocol {
8
8
  deserializer;
9
9
  codec;
10
10
  mixin = new ProtocolLib();
11
- constructor({ defaultNamespace }) {
11
+ constructor({ defaultNamespace, errorTypeRegistries, }) {
12
12
  super({
13
13
  defaultNamespace,
14
+ errorTypeRegistries,
14
15
  });
15
16
  const settings = {
16
17
  timestampFormat: {
@@ -60,10 +61,11 @@ export class AwsRestJsonProtocol extends HttpBindingProtocol {
60
61
  }
61
62
  async handleError(operationSchema, context, response, dataObject, metadata) {
62
63
  const errorIdentifier = loadRestJsonErrorCode(response, dataObject) ?? "Unknown";
64
+ this.mixin.compose(this.compositeErrorRegistry, errorIdentifier, this.options.defaultNamespace);
63
65
  const { errorSchema, errorMetadata } = await this.mixin.getErrorSchemaOrThrowBaseException(errorIdentifier, this.options.defaultNamespace, response, dataObject, metadata);
64
66
  const ns = NormalizedSchema.of(errorSchema);
65
- const message = dataObject.message ?? dataObject.Message ?? "Unknown";
66
- const ErrorCtor = TypeRegistry.for(errorSchema[1]).getErrorCtor(errorSchema) ?? Error;
67
+ const message = dataObject.message ?? dataObject.Message ?? "UnknownError";
68
+ const ErrorCtor = this.compositeErrorRegistry.getErrorCtor(errorSchema) ?? Error;
67
69
  const exception = new ErrorCtor(message);
68
70
  await this.deserializeHttpMessage(errorSchema, context, response, dataObject);
69
71
  const output = {};
@@ -1,5 +1,5 @@
1
1
  import { collectBody, RpcProtocol } from "@smithy/core/protocols";
2
- import { deref, NormalizedSchema, TypeRegistry } from "@smithy/core/schema";
2
+ import { deref, NormalizedSchema } from "@smithy/core/schema";
3
3
  import { ProtocolLib } from "../ProtocolLib";
4
4
  import { XmlShapeDeserializer } from "../xml/XmlShapeDeserializer";
5
5
  import { QueryShapeSerializer } from "./QueryShapeSerializer";
@@ -11,6 +11,7 @@ export class AwsQueryProtocol extends RpcProtocol {
11
11
  constructor(options) {
12
12
  super({
13
13
  defaultNamespace: options.defaultNamespace,
14
+ errorTypeRegistries: options.errorTypeRegistries,
14
15
  });
15
16
  this.options = options;
16
17
  const settings = {
@@ -87,6 +88,7 @@ export class AwsQueryProtocol extends RpcProtocol {
87
88
  }
88
89
  async handleError(operationSchema, context, response, dataObject, metadata) {
89
90
  const errorIdentifier = this.loadQueryErrorCode(response, dataObject) ?? "Unknown";
91
+ this.mixin.compose(this.compositeErrorRegistry, errorIdentifier, this.options.defaultNamespace);
90
92
  const errorData = this.loadQueryError(dataObject) ?? {};
91
93
  const message = this.loadQueryErrorMessage(dataObject);
92
94
  errorData.message = message;
@@ -97,7 +99,7 @@ export class AwsQueryProtocol extends RpcProtocol {
97
99
  };
98
100
  const { errorSchema, errorMetadata } = await this.mixin.getErrorSchemaOrThrowBaseException(errorIdentifier, this.options.defaultNamespace, response, errorData, metadata, this.mixin.findQueryCompatibleError);
99
101
  const ns = NormalizedSchema.of(errorSchema);
100
- const ErrorCtor = TypeRegistry.for(errorSchema[1]).getErrorCtor(errorSchema) ?? Error;
102
+ const ErrorCtor = this.compositeErrorRegistry.getErrorCtor(errorSchema) ?? Error;
101
103
  const exception = new ErrorCtor(message);
102
104
  const output = {
103
105
  Type: errorData.Error.Type,
@@ -1,5 +1,5 @@
1
1
  import { HttpBindingProtocol, HttpInterceptingShapeDeserializer, HttpInterceptingShapeSerializer, } from "@smithy/core/protocols";
2
- import { NormalizedSchema, TypeRegistry } from "@smithy/core/schema";
2
+ import { NormalizedSchema } from "@smithy/core/schema";
3
3
  import { ProtocolLib } from "../ProtocolLib";
4
4
  import { loadRestXmlErrorCode } from "./parseXmlBody";
5
5
  import { XmlCodec } from "./XmlCodec";
@@ -22,6 +22,7 @@ export class AwsRestXmlProtocol extends HttpBindingProtocol {
22
22
  this.codec = new XmlCodec(settings);
23
23
  this.serializer = new HttpInterceptingShapeSerializer(this.codec.createSerializer(), settings);
24
24
  this.deserializer = new HttpInterceptingShapeDeserializer(this.codec.createDeserializer(), settings);
25
+ this.compositeErrorRegistry;
25
26
  }
26
27
  getPayloadCodec() {
27
28
  return this.codec;
@@ -51,6 +52,7 @@ export class AwsRestXmlProtocol extends HttpBindingProtocol {
51
52
  }
52
53
  async handleError(operationSchema, context, response, dataObject, metadata) {
53
54
  const errorIdentifier = loadRestXmlErrorCode(response, dataObject) ?? "Unknown";
55
+ this.mixin.compose(this.compositeErrorRegistry, errorIdentifier, this.options.defaultNamespace);
54
56
  if (dataObject.Error && typeof dataObject.Error === "object") {
55
57
  for (const key of Object.keys(dataObject.Error)) {
56
58
  dataObject[key] = dataObject.Error[key];
@@ -64,8 +66,12 @@ export class AwsRestXmlProtocol extends HttpBindingProtocol {
64
66
  }
65
67
  const { errorSchema, errorMetadata } = await this.mixin.getErrorSchemaOrThrowBaseException(errorIdentifier, this.options.defaultNamespace, response, dataObject, metadata);
66
68
  const ns = NormalizedSchema.of(errorSchema);
67
- const message = dataObject.Error?.message ?? dataObject.Error?.Message ?? dataObject.message ?? dataObject.Message ?? "Unknown";
68
- const ErrorCtor = TypeRegistry.for(errorSchema[1]).getErrorCtor(errorSchema) ?? Error;
69
+ const message = dataObject.Error?.message ??
70
+ dataObject.Error?.Message ??
71
+ dataObject.message ??
72
+ dataObject.Message ??
73
+ "UnknownError";
74
+ const ErrorCtor = this.compositeErrorRegistry.getErrorCtor(errorSchema) ?? Error;
69
75
  const exception = new ErrorCtor(message);
70
76
  await this.deserializeHttpMessage(errorSchema, context, response, dataObject);
71
77
  const output = {};
@@ -14,6 +14,7 @@ type ErrorMetadataBearer = MetadataBearer & {
14
14
  */
15
15
  export declare class ProtocolLib {
16
16
  private queryCompat;
17
+ private errorRegistry?;
17
18
  constructor(queryCompat?: boolean);
18
19
  /**
19
20
  * This is only for REST protocols.
@@ -34,6 +35,18 @@ export declare class ProtocolLib {
34
35
  errorSchema: StaticErrorSchema;
35
36
  errorMetadata: ErrorMetadataBearer;
36
37
  }>;
38
+ /**
39
+ * This method exists because in older clients, no `errorTypeRegistries` array is provided to the Protocol
40
+ * implementation. This means that the TypeRegistry queried by the error's namespace or the service's defaultNamespace
41
+ * must be composed into the possibly-empty local compositeErrorRegistry.
42
+ *
43
+ *
44
+ * @param composite - TypeRegistry instance local to instances of HttpProtocol. In newer clients, this instance directly
45
+ * receives the error registries exported by the client.
46
+ * @param errorIdentifier - parsed from the response, used to look up the error schema within the registry.
47
+ * @param defaultNamespace - property of the Protocol implementation pointing to a specific service.
48
+ */
49
+ compose(composite: TypeRegistry, errorIdentifier: string, defaultNamespace: string): void;
37
50
  /**
38
51
  * Assigns additions onto exception if not already present.
39
52
  */
@@ -1,4 +1,5 @@
1
1
  import { SmithyRpcV2CborProtocol } from "@smithy/core/cbor";
2
+ import type { TypeRegistry } from "@smithy/core/schema";
2
3
  import type { EndpointBearer, HandlerExecutionContext, HttpRequest, HttpResponse, OperationSchema, ResponseMetadata, SerdeFunctions } from "@smithy/types";
3
4
  /**
4
5
  * Extends the Smithy implementation to add AwsQueryCompatibility support.
@@ -8,8 +9,9 @@ import type { EndpointBearer, HandlerExecutionContext, HttpRequest, HttpResponse
8
9
  export declare class AwsSmithyRpcV2CborProtocol extends SmithyRpcV2CborProtocol {
9
10
  private readonly awsQueryCompatible;
10
11
  private readonly mixin;
11
- constructor({ defaultNamespace, awsQueryCompatible, }: {
12
+ constructor({ defaultNamespace, errorTypeRegistries, awsQueryCompatible, }: {
12
13
  defaultNamespace: string;
14
+ errorTypeRegistries?: TypeRegistry[];
13
15
  awsQueryCompatible?: boolean;
14
16
  });
15
17
  /**
@@ -1,3 +1,4 @@
1
+ import type { TypeRegistry } from "@smithy/core/schema";
1
2
  import { AwsJsonRpcProtocol } from "./AwsJsonRpcProtocol";
2
3
  import type { JsonCodec } from "./JsonCodec";
3
4
  /**
@@ -5,8 +6,9 @@ import type { JsonCodec } from "./JsonCodec";
5
6
  * @see https://smithy.io/2.0/aws/protocols/aws-json-1_1-protocol.html#differences-between-awsjson1-0-and-awsjson1-1
6
7
  */
7
8
  export declare class AwsJson1_0Protocol extends AwsJsonRpcProtocol {
8
- constructor({ defaultNamespace, serviceTarget, awsQueryCompatible, jsonCodec, }: {
9
+ constructor({ defaultNamespace, errorTypeRegistries, serviceTarget, awsQueryCompatible, jsonCodec, }: {
9
10
  defaultNamespace: string;
11
+ errorTypeRegistries?: TypeRegistry[];
10
12
  serviceTarget: string;
11
13
  awsQueryCompatible?: boolean;
12
14
  jsonCodec?: JsonCodec;
@@ -1,3 +1,4 @@
1
+ import type { TypeRegistry } from "@smithy/core/schema";
1
2
  import { AwsJsonRpcProtocol } from "./AwsJsonRpcProtocol";
2
3
  import type { JsonCodec } from "./JsonCodec";
3
4
  /**
@@ -5,8 +6,9 @@ import type { JsonCodec } from "./JsonCodec";
5
6
  * @see https://smithy.io/2.0/aws/protocols/aws-json-1_1-protocol.html#differences-between-awsjson1-0-and-awsjson1-1
6
7
  */
7
8
  export declare class AwsJson1_1Protocol extends AwsJsonRpcProtocol {
8
- constructor({ defaultNamespace, serviceTarget, awsQueryCompatible, jsonCodec, }: {
9
+ constructor({ defaultNamespace, errorTypeRegistries, serviceTarget, awsQueryCompatible, jsonCodec, }: {
9
10
  defaultNamespace: string;
11
+ errorTypeRegistries?: TypeRegistry[];
10
12
  serviceTarget: string;
11
13
  awsQueryCompatible?: boolean;
12
14
  jsonCodec?: JsonCodec;
@@ -1,4 +1,5 @@
1
1
  import { RpcProtocol } from "@smithy/core/protocols";
2
+ import type { TypeRegistry } from "@smithy/core/schema";
2
3
  import type { EndpointBearer, HandlerExecutionContext, HttpRequest, HttpResponse, OperationSchema, ResponseMetadata, SerdeFunctions, ShapeDeserializer, ShapeSerializer } from "@smithy/types";
3
4
  import { JsonCodec } from "./JsonCodec";
4
5
  /**
@@ -11,8 +12,9 @@ export declare abstract class AwsJsonRpcProtocol extends RpcProtocol {
11
12
  private readonly codec;
12
13
  private readonly mixin;
13
14
  private readonly awsQueryCompatible;
14
- protected constructor({ defaultNamespace, serviceTarget, awsQueryCompatible, jsonCodec, }: {
15
+ protected constructor({ defaultNamespace, errorTypeRegistries, serviceTarget, awsQueryCompatible, jsonCodec, }: {
15
16
  defaultNamespace: string;
17
+ errorTypeRegistries?: TypeRegistry[];
16
18
  serviceTarget: string;
17
19
  awsQueryCompatible?: boolean;
18
20
  jsonCodec?: JsonCodec;
@@ -1,4 +1,5 @@
1
1
  import { HttpBindingProtocol } from "@smithy/core/protocols";
2
+ import type { TypeRegistry } from "@smithy/core/schema";
2
3
  import type { EndpointBearer, HandlerExecutionContext, HttpRequest, HttpResponse, MetadataBearer, OperationSchema, ResponseMetadata, SerdeFunctions, ShapeDeserializer, ShapeSerializer } from "@smithy/types";
3
4
  import { JsonCodec } from "./JsonCodec";
4
5
  /**
@@ -9,8 +10,9 @@ export declare class AwsRestJsonProtocol extends HttpBindingProtocol {
9
10
  protected deserializer: ShapeDeserializer<string | Uint8Array>;
10
11
  private readonly codec;
11
12
  private readonly mixin;
12
- constructor({ defaultNamespace }: {
13
+ constructor({ defaultNamespace, errorTypeRegistries, }: {
13
14
  defaultNamespace: string;
15
+ errorTypeRegistries?: TypeRegistry[];
14
16
  });
15
17
  getShapeId(): string;
16
18
  getPayloadCodec(): JsonCodec;
@@ -1,3 +1,4 @@
1
+ import type { TypeRegistry } from "@smithy/core/schema";
1
2
  import { AwsQueryProtocol } from "./AwsQueryProtocol";
2
3
  /**
3
4
  * @public
@@ -7,11 +8,13 @@ export declare class AwsEc2QueryProtocol extends AwsQueryProtocol {
7
8
  defaultNamespace: string;
8
9
  xmlNamespace: string;
9
10
  version: string;
11
+ errorTypeRegistries?: TypeRegistry[];
10
12
  };
11
13
  constructor(options: {
12
14
  defaultNamespace: string;
13
15
  xmlNamespace: string;
14
16
  version: string;
17
+ errorTypeRegistries?: TypeRegistry[];
15
18
  });
16
19
  /**
17
20
  * @override
@@ -1,4 +1,5 @@
1
1
  import { RpcProtocol } from "@smithy/core/protocols";
2
+ import type { TypeRegistry } from "@smithy/core/schema";
2
3
  import type { Codec, EndpointBearer, HandlerExecutionContext, HttpRequest, HttpResponse as IHttpResponse, MetadataBearer, OperationSchema, ResponseMetadata, SerdeFunctions } from "@smithy/types";
3
4
  import { XmlShapeDeserializer } from "../xml/XmlShapeDeserializer";
4
5
  import { QueryShapeSerializer } from "./QueryShapeSerializer";
@@ -10,6 +11,7 @@ export declare class AwsQueryProtocol extends RpcProtocol {
10
11
  defaultNamespace: string;
11
12
  xmlNamespace: string;
12
13
  version: string;
14
+ errorTypeRegistries?: TypeRegistry[];
13
15
  };
14
16
  protected serializer: QueryShapeSerializer;
15
17
  protected deserializer: XmlShapeDeserializer;
@@ -18,6 +20,7 @@ export declare class AwsQueryProtocol extends RpcProtocol {
18
20
  defaultNamespace: string;
19
21
  xmlNamespace: string;
20
22
  version: string;
23
+ errorTypeRegistries?: TypeRegistry[];
21
24
  });
22
25
  getShapeId(): string;
23
26
  setSerdeContext(serdeContext: SerdeFunctions): void;
@@ -1,4 +1,5 @@
1
1
  import { HttpBindingProtocol } from "@smithy/core/protocols";
2
+ import type { TypeRegistry } from "@smithy/core/schema";
2
3
  import type { EndpointBearer, HandlerExecutionContext, HttpRequest as IHttpRequest, HttpResponse as IHttpResponse, MetadataBearer, OperationSchema, ResponseMetadata, SerdeFunctions, ShapeDeserializer, ShapeSerializer } from "@smithy/types";
3
4
  import { XmlCodec } from "./XmlCodec";
4
5
  /**
@@ -12,6 +13,7 @@ export declare class AwsRestXmlProtocol extends HttpBindingProtocol {
12
13
  constructor(options: {
13
14
  defaultNamespace: string;
14
15
  xmlNamespace: string;
16
+ errorTypeRegistries?: TypeRegistry[];
15
17
  });
16
18
  getPayloadCodec(): XmlCodec;
17
19
  getShapeId(): string;