@aws-sdk/client-license-manager-linux-subscriptions 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
@@ -194,6 +194,7 @@ var import_middleware_serde = require("@smithy/middleware-serde");
194
194
  var import_types = require("@smithy/types");
195
195
 
196
196
  // src/protocols/Aws_restJson1.ts
197
+ var import_core2 = require("@aws-sdk/core");
197
198
 
198
199
 
199
200
 
@@ -386,7 +387,7 @@ var de_GetServiceSettingsCommand = /* @__PURE__ */ __name(async (output, context
386
387
  const contents = (0, import_smithy_client.map)({
387
388
  $metadata: deserializeMetadata(output)
388
389
  });
389
- const data = (0, import_smithy_client.expectNonNull)((0, import_smithy_client.expectObject)(await parseBody(output.body, context)), "body");
390
+ const data = (0, import_smithy_client.expectNonNull)((0, import_smithy_client.expectObject)(await (0, import_core2.parseJsonBody)(output.body, context)), "body");
390
391
  const doc = (0, import_smithy_client.take)(data, {
391
392
  HomeRegions: import_smithy_client._json,
392
393
  LinuxSubscriptionsDiscovery: import_smithy_client.expectString,
@@ -404,7 +405,7 @@ var de_ListLinuxSubscriptionInstancesCommand = /* @__PURE__ */ __name(async (out
404
405
  const contents = (0, import_smithy_client.map)({
405
406
  $metadata: deserializeMetadata(output)
406
407
  });
407
- const data = (0, import_smithy_client.expectNonNull)((0, import_smithy_client.expectObject)(await parseBody(output.body, context)), "body");
408
+ const data = (0, import_smithy_client.expectNonNull)((0, import_smithy_client.expectObject)(await (0, import_core2.parseJsonBody)(output.body, context)), "body");
408
409
  const doc = (0, import_smithy_client.take)(data, {
409
410
  Instances: import_smithy_client._json,
410
411
  NextToken: import_smithy_client.expectString
@@ -419,7 +420,7 @@ var de_ListLinuxSubscriptionsCommand = /* @__PURE__ */ __name(async (output, con
419
420
  const contents = (0, import_smithy_client.map)({
420
421
  $metadata: deserializeMetadata(output)
421
422
  });
422
- const data = (0, import_smithy_client.expectNonNull)((0, import_smithy_client.expectObject)(await parseBody(output.body, context)), "body");
423
+ const data = (0, import_smithy_client.expectNonNull)((0, import_smithy_client.expectObject)(await (0, import_core2.parseJsonBody)(output.body, context)), "body");
423
424
  const doc = (0, import_smithy_client.take)(data, {
424
425
  NextToken: import_smithy_client.expectString,
425
426
  Subscriptions: import_smithy_client._json
@@ -434,7 +435,7 @@ var de_UpdateServiceSettingsCommand = /* @__PURE__ */ __name(async (output, cont
434
435
  const contents = (0, import_smithy_client.map)({
435
436
  $metadata: deserializeMetadata(output)
436
437
  });
437
- const data = (0, import_smithy_client.expectNonNull)((0, import_smithy_client.expectObject)(await parseBody(output.body, context)), "body");
438
+ const data = (0, import_smithy_client.expectNonNull)((0, import_smithy_client.expectObject)(await (0, import_core2.parseJsonBody)(output.body, context)), "body");
438
439
  const doc = (0, import_smithy_client.take)(data, {
439
440
  HomeRegions: import_smithy_client._json,
440
441
  LinuxSubscriptionsDiscovery: import_smithy_client.expectString,
@@ -448,9 +449,9 @@ var de_UpdateServiceSettingsCommand = /* @__PURE__ */ __name(async (output, cont
448
449
  var de_CommandError = /* @__PURE__ */ __name(async (output, context) => {
449
450
  const parsedOutput = {
450
451
  ...output,
451
- body: await parseErrorBody(output.body, context)
452
+ body: await (0, import_core2.parseJsonErrorBody)(output.body, context)
452
453
  };
453
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
454
+ const errorCode = (0, import_core2.loadRestJsonErrorCode)(output, parsedOutput.body);
454
455
  switch (errorCode) {
455
456
  case "InternalServerException":
456
457
  case "com.amazonaws.licensemanagerlinuxsubscriptions#InternalServerException":
@@ -516,47 +517,6 @@ var deserializeMetadata = /* @__PURE__ */ __name((output) => ({
516
517
  extendedRequestId: output.headers["x-amz-id-2"],
517
518
  cfId: output.headers["x-amz-cf-id"]
518
519
  }), "deserializeMetadata");
519
- var collectBodyString = /* @__PURE__ */ __name((streamBody, context) => (0, import_smithy_client.collectBody)(streamBody, context).then((body) => context.utf8Encoder(body)), "collectBodyString");
520
- var parseBody = /* @__PURE__ */ __name((streamBody, context) => collectBodyString(streamBody, context).then((encoded) => {
521
- if (encoded.length) {
522
- return JSON.parse(encoded);
523
- }
524
- return {};
525
- }), "parseBody");
526
- var parseErrorBody = /* @__PURE__ */ __name(async (errorBody, context) => {
527
- const value = await parseBody(errorBody, context);
528
- value.message = value.message ?? value.Message;
529
- return value;
530
- }, "parseErrorBody");
531
- var loadRestJsonErrorCode = /* @__PURE__ */ __name((output, data) => {
532
- const findKey = /* @__PURE__ */ __name((object, key) => Object.keys(object).find((k) => k.toLowerCase() === key.toLowerCase()), "findKey");
533
- const sanitizeErrorCode = /* @__PURE__ */ __name((rawValue) => {
534
- let cleanValue = rawValue;
535
- if (typeof cleanValue === "number") {
536
- cleanValue = cleanValue.toString();
537
- }
538
- if (cleanValue.indexOf(",") >= 0) {
539
- cleanValue = cleanValue.split(",")[0];
540
- }
541
- if (cleanValue.indexOf(":") >= 0) {
542
- cleanValue = cleanValue.split(":")[0];
543
- }
544
- if (cleanValue.indexOf("#") >= 0) {
545
- cleanValue = cleanValue.split("#")[1];
546
- }
547
- return cleanValue;
548
- }, "sanitizeErrorCode");
549
- const headerKey = findKey(output.headers, "x-amzn-errortype");
550
- if (headerKey !== void 0) {
551
- return sanitizeErrorCode(output.headers[headerKey]);
552
- }
553
- if (data.code !== void 0) {
554
- return sanitizeErrorCode(data.code);
555
- }
556
- if (data["__type"] !== void 0) {
557
- return sanitizeErrorCode(data["__type"]);
558
- }
559
- }, "loadRestJsonErrorCode");
560
520
 
561
521
  // src/commands/GetServiceSettingsCommand.ts
562
522
  var _GetServiceSettingsCommand = class _GetServiceSettingsCommand 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, expectObject as __expectObject, expectString as __expectString, map, take, withBaseException, } from "@smithy/smithy-client";
3
4
  import { LicenseManagerLinuxSubscriptionsServiceException as __BaseException } from "../models/LicenseManagerLinuxSubscriptionsServiceException";
@@ -201,43 +202,3 @@ const isSerializableHeaderValue = (value) => value !== undefined &&
201
202
  value !== "" &&
202
203
  (!Object.getOwnPropertyNames(value).includes("length") || value.length != 0) &&
203
204
  (!Object.getOwnPropertyNames(value).includes("size") || value.size != 0);
204
- const parseBody = (streamBody, context) => collectBodyString(streamBody, context).then((encoded) => {
205
- if (encoded.length) {
206
- return JSON.parse(encoded);
207
- }
208
- return {};
209
- });
210
- const parseErrorBody = async (errorBody, context) => {
211
- const value = await parseBody(errorBody, context);
212
- value.message = value.message ?? value.Message;
213
- return value;
214
- };
215
- const loadRestJsonErrorCode = (output, data) => {
216
- const findKey = (object, key) => Object.keys(object).find((k) => k.toLowerCase() === key.toLowerCase());
217
- const sanitizeErrorCode = (rawValue) => {
218
- let cleanValue = rawValue;
219
- if (typeof cleanValue === "number") {
220
- cleanValue = cleanValue.toString();
221
- }
222
- if (cleanValue.indexOf(",") >= 0) {
223
- cleanValue = cleanValue.split(",")[0];
224
- }
225
- if (cleanValue.indexOf(":") >= 0) {
226
- cleanValue = cleanValue.split(":")[0];
227
- }
228
- if (cleanValue.indexOf("#") >= 0) {
229
- cleanValue = cleanValue.split("#")[1];
230
- }
231
- return cleanValue;
232
- };
233
- const headerKey = findKey(output.headers, "x-amzn-errortype");
234
- if (headerKey !== undefined) {
235
- return sanitizeErrorCode(output.headers[headerKey]);
236
- }
237
- if (data.code !== undefined) {
238
- return sanitizeErrorCode(data.code);
239
- }
240
- if (data["__type"] !== undefined) {
241
- return sanitizeErrorCode(data["__type"]);
242
- }
243
- };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@aws-sdk/client-license-manager-linux-subscriptions",
3
3
  "description": "AWS SDK for JavaScript License Manager Linux Subscriptions 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-license-manager-linux-subscriptions",
@@ -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",