-
Notifications
You must be signed in to change notification settings - Fork 115
/
attachments.ts
75 lines (65 loc) · 1.36 KB
/
attachments.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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
/**
* Interface of an attachment object from Nylas.
*/
interface BaseAttachment {
/**
* Attachment's name.
*/
filename: string;
/**
* Attachment's content type.
*/
contentType: string;
/**
* If it's an inline attachment.
*/
isInline?: boolean;
/**
* Attachment's size in bytes.
*/
size?: number;
/**
* Content ID of the attachment.
*/
contentId?: string;
/**
* Content disposition of the attachment.
*/
contentDisposition?: string;
}
/**
* Interface of a create attachment request.
*/
export interface CreateAttachmentRequest extends BaseAttachment {
/**
* Content of the attachment.
* It can either be a readable stream or a base64 encoded string.
*/
content: NodeJS.ReadableStream | string;
}
/**
* Interface of an attachment object from Nylas.
*/
export interface Attachment extends BaseAttachment {
/**
* Attachment's ID.
*/
id: string;
/**
* Grant ID of the Nylas account.
*/
grantId: string;
}
/**
* Interface representing of the query parameters for finding an attachment's metadata.
*/
export interface FindAttachmentQueryParams {
/**
* ID of the message the attachment belongs to.
*/
messageId: string;
}
/**
* Interface representing of the query parameters for downloading an attachment.
*/
export type DownloadAttachmentQueryParams = FindAttachmentQueryParams;