-
Notifications
You must be signed in to change notification settings - Fork 154
/
Copy pathtypes.ts
40 lines (33 loc) · 896 Bytes
/
types.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
/**
* Types for batch processing utility
*/
import {
Context,
DynamoDBRecord,
KinesisStreamRecord,
SQSRecord,
} from 'aws-lambda';
type BatchProcessingOptions = {
context: Context;
};
type EventSourceDataClassTypes =
| SQSRecord
| KinesisStreamRecord
| DynamoDBRecord;
type RecordValue = unknown;
type BaseRecord = { [key: string]: RecordValue } | EventSourceDataClassTypes;
type ResultType = unknown;
type SuccessResponse = ['success', ResultType, EventSourceDataClassTypes];
type FailureResponse = ['fail', string, EventSourceDataClassTypes];
type PartialItemFailures = { itemIdentifier: string };
type PartialItemFailureResponse = { batchItemFailures: PartialItemFailures[] };
export type {
BatchProcessingOptions,
BaseRecord,
EventSourceDataClassTypes,
ResultType,
SuccessResponse,
FailureResponse,
PartialItemFailures,
PartialItemFailureResponse,
};