nylas 7.0.0-beta.2 → 7.0.0-beta.4
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/README.md +19 -10
- package/lib/cjs/apiClient.js +57 -32
- package/lib/cjs/models/attachments.js +2 -0
- package/lib/cjs/models/connectors.js +2 -0
- package/lib/cjs/models/contacts.js +2 -0
- package/lib/cjs/models/credentials.js +12 -0
- package/lib/cjs/models/drafts.js +2 -0
- package/lib/cjs/models/files.js +2 -0
- package/lib/cjs/models/folders.js +2 -0
- package/lib/cjs/models/freeBusy.js +11 -0
- package/lib/cjs/models/messages.js +11 -0
- package/lib/cjs/models/smartCompose.js +2 -0
- package/lib/cjs/models/threads.js +2 -0
- package/lib/cjs/models/webhooks.js +3 -0
- package/lib/cjs/nylas.js +16 -0
- package/lib/cjs/resources/attachments.js +57 -0
- package/lib/cjs/resources/auth.js +21 -16
- package/lib/cjs/resources/calendars.js +12 -0
- package/lib/cjs/resources/connectors.js +68 -0
- package/lib/cjs/resources/contacts.js +76 -0
- package/lib/cjs/resources/credentials.js +60 -0
- package/lib/cjs/resources/drafts.js +81 -0
- package/lib/cjs/resources/events.js +14 -0
- package/lib/cjs/resources/folders.js +72 -0
- package/lib/cjs/resources/grants.js +0 -11
- package/lib/cjs/resources/messages.js +128 -0
- package/lib/cjs/resources/redirectUris.js +1 -1
- package/lib/cjs/resources/resource.js +16 -0
- package/lib/cjs/resources/smartCompose.js +34 -0
- package/lib/cjs/resources/threads.js +54 -0
- package/lib/cjs/utils.js +17 -1
- package/lib/cjs/version.js +1 -1
- package/lib/esm/apiClient.js +57 -32
- package/lib/esm/models/attachments.js +1 -0
- package/lib/esm/models/connectors.js +1 -0
- package/lib/esm/models/contacts.js +1 -0
- package/lib/esm/models/credentials.js +9 -0
- package/lib/esm/models/drafts.js +1 -0
- package/lib/esm/models/files.js +1 -0
- package/lib/esm/models/folders.js +1 -0
- package/lib/esm/models/freeBusy.js +8 -0
- package/lib/esm/models/messages.js +8 -0
- package/lib/esm/models/smartCompose.js +1 -0
- package/lib/esm/models/threads.js +1 -0
- package/lib/esm/models/webhooks.js +3 -0
- package/lib/esm/nylas.js +16 -0
- package/lib/esm/resources/attachments.js +53 -0
- package/lib/esm/resources/auth.js +21 -16
- package/lib/esm/resources/calendars.js +12 -0
- package/lib/esm/resources/connectors.js +64 -0
- package/lib/esm/resources/contacts.js +72 -0
- package/lib/esm/resources/credentials.js +56 -0
- package/lib/esm/resources/drafts.js +77 -0
- package/lib/esm/resources/events.js +14 -0
- package/lib/esm/resources/folders.js +68 -0
- package/lib/esm/resources/grants.js +0 -11
- package/lib/esm/resources/messages.js +124 -0
- package/lib/esm/resources/redirectUris.js +1 -1
- package/lib/esm/resources/resource.js +16 -0
- package/lib/esm/resources/smartCompose.js +30 -0
- package/lib/esm/resources/threads.js +50 -0
- package/lib/esm/utils.js +15 -0
- package/lib/esm/version.js +1 -1
- package/lib/types/apiClient.d.ts +8 -1
- package/lib/types/models/attachments.d.ts +42 -0
- package/lib/types/models/auth.d.ts +5 -1
- package/lib/types/models/calendars.d.ts +1 -1
- package/lib/types/models/connectors.d.ts +123 -0
- package/lib/types/models/contacts.d.ts +148 -0
- package/lib/types/models/credentials.d.ts +151 -0
- package/lib/types/models/drafts.d.ts +92 -0
- package/lib/types/models/events.d.ts +14 -0
- package/lib/types/models/files.d.ts +17 -0
- package/lib/types/models/folders.d.ts +71 -0
- package/lib/types/models/freeBusy.d.ts +79 -0
- package/lib/types/models/messages.d.ts +271 -0
- package/lib/types/models/response.d.ts +6 -6
- package/lib/types/models/smartCompose.d.ts +18 -0
- package/lib/types/models/threads.d.ts +153 -0
- package/lib/types/models/webhooks.d.ts +80 -2
- package/lib/types/nylas.d.ts +40 -0
- package/lib/types/resources/attachments.d.ts +61 -0
- package/lib/types/resources/auth.d.ts +15 -11
- package/lib/types/resources/calendars.d.ts +18 -3
- package/lib/types/resources/connectors.d.ts +80 -0
- package/lib/types/resources/contacts.d.ts +92 -0
- package/lib/types/resources/credentials.d.ts +80 -0
- package/lib/types/resources/drafts.d.ts +87 -0
- package/lib/types/resources/events.d.ts +22 -3
- package/lib/types/resources/folders.d.ts +90 -0
- package/lib/types/resources/grants.d.ts +3 -14
- package/lib/types/resources/messages.d.ts +129 -0
- package/lib/types/resources/redirectUris.d.ts +2 -2
- package/lib/types/resources/resource.d.ts +4 -0
- package/lib/types/resources/smartCompose.d.ts +41 -0
- package/lib/types/resources/threads.d.ts +70 -0
- package/lib/types/resources/webhooks.d.ts +1 -1
- package/lib/types/utils.d.ts +2 -0
- package/lib/types/version.d.ts +1 -1
- package/package.json +5 -3
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import { BaseMessage, BaseCreateMessage } from './messages.js';
|
|
2
|
+
import { ListQueryParams } from './listQueryParams.js';
|
|
3
|
+
/**
|
|
4
|
+
* Interface representing a request to create a draft.
|
|
5
|
+
*/
|
|
6
|
+
export interface CreateDraftRequest extends BaseCreateMessage {
|
|
7
|
+
/**
|
|
8
|
+
* Unix timestamp to send the message at.
|
|
9
|
+
*/
|
|
10
|
+
sendAt?: number;
|
|
11
|
+
/**
|
|
12
|
+
* The ID of the message that you are replying to.
|
|
13
|
+
*/
|
|
14
|
+
replyToMessageId?: string;
|
|
15
|
+
/**
|
|
16
|
+
* Options for tracking opens, links, and thread replies.
|
|
17
|
+
*/
|
|
18
|
+
trackingOptions?: TrackingOptions;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Interface representing a request to send a message.
|
|
22
|
+
*/
|
|
23
|
+
export interface SendMessageRequest extends CreateDraftRequest {
|
|
24
|
+
/**
|
|
25
|
+
* Whether or not to use draft support.
|
|
26
|
+
* This is primarily used when dealing with large attachments.
|
|
27
|
+
*/
|
|
28
|
+
useDraft?: boolean;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Interface representing a Nylas Draft object.
|
|
32
|
+
*/
|
|
33
|
+
export interface Draft extends BaseMessage, Omit<CreateDraftRequest, 'attachments'> {
|
|
34
|
+
/**
|
|
35
|
+
* The type of object.
|
|
36
|
+
*/
|
|
37
|
+
object: 'draft';
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Interface representing a request to update a draft.
|
|
41
|
+
*/
|
|
42
|
+
export type UpdateDraftRequest = Partial<CreateDraftRequest>;
|
|
43
|
+
/**
|
|
44
|
+
* Interface representing the different tracking options for when a message is sent.
|
|
45
|
+
*/
|
|
46
|
+
export interface TrackingOptions {
|
|
47
|
+
label?: string;
|
|
48
|
+
links?: boolean;
|
|
49
|
+
opens?: boolean;
|
|
50
|
+
threadReplies?: boolean;
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* Interface representing the query parameters for listing drafts.
|
|
54
|
+
*/
|
|
55
|
+
export interface ListDraftsQueryParams extends ListQueryParams {
|
|
56
|
+
/**
|
|
57
|
+
* Return items with a matching literal subject.
|
|
58
|
+
*/
|
|
59
|
+
subject?: string;
|
|
60
|
+
/**
|
|
61
|
+
* Return emails that have been sent or received from this list of email addresses.
|
|
62
|
+
*/
|
|
63
|
+
anyEmail?: string[];
|
|
64
|
+
/**
|
|
65
|
+
* Return items containing drafts to be sent these email address.
|
|
66
|
+
*/
|
|
67
|
+
to?: string[];
|
|
68
|
+
/**
|
|
69
|
+
* Return items containing drafts cc'ing these email address.
|
|
70
|
+
*/
|
|
71
|
+
cc?: string[];
|
|
72
|
+
/**
|
|
73
|
+
* Return items containing drafts bcc'ing these email address.
|
|
74
|
+
*/
|
|
75
|
+
bcc?: string[];
|
|
76
|
+
/**
|
|
77
|
+
* Return drafts that are unread.
|
|
78
|
+
*/
|
|
79
|
+
unread?: boolean;
|
|
80
|
+
/**
|
|
81
|
+
* Return drafts that are starred.
|
|
82
|
+
*/
|
|
83
|
+
starred?: boolean;
|
|
84
|
+
/**
|
|
85
|
+
* Return drafts that belong to this thread.
|
|
86
|
+
*/
|
|
87
|
+
threadId?: string;
|
|
88
|
+
/**
|
|
89
|
+
* Return drafts that contain attachments.
|
|
90
|
+
*/
|
|
91
|
+
hasAttachment?: boolean;
|
|
92
|
+
}
|
|
@@ -191,6 +191,12 @@ export interface CreateEventRequest {
|
|
|
191
191
|
* Interface representing a request to update an event.
|
|
192
192
|
*/
|
|
193
193
|
export type UpdateEventRequest = Subset<CreateEventRequest>;
|
|
194
|
+
/**
|
|
195
|
+
* Interface representing a request to send RSVP to an event.
|
|
196
|
+
*/
|
|
197
|
+
export type SendRsvpRequest = {
|
|
198
|
+
status: RsvpStatus;
|
|
199
|
+
};
|
|
194
200
|
/**
|
|
195
201
|
* Interface representing the query parameters for listing events.
|
|
196
202
|
*/
|
|
@@ -290,10 +296,18 @@ export type UpdateEventQueryParams = CreateEventQueryParams;
|
|
|
290
296
|
* Interface representing of the query parameters for destroying events.
|
|
291
297
|
*/
|
|
292
298
|
export type DestroyEventQueryParams = CreateEventQueryParams;
|
|
299
|
+
/**
|
|
300
|
+
* Interface representing of the query parameters for sending RSVP to an event.
|
|
301
|
+
*/
|
|
302
|
+
export type SendRsvpQueryParams = FindEventQueryParams;
|
|
293
303
|
/**
|
|
294
304
|
* Enum representing the status of an event.
|
|
295
305
|
*/
|
|
296
306
|
type Status = 'confirmed' | 'tentative' | 'cancelled';
|
|
307
|
+
/**
|
|
308
|
+
* Enum representing the status of an RSVP response.
|
|
309
|
+
*/
|
|
310
|
+
type RsvpStatus = 'yes' | 'no' | 'maybe';
|
|
297
311
|
/**
|
|
298
312
|
* Enum representing the visibility of an event.
|
|
299
313
|
*/
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
interface BaseFile {
|
|
3
|
+
filename: string;
|
|
4
|
+
contentType: string;
|
|
5
|
+
size?: number;
|
|
6
|
+
isInline?: boolean;
|
|
7
|
+
contentId?: string;
|
|
8
|
+
contentDisposition?: string;
|
|
9
|
+
}
|
|
10
|
+
export interface CreateFileRequest extends BaseFile {
|
|
11
|
+
content: NodeJS.ReadableStream;
|
|
12
|
+
}
|
|
13
|
+
export interface File extends BaseFile {
|
|
14
|
+
id: string;
|
|
15
|
+
grantId: string;
|
|
16
|
+
}
|
|
17
|
+
export {};
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Interface of a folder object from Nylas.
|
|
3
|
+
*/
|
|
4
|
+
export interface Folder {
|
|
5
|
+
/**
|
|
6
|
+
* A globally unique object identifier.
|
|
7
|
+
*/
|
|
8
|
+
id: string;
|
|
9
|
+
/**
|
|
10
|
+
* Folder name.
|
|
11
|
+
*/
|
|
12
|
+
name: string;
|
|
13
|
+
/**
|
|
14
|
+
* The type of object.
|
|
15
|
+
*/
|
|
16
|
+
object: string;
|
|
17
|
+
/**
|
|
18
|
+
* Grant ID of the Nylas account
|
|
19
|
+
*/
|
|
20
|
+
grantId: string;
|
|
21
|
+
/**
|
|
22
|
+
* (Google only) Folder background color.
|
|
23
|
+
*/
|
|
24
|
+
backgroundColor?: string;
|
|
25
|
+
/**
|
|
26
|
+
* (Google only) Indicates if the folder is user created or system created.
|
|
27
|
+
*/
|
|
28
|
+
systemFolder?: boolean;
|
|
29
|
+
/**
|
|
30
|
+
* (Google only) Folder text color.
|
|
31
|
+
*/
|
|
32
|
+
textColor?: string;
|
|
33
|
+
/**
|
|
34
|
+
* (Microsoft only) The number of immediate child folders in the current folder.
|
|
35
|
+
*/
|
|
36
|
+
childCount?: number;
|
|
37
|
+
/**
|
|
38
|
+
* (Microsoft only) ID of the parent folder.
|
|
39
|
+
*/
|
|
40
|
+
parentId?: string;
|
|
41
|
+
/**
|
|
42
|
+
* The number of items inside of a folder.
|
|
43
|
+
*/
|
|
44
|
+
totalCount?: number;
|
|
45
|
+
/**
|
|
46
|
+
* The number of unread items inside of a folder.
|
|
47
|
+
*/
|
|
48
|
+
unreadCount?: number;
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* Interface for creating a new folder.
|
|
52
|
+
*/
|
|
53
|
+
export interface CreateFolderRequest {
|
|
54
|
+
/**
|
|
55
|
+
* Creates a folder with the specified display name. (Constraints: 1 to 1024 chars)
|
|
56
|
+
*/
|
|
57
|
+
name: string;
|
|
58
|
+
/**
|
|
59
|
+
* (Microsoft only) ID of the parent folder.
|
|
60
|
+
*/
|
|
61
|
+
parentId?: string;
|
|
62
|
+
/**
|
|
63
|
+
* (Google only) The text color of the folder in the hexadecimal format "#0099EE". See Google Defined Values for more information.
|
|
64
|
+
*/
|
|
65
|
+
textColor?: string;
|
|
66
|
+
/**
|
|
67
|
+
* (Google only) The background color of the folder in the hexadecimal format "#0099EE". See Google Defined Values for more information.
|
|
68
|
+
*/
|
|
69
|
+
backgroundColor?: string;
|
|
70
|
+
}
|
|
71
|
+
export type UpdateFolderRequest = Partial<CreateFolderRequest>;
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Interface representation of a Nylas free-busy time slot object.
|
|
3
|
+
*/
|
|
4
|
+
export interface FreeBusyTimeSlot {
|
|
5
|
+
/**
|
|
6
|
+
* Unix timestamp for the start of the slot.
|
|
7
|
+
*/
|
|
8
|
+
startTime: number;
|
|
9
|
+
/**
|
|
10
|
+
* Unix timestamp for the end of the slot.
|
|
11
|
+
*/
|
|
12
|
+
endTime: number;
|
|
13
|
+
/**
|
|
14
|
+
* The status of the time slot.
|
|
15
|
+
*/
|
|
16
|
+
status: string;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Class representation of a Nylas get free-busy request
|
|
20
|
+
*/
|
|
21
|
+
export interface GetFreeBusyRequest {
|
|
22
|
+
/**
|
|
23
|
+
* Unix timestamp representing the start of the time block for assessing the account's free/busy schedule.
|
|
24
|
+
*/
|
|
25
|
+
startTime: number;
|
|
26
|
+
/**
|
|
27
|
+
* Unix timestamp representing the end of the time block for assessing the account's free/busy schedule.
|
|
28
|
+
*/
|
|
29
|
+
endTime: number;
|
|
30
|
+
/**
|
|
31
|
+
* A list of email addresses to check the free/busy schedules for.
|
|
32
|
+
*/
|
|
33
|
+
emails: string[];
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Enum representing the type of free/busy information returned for a calendar.
|
|
37
|
+
*/
|
|
38
|
+
export declare enum FreeBusyType {
|
|
39
|
+
FREE_BUSY = "free_busy",
|
|
40
|
+
ERROR = "error"
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Union type of the possible Nylas get free busy response.
|
|
44
|
+
*/
|
|
45
|
+
export type GetFreeBusyResponse = FreeBusy | FreeBusyError;
|
|
46
|
+
/**
|
|
47
|
+
* This interface represents a successful free-busy response.
|
|
48
|
+
*/
|
|
49
|
+
export interface FreeBusy {
|
|
50
|
+
/**
|
|
51
|
+
* The participant's email address.
|
|
52
|
+
*/
|
|
53
|
+
email: string;
|
|
54
|
+
/**
|
|
55
|
+
* A list of busy time slots.
|
|
56
|
+
*/
|
|
57
|
+
timeSlots: FreeBusyTimeSlot[];
|
|
58
|
+
/**
|
|
59
|
+
* The type of the response.
|
|
60
|
+
*/
|
|
61
|
+
object: FreeBusyType.FREE_BUSY;
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* This interface represents a failed free-busy response.
|
|
65
|
+
*/
|
|
66
|
+
export interface FreeBusyError {
|
|
67
|
+
/**
|
|
68
|
+
* The participant's email address.
|
|
69
|
+
*/
|
|
70
|
+
email: string;
|
|
71
|
+
/**
|
|
72
|
+
* Description of the error fetching data for this participant.
|
|
73
|
+
*/
|
|
74
|
+
error: string;
|
|
75
|
+
/**
|
|
76
|
+
* The type of the response.
|
|
77
|
+
*/
|
|
78
|
+
object: FreeBusyType.ERROR;
|
|
79
|
+
}
|
|
@@ -0,0 +1,271 @@
|
|
|
1
|
+
import { EmailName } from './events.js';
|
|
2
|
+
import { CreateFileRequest, File } from './files.js';
|
|
3
|
+
import { ListQueryParams } from './listQueryParams.js';
|
|
4
|
+
/**
|
|
5
|
+
* @internal Internal interface for creating a message.
|
|
6
|
+
*/
|
|
7
|
+
export interface BaseCreateMessage {
|
|
8
|
+
/**
|
|
9
|
+
* An array of message recipients.
|
|
10
|
+
*/
|
|
11
|
+
to: EmailName[];
|
|
12
|
+
/**
|
|
13
|
+
* An array of bcc recipients.
|
|
14
|
+
*/
|
|
15
|
+
bcc?: EmailName[];
|
|
16
|
+
/**
|
|
17
|
+
* An array of cc recipients.
|
|
18
|
+
*/
|
|
19
|
+
cc?: EmailName[];
|
|
20
|
+
/**
|
|
21
|
+
* An array of name and email pairs that override the sent reply-to headers.
|
|
22
|
+
*/
|
|
23
|
+
replyTo?: EmailName[];
|
|
24
|
+
/**
|
|
25
|
+
* An array of files to attach to the message.
|
|
26
|
+
*/
|
|
27
|
+
attachments?: CreateFileRequest[];
|
|
28
|
+
/**
|
|
29
|
+
* A short snippet of the message body.
|
|
30
|
+
* This is the first 100 characters of the message body, with any HTML tags removed.
|
|
31
|
+
*/
|
|
32
|
+
snippet?: string;
|
|
33
|
+
/**
|
|
34
|
+
* The message subject.
|
|
35
|
+
*/
|
|
36
|
+
subject?: string;
|
|
37
|
+
/**
|
|
38
|
+
* A reference to the parent thread object.
|
|
39
|
+
* If this is a new draft, the thread will be empty.
|
|
40
|
+
*/
|
|
41
|
+
threadId?: string;
|
|
42
|
+
/**
|
|
43
|
+
* The full HTML message body.
|
|
44
|
+
* Messages with only plain-text representations are up-converted to HTML.
|
|
45
|
+
*/
|
|
46
|
+
body?: string;
|
|
47
|
+
/**
|
|
48
|
+
* Whether or not the message has been starred by the user.
|
|
49
|
+
*/
|
|
50
|
+
starred?: boolean;
|
|
51
|
+
/**
|
|
52
|
+
* Whether or not the message has been read by the user.
|
|
53
|
+
*/
|
|
54
|
+
unread?: boolean;
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* @internal Internal interface for a message.
|
|
58
|
+
*/
|
|
59
|
+
export interface BaseMessage extends Omit<BaseCreateMessage, 'attachments'> {
|
|
60
|
+
/**
|
|
61
|
+
* The unique identifier for the message.
|
|
62
|
+
*/
|
|
63
|
+
id: string;
|
|
64
|
+
/**
|
|
65
|
+
* Grant ID of the Nylas account.
|
|
66
|
+
*/
|
|
67
|
+
grantId: string;
|
|
68
|
+
/**
|
|
69
|
+
* Unix timestamp of when the message was received by the mail server.
|
|
70
|
+
* This may be different from the unverified Date header in raw message object.
|
|
71
|
+
*/
|
|
72
|
+
date: number;
|
|
73
|
+
/**
|
|
74
|
+
* Unix timestamp of when the message was created.
|
|
75
|
+
*/
|
|
76
|
+
createdAt: number;
|
|
77
|
+
/**
|
|
78
|
+
* The ID of the folder(s) the message appears in.
|
|
79
|
+
*/
|
|
80
|
+
folders: string[];
|
|
81
|
+
/**
|
|
82
|
+
* An array of message senders.
|
|
83
|
+
*/
|
|
84
|
+
from?: EmailName[];
|
|
85
|
+
/**
|
|
86
|
+
* An array of files attached to the message.
|
|
87
|
+
*/
|
|
88
|
+
attachments?: File[];
|
|
89
|
+
}
|
|
90
|
+
/**
|
|
91
|
+
* Interface representing a Nylas Message object.
|
|
92
|
+
*/
|
|
93
|
+
export interface Message extends BaseMessage {
|
|
94
|
+
/**
|
|
95
|
+
* The type of object.
|
|
96
|
+
*/
|
|
97
|
+
object: 'message';
|
|
98
|
+
/**
|
|
99
|
+
* The message headers.
|
|
100
|
+
* Only present if the 'fields' query parameter is set to includeHeaders.
|
|
101
|
+
*/
|
|
102
|
+
headers?: MessageHeaders[];
|
|
103
|
+
/**
|
|
104
|
+
* A list of key-value pairs storing additional data.
|
|
105
|
+
*/
|
|
106
|
+
metadata?: Record<string, unknown>;
|
|
107
|
+
}
|
|
108
|
+
/**
|
|
109
|
+
* Interface representing a request to update a message.
|
|
110
|
+
*/
|
|
111
|
+
export interface UpdateMessageRequest {
|
|
112
|
+
/**
|
|
113
|
+
* Sets the message as starred or unstarred.
|
|
114
|
+
*/
|
|
115
|
+
starred?: boolean;
|
|
116
|
+
/**
|
|
117
|
+
* Sets the message as read or unread.
|
|
118
|
+
*/
|
|
119
|
+
unread?: boolean;
|
|
120
|
+
/**
|
|
121
|
+
* The IDs of the folders the message should appear in.
|
|
122
|
+
*/
|
|
123
|
+
folders?: string[];
|
|
124
|
+
/**
|
|
125
|
+
* A list of key-value pairs storing additional data.
|
|
126
|
+
*/
|
|
127
|
+
metadata?: Record<string, unknown>;
|
|
128
|
+
}
|
|
129
|
+
/**
|
|
130
|
+
* Interface representing a message header.
|
|
131
|
+
*/
|
|
132
|
+
export interface MessageHeaders {
|
|
133
|
+
/**
|
|
134
|
+
* The header name.
|
|
135
|
+
*/
|
|
136
|
+
name: string;
|
|
137
|
+
/**
|
|
138
|
+
* The header value.
|
|
139
|
+
*/
|
|
140
|
+
value: string;
|
|
141
|
+
}
|
|
142
|
+
/**
|
|
143
|
+
* Enum representing the message fields that can be included in a response.
|
|
144
|
+
*/
|
|
145
|
+
export declare enum MessageFields {
|
|
146
|
+
STANDARD = "standard",
|
|
147
|
+
INCLUDE_HEADERS = "include_headers"
|
|
148
|
+
}
|
|
149
|
+
/**
|
|
150
|
+
* Interface representing information about a scheduled message.
|
|
151
|
+
*/
|
|
152
|
+
export interface ScheduledMessage {
|
|
153
|
+
/**
|
|
154
|
+
* The unique identifier for the scheduled message.
|
|
155
|
+
*/
|
|
156
|
+
scheduleId: number;
|
|
157
|
+
/**
|
|
158
|
+
* The status of the scheduled message.
|
|
159
|
+
*/
|
|
160
|
+
status: ScheduledMessageStatus;
|
|
161
|
+
/**
|
|
162
|
+
* The time the message was sent or failed to send, in epoch time.
|
|
163
|
+
*/
|
|
164
|
+
closeTime?: number;
|
|
165
|
+
}
|
|
166
|
+
/**
|
|
167
|
+
* Interface representing a list of scheduled messages.
|
|
168
|
+
*/
|
|
169
|
+
export interface ScheduledMessagesList {
|
|
170
|
+
/**
|
|
171
|
+
* The list of scheduled messages.
|
|
172
|
+
*/
|
|
173
|
+
schedules: ScheduledMessage[];
|
|
174
|
+
}
|
|
175
|
+
/**
|
|
176
|
+
* Interface representing a scheduled message status.
|
|
177
|
+
*/
|
|
178
|
+
export interface ScheduledMessageStatus {
|
|
179
|
+
/**
|
|
180
|
+
* The status code the describes the state of the scheduled message
|
|
181
|
+
*/
|
|
182
|
+
code: string;
|
|
183
|
+
/**
|
|
184
|
+
* A description of the status of the scheduled message
|
|
185
|
+
*/
|
|
186
|
+
description: string;
|
|
187
|
+
}
|
|
188
|
+
/**
|
|
189
|
+
* Interface representing a response after stopping a scheduled message.
|
|
190
|
+
*/
|
|
191
|
+
export interface StopScheduledMessageResponse {
|
|
192
|
+
/**
|
|
193
|
+
* A message describing the result of the request.
|
|
194
|
+
*/
|
|
195
|
+
message: string;
|
|
196
|
+
}
|
|
197
|
+
/**
|
|
198
|
+
* Interface representing the query parameters for listing messages.
|
|
199
|
+
*/
|
|
200
|
+
export interface ListMessagesQueryParams extends ListQueryParams {
|
|
201
|
+
/**
|
|
202
|
+
* Return items with a matching literal subject.
|
|
203
|
+
*/
|
|
204
|
+
subject?: string;
|
|
205
|
+
/**
|
|
206
|
+
* Return emails that have been sent or received from this list of email addresses.
|
|
207
|
+
*/
|
|
208
|
+
anyEmail?: string[];
|
|
209
|
+
/**
|
|
210
|
+
* Return items containing messages sent to these email address.
|
|
211
|
+
*/
|
|
212
|
+
to?: string[];
|
|
213
|
+
/**
|
|
214
|
+
* Return items containing messages sent from these email address.
|
|
215
|
+
*/
|
|
216
|
+
from?: string[];
|
|
217
|
+
/**
|
|
218
|
+
* Return items containing messages cc'd on these email address.
|
|
219
|
+
*/
|
|
220
|
+
cc?: string[];
|
|
221
|
+
/**
|
|
222
|
+
* Return items containing messages bcc'd on these email address.
|
|
223
|
+
*/
|
|
224
|
+
bcc?: string[];
|
|
225
|
+
/**
|
|
226
|
+
* Return emails that are in these folder IDs.
|
|
227
|
+
*/
|
|
228
|
+
in?: string[];
|
|
229
|
+
/**
|
|
230
|
+
* Return emails that are unread.
|
|
231
|
+
*/
|
|
232
|
+
unread?: boolean;
|
|
233
|
+
/**
|
|
234
|
+
* Return emails that are starred.
|
|
235
|
+
*/
|
|
236
|
+
starred?: boolean;
|
|
237
|
+
/**
|
|
238
|
+
* Return emails that belong to this thread.
|
|
239
|
+
*/
|
|
240
|
+
threadId?: string;
|
|
241
|
+
/**
|
|
242
|
+
* Return emails that have been received before this timestamp.
|
|
243
|
+
*/
|
|
244
|
+
receivedBefore?: number;
|
|
245
|
+
/**
|
|
246
|
+
* Return emails that have been received after this timestamp.
|
|
247
|
+
*/
|
|
248
|
+
receivedAfter?: number;
|
|
249
|
+
/**
|
|
250
|
+
* Return emails that contain attachments.
|
|
251
|
+
*/
|
|
252
|
+
hasAttachment?: boolean;
|
|
253
|
+
/**
|
|
254
|
+
* Allows you to specify to return messages with headers included.
|
|
255
|
+
*/
|
|
256
|
+
fields?: MessageFields;
|
|
257
|
+
/**
|
|
258
|
+
* The provider-specific query string used to search messages.
|
|
259
|
+
* Available for Google and Microsoft Graph only.
|
|
260
|
+
*/
|
|
261
|
+
searchQueryNative?: string;
|
|
262
|
+
}
|
|
263
|
+
/**
|
|
264
|
+
* Interface representing the query parameters for finding a message.
|
|
265
|
+
*/
|
|
266
|
+
export interface FindMessageQueryParams {
|
|
267
|
+
/**
|
|
268
|
+
* Allows you to specify to the message with headers included.
|
|
269
|
+
*/
|
|
270
|
+
fields?: MessageFields;
|
|
271
|
+
}
|
|
@@ -1,3 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Interface representing a base response to a request.
|
|
3
|
+
*/
|
|
4
|
+
export interface NylasBaseResponse {
|
|
5
|
+
requestId: string;
|
|
6
|
+
}
|
|
1
7
|
/**
|
|
2
8
|
* Interface representation of a Nylas response object
|
|
3
9
|
*/
|
|
@@ -28,12 +34,6 @@ export interface NylasListResponse<T> {
|
|
|
28
34
|
*/
|
|
29
35
|
nextCursor?: string;
|
|
30
36
|
}
|
|
31
|
-
/**
|
|
32
|
-
* Interface representing a response to a delete request.
|
|
33
|
-
*/
|
|
34
|
-
export interface NylasDeleteResponse {
|
|
35
|
-
requestId: string;
|
|
36
|
-
}
|
|
37
37
|
/**
|
|
38
38
|
* Helper type for pagination
|
|
39
39
|
*/
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Interface representing a request to compose a message.
|
|
3
|
+
*/
|
|
4
|
+
export interface ComposeMessageRequest {
|
|
5
|
+
/**
|
|
6
|
+
* The prompt that smart compose will use to generate a message suggestion.
|
|
7
|
+
*/
|
|
8
|
+
prompt: string;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Interface representing a response to a message composition request.
|
|
12
|
+
*/
|
|
13
|
+
export interface ComposeMessageResponse {
|
|
14
|
+
/**
|
|
15
|
+
* The message suggestion generated by smart compose.
|
|
16
|
+
*/
|
|
17
|
+
suggestion: string;
|
|
18
|
+
}
|