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