nylas 7.9.0 → 7.11.0
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/apiClient.js +23 -2
- package/lib/cjs/config.js +1 -1
- package/lib/cjs/models/availability.js +1 -1
- package/lib/cjs/models/credentials.js +1 -1
- package/lib/cjs/models/events.js +1 -1
- package/lib/cjs/models/freeBusy.js +1 -1
- package/lib/cjs/models/messages.js +3 -1
- package/lib/cjs/models/webhooks.js +1 -1
- package/lib/cjs/resources/applications.js +2 -1
- package/lib/cjs/resources/attachments.js +4 -3
- package/lib/cjs/resources/auth.js +9 -12
- package/lib/cjs/resources/bookings.js +14 -5
- package/lib/cjs/resources/calendars.js +19 -7
- package/lib/cjs/resources/configurations.js +19 -5
- package/lib/cjs/resources/connectors.js +6 -5
- package/lib/cjs/resources/contacts.js +18 -6
- package/lib/cjs/resources/credentials.js +15 -5
- package/lib/cjs/resources/drafts.js +27 -16
- package/lib/cjs/resources/events.js +22 -9
- package/lib/cjs/resources/folders.js +15 -5
- package/lib/cjs/resources/grants.js +5 -4
- package/lib/cjs/resources/messages.js +27 -14
- package/lib/cjs/resources/notetakers.js +32 -14
- package/lib/cjs/resources/redirectUris.js +12 -5
- package/lib/cjs/resources/resource.js +1 -1
- package/lib/cjs/resources/sessions.js +5 -2
- package/lib/cjs/resources/smartCompose.js +5 -2
- package/lib/cjs/resources/threads.js +14 -4
- package/lib/cjs/resources/webhooks.js +10 -7
- package/lib/cjs/utils.js +58 -7
- package/lib/cjs/version.js +1 -1
- package/lib/esm/apiClient.js +23 -2
- package/lib/esm/models/messages.js +2 -0
- package/lib/esm/resources/applications.js +2 -1
- package/lib/esm/resources/attachments.js +4 -3
- package/lib/esm/resources/auth.js +9 -12
- package/lib/esm/resources/bookings.js +14 -5
- package/lib/esm/resources/calendars.js +19 -7
- package/lib/esm/resources/configurations.js +19 -5
- package/lib/esm/resources/connectors.js +6 -5
- package/lib/esm/resources/contacts.js +18 -6
- package/lib/esm/resources/credentials.js +15 -5
- package/lib/esm/resources/drafts.js +28 -17
- package/lib/esm/resources/events.js +22 -9
- package/lib/esm/resources/folders.js +15 -5
- package/lib/esm/resources/grants.js +5 -4
- package/lib/esm/resources/messages.js +28 -15
- package/lib/esm/resources/notetakers.js +32 -14
- package/lib/esm/resources/redirectUris.js +12 -5
- package/lib/esm/resources/resource.js +1 -1
- package/lib/esm/resources/sessions.js +5 -2
- package/lib/esm/resources/smartCompose.js +5 -2
- package/lib/esm/resources/threads.js +14 -4
- package/lib/esm/resources/webhooks.js +10 -7
- package/lib/esm/utils.js +51 -2
- package/lib/esm/version.js +1 -1
- package/lib/types/apiClient.d.ts +0 -2
- package/lib/types/config.d.ts +9 -1
- package/lib/types/models/attachments.d.ts +0 -2
- package/lib/types/models/auth.d.ts +1 -1
- package/lib/types/models/events.d.ts +1 -1
- package/lib/types/models/folders.d.ts +10 -0
- package/lib/types/models/freeBusy.d.ts +5 -0
- package/lib/types/models/messages.d.ts +36 -1
- package/lib/types/resources/attachments.d.ts +0 -2
- package/lib/types/resources/resource.d.ts +0 -2
- package/lib/types/utils.d.ts +22 -0
- package/lib/types/version.d.ts +1 -1
- package/package.json +7 -6
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { Resource } from './resource.js';
|
|
2
|
+
import { makePathParams } from '../utils.js';
|
|
2
3
|
export class Credentials extends Resource {
|
|
3
4
|
/**
|
|
4
5
|
* Return all credentials
|
|
@@ -8,7 +9,7 @@ export class Credentials extends Resource {
|
|
|
8
9
|
return super._list({
|
|
9
10
|
queryParams,
|
|
10
11
|
overrides,
|
|
11
|
-
path:
|
|
12
|
+
path: makePathParams('/v3/connectors/{provider}/creds', { provider }),
|
|
12
13
|
});
|
|
13
14
|
}
|
|
14
15
|
/**
|
|
@@ -17,7 +18,10 @@ export class Credentials extends Resource {
|
|
|
17
18
|
*/
|
|
18
19
|
find({ provider, credentialsId, overrides, }) {
|
|
19
20
|
return super._find({
|
|
20
|
-
path:
|
|
21
|
+
path: makePathParams('/v3/connectors/{provider}/creds/{credentialsId}', {
|
|
22
|
+
provider,
|
|
23
|
+
credentialsId,
|
|
24
|
+
}),
|
|
21
25
|
overrides,
|
|
22
26
|
});
|
|
23
27
|
}
|
|
@@ -27,7 +31,7 @@ export class Credentials extends Resource {
|
|
|
27
31
|
*/
|
|
28
32
|
create({ provider, requestBody, overrides, }) {
|
|
29
33
|
return super._create({
|
|
30
|
-
path:
|
|
34
|
+
path: makePathParams('/v3/connectors/{provider}/creds', { provider }),
|
|
31
35
|
requestBody,
|
|
32
36
|
overrides,
|
|
33
37
|
});
|
|
@@ -38,7 +42,10 @@ export class Credentials extends Resource {
|
|
|
38
42
|
*/
|
|
39
43
|
update({ provider, credentialsId, requestBody, overrides, }) {
|
|
40
44
|
return super._update({
|
|
41
|
-
path:
|
|
45
|
+
path: makePathParams('/v3/connectors/{provider}/creds/{credentialsId}', {
|
|
46
|
+
provider,
|
|
47
|
+
credentialsId,
|
|
48
|
+
}),
|
|
42
49
|
requestBody,
|
|
43
50
|
overrides,
|
|
44
51
|
});
|
|
@@ -49,7 +56,10 @@ export class Credentials extends Resource {
|
|
|
49
56
|
*/
|
|
50
57
|
destroy({ provider, credentialsId, overrides, }) {
|
|
51
58
|
return super._destroy({
|
|
52
|
-
path:
|
|
59
|
+
path: makePathParams('/v3/connectors/{provider}/creds/{credentialsId}', {
|
|
60
|
+
provider,
|
|
61
|
+
credentialsId,
|
|
62
|
+
}),
|
|
53
63
|
overrides,
|
|
54
64
|
});
|
|
55
65
|
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { Messages } from './messages.js';
|
|
2
2
|
import { Resource } from './resource.js';
|
|
3
|
-
import { encodeAttachmentStreams } from '../utils.js';
|
|
3
|
+
import { encodeAttachmentStreams, calculateTotalPayloadSize, } from '../utils.js';
|
|
4
|
+
import { makePathParams } from '../utils.js';
|
|
4
5
|
/**
|
|
5
6
|
* Nylas Drafts API
|
|
6
7
|
*
|
|
@@ -15,7 +16,7 @@ export class Drafts extends Resource {
|
|
|
15
16
|
return super._list({
|
|
16
17
|
queryParams,
|
|
17
18
|
overrides,
|
|
18
|
-
path:
|
|
19
|
+
path: makePathParams('/v3/grants/{identifier}/drafts', { identifier }),
|
|
19
20
|
});
|
|
20
21
|
}
|
|
21
22
|
/**
|
|
@@ -24,7 +25,10 @@ export class Drafts extends Resource {
|
|
|
24
25
|
*/
|
|
25
26
|
find({ identifier, draftId, overrides, }) {
|
|
26
27
|
return super._find({
|
|
27
|
-
path:
|
|
28
|
+
path: makePathParams('/v3/grants/{identifier}/drafts/{draftId}', {
|
|
29
|
+
identifier,
|
|
30
|
+
draftId,
|
|
31
|
+
}),
|
|
28
32
|
overrides,
|
|
29
33
|
});
|
|
30
34
|
}
|
|
@@ -33,12 +37,12 @@ export class Drafts extends Resource {
|
|
|
33
37
|
* @return The draft
|
|
34
38
|
*/
|
|
35
39
|
async create({ identifier, requestBody, overrides, }) {
|
|
36
|
-
const path =
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
if (
|
|
40
|
+
const path = makePathParams('/v3/grants/{identifier}/drafts', {
|
|
41
|
+
identifier,
|
|
42
|
+
});
|
|
43
|
+
// Use form data if the total payload size (body + attachments) is greater than 3mb
|
|
44
|
+
const totalPayloadSize = calculateTotalPayloadSize(requestBody);
|
|
45
|
+
if (totalPayloadSize >= Messages.MAXIMUM_JSON_ATTACHMENT_SIZE) {
|
|
42
46
|
const form = Messages._buildFormRequest(requestBody);
|
|
43
47
|
return this.apiClient.request({
|
|
44
48
|
method: 'POST',
|
|
@@ -65,12 +69,13 @@ export class Drafts extends Resource {
|
|
|
65
69
|
* @return The updated draft
|
|
66
70
|
*/
|
|
67
71
|
async update({ identifier, draftId, requestBody, overrides, }) {
|
|
68
|
-
const path =
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
72
|
+
const path = makePathParams('/v3/grants/{identifier}/drafts/{draftId}', {
|
|
73
|
+
identifier,
|
|
74
|
+
draftId,
|
|
75
|
+
});
|
|
76
|
+
// Use form data if the total payload size (body + attachments) is greater than 3mb
|
|
77
|
+
const totalPayloadSize = calculateTotalPayloadSize(requestBody);
|
|
78
|
+
if (totalPayloadSize >= Messages.MAXIMUM_JSON_ATTACHMENT_SIZE) {
|
|
74
79
|
const form = Messages._buildFormRequest(requestBody);
|
|
75
80
|
return this.apiClient.request({
|
|
76
81
|
method: 'PUT',
|
|
@@ -98,7 +103,10 @@ export class Drafts extends Resource {
|
|
|
98
103
|
*/
|
|
99
104
|
destroy({ identifier, draftId, overrides, }) {
|
|
100
105
|
return super._destroy({
|
|
101
|
-
path:
|
|
106
|
+
path: makePathParams('/v3/grants/{identifier}/drafts/{draftId}', {
|
|
107
|
+
identifier,
|
|
108
|
+
draftId,
|
|
109
|
+
}),
|
|
102
110
|
overrides,
|
|
103
111
|
});
|
|
104
112
|
}
|
|
@@ -108,7 +116,10 @@ export class Drafts extends Resource {
|
|
|
108
116
|
*/
|
|
109
117
|
send({ identifier, draftId, overrides, }) {
|
|
110
118
|
return super._create({
|
|
111
|
-
path:
|
|
119
|
+
path: makePathParams('/v3/grants/{identifier}/drafts/{draftId}', {
|
|
120
|
+
identifier,
|
|
121
|
+
draftId,
|
|
122
|
+
}),
|
|
112
123
|
requestBody: {},
|
|
113
124
|
overrides,
|
|
114
125
|
});
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { Resource } from './resource.js';
|
|
2
|
+
import { makePathParams } from '../utils.js';
|
|
2
3
|
/**
|
|
3
4
|
* Nylas Events API
|
|
4
5
|
*
|
|
@@ -12,7 +13,7 @@ export class Events extends Resource {
|
|
|
12
13
|
list({ identifier, queryParams, overrides, }) {
|
|
13
14
|
return super._list({
|
|
14
15
|
queryParams,
|
|
15
|
-
path:
|
|
16
|
+
path: makePathParams('/v3/grants/{identifier}/events', { identifier }),
|
|
16
17
|
overrides,
|
|
17
18
|
});
|
|
18
19
|
}
|
|
@@ -24,7 +25,9 @@ export class Events extends Resource {
|
|
|
24
25
|
listImportEvents({ identifier, queryParams, overrides, }) {
|
|
25
26
|
return super._list({
|
|
26
27
|
queryParams,
|
|
27
|
-
path:
|
|
28
|
+
path: makePathParams('/v3/grants/{identifier}/events/import', {
|
|
29
|
+
identifier,
|
|
30
|
+
}),
|
|
28
31
|
overrides,
|
|
29
32
|
});
|
|
30
33
|
}
|
|
@@ -34,7 +37,10 @@ export class Events extends Resource {
|
|
|
34
37
|
*/
|
|
35
38
|
find({ identifier, eventId, queryParams, overrides, }) {
|
|
36
39
|
return super._find({
|
|
37
|
-
path:
|
|
40
|
+
path: makePathParams('/v3/grants/{identifier}/events/{eventId}', {
|
|
41
|
+
identifier,
|
|
42
|
+
eventId,
|
|
43
|
+
}),
|
|
38
44
|
queryParams,
|
|
39
45
|
overrides,
|
|
40
46
|
});
|
|
@@ -45,7 +51,7 @@ export class Events extends Resource {
|
|
|
45
51
|
*/
|
|
46
52
|
create({ identifier, requestBody, queryParams, overrides, }) {
|
|
47
53
|
return super._create({
|
|
48
|
-
path:
|
|
54
|
+
path: makePathParams('/v3/grants/{identifier}/events', { identifier }),
|
|
49
55
|
queryParams,
|
|
50
56
|
requestBody,
|
|
51
57
|
overrides,
|
|
@@ -57,7 +63,10 @@ export class Events extends Resource {
|
|
|
57
63
|
*/
|
|
58
64
|
update({ identifier, eventId, requestBody, queryParams, overrides, }) {
|
|
59
65
|
return super._update({
|
|
60
|
-
path:
|
|
66
|
+
path: makePathParams('/v3/grants/{identifier}/events/{eventId}', {
|
|
67
|
+
identifier,
|
|
68
|
+
eventId,
|
|
69
|
+
}),
|
|
61
70
|
queryParams,
|
|
62
71
|
requestBody,
|
|
63
72
|
overrides,
|
|
@@ -69,7 +78,10 @@ export class Events extends Resource {
|
|
|
69
78
|
*/
|
|
70
79
|
destroy({ identifier, eventId, queryParams, overrides, }) {
|
|
71
80
|
return super._destroy({
|
|
72
|
-
path:
|
|
81
|
+
path: makePathParams('/v3/grants/{identifier}/events/{eventId}', {
|
|
82
|
+
identifier,
|
|
83
|
+
eventId,
|
|
84
|
+
}),
|
|
73
85
|
queryParams,
|
|
74
86
|
overrides,
|
|
75
87
|
});
|
|
@@ -81,10 +93,11 @@ export class Events extends Resource {
|
|
|
81
93
|
* @return The send-rsvp response
|
|
82
94
|
*/
|
|
83
95
|
sendRsvp({ identifier, eventId, requestBody, queryParams, overrides, }) {
|
|
84
|
-
return
|
|
85
|
-
|
|
96
|
+
return this.apiClient.request({
|
|
97
|
+
method: 'POST',
|
|
98
|
+
path: makePathParams('/v3/grants/{identifier}/events/{eventId}/send-rsvp', { identifier, eventId }),
|
|
86
99
|
queryParams,
|
|
87
|
-
requestBody,
|
|
100
|
+
body: requestBody,
|
|
88
101
|
overrides,
|
|
89
102
|
});
|
|
90
103
|
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { Resource } from './resource.js';
|
|
2
|
+
import { makePathParams } from '../utils.js';
|
|
2
3
|
/**
|
|
3
4
|
* Nylas Folder API
|
|
4
5
|
*
|
|
@@ -21,7 +22,7 @@ export class Folders extends Resource {
|
|
|
21
22
|
return super._list({
|
|
22
23
|
overrides,
|
|
23
24
|
queryParams,
|
|
24
|
-
path:
|
|
25
|
+
path: makePathParams('/v3/grants/{identifier}/folders', { identifier }),
|
|
25
26
|
});
|
|
26
27
|
}
|
|
27
28
|
/**
|
|
@@ -30,7 +31,10 @@ export class Folders extends Resource {
|
|
|
30
31
|
*/
|
|
31
32
|
find({ identifier, folderId, overrides, }) {
|
|
32
33
|
return super._find({
|
|
33
|
-
path:
|
|
34
|
+
path: makePathParams('/v3/grants/{identifier}/folders/{folderId}', {
|
|
35
|
+
identifier,
|
|
36
|
+
folderId,
|
|
37
|
+
}),
|
|
34
38
|
overrides,
|
|
35
39
|
});
|
|
36
40
|
}
|
|
@@ -40,7 +44,7 @@ export class Folders extends Resource {
|
|
|
40
44
|
*/
|
|
41
45
|
create({ identifier, requestBody, overrides, }) {
|
|
42
46
|
return super._create({
|
|
43
|
-
path:
|
|
47
|
+
path: makePathParams('/v3/grants/{identifier}/folders', { identifier }),
|
|
44
48
|
requestBody,
|
|
45
49
|
overrides,
|
|
46
50
|
});
|
|
@@ -51,7 +55,10 @@ export class Folders extends Resource {
|
|
|
51
55
|
*/
|
|
52
56
|
update({ identifier, folderId, requestBody, overrides, }) {
|
|
53
57
|
return super._update({
|
|
54
|
-
path:
|
|
58
|
+
path: makePathParams('/v3/grants/{identifier}/folders/{folderId}', {
|
|
59
|
+
identifier,
|
|
60
|
+
folderId,
|
|
61
|
+
}),
|
|
55
62
|
requestBody,
|
|
56
63
|
overrides,
|
|
57
64
|
});
|
|
@@ -62,7 +69,10 @@ export class Folders extends Resource {
|
|
|
62
69
|
*/
|
|
63
70
|
destroy({ identifier, folderId, overrides, }) {
|
|
64
71
|
return super._destroy({
|
|
65
|
-
path:
|
|
72
|
+
path: makePathParams('/v3/grants/{identifier}/folders/{folderId}', {
|
|
73
|
+
identifier,
|
|
74
|
+
folderId,
|
|
75
|
+
}),
|
|
66
76
|
overrides,
|
|
67
77
|
});
|
|
68
78
|
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { Resource } from './resource.js';
|
|
2
|
+
import { makePathParams } from '../utils.js';
|
|
2
3
|
/**
|
|
3
4
|
* Nylas Grants API
|
|
4
5
|
*
|
|
@@ -16,7 +17,7 @@ export class Grants extends Resource {
|
|
|
16
17
|
_queryParams) {
|
|
17
18
|
return super._list({
|
|
18
19
|
queryParams: queryParams ?? _queryParams ?? undefined,
|
|
19
|
-
path:
|
|
20
|
+
path: makePathParams('/v3/grants', {}),
|
|
20
21
|
overrides: overrides ?? {},
|
|
21
22
|
});
|
|
22
23
|
}
|
|
@@ -26,7 +27,7 @@ export class Grants extends Resource {
|
|
|
26
27
|
*/
|
|
27
28
|
find({ grantId, overrides, }) {
|
|
28
29
|
return super._find({
|
|
29
|
-
path:
|
|
30
|
+
path: makePathParams('/v3/grants/{grantId}', { grantId }),
|
|
30
31
|
overrides,
|
|
31
32
|
});
|
|
32
33
|
}
|
|
@@ -36,7 +37,7 @@ export class Grants extends Resource {
|
|
|
36
37
|
*/
|
|
37
38
|
update({ grantId, requestBody, overrides, }) {
|
|
38
39
|
return super._updatePatch({
|
|
39
|
-
path:
|
|
40
|
+
path: makePathParams('/v3/grants/{grantId}', { grantId }),
|
|
40
41
|
requestBody,
|
|
41
42
|
overrides,
|
|
42
43
|
});
|
|
@@ -47,7 +48,7 @@ export class Grants extends Resource {
|
|
|
47
48
|
*/
|
|
48
49
|
destroy({ grantId, overrides, }) {
|
|
49
50
|
return super._destroy({
|
|
50
|
-
path:
|
|
51
|
+
path: makePathParams('/v3/grants/{grantId}', { grantId }),
|
|
51
52
|
overrides,
|
|
52
53
|
});
|
|
53
54
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { encodeAttachmentStreams, objKeysToSnakeCase } from '../utils.js';
|
|
1
|
+
import { encodeAttachmentStreams, objKeysToSnakeCase, makePathParams, calculateTotalPayloadSize, } from '../utils.js';
|
|
2
2
|
import { Resource } from './resource.js';
|
|
3
3
|
import { SmartCompose } from './smartCompose.js';
|
|
4
4
|
/**
|
|
@@ -29,7 +29,7 @@ export class Messages extends Resource {
|
|
|
29
29
|
return super._list({
|
|
30
30
|
queryParams: modifiedQueryParams,
|
|
31
31
|
overrides,
|
|
32
|
-
path:
|
|
32
|
+
path: makePathParams('/v3/grants/{identifier}/messages', { identifier }),
|
|
33
33
|
});
|
|
34
34
|
}
|
|
35
35
|
/**
|
|
@@ -38,7 +38,10 @@ export class Messages extends Resource {
|
|
|
38
38
|
*/
|
|
39
39
|
find({ identifier, messageId, overrides, queryParams, }) {
|
|
40
40
|
return super._find({
|
|
41
|
-
path:
|
|
41
|
+
path: makePathParams('/v3/grants/{identifier}/messages/{messageId}', {
|
|
42
|
+
identifier,
|
|
43
|
+
messageId,
|
|
44
|
+
}),
|
|
42
45
|
overrides,
|
|
43
46
|
queryParams,
|
|
44
47
|
});
|
|
@@ -49,7 +52,10 @@ export class Messages extends Resource {
|
|
|
49
52
|
*/
|
|
50
53
|
update({ identifier, messageId, requestBody, overrides, }) {
|
|
51
54
|
return super._update({
|
|
52
|
-
path:
|
|
55
|
+
path: makePathParams('/v3/grants/{identifier}/messages/{messageId}', {
|
|
56
|
+
identifier,
|
|
57
|
+
messageId,
|
|
58
|
+
}),
|
|
53
59
|
requestBody,
|
|
54
60
|
overrides,
|
|
55
61
|
});
|
|
@@ -60,7 +66,10 @@ export class Messages extends Resource {
|
|
|
60
66
|
*/
|
|
61
67
|
destroy({ identifier, messageId, overrides, }) {
|
|
62
68
|
return super._destroy({
|
|
63
|
-
path:
|
|
69
|
+
path: makePathParams('/v3/grants/{identifier}/messages/{messageId}', {
|
|
70
|
+
identifier,
|
|
71
|
+
messageId,
|
|
72
|
+
}),
|
|
64
73
|
overrides,
|
|
65
74
|
});
|
|
66
75
|
}
|
|
@@ -69,17 +78,17 @@ export class Messages extends Resource {
|
|
|
69
78
|
* @return The sent message
|
|
70
79
|
*/
|
|
71
80
|
async send({ identifier, requestBody, overrides, }) {
|
|
72
|
-
const path =
|
|
81
|
+
const path = makePathParams('/v3/grants/{identifier}/messages/send', {
|
|
82
|
+
identifier,
|
|
83
|
+
});
|
|
73
84
|
const requestOptions = {
|
|
74
85
|
method: 'POST',
|
|
75
86
|
path,
|
|
76
87
|
overrides,
|
|
77
88
|
};
|
|
78
|
-
// Use form data
|
|
79
|
-
const
|
|
80
|
-
|
|
81
|
-
}, 0) || 0;
|
|
82
|
-
if (attachmentSize >= Messages.MAXIMUM_JSON_ATTACHMENT_SIZE) {
|
|
89
|
+
// Use form data if the total payload size (body + attachments) is greater than 3mb
|
|
90
|
+
const totalPayloadSize = calculateTotalPayloadSize(requestBody);
|
|
91
|
+
if (totalPayloadSize >= Messages.MAXIMUM_JSON_ATTACHMENT_SIZE) {
|
|
83
92
|
requestOptions.form = Messages._buildFormRequest(requestBody);
|
|
84
93
|
}
|
|
85
94
|
else {
|
|
@@ -102,7 +111,9 @@ export class Messages extends Resource {
|
|
|
102
111
|
*/
|
|
103
112
|
listScheduledMessages({ identifier, overrides, }) {
|
|
104
113
|
return super._find({
|
|
105
|
-
path:
|
|
114
|
+
path: makePathParams('/v3/grants/{identifier}/messages/schedules', {
|
|
115
|
+
identifier,
|
|
116
|
+
}),
|
|
106
117
|
overrides,
|
|
107
118
|
});
|
|
108
119
|
}
|
|
@@ -112,7 +123,7 @@ export class Messages extends Resource {
|
|
|
112
123
|
*/
|
|
113
124
|
findScheduledMessage({ identifier, scheduleId, overrides, }) {
|
|
114
125
|
return super._find({
|
|
115
|
-
path:
|
|
126
|
+
path: makePathParams('/v3/grants/{identifier}/messages/schedules/{scheduleId}', { identifier, scheduleId }),
|
|
116
127
|
overrides,
|
|
117
128
|
});
|
|
118
129
|
}
|
|
@@ -122,7 +133,7 @@ export class Messages extends Resource {
|
|
|
122
133
|
*/
|
|
123
134
|
stopScheduledMessage({ identifier, scheduleId, overrides, }) {
|
|
124
135
|
return super._destroy({
|
|
125
|
-
path:
|
|
136
|
+
path: makePathParams('/v3/grants/{identifier}/messages/schedules/{scheduleId}', { identifier, scheduleId }),
|
|
126
137
|
overrides,
|
|
127
138
|
});
|
|
128
139
|
}
|
|
@@ -133,7 +144,9 @@ export class Messages extends Resource {
|
|
|
133
144
|
cleanMessages({ identifier, requestBody, overrides, }) {
|
|
134
145
|
return this.apiClient.request({
|
|
135
146
|
method: 'PUT',
|
|
136
|
-
path:
|
|
147
|
+
path: makePathParams('/v3/grants/{identifier}/messages/clean', {
|
|
148
|
+
identifier,
|
|
149
|
+
}),
|
|
137
150
|
body: requestBody,
|
|
138
151
|
overrides,
|
|
139
152
|
});
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { Resource } from './resource.js';
|
|
2
|
+
import { makePathParams } from '../utils.js';
|
|
2
3
|
/**
|
|
3
4
|
* Nylas Notetakers API
|
|
4
5
|
*
|
|
@@ -13,8 +14,8 @@ export class Notetakers extends Resource {
|
|
|
13
14
|
list({ identifier, queryParams, overrides, }) {
|
|
14
15
|
return super._list({
|
|
15
16
|
path: identifier
|
|
16
|
-
?
|
|
17
|
-
: '/v3/notetakers',
|
|
17
|
+
? makePathParams('/v3/grants/{identifier}/notetakers', { identifier })
|
|
18
|
+
: makePathParams('/v3/notetakers', {}),
|
|
18
19
|
queryParams,
|
|
19
20
|
overrides,
|
|
20
21
|
});
|
|
@@ -27,8 +28,8 @@ export class Notetakers extends Resource {
|
|
|
27
28
|
create({ identifier, requestBody, overrides, }) {
|
|
28
29
|
return this._create({
|
|
29
30
|
path: identifier
|
|
30
|
-
?
|
|
31
|
-
: '/v3/notetakers',
|
|
31
|
+
? makePathParams('/v3/grants/{identifier}/notetakers', { identifier })
|
|
32
|
+
: makePathParams('/v3/notetakers', {}),
|
|
32
33
|
requestBody,
|
|
33
34
|
overrides,
|
|
34
35
|
});
|
|
@@ -41,8 +42,11 @@ export class Notetakers extends Resource {
|
|
|
41
42
|
find({ identifier, notetakerId, overrides, }) {
|
|
42
43
|
return this._find({
|
|
43
44
|
path: identifier
|
|
44
|
-
?
|
|
45
|
-
|
|
45
|
+
? makePathParams('/v3/grants/{identifier}/notetakers/{notetakerId}', {
|
|
46
|
+
identifier,
|
|
47
|
+
notetakerId,
|
|
48
|
+
})
|
|
49
|
+
: makePathParams('/v3/notetakers/{notetakerId}', { notetakerId }),
|
|
46
50
|
overrides,
|
|
47
51
|
});
|
|
48
52
|
}
|
|
@@ -54,8 +58,11 @@ export class Notetakers extends Resource {
|
|
|
54
58
|
update({ identifier, notetakerId, requestBody, overrides, }) {
|
|
55
59
|
return this._updatePatch({
|
|
56
60
|
path: identifier
|
|
57
|
-
?
|
|
58
|
-
|
|
61
|
+
? makePathParams('/v3/grants/{identifier}/notetakers/{notetakerId}', {
|
|
62
|
+
identifier,
|
|
63
|
+
notetakerId,
|
|
64
|
+
})
|
|
65
|
+
: makePathParams('/v3/notetakers/{notetakerId}', { notetakerId }),
|
|
59
66
|
requestBody,
|
|
60
67
|
overrides,
|
|
61
68
|
});
|
|
@@ -68,8 +75,13 @@ export class Notetakers extends Resource {
|
|
|
68
75
|
cancel({ identifier, notetakerId, overrides, }) {
|
|
69
76
|
return this._destroy({
|
|
70
77
|
path: identifier
|
|
71
|
-
?
|
|
72
|
-
|
|
78
|
+
? makePathParams('/v3/grants/{identifier}/notetakers/{notetakerId}/cancel', {
|
|
79
|
+
identifier,
|
|
80
|
+
notetakerId,
|
|
81
|
+
})
|
|
82
|
+
: makePathParams('/v3/notetakers/{notetakerId}/cancel', {
|
|
83
|
+
notetakerId,
|
|
84
|
+
}),
|
|
73
85
|
overrides,
|
|
74
86
|
});
|
|
75
87
|
}
|
|
@@ -82,8 +94,11 @@ export class Notetakers extends Resource {
|
|
|
82
94
|
return this.apiClient.request({
|
|
83
95
|
method: 'POST',
|
|
84
96
|
path: identifier
|
|
85
|
-
?
|
|
86
|
-
|
|
97
|
+
? makePathParams('/v3/grants/{identifier}/notetakers/{notetakerId}/leave', {
|
|
98
|
+
identifier,
|
|
99
|
+
notetakerId,
|
|
100
|
+
})
|
|
101
|
+
: makePathParams('/v3/notetakers/{notetakerId}/leave', { notetakerId }),
|
|
87
102
|
overrides,
|
|
88
103
|
});
|
|
89
104
|
}
|
|
@@ -96,8 +111,11 @@ export class Notetakers extends Resource {
|
|
|
96
111
|
return this.apiClient.request({
|
|
97
112
|
method: 'GET',
|
|
98
113
|
path: identifier
|
|
99
|
-
?
|
|
100
|
-
|
|
114
|
+
? makePathParams('/v3/grants/{identifier}/notetakers/{notetakerId}/media', {
|
|
115
|
+
identifier,
|
|
116
|
+
notetakerId,
|
|
117
|
+
})
|
|
118
|
+
: makePathParams('/v3/notetakers/{notetakerId}/media', { notetakerId }),
|
|
101
119
|
overrides,
|
|
102
120
|
});
|
|
103
121
|
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { Resource } from './resource.js';
|
|
2
|
+
import { makePathParams } from '../utils.js';
|
|
2
3
|
/**
|
|
3
4
|
* A collection of redirect URI related API endpoints.
|
|
4
5
|
*
|
|
@@ -12,7 +13,7 @@ export class RedirectUris extends Resource {
|
|
|
12
13
|
list({ overrides } = {}) {
|
|
13
14
|
return super._list({
|
|
14
15
|
overrides,
|
|
15
|
-
path: '/v3/applications/redirect-uris',
|
|
16
|
+
path: makePathParams('/v3/applications/redirect-uris', {}),
|
|
16
17
|
});
|
|
17
18
|
}
|
|
18
19
|
/**
|
|
@@ -22,7 +23,9 @@ export class RedirectUris extends Resource {
|
|
|
22
23
|
find({ redirectUriId, overrides, }) {
|
|
23
24
|
return super._find({
|
|
24
25
|
overrides,
|
|
25
|
-
path:
|
|
26
|
+
path: makePathParams('/v3/applications/redirect-uris/{redirectUriId}', {
|
|
27
|
+
redirectUriId,
|
|
28
|
+
}),
|
|
26
29
|
});
|
|
27
30
|
}
|
|
28
31
|
/**
|
|
@@ -32,7 +35,7 @@ export class RedirectUris extends Resource {
|
|
|
32
35
|
create({ requestBody, overrides, }) {
|
|
33
36
|
return super._create({
|
|
34
37
|
overrides,
|
|
35
|
-
path: '/v3/applications/redirect-uris',
|
|
38
|
+
path: makePathParams('/v3/applications/redirect-uris', {}),
|
|
36
39
|
requestBody,
|
|
37
40
|
});
|
|
38
41
|
}
|
|
@@ -43,7 +46,9 @@ export class RedirectUris extends Resource {
|
|
|
43
46
|
update({ redirectUriId, requestBody, overrides, }) {
|
|
44
47
|
return super._update({
|
|
45
48
|
overrides,
|
|
46
|
-
path:
|
|
49
|
+
path: makePathParams('/v3/applications/redirect-uris/{redirectUriId}', {
|
|
50
|
+
redirectUriId,
|
|
51
|
+
}),
|
|
47
52
|
requestBody,
|
|
48
53
|
});
|
|
49
54
|
}
|
|
@@ -54,7 +59,9 @@ export class RedirectUris extends Resource {
|
|
|
54
59
|
destroy({ redirectUriId, overrides, }) {
|
|
55
60
|
return super._destroy({
|
|
56
61
|
overrides,
|
|
57
|
-
path:
|
|
62
|
+
path: makePathParams('/v3/applications/redirect-uris/{redirectUriId}', {
|
|
63
|
+
redirectUriId,
|
|
64
|
+
}),
|
|
58
65
|
});
|
|
59
66
|
}
|
|
60
67
|
}
|
|
@@ -62,7 +62,7 @@ export class Resource {
|
|
|
62
62
|
}
|
|
63
63
|
_list(listParams) {
|
|
64
64
|
const iterator = this.listIterator(listParams);
|
|
65
|
-
const first = iterator.next().then(res => ({
|
|
65
|
+
const first = iterator.next().then((res) => ({
|
|
66
66
|
...res.value,
|
|
67
67
|
next: iterator.next.bind(iterator),
|
|
68
68
|
}));
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { Resource } from './resource.js';
|
|
2
|
+
import { makePathParams } from '../utils.js';
|
|
2
3
|
export class Sessions extends Resource {
|
|
3
4
|
/**
|
|
4
5
|
* Create a Session
|
|
@@ -6,7 +7,7 @@ export class Sessions extends Resource {
|
|
|
6
7
|
*/
|
|
7
8
|
create({ requestBody, overrides, }) {
|
|
8
9
|
return super._create({
|
|
9
|
-
path:
|
|
10
|
+
path: makePathParams('/v3/scheduling/sessions', {}),
|
|
10
11
|
requestBody,
|
|
11
12
|
overrides,
|
|
12
13
|
});
|
|
@@ -17,7 +18,9 @@ export class Sessions extends Resource {
|
|
|
17
18
|
*/
|
|
18
19
|
destroy({ sessionId, overrides, }) {
|
|
19
20
|
return super._destroy({
|
|
20
|
-
path:
|
|
21
|
+
path: makePathParams('/v3/scheduling/sessions/{sessionId}', {
|
|
22
|
+
sessionId,
|
|
23
|
+
}),
|
|
21
24
|
overrides,
|
|
22
25
|
});
|
|
23
26
|
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { Resource } from './resource.js';
|
|
2
|
+
import { makePathParams } from '../utils.js';
|
|
2
3
|
/**
|
|
3
4
|
* A collection of Smart Compose related API endpoints.
|
|
4
5
|
*
|
|
@@ -11,7 +12,9 @@ export class SmartCompose extends Resource {
|
|
|
11
12
|
*/
|
|
12
13
|
composeMessage({ identifier, requestBody, overrides, }) {
|
|
13
14
|
return super._create({
|
|
14
|
-
path:
|
|
15
|
+
path: makePathParams('/v3/grants/{identifier}/messages/smart-compose', {
|
|
16
|
+
identifier,
|
|
17
|
+
}),
|
|
15
18
|
requestBody,
|
|
16
19
|
overrides,
|
|
17
20
|
});
|
|
@@ -22,7 +25,7 @@ export class SmartCompose extends Resource {
|
|
|
22
25
|
*/
|
|
23
26
|
composeMessageReply({ identifier, messageId, requestBody, overrides, }) {
|
|
24
27
|
return super._create({
|
|
25
|
-
path:
|
|
28
|
+
path: makePathParams('/v3/grants/{identifier}/messages/{messageId}/smart-compose', { identifier, messageId }),
|
|
26
29
|
requestBody,
|
|
27
30
|
overrides,
|
|
28
31
|
});
|