UNPKG

20.1 kBTypeScriptView Raw
1import {Request} from '../lib/request';
2import {Response} from '../lib/response';
3import {AWSError} from '../lib/error';
4import {Service} from '../lib/service';
5import {ServiceConfigurationOptions} from '../lib/service';
6import {ConfigBase as Config} from '../lib/config';
7interface Blob {}
8declare class DynamoDBStreams extends Service {
9 /**
10 * Constructs a service object. This object has one method for each API operation.
11 */
12 constructor(options?: DynamoDBStreams.Types.ClientConfiguration)
13 config: Config & DynamoDBStreams.Types.ClientConfiguration;
14 /**
15 * Returns information about a stream, including the current status of the stream, its Amazon Resource Name (ARN), the composition of its shards, and its corresponding DynamoDB table. You can call DescribeStream at a maximum rate of 10 times per second. Each shard in the stream has a SequenceNumberRange associated with it. If the SequenceNumberRange has a StartingSequenceNumber but no EndingSequenceNumber, then the shard is still open (able to receive more stream records). If both StartingSequenceNumber and EndingSequenceNumber are present, then that shard is closed and can no longer receive more data.
16 */
17 describeStream(params: DynamoDBStreams.Types.DescribeStreamInput, callback?: (err: AWSError, data: DynamoDBStreams.Types.DescribeStreamOutput) => void): Request<DynamoDBStreams.Types.DescribeStreamOutput, AWSError>;
18 /**
19 * Returns information about a stream, including the current status of the stream, its Amazon Resource Name (ARN), the composition of its shards, and its corresponding DynamoDB table. You can call DescribeStream at a maximum rate of 10 times per second. Each shard in the stream has a SequenceNumberRange associated with it. If the SequenceNumberRange has a StartingSequenceNumber but no EndingSequenceNumber, then the shard is still open (able to receive more stream records). If both StartingSequenceNumber and EndingSequenceNumber are present, then that shard is closed and can no longer receive more data.
20 */
21 describeStream(callback?: (err: AWSError, data: DynamoDBStreams.Types.DescribeStreamOutput) => void): Request<DynamoDBStreams.Types.DescribeStreamOutput, AWSError>;
22 /**
23 * Retrieves the stream records from a given shard. Specify a shard iterator using the ShardIterator parameter. The shard iterator specifies the position in the shard from which you want to start reading stream records sequentially. If there are no stream records available in the portion of the shard that the iterator points to, GetRecords returns an empty list. Note that it might take multiple calls to get to a portion of the shard that contains stream records. GetRecords can retrieve a maximum of 1 MB of data or 1000 stream records, whichever comes first.
24 */
25 getRecords(params: DynamoDBStreams.Types.GetRecordsInput, callback?: (err: AWSError, data: DynamoDBStreams.Types.GetRecordsOutput) => void): Request<DynamoDBStreams.Types.GetRecordsOutput, AWSError>;
26 /**
27 * Retrieves the stream records from a given shard. Specify a shard iterator using the ShardIterator parameter. The shard iterator specifies the position in the shard from which you want to start reading stream records sequentially. If there are no stream records available in the portion of the shard that the iterator points to, GetRecords returns an empty list. Note that it might take multiple calls to get to a portion of the shard that contains stream records. GetRecords can retrieve a maximum of 1 MB of data or 1000 stream records, whichever comes first.
28 */
29 getRecords(callback?: (err: AWSError, data: DynamoDBStreams.Types.GetRecordsOutput) => void): Request<DynamoDBStreams.Types.GetRecordsOutput, AWSError>;
30 /**
31 * Returns a shard iterator. A shard iterator provides information about how to retrieve the stream records from within a shard. Use the shard iterator in a subsequent GetRecords request to read the stream records from the shard. A shard iterator expires 15 minutes after it is returned to the requester.
32 */
33 getShardIterator(params: DynamoDBStreams.Types.GetShardIteratorInput, callback?: (err: AWSError, data: DynamoDBStreams.Types.GetShardIteratorOutput) => void): Request<DynamoDBStreams.Types.GetShardIteratorOutput, AWSError>;
34 /**
35 * Returns a shard iterator. A shard iterator provides information about how to retrieve the stream records from within a shard. Use the shard iterator in a subsequent GetRecords request to read the stream records from the shard. A shard iterator expires 15 minutes after it is returned to the requester.
36 */
37 getShardIterator(callback?: (err: AWSError, data: DynamoDBStreams.Types.GetShardIteratorOutput) => void): Request<DynamoDBStreams.Types.GetShardIteratorOutput, AWSError>;
38 /**
39 * Returns an array of stream ARNs associated with the current account and endpoint. If the TableName parameter is present, then ListStreams will return only the streams ARNs for that table. You can call ListStreams at a maximum rate of 5 times per second.
40 */
41 listStreams(params: DynamoDBStreams.Types.ListStreamsInput, callback?: (err: AWSError, data: DynamoDBStreams.Types.ListStreamsOutput) => void): Request<DynamoDBStreams.Types.ListStreamsOutput, AWSError>;
42 /**
43 * Returns an array of stream ARNs associated with the current account and endpoint. If the TableName parameter is present, then ListStreams will return only the streams ARNs for that table. You can call ListStreams at a maximum rate of 5 times per second.
44 */
45 listStreams(callback?: (err: AWSError, data: DynamoDBStreams.Types.ListStreamsOutput) => void): Request<DynamoDBStreams.Types.ListStreamsOutput, AWSError>;
46}
47declare namespace DynamoDBStreams {
48 export type AttributeMap = {[key: string]: AttributeValue};
49 export type AttributeName = string;
50 export interface AttributeValue {
51 /**
52 * A String data type.
53 */
54 S?: StringAttributeValue;
55 /**
56 * A Number data type.
57 */
58 N?: NumberAttributeValue;
59 /**
60 * A Binary data type.
61 */
62 B?: BinaryAttributeValue;
63 /**
64 * A String Set data type.
65 */
66 SS?: StringSetAttributeValue;
67 /**
68 * A Number Set data type.
69 */
70 NS?: NumberSetAttributeValue;
71 /**
72 * A Binary Set data type.
73 */
74 BS?: BinarySetAttributeValue;
75 /**
76 * A Map data type.
77 */
78 M?: MapAttributeValue;
79 /**
80 * A List data type.
81 */
82 L?: ListAttributeValue;
83 /**
84 * A Null data type.
85 */
86 NULL?: NullAttributeValue;
87 /**
88 * A Boolean data type.
89 */
90 BOOL?: BooleanAttributeValue;
91 }
92 export type BinaryAttributeValue = Buffer|Uint8Array|Blob|string;
93 export type BinarySetAttributeValue = BinaryAttributeValue[];
94 export type BooleanAttributeValue = boolean;
95 export type _Date = Date;
96 export interface DescribeStreamInput {
97 /**
98 * The Amazon Resource Name (ARN) for the stream.
99 */
100 StreamArn: StreamArn;
101 /**
102 * The maximum number of shard objects to return. The upper limit is 100.
103 */
104 Limit?: PositiveIntegerObject;
105 /**
106 * The shard ID of the first item that this operation will evaluate. Use the value that was returned for LastEvaluatedShardId in the previous operation.
107 */
108 ExclusiveStartShardId?: ShardId;
109 }
110 export interface DescribeStreamOutput {
111 /**
112 * A complete description of the stream, including its creation date and time, the DynamoDB table associated with the stream, the shard IDs within the stream, and the beginning and ending sequence numbers of stream records within the shards.
113 */
114 StreamDescription?: StreamDescription;
115 }
116 export interface GetRecordsInput {
117 /**
118 * A shard iterator that was retrieved from a previous GetShardIterator operation. This iterator can be used to access the stream records in this shard.
119 */
120 ShardIterator: ShardIterator;
121 /**
122 * The maximum number of records to return from the shard. The upper limit is 1000.
123 */
124 Limit?: PositiveIntegerObject;
125 }
126 export interface GetRecordsOutput {
127 /**
128 * The stream records from the shard, which were retrieved using the shard iterator.
129 */
130 Records?: RecordList;
131 /**
132 * The next position in the shard from which to start sequentially reading stream records. If set to null, the shard has been closed and the requested iterator will not return any more data.
133 */
134 NextShardIterator?: ShardIterator;
135 }
136 export interface GetShardIteratorInput {
137 /**
138 * The Amazon Resource Name (ARN) for the stream.
139 */
140 StreamArn: StreamArn;
141 /**
142 * The identifier of the shard. The iterator will be returned for this shard ID.
143 */
144 ShardId: ShardId;
145 /**
146 * Determines how the shard iterator is used to start reading stream records from the shard: AT_SEQUENCE_NUMBER - Start reading exactly from the position denoted by a specific sequence number. AFTER_SEQUENCE_NUMBER - Start reading right after the position denoted by a specific sequence number. TRIM_HORIZON - Start reading at the last (untrimmed) stream record, which is the oldest record in the shard. In DynamoDB Streams, there is a 24 hour limit on data retention. Stream records whose age exceeds this limit are subject to removal (trimming) from the stream. LATEST - Start reading just after the most recent stream record in the shard, so that you always read the most recent data in the shard.
147 */
148 ShardIteratorType: ShardIteratorType;
149 /**
150 * The sequence number of a stream record in the shard from which to start reading.
151 */
152 SequenceNumber?: SequenceNumber;
153 }
154 export interface GetShardIteratorOutput {
155 /**
156 * The position in the shard from which to start reading stream records sequentially. A shard iterator specifies this position using the sequence number of a stream record in a shard.
157 */
158 ShardIterator?: ShardIterator;
159 }
160 export interface Identity {
161 /**
162 * A unique identifier for the entity that made the call. For Time To Live, the principalId is "dynamodb.amazonaws.com".
163 */
164 PrincipalId?: String;
165 /**
166 * The type of the identity. For Time To Live, the type is "Service".
167 */
168 Type?: String;
169 }
170 export type KeySchema = KeySchemaElement[];
171 export type KeySchemaAttributeName = string;
172 export interface KeySchemaElement {
173 /**
174 * The name of a key attribute.
175 */
176 AttributeName: KeySchemaAttributeName;
177 /**
178 * The attribute data, consisting of the data type and the attribute value itself.
179 */
180 KeyType: KeyType;
181 }
182 export type KeyType = "HASH"|"RANGE"|string;
183 export type ListAttributeValue = AttributeValue[];
184 export interface ListStreamsInput {
185 /**
186 * If this parameter is provided, then only the streams associated with this table name are returned.
187 */
188 TableName?: TableName;
189 /**
190 * The maximum number of streams to return. The upper limit is 100.
191 */
192 Limit?: PositiveIntegerObject;
193 /**
194 * The ARN (Amazon Resource Name) of the first item that this operation will evaluate. Use the value that was returned for LastEvaluatedStreamArn in the previous operation.
195 */
196 ExclusiveStartStreamArn?: StreamArn;
197 }
198 export interface ListStreamsOutput {
199 /**
200 * A list of stream descriptors associated with the current account and endpoint.
201 */
202 Streams?: StreamList;
203 /**
204 * The stream ARN of the item where the operation stopped, inclusive of the previous result set. Use this value to start a new operation, excluding this value in the new request. If LastEvaluatedStreamArn is empty, then the "last page" of results has been processed and there is no more data to be retrieved. If LastEvaluatedStreamArn is not empty, it does not necessarily mean that there is more data in the result set. The only way to know when you have reached the end of the result set is when LastEvaluatedStreamArn is empty.
205 */
206 LastEvaluatedStreamArn?: StreamArn;
207 }
208 export type MapAttributeValue = {[key: string]: AttributeValue};
209 export type NullAttributeValue = boolean;
210 export type NumberAttributeValue = string;
211 export type NumberSetAttributeValue = NumberAttributeValue[];
212 export type OperationType = "INSERT"|"MODIFY"|"REMOVE"|string;
213 export type PositiveIntegerObject = number;
214 export type PositiveLongObject = number;
215 export interface Record {
216 /**
217 * A globally unique identifier for the event that was recorded in this stream record.
218 */
219 eventID?: String;
220 /**
221 * The type of data modification that was performed on the DynamoDB table: INSERT - a new item was added to the table. MODIFY - one or more of an existing item's attributes were modified. REMOVE - the item was deleted from the table
222 */
223 eventName?: OperationType;
224 /**
225 * The version number of the stream record format. This number is updated whenever the structure of Record is modified. Client applications must not assume that eventVersion will remain at a particular value, as this number is subject to change at any time. In general, eventVersion will only increase as the low-level DynamoDB Streams API evolves.
226 */
227 eventVersion?: String;
228 /**
229 * The AWS service from which the stream record originated. For DynamoDB Streams, this is aws:dynamodb.
230 */
231 eventSource?: String;
232 /**
233 * The region in which the GetRecords request was received.
234 */
235 awsRegion?: String;
236 /**
237 * The main body of the stream record, containing all of the DynamoDB-specific fields.
238 */
239 dynamodb?: StreamRecord;
240 /**
241 * Items that are deleted by the Time to Live process after expiration have the following fields: Records[].userIdentity.type "Service" Records[].userIdentity.principalId "dynamodb.amazonaws.com"
242 */
243 userIdentity?: Identity;
244 }
245 export type RecordList = Record[];
246 export type SequenceNumber = string;
247 export interface SequenceNumberRange {
248 /**
249 * The first sequence number.
250 */
251 StartingSequenceNumber?: SequenceNumber;
252 /**
253 * The last sequence number.
254 */
255 EndingSequenceNumber?: SequenceNumber;
256 }
257 export interface Shard {
258 /**
259 * The system-generated identifier for this shard.
260 */
261 ShardId?: ShardId;
262 /**
263 * The range of possible sequence numbers for the shard.
264 */
265 SequenceNumberRange?: SequenceNumberRange;
266 /**
267 * The shard ID of the current shard's parent.
268 */
269 ParentShardId?: ShardId;
270 }
271 export type ShardDescriptionList = Shard[];
272 export type ShardId = string;
273 export type ShardIterator = string;
274 export type ShardIteratorType = "TRIM_HORIZON"|"LATEST"|"AT_SEQUENCE_NUMBER"|"AFTER_SEQUENCE_NUMBER"|string;
275 export interface Stream {
276 /**
277 * The Amazon Resource Name (ARN) for the stream.
278 */
279 StreamArn?: StreamArn;
280 /**
281 * The DynamoDB table with which the stream is associated.
282 */
283 TableName?: TableName;
284 /**
285 * A timestamp, in ISO 8601 format, for this stream. Note that LatestStreamLabel is not a unique identifier for the stream, because it is possible that a stream from another table might have the same timestamp. However, the combination of the following three elements is guaranteed to be unique: the AWS customer ID. the table name the StreamLabel
286 */
287 StreamLabel?: String;
288 }
289 export type StreamArn = string;
290 export interface StreamDescription {
291 /**
292 * The Amazon Resource Name (ARN) for the stream.
293 */
294 StreamArn?: StreamArn;
295 /**
296 * A timestamp, in ISO 8601 format, for this stream. Note that LatestStreamLabel is not a unique identifier for the stream, because it is possible that a stream from another table might have the same timestamp. However, the combination of the following three elements is guaranteed to be unique: the AWS customer ID. the table name the StreamLabel
297 */
298 StreamLabel?: String;
299 /**
300 * Indicates the current status of the stream: ENABLING - Streams is currently being enabled on the DynamoDB table. ENABLED - the stream is enabled. DISABLING - Streams is currently being disabled on the DynamoDB table. DISABLED - the stream is disabled.
301 */
302 StreamStatus?: StreamStatus;
303 /**
304 * Indicates the format of the records within this stream: KEYS_ONLY - only the key attributes of items that were modified in the DynamoDB table. NEW_IMAGE - entire items from the table, as they appeared after they were modified. OLD_IMAGE - entire items from the table, as they appeared before they were modified. NEW_AND_OLD_IMAGES - both the new and the old images of the items from the table.
305 */
306 StreamViewType?: StreamViewType;
307 /**
308 * The date and time when the request to create this stream was issued.
309 */
310 CreationRequestDateTime?: _Date;
311 /**
312 * The DynamoDB table with which the stream is associated.
313 */
314 TableName?: TableName;
315 /**
316 * The key attribute(s) of the stream's DynamoDB table.
317 */
318 KeySchema?: KeySchema;
319 /**
320 * The shards that comprise the stream.
321 */
322 Shards?: ShardDescriptionList;
323 /**
324 * The shard ID of the item where the operation stopped, inclusive of the previous result set. Use this value to start a new operation, excluding this value in the new request. If LastEvaluatedShardId is empty, then the "last page" of results has been processed and there is currently no more data to be retrieved. If LastEvaluatedShardId is not empty, it does not necessarily mean that there is more data in the result set. The only way to know when you have reached the end of the result set is when LastEvaluatedShardId is empty.
325 */
326 LastEvaluatedShardId?: ShardId;
327 }
328 export type StreamList = Stream[];
329 export interface StreamRecord {
330 /**
331 * The approximate date and time when the stream record was created, in UNIX epoch time format.
332 */
333 ApproximateCreationDateTime?: _Date;
334 /**
335 * The primary key attribute(s) for the DynamoDB item that was modified.
336 */
337 Keys?: AttributeMap;
338 /**
339 * The item in the DynamoDB table as it appeared after it was modified.
340 */
341 NewImage?: AttributeMap;
342 /**
343 * The item in the DynamoDB table as it appeared before it was modified.
344 */
345 OldImage?: AttributeMap;
346 /**
347 * The sequence number of the stream record.
348 */
349 SequenceNumber?: SequenceNumber;
350 /**
351 * The size of the stream record, in bytes.
352 */
353 SizeBytes?: PositiveLongObject;
354 /**
355 * The type of data from the modified DynamoDB item that was captured in this stream record: KEYS_ONLY - only the key attributes of the modified item. NEW_IMAGE - the entire item, as it appeared after it was modified. OLD_IMAGE - the entire item, as it appeared before it was modified. NEW_AND_OLD_IMAGES - both the new and the old item images of the item.
356 */
357 StreamViewType?: StreamViewType;
358 }
359 export type StreamStatus = "ENABLING"|"ENABLED"|"DISABLING"|"DISABLED"|string;
360 export type StreamViewType = "NEW_IMAGE"|"OLD_IMAGE"|"NEW_AND_OLD_IMAGES"|"KEYS_ONLY"|string;
361 export type String = string;
362 export type StringAttributeValue = string;
363 export type StringSetAttributeValue = StringAttributeValue[];
364 export type TableName = string;
365 /**
366 * A string in YYYY-MM-DD format that represents the latest possible API version that can be used in this service. Specify 'latest' to use the latest possible version.
367 */
368 export type apiVersion = "2012-08-10"|"latest"|string;
369 export interface ClientApiVersions {
370 /**
371 * A string in YYYY-MM-DD format that represents the latest possible API version that can be used in this service. Specify 'latest' to use the latest possible version.
372 */
373 apiVersion?: apiVersion;
374 }
375 export type ClientConfiguration = ServiceConfigurationOptions & ClientApiVersions;
376 /**
377 * Contains interfaces for use with the DynamoDBStreams client.
378 */
379 export import Types = DynamoDBStreams;
380}
381export = DynamoDBStreams;