@aws-sdk/client-workspaces-thin-client 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
@@ -555,6 +555,7 @@ var UpdateEnvironmentResponseFilterSensitiveLog = /* @__PURE__ */ __name((obj) =
555
555
  }), "UpdateEnvironmentResponseFilterSensitiveLog");
556
556
 
557
557
  // src/protocols/Aws_restJson1.ts
558
+ var import_core2 = require("@aws-sdk/core");
558
559
 
559
560
 
560
561
 
@@ -919,7 +920,7 @@ var de_CreateEnvironmentCommand = /* @__PURE__ */ __name(async (output, context)
919
920
  const contents = (0, import_smithy_client.map)({
920
921
  $metadata: deserializeMetadata(output)
921
922
  });
922
- const data = (0, import_smithy_client.expectNonNull)((0, import_smithy_client.expectObject)(await parseBody(output.body, context)), "body");
923
+ const data = (0, import_smithy_client.expectNonNull)((0, import_smithy_client.expectObject)(await (0, import_core2.parseJsonBody)(output.body, context)), "body");
923
924
  const doc = (0, import_smithy_client.take)(data, {
924
925
  environment: (_) => de_EnvironmentSummary(_, context)
925
926
  });
@@ -963,7 +964,7 @@ var de_GetDeviceCommand = /* @__PURE__ */ __name(async (output, context) => {
963
964
  const contents = (0, import_smithy_client.map)({
964
965
  $metadata: deserializeMetadata(output)
965
966
  });
966
- const data = (0, import_smithy_client.expectNonNull)((0, import_smithy_client.expectObject)(await parseBody(output.body, context)), "body");
967
+ const data = (0, import_smithy_client.expectNonNull)((0, import_smithy_client.expectObject)(await (0, import_core2.parseJsonBody)(output.body, context)), "body");
967
968
  const doc = (0, import_smithy_client.take)(data, {
968
969
  device: (_) => de_Device(_, context)
969
970
  });
@@ -977,7 +978,7 @@ var de_GetEnvironmentCommand = /* @__PURE__ */ __name(async (output, context) =>
977
978
  const contents = (0, import_smithy_client.map)({
978
979
  $metadata: deserializeMetadata(output)
979
980
  });
980
- const data = (0, import_smithy_client.expectNonNull)((0, import_smithy_client.expectObject)(await parseBody(output.body, context)), "body");
981
+ const data = (0, import_smithy_client.expectNonNull)((0, import_smithy_client.expectObject)(await (0, import_core2.parseJsonBody)(output.body, context)), "body");
981
982
  const doc = (0, import_smithy_client.take)(data, {
982
983
  environment: (_) => de_Environment(_, context)
983
984
  });
@@ -991,7 +992,7 @@ var de_GetSoftwareSetCommand = /* @__PURE__ */ __name(async (output, context) =>
991
992
  const contents = (0, import_smithy_client.map)({
992
993
  $metadata: deserializeMetadata(output)
993
994
  });
994
- const data = (0, import_smithy_client.expectNonNull)((0, import_smithy_client.expectObject)(await parseBody(output.body, context)), "body");
995
+ const data = (0, import_smithy_client.expectNonNull)((0, import_smithy_client.expectObject)(await (0, import_core2.parseJsonBody)(output.body, context)), "body");
995
996
  const doc = (0, import_smithy_client.take)(data, {
996
997
  softwareSet: (_) => de_SoftwareSet(_, context)
997
998
  });
@@ -1005,7 +1006,7 @@ var de_ListDevicesCommand = /* @__PURE__ */ __name(async (output, context) => {
1005
1006
  const contents = (0, import_smithy_client.map)({
1006
1007
  $metadata: deserializeMetadata(output)
1007
1008
  });
1008
- const data = (0, import_smithy_client.expectNonNull)((0, import_smithy_client.expectObject)(await parseBody(output.body, context)), "body");
1009
+ const data = (0, import_smithy_client.expectNonNull)((0, import_smithy_client.expectObject)(await (0, import_core2.parseJsonBody)(output.body, context)), "body");
1009
1010
  const doc = (0, import_smithy_client.take)(data, {
1010
1011
  devices: (_) => de_DeviceList(_, context),
1011
1012
  nextToken: import_smithy_client.expectString
@@ -1020,7 +1021,7 @@ var de_ListEnvironmentsCommand = /* @__PURE__ */ __name(async (output, context)
1020
1021
  const contents = (0, import_smithy_client.map)({
1021
1022
  $metadata: deserializeMetadata(output)
1022
1023
  });
1023
- const data = (0, import_smithy_client.expectNonNull)((0, import_smithy_client.expectObject)(await parseBody(output.body, context)), "body");
1024
+ const data = (0, import_smithy_client.expectNonNull)((0, import_smithy_client.expectObject)(await (0, import_core2.parseJsonBody)(output.body, context)), "body");
1024
1025
  const doc = (0, import_smithy_client.take)(data, {
1025
1026
  environments: (_) => de_EnvironmentList(_, context),
1026
1027
  nextToken: import_smithy_client.expectString
@@ -1035,7 +1036,7 @@ var de_ListSoftwareSetsCommand = /* @__PURE__ */ __name(async (output, context)
1035
1036
  const contents = (0, import_smithy_client.map)({
1036
1037
  $metadata: deserializeMetadata(output)
1037
1038
  });
1038
- const data = (0, import_smithy_client.expectNonNull)((0, import_smithy_client.expectObject)(await parseBody(output.body, context)), "body");
1039
+ const data = (0, import_smithy_client.expectNonNull)((0, import_smithy_client.expectObject)(await (0, import_core2.parseJsonBody)(output.body, context)), "body");
1039
1040
  const doc = (0, import_smithy_client.take)(data, {
1040
1041
  nextToken: import_smithy_client.expectString,
1041
1042
  softwareSets: (_) => de_SoftwareSetList(_, context)
@@ -1050,7 +1051,7 @@ var de_ListTagsForResourceCommand = /* @__PURE__ */ __name(async (output, contex
1050
1051
  const contents = (0, import_smithy_client.map)({
1051
1052
  $metadata: deserializeMetadata(output)
1052
1053
  });
1053
- const data = (0, import_smithy_client.expectNonNull)((0, import_smithy_client.expectObject)(await parseBody(output.body, context)), "body");
1054
+ const data = (0, import_smithy_client.expectNonNull)((0, import_smithy_client.expectObject)(await (0, import_core2.parseJsonBody)(output.body, context)), "body");
1054
1055
  const doc = (0, import_smithy_client.take)(data, {
1055
1056
  tags: import_smithy_client._json
1056
1057
  });
@@ -1084,7 +1085,7 @@ var de_UpdateDeviceCommand = /* @__PURE__ */ __name(async (output, context) => {
1084
1085
  const contents = (0, import_smithy_client.map)({
1085
1086
  $metadata: deserializeMetadata(output)
1086
1087
  });
1087
- const data = (0, import_smithy_client.expectNonNull)((0, import_smithy_client.expectObject)(await parseBody(output.body, context)), "body");
1088
+ const data = (0, import_smithy_client.expectNonNull)((0, import_smithy_client.expectObject)(await (0, import_core2.parseJsonBody)(output.body, context)), "body");
1088
1089
  const doc = (0, import_smithy_client.take)(data, {
1089
1090
  device: (_) => de_DeviceSummary(_, context)
1090
1091
  });
@@ -1098,7 +1099,7 @@ var de_UpdateEnvironmentCommand = /* @__PURE__ */ __name(async (output, context)
1098
1099
  const contents = (0, import_smithy_client.map)({
1099
1100
  $metadata: deserializeMetadata(output)
1100
1101
  });
1101
- const data = (0, import_smithy_client.expectNonNull)((0, import_smithy_client.expectObject)(await parseBody(output.body, context)), "body");
1102
+ const data = (0, import_smithy_client.expectNonNull)((0, import_smithy_client.expectObject)(await (0, import_core2.parseJsonBody)(output.body, context)), "body");
1102
1103
  const doc = (0, import_smithy_client.take)(data, {
1103
1104
  environment: (_) => de_EnvironmentSummary(_, context)
1104
1105
  });
@@ -1118,9 +1119,9 @@ var de_UpdateSoftwareSetCommand = /* @__PURE__ */ __name(async (output, context)
1118
1119
  var de_CommandError = /* @__PURE__ */ __name(async (output, context) => {
1119
1120
  const parsedOutput = {
1120
1121
  ...output,
1121
- body: await parseErrorBody(output.body, context)
1122
+ body: await (0, import_core2.parseJsonErrorBody)(output.body, context)
1122
1123
  };
1123
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1124
+ const errorCode = (0, import_core2.loadRestJsonErrorCode)(output, parsedOutput.body);
1124
1125
  switch (errorCode) {
1125
1126
  case "AccessDeniedException":
1126
1127
  case "com.amazonaws.workspacesthinclient#AccessDeniedException":
@@ -1410,53 +1411,12 @@ var deserializeMetadata = /* @__PURE__ */ __name((output) => ({
1410
1411
  extendedRequestId: output.headers["x-amz-id-2"],
1411
1412
  cfId: output.headers["x-amz-cf-id"]
1412
1413
  }), "deserializeMetadata");
1413
- var collectBodyString = /* @__PURE__ */ __name((streamBody, context) => (0, import_smithy_client.collectBody)(streamBody, context).then((body) => context.utf8Encoder(body)), "collectBodyString");
1414
1414
  var _cT = "clientToken";
1415
1415
  var _mR = "maxResults";
1416
1416
  var _nT = "nextToken";
1417
1417
  var _rAS = "retryAfterSeconds";
1418
1418
  var _ra = "retry-after";
1419
1419
  var _tK = "tagKeys";
1420
- var parseBody = /* @__PURE__ */ __name((streamBody, context) => collectBodyString(streamBody, context).then((encoded) => {
1421
- if (encoded.length) {
1422
- return JSON.parse(encoded);
1423
- }
1424
- return {};
1425
- }), "parseBody");
1426
- var parseErrorBody = /* @__PURE__ */ __name(async (errorBody, context) => {
1427
- const value = await parseBody(errorBody, context);
1428
- value.message = value.message ?? value.Message;
1429
- return value;
1430
- }, "parseErrorBody");
1431
- var loadRestJsonErrorCode = /* @__PURE__ */ __name((output, data) => {
1432
- const findKey = /* @__PURE__ */ __name((object, key) => Object.keys(object).find((k) => k.toLowerCase() === key.toLowerCase()), "findKey");
1433
- const sanitizeErrorCode = /* @__PURE__ */ __name((rawValue) => {
1434
- let cleanValue = rawValue;
1435
- if (typeof cleanValue === "number") {
1436
- cleanValue = cleanValue.toString();
1437
- }
1438
- if (cleanValue.indexOf(",") >= 0) {
1439
- cleanValue = cleanValue.split(",")[0];
1440
- }
1441
- if (cleanValue.indexOf(":") >= 0) {
1442
- cleanValue = cleanValue.split(":")[0];
1443
- }
1444
- if (cleanValue.indexOf("#") >= 0) {
1445
- cleanValue = cleanValue.split("#")[1];
1446
- }
1447
- return cleanValue;
1448
- }, "sanitizeErrorCode");
1449
- const headerKey = findKey(output.headers, "x-amzn-errortype");
1450
- if (headerKey !== void 0) {
1451
- return sanitizeErrorCode(output.headers[headerKey]);
1452
- }
1453
- if (data.code !== void 0) {
1454
- return sanitizeErrorCode(data.code);
1455
- }
1456
- if (data["__type"] !== void 0) {
1457
- return sanitizeErrorCode(data["__type"]);
1458
- }
1459
- }, "loadRestJsonErrorCode");
1460
1420
 
1461
1421
  // src/commands/CreateEnvironmentCommand.ts
1462
1422
  var _CreateEnvironmentCommand = class _CreateEnvironmentCommand 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 { isValidHostname as __isValidHostname, } from "@smithy/protocol-http";
3
4
  import { _json, collectBody, decorateServiceException as __decorateServiceException, expectInt32 as __expectInt32, expectNonNull as __expectNonNull, expectNumber as __expectNumber, expectObject as __expectObject, expectString as __expectString, map, parseEpochTimestamp as __parseEpochTimestamp, strictParseInt32 as __strictParseInt32, take, withBaseException, } from "@smithy/smithy-client";
@@ -861,43 +862,3 @@ const _nT = "nextToken";
861
862
  const _rAS = "retryAfterSeconds";
862
863
  const _ra = "retry-after";
863
864
  const _tK = "tagKeys";
864
- const parseBody = (streamBody, context) => collectBodyString(streamBody, context).then((encoded) => {
865
- if (encoded.length) {
866
- return JSON.parse(encoded);
867
- }
868
- return {};
869
- });
870
- const parseErrorBody = async (errorBody, context) => {
871
- const value = await parseBody(errorBody, context);
872
- value.message = value.message ?? value.Message;
873
- return value;
874
- };
875
- const loadRestJsonErrorCode = (output, data) => {
876
- const findKey = (object, key) => Object.keys(object).find((k) => k.toLowerCase() === key.toLowerCase());
877
- const sanitizeErrorCode = (rawValue) => {
878
- let cleanValue = rawValue;
879
- if (typeof cleanValue === "number") {
880
- cleanValue = cleanValue.toString();
881
- }
882
- if (cleanValue.indexOf(",") >= 0) {
883
- cleanValue = cleanValue.split(",")[0];
884
- }
885
- if (cleanValue.indexOf(":") >= 0) {
886
- cleanValue = cleanValue.split(":")[0];
887
- }
888
- if (cleanValue.indexOf("#") >= 0) {
889
- cleanValue = cleanValue.split("#")[1];
890
- }
891
- return cleanValue;
892
- };
893
- const headerKey = findKey(output.headers, "x-amzn-errortype");
894
- if (headerKey !== undefined) {
895
- return sanitizeErrorCode(output.headers[headerKey]);
896
- }
897
- if (data.code !== undefined) {
898
- return sanitizeErrorCode(data.code);
899
- }
900
- if (data["__type"] !== undefined) {
901
- return sanitizeErrorCode(data["__type"]);
902
- }
903
- };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@aws-sdk/client-workspaces-thin-client",
3
3
  "description": "AWS SDK for JavaScript Workspaces Thin Client 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-workspaces-thin-client",
@@ -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",