@aws-sdk/client-applicationcostprofiler 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
@@ -196,6 +196,7 @@ var import_middleware_serde = require("@smithy/middleware-serde");
196
196
  var import_types = require("@smithy/types");
197
197
 
198
198
  // src/protocols/Aws_restJson1.ts
199
+ var import_core2 = require("@aws-sdk/core");
199
200
 
200
201
 
201
202
 
@@ -406,7 +407,7 @@ var de_DeleteReportDefinitionCommand = /* @__PURE__ */ __name(async (output, con
406
407
  const contents = (0, import_smithy_client.map)({
407
408
  $metadata: deserializeMetadata(output)
408
409
  });
409
- const data = (0, import_smithy_client.expectNonNull)((0, import_smithy_client.expectObject)(await parseBody(output.body, context)), "body");
410
+ const data = (0, import_smithy_client.expectNonNull)((0, import_smithy_client.expectObject)(await (0, import_core2.parseJsonBody)(output.body, context)), "body");
410
411
  const doc = (0, import_smithy_client.take)(data, {
411
412
  reportId: import_smithy_client.expectString
412
413
  });
@@ -420,7 +421,7 @@ var de_GetReportDefinitionCommand = /* @__PURE__ */ __name(async (output, contex
420
421
  const contents = (0, import_smithy_client.map)({
421
422
  $metadata: deserializeMetadata(output)
422
423
  });
423
- const data = (0, import_smithy_client.expectNonNull)((0, import_smithy_client.expectObject)(await parseBody(output.body, context)), "body");
424
+ const data = (0, import_smithy_client.expectNonNull)((0, import_smithy_client.expectObject)(await (0, import_core2.parseJsonBody)(output.body, context)), "body");
424
425
  const doc = (0, import_smithy_client.take)(data, {
425
426
  createdAt: (_) => (0, import_smithy_client.expectNonNull)((0, import_smithy_client.parseEpochTimestamp)((0, import_smithy_client.expectNumber)(_))),
426
427
  destinationS3Location: import_smithy_client._json,
@@ -440,7 +441,7 @@ var de_ImportApplicationUsageCommand = /* @__PURE__ */ __name(async (output, con
440
441
  const contents = (0, import_smithy_client.map)({
441
442
  $metadata: deserializeMetadata(output)
442
443
  });
443
- const data = (0, import_smithy_client.expectNonNull)((0, import_smithy_client.expectObject)(await parseBody(output.body, context)), "body");
444
+ const data = (0, import_smithy_client.expectNonNull)((0, import_smithy_client.expectObject)(await (0, import_core2.parseJsonBody)(output.body, context)), "body");
444
445
  const doc = (0, import_smithy_client.take)(data, {
445
446
  importId: import_smithy_client.expectString
446
447
  });
@@ -454,7 +455,7 @@ var de_ListReportDefinitionsCommand = /* @__PURE__ */ __name(async (output, cont
454
455
  const contents = (0, import_smithy_client.map)({
455
456
  $metadata: deserializeMetadata(output)
456
457
  });
457
- const data = (0, import_smithy_client.expectNonNull)((0, import_smithy_client.expectObject)(await parseBody(output.body, context)), "body");
458
+ const data = (0, import_smithy_client.expectNonNull)((0, import_smithy_client.expectObject)(await (0, import_core2.parseJsonBody)(output.body, context)), "body");
458
459
  const doc = (0, import_smithy_client.take)(data, {
459
460
  nextToken: import_smithy_client.expectString,
460
461
  reportDefinitions: (_) => de_ReportDefinitionList(_, context)
@@ -469,7 +470,7 @@ var de_PutReportDefinitionCommand = /* @__PURE__ */ __name(async (output, contex
469
470
  const contents = (0, import_smithy_client.map)({
470
471
  $metadata: deserializeMetadata(output)
471
472
  });
472
- const data = (0, import_smithy_client.expectNonNull)((0, import_smithy_client.expectObject)(await parseBody(output.body, context)), "body");
473
+ const data = (0, import_smithy_client.expectNonNull)((0, import_smithy_client.expectObject)(await (0, import_core2.parseJsonBody)(output.body, context)), "body");
473
474
  const doc = (0, import_smithy_client.take)(data, {
474
475
  reportId: import_smithy_client.expectString
475
476
  });
@@ -483,7 +484,7 @@ var de_UpdateReportDefinitionCommand = /* @__PURE__ */ __name(async (output, con
483
484
  const contents = (0, import_smithy_client.map)({
484
485
  $metadata: deserializeMetadata(output)
485
486
  });
486
- const data = (0, import_smithy_client.expectNonNull)((0, import_smithy_client.expectObject)(await parseBody(output.body, context)), "body");
487
+ const data = (0, import_smithy_client.expectNonNull)((0, import_smithy_client.expectObject)(await (0, import_core2.parseJsonBody)(output.body, context)), "body");
487
488
  const doc = (0, import_smithy_client.take)(data, {
488
489
  reportId: import_smithy_client.expectString
489
490
  });
@@ -493,9 +494,9 @@ var de_UpdateReportDefinitionCommand = /* @__PURE__ */ __name(async (output, con
493
494
  var de_CommandError = /* @__PURE__ */ __name(async (output, context) => {
494
495
  const parsedOutput = {
495
496
  ...output,
496
- body: await parseErrorBody(output.body, context)
497
+ body: await (0, import_core2.parseJsonErrorBody)(output.body, context)
497
498
  };
498
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
499
+ const errorCode = (0, import_core2.loadRestJsonErrorCode)(output, parsedOutput.body);
499
500
  switch (errorCode) {
500
501
  case "AccessDeniedException":
501
502
  case "com.amazonaws.applicationcostprofiler#AccessDeniedException":
@@ -610,49 +611,8 @@ var deserializeMetadata = /* @__PURE__ */ __name((output) => ({
610
611
  extendedRequestId: output.headers["x-amz-id-2"],
611
612
  cfId: output.headers["x-amz-cf-id"]
612
613
  }), "deserializeMetadata");
613
- var collectBodyString = /* @__PURE__ */ __name((streamBody, context) => (0, import_smithy_client.collectBody)(streamBody, context).then((body) => context.utf8Encoder(body)), "collectBodyString");
614
614
  var _mR = "maxResults";
615
615
  var _nT = "nextToken";
616
- var parseBody = /* @__PURE__ */ __name((streamBody, context) => collectBodyString(streamBody, context).then((encoded) => {
617
- if (encoded.length) {
618
- return JSON.parse(encoded);
619
- }
620
- return {};
621
- }), "parseBody");
622
- var parseErrorBody = /* @__PURE__ */ __name(async (errorBody, context) => {
623
- const value = await parseBody(errorBody, context);
624
- value.message = value.message ?? value.Message;
625
- return value;
626
- }, "parseErrorBody");
627
- var loadRestJsonErrorCode = /* @__PURE__ */ __name((output, data) => {
628
- const findKey = /* @__PURE__ */ __name((object, key) => Object.keys(object).find((k) => k.toLowerCase() === key.toLowerCase()), "findKey");
629
- const sanitizeErrorCode = /* @__PURE__ */ __name((rawValue) => {
630
- let cleanValue = rawValue;
631
- if (typeof cleanValue === "number") {
632
- cleanValue = cleanValue.toString();
633
- }
634
- if (cleanValue.indexOf(",") >= 0) {
635
- cleanValue = cleanValue.split(",")[0];
636
- }
637
- if (cleanValue.indexOf(":") >= 0) {
638
- cleanValue = cleanValue.split(":")[0];
639
- }
640
- if (cleanValue.indexOf("#") >= 0) {
641
- cleanValue = cleanValue.split("#")[1];
642
- }
643
- return cleanValue;
644
- }, "sanitizeErrorCode");
645
- const headerKey = findKey(output.headers, "x-amzn-errortype");
646
- if (headerKey !== void 0) {
647
- return sanitizeErrorCode(output.headers[headerKey]);
648
- }
649
- if (data.code !== void 0) {
650
- return sanitizeErrorCode(data.code);
651
- }
652
- if (data["__type"] !== void 0) {
653
- return sanitizeErrorCode(data["__type"]);
654
- }
655
- }, "loadRestJsonErrorCode");
656
616
 
657
617
  // src/commands/DeleteReportDefinitionCommand.ts
658
618
  var _DeleteReportDefinitionCommand = class _DeleteReportDefinitionCommand 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 { ApplicationCostProfilerServiceException as __BaseException } from "../models/ApplicationCostProfilerServiceException";
@@ -300,43 +301,3 @@ const isSerializableHeaderValue = (value) => value !== undefined &&
300
301
  (!Object.getOwnPropertyNames(value).includes("size") || value.size != 0);
301
302
  const _mR = "maxResults";
302
303
  const _nT = "nextToken";
303
- const parseBody = (streamBody, context) => collectBodyString(streamBody, context).then((encoded) => {
304
- if (encoded.length) {
305
- return JSON.parse(encoded);
306
- }
307
- return {};
308
- });
309
- const parseErrorBody = async (errorBody, context) => {
310
- const value = await parseBody(errorBody, context);
311
- value.message = value.message ?? value.Message;
312
- return value;
313
- };
314
- const loadRestJsonErrorCode = (output, data) => {
315
- const findKey = (object, key) => Object.keys(object).find((k) => k.toLowerCase() === key.toLowerCase());
316
- const sanitizeErrorCode = (rawValue) => {
317
- let cleanValue = rawValue;
318
- if (typeof cleanValue === "number") {
319
- cleanValue = cleanValue.toString();
320
- }
321
- if (cleanValue.indexOf(",") >= 0) {
322
- cleanValue = cleanValue.split(",")[0];
323
- }
324
- if (cleanValue.indexOf(":") >= 0) {
325
- cleanValue = cleanValue.split(":")[0];
326
- }
327
- if (cleanValue.indexOf("#") >= 0) {
328
- cleanValue = cleanValue.split("#")[1];
329
- }
330
- return cleanValue;
331
- };
332
- const headerKey = findKey(output.headers, "x-amzn-errortype");
333
- if (headerKey !== undefined) {
334
- return sanitizeErrorCode(output.headers[headerKey]);
335
- }
336
- if (data.code !== undefined) {
337
- return sanitizeErrorCode(data.code);
338
- }
339
- if (data["__type"] !== undefined) {
340
- return sanitizeErrorCode(data["__type"]);
341
- }
342
- };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@aws-sdk/client-applicationcostprofiler",
3
3
  "description": "AWS SDK for JavaScript Applicationcostprofiler 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-applicationcostprofiler",
@@ -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",