@aws-sdk/client-apigatewaymanagementapi 3.32.0 → 3.36.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/CHANGELOG.md +44 -0
- package/{dist/cjs → dist-cjs}/ApiGatewayManagementApi.js +0 -1
- package/{dist/cjs → dist-cjs}/ApiGatewayManagementApiClient.js +8 -9
- package/{dist/cjs → dist-cjs}/commands/DeleteConnectionCommand.js +2 -3
- package/{dist/cjs → dist-cjs}/commands/GetConnectionCommand.js +2 -3
- package/{dist/cjs → dist-cjs}/commands/PostToConnectionCommand.js +2 -3
- package/{dist/cjs → dist-cjs}/endpoints.js +0 -1
- package/{dist/cjs → dist-cjs}/index.js +0 -1
- package/{dist/cjs → dist-cjs}/models/index.js +0 -1
- package/{dist/cjs → dist-cjs}/models/models_0.js +0 -1
- package/{dist/cjs → dist-cjs}/protocols/Aws_restJson1.js +0 -1
- package/{dist/cjs → dist-cjs}/runtimeConfig.browser.js +2 -2
- package/{dist/cjs → dist-cjs}/runtimeConfig.js +2 -2
- package/{dist/cjs → dist-cjs}/runtimeConfig.native.js +0 -1
- package/{dist/cjs → dist-cjs}/runtimeConfig.shared.js +1 -2
- package/{dist/es → dist-es}/ApiGatewayManagementApi.js +1 -5
- package/{dist/es → dist-es}/ApiGatewayManagementApiClient.js +2 -11
- package/{dist/es → dist-es}/commands/DeleteConnectionCommand.js +4 -30
- package/{dist/es → dist-es}/commands/GetConnectionCommand.js +4 -30
- package/{dist/es → dist-es}/commands/PostToConnectionCommand.js +4 -30
- package/{dist/es → dist-es}/endpoints.js +1 -2
- package/{dist/types/index.d.ts → dist-es/index.js} +0 -0
- package/{dist/types/models/index.d.ts → dist-es/models/index.js} +0 -0
- package/{dist/es → dist-es}/models/models_0.js +0 -28
- package/{dist/es → dist-es}/protocols/Aws_restJson1.js +68 -74
- package/{dist/es → dist-es}/runtimeConfig.browser.js +1 -5
- package/{dist/es → dist-es}/runtimeConfig.js +1 -5
- package/{dist/es → dist-es}/runtimeConfig.native.js +0 -4
- package/{dist/es → dist-es}/runtimeConfig.shared.js +1 -5
- package/{dist/types → dist-types}/ApiGatewayManagementApi.d.ts +1 -1
- package/{dist/types → dist-types}/ApiGatewayManagementApiClient.d.ts +4 -4
- package/{dist/types → dist-types}/commands/DeleteConnectionCommand.d.ts +2 -2
- package/{dist/types → dist-types}/commands/GetConnectionCommand.d.ts +2 -2
- package/{dist/types → dist-types}/commands/PostToConnectionCommand.d.ts +2 -2
- package/{dist/types → dist-types}/endpoints.d.ts +0 -0
- package/{index.ts → dist-types/index.d.ts} +0 -0
- package/{models/index.ts → dist-types/models/index.d.ts} +0 -0
- package/{dist/types → dist-types}/models/models_0.d.ts +0 -0
- package/{dist/types → dist-types}/protocols/Aws_restJson1.d.ts +2 -2
- package/{dist/types/ts3.4 → dist-types}/runtimeConfig.browser.d.ts +40 -36
- package/{dist/types/ts3.4 → dist-types}/runtimeConfig.d.ts +37 -36
- package/{dist/types → dist-types}/runtimeConfig.native.d.ts +1 -0
- package/{dist/types → dist-types}/runtimeConfig.shared.d.ts +0 -0
- package/{dist/types → dist-types}/ts3.4/ApiGatewayManagementApi.d.ts +1 -1
- package/{dist/types → dist-types}/ts3.4/ApiGatewayManagementApiClient.d.ts +4 -4
- package/{dist/types → dist-types}/ts3.4/commands/DeleteConnectionCommand.d.ts +2 -2
- package/{dist/types → dist-types}/ts3.4/commands/GetConnectionCommand.d.ts +2 -2
- package/{dist/types → dist-types}/ts3.4/commands/PostToConnectionCommand.d.ts +2 -2
- package/{dist/types → dist-types}/ts3.4/endpoints.d.ts +0 -0
- package/{dist/types → dist-types}/ts3.4/index.d.ts +0 -0
- package/{dist/types → dist-types}/ts3.4/models/index.d.ts +0 -0
- package/{dist/types → dist-types}/ts3.4/models/models_0.d.ts +0 -0
- package/{dist/types → dist-types}/ts3.4/protocols/Aws_restJson1.d.ts +2 -2
- package/{dist/types → dist-types/ts3.4}/runtimeConfig.browser.d.ts +40 -36
- package/{dist/types → dist-types/ts3.4}/runtimeConfig.d.ts +37 -36
- package/{dist/types → dist-types}/ts3.4/runtimeConfig.native.d.ts +1 -0
- package/{dist/types → dist-types}/ts3.4/runtimeConfig.shared.d.ts +0 -0
- package/package.json +52 -49
- package/ApiGatewayManagementApi.ts +0 -118
- package/ApiGatewayManagementApiClient.ts +0 -241
- package/commands/DeleteConnectionCommand.ts +0 -98
- package/commands/GetConnectionCommand.ts +0 -98
- package/commands/PostToConnectionCommand.ts +0 -98
- package/dist/cjs/ApiGatewayManagementApi.js.map +0 -1
- package/dist/cjs/ApiGatewayManagementApiClient.js.map +0 -1
- package/dist/cjs/commands/DeleteConnectionCommand.js.map +0 -1
- package/dist/cjs/commands/GetConnectionCommand.js.map +0 -1
- package/dist/cjs/commands/PostToConnectionCommand.js.map +0 -1
- package/dist/cjs/endpoints.js.map +0 -1
- package/dist/cjs/index.js.map +0 -1
- package/dist/cjs/models/index.js.map +0 -1
- package/dist/cjs/models/models_0.js.map +0 -1
- package/dist/cjs/package.json +0 -91
- package/dist/cjs/protocols/Aws_restJson1.js.map +0 -1
- package/dist/cjs/runtimeConfig.browser.js.map +0 -1
- package/dist/cjs/runtimeConfig.js.map +0 -1
- package/dist/cjs/runtimeConfig.native.js.map +0 -1
- package/dist/cjs/runtimeConfig.shared.js.map +0 -1
- package/dist/es/ApiGatewayManagementApi.js.map +0 -1
- package/dist/es/ApiGatewayManagementApiClient.js.map +0 -1
- package/dist/es/commands/DeleteConnectionCommand.js.map +0 -1
- package/dist/es/commands/GetConnectionCommand.js.map +0 -1
- package/dist/es/commands/PostToConnectionCommand.js.map +0 -1
- package/dist/es/endpoints.js.map +0 -1
- package/dist/es/index.js +0 -7
- package/dist/es/index.js.map +0 -1
- package/dist/es/models/index.js +0 -2
- package/dist/es/models/index.js.map +0 -1
- package/dist/es/models/models_0.js.map +0 -1
- package/dist/es/package.json +0 -91
- package/dist/es/protocols/Aws_restJson1.js.map +0 -1
- package/dist/es/runtimeConfig.browser.js.map +0 -1
- package/dist/es/runtimeConfig.js.map +0 -1
- package/dist/es/runtimeConfig.native.js.map +0 -1
- package/dist/es/runtimeConfig.shared.js.map +0 -1
- package/endpoints.ts +0 -57
- package/jest.config.js +0 -4
- package/models/models_0.ts +0 -160
- package/protocols/Aws_restJson1.ts +0 -468
- package/runtimeConfig.browser.ts +0 -40
- package/runtimeConfig.native.ts +0 -16
- package/runtimeConfig.shared.ts +0 -16
- package/runtimeConfig.ts +0 -45
- package/tsconfig.es.json +0 -12
- package/tsconfig.json +0 -32
|
@@ -1,468 +0,0 @@
|
|
|
1
|
-
import { DeleteConnectionCommandInput, DeleteConnectionCommandOutput } from "../commands/DeleteConnectionCommand";
|
|
2
|
-
import { GetConnectionCommandInput, GetConnectionCommandOutput } from "../commands/GetConnectionCommand";
|
|
3
|
-
import { PostToConnectionCommandInput, PostToConnectionCommandOutput } from "../commands/PostToConnectionCommand";
|
|
4
|
-
import {
|
|
5
|
-
ForbiddenException,
|
|
6
|
-
GoneException,
|
|
7
|
-
Identity,
|
|
8
|
-
LimitExceededException,
|
|
9
|
-
PayloadTooLargeException,
|
|
10
|
-
} from "../models/models_0";
|
|
11
|
-
import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@aws-sdk/protocol-http";
|
|
12
|
-
import {
|
|
13
|
-
expectNonNull as __expectNonNull,
|
|
14
|
-
expectObject as __expectObject,
|
|
15
|
-
expectString as __expectString,
|
|
16
|
-
extendedEncodeURIComponent as __extendedEncodeURIComponent,
|
|
17
|
-
parseRfc3339DateTime as __parseRfc3339DateTime,
|
|
18
|
-
} from "@aws-sdk/smithy-client";
|
|
19
|
-
import {
|
|
20
|
-
Endpoint as __Endpoint,
|
|
21
|
-
MetadataBearer as __MetadataBearer,
|
|
22
|
-
ResponseMetadata as __ResponseMetadata,
|
|
23
|
-
SerdeContext as __SerdeContext,
|
|
24
|
-
SmithyException as __SmithyException,
|
|
25
|
-
} from "@aws-sdk/types";
|
|
26
|
-
|
|
27
|
-
export const serializeAws_restJson1DeleteConnectionCommand = async (
|
|
28
|
-
input: DeleteConnectionCommandInput,
|
|
29
|
-
context: __SerdeContext
|
|
30
|
-
): Promise<__HttpRequest> => {
|
|
31
|
-
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
|
|
32
|
-
const headers: any = {};
|
|
33
|
-
let resolvedPath =
|
|
34
|
-
`${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/@connections/{ConnectionId}";
|
|
35
|
-
if (input.ConnectionId !== undefined) {
|
|
36
|
-
const labelValue: string = input.ConnectionId;
|
|
37
|
-
if (labelValue.length <= 0) {
|
|
38
|
-
throw new Error("Empty value provided for input HTTP label: ConnectionId.");
|
|
39
|
-
}
|
|
40
|
-
resolvedPath = resolvedPath.replace("{ConnectionId}", __extendedEncodeURIComponent(labelValue));
|
|
41
|
-
} else {
|
|
42
|
-
throw new Error("No value provided for input HTTP label: ConnectionId.");
|
|
43
|
-
}
|
|
44
|
-
let body: any;
|
|
45
|
-
return new __HttpRequest({
|
|
46
|
-
protocol,
|
|
47
|
-
hostname,
|
|
48
|
-
port,
|
|
49
|
-
method: "DELETE",
|
|
50
|
-
headers,
|
|
51
|
-
path: resolvedPath,
|
|
52
|
-
body,
|
|
53
|
-
});
|
|
54
|
-
};
|
|
55
|
-
|
|
56
|
-
export const serializeAws_restJson1GetConnectionCommand = async (
|
|
57
|
-
input: GetConnectionCommandInput,
|
|
58
|
-
context: __SerdeContext
|
|
59
|
-
): Promise<__HttpRequest> => {
|
|
60
|
-
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
|
|
61
|
-
const headers: any = {};
|
|
62
|
-
let resolvedPath =
|
|
63
|
-
`${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/@connections/{ConnectionId}";
|
|
64
|
-
if (input.ConnectionId !== undefined) {
|
|
65
|
-
const labelValue: string = input.ConnectionId;
|
|
66
|
-
if (labelValue.length <= 0) {
|
|
67
|
-
throw new Error("Empty value provided for input HTTP label: ConnectionId.");
|
|
68
|
-
}
|
|
69
|
-
resolvedPath = resolvedPath.replace("{ConnectionId}", __extendedEncodeURIComponent(labelValue));
|
|
70
|
-
} else {
|
|
71
|
-
throw new Error("No value provided for input HTTP label: ConnectionId.");
|
|
72
|
-
}
|
|
73
|
-
let body: any;
|
|
74
|
-
return new __HttpRequest({
|
|
75
|
-
protocol,
|
|
76
|
-
hostname,
|
|
77
|
-
port,
|
|
78
|
-
method: "GET",
|
|
79
|
-
headers,
|
|
80
|
-
path: resolvedPath,
|
|
81
|
-
body,
|
|
82
|
-
});
|
|
83
|
-
};
|
|
84
|
-
|
|
85
|
-
export const serializeAws_restJson1PostToConnectionCommand = async (
|
|
86
|
-
input: PostToConnectionCommandInput,
|
|
87
|
-
context: __SerdeContext
|
|
88
|
-
): Promise<__HttpRequest> => {
|
|
89
|
-
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
|
|
90
|
-
const headers: any = {
|
|
91
|
-
"content-type": "application/octet-stream",
|
|
92
|
-
};
|
|
93
|
-
let resolvedPath =
|
|
94
|
-
`${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/@connections/{ConnectionId}";
|
|
95
|
-
if (input.ConnectionId !== undefined) {
|
|
96
|
-
const labelValue: string = input.ConnectionId;
|
|
97
|
-
if (labelValue.length <= 0) {
|
|
98
|
-
throw new Error("Empty value provided for input HTTP label: ConnectionId.");
|
|
99
|
-
}
|
|
100
|
-
resolvedPath = resolvedPath.replace("{ConnectionId}", __extendedEncodeURIComponent(labelValue));
|
|
101
|
-
} else {
|
|
102
|
-
throw new Error("No value provided for input HTTP label: ConnectionId.");
|
|
103
|
-
}
|
|
104
|
-
let body: any;
|
|
105
|
-
if (input.Data !== undefined) {
|
|
106
|
-
body = input.Data;
|
|
107
|
-
}
|
|
108
|
-
return new __HttpRequest({
|
|
109
|
-
protocol,
|
|
110
|
-
hostname,
|
|
111
|
-
port,
|
|
112
|
-
method: "POST",
|
|
113
|
-
headers,
|
|
114
|
-
path: resolvedPath,
|
|
115
|
-
body,
|
|
116
|
-
});
|
|
117
|
-
};
|
|
118
|
-
|
|
119
|
-
export const deserializeAws_restJson1DeleteConnectionCommand = async (
|
|
120
|
-
output: __HttpResponse,
|
|
121
|
-
context: __SerdeContext
|
|
122
|
-
): Promise<DeleteConnectionCommandOutput> => {
|
|
123
|
-
if (output.statusCode !== 204 && output.statusCode >= 300) {
|
|
124
|
-
return deserializeAws_restJson1DeleteConnectionCommandError(output, context);
|
|
125
|
-
}
|
|
126
|
-
const contents: DeleteConnectionCommandOutput = {
|
|
127
|
-
$metadata: deserializeMetadata(output),
|
|
128
|
-
};
|
|
129
|
-
await collectBody(output.body, context);
|
|
130
|
-
return Promise.resolve(contents);
|
|
131
|
-
};
|
|
132
|
-
|
|
133
|
-
const deserializeAws_restJson1DeleteConnectionCommandError = async (
|
|
134
|
-
output: __HttpResponse,
|
|
135
|
-
context: __SerdeContext
|
|
136
|
-
): Promise<DeleteConnectionCommandOutput> => {
|
|
137
|
-
const parsedOutput: any = {
|
|
138
|
-
...output,
|
|
139
|
-
body: await parseBody(output.body, context),
|
|
140
|
-
};
|
|
141
|
-
let response: __SmithyException & __MetadataBearer & { [key: string]: any };
|
|
142
|
-
let errorCode: string = "UnknownError";
|
|
143
|
-
errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
144
|
-
switch (errorCode) {
|
|
145
|
-
case "ForbiddenException":
|
|
146
|
-
case "com.amazonaws.apigatewaymanagementapi#ForbiddenException":
|
|
147
|
-
response = {
|
|
148
|
-
...(await deserializeAws_restJson1ForbiddenExceptionResponse(parsedOutput, context)),
|
|
149
|
-
name: errorCode,
|
|
150
|
-
$metadata: deserializeMetadata(output),
|
|
151
|
-
};
|
|
152
|
-
break;
|
|
153
|
-
case "GoneException":
|
|
154
|
-
case "com.amazonaws.apigatewaymanagementapi#GoneException":
|
|
155
|
-
response = {
|
|
156
|
-
...(await deserializeAws_restJson1GoneExceptionResponse(parsedOutput, context)),
|
|
157
|
-
name: errorCode,
|
|
158
|
-
$metadata: deserializeMetadata(output),
|
|
159
|
-
};
|
|
160
|
-
break;
|
|
161
|
-
case "LimitExceededException":
|
|
162
|
-
case "com.amazonaws.apigatewaymanagementapi#LimitExceededException":
|
|
163
|
-
response = {
|
|
164
|
-
...(await deserializeAws_restJson1LimitExceededExceptionResponse(parsedOutput, context)),
|
|
165
|
-
name: errorCode,
|
|
166
|
-
$metadata: deserializeMetadata(output),
|
|
167
|
-
};
|
|
168
|
-
break;
|
|
169
|
-
default:
|
|
170
|
-
const parsedBody = parsedOutput.body;
|
|
171
|
-
errorCode = parsedBody.code || parsedBody.Code || errorCode;
|
|
172
|
-
response = {
|
|
173
|
-
...parsedBody,
|
|
174
|
-
name: `${errorCode}`,
|
|
175
|
-
message: parsedBody.message || parsedBody.Message || errorCode,
|
|
176
|
-
$fault: "client",
|
|
177
|
-
$metadata: deserializeMetadata(output),
|
|
178
|
-
} as any;
|
|
179
|
-
}
|
|
180
|
-
const message = response.message || response.Message || errorCode;
|
|
181
|
-
response.message = message;
|
|
182
|
-
delete response.Message;
|
|
183
|
-
return Promise.reject(Object.assign(new Error(message), response));
|
|
184
|
-
};
|
|
185
|
-
|
|
186
|
-
export const deserializeAws_restJson1GetConnectionCommand = async (
|
|
187
|
-
output: __HttpResponse,
|
|
188
|
-
context: __SerdeContext
|
|
189
|
-
): Promise<GetConnectionCommandOutput> => {
|
|
190
|
-
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
191
|
-
return deserializeAws_restJson1GetConnectionCommandError(output, context);
|
|
192
|
-
}
|
|
193
|
-
const contents: GetConnectionCommandOutput = {
|
|
194
|
-
$metadata: deserializeMetadata(output),
|
|
195
|
-
ConnectedAt: undefined,
|
|
196
|
-
Identity: undefined,
|
|
197
|
-
LastActiveAt: undefined,
|
|
198
|
-
};
|
|
199
|
-
const data: { [key: string]: any } = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
|
|
200
|
-
if (data.connectedAt !== undefined && data.connectedAt !== null) {
|
|
201
|
-
contents.ConnectedAt = __expectNonNull(__parseRfc3339DateTime(data.connectedAt));
|
|
202
|
-
}
|
|
203
|
-
if (data.identity !== undefined && data.identity !== null) {
|
|
204
|
-
contents.Identity = deserializeAws_restJson1Identity(data.identity, context);
|
|
205
|
-
}
|
|
206
|
-
if (data.lastActiveAt !== undefined && data.lastActiveAt !== null) {
|
|
207
|
-
contents.LastActiveAt = __expectNonNull(__parseRfc3339DateTime(data.lastActiveAt));
|
|
208
|
-
}
|
|
209
|
-
return Promise.resolve(contents);
|
|
210
|
-
};
|
|
211
|
-
|
|
212
|
-
const deserializeAws_restJson1GetConnectionCommandError = async (
|
|
213
|
-
output: __HttpResponse,
|
|
214
|
-
context: __SerdeContext
|
|
215
|
-
): Promise<GetConnectionCommandOutput> => {
|
|
216
|
-
const parsedOutput: any = {
|
|
217
|
-
...output,
|
|
218
|
-
body: await parseBody(output.body, context),
|
|
219
|
-
};
|
|
220
|
-
let response: __SmithyException & __MetadataBearer & { [key: string]: any };
|
|
221
|
-
let errorCode: string = "UnknownError";
|
|
222
|
-
errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
223
|
-
switch (errorCode) {
|
|
224
|
-
case "ForbiddenException":
|
|
225
|
-
case "com.amazonaws.apigatewaymanagementapi#ForbiddenException":
|
|
226
|
-
response = {
|
|
227
|
-
...(await deserializeAws_restJson1ForbiddenExceptionResponse(parsedOutput, context)),
|
|
228
|
-
name: errorCode,
|
|
229
|
-
$metadata: deserializeMetadata(output),
|
|
230
|
-
};
|
|
231
|
-
break;
|
|
232
|
-
case "GoneException":
|
|
233
|
-
case "com.amazonaws.apigatewaymanagementapi#GoneException":
|
|
234
|
-
response = {
|
|
235
|
-
...(await deserializeAws_restJson1GoneExceptionResponse(parsedOutput, context)),
|
|
236
|
-
name: errorCode,
|
|
237
|
-
$metadata: deserializeMetadata(output),
|
|
238
|
-
};
|
|
239
|
-
break;
|
|
240
|
-
case "LimitExceededException":
|
|
241
|
-
case "com.amazonaws.apigatewaymanagementapi#LimitExceededException":
|
|
242
|
-
response = {
|
|
243
|
-
...(await deserializeAws_restJson1LimitExceededExceptionResponse(parsedOutput, context)),
|
|
244
|
-
name: errorCode,
|
|
245
|
-
$metadata: deserializeMetadata(output),
|
|
246
|
-
};
|
|
247
|
-
break;
|
|
248
|
-
default:
|
|
249
|
-
const parsedBody = parsedOutput.body;
|
|
250
|
-
errorCode = parsedBody.code || parsedBody.Code || errorCode;
|
|
251
|
-
response = {
|
|
252
|
-
...parsedBody,
|
|
253
|
-
name: `${errorCode}`,
|
|
254
|
-
message: parsedBody.message || parsedBody.Message || errorCode,
|
|
255
|
-
$fault: "client",
|
|
256
|
-
$metadata: deserializeMetadata(output),
|
|
257
|
-
} as any;
|
|
258
|
-
}
|
|
259
|
-
const message = response.message || response.Message || errorCode;
|
|
260
|
-
response.message = message;
|
|
261
|
-
delete response.Message;
|
|
262
|
-
return Promise.reject(Object.assign(new Error(message), response));
|
|
263
|
-
};
|
|
264
|
-
|
|
265
|
-
export const deserializeAws_restJson1PostToConnectionCommand = async (
|
|
266
|
-
output: __HttpResponse,
|
|
267
|
-
context: __SerdeContext
|
|
268
|
-
): Promise<PostToConnectionCommandOutput> => {
|
|
269
|
-
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
270
|
-
return deserializeAws_restJson1PostToConnectionCommandError(output, context);
|
|
271
|
-
}
|
|
272
|
-
const contents: PostToConnectionCommandOutput = {
|
|
273
|
-
$metadata: deserializeMetadata(output),
|
|
274
|
-
};
|
|
275
|
-
await collectBody(output.body, context);
|
|
276
|
-
return Promise.resolve(contents);
|
|
277
|
-
};
|
|
278
|
-
|
|
279
|
-
const deserializeAws_restJson1PostToConnectionCommandError = async (
|
|
280
|
-
output: __HttpResponse,
|
|
281
|
-
context: __SerdeContext
|
|
282
|
-
): Promise<PostToConnectionCommandOutput> => {
|
|
283
|
-
const parsedOutput: any = {
|
|
284
|
-
...output,
|
|
285
|
-
body: await parseBody(output.body, context),
|
|
286
|
-
};
|
|
287
|
-
let response: __SmithyException & __MetadataBearer & { [key: string]: any };
|
|
288
|
-
let errorCode: string = "UnknownError";
|
|
289
|
-
errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
290
|
-
switch (errorCode) {
|
|
291
|
-
case "ForbiddenException":
|
|
292
|
-
case "com.amazonaws.apigatewaymanagementapi#ForbiddenException":
|
|
293
|
-
response = {
|
|
294
|
-
...(await deserializeAws_restJson1ForbiddenExceptionResponse(parsedOutput, context)),
|
|
295
|
-
name: errorCode,
|
|
296
|
-
$metadata: deserializeMetadata(output),
|
|
297
|
-
};
|
|
298
|
-
break;
|
|
299
|
-
case "GoneException":
|
|
300
|
-
case "com.amazonaws.apigatewaymanagementapi#GoneException":
|
|
301
|
-
response = {
|
|
302
|
-
...(await deserializeAws_restJson1GoneExceptionResponse(parsedOutput, context)),
|
|
303
|
-
name: errorCode,
|
|
304
|
-
$metadata: deserializeMetadata(output),
|
|
305
|
-
};
|
|
306
|
-
break;
|
|
307
|
-
case "LimitExceededException":
|
|
308
|
-
case "com.amazonaws.apigatewaymanagementapi#LimitExceededException":
|
|
309
|
-
response = {
|
|
310
|
-
...(await deserializeAws_restJson1LimitExceededExceptionResponse(parsedOutput, context)),
|
|
311
|
-
name: errorCode,
|
|
312
|
-
$metadata: deserializeMetadata(output),
|
|
313
|
-
};
|
|
314
|
-
break;
|
|
315
|
-
case "PayloadTooLargeException":
|
|
316
|
-
case "com.amazonaws.apigatewaymanagementapi#PayloadTooLargeException":
|
|
317
|
-
response = {
|
|
318
|
-
...(await deserializeAws_restJson1PayloadTooLargeExceptionResponse(parsedOutput, context)),
|
|
319
|
-
name: errorCode,
|
|
320
|
-
$metadata: deserializeMetadata(output),
|
|
321
|
-
};
|
|
322
|
-
break;
|
|
323
|
-
default:
|
|
324
|
-
const parsedBody = parsedOutput.body;
|
|
325
|
-
errorCode = parsedBody.code || parsedBody.Code || errorCode;
|
|
326
|
-
response = {
|
|
327
|
-
...parsedBody,
|
|
328
|
-
name: `${errorCode}`,
|
|
329
|
-
message: parsedBody.message || parsedBody.Message || errorCode,
|
|
330
|
-
$fault: "client",
|
|
331
|
-
$metadata: deserializeMetadata(output),
|
|
332
|
-
} as any;
|
|
333
|
-
}
|
|
334
|
-
const message = response.message || response.Message || errorCode;
|
|
335
|
-
response.message = message;
|
|
336
|
-
delete response.Message;
|
|
337
|
-
return Promise.reject(Object.assign(new Error(message), response));
|
|
338
|
-
};
|
|
339
|
-
|
|
340
|
-
const deserializeAws_restJson1ForbiddenExceptionResponse = async (
|
|
341
|
-
parsedOutput: any,
|
|
342
|
-
context: __SerdeContext
|
|
343
|
-
): Promise<ForbiddenException> => {
|
|
344
|
-
const contents: ForbiddenException = {
|
|
345
|
-
name: "ForbiddenException",
|
|
346
|
-
$fault: "client",
|
|
347
|
-
$metadata: deserializeMetadata(parsedOutput),
|
|
348
|
-
};
|
|
349
|
-
const data: any = parsedOutput.body;
|
|
350
|
-
return contents;
|
|
351
|
-
};
|
|
352
|
-
|
|
353
|
-
const deserializeAws_restJson1GoneExceptionResponse = async (
|
|
354
|
-
parsedOutput: any,
|
|
355
|
-
context: __SerdeContext
|
|
356
|
-
): Promise<GoneException> => {
|
|
357
|
-
const contents: GoneException = {
|
|
358
|
-
name: "GoneException",
|
|
359
|
-
$fault: "client",
|
|
360
|
-
$metadata: deserializeMetadata(parsedOutput),
|
|
361
|
-
};
|
|
362
|
-
const data: any = parsedOutput.body;
|
|
363
|
-
return contents;
|
|
364
|
-
};
|
|
365
|
-
|
|
366
|
-
const deserializeAws_restJson1LimitExceededExceptionResponse = async (
|
|
367
|
-
parsedOutput: any,
|
|
368
|
-
context: __SerdeContext
|
|
369
|
-
): Promise<LimitExceededException> => {
|
|
370
|
-
const contents: LimitExceededException = {
|
|
371
|
-
name: "LimitExceededException",
|
|
372
|
-
$fault: "client",
|
|
373
|
-
$metadata: deserializeMetadata(parsedOutput),
|
|
374
|
-
};
|
|
375
|
-
const data: any = parsedOutput.body;
|
|
376
|
-
return contents;
|
|
377
|
-
};
|
|
378
|
-
|
|
379
|
-
const deserializeAws_restJson1PayloadTooLargeExceptionResponse = async (
|
|
380
|
-
parsedOutput: any,
|
|
381
|
-
context: __SerdeContext
|
|
382
|
-
): Promise<PayloadTooLargeException> => {
|
|
383
|
-
const contents: PayloadTooLargeException = {
|
|
384
|
-
name: "PayloadTooLargeException",
|
|
385
|
-
$fault: "client",
|
|
386
|
-
$metadata: deserializeMetadata(parsedOutput),
|
|
387
|
-
Message: undefined,
|
|
388
|
-
};
|
|
389
|
-
const data: any = parsedOutput.body;
|
|
390
|
-
if (data.message !== undefined && data.message !== null) {
|
|
391
|
-
contents.Message = __expectString(data.message);
|
|
392
|
-
}
|
|
393
|
-
return contents;
|
|
394
|
-
};
|
|
395
|
-
|
|
396
|
-
const deserializeAws_restJson1Identity = (output: any, context: __SerdeContext): Identity => {
|
|
397
|
-
return {
|
|
398
|
-
SourceIp: __expectString(output.sourceIp),
|
|
399
|
-
UserAgent: __expectString(output.userAgent),
|
|
400
|
-
} as any;
|
|
401
|
-
};
|
|
402
|
-
|
|
403
|
-
const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({
|
|
404
|
-
httpStatusCode: output.statusCode,
|
|
405
|
-
requestId: output.headers["x-amzn-requestid"] ?? output.headers["x-amzn-request-id"],
|
|
406
|
-
extendedRequestId: output.headers["x-amz-id-2"],
|
|
407
|
-
cfId: output.headers["x-amz-cf-id"],
|
|
408
|
-
});
|
|
409
|
-
|
|
410
|
-
// Collect low-level response body stream to Uint8Array.
|
|
411
|
-
const collectBody = (streamBody: any = new Uint8Array(), context: __SerdeContext): Promise<Uint8Array> => {
|
|
412
|
-
if (streamBody instanceof Uint8Array) {
|
|
413
|
-
return Promise.resolve(streamBody);
|
|
414
|
-
}
|
|
415
|
-
return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array());
|
|
416
|
-
};
|
|
417
|
-
|
|
418
|
-
// Encode Uint8Array data into string with utf-8.
|
|
419
|
-
const collectBodyString = (streamBody: any, context: __SerdeContext): Promise<string> =>
|
|
420
|
-
collectBody(streamBody, context).then((body) => context.utf8Encoder(body));
|
|
421
|
-
|
|
422
|
-
const isSerializableHeaderValue = (value: any): boolean =>
|
|
423
|
-
value !== undefined &&
|
|
424
|
-
value !== null &&
|
|
425
|
-
value !== "" &&
|
|
426
|
-
(!Object.getOwnPropertyNames(value).includes("length") || value.length != 0) &&
|
|
427
|
-
(!Object.getOwnPropertyNames(value).includes("size") || value.size != 0);
|
|
428
|
-
|
|
429
|
-
const parseBody = (streamBody: any, context: __SerdeContext): any =>
|
|
430
|
-
collectBodyString(streamBody, context).then((encoded) => {
|
|
431
|
-
if (encoded.length) {
|
|
432
|
-
return JSON.parse(encoded);
|
|
433
|
-
}
|
|
434
|
-
return {};
|
|
435
|
-
});
|
|
436
|
-
|
|
437
|
-
/**
|
|
438
|
-
* Load an error code for the aws.rest-json-1.1 protocol.
|
|
439
|
-
*/
|
|
440
|
-
const loadRestJsonErrorCode = (output: __HttpResponse, data: any): string => {
|
|
441
|
-
const findKey = (object: any, key: string) => Object.keys(object).find((k) => k.toLowerCase() === key.toLowerCase());
|
|
442
|
-
|
|
443
|
-
const sanitizeErrorCode = (rawValue: string): string => {
|
|
444
|
-
let cleanValue = rawValue;
|
|
445
|
-
if (cleanValue.indexOf(":") >= 0) {
|
|
446
|
-
cleanValue = cleanValue.split(":")[0];
|
|
447
|
-
}
|
|
448
|
-
if (cleanValue.indexOf("#") >= 0) {
|
|
449
|
-
cleanValue = cleanValue.split("#")[1];
|
|
450
|
-
}
|
|
451
|
-
return cleanValue;
|
|
452
|
-
};
|
|
453
|
-
|
|
454
|
-
const headerKey = findKey(output.headers, "x-amzn-errortype");
|
|
455
|
-
if (headerKey !== undefined) {
|
|
456
|
-
return sanitizeErrorCode(output.headers[headerKey]);
|
|
457
|
-
}
|
|
458
|
-
|
|
459
|
-
if (data.code !== undefined) {
|
|
460
|
-
return sanitizeErrorCode(data.code);
|
|
461
|
-
}
|
|
462
|
-
|
|
463
|
-
if (data["__type"] !== undefined) {
|
|
464
|
-
return sanitizeErrorCode(data["__type"]);
|
|
465
|
-
}
|
|
466
|
-
|
|
467
|
-
return "";
|
|
468
|
-
};
|
package/runtimeConfig.browser.ts
DELETED
|
@@ -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 { ApiGatewayManagementApiClientConfig } from "./ApiGatewayManagementApiClient";
|
|
12
|
-
import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared";
|
|
13
|
-
|
|
14
|
-
/**
|
|
15
|
-
* @internal
|
|
16
|
-
*/
|
|
17
|
-
export const getRuntimeConfig = (config: ApiGatewayManagementApiClientConfig) => {
|
|
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
|
-
};
|
package/runtimeConfig.native.ts
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { Sha256 } from "@aws-crypto/sha256-js";
|
|
2
|
-
import { ApiGatewayManagementApiClientConfig } from "./ApiGatewayManagementApiClient";
|
|
3
|
-
import { getRuntimeConfig as getBrowserRuntimeConfig } from "./runtimeConfig.browser";
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* @internal
|
|
7
|
-
*/
|
|
8
|
-
export const getRuntimeConfig = (config: ApiGatewayManagementApiClientConfig) => {
|
|
9
|
-
const browserDefaults = getBrowserRuntimeConfig(config);
|
|
10
|
-
return {
|
|
11
|
-
...browserDefaults,
|
|
12
|
-
...config,
|
|
13
|
-
runtime: "react-native",
|
|
14
|
-
sha256: config?.sha256 ?? Sha256,
|
|
15
|
-
};
|
|
16
|
-
};
|
package/runtimeConfig.shared.ts
DELETED
|
@@ -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 { ApiGatewayManagementApiClientConfig } from "./ApiGatewayManagementApiClient";
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
* @internal
|
|
8
|
-
*/
|
|
9
|
-
export const getRuntimeConfig = (config: ApiGatewayManagementApiClientConfig) => ({
|
|
10
|
-
apiVersion: "2018-11-29",
|
|
11
|
-
disableHostPrefix: config?.disableHostPrefix ?? false,
|
|
12
|
-
logger: config?.logger ?? ({} as __Logger),
|
|
13
|
-
regionInfoProvider: config?.regionInfoProvider ?? defaultRegionInfoProvider,
|
|
14
|
-
serviceId: config?.serviceId ?? "ApiGatewayManagementApi",
|
|
15
|
-
urlParser: config?.urlParser ?? parseUrl,
|
|
16
|
-
});
|
package/runtimeConfig.ts
DELETED
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
import packageInfo from "./package.json";
|
|
2
|
-
|
|
3
|
-
import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts";
|
|
4
|
-
import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver";
|
|
5
|
-
import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node";
|
|
6
|
-
import { Hash } from "@aws-sdk/hash-node";
|
|
7
|
-
import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry";
|
|
8
|
-
import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider";
|
|
9
|
-
import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler";
|
|
10
|
-
import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node";
|
|
11
|
-
import { calculateBodyLength } from "@aws-sdk/util-body-length-node";
|
|
12
|
-
import { defaultUserAgent } from "@aws-sdk/util-user-agent-node";
|
|
13
|
-
import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node";
|
|
14
|
-
import { ApiGatewayManagementApiClientConfig } from "./ApiGatewayManagementApiClient";
|
|
15
|
-
import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared";
|
|
16
|
-
import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client";
|
|
17
|
-
|
|
18
|
-
/**
|
|
19
|
-
* @internal
|
|
20
|
-
*/
|
|
21
|
-
export const getRuntimeConfig = (config: ApiGatewayManagementApiClientConfig) => {
|
|
22
|
-
emitWarningIfUnsupportedVersion(process.version);
|
|
23
|
-
const clientSharedValues = getSharedRuntimeConfig(config);
|
|
24
|
-
return {
|
|
25
|
-
...clientSharedValues,
|
|
26
|
-
...config,
|
|
27
|
-
runtime: "node",
|
|
28
|
-
base64Decoder: config?.base64Decoder ?? fromBase64,
|
|
29
|
-
base64Encoder: config?.base64Encoder ?? toBase64,
|
|
30
|
-
bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength,
|
|
31
|
-
credentialDefaultProvider:
|
|
32
|
-
config?.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider),
|
|
33
|
-
defaultUserAgentProvider:
|
|
34
|
-
config?.defaultUserAgentProvider ??
|
|
35
|
-
defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }),
|
|
36
|
-
maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS),
|
|
37
|
-
region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS),
|
|
38
|
-
requestHandler: config?.requestHandler ?? new NodeHttpHandler(),
|
|
39
|
-
retryMode: config?.retryMode ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS),
|
|
40
|
-
sha256: config?.sha256 ?? Hash.bind(null, "sha256"),
|
|
41
|
-
streamCollector: config?.streamCollector ?? streamCollector,
|
|
42
|
-
utf8Decoder: config?.utf8Decoder ?? fromUtf8,
|
|
43
|
-
utf8Encoder: config?.utf8Encoder ?? toUtf8,
|
|
44
|
-
};
|
|
45
|
-
};
|
package/tsconfig.es.json
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"extends": "./tsconfig",
|
|
3
|
-
"compilerOptions": {
|
|
4
|
-
"target": "es5",
|
|
5
|
-
"module": "esnext",
|
|
6
|
-
"moduleResolution": "node",
|
|
7
|
-
"declaration": false,
|
|
8
|
-
"declarationDir": null,
|
|
9
|
-
"lib": ["dom", "es5", "es2015.promise", "es2015.collection", "es2015.iterable", "es2015.symbol.wellknown"],
|
|
10
|
-
"outDir": "dist/es"
|
|
11
|
-
}
|
|
12
|
-
}
|
package/tsconfig.json
DELETED
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"compilerOptions": {
|
|
3
|
-
"alwaysStrict": true,
|
|
4
|
-
"target": "ES2018",
|
|
5
|
-
"module": "commonjs",
|
|
6
|
-
"declaration": true,
|
|
7
|
-
"strict": true,
|
|
8
|
-
"sourceMap": true,
|
|
9
|
-
"downlevelIteration": true,
|
|
10
|
-
"importHelpers": true,
|
|
11
|
-
"noEmitHelpers": true,
|
|
12
|
-
"incremental": true,
|
|
13
|
-
"resolveJsonModule": true,
|
|
14
|
-
"esModuleInterop": true,
|
|
15
|
-
"declarationDir": "./dist/types",
|
|
16
|
-
"outDir": "dist/cjs"
|
|
17
|
-
},
|
|
18
|
-
"typedocOptions": {
|
|
19
|
-
"exclude": ["**/node_modules/**", "**/*.spec.ts", "**/protocols/*.ts", "**/e2e/*.ts", "**/endpoints.ts"],
|
|
20
|
-
"excludeNotExported": true,
|
|
21
|
-
"excludePrivate": true,
|
|
22
|
-
"hideGenerator": true,
|
|
23
|
-
"ignoreCompilerErrors": true,
|
|
24
|
-
"includeDeclarations": true,
|
|
25
|
-
"stripInternal": true,
|
|
26
|
-
"readme": "./README.md",
|
|
27
|
-
"mode": "file",
|
|
28
|
-
"out": "./docs",
|
|
29
|
-
"theme": "minimal",
|
|
30
|
-
"plugin": ["@aws-sdk/client-documentation-generator"]
|
|
31
|
-
}
|
|
32
|
-
}
|