@aws-sdk/client-keyspacesstreams 3.838.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +201 -0
- package/README.md +237 -0
- package/dist-cjs/KeyspacesStreams.js +19 -0
- package/dist-cjs/KeyspacesStreamsClient.js +52 -0
- package/dist-cjs/auth/httpAuthExtensionConfiguration.js +43 -0
- package/dist-cjs/auth/httpAuthSchemeProvider.js +47 -0
- package/dist-cjs/commands/GetRecordsCommand.js +26 -0
- package/dist-cjs/commands/GetShardIteratorCommand.js +26 -0
- package/dist-cjs/commands/GetStreamCommand.js +26 -0
- package/dist-cjs/commands/ListStreamsCommand.js +26 -0
- package/dist-cjs/commands/index.js +7 -0
- package/dist-cjs/endpoint/EndpointParameters.js +15 -0
- package/dist-cjs/endpoint/endpointResolver.js +18 -0
- package/dist-cjs/endpoint/ruleset.js +7 -0
- package/dist-cjs/extensionConfiguration.js +2 -0
- package/dist-cjs/index.js +11 -0
- package/dist-cjs/models/KeyspacesStreamsServiceException.js +12 -0
- package/dist-cjs/models/index.js +4 -0
- package/dist-cjs/models/models_0.js +159 -0
- package/dist-cjs/pagination/GetStreamPaginator.js +7 -0
- package/dist-cjs/pagination/Interfaces.js +2 -0
- package/dist-cjs/pagination/ListStreamsPaginator.js +7 -0
- package/dist-cjs/pagination/index.js +6 -0
- package/dist-cjs/protocols/Aws_json1_0.js +392 -0
- package/dist-cjs/runtimeConfig.browser.js +39 -0
- package/dist-cjs/runtimeConfig.js +56 -0
- package/dist-cjs/runtimeConfig.native.js +15 -0
- package/dist-cjs/runtimeConfig.shared.js +34 -0
- package/dist-cjs/runtimeExtensions.js +13 -0
- package/dist-es/KeyspacesStreams.js +15 -0
- package/dist-es/KeyspacesStreamsClient.js +48 -0
- package/dist-es/auth/httpAuthExtensionConfiguration.js +38 -0
- package/dist-es/auth/httpAuthSchemeProvider.js +41 -0
- package/dist-es/commands/GetRecordsCommand.js +22 -0
- package/dist-es/commands/GetShardIteratorCommand.js +22 -0
- package/dist-es/commands/GetStreamCommand.js +22 -0
- package/dist-es/commands/ListStreamsCommand.js +22 -0
- package/dist-es/commands/index.js +4 -0
- package/dist-es/endpoint/EndpointParameters.js +11 -0
- package/dist-es/endpoint/endpointResolver.js +14 -0
- package/dist-es/endpoint/ruleset.js +4 -0
- package/dist-es/extensionConfiguration.js +1 -0
- package/dist-es/index.js +6 -0
- package/dist-es/models/KeyspacesStreamsServiceException.js +8 -0
- package/dist-es/models/index.js +1 -0
- package/dist-es/models/models_0.js +151 -0
- package/dist-es/pagination/GetStreamPaginator.js +4 -0
- package/dist-es/pagination/Interfaces.js +1 -0
- package/dist-es/pagination/ListStreamsPaginator.js +4 -0
- package/dist-es/pagination/index.js +3 -0
- package/dist-es/protocols/Aws_json1_0.js +381 -0
- package/dist-es/runtimeConfig.browser.js +34 -0
- package/dist-es/runtimeConfig.js +51 -0
- package/dist-es/runtimeConfig.native.js +11 -0
- package/dist-es/runtimeConfig.shared.js +30 -0
- package/dist-es/runtimeExtensions.js +9 -0
- package/dist-types/KeyspacesStreams.d.ts +39 -0
- package/dist-types/KeyspacesStreamsClient.d.ts +191 -0
- package/dist-types/auth/httpAuthExtensionConfiguration.d.ts +29 -0
- package/dist-types/auth/httpAuthSchemeProvider.d.ts +75 -0
- package/dist-types/commands/GetRecordsCommand.d.ts +228 -0
- package/dist-types/commands/GetShardIteratorCommand.d.ts +90 -0
- package/dist-types/commands/GetStreamCommand.d.ts +112 -0
- package/dist-types/commands/ListStreamsCommand.d.ts +98 -0
- package/dist-types/commands/index.d.ts +4 -0
- package/dist-types/endpoint/EndpointParameters.d.ts +32 -0
- package/dist-types/endpoint/endpointResolver.d.ts +5 -0
- package/dist-types/endpoint/ruleset.d.ts +2 -0
- package/dist-types/extensionConfiguration.d.ts +9 -0
- package/dist-types/index.d.ts +14 -0
- package/dist-types/models/KeyspacesStreamsServiceException.d.ts +14 -0
- package/dist-types/models/index.d.ts +1 -0
- package/dist-types/models/models_0.d.ts +1396 -0
- package/dist-types/pagination/GetStreamPaginator.d.ts +7 -0
- package/dist-types/pagination/Interfaces.d.ts +8 -0
- package/dist-types/pagination/ListStreamsPaginator.d.ts +7 -0
- package/dist-types/pagination/index.d.ts +3 -0
- package/dist-types/protocols/Aws_json1_0.d.ts +38 -0
- package/dist-types/runtimeConfig.browser.d.ts +50 -0
- package/dist-types/runtimeConfig.d.ts +50 -0
- package/dist-types/runtimeConfig.native.d.ts +49 -0
- package/dist-types/runtimeConfig.shared.d.ts +21 -0
- package/dist-types/runtimeExtensions.d.ts +17 -0
- package/dist-types/ts3.4/KeyspacesStreams.d.ts +76 -0
- package/dist-types/ts3.4/KeyspacesStreamsClient.d.ts +146 -0
- package/dist-types/ts3.4/auth/httpAuthExtensionConfiguration.d.ts +32 -0
- package/dist-types/ts3.4/auth/httpAuthSchemeProvider.d.ts +47 -0
- package/dist-types/ts3.4/commands/GetRecordsCommand.d.ts +47 -0
- package/dist-types/ts3.4/commands/GetShardIteratorCommand.d.ts +50 -0
- package/dist-types/ts3.4/commands/GetStreamCommand.d.ts +47 -0
- package/dist-types/ts3.4/commands/ListStreamsCommand.d.ts +47 -0
- package/dist-types/ts3.4/commands/index.d.ts +4 -0
- package/dist-types/ts3.4/endpoint/EndpointParameters.d.ts +45 -0
- package/dist-types/ts3.4/endpoint/endpointResolver.d.ts +8 -0
- package/dist-types/ts3.4/endpoint/ruleset.d.ts +2 -0
- package/dist-types/ts3.4/extensionConfiguration.d.ts +9 -0
- package/dist-types/ts3.4/index.d.ts +9 -0
- package/dist-types/ts3.4/models/KeyspacesStreamsServiceException.d.ts +9 -0
- package/dist-types/ts3.4/models/index.d.ts +1 -0
- package/dist-types/ts3.4/models/models_0.d.ts +957 -0
- package/dist-types/ts3.4/pagination/GetStreamPaginator.d.ts +11 -0
- package/dist-types/ts3.4/pagination/Interfaces.d.ts +6 -0
- package/dist-types/ts3.4/pagination/ListStreamsPaginator.d.ts +11 -0
- package/dist-types/ts3.4/pagination/index.d.ts +3 -0
- package/dist-types/ts3.4/protocols/Aws_json1_0.d.ts +53 -0
- package/dist-types/ts3.4/runtimeConfig.browser.d.ts +93 -0
- package/dist-types/ts3.4/runtimeConfig.d.ts +91 -0
- package/dist-types/ts3.4/runtimeConfig.native.d.ts +97 -0
- package/dist-types/ts3.4/runtimeConfig.shared.d.ts +23 -0
- package/dist-types/ts3.4/runtimeExtensions.d.ts +13 -0
- package/package.json +99 -0
|
@@ -0,0 +1,381 @@
|
|
|
1
|
+
import { awsExpectUnion as __expectUnion, loadRestJsonErrorCode, parseJsonBody as parseBody, parseJsonErrorBody as parseErrorBody, } from "@aws-sdk/core";
|
|
2
|
+
import { HttpRequest as __HttpRequest } from "@smithy/protocol-http";
|
|
3
|
+
import { _json, collectBody, decorateServiceException as __decorateServiceException, expectBoolean as __expectBoolean, expectNonNull as __expectNonNull, expectNumber as __expectNumber, expectString as __expectString, parseEpochTimestamp as __parseEpochTimestamp, take, withBaseException, } from "@smithy/smithy-client";
|
|
4
|
+
import { KeyspacesStreamsServiceException as __BaseException } from "../models/KeyspacesStreamsServiceException";
|
|
5
|
+
import { AccessDeniedException, InternalServerException, ResourceNotFoundException, ThrottlingException, ValidationException, } from "../models/models_0";
|
|
6
|
+
export const se_GetRecordsCommand = async (input, context) => {
|
|
7
|
+
const headers = sharedHeaders("GetRecords");
|
|
8
|
+
let body;
|
|
9
|
+
body = JSON.stringify(_json(input));
|
|
10
|
+
return buildHttpRpcRequest(context, headers, "/", undefined, body);
|
|
11
|
+
};
|
|
12
|
+
export const se_GetShardIteratorCommand = async (input, context) => {
|
|
13
|
+
const headers = sharedHeaders("GetShardIterator");
|
|
14
|
+
let body;
|
|
15
|
+
body = JSON.stringify(_json(input));
|
|
16
|
+
return buildHttpRpcRequest(context, headers, "/", undefined, body);
|
|
17
|
+
};
|
|
18
|
+
export const se_GetStreamCommand = async (input, context) => {
|
|
19
|
+
const headers = sharedHeaders("GetStream");
|
|
20
|
+
let body;
|
|
21
|
+
body = JSON.stringify(_json(input));
|
|
22
|
+
return buildHttpRpcRequest(context, headers, "/", undefined, body);
|
|
23
|
+
};
|
|
24
|
+
export const se_ListStreamsCommand = async (input, context) => {
|
|
25
|
+
const headers = sharedHeaders("ListStreams");
|
|
26
|
+
let body;
|
|
27
|
+
body = JSON.stringify(_json(input));
|
|
28
|
+
return buildHttpRpcRequest(context, headers, "/", undefined, body);
|
|
29
|
+
};
|
|
30
|
+
export const de_GetRecordsCommand = async (output, context) => {
|
|
31
|
+
if (output.statusCode >= 300) {
|
|
32
|
+
return de_CommandError(output, context);
|
|
33
|
+
}
|
|
34
|
+
const data = await parseBody(output.body, context);
|
|
35
|
+
let contents = {};
|
|
36
|
+
contents = de_GetRecordsOutput(data, context);
|
|
37
|
+
const response = {
|
|
38
|
+
$metadata: deserializeMetadata(output),
|
|
39
|
+
...contents,
|
|
40
|
+
};
|
|
41
|
+
return response;
|
|
42
|
+
};
|
|
43
|
+
export const de_GetShardIteratorCommand = async (output, context) => {
|
|
44
|
+
if (output.statusCode >= 300) {
|
|
45
|
+
return de_CommandError(output, context);
|
|
46
|
+
}
|
|
47
|
+
const data = await parseBody(output.body, context);
|
|
48
|
+
let contents = {};
|
|
49
|
+
contents = _json(data);
|
|
50
|
+
const response = {
|
|
51
|
+
$metadata: deserializeMetadata(output),
|
|
52
|
+
...contents,
|
|
53
|
+
};
|
|
54
|
+
return response;
|
|
55
|
+
};
|
|
56
|
+
export const de_GetStreamCommand = async (output, context) => {
|
|
57
|
+
if (output.statusCode >= 300) {
|
|
58
|
+
return de_CommandError(output, context);
|
|
59
|
+
}
|
|
60
|
+
const data = await parseBody(output.body, context);
|
|
61
|
+
let contents = {};
|
|
62
|
+
contents = de_GetStreamOutput(data, context);
|
|
63
|
+
const response = {
|
|
64
|
+
$metadata: deserializeMetadata(output),
|
|
65
|
+
...contents,
|
|
66
|
+
};
|
|
67
|
+
return response;
|
|
68
|
+
};
|
|
69
|
+
export const de_ListStreamsCommand = async (output, context) => {
|
|
70
|
+
if (output.statusCode >= 300) {
|
|
71
|
+
return de_CommandError(output, context);
|
|
72
|
+
}
|
|
73
|
+
const data = await parseBody(output.body, context);
|
|
74
|
+
let contents = {};
|
|
75
|
+
contents = _json(data);
|
|
76
|
+
const response = {
|
|
77
|
+
$metadata: deserializeMetadata(output),
|
|
78
|
+
...contents,
|
|
79
|
+
};
|
|
80
|
+
return response;
|
|
81
|
+
};
|
|
82
|
+
const de_CommandError = async (output, context) => {
|
|
83
|
+
const parsedOutput = {
|
|
84
|
+
...output,
|
|
85
|
+
body: await parseErrorBody(output.body, context),
|
|
86
|
+
};
|
|
87
|
+
const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
88
|
+
switch (errorCode) {
|
|
89
|
+
case "AccessDeniedException":
|
|
90
|
+
case "com.amazonaws.keyspacesstreams#AccessDeniedException":
|
|
91
|
+
throw await de_AccessDeniedExceptionRes(parsedOutput, context);
|
|
92
|
+
case "InternalServerException":
|
|
93
|
+
case "com.amazonaws.keyspacesstreams#InternalServerException":
|
|
94
|
+
throw await de_InternalServerExceptionRes(parsedOutput, context);
|
|
95
|
+
case "ResourceNotFoundException":
|
|
96
|
+
case "com.amazonaws.keyspacesstreams#ResourceNotFoundException":
|
|
97
|
+
throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
|
|
98
|
+
case "ThrottlingException":
|
|
99
|
+
case "com.amazonaws.keyspacesstreams#ThrottlingException":
|
|
100
|
+
throw await de_ThrottlingExceptionRes(parsedOutput, context);
|
|
101
|
+
case "ValidationException":
|
|
102
|
+
case "com.amazonaws.keyspacesstreams#ValidationException":
|
|
103
|
+
throw await de_ValidationExceptionRes(parsedOutput, context);
|
|
104
|
+
default:
|
|
105
|
+
const parsedBody = parsedOutput.body;
|
|
106
|
+
return throwDefaultError({
|
|
107
|
+
output,
|
|
108
|
+
parsedBody,
|
|
109
|
+
errorCode,
|
|
110
|
+
});
|
|
111
|
+
}
|
|
112
|
+
};
|
|
113
|
+
const de_AccessDeniedExceptionRes = async (parsedOutput, context) => {
|
|
114
|
+
const body = parsedOutput.body;
|
|
115
|
+
const deserialized = _json(body);
|
|
116
|
+
const exception = new AccessDeniedException({
|
|
117
|
+
$metadata: deserializeMetadata(parsedOutput),
|
|
118
|
+
...deserialized,
|
|
119
|
+
});
|
|
120
|
+
return __decorateServiceException(exception, body);
|
|
121
|
+
};
|
|
122
|
+
const de_InternalServerExceptionRes = async (parsedOutput, context) => {
|
|
123
|
+
const body = parsedOutput.body;
|
|
124
|
+
const deserialized = _json(body);
|
|
125
|
+
const exception = new InternalServerException({
|
|
126
|
+
$metadata: deserializeMetadata(parsedOutput),
|
|
127
|
+
...deserialized,
|
|
128
|
+
});
|
|
129
|
+
return __decorateServiceException(exception, body);
|
|
130
|
+
};
|
|
131
|
+
const de_ResourceNotFoundExceptionRes = async (parsedOutput, context) => {
|
|
132
|
+
const body = parsedOutput.body;
|
|
133
|
+
const deserialized = _json(body);
|
|
134
|
+
const exception = new ResourceNotFoundException({
|
|
135
|
+
$metadata: deserializeMetadata(parsedOutput),
|
|
136
|
+
...deserialized,
|
|
137
|
+
});
|
|
138
|
+
return __decorateServiceException(exception, body);
|
|
139
|
+
};
|
|
140
|
+
const de_ThrottlingExceptionRes = async (parsedOutput, context) => {
|
|
141
|
+
const body = parsedOutput.body;
|
|
142
|
+
const deserialized = _json(body);
|
|
143
|
+
const exception = new ThrottlingException({
|
|
144
|
+
$metadata: deserializeMetadata(parsedOutput),
|
|
145
|
+
...deserialized,
|
|
146
|
+
});
|
|
147
|
+
return __decorateServiceException(exception, body);
|
|
148
|
+
};
|
|
149
|
+
const de_ValidationExceptionRes = async (parsedOutput, context) => {
|
|
150
|
+
const body = parsedOutput.body;
|
|
151
|
+
const deserialized = _json(body);
|
|
152
|
+
const exception = new ValidationException({
|
|
153
|
+
$metadata: deserializeMetadata(parsedOutput),
|
|
154
|
+
...deserialized,
|
|
155
|
+
});
|
|
156
|
+
return __decorateServiceException(exception, body);
|
|
157
|
+
};
|
|
158
|
+
const de_GetRecordsOutput = (output, context) => {
|
|
159
|
+
return take(output, {
|
|
160
|
+
changeRecords: (_) => de_RecordList(_, context),
|
|
161
|
+
nextShardIterator: __expectString,
|
|
162
|
+
});
|
|
163
|
+
};
|
|
164
|
+
const de_GetStreamOutput = (output, context) => {
|
|
165
|
+
return take(output, {
|
|
166
|
+
creationRequestDateTime: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))),
|
|
167
|
+
keyspaceName: __expectString,
|
|
168
|
+
nextToken: __expectString,
|
|
169
|
+
shards: _json,
|
|
170
|
+
streamArn: __expectString,
|
|
171
|
+
streamLabel: __expectString,
|
|
172
|
+
streamStatus: __expectString,
|
|
173
|
+
streamViewType: __expectString,
|
|
174
|
+
tableName: __expectString,
|
|
175
|
+
});
|
|
176
|
+
};
|
|
177
|
+
const de_KeyspacesCell = (output, context) => {
|
|
178
|
+
return take(output, {
|
|
179
|
+
metadata: _json,
|
|
180
|
+
value: (_) => de_KeyspacesCellValue(__expectUnion(_), context),
|
|
181
|
+
});
|
|
182
|
+
};
|
|
183
|
+
const de_KeyspacesCellList = (output, context) => {
|
|
184
|
+
const retVal = (output || [])
|
|
185
|
+
.filter((e) => e != null)
|
|
186
|
+
.map((entry) => {
|
|
187
|
+
return de_KeyspacesCell(entry, context);
|
|
188
|
+
});
|
|
189
|
+
return retVal;
|
|
190
|
+
};
|
|
191
|
+
const de_KeyspacesCellMap = (output, context) => {
|
|
192
|
+
const retVal = (output || [])
|
|
193
|
+
.filter((e) => e != null)
|
|
194
|
+
.map((entry) => {
|
|
195
|
+
return de_KeyspacesCellMapDefinition(entry, context);
|
|
196
|
+
});
|
|
197
|
+
return retVal;
|
|
198
|
+
};
|
|
199
|
+
const de_KeyspacesCellMapDefinition = (output, context) => {
|
|
200
|
+
return take(output, {
|
|
201
|
+
key: (_) => de_KeyspacesCellValue(__expectUnion(_), context),
|
|
202
|
+
metadata: _json,
|
|
203
|
+
value: (_) => de_KeyspacesCellValue(__expectUnion(_), context),
|
|
204
|
+
});
|
|
205
|
+
};
|
|
206
|
+
const de_KeyspacesCells = (output, context) => {
|
|
207
|
+
return Object.entries(output).reduce((acc, [key, value]) => {
|
|
208
|
+
if (value === null) {
|
|
209
|
+
return acc;
|
|
210
|
+
}
|
|
211
|
+
acc[key] = de_KeyspacesCell(value, context);
|
|
212
|
+
return acc;
|
|
213
|
+
}, {});
|
|
214
|
+
};
|
|
215
|
+
const de_KeyspacesCellValue = (output, context) => {
|
|
216
|
+
if (__expectString(output.asciiT) !== undefined) {
|
|
217
|
+
return { asciiT: __expectString(output.asciiT) };
|
|
218
|
+
}
|
|
219
|
+
if (__expectString(output.bigintT) !== undefined) {
|
|
220
|
+
return { bigintT: __expectString(output.bigintT) };
|
|
221
|
+
}
|
|
222
|
+
if (output.blobT != null) {
|
|
223
|
+
return {
|
|
224
|
+
blobT: context.base64Decoder(output.blobT),
|
|
225
|
+
};
|
|
226
|
+
}
|
|
227
|
+
if (__expectBoolean(output.boolT) !== undefined) {
|
|
228
|
+
return { boolT: __expectBoolean(output.boolT) };
|
|
229
|
+
}
|
|
230
|
+
if (__expectString(output.counterT) !== undefined) {
|
|
231
|
+
return { counterT: __expectString(output.counterT) };
|
|
232
|
+
}
|
|
233
|
+
if (__expectString(output.dateT) !== undefined) {
|
|
234
|
+
return { dateT: __expectString(output.dateT) };
|
|
235
|
+
}
|
|
236
|
+
if (__expectString(output.decimalT) !== undefined) {
|
|
237
|
+
return { decimalT: __expectString(output.decimalT) };
|
|
238
|
+
}
|
|
239
|
+
if (__expectString(output.doubleT) !== undefined) {
|
|
240
|
+
return { doubleT: __expectString(output.doubleT) };
|
|
241
|
+
}
|
|
242
|
+
if (__expectString(output.floatT) !== undefined) {
|
|
243
|
+
return { floatT: __expectString(output.floatT) };
|
|
244
|
+
}
|
|
245
|
+
if (__expectString(output.inetT) !== undefined) {
|
|
246
|
+
return { inetT: __expectString(output.inetT) };
|
|
247
|
+
}
|
|
248
|
+
if (__expectString(output.intT) !== undefined) {
|
|
249
|
+
return { intT: __expectString(output.intT) };
|
|
250
|
+
}
|
|
251
|
+
if (output.listT != null) {
|
|
252
|
+
return {
|
|
253
|
+
listT: de_KeyspacesCellList(output.listT, context),
|
|
254
|
+
};
|
|
255
|
+
}
|
|
256
|
+
if (output.mapT != null) {
|
|
257
|
+
return {
|
|
258
|
+
mapT: de_KeyspacesCellMap(output.mapT, context),
|
|
259
|
+
};
|
|
260
|
+
}
|
|
261
|
+
if (output.setT != null) {
|
|
262
|
+
return {
|
|
263
|
+
setT: de_KeyspacesCellList(output.setT, context),
|
|
264
|
+
};
|
|
265
|
+
}
|
|
266
|
+
if (__expectString(output.smallintT) !== undefined) {
|
|
267
|
+
return { smallintT: __expectString(output.smallintT) };
|
|
268
|
+
}
|
|
269
|
+
if (__expectString(output.textT) !== undefined) {
|
|
270
|
+
return { textT: __expectString(output.textT) };
|
|
271
|
+
}
|
|
272
|
+
if (__expectString(output.timeT) !== undefined) {
|
|
273
|
+
return { timeT: __expectString(output.timeT) };
|
|
274
|
+
}
|
|
275
|
+
if (__expectString(output.timestampT) !== undefined) {
|
|
276
|
+
return { timestampT: __expectString(output.timestampT) };
|
|
277
|
+
}
|
|
278
|
+
if (__expectString(output.timeuuidT) !== undefined) {
|
|
279
|
+
return { timeuuidT: __expectString(output.timeuuidT) };
|
|
280
|
+
}
|
|
281
|
+
if (__expectString(output.tinyintT) !== undefined) {
|
|
282
|
+
return { tinyintT: __expectString(output.tinyintT) };
|
|
283
|
+
}
|
|
284
|
+
if (output.tupleT != null) {
|
|
285
|
+
return {
|
|
286
|
+
tupleT: de_KeyspacesCellList(output.tupleT, context),
|
|
287
|
+
};
|
|
288
|
+
}
|
|
289
|
+
if (output.udtT != null) {
|
|
290
|
+
return {
|
|
291
|
+
udtT: de_KeyspacesUdtMap(output.udtT, context),
|
|
292
|
+
};
|
|
293
|
+
}
|
|
294
|
+
if (__expectString(output.uuidT) !== undefined) {
|
|
295
|
+
return { uuidT: __expectString(output.uuidT) };
|
|
296
|
+
}
|
|
297
|
+
if (__expectString(output.varcharT) !== undefined) {
|
|
298
|
+
return { varcharT: __expectString(output.varcharT) };
|
|
299
|
+
}
|
|
300
|
+
if (__expectString(output.varintT) !== undefined) {
|
|
301
|
+
return { varintT: __expectString(output.varintT) };
|
|
302
|
+
}
|
|
303
|
+
return { $unknown: Object.entries(output)[0] };
|
|
304
|
+
};
|
|
305
|
+
const de_KeyspacesKeysMap = (output, context) => {
|
|
306
|
+
return Object.entries(output).reduce((acc, [key, value]) => {
|
|
307
|
+
if (value === null) {
|
|
308
|
+
return acc;
|
|
309
|
+
}
|
|
310
|
+
acc[key] = de_KeyspacesCellValue(__expectUnion(value), context);
|
|
311
|
+
return acc;
|
|
312
|
+
}, {});
|
|
313
|
+
};
|
|
314
|
+
const de_KeyspacesRow = (output, context) => {
|
|
315
|
+
return take(output, {
|
|
316
|
+
rowMetadata: _json,
|
|
317
|
+
staticCells: (_) => de_KeyspacesCells(_, context),
|
|
318
|
+
valueCells: (_) => de_KeyspacesCells(_, context),
|
|
319
|
+
});
|
|
320
|
+
};
|
|
321
|
+
const de_KeyspacesUdtMap = (output, context) => {
|
|
322
|
+
return Object.entries(output).reduce((acc, [key, value]) => {
|
|
323
|
+
if (value === null) {
|
|
324
|
+
return acc;
|
|
325
|
+
}
|
|
326
|
+
acc[key] = de_KeyspacesCell(value, context);
|
|
327
|
+
return acc;
|
|
328
|
+
}, {});
|
|
329
|
+
};
|
|
330
|
+
const de__Record = (output, context) => {
|
|
331
|
+
return take(output, {
|
|
332
|
+
clusteringKeys: (_) => de_KeyspacesKeysMap(_, context),
|
|
333
|
+
createdAt: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))),
|
|
334
|
+
eventVersion: __expectString,
|
|
335
|
+
newImage: (_) => de_KeyspacesRow(_, context),
|
|
336
|
+
oldImage: (_) => de_KeyspacesRow(_, context),
|
|
337
|
+
origin: __expectString,
|
|
338
|
+
partitionKeys: (_) => de_KeyspacesKeysMap(_, context),
|
|
339
|
+
sequenceNumber: __expectString,
|
|
340
|
+
});
|
|
341
|
+
};
|
|
342
|
+
const de_RecordList = (output, context) => {
|
|
343
|
+
const retVal = (output || [])
|
|
344
|
+
.filter((e) => e != null)
|
|
345
|
+
.map((entry) => {
|
|
346
|
+
return de__Record(entry, context);
|
|
347
|
+
});
|
|
348
|
+
return retVal;
|
|
349
|
+
};
|
|
350
|
+
const deserializeMetadata = (output) => ({
|
|
351
|
+
httpStatusCode: output.statusCode,
|
|
352
|
+
requestId: output.headers["x-amzn-requestid"] ?? output.headers["x-amzn-request-id"] ?? output.headers["x-amz-request-id"],
|
|
353
|
+
extendedRequestId: output.headers["x-amz-id-2"],
|
|
354
|
+
cfId: output.headers["x-amz-cf-id"],
|
|
355
|
+
});
|
|
356
|
+
const collectBodyString = (streamBody, context) => collectBody(streamBody, context).then((body) => context.utf8Encoder(body));
|
|
357
|
+
const throwDefaultError = withBaseException(__BaseException);
|
|
358
|
+
const buildHttpRpcRequest = async (context, headers, path, resolvedHostname, body) => {
|
|
359
|
+
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
|
|
360
|
+
const contents = {
|
|
361
|
+
protocol,
|
|
362
|
+
hostname,
|
|
363
|
+
port,
|
|
364
|
+
method: "POST",
|
|
365
|
+
path: basePath.endsWith("/") ? basePath.slice(0, -1) + path : basePath + path,
|
|
366
|
+
headers,
|
|
367
|
+
};
|
|
368
|
+
if (resolvedHostname !== undefined) {
|
|
369
|
+
contents.hostname = resolvedHostname;
|
|
370
|
+
}
|
|
371
|
+
if (body !== undefined) {
|
|
372
|
+
contents.body = body;
|
|
373
|
+
}
|
|
374
|
+
return new __HttpRequest(contents);
|
|
375
|
+
};
|
|
376
|
+
function sharedHeaders(operation) {
|
|
377
|
+
return {
|
|
378
|
+
"content-type": "application/x-amz-json-1.0",
|
|
379
|
+
"x-amz-target": `KeyspacesStreams.${operation}`,
|
|
380
|
+
};
|
|
381
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import packageInfo from "../package.json";
|
|
2
|
+
import { Sha256 } from "@aws-crypto/sha256-browser";
|
|
3
|
+
import { createDefaultUserAgentProvider } from "@aws-sdk/util-user-agent-browser";
|
|
4
|
+
import { DEFAULT_USE_DUALSTACK_ENDPOINT, DEFAULT_USE_FIPS_ENDPOINT } from "@smithy/config-resolver";
|
|
5
|
+
import { FetchHttpHandler as RequestHandler, streamCollector } from "@smithy/fetch-http-handler";
|
|
6
|
+
import { invalidProvider } from "@smithy/invalid-dependency";
|
|
7
|
+
import { calculateBodyLength } from "@smithy/util-body-length-browser";
|
|
8
|
+
import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@smithy/util-retry";
|
|
9
|
+
import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared";
|
|
10
|
+
import { loadConfigsForDefaultMode } from "@smithy/smithy-client";
|
|
11
|
+
import { resolveDefaultsModeConfig } from "@smithy/util-defaults-mode-browser";
|
|
12
|
+
export const getRuntimeConfig = (config) => {
|
|
13
|
+
const defaultsMode = resolveDefaultsModeConfig(config);
|
|
14
|
+
const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode);
|
|
15
|
+
const clientSharedValues = getSharedRuntimeConfig(config);
|
|
16
|
+
return {
|
|
17
|
+
...clientSharedValues,
|
|
18
|
+
...config,
|
|
19
|
+
runtime: "browser",
|
|
20
|
+
defaultsMode,
|
|
21
|
+
bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength,
|
|
22
|
+
credentialDefaultProvider: config?.credentialDefaultProvider ?? ((_) => () => Promise.reject(new Error("Credential is missing"))),
|
|
23
|
+
defaultUserAgentProvider: config?.defaultUserAgentProvider ??
|
|
24
|
+
createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }),
|
|
25
|
+
maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS,
|
|
26
|
+
region: config?.region ?? invalidProvider("Region is missing"),
|
|
27
|
+
requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider),
|
|
28
|
+
retryMode: config?.retryMode ?? (async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE),
|
|
29
|
+
sha256: config?.sha256 ?? Sha256,
|
|
30
|
+
streamCollector: config?.streamCollector ?? streamCollector,
|
|
31
|
+
useDualstackEndpoint: config?.useDualstackEndpoint ?? (() => Promise.resolve(DEFAULT_USE_DUALSTACK_ENDPOINT)),
|
|
32
|
+
useFipsEndpoint: config?.useFipsEndpoint ?? (() => Promise.resolve(DEFAULT_USE_FIPS_ENDPOINT)),
|
|
33
|
+
};
|
|
34
|
+
};
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import packageInfo from "../package.json";
|
|
2
|
+
import { NODE_AUTH_SCHEME_PREFERENCE_OPTIONS, emitWarningIfUnsupportedVersion as awsCheckVersion } from "@aws-sdk/core";
|
|
3
|
+
import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node";
|
|
4
|
+
import { NODE_APP_ID_CONFIG_OPTIONS, createDefaultUserAgentProvider } from "@aws-sdk/util-user-agent-node";
|
|
5
|
+
import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS, NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, } from "@smithy/config-resolver";
|
|
6
|
+
import { Hash } from "@smithy/hash-node";
|
|
7
|
+
import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@smithy/middleware-retry";
|
|
8
|
+
import { loadConfig as loadNodeConfig } from "@smithy/node-config-provider";
|
|
9
|
+
import { NodeHttpHandler as RequestHandler, streamCollector } from "@smithy/node-http-handler";
|
|
10
|
+
import { calculateBodyLength } from "@smithy/util-body-length-node";
|
|
11
|
+
import { DEFAULT_RETRY_MODE } from "@smithy/util-retry";
|
|
12
|
+
import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared";
|
|
13
|
+
import { loadConfigsForDefaultMode } from "@smithy/smithy-client";
|
|
14
|
+
import { resolveDefaultsModeConfig } from "@smithy/util-defaults-mode-node";
|
|
15
|
+
import { emitWarningIfUnsupportedVersion } from "@smithy/smithy-client";
|
|
16
|
+
export const getRuntimeConfig = (config) => {
|
|
17
|
+
emitWarningIfUnsupportedVersion(process.version);
|
|
18
|
+
const defaultsMode = resolveDefaultsModeConfig(config);
|
|
19
|
+
const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode);
|
|
20
|
+
const clientSharedValues = getSharedRuntimeConfig(config);
|
|
21
|
+
awsCheckVersion(process.version);
|
|
22
|
+
const loaderConfig = {
|
|
23
|
+
profile: config?.profile,
|
|
24
|
+
logger: clientSharedValues.logger,
|
|
25
|
+
};
|
|
26
|
+
return {
|
|
27
|
+
...clientSharedValues,
|
|
28
|
+
...config,
|
|
29
|
+
runtime: "node",
|
|
30
|
+
defaultsMode,
|
|
31
|
+
authSchemePreference: config?.authSchemePreference ?? loadNodeConfig(NODE_AUTH_SCHEME_PREFERENCE_OPTIONS, loaderConfig),
|
|
32
|
+
bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength,
|
|
33
|
+
credentialDefaultProvider: config?.credentialDefaultProvider ?? credentialDefaultProvider,
|
|
34
|
+
defaultUserAgentProvider: config?.defaultUserAgentProvider ??
|
|
35
|
+
createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }),
|
|
36
|
+
maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config),
|
|
37
|
+
region: config?.region ??
|
|
38
|
+
loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...loaderConfig }),
|
|
39
|
+
requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider),
|
|
40
|
+
retryMode: config?.retryMode ??
|
|
41
|
+
loadNodeConfig({
|
|
42
|
+
...NODE_RETRY_MODE_CONFIG_OPTIONS,
|
|
43
|
+
default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE,
|
|
44
|
+
}, config),
|
|
45
|
+
sha256: config?.sha256 ?? Hash.bind(null, "sha256"),
|
|
46
|
+
streamCollector: config?.streamCollector ?? streamCollector,
|
|
47
|
+
useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, loaderConfig),
|
|
48
|
+
useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, loaderConfig),
|
|
49
|
+
userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS, loaderConfig),
|
|
50
|
+
};
|
|
51
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Sha256 } from "@aws-crypto/sha256-js";
|
|
2
|
+
import { getRuntimeConfig as getBrowserRuntimeConfig } from "./runtimeConfig.browser";
|
|
3
|
+
export const getRuntimeConfig = (config) => {
|
|
4
|
+
const browserDefaults = getBrowserRuntimeConfig(config);
|
|
5
|
+
return {
|
|
6
|
+
...browserDefaults,
|
|
7
|
+
...config,
|
|
8
|
+
runtime: "react-native",
|
|
9
|
+
sha256: config?.sha256 ?? Sha256,
|
|
10
|
+
};
|
|
11
|
+
};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { AwsSdkSigV4Signer } from "@aws-sdk/core";
|
|
2
|
+
import { NoOpLogger } from "@smithy/smithy-client";
|
|
3
|
+
import { parseUrl } from "@smithy/url-parser";
|
|
4
|
+
import { fromBase64, toBase64 } from "@smithy/util-base64";
|
|
5
|
+
import { fromUtf8, toUtf8 } from "@smithy/util-utf8";
|
|
6
|
+
import { defaultKeyspacesStreamsHttpAuthSchemeProvider } from "./auth/httpAuthSchemeProvider";
|
|
7
|
+
import { defaultEndpointResolver } from "./endpoint/endpointResolver";
|
|
8
|
+
export const getRuntimeConfig = (config) => {
|
|
9
|
+
return {
|
|
10
|
+
apiVersion: "2024-09-09",
|
|
11
|
+
base64Decoder: config?.base64Decoder ?? fromBase64,
|
|
12
|
+
base64Encoder: config?.base64Encoder ?? toBase64,
|
|
13
|
+
disableHostPrefix: config?.disableHostPrefix ?? false,
|
|
14
|
+
endpointProvider: config?.endpointProvider ?? defaultEndpointResolver,
|
|
15
|
+
extensions: config?.extensions ?? [],
|
|
16
|
+
httpAuthSchemeProvider: config?.httpAuthSchemeProvider ?? defaultKeyspacesStreamsHttpAuthSchemeProvider,
|
|
17
|
+
httpAuthSchemes: config?.httpAuthSchemes ?? [
|
|
18
|
+
{
|
|
19
|
+
schemeId: "aws.auth#sigv4",
|
|
20
|
+
identityProvider: (ipc) => ipc.getIdentityProvider("aws.auth#sigv4"),
|
|
21
|
+
signer: new AwsSdkSigV4Signer(),
|
|
22
|
+
},
|
|
23
|
+
],
|
|
24
|
+
logger: config?.logger ?? new NoOpLogger(),
|
|
25
|
+
serviceId: config?.serviceId ?? "KeyspacesStreams",
|
|
26
|
+
urlParser: config?.urlParser ?? parseUrl,
|
|
27
|
+
utf8Decoder: config?.utf8Decoder ?? fromUtf8,
|
|
28
|
+
utf8Encoder: config?.utf8Encoder ?? toUtf8,
|
|
29
|
+
};
|
|
30
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { getAwsRegionExtensionConfiguration, resolveAwsRegionExtensionConfiguration, } from "@aws-sdk/region-config-resolver";
|
|
2
|
+
import { getHttpHandlerExtensionConfiguration, resolveHttpHandlerRuntimeConfig } from "@smithy/protocol-http";
|
|
3
|
+
import { getDefaultExtensionConfiguration, resolveDefaultRuntimeConfig } from "@smithy/smithy-client";
|
|
4
|
+
import { getHttpAuthExtensionConfiguration, resolveHttpAuthRuntimeConfig } from "./auth/httpAuthExtensionConfiguration";
|
|
5
|
+
export const resolveRuntimeExtensions = (runtimeConfig, extensions) => {
|
|
6
|
+
const extensionConfiguration = Object.assign(getAwsRegionExtensionConfiguration(runtimeConfig), getDefaultExtensionConfiguration(runtimeConfig), getHttpHandlerExtensionConfiguration(runtimeConfig), getHttpAuthExtensionConfiguration(runtimeConfig));
|
|
7
|
+
extensions.forEach((extension) => extension.configure(extensionConfiguration));
|
|
8
|
+
return Object.assign(runtimeConfig, resolveAwsRegionExtensionConfiguration(extensionConfiguration), resolveDefaultRuntimeConfig(extensionConfiguration), resolveHttpHandlerRuntimeConfig(extensionConfiguration), resolveHttpAuthRuntimeConfig(extensionConfiguration));
|
|
9
|
+
};
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { HttpHandlerOptions as __HttpHandlerOptions } from "@smithy/types";
|
|
2
|
+
import { GetRecordsCommandInput, GetRecordsCommandOutput } from "./commands/GetRecordsCommand";
|
|
3
|
+
import { GetShardIteratorCommandInput, GetShardIteratorCommandOutput } from "./commands/GetShardIteratorCommand";
|
|
4
|
+
import { GetStreamCommandInput, GetStreamCommandOutput } from "./commands/GetStreamCommand";
|
|
5
|
+
import { ListStreamsCommandInput, ListStreamsCommandOutput } from "./commands/ListStreamsCommand";
|
|
6
|
+
import { KeyspacesStreamsClient } from "./KeyspacesStreamsClient";
|
|
7
|
+
export interface KeyspacesStreams {
|
|
8
|
+
/**
|
|
9
|
+
* @see {@link GetRecordsCommand}
|
|
10
|
+
*/
|
|
11
|
+
getRecords(args: GetRecordsCommandInput, options?: __HttpHandlerOptions): Promise<GetRecordsCommandOutput>;
|
|
12
|
+
getRecords(args: GetRecordsCommandInput, cb: (err: any, data?: GetRecordsCommandOutput) => void): void;
|
|
13
|
+
getRecords(args: GetRecordsCommandInput, options: __HttpHandlerOptions, cb: (err: any, data?: GetRecordsCommandOutput) => void): void;
|
|
14
|
+
/**
|
|
15
|
+
* @see {@link GetShardIteratorCommand}
|
|
16
|
+
*/
|
|
17
|
+
getShardIterator(args: GetShardIteratorCommandInput, options?: __HttpHandlerOptions): Promise<GetShardIteratorCommandOutput>;
|
|
18
|
+
getShardIterator(args: GetShardIteratorCommandInput, cb: (err: any, data?: GetShardIteratorCommandOutput) => void): void;
|
|
19
|
+
getShardIterator(args: GetShardIteratorCommandInput, options: __HttpHandlerOptions, cb: (err: any, data?: GetShardIteratorCommandOutput) => void): void;
|
|
20
|
+
/**
|
|
21
|
+
* @see {@link GetStreamCommand}
|
|
22
|
+
*/
|
|
23
|
+
getStream(args: GetStreamCommandInput, options?: __HttpHandlerOptions): Promise<GetStreamCommandOutput>;
|
|
24
|
+
getStream(args: GetStreamCommandInput, cb: (err: any, data?: GetStreamCommandOutput) => void): void;
|
|
25
|
+
getStream(args: GetStreamCommandInput, options: __HttpHandlerOptions, cb: (err: any, data?: GetStreamCommandOutput) => void): void;
|
|
26
|
+
/**
|
|
27
|
+
* @see {@link ListStreamsCommand}
|
|
28
|
+
*/
|
|
29
|
+
listStreams(): Promise<ListStreamsCommandOutput>;
|
|
30
|
+
listStreams(args: ListStreamsCommandInput, options?: __HttpHandlerOptions): Promise<ListStreamsCommandOutput>;
|
|
31
|
+
listStreams(args: ListStreamsCommandInput, cb: (err: any, data?: ListStreamsCommandOutput) => void): void;
|
|
32
|
+
listStreams(args: ListStreamsCommandInput, options: __HttpHandlerOptions, cb: (err: any, data?: ListStreamsCommandOutput) => void): void;
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* <p>Amazon Keyspaces (for Apache Cassandra) change data capture (CDC) records change events for Amazon Keyspaces tables. The change events captured in a stream are time-ordered and de-duplicated write operations. Using stream data you can build event driven applications that incorporate near-real time change events from Amazon Keyspaces tables. </p> <p>Amazon Keyspaces CDC is serverless and scales the infrastructure for change events automatically based on the volume of changes on your table. </p> <p> This API reference describes the Amazon Keyspaces CDC stream API in detail. </p> <p>For more information about Amazon Keyspaces CDC, see <a href="https://docs.aws.amazon.com/keyspaces/latest/devguide/cdc.html">Working with change data capture (CDC) streams in Amazon Keyspaces</a> in the <i>Amazon Keyspaces Developer Guide</i>.</p> <p>To learn how Amazon Keyspaces CDC API actions are recorded with CloudTrail, see <a href="https://docs.aws.amazon.com/keyspaces/latest/devguide/logging-using-cloudtrail.html#service-name-info-in-cloudtrail">Amazon Keyspaces information in CloudTrail</a> in the <i>Amazon Keyspaces Developer Guide</i>.</p> <p>To see the metrics Amazon Keyspaces CDC sends to Amazon CloudWatch, see <a href="https://docs.aws.amazon.com/keyspaces/latest/devguide/metrics-dimensions.html#keyspaces-cdc-metrics">Amazon Keyspaces change data capture (CDC) CloudWatch metrics</a> in the <i>Amazon Keyspaces Developer Guide</i>.</p>
|
|
36
|
+
* @public
|
|
37
|
+
*/
|
|
38
|
+
export declare class KeyspacesStreams extends KeyspacesStreamsClient implements KeyspacesStreams {
|
|
39
|
+
}
|