@aws-sdk/client-scheduler 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
@@ -210,6 +210,7 @@ var import_middleware_serde = require("@smithy/middleware-serde");
210
210
  var import_types = require("@smithy/types");
211
211
 
212
212
  // src/protocols/Aws_restJson1.ts
213
+ var import_core2 = require("@aws-sdk/core");
213
214
 
214
215
 
215
216
  var import_uuid = require("uuid");
@@ -568,7 +569,7 @@ var de_CreateScheduleCommand = /* @__PURE__ */ __name(async (output, context) =>
568
569
  const contents = (0, import_smithy_client.map)({
569
570
  $metadata: deserializeMetadata(output)
570
571
  });
571
- const data = (0, import_smithy_client.expectNonNull)((0, import_smithy_client.expectObject)(await parseBody(output.body, context)), "body");
572
+ const data = (0, import_smithy_client.expectNonNull)((0, import_smithy_client.expectObject)(await (0, import_core2.parseJsonBody)(output.body, context)), "body");
572
573
  const doc = (0, import_smithy_client.take)(data, {
573
574
  ScheduleArn: import_smithy_client.expectString
574
575
  });
@@ -582,7 +583,7 @@ var de_CreateScheduleGroupCommand = /* @__PURE__ */ __name(async (output, contex
582
583
  const contents = (0, import_smithy_client.map)({
583
584
  $metadata: deserializeMetadata(output)
584
585
  });
585
- const data = (0, import_smithy_client.expectNonNull)((0, import_smithy_client.expectObject)(await parseBody(output.body, context)), "body");
586
+ const data = (0, import_smithy_client.expectNonNull)((0, import_smithy_client.expectObject)(await (0, import_core2.parseJsonBody)(output.body, context)), "body");
586
587
  const doc = (0, import_smithy_client.take)(data, {
587
588
  ScheduleGroupArn: import_smithy_client.expectString
588
589
  });
@@ -616,7 +617,7 @@ var de_GetScheduleCommand = /* @__PURE__ */ __name(async (output, context) => {
616
617
  const contents = (0, import_smithy_client.map)({
617
618
  $metadata: deserializeMetadata(output)
618
619
  });
619
- const data = (0, import_smithy_client.expectNonNull)((0, import_smithy_client.expectObject)(await parseBody(output.body, context)), "body");
620
+ const data = (0, import_smithy_client.expectNonNull)((0, import_smithy_client.expectObject)(await (0, import_core2.parseJsonBody)(output.body, context)), "body");
620
621
  const doc = (0, import_smithy_client.take)(data, {
621
622
  ActionAfterCompletion: import_smithy_client.expectString,
622
623
  Arn: import_smithy_client.expectString,
@@ -644,7 +645,7 @@ var de_GetScheduleGroupCommand = /* @__PURE__ */ __name(async (output, context)
644
645
  const contents = (0, import_smithy_client.map)({
645
646
  $metadata: deserializeMetadata(output)
646
647
  });
647
- const data = (0, import_smithy_client.expectNonNull)((0, import_smithy_client.expectObject)(await parseBody(output.body, context)), "body");
648
+ const data = (0, import_smithy_client.expectNonNull)((0, import_smithy_client.expectObject)(await (0, import_core2.parseJsonBody)(output.body, context)), "body");
648
649
  const doc = (0, import_smithy_client.take)(data, {
649
650
  Arn: import_smithy_client.expectString,
650
651
  CreationDate: (_) => (0, import_smithy_client.expectNonNull)((0, import_smithy_client.parseEpochTimestamp)((0, import_smithy_client.expectNumber)(_))),
@@ -662,7 +663,7 @@ var de_ListScheduleGroupsCommand = /* @__PURE__ */ __name(async (output, context
662
663
  const contents = (0, import_smithy_client.map)({
663
664
  $metadata: deserializeMetadata(output)
664
665
  });
665
- const data = (0, import_smithy_client.expectNonNull)((0, import_smithy_client.expectObject)(await parseBody(output.body, context)), "body");
666
+ const data = (0, import_smithy_client.expectNonNull)((0, import_smithy_client.expectObject)(await (0, import_core2.parseJsonBody)(output.body, context)), "body");
666
667
  const doc = (0, import_smithy_client.take)(data, {
667
668
  NextToken: import_smithy_client.expectString,
668
669
  ScheduleGroups: (_) => de_ScheduleGroupList(_, context)
@@ -677,7 +678,7 @@ var de_ListSchedulesCommand = /* @__PURE__ */ __name(async (output, context) =>
677
678
  const contents = (0, import_smithy_client.map)({
678
679
  $metadata: deserializeMetadata(output)
679
680
  });
680
- const data = (0, import_smithy_client.expectNonNull)((0, import_smithy_client.expectObject)(await parseBody(output.body, context)), "body");
681
+ const data = (0, import_smithy_client.expectNonNull)((0, import_smithy_client.expectObject)(await (0, import_core2.parseJsonBody)(output.body, context)), "body");
681
682
  const doc = (0, import_smithy_client.take)(data, {
682
683
  NextToken: import_smithy_client.expectString,
683
684
  Schedules: (_) => de_ScheduleList(_, context)
@@ -692,7 +693,7 @@ var de_ListTagsForResourceCommand = /* @__PURE__ */ __name(async (output, contex
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
  Tags: import_smithy_client._json
698
699
  });
@@ -726,7 +727,7 @@ var de_UpdateScheduleCommand = /* @__PURE__ */ __name(async (output, context) =>
726
727
  const contents = (0, import_smithy_client.map)({
727
728
  $metadata: deserializeMetadata(output)
728
729
  });
729
- const data = (0, import_smithy_client.expectNonNull)((0, import_smithy_client.expectObject)(await parseBody(output.body, context)), "body");
730
+ const data = (0, import_smithy_client.expectNonNull)((0, import_smithy_client.expectObject)(await (0, import_core2.parseJsonBody)(output.body, context)), "body");
730
731
  const doc = (0, import_smithy_client.take)(data, {
731
732
  ScheduleArn: import_smithy_client.expectString
732
733
  });
@@ -736,9 +737,9 @@ var de_UpdateScheduleCommand = /* @__PURE__ */ __name(async (output, context) =>
736
737
  var de_CommandError = /* @__PURE__ */ __name(async (output, context) => {
737
738
  const parsedOutput = {
738
739
  ...output,
739
- body: await parseErrorBody(output.body, context)
740
+ body: await (0, import_core2.parseJsonErrorBody)(output.body, context)
740
741
  };
741
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
742
+ const errorCode = (0, import_core2.loadRestJsonErrorCode)(output, parsedOutput.body);
742
743
  switch (errorCode) {
743
744
  case "ConflictException":
744
745
  case "com.amazonaws.scheduler#ConflictException":
@@ -884,7 +885,6 @@ var deserializeMetadata = /* @__PURE__ */ __name((output) => ({
884
885
  extendedRequestId: output.headers["x-amz-id-2"],
885
886
  cfId: output.headers["x-amz-cf-id"]
886
887
  }), "deserializeMetadata");
887
- var collectBodyString = /* @__PURE__ */ __name((streamBody, context) => (0, import_smithy_client.collectBody)(streamBody, context).then((body) => context.utf8Encoder(body)), "collectBodyString");
888
888
  var _CT = "ClientToken";
889
889
  var _GN = "GroupName";
890
890
  var _MR = "MaxResults";
@@ -895,46 +895,6 @@ var _SG = "ScheduleGroup";
895
895
  var _TK = "TagKeys";
896
896
  var _cT = "clientToken";
897
897
  var _gN = "groupName";
898
- var parseBody = /* @__PURE__ */ __name((streamBody, context) => collectBodyString(streamBody, context).then((encoded) => {
899
- if (encoded.length) {
900
- return JSON.parse(encoded);
901
- }
902
- return {};
903
- }), "parseBody");
904
- var parseErrorBody = /* @__PURE__ */ __name(async (errorBody, context) => {
905
- const value = await parseBody(errorBody, context);
906
- value.message = value.message ?? value.Message;
907
- return value;
908
- }, "parseErrorBody");
909
- var loadRestJsonErrorCode = /* @__PURE__ */ __name((output, data) => {
910
- const findKey = /* @__PURE__ */ __name((object, key) => Object.keys(object).find((k) => k.toLowerCase() === key.toLowerCase()), "findKey");
911
- const sanitizeErrorCode = /* @__PURE__ */ __name((rawValue) => {
912
- let cleanValue = rawValue;
913
- if (typeof cleanValue === "number") {
914
- cleanValue = cleanValue.toString();
915
- }
916
- if (cleanValue.indexOf(",") >= 0) {
917
- cleanValue = cleanValue.split(",")[0];
918
- }
919
- if (cleanValue.indexOf(":") >= 0) {
920
- cleanValue = cleanValue.split(":")[0];
921
- }
922
- if (cleanValue.indexOf("#") >= 0) {
923
- cleanValue = cleanValue.split("#")[1];
924
- }
925
- return cleanValue;
926
- }, "sanitizeErrorCode");
927
- const headerKey = findKey(output.headers, "x-amzn-errortype");
928
- if (headerKey !== void 0) {
929
- return sanitizeErrorCode(output.headers[headerKey]);
930
- }
931
- if (data.code !== void 0) {
932
- return sanitizeErrorCode(data.code);
933
- }
934
- if (data["__type"] !== void 0) {
935
- return sanitizeErrorCode(data["__type"]);
936
- }
937
- }, "loadRestJsonErrorCode");
938
898
 
939
899
  // src/commands/CreateScheduleCommand.ts
940
900
  var _CreateScheduleCommand = class _CreateScheduleCommand 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 { v4 as generateIdempotencyToken } from "uuid";
@@ -523,43 +524,3 @@ const _SG = "ScheduleGroup";
523
524
  const _TK = "TagKeys";
524
525
  const _cT = "clientToken";
525
526
  const _gN = "groupName";
526
- const parseBody = (streamBody, context) => collectBodyString(streamBody, context).then((encoded) => {
527
- if (encoded.length) {
528
- return JSON.parse(encoded);
529
- }
530
- return {};
531
- });
532
- const parseErrorBody = async (errorBody, context) => {
533
- const value = await parseBody(errorBody, context);
534
- value.message = value.message ?? value.Message;
535
- return value;
536
- };
537
- const loadRestJsonErrorCode = (output, data) => {
538
- const findKey = (object, key) => Object.keys(object).find((k) => k.toLowerCase() === key.toLowerCase());
539
- const sanitizeErrorCode = (rawValue) => {
540
- let cleanValue = rawValue;
541
- if (typeof cleanValue === "number") {
542
- cleanValue = cleanValue.toString();
543
- }
544
- if (cleanValue.indexOf(",") >= 0) {
545
- cleanValue = cleanValue.split(",")[0];
546
- }
547
- if (cleanValue.indexOf(":") >= 0) {
548
- cleanValue = cleanValue.split(":")[0];
549
- }
550
- if (cleanValue.indexOf("#") >= 0) {
551
- cleanValue = cleanValue.split("#")[1];
552
- }
553
- return cleanValue;
554
- };
555
- const headerKey = findKey(output.headers, "x-amzn-errortype");
556
- if (headerKey !== undefined) {
557
- return sanitizeErrorCode(output.headers[headerKey]);
558
- }
559
- if (data.code !== undefined) {
560
- return sanitizeErrorCode(data.code);
561
- }
562
- if (data["__type"] !== undefined) {
563
- return sanitizeErrorCode(data["__type"]);
564
- }
565
- };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@aws-sdk/client-scheduler",
3
3
  "description": "AWS SDK for JavaScript Scheduler 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-scheduler",
@@ -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",