@aws-sdk/client-kinesis-video-archived-media 3.525.0 → 3.529.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/index.js CHANGED
@@ -461,6 +461,7 @@ var GetMediaForFragmentListOutputFilterSensitiveLog = /* @__PURE__ */ __name((ob
461
461
  }), "GetMediaForFragmentListOutputFilterSensitiveLog");
462
462
 
463
463
  // src/protocols/Aws_restJson1.ts
464
+ var import_core2 = require("@aws-sdk/core");
464
465
 
465
466
 
466
467
  var se_GetClipCommand = /* @__PURE__ */ __name(async (input, context) => {
@@ -607,7 +608,7 @@ var de_GetDASHStreamingSessionURLCommand = /* @__PURE__ */ __name(async (output,
607
608
  const contents = (0, import_smithy_client.map)({
608
609
  $metadata: deserializeMetadata(output)
609
610
  });
610
- const data = (0, import_smithy_client.expectNonNull)((0, import_smithy_client.expectObject)(await parseBody(output.body, context)), "body");
611
+ const data = (0, import_smithy_client.expectNonNull)((0, import_smithy_client.expectObject)(await (0, import_core2.parseJsonBody)(output.body, context)), "body");
611
612
  const doc = (0, import_smithy_client.take)(data, {
612
613
  DASHStreamingSessionURL: import_smithy_client.expectString
613
614
  });
@@ -621,7 +622,7 @@ var de_GetHLSStreamingSessionURLCommand = /* @__PURE__ */ __name(async (output,
621
622
  const contents = (0, import_smithy_client.map)({
622
623
  $metadata: deserializeMetadata(output)
623
624
  });
624
- const data = (0, import_smithy_client.expectNonNull)((0, import_smithy_client.expectObject)(await parseBody(output.body, context)), "body");
625
+ const data = (0, import_smithy_client.expectNonNull)((0, import_smithy_client.expectObject)(await (0, import_core2.parseJsonBody)(output.body, context)), "body");
625
626
  const doc = (0, import_smithy_client.take)(data, {
626
627
  HLSStreamingSessionURL: import_smithy_client.expectString
627
628
  });
@@ -635,7 +636,7 @@ var de_GetImagesCommand = /* @__PURE__ */ __name(async (output, context) => {
635
636
  const contents = (0, import_smithy_client.map)({
636
637
  $metadata: deserializeMetadata(output)
637
638
  });
638
- const data = (0, import_smithy_client.expectNonNull)((0, import_smithy_client.expectObject)(await parseBody(output.body, context)), "body");
639
+ const data = (0, import_smithy_client.expectNonNull)((0, import_smithy_client.expectObject)(await (0, import_core2.parseJsonBody)(output.body, context)), "body");
639
640
  const doc = (0, import_smithy_client.take)(data, {
640
641
  Images: (_) => de_Images(_, context),
641
642
  NextToken: import_smithy_client.expectString
@@ -663,7 +664,7 @@ var de_ListFragmentsCommand = /* @__PURE__ */ __name(async (output, context) =>
663
664
  const contents = (0, import_smithy_client.map)({
664
665
  $metadata: deserializeMetadata(output)
665
666
  });
666
- const data = (0, import_smithy_client.expectNonNull)((0, import_smithy_client.expectObject)(await parseBody(output.body, context)), "body");
667
+ const data = (0, import_smithy_client.expectNonNull)((0, import_smithy_client.expectObject)(await (0, import_core2.parseJsonBody)(output.body, context)), "body");
667
668
  const doc = (0, import_smithy_client.take)(data, {
668
669
  Fragments: (_) => de_FragmentList(_, context),
669
670
  NextToken: import_smithy_client.expectString
@@ -674,9 +675,9 @@ var de_ListFragmentsCommand = /* @__PURE__ */ __name(async (output, context) =>
674
675
  var de_CommandError = /* @__PURE__ */ __name(async (output, context) => {
675
676
  const parsedOutput = {
676
677
  ...output,
677
- body: await parseErrorBody(output.body, context)
678
+ body: await (0, import_core2.parseJsonErrorBody)(output.body, context)
678
679
  };
679
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
680
+ const errorCode = (0, import_core2.loadRestJsonErrorCode)(output, parsedOutput.body);
680
681
  switch (errorCode) {
681
682
  case "ClientLimitExceededException":
682
683
  case "com.amazonaws.kinesisvideoarchivedmedia#ClientLimitExceededException":
@@ -914,49 +915,8 @@ var deserializeMetadata = /* @__PURE__ */ __name((output) => ({
914
915
  extendedRequestId: output.headers["x-amz-id-2"],
915
916
  cfId: output.headers["x-amz-cf-id"]
916
917
  }), "deserializeMetadata");
917
- var collectBodyString = /* @__PURE__ */ __name((streamBody, context) => (0, import_smithy_client.collectBody)(streamBody, context).then((body) => context.utf8Encoder(body)), "collectBodyString");
918
918
  var _CT = "ContentType";
919
919
  var _ct = "content-type";
920
- var parseBody = /* @__PURE__ */ __name((streamBody, context) => collectBodyString(streamBody, context).then((encoded) => {
921
- if (encoded.length) {
922
- return JSON.parse(encoded);
923
- }
924
- return {};
925
- }), "parseBody");
926
- var parseErrorBody = /* @__PURE__ */ __name(async (errorBody, context) => {
927
- const value = await parseBody(errorBody, context);
928
- value.message = value.message ?? value.Message;
929
- return value;
930
- }, "parseErrorBody");
931
- var loadRestJsonErrorCode = /* @__PURE__ */ __name((output, data) => {
932
- const findKey = /* @__PURE__ */ __name((object, key) => Object.keys(object).find((k) => k.toLowerCase() === key.toLowerCase()), "findKey");
933
- const sanitizeErrorCode = /* @__PURE__ */ __name((rawValue) => {
934
- let cleanValue = rawValue;
935
- if (typeof cleanValue === "number") {
936
- cleanValue = cleanValue.toString();
937
- }
938
- if (cleanValue.indexOf(",") >= 0) {
939
- cleanValue = cleanValue.split(",")[0];
940
- }
941
- if (cleanValue.indexOf(":") >= 0) {
942
- cleanValue = cleanValue.split(":")[0];
943
- }
944
- if (cleanValue.indexOf("#") >= 0) {
945
- cleanValue = cleanValue.split("#")[1];
946
- }
947
- return cleanValue;
948
- }, "sanitizeErrorCode");
949
- const headerKey = findKey(output.headers, "x-amzn-errortype");
950
- if (headerKey !== void 0) {
951
- return sanitizeErrorCode(output.headers[headerKey]);
952
- }
953
- if (data.code !== void 0) {
954
- return sanitizeErrorCode(data.code);
955
- }
956
- if (data["__type"] !== void 0) {
957
- return sanitizeErrorCode(data["__type"]);
958
- }
959
- }, "loadRestJsonErrorCode");
960
920
 
961
921
  // src/commands/GetClipCommand.ts
962
922
  var _GetClipCommand = class _GetClipCommand 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, expectLong as __expectLong, 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 { KinesisVideoArchivedMediaServiceException as __BaseException } from "../models/KinesisVideoArchivedMediaServiceException";
@@ -453,43 +454,3 @@ const isSerializableHeaderValue = (value) => value !== undefined &&
453
454
  (!Object.getOwnPropertyNames(value).includes("size") || value.size != 0);
454
455
  const _CT = "ContentType";
455
456
  const _ct = "content-type";
456
- const parseBody = (streamBody, context) => collectBodyString(streamBody, context).then((encoded) => {
457
- if (encoded.length) {
458
- return JSON.parse(encoded);
459
- }
460
- return {};
461
- });
462
- const parseErrorBody = async (errorBody, context) => {
463
- const value = await parseBody(errorBody, context);
464
- value.message = value.message ?? value.Message;
465
- return value;
466
- };
467
- const loadRestJsonErrorCode = (output, data) => {
468
- const findKey = (object, key) => Object.keys(object).find((k) => k.toLowerCase() === key.toLowerCase());
469
- const sanitizeErrorCode = (rawValue) => {
470
- let cleanValue = rawValue;
471
- if (typeof cleanValue === "number") {
472
- cleanValue = cleanValue.toString();
473
- }
474
- if (cleanValue.indexOf(",") >= 0) {
475
- cleanValue = cleanValue.split(",")[0];
476
- }
477
- if (cleanValue.indexOf(":") >= 0) {
478
- cleanValue = cleanValue.split(":")[0];
479
- }
480
- if (cleanValue.indexOf("#") >= 0) {
481
- cleanValue = cleanValue.split("#")[1];
482
- }
483
- return cleanValue;
484
- };
485
- const headerKey = findKey(output.headers, "x-amzn-errortype");
486
- if (headerKey !== undefined) {
487
- return sanitizeErrorCode(output.headers[headerKey]);
488
- }
489
- if (data.code !== undefined) {
490
- return sanitizeErrorCode(data.code);
491
- }
492
- if (data["__type"] !== undefined) {
493
- return sanitizeErrorCode(data["__type"]);
494
- }
495
- };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@aws-sdk/client-kinesis-video-archived-media",
3
3
  "description": "AWS SDK for JavaScript Kinesis Video Archived Media Client for Node.js, Browser and React Native",
4
- "version": "3.525.0",
4
+ "version": "3.529.0",
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-kinesis-video-archived-media",
@@ -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.0",
24
+ "@aws-sdk/core": "3.529.0",
25
+ "@aws-sdk/credential-provider-node": "3.529.0",
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",