1 | import { Handler } from "../handler";
|
2 |
|
3 |
|
4 | export type SQSHandler = Handler<SQSEvent, SQSBatchResponse | void>;
|
5 |
|
6 |
|
7 |
|
8 | export interface SQSRecord {
|
9 | messageId: string;
|
10 | receiptHandle: string;
|
11 | body: string;
|
12 | attributes: SQSRecordAttributes;
|
13 | messageAttributes: SQSMessageAttributes;
|
14 | md5OfBody: string;
|
15 | md5OfMessageAttributes?: string;
|
16 | eventSource: string;
|
17 | eventSourceARN: string;
|
18 | awsRegion: string;
|
19 | }
|
20 |
|
21 | export interface SQSEvent {
|
22 | Records: SQSRecord[];
|
23 | }
|
24 |
|
25 | export interface SQSRecordAttributes {
|
26 | AWSTraceHeader?: string | undefined;
|
27 | ApproximateReceiveCount: string;
|
28 | SentTimestamp: string;
|
29 | SenderId: string;
|
30 | ApproximateFirstReceiveTimestamp: string;
|
31 | SequenceNumber?: string | undefined;
|
32 | MessageGroupId?: string | undefined;
|
33 | MessageDeduplicationId?: string | undefined;
|
34 | DeadLetterQueueSourceArn?: string | undefined;
|
35 | }
|
36 |
|
37 | export type SQSMessageAttributeDataType = "String" | "Number" | "Binary" | string;
|
38 |
|
39 | export interface SQSMessageAttribute {
|
40 | stringValue?: string | undefined;
|
41 | binaryValue?: string | undefined;
|
42 | stringListValues?: string[] | undefined;
|
43 | binaryListValues?: string[] | undefined;
|
44 | dataType: SQSMessageAttributeDataType;
|
45 | }
|
46 |
|
47 | export interface SQSMessageAttributes {
|
48 | [name: string]: SQSMessageAttribute;
|
49 | }
|
50 |
|
51 |
|
52 | export interface SQSBatchResponse {
|
53 | batchItemFailures: SQSBatchItemFailure[];
|
54 | }
|
55 |
|
56 | export interface SQSBatchItemFailure {
|
57 | itemIdentifier: string;
|
58 | }
|