@aws-sdk/client-rbin 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
@@ -206,6 +206,7 @@ var import_middleware_serde = require("@smithy/middleware-serde");
206
206
  var import_types = require("@smithy/types");
207
207
 
208
208
  // src/protocols/Aws_restJson1.ts
209
+ var import_core2 = require("@aws-sdk/core");
209
210
 
210
211
 
211
212
 
@@ -500,7 +501,7 @@ var de_CreateRuleCommand = /* @__PURE__ */ __name(async (output, context) => {
500
501
  const contents = (0, import_smithy_client.map)({
501
502
  $metadata: deserializeMetadata(output)
502
503
  });
503
- const data = (0, import_smithy_client.expectNonNull)((0, import_smithy_client.expectObject)(await parseBody(output.body, context)), "body");
504
+ const data = (0, import_smithy_client.expectNonNull)((0, import_smithy_client.expectObject)(await (0, import_core2.parseJsonBody)(output.body, context)), "body");
504
505
  const doc = (0, import_smithy_client.take)(data, {
505
506
  Description: import_smithy_client.expectString,
506
507
  Identifier: import_smithy_client.expectString,
@@ -533,7 +534,7 @@ var de_GetRuleCommand = /* @__PURE__ */ __name(async (output, context) => {
533
534
  const contents = (0, import_smithy_client.map)({
534
535
  $metadata: deserializeMetadata(output)
535
536
  });
536
- const data = (0, import_smithy_client.expectNonNull)((0, import_smithy_client.expectObject)(await parseBody(output.body, context)), "body");
537
+ const data = (0, import_smithy_client.expectNonNull)((0, import_smithy_client.expectObject)(await (0, import_core2.parseJsonBody)(output.body, context)), "body");
537
538
  const doc = (0, import_smithy_client.take)(data, {
538
539
  Description: import_smithy_client.expectString,
539
540
  Identifier: import_smithy_client.expectString,
@@ -556,7 +557,7 @@ var de_ListRulesCommand = /* @__PURE__ */ __name(async (output, context) => {
556
557
  const contents = (0, import_smithy_client.map)({
557
558
  $metadata: deserializeMetadata(output)
558
559
  });
559
- const data = (0, import_smithy_client.expectNonNull)((0, import_smithy_client.expectObject)(await parseBody(output.body, context)), "body");
560
+ const data = (0, import_smithy_client.expectNonNull)((0, import_smithy_client.expectObject)(await (0, import_core2.parseJsonBody)(output.body, context)), "body");
560
561
  const doc = (0, import_smithy_client.take)(data, {
561
562
  NextToken: import_smithy_client.expectString,
562
563
  Rules: import_smithy_client._json
@@ -571,7 +572,7 @@ var de_ListTagsForResourceCommand = /* @__PURE__ */ __name(async (output, contex
571
572
  const contents = (0, import_smithy_client.map)({
572
573
  $metadata: deserializeMetadata(output)
573
574
  });
574
- const data = (0, import_smithy_client.expectNonNull)((0, import_smithy_client.expectObject)(await parseBody(output.body, context)), "body");
575
+ const data = (0, import_smithy_client.expectNonNull)((0, import_smithy_client.expectObject)(await (0, import_core2.parseJsonBody)(output.body, context)), "body");
575
576
  const doc = (0, import_smithy_client.take)(data, {
576
577
  Tags: import_smithy_client._json
577
578
  });
@@ -585,7 +586,7 @@ var de_LockRuleCommand = /* @__PURE__ */ __name(async (output, context) => {
585
586
  const contents = (0, import_smithy_client.map)({
586
587
  $metadata: deserializeMetadata(output)
587
588
  });
588
- const data = (0, import_smithy_client.expectNonNull)((0, import_smithy_client.expectObject)(await parseBody(output.body, context)), "body");
589
+ const data = (0, import_smithy_client.expectNonNull)((0, import_smithy_client.expectObject)(await (0, import_core2.parseJsonBody)(output.body, context)), "body");
589
590
  const doc = (0, import_smithy_client.take)(data, {
590
591
  Description: import_smithy_client.expectString,
591
592
  Identifier: import_smithy_client.expectString,
@@ -617,7 +618,7 @@ var de_UnlockRuleCommand = /* @__PURE__ */ __name(async (output, context) => {
617
618
  const contents = (0, import_smithy_client.map)({
618
619
  $metadata: deserializeMetadata(output)
619
620
  });
620
- const data = (0, import_smithy_client.expectNonNull)((0, import_smithy_client.expectObject)(await parseBody(output.body, context)), "body");
621
+ const data = (0, import_smithy_client.expectNonNull)((0, import_smithy_client.expectObject)(await (0, import_core2.parseJsonBody)(output.body, context)), "body");
621
622
  const doc = (0, import_smithy_client.take)(data, {
622
623
  Description: import_smithy_client.expectString,
623
624
  Identifier: import_smithy_client.expectString,
@@ -650,7 +651,7 @@ var de_UpdateRuleCommand = /* @__PURE__ */ __name(async (output, context) => {
650
651
  const contents = (0, import_smithy_client.map)({
651
652
  $metadata: deserializeMetadata(output)
652
653
  });
653
- const data = (0, import_smithy_client.expectNonNull)((0, import_smithy_client.expectObject)(await parseBody(output.body, context)), "body");
654
+ const data = (0, import_smithy_client.expectNonNull)((0, import_smithy_client.expectObject)(await (0, import_core2.parseJsonBody)(output.body, context)), "body");
654
655
  const doc = (0, import_smithy_client.take)(data, {
655
656
  Description: import_smithy_client.expectString,
656
657
  Identifier: import_smithy_client.expectString,
@@ -668,9 +669,9 @@ var de_UpdateRuleCommand = /* @__PURE__ */ __name(async (output, context) => {
668
669
  var de_CommandError = /* @__PURE__ */ __name(async (output, context) => {
669
670
  const parsedOutput = {
670
671
  ...output,
671
- body: await parseErrorBody(output.body, context)
672
+ body: await (0, import_core2.parseJsonErrorBody)(output.body, context)
672
673
  };
673
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
674
+ const errorCode = (0, import_core2.loadRestJsonErrorCode)(output, parsedOutput.body);
674
675
  switch (errorCode) {
675
676
  case "InternalServerException":
676
677
  case "com.amazonaws.rbin#InternalServerException":
@@ -772,49 +773,8 @@ var deserializeMetadata = /* @__PURE__ */ __name((output) => ({
772
773
  extendedRequestId: output.headers["x-amz-id-2"],
773
774
  cfId: output.headers["x-amz-cf-id"]
774
775
  }), "deserializeMetadata");
775
- var collectBodyString = /* @__PURE__ */ __name((streamBody, context) => (0, import_smithy_client.collectBody)(streamBody, context).then((body) => context.utf8Encoder(body)), "collectBodyString");
776
776
  var _TK = "TagKeys";
777
777
  var _tK = "tagKeys";
778
- var parseBody = /* @__PURE__ */ __name((streamBody, context) => collectBodyString(streamBody, context).then((encoded) => {
779
- if (encoded.length) {
780
- return JSON.parse(encoded);
781
- }
782
- return {};
783
- }), "parseBody");
784
- var parseErrorBody = /* @__PURE__ */ __name(async (errorBody, context) => {
785
- const value = await parseBody(errorBody, context);
786
- value.message = value.message ?? value.Message;
787
- return value;
788
- }, "parseErrorBody");
789
- var loadRestJsonErrorCode = /* @__PURE__ */ __name((output, data) => {
790
- const findKey = /* @__PURE__ */ __name((object, key) => Object.keys(object).find((k) => k.toLowerCase() === key.toLowerCase()), "findKey");
791
- const sanitizeErrorCode = /* @__PURE__ */ __name((rawValue) => {
792
- let cleanValue = rawValue;
793
- if (typeof cleanValue === "number") {
794
- cleanValue = cleanValue.toString();
795
- }
796
- if (cleanValue.indexOf(",") >= 0) {
797
- cleanValue = cleanValue.split(",")[0];
798
- }
799
- if (cleanValue.indexOf(":") >= 0) {
800
- cleanValue = cleanValue.split(":")[0];
801
- }
802
- if (cleanValue.indexOf("#") >= 0) {
803
- cleanValue = cleanValue.split("#")[1];
804
- }
805
- return cleanValue;
806
- }, "sanitizeErrorCode");
807
- const headerKey = findKey(output.headers, "x-amzn-errortype");
808
- if (headerKey !== void 0) {
809
- return sanitizeErrorCode(output.headers[headerKey]);
810
- }
811
- if (data.code !== void 0) {
812
- return sanitizeErrorCode(data.code);
813
- }
814
- if (data["__type"] !== void 0) {
815
- return sanitizeErrorCode(data["__type"]);
816
- }
817
- }, "loadRestJsonErrorCode");
818
778
 
819
779
  // src/commands/CreateRuleCommand.ts
820
780
  var _CreateRuleCommand = class _CreateRuleCommand 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, expectNonNull as __expectNonNull, expectNumber as __expectNumber, expectObject as __expectObject, expectString as __expectString, map, parseEpochTimestamp as __parseEpochTimestamp, take, withBaseException, } from "@smithy/smithy-client";
3
4
  import { ConflictException, InternalServerException, ResourceNotFoundException, ServiceQuotaExceededException, ValidationException, } from "../models/models_0";
@@ -420,43 +421,3 @@ const isSerializableHeaderValue = (value) => value !== undefined &&
420
421
  (!Object.getOwnPropertyNames(value).includes("size") || value.size != 0);
421
422
  const _TK = "TagKeys";
422
423
  const _tK = "tagKeys";
423
- const parseBody = (streamBody, context) => collectBodyString(streamBody, context).then((encoded) => {
424
- if (encoded.length) {
425
- return JSON.parse(encoded);
426
- }
427
- return {};
428
- });
429
- const parseErrorBody = async (errorBody, context) => {
430
- const value = await parseBody(errorBody, context);
431
- value.message = value.message ?? value.Message;
432
- return value;
433
- };
434
- const loadRestJsonErrorCode = (output, data) => {
435
- const findKey = (object, key) => Object.keys(object).find((k) => k.toLowerCase() === key.toLowerCase());
436
- const sanitizeErrorCode = (rawValue) => {
437
- let cleanValue = rawValue;
438
- if (typeof cleanValue === "number") {
439
- cleanValue = cleanValue.toString();
440
- }
441
- if (cleanValue.indexOf(",") >= 0) {
442
- cleanValue = cleanValue.split(",")[0];
443
- }
444
- if (cleanValue.indexOf(":") >= 0) {
445
- cleanValue = cleanValue.split(":")[0];
446
- }
447
- if (cleanValue.indexOf("#") >= 0) {
448
- cleanValue = cleanValue.split("#")[1];
449
- }
450
- return cleanValue;
451
- };
452
- const headerKey = findKey(output.headers, "x-amzn-errortype");
453
- if (headerKey !== undefined) {
454
- return sanitizeErrorCode(output.headers[headerKey]);
455
- }
456
- if (data.code !== undefined) {
457
- return sanitizeErrorCode(data.code);
458
- }
459
- if (data["__type"] !== undefined) {
460
- return sanitizeErrorCode(data["__type"]);
461
- }
462
- };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@aws-sdk/client-rbin",
3
3
  "description": "AWS SDK for JavaScript Rbin 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-rbin",
@@ -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",