nylas 7.1.0 → 7.2.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.
@@ -30,10 +30,11 @@ class Messages extends resource_js_1.Resource {
30
30
  * Return a Message
31
31
  * @return The message
32
32
  */
33
- find({ identifier, messageId, overrides, }) {
33
+ find({ identifier, messageId, overrides, queryParams, }) {
34
34
  return super._find({
35
35
  path: `/v3/grants/${identifier}/messages/${messageId}`,
36
36
  overrides,
37
+ queryParams,
37
38
  });
38
39
  }
39
40
  /**
@@ -2,4 +2,4 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.SDK_VERSION = void 0;
4
4
  // This file is generated by scripts/exportVersion.js
5
- exports.SDK_VERSION = '7.1.0';
5
+ exports.SDK_VERSION = '7.2.0';
@@ -27,10 +27,11 @@ export class Messages extends Resource {
27
27
  * Return a Message
28
28
  * @return The message
29
29
  */
30
- find({ identifier, messageId, overrides, }) {
30
+ find({ identifier, messageId, overrides, queryParams, }) {
31
31
  return super._find({
32
32
  path: `/v3/grants/${identifier}/messages/${messageId}`,
33
33
  overrides,
34
+ queryParams,
34
35
  });
35
36
  }
36
37
  /**
@@ -1,2 +1,2 @@
1
1
  // This file is generated by scripts/exportVersion.js
2
- export const SDK_VERSION = '7.1.0';
2
+ export const SDK_VERSION = '7.2.0';
@@ -5,7 +5,7 @@ type AccessType = 'online' | 'offline';
5
5
  /**
6
6
  * Type for the different OAuth providers Nylas supports.
7
7
  */
8
- export type Provider = 'google' | 'imap' | 'microsoft' | 'virtual-calendar';
8
+ export type Provider = 'google' | 'imap' | 'microsoft' | 'icloud' | 'virtual-calendar';
9
9
  /**
10
10
  * Configuration for generating a URL for OAuth 2.0 authentication.
11
11
  */
@@ -167,10 +167,6 @@ export interface ProviderDetectParams {
167
167
  * Email address to detect the provider for.
168
168
  */
169
169
  email: string;
170
- /**
171
- * Client ID of the Nylas application.
172
- */
173
- clientId: string;
174
170
  /**
175
171
  * Search by all providers regardless of created integrations. If unset, defaults to false.
176
172
  */
@@ -39,14 +39,22 @@ export interface GetAvailabilityRequest {
39
39
  */
40
40
  intervalMinutes?: number;
41
41
  /**
42
- * When set to true, the availability time slots will start at 30 minutes past or on the hour.
43
- * For example, a free slot starting at 16:10 is considered available only from 16:30.
42
+ * The number of minutes to round the time slots to.
43
+ * This allows for rounding to any multiple of 5 minutes, up to a maximum of 60 minutes.
44
+ * The default value is set to 15 minutes.
45
+ * When this variable is assigned a value, it overrides the behavior of the {@link roundTo30Minutes} flag, if it was set.
44
46
  */
45
- roundTo30Minutes?: boolean;
47
+ roundTo?: number;
46
48
  /**
47
49
  * The rules to apply when checking availability.
48
50
  */
49
51
  availabilityRules?: AvailabilityRules;
52
+ /**
53
+ * When set to true, the availability time slots will start at 30 minutes past or on the hour.
54
+ * For example, a free slot starting at 16:10 is considered available only from 16:30.
55
+ * @deprecated Use [roundTo] instead.
56
+ */
57
+ roundTo30Minutes?: boolean;
50
58
  }
51
59
  /**
52
60
  * Interface for a Nylas availability time slot
@@ -1,9 +1,48 @@
1
- import { BaseMessage, BaseCreateMessage } from './messages.js';
1
+ import { BaseMessage } from './messages.js';
2
2
  import { ListQueryParams } from './listQueryParams.js';
3
+ import { EmailName } from './events.js';
4
+ import { CreateAttachmentRequest } from './attachments.js';
3
5
  /**
4
6
  * Interface representing a request to create a draft.
5
7
  */
6
- export interface CreateDraftRequest extends BaseCreateMessage {
8
+ export interface CreateDraftRequest {
9
+ /**
10
+ * An array of name/email address pairs that the message was sent from. This is usually one pair only, but can be many.
11
+ */
12
+ from?: EmailName[];
13
+ /**
14
+ * An array of message recipients.
15
+ */
16
+ to: EmailName[];
17
+ /**
18
+ * An array of bcc recipients.
19
+ */
20
+ bcc?: EmailName[];
21
+ /**
22
+ * An array of cc recipients.
23
+ */
24
+ cc?: EmailName[];
25
+ /**
26
+ * An array of name and email pairs that override the sent reply-to headers.
27
+ */
28
+ replyTo?: EmailName[];
29
+ /**
30
+ * An array of files to attach to the message.
31
+ */
32
+ attachments?: CreateAttachmentRequest[];
33
+ /**
34
+ * The message subject.
35
+ */
36
+ subject?: string;
37
+ /**
38
+ * The full HTML message body.
39
+ * Messages with only plain-text representations are up-converted to HTML.
40
+ */
41
+ body?: string;
42
+ /**
43
+ * Whether or not the message has been starred by the user.
44
+ */
45
+ starred?: boolean;
7
46
  /**
8
47
  * Unix timestamp to send the message at.
9
48
  */
@@ -21,6 +60,10 @@ export interface CreateDraftRequest extends BaseCreateMessage {
21
60
  * Interface representing a request to send a message.
22
61
  */
23
62
  export interface SendMessageRequest extends CreateDraftRequest {
63
+ /**
64
+ * An array of message senders.
65
+ */
66
+ from?: EmailName[];
24
67
  /**
25
68
  * Whether or not to use draft support.
26
69
  * This is primarily used when dealing with large attachments.
@@ -46,6 +46,13 @@ export interface Folder {
46
46
  * The number of unread items inside of a folder.
47
47
  */
48
48
  unreadCount?: number;
49
+ /**
50
+ * Common attribute descriptors shared by system folders across providers.
51
+ * For example, Sent email folders have the `["\\Sent"]` attribute.
52
+ * For IMAP grants, IMAP providers provide the attributes.
53
+ * For Google and Microsoft Graph, Nylas matches system folders to a set of common attributes.
54
+ */
55
+ attributes?: string[];
49
56
  }
50
57
  /**
51
58
  * Interface for creating a new folder.
@@ -1,10 +1,31 @@
1
1
  import { EmailName } from './events.js';
2
2
  import { ListQueryParams } from './listQueryParams.js';
3
- import { Attachment, CreateAttachmentRequest } from './attachments.js';
3
+ import { Attachment } from './attachments.js';
4
4
  /**
5
- * @internal Internal interface for creating a message.
5
+ * @internal Internal interface for a message.
6
6
  */
7
- export interface BaseCreateMessage {
7
+ export interface BaseMessage {
8
+ /**
9
+ * The unique identifier for the message.
10
+ */
11
+ id: string;
12
+ /**
13
+ * Grant ID of the Nylas account.
14
+ */
15
+ grantId: string;
16
+ /**
17
+ * Unix timestamp of when the message was received by the mail server.
18
+ * This may be different from the unverified Date header in raw message object.
19
+ */
20
+ date: number;
21
+ /**
22
+ * Unix timestamp of when the message was created.
23
+ */
24
+ createdAt: number;
25
+ /**
26
+ * The ID of the folder(s) the message appears in.
27
+ */
28
+ folders: string[];
8
29
  /**
9
30
  * An array of message recipients.
10
31
  */
@@ -21,10 +42,6 @@ export interface BaseCreateMessage {
21
42
  * An array of name and email pairs that override the sent reply-to headers.
22
43
  */
23
44
  replyTo?: EmailName[];
24
- /**
25
- * An array of files to attach to the message.
26
- */
27
- attachments?: CreateAttachmentRequest[];
28
45
  /**
29
46
  * The message subject.
30
47
  */
@@ -38,32 +55,6 @@ export interface BaseCreateMessage {
38
55
  * Whether or not the message has been starred by the user.
39
56
  */
40
57
  starred?: boolean;
41
- }
42
- /**
43
- * @internal Internal interface for a message.
44
- */
45
- export interface BaseMessage extends Omit<BaseCreateMessage, 'attachments'> {
46
- /**
47
- * The unique identifier for the message.
48
- */
49
- id: string;
50
- /**
51
- * Grant ID of the Nylas account.
52
- */
53
- grantId: string;
54
- /**
55
- * Unix timestamp of when the message was received by the mail server.
56
- * This may be different from the unverified Date header in raw message object.
57
- */
58
- date: number;
59
- /**
60
- * Unix timestamp of when the message was created.
61
- */
62
- createdAt: number;
63
- /**
64
- * The ID of the folder(s) the message appears in.
65
- */
66
- folders: string[];
67
58
  /**
68
59
  * An array of message senders.
69
60
  */
@@ -104,6 +95,19 @@ export interface Message extends BaseMessage {
104
95
  * A list of key-value pairs storing additional data.
105
96
  */
106
97
  metadata?: Record<string, unknown>;
98
+ /**
99
+ * The unique identifier for the scheduled message.
100
+ */
101
+ scheduleId?: string;
102
+ /**
103
+ * Unix timestamp to send the message at.
104
+ */
105
+ sendAt?: number;
106
+ /**
107
+ * Whether or not to use draft support.
108
+ * This is primarily used when dealing with large attachments.
109
+ */
110
+ useDraft?: boolean;
107
111
  }
108
112
  /**
109
113
  * Interface representing a request to update a message.
@@ -1,8 +1,8 @@
1
1
  import { AsyncListResponse, Resource } from './resource.js';
2
- import { BaseCreateMessage, FindMessageQueryParams, ListMessagesQueryParams, Message, ScheduledMessage, ScheduledMessagesList, StopScheduledMessageResponse, UpdateMessageRequest } from '../models/messages.js';
2
+ import { FindMessageQueryParams, ListMessagesQueryParams, Message, ScheduledMessage, ScheduledMessagesList, StopScheduledMessageResponse, UpdateMessageRequest } from '../models/messages.js';
3
3
  import { Overrides } from '../config.js';
4
4
  import { NylasBaseResponse, NylasListResponse, NylasResponse } from '../models/response.js';
5
- import { SendMessageRequest, UpdateDraftRequest } from '../models/drafts.js';
5
+ import { CreateDraftRequest, SendMessageRequest, UpdateDraftRequest } from '../models/drafts.js';
6
6
  import * as FormData from 'form-data';
7
7
  import { SmartCompose } from './smartCompose.js';
8
8
  import APIClient from '../apiClient.js';
@@ -94,7 +94,7 @@ export declare class Messages extends Resource {
94
94
  * Return a Message
95
95
  * @return The message
96
96
  */
97
- find({ identifier, messageId, overrides, }: FindMessageParams & Overrides): Promise<NylasResponse<Message>>;
97
+ find({ identifier, messageId, overrides, queryParams, }: FindMessageParams & Overrides): Promise<NylasResponse<Message>>;
98
98
  /**
99
99
  * Update a Message
100
100
  * @return The updated message
@@ -125,5 +125,5 @@ export declare class Messages extends Resource {
125
125
  * @return The confirmation of the stopped scheduled message
126
126
  */
127
127
  stopScheduledMessage({ identifier, scheduleId, overrides, }: StopScheduledMessageParams & Overrides): Promise<NylasResponse<StopScheduledMessageResponse>>;
128
- static _buildFormRequest(requestBody: BaseCreateMessage | UpdateDraftRequest): FormData;
128
+ static _buildFormRequest(requestBody: CreateDraftRequest | UpdateDraftRequest | SendMessageRequest): FormData;
129
129
  }
@@ -1 +1 @@
1
- export declare const SDK_VERSION = "7.1.0";
1
+ export declare const SDK_VERSION = "7.2.0";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nylas",
3
- "version": "7.1.0",
3
+ "version": "7.2.0",
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",