@aws-sdk/client-workmailmessageflow 3.33.0 → 3.36.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.
Files changed (105) hide show
  1. package/CHANGELOG.md +47 -0
  2. package/{dist/cjs → dist-cjs}/WorkMailMessageFlow.js +1 -9
  3. package/{dist/cjs → dist-cjs}/WorkMailMessageFlowClient.js +8 -21
  4. package/{dist/cjs → dist-cjs}/commands/GetRawMessageContentCommand.js +2 -27
  5. package/dist-cjs/commands/PutRawMessageContentCommand.js +36 -0
  6. package/{dist/cjs → dist-cjs}/endpoints.js +0 -1
  7. package/{dist/cjs → dist-cjs}/index.js +0 -1
  8. package/{dist/cjs → dist-cjs}/models/index.js +0 -1
  9. package/{dist/cjs → dist-cjs}/models/models_0.js +0 -31
  10. package/{dist/cjs → dist-cjs}/protocols/Aws_restJson1.js +0 -6
  11. package/{dist/cjs → dist-cjs}/runtimeConfig.browser.js +1 -5
  12. package/{dist/cjs → dist-cjs}/runtimeConfig.js +1 -5
  13. package/{dist/cjs → dist-cjs}/runtimeConfig.native.js +0 -4
  14. package/{dist/cjs → dist-cjs}/runtimeConfig.shared.js +1 -5
  15. package/{dist/es → dist-es}/WorkMailMessageFlow.js +2 -10
  16. package/{dist/es → dist-es}/WorkMailMessageFlowClient.js +2 -15
  17. package/{dist/es → dist-es}/commands/GetRawMessageContentCommand.js +4 -30
  18. package/dist-es/commands/PutRawMessageContentCommand.js +39 -0
  19. package/{dist/es → dist-es}/endpoints.js +1 -2
  20. package/{dist/types/index.d.ts → dist-es/index.js} +0 -0
  21. package/{dist/types/models/index.d.ts → dist-es/models/index.js} +0 -0
  22. package/{dist/es → dist-es}/models/models_0.js +0 -31
  23. package/{dist/es → dist-es}/protocols/Aws_restJson1.js +39 -45
  24. package/{dist/es → dist-es}/runtimeConfig.browser.js +1 -5
  25. package/{dist/es → dist-es}/runtimeConfig.js +1 -5
  26. package/{dist/es → dist-es}/runtimeConfig.native.js +0 -4
  27. package/{dist/es → dist-es}/runtimeConfig.shared.js +1 -5
  28. package/{dist/types → dist-types}/WorkMailMessageFlow.d.ts +2 -2
  29. package/{dist/types → dist-types}/WorkMailMessageFlowClient.d.ts +3 -3
  30. package/{dist/types → dist-types}/commands/GetRawMessageContentCommand.d.ts +3 -3
  31. package/{dist/types → dist-types}/commands/PutRawMessageContentCommand.d.ts +3 -3
  32. package/{dist/types → dist-types}/endpoints.d.ts +0 -0
  33. package/{index.ts → dist-types/index.d.ts} +0 -0
  34. package/{models/index.ts → dist-types/models/index.d.ts} +0 -0
  35. package/{dist/types → dist-types}/models/models_0.d.ts +0 -0
  36. package/{dist/types → dist-types}/protocols/Aws_restJson1.d.ts +2 -2
  37. package/{dist/types → dist-types}/runtimeConfig.browser.d.ts +0 -0
  38. package/{dist/types → dist-types}/runtimeConfig.d.ts +1 -1
  39. package/{dist/types → dist-types}/runtimeConfig.native.d.ts +0 -0
  40. package/{dist/types → dist-types}/runtimeConfig.shared.d.ts +0 -0
  41. package/dist-types/ts3.4/WorkMailMessageFlow.d.ts +15 -0
  42. package/dist-types/ts3.4/WorkMailMessageFlowClient.d.ts +69 -0
  43. package/dist-types/ts3.4/commands/GetRawMessageContentCommand.d.ts +17 -0
  44. package/dist-types/ts3.4/commands/PutRawMessageContentCommand.d.ts +17 -0
  45. package/{dist/types → dist-types}/ts3.4/endpoints.d.ts +0 -0
  46. package/{dist/types → dist-types}/ts3.4/index.d.ts +0 -0
  47. package/{dist/types → dist-types}/ts3.4/models/index.d.ts +0 -0
  48. package/dist-types/ts3.4/models/models_0.d.ts +97 -0
  49. package/{dist/types → dist-types}/ts3.4/protocols/Aws_restJson1.d.ts +2 -2
  50. package/{dist/types → dist-types}/ts3.4/runtimeConfig.browser.d.ts +1 -3
  51. package/{dist/types → dist-types}/ts3.4/runtimeConfig.d.ts +2 -4
  52. package/{dist/types → dist-types}/ts3.4/runtimeConfig.native.d.ts +1 -3
  53. package/{dist/types → dist-types}/ts3.4/runtimeConfig.shared.d.ts +1 -3
  54. package/package.json +52 -49
  55. package/WorkMailMessageFlow.ts +0 -98
  56. package/WorkMailMessageFlowClient.ts +0 -247
  57. package/commands/GetRawMessageContentCommand.ts +0 -98
  58. package/commands/PutRawMessageContentCommand.ts +0 -111
  59. package/dist/cjs/WorkMailMessageFlow.js.map +0 -1
  60. package/dist/cjs/WorkMailMessageFlowClient.js.map +0 -1
  61. package/dist/cjs/commands/GetRawMessageContentCommand.js.map +0 -1
  62. package/dist/cjs/commands/PutRawMessageContentCommand.js +0 -74
  63. package/dist/cjs/commands/PutRawMessageContentCommand.js.map +0 -1
  64. package/dist/cjs/endpoints.js.map +0 -1
  65. package/dist/cjs/index.js.map +0 -1
  66. package/dist/cjs/models/index.js.map +0 -1
  67. package/dist/cjs/models/models_0.js.map +0 -1
  68. package/dist/cjs/package.json +0 -91
  69. package/dist/cjs/protocols/Aws_restJson1.js.map +0 -1
  70. package/dist/cjs/runtimeConfig.browser.js.map +0 -1
  71. package/dist/cjs/runtimeConfig.js.map +0 -1
  72. package/dist/cjs/runtimeConfig.native.js.map +0 -1
  73. package/dist/cjs/runtimeConfig.shared.js.map +0 -1
  74. package/dist/es/WorkMailMessageFlow.js.map +0 -1
  75. package/dist/es/WorkMailMessageFlowClient.js.map +0 -1
  76. package/dist/es/commands/GetRawMessageContentCommand.js.map +0 -1
  77. package/dist/es/commands/PutRawMessageContentCommand.js +0 -78
  78. package/dist/es/commands/PutRawMessageContentCommand.js.map +0 -1
  79. package/dist/es/endpoints.js.map +0 -1
  80. package/dist/es/index.js +0 -6
  81. package/dist/es/index.js.map +0 -1
  82. package/dist/es/models/index.js +0 -2
  83. package/dist/es/models/index.js.map +0 -1
  84. package/dist/es/models/models_0.js.map +0 -1
  85. package/dist/es/package.json +0 -91
  86. package/dist/es/protocols/Aws_restJson1.js.map +0 -1
  87. package/dist/es/runtimeConfig.browser.js.map +0 -1
  88. package/dist/es/runtimeConfig.js.map +0 -1
  89. package/dist/es/runtimeConfig.native.js.map +0 -1
  90. package/dist/es/runtimeConfig.shared.js.map +0 -1
  91. package/dist/types/ts3.4/WorkMailMessageFlow.d.ts +0 -38
  92. package/dist/types/ts3.4/WorkMailMessageFlowClient.d.ts +0 -138
  93. package/dist/types/ts3.4/commands/GetRawMessageContentCommand.d.ts +0 -35
  94. package/dist/types/ts3.4/commands/PutRawMessageContentCommand.d.ts +0 -48
  95. package/dist/types/ts3.4/models/models_0.d.ts +0 -194
  96. package/endpoints.ts +0 -57
  97. package/jest.config.js +0 -4
  98. package/models/models_0.ts +0 -235
  99. package/protocols/Aws_restJson1.ts +0 -368
  100. package/runtimeConfig.browser.ts +0 -40
  101. package/runtimeConfig.native.ts +0 -16
  102. package/runtimeConfig.shared.ts +0 -16
  103. package/runtimeConfig.ts +0 -45
  104. package/tsconfig.es.json +0 -12
  105. package/tsconfig.json +0 -32
package/jest.config.js DELETED
@@ -1,4 +0,0 @@
1
- module.exports = {
2
- preset: "ts-jest",
3
- testMatch: ["**/*.spec.ts", "!**/*.browser.spec.ts", "!**/*.integ.spec.ts"],
4
- };
@@ -1,235 +0,0 @@
1
- import { MetadataBearer as $MetadataBearer, SmithyException as __SmithyException } from "@aws-sdk/types";
2
- import { Readable } from "stream";
3
-
4
- export interface GetRawMessageContentRequest {
5
- /**
6
- * <p>The identifier of the email message to retrieve.</p>
7
- */
8
- messageId: string | undefined;
9
- }
10
-
11
- export namespace GetRawMessageContentRequest {
12
- /**
13
- * @internal
14
- */
15
- export const filterSensitiveLog = (obj: GetRawMessageContentRequest): any => ({
16
- ...obj,
17
- });
18
- }
19
-
20
- export interface GetRawMessageContentResponse {
21
- /**
22
- * <p>The raw content of the email message, in MIME format.</p>
23
- */
24
- messageContent: Readable | ReadableStream | Blob | undefined;
25
- }
26
-
27
- export namespace GetRawMessageContentResponse {
28
- /**
29
- * @internal
30
- */
31
- export const filterSensitiveLog = (obj: GetRawMessageContentResponse): any => ({
32
- ...obj,
33
- });
34
- }
35
-
36
- /**
37
- * <p>The requested email message is not found.</p>
38
- */
39
- export interface ResourceNotFoundException extends __SmithyException, $MetadataBearer {
40
- name: "ResourceNotFoundException";
41
- $fault: "client";
42
- message?: string;
43
- }
44
-
45
- export namespace ResourceNotFoundException {
46
- /**
47
- * @internal
48
- */
49
- export const filterSensitiveLog = (obj: ResourceNotFoundException): any => ({
50
- ...obj,
51
- });
52
- }
53
-
54
- /**
55
- * <p>WorkMail could not access the updated email content. Possible reasons:</p>
56
- * <ul>
57
- * <li>
58
- * <p>You made the request in a region other than your S3 bucket region.</p>
59
- * </li>
60
- * <li>
61
- * <p>The <a href="https://docs.aws.amazon.com/AmazonS3/latest/dev/bucket-owner-condition.html">S3 bucket owner</a> is not the
62
- * same as the calling AWS account.</p>
63
- * </li>
64
- * <li>
65
- * <p>You have an incomplete or missing S3 bucket policy. For more information about policies, see
66
- * <a href="https://docs.aws.amazon.com/workmail/latest/adminguide/update-with-lambda.html">
67
- * Updating message content with AWS Lambda
68
- * </a> in the <i>WorkMail Administrator
69
- * Guide</i>.</p>
70
- * </li>
71
- * </ul>
72
- */
73
- export interface InvalidContentLocation extends __SmithyException, $MetadataBearer {
74
- name: "InvalidContentLocation";
75
- $fault: "client";
76
- message?: string;
77
- }
78
-
79
- export namespace InvalidContentLocation {
80
- /**
81
- * @internal
82
- */
83
- export const filterSensitiveLog = (obj: InvalidContentLocation): any => ({
84
- ...obj,
85
- });
86
- }
87
-
88
- /**
89
- * <p>The requested email is not eligible for update. This is usually the case for a redirected email.</p>
90
- */
91
- export interface MessageFrozen extends __SmithyException, $MetadataBearer {
92
- name: "MessageFrozen";
93
- $fault: "client";
94
- message?: string;
95
- }
96
-
97
- export namespace MessageFrozen {
98
- /**
99
- * @internal
100
- */
101
- export const filterSensitiveLog = (obj: MessageFrozen): any => ({
102
- ...obj,
103
- });
104
- }
105
-
106
- /**
107
- * <p>The requested email could not be updated due to an error in the MIME content. Check the error message for more information about
108
- * what caused the error.</p>
109
- */
110
- export interface MessageRejected extends __SmithyException, $MetadataBearer {
111
- name: "MessageRejected";
112
- $fault: "client";
113
- message?: string;
114
- }
115
-
116
- export namespace MessageRejected {
117
- /**
118
- * @internal
119
- */
120
- export const filterSensitiveLog = (obj: MessageRejected): any => ({
121
- ...obj,
122
- });
123
- }
124
-
125
- /**
126
- * <p>Amazon S3 object representing the updated message content, in MIME format.</p>
127
- * <note>
128
- * <p>The region for the S3 bucket containing the S3 object must match the region used for WorkMail operations. Also, for WorkMail to process
129
- * an S3 object, it must have permission to access that object. For more information, see
130
- * <a href="https://docs.aws.amazon.com/workmail/latest/adminguide/update-with-lambda.html">
131
- * Updating message content with AWS Lambda</a>.</p>
132
- * </note>
133
- */
134
- export interface S3Reference {
135
- /**
136
- * <p>The S3 bucket name.</p>
137
- */
138
- bucket: string | undefined;
139
-
140
- /**
141
- * <p>The S3 key object name.</p>
142
- */
143
- key: string | undefined;
144
-
145
- /**
146
- * <p>If you enable versioning for the bucket, you can specify the object version.</p>
147
- */
148
- objectVersion?: string;
149
- }
150
-
151
- export namespace S3Reference {
152
- /**
153
- * @internal
154
- */
155
- export const filterSensitiveLog = (obj: S3Reference): any => ({
156
- ...obj,
157
- });
158
- }
159
-
160
- /**
161
- * <p>Provides the MIME content of the updated email message as an S3 object. All MIME content must meet the following criteria:</p>
162
- * <ul>
163
- * <li>
164
- * <p>Each part of a multipart MIME message must be formatted properly.</p>
165
- * </li>
166
- * <li>
167
- * <p>Attachments must be of a content type that Amazon SES supports. For more information, see
168
- * <a href="https://docs.aws.amazon.com/ses/latest/DeveloperGuide/mime-types-appendix.html">Unsupported Attachment Types</a>.</p>
169
- * </li>
170
- * <li>
171
- * <p>If any of the MIME parts in a message contain content that is outside of the 7-bit ASCII character range, we recommend
172
- * encoding that content.</p>
173
- * </li>
174
- * <li>
175
- * <p>Per <a href="https://tools.ietf.org/html/rfc5321#section-4.5.3.1.6">RFC 5321</a>, the maximum length of each line of
176
- * text, including the <CRLF>, must not exceed 1,000 characters.</p>
177
- * </li>
178
- * <li>
179
- * <p>The message must contain all the required header fields. Check the returned error message for more information.</p>
180
- * </li>
181
- * <li>
182
- * <p>The value of immutable headers must remain unchanged. Check the returned error message for more information.</p>
183
- * </li>
184
- * <li>
185
- * <p>Certain unique headers can only appear once. Check the returned error message for more information.</p>
186
- * </li>
187
- * </ul>
188
- */
189
- export interface RawMessageContent {
190
- /**
191
- * <p>The S3 reference of an email message.</p>
192
- */
193
- s3Reference: S3Reference | undefined;
194
- }
195
-
196
- export namespace RawMessageContent {
197
- /**
198
- * @internal
199
- */
200
- export const filterSensitiveLog = (obj: RawMessageContent): any => ({
201
- ...obj,
202
- });
203
- }
204
-
205
- export interface PutRawMessageContentRequest {
206
- /**
207
- * <p>The identifier of the email message being updated.</p>
208
- */
209
- messageId: string | undefined;
210
-
211
- /**
212
- * <p>Describes the raw message content of the updated email message.</p>
213
- */
214
- content: RawMessageContent | undefined;
215
- }
216
-
217
- export namespace PutRawMessageContentRequest {
218
- /**
219
- * @internal
220
- */
221
- export const filterSensitiveLog = (obj: PutRawMessageContentRequest): any => ({
222
- ...obj,
223
- });
224
- }
225
-
226
- export interface PutRawMessageContentResponse {}
227
-
228
- export namespace PutRawMessageContentResponse {
229
- /**
230
- * @internal
231
- */
232
- export const filterSensitiveLog = (obj: PutRawMessageContentResponse): any => ({
233
- ...obj,
234
- });
235
- }
@@ -1,368 +0,0 @@
1
- import {
2
- GetRawMessageContentCommandInput,
3
- GetRawMessageContentCommandOutput,
4
- } from "../commands/GetRawMessageContentCommand";
5
- import {
6
- PutRawMessageContentCommandInput,
7
- PutRawMessageContentCommandOutput,
8
- } from "../commands/PutRawMessageContentCommand";
9
- import {
10
- InvalidContentLocation,
11
- MessageFrozen,
12
- MessageRejected,
13
- RawMessageContent,
14
- ResourceNotFoundException,
15
- S3Reference,
16
- } from "../models/models_0";
17
- import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@aws-sdk/protocol-http";
18
- import {
19
- expectString as __expectString,
20
- extendedEncodeURIComponent as __extendedEncodeURIComponent,
21
- } from "@aws-sdk/smithy-client";
22
- import {
23
- Endpoint as __Endpoint,
24
- MetadataBearer as __MetadataBearer,
25
- ResponseMetadata as __ResponseMetadata,
26
- SerdeContext as __SerdeContext,
27
- SmithyException as __SmithyException,
28
- } from "@aws-sdk/types";
29
-
30
- export const serializeAws_restJson1GetRawMessageContentCommand = async (
31
- input: GetRawMessageContentCommandInput,
32
- context: __SerdeContext
33
- ): Promise<__HttpRequest> => {
34
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
35
- const headers: any = {};
36
- let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/messages/{messageId}";
37
- if (input.messageId !== undefined) {
38
- const labelValue: string = input.messageId;
39
- if (labelValue.length <= 0) {
40
- throw new Error("Empty value provided for input HTTP label: messageId.");
41
- }
42
- resolvedPath = resolvedPath.replace("{messageId}", __extendedEncodeURIComponent(labelValue));
43
- } else {
44
- throw new Error("No value provided for input HTTP label: messageId.");
45
- }
46
- let body: any;
47
- return new __HttpRequest({
48
- protocol,
49
- hostname,
50
- port,
51
- method: "GET",
52
- headers,
53
- path: resolvedPath,
54
- body,
55
- });
56
- };
57
-
58
- export const serializeAws_restJson1PutRawMessageContentCommand = async (
59
- input: PutRawMessageContentCommandInput,
60
- context: __SerdeContext
61
- ): Promise<__HttpRequest> => {
62
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
63
- const headers: any = {
64
- "content-type": "application/json",
65
- };
66
- let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/messages/{messageId}";
67
- if (input.messageId !== undefined) {
68
- const labelValue: string = input.messageId;
69
- if (labelValue.length <= 0) {
70
- throw new Error("Empty value provided for input HTTP label: messageId.");
71
- }
72
- resolvedPath = resolvedPath.replace("{messageId}", __extendedEncodeURIComponent(labelValue));
73
- } else {
74
- throw new Error("No value provided for input HTTP label: messageId.");
75
- }
76
- let body: any;
77
- body = JSON.stringify({
78
- ...(input.content !== undefined &&
79
- input.content !== null && { content: serializeAws_restJson1RawMessageContent(input.content, context) }),
80
- });
81
- return new __HttpRequest({
82
- protocol,
83
- hostname,
84
- port,
85
- method: "POST",
86
- headers,
87
- path: resolvedPath,
88
- body,
89
- });
90
- };
91
-
92
- export const deserializeAws_restJson1GetRawMessageContentCommand = async (
93
- output: __HttpResponse,
94
- context: __SerdeContext
95
- ): Promise<GetRawMessageContentCommandOutput> => {
96
- if (output.statusCode !== 200 && output.statusCode >= 300) {
97
- return deserializeAws_restJson1GetRawMessageContentCommandError(output, context);
98
- }
99
- const contents: GetRawMessageContentCommandOutput = {
100
- $metadata: deserializeMetadata(output),
101
- messageContent: undefined,
102
- };
103
- const data: any = output.body;
104
- contents.messageContent = data;
105
- return Promise.resolve(contents);
106
- };
107
-
108
- const deserializeAws_restJson1GetRawMessageContentCommandError = async (
109
- output: __HttpResponse,
110
- context: __SerdeContext
111
- ): Promise<GetRawMessageContentCommandOutput> => {
112
- const parsedOutput: any = {
113
- ...output,
114
- body: await parseBody(output.body, context),
115
- };
116
- let response: __SmithyException & __MetadataBearer & { [key: string]: any };
117
- let errorCode: string = "UnknownError";
118
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
119
- switch (errorCode) {
120
- case "ResourceNotFoundException":
121
- case "com.amazonaws.workmailmessageflow#ResourceNotFoundException":
122
- response = {
123
- ...(await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)),
124
- name: errorCode,
125
- $metadata: deserializeMetadata(output),
126
- };
127
- break;
128
- default:
129
- const parsedBody = parsedOutput.body;
130
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
131
- response = {
132
- ...parsedBody,
133
- name: `${errorCode}`,
134
- message: parsedBody.message || parsedBody.Message || errorCode,
135
- $fault: "client",
136
- $metadata: deserializeMetadata(output),
137
- } as any;
138
- }
139
- const message = response.message || response.Message || errorCode;
140
- response.message = message;
141
- delete response.Message;
142
- return Promise.reject(Object.assign(new Error(message), response));
143
- };
144
-
145
- export const deserializeAws_restJson1PutRawMessageContentCommand = async (
146
- output: __HttpResponse,
147
- context: __SerdeContext
148
- ): Promise<PutRawMessageContentCommandOutput> => {
149
- if (output.statusCode !== 200 && output.statusCode >= 300) {
150
- return deserializeAws_restJson1PutRawMessageContentCommandError(output, context);
151
- }
152
- const contents: PutRawMessageContentCommandOutput = {
153
- $metadata: deserializeMetadata(output),
154
- };
155
- await collectBody(output.body, context);
156
- return Promise.resolve(contents);
157
- };
158
-
159
- const deserializeAws_restJson1PutRawMessageContentCommandError = async (
160
- output: __HttpResponse,
161
- context: __SerdeContext
162
- ): Promise<PutRawMessageContentCommandOutput> => {
163
- const parsedOutput: any = {
164
- ...output,
165
- body: await parseBody(output.body, context),
166
- };
167
- let response: __SmithyException & __MetadataBearer & { [key: string]: any };
168
- let errorCode: string = "UnknownError";
169
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
170
- switch (errorCode) {
171
- case "InvalidContentLocation":
172
- case "com.amazonaws.workmailmessageflow#InvalidContentLocation":
173
- response = {
174
- ...(await deserializeAws_restJson1InvalidContentLocationResponse(parsedOutput, context)),
175
- name: errorCode,
176
- $metadata: deserializeMetadata(output),
177
- };
178
- break;
179
- case "MessageFrozen":
180
- case "com.amazonaws.workmailmessageflow#MessageFrozen":
181
- response = {
182
- ...(await deserializeAws_restJson1MessageFrozenResponse(parsedOutput, context)),
183
- name: errorCode,
184
- $metadata: deserializeMetadata(output),
185
- };
186
- break;
187
- case "MessageRejected":
188
- case "com.amazonaws.workmailmessageflow#MessageRejected":
189
- response = {
190
- ...(await deserializeAws_restJson1MessageRejectedResponse(parsedOutput, context)),
191
- name: errorCode,
192
- $metadata: deserializeMetadata(output),
193
- };
194
- break;
195
- case "ResourceNotFoundException":
196
- case "com.amazonaws.workmailmessageflow#ResourceNotFoundException":
197
- response = {
198
- ...(await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)),
199
- name: errorCode,
200
- $metadata: deserializeMetadata(output),
201
- };
202
- break;
203
- default:
204
- const parsedBody = parsedOutput.body;
205
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
206
- response = {
207
- ...parsedBody,
208
- name: `${errorCode}`,
209
- message: parsedBody.message || parsedBody.Message || errorCode,
210
- $fault: "client",
211
- $metadata: deserializeMetadata(output),
212
- } as any;
213
- }
214
- const message = response.message || response.Message || errorCode;
215
- response.message = message;
216
- delete response.Message;
217
- return Promise.reject(Object.assign(new Error(message), response));
218
- };
219
-
220
- const deserializeAws_restJson1InvalidContentLocationResponse = async (
221
- parsedOutput: any,
222
- context: __SerdeContext
223
- ): Promise<InvalidContentLocation> => {
224
- const contents: InvalidContentLocation = {
225
- name: "InvalidContentLocation",
226
- $fault: "client",
227
- $metadata: deserializeMetadata(parsedOutput),
228
- message: undefined,
229
- };
230
- const data: any = parsedOutput.body;
231
- if (data.message !== undefined && data.message !== null) {
232
- contents.message = __expectString(data.message);
233
- }
234
- return contents;
235
- };
236
-
237
- const deserializeAws_restJson1MessageFrozenResponse = async (
238
- parsedOutput: any,
239
- context: __SerdeContext
240
- ): Promise<MessageFrozen> => {
241
- const contents: MessageFrozen = {
242
- name: "MessageFrozen",
243
- $fault: "client",
244
- $metadata: deserializeMetadata(parsedOutput),
245
- message: undefined,
246
- };
247
- const data: any = parsedOutput.body;
248
- if (data.message !== undefined && data.message !== null) {
249
- contents.message = __expectString(data.message);
250
- }
251
- return contents;
252
- };
253
-
254
- const deserializeAws_restJson1MessageRejectedResponse = async (
255
- parsedOutput: any,
256
- context: __SerdeContext
257
- ): Promise<MessageRejected> => {
258
- const contents: MessageRejected = {
259
- name: "MessageRejected",
260
- $fault: "client",
261
- $metadata: deserializeMetadata(parsedOutput),
262
- message: undefined,
263
- };
264
- const data: any = parsedOutput.body;
265
- if (data.message !== undefined && data.message !== null) {
266
- contents.message = __expectString(data.message);
267
- }
268
- return contents;
269
- };
270
-
271
- const deserializeAws_restJson1ResourceNotFoundExceptionResponse = async (
272
- parsedOutput: any,
273
- context: __SerdeContext
274
- ): Promise<ResourceNotFoundException> => {
275
- const contents: ResourceNotFoundException = {
276
- name: "ResourceNotFoundException",
277
- $fault: "client",
278
- $metadata: deserializeMetadata(parsedOutput),
279
- message: undefined,
280
- };
281
- const data: any = parsedOutput.body;
282
- if (data.message !== undefined && data.message !== null) {
283
- contents.message = __expectString(data.message);
284
- }
285
- return contents;
286
- };
287
-
288
- const serializeAws_restJson1RawMessageContent = (input: RawMessageContent, context: __SerdeContext): any => {
289
- return {
290
- ...(input.s3Reference !== undefined &&
291
- input.s3Reference !== null && { s3Reference: serializeAws_restJson1S3Reference(input.s3Reference, context) }),
292
- };
293
- };
294
-
295
- const serializeAws_restJson1S3Reference = (input: S3Reference, context: __SerdeContext): any => {
296
- return {
297
- ...(input.bucket !== undefined && input.bucket !== null && { bucket: input.bucket }),
298
- ...(input.key !== undefined && input.key !== null && { key: input.key }),
299
- ...(input.objectVersion !== undefined && input.objectVersion !== null && { objectVersion: input.objectVersion }),
300
- };
301
- };
302
-
303
- const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({
304
- httpStatusCode: output.statusCode,
305
- requestId: output.headers["x-amzn-requestid"] ?? output.headers["x-amzn-request-id"],
306
- extendedRequestId: output.headers["x-amz-id-2"],
307
- cfId: output.headers["x-amz-cf-id"],
308
- });
309
-
310
- // Collect low-level response body stream to Uint8Array.
311
- const collectBody = (streamBody: any = new Uint8Array(), context: __SerdeContext): Promise<Uint8Array> => {
312
- if (streamBody instanceof Uint8Array) {
313
- return Promise.resolve(streamBody);
314
- }
315
- return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array());
316
- };
317
-
318
- // Encode Uint8Array data into string with utf-8.
319
- const collectBodyString = (streamBody: any, context: __SerdeContext): Promise<string> =>
320
- collectBody(streamBody, context).then((body) => context.utf8Encoder(body));
321
-
322
- const isSerializableHeaderValue = (value: any): boolean =>
323
- value !== undefined &&
324
- value !== null &&
325
- value !== "" &&
326
- (!Object.getOwnPropertyNames(value).includes("length") || value.length != 0) &&
327
- (!Object.getOwnPropertyNames(value).includes("size") || value.size != 0);
328
-
329
- const parseBody = (streamBody: any, context: __SerdeContext): any =>
330
- collectBodyString(streamBody, context).then((encoded) => {
331
- if (encoded.length) {
332
- return JSON.parse(encoded);
333
- }
334
- return {};
335
- });
336
-
337
- /**
338
- * Load an error code for the aws.rest-json-1.1 protocol.
339
- */
340
- const loadRestJsonErrorCode = (output: __HttpResponse, data: any): string => {
341
- const findKey = (object: any, key: string) => Object.keys(object).find((k) => k.toLowerCase() === key.toLowerCase());
342
-
343
- const sanitizeErrorCode = (rawValue: string): string => {
344
- let cleanValue = rawValue;
345
- if (cleanValue.indexOf(":") >= 0) {
346
- cleanValue = cleanValue.split(":")[0];
347
- }
348
- if (cleanValue.indexOf("#") >= 0) {
349
- cleanValue = cleanValue.split("#")[1];
350
- }
351
- return cleanValue;
352
- };
353
-
354
- const headerKey = findKey(output.headers, "x-amzn-errortype");
355
- if (headerKey !== undefined) {
356
- return sanitizeErrorCode(output.headers[headerKey]);
357
- }
358
-
359
- if (data.code !== undefined) {
360
- return sanitizeErrorCode(data.code);
361
- }
362
-
363
- if (data["__type"] !== undefined) {
364
- return sanitizeErrorCode(data["__type"]);
365
- }
366
-
367
- return "";
368
- };
@@ -1,40 +0,0 @@
1
- import packageInfo from "./package.json";
2
-
3
- import { Sha256 } from "@aws-crypto/sha256-browser";
4
- import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler";
5
- import { invalidProvider } from "@aws-sdk/invalid-dependency";
6
- import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry";
7
- import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser";
8
- import { calculateBodyLength } from "@aws-sdk/util-body-length-browser";
9
- import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser";
10
- import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser";
11
- import { WorkMailMessageFlowClientConfig } from "./WorkMailMessageFlowClient";
12
- import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared";
13
-
14
- /**
15
- * @internal
16
- */
17
- export const getRuntimeConfig = (config: WorkMailMessageFlowClientConfig) => {
18
- const clientSharedValues = getSharedRuntimeConfig(config);
19
- return {
20
- ...clientSharedValues,
21
- ...config,
22
- runtime: "browser",
23
- base64Decoder: config?.base64Decoder ?? fromBase64,
24
- base64Encoder: config?.base64Encoder ?? toBase64,
25
- bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength,
26
- credentialDefaultProvider:
27
- config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))),
28
- defaultUserAgentProvider:
29
- config?.defaultUserAgentProvider ??
30
- defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }),
31
- maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS,
32
- region: config?.region ?? invalidProvider("Region is missing"),
33
- requestHandler: config?.requestHandler ?? new FetchHttpHandler(),
34
- retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)),
35
- sha256: config?.sha256 ?? Sha256,
36
- streamCollector: config?.streamCollector ?? streamCollector,
37
- utf8Decoder: config?.utf8Decoder ?? fromUtf8,
38
- utf8Encoder: config?.utf8Encoder ?? toUtf8,
39
- };
40
- };
@@ -1,16 +0,0 @@
1
- import { Sha256 } from "@aws-crypto/sha256-js";
2
- import { WorkMailMessageFlowClientConfig } from "./WorkMailMessageFlowClient";
3
- import { getRuntimeConfig as getBrowserRuntimeConfig } from "./runtimeConfig.browser";
4
-
5
- /**
6
- * @internal
7
- */
8
- export const getRuntimeConfig = (config: WorkMailMessageFlowClientConfig) => {
9
- const browserDefaults = getBrowserRuntimeConfig(config);
10
- return {
11
- ...browserDefaults,
12
- ...config,
13
- runtime: "react-native",
14
- sha256: config?.sha256 ?? Sha256,
15
- };
16
- };
@@ -1,16 +0,0 @@
1
- import { defaultRegionInfoProvider } from "./endpoints";
2
- import { Logger as __Logger } from "@aws-sdk/types";
3
- import { parseUrl } from "@aws-sdk/url-parser";
4
- import { WorkMailMessageFlowClientConfig } from "./WorkMailMessageFlowClient";
5
-
6
- /**
7
- * @internal
8
- */
9
- export const getRuntimeConfig = (config: WorkMailMessageFlowClientConfig) => ({
10
- apiVersion: "2019-05-01",
11
- disableHostPrefix: config?.disableHostPrefix ?? false,
12
- logger: config?.logger ?? ({} as __Logger),
13
- regionInfoProvider: config?.regionInfoProvider ?? defaultRegionInfoProvider,
14
- serviceId: config?.serviceId ?? "WorkMailMessageFlow",
15
- urlParser: config?.urlParser ?? parseUrl,
16
- });