@aws-sdk/client-apigatewaymanagementapi 3.490.0 → 3.495.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.
@@ -1,17 +1 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ApiGatewayManagementApi = void 0;
4
- const smithy_client_1 = require("@smithy/smithy-client");
5
- const ApiGatewayManagementApiClient_1 = require("./ApiGatewayManagementApiClient");
6
- const DeleteConnectionCommand_1 = require("./commands/DeleteConnectionCommand");
7
- const GetConnectionCommand_1 = require("./commands/GetConnectionCommand");
8
- const PostToConnectionCommand_1 = require("./commands/PostToConnectionCommand");
9
- const commands = {
10
- DeleteConnectionCommand: DeleteConnectionCommand_1.DeleteConnectionCommand,
11
- GetConnectionCommand: GetConnectionCommand_1.GetConnectionCommand,
12
- PostToConnectionCommand: PostToConnectionCommand_1.PostToConnectionCommand,
13
- };
14
- class ApiGatewayManagementApi extends ApiGatewayManagementApiClient_1.ApiGatewayManagementApiClient {
15
- }
16
- exports.ApiGatewayManagementApi = ApiGatewayManagementApi;
17
- (0, smithy_client_1.createAggregatedClient)(commands, ApiGatewayManagementApi);
1
+ module.exports = require("./index.js");
@@ -1,43 +1 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ApiGatewayManagementApiClient = exports.__Client = void 0;
4
- const middleware_host_header_1 = require("@aws-sdk/middleware-host-header");
5
- const middleware_logger_1 = require("@aws-sdk/middleware-logger");
6
- const middleware_recursion_detection_1 = require("@aws-sdk/middleware-recursion-detection");
7
- const middleware_signing_1 = require("@aws-sdk/middleware-signing");
8
- const middleware_user_agent_1 = require("@aws-sdk/middleware-user-agent");
9
- const config_resolver_1 = require("@smithy/config-resolver");
10
- const middleware_content_length_1 = require("@smithy/middleware-content-length");
11
- const middleware_endpoint_1 = require("@smithy/middleware-endpoint");
12
- const middleware_retry_1 = require("@smithy/middleware-retry");
13
- const smithy_client_1 = require("@smithy/smithy-client");
14
- Object.defineProperty(exports, "__Client", { enumerable: true, get: function () { return smithy_client_1.Client; } });
15
- const EndpointParameters_1 = require("./endpoint/EndpointParameters");
16
- const runtimeConfig_1 = require("./runtimeConfig");
17
- const runtimeExtensions_1 = require("./runtimeExtensions");
18
- class ApiGatewayManagementApiClient extends smithy_client_1.Client {
19
- constructor(...[configuration]) {
20
- const _config_0 = (0, runtimeConfig_1.getRuntimeConfig)(configuration || {});
21
- const _config_1 = (0, EndpointParameters_1.resolveClientEndpointParameters)(_config_0);
22
- const _config_2 = (0, config_resolver_1.resolveRegionConfig)(_config_1);
23
- const _config_3 = (0, middleware_endpoint_1.resolveEndpointConfig)(_config_2);
24
- const _config_4 = (0, middleware_retry_1.resolveRetryConfig)(_config_3);
25
- const _config_5 = (0, middleware_host_header_1.resolveHostHeaderConfig)(_config_4);
26
- const _config_6 = (0, middleware_signing_1.resolveAwsAuthConfig)(_config_5);
27
- const _config_7 = (0, middleware_user_agent_1.resolveUserAgentConfig)(_config_6);
28
- const _config_8 = (0, runtimeExtensions_1.resolveRuntimeExtensions)(_config_7, configuration?.extensions || []);
29
- super(_config_8);
30
- this.config = _config_8;
31
- this.middlewareStack.use((0, middleware_retry_1.getRetryPlugin)(this.config));
32
- this.middlewareStack.use((0, middleware_content_length_1.getContentLengthPlugin)(this.config));
33
- this.middlewareStack.use((0, middleware_host_header_1.getHostHeaderPlugin)(this.config));
34
- this.middlewareStack.use((0, middleware_logger_1.getLoggerPlugin)(this.config));
35
- this.middlewareStack.use((0, middleware_recursion_detection_1.getRecursionDetectionPlugin)(this.config));
36
- this.middlewareStack.use((0, middleware_signing_1.getAwsAuthPlugin)(this.config));
37
- this.middlewareStack.use((0, middleware_user_agent_1.getUserAgentPlugin)(this.config));
38
- }
39
- destroy() {
40
- super.destroy();
41
- }
42
- }
43
- exports.ApiGatewayManagementApiClient = ApiGatewayManagementApiClient;
1
+ module.exports = require("./index.js");
@@ -1,28 +1 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.DeleteConnectionCommand = exports.$Command = void 0;
4
- const middleware_endpoint_1 = require("@smithy/middleware-endpoint");
5
- const middleware_serde_1 = require("@smithy/middleware-serde");
6
- const smithy_client_1 = require("@smithy/smithy-client");
7
- Object.defineProperty(exports, "$Command", { enumerable: true, get: function () { return smithy_client_1.Command; } });
8
- const EndpointParameters_1 = require("../endpoint/EndpointParameters");
9
- const Aws_restJson1_1 = require("../protocols/Aws_restJson1");
10
- class DeleteConnectionCommand extends smithy_client_1.Command
11
- .classBuilder()
12
- .ep({
13
- ...EndpointParameters_1.commonParams,
14
- })
15
- .m(function (Command, cs, config, o) {
16
- return [
17
- (0, middleware_serde_1.getSerdePlugin)(config, this.serialize, this.deserialize),
18
- (0, middleware_endpoint_1.getEndpointPlugin)(config, Command.getEndpointParameterInstructions()),
19
- ];
20
- })
21
- .s("ApiGatewayManagementApi", "DeleteConnection", {})
22
- .n("ApiGatewayManagementApiClient", "DeleteConnectionCommand")
23
- .f(void 0, void 0)
24
- .ser(Aws_restJson1_1.se_DeleteConnectionCommand)
25
- .de(Aws_restJson1_1.de_DeleteConnectionCommand)
26
- .build() {
27
- }
28
- exports.DeleteConnectionCommand = DeleteConnectionCommand;
1
+ module.exports = require("../index.js");
@@ -1,28 +1 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.GetConnectionCommand = exports.$Command = void 0;
4
- const middleware_endpoint_1 = require("@smithy/middleware-endpoint");
5
- const middleware_serde_1 = require("@smithy/middleware-serde");
6
- const smithy_client_1 = require("@smithy/smithy-client");
7
- Object.defineProperty(exports, "$Command", { enumerable: true, get: function () { return smithy_client_1.Command; } });
8
- const EndpointParameters_1 = require("../endpoint/EndpointParameters");
9
- const Aws_restJson1_1 = require("../protocols/Aws_restJson1");
10
- class GetConnectionCommand extends smithy_client_1.Command
11
- .classBuilder()
12
- .ep({
13
- ...EndpointParameters_1.commonParams,
14
- })
15
- .m(function (Command, cs, config, o) {
16
- return [
17
- (0, middleware_serde_1.getSerdePlugin)(config, this.serialize, this.deserialize),
18
- (0, middleware_endpoint_1.getEndpointPlugin)(config, Command.getEndpointParameterInstructions()),
19
- ];
20
- })
21
- .s("ApiGatewayManagementApi", "GetConnection", {})
22
- .n("ApiGatewayManagementApiClient", "GetConnectionCommand")
23
- .f(void 0, void 0)
24
- .ser(Aws_restJson1_1.se_GetConnectionCommand)
25
- .de(Aws_restJson1_1.de_GetConnectionCommand)
26
- .build() {
27
- }
28
- exports.GetConnectionCommand = GetConnectionCommand;
1
+ module.exports = require("../index.js");
@@ -1,28 +1 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.PostToConnectionCommand = exports.$Command = void 0;
4
- const middleware_endpoint_1 = require("@smithy/middleware-endpoint");
5
- const middleware_serde_1 = require("@smithy/middleware-serde");
6
- const smithy_client_1 = require("@smithy/smithy-client");
7
- Object.defineProperty(exports, "$Command", { enumerable: true, get: function () { return smithy_client_1.Command; } });
8
- const EndpointParameters_1 = require("../endpoint/EndpointParameters");
9
- const Aws_restJson1_1 = require("../protocols/Aws_restJson1");
10
- class PostToConnectionCommand extends smithy_client_1.Command
11
- .classBuilder()
12
- .ep({
13
- ...EndpointParameters_1.commonParams,
14
- })
15
- .m(function (Command, cs, config, o) {
16
- return [
17
- (0, middleware_serde_1.getSerdePlugin)(config, this.serialize, this.deserialize),
18
- (0, middleware_endpoint_1.getEndpointPlugin)(config, Command.getEndpointParameterInstructions()),
19
- ];
20
- })
21
- .s("ApiGatewayManagementApi", "PostToConnection", {})
22
- .n("ApiGatewayManagementApiClient", "PostToConnectionCommand")
23
- .f(void 0, void 0)
24
- .ser(Aws_restJson1_1.se_PostToConnectionCommand)
25
- .de(Aws_restJson1_1.de_PostToConnectionCommand)
26
- .build() {
27
- }
28
- exports.PostToConnectionCommand = PostToConnectionCommand;
1
+ module.exports = require("../index.js");
@@ -1,6 +1 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const tslib_1 = require("tslib");
4
- tslib_1.__exportStar(require("./DeleteConnectionCommand"), exports);
5
- tslib_1.__exportStar(require("./GetConnectionCommand"), exports);
6
- tslib_1.__exportStar(require("./PostToConnectionCommand"), exports);
1
+ module.exports = require("../index.js");
@@ -1,18 +1 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.commonParams = exports.resolveClientEndpointParameters = void 0;
4
- const resolveClientEndpointParameters = (options) => {
5
- return {
6
- ...options,
7
- useDualstackEndpoint: options.useDualstackEndpoint ?? false,
8
- useFipsEndpoint: options.useFipsEndpoint ?? false,
9
- defaultSigningName: "execute-api",
10
- };
11
- };
12
- exports.resolveClientEndpointParameters = resolveClientEndpointParameters;
13
- exports.commonParams = {
14
- UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" },
15
- Endpoint: { type: "builtInParams", name: "endpoint" },
16
- Region: { type: "builtInParams", name: "region" },
17
- UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" },
18
- };
1
+ module.exports = require("../index.js");
@@ -1,2 +1 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
1
+ module.exports = require("./index.js");
package/dist-cjs/index.js CHANGED
@@ -1,11 +1,543 @@
1
1
  "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ApiGatewayManagementApiServiceException = void 0;
4
- const tslib_1 = require("tslib");
5
- tslib_1.__exportStar(require("./ApiGatewayManagementApiClient"), exports);
6
- tslib_1.__exportStar(require("./ApiGatewayManagementApi"), exports);
7
- tslib_1.__exportStar(require("./commands"), exports);
8
- tslib_1.__exportStar(require("./models"), exports);
9
- require("@aws-sdk/util-endpoints");
10
- var ApiGatewayManagementApiServiceException_1 = require("./models/ApiGatewayManagementApiServiceException");
11
- Object.defineProperty(exports, "ApiGatewayManagementApiServiceException", { enumerable: true, get: function () { return ApiGatewayManagementApiServiceException_1.ApiGatewayManagementApiServiceException; } });
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
7
+ var __export = (target, all) => {
8
+ for (var name in all)
9
+ __defProp(target, name, { get: all[name], enumerable: true });
10
+ };
11
+ var __copyProps = (to, from, except, desc) => {
12
+ if (from && typeof from === "object" || typeof from === "function") {
13
+ for (let key of __getOwnPropNames(from))
14
+ if (!__hasOwnProp.call(to, key) && key !== except)
15
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
16
+ }
17
+ return to;
18
+ };
19
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
20
+
21
+ // src/index.ts
22
+ var src_exports = {};
23
+ __export(src_exports, {
24
+ ApiGatewayManagementApi: () => ApiGatewayManagementApi,
25
+ ApiGatewayManagementApiClient: () => ApiGatewayManagementApiClient,
26
+ ApiGatewayManagementApiServiceException: () => ApiGatewayManagementApiServiceException,
27
+ DeleteConnectionCommand: () => DeleteConnectionCommand,
28
+ ForbiddenException: () => ForbiddenException,
29
+ GetConnectionCommand: () => GetConnectionCommand,
30
+ GoneException: () => GoneException,
31
+ LimitExceededException: () => LimitExceededException,
32
+ PayloadTooLargeException: () => PayloadTooLargeException,
33
+ PostToConnectionCommand: () => PostToConnectionCommand,
34
+ __Client: () => import_smithy_client.Client
35
+ });
36
+ module.exports = __toCommonJS(src_exports);
37
+
38
+ // src/ApiGatewayManagementApiClient.ts
39
+ var import_middleware_host_header = require("@aws-sdk/middleware-host-header");
40
+ var import_middleware_logger = require("@aws-sdk/middleware-logger");
41
+ var import_middleware_recursion_detection = require("@aws-sdk/middleware-recursion-detection");
42
+ var import_middleware_signing = require("@aws-sdk/middleware-signing");
43
+ var import_middleware_user_agent = require("@aws-sdk/middleware-user-agent");
44
+ var import_config_resolver = require("@smithy/config-resolver");
45
+ var import_middleware_content_length = require("@smithy/middleware-content-length");
46
+ var import_middleware_endpoint = require("@smithy/middleware-endpoint");
47
+ var import_middleware_retry = require("@smithy/middleware-retry");
48
+
49
+
50
+ // src/endpoint/EndpointParameters.ts
51
+ var resolveClientEndpointParameters = /* @__PURE__ */ __name((options) => {
52
+ return {
53
+ ...options,
54
+ useDualstackEndpoint: options.useDualstackEndpoint ?? false,
55
+ useFipsEndpoint: options.useFipsEndpoint ?? false,
56
+ defaultSigningName: "execute-api"
57
+ };
58
+ }, "resolveClientEndpointParameters");
59
+ var commonParams = {
60
+ UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" },
61
+ Endpoint: { type: "builtInParams", name: "endpoint" },
62
+ Region: { type: "builtInParams", name: "region" },
63
+ UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" }
64
+ };
65
+
66
+ // src/ApiGatewayManagementApiClient.ts
67
+ var import_runtimeConfig = require("././runtimeConfig");
68
+
69
+ // src/runtimeExtensions.ts
70
+ var import_region_config_resolver = require("@aws-sdk/region-config-resolver");
71
+ var import_protocol_http = require("@smithy/protocol-http");
72
+ var import_smithy_client = require("@smithy/smithy-client");
73
+ var asPartial = /* @__PURE__ */ __name((t) => t, "asPartial");
74
+ var resolveRuntimeExtensions = /* @__PURE__ */ __name((runtimeConfig, extensions) => {
75
+ const extensionConfiguration = {
76
+ ...asPartial((0, import_region_config_resolver.getAwsRegionExtensionConfiguration)(runtimeConfig)),
77
+ ...asPartial((0, import_smithy_client.getDefaultExtensionConfiguration)(runtimeConfig)),
78
+ ...asPartial((0, import_protocol_http.getHttpHandlerExtensionConfiguration)(runtimeConfig))
79
+ };
80
+ extensions.forEach((extension) => extension.configure(extensionConfiguration));
81
+ return {
82
+ ...runtimeConfig,
83
+ ...(0, import_region_config_resolver.resolveAwsRegionExtensionConfiguration)(extensionConfiguration),
84
+ ...(0, import_smithy_client.resolveDefaultRuntimeConfig)(extensionConfiguration),
85
+ ...(0, import_protocol_http.resolveHttpHandlerRuntimeConfig)(extensionConfiguration)
86
+ };
87
+ }, "resolveRuntimeExtensions");
88
+
89
+ // src/ApiGatewayManagementApiClient.ts
90
+ var _ApiGatewayManagementApiClient = class _ApiGatewayManagementApiClient extends import_smithy_client.Client {
91
+ constructor(...[configuration]) {
92
+ const _config_0 = (0, import_runtimeConfig.getRuntimeConfig)(configuration || {});
93
+ const _config_1 = resolveClientEndpointParameters(_config_0);
94
+ const _config_2 = (0, import_config_resolver.resolveRegionConfig)(_config_1);
95
+ const _config_3 = (0, import_middleware_endpoint.resolveEndpointConfig)(_config_2);
96
+ const _config_4 = (0, import_middleware_retry.resolveRetryConfig)(_config_3);
97
+ const _config_5 = (0, import_middleware_host_header.resolveHostHeaderConfig)(_config_4);
98
+ const _config_6 = (0, import_middleware_signing.resolveAwsAuthConfig)(_config_5);
99
+ const _config_7 = (0, import_middleware_user_agent.resolveUserAgentConfig)(_config_6);
100
+ const _config_8 = resolveRuntimeExtensions(_config_7, (configuration == null ? void 0 : configuration.extensions) || []);
101
+ super(_config_8);
102
+ this.config = _config_8;
103
+ this.middlewareStack.use((0, import_middleware_retry.getRetryPlugin)(this.config));
104
+ this.middlewareStack.use((0, import_middleware_content_length.getContentLengthPlugin)(this.config));
105
+ this.middlewareStack.use((0, import_middleware_host_header.getHostHeaderPlugin)(this.config));
106
+ this.middlewareStack.use((0, import_middleware_logger.getLoggerPlugin)(this.config));
107
+ this.middlewareStack.use((0, import_middleware_recursion_detection.getRecursionDetectionPlugin)(this.config));
108
+ this.middlewareStack.use((0, import_middleware_signing.getAwsAuthPlugin)(this.config));
109
+ this.middlewareStack.use((0, import_middleware_user_agent.getUserAgentPlugin)(this.config));
110
+ }
111
+ /**
112
+ * Destroy underlying resources, like sockets. It's usually not necessary to do this.
113
+ * However in Node.js, it's best to explicitly shut down the client's agent when it is no longer needed.
114
+ * Otherwise, sockets might stay open for quite a long time before the server terminates them.
115
+ */
116
+ destroy() {
117
+ super.destroy();
118
+ }
119
+ };
120
+ __name(_ApiGatewayManagementApiClient, "ApiGatewayManagementApiClient");
121
+ var ApiGatewayManagementApiClient = _ApiGatewayManagementApiClient;
122
+
123
+ // src/ApiGatewayManagementApi.ts
124
+
125
+
126
+ // src/commands/DeleteConnectionCommand.ts
127
+
128
+ var import_middleware_serde = require("@smithy/middleware-serde");
129
+
130
+ var import_types = require("@smithy/types");
131
+
132
+ // src/protocols/Aws_restJson1.ts
133
+ var import_core = require("@smithy/core");
134
+
135
+
136
+ // src/models/ApiGatewayManagementApiServiceException.ts
137
+
138
+ var _ApiGatewayManagementApiServiceException = class _ApiGatewayManagementApiServiceException extends import_smithy_client.ServiceException {
139
+ /**
140
+ * @internal
141
+ */
142
+ constructor(options) {
143
+ super(options);
144
+ Object.setPrototypeOf(this, _ApiGatewayManagementApiServiceException.prototype);
145
+ }
146
+ };
147
+ __name(_ApiGatewayManagementApiServiceException, "ApiGatewayManagementApiServiceException");
148
+ var ApiGatewayManagementApiServiceException = _ApiGatewayManagementApiServiceException;
149
+
150
+ // src/models/models_0.ts
151
+ var _ForbiddenException = class _ForbiddenException extends ApiGatewayManagementApiServiceException {
152
+ /**
153
+ * @internal
154
+ */
155
+ constructor(opts) {
156
+ super({
157
+ name: "ForbiddenException",
158
+ $fault: "client",
159
+ ...opts
160
+ });
161
+ this.name = "ForbiddenException";
162
+ this.$fault = "client";
163
+ Object.setPrototypeOf(this, _ForbiddenException.prototype);
164
+ }
165
+ };
166
+ __name(_ForbiddenException, "ForbiddenException");
167
+ var ForbiddenException = _ForbiddenException;
168
+ var _GoneException = class _GoneException extends ApiGatewayManagementApiServiceException {
169
+ /**
170
+ * @internal
171
+ */
172
+ constructor(opts) {
173
+ super({
174
+ name: "GoneException",
175
+ $fault: "client",
176
+ ...opts
177
+ });
178
+ this.name = "GoneException";
179
+ this.$fault = "client";
180
+ Object.setPrototypeOf(this, _GoneException.prototype);
181
+ }
182
+ };
183
+ __name(_GoneException, "GoneException");
184
+ var GoneException = _GoneException;
185
+ var _LimitExceededException = class _LimitExceededException extends ApiGatewayManagementApiServiceException {
186
+ /**
187
+ * @internal
188
+ */
189
+ constructor(opts) {
190
+ super({
191
+ name: "LimitExceededException",
192
+ $fault: "client",
193
+ ...opts
194
+ });
195
+ this.name = "LimitExceededException";
196
+ this.$fault = "client";
197
+ Object.setPrototypeOf(this, _LimitExceededException.prototype);
198
+ }
199
+ };
200
+ __name(_LimitExceededException, "LimitExceededException");
201
+ var LimitExceededException = _LimitExceededException;
202
+ var _PayloadTooLargeException = class _PayloadTooLargeException extends ApiGatewayManagementApiServiceException {
203
+ /**
204
+ * @internal
205
+ */
206
+ constructor(opts) {
207
+ super({
208
+ name: "PayloadTooLargeException",
209
+ $fault: "client",
210
+ ...opts
211
+ });
212
+ this.name = "PayloadTooLargeException";
213
+ this.$fault = "client";
214
+ Object.setPrototypeOf(this, _PayloadTooLargeException.prototype);
215
+ this.Message = opts.Message;
216
+ }
217
+ };
218
+ __name(_PayloadTooLargeException, "PayloadTooLargeException");
219
+ var PayloadTooLargeException = _PayloadTooLargeException;
220
+
221
+ // src/protocols/Aws_restJson1.ts
222
+ var se_DeleteConnectionCommand = /* @__PURE__ */ __name(async (input, context) => {
223
+ const b = (0, import_core.requestBuilder)(input, context);
224
+ const headers = {};
225
+ b.bp("/@connections/{ConnectionId}");
226
+ b.p("ConnectionId", () => input.ConnectionId, "{ConnectionId}", false);
227
+ let body;
228
+ b.m("DELETE").h(headers).b(body);
229
+ return b.build();
230
+ }, "se_DeleteConnectionCommand");
231
+ var se_GetConnectionCommand = /* @__PURE__ */ __name(async (input, context) => {
232
+ const b = (0, import_core.requestBuilder)(input, context);
233
+ const headers = {};
234
+ b.bp("/@connections/{ConnectionId}");
235
+ b.p("ConnectionId", () => input.ConnectionId, "{ConnectionId}", false);
236
+ let body;
237
+ b.m("GET").h(headers).b(body);
238
+ return b.build();
239
+ }, "se_GetConnectionCommand");
240
+ var se_PostToConnectionCommand = /* @__PURE__ */ __name(async (input, context) => {
241
+ const b = (0, import_core.requestBuilder)(input, context);
242
+ const headers = {
243
+ "content-type": "application/octet-stream"
244
+ };
245
+ b.bp("/@connections/{ConnectionId}");
246
+ b.p("ConnectionId", () => input.ConnectionId, "{ConnectionId}", false);
247
+ let body;
248
+ if (input.Data !== void 0) {
249
+ body = input.Data;
250
+ }
251
+ b.m("POST").h(headers).b(body);
252
+ return b.build();
253
+ }, "se_PostToConnectionCommand");
254
+ var de_DeleteConnectionCommand = /* @__PURE__ */ __name(async (output, context) => {
255
+ if (output.statusCode !== 204 && output.statusCode >= 300) {
256
+ return de_DeleteConnectionCommandError(output, context);
257
+ }
258
+ const contents = (0, import_smithy_client.map)({
259
+ $metadata: deserializeMetadata(output)
260
+ });
261
+ await (0, import_smithy_client.collectBody)(output.body, context);
262
+ return contents;
263
+ }, "de_DeleteConnectionCommand");
264
+ var de_DeleteConnectionCommandError = /* @__PURE__ */ __name(async (output, context) => {
265
+ const parsedOutput = {
266
+ ...output,
267
+ body: await parseErrorBody(output.body, context)
268
+ };
269
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
270
+ switch (errorCode) {
271
+ case "ForbiddenException":
272
+ case "com.amazonaws.apigatewaymanagementapi#ForbiddenException":
273
+ throw await de_ForbiddenExceptionRes(parsedOutput, context);
274
+ case "GoneException":
275
+ case "com.amazonaws.apigatewaymanagementapi#GoneException":
276
+ throw await de_GoneExceptionRes(parsedOutput, context);
277
+ case "LimitExceededException":
278
+ case "com.amazonaws.apigatewaymanagementapi#LimitExceededException":
279
+ throw await de_LimitExceededExceptionRes(parsedOutput, context);
280
+ default:
281
+ const parsedBody = parsedOutput.body;
282
+ return throwDefaultError({
283
+ output,
284
+ parsedBody,
285
+ errorCode
286
+ });
287
+ }
288
+ }, "de_DeleteConnectionCommandError");
289
+ var de_GetConnectionCommand = /* @__PURE__ */ __name(async (output, context) => {
290
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
291
+ return de_GetConnectionCommandError(output, context);
292
+ }
293
+ const contents = (0, import_smithy_client.map)({
294
+ $metadata: deserializeMetadata(output)
295
+ });
296
+ const data = (0, import_smithy_client.expectNonNull)((0, import_smithy_client.expectObject)(await parseBody(output.body, context)), "body");
297
+ const doc = (0, import_smithy_client.take)(data, {
298
+ ConnectedAt: [, (_) => (0, import_smithy_client.expectNonNull)((0, import_smithy_client.parseRfc3339DateTimeWithOffset)(_)), `connectedAt`],
299
+ Identity: [, (_) => de_Identity(_, context), `identity`],
300
+ LastActiveAt: [, (_) => (0, import_smithy_client.expectNonNull)((0, import_smithy_client.parseRfc3339DateTimeWithOffset)(_)), `lastActiveAt`]
301
+ });
302
+ Object.assign(contents, doc);
303
+ return contents;
304
+ }, "de_GetConnectionCommand");
305
+ var de_GetConnectionCommandError = /* @__PURE__ */ __name(async (output, context) => {
306
+ const parsedOutput = {
307
+ ...output,
308
+ body: await parseErrorBody(output.body, context)
309
+ };
310
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
311
+ switch (errorCode) {
312
+ case "ForbiddenException":
313
+ case "com.amazonaws.apigatewaymanagementapi#ForbiddenException":
314
+ throw await de_ForbiddenExceptionRes(parsedOutput, context);
315
+ case "GoneException":
316
+ case "com.amazonaws.apigatewaymanagementapi#GoneException":
317
+ throw await de_GoneExceptionRes(parsedOutput, context);
318
+ case "LimitExceededException":
319
+ case "com.amazonaws.apigatewaymanagementapi#LimitExceededException":
320
+ throw await de_LimitExceededExceptionRes(parsedOutput, context);
321
+ default:
322
+ const parsedBody = parsedOutput.body;
323
+ return throwDefaultError({
324
+ output,
325
+ parsedBody,
326
+ errorCode
327
+ });
328
+ }
329
+ }, "de_GetConnectionCommandError");
330
+ var de_PostToConnectionCommand = /* @__PURE__ */ __name(async (output, context) => {
331
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
332
+ return de_PostToConnectionCommandError(output, context);
333
+ }
334
+ const contents = (0, import_smithy_client.map)({
335
+ $metadata: deserializeMetadata(output)
336
+ });
337
+ await (0, import_smithy_client.collectBody)(output.body, context);
338
+ return contents;
339
+ }, "de_PostToConnectionCommand");
340
+ var de_PostToConnectionCommandError = /* @__PURE__ */ __name(async (output, context) => {
341
+ const parsedOutput = {
342
+ ...output,
343
+ body: await parseErrorBody(output.body, context)
344
+ };
345
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
346
+ switch (errorCode) {
347
+ case "ForbiddenException":
348
+ case "com.amazonaws.apigatewaymanagementapi#ForbiddenException":
349
+ throw await de_ForbiddenExceptionRes(parsedOutput, context);
350
+ case "GoneException":
351
+ case "com.amazonaws.apigatewaymanagementapi#GoneException":
352
+ throw await de_GoneExceptionRes(parsedOutput, context);
353
+ case "LimitExceededException":
354
+ case "com.amazonaws.apigatewaymanagementapi#LimitExceededException":
355
+ throw await de_LimitExceededExceptionRes(parsedOutput, context);
356
+ case "PayloadTooLargeException":
357
+ case "com.amazonaws.apigatewaymanagementapi#PayloadTooLargeException":
358
+ throw await de_PayloadTooLargeExceptionRes(parsedOutput, context);
359
+ default:
360
+ const parsedBody = parsedOutput.body;
361
+ return throwDefaultError({
362
+ output,
363
+ parsedBody,
364
+ errorCode
365
+ });
366
+ }
367
+ }, "de_PostToConnectionCommandError");
368
+ var throwDefaultError = (0, import_smithy_client.withBaseException)(ApiGatewayManagementApiServiceException);
369
+ var de_ForbiddenExceptionRes = /* @__PURE__ */ __name(async (parsedOutput, context) => {
370
+ const contents = (0, import_smithy_client.map)({});
371
+ const data = parsedOutput.body;
372
+ const doc = (0, import_smithy_client.take)(data, {});
373
+ Object.assign(contents, doc);
374
+ const exception = new ForbiddenException({
375
+ $metadata: deserializeMetadata(parsedOutput),
376
+ ...contents
377
+ });
378
+ return (0, import_smithy_client.decorateServiceException)(exception, parsedOutput.body);
379
+ }, "de_ForbiddenExceptionRes");
380
+ var de_GoneExceptionRes = /* @__PURE__ */ __name(async (parsedOutput, context) => {
381
+ const contents = (0, import_smithy_client.map)({});
382
+ const data = parsedOutput.body;
383
+ const doc = (0, import_smithy_client.take)(data, {});
384
+ Object.assign(contents, doc);
385
+ const exception = new GoneException({
386
+ $metadata: deserializeMetadata(parsedOutput),
387
+ ...contents
388
+ });
389
+ return (0, import_smithy_client.decorateServiceException)(exception, parsedOutput.body);
390
+ }, "de_GoneExceptionRes");
391
+ var de_LimitExceededExceptionRes = /* @__PURE__ */ __name(async (parsedOutput, context) => {
392
+ const contents = (0, import_smithy_client.map)({});
393
+ const data = parsedOutput.body;
394
+ const doc = (0, import_smithy_client.take)(data, {});
395
+ Object.assign(contents, doc);
396
+ const exception = new LimitExceededException({
397
+ $metadata: deserializeMetadata(parsedOutput),
398
+ ...contents
399
+ });
400
+ return (0, import_smithy_client.decorateServiceException)(exception, parsedOutput.body);
401
+ }, "de_LimitExceededExceptionRes");
402
+ var de_PayloadTooLargeExceptionRes = /* @__PURE__ */ __name(async (parsedOutput, context) => {
403
+ const contents = (0, import_smithy_client.map)({});
404
+ const data = parsedOutput.body;
405
+ const doc = (0, import_smithy_client.take)(data, {
406
+ Message: [, import_smithy_client.expectString, `message`]
407
+ });
408
+ Object.assign(contents, doc);
409
+ const exception = new PayloadTooLargeException({
410
+ $metadata: deserializeMetadata(parsedOutput),
411
+ ...contents
412
+ });
413
+ return (0, import_smithy_client.decorateServiceException)(exception, parsedOutput.body);
414
+ }, "de_PayloadTooLargeExceptionRes");
415
+ var de_Identity = /* @__PURE__ */ __name((output, context) => {
416
+ return (0, import_smithy_client.take)(output, {
417
+ SourceIp: [, import_smithy_client.expectString, `sourceIp`],
418
+ UserAgent: [, import_smithy_client.expectString, `userAgent`]
419
+ });
420
+ }, "de_Identity");
421
+ var deserializeMetadata = /* @__PURE__ */ __name((output) => ({
422
+ httpStatusCode: output.statusCode,
423
+ requestId: output.headers["x-amzn-requestid"] ?? output.headers["x-amzn-request-id"] ?? output.headers["x-amz-request-id"],
424
+ extendedRequestId: output.headers["x-amz-id-2"],
425
+ cfId: output.headers["x-amz-cf-id"]
426
+ }), "deserializeMetadata");
427
+ var collectBodyString = /* @__PURE__ */ __name((streamBody, context) => (0, import_smithy_client.collectBody)(streamBody, context).then((body) => context.utf8Encoder(body)), "collectBodyString");
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
+
469
+ // src/commands/DeleteConnectionCommand.ts
470
+ var _DeleteConnectionCommand = class _DeleteConnectionCommand extends import_smithy_client.Command.classBuilder().ep({
471
+ ...commonParams
472
+ }).m(function(Command, cs, config, o) {
473
+ return [
474
+ (0, import_middleware_serde.getSerdePlugin)(config, this.serialize, this.deserialize),
475
+ (0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions())
476
+ ];
477
+ }).s("ApiGatewayManagementApi", "DeleteConnection", {}).n("ApiGatewayManagementApiClient", "DeleteConnectionCommand").f(void 0, void 0).ser(se_DeleteConnectionCommand).de(de_DeleteConnectionCommand).build() {
478
+ };
479
+ __name(_DeleteConnectionCommand, "DeleteConnectionCommand");
480
+ var DeleteConnectionCommand = _DeleteConnectionCommand;
481
+
482
+ // src/commands/GetConnectionCommand.ts
483
+
484
+
485
+
486
+
487
+ var _GetConnectionCommand = class _GetConnectionCommand extends import_smithy_client.Command.classBuilder().ep({
488
+ ...commonParams
489
+ }).m(function(Command, cs, config, o) {
490
+ return [
491
+ (0, import_middleware_serde.getSerdePlugin)(config, this.serialize, this.deserialize),
492
+ (0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions())
493
+ ];
494
+ }).s("ApiGatewayManagementApi", "GetConnection", {}).n("ApiGatewayManagementApiClient", "GetConnectionCommand").f(void 0, void 0).ser(se_GetConnectionCommand).de(de_GetConnectionCommand).build() {
495
+ };
496
+ __name(_GetConnectionCommand, "GetConnectionCommand");
497
+ var GetConnectionCommand = _GetConnectionCommand;
498
+
499
+ // src/commands/PostToConnectionCommand.ts
500
+
501
+
502
+
503
+
504
+ var _PostToConnectionCommand = class _PostToConnectionCommand extends import_smithy_client.Command.classBuilder().ep({
505
+ ...commonParams
506
+ }).m(function(Command, cs, config, o) {
507
+ return [
508
+ (0, import_middleware_serde.getSerdePlugin)(config, this.serialize, this.deserialize),
509
+ (0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions())
510
+ ];
511
+ }).s("ApiGatewayManagementApi", "PostToConnection", {}).n("ApiGatewayManagementApiClient", "PostToConnectionCommand").f(void 0, void 0).ser(se_PostToConnectionCommand).de(de_PostToConnectionCommand).build() {
512
+ };
513
+ __name(_PostToConnectionCommand, "PostToConnectionCommand");
514
+ var PostToConnectionCommand = _PostToConnectionCommand;
515
+
516
+ // src/ApiGatewayManagementApi.ts
517
+ var commands = {
518
+ DeleteConnectionCommand,
519
+ GetConnectionCommand,
520
+ PostToConnectionCommand
521
+ };
522
+ var _ApiGatewayManagementApi = class _ApiGatewayManagementApi extends ApiGatewayManagementApiClient {
523
+ };
524
+ __name(_ApiGatewayManagementApi, "ApiGatewayManagementApi");
525
+ var ApiGatewayManagementApi = _ApiGatewayManagementApi;
526
+ (0, import_smithy_client.createAggregatedClient)(commands, ApiGatewayManagementApi);
527
+
528
+ // src/index.ts
529
+ var import_util_endpoints = require("@aws-sdk/util-endpoints");
530
+ // Annotate the CommonJS export names for ESM import in node:
531
+ 0 && (module.exports = {
532
+ ApiGatewayManagementApi,
533
+ ApiGatewayManagementApiClient,
534
+ ApiGatewayManagementApiServiceException,
535
+ DeleteConnectionCommand,
536
+ ForbiddenException,
537
+ GetConnectionCommand,
538
+ GoneException,
539
+ LimitExceededException,
540
+ PayloadTooLargeException,
541
+ PostToConnectionCommand,
542
+ __Client
543
+ });
@@ -1,12 +1 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ApiGatewayManagementApiServiceException = exports.__ServiceException = void 0;
4
- const smithy_client_1 = require("@smithy/smithy-client");
5
- Object.defineProperty(exports, "__ServiceException", { enumerable: true, get: function () { return smithy_client_1.ServiceException; } });
6
- class ApiGatewayManagementApiServiceException extends smithy_client_1.ServiceException {
7
- constructor(options) {
8
- super(options);
9
- Object.setPrototypeOf(this, ApiGatewayManagementApiServiceException.prototype);
10
- }
11
- }
12
- exports.ApiGatewayManagementApiServiceException = ApiGatewayManagementApiServiceException;
1
+ module.exports = require("../index.js");
@@ -1,4 +1 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const tslib_1 = require("tslib");
4
- tslib_1.__exportStar(require("./models_0"), exports);
1
+ module.exports = require("../index.js");
@@ -1,57 +1 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.PayloadTooLargeException = exports.LimitExceededException = exports.GoneException = exports.ForbiddenException = void 0;
4
- const ApiGatewayManagementApiServiceException_1 = require("./ApiGatewayManagementApiServiceException");
5
- class ForbiddenException extends ApiGatewayManagementApiServiceException_1.ApiGatewayManagementApiServiceException {
6
- constructor(opts) {
7
- super({
8
- name: "ForbiddenException",
9
- $fault: "client",
10
- ...opts,
11
- });
12
- this.name = "ForbiddenException";
13
- this.$fault = "client";
14
- Object.setPrototypeOf(this, ForbiddenException.prototype);
15
- }
16
- }
17
- exports.ForbiddenException = ForbiddenException;
18
- class GoneException extends ApiGatewayManagementApiServiceException_1.ApiGatewayManagementApiServiceException {
19
- constructor(opts) {
20
- super({
21
- name: "GoneException",
22
- $fault: "client",
23
- ...opts,
24
- });
25
- this.name = "GoneException";
26
- this.$fault = "client";
27
- Object.setPrototypeOf(this, GoneException.prototype);
28
- }
29
- }
30
- exports.GoneException = GoneException;
31
- class LimitExceededException extends ApiGatewayManagementApiServiceException_1.ApiGatewayManagementApiServiceException {
32
- constructor(opts) {
33
- super({
34
- name: "LimitExceededException",
35
- $fault: "client",
36
- ...opts,
37
- });
38
- this.name = "LimitExceededException";
39
- this.$fault = "client";
40
- Object.setPrototypeOf(this, LimitExceededException.prototype);
41
- }
42
- }
43
- exports.LimitExceededException = LimitExceededException;
44
- class PayloadTooLargeException extends ApiGatewayManagementApiServiceException_1.ApiGatewayManagementApiServiceException {
45
- constructor(opts) {
46
- super({
47
- name: "PayloadTooLargeException",
48
- $fault: "client",
49
- ...opts,
50
- });
51
- this.name = "PayloadTooLargeException";
52
- this.$fault = "client";
53
- Object.setPrototypeOf(this, PayloadTooLargeException.prototype);
54
- this.Message = opts.Message;
55
- }
56
- }
57
- exports.PayloadTooLargeException = PayloadTooLargeException;
1
+ module.exports = require("../index.js");
@@ -1,264 +1 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.de_PostToConnectionCommand = exports.de_GetConnectionCommand = exports.de_DeleteConnectionCommand = exports.se_PostToConnectionCommand = exports.se_GetConnectionCommand = exports.se_DeleteConnectionCommand = void 0;
4
- const core_1 = require("@smithy/core");
5
- const smithy_client_1 = require("@smithy/smithy-client");
6
- const ApiGatewayManagementApiServiceException_1 = require("../models/ApiGatewayManagementApiServiceException");
7
- const models_0_1 = require("../models/models_0");
8
- const se_DeleteConnectionCommand = async (input, context) => {
9
- const b = (0, core_1.requestBuilder)(input, context);
10
- const headers = {};
11
- b.bp("/@connections/{ConnectionId}");
12
- b.p("ConnectionId", () => input.ConnectionId, "{ConnectionId}", false);
13
- let body;
14
- b.m("DELETE").h(headers).b(body);
15
- return b.build();
16
- };
17
- exports.se_DeleteConnectionCommand = se_DeleteConnectionCommand;
18
- const se_GetConnectionCommand = async (input, context) => {
19
- const b = (0, core_1.requestBuilder)(input, context);
20
- const headers = {};
21
- b.bp("/@connections/{ConnectionId}");
22
- b.p("ConnectionId", () => input.ConnectionId, "{ConnectionId}", false);
23
- let body;
24
- b.m("GET").h(headers).b(body);
25
- return b.build();
26
- };
27
- exports.se_GetConnectionCommand = se_GetConnectionCommand;
28
- const se_PostToConnectionCommand = async (input, context) => {
29
- const b = (0, core_1.requestBuilder)(input, context);
30
- const headers = {
31
- "content-type": "application/octet-stream",
32
- };
33
- b.bp("/@connections/{ConnectionId}");
34
- b.p("ConnectionId", () => input.ConnectionId, "{ConnectionId}", false);
35
- let body;
36
- if (input.Data !== undefined) {
37
- body = input.Data;
38
- }
39
- b.m("POST").h(headers).b(body);
40
- return b.build();
41
- };
42
- exports.se_PostToConnectionCommand = se_PostToConnectionCommand;
43
- const de_DeleteConnectionCommand = async (output, context) => {
44
- if (output.statusCode !== 204 && output.statusCode >= 300) {
45
- return de_DeleteConnectionCommandError(output, context);
46
- }
47
- const contents = (0, smithy_client_1.map)({
48
- $metadata: deserializeMetadata(output),
49
- });
50
- await (0, smithy_client_1.collectBody)(output.body, context);
51
- return contents;
52
- };
53
- exports.de_DeleteConnectionCommand = de_DeleteConnectionCommand;
54
- const de_DeleteConnectionCommandError = async (output, context) => {
55
- const parsedOutput = {
56
- ...output,
57
- body: await parseErrorBody(output.body, context),
58
- };
59
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
60
- switch (errorCode) {
61
- case "ForbiddenException":
62
- case "com.amazonaws.apigatewaymanagementapi#ForbiddenException":
63
- throw await de_ForbiddenExceptionRes(parsedOutput, context);
64
- case "GoneException":
65
- case "com.amazonaws.apigatewaymanagementapi#GoneException":
66
- throw await de_GoneExceptionRes(parsedOutput, context);
67
- case "LimitExceededException":
68
- case "com.amazonaws.apigatewaymanagementapi#LimitExceededException":
69
- throw await de_LimitExceededExceptionRes(parsedOutput, context);
70
- default:
71
- const parsedBody = parsedOutput.body;
72
- return throwDefaultError({
73
- output,
74
- parsedBody,
75
- errorCode,
76
- });
77
- }
78
- };
79
- const de_GetConnectionCommand = async (output, context) => {
80
- if (output.statusCode !== 200 && output.statusCode >= 300) {
81
- return de_GetConnectionCommandError(output, context);
82
- }
83
- const contents = (0, smithy_client_1.map)({
84
- $metadata: deserializeMetadata(output),
85
- });
86
- const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
87
- const doc = (0, smithy_client_1.take)(data, {
88
- ConnectedAt: [, (_) => (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseRfc3339DateTimeWithOffset)(_)), `connectedAt`],
89
- Identity: [, (_) => de_Identity(_, context), `identity`],
90
- LastActiveAt: [, (_) => (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseRfc3339DateTimeWithOffset)(_)), `lastActiveAt`],
91
- });
92
- Object.assign(contents, doc);
93
- return contents;
94
- };
95
- exports.de_GetConnectionCommand = de_GetConnectionCommand;
96
- const de_GetConnectionCommandError = async (output, context) => {
97
- const parsedOutput = {
98
- ...output,
99
- body: await parseErrorBody(output.body, context),
100
- };
101
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
102
- switch (errorCode) {
103
- case "ForbiddenException":
104
- case "com.amazonaws.apigatewaymanagementapi#ForbiddenException":
105
- throw await de_ForbiddenExceptionRes(parsedOutput, context);
106
- case "GoneException":
107
- case "com.amazonaws.apigatewaymanagementapi#GoneException":
108
- throw await de_GoneExceptionRes(parsedOutput, context);
109
- case "LimitExceededException":
110
- case "com.amazonaws.apigatewaymanagementapi#LimitExceededException":
111
- throw await de_LimitExceededExceptionRes(parsedOutput, context);
112
- default:
113
- const parsedBody = parsedOutput.body;
114
- return throwDefaultError({
115
- output,
116
- parsedBody,
117
- errorCode,
118
- });
119
- }
120
- };
121
- const de_PostToConnectionCommand = async (output, context) => {
122
- if (output.statusCode !== 200 && output.statusCode >= 300) {
123
- return de_PostToConnectionCommandError(output, context);
124
- }
125
- const contents = (0, smithy_client_1.map)({
126
- $metadata: deserializeMetadata(output),
127
- });
128
- await (0, smithy_client_1.collectBody)(output.body, context);
129
- return contents;
130
- };
131
- exports.de_PostToConnectionCommand = de_PostToConnectionCommand;
132
- const de_PostToConnectionCommandError = async (output, context) => {
133
- const parsedOutput = {
134
- ...output,
135
- body: await parseErrorBody(output.body, context),
136
- };
137
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
138
- switch (errorCode) {
139
- case "ForbiddenException":
140
- case "com.amazonaws.apigatewaymanagementapi#ForbiddenException":
141
- throw await de_ForbiddenExceptionRes(parsedOutput, context);
142
- case "GoneException":
143
- case "com.amazonaws.apigatewaymanagementapi#GoneException":
144
- throw await de_GoneExceptionRes(parsedOutput, context);
145
- case "LimitExceededException":
146
- case "com.amazonaws.apigatewaymanagementapi#LimitExceededException":
147
- throw await de_LimitExceededExceptionRes(parsedOutput, context);
148
- case "PayloadTooLargeException":
149
- case "com.amazonaws.apigatewaymanagementapi#PayloadTooLargeException":
150
- throw await de_PayloadTooLargeExceptionRes(parsedOutput, context);
151
- default:
152
- const parsedBody = parsedOutput.body;
153
- return throwDefaultError({
154
- output,
155
- parsedBody,
156
- errorCode,
157
- });
158
- }
159
- };
160
- const throwDefaultError = (0, smithy_client_1.withBaseException)(ApiGatewayManagementApiServiceException_1.ApiGatewayManagementApiServiceException);
161
- const de_ForbiddenExceptionRes = async (parsedOutput, context) => {
162
- const contents = (0, smithy_client_1.map)({});
163
- const data = parsedOutput.body;
164
- const doc = (0, smithy_client_1.take)(data, {});
165
- Object.assign(contents, doc);
166
- const exception = new models_0_1.ForbiddenException({
167
- $metadata: deserializeMetadata(parsedOutput),
168
- ...contents,
169
- });
170
- return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
171
- };
172
- const de_GoneExceptionRes = async (parsedOutput, context) => {
173
- const contents = (0, smithy_client_1.map)({});
174
- const data = parsedOutput.body;
175
- const doc = (0, smithy_client_1.take)(data, {});
176
- Object.assign(contents, doc);
177
- const exception = new models_0_1.GoneException({
178
- $metadata: deserializeMetadata(parsedOutput),
179
- ...contents,
180
- });
181
- return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
182
- };
183
- const de_LimitExceededExceptionRes = async (parsedOutput, context) => {
184
- const contents = (0, smithy_client_1.map)({});
185
- const data = parsedOutput.body;
186
- const doc = (0, smithy_client_1.take)(data, {});
187
- Object.assign(contents, doc);
188
- const exception = new models_0_1.LimitExceededException({
189
- $metadata: deserializeMetadata(parsedOutput),
190
- ...contents,
191
- });
192
- return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
193
- };
194
- const de_PayloadTooLargeExceptionRes = async (parsedOutput, context) => {
195
- const contents = (0, smithy_client_1.map)({});
196
- const data = parsedOutput.body;
197
- const doc = (0, smithy_client_1.take)(data, {
198
- Message: [, smithy_client_1.expectString, `message`],
199
- });
200
- Object.assign(contents, doc);
201
- const exception = new models_0_1.PayloadTooLargeException({
202
- $metadata: deserializeMetadata(parsedOutput),
203
- ...contents,
204
- });
205
- return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
206
- };
207
- const de_Identity = (output, context) => {
208
- return (0, smithy_client_1.take)(output, {
209
- SourceIp: [, smithy_client_1.expectString, `sourceIp`],
210
- UserAgent: [, smithy_client_1.expectString, `userAgent`],
211
- });
212
- };
213
- const deserializeMetadata = (output) => ({
214
- httpStatusCode: output.statusCode,
215
- requestId: output.headers["x-amzn-requestid"] ?? output.headers["x-amzn-request-id"] ?? output.headers["x-amz-request-id"],
216
- extendedRequestId: output.headers["x-amz-id-2"],
217
- cfId: output.headers["x-amz-cf-id"],
218
- });
219
- const collectBodyString = (streamBody, context) => (0, smithy_client_1.collectBody)(streamBody, context).then((body) => context.utf8Encoder(body));
220
- const isSerializableHeaderValue = (value) => value !== undefined &&
221
- value !== null &&
222
- value !== "" &&
223
- (!Object.getOwnPropertyNames(value).includes("length") || value.length != 0) &&
224
- (!Object.getOwnPropertyNames(value).includes("size") || value.size != 0);
225
- const parseBody = (streamBody, context) => collectBodyString(streamBody, context).then((encoded) => {
226
- if (encoded.length) {
227
- return JSON.parse(encoded);
228
- }
229
- return {};
230
- });
231
- const parseErrorBody = async (errorBody, context) => {
232
- const value = await parseBody(errorBody, context);
233
- value.message = value.message ?? value.Message;
234
- return value;
235
- };
236
- const loadRestJsonErrorCode = (output, data) => {
237
- const findKey = (object, key) => Object.keys(object).find((k) => k.toLowerCase() === key.toLowerCase());
238
- const sanitizeErrorCode = (rawValue) => {
239
- let cleanValue = rawValue;
240
- if (typeof cleanValue === "number") {
241
- cleanValue = cleanValue.toString();
242
- }
243
- if (cleanValue.indexOf(",") >= 0) {
244
- cleanValue = cleanValue.split(",")[0];
245
- }
246
- if (cleanValue.indexOf(":") >= 0) {
247
- cleanValue = cleanValue.split(":")[0];
248
- }
249
- if (cleanValue.indexOf("#") >= 0) {
250
- cleanValue = cleanValue.split("#")[1];
251
- }
252
- return cleanValue;
253
- };
254
- const headerKey = findKey(output.headers, "x-amzn-errortype");
255
- if (headerKey !== undefined) {
256
- return sanitizeErrorCode(output.headers[headerKey]);
257
- }
258
- if (data.code !== undefined) {
259
- return sanitizeErrorCode(data.code);
260
- }
261
- if (data["__type"] !== undefined) {
262
- return sanitizeErrorCode(data["__type"]);
263
- }
264
- };
1
+ module.exports = require("../index.js");
@@ -1,22 +1 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.resolveRuntimeExtensions = void 0;
4
- const region_config_resolver_1 = require("@aws-sdk/region-config-resolver");
5
- const protocol_http_1 = require("@smithy/protocol-http");
6
- const smithy_client_1 = require("@smithy/smithy-client");
7
- const asPartial = (t) => t;
8
- const resolveRuntimeExtensions = (runtimeConfig, extensions) => {
9
- const extensionConfiguration = {
10
- ...asPartial((0, region_config_resolver_1.getAwsRegionExtensionConfiguration)(runtimeConfig)),
11
- ...asPartial((0, smithy_client_1.getDefaultExtensionConfiguration)(runtimeConfig)),
12
- ...asPartial((0, protocol_http_1.getHttpHandlerExtensionConfiguration)(runtimeConfig)),
13
- };
14
- extensions.forEach((extension) => extension.configure(extensionConfiguration));
15
- return {
16
- ...runtimeConfig,
17
- ...(0, region_config_resolver_1.resolveAwsRegionExtensionConfiguration)(extensionConfiguration),
18
- ...(0, smithy_client_1.resolveDefaultRuntimeConfig)(extensionConfiguration),
19
- ...(0, protocol_http_1.resolveHttpHandlerRuntimeConfig)(extensionConfiguration),
20
- };
21
- };
22
- exports.resolveRuntimeExtensions = resolveRuntimeExtensions;
1
+ module.exports = require("./index.js");
package/package.json CHANGED
@@ -1,10 +1,10 @@
1
1
  {
2
2
  "name": "@aws-sdk/client-apigatewaymanagementapi",
3
3
  "description": "AWS SDK for JavaScript Apigatewaymanagementapi Client for Node.js, Browser and React Native",
4
- "version": "3.490.0",
4
+ "version": "3.495.0",
5
5
  "scripts": {
6
6
  "build": "concurrently 'yarn:build:cjs' 'yarn:build:es' 'yarn:build:types'",
7
- "build:cjs": "tsc -p tsconfig.cjs.json",
7
+ "build:cjs": "node ../../scripts/compilation/inline client-apigatewaymanagementapi",
8
8
  "build:es": "tsc -p tsconfig.es.json",
9
9
  "build:include:deps": "lerna run --scope $npm_package_name --include-dependencies build",
10
10
  "build:types": "tsc -p tsconfig.types.json",
@@ -20,47 +20,47 @@
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.490.0",
24
- "@aws-sdk/core": "3.490.0",
25
- "@aws-sdk/credential-provider-node": "3.490.0",
26
- "@aws-sdk/middleware-host-header": "3.489.0",
27
- "@aws-sdk/middleware-logger": "3.489.0",
28
- "@aws-sdk/middleware-recursion-detection": "3.489.0",
29
- "@aws-sdk/middleware-signing": "3.489.0",
30
- "@aws-sdk/middleware-user-agent": "3.489.0",
31
- "@aws-sdk/region-config-resolver": "3.489.0",
32
- "@aws-sdk/types": "3.489.0",
33
- "@aws-sdk/util-endpoints": "3.489.0",
34
- "@aws-sdk/util-user-agent-browser": "3.489.0",
35
- "@aws-sdk/util-user-agent-node": "3.489.0",
36
- "@smithy/config-resolver": "^2.0.23",
37
- "@smithy/core": "^1.2.2",
38
- "@smithy/fetch-http-handler": "^2.3.2",
39
- "@smithy/hash-node": "^2.0.18",
40
- "@smithy/invalid-dependency": "^2.0.16",
41
- "@smithy/middleware-content-length": "^2.0.18",
42
- "@smithy/middleware-endpoint": "^2.3.0",
43
- "@smithy/middleware-retry": "^2.0.26",
44
- "@smithy/middleware-serde": "^2.0.16",
45
- "@smithy/middleware-stack": "^2.0.10",
46
- "@smithy/node-config-provider": "^2.1.9",
47
- "@smithy/node-http-handler": "^2.2.2",
48
- "@smithy/protocol-http": "^3.0.12",
49
- "@smithy/smithy-client": "^2.2.1",
50
- "@smithy/types": "^2.8.0",
51
- "@smithy/url-parser": "^2.0.16",
52
- "@smithy/util-base64": "^2.0.1",
53
- "@smithy/util-body-length-browser": "^2.0.1",
54
- "@smithy/util-body-length-node": "^2.1.0",
55
- "@smithy/util-defaults-mode-browser": "^2.0.24",
56
- "@smithy/util-defaults-mode-node": "^2.0.32",
57
- "@smithy/util-endpoints": "^1.0.8",
58
- "@smithy/util-retry": "^2.0.9",
59
- "@smithy/util-utf8": "^2.0.2",
23
+ "@aws-sdk/client-sts": "3.495.0",
24
+ "@aws-sdk/core": "3.495.0",
25
+ "@aws-sdk/credential-provider-node": "3.495.0",
26
+ "@aws-sdk/middleware-host-header": "3.495.0",
27
+ "@aws-sdk/middleware-logger": "3.495.0",
28
+ "@aws-sdk/middleware-recursion-detection": "3.495.0",
29
+ "@aws-sdk/middleware-signing": "3.495.0",
30
+ "@aws-sdk/middleware-user-agent": "3.495.0",
31
+ "@aws-sdk/region-config-resolver": "3.495.0",
32
+ "@aws-sdk/types": "3.495.0",
33
+ "@aws-sdk/util-endpoints": "3.495.0",
34
+ "@aws-sdk/util-user-agent-browser": "3.495.0",
35
+ "@aws-sdk/util-user-agent-node": "3.495.0",
36
+ "@smithy/config-resolver": "^2.1.0",
37
+ "@smithy/core": "^1.3.0",
38
+ "@smithy/fetch-http-handler": "^2.4.0",
39
+ "@smithy/hash-node": "^2.1.0",
40
+ "@smithy/invalid-dependency": "^2.1.0",
41
+ "@smithy/middleware-content-length": "^2.1.0",
42
+ "@smithy/middleware-endpoint": "^2.4.0",
43
+ "@smithy/middleware-retry": "^2.1.0",
44
+ "@smithy/middleware-serde": "^2.1.0",
45
+ "@smithy/middleware-stack": "^2.1.0",
46
+ "@smithy/node-config-provider": "^2.2.0",
47
+ "@smithy/node-http-handler": "^2.3.0",
48
+ "@smithy/protocol-http": "^3.1.0",
49
+ "@smithy/smithy-client": "^2.3.0",
50
+ "@smithy/types": "^2.9.0",
51
+ "@smithy/url-parser": "^2.1.0",
52
+ "@smithy/util-base64": "^2.1.0",
53
+ "@smithy/util-body-length-browser": "^2.1.0",
54
+ "@smithy/util-body-length-node": "^2.2.0",
55
+ "@smithy/util-defaults-mode-browser": "^2.1.0",
56
+ "@smithy/util-defaults-mode-node": "^2.1.0",
57
+ "@smithy/util-endpoints": "^1.1.0",
58
+ "@smithy/util-retry": "^2.1.0",
59
+ "@smithy/util-utf8": "^2.1.0",
60
60
  "tslib": "^2.5.0"
61
61
  },
62
62
  "devDependencies": {
63
- "@smithy/service-client-documentation-generator": "^2.0.0",
63
+ "@smithy/service-client-documentation-generator": "^2.1.0",
64
64
  "@tsconfig/node14": "1.0.3",
65
65
  "@types/node": "^14.14.31",
66
66
  "concurrently": "7.0.0",