@aws-sdk/client-workmailmessageflow 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
@@ -275,6 +275,7 @@ var GetRawMessageContentResponseFilterSensitiveLog = /* @__PURE__ */ __name((obj
275
275
  }), "GetRawMessageContentResponseFilterSensitiveLog");
276
276
 
277
277
  // src/protocols/Aws_restJson1.ts
278
+ var import_core2 = require("@aws-sdk/core");
278
279
 
279
280
 
280
281
  var se_GetRawMessageContentCommand = /* @__PURE__ */ __name(async (input, context) => {
@@ -327,9 +328,9 @@ var de_PutRawMessageContentCommand = /* @__PURE__ */ __name(async (output, conte
327
328
  var de_CommandError = /* @__PURE__ */ __name(async (output, context) => {
328
329
  const parsedOutput = {
329
330
  ...output,
330
- body: await parseErrorBody(output.body, context)
331
+ body: await (0, import_core2.parseJsonErrorBody)(output.body, context)
331
332
  };
332
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
333
+ const errorCode = (0, import_core2.loadRestJsonErrorCode)(output, parsedOutput.body);
333
334
  switch (errorCode) {
334
335
  case "ResourceNotFoundException":
335
336
  case "com.amazonaws.workmailmessageflow#ResourceNotFoundException":
@@ -411,47 +412,6 @@ var deserializeMetadata = /* @__PURE__ */ __name((output) => ({
411
412
  extendedRequestId: output.headers["x-amz-id-2"],
412
413
  cfId: output.headers["x-amz-cf-id"]
413
414
  }), "deserializeMetadata");
414
- var collectBodyString = /* @__PURE__ */ __name((streamBody, context) => (0, import_smithy_client.collectBody)(streamBody, context).then((body) => context.utf8Encoder(body)), "collectBodyString");
415
- var parseBody = /* @__PURE__ */ __name((streamBody, context) => collectBodyString(streamBody, context).then((encoded) => {
416
- if (encoded.length) {
417
- return JSON.parse(encoded);
418
- }
419
- return {};
420
- }), "parseBody");
421
- var parseErrorBody = /* @__PURE__ */ __name(async (errorBody, context) => {
422
- const value = await parseBody(errorBody, context);
423
- value.message = value.message ?? value.Message;
424
- return value;
425
- }, "parseErrorBody");
426
- var loadRestJsonErrorCode = /* @__PURE__ */ __name((output, data) => {
427
- const findKey = /* @__PURE__ */ __name((object, key) => Object.keys(object).find((k) => k.toLowerCase() === key.toLowerCase()), "findKey");
428
- const sanitizeErrorCode = /* @__PURE__ */ __name((rawValue) => {
429
- let cleanValue = rawValue;
430
- if (typeof cleanValue === "number") {
431
- cleanValue = cleanValue.toString();
432
- }
433
- if (cleanValue.indexOf(",") >= 0) {
434
- cleanValue = cleanValue.split(",")[0];
435
- }
436
- if (cleanValue.indexOf(":") >= 0) {
437
- cleanValue = cleanValue.split(":")[0];
438
- }
439
- if (cleanValue.indexOf("#") >= 0) {
440
- cleanValue = cleanValue.split("#")[1];
441
- }
442
- return cleanValue;
443
- }, "sanitizeErrorCode");
444
- const headerKey = findKey(output.headers, "x-amzn-errortype");
445
- if (headerKey !== void 0) {
446
- return sanitizeErrorCode(output.headers[headerKey]);
447
- }
448
- if (data.code !== void 0) {
449
- return sanitizeErrorCode(data.code);
450
- }
451
- if (data["__type"] !== void 0) {
452
- return sanitizeErrorCode(data["__type"]);
453
- }
454
- }, "loadRestJsonErrorCode");
455
415
 
456
416
  // src/commands/GetRawMessageContentCommand.ts
457
417
  var _GetRawMessageContentCommand = class _GetRawMessageContentCommand extends import_smithy_client.Command.classBuilder().ep({
@@ -1,3 +1,4 @@
1
+ import { loadRestJsonErrorCode, parseJsonErrorBody as parseErrorBody } from "@aws-sdk/core";
1
2
  import { requestBuilder as rb } from "@smithy/core";
2
3
  import { _json, collectBody, decorateServiceException as __decorateServiceException, expectString as __expectString, map, take, withBaseException, } from "@smithy/smithy-client";
3
4
  import { InvalidContentLocation, MessageFrozen, MessageRejected, ResourceNotFoundException, } from "../models/models_0";
@@ -140,43 +141,3 @@ const isSerializableHeaderValue = (value) => value !== undefined &&
140
141
  value !== "" &&
141
142
  (!Object.getOwnPropertyNames(value).includes("length") || value.length != 0) &&
142
143
  (!Object.getOwnPropertyNames(value).includes("size") || value.size != 0);
143
- const parseBody = (streamBody, context) => collectBodyString(streamBody, context).then((encoded) => {
144
- if (encoded.length) {
145
- return JSON.parse(encoded);
146
- }
147
- return {};
148
- });
149
- const parseErrorBody = async (errorBody, context) => {
150
- const value = await parseBody(errorBody, context);
151
- value.message = value.message ?? value.Message;
152
- return value;
153
- };
154
- const loadRestJsonErrorCode = (output, data) => {
155
- const findKey = (object, key) => Object.keys(object).find((k) => k.toLowerCase() === key.toLowerCase());
156
- const sanitizeErrorCode = (rawValue) => {
157
- let cleanValue = rawValue;
158
- if (typeof cleanValue === "number") {
159
- cleanValue = cleanValue.toString();
160
- }
161
- if (cleanValue.indexOf(",") >= 0) {
162
- cleanValue = cleanValue.split(",")[0];
163
- }
164
- if (cleanValue.indexOf(":") >= 0) {
165
- cleanValue = cleanValue.split(":")[0];
166
- }
167
- if (cleanValue.indexOf("#") >= 0) {
168
- cleanValue = cleanValue.split("#")[1];
169
- }
170
- return cleanValue;
171
- };
172
- const headerKey = findKey(output.headers, "x-amzn-errortype");
173
- if (headerKey !== undefined) {
174
- return sanitizeErrorCode(output.headers[headerKey]);
175
- }
176
- if (data.code !== undefined) {
177
- return sanitizeErrorCode(data.code);
178
- }
179
- if (data["__type"] !== undefined) {
180
- return sanitizeErrorCode(data["__type"]);
181
- }
182
- };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@aws-sdk/client-workmailmessageflow",
3
3
  "description": "AWS SDK for JavaScript Workmailmessageflow 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-workmailmessageflow",
@@ -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-stream": "^2.1.3",
@@ -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");