@aws-sdk/client-keyspacesstreams 3.893.0 → 3.894.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,392 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.de_ListStreamsCommand = exports.de_GetStreamCommand = exports.de_GetShardIteratorCommand = exports.de_GetRecordsCommand = exports.se_ListStreamsCommand = exports.se_GetStreamCommand = exports.se_GetShardIteratorCommand = exports.se_GetRecordsCommand = void 0;
4
- const core_1 = require("@aws-sdk/core");
5
- const protocol_http_1 = require("@smithy/protocol-http");
6
- const smithy_client_1 = require("@smithy/smithy-client");
7
- const KeyspacesStreamsServiceException_1 = require("../models/KeyspacesStreamsServiceException");
8
- const models_0_1 = require("../models/models_0");
9
- const se_GetRecordsCommand = async (input, context) => {
10
- const headers = sharedHeaders("GetRecords");
11
- let body;
12
- body = JSON.stringify((0, smithy_client_1._json)(input));
13
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
14
- };
15
- exports.se_GetRecordsCommand = se_GetRecordsCommand;
16
- const se_GetShardIteratorCommand = async (input, context) => {
17
- const headers = sharedHeaders("GetShardIterator");
18
- let body;
19
- body = JSON.stringify((0, smithy_client_1._json)(input));
20
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
21
- };
22
- exports.se_GetShardIteratorCommand = se_GetShardIteratorCommand;
23
- const se_GetStreamCommand = async (input, context) => {
24
- const headers = sharedHeaders("GetStream");
25
- let body;
26
- body = JSON.stringify((0, smithy_client_1._json)(input));
27
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
28
- };
29
- exports.se_GetStreamCommand = se_GetStreamCommand;
30
- const se_ListStreamsCommand = async (input, context) => {
31
- const headers = sharedHeaders("ListStreams");
32
- let body;
33
- body = JSON.stringify((0, smithy_client_1._json)(input));
34
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
35
- };
36
- exports.se_ListStreamsCommand = se_ListStreamsCommand;
37
- const de_GetRecordsCommand = async (output, context) => {
38
- if (output.statusCode >= 300) {
39
- return de_CommandError(output, context);
40
- }
41
- const data = await (0, core_1.parseJsonBody)(output.body, context);
42
- let contents = {};
43
- contents = de_GetRecordsOutput(data, context);
44
- const response = {
45
- $metadata: deserializeMetadata(output),
46
- ...contents,
47
- };
48
- return response;
49
- };
50
- exports.de_GetRecordsCommand = de_GetRecordsCommand;
51
- const de_GetShardIteratorCommand = async (output, context) => {
52
- if (output.statusCode >= 300) {
53
- return de_CommandError(output, context);
54
- }
55
- const data = await (0, core_1.parseJsonBody)(output.body, context);
56
- let contents = {};
57
- contents = (0, smithy_client_1._json)(data);
58
- const response = {
59
- $metadata: deserializeMetadata(output),
60
- ...contents,
61
- };
62
- return response;
63
- };
64
- exports.de_GetShardIteratorCommand = de_GetShardIteratorCommand;
65
- const de_GetStreamCommand = async (output, context) => {
66
- if (output.statusCode >= 300) {
67
- return de_CommandError(output, context);
68
- }
69
- const data = await (0, core_1.parseJsonBody)(output.body, context);
70
- let contents = {};
71
- contents = de_GetStreamOutput(data, context);
72
- const response = {
73
- $metadata: deserializeMetadata(output),
74
- ...contents,
75
- };
76
- return response;
77
- };
78
- exports.de_GetStreamCommand = de_GetStreamCommand;
79
- const de_ListStreamsCommand = async (output, context) => {
80
- if (output.statusCode >= 300) {
81
- return de_CommandError(output, context);
82
- }
83
- const data = await (0, core_1.parseJsonBody)(output.body, context);
84
- let contents = {};
85
- contents = (0, smithy_client_1._json)(data);
86
- const response = {
87
- $metadata: deserializeMetadata(output),
88
- ...contents,
89
- };
90
- return response;
91
- };
92
- exports.de_ListStreamsCommand = de_ListStreamsCommand;
93
- const de_CommandError = async (output, context) => {
94
- const parsedOutput = {
95
- ...output,
96
- body: await (0, core_1.parseJsonErrorBody)(output.body, context),
97
- };
98
- const errorCode = (0, core_1.loadRestJsonErrorCode)(output, parsedOutput.body);
99
- switch (errorCode) {
100
- case "AccessDeniedException":
101
- case "com.amazonaws.keyspacesstreams#AccessDeniedException":
102
- throw await de_AccessDeniedExceptionRes(parsedOutput, context);
103
- case "InternalServerException":
104
- case "com.amazonaws.keyspacesstreams#InternalServerException":
105
- throw await de_InternalServerExceptionRes(parsedOutput, context);
106
- case "ResourceNotFoundException":
107
- case "com.amazonaws.keyspacesstreams#ResourceNotFoundException":
108
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
109
- case "ThrottlingException":
110
- case "com.amazonaws.keyspacesstreams#ThrottlingException":
111
- throw await de_ThrottlingExceptionRes(parsedOutput, context);
112
- case "ValidationException":
113
- case "com.amazonaws.keyspacesstreams#ValidationException":
114
- throw await de_ValidationExceptionRes(parsedOutput, context);
115
- default:
116
- const parsedBody = parsedOutput.body;
117
- return throwDefaultError({
118
- output,
119
- parsedBody,
120
- errorCode,
121
- });
122
- }
123
- };
124
- const de_AccessDeniedExceptionRes = async (parsedOutput, context) => {
125
- const body = parsedOutput.body;
126
- const deserialized = (0, smithy_client_1._json)(body);
127
- const exception = new models_0_1.AccessDeniedException({
128
- $metadata: deserializeMetadata(parsedOutput),
129
- ...deserialized,
130
- });
131
- return (0, smithy_client_1.decorateServiceException)(exception, body);
132
- };
133
- const de_InternalServerExceptionRes = async (parsedOutput, context) => {
134
- const body = parsedOutput.body;
135
- const deserialized = (0, smithy_client_1._json)(body);
136
- const exception = new models_0_1.InternalServerException({
137
- $metadata: deserializeMetadata(parsedOutput),
138
- ...deserialized,
139
- });
140
- return (0, smithy_client_1.decorateServiceException)(exception, body);
141
- };
142
- const de_ResourceNotFoundExceptionRes = async (parsedOutput, context) => {
143
- const body = parsedOutput.body;
144
- const deserialized = (0, smithy_client_1._json)(body);
145
- const exception = new models_0_1.ResourceNotFoundException({
146
- $metadata: deserializeMetadata(parsedOutput),
147
- ...deserialized,
148
- });
149
- return (0, smithy_client_1.decorateServiceException)(exception, body);
150
- };
151
- const de_ThrottlingExceptionRes = async (parsedOutput, context) => {
152
- const body = parsedOutput.body;
153
- const deserialized = (0, smithy_client_1._json)(body);
154
- const exception = new models_0_1.ThrottlingException({
155
- $metadata: deserializeMetadata(parsedOutput),
156
- ...deserialized,
157
- });
158
- return (0, smithy_client_1.decorateServiceException)(exception, body);
159
- };
160
- const de_ValidationExceptionRes = async (parsedOutput, context) => {
161
- const body = parsedOutput.body;
162
- const deserialized = (0, smithy_client_1._json)(body);
163
- const exception = new models_0_1.ValidationException({
164
- $metadata: deserializeMetadata(parsedOutput),
165
- ...deserialized,
166
- });
167
- return (0, smithy_client_1.decorateServiceException)(exception, body);
168
- };
169
- const de_GetRecordsOutput = (output, context) => {
170
- return (0, smithy_client_1.take)(output, {
171
- changeRecords: (_) => de_RecordList(_, context),
172
- nextShardIterator: smithy_client_1.expectString,
173
- });
174
- };
175
- const de_GetStreamOutput = (output, context) => {
176
- return (0, smithy_client_1.take)(output, {
177
- creationRequestDateTime: (_) => (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(_))),
178
- keyspaceName: smithy_client_1.expectString,
179
- nextToken: smithy_client_1.expectString,
180
- shards: smithy_client_1._json,
181
- streamArn: smithy_client_1.expectString,
182
- streamLabel: smithy_client_1.expectString,
183
- streamStatus: smithy_client_1.expectString,
184
- streamViewType: smithy_client_1.expectString,
185
- tableName: smithy_client_1.expectString,
186
- });
187
- };
188
- const de_KeyspacesCell = (output, context) => {
189
- return (0, smithy_client_1.take)(output, {
190
- metadata: smithy_client_1._json,
191
- value: (_) => de_KeyspacesCellValue((0, core_1.awsExpectUnion)(_), context),
192
- });
193
- };
194
- const de_KeyspacesCellList = (output, context) => {
195
- const retVal = (output || [])
196
- .filter((e) => e != null)
197
- .map((entry) => {
198
- return de_KeyspacesCell(entry, context);
199
- });
200
- return retVal;
201
- };
202
- const de_KeyspacesCellMap = (output, context) => {
203
- const retVal = (output || [])
204
- .filter((e) => e != null)
205
- .map((entry) => {
206
- return de_KeyspacesCellMapDefinition(entry, context);
207
- });
208
- return retVal;
209
- };
210
- const de_KeyspacesCellMapDefinition = (output, context) => {
211
- return (0, smithy_client_1.take)(output, {
212
- key: (_) => de_KeyspacesCellValue((0, core_1.awsExpectUnion)(_), context),
213
- metadata: smithy_client_1._json,
214
- value: (_) => de_KeyspacesCellValue((0, core_1.awsExpectUnion)(_), context),
215
- });
216
- };
217
- const de_KeyspacesCells = (output, context) => {
218
- return Object.entries(output).reduce((acc, [key, value]) => {
219
- if (value === null) {
220
- return acc;
221
- }
222
- acc[key] = de_KeyspacesCell(value, context);
223
- return acc;
224
- }, {});
225
- };
226
- const de_KeyspacesCellValue = (output, context) => {
227
- if ((0, smithy_client_1.expectString)(output.asciiT) !== undefined) {
228
- return { asciiT: (0, smithy_client_1.expectString)(output.asciiT) };
229
- }
230
- if ((0, smithy_client_1.expectString)(output.bigintT) !== undefined) {
231
- return { bigintT: (0, smithy_client_1.expectString)(output.bigintT) };
232
- }
233
- if (output.blobT != null) {
234
- return {
235
- blobT: context.base64Decoder(output.blobT),
236
- };
237
- }
238
- if ((0, smithy_client_1.expectBoolean)(output.boolT) !== undefined) {
239
- return { boolT: (0, smithy_client_1.expectBoolean)(output.boolT) };
240
- }
241
- if ((0, smithy_client_1.expectString)(output.counterT) !== undefined) {
242
- return { counterT: (0, smithy_client_1.expectString)(output.counterT) };
243
- }
244
- if ((0, smithy_client_1.expectString)(output.dateT) !== undefined) {
245
- return { dateT: (0, smithy_client_1.expectString)(output.dateT) };
246
- }
247
- if ((0, smithy_client_1.expectString)(output.decimalT) !== undefined) {
248
- return { decimalT: (0, smithy_client_1.expectString)(output.decimalT) };
249
- }
250
- if ((0, smithy_client_1.expectString)(output.doubleT) !== undefined) {
251
- return { doubleT: (0, smithy_client_1.expectString)(output.doubleT) };
252
- }
253
- if ((0, smithy_client_1.expectString)(output.floatT) !== undefined) {
254
- return { floatT: (0, smithy_client_1.expectString)(output.floatT) };
255
- }
256
- if ((0, smithy_client_1.expectString)(output.inetT) !== undefined) {
257
- return { inetT: (0, smithy_client_1.expectString)(output.inetT) };
258
- }
259
- if ((0, smithy_client_1.expectString)(output.intT) !== undefined) {
260
- return { intT: (0, smithy_client_1.expectString)(output.intT) };
261
- }
262
- if (output.listT != null) {
263
- return {
264
- listT: de_KeyspacesCellList(output.listT, context),
265
- };
266
- }
267
- if (output.mapT != null) {
268
- return {
269
- mapT: de_KeyspacesCellMap(output.mapT, context),
270
- };
271
- }
272
- if (output.setT != null) {
273
- return {
274
- setT: de_KeyspacesCellList(output.setT, context),
275
- };
276
- }
277
- if ((0, smithy_client_1.expectString)(output.smallintT) !== undefined) {
278
- return { smallintT: (0, smithy_client_1.expectString)(output.smallintT) };
279
- }
280
- if ((0, smithy_client_1.expectString)(output.textT) !== undefined) {
281
- return { textT: (0, smithy_client_1.expectString)(output.textT) };
282
- }
283
- if ((0, smithy_client_1.expectString)(output.timeT) !== undefined) {
284
- return { timeT: (0, smithy_client_1.expectString)(output.timeT) };
285
- }
286
- if ((0, smithy_client_1.expectString)(output.timestampT) !== undefined) {
287
- return { timestampT: (0, smithy_client_1.expectString)(output.timestampT) };
288
- }
289
- if ((0, smithy_client_1.expectString)(output.timeuuidT) !== undefined) {
290
- return { timeuuidT: (0, smithy_client_1.expectString)(output.timeuuidT) };
291
- }
292
- if ((0, smithy_client_1.expectString)(output.tinyintT) !== undefined) {
293
- return { tinyintT: (0, smithy_client_1.expectString)(output.tinyintT) };
294
- }
295
- if (output.tupleT != null) {
296
- return {
297
- tupleT: de_KeyspacesCellList(output.tupleT, context),
298
- };
299
- }
300
- if (output.udtT != null) {
301
- return {
302
- udtT: de_KeyspacesUdtMap(output.udtT, context),
303
- };
304
- }
305
- if ((0, smithy_client_1.expectString)(output.uuidT) !== undefined) {
306
- return { uuidT: (0, smithy_client_1.expectString)(output.uuidT) };
307
- }
308
- if ((0, smithy_client_1.expectString)(output.varcharT) !== undefined) {
309
- return { varcharT: (0, smithy_client_1.expectString)(output.varcharT) };
310
- }
311
- if ((0, smithy_client_1.expectString)(output.varintT) !== undefined) {
312
- return { varintT: (0, smithy_client_1.expectString)(output.varintT) };
313
- }
314
- return { $unknown: Object.entries(output)[0] };
315
- };
316
- const de_KeyspacesKeysMap = (output, context) => {
317
- return Object.entries(output).reduce((acc, [key, value]) => {
318
- if (value === null) {
319
- return acc;
320
- }
321
- acc[key] = de_KeyspacesCellValue((0, core_1.awsExpectUnion)(value), context);
322
- return acc;
323
- }, {});
324
- };
325
- const de_KeyspacesRow = (output, context) => {
326
- return (0, smithy_client_1.take)(output, {
327
- rowMetadata: smithy_client_1._json,
328
- staticCells: (_) => de_KeyspacesCells(_, context),
329
- valueCells: (_) => de_KeyspacesCells(_, context),
330
- });
331
- };
332
- const de_KeyspacesUdtMap = (output, context) => {
333
- return Object.entries(output).reduce((acc, [key, value]) => {
334
- if (value === null) {
335
- return acc;
336
- }
337
- acc[key] = de_KeyspacesCell(value, context);
338
- return acc;
339
- }, {});
340
- };
341
- const de__Record = (output, context) => {
342
- return (0, smithy_client_1.take)(output, {
343
- clusteringKeys: (_) => de_KeyspacesKeysMap(_, context),
344
- createdAt: (_) => (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(_))),
345
- eventVersion: smithy_client_1.expectString,
346
- newImage: (_) => de_KeyspacesRow(_, context),
347
- oldImage: (_) => de_KeyspacesRow(_, context),
348
- origin: smithy_client_1.expectString,
349
- partitionKeys: (_) => de_KeyspacesKeysMap(_, context),
350
- sequenceNumber: smithy_client_1.expectString,
351
- });
352
- };
353
- const de_RecordList = (output, context) => {
354
- const retVal = (output || [])
355
- .filter((e) => e != null)
356
- .map((entry) => {
357
- return de__Record(entry, context);
358
- });
359
- return retVal;
360
- };
361
- const deserializeMetadata = (output) => ({
362
- httpStatusCode: output.statusCode,
363
- requestId: output.headers["x-amzn-requestid"] ?? output.headers["x-amzn-request-id"] ?? output.headers["x-amz-request-id"],
364
- extendedRequestId: output.headers["x-amz-id-2"],
365
- cfId: output.headers["x-amz-cf-id"],
366
- });
367
- const collectBodyString = (streamBody, context) => (0, smithy_client_1.collectBody)(streamBody, context).then((body) => context.utf8Encoder(body));
368
- const throwDefaultError = (0, smithy_client_1.withBaseException)(KeyspacesStreamsServiceException_1.KeyspacesStreamsServiceException);
369
- const buildHttpRpcRequest = async (context, headers, path, resolvedHostname, body) => {
370
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
371
- const contents = {
372
- protocol,
373
- hostname,
374
- port,
375
- method: "POST",
376
- path: basePath.endsWith("/") ? basePath.slice(0, -1) + path : basePath + path,
377
- headers,
378
- };
379
- if (resolvedHostname !== undefined) {
380
- contents.hostname = resolvedHostname;
381
- }
382
- if (body !== undefined) {
383
- contents.body = body;
384
- }
385
- return new protocol_http_1.HttpRequest(contents);
386
- };
387
- function sharedHeaders(operation) {
388
- return {
389
- "content-type": "application/x-amz-json-1.0",
390
- "x-amz-target": `KeyspacesStreams.${operation}`,
391
- };
392
- }
@@ -1,13 +0,0 @@
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 httpAuthExtensionConfiguration_1 = require("./auth/httpAuthExtensionConfiguration");
8
- const resolveRuntimeExtensions = (runtimeConfig, extensions) => {
9
- const extensionConfiguration = Object.assign((0, region_config_resolver_1.getAwsRegionExtensionConfiguration)(runtimeConfig), (0, smithy_client_1.getDefaultExtensionConfiguration)(runtimeConfig), (0, protocol_http_1.getHttpHandlerExtensionConfiguration)(runtimeConfig), (0, httpAuthExtensionConfiguration_1.getHttpAuthExtensionConfiguration)(runtimeConfig));
10
- extensions.forEach((extension) => extension.configure(extensionConfiguration));
11
- return Object.assign(runtimeConfig, (0, region_config_resolver_1.resolveAwsRegionExtensionConfiguration)(extensionConfiguration), (0, smithy_client_1.resolveDefaultRuntimeConfig)(extensionConfiguration), (0, protocol_http_1.resolveHttpHandlerRuntimeConfig)(extensionConfiguration), (0, httpAuthExtensionConfiguration_1.resolveHttpAuthRuntimeConfig)(extensionConfiguration));
12
- };
13
- exports.resolveRuntimeExtensions = resolveRuntimeExtensions;