@aws-sdk/client-apigatewaymanagementapi 3.901.0 → 3.906.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.
Files changed (2) hide show
  1. package/dist-cjs/index.js +379 -485
  2. package/package.json +5 -5
package/dist-cjs/index.js CHANGED
@@ -1,510 +1,404 @@
1
- "use strict";
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 });
1
+ 'use strict';
2
+
3
+ var middlewareHostHeader = require('@aws-sdk/middleware-host-header');
4
+ var middlewareLogger = require('@aws-sdk/middleware-logger');
5
+ var middlewareRecursionDetection = require('@aws-sdk/middleware-recursion-detection');
6
+ var middlewareUserAgent = require('@aws-sdk/middleware-user-agent');
7
+ var configResolver = require('@smithy/config-resolver');
8
+ var core = require('@smithy/core');
9
+ var middlewareContentLength = require('@smithy/middleware-content-length');
10
+ var middlewareEndpoint = require('@smithy/middleware-endpoint');
11
+ var middlewareRetry = require('@smithy/middleware-retry');
12
+ var smithyClient = require('@smithy/smithy-client');
13
+ var httpAuthSchemeProvider = require('./auth/httpAuthSchemeProvider');
14
+ var runtimeConfig = require('./runtimeConfig');
15
+ var regionConfigResolver = require('@aws-sdk/region-config-resolver');
16
+ var protocolHttp = require('@smithy/protocol-http');
17
+ var middlewareSerde = require('@smithy/middleware-serde');
18
+ var core$1 = require('@aws-sdk/core');
19
+
20
+ const resolveClientEndpointParameters = (options) => {
21
+ return Object.assign(options, {
22
+ useDualstackEndpoint: options.useDualstackEndpoint ?? false,
23
+ useFipsEndpoint: options.useFipsEndpoint ?? false,
24
+ defaultSigningName: "execute-api",
25
+ });
10
26
  };
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;
27
+ const commonParams = {
28
+ UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" },
29
+ Endpoint: { type: "builtInParams", name: "endpoint" },
30
+ Region: { type: "builtInParams", name: "region" },
31
+ UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" },
18
32
  };
19
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
20
-
21
- // src/index.ts
22
- var index_exports = {};
23
- __export(index_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(index_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_user_agent = require("@aws-sdk/middleware-user-agent");
43
- var import_config_resolver = require("@smithy/config-resolver");
44
- var import_core = require("@smithy/core");
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
33
 
49
- var import_httpAuthSchemeProvider = require("./auth/httpAuthSchemeProvider");
50
-
51
- // src/endpoint/EndpointParameters.ts
52
- var resolveClientEndpointParameters = /* @__PURE__ */ __name((options) => {
53
- return Object.assign(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" }
34
+ const getHttpAuthExtensionConfiguration = (runtimeConfig) => {
35
+ const _httpAuthSchemes = runtimeConfig.httpAuthSchemes;
36
+ let _httpAuthSchemeProvider = runtimeConfig.httpAuthSchemeProvider;
37
+ let _credentials = runtimeConfig.credentials;
38
+ return {
39
+ setHttpAuthScheme(httpAuthScheme) {
40
+ const index = _httpAuthSchemes.findIndex((scheme) => scheme.schemeId === httpAuthScheme.schemeId);
41
+ if (index === -1) {
42
+ _httpAuthSchemes.push(httpAuthScheme);
43
+ }
44
+ else {
45
+ _httpAuthSchemes.splice(index, 1, httpAuthScheme);
46
+ }
47
+ },
48
+ httpAuthSchemes() {
49
+ return _httpAuthSchemes;
50
+ },
51
+ setHttpAuthSchemeProvider(httpAuthSchemeProvider) {
52
+ _httpAuthSchemeProvider = httpAuthSchemeProvider;
53
+ },
54
+ httpAuthSchemeProvider() {
55
+ return _httpAuthSchemeProvider;
56
+ },
57
+ setCredentials(credentials) {
58
+ _credentials = credentials;
59
+ },
60
+ credentials() {
61
+ return _credentials;
62
+ },
63
+ };
64
+ };
65
+ const resolveHttpAuthRuntimeConfig = (config) => {
66
+ return {
67
+ httpAuthSchemes: config.httpAuthSchemes(),
68
+ httpAuthSchemeProvider: config.httpAuthSchemeProvider(),
69
+ credentials: config.credentials(),
70
+ };
64
71
  };
65
72
 
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
+ const resolveRuntimeExtensions = (runtimeConfig, extensions) => {
74
+ const extensionConfiguration = Object.assign(regionConfigResolver.getAwsRegionExtensionConfiguration(runtimeConfig), smithyClient.getDefaultExtensionConfiguration(runtimeConfig), protocolHttp.getHttpHandlerExtensionConfiguration(runtimeConfig), getHttpAuthExtensionConfiguration(runtimeConfig));
75
+ extensions.forEach((extension) => extension.configure(extensionConfiguration));
76
+ return Object.assign(runtimeConfig, regionConfigResolver.resolveAwsRegionExtensionConfiguration(extensionConfiguration), smithyClient.resolveDefaultRuntimeConfig(extensionConfiguration), protocolHttp.resolveHttpHandlerRuntimeConfig(extensionConfiguration), resolveHttpAuthRuntimeConfig(extensionConfiguration));
77
+ };
73
78
 
74
- // src/auth/httpAuthExtensionConfiguration.ts
75
- var getHttpAuthExtensionConfiguration = /* @__PURE__ */ __name((runtimeConfig) => {
76
- const _httpAuthSchemes = runtimeConfig.httpAuthSchemes;
77
- let _httpAuthSchemeProvider = runtimeConfig.httpAuthSchemeProvider;
78
- let _credentials = runtimeConfig.credentials;
79
- return {
80
- setHttpAuthScheme(httpAuthScheme) {
81
- const index = _httpAuthSchemes.findIndex((scheme) => scheme.schemeId === httpAuthScheme.schemeId);
82
- if (index === -1) {
83
- _httpAuthSchemes.push(httpAuthScheme);
84
- } else {
85
- _httpAuthSchemes.splice(index, 1, httpAuthScheme);
86
- }
87
- },
88
- httpAuthSchemes() {
89
- return _httpAuthSchemes;
90
- },
91
- setHttpAuthSchemeProvider(httpAuthSchemeProvider) {
92
- _httpAuthSchemeProvider = httpAuthSchemeProvider;
93
- },
94
- httpAuthSchemeProvider() {
95
- return _httpAuthSchemeProvider;
96
- },
97
- setCredentials(credentials) {
98
- _credentials = credentials;
99
- },
100
- credentials() {
101
- return _credentials;
79
+ class ApiGatewayManagementApiClient extends smithyClient.Client {
80
+ config;
81
+ constructor(...[configuration]) {
82
+ const _config_0 = runtimeConfig.getRuntimeConfig(configuration || {});
83
+ super(_config_0);
84
+ this.initConfig = _config_0;
85
+ const _config_1 = resolveClientEndpointParameters(_config_0);
86
+ const _config_2 = middlewareUserAgent.resolveUserAgentConfig(_config_1);
87
+ const _config_3 = middlewareRetry.resolveRetryConfig(_config_2);
88
+ const _config_4 = configResolver.resolveRegionConfig(_config_3);
89
+ const _config_5 = middlewareHostHeader.resolveHostHeaderConfig(_config_4);
90
+ const _config_6 = middlewareEndpoint.resolveEndpointConfig(_config_5);
91
+ const _config_7 = httpAuthSchemeProvider.resolveHttpAuthSchemeConfig(_config_6);
92
+ const _config_8 = resolveRuntimeExtensions(_config_7, configuration?.extensions || []);
93
+ this.config = _config_8;
94
+ this.middlewareStack.use(middlewareUserAgent.getUserAgentPlugin(this.config));
95
+ this.middlewareStack.use(middlewareRetry.getRetryPlugin(this.config));
96
+ this.middlewareStack.use(middlewareContentLength.getContentLengthPlugin(this.config));
97
+ this.middlewareStack.use(middlewareHostHeader.getHostHeaderPlugin(this.config));
98
+ this.middlewareStack.use(middlewareLogger.getLoggerPlugin(this.config));
99
+ this.middlewareStack.use(middlewareRecursionDetection.getRecursionDetectionPlugin(this.config));
100
+ this.middlewareStack.use(core.getHttpAuthSchemeEndpointRuleSetPlugin(this.config, {
101
+ httpAuthSchemeParametersProvider: httpAuthSchemeProvider.defaultApiGatewayManagementApiHttpAuthSchemeParametersProvider,
102
+ identityProviderConfigProvider: async (config) => new core.DefaultIdentityProviderConfig({
103
+ "aws.auth#sigv4": config.credentials,
104
+ }),
105
+ }));
106
+ this.middlewareStack.use(core.getHttpSigningPlugin(this.config));
102
107
  }
103
- };
104
- }, "getHttpAuthExtensionConfiguration");
105
- var resolveHttpAuthRuntimeConfig = /* @__PURE__ */ __name((config) => {
106
- return {
107
- httpAuthSchemes: config.httpAuthSchemes(),
108
- httpAuthSchemeProvider: config.httpAuthSchemeProvider(),
109
- credentials: config.credentials()
110
- };
111
- }, "resolveHttpAuthRuntimeConfig");
112
-
113
- // src/runtimeExtensions.ts
114
- var resolveRuntimeExtensions = /* @__PURE__ */ __name((runtimeConfig, extensions) => {
115
- const extensionConfiguration = Object.assign(
116
- (0, import_region_config_resolver.getAwsRegionExtensionConfiguration)(runtimeConfig),
117
- (0, import_smithy_client.getDefaultExtensionConfiguration)(runtimeConfig),
118
- (0, import_protocol_http.getHttpHandlerExtensionConfiguration)(runtimeConfig),
119
- getHttpAuthExtensionConfiguration(runtimeConfig)
120
- );
121
- extensions.forEach((extension) => extension.configure(extensionConfiguration));
122
- return Object.assign(
123
- runtimeConfig,
124
- (0, import_region_config_resolver.resolveAwsRegionExtensionConfiguration)(extensionConfiguration),
125
- (0, import_smithy_client.resolveDefaultRuntimeConfig)(extensionConfiguration),
126
- (0, import_protocol_http.resolveHttpHandlerRuntimeConfig)(extensionConfiguration),
127
- resolveHttpAuthRuntimeConfig(extensionConfiguration)
128
- );
129
- }, "resolveRuntimeExtensions");
108
+ destroy() {
109
+ super.destroy();
110
+ }
111
+ }
130
112
 
131
- // src/ApiGatewayManagementApiClient.ts
132
- var ApiGatewayManagementApiClient = class extends import_smithy_client.Client {
133
- static {
134
- __name(this, "ApiGatewayManagementApiClient");
135
- }
136
- /**
137
- * The resolved configuration of ApiGatewayManagementApiClient class. This is resolved and normalized from the {@link ApiGatewayManagementApiClientConfig | constructor configuration interface}.
138
- */
139
- config;
140
- constructor(...[configuration]) {
141
- const _config_0 = (0, import_runtimeConfig.getRuntimeConfig)(configuration || {});
142
- super(_config_0);
143
- this.initConfig = _config_0;
144
- const _config_1 = resolveClientEndpointParameters(_config_0);
145
- const _config_2 = (0, import_middleware_user_agent.resolveUserAgentConfig)(_config_1);
146
- const _config_3 = (0, import_middleware_retry.resolveRetryConfig)(_config_2);
147
- const _config_4 = (0, import_config_resolver.resolveRegionConfig)(_config_3);
148
- const _config_5 = (0, import_middleware_host_header.resolveHostHeaderConfig)(_config_4);
149
- const _config_6 = (0, import_middleware_endpoint.resolveEndpointConfig)(_config_5);
150
- const _config_7 = (0, import_httpAuthSchemeProvider.resolveHttpAuthSchemeConfig)(_config_6);
151
- const _config_8 = resolveRuntimeExtensions(_config_7, configuration?.extensions || []);
152
- this.config = _config_8;
153
- this.middlewareStack.use((0, import_middleware_user_agent.getUserAgentPlugin)(this.config));
154
- this.middlewareStack.use((0, import_middleware_retry.getRetryPlugin)(this.config));
155
- this.middlewareStack.use((0, import_middleware_content_length.getContentLengthPlugin)(this.config));
156
- this.middlewareStack.use((0, import_middleware_host_header.getHostHeaderPlugin)(this.config));
157
- this.middlewareStack.use((0, import_middleware_logger.getLoggerPlugin)(this.config));
158
- this.middlewareStack.use((0, import_middleware_recursion_detection.getRecursionDetectionPlugin)(this.config));
159
- this.middlewareStack.use(
160
- (0, import_core.getHttpAuthSchemeEndpointRuleSetPlugin)(this.config, {
161
- httpAuthSchemeParametersProvider: import_httpAuthSchemeProvider.defaultApiGatewayManagementApiHttpAuthSchemeParametersProvider,
162
- identityProviderConfigProvider: /* @__PURE__ */ __name(async (config) => new import_core.DefaultIdentityProviderConfig({
163
- "aws.auth#sigv4": config.credentials
164
- }), "identityProviderConfigProvider")
165
- })
166
- );
167
- this.middlewareStack.use((0, import_core.getHttpSigningPlugin)(this.config));
168
- }
169
- /**
170
- * Destroy underlying resources, like sockets. It's usually not necessary to do this.
171
- * However in Node.js, it's best to explicitly shut down the client's agent when it is no longer needed.
172
- * Otherwise, sockets might stay open for quite a long time before the server terminates them.
173
- */
174
- destroy() {
175
- super.destroy();
176
- }
113
+ class ApiGatewayManagementApiServiceException extends smithyClient.ServiceException {
114
+ constructor(options) {
115
+ super(options);
116
+ Object.setPrototypeOf(this, ApiGatewayManagementApiServiceException.prototype);
117
+ }
118
+ }
119
+
120
+ class ForbiddenException extends ApiGatewayManagementApiServiceException {
121
+ name = "ForbiddenException";
122
+ $fault = "client";
123
+ constructor(opts) {
124
+ super({
125
+ name: "ForbiddenException",
126
+ $fault: "client",
127
+ ...opts,
128
+ });
129
+ Object.setPrototypeOf(this, ForbiddenException.prototype);
130
+ }
131
+ }
132
+ class GoneException extends ApiGatewayManagementApiServiceException {
133
+ name = "GoneException";
134
+ $fault = "client";
135
+ constructor(opts) {
136
+ super({
137
+ name: "GoneException",
138
+ $fault: "client",
139
+ ...opts,
140
+ });
141
+ Object.setPrototypeOf(this, GoneException.prototype);
142
+ }
143
+ }
144
+ class LimitExceededException extends ApiGatewayManagementApiServiceException {
145
+ name = "LimitExceededException";
146
+ $fault = "client";
147
+ constructor(opts) {
148
+ super({
149
+ name: "LimitExceededException",
150
+ $fault: "client",
151
+ ...opts,
152
+ });
153
+ Object.setPrototypeOf(this, LimitExceededException.prototype);
154
+ }
155
+ }
156
+ class PayloadTooLargeException extends ApiGatewayManagementApiServiceException {
157
+ name = "PayloadTooLargeException";
158
+ $fault = "client";
159
+ Message;
160
+ constructor(opts) {
161
+ super({
162
+ name: "PayloadTooLargeException",
163
+ $fault: "client",
164
+ ...opts,
165
+ });
166
+ Object.setPrototypeOf(this, PayloadTooLargeException.prototype);
167
+ this.Message = opts.Message;
168
+ }
169
+ }
170
+
171
+ const se_DeleteConnectionCommand = async (input, context) => {
172
+ const b = core.requestBuilder(input, context);
173
+ const headers = {};
174
+ b.bp("/@connections/{ConnectionId}");
175
+ b.p("ConnectionId", () => input.ConnectionId, "{ConnectionId}", false);
176
+ let body;
177
+ b.m("DELETE").h(headers).b(body);
178
+ return b.build();
177
179
  };
178
-
179
- // src/ApiGatewayManagementApi.ts
180
-
181
-
182
- // src/commands/DeleteConnectionCommand.ts
183
-
184
- var import_middleware_serde = require("@smithy/middleware-serde");
185
-
186
-
187
- // src/protocols/Aws_restJson1.ts
188
- var import_core2 = require("@aws-sdk/core");
189
-
190
-
191
-
192
- // src/models/ApiGatewayManagementApiServiceException.ts
193
-
194
- var ApiGatewayManagementApiServiceException = class _ApiGatewayManagementApiServiceException extends import_smithy_client.ServiceException {
195
- static {
196
- __name(this, "ApiGatewayManagementApiServiceException");
197
- }
198
- /**
199
- * @internal
200
- */
201
- constructor(options) {
202
- super(options);
203
- Object.setPrototypeOf(this, _ApiGatewayManagementApiServiceException.prototype);
204
- }
180
+ const se_GetConnectionCommand = async (input, context) => {
181
+ const b = core.requestBuilder(input, context);
182
+ const headers = {};
183
+ b.bp("/@connections/{ConnectionId}");
184
+ b.p("ConnectionId", () => input.ConnectionId, "{ConnectionId}", false);
185
+ let body;
186
+ b.m("GET").h(headers).b(body);
187
+ return b.build();
205
188
  };
206
-
207
- // src/models/models_0.ts
208
- var ForbiddenException = class _ForbiddenException extends ApiGatewayManagementApiServiceException {
209
- static {
210
- __name(this, "ForbiddenException");
211
- }
212
- name = "ForbiddenException";
213
- $fault = "client";
214
- /**
215
- * @internal
216
- */
217
- constructor(opts) {
218
- super({
219
- name: "ForbiddenException",
220
- $fault: "client",
221
- ...opts
189
+ const se_PostToConnectionCommand = async (input, context) => {
190
+ const b = core.requestBuilder(input, context);
191
+ const headers = {
192
+ "content-type": "application/octet-stream",
193
+ };
194
+ b.bp("/@connections/{ConnectionId}");
195
+ b.p("ConnectionId", () => input.ConnectionId, "{ConnectionId}", false);
196
+ let body;
197
+ if (input.Data !== undefined) {
198
+ body = input.Data;
199
+ }
200
+ b.m("POST").h(headers).b(body);
201
+ return b.build();
202
+ };
203
+ const de_DeleteConnectionCommand = async (output, context) => {
204
+ if (output.statusCode !== 204 && output.statusCode >= 300) {
205
+ return de_CommandError(output, context);
206
+ }
207
+ const contents = smithyClient.map({
208
+ $metadata: deserializeMetadata(output),
222
209
  });
223
- Object.setPrototypeOf(this, _ForbiddenException.prototype);
224
- }
210
+ await smithyClient.collectBody(output.body, context);
211
+ return contents;
225
212
  };
226
- var GoneException = class _GoneException extends ApiGatewayManagementApiServiceException {
227
- static {
228
- __name(this, "GoneException");
229
- }
230
- name = "GoneException";
231
- $fault = "client";
232
- /**
233
- * @internal
234
- */
235
- constructor(opts) {
236
- super({
237
- name: "GoneException",
238
- $fault: "client",
239
- ...opts
213
+ const de_GetConnectionCommand = async (output, context) => {
214
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
215
+ return de_CommandError(output, context);
216
+ }
217
+ const contents = smithyClient.map({
218
+ $metadata: deserializeMetadata(output),
219
+ });
220
+ const data = smithyClient.expectNonNull(smithyClient.expectObject(await core$1.parseJsonBody(output.body, context)), "body");
221
+ const doc = smithyClient.take(data, {
222
+ ConnectedAt: [, (_) => smithyClient.expectNonNull(smithyClient.parseRfc3339DateTimeWithOffset(_)), `connectedAt`],
223
+ Identity: [, (_) => de_Identity(_), `identity`],
224
+ LastActiveAt: [, (_) => smithyClient.expectNonNull(smithyClient.parseRfc3339DateTimeWithOffset(_)), `lastActiveAt`],
240
225
  });
241
- Object.setPrototypeOf(this, _GoneException.prototype);
242
- }
226
+ Object.assign(contents, doc);
227
+ return contents;
243
228
  };
244
- var LimitExceededException = class _LimitExceededException extends ApiGatewayManagementApiServiceException {
245
- static {
246
- __name(this, "LimitExceededException");
247
- }
248
- name = "LimitExceededException";
249
- $fault = "client";
250
- /**
251
- * @internal
252
- */
253
- constructor(opts) {
254
- super({
255
- name: "LimitExceededException",
256
- $fault: "client",
257
- ...opts
229
+ const de_PostToConnectionCommand = async (output, context) => {
230
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
231
+ return de_CommandError(output, context);
232
+ }
233
+ const contents = smithyClient.map({
234
+ $metadata: deserializeMetadata(output),
258
235
  });
259
- Object.setPrototypeOf(this, _LimitExceededException.prototype);
260
- }
236
+ await smithyClient.collectBody(output.body, context);
237
+ return contents;
238
+ };
239
+ const de_CommandError = async (output, context) => {
240
+ const parsedOutput = {
241
+ ...output,
242
+ body: await core$1.parseJsonErrorBody(output.body, context),
243
+ };
244
+ const errorCode = core$1.loadRestJsonErrorCode(output, parsedOutput.body);
245
+ switch (errorCode) {
246
+ case "ForbiddenException":
247
+ case "com.amazonaws.apigatewaymanagementapi#ForbiddenException":
248
+ throw await de_ForbiddenExceptionRes(parsedOutput);
249
+ case "GoneException":
250
+ case "com.amazonaws.apigatewaymanagementapi#GoneException":
251
+ throw await de_GoneExceptionRes(parsedOutput);
252
+ case "LimitExceededException":
253
+ case "com.amazonaws.apigatewaymanagementapi#LimitExceededException":
254
+ throw await de_LimitExceededExceptionRes(parsedOutput);
255
+ case "PayloadTooLargeException":
256
+ case "com.amazonaws.apigatewaymanagementapi#PayloadTooLargeException":
257
+ throw await de_PayloadTooLargeExceptionRes(parsedOutput);
258
+ default:
259
+ const parsedBody = parsedOutput.body;
260
+ return throwDefaultError({
261
+ output,
262
+ parsedBody,
263
+ errorCode,
264
+ });
265
+ }
261
266
  };
262
- var PayloadTooLargeException = class _PayloadTooLargeException extends ApiGatewayManagementApiServiceException {
263
- static {
264
- __name(this, "PayloadTooLargeException");
265
- }
266
- name = "PayloadTooLargeException";
267
- $fault = "client";
268
- Message;
269
- /**
270
- * @internal
271
- */
272
- constructor(opts) {
273
- super({
274
- name: "PayloadTooLargeException",
275
- $fault: "client",
276
- ...opts
267
+ const throwDefaultError = smithyClient.withBaseException(ApiGatewayManagementApiServiceException);
268
+ const de_ForbiddenExceptionRes = async (parsedOutput, context) => {
269
+ const contents = smithyClient.map({});
270
+ const data = parsedOutput.body;
271
+ const doc = smithyClient.take(data, {});
272
+ Object.assign(contents, doc);
273
+ const exception = new ForbiddenException({
274
+ $metadata: deserializeMetadata(parsedOutput),
275
+ ...contents,
277
276
  });
278
- Object.setPrototypeOf(this, _PayloadTooLargeException.prototype);
279
- this.Message = opts.Message;
280
- }
277
+ return smithyClient.decorateServiceException(exception, parsedOutput.body);
281
278
  };
282
-
283
- // src/protocols/Aws_restJson1.ts
284
- var se_DeleteConnectionCommand = /* @__PURE__ */ __name(async (input, context) => {
285
- const b = (0, import_core.requestBuilder)(input, context);
286
- const headers = {};
287
- b.bp("/@connections/{ConnectionId}");
288
- b.p("ConnectionId", () => input.ConnectionId, "{ConnectionId}", false);
289
- let body;
290
- b.m("DELETE").h(headers).b(body);
291
- return b.build();
292
- }, "se_DeleteConnectionCommand");
293
- var se_GetConnectionCommand = /* @__PURE__ */ __name(async (input, context) => {
294
- const b = (0, import_core.requestBuilder)(input, context);
295
- const headers = {};
296
- b.bp("/@connections/{ConnectionId}");
297
- b.p("ConnectionId", () => input.ConnectionId, "{ConnectionId}", false);
298
- let body;
299
- b.m("GET").h(headers).b(body);
300
- return b.build();
301
- }, "se_GetConnectionCommand");
302
- var se_PostToConnectionCommand = /* @__PURE__ */ __name(async (input, context) => {
303
- const b = (0, import_core.requestBuilder)(input, context);
304
- const headers = {
305
- "content-type": "application/octet-stream"
306
- };
307
- b.bp("/@connections/{ConnectionId}");
308
- b.p("ConnectionId", () => input.ConnectionId, "{ConnectionId}", false);
309
- let body;
310
- if (input.Data !== void 0) {
311
- body = input.Data;
312
- }
313
- b.m("POST").h(headers).b(body);
314
- return b.build();
315
- }, "se_PostToConnectionCommand");
316
- var de_DeleteConnectionCommand = /* @__PURE__ */ __name(async (output, context) => {
317
- if (output.statusCode !== 204 && output.statusCode >= 300) {
318
- return de_CommandError(output, context);
319
- }
320
- const contents = (0, import_smithy_client.map)({
321
- $metadata: deserializeMetadata(output)
322
- });
323
- await (0, import_smithy_client.collectBody)(output.body, context);
324
- return contents;
325
- }, "de_DeleteConnectionCommand");
326
- var de_GetConnectionCommand = /* @__PURE__ */ __name(async (output, context) => {
327
- if (output.statusCode !== 200 && output.statusCode >= 300) {
328
- return de_CommandError(output, context);
329
- }
330
- const contents = (0, import_smithy_client.map)({
331
- $metadata: deserializeMetadata(output)
332
- });
333
- const data = (0, import_smithy_client.expectNonNull)((0, import_smithy_client.expectObject)(await (0, import_core2.parseJsonBody)(output.body, context)), "body");
334
- const doc = (0, import_smithy_client.take)(data, {
335
- ConnectedAt: [, (_) => (0, import_smithy_client.expectNonNull)((0, import_smithy_client.parseRfc3339DateTimeWithOffset)(_)), `connectedAt`],
336
- Identity: [, (_) => de_Identity(_, context), `identity`],
337
- LastActiveAt: [, (_) => (0, import_smithy_client.expectNonNull)((0, import_smithy_client.parseRfc3339DateTimeWithOffset)(_)), `lastActiveAt`]
338
- });
339
- Object.assign(contents, doc);
340
- return contents;
341
- }, "de_GetConnectionCommand");
342
- var de_PostToConnectionCommand = /* @__PURE__ */ __name(async (output, context) => {
343
- if (output.statusCode !== 200 && output.statusCode >= 300) {
344
- return de_CommandError(output, context);
345
- }
346
- const contents = (0, import_smithy_client.map)({
347
- $metadata: deserializeMetadata(output)
348
- });
349
- await (0, import_smithy_client.collectBody)(output.body, context);
350
- return contents;
351
- }, "de_PostToConnectionCommand");
352
- var de_CommandError = /* @__PURE__ */ __name(async (output, context) => {
353
- const parsedOutput = {
354
- ...output,
355
- body: await (0, import_core2.parseJsonErrorBody)(output.body, context)
356
- };
357
- const errorCode = (0, import_core2.loadRestJsonErrorCode)(output, parsedOutput.body);
358
- switch (errorCode) {
359
- case "ForbiddenException":
360
- case "com.amazonaws.apigatewaymanagementapi#ForbiddenException":
361
- throw await de_ForbiddenExceptionRes(parsedOutput, context);
362
- case "GoneException":
363
- case "com.amazonaws.apigatewaymanagementapi#GoneException":
364
- throw await de_GoneExceptionRes(parsedOutput, context);
365
- case "LimitExceededException":
366
- case "com.amazonaws.apigatewaymanagementapi#LimitExceededException":
367
- throw await de_LimitExceededExceptionRes(parsedOutput, context);
368
- case "PayloadTooLargeException":
369
- case "com.amazonaws.apigatewaymanagementapi#PayloadTooLargeException":
370
- throw await de_PayloadTooLargeExceptionRes(parsedOutput, context);
371
- default:
372
- const parsedBody = parsedOutput.body;
373
- return throwDefaultError({
374
- output,
375
- parsedBody,
376
- errorCode
377
- });
378
- }
379
- }, "de_CommandError");
380
- var throwDefaultError = (0, import_smithy_client.withBaseException)(ApiGatewayManagementApiServiceException);
381
- var de_ForbiddenExceptionRes = /* @__PURE__ */ __name(async (parsedOutput, context) => {
382
- const contents = (0, import_smithy_client.map)({});
383
- const data = parsedOutput.body;
384
- const doc = (0, import_smithy_client.take)(data, {});
385
- Object.assign(contents, doc);
386
- const exception = new ForbiddenException({
387
- $metadata: deserializeMetadata(parsedOutput),
388
- ...contents
389
- });
390
- return (0, import_smithy_client.decorateServiceException)(exception, parsedOutput.body);
391
- }, "de_ForbiddenExceptionRes");
392
- var de_GoneExceptionRes = /* @__PURE__ */ __name(async (parsedOutput, context) => {
393
- const contents = (0, import_smithy_client.map)({});
394
- const data = parsedOutput.body;
395
- const doc = (0, import_smithy_client.take)(data, {});
396
- Object.assign(contents, doc);
397
- const exception = new GoneException({
398
- $metadata: deserializeMetadata(parsedOutput),
399
- ...contents
400
- });
401
- return (0, import_smithy_client.decorateServiceException)(exception, parsedOutput.body);
402
- }, "de_GoneExceptionRes");
403
- var de_LimitExceededExceptionRes = /* @__PURE__ */ __name(async (parsedOutput, context) => {
404
- const contents = (0, import_smithy_client.map)({});
405
- const data = parsedOutput.body;
406
- const doc = (0, import_smithy_client.take)(data, {});
407
- Object.assign(contents, doc);
408
- const exception = new LimitExceededException({
409
- $metadata: deserializeMetadata(parsedOutput),
410
- ...contents
411
- });
412
- return (0, import_smithy_client.decorateServiceException)(exception, parsedOutput.body);
413
- }, "de_LimitExceededExceptionRes");
414
- var de_PayloadTooLargeExceptionRes = /* @__PURE__ */ __name(async (parsedOutput, context) => {
415
- const contents = (0, import_smithy_client.map)({});
416
- const data = parsedOutput.body;
417
- const doc = (0, import_smithy_client.take)(data, {
418
- Message: [, import_smithy_client.expectString, `message`]
419
- });
420
- Object.assign(contents, doc);
421
- const exception = new PayloadTooLargeException({
422
- $metadata: deserializeMetadata(parsedOutput),
423
- ...contents
424
- });
425
- return (0, import_smithy_client.decorateServiceException)(exception, parsedOutput.body);
426
- }, "de_PayloadTooLargeExceptionRes");
427
- var de_Identity = /* @__PURE__ */ __name((output, context) => {
428
- return (0, import_smithy_client.take)(output, {
429
- SourceIp: [, import_smithy_client.expectString, `sourceIp`],
430
- UserAgent: [, import_smithy_client.expectString, `userAgent`]
431
- });
432
- }, "de_Identity");
433
- var deserializeMetadata = /* @__PURE__ */ __name((output) => ({
434
- httpStatusCode: output.statusCode,
435
- requestId: output.headers["x-amzn-requestid"] ?? output.headers["x-amzn-request-id"] ?? output.headers["x-amz-request-id"],
436
- extendedRequestId: output.headers["x-amz-id-2"],
437
- cfId: output.headers["x-amz-cf-id"]
438
- }), "deserializeMetadata");
439
-
440
- // src/commands/DeleteConnectionCommand.ts
441
- var DeleteConnectionCommand = class extends import_smithy_client.Command.classBuilder().ep(commonParams).m(function(Command, cs, config, o) {
442
- return [
443
- (0, import_middleware_serde.getSerdePlugin)(config, this.serialize, this.deserialize),
444
- (0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions())
445
- ];
446
- }).s("ApiGatewayManagementApi", "DeleteConnection", {}).n("ApiGatewayManagementApiClient", "DeleteConnectionCommand").f(void 0, void 0).ser(se_DeleteConnectionCommand).de(de_DeleteConnectionCommand).build() {
447
- static {
448
- __name(this, "DeleteConnectionCommand");
449
- }
279
+ const de_GoneExceptionRes = async (parsedOutput, context) => {
280
+ const contents = smithyClient.map({});
281
+ const data = parsedOutput.body;
282
+ const doc = smithyClient.take(data, {});
283
+ Object.assign(contents, doc);
284
+ const exception = new GoneException({
285
+ $metadata: deserializeMetadata(parsedOutput),
286
+ ...contents,
287
+ });
288
+ return smithyClient.decorateServiceException(exception, parsedOutput.body);
450
289
  };
451
-
452
- // src/commands/GetConnectionCommand.ts
453
-
454
-
455
-
456
- var GetConnectionCommand = class extends import_smithy_client.Command.classBuilder().ep(commonParams).m(function(Command, cs, config, o) {
457
- return [
458
- (0, import_middleware_serde.getSerdePlugin)(config, this.serialize, this.deserialize),
459
- (0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions())
460
- ];
461
- }).s("ApiGatewayManagementApi", "GetConnection", {}).n("ApiGatewayManagementApiClient", "GetConnectionCommand").f(void 0, void 0).ser(se_GetConnectionCommand).de(de_GetConnectionCommand).build() {
462
- static {
463
- __name(this, "GetConnectionCommand");
464
- }
290
+ const de_LimitExceededExceptionRes = async (parsedOutput, context) => {
291
+ const contents = smithyClient.map({});
292
+ const data = parsedOutput.body;
293
+ const doc = smithyClient.take(data, {});
294
+ Object.assign(contents, doc);
295
+ const exception = new LimitExceededException({
296
+ $metadata: deserializeMetadata(parsedOutput),
297
+ ...contents,
298
+ });
299
+ return smithyClient.decorateServiceException(exception, parsedOutput.body);
465
300
  };
466
-
467
- // src/commands/PostToConnectionCommand.ts
468
-
469
-
470
-
471
- var PostToConnectionCommand = class extends import_smithy_client.Command.classBuilder().ep(commonParams).m(function(Command, cs, config, o) {
472
- return [
473
- (0, import_middleware_serde.getSerdePlugin)(config, this.serialize, this.deserialize),
474
- (0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions())
475
- ];
476
- }).s("ApiGatewayManagementApi", "PostToConnection", {}).n("ApiGatewayManagementApiClient", "PostToConnectionCommand").f(void 0, void 0).ser(se_PostToConnectionCommand).de(de_PostToConnectionCommand).build() {
477
- static {
478
- __name(this, "PostToConnectionCommand");
479
- }
301
+ const de_PayloadTooLargeExceptionRes = async (parsedOutput, context) => {
302
+ const contents = smithyClient.map({});
303
+ const data = parsedOutput.body;
304
+ const doc = smithyClient.take(data, {
305
+ Message: [, smithyClient.expectString, `message`],
306
+ });
307
+ Object.assign(contents, doc);
308
+ const exception = new PayloadTooLargeException({
309
+ $metadata: deserializeMetadata(parsedOutput),
310
+ ...contents,
311
+ });
312
+ return smithyClient.decorateServiceException(exception, parsedOutput.body);
480
313
  };
481
-
482
- // src/ApiGatewayManagementApi.ts
483
- var commands = {
484
- DeleteConnectionCommand,
485
- GetConnectionCommand,
486
- PostToConnectionCommand
314
+ const de_Identity = (output, context) => {
315
+ return smithyClient.take(output, {
316
+ SourceIp: [, smithyClient.expectString, `sourceIp`],
317
+ UserAgent: [, smithyClient.expectString, `userAgent`],
318
+ });
487
319
  };
488
- var ApiGatewayManagementApi = class extends ApiGatewayManagementApiClient {
489
- static {
490
- __name(this, "ApiGatewayManagementApi");
491
- }
320
+ const deserializeMetadata = (output) => ({
321
+ httpStatusCode: output.statusCode,
322
+ requestId: output.headers["x-amzn-requestid"] ?? output.headers["x-amzn-request-id"] ?? output.headers["x-amz-request-id"],
323
+ extendedRequestId: output.headers["x-amz-id-2"],
324
+ cfId: output.headers["x-amz-cf-id"],
325
+ });
326
+
327
+ class DeleteConnectionCommand extends smithyClient.Command
328
+ .classBuilder()
329
+ .ep(commonParams)
330
+ .m(function (Command, cs, config, o) {
331
+ return [
332
+ middlewareSerde.getSerdePlugin(config, this.serialize, this.deserialize),
333
+ middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions()),
334
+ ];
335
+ })
336
+ .s("ApiGatewayManagementApi", "DeleteConnection", {})
337
+ .n("ApiGatewayManagementApiClient", "DeleteConnectionCommand")
338
+ .f(void 0, void 0)
339
+ .ser(se_DeleteConnectionCommand)
340
+ .de(de_DeleteConnectionCommand)
341
+ .build() {
342
+ }
343
+
344
+ class GetConnectionCommand extends smithyClient.Command
345
+ .classBuilder()
346
+ .ep(commonParams)
347
+ .m(function (Command, cs, config, o) {
348
+ return [
349
+ middlewareSerde.getSerdePlugin(config, this.serialize, this.deserialize),
350
+ middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions()),
351
+ ];
352
+ })
353
+ .s("ApiGatewayManagementApi", "GetConnection", {})
354
+ .n("ApiGatewayManagementApiClient", "GetConnectionCommand")
355
+ .f(void 0, void 0)
356
+ .ser(se_GetConnectionCommand)
357
+ .de(de_GetConnectionCommand)
358
+ .build() {
359
+ }
360
+
361
+ class PostToConnectionCommand extends smithyClient.Command
362
+ .classBuilder()
363
+ .ep(commonParams)
364
+ .m(function (Command, cs, config, o) {
365
+ return [
366
+ middlewareSerde.getSerdePlugin(config, this.serialize, this.deserialize),
367
+ middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions()),
368
+ ];
369
+ })
370
+ .s("ApiGatewayManagementApi", "PostToConnection", {})
371
+ .n("ApiGatewayManagementApiClient", "PostToConnectionCommand")
372
+ .f(void 0, void 0)
373
+ .ser(se_PostToConnectionCommand)
374
+ .de(de_PostToConnectionCommand)
375
+ .build() {
376
+ }
377
+
378
+ const commands = {
379
+ DeleteConnectionCommand,
380
+ GetConnectionCommand,
381
+ PostToConnectionCommand,
492
382
  };
493
- (0, import_smithy_client.createAggregatedClient)(commands, ApiGatewayManagementApi);
494
- // Annotate the CommonJS export names for ESM import in node:
383
+ class ApiGatewayManagementApi extends ApiGatewayManagementApiClient {
384
+ }
385
+ smithyClient.createAggregatedClient(commands, ApiGatewayManagementApi);
495
386
 
496
- 0 && (module.exports = {
497
- ApiGatewayManagementApiServiceException,
498
- __Client,
499
- ApiGatewayManagementApiClient,
500
- ApiGatewayManagementApi,
501
- $Command,
502
- DeleteConnectionCommand,
503
- GetConnectionCommand,
504
- PostToConnectionCommand,
505
- ForbiddenException,
506
- GoneException,
507
- LimitExceededException,
508
- PayloadTooLargeException
387
+ Object.defineProperty(exports, "$Command", {
388
+ enumerable: true,
389
+ get: function () { return smithyClient.Command; }
509
390
  });
510
-
391
+ Object.defineProperty(exports, "__Client", {
392
+ enumerable: true,
393
+ get: function () { return smithyClient.Client; }
394
+ });
395
+ exports.ApiGatewayManagementApi = ApiGatewayManagementApi;
396
+ exports.ApiGatewayManagementApiClient = ApiGatewayManagementApiClient;
397
+ exports.ApiGatewayManagementApiServiceException = ApiGatewayManagementApiServiceException;
398
+ exports.DeleteConnectionCommand = DeleteConnectionCommand;
399
+ exports.ForbiddenException = ForbiddenException;
400
+ exports.GetConnectionCommand = GetConnectionCommand;
401
+ exports.GoneException = GoneException;
402
+ exports.LimitExceededException = LimitExceededException;
403
+ exports.PayloadTooLargeException = PayloadTooLargeException;
404
+ exports.PostToConnectionCommand = PostToConnectionCommand;
package/package.json CHANGED
@@ -1,7 +1,7 @@
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.901.0",
4
+ "version": "3.906.0",
5
5
  "scripts": {
6
6
  "build": "concurrently 'yarn:build:cjs' 'yarn:build:es' 'yarn:build:types'",
7
7
  "build:cjs": "node ../../scripts/compilation/inline client-apigatewaymanagementapi",
@@ -20,17 +20,17 @@
20
20
  "dependencies": {
21
21
  "@aws-crypto/sha256-browser": "5.2.0",
22
22
  "@aws-crypto/sha256-js": "5.2.0",
23
- "@aws-sdk/core": "3.901.0",
24
- "@aws-sdk/credential-provider-node": "3.901.0",
23
+ "@aws-sdk/core": "3.906.0",
24
+ "@aws-sdk/credential-provider-node": "3.906.0",
25
25
  "@aws-sdk/middleware-host-header": "3.901.0",
26
26
  "@aws-sdk/middleware-logger": "3.901.0",
27
27
  "@aws-sdk/middleware-recursion-detection": "3.901.0",
28
- "@aws-sdk/middleware-user-agent": "3.901.0",
28
+ "@aws-sdk/middleware-user-agent": "3.906.0",
29
29
  "@aws-sdk/region-config-resolver": "3.901.0",
30
30
  "@aws-sdk/types": "3.901.0",
31
31
  "@aws-sdk/util-endpoints": "3.901.0",
32
32
  "@aws-sdk/util-user-agent-browser": "3.901.0",
33
- "@aws-sdk/util-user-agent-node": "3.901.0",
33
+ "@aws-sdk/util-user-agent-node": "3.906.0",
34
34
  "@smithy/config-resolver": "^4.3.0",
35
35
  "@smithy/core": "^3.14.0",
36
36
  "@smithy/fetch-http-handler": "^5.3.0",