@aws-sdk/client-managedblockchain-query 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
@@ -209,6 +209,7 @@ var import_middleware_serde = require("@smithy/middleware-serde");
209
209
  var import_types = require("@smithy/types");
210
210
 
211
211
  // src/protocols/Aws_restJson1.ts
212
+ var import_core2 = require("@aws-sdk/core");
212
213
 
213
214
 
214
215
 
@@ -604,7 +605,7 @@ var de_BatchGetTokenBalanceCommand = /* @__PURE__ */ __name(async (output, conte
604
605
  const contents = (0, import_smithy_client.map)({
605
606
  $metadata: deserializeMetadata(output)
606
607
  });
607
- const data = (0, import_smithy_client.expectNonNull)((0, import_smithy_client.expectObject)(await parseBody(output.body, context)), "body");
608
+ const data = (0, import_smithy_client.expectNonNull)((0, import_smithy_client.expectObject)(await (0, import_core2.parseJsonBody)(output.body, context)), "body");
608
609
  const doc = (0, import_smithy_client.take)(data, {
609
610
  errors: (_) => de_BatchGetTokenBalanceErrors(_, context),
610
611
  tokenBalances: (_) => de_BatchGetTokenBalanceOutputList(_, context)
@@ -619,7 +620,7 @@ var de_GetAssetContractCommand = /* @__PURE__ */ __name(async (output, context)
619
620
  const contents = (0, import_smithy_client.map)({
620
621
  $metadata: deserializeMetadata(output)
621
622
  });
622
- const data = (0, import_smithy_client.expectNonNull)((0, import_smithy_client.expectObject)(await parseBody(output.body, context)), "body");
623
+ const data = (0, import_smithy_client.expectNonNull)((0, import_smithy_client.expectObject)(await (0, import_core2.parseJsonBody)(output.body, context)), "body");
623
624
  const doc = (0, import_smithy_client.take)(data, {
624
625
  contractIdentifier: import_smithy_client._json,
625
626
  deployerAddress: import_smithy_client.expectString,
@@ -636,7 +637,7 @@ var de_GetTokenBalanceCommand = /* @__PURE__ */ __name(async (output, context) =
636
637
  const contents = (0, import_smithy_client.map)({
637
638
  $metadata: deserializeMetadata(output)
638
639
  });
639
- const data = (0, import_smithy_client.expectNonNull)((0, import_smithy_client.expectObject)(await parseBody(output.body, context)), "body");
640
+ const data = (0, import_smithy_client.expectNonNull)((0, import_smithy_client.expectObject)(await (0, import_core2.parseJsonBody)(output.body, context)), "body");
640
641
  const doc = (0, import_smithy_client.take)(data, {
641
642
  atBlockchainInstant: (_) => de_BlockchainInstant(_, context),
642
643
  balance: import_smithy_client.expectString,
@@ -654,7 +655,7 @@ var de_GetTransactionCommand = /* @__PURE__ */ __name(async (output, context) =>
654
655
  const contents = (0, import_smithy_client.map)({
655
656
  $metadata: deserializeMetadata(output)
656
657
  });
657
- const data = (0, import_smithy_client.expectNonNull)((0, import_smithy_client.expectObject)(await parseBody(output.body, context)), "body");
658
+ const data = (0, import_smithy_client.expectNonNull)((0, import_smithy_client.expectObject)(await (0, import_core2.parseJsonBody)(output.body, context)), "body");
658
659
  const doc = (0, import_smithy_client.take)(data, {
659
660
  transaction: (_) => de_Transaction(_, context)
660
661
  });
@@ -668,7 +669,7 @@ var de_ListAssetContractsCommand = /* @__PURE__ */ __name(async (output, context
668
669
  const contents = (0, import_smithy_client.map)({
669
670
  $metadata: deserializeMetadata(output)
670
671
  });
671
- const data = (0, import_smithy_client.expectNonNull)((0, import_smithy_client.expectObject)(await parseBody(output.body, context)), "body");
672
+ const data = (0, import_smithy_client.expectNonNull)((0, import_smithy_client.expectObject)(await (0, import_core2.parseJsonBody)(output.body, context)), "body");
672
673
  const doc = (0, import_smithy_client.take)(data, {
673
674
  contracts: import_smithy_client._json,
674
675
  nextToken: import_smithy_client.expectString
@@ -683,7 +684,7 @@ var de_ListTokenBalancesCommand = /* @__PURE__ */ __name(async (output, context)
683
684
  const contents = (0, import_smithy_client.map)({
684
685
  $metadata: deserializeMetadata(output)
685
686
  });
686
- const data = (0, import_smithy_client.expectNonNull)((0, import_smithy_client.expectObject)(await parseBody(output.body, context)), "body");
687
+ const data = (0, import_smithy_client.expectNonNull)((0, import_smithy_client.expectObject)(await (0, import_core2.parseJsonBody)(output.body, context)), "body");
687
688
  const doc = (0, import_smithy_client.take)(data, {
688
689
  nextToken: import_smithy_client.expectString,
689
690
  tokenBalances: (_) => de_TokenBalanceList(_, context)
@@ -698,7 +699,7 @@ var de_ListTransactionEventsCommand = /* @__PURE__ */ __name(async (output, cont
698
699
  const contents = (0, import_smithy_client.map)({
699
700
  $metadata: deserializeMetadata(output)
700
701
  });
701
- const data = (0, import_smithy_client.expectNonNull)((0, import_smithy_client.expectObject)(await parseBody(output.body, context)), "body");
702
+ const data = (0, import_smithy_client.expectNonNull)((0, import_smithy_client.expectObject)(await (0, import_core2.parseJsonBody)(output.body, context)), "body");
702
703
  const doc = (0, import_smithy_client.take)(data, {
703
704
  events: import_smithy_client._json,
704
705
  nextToken: import_smithy_client.expectString
@@ -713,7 +714,7 @@ var de_ListTransactionsCommand = /* @__PURE__ */ __name(async (output, context)
713
714
  const contents = (0, import_smithy_client.map)({
714
715
  $metadata: deserializeMetadata(output)
715
716
  });
716
- const data = (0, import_smithy_client.expectNonNull)((0, import_smithy_client.expectObject)(await parseBody(output.body, context)), "body");
717
+ const data = (0, import_smithy_client.expectNonNull)((0, import_smithy_client.expectObject)(await (0, import_core2.parseJsonBody)(output.body, context)), "body");
717
718
  const doc = (0, import_smithy_client.take)(data, {
718
719
  nextToken: import_smithy_client.expectString,
719
720
  transactions: (_) => de_TransactionOutputList(_, context)
@@ -724,9 +725,9 @@ var de_ListTransactionsCommand = /* @__PURE__ */ __name(async (output, context)
724
725
  var de_CommandError = /* @__PURE__ */ __name(async (output, context) => {
725
726
  const parsedOutput = {
726
727
  ...output,
727
- body: await parseErrorBody(output.body, context)
728
+ body: await (0, import_core2.parseJsonErrorBody)(output.body, context)
728
729
  };
729
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
730
+ const errorCode = (0, import_core2.loadRestJsonErrorCode)(output, parsedOutput.body);
730
731
  switch (errorCode) {
731
732
  case "AccessDeniedException":
732
733
  case "com.amazonaws.managedblockchainquery#AccessDeniedException":
@@ -960,49 +961,8 @@ var deserializeMetadata = /* @__PURE__ */ __name((output) => ({
960
961
  extendedRequestId: output.headers["x-amz-id-2"],
961
962
  cfId: output.headers["x-amz-cf-id"]
962
963
  }), "deserializeMetadata");
963
- var collectBodyString = /* @__PURE__ */ __name((streamBody, context) => (0, import_smithy_client.collectBody)(streamBody, context).then((body) => context.utf8Encoder(body)), "collectBodyString");
964
964
  var _rAS = "retryAfterSeconds";
965
965
  var _ra = "retry-after";
966
- var parseBody = /* @__PURE__ */ __name((streamBody, context) => collectBodyString(streamBody, context).then((encoded) => {
967
- if (encoded.length) {
968
- return JSON.parse(encoded);
969
- }
970
- return {};
971
- }), "parseBody");
972
- var parseErrorBody = /* @__PURE__ */ __name(async (errorBody, context) => {
973
- const value = await parseBody(errorBody, context);
974
- value.message = value.message ?? value.Message;
975
- return value;
976
- }, "parseErrorBody");
977
- var loadRestJsonErrorCode = /* @__PURE__ */ __name((output, data) => {
978
- const findKey = /* @__PURE__ */ __name((object, key) => Object.keys(object).find((k) => k.toLowerCase() === key.toLowerCase()), "findKey");
979
- const sanitizeErrorCode = /* @__PURE__ */ __name((rawValue) => {
980
- let cleanValue = rawValue;
981
- if (typeof cleanValue === "number") {
982
- cleanValue = cleanValue.toString();
983
- }
984
- if (cleanValue.indexOf(",") >= 0) {
985
- cleanValue = cleanValue.split(",")[0];
986
- }
987
- if (cleanValue.indexOf(":") >= 0) {
988
- cleanValue = cleanValue.split(":")[0];
989
- }
990
- if (cleanValue.indexOf("#") >= 0) {
991
- cleanValue = cleanValue.split("#")[1];
992
- }
993
- return cleanValue;
994
- }, "sanitizeErrorCode");
995
- const headerKey = findKey(output.headers, "x-amzn-errortype");
996
- if (headerKey !== void 0) {
997
- return sanitizeErrorCode(output.headers[headerKey]);
998
- }
999
- if (data.code !== void 0) {
1000
- return sanitizeErrorCode(data.code);
1001
- }
1002
- if (data["__type"] !== void 0) {
1003
- return sanitizeErrorCode(data["__type"]);
1004
- }
1005
- }, "loadRestJsonErrorCode");
1006
966
 
1007
967
  // src/commands/BatchGetTokenBalanceCommand.ts
1008
968
  var _BatchGetTokenBalanceCommand = class _BatchGetTokenBalanceCommand 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 { requestBuilder as rb } from "@smithy/core";
2
3
  import { _json, collectBody, decorateServiceException as __decorateServiceException, expectInt32 as __expectInt32, expectLong as __expectLong, expectNonNull as __expectNonNull, expectNumber as __expectNumber, expectObject as __expectObject, expectString as __expectString, map, parseEpochTimestamp as __parseEpochTimestamp, strictParseInt32 as __strictParseInt32, take, withBaseException, } from "@smithy/smithy-client";
3
4
  import { ManagedBlockchainQueryServiceException as __BaseException } from "../models/ManagedBlockchainQueryServiceException";
@@ -505,43 +506,3 @@ const isSerializableHeaderValue = (value) => value !== undefined &&
505
506
  (!Object.getOwnPropertyNames(value).includes("size") || value.size != 0);
506
507
  const _rAS = "retryAfterSeconds";
507
508
  const _ra = "retry-after";
508
- const parseBody = (streamBody, context) => collectBodyString(streamBody, context).then((encoded) => {
509
- if (encoded.length) {
510
- return JSON.parse(encoded);
511
- }
512
- return {};
513
- });
514
- const parseErrorBody = async (errorBody, context) => {
515
- const value = await parseBody(errorBody, context);
516
- value.message = value.message ?? value.Message;
517
- return value;
518
- };
519
- const loadRestJsonErrorCode = (output, data) => {
520
- const findKey = (object, key) => Object.keys(object).find((k) => k.toLowerCase() === key.toLowerCase());
521
- const sanitizeErrorCode = (rawValue) => {
522
- let cleanValue = rawValue;
523
- if (typeof cleanValue === "number") {
524
- cleanValue = cleanValue.toString();
525
- }
526
- if (cleanValue.indexOf(",") >= 0) {
527
- cleanValue = cleanValue.split(",")[0];
528
- }
529
- if (cleanValue.indexOf(":") >= 0) {
530
- cleanValue = cleanValue.split(":")[0];
531
- }
532
- if (cleanValue.indexOf("#") >= 0) {
533
- cleanValue = cleanValue.split("#")[1];
534
- }
535
- return cleanValue;
536
- };
537
- const headerKey = findKey(output.headers, "x-amzn-errortype");
538
- if (headerKey !== undefined) {
539
- return sanitizeErrorCode(output.headers[headerKey]);
540
- }
541
- if (data.code !== undefined) {
542
- return sanitizeErrorCode(data.code);
543
- }
544
- if (data["__type"] !== undefined) {
545
- return sanitizeErrorCode(data["__type"]);
546
- }
547
- };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@aws-sdk/client-managedblockchain-query",
3
3
  "description": "AWS SDK for JavaScript Managedblockchain Query 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-managedblockchain-query",
@@ -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",