@aws-sdk/client-mediapackage-vod 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
@@ -217,6 +217,7 @@ var import_middleware_serde = require("@smithy/middleware-serde");
217
217
  var import_types = require("@smithy/types");
218
218
 
219
219
  // src/protocols/Aws_restJson1.ts
220
+ var import_core2 = require("@aws-sdk/core");
220
221
 
221
222
 
222
223
 
@@ -628,7 +629,7 @@ var de_ConfigureLogsCommand = /* @__PURE__ */ __name(async (output, context) =>
628
629
  const contents = (0, import_smithy_client.map)({
629
630
  $metadata: deserializeMetadata(output)
630
631
  });
631
- const data = (0, import_smithy_client.expectNonNull)((0, import_smithy_client.expectObject)(await parseBody(output.body, context)), "body");
632
+ const data = (0, import_smithy_client.expectNonNull)((0, import_smithy_client.expectObject)(await (0, import_core2.parseJsonBody)(output.body, context)), "body");
632
633
  const doc = (0, import_smithy_client.take)(data, {
633
634
  Arn: [, import_smithy_client.expectString, `arn`],
634
635
  Authorization: [, (_) => de_Authorization(_, context), `authorization`],
@@ -648,7 +649,7 @@ var de_CreateAssetCommand = /* @__PURE__ */ __name(async (output, context) => {
648
649
  const contents = (0, import_smithy_client.map)({
649
650
  $metadata: deserializeMetadata(output)
650
651
  });
651
- const data = (0, import_smithy_client.expectNonNull)((0, import_smithy_client.expectObject)(await parseBody(output.body, context)), "body");
652
+ const data = (0, import_smithy_client.expectNonNull)((0, import_smithy_client.expectObject)(await (0, import_core2.parseJsonBody)(output.body, context)), "body");
652
653
  const doc = (0, import_smithy_client.take)(data, {
653
654
  Arn: [, import_smithy_client.expectString, `arn`],
654
655
  CreatedAt: [, import_smithy_client.expectString, `createdAt`],
@@ -670,7 +671,7 @@ var de_CreatePackagingConfigurationCommand = /* @__PURE__ */ __name(async (outpu
670
671
  const contents = (0, import_smithy_client.map)({
671
672
  $metadata: deserializeMetadata(output)
672
673
  });
673
- const data = (0, import_smithy_client.expectNonNull)((0, import_smithy_client.expectObject)(await parseBody(output.body, context)), "body");
674
+ const data = (0, import_smithy_client.expectNonNull)((0, import_smithy_client.expectObject)(await (0, import_core2.parseJsonBody)(output.body, context)), "body");
674
675
  const doc = (0, import_smithy_client.take)(data, {
675
676
  Arn: [, import_smithy_client.expectString, `arn`],
676
677
  CmafPackage: [, (_) => de_CmafPackage(_, context), `cmafPackage`],
@@ -692,7 +693,7 @@ var de_CreatePackagingGroupCommand = /* @__PURE__ */ __name(async (output, conte
692
693
  const contents = (0, import_smithy_client.map)({
693
694
  $metadata: deserializeMetadata(output)
694
695
  });
695
- const data = (0, import_smithy_client.expectNonNull)((0, import_smithy_client.expectObject)(await parseBody(output.body, context)), "body");
696
+ const data = (0, import_smithy_client.expectNonNull)((0, import_smithy_client.expectObject)(await (0, import_core2.parseJsonBody)(output.body, context)), "body");
696
697
  const doc = (0, import_smithy_client.take)(data, {
697
698
  Arn: [, import_smithy_client.expectString, `arn`],
698
699
  Authorization: [, (_) => de_Authorization(_, context), `authorization`],
@@ -742,7 +743,7 @@ var de_DescribeAssetCommand = /* @__PURE__ */ __name(async (output, context) =>
742
743
  const contents = (0, import_smithy_client.map)({
743
744
  $metadata: deserializeMetadata(output)
744
745
  });
745
- const data = (0, import_smithy_client.expectNonNull)((0, import_smithy_client.expectObject)(await parseBody(output.body, context)), "body");
746
+ const data = (0, import_smithy_client.expectNonNull)((0, import_smithy_client.expectObject)(await (0, import_core2.parseJsonBody)(output.body, context)), "body");
746
747
  const doc = (0, import_smithy_client.take)(data, {
747
748
  Arn: [, import_smithy_client.expectString, `arn`],
748
749
  CreatedAt: [, import_smithy_client.expectString, `createdAt`],
@@ -764,7 +765,7 @@ var de_DescribePackagingConfigurationCommand = /* @__PURE__ */ __name(async (out
764
765
  const contents = (0, import_smithy_client.map)({
765
766
  $metadata: deserializeMetadata(output)
766
767
  });
767
- const data = (0, import_smithy_client.expectNonNull)((0, import_smithy_client.expectObject)(await parseBody(output.body, context)), "body");
768
+ const data = (0, import_smithy_client.expectNonNull)((0, import_smithy_client.expectObject)(await (0, import_core2.parseJsonBody)(output.body, context)), "body");
768
769
  const doc = (0, import_smithy_client.take)(data, {
769
770
  Arn: [, import_smithy_client.expectString, `arn`],
770
771
  CmafPackage: [, (_) => de_CmafPackage(_, context), `cmafPackage`],
@@ -786,7 +787,7 @@ var de_DescribePackagingGroupCommand = /* @__PURE__ */ __name(async (output, con
786
787
  const contents = (0, import_smithy_client.map)({
787
788
  $metadata: deserializeMetadata(output)
788
789
  });
789
- const data = (0, import_smithy_client.expectNonNull)((0, import_smithy_client.expectObject)(await parseBody(output.body, context)), "body");
790
+ const data = (0, import_smithy_client.expectNonNull)((0, import_smithy_client.expectObject)(await (0, import_core2.parseJsonBody)(output.body, context)), "body");
790
791
  const doc = (0, import_smithy_client.take)(data, {
791
792
  ApproximateAssetCount: [, import_smithy_client.expectInt32, `approximateAssetCount`],
792
793
  Arn: [, import_smithy_client.expectString, `arn`],
@@ -807,7 +808,7 @@ var de_ListAssetsCommand = /* @__PURE__ */ __name(async (output, context) => {
807
808
  const contents = (0, import_smithy_client.map)({
808
809
  $metadata: deserializeMetadata(output)
809
810
  });
810
- const data = (0, import_smithy_client.expectNonNull)((0, import_smithy_client.expectObject)(await parseBody(output.body, context)), "body");
811
+ const data = (0, import_smithy_client.expectNonNull)((0, import_smithy_client.expectObject)(await (0, import_core2.parseJsonBody)(output.body, context)), "body");
811
812
  const doc = (0, import_smithy_client.take)(data, {
812
813
  Assets: [, (_) => de___listOfAssetShallow(_, context), `assets`],
813
814
  NextToken: [, import_smithy_client.expectString, `nextToken`]
@@ -822,7 +823,7 @@ var de_ListPackagingConfigurationsCommand = /* @__PURE__ */ __name(async (output
822
823
  const contents = (0, import_smithy_client.map)({
823
824
  $metadata: deserializeMetadata(output)
824
825
  });
825
- const data = (0, import_smithy_client.expectNonNull)((0, import_smithy_client.expectObject)(await parseBody(output.body, context)), "body");
826
+ const data = (0, import_smithy_client.expectNonNull)((0, import_smithy_client.expectObject)(await (0, import_core2.parseJsonBody)(output.body, context)), "body");
826
827
  const doc = (0, import_smithy_client.take)(data, {
827
828
  NextToken: [, import_smithy_client.expectString, `nextToken`],
828
829
  PackagingConfigurations: [, (_) => de___listOfPackagingConfiguration(_, context), `packagingConfigurations`]
@@ -837,7 +838,7 @@ var de_ListPackagingGroupsCommand = /* @__PURE__ */ __name(async (output, contex
837
838
  const contents = (0, import_smithy_client.map)({
838
839
  $metadata: deserializeMetadata(output)
839
840
  });
840
- const data = (0, import_smithy_client.expectNonNull)((0, import_smithy_client.expectObject)(await parseBody(output.body, context)), "body");
841
+ const data = (0, import_smithy_client.expectNonNull)((0, import_smithy_client.expectObject)(await (0, import_core2.parseJsonBody)(output.body, context)), "body");
841
842
  const doc = (0, import_smithy_client.take)(data, {
842
843
  NextToken: [, import_smithy_client.expectString, `nextToken`],
843
844
  PackagingGroups: [, (_) => de___listOfPackagingGroup(_, context), `packagingGroups`]
@@ -852,7 +853,7 @@ var de_ListTagsForResourceCommand = /* @__PURE__ */ __name(async (output, contex
852
853
  const contents = (0, import_smithy_client.map)({
853
854
  $metadata: deserializeMetadata(output)
854
855
  });
855
- const data = (0, import_smithy_client.expectNonNull)((0, import_smithy_client.expectObject)(await parseBody(output.body, context)), "body");
856
+ const data = (0, import_smithy_client.expectNonNull)((0, import_smithy_client.expectObject)(await (0, import_core2.parseJsonBody)(output.body, context)), "body");
856
857
  const doc = (0, import_smithy_client.take)(data, {
857
858
  Tags: [, import_smithy_client._json, `tags`]
858
859
  });
@@ -886,7 +887,7 @@ var de_UpdatePackagingGroupCommand = /* @__PURE__ */ __name(async (output, conte
886
887
  const contents = (0, import_smithy_client.map)({
887
888
  $metadata: deserializeMetadata(output)
888
889
  });
889
- const data = (0, import_smithy_client.expectNonNull)((0, import_smithy_client.expectObject)(await parseBody(output.body, context)), "body");
890
+ const data = (0, import_smithy_client.expectNonNull)((0, import_smithy_client.expectObject)(await (0, import_core2.parseJsonBody)(output.body, context)), "body");
890
891
  const doc = (0, import_smithy_client.take)(data, {
891
892
  ApproximateAssetCount: [, import_smithy_client.expectInt32, `approximateAssetCount`],
892
893
  Arn: [, import_smithy_client.expectString, `arn`],
@@ -903,9 +904,9 @@ var de_UpdatePackagingGroupCommand = /* @__PURE__ */ __name(async (output, conte
903
904
  var de_CommandError = /* @__PURE__ */ __name(async (output, context) => {
904
905
  const parsedOutput = {
905
906
  ...output,
906
- body: await parseErrorBody(output.body, context)
907
+ body: await (0, import_core2.parseJsonErrorBody)(output.body, context)
907
908
  };
908
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
909
+ const errorCode = (0, import_core2.loadRestJsonErrorCode)(output, parsedOutput.body);
909
910
  switch (errorCode) {
910
911
  case "ForbiddenException":
911
912
  case "com.amazonaws.mediapackagevod#ForbiddenException":
@@ -1360,7 +1361,6 @@ var deserializeMetadata = /* @__PURE__ */ __name((output) => ({
1360
1361
  extendedRequestId: output.headers["x-amz-id-2"],
1361
1362
  cfId: output.headers["x-amz-cf-id"]
1362
1363
  }), "deserializeMetadata");
1363
- var collectBodyString = /* @__PURE__ */ __name((streamBody, context) => (0, import_smithy_client.collectBody)(streamBody, context).then((body) => context.utf8Encoder(body)), "collectBodyString");
1364
1364
  var _MR = "MaxResults";
1365
1365
  var _NT = "NextToken";
1366
1366
  var _PGI = "PackagingGroupId";
@@ -1369,46 +1369,6 @@ var _mR = "maxResults";
1369
1369
  var _nT = "nextToken";
1370
1370
  var _pGI = "packagingGroupId";
1371
1371
  var _tK = "tagKeys";
1372
- var parseBody = /* @__PURE__ */ __name((streamBody, context) => collectBodyString(streamBody, context).then((encoded) => {
1373
- if (encoded.length) {
1374
- return JSON.parse(encoded);
1375
- }
1376
- return {};
1377
- }), "parseBody");
1378
- var parseErrorBody = /* @__PURE__ */ __name(async (errorBody, context) => {
1379
- const value = await parseBody(errorBody, context);
1380
- value.message = value.message ?? value.Message;
1381
- return value;
1382
- }, "parseErrorBody");
1383
- var loadRestJsonErrorCode = /* @__PURE__ */ __name((output, data) => {
1384
- const findKey = /* @__PURE__ */ __name((object, key) => Object.keys(object).find((k) => k.toLowerCase() === key.toLowerCase()), "findKey");
1385
- const sanitizeErrorCode = /* @__PURE__ */ __name((rawValue) => {
1386
- let cleanValue = rawValue;
1387
- if (typeof cleanValue === "number") {
1388
- cleanValue = cleanValue.toString();
1389
- }
1390
- if (cleanValue.indexOf(",") >= 0) {
1391
- cleanValue = cleanValue.split(",")[0];
1392
- }
1393
- if (cleanValue.indexOf(":") >= 0) {
1394
- cleanValue = cleanValue.split(":")[0];
1395
- }
1396
- if (cleanValue.indexOf("#") >= 0) {
1397
- cleanValue = cleanValue.split("#")[1];
1398
- }
1399
- return cleanValue;
1400
- }, "sanitizeErrorCode");
1401
- const headerKey = findKey(output.headers, "x-amzn-errortype");
1402
- if (headerKey !== void 0) {
1403
- return sanitizeErrorCode(output.headers[headerKey]);
1404
- }
1405
- if (data.code !== void 0) {
1406
- return sanitizeErrorCode(data.code);
1407
- }
1408
- if (data["__type"] !== void 0) {
1409
- return sanitizeErrorCode(data["__type"]);
1410
- }
1411
- }, "loadRestJsonErrorCode");
1412
1372
 
1413
1373
  // src/commands/ConfigureLogsCommand.ts
1414
1374
  var _ConfigureLogsCommand = class _ConfigureLogsCommand 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, expectBoolean as __expectBoolean, expectInt32 as __expectInt32, expectNonNull as __expectNonNull, expectObject as __expectObject, expectString as __expectString, map, take, withBaseException, } from "@smithy/smithy-client";
3
4
  import { MediaPackageVodServiceException as __BaseException } from "../models/MediaPackageVodServiceException";
@@ -986,43 +987,3 @@ const _mR = "maxResults";
986
987
  const _nT = "nextToken";
987
988
  const _pGI = "packagingGroupId";
988
989
  const _tK = "tagKeys";
989
- const parseBody = (streamBody, context) => collectBodyString(streamBody, context).then((encoded) => {
990
- if (encoded.length) {
991
- return JSON.parse(encoded);
992
- }
993
- return {};
994
- });
995
- const parseErrorBody = async (errorBody, context) => {
996
- const value = await parseBody(errorBody, context);
997
- value.message = value.message ?? value.Message;
998
- return value;
999
- };
1000
- const loadRestJsonErrorCode = (output, data) => {
1001
- const findKey = (object, key) => Object.keys(object).find((k) => k.toLowerCase() === key.toLowerCase());
1002
- const sanitizeErrorCode = (rawValue) => {
1003
- let cleanValue = rawValue;
1004
- if (typeof cleanValue === "number") {
1005
- cleanValue = cleanValue.toString();
1006
- }
1007
- if (cleanValue.indexOf(",") >= 0) {
1008
- cleanValue = cleanValue.split(",")[0];
1009
- }
1010
- if (cleanValue.indexOf(":") >= 0) {
1011
- cleanValue = cleanValue.split(":")[0];
1012
- }
1013
- if (cleanValue.indexOf("#") >= 0) {
1014
- cleanValue = cleanValue.split("#")[1];
1015
- }
1016
- return cleanValue;
1017
- };
1018
- const headerKey = findKey(output.headers, "x-amzn-errortype");
1019
- if (headerKey !== undefined) {
1020
- return sanitizeErrorCode(output.headers[headerKey]);
1021
- }
1022
- if (data.code !== undefined) {
1023
- return sanitizeErrorCode(data.code);
1024
- }
1025
- if (data["__type"] !== undefined) {
1026
- return sanitizeErrorCode(data["__type"]);
1027
- }
1028
- };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@aws-sdk/client-mediapackage-vod",
3
3
  "description": "AWS SDK for JavaScript Mediapackage Vod 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-mediapackage-vod",
@@ -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",