nylas 8.0.5 → 8.1.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/models/agentLists.js +2 -0
- package/lib/cjs/models/index.js +3 -0
- package/lib/cjs/models/policies.js +2 -0
- package/lib/cjs/models/rules.js +2 -0
- package/lib/cjs/nylas.js +6 -0
- package/lib/cjs/resources/agentLists.js +99 -0
- package/lib/cjs/resources/attachments.js +28 -0
- package/lib/cjs/resources/policies.js +66 -0
- package/lib/cjs/resources/rules.js +79 -0
- package/lib/cjs/version.js +1 -1
- package/lib/esm/models/agentLists.js +1 -0
- package/lib/esm/models/index.js +3 -0
- package/lib/esm/models/policies.js +1 -0
- package/lib/esm/models/rules.js +1 -0
- package/lib/esm/nylas.js +6 -0
- package/lib/esm/resources/agentLists.js +95 -0
- package/lib/esm/resources/attachments.js +28 -0
- package/lib/esm/resources/policies.js +62 -0
- package/lib/esm/resources/rules.js +75 -0
- package/lib/esm/version.js +1 -1
- package/lib/types/models/agentLists.d.ts +123 -0
- package/lib/types/models/attachments.d.ts +81 -0
- package/lib/types/models/auth.d.ts +1 -1
- package/lib/types/models/grants.d.ts +37 -2
- package/lib/types/models/index.d.ts +3 -0
- package/lib/types/models/policies.d.ts +167 -0
- package/lib/types/models/rules.d.ts +318 -0
- package/lib/types/nylas.d.ts +15 -0
- package/lib/types/resources/agentLists.d.ts +108 -0
- package/lib/types/resources/attachments.d.ts +31 -1
- package/lib/types/resources/policies.d.ts +69 -0
- package/lib/types/resources/rules.d.ts +82 -0
- package/lib/types/version.d.ts +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,318 @@
|
|
|
1
|
+
import { ListQueryParams } from './listQueryParams.js';
|
|
2
|
+
/**
|
|
3
|
+
* Type for when a Nylas Agent Account rule is evaluated.
|
|
4
|
+
*/
|
|
5
|
+
export type RuleTrigger = 'inbound' | 'outbound';
|
|
6
|
+
/**
|
|
7
|
+
* Type for how rule conditions are combined.
|
|
8
|
+
*/
|
|
9
|
+
export type RuleMatchOperator = 'all' | 'any';
|
|
10
|
+
/**
|
|
11
|
+
* Type for fields a rule condition can match.
|
|
12
|
+
*/
|
|
13
|
+
export type RuleConditionField = 'from.address' | 'from.domain' | 'from.tld' | 'recipient.address' | 'recipient.domain' | 'recipient.tld' | 'outbound.type';
|
|
14
|
+
/**
|
|
15
|
+
* Type for how a condition compares its field value.
|
|
16
|
+
*/
|
|
17
|
+
export type RuleConditionOperator = 'is' | 'is_not' | 'contains' | 'in_list';
|
|
18
|
+
/**
|
|
19
|
+
* Type for the outbound send classification used in rule evaluation.
|
|
20
|
+
*/
|
|
21
|
+
export type RuleOutboundType = 'compose' | 'reply';
|
|
22
|
+
/**
|
|
23
|
+
* Type for actions a rule can apply when matched.
|
|
24
|
+
*/
|
|
25
|
+
export type RuleActionType = 'block' | 'mark_as_spam' | 'assign_to_folder' | 'mark_as_read' | 'mark_as_starred' | 'archive' | 'trash';
|
|
26
|
+
/**
|
|
27
|
+
* Type for where in the processing pipeline a rule evaluation happened.
|
|
28
|
+
*/
|
|
29
|
+
export type RuleEvaluationStage = 'smtp_rcpt' | 'inbox_processing' | 'outbound_send';
|
|
30
|
+
/**
|
|
31
|
+
* Interface representing a Nylas Agent Account rule condition.
|
|
32
|
+
*/
|
|
33
|
+
export interface RuleCondition {
|
|
34
|
+
/**
|
|
35
|
+
* The field to match against.
|
|
36
|
+
*/
|
|
37
|
+
field: RuleConditionField;
|
|
38
|
+
/**
|
|
39
|
+
* How to compare the field value.
|
|
40
|
+
*/
|
|
41
|
+
operator: RuleConditionOperator;
|
|
42
|
+
/**
|
|
43
|
+
* The value to compare against. For in_list, pass one or more List IDs.
|
|
44
|
+
*/
|
|
45
|
+
value: string | string[];
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* Interface representing the match clause for a rule.
|
|
49
|
+
*/
|
|
50
|
+
export interface RuleMatch {
|
|
51
|
+
/**
|
|
52
|
+
* How conditions are combined. Defaults to all when omitted.
|
|
53
|
+
*/
|
|
54
|
+
operator?: RuleMatchOperator;
|
|
55
|
+
/**
|
|
56
|
+
* The list of conditions to evaluate.
|
|
57
|
+
*/
|
|
58
|
+
conditions: RuleCondition[];
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* Interface representing a Nylas Agent Account rule action.
|
|
62
|
+
*/
|
|
63
|
+
export interface RuleAction {
|
|
64
|
+
/**
|
|
65
|
+
* The action to take when the rule matches.
|
|
66
|
+
*/
|
|
67
|
+
type: RuleActionType;
|
|
68
|
+
/**
|
|
69
|
+
* Required when type is assign_to_folder.
|
|
70
|
+
*/
|
|
71
|
+
value?: string;
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* Interface representing a Nylas Agent Account rule.
|
|
75
|
+
*/
|
|
76
|
+
export interface Rule {
|
|
77
|
+
/**
|
|
78
|
+
* Globally unique identifier for the rule.
|
|
79
|
+
*/
|
|
80
|
+
id: string;
|
|
81
|
+
/**
|
|
82
|
+
* Human-readable name for the rule.
|
|
83
|
+
*/
|
|
84
|
+
name: string;
|
|
85
|
+
/**
|
|
86
|
+
* Optional description of what the rule does.
|
|
87
|
+
*/
|
|
88
|
+
description?: string;
|
|
89
|
+
/**
|
|
90
|
+
* Execution order for the rule. Lower numbers run first.
|
|
91
|
+
*/
|
|
92
|
+
priority?: number;
|
|
93
|
+
/**
|
|
94
|
+
* Whether the rule is active.
|
|
95
|
+
*/
|
|
96
|
+
enabled?: boolean;
|
|
97
|
+
/**
|
|
98
|
+
* When the rule is evaluated.
|
|
99
|
+
*/
|
|
100
|
+
trigger?: RuleTrigger;
|
|
101
|
+
/**
|
|
102
|
+
* Conditions that must be met for the rule to apply.
|
|
103
|
+
*/
|
|
104
|
+
match: RuleMatch;
|
|
105
|
+
/**
|
|
106
|
+
* Actions to perform when the rule matches.
|
|
107
|
+
*/
|
|
108
|
+
actions: RuleAction[];
|
|
109
|
+
/**
|
|
110
|
+
* The ID of the application that owns the rule.
|
|
111
|
+
*/
|
|
112
|
+
applicationId?: string;
|
|
113
|
+
/**
|
|
114
|
+
* The ID of the Nylas organization that owns the rule.
|
|
115
|
+
*/
|
|
116
|
+
organizationId?: string;
|
|
117
|
+
/**
|
|
118
|
+
* Unix timestamp when the rule was created.
|
|
119
|
+
*/
|
|
120
|
+
createdAt?: number;
|
|
121
|
+
/**
|
|
122
|
+
* Unix timestamp when the rule was last updated.
|
|
123
|
+
*/
|
|
124
|
+
updatedAt?: number;
|
|
125
|
+
}
|
|
126
|
+
/**
|
|
127
|
+
* Interface representing a request to create a Nylas Agent Account rule.
|
|
128
|
+
*/
|
|
129
|
+
export interface CreateRuleRequest {
|
|
130
|
+
/**
|
|
131
|
+
* Human-readable name for the rule.
|
|
132
|
+
*/
|
|
133
|
+
name: string;
|
|
134
|
+
/**
|
|
135
|
+
* Optional description of what the rule does.
|
|
136
|
+
*/
|
|
137
|
+
description?: string;
|
|
138
|
+
/**
|
|
139
|
+
* Execution order for the rule. Lower numbers run first.
|
|
140
|
+
*/
|
|
141
|
+
priority?: number;
|
|
142
|
+
/**
|
|
143
|
+
* Whether the rule is active.
|
|
144
|
+
*/
|
|
145
|
+
enabled?: boolean;
|
|
146
|
+
/**
|
|
147
|
+
* When the rule is evaluated.
|
|
148
|
+
*/
|
|
149
|
+
trigger?: RuleTrigger;
|
|
150
|
+
/**
|
|
151
|
+
* Conditions that must be met for the rule to apply.
|
|
152
|
+
*/
|
|
153
|
+
match: RuleMatch;
|
|
154
|
+
/**
|
|
155
|
+
* Actions to perform when the rule matches.
|
|
156
|
+
*/
|
|
157
|
+
actions: RuleAction[];
|
|
158
|
+
}
|
|
159
|
+
/**
|
|
160
|
+
* Interface representing a request to update a Nylas Agent Account rule.
|
|
161
|
+
*/
|
|
162
|
+
export interface UpdateRuleRequest {
|
|
163
|
+
/**
|
|
164
|
+
* Human-readable name for the rule.
|
|
165
|
+
*/
|
|
166
|
+
name?: string;
|
|
167
|
+
/**
|
|
168
|
+
* Optional description of what the rule does.
|
|
169
|
+
*/
|
|
170
|
+
description?: string;
|
|
171
|
+
/**
|
|
172
|
+
* Execution order for the rule. Lower numbers run first.
|
|
173
|
+
*/
|
|
174
|
+
priority?: number;
|
|
175
|
+
/**
|
|
176
|
+
* Whether the rule is active.
|
|
177
|
+
*/
|
|
178
|
+
enabled?: boolean;
|
|
179
|
+
/**
|
|
180
|
+
* When the rule is evaluated.
|
|
181
|
+
*/
|
|
182
|
+
trigger?: RuleTrigger;
|
|
183
|
+
/**
|
|
184
|
+
* Conditions that must be met for the rule to apply.
|
|
185
|
+
*/
|
|
186
|
+
match?: RuleMatch;
|
|
187
|
+
/**
|
|
188
|
+
* Actions to perform when the rule matches.
|
|
189
|
+
*/
|
|
190
|
+
actions?: RuleAction[];
|
|
191
|
+
}
|
|
192
|
+
/**
|
|
193
|
+
* Interface representing the normalized data evaluated by the Rules engine.
|
|
194
|
+
*/
|
|
195
|
+
export interface RuleEvaluationInput {
|
|
196
|
+
/**
|
|
197
|
+
* The normalized sender email address.
|
|
198
|
+
*/
|
|
199
|
+
fromAddress?: string;
|
|
200
|
+
/**
|
|
201
|
+
* The normalized sender domain.
|
|
202
|
+
*/
|
|
203
|
+
fromDomain?: string;
|
|
204
|
+
/**
|
|
205
|
+
* The normalized sender top-level domain.
|
|
206
|
+
*/
|
|
207
|
+
fromTld?: string;
|
|
208
|
+
/**
|
|
209
|
+
* Outbound recipient email addresses considered during rule evaluation.
|
|
210
|
+
*/
|
|
211
|
+
recipientAddresses?: string[];
|
|
212
|
+
/**
|
|
213
|
+
* Outbound recipient domains considered during rule evaluation.
|
|
214
|
+
*/
|
|
215
|
+
recipientDomains?: string[];
|
|
216
|
+
/**
|
|
217
|
+
* Outbound recipient top-level domains considered during rule evaluation.
|
|
218
|
+
*/
|
|
219
|
+
recipientTlds?: string[];
|
|
220
|
+
/**
|
|
221
|
+
* Outbound send classification used during rule evaluation.
|
|
222
|
+
*/
|
|
223
|
+
outboundType?: RuleOutboundType;
|
|
224
|
+
}
|
|
225
|
+
/**
|
|
226
|
+
* Interface representing actions applied during a rule evaluation.
|
|
227
|
+
*/
|
|
228
|
+
export interface RuleEvaluationAppliedActions {
|
|
229
|
+
/**
|
|
230
|
+
* Whether the inbound message or outbound send was blocked.
|
|
231
|
+
*/
|
|
232
|
+
blocked?: boolean;
|
|
233
|
+
/**
|
|
234
|
+
* Whether the message or stored sent copy was moved to spam.
|
|
235
|
+
*/
|
|
236
|
+
markedAsSpam?: boolean;
|
|
237
|
+
/**
|
|
238
|
+
* Whether the message or stored sent copy was marked as read.
|
|
239
|
+
*/
|
|
240
|
+
markedAsRead?: boolean;
|
|
241
|
+
/**
|
|
242
|
+
* Whether the message or stored sent copy was starred.
|
|
243
|
+
*/
|
|
244
|
+
markedStarred?: boolean;
|
|
245
|
+
/**
|
|
246
|
+
* Whether the message or stored sent copy was archived.
|
|
247
|
+
*/
|
|
248
|
+
archived?: boolean;
|
|
249
|
+
/**
|
|
250
|
+
* Whether the message or stored sent copy was moved to trash.
|
|
251
|
+
*/
|
|
252
|
+
trashed?: boolean;
|
|
253
|
+
/**
|
|
254
|
+
* IDs of folders assigned by matching rules.
|
|
255
|
+
*/
|
|
256
|
+
folderIds?: string[];
|
|
257
|
+
}
|
|
258
|
+
/**
|
|
259
|
+
* Interface representing a Nylas Agent Account rule evaluation record.
|
|
260
|
+
*/
|
|
261
|
+
export interface RuleEvaluation {
|
|
262
|
+
/**
|
|
263
|
+
* Globally unique identifier for this evaluation record.
|
|
264
|
+
*/
|
|
265
|
+
id: string;
|
|
266
|
+
/**
|
|
267
|
+
* The grant this evaluation belongs to.
|
|
268
|
+
*/
|
|
269
|
+
grantId: string;
|
|
270
|
+
/**
|
|
271
|
+
* The inbound message or stored sent copy associated with this evaluation.
|
|
272
|
+
*/
|
|
273
|
+
messageId?: string | null;
|
|
274
|
+
/**
|
|
275
|
+
* Unix timestamp when the evaluation occurred.
|
|
276
|
+
*/
|
|
277
|
+
evaluatedAt?: number;
|
|
278
|
+
/**
|
|
279
|
+
* Where in the processing pipeline the evaluation happened.
|
|
280
|
+
*/
|
|
281
|
+
evaluationStage?: RuleEvaluationStage;
|
|
282
|
+
/**
|
|
283
|
+
* The normalized data that rules were matched against.
|
|
284
|
+
*/
|
|
285
|
+
evaluationInput?: RuleEvaluationInput;
|
|
286
|
+
/**
|
|
287
|
+
* The actions that were applied as a result of matching rules.
|
|
288
|
+
*/
|
|
289
|
+
appliedActions?: RuleEvaluationAppliedActions;
|
|
290
|
+
/**
|
|
291
|
+
* IDs of the rules that matched during this evaluation.
|
|
292
|
+
*/
|
|
293
|
+
matchedRuleIds?: string[];
|
|
294
|
+
/**
|
|
295
|
+
* The ID of the application this evaluation belongs to.
|
|
296
|
+
*/
|
|
297
|
+
applicationId?: string;
|
|
298
|
+
/**
|
|
299
|
+
* The ID of the Nylas organization this evaluation belongs to.
|
|
300
|
+
*/
|
|
301
|
+
organizationId?: string;
|
|
302
|
+
/**
|
|
303
|
+
* Unix timestamp when the evaluation record was created.
|
|
304
|
+
*/
|
|
305
|
+
createdAt?: number;
|
|
306
|
+
/**
|
|
307
|
+
* Unix timestamp when the evaluation record was last updated.
|
|
308
|
+
*/
|
|
309
|
+
updatedAt?: number;
|
|
310
|
+
}
|
|
311
|
+
/**
|
|
312
|
+
* Interface representing query parameters for listing rules.
|
|
313
|
+
*/
|
|
314
|
+
export type ListRulesQueryParams = ListQueryParams;
|
|
315
|
+
/**
|
|
316
|
+
* Interface representing query parameters for listing rule evaluations.
|
|
317
|
+
*/
|
|
318
|
+
export type ListRuleEvaluationsQueryParams = ListQueryParams;
|
package/lib/types/nylas.d.ts
CHANGED
|
@@ -16,6 +16,9 @@ import { Contacts } from './resources/contacts.js';
|
|
|
16
16
|
import { Attachments } from './resources/attachments.js';
|
|
17
17
|
import { Scheduler } from './resources/scheduler.js';
|
|
18
18
|
import { Notetakers } from './resources/notetakers.js';
|
|
19
|
+
import { Policies } from './resources/policies.js';
|
|
20
|
+
import { Rules } from './resources/rules.js';
|
|
21
|
+
import { AgentLists } from './resources/agentLists.js';
|
|
19
22
|
/**
|
|
20
23
|
* The entry point to the Node SDK
|
|
21
24
|
*
|
|
@@ -67,6 +70,18 @@ declare class Nylas {
|
|
|
67
70
|
* Access the Notetakers API
|
|
68
71
|
*/
|
|
69
72
|
notetakers: Notetakers;
|
|
73
|
+
/**
|
|
74
|
+
* Access the Agent Account Policies API
|
|
75
|
+
*/
|
|
76
|
+
policies: Policies;
|
|
77
|
+
/**
|
|
78
|
+
* Access the Agent Account Rules API
|
|
79
|
+
*/
|
|
80
|
+
rules: Rules;
|
|
81
|
+
/**
|
|
82
|
+
* Access the Agent Account Lists API
|
|
83
|
+
*/
|
|
84
|
+
lists: AgentLists;
|
|
70
85
|
/**
|
|
71
86
|
* Access the Threads API
|
|
72
87
|
*/
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
import { Overrides } from '../config.js';
|
|
2
|
+
import { AddAgentListItemsRequest, AgentList, AgentListItem, CreateAgentListRequest, ListAgentListItemsQueryParams, ListAgentListsQueryParams, RemoveAgentListItemsRequest, UpdateAgentListRequest } from '../models/agentLists.js';
|
|
3
|
+
import { NylasBaseResponse, NylasListResponse, NylasResponse } from '../models/response.js';
|
|
4
|
+
import { AsyncListResponse, Resource } from './resource.js';
|
|
5
|
+
/**
|
|
6
|
+
* @property queryParams The query parameters to include in the request.
|
|
7
|
+
*/
|
|
8
|
+
interface ListAgentListsParams {
|
|
9
|
+
queryParams?: ListAgentListsQueryParams;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* @property listId The ID of the list to retrieve.
|
|
13
|
+
*/
|
|
14
|
+
interface FindAgentListParams {
|
|
15
|
+
listId: string;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* @property requestBody The values to create the list with.
|
|
19
|
+
*/
|
|
20
|
+
interface CreateAgentListParams {
|
|
21
|
+
requestBody: CreateAgentListRequest;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* @property listId The ID of the list to update.
|
|
25
|
+
* @property requestBody The values to update the list with.
|
|
26
|
+
*/
|
|
27
|
+
interface UpdateAgentListParams {
|
|
28
|
+
listId: string;
|
|
29
|
+
requestBody: UpdateAgentListRequest;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* @property listId The ID of the list to delete.
|
|
33
|
+
*/
|
|
34
|
+
interface DestroyAgentListParams {
|
|
35
|
+
listId: string;
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* @property listId The ID of the list to list items from.
|
|
39
|
+
* @property queryParams The query parameters to include in the request.
|
|
40
|
+
*/
|
|
41
|
+
interface ListAgentListItemsParams {
|
|
42
|
+
listId: string;
|
|
43
|
+
queryParams?: ListAgentListItemsQueryParams;
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* @property listId The ID of the list to add items to.
|
|
47
|
+
* @property requestBody The values to add to the list.
|
|
48
|
+
*/
|
|
49
|
+
interface AddAgentListItemsParams {
|
|
50
|
+
listId: string;
|
|
51
|
+
requestBody: AddAgentListItemsRequest;
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* @property listId The ID of the list to remove items from.
|
|
55
|
+
* @property requestBody The values to remove from the list.
|
|
56
|
+
*/
|
|
57
|
+
interface RemoveAgentListItemsParams {
|
|
58
|
+
listId: string;
|
|
59
|
+
requestBody: RemoveAgentListItemsRequest;
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* Nylas Agent Account Lists API
|
|
63
|
+
*
|
|
64
|
+
* Lists manage values that rules can reference using the in_list operator.
|
|
65
|
+
*/
|
|
66
|
+
export declare class AgentLists extends Resource {
|
|
67
|
+
/**
|
|
68
|
+
* Return all lists.
|
|
69
|
+
* @return The list of Agent Account lists.
|
|
70
|
+
*/
|
|
71
|
+
list({ queryParams, overrides, }?: ListAgentListsParams & Overrides): AsyncListResponse<NylasListResponse<AgentList>>;
|
|
72
|
+
/**
|
|
73
|
+
* Return a list.
|
|
74
|
+
* @return The Agent Account list.
|
|
75
|
+
*/
|
|
76
|
+
find({ listId, overrides, }: FindAgentListParams & Overrides): Promise<NylasResponse<AgentList>>;
|
|
77
|
+
/**
|
|
78
|
+
* Create a list.
|
|
79
|
+
* @return The created Agent Account list.
|
|
80
|
+
*/
|
|
81
|
+
create({ requestBody, overrides, }: CreateAgentListParams & Overrides): Promise<NylasResponse<AgentList>>;
|
|
82
|
+
/**
|
|
83
|
+
* Update a list.
|
|
84
|
+
* @return The updated Agent Account list.
|
|
85
|
+
*/
|
|
86
|
+
update({ listId, requestBody, overrides, }: UpdateAgentListParams & Overrides): Promise<NylasResponse<AgentList>>;
|
|
87
|
+
/**
|
|
88
|
+
* Delete a list.
|
|
89
|
+
* @return The deletion response.
|
|
90
|
+
*/
|
|
91
|
+
destroy({ listId, overrides, }: DestroyAgentListParams & Overrides): Promise<NylasBaseResponse>;
|
|
92
|
+
/**
|
|
93
|
+
* Return items in a list.
|
|
94
|
+
* @return The list items.
|
|
95
|
+
*/
|
|
96
|
+
listItems({ listId, queryParams, overrides, }: ListAgentListItemsParams & Overrides): AsyncListResponse<NylasListResponse<AgentListItem>>;
|
|
97
|
+
/**
|
|
98
|
+
* Add items to a list.
|
|
99
|
+
* @return The updated Agent Account list.
|
|
100
|
+
*/
|
|
101
|
+
addItems({ listId, requestBody, overrides, }: AddAgentListItemsParams & Overrides): Promise<NylasResponse<AgentList>>;
|
|
102
|
+
/**
|
|
103
|
+
* Remove items from a list.
|
|
104
|
+
* @return The updated Agent Account list.
|
|
105
|
+
*/
|
|
106
|
+
removeItems({ listId, requestBody, overrides, }: RemoveAgentListItemsParams & Overrides): Promise<NylasResponse<AgentList>>;
|
|
107
|
+
}
|
|
108
|
+
export {};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Overrides } from '../config.js';
|
|
2
|
-
import { Attachment, FindAttachmentQueryParams, DownloadAttachmentQueryParams } from '../models/attachments.js';
|
|
2
|
+
import { Attachment, AttachmentUploadSession, AttachmentUploadSessionComplete, CreateAttachmentUploadSessionRequest, FindAttachmentQueryParams, DownloadAttachmentQueryParams } from '../models/attachments.js';
|
|
3
3
|
import { NylasResponse } from '../models/response.js';
|
|
4
4
|
import { Resource } from './resource.js';
|
|
5
5
|
/**
|
|
@@ -22,6 +22,22 @@ interface DownloadAttachmentParams {
|
|
|
22
22
|
attachmentId: string;
|
|
23
23
|
queryParams: DownloadAttachmentQueryParams;
|
|
24
24
|
}
|
|
25
|
+
/**
|
|
26
|
+
* @property identifier The ID of the grant to act upon.
|
|
27
|
+
* @property requestBody Session details (filename, content type, optional size).
|
|
28
|
+
*/
|
|
29
|
+
interface CreateAttachmentUploadSessionParams {
|
|
30
|
+
identifier: string;
|
|
31
|
+
requestBody: CreateAttachmentUploadSessionRequest;
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* @property identifier The ID of the grant to act upon.
|
|
35
|
+
* @property attachmentId The attachment upload session ID.
|
|
36
|
+
*/
|
|
37
|
+
interface CompleteAttachmentUploadSessionParams {
|
|
38
|
+
identifier: string;
|
|
39
|
+
attachmentId: string;
|
|
40
|
+
}
|
|
25
41
|
/**
|
|
26
42
|
* Nylas Attachments API
|
|
27
43
|
*
|
|
@@ -55,5 +71,19 @@ export declare class Attachments extends Resource {
|
|
|
55
71
|
* @return The raw file data
|
|
56
72
|
*/
|
|
57
73
|
downloadBytes({ identifier, attachmentId, queryParams, overrides, }: DownloadAttachmentParams & Overrides): Promise<Buffer>;
|
|
74
|
+
/**
|
|
75
|
+
* Create a resumable upload session for a large attachment (up to 150 MB).
|
|
76
|
+
* Upload bytes to the returned `url`, then call {@link Attachments.completeUploadSession}.
|
|
77
|
+
*
|
|
78
|
+
* @see https://developer.nylas.com/docs/v3/email/send-large-attachments/
|
|
79
|
+
* @return Session details including `attachmentId` and pre-signed `url`
|
|
80
|
+
*/
|
|
81
|
+
createUploadSession({ identifier, requestBody, overrides, }: CreateAttachmentUploadSessionParams & Overrides): Promise<NylasResponse<AttachmentUploadSession>>;
|
|
82
|
+
/**
|
|
83
|
+
* Complete an upload session after the file has been uploaded to the pre-signed URL.
|
|
84
|
+
*
|
|
85
|
+
* @see https://developer.nylas.com/docs/v3/email/send-large-attachments/
|
|
86
|
+
*/
|
|
87
|
+
completeUploadSession({ identifier, attachmentId, overrides, }: CompleteAttachmentUploadSessionParams & Overrides): Promise<NylasResponse<AttachmentUploadSessionComplete>>;
|
|
58
88
|
}
|
|
59
89
|
export {};
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import { Overrides } from '../config.js';
|
|
2
|
+
import { CreatePolicyRequest, ListPoliciesQueryParams, Policy, UpdatePolicyRequest } from '../models/policies.js';
|
|
3
|
+
import { NylasBaseResponse, NylasListResponse, NylasResponse } from '../models/response.js';
|
|
4
|
+
import { AsyncListResponse, Resource } from './resource.js';
|
|
5
|
+
/**
|
|
6
|
+
* @property queryParams The query parameters to include in the request.
|
|
7
|
+
*/
|
|
8
|
+
interface ListPoliciesParams {
|
|
9
|
+
queryParams?: ListPoliciesQueryParams;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* @property policyId The ID of the policy to retrieve.
|
|
13
|
+
*/
|
|
14
|
+
interface FindPolicyParams {
|
|
15
|
+
policyId: string;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* @property requestBody The values to create the policy with.
|
|
19
|
+
*/
|
|
20
|
+
interface CreatePolicyParams {
|
|
21
|
+
requestBody: CreatePolicyRequest;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* @property policyId The ID of the policy to update.
|
|
25
|
+
* @property requestBody The values to update the policy with.
|
|
26
|
+
*/
|
|
27
|
+
interface UpdatePolicyParams {
|
|
28
|
+
policyId: string;
|
|
29
|
+
requestBody: UpdatePolicyRequest;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* @property policyId The ID of the policy to delete.
|
|
33
|
+
*/
|
|
34
|
+
interface DestroyPolicyParams {
|
|
35
|
+
policyId: string;
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Nylas Agent Account Policies API
|
|
39
|
+
*
|
|
40
|
+
* Policies define limits, spam settings, options, and linked rules for Agent Accounts.
|
|
41
|
+
*/
|
|
42
|
+
export declare class Policies extends Resource {
|
|
43
|
+
/**
|
|
44
|
+
* Return all policies.
|
|
45
|
+
* @return The list of policies.
|
|
46
|
+
*/
|
|
47
|
+
list({ queryParams, overrides, }?: ListPoliciesParams & Overrides): AsyncListResponse<NylasListResponse<Policy>>;
|
|
48
|
+
/**
|
|
49
|
+
* Return a policy.
|
|
50
|
+
* @return The policy.
|
|
51
|
+
*/
|
|
52
|
+
find({ policyId, overrides, }: FindPolicyParams & Overrides): Promise<NylasResponse<Policy>>;
|
|
53
|
+
/**
|
|
54
|
+
* Create a policy.
|
|
55
|
+
* @return The created policy.
|
|
56
|
+
*/
|
|
57
|
+
create({ requestBody, overrides, }: CreatePolicyParams & Overrides): Promise<NylasResponse<Policy>>;
|
|
58
|
+
/**
|
|
59
|
+
* Update a policy.
|
|
60
|
+
* @return The updated policy.
|
|
61
|
+
*/
|
|
62
|
+
update({ policyId, requestBody, overrides, }: UpdatePolicyParams & Overrides): Promise<NylasResponse<Policy>>;
|
|
63
|
+
/**
|
|
64
|
+
* Delete a policy.
|
|
65
|
+
* @return The deletion response.
|
|
66
|
+
*/
|
|
67
|
+
destroy({ policyId, overrides, }: DestroyPolicyParams & Overrides): Promise<NylasBaseResponse>;
|
|
68
|
+
}
|
|
69
|
+
export {};
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import { Overrides } from '../config.js';
|
|
2
|
+
import { CreateRuleRequest, ListRuleEvaluationsQueryParams, ListRulesQueryParams, Rule, RuleEvaluation, UpdateRuleRequest } from '../models/rules.js';
|
|
3
|
+
import { NylasBaseResponse, NylasListResponse, NylasResponse } from '../models/response.js';
|
|
4
|
+
import { AsyncListResponse, Resource } from './resource.js';
|
|
5
|
+
/**
|
|
6
|
+
* @property queryParams The query parameters to include in the request.
|
|
7
|
+
*/
|
|
8
|
+
interface ListRulesParams {
|
|
9
|
+
queryParams?: ListRulesQueryParams;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* @property ruleId The ID of the rule to retrieve.
|
|
13
|
+
*/
|
|
14
|
+
interface FindRuleParams {
|
|
15
|
+
ruleId: string;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* @property requestBody The values to create the rule with.
|
|
19
|
+
*/
|
|
20
|
+
interface CreateRuleParams {
|
|
21
|
+
requestBody: CreateRuleRequest;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* @property ruleId The ID of the rule to update.
|
|
25
|
+
* @property requestBody The values to update the rule with.
|
|
26
|
+
*/
|
|
27
|
+
interface UpdateRuleParams {
|
|
28
|
+
ruleId: string;
|
|
29
|
+
requestBody: UpdateRuleRequest;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* @property ruleId The ID of the rule to delete.
|
|
33
|
+
*/
|
|
34
|
+
interface DestroyRuleParams {
|
|
35
|
+
ruleId: string;
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* @property identifier The identifier of the grant to list rule evaluations for.
|
|
39
|
+
* @property queryParams The query parameters to include in the request.
|
|
40
|
+
*/
|
|
41
|
+
interface ListRuleEvaluationsParams {
|
|
42
|
+
identifier: string;
|
|
43
|
+
queryParams?: ListRuleEvaluationsQueryParams;
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* Nylas Agent Account Rules API
|
|
47
|
+
*
|
|
48
|
+
* Rules define inbound and outbound filtering logic for Agent Accounts.
|
|
49
|
+
*/
|
|
50
|
+
export declare class Rules extends Resource {
|
|
51
|
+
/**
|
|
52
|
+
* Return all rules.
|
|
53
|
+
* @return The list of rules.
|
|
54
|
+
*/
|
|
55
|
+
list({ queryParams, overrides, }?: ListRulesParams & Overrides): AsyncListResponse<NylasListResponse<Rule>>;
|
|
56
|
+
/**
|
|
57
|
+
* Return a rule.
|
|
58
|
+
* @return The rule.
|
|
59
|
+
*/
|
|
60
|
+
find({ ruleId, overrides, }: FindRuleParams & Overrides): Promise<NylasResponse<Rule>>;
|
|
61
|
+
/**
|
|
62
|
+
* Create a rule.
|
|
63
|
+
* @return The created rule.
|
|
64
|
+
*/
|
|
65
|
+
create({ requestBody, overrides, }: CreateRuleParams & Overrides): Promise<NylasResponse<Rule>>;
|
|
66
|
+
/**
|
|
67
|
+
* Update a rule.
|
|
68
|
+
* @return The updated rule.
|
|
69
|
+
*/
|
|
70
|
+
update({ ruleId, requestBody, overrides, }: UpdateRuleParams & Overrides): Promise<NylasResponse<Rule>>;
|
|
71
|
+
/**
|
|
72
|
+
* Delete a rule.
|
|
73
|
+
* @return The deletion response.
|
|
74
|
+
*/
|
|
75
|
+
destroy({ ruleId, overrides, }: DestroyRuleParams & Overrides): Promise<NylasBaseResponse>;
|
|
76
|
+
/**
|
|
77
|
+
* Return rule evaluation records for a grant.
|
|
78
|
+
* @return The list of rule evaluation records.
|
|
79
|
+
*/
|
|
80
|
+
listEvaluations({ identifier, queryParams, overrides, }: ListRuleEvaluationsParams & Overrides): AsyncListResponse<NylasListResponse<RuleEvaluation>>;
|
|
81
|
+
}
|
|
82
|
+
export {};
|
package/lib/types/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const SDK_VERSION = "8.0
|
|
1
|
+
export declare const SDK_VERSION = "8.1.0";
|