@aws-sdk/client-payment-cryptography 3.525.0 → 3.529.1

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/index.js CHANGED
@@ -238,6 +238,7 @@ var import_middleware_serde = require("@smithy/middleware-serde");
238
238
  var import_types = require("@smithy/types");
239
239
 
240
240
  // src/protocols/Aws_json1_0.ts
241
+ var import_core2 = require("@aws-sdk/core");
241
242
 
242
243
 
243
244
 
@@ -708,7 +709,7 @@ var de_CreateAliasCommand = /* @__PURE__ */ __name(async (output, context) => {
708
709
  if (output.statusCode >= 300) {
709
710
  return de_CommandError(output, context);
710
711
  }
711
- const data = await parseBody(output.body, context);
712
+ const data = await (0, import_core2.parseJsonBody)(output.body, context);
712
713
  let contents = {};
713
714
  contents = (0, import_smithy_client._json)(data);
714
715
  const response = {
@@ -721,7 +722,7 @@ var de_CreateKeyCommand = /* @__PURE__ */ __name(async (output, context) => {
721
722
  if (output.statusCode >= 300) {
722
723
  return de_CommandError(output, context);
723
724
  }
724
- const data = await parseBody(output.body, context);
725
+ const data = await (0, import_core2.parseJsonBody)(output.body, context);
725
726
  let contents = {};
726
727
  contents = de_CreateKeyOutput(data, context);
727
728
  const response = {
@@ -734,7 +735,7 @@ var de_DeleteAliasCommand = /* @__PURE__ */ __name(async (output, context) => {
734
735
  if (output.statusCode >= 300) {
735
736
  return de_CommandError(output, context);
736
737
  }
737
- const data = await parseBody(output.body, context);
738
+ const data = await (0, import_core2.parseJsonBody)(output.body, context);
738
739
  let contents = {};
739
740
  contents = (0, import_smithy_client._json)(data);
740
741
  const response = {
@@ -747,7 +748,7 @@ var de_DeleteKeyCommand = /* @__PURE__ */ __name(async (output, context) => {
747
748
  if (output.statusCode >= 300) {
748
749
  return de_CommandError(output, context);
749
750
  }
750
- const data = await parseBody(output.body, context);
751
+ const data = await (0, import_core2.parseJsonBody)(output.body, context);
751
752
  let contents = {};
752
753
  contents = de_DeleteKeyOutput(data, context);
753
754
  const response = {
@@ -760,7 +761,7 @@ var de_ExportKeyCommand = /* @__PURE__ */ __name(async (output, context) => {
760
761
  if (output.statusCode >= 300) {
761
762
  return de_CommandError(output, context);
762
763
  }
763
- const data = await parseBody(output.body, context);
764
+ const data = await (0, import_core2.parseJsonBody)(output.body, context);
764
765
  let contents = {};
765
766
  contents = (0, import_smithy_client._json)(data);
766
767
  const response = {
@@ -773,7 +774,7 @@ var de_GetAliasCommand = /* @__PURE__ */ __name(async (output, context) => {
773
774
  if (output.statusCode >= 300) {
774
775
  return de_CommandError(output, context);
775
776
  }
776
- const data = await parseBody(output.body, context);
777
+ const data = await (0, import_core2.parseJsonBody)(output.body, context);
777
778
  let contents = {};
778
779
  contents = (0, import_smithy_client._json)(data);
779
780
  const response = {
@@ -786,7 +787,7 @@ var de_GetKeyCommand = /* @__PURE__ */ __name(async (output, context) => {
786
787
  if (output.statusCode >= 300) {
787
788
  return de_CommandError(output, context);
788
789
  }
789
- const data = await parseBody(output.body, context);
790
+ const data = await (0, import_core2.parseJsonBody)(output.body, context);
790
791
  let contents = {};
791
792
  contents = de_GetKeyOutput(data, context);
792
793
  const response = {
@@ -799,7 +800,7 @@ var de_GetParametersForExportCommand = /* @__PURE__ */ __name(async (output, con
799
800
  if (output.statusCode >= 300) {
800
801
  return de_CommandError(output, context);
801
802
  }
802
- const data = await parseBody(output.body, context);
803
+ const data = await (0, import_core2.parseJsonBody)(output.body, context);
803
804
  let contents = {};
804
805
  contents = de_GetParametersForExportOutput(data, context);
805
806
  const response = {
@@ -812,7 +813,7 @@ var de_GetParametersForImportCommand = /* @__PURE__ */ __name(async (output, con
812
813
  if (output.statusCode >= 300) {
813
814
  return de_CommandError(output, context);
814
815
  }
815
- const data = await parseBody(output.body, context);
816
+ const data = await (0, import_core2.parseJsonBody)(output.body, context);
816
817
  let contents = {};
817
818
  contents = de_GetParametersForImportOutput(data, context);
818
819
  const response = {
@@ -825,7 +826,7 @@ var de_GetPublicKeyCertificateCommand = /* @__PURE__ */ __name(async (output, co
825
826
  if (output.statusCode >= 300) {
826
827
  return de_CommandError(output, context);
827
828
  }
828
- const data = await parseBody(output.body, context);
829
+ const data = await (0, import_core2.parseJsonBody)(output.body, context);
829
830
  let contents = {};
830
831
  contents = (0, import_smithy_client._json)(data);
831
832
  const response = {
@@ -838,7 +839,7 @@ var de_ImportKeyCommand = /* @__PURE__ */ __name(async (output, context) => {
838
839
  if (output.statusCode >= 300) {
839
840
  return de_CommandError(output, context);
840
841
  }
841
- const data = await parseBody(output.body, context);
842
+ const data = await (0, import_core2.parseJsonBody)(output.body, context);
842
843
  let contents = {};
843
844
  contents = de_ImportKeyOutput(data, context);
844
845
  const response = {
@@ -851,7 +852,7 @@ var de_ListAliasesCommand = /* @__PURE__ */ __name(async (output, context) => {
851
852
  if (output.statusCode >= 300) {
852
853
  return de_CommandError(output, context);
853
854
  }
854
- const data = await parseBody(output.body, context);
855
+ const data = await (0, import_core2.parseJsonBody)(output.body, context);
855
856
  let contents = {};
856
857
  contents = (0, import_smithy_client._json)(data);
857
858
  const response = {
@@ -864,7 +865,7 @@ var de_ListKeysCommand = /* @__PURE__ */ __name(async (output, context) => {
864
865
  if (output.statusCode >= 300) {
865
866
  return de_CommandError(output, context);
866
867
  }
867
- const data = await parseBody(output.body, context);
868
+ const data = await (0, import_core2.parseJsonBody)(output.body, context);
868
869
  let contents = {};
869
870
  contents = (0, import_smithy_client._json)(data);
870
871
  const response = {
@@ -877,7 +878,7 @@ var de_ListTagsForResourceCommand = /* @__PURE__ */ __name(async (output, contex
877
878
  if (output.statusCode >= 300) {
878
879
  return de_CommandError(output, context);
879
880
  }
880
- const data = await parseBody(output.body, context);
881
+ const data = await (0, import_core2.parseJsonBody)(output.body, context);
881
882
  let contents = {};
882
883
  contents = (0, import_smithy_client._json)(data);
883
884
  const response = {
@@ -890,7 +891,7 @@ var de_RestoreKeyCommand = /* @__PURE__ */ __name(async (output, context) => {
890
891
  if (output.statusCode >= 300) {
891
892
  return de_CommandError(output, context);
892
893
  }
893
- const data = await parseBody(output.body, context);
894
+ const data = await (0, import_core2.parseJsonBody)(output.body, context);
894
895
  let contents = {};
895
896
  contents = de_RestoreKeyOutput(data, context);
896
897
  const response = {
@@ -903,7 +904,7 @@ var de_StartKeyUsageCommand = /* @__PURE__ */ __name(async (output, context) =>
903
904
  if (output.statusCode >= 300) {
904
905
  return de_CommandError(output, context);
905
906
  }
906
- const data = await parseBody(output.body, context);
907
+ const data = await (0, import_core2.parseJsonBody)(output.body, context);
907
908
  let contents = {};
908
909
  contents = de_StartKeyUsageOutput(data, context);
909
910
  const response = {
@@ -916,7 +917,7 @@ var de_StopKeyUsageCommand = /* @__PURE__ */ __name(async (output, context) => {
916
917
  if (output.statusCode >= 300) {
917
918
  return de_CommandError(output, context);
918
919
  }
919
- const data = await parseBody(output.body, context);
920
+ const data = await (0, import_core2.parseJsonBody)(output.body, context);
920
921
  let contents = {};
921
922
  contents = de_StopKeyUsageOutput(data, context);
922
923
  const response = {
@@ -929,7 +930,7 @@ var de_TagResourceCommand = /* @__PURE__ */ __name(async (output, context) => {
929
930
  if (output.statusCode >= 300) {
930
931
  return de_CommandError(output, context);
931
932
  }
932
- const data = await parseBody(output.body, context);
933
+ const data = await (0, import_core2.parseJsonBody)(output.body, context);
933
934
  let contents = {};
934
935
  contents = (0, import_smithy_client._json)(data);
935
936
  const response = {
@@ -942,7 +943,7 @@ var de_UntagResourceCommand = /* @__PURE__ */ __name(async (output, context) =>
942
943
  if (output.statusCode >= 300) {
943
944
  return de_CommandError(output, context);
944
945
  }
945
- const data = await parseBody(output.body, context);
946
+ const data = await (0, import_core2.parseJsonBody)(output.body, context);
946
947
  let contents = {};
947
948
  contents = (0, import_smithy_client._json)(data);
948
949
  const response = {
@@ -955,7 +956,7 @@ var de_UpdateAliasCommand = /* @__PURE__ */ __name(async (output, context) => {
955
956
  if (output.statusCode >= 300) {
956
957
  return de_CommandError(output, context);
957
958
  }
958
- const data = await parseBody(output.body, context);
959
+ const data = await (0, import_core2.parseJsonBody)(output.body, context);
959
960
  let contents = {};
960
961
  contents = (0, import_smithy_client._json)(data);
961
962
  const response = {
@@ -967,9 +968,9 @@ var de_UpdateAliasCommand = /* @__PURE__ */ __name(async (output, context) => {
967
968
  var de_CommandError = /* @__PURE__ */ __name(async (output, context) => {
968
969
  const parsedOutput = {
969
970
  ...output,
970
- body: await parseErrorBody(output.body, context)
971
+ body: await (0, import_core2.parseJsonErrorBody)(output.body, context)
971
972
  };
972
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
973
+ const errorCode = (0, import_core2.loadRestJsonErrorCode)(output, parsedOutput.body);
973
974
  switch (errorCode) {
974
975
  case "AccessDeniedException":
975
976
  case "com.amazonaws.paymentcryptography#AccessDeniedException":
@@ -1152,7 +1153,6 @@ var deserializeMetadata = /* @__PURE__ */ __name((output) => ({
1152
1153
  extendedRequestId: output.headers["x-amz-id-2"],
1153
1154
  cfId: output.headers["x-amz-cf-id"]
1154
1155
  }), "deserializeMetadata");
1155
- var collectBodyString = /* @__PURE__ */ __name((streamBody, context) => (0, import_smithy_client.collectBody)(streamBody, context).then((body) => context.utf8Encoder(body)), "collectBodyString");
1156
1156
  var throwDefaultError = (0, import_smithy_client.withBaseException)(PaymentCryptographyServiceException);
1157
1157
  var buildHttpRpcRequest = /* @__PURE__ */ __name(async (context, headers, path, resolvedHostname, body) => {
1158
1158
  const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
@@ -1179,46 +1179,6 @@ function sharedHeaders(operation) {
1179
1179
  };
1180
1180
  }
1181
1181
  __name(sharedHeaders, "sharedHeaders");
1182
- var parseBody = /* @__PURE__ */ __name((streamBody, context) => collectBodyString(streamBody, context).then((encoded) => {
1183
- if (encoded.length) {
1184
- return JSON.parse(encoded);
1185
- }
1186
- return {};
1187
- }), "parseBody");
1188
- var parseErrorBody = /* @__PURE__ */ __name(async (errorBody, context) => {
1189
- const value = await parseBody(errorBody, context);
1190
- value.message = value.message ?? value.Message;
1191
- return value;
1192
- }, "parseErrorBody");
1193
- var loadRestJsonErrorCode = /* @__PURE__ */ __name((output, data) => {
1194
- const findKey = /* @__PURE__ */ __name((object, key) => Object.keys(object).find((k) => k.toLowerCase() === key.toLowerCase()), "findKey");
1195
- const sanitizeErrorCode = /* @__PURE__ */ __name((rawValue) => {
1196
- let cleanValue = rawValue;
1197
- if (typeof cleanValue === "number") {
1198
- cleanValue = cleanValue.toString();
1199
- }
1200
- if (cleanValue.indexOf(",") >= 0) {
1201
- cleanValue = cleanValue.split(",")[0];
1202
- }
1203
- if (cleanValue.indexOf(":") >= 0) {
1204
- cleanValue = cleanValue.split(":")[0];
1205
- }
1206
- if (cleanValue.indexOf("#") >= 0) {
1207
- cleanValue = cleanValue.split("#")[1];
1208
- }
1209
- return cleanValue;
1210
- }, "sanitizeErrorCode");
1211
- const headerKey = findKey(output.headers, "x-amzn-errortype");
1212
- if (headerKey !== void 0) {
1213
- return sanitizeErrorCode(output.headers[headerKey]);
1214
- }
1215
- if (data.code !== void 0) {
1216
- return sanitizeErrorCode(data.code);
1217
- }
1218
- if (data["__type"] !== void 0) {
1219
- return sanitizeErrorCode(data["__type"]);
1220
- }
1221
- }, "loadRestJsonErrorCode");
1222
1182
 
1223
1183
  // src/commands/CreateAliasCommand.ts
1224
1184
  var _CreateAliasCommand = class _CreateAliasCommand extends import_smithy_client.Command.classBuilder().ep({
@@ -1,3 +1,4 @@
1
+ import { loadRestJsonErrorCode, parseJsonBody as parseBody, parseJsonErrorBody as parseErrorBody } from "@aws-sdk/core";
1
2
  import { HttpRequest as __HttpRequest } from "@smithy/protocol-http";
2
3
  import { _json, collectBody, decorateServiceException as __decorateServiceException, expectBoolean as __expectBoolean, expectNonNull as __expectNonNull, expectNumber as __expectNumber, expectString as __expectString, parseEpochTimestamp as __parseEpochTimestamp, take, withBaseException, } from "@smithy/smithy-client";
3
4
  import { AccessDeniedException, ConflictException, InternalServerException, ResourceNotFoundException, ServiceQuotaExceededException, ServiceUnavailableException, ThrottlingException, ValidationException, } from "../models/models_0";
@@ -596,43 +597,3 @@ function sharedHeaders(operation) {
596
597
  "x-amz-target": `PaymentCryptographyControlPlane.${operation}`,
597
598
  };
598
599
  }
599
- const parseBody = (streamBody, context) => collectBodyString(streamBody, context).then((encoded) => {
600
- if (encoded.length) {
601
- return JSON.parse(encoded);
602
- }
603
- return {};
604
- });
605
- const parseErrorBody = async (errorBody, context) => {
606
- const value = await parseBody(errorBody, context);
607
- value.message = value.message ?? value.Message;
608
- return value;
609
- };
610
- const loadRestJsonErrorCode = (output, data) => {
611
- const findKey = (object, key) => Object.keys(object).find((k) => k.toLowerCase() === key.toLowerCase());
612
- const sanitizeErrorCode = (rawValue) => {
613
- let cleanValue = rawValue;
614
- if (typeof cleanValue === "number") {
615
- cleanValue = cleanValue.toString();
616
- }
617
- if (cleanValue.indexOf(",") >= 0) {
618
- cleanValue = cleanValue.split(",")[0];
619
- }
620
- if (cleanValue.indexOf(":") >= 0) {
621
- cleanValue = cleanValue.split(":")[0];
622
- }
623
- if (cleanValue.indexOf("#") >= 0) {
624
- cleanValue = cleanValue.split("#")[1];
625
- }
626
- return cleanValue;
627
- };
628
- const headerKey = findKey(output.headers, "x-amzn-errortype");
629
- if (headerKey !== undefined) {
630
- return sanitizeErrorCode(output.headers[headerKey]);
631
- }
632
- if (data.code !== undefined) {
633
- return sanitizeErrorCode(data.code);
634
- }
635
- if (data["__type"] !== undefined) {
636
- return sanitizeErrorCode(data["__type"]);
637
- }
638
- };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@aws-sdk/client-payment-cryptography",
3
3
  "description": "AWS SDK for JavaScript Payment Cryptography Client for Node.js, Browser and React Native",
4
- "version": "3.525.0",
4
+ "version": "3.529.1",
5
5
  "scripts": {
6
6
  "build": "concurrently 'yarn:build:cjs' 'yarn:build:es' 'yarn:build:types'",
7
7
  "build:cjs": "node ../../scripts/compilation/inline client-payment-cryptography",
@@ -20,9 +20,9 @@
20
20
  "dependencies": {
21
21
  "@aws-crypto/sha256-browser": "3.0.0",
22
22
  "@aws-crypto/sha256-js": "3.0.0",
23
- "@aws-sdk/client-sts": "3.525.0",
24
- "@aws-sdk/core": "3.525.0",
25
- "@aws-sdk/credential-provider-node": "3.525.0",
23
+ "@aws-sdk/client-sts": "3.529.1",
24
+ "@aws-sdk/core": "3.529.1",
25
+ "@aws-sdk/credential-provider-node": "3.529.1",
26
26
  "@aws-sdk/middleware-host-header": "3.523.0",
27
27
  "@aws-sdk/middleware-logger": "3.523.0",
28
28
  "@aws-sdk/middleware-recursion-detection": "3.523.0",