@aws-sdk/client-resource-groups-tagging-api 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
@@ -202,6 +202,7 @@ var import_middleware_serde = require("@smithy/middleware-serde");
202
202
  var import_types = require("@smithy/types");
203
203
 
204
204
  // src/protocols/Aws_json1_1.ts
205
+ var import_core2 = require("@aws-sdk/core");
205
206
 
206
207
 
207
208
 
@@ -396,7 +397,7 @@ var de_DescribeReportCreationCommand = /* @__PURE__ */ __name(async (output, con
396
397
  if (output.statusCode >= 300) {
397
398
  return de_CommandError(output, context);
398
399
  }
399
- const data = await parseBody(output.body, context);
400
+ const data = await (0, import_core2.parseJsonBody)(output.body, context);
400
401
  let contents = {};
401
402
  contents = (0, import_smithy_client._json)(data);
402
403
  const response = {
@@ -409,7 +410,7 @@ var de_GetComplianceSummaryCommand = /* @__PURE__ */ __name(async (output, conte
409
410
  if (output.statusCode >= 300) {
410
411
  return de_CommandError(output, context);
411
412
  }
412
- const data = await parseBody(output.body, context);
413
+ const data = await (0, import_core2.parseJsonBody)(output.body, context);
413
414
  let contents = {};
414
415
  contents = (0, import_smithy_client._json)(data);
415
416
  const response = {
@@ -422,7 +423,7 @@ var de_GetResourcesCommand = /* @__PURE__ */ __name(async (output, context) => {
422
423
  if (output.statusCode >= 300) {
423
424
  return de_CommandError(output, context);
424
425
  }
425
- const data = await parseBody(output.body, context);
426
+ const data = await (0, import_core2.parseJsonBody)(output.body, context);
426
427
  let contents = {};
427
428
  contents = (0, import_smithy_client._json)(data);
428
429
  const response = {
@@ -435,7 +436,7 @@ var de_GetTagKeysCommand = /* @__PURE__ */ __name(async (output, context) => {
435
436
  if (output.statusCode >= 300) {
436
437
  return de_CommandError(output, context);
437
438
  }
438
- const data = await parseBody(output.body, context);
439
+ const data = await (0, import_core2.parseJsonBody)(output.body, context);
439
440
  let contents = {};
440
441
  contents = (0, import_smithy_client._json)(data);
441
442
  const response = {
@@ -448,7 +449,7 @@ var de_GetTagValuesCommand = /* @__PURE__ */ __name(async (output, context) => {
448
449
  if (output.statusCode >= 300) {
449
450
  return de_CommandError(output, context);
450
451
  }
451
- const data = await parseBody(output.body, context);
452
+ const data = await (0, import_core2.parseJsonBody)(output.body, context);
452
453
  let contents = {};
453
454
  contents = (0, import_smithy_client._json)(data);
454
455
  const response = {
@@ -461,7 +462,7 @@ var de_StartReportCreationCommand = /* @__PURE__ */ __name(async (output, contex
461
462
  if (output.statusCode >= 300) {
462
463
  return de_CommandError(output, context);
463
464
  }
464
- const data = await parseBody(output.body, context);
465
+ const data = await (0, import_core2.parseJsonBody)(output.body, context);
465
466
  let contents = {};
466
467
  contents = (0, import_smithy_client._json)(data);
467
468
  const response = {
@@ -474,7 +475,7 @@ var de_TagResourcesCommand = /* @__PURE__ */ __name(async (output, context) => {
474
475
  if (output.statusCode >= 300) {
475
476
  return de_CommandError(output, context);
476
477
  }
477
- const data = await parseBody(output.body, context);
478
+ const data = await (0, import_core2.parseJsonBody)(output.body, context);
478
479
  let contents = {};
479
480
  contents = (0, import_smithy_client._json)(data);
480
481
  const response = {
@@ -487,7 +488,7 @@ var de_UntagResourcesCommand = /* @__PURE__ */ __name(async (output, context) =>
487
488
  if (output.statusCode >= 300) {
488
489
  return de_CommandError(output, context);
489
490
  }
490
- const data = await parseBody(output.body, context);
491
+ const data = await (0, import_core2.parseJsonBody)(output.body, context);
491
492
  let contents = {};
492
493
  contents = (0, import_smithy_client._json)(data);
493
494
  const response = {
@@ -499,9 +500,9 @@ var de_UntagResourcesCommand = /* @__PURE__ */ __name(async (output, context) =>
499
500
  var de_CommandError = /* @__PURE__ */ __name(async (output, context) => {
500
501
  const parsedOutput = {
501
502
  ...output,
502
- body: await parseErrorBody(output.body, context)
503
+ body: await (0, import_core2.parseJsonErrorBody)(output.body, context)
503
504
  };
504
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
505
+ const errorCode = (0, import_core2.loadRestJsonErrorCode)(output, parsedOutput.body);
505
506
  switch (errorCode) {
506
507
  case "ConstraintViolationException":
507
508
  case "com.amazonaws.resourcegroupstaggingapi#ConstraintViolationException":
@@ -590,7 +591,6 @@ var deserializeMetadata = /* @__PURE__ */ __name((output) => ({
590
591
  extendedRequestId: output.headers["x-amz-id-2"],
591
592
  cfId: output.headers["x-amz-cf-id"]
592
593
  }), "deserializeMetadata");
593
- var collectBodyString = /* @__PURE__ */ __name((streamBody, context) => (0, import_smithy_client.collectBody)(streamBody, context).then((body) => context.utf8Encoder(body)), "collectBodyString");
594
594
  var throwDefaultError = (0, import_smithy_client.withBaseException)(ResourceGroupsTaggingAPIServiceException);
595
595
  var buildHttpRpcRequest = /* @__PURE__ */ __name(async (context, headers, path, resolvedHostname, body) => {
596
596
  const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
@@ -617,46 +617,6 @@ function sharedHeaders(operation) {
617
617
  };
618
618
  }
619
619
  __name(sharedHeaders, "sharedHeaders");
620
- var parseBody = /* @__PURE__ */ __name((streamBody, context) => collectBodyString(streamBody, context).then((encoded) => {
621
- if (encoded.length) {
622
- return JSON.parse(encoded);
623
- }
624
- return {};
625
- }), "parseBody");
626
- var parseErrorBody = /* @__PURE__ */ __name(async (errorBody, context) => {
627
- const value = await parseBody(errorBody, context);
628
- value.message = value.message ?? value.Message;
629
- return value;
630
- }, "parseErrorBody");
631
- var loadRestJsonErrorCode = /* @__PURE__ */ __name((output, data) => {
632
- const findKey = /* @__PURE__ */ __name((object, key) => Object.keys(object).find((k) => k.toLowerCase() === key.toLowerCase()), "findKey");
633
- const sanitizeErrorCode = /* @__PURE__ */ __name((rawValue) => {
634
- let cleanValue = rawValue;
635
- if (typeof cleanValue === "number") {
636
- cleanValue = cleanValue.toString();
637
- }
638
- if (cleanValue.indexOf(",") >= 0) {
639
- cleanValue = cleanValue.split(",")[0];
640
- }
641
- if (cleanValue.indexOf(":") >= 0) {
642
- cleanValue = cleanValue.split(":")[0];
643
- }
644
- if (cleanValue.indexOf("#") >= 0) {
645
- cleanValue = cleanValue.split("#")[1];
646
- }
647
- return cleanValue;
648
- }, "sanitizeErrorCode");
649
- const headerKey = findKey(output.headers, "x-amzn-errortype");
650
- if (headerKey !== void 0) {
651
- return sanitizeErrorCode(output.headers[headerKey]);
652
- }
653
- if (data.code !== void 0) {
654
- return sanitizeErrorCode(data.code);
655
- }
656
- if (data["__type"] !== void 0) {
657
- return sanitizeErrorCode(data["__type"]);
658
- }
659
- }, "loadRestJsonErrorCode");
660
620
 
661
621
  // src/commands/DescribeReportCreationCommand.ts
662
622
  var _DescribeReportCreationCommand = class _DescribeReportCreationCommand 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, withBaseException, } from "@smithy/smithy-client";
3
4
  import { ConcurrentModificationException, ConstraintViolationException, InternalServiceException, InvalidParameterException, PaginationTokenExpiredException, ThrottledException, } from "../models/models_0";
@@ -274,43 +275,3 @@ function sharedHeaders(operation) {
274
275
  "x-amz-target": `ResourceGroupsTaggingAPI_20170126.${operation}`,
275
276
  };
276
277
  }
277
- const parseBody = (streamBody, context) => collectBodyString(streamBody, context).then((encoded) => {
278
- if (encoded.length) {
279
- return JSON.parse(encoded);
280
- }
281
- return {};
282
- });
283
- const parseErrorBody = async (errorBody, context) => {
284
- const value = await parseBody(errorBody, context);
285
- value.message = value.message ?? value.Message;
286
- return value;
287
- };
288
- const loadRestJsonErrorCode = (output, data) => {
289
- const findKey = (object, key) => Object.keys(object).find((k) => k.toLowerCase() === key.toLowerCase());
290
- const sanitizeErrorCode = (rawValue) => {
291
- let cleanValue = rawValue;
292
- if (typeof cleanValue === "number") {
293
- cleanValue = cleanValue.toString();
294
- }
295
- if (cleanValue.indexOf(",") >= 0) {
296
- cleanValue = cleanValue.split(",")[0];
297
- }
298
- if (cleanValue.indexOf(":") >= 0) {
299
- cleanValue = cleanValue.split(":")[0];
300
- }
301
- if (cleanValue.indexOf("#") >= 0) {
302
- cleanValue = cleanValue.split("#")[1];
303
- }
304
- return cleanValue;
305
- };
306
- const headerKey = findKey(output.headers, "x-amzn-errortype");
307
- if (headerKey !== undefined) {
308
- return sanitizeErrorCode(output.headers[headerKey]);
309
- }
310
- if (data.code !== undefined) {
311
- return sanitizeErrorCode(data.code);
312
- }
313
- if (data["__type"] !== undefined) {
314
- return sanitizeErrorCode(data["__type"]);
315
- }
316
- };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@aws-sdk/client-resource-groups-tagging-api",
3
3
  "description": "AWS SDK for JavaScript Resource Groups Tagging Api 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-resource-groups-tagging-api",
@@ -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",