@aws-sdk/client-cloud9 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
@@ -475,6 +475,7 @@ var UpdateEnvironmentRequestFilterSensitiveLog = /* @__PURE__ */ __name((obj) =>
475
475
  }), "UpdateEnvironmentRequestFilterSensitiveLog");
476
476
 
477
477
  // src/protocols/Aws_json1_1.ts
478
+ var import_core2 = require("@aws-sdk/core");
478
479
 
479
480
 
480
481
  var se_CreateEnvironmentEC2Command = /* @__PURE__ */ __name(async (input, context) => {
@@ -559,7 +560,7 @@ var de_CreateEnvironmentEC2Command = /* @__PURE__ */ __name(async (output, conte
559
560
  if (output.statusCode >= 300) {
560
561
  return de_CommandError(output, context);
561
562
  }
562
- const data = await parseBody(output.body, context);
563
+ const data = await (0, import_core2.parseJsonBody)(output.body, context);
563
564
  let contents = {};
564
565
  contents = (0, import_smithy_client._json)(data);
565
566
  const response = {
@@ -572,7 +573,7 @@ var de_CreateEnvironmentMembershipCommand = /* @__PURE__ */ __name(async (output
572
573
  if (output.statusCode >= 300) {
573
574
  return de_CommandError(output, context);
574
575
  }
575
- const data = await parseBody(output.body, context);
576
+ const data = await (0, import_core2.parseJsonBody)(output.body, context);
576
577
  let contents = {};
577
578
  contents = de_CreateEnvironmentMembershipResult(data, context);
578
579
  const response = {
@@ -585,7 +586,7 @@ var de_DeleteEnvironmentCommand = /* @__PURE__ */ __name(async (output, context)
585
586
  if (output.statusCode >= 300) {
586
587
  return de_CommandError(output, context);
587
588
  }
588
- const data = await parseBody(output.body, context);
589
+ const data = await (0, import_core2.parseJsonBody)(output.body, context);
589
590
  let contents = {};
590
591
  contents = (0, import_smithy_client._json)(data);
591
592
  const response = {
@@ -598,7 +599,7 @@ var de_DeleteEnvironmentMembershipCommand = /* @__PURE__ */ __name(async (output
598
599
  if (output.statusCode >= 300) {
599
600
  return de_CommandError(output, context);
600
601
  }
601
- const data = await parseBody(output.body, context);
602
+ const data = await (0, import_core2.parseJsonBody)(output.body, context);
602
603
  let contents = {};
603
604
  contents = (0, import_smithy_client._json)(data);
604
605
  const response = {
@@ -611,7 +612,7 @@ var de_DescribeEnvironmentMembershipsCommand = /* @__PURE__ */ __name(async (out
611
612
  if (output.statusCode >= 300) {
612
613
  return de_CommandError(output, context);
613
614
  }
614
- const data = await parseBody(output.body, context);
615
+ const data = await (0, import_core2.parseJsonBody)(output.body, context);
615
616
  let contents = {};
616
617
  contents = de_DescribeEnvironmentMembershipsResult(data, context);
617
618
  const response = {
@@ -624,7 +625,7 @@ var de_DescribeEnvironmentsCommand = /* @__PURE__ */ __name(async (output, conte
624
625
  if (output.statusCode >= 300) {
625
626
  return de_CommandError(output, context);
626
627
  }
627
- const data = await parseBody(output.body, context);
628
+ const data = await (0, import_core2.parseJsonBody)(output.body, context);
628
629
  let contents = {};
629
630
  contents = (0, import_smithy_client._json)(data);
630
631
  const response = {
@@ -637,7 +638,7 @@ var de_DescribeEnvironmentStatusCommand = /* @__PURE__ */ __name(async (output,
637
638
  if (output.statusCode >= 300) {
638
639
  return de_CommandError(output, context);
639
640
  }
640
- const data = await parseBody(output.body, context);
641
+ const data = await (0, import_core2.parseJsonBody)(output.body, context);
641
642
  let contents = {};
642
643
  contents = (0, import_smithy_client._json)(data);
643
644
  const response = {
@@ -650,7 +651,7 @@ var de_ListEnvironmentsCommand = /* @__PURE__ */ __name(async (output, context)
650
651
  if (output.statusCode >= 300) {
651
652
  return de_CommandError(output, context);
652
653
  }
653
- const data = await parseBody(output.body, context);
654
+ const data = await (0, import_core2.parseJsonBody)(output.body, context);
654
655
  let contents = {};
655
656
  contents = (0, import_smithy_client._json)(data);
656
657
  const response = {
@@ -663,7 +664,7 @@ var de_ListTagsForResourceCommand = /* @__PURE__ */ __name(async (output, contex
663
664
  if (output.statusCode >= 300) {
664
665
  return de_CommandError(output, context);
665
666
  }
666
- const data = await parseBody(output.body, context);
667
+ const data = await (0, import_core2.parseJsonBody)(output.body, context);
667
668
  let contents = {};
668
669
  contents = (0, import_smithy_client._json)(data);
669
670
  const response = {
@@ -676,7 +677,7 @@ var de_TagResourceCommand = /* @__PURE__ */ __name(async (output, context) => {
676
677
  if (output.statusCode >= 300) {
677
678
  return de_CommandError(output, context);
678
679
  }
679
- const data = await parseBody(output.body, context);
680
+ const data = await (0, import_core2.parseJsonBody)(output.body, context);
680
681
  let contents = {};
681
682
  contents = (0, import_smithy_client._json)(data);
682
683
  const response = {
@@ -689,7 +690,7 @@ var de_UntagResourceCommand = /* @__PURE__ */ __name(async (output, context) =>
689
690
  if (output.statusCode >= 300) {
690
691
  return de_CommandError(output, context);
691
692
  }
692
- const data = await parseBody(output.body, context);
693
+ const data = await (0, import_core2.parseJsonBody)(output.body, context);
693
694
  let contents = {};
694
695
  contents = (0, import_smithy_client._json)(data);
695
696
  const response = {
@@ -702,7 +703,7 @@ var de_UpdateEnvironmentCommand = /* @__PURE__ */ __name(async (output, context)
702
703
  if (output.statusCode >= 300) {
703
704
  return de_CommandError(output, context);
704
705
  }
705
- const data = await parseBody(output.body, context);
706
+ const data = await (0, import_core2.parseJsonBody)(output.body, context);
706
707
  let contents = {};
707
708
  contents = (0, import_smithy_client._json)(data);
708
709
  const response = {
@@ -715,7 +716,7 @@ var de_UpdateEnvironmentMembershipCommand = /* @__PURE__ */ __name(async (output
715
716
  if (output.statusCode >= 300) {
716
717
  return de_CommandError(output, context);
717
718
  }
718
- const data = await parseBody(output.body, context);
719
+ const data = await (0, import_core2.parseJsonBody)(output.body, context);
719
720
  let contents = {};
720
721
  contents = de_UpdateEnvironmentMembershipResult(data, context);
721
722
  const response = {
@@ -727,9 +728,9 @@ var de_UpdateEnvironmentMembershipCommand = /* @__PURE__ */ __name(async (output
727
728
  var de_CommandError = /* @__PURE__ */ __name(async (output, context) => {
728
729
  const parsedOutput = {
729
730
  ...output,
730
- body: await parseErrorBody(output.body, context)
731
+ body: await (0, import_core2.parseJsonErrorBody)(output.body, context)
731
732
  };
732
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
733
+ const errorCode = (0, import_core2.loadRestJsonErrorCode)(output, parsedOutput.body);
733
734
  switch (errorCode) {
734
735
  case "BadRequestException":
735
736
  case "com.amazonaws.cloud9#BadRequestException":
@@ -873,7 +874,6 @@ var deserializeMetadata = /* @__PURE__ */ __name((output) => ({
873
874
  extendedRequestId: output.headers["x-amz-id-2"],
874
875
  cfId: output.headers["x-amz-cf-id"]
875
876
  }), "deserializeMetadata");
876
- var collectBodyString = /* @__PURE__ */ __name((streamBody, context) => (0, import_smithy_client.collectBody)(streamBody, context).then((body) => context.utf8Encoder(body)), "collectBodyString");
877
877
  var throwDefaultError = (0, import_smithy_client.withBaseException)(Cloud9ServiceException);
878
878
  var buildHttpRpcRequest = /* @__PURE__ */ __name(async (context, headers, path, resolvedHostname, body) => {
879
879
  const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
@@ -900,46 +900,6 @@ function sharedHeaders(operation) {
900
900
  };
901
901
  }
902
902
  __name(sharedHeaders, "sharedHeaders");
903
- var parseBody = /* @__PURE__ */ __name((streamBody, context) => collectBodyString(streamBody, context).then((encoded) => {
904
- if (encoded.length) {
905
- return JSON.parse(encoded);
906
- }
907
- return {};
908
- }), "parseBody");
909
- var parseErrorBody = /* @__PURE__ */ __name(async (errorBody, context) => {
910
- const value = await parseBody(errorBody, context);
911
- value.message = value.message ?? value.Message;
912
- return value;
913
- }, "parseErrorBody");
914
- var loadRestJsonErrorCode = /* @__PURE__ */ __name((output, data) => {
915
- const findKey = /* @__PURE__ */ __name((object, key) => Object.keys(object).find((k) => k.toLowerCase() === key.toLowerCase()), "findKey");
916
- const sanitizeErrorCode = /* @__PURE__ */ __name((rawValue) => {
917
- let cleanValue = rawValue;
918
- if (typeof cleanValue === "number") {
919
- cleanValue = cleanValue.toString();
920
- }
921
- if (cleanValue.indexOf(",") >= 0) {
922
- cleanValue = cleanValue.split(",")[0];
923
- }
924
- if (cleanValue.indexOf(":") >= 0) {
925
- cleanValue = cleanValue.split(":")[0];
926
- }
927
- if (cleanValue.indexOf("#") >= 0) {
928
- cleanValue = cleanValue.split("#")[1];
929
- }
930
- return cleanValue;
931
- }, "sanitizeErrorCode");
932
- const headerKey = findKey(output.headers, "x-amzn-errortype");
933
- if (headerKey !== void 0) {
934
- return sanitizeErrorCode(output.headers[headerKey]);
935
- }
936
- if (data.code !== void 0) {
937
- return sanitizeErrorCode(data.code);
938
- }
939
- if (data["__type"] !== void 0) {
940
- return sanitizeErrorCode(data["__type"]);
941
- }
942
- }, "loadRestJsonErrorCode");
943
903
 
944
904
  // src/commands/CreateEnvironmentEC2Command.ts
945
905
  var _CreateEnvironmentEC2Command = class _CreateEnvironmentEC2Command 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 { HttpRequest as __HttpRequest } from "@smithy/protocol-http";
2
3
  import { _json, collectBody, decorateServiceException as __decorateServiceException, expectNonNull as __expectNonNull, expectNumber as __expectNumber, expectString as __expectString, parseEpochTimestamp as __parseEpochTimestamp, take, withBaseException, } from "@smithy/smithy-client";
3
4
  import { Cloud9ServiceException as __BaseException } from "../models/Cloud9ServiceException";
@@ -426,43 +427,3 @@ function sharedHeaders(operation) {
426
427
  "x-amz-target": `AWSCloud9WorkspaceManagementService.${operation}`,
427
428
  };
428
429
  }
429
- const parseBody = (streamBody, context) => collectBodyString(streamBody, context).then((encoded) => {
430
- if (encoded.length) {
431
- return JSON.parse(encoded);
432
- }
433
- return {};
434
- });
435
- const parseErrorBody = async (errorBody, context) => {
436
- const value = await parseBody(errorBody, context);
437
- value.message = value.message ?? value.Message;
438
- return value;
439
- };
440
- const loadRestJsonErrorCode = (output, data) => {
441
- const findKey = (object, key) => Object.keys(object).find((k) => k.toLowerCase() === key.toLowerCase());
442
- const sanitizeErrorCode = (rawValue) => {
443
- let cleanValue = rawValue;
444
- if (typeof cleanValue === "number") {
445
- cleanValue = cleanValue.toString();
446
- }
447
- if (cleanValue.indexOf(",") >= 0) {
448
- cleanValue = cleanValue.split(",")[0];
449
- }
450
- if (cleanValue.indexOf(":") >= 0) {
451
- cleanValue = cleanValue.split(":")[0];
452
- }
453
- if (cleanValue.indexOf("#") >= 0) {
454
- cleanValue = cleanValue.split("#")[1];
455
- }
456
- return cleanValue;
457
- };
458
- const headerKey = findKey(output.headers, "x-amzn-errortype");
459
- if (headerKey !== undefined) {
460
- return sanitizeErrorCode(output.headers[headerKey]);
461
- }
462
- if (data.code !== undefined) {
463
- return sanitizeErrorCode(data.code);
464
- }
465
- if (data["__type"] !== undefined) {
466
- return sanitizeErrorCode(data["__type"]);
467
- }
468
- };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@aws-sdk/client-cloud9",
3
3
  "description": "AWS SDK for JavaScript Cloud9 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-cloud9",
@@ -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",