nylas 7.0.0-beta.4 → 7.0.0-beta.5
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/lib/cjs/models/events.js +11 -0
- package/lib/cjs/resources/auth.js +9 -7
- package/lib/cjs/resources/drafts.js +2 -2
- package/lib/cjs/version.js +1 -1
- package/lib/esm/models/events.js +10 -1
- package/lib/esm/resources/auth.js +9 -7
- package/lib/esm/resources/drafts.js +2 -2
- package/lib/esm/version.js +1 -1
- package/lib/types/models/attachments.d.ts +35 -11
- package/lib/types/models/auth.d.ts +4 -4
- package/lib/types/models/contacts.d.ts +4 -5
- package/lib/types/models/drafts.d.ts +6 -1
- package/lib/types/models/events.d.ts +55 -18
- package/lib/types/models/messages.d.ts +17 -17
- package/lib/types/resources/auth.d.ts +1 -1
- package/lib/types/resources/calendars.d.ts +7 -8
- package/lib/types/resources/drafts.d.ts +4 -3
- package/lib/types/resources/events.d.ts +5 -5
- package/lib/types/resources/grants.d.ts +3 -4
- package/lib/types/resources/redirectUris.d.ts +4 -5
- package/lib/types/resources/webhooks.d.ts +4 -5
- package/lib/types/utils.d.ts +2 -2
- package/lib/types/version.d.ts +1 -1
- package/package.json +1 -1
- package/lib/cjs/models/files.js +0 -2
- package/lib/esm/models/files.js +0 -1
- package/lib/types/models/files.d.ts +0 -17
package/lib/cjs/models/events.js
CHANGED
|
@@ -1,2 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.WhenType = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* Enum representing the different types of when objects.
|
|
6
|
+
*/
|
|
7
|
+
var WhenType;
|
|
8
|
+
(function (WhenType) {
|
|
9
|
+
WhenType["Time"] = "time";
|
|
10
|
+
WhenType["Timespan"] = "timespan";
|
|
11
|
+
WhenType["Date"] = "date";
|
|
12
|
+
WhenType["Datespan"] = "datespan";
|
|
13
|
+
})(WhenType = exports.WhenType || (exports.WhenType = {}));
|
|
@@ -25,17 +25,16 @@ class Auth extends resource_js_1.Resource {
|
|
|
25
25
|
* @return Information about the Nylas application
|
|
26
26
|
*/
|
|
27
27
|
exchangeCodeForToken(request) {
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
grantType: 'authorization_code',
|
|
31
|
-
};
|
|
32
|
-
if (request.codeVerifier) {
|
|
33
|
-
body.codeVerifier = request.codeVerifier;
|
|
28
|
+
if (!request.clientSecret) {
|
|
29
|
+
request.clientSecret = this.apiClient.apiKey;
|
|
34
30
|
}
|
|
35
31
|
return this.apiClient.request({
|
|
36
32
|
method: 'POST',
|
|
37
33
|
path: `/v3/connect/token`,
|
|
38
|
-
body
|
|
34
|
+
body: {
|
|
35
|
+
...request,
|
|
36
|
+
grantType: 'authorization_code',
|
|
37
|
+
},
|
|
39
38
|
});
|
|
40
39
|
}
|
|
41
40
|
/**
|
|
@@ -44,6 +43,9 @@ class Auth extends resource_js_1.Resource {
|
|
|
44
43
|
* @return The response containing the new access token
|
|
45
44
|
*/
|
|
46
45
|
refreshAccessToken(request) {
|
|
46
|
+
if (!request.clientSecret) {
|
|
47
|
+
request.clientSecret = this.apiClient.apiKey;
|
|
48
|
+
}
|
|
47
49
|
return this.apiClient.request({
|
|
48
50
|
method: 'POST',
|
|
49
51
|
path: `/v3/connect/token`,
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.Drafts = void 0;
|
|
4
|
-
const resource_js_1 = require("./resource.js");
|
|
5
4
|
const messages_js_1 = require("./messages.js");
|
|
5
|
+
const resource_js_1 = require("./resource.js");
|
|
6
6
|
/**
|
|
7
7
|
* Nylas Drafts API
|
|
8
8
|
*
|
|
@@ -68,7 +68,7 @@ class Drafts extends resource_js_1.Resource {
|
|
|
68
68
|
}
|
|
69
69
|
/**
|
|
70
70
|
* Send a Draft
|
|
71
|
-
* @return The sent
|
|
71
|
+
* @return The sent message
|
|
72
72
|
*/
|
|
73
73
|
send({ identifier, draftId, overrides, }) {
|
|
74
74
|
return super._create({
|
package/lib/cjs/version.js
CHANGED
package/lib/esm/models/events.js
CHANGED
|
@@ -1 +1,10 @@
|
|
|
1
|
-
|
|
1
|
+
/**
|
|
2
|
+
* Enum representing the different types of when objects.
|
|
3
|
+
*/
|
|
4
|
+
export var WhenType;
|
|
5
|
+
(function (WhenType) {
|
|
6
|
+
WhenType["Time"] = "time";
|
|
7
|
+
WhenType["Timespan"] = "timespan";
|
|
8
|
+
WhenType["Date"] = "date";
|
|
9
|
+
WhenType["Datespan"] = "datespan";
|
|
10
|
+
})(WhenType || (WhenType = {}));
|
|
@@ -22,17 +22,16 @@ export class Auth extends Resource {
|
|
|
22
22
|
* @return Information about the Nylas application
|
|
23
23
|
*/
|
|
24
24
|
exchangeCodeForToken(request) {
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
grantType: 'authorization_code',
|
|
28
|
-
};
|
|
29
|
-
if (request.codeVerifier) {
|
|
30
|
-
body.codeVerifier = request.codeVerifier;
|
|
25
|
+
if (!request.clientSecret) {
|
|
26
|
+
request.clientSecret = this.apiClient.apiKey;
|
|
31
27
|
}
|
|
32
28
|
return this.apiClient.request({
|
|
33
29
|
method: 'POST',
|
|
34
30
|
path: `/v3/connect/token`,
|
|
35
|
-
body
|
|
31
|
+
body: {
|
|
32
|
+
...request,
|
|
33
|
+
grantType: 'authorization_code',
|
|
34
|
+
},
|
|
36
35
|
});
|
|
37
36
|
}
|
|
38
37
|
/**
|
|
@@ -41,6 +40,9 @@ export class Auth extends Resource {
|
|
|
41
40
|
* @return The response containing the new access token
|
|
42
41
|
*/
|
|
43
42
|
refreshAccessToken(request) {
|
|
43
|
+
if (!request.clientSecret) {
|
|
44
|
+
request.clientSecret = this.apiClient.apiKey;
|
|
45
|
+
}
|
|
44
46
|
return this.apiClient.request({
|
|
45
47
|
method: 'POST',
|
|
46
48
|
path: `/v3/connect/token`,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Resource } from './resource.js';
|
|
2
1
|
import { Messages } from './messages.js';
|
|
2
|
+
import { Resource } from './resource.js';
|
|
3
3
|
/**
|
|
4
4
|
* Nylas Drafts API
|
|
5
5
|
*
|
|
@@ -65,7 +65,7 @@ export class Drafts extends Resource {
|
|
|
65
65
|
}
|
|
66
66
|
/**
|
|
67
67
|
* Send a Draft
|
|
68
|
-
* @return The sent
|
|
68
|
+
* @return The sent message
|
|
69
69
|
*/
|
|
70
70
|
send({ identifier, draftId, overrides, }) {
|
|
71
71
|
return super._create({
|
package/lib/esm/version.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// This file is generated by scripts/exportVersion.js
|
|
2
|
-
export const SDK_VERSION = '7.0.0-beta.
|
|
2
|
+
export const SDK_VERSION = '7.0.0-beta.5';
|
|
@@ -1,11 +1,8 @@
|
|
|
1
|
+
/// <reference types="node" />
|
|
1
2
|
/**
|
|
2
3
|
* Interface of an attachment object from Nylas.
|
|
3
4
|
*/
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* A globally unique object identifier.
|
|
7
|
-
*/
|
|
8
|
-
id: string;
|
|
5
|
+
interface BaseAttachment {
|
|
9
6
|
/**
|
|
10
7
|
* Attachment's name.
|
|
11
8
|
*/
|
|
@@ -14,18 +11,44 @@ export interface Attachment {
|
|
|
14
11
|
* Attachment's content type.
|
|
15
12
|
*/
|
|
16
13
|
contentType: string;
|
|
17
|
-
/**
|
|
18
|
-
* Grant ID of the Nylas account.
|
|
19
|
-
*/
|
|
20
|
-
grantId: string;
|
|
21
14
|
/**
|
|
22
15
|
* If it's an inline attachment.
|
|
23
16
|
*/
|
|
24
|
-
isInline
|
|
17
|
+
isInline?: boolean;
|
|
25
18
|
/**
|
|
26
19
|
* Attachment's size in bytes.
|
|
27
20
|
*/
|
|
28
|
-
size
|
|
21
|
+
size?: number;
|
|
22
|
+
/**
|
|
23
|
+
* Content ID of the attachment.
|
|
24
|
+
*/
|
|
25
|
+
contentId?: string;
|
|
26
|
+
/**
|
|
27
|
+
* Content disposition of the attachment.
|
|
28
|
+
*/
|
|
29
|
+
contentDisposition?: string;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Interface of a create attachment request.
|
|
33
|
+
*/
|
|
34
|
+
export interface CreateAttachmentRequest extends BaseAttachment {
|
|
35
|
+
/**
|
|
36
|
+
* Content of the attachment.
|
|
37
|
+
*/
|
|
38
|
+
content: NodeJS.ReadableStream;
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Interface of an attachment object from Nylas.
|
|
42
|
+
*/
|
|
43
|
+
export interface Attachment extends BaseAttachment {
|
|
44
|
+
/**
|
|
45
|
+
* Attachment's ID.
|
|
46
|
+
*/
|
|
47
|
+
id: string;
|
|
48
|
+
/**
|
|
49
|
+
* Grant ID of the Nylas account.
|
|
50
|
+
*/
|
|
51
|
+
grantId: string;
|
|
29
52
|
}
|
|
30
53
|
/**
|
|
31
54
|
* Interface representing of the query parameters for finding an attachment's metadata.
|
|
@@ -40,3 +63,4 @@ export interface FindAttachmentQueryParams {
|
|
|
40
63
|
* Interface representing of the query parameters for downloading an attachment.
|
|
41
64
|
*/
|
|
42
65
|
export type DownloadAttachmentQueryParams = FindAttachmentQueryParams;
|
|
66
|
+
export {};
|
|
@@ -76,9 +76,9 @@ export interface CodeExchangeRequest {
|
|
|
76
76
|
*/
|
|
77
77
|
clientId: string;
|
|
78
78
|
/**
|
|
79
|
-
* Client secret of the application.
|
|
79
|
+
* Client secret of the application. If not provided, the API Key will be used instead.
|
|
80
80
|
*/
|
|
81
|
-
clientSecret
|
|
81
|
+
clientSecret?: string;
|
|
82
82
|
/**
|
|
83
83
|
* The original plain text code verifier (code_challenge) used in the initial authorization request (PKCE).
|
|
84
84
|
*/
|
|
@@ -101,9 +101,9 @@ export interface TokenExchangeRequest {
|
|
|
101
101
|
*/
|
|
102
102
|
clientId: string;
|
|
103
103
|
/**
|
|
104
|
-
* Client secret of the application.
|
|
104
|
+
* Client secret of the application. If not provided, the API Key will be used instead.
|
|
105
105
|
*/
|
|
106
|
-
clientSecret
|
|
106
|
+
clientSecret?: string;
|
|
107
107
|
}
|
|
108
108
|
/**
|
|
109
109
|
* Interface of the object containing the OAuth 2.0 URL as well as the hashed secret.
|
|
@@ -31,7 +31,6 @@ export interface Contact {
|
|
|
31
31
|
/**
|
|
32
32
|
* Custom Types.
|
|
33
33
|
*/
|
|
34
|
-
export type ContactType = 'work' | 'home' | 'other';
|
|
35
34
|
export type SourceType = 'address_book' | 'inbox' | 'domain';
|
|
36
35
|
export type GroupType = 'user' | 'system' | 'other';
|
|
37
36
|
/**
|
|
@@ -39,7 +38,7 @@ export type GroupType = 'user' | 'system' | 'other';
|
|
|
39
38
|
*/
|
|
40
39
|
export interface Email {
|
|
41
40
|
email?: string;
|
|
42
|
-
type?:
|
|
41
|
+
type?: string;
|
|
43
42
|
}
|
|
44
43
|
/**
|
|
45
44
|
* Interface for IM addresses in a contact.
|
|
@@ -53,7 +52,7 @@ export interface InstantMessagingAddress {
|
|
|
53
52
|
*/
|
|
54
53
|
export interface PhoneNumber {
|
|
55
54
|
number?: string;
|
|
56
|
-
type?:
|
|
55
|
+
type?: string;
|
|
57
56
|
}
|
|
58
57
|
/**
|
|
59
58
|
* Interface for physical addresses in a contact.
|
|
@@ -65,14 +64,14 @@ export interface PhysicalAddress {
|
|
|
65
64
|
postalCode?: string;
|
|
66
65
|
state?: string;
|
|
67
66
|
country?: string;
|
|
68
|
-
type?:
|
|
67
|
+
type?: string;
|
|
69
68
|
}
|
|
70
69
|
/**
|
|
71
70
|
* Interface for web pages in a contact.
|
|
72
71
|
*/
|
|
73
72
|
export interface WebPage {
|
|
74
73
|
url?: string;
|
|
75
|
-
type?:
|
|
74
|
+
type?: string;
|
|
76
75
|
}
|
|
77
76
|
/**
|
|
78
77
|
* Interface representing a contact group.
|
|
@@ -39,7 +39,12 @@ export interface Draft extends BaseMessage, Omit<CreateDraftRequest, 'attachment
|
|
|
39
39
|
/**
|
|
40
40
|
* Interface representing a request to update a draft.
|
|
41
41
|
*/
|
|
42
|
-
export type UpdateDraftRequest = Partial<CreateDraftRequest
|
|
42
|
+
export type UpdateDraftRequest = Partial<CreateDraftRequest> & {
|
|
43
|
+
/**
|
|
44
|
+
* Return drafts that are unread.
|
|
45
|
+
*/
|
|
46
|
+
unread?: boolean;
|
|
47
|
+
};
|
|
43
48
|
/**
|
|
44
49
|
* Interface representing the different tracking options for when a message is sent.
|
|
45
50
|
*/
|
|
@@ -54,6 +54,10 @@ export interface Event {
|
|
|
54
54
|
* - {@link Details}
|
|
55
55
|
*/
|
|
56
56
|
conferencing: Conferencing;
|
|
57
|
+
/**
|
|
58
|
+
* Visibility of the event, if the event is private or public.
|
|
59
|
+
*/
|
|
60
|
+
visibility: Visibility;
|
|
57
61
|
/**
|
|
58
62
|
* Description of the event.
|
|
59
63
|
*/
|
|
@@ -91,24 +95,20 @@ export interface Event {
|
|
|
91
95
|
/**
|
|
92
96
|
* Organizer of the event.
|
|
93
97
|
*/
|
|
94
|
-
organizer
|
|
98
|
+
organizer?: EmailName;
|
|
95
99
|
/**
|
|
96
100
|
* An list of RRULE and EXDATE strings.
|
|
97
101
|
* @see <a href="https://datatracker.ietf.org/doc/html/rfc5545#section-3.8.5">RFC-5545</a>
|
|
98
102
|
*/
|
|
99
103
|
recurrence?: string[];
|
|
100
104
|
/**
|
|
101
|
-
*
|
|
105
|
+
* A list of reminders to send for the event. If left empty or omitted, the event uses the provider defaults.
|
|
102
106
|
*/
|
|
103
|
-
reminders?:
|
|
107
|
+
reminders?: Reminders;
|
|
104
108
|
/**
|
|
105
109
|
* Status of the event.
|
|
106
110
|
*/
|
|
107
111
|
status?: Status;
|
|
108
|
-
/**
|
|
109
|
-
* Visibility of the event, if the event is private or public.
|
|
110
|
-
*/
|
|
111
|
-
visibility?: Visibility;
|
|
112
112
|
}
|
|
113
113
|
/**
|
|
114
114
|
* Interface representing a request to create an event.
|
|
@@ -121,7 +121,7 @@ export interface CreateEventRequest {
|
|
|
121
121
|
* - {@link Time}
|
|
122
122
|
* - {@link Timespan}
|
|
123
123
|
*/
|
|
124
|
-
when:
|
|
124
|
+
when: CreateWhen;
|
|
125
125
|
/**
|
|
126
126
|
* Title of the event.
|
|
127
127
|
*/
|
|
@@ -145,14 +145,9 @@ export interface CreateEventRequest {
|
|
|
145
145
|
*/
|
|
146
146
|
conferencing?: Conferencing;
|
|
147
147
|
/**
|
|
148
|
-
*
|
|
149
|
-
* Reminder minutes need to be entered in the following format: "[20]".
|
|
150
|
-
*/
|
|
151
|
-
reminderMinutes?: string;
|
|
152
|
-
/**
|
|
153
|
-
* Method to remind the user about the event. (Google only).
|
|
148
|
+
* A list of reminders to send for the event. If left empty or omitted, the event uses the provider defaults.
|
|
154
149
|
*/
|
|
155
|
-
|
|
150
|
+
reminders?: Reminders;
|
|
156
151
|
/**
|
|
157
152
|
* A list of key-value pairs storing additional data.
|
|
158
153
|
*/
|
|
@@ -207,7 +202,6 @@ export interface ListEventQueryParams extends ListQueryParams {
|
|
|
207
202
|
* Different providers have different semantics for cancelled events.
|
|
208
203
|
*/
|
|
209
204
|
showCancelled?: boolean;
|
|
210
|
-
eventId?: string;
|
|
211
205
|
/**
|
|
212
206
|
* Specify calendar ID of the event. "primary" is a supported value indicating the user's primary calendar.
|
|
213
207
|
*/
|
|
@@ -311,7 +305,7 @@ type RsvpStatus = 'yes' | 'no' | 'maybe';
|
|
|
311
305
|
/**
|
|
312
306
|
* Enum representing the visibility of an event.
|
|
313
307
|
*/
|
|
314
|
-
type Visibility = 'public' | 'private';
|
|
308
|
+
type Visibility = 'default' | 'public' | 'private';
|
|
315
309
|
/**
|
|
316
310
|
* Enum representing the supported conferencing providers.
|
|
317
311
|
*/
|
|
@@ -332,6 +326,19 @@ type Conferencing = Details | Autocreate;
|
|
|
332
326
|
* Type representing the different objects representing time and duration for events.
|
|
333
327
|
*/
|
|
334
328
|
type When = Time | Timespan | Date | Datespan;
|
|
329
|
+
/**
|
|
330
|
+
* Type representing the different objects representing time and duration when creating events.
|
|
331
|
+
*/
|
|
332
|
+
type CreateWhen = Omit<Time, 'type'> | Omit<Timespan, 'type'> | Omit<Date, 'type'> | Omit<Datespan, 'type'>;
|
|
333
|
+
/**
|
|
334
|
+
* Enum representing the different types of when objects.
|
|
335
|
+
*/
|
|
336
|
+
export declare enum WhenType {
|
|
337
|
+
Time = "time",
|
|
338
|
+
Timespan = "timespan",
|
|
339
|
+
Date = "date",
|
|
340
|
+
Datespan = "datespan"
|
|
341
|
+
}
|
|
335
342
|
/**
|
|
336
343
|
* Interface of a conferencing details object
|
|
337
344
|
*/
|
|
@@ -399,6 +406,10 @@ export interface Time {
|
|
|
399
406
|
* @see <a href="https://en.wikipedia.org/wiki/List_of_tz_database_time_zones">List of tz database time zones</a>
|
|
400
407
|
*/
|
|
401
408
|
timezone: string;
|
|
409
|
+
/**
|
|
410
|
+
* The type of 'when' object.
|
|
411
|
+
*/
|
|
412
|
+
type: WhenType.Time;
|
|
402
413
|
}
|
|
403
414
|
/**
|
|
404
415
|
* Class representation of a time span with start and end times.
|
|
@@ -425,6 +436,10 @@ export interface Timespan {
|
|
|
425
436
|
* @see <a href="https://en.wikipedia.org/wiki/List_of_tz_database_time_zones">List of tz database time zones</a>
|
|
426
437
|
*/
|
|
427
438
|
endTimezone?: string;
|
|
439
|
+
/**
|
|
440
|
+
* The type of 'when' object.
|
|
441
|
+
*/
|
|
442
|
+
type: WhenType.Timespan;
|
|
428
443
|
}
|
|
429
444
|
/**
|
|
430
445
|
* Class representation of an entire day spans without specific times.
|
|
@@ -436,6 +451,10 @@ export interface Date {
|
|
|
436
451
|
* @see <a href="https://en.wikipedia.org/wiki/ISO_8601#Calendar_dates">ISO 8601</a>
|
|
437
452
|
*/
|
|
438
453
|
date: string;
|
|
454
|
+
/**
|
|
455
|
+
* The type of 'when' object.
|
|
456
|
+
*/
|
|
457
|
+
type: WhenType.Date;
|
|
439
458
|
}
|
|
440
459
|
/**
|
|
441
460
|
* Class representation of a specific dates without clock-based start or end times.
|
|
@@ -452,6 +471,10 @@ export interface Datespan {
|
|
|
452
471
|
* @see <a href="https://en.wikipedia.org/wiki/ISO_8601#Calendar_dates">ISO 8601</a>
|
|
453
472
|
*/
|
|
454
473
|
endDate: string;
|
|
474
|
+
/**
|
|
475
|
+
* The type of 'when' object.
|
|
476
|
+
*/
|
|
477
|
+
type: WhenType.Datespan;
|
|
455
478
|
}
|
|
456
479
|
/**
|
|
457
480
|
* Interface representing an Event participant.
|
|
@@ -481,7 +504,21 @@ export interface Participant {
|
|
|
481
504
|
/**
|
|
482
505
|
* Interface representing the reminders field of an event.
|
|
483
506
|
*/
|
|
484
|
-
export interface
|
|
507
|
+
export interface Reminders {
|
|
508
|
+
/**
|
|
509
|
+
* Whether to use the default reminders for the calendar.
|
|
510
|
+
* When true, uses the default reminder settings for the calendar
|
|
511
|
+
*/
|
|
512
|
+
useDefault: boolean;
|
|
513
|
+
/**
|
|
514
|
+
* A list of reminders for the event if useDefault is set to false.
|
|
515
|
+
*/
|
|
516
|
+
overrides: ReminderOverride[];
|
|
517
|
+
}
|
|
518
|
+
/**
|
|
519
|
+
* Interface representing the reminder details for an event.
|
|
520
|
+
*/
|
|
521
|
+
export interface ReminderOverride {
|
|
485
522
|
/**
|
|
486
523
|
* The number of minutes before the event start time when a user wants a reminder for this event.
|
|
487
524
|
* Reminder minutes are in the following format: "[20]".
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { EmailName } from './events.js';
|
|
2
|
-
import { CreateFileRequest, File } from './files.js';
|
|
3
2
|
import { ListQueryParams } from './listQueryParams.js';
|
|
3
|
+
import { Attachment, CreateAttachmentRequest } from './attachments.js';
|
|
4
4
|
/**
|
|
5
5
|
* @internal Internal interface for creating a message.
|
|
6
6
|
*/
|
|
@@ -24,21 +24,11 @@ export interface BaseCreateMessage {
|
|
|
24
24
|
/**
|
|
25
25
|
* An array of files to attach to the message.
|
|
26
26
|
*/
|
|
27
|
-
attachments?:
|
|
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;
|
|
27
|
+
attachments?: CreateAttachmentRequest[];
|
|
33
28
|
/**
|
|
34
29
|
* The message subject.
|
|
35
30
|
*/
|
|
36
31
|
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
32
|
/**
|
|
43
33
|
* The full HTML message body.
|
|
44
34
|
* Messages with only plain-text representations are up-converted to HTML.
|
|
@@ -48,10 +38,6 @@ export interface BaseCreateMessage {
|
|
|
48
38
|
* Whether or not the message has been starred by the user.
|
|
49
39
|
*/
|
|
50
40
|
starred?: boolean;
|
|
51
|
-
/**
|
|
52
|
-
* Whether or not the message has been read by the user.
|
|
53
|
-
*/
|
|
54
|
-
unread?: boolean;
|
|
55
41
|
}
|
|
56
42
|
/**
|
|
57
43
|
* @internal Internal interface for a message.
|
|
@@ -85,7 +71,21 @@ export interface BaseMessage extends Omit<BaseCreateMessage, 'attachments'> {
|
|
|
85
71
|
/**
|
|
86
72
|
* An array of files attached to the message.
|
|
87
73
|
*/
|
|
88
|
-
attachments?:
|
|
74
|
+
attachments?: Attachment[];
|
|
75
|
+
/**
|
|
76
|
+
* A short snippet of the message body.
|
|
77
|
+
* This is the first 100 characters of the message body, with any HTML tags removed.
|
|
78
|
+
*/
|
|
79
|
+
snippet?: string;
|
|
80
|
+
/**
|
|
81
|
+
* A reference to the parent thread object.
|
|
82
|
+
* If this is a new draft, the thread will be empty.
|
|
83
|
+
*/
|
|
84
|
+
threadId?: string;
|
|
85
|
+
/**
|
|
86
|
+
* Whether or not the message has been read by the user.
|
|
87
|
+
*/
|
|
88
|
+
unread?: boolean;
|
|
89
89
|
}
|
|
90
90
|
/**
|
|
91
91
|
* Interface representing a Nylas Message object.
|
|
@@ -63,7 +63,7 @@ export declare class Auth extends Resource {
|
|
|
63
63
|
* @param params The parameters to include in the request
|
|
64
64
|
* @return The detected provider, if found
|
|
65
65
|
*/
|
|
66
|
-
detectProvider(params: ProviderDetectParams): Promise<ProviderDetectResponse
|
|
66
|
+
detectProvider(params: ProviderDetectParams): Promise<NylasResponse<ProviderDetectResponse>>;
|
|
67
67
|
private urlAuthBuilder;
|
|
68
68
|
private hashPKCESecret;
|
|
69
69
|
}
|
|
@@ -9,7 +9,7 @@ import { GetFreeBusyRequest, GetFreeBusyResponse } from '../models/freeBusy.js';
|
|
|
9
9
|
* @property calendarId The id of the Calendar to retrieve. Use "primary" to refer to the primary calendar associated with grant.
|
|
10
10
|
* @property identifier The identifier of the grant to act upon
|
|
11
11
|
*/
|
|
12
|
-
interface FindCalendarParams {
|
|
12
|
+
export interface FindCalendarParams {
|
|
13
13
|
identifier: string;
|
|
14
14
|
calendarId: string;
|
|
15
15
|
}
|
|
@@ -18,7 +18,7 @@ interface FindCalendarParams {
|
|
|
18
18
|
* @property identifier The identifier of the grant to act upon
|
|
19
19
|
* @property queryParams The query parameters to include in the request
|
|
20
20
|
*/
|
|
21
|
-
interface ListCalendersParams {
|
|
21
|
+
export interface ListCalendersParams {
|
|
22
22
|
identifier: string;
|
|
23
23
|
queryParams?: ListCalendersQueryParams;
|
|
24
24
|
}
|
|
@@ -27,7 +27,7 @@ interface ListCalendersParams {
|
|
|
27
27
|
* @property identifier The identifier of the grant to act upon
|
|
28
28
|
* @property requestBody The request body to create a calendar
|
|
29
29
|
*/
|
|
30
|
-
interface CreateCalendarParams {
|
|
30
|
+
export interface CreateCalendarParams {
|
|
31
31
|
identifier: string;
|
|
32
32
|
requestBody: CreateCalenderRequest;
|
|
33
33
|
}
|
|
@@ -36,7 +36,7 @@ interface CreateCalendarParams {
|
|
|
36
36
|
* @property identifier The identifier of the grant to act upon
|
|
37
37
|
* @property calendarId The id of the Calendar to retrieve. Use "primary" to refer to the primary calendar associated with grant.
|
|
38
38
|
*/
|
|
39
|
-
interface UpdateCalendarParams {
|
|
39
|
+
export interface UpdateCalendarParams {
|
|
40
40
|
identifier: string;
|
|
41
41
|
calendarId: string;
|
|
42
42
|
requestBody: UpdateCalenderRequest;
|
|
@@ -46,7 +46,7 @@ interface UpdateCalendarParams {
|
|
|
46
46
|
* @property identifier The identifier of the grant to act upon
|
|
47
47
|
* @property calendarId The id of the Calendar to retrieve. Use "primary" to refer to the primary calendar associated with grant.
|
|
48
48
|
*/
|
|
49
|
-
interface DestroyCalendarParams {
|
|
49
|
+
export interface DestroyCalendarParams {
|
|
50
50
|
identifier: string;
|
|
51
51
|
calendarId: string;
|
|
52
52
|
}
|
|
@@ -54,7 +54,7 @@ interface DestroyCalendarParams {
|
|
|
54
54
|
* The parameters for the {@link Calendars.getAvailability} method
|
|
55
55
|
* @property requestBody The availability request
|
|
56
56
|
*/
|
|
57
|
-
interface GetAvailabilityParams {
|
|
57
|
+
export interface GetAvailabilityParams {
|
|
58
58
|
requestBody: GetAvailabilityRequest;
|
|
59
59
|
}
|
|
60
60
|
/**
|
|
@@ -62,7 +62,7 @@ interface GetAvailabilityParams {
|
|
|
62
62
|
* @property identifier The identifier of the grant to act upon
|
|
63
63
|
* @property requestBody The free busy request
|
|
64
64
|
*/
|
|
65
|
-
interface GetFreeBusyParams {
|
|
65
|
+
export interface GetFreeBusyParams {
|
|
66
66
|
identifier: string;
|
|
67
67
|
requestBody: GetFreeBusyRequest;
|
|
68
68
|
}
|
|
@@ -109,4 +109,3 @@ export declare class Calendars extends Resource {
|
|
|
109
109
|
*/
|
|
110
110
|
getFreeBusy({ identifier, requestBody, overrides, }: GetFreeBusyParams & Overrides): Promise<NylasResponse<GetFreeBusyResponse[]>>;
|
|
111
111
|
}
|
|
112
|
-
export {};
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
+
import { Overrides } from '../config.js';
|
|
1
2
|
import { AsyncListResponse, Resource } from './resource.js';
|
|
2
3
|
import { CreateDraftRequest, Draft, ListDraftsQueryParams, UpdateDraftRequest } from '../models/drafts.js';
|
|
3
|
-
import {
|
|
4
|
+
import { Message } from '../models/messages.js';
|
|
4
5
|
import { NylasBaseResponse, NylasListResponse, NylasResponse } from '../models/response.js';
|
|
5
6
|
/**
|
|
6
7
|
* The parameters for the {@link Drafts.list} method
|
|
@@ -81,7 +82,7 @@ export declare class Drafts extends Resource {
|
|
|
81
82
|
destroy({ identifier, draftId, overrides, }: DestroyDraftParams & Overrides): Promise<NylasBaseResponse>;
|
|
82
83
|
/**
|
|
83
84
|
* Send a Draft
|
|
84
|
-
* @return The sent
|
|
85
|
+
* @return The sent message
|
|
85
86
|
*/
|
|
86
|
-
send({ identifier, draftId, overrides, }: SendDraftParams & Overrides): Promise<NylasResponse<
|
|
87
|
+
send({ identifier, draftId, overrides, }: SendDraftParams & Overrides): Promise<NylasResponse<Message>>;
|
|
87
88
|
}
|
|
@@ -7,7 +7,7 @@ import { AsyncListResponse, Resource } from './resource.js';
|
|
|
7
7
|
* @property identifier The identifier of the grant to act upon
|
|
8
8
|
* @property queryParams The query parameters to include in the request
|
|
9
9
|
*/
|
|
10
|
-
interface FindEventParams {
|
|
10
|
+
export interface FindEventParams {
|
|
11
11
|
identifier: string;
|
|
12
12
|
eventId: string;
|
|
13
13
|
queryParams: FindEventQueryParams;
|
|
@@ -16,7 +16,7 @@ interface FindEventParams {
|
|
|
16
16
|
* @property identifier The identifier of the grant to act upon
|
|
17
17
|
* @property queryParams The query parameters to include in the request
|
|
18
18
|
*/
|
|
19
|
-
interface ListEventParams {
|
|
19
|
+
export interface ListEventParams {
|
|
20
20
|
identifier: string;
|
|
21
21
|
queryParams: ListEventQueryParams;
|
|
22
22
|
}
|
|
@@ -25,7 +25,7 @@ interface ListEventParams {
|
|
|
25
25
|
* @property queryParams The query parameters to include in the request
|
|
26
26
|
* @property requestBody The values to create the Event with
|
|
27
27
|
*/
|
|
28
|
-
interface CreateEventParams {
|
|
28
|
+
export interface CreateEventParams {
|
|
29
29
|
identifier: string;
|
|
30
30
|
requestBody: CreateEventRequest;
|
|
31
31
|
queryParams: CreateEventQueryParams;
|
|
@@ -36,7 +36,7 @@ interface CreateEventParams {
|
|
|
36
36
|
* @property requestBody The values to update the Event with
|
|
37
37
|
* @property queryParams The query parameters to include in the request
|
|
38
38
|
*/
|
|
39
|
-
interface UpdateEventParams {
|
|
39
|
+
export interface UpdateEventParams {
|
|
40
40
|
identifier: string;
|
|
41
41
|
eventId: string;
|
|
42
42
|
requestBody: UpdateEventRequest;
|
|
@@ -47,7 +47,7 @@ interface UpdateEventParams {
|
|
|
47
47
|
* @property eventId The id of the Event to retrieve.
|
|
48
48
|
* @property queryParams The query parameters to include in the request
|
|
49
49
|
*/
|
|
50
|
-
interface DestroyEventParams {
|
|
50
|
+
export interface DestroyEventParams {
|
|
51
51
|
identifier: string;
|
|
52
52
|
eventId: string;
|
|
53
53
|
queryParams: DestroyEventQueryParams;
|
|
@@ -5,21 +5,21 @@ import { Grant, ListGrantsQueryParams, UpdateGrantRequest } from '../models/gran
|
|
|
5
5
|
/**
|
|
6
6
|
* @property grantId The id of the Grant to retrieve.
|
|
7
7
|
*/
|
|
8
|
-
interface FindGrantParams {
|
|
8
|
+
export interface FindGrantParams {
|
|
9
9
|
grantId: string;
|
|
10
10
|
}
|
|
11
11
|
/**
|
|
12
12
|
* @property grantId The id of the Grant to update.
|
|
13
13
|
* @property requestBody The values to update the Grant with.
|
|
14
14
|
*/
|
|
15
|
-
interface UpdateGrantParams {
|
|
15
|
+
export interface UpdateGrantParams {
|
|
16
16
|
grantId: string;
|
|
17
17
|
requestBody: UpdateGrantRequest;
|
|
18
18
|
}
|
|
19
19
|
/**
|
|
20
20
|
* @property grantId The id of the Grant to delete.
|
|
21
21
|
*/
|
|
22
|
-
interface DestroyGrantParams {
|
|
22
|
+
export interface DestroyGrantParams {
|
|
23
23
|
grantId: string;
|
|
24
24
|
}
|
|
25
25
|
/**
|
|
@@ -49,4 +49,3 @@ export declare class Grants extends Resource {
|
|
|
49
49
|
*/
|
|
50
50
|
destroy({ grantId, overrides, }: DestroyGrantParams & Overrides): Promise<NylasBaseResponse>;
|
|
51
51
|
}
|
|
52
|
-
export {};
|
|
@@ -5,27 +5,27 @@ import { Overrides } from '../config.js';
|
|
|
5
5
|
/**
|
|
6
6
|
* @property redirectUriId The id of the Redirect URI to retrieve.
|
|
7
7
|
*/
|
|
8
|
-
interface FindRedirectUrisParams {
|
|
8
|
+
export interface FindRedirectUrisParams {
|
|
9
9
|
redirectUriId: string;
|
|
10
10
|
}
|
|
11
11
|
/**
|
|
12
12
|
* @property requestBody The values to create the Redirect URI with.
|
|
13
13
|
*/
|
|
14
|
-
interface CreateRedirectUrisParams {
|
|
14
|
+
export interface CreateRedirectUrisParams {
|
|
15
15
|
requestBody: CreateRedirectUriRequest;
|
|
16
16
|
}
|
|
17
17
|
/**
|
|
18
18
|
* @property redirectUriId The id of the Redirect URI to update.
|
|
19
19
|
* @property requestBody The values to update the Redirect URI with.
|
|
20
20
|
*/
|
|
21
|
-
interface UpdateRedirectUrisParams {
|
|
21
|
+
export interface UpdateRedirectUrisParams {
|
|
22
22
|
redirectUriId: string;
|
|
23
23
|
requestBody: UpdateRedirectUriRequest;
|
|
24
24
|
}
|
|
25
25
|
/**
|
|
26
26
|
* @property redirectUriId The id of the Redirect URI to delete.
|
|
27
27
|
*/
|
|
28
|
-
interface DestroyRedirectUrisParams {
|
|
28
|
+
export interface DestroyRedirectUrisParams {
|
|
29
29
|
redirectUriId: string;
|
|
30
30
|
}
|
|
31
31
|
/**
|
|
@@ -60,4 +60,3 @@ export declare class RedirectUris extends Resource {
|
|
|
60
60
|
*/
|
|
61
61
|
destroy({ redirectUriId, overrides, }: DestroyRedirectUrisParams & Overrides): Promise<NylasResponse<NylasBaseResponse>>;
|
|
62
62
|
}
|
|
63
|
-
export {};
|
|
@@ -5,27 +5,27 @@ import { CreateWebhookRequest, UpdateWebhookRequest, Webhook, WebhookDeleteRespo
|
|
|
5
5
|
/**
|
|
6
6
|
* @property webhookId The ID of the webhook destination to update
|
|
7
7
|
*/
|
|
8
|
-
interface FindWebhookParams {
|
|
8
|
+
export interface FindWebhookParams {
|
|
9
9
|
webhookId: string;
|
|
10
10
|
}
|
|
11
11
|
/**
|
|
12
12
|
* @property requestBody The webhook destination details
|
|
13
13
|
*/
|
|
14
|
-
interface CreateWebhookParams {
|
|
14
|
+
export interface CreateWebhookParams {
|
|
15
15
|
requestBody: CreateWebhookRequest;
|
|
16
16
|
}
|
|
17
17
|
/**
|
|
18
18
|
* @property webhookId The ID of the webhook destination to update
|
|
19
19
|
* @property requestBody The updated webview destination details
|
|
20
20
|
*/
|
|
21
|
-
interface UpdateWebhookParams {
|
|
21
|
+
export interface UpdateWebhookParams {
|
|
22
22
|
webhookId: string;
|
|
23
23
|
requestBody: UpdateWebhookRequest;
|
|
24
24
|
}
|
|
25
25
|
/**
|
|
26
26
|
* @property webhookId The ID of the webhook destination to delete
|
|
27
27
|
*/
|
|
28
|
-
interface DestroyWebhookParams {
|
|
28
|
+
export interface DestroyWebhookParams {
|
|
29
29
|
webhookId: string;
|
|
30
30
|
}
|
|
31
31
|
/**
|
|
@@ -76,4 +76,3 @@ export declare class Webhooks extends Resource {
|
|
|
76
76
|
*/
|
|
77
77
|
extractChallengeParameter(url: string): string;
|
|
78
78
|
}
|
|
79
|
-
export {};
|
package/lib/types/utils.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export declare function createFileRequestBuilder(filePath: string):
|
|
1
|
+
import { CreateAttachmentRequest } from './models/attachments.js';
|
|
2
|
+
export declare function createFileRequestBuilder(filePath: string): CreateAttachmentRequest;
|
|
3
3
|
/**
|
|
4
4
|
* A utility function that recursively converts all keys in an object to camelCase.
|
|
5
5
|
* @param obj The object to convert
|
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.5";
|
package/package.json
CHANGED
package/lib/cjs/models/files.js
DELETED
package/lib/esm/models/files.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,17 +0,0 @@
|
|
|
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 {};
|