@aws-sdk/client-freetier 3.523.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
@@ -188,6 +188,7 @@ var import_middleware_serde = require("@smithy/middleware-serde");
188
188
  var import_types = require("@smithy/types");
189
189
 
190
190
  // src/protocols/Aws_json1_0.ts
191
+ var import_core2 = require("@aws-sdk/core");
191
192
 
192
193
 
193
194
 
@@ -285,7 +286,7 @@ var de_GetFreeTierUsageCommand = /* @__PURE__ */ __name(async (output, context)
285
286
  if (output.statusCode >= 300) {
286
287
  return de_CommandError(output, context);
287
288
  }
288
- const data = await parseBody(output.body, context);
289
+ const data = await (0, import_core2.parseJsonBody)(output.body, context);
289
290
  let contents = {};
290
291
  contents = de_GetFreeTierUsageResponse(data, context);
291
292
  const response = {
@@ -297,9 +298,9 @@ var de_GetFreeTierUsageCommand = /* @__PURE__ */ __name(async (output, context)
297
298
  var de_CommandError = /* @__PURE__ */ __name(async (output, context) => {
298
299
  const parsedOutput = {
299
300
  ...output,
300
- body: await parseErrorBody(output.body, context)
301
+ body: await (0, import_core2.parseJsonErrorBody)(output.body, context)
301
302
  };
302
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
303
+ const errorCode = (0, import_core2.loadRestJsonErrorCode)(output, parsedOutput.body);
303
304
  switch (errorCode) {
304
305
  case "InternalServerException":
305
306
  case "com.amazonaws.freetier#InternalServerException":
@@ -398,7 +399,6 @@ var deserializeMetadata = /* @__PURE__ */ __name((output) => ({
398
399
  extendedRequestId: output.headers["x-amz-id-2"],
399
400
  cfId: output.headers["x-amz-cf-id"]
400
401
  }), "deserializeMetadata");
401
- var collectBodyString = /* @__PURE__ */ __name((streamBody, context) => (0, import_smithy_client.collectBody)(streamBody, context).then((body) => context.utf8Encoder(body)), "collectBodyString");
402
402
  var throwDefaultError = (0, import_smithy_client.withBaseException)(FreeTierServiceException);
403
403
  var buildHttpRpcRequest = /* @__PURE__ */ __name(async (context, headers, path, resolvedHostname, body) => {
404
404
  const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
@@ -425,46 +425,6 @@ function sharedHeaders(operation) {
425
425
  };
426
426
  }
427
427
  __name(sharedHeaders, "sharedHeaders");
428
- var parseBody = /* @__PURE__ */ __name((streamBody, context) => collectBodyString(streamBody, context).then((encoded) => {
429
- if (encoded.length) {
430
- return JSON.parse(encoded);
431
- }
432
- return {};
433
- }), "parseBody");
434
- var parseErrorBody = /* @__PURE__ */ __name(async (errorBody, context) => {
435
- const value = await parseBody(errorBody, context);
436
- value.message = value.message ?? value.Message;
437
- return value;
438
- }, "parseErrorBody");
439
- var loadRestJsonErrorCode = /* @__PURE__ */ __name((output, data) => {
440
- const findKey = /* @__PURE__ */ __name((object, key) => Object.keys(object).find((k) => k.toLowerCase() === key.toLowerCase()), "findKey");
441
- const sanitizeErrorCode = /* @__PURE__ */ __name((rawValue) => {
442
- let cleanValue = rawValue;
443
- if (typeof cleanValue === "number") {
444
- cleanValue = cleanValue.toString();
445
- }
446
- if (cleanValue.indexOf(",") >= 0) {
447
- cleanValue = cleanValue.split(",")[0];
448
- }
449
- if (cleanValue.indexOf(":") >= 0) {
450
- cleanValue = cleanValue.split(":")[0];
451
- }
452
- if (cleanValue.indexOf("#") >= 0) {
453
- cleanValue = cleanValue.split("#")[1];
454
- }
455
- return cleanValue;
456
- }, "sanitizeErrorCode");
457
- const headerKey = findKey(output.headers, "x-amzn-errortype");
458
- if (headerKey !== void 0) {
459
- return sanitizeErrorCode(output.headers[headerKey]);
460
- }
461
- if (data.code !== void 0) {
462
- return sanitizeErrorCode(data.code);
463
- }
464
- if (data["__type"] !== void 0) {
465
- return sanitizeErrorCode(data["__type"]);
466
- }
467
- }, "loadRestJsonErrorCode");
468
428
 
469
429
  // src/commands/GetFreeTierUsageCommand.ts
470
430
  var _GetFreeTierUsageCommand = class _GetFreeTierUsageCommand 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, expectString as __expectString, limitedParseDouble as __limitedParseDouble, take, withBaseException, } from "@smithy/smithy-client";
3
4
  import { FreeTierServiceException as __BaseException } from "../models/FreeTierServiceException";
@@ -155,43 +156,3 @@ function sharedHeaders(operation) {
155
156
  "x-amz-target": `AWSFreeTierService.${operation}`,
156
157
  };
157
158
  }
158
- const parseBody = (streamBody, context) => collectBodyString(streamBody, context).then((encoded) => {
159
- if (encoded.length) {
160
- return JSON.parse(encoded);
161
- }
162
- return {};
163
- });
164
- const parseErrorBody = async (errorBody, context) => {
165
- const value = await parseBody(errorBody, context);
166
- value.message = value.message ?? value.Message;
167
- return value;
168
- };
169
- const loadRestJsonErrorCode = (output, data) => {
170
- const findKey = (object, key) => Object.keys(object).find((k) => k.toLowerCase() === key.toLowerCase());
171
- const sanitizeErrorCode = (rawValue) => {
172
- let cleanValue = rawValue;
173
- if (typeof cleanValue === "number") {
174
- cleanValue = cleanValue.toString();
175
- }
176
- if (cleanValue.indexOf(",") >= 0) {
177
- cleanValue = cleanValue.split(",")[0];
178
- }
179
- if (cleanValue.indexOf(":") >= 0) {
180
- cleanValue = cleanValue.split(":")[0];
181
- }
182
- if (cleanValue.indexOf("#") >= 0) {
183
- cleanValue = cleanValue.split("#")[1];
184
- }
185
- return cleanValue;
186
- };
187
- const headerKey = findKey(output.headers, "x-amzn-errortype");
188
- if (headerKey !== undefined) {
189
- return sanitizeErrorCode(output.headers[headerKey]);
190
- }
191
- if (data.code !== undefined) {
192
- return sanitizeErrorCode(data.code);
193
- }
194
- if (data["__type"] !== undefined) {
195
- return sanitizeErrorCode(data["__type"]);
196
- }
197
- };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@aws-sdk/client-freetier",
3
3
  "description": "AWS SDK for JavaScript Freetier Client for Node.js, Browser and React Native",
4
- "version": "3.523.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-freetier",
@@ -20,40 +20,40 @@
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.523.0",
24
- "@aws-sdk/core": "3.523.0",
25
- "@aws-sdk/credential-provider-node": "3.523.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",
29
- "@aws-sdk/middleware-user-agent": "3.523.0",
30
- "@aws-sdk/region-config-resolver": "3.523.0",
29
+ "@aws-sdk/middleware-user-agent": "3.525.0",
30
+ "@aws-sdk/region-config-resolver": "3.525.0",
31
31
  "@aws-sdk/types": "3.523.0",
32
- "@aws-sdk/util-endpoints": "3.523.0",
32
+ "@aws-sdk/util-endpoints": "3.525.0",
33
33
  "@aws-sdk/util-user-agent-browser": "3.523.0",
34
- "@aws-sdk/util-user-agent-node": "3.523.0",
35
- "@smithy/config-resolver": "^2.1.3",
36
- "@smithy/core": "^1.3.4",
34
+ "@aws-sdk/util-user-agent-node": "3.525.0",
35
+ "@smithy/config-resolver": "^2.1.4",
36
+ "@smithy/core": "^1.3.5",
37
37
  "@smithy/fetch-http-handler": "^2.4.3",
38
38
  "@smithy/hash-node": "^2.1.3",
39
39
  "@smithy/invalid-dependency": "^2.1.3",
40
40
  "@smithy/middleware-content-length": "^2.1.3",
41
- "@smithy/middleware-endpoint": "^2.4.3",
42
- "@smithy/middleware-retry": "^2.1.3",
41
+ "@smithy/middleware-endpoint": "^2.4.4",
42
+ "@smithy/middleware-retry": "^2.1.4",
43
43
  "@smithy/middleware-serde": "^2.1.3",
44
44
  "@smithy/middleware-stack": "^2.1.3",
45
- "@smithy/node-config-provider": "^2.2.3",
45
+ "@smithy/node-config-provider": "^2.2.4",
46
46
  "@smithy/node-http-handler": "^2.4.1",
47
47
  "@smithy/protocol-http": "^3.2.1",
48
- "@smithy/smithy-client": "^2.4.1",
48
+ "@smithy/smithy-client": "^2.4.2",
49
49
  "@smithy/types": "^2.10.1",
50
50
  "@smithy/url-parser": "^2.1.3",
51
51
  "@smithy/util-base64": "^2.1.1",
52
52
  "@smithy/util-body-length-browser": "^2.1.1",
53
53
  "@smithy/util-body-length-node": "^2.2.1",
54
- "@smithy/util-defaults-mode-browser": "^2.1.3",
55
- "@smithy/util-defaults-mode-node": "^2.2.2",
56
- "@smithy/util-endpoints": "^1.1.3",
54
+ "@smithy/util-defaults-mode-browser": "^2.1.4",
55
+ "@smithy/util-defaults-mode-node": "^2.2.3",
56
+ "@smithy/util-endpoints": "^1.1.4",
57
57
  "@smithy/util-middleware": "^2.1.3",
58
58
  "@smithy/util-retry": "^2.1.3",
59
59
  "@smithy/util-utf8": "^2.1.1",
@@ -1 +0,0 @@
1
- module.exports = require("./index.js");
@@ -1 +0,0 @@
1
- module.exports = require("./index.js");
@@ -1 +0,0 @@
1
- module.exports = require("../index.js");
@@ -1 +0,0 @@
1
- module.exports = require("../index.js");
@@ -1 +0,0 @@
1
- module.exports = require("../index.js");
@@ -1 +0,0 @@
1
- module.exports = require("../index.js");
@@ -1 +0,0 @@
1
- module.exports = require("./index.js");
@@ -1 +0,0 @@
1
- module.exports = require("../index.js");
@@ -1 +0,0 @@
1
- module.exports = require("../index.js");
@@ -1 +0,0 @@
1
- module.exports = require("../index.js");
@@ -1 +0,0 @@
1
- module.exports = require("../index.js");
@@ -1 +0,0 @@
1
- module.exports = require("../index.js");
@@ -1 +0,0 @@
1
- module.exports = require("../index.js");
@@ -1 +0,0 @@
1
- module.exports = require("../index.js");
@@ -1 +0,0 @@
1
- module.exports = require("./index.js");