nylas 7.0.0-beta.2 → 7.0.0-beta.3
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 +7 -0
- package/lib/cjs/models/connectors.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/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 +8 -0
- package/lib/cjs/resources/auth.js +8 -6
- package/lib/cjs/resources/calendars.js +12 -0
- package/lib/cjs/resources/connectors.js +68 -0
- package/lib/cjs/resources/credentials.js +60 -0
- package/lib/cjs/resources/drafts.js +81 -0
- package/lib/cjs/resources/grants.js +2 -2
- package/lib/cjs/resources/messages.js +121 -0
- package/lib/cjs/resources/redirectUris.js +1 -1
- 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 +7 -0
- package/lib/esm/models/connectors.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/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 +8 -0
- package/lib/esm/resources/auth.js +8 -6
- package/lib/esm/resources/calendars.js +12 -0
- package/lib/esm/resources/connectors.js +64 -0
- package/lib/esm/resources/credentials.js +56 -0
- package/lib/esm/resources/drafts.js +77 -0
- package/lib/esm/resources/grants.js +2 -2
- package/lib/esm/resources/messages.js +117 -0
- package/lib/esm/resources/redirectUris.js +1 -1
- 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 +3 -1
- package/lib/types/models/auth.d.ts +1 -1
- package/lib/types/models/calendars.d.ts +1 -1
- package/lib/types/models/connectors.d.ts +127 -0
- package/lib/types/models/credentials.d.ts +151 -0
- package/lib/types/models/drafts.d.ts +92 -0
- package/lib/types/models/files.d.ts +17 -0
- package/lib/types/models/freeBusy.d.ts +79 -0
- package/lib/types/models/messages.d.ts +271 -0
- 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 +20 -0
- package/lib/types/resources/calendars.d.ts +16 -1
- package/lib/types/resources/connectors.d.ts +80 -0
- package/lib/types/resources/credentials.d.ts +80 -0
- package/lib/types/resources/drafts.d.ts +87 -0
- package/lib/types/resources/grants.d.ts +1 -1
- package/lib/types/resources/messages.d.ts +129 -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,80 @@
|
|
|
1
|
+
import { AsyncListResponse, Resource } from './resource.js';
|
|
2
|
+
import { Credential, CreateCredentialRequest, ListCredentialsQueryParams, UpdateCredentialRequest } from '../models/credentials.js';
|
|
3
|
+
import { Overrides } from '../config.js';
|
|
4
|
+
import { NylasDeleteResponse, NylasListResponse, NylasResponse } from '../models/response.js';
|
|
5
|
+
import { Provider } from '../models/auth.js';
|
|
6
|
+
/**
|
|
7
|
+
* The parameters for the {@link Credentials.find} method
|
|
8
|
+
* @property provider The provider associated to the credential to retrieve.
|
|
9
|
+
* @property credentialsId The id of the credentials to retrieve.
|
|
10
|
+
*/
|
|
11
|
+
interface FindCredentialParams {
|
|
12
|
+
provider: Provider;
|
|
13
|
+
credentialsId: string;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* The parameters for the {@link Credentials.list} method
|
|
17
|
+
* @property provider The provider associated to the credential to list from.
|
|
18
|
+
* @property queryParams The query parameters to include in the request
|
|
19
|
+
*/
|
|
20
|
+
interface ListCredentialsParams {
|
|
21
|
+
provider: Provider;
|
|
22
|
+
queryParams?: ListCredentialsQueryParams;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* The parameters for the {@link Credentials.create} method
|
|
26
|
+
* @property provider The provider associated to the credential being created.
|
|
27
|
+
* @property requestBody The request body to create a credential
|
|
28
|
+
*/
|
|
29
|
+
interface CreateCredentialParams {
|
|
30
|
+
provider: Provider;
|
|
31
|
+
requestBody: CreateCredentialRequest;
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* The parameters for the {@link Credentials.update} method
|
|
35
|
+
* @property provider The provider associated to the credential to update from.
|
|
36
|
+
* @property requestBody The request body to create a credential
|
|
37
|
+
* @property credentialsId The id of the credentials to update.
|
|
38
|
+
*/
|
|
39
|
+
interface UpdateCredentialParams {
|
|
40
|
+
provider: Provider;
|
|
41
|
+
credentialsId: string;
|
|
42
|
+
requestBody: UpdateCredentialRequest;
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* The parameters for the {@link Credentials.destroy} method
|
|
46
|
+
* @property provider The provider associated to the credential to delete from.
|
|
47
|
+
* @property credentialsId The id of the credentials to delete.
|
|
48
|
+
*/
|
|
49
|
+
interface DestroyCredentialParams {
|
|
50
|
+
provider: string;
|
|
51
|
+
credentialsId: string;
|
|
52
|
+
}
|
|
53
|
+
export declare class Credentials extends Resource {
|
|
54
|
+
/**
|
|
55
|
+
* Return all credentials
|
|
56
|
+
* @return A list of credentials
|
|
57
|
+
*/
|
|
58
|
+
list({ provider, queryParams, overrides, }: ListCredentialsParams & ListCredentialsQueryParams & Overrides): AsyncListResponse<NylasListResponse<Credential>>;
|
|
59
|
+
/**
|
|
60
|
+
* Return a credential
|
|
61
|
+
* @return The credential
|
|
62
|
+
*/
|
|
63
|
+
find({ provider, credentialsId, overrides, }: FindCredentialParams & Overrides): Promise<NylasResponse<Credential>>;
|
|
64
|
+
/**
|
|
65
|
+
* Create a credential
|
|
66
|
+
* @return The created credential
|
|
67
|
+
*/
|
|
68
|
+
create({ provider, requestBody, overrides, }: CreateCredentialParams & Overrides): Promise<NylasResponse<Credential>>;
|
|
69
|
+
/**
|
|
70
|
+
* Update a credential
|
|
71
|
+
* @return The updated credential
|
|
72
|
+
*/
|
|
73
|
+
update({ provider, credentialsId, requestBody, overrides, }: UpdateCredentialParams & Overrides): Promise<NylasResponse<Credential>>;
|
|
74
|
+
/**
|
|
75
|
+
* Delete a credential
|
|
76
|
+
* @return The deleted credential
|
|
77
|
+
*/
|
|
78
|
+
destroy({ provider, credentialsId, overrides, }: DestroyCredentialParams & Overrides): Promise<NylasDeleteResponse>;
|
|
79
|
+
}
|
|
80
|
+
export {};
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import { AsyncListResponse, Resource } from './resource.js';
|
|
2
|
+
import { CreateDraftRequest, Draft, ListDraftsQueryParams, UpdateDraftRequest } from '../models/drafts.js';
|
|
3
|
+
import { Overrides } from '../config.js';
|
|
4
|
+
import { NylasDeleteResponse, NylasListResponse, NylasResponse } from '../models/response.js';
|
|
5
|
+
/**
|
|
6
|
+
* The parameters for the {@link Drafts.list} method
|
|
7
|
+
* @property identifier The identifier of the grant to act upon
|
|
8
|
+
* @property queryParams The query parameters to include in the request
|
|
9
|
+
*/
|
|
10
|
+
export interface ListDraftsParams {
|
|
11
|
+
identifier: string;
|
|
12
|
+
queryParams?: ListDraftsQueryParams;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* The parameters for the {@link Drafts.find} method
|
|
16
|
+
* @property identifier The identifier of the grant to act upon
|
|
17
|
+
* @property draftId The id of the draft to retrieve.
|
|
18
|
+
*/
|
|
19
|
+
export interface FindDraftParams {
|
|
20
|
+
identifier: string;
|
|
21
|
+
draftId: string;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* The parameters for the {@link Drafts.create} method
|
|
25
|
+
* @property identifier The identifier of the grant to act upon
|
|
26
|
+
* @property requestBody The values to create the message with
|
|
27
|
+
*/
|
|
28
|
+
export interface CreateDraftParams {
|
|
29
|
+
identifier: string;
|
|
30
|
+
requestBody: CreateDraftRequest;
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* The parameters for the {@link Drafts.update} method
|
|
34
|
+
* @property identifier The identifier of the grant to act upon
|
|
35
|
+
* @property draftId The id of the draft to update.
|
|
36
|
+
* @property requestBody The values to update the draft with
|
|
37
|
+
*/
|
|
38
|
+
export interface UpdateDraftParams {
|
|
39
|
+
identifier: string;
|
|
40
|
+
draftId: string;
|
|
41
|
+
requestBody: UpdateDraftRequest;
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* The parameters for the {@link Drafts.destroy} method
|
|
45
|
+
*/
|
|
46
|
+
export type DestroyDraftParams = FindDraftParams;
|
|
47
|
+
/**
|
|
48
|
+
* The parameters for the {@link Drafts.send} method
|
|
49
|
+
*/
|
|
50
|
+
export type SendDraftParams = FindDraftParams;
|
|
51
|
+
/**
|
|
52
|
+
* Nylas Drafts API
|
|
53
|
+
*
|
|
54
|
+
* The Nylas Drafts API allows you to list, find, update, delete, and send drafts on user accounts.
|
|
55
|
+
*/
|
|
56
|
+
export declare class Drafts extends Resource {
|
|
57
|
+
/**
|
|
58
|
+
* Return all Drafts
|
|
59
|
+
* @return A list of drafts
|
|
60
|
+
*/
|
|
61
|
+
list({ identifier, queryParams, overrides, }: ListDraftsParams & Overrides): AsyncListResponse<NylasListResponse<Draft>>;
|
|
62
|
+
/**
|
|
63
|
+
* Return a Draft
|
|
64
|
+
* @return The draft
|
|
65
|
+
*/
|
|
66
|
+
find({ identifier, draftId, overrides, }: FindDraftParams & Overrides): Promise<NylasResponse<Draft>>;
|
|
67
|
+
/**
|
|
68
|
+
* Return a Draft
|
|
69
|
+
* @return The draft
|
|
70
|
+
*/
|
|
71
|
+
create({ identifier, requestBody, overrides, }: CreateDraftParams & Overrides): Promise<NylasResponse<Draft>>;
|
|
72
|
+
/**
|
|
73
|
+
* Update a Draft
|
|
74
|
+
* @return The updated draft
|
|
75
|
+
*/
|
|
76
|
+
update({ identifier, draftId, requestBody, overrides, }: UpdateDraftParams & Overrides): Promise<NylasResponse<Draft>>;
|
|
77
|
+
/**
|
|
78
|
+
* Delete a Draft
|
|
79
|
+
* @return The deleted draft
|
|
80
|
+
*/
|
|
81
|
+
destroy({ identifier, draftId, overrides, }: DestroyDraftParams & Overrides): Promise<NylasDeleteResponse>;
|
|
82
|
+
/**
|
|
83
|
+
* Send a Draft
|
|
84
|
+
* @return The sent draft
|
|
85
|
+
*/
|
|
86
|
+
send({ identifier, draftId, overrides, }: SendDraftParams & Overrides): Promise<NylasResponse<Draft>>;
|
|
87
|
+
}
|
|
@@ -45,7 +45,7 @@ export declare class Grants extends Resource {
|
|
|
45
45
|
*/
|
|
46
46
|
find({ grantId, overrides, }: FindGrantParams & Overrides): Promise<NylasResponse<Grant>>;
|
|
47
47
|
/**
|
|
48
|
-
* Create a Grant
|
|
48
|
+
* Create a Grant via Custom Authentication
|
|
49
49
|
* @return The created Grant
|
|
50
50
|
*/
|
|
51
51
|
create({ requestBody, overrides, }: CreateGrantParams & Overrides): Promise<NylasResponse<Grant>>;
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
import { AsyncListResponse, Resource } from './resource.js';
|
|
2
|
+
import { BaseCreateMessage, FindMessageQueryParams, ListMessagesQueryParams, Message, ScheduledMessage, ScheduledMessagesList, StopScheduledMessageResponse, UpdateMessageRequest } from '../models/messages.js';
|
|
3
|
+
import { Overrides } from '../config.js';
|
|
4
|
+
import { NylasDeleteResponse, NylasListResponse, NylasResponse } from '../models/response.js';
|
|
5
|
+
import { SendMessageRequest, UpdateDraftRequest } from '../models/drafts.js';
|
|
6
|
+
import * as FormData from 'form-data';
|
|
7
|
+
import { SmartCompose } from './smartCompose.js';
|
|
8
|
+
import APIClient from '../apiClient.js';
|
|
9
|
+
/**
|
|
10
|
+
* The parameters for the {@link Messages.list} method
|
|
11
|
+
* @property identifier The identifier of the grant to act upon
|
|
12
|
+
* @property queryParams The query parameters to include in the request
|
|
13
|
+
*/
|
|
14
|
+
export interface ListMessagesParams {
|
|
15
|
+
identifier: string;
|
|
16
|
+
queryParams?: ListMessagesQueryParams;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* The parameters for the {@link Messages.find} method
|
|
20
|
+
* @property identifier The identifier of the grant to act upon
|
|
21
|
+
* @property messageId The id of the message to retrieve.
|
|
22
|
+
* @property queryParams The query parameters to include in the request
|
|
23
|
+
*/
|
|
24
|
+
export interface FindMessageParams {
|
|
25
|
+
identifier: string;
|
|
26
|
+
messageId: string;
|
|
27
|
+
queryParams?: FindMessageQueryParams;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* The parameters for the {@link Messages.update} method
|
|
31
|
+
* @property identifier The identifier of the grant to act upon
|
|
32
|
+
* @property messageId The id of the message to update
|
|
33
|
+
* @property requestBody The values to update the message with
|
|
34
|
+
*/
|
|
35
|
+
export interface UpdateMessageParams {
|
|
36
|
+
identifier: string;
|
|
37
|
+
messageId: string;
|
|
38
|
+
requestBody: UpdateMessageRequest;
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* The parameters for the {@link Messages.destroy} method
|
|
42
|
+
* @property identifier The identifier of the grant to act upon
|
|
43
|
+
* @property messageId The id of the message to delete
|
|
44
|
+
*/
|
|
45
|
+
export interface DestroyMessageParams {
|
|
46
|
+
identifier: string;
|
|
47
|
+
messageId: string;
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* The parameters for the {@link Messages.send} method
|
|
51
|
+
* @property identifier The identifier of the grant to act upon
|
|
52
|
+
* @property requestBody The message to send
|
|
53
|
+
*/
|
|
54
|
+
export interface SendMessageParams {
|
|
55
|
+
identifier: string;
|
|
56
|
+
requestBody: SendMessageRequest;
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* The parameters for the {@link Messages.listScheduledMessages} method
|
|
60
|
+
* @property identifier The identifier of the grant to act upon
|
|
61
|
+
*/
|
|
62
|
+
export interface ListScheduledMessagesParams {
|
|
63
|
+
identifier: string;
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* The parameters for the {@link Messages.findScheduledMessage} method
|
|
67
|
+
* @property identifier The identifier of the grant to act upon
|
|
68
|
+
* @property scheduleId The id of the scheduled message to retrieve.
|
|
69
|
+
*/
|
|
70
|
+
export interface FindScheduledMessageParams {
|
|
71
|
+
identifier: string;
|
|
72
|
+
scheduleId: string;
|
|
73
|
+
}
|
|
74
|
+
/**
|
|
75
|
+
* The parameters for the {@link Messages.stopScheduledMessage} method
|
|
76
|
+
* @property identifier The identifier of the grant to act upon
|
|
77
|
+
* @property scheduleId The id of the scheduled message to destroy.
|
|
78
|
+
*/
|
|
79
|
+
export type StopScheduledMessageParams = FindScheduledMessageParams;
|
|
80
|
+
/**
|
|
81
|
+
* Nylas Messages API
|
|
82
|
+
*
|
|
83
|
+
* The Nylas Messages API allows you to list, find, update, delete, schedule, and send messages on user accounts.
|
|
84
|
+
*/
|
|
85
|
+
export declare class Messages extends Resource {
|
|
86
|
+
smartCompose: SmartCompose;
|
|
87
|
+
constructor(apiClient: APIClient);
|
|
88
|
+
/**
|
|
89
|
+
* Return all Messages
|
|
90
|
+
* @return A list of messages
|
|
91
|
+
*/
|
|
92
|
+
list({ identifier, queryParams, overrides, }: ListMessagesParams & Overrides): AsyncListResponse<NylasListResponse<Message>>;
|
|
93
|
+
/**
|
|
94
|
+
* Return a Message
|
|
95
|
+
* @return The message
|
|
96
|
+
*/
|
|
97
|
+
find({ identifier, messageId, overrides, }: FindMessageParams & Overrides): Promise<NylasResponse<Message>>;
|
|
98
|
+
/**
|
|
99
|
+
* Update a Message
|
|
100
|
+
* @return The updated message
|
|
101
|
+
*/
|
|
102
|
+
update({ identifier, messageId, requestBody, overrides, }: UpdateMessageParams & Overrides): Promise<NylasResponse<Message>>;
|
|
103
|
+
/**
|
|
104
|
+
* Delete a Message
|
|
105
|
+
* @return The deleted message
|
|
106
|
+
*/
|
|
107
|
+
destroy({ identifier, messageId, overrides, }: DestroyMessageParams & Overrides): Promise<NylasDeleteResponse>;
|
|
108
|
+
/**
|
|
109
|
+
* Send an email
|
|
110
|
+
* @return The sent message
|
|
111
|
+
*/
|
|
112
|
+
send({ identifier, requestBody, overrides, }: SendMessageParams & Overrides): Promise<NylasResponse<Message>>;
|
|
113
|
+
/**
|
|
114
|
+
* Retrieve your scheduled messages
|
|
115
|
+
* @return A list of scheduled messages
|
|
116
|
+
*/
|
|
117
|
+
listScheduledMessages({ identifier, overrides, }: ListScheduledMessagesParams & Overrides): Promise<NylasResponse<ScheduledMessagesList>>;
|
|
118
|
+
/**
|
|
119
|
+
* Retrieve a scheduled message
|
|
120
|
+
* @return The scheduled message
|
|
121
|
+
*/
|
|
122
|
+
findScheduledMessage({ identifier, scheduleId, overrides, }: FindScheduledMessageParams & Overrides): Promise<NylasResponse<ScheduledMessage>>;
|
|
123
|
+
/**
|
|
124
|
+
* Stop a scheduled message
|
|
125
|
+
* @return The confirmation of the stopped scheduled message
|
|
126
|
+
*/
|
|
127
|
+
stopScheduledMessage({ identifier, scheduleId, overrides, }: StopScheduledMessageParams & Overrides): Promise<NylasResponse<StopScheduledMessageResponse>>;
|
|
128
|
+
static _buildFormRequest(requestBody: BaseCreateMessage | UpdateDraftRequest): FormData;
|
|
129
|
+
}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { Resource } from './resource.js';
|
|
2
|
+
import { ComposeMessageRequest, ComposeMessageResponse } from '../models/smartCompose.js';
|
|
3
|
+
import { Overrides } from '../config.js';
|
|
4
|
+
import { NylasResponse } from '../models/response.js';
|
|
5
|
+
/**
|
|
6
|
+
* The parameters for the {@link SmartCompose.composeMessage} method
|
|
7
|
+
* @property identifier The identifier of the grant to act upon
|
|
8
|
+
* @property requestBody The prompt that smart compose will use to generate a message suggestion
|
|
9
|
+
*/
|
|
10
|
+
export interface ComposeMessageParams {
|
|
11
|
+
identifier: string;
|
|
12
|
+
requestBody: ComposeMessageRequest;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* The parameters for the {@link SmartCompose.composeMessageReply} method
|
|
16
|
+
* @property identifier The identifier of the grant to act upon
|
|
17
|
+
* @property messageId The id of the message to reply to
|
|
18
|
+
* @property requestBody The prompt that smart compose will use to generate a reply suggestion
|
|
19
|
+
*/
|
|
20
|
+
export interface ComposeMessageReplyParams {
|
|
21
|
+
identifier: string;
|
|
22
|
+
messageId: string;
|
|
23
|
+
requestBody: ComposeMessageRequest;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* A collection of Smart Compose related API endpoints.
|
|
27
|
+
*
|
|
28
|
+
* These endpoints allow for the generation of message suggestions.
|
|
29
|
+
*/
|
|
30
|
+
export declare class SmartCompose extends Resource {
|
|
31
|
+
/**
|
|
32
|
+
* Compose a message
|
|
33
|
+
* @return The generated message
|
|
34
|
+
*/
|
|
35
|
+
composeMessage({ identifier, requestBody, overrides, }: ComposeMessageParams & Overrides): Promise<NylasResponse<ComposeMessageResponse>>;
|
|
36
|
+
/**
|
|
37
|
+
* Compose a message reply
|
|
38
|
+
* @return The generated message reply
|
|
39
|
+
*/
|
|
40
|
+
composeMessageReply({ identifier, messageId, requestBody, overrides, }: ComposeMessageReplyParams & Overrides): Promise<NylasResponse<ComposeMessageResponse>>;
|
|
41
|
+
}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import { ListThreadsQueryParams, Thread, UpdateThreadRequest } from '../models/threads.js';
|
|
2
|
+
import { AsyncListResponse, Resource } from './resource.js';
|
|
3
|
+
import { Overrides } from '../config.js';
|
|
4
|
+
import { NylasDeleteResponse, NylasListResponse, NylasResponse } from '../models/response.js';
|
|
5
|
+
/**
|
|
6
|
+
* The parameters for the {@link Threads.list} method
|
|
7
|
+
* @property identifier The identifier of the grant to act upon
|
|
8
|
+
* @property queryParams The query parameters to include in the request
|
|
9
|
+
*/
|
|
10
|
+
export interface ListThreadsParams {
|
|
11
|
+
identifier: string;
|
|
12
|
+
queryParams?: ListThreadsQueryParams;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* The parameters for the {@link Threads.find} method
|
|
16
|
+
* @property identifier The identifier of the grant to act upon
|
|
17
|
+
* @property threadId The id of the thread to retrieve.
|
|
18
|
+
* @property queryParams The query parameters to include in the request
|
|
19
|
+
*/
|
|
20
|
+
export interface FindThreadParams {
|
|
21
|
+
identifier: string;
|
|
22
|
+
threadId: string;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* The parameters for the {@link Threads.update} method
|
|
26
|
+
* @property identifier The identifier of the grant to act upon
|
|
27
|
+
* @property threadId The id of the thread to update
|
|
28
|
+
* @property requestBody The values to update the thread with
|
|
29
|
+
*/
|
|
30
|
+
export interface UpdateThreadParams {
|
|
31
|
+
identifier: string;
|
|
32
|
+
threadId: string;
|
|
33
|
+
requestBody: UpdateThreadRequest;
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* The parameters for the {@link Threads.destroy} method
|
|
37
|
+
* @property identifier The identifier of the grant to act upon
|
|
38
|
+
* @property threadId The id of the thread to delete
|
|
39
|
+
*/
|
|
40
|
+
export interface DestroyThreadParams {
|
|
41
|
+
identifier: string;
|
|
42
|
+
threadId: string;
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* Nylas Threads API
|
|
46
|
+
*
|
|
47
|
+
* The Nylas Threads API allows you to list, find, update, and delete threads on user accounts.
|
|
48
|
+
*/
|
|
49
|
+
export declare class Threads extends Resource {
|
|
50
|
+
/**
|
|
51
|
+
* Return all Threads
|
|
52
|
+
* @return A list of threads
|
|
53
|
+
*/
|
|
54
|
+
list({ identifier, queryParams, overrides, }: ListThreadsParams & Overrides): AsyncListResponse<NylasListResponse<Thread>>;
|
|
55
|
+
/**
|
|
56
|
+
* Return a Thread
|
|
57
|
+
* @return The thread
|
|
58
|
+
*/
|
|
59
|
+
find({ identifier, threadId, overrides, }: FindThreadParams & Overrides): Promise<NylasResponse<Thread>>;
|
|
60
|
+
/**
|
|
61
|
+
* Update a Thread
|
|
62
|
+
* @return The updated thread
|
|
63
|
+
*/
|
|
64
|
+
update({ identifier, threadId, requestBody, overrides, }: UpdateThreadParams & Overrides): Promise<NylasResponse<Thread>>;
|
|
65
|
+
/**
|
|
66
|
+
* Delete a Thread
|
|
67
|
+
* @return The deleted thread
|
|
68
|
+
*/
|
|
69
|
+
destroy({ identifier, threadId, overrides, }: DestroyThreadParams & Overrides): Promise<NylasDeleteResponse>;
|
|
70
|
+
}
|
|
@@ -48,7 +48,7 @@ export declare class Webhooks extends Resource {
|
|
|
48
48
|
* Create a webhook destination
|
|
49
49
|
* @returns The created webhook destination
|
|
50
50
|
*/
|
|
51
|
-
create({ requestBody, overrides, }: CreateWebhookParams & Overrides): Promise<NylasResponse<
|
|
51
|
+
create({ requestBody, overrides, }: CreateWebhookParams & Overrides): Promise<NylasResponse<WebhookWithSecret>>;
|
|
52
52
|
/**
|
|
53
53
|
* Update a webhook destination
|
|
54
54
|
* @returns The updated webhook destination
|
package/lib/types/utils.d.ts
CHANGED
package/lib/types/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const SDK_VERSION = "7.0.0-beta.
|
|
1
|
+
export declare const SDK_VERSION = "7.0.0-beta.3";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "nylas",
|
|
3
|
-
"version": "7.0.0-beta.
|
|
3
|
+
"version": "7.0.0-beta.3",
|
|
4
4
|
"description": "A NodeJS wrapper for the Nylas REST API for email, contacts, and calendar.",
|
|
5
5
|
"main": "lib/cjs/nylas.js",
|
|
6
6
|
"types": "lib/types/nylas.d.ts",
|
|
@@ -40,15 +40,16 @@
|
|
|
40
40
|
"dependencies": {
|
|
41
41
|
"change-case": "^4.1.2",
|
|
42
42
|
"eslint-plugin-import": "^2.28.1",
|
|
43
|
+
"form-data": "^4.0.0",
|
|
44
|
+
"mime-types": "^2.1.35",
|
|
43
45
|
"node-fetch": "^2.6.12",
|
|
44
|
-
"sha256": "^0.2.0",
|
|
45
46
|
"uuid": "^8.3.2"
|
|
46
47
|
},
|
|
47
48
|
"devDependencies": {
|
|
48
49
|
"@babel/core": "^7.3.3",
|
|
49
50
|
"@types/jest": "^29.5.2",
|
|
51
|
+
"@types/mime-types": "^2.1.2",
|
|
50
52
|
"@types/node-fetch": "^2.6.4",
|
|
51
|
-
"@types/sha256": "^0.2.0",
|
|
52
53
|
"@types/uuid": "^8.3.4",
|
|
53
54
|
"@typescript-eslint/eslint-plugin": "^2.25.0",
|
|
54
55
|
"@typescript-eslint/parser": "^2.25.0",
|
|
@@ -56,6 +57,7 @@
|
|
|
56
57
|
"eslint-config-prettier": "^4.0.0",
|
|
57
58
|
"eslint-plugin-custom-rules": "^0.0.0",
|
|
58
59
|
"eslint-plugin-prettier": "^3.0.1",
|
|
60
|
+
"eslint-plugin-import": "^2.28.1",
|
|
59
61
|
"jest": "^29.6.1",
|
|
60
62
|
"prettier": "^1.19.1",
|
|
61
63
|
"ts-jest": "^29.1.1",
|