emailr 1.3.3 → 1.4.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/dist/index.d.mts +148 -1
- package/dist/index.d.ts +148 -1
- package/dist/index.js +72 -0
- package/dist/index.mjs +72 -0
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -34,6 +34,81 @@ interface PaginatedResponse<T> {
|
|
|
34
34
|
interface SuccessResponse {
|
|
35
35
|
success: boolean;
|
|
36
36
|
}
|
|
37
|
+
interface Inbox {
|
|
38
|
+
id: string;
|
|
39
|
+
organization_id: string;
|
|
40
|
+
name: string;
|
|
41
|
+
username: string;
|
|
42
|
+
domain: string;
|
|
43
|
+
from_address: string;
|
|
44
|
+
inbound_address: string;
|
|
45
|
+
created_at: string;
|
|
46
|
+
updated_at: string;
|
|
47
|
+
}
|
|
48
|
+
interface CreateInboxRequest {
|
|
49
|
+
name: string;
|
|
50
|
+
username: string;
|
|
51
|
+
domain: string;
|
|
52
|
+
}
|
|
53
|
+
interface UpdateInboxRequest {
|
|
54
|
+
name?: string;
|
|
55
|
+
}
|
|
56
|
+
interface ListInboxesParams {
|
|
57
|
+
}
|
|
58
|
+
interface Thread {
|
|
59
|
+
thread_id: string;
|
|
60
|
+
subject: string | null;
|
|
61
|
+
latest_email_id: string;
|
|
62
|
+
from_email: string;
|
|
63
|
+
to_email: string;
|
|
64
|
+
preview: string | null;
|
|
65
|
+
labels: string[];
|
|
66
|
+
message_count: number;
|
|
67
|
+
participants: string[];
|
|
68
|
+
has_attachments: boolean;
|
|
69
|
+
created_at: string;
|
|
70
|
+
updated_at: string;
|
|
71
|
+
}
|
|
72
|
+
interface ThreadMessage {
|
|
73
|
+
id: string;
|
|
74
|
+
from_email: string;
|
|
75
|
+
to_email: string;
|
|
76
|
+
cc_emails: string[] | null;
|
|
77
|
+
bcc_emails: string[] | null;
|
|
78
|
+
subject: string | null;
|
|
79
|
+
html_content: string | null;
|
|
80
|
+
text_content: string | null;
|
|
81
|
+
status: string;
|
|
82
|
+
labels: string[];
|
|
83
|
+
attachments: unknown[] | null;
|
|
84
|
+
created_at: string;
|
|
85
|
+
sent_at: string | null;
|
|
86
|
+
}
|
|
87
|
+
interface ThreadDetail {
|
|
88
|
+
thread_id: string;
|
|
89
|
+
subject: string | null;
|
|
90
|
+
labels: string[];
|
|
91
|
+
messages: ThreadMessage[];
|
|
92
|
+
}
|
|
93
|
+
interface ListThreadsParams {
|
|
94
|
+
label?: string;
|
|
95
|
+
page?: number;
|
|
96
|
+
limit?: number;
|
|
97
|
+
search?: string;
|
|
98
|
+
inbox_id?: string;
|
|
99
|
+
}
|
|
100
|
+
interface UpdateLabelsRequest {
|
|
101
|
+
add?: string[];
|
|
102
|
+
remove?: string[];
|
|
103
|
+
}
|
|
104
|
+
interface UpdateLabelsResponse {
|
|
105
|
+
success: boolean;
|
|
106
|
+
labels: string[];
|
|
107
|
+
}
|
|
108
|
+
interface UpdateThreadLabelsResponse {
|
|
109
|
+
success: boolean;
|
|
110
|
+
updated: number;
|
|
111
|
+
}
|
|
37
112
|
interface Attachment {
|
|
38
113
|
filename: string;
|
|
39
114
|
content: string;
|
|
@@ -99,6 +174,12 @@ interface Email {
|
|
|
99
174
|
interface ListEmailsParams {
|
|
100
175
|
page?: number;
|
|
101
176
|
limit?: number;
|
|
177
|
+
status?: string;
|
|
178
|
+
email?: string;
|
|
179
|
+
domain?: string;
|
|
180
|
+
broadcast_id?: string;
|
|
181
|
+
email_id?: string;
|
|
182
|
+
template_id?: string;
|
|
102
183
|
}
|
|
103
184
|
interface ForwardEmailRequest {
|
|
104
185
|
email_id: string;
|
|
@@ -183,6 +264,7 @@ interface Template {
|
|
|
183
264
|
reply_to: string | null;
|
|
184
265
|
preview_text: string | null;
|
|
185
266
|
created_by: string | null;
|
|
267
|
+
inbox_id: string | null;
|
|
186
268
|
created_at: string;
|
|
187
269
|
updated_at: string;
|
|
188
270
|
}
|
|
@@ -197,6 +279,7 @@ interface CreateTemplateRequest {
|
|
|
197
279
|
from_name?: string;
|
|
198
280
|
reply_to?: string;
|
|
199
281
|
preview_text?: string;
|
|
282
|
+
inbox_id?: string;
|
|
200
283
|
}
|
|
201
284
|
interface UpdateTemplateRequest {
|
|
202
285
|
name?: string;
|
|
@@ -209,6 +292,7 @@ interface UpdateTemplateRequest {
|
|
|
209
292
|
from_name?: string;
|
|
210
293
|
reply_to?: string;
|
|
211
294
|
preview_text?: string;
|
|
295
|
+
inbox_id?: string;
|
|
212
296
|
}
|
|
213
297
|
interface ListTemplatesParams {
|
|
214
298
|
page?: number;
|
|
@@ -322,6 +406,8 @@ interface Broadcast {
|
|
|
322
406
|
subject: string;
|
|
323
407
|
from_email: string;
|
|
324
408
|
from_name: string | null;
|
|
409
|
+
reply_to: string | null;
|
|
410
|
+
preview_text: string | null;
|
|
325
411
|
template_id: string | null;
|
|
326
412
|
segment_id: string | null;
|
|
327
413
|
status: string;
|
|
@@ -337,30 +423,37 @@ interface Broadcast {
|
|
|
337
423
|
tags?: string[];
|
|
338
424
|
created_by: string | null;
|
|
339
425
|
created_at: string;
|
|
426
|
+
inbox_id: string | null;
|
|
340
427
|
}
|
|
341
428
|
interface CreateBroadcastRequest {
|
|
342
429
|
name: string;
|
|
343
430
|
subject: string;
|
|
344
431
|
from_email: string;
|
|
345
432
|
from_name?: string;
|
|
433
|
+
reply_to?: string;
|
|
434
|
+
preview_text?: string;
|
|
346
435
|
template_id?: string;
|
|
347
436
|
segment_id?: string;
|
|
348
437
|
html_content?: string;
|
|
349
438
|
text_content?: string;
|
|
350
439
|
scheduled_at?: string;
|
|
351
440
|
tags?: string[];
|
|
441
|
+
inbox_id?: string;
|
|
352
442
|
}
|
|
353
443
|
interface UpdateBroadcastRequest {
|
|
354
444
|
name?: string;
|
|
355
445
|
subject?: string;
|
|
356
446
|
from_email?: string;
|
|
357
447
|
from_name?: string;
|
|
448
|
+
reply_to?: string;
|
|
449
|
+
preview_text?: string;
|
|
358
450
|
template_id?: string;
|
|
359
451
|
segment_id?: string;
|
|
360
452
|
html_content?: string;
|
|
361
453
|
text_content?: string;
|
|
362
454
|
scheduled_at?: string;
|
|
363
455
|
tags?: string[];
|
|
456
|
+
inbox_id?: string;
|
|
364
457
|
}
|
|
365
458
|
interface SendBroadcastResponse {
|
|
366
459
|
success: boolean;
|
|
@@ -503,6 +596,31 @@ interface EmailMetrics {
|
|
|
503
596
|
complained: number;
|
|
504
597
|
}
|
|
505
598
|
|
|
599
|
+
declare class InboxesResource {
|
|
600
|
+
private readonly http;
|
|
601
|
+
constructor(http: HttpClient);
|
|
602
|
+
/**
|
|
603
|
+
* Create a new inbox
|
|
604
|
+
*/
|
|
605
|
+
create(data: CreateInboxRequest): Promise<Inbox>;
|
|
606
|
+
/**
|
|
607
|
+
* List all inboxes for the organization
|
|
608
|
+
*/
|
|
609
|
+
list(): Promise<Inbox[]>;
|
|
610
|
+
/**
|
|
611
|
+
* Get inbox by ID
|
|
612
|
+
*/
|
|
613
|
+
get(id: string): Promise<Inbox>;
|
|
614
|
+
/**
|
|
615
|
+
* Update an inbox
|
|
616
|
+
*/
|
|
617
|
+
update(id: string, data: UpdateInboxRequest): Promise<Inbox>;
|
|
618
|
+
/**
|
|
619
|
+
* Delete an inbox
|
|
620
|
+
*/
|
|
621
|
+
delete(id: string): Promise<SuccessResponse>;
|
|
622
|
+
}
|
|
623
|
+
|
|
506
624
|
declare class EmailsResource {
|
|
507
625
|
private readonly http;
|
|
508
626
|
constructor(http: HttpClient);
|
|
@@ -884,6 +1002,27 @@ declare class ForwardingRulesResource {
|
|
|
884
1002
|
delete(id: string): Promise<SuccessResponse>;
|
|
885
1003
|
}
|
|
886
1004
|
|
|
1005
|
+
declare class ThreadsResource {
|
|
1006
|
+
private readonly http;
|
|
1007
|
+
constructor(http: HttpClient);
|
|
1008
|
+
/**
|
|
1009
|
+
* List email threads with optional filtering by label, search, and inbox
|
|
1010
|
+
*/
|
|
1011
|
+
list(params?: ListThreadsParams): Promise<PaginatedResponse<Thread>>;
|
|
1012
|
+
/**
|
|
1013
|
+
* Get thread detail with all messages
|
|
1014
|
+
*/
|
|
1015
|
+
get(threadId: string): Promise<ThreadDetail>;
|
|
1016
|
+
/**
|
|
1017
|
+
* Add or remove labels from all emails in a thread
|
|
1018
|
+
*/
|
|
1019
|
+
updateLabels(threadId: string, data: UpdateLabelsRequest): Promise<UpdateThreadLabelsResponse>;
|
|
1020
|
+
/**
|
|
1021
|
+
* Add or remove labels from a single email
|
|
1022
|
+
*/
|
|
1023
|
+
updateEmailLabels(emailId: string, data: UpdateLabelsRequest): Promise<UpdateLabelsResponse>;
|
|
1024
|
+
}
|
|
1025
|
+
|
|
887
1026
|
/**
|
|
888
1027
|
* Configuration options for the Emailr client
|
|
889
1028
|
*/
|
|
@@ -971,6 +1110,14 @@ declare class Emailr {
|
|
|
971
1110
|
* Email forwarding rules
|
|
972
1111
|
*/
|
|
973
1112
|
readonly forwardingRules: ForwardingRulesResource;
|
|
1113
|
+
/**
|
|
1114
|
+
* Inbox management
|
|
1115
|
+
*/
|
|
1116
|
+
readonly inboxes: InboxesResource;
|
|
1117
|
+
/**
|
|
1118
|
+
* Thread and label management
|
|
1119
|
+
*/
|
|
1120
|
+
readonly threads: ThreadsResource;
|
|
974
1121
|
private readonly http;
|
|
975
1122
|
constructor(config: EmailrConfig);
|
|
976
1123
|
}
|
|
@@ -1018,4 +1165,4 @@ declare class ValidationError extends EmailrError {
|
|
|
1018
1165
|
constructor(message: string, details?: Record<string, unknown>, requestId?: string);
|
|
1019
1166
|
}
|
|
1020
1167
|
|
|
1021
|
-
export { type AddDomainRequest, type ApiKey, type Attachment, AuthenticationError, type Broadcast, type BulkCreateContactsRequest, type BulkCreateContactsResponse, type Contact, type ContactListResponse, type CreateApiKeyRequest, type CreateBroadcastRequest, type CreateContactRequest, type CreateForwardingRuleRequest, type CreateSegmentRequest, type CreateTemplateRequest, type CreateWebhookRequest, type DnsRecord, type DnsVerificationStatus, type Domain, type DomainDnsRecords, type DomainVerificationStatus, type Email, Emailr, Emailr as EmailrClient, type EmailrConfig, EmailrError, type FetchTemplateOptions, type ForwardEmailRequest, type ForwardingRule, type ListApiKeysParams, type ListBroadcastsParams, type ListContactsParams, type ListEmailsParams, type ListSegmentsParams, type ListTemplatesParams, type ListWebhooksParams, NetworkError, NotFoundError, type PaginatedResponse, type PushPreviewResponse, RateLimitError, type ReplyTo, type Segment, type SendBroadcastResponse, type SendEmailRequest, type SendEmailResponse, type SuccessResponse, type Template, type UpdateBroadcastRequest, type UpdateContactRequest, type UpdateDomainRequest, type UpdateSegmentRequest, type UpdateTemplateRequest, type UpdateWebhookRequest, ValidationError, type Webhook, type WebhookDelivery, type WebhookToggleResponse };
|
|
1168
|
+
export { type AddDomainRequest, type ApiKey, type Attachment, AuthenticationError, type Broadcast, type BulkCreateContactsRequest, type BulkCreateContactsResponse, type Contact, type ContactListResponse, type CreateApiKeyRequest, type CreateBroadcastRequest, type CreateContactRequest, type CreateForwardingRuleRequest, type CreateInboxRequest, type CreateSegmentRequest, type CreateTemplateRequest, type CreateWebhookRequest, type DnsRecord, type DnsVerificationStatus, type Domain, type DomainDnsRecords, type DomainVerificationStatus, type Email, Emailr, Emailr as EmailrClient, type EmailrConfig, EmailrError, type FetchTemplateOptions, type ForwardEmailRequest, type ForwardingRule, type Inbox, type ListApiKeysParams, type ListBroadcastsParams, type ListContactsParams, type ListEmailsParams, type ListInboxesParams, type ListSegmentsParams, type ListTemplatesParams, type ListThreadsParams, type ListWebhooksParams, NetworkError, NotFoundError, type PaginatedResponse, type PushPreviewResponse, RateLimitError, type ReplyTo, type Segment, type SendBroadcastResponse, type SendEmailRequest, type SendEmailResponse, type SuccessResponse, type Template, type Thread, type ThreadDetail, type ThreadMessage, type UpdateBroadcastRequest, type UpdateContactRequest, type UpdateDomainRequest, type UpdateInboxRequest, type UpdateLabelsRequest, type UpdateLabelsResponse, type UpdateSegmentRequest, type UpdateTemplateRequest, type UpdateThreadLabelsResponse, type UpdateWebhookRequest, ValidationError, type Webhook, type WebhookDelivery, type WebhookToggleResponse };
|
package/dist/index.d.ts
CHANGED
|
@@ -34,6 +34,81 @@ interface PaginatedResponse<T> {
|
|
|
34
34
|
interface SuccessResponse {
|
|
35
35
|
success: boolean;
|
|
36
36
|
}
|
|
37
|
+
interface Inbox {
|
|
38
|
+
id: string;
|
|
39
|
+
organization_id: string;
|
|
40
|
+
name: string;
|
|
41
|
+
username: string;
|
|
42
|
+
domain: string;
|
|
43
|
+
from_address: string;
|
|
44
|
+
inbound_address: string;
|
|
45
|
+
created_at: string;
|
|
46
|
+
updated_at: string;
|
|
47
|
+
}
|
|
48
|
+
interface CreateInboxRequest {
|
|
49
|
+
name: string;
|
|
50
|
+
username: string;
|
|
51
|
+
domain: string;
|
|
52
|
+
}
|
|
53
|
+
interface UpdateInboxRequest {
|
|
54
|
+
name?: string;
|
|
55
|
+
}
|
|
56
|
+
interface ListInboxesParams {
|
|
57
|
+
}
|
|
58
|
+
interface Thread {
|
|
59
|
+
thread_id: string;
|
|
60
|
+
subject: string | null;
|
|
61
|
+
latest_email_id: string;
|
|
62
|
+
from_email: string;
|
|
63
|
+
to_email: string;
|
|
64
|
+
preview: string | null;
|
|
65
|
+
labels: string[];
|
|
66
|
+
message_count: number;
|
|
67
|
+
participants: string[];
|
|
68
|
+
has_attachments: boolean;
|
|
69
|
+
created_at: string;
|
|
70
|
+
updated_at: string;
|
|
71
|
+
}
|
|
72
|
+
interface ThreadMessage {
|
|
73
|
+
id: string;
|
|
74
|
+
from_email: string;
|
|
75
|
+
to_email: string;
|
|
76
|
+
cc_emails: string[] | null;
|
|
77
|
+
bcc_emails: string[] | null;
|
|
78
|
+
subject: string | null;
|
|
79
|
+
html_content: string | null;
|
|
80
|
+
text_content: string | null;
|
|
81
|
+
status: string;
|
|
82
|
+
labels: string[];
|
|
83
|
+
attachments: unknown[] | null;
|
|
84
|
+
created_at: string;
|
|
85
|
+
sent_at: string | null;
|
|
86
|
+
}
|
|
87
|
+
interface ThreadDetail {
|
|
88
|
+
thread_id: string;
|
|
89
|
+
subject: string | null;
|
|
90
|
+
labels: string[];
|
|
91
|
+
messages: ThreadMessage[];
|
|
92
|
+
}
|
|
93
|
+
interface ListThreadsParams {
|
|
94
|
+
label?: string;
|
|
95
|
+
page?: number;
|
|
96
|
+
limit?: number;
|
|
97
|
+
search?: string;
|
|
98
|
+
inbox_id?: string;
|
|
99
|
+
}
|
|
100
|
+
interface UpdateLabelsRequest {
|
|
101
|
+
add?: string[];
|
|
102
|
+
remove?: string[];
|
|
103
|
+
}
|
|
104
|
+
interface UpdateLabelsResponse {
|
|
105
|
+
success: boolean;
|
|
106
|
+
labels: string[];
|
|
107
|
+
}
|
|
108
|
+
interface UpdateThreadLabelsResponse {
|
|
109
|
+
success: boolean;
|
|
110
|
+
updated: number;
|
|
111
|
+
}
|
|
37
112
|
interface Attachment {
|
|
38
113
|
filename: string;
|
|
39
114
|
content: string;
|
|
@@ -99,6 +174,12 @@ interface Email {
|
|
|
99
174
|
interface ListEmailsParams {
|
|
100
175
|
page?: number;
|
|
101
176
|
limit?: number;
|
|
177
|
+
status?: string;
|
|
178
|
+
email?: string;
|
|
179
|
+
domain?: string;
|
|
180
|
+
broadcast_id?: string;
|
|
181
|
+
email_id?: string;
|
|
182
|
+
template_id?: string;
|
|
102
183
|
}
|
|
103
184
|
interface ForwardEmailRequest {
|
|
104
185
|
email_id: string;
|
|
@@ -183,6 +264,7 @@ interface Template {
|
|
|
183
264
|
reply_to: string | null;
|
|
184
265
|
preview_text: string | null;
|
|
185
266
|
created_by: string | null;
|
|
267
|
+
inbox_id: string | null;
|
|
186
268
|
created_at: string;
|
|
187
269
|
updated_at: string;
|
|
188
270
|
}
|
|
@@ -197,6 +279,7 @@ interface CreateTemplateRequest {
|
|
|
197
279
|
from_name?: string;
|
|
198
280
|
reply_to?: string;
|
|
199
281
|
preview_text?: string;
|
|
282
|
+
inbox_id?: string;
|
|
200
283
|
}
|
|
201
284
|
interface UpdateTemplateRequest {
|
|
202
285
|
name?: string;
|
|
@@ -209,6 +292,7 @@ interface UpdateTemplateRequest {
|
|
|
209
292
|
from_name?: string;
|
|
210
293
|
reply_to?: string;
|
|
211
294
|
preview_text?: string;
|
|
295
|
+
inbox_id?: string;
|
|
212
296
|
}
|
|
213
297
|
interface ListTemplatesParams {
|
|
214
298
|
page?: number;
|
|
@@ -322,6 +406,8 @@ interface Broadcast {
|
|
|
322
406
|
subject: string;
|
|
323
407
|
from_email: string;
|
|
324
408
|
from_name: string | null;
|
|
409
|
+
reply_to: string | null;
|
|
410
|
+
preview_text: string | null;
|
|
325
411
|
template_id: string | null;
|
|
326
412
|
segment_id: string | null;
|
|
327
413
|
status: string;
|
|
@@ -337,30 +423,37 @@ interface Broadcast {
|
|
|
337
423
|
tags?: string[];
|
|
338
424
|
created_by: string | null;
|
|
339
425
|
created_at: string;
|
|
426
|
+
inbox_id: string | null;
|
|
340
427
|
}
|
|
341
428
|
interface CreateBroadcastRequest {
|
|
342
429
|
name: string;
|
|
343
430
|
subject: string;
|
|
344
431
|
from_email: string;
|
|
345
432
|
from_name?: string;
|
|
433
|
+
reply_to?: string;
|
|
434
|
+
preview_text?: string;
|
|
346
435
|
template_id?: string;
|
|
347
436
|
segment_id?: string;
|
|
348
437
|
html_content?: string;
|
|
349
438
|
text_content?: string;
|
|
350
439
|
scheduled_at?: string;
|
|
351
440
|
tags?: string[];
|
|
441
|
+
inbox_id?: string;
|
|
352
442
|
}
|
|
353
443
|
interface UpdateBroadcastRequest {
|
|
354
444
|
name?: string;
|
|
355
445
|
subject?: string;
|
|
356
446
|
from_email?: string;
|
|
357
447
|
from_name?: string;
|
|
448
|
+
reply_to?: string;
|
|
449
|
+
preview_text?: string;
|
|
358
450
|
template_id?: string;
|
|
359
451
|
segment_id?: string;
|
|
360
452
|
html_content?: string;
|
|
361
453
|
text_content?: string;
|
|
362
454
|
scheduled_at?: string;
|
|
363
455
|
tags?: string[];
|
|
456
|
+
inbox_id?: string;
|
|
364
457
|
}
|
|
365
458
|
interface SendBroadcastResponse {
|
|
366
459
|
success: boolean;
|
|
@@ -503,6 +596,31 @@ interface EmailMetrics {
|
|
|
503
596
|
complained: number;
|
|
504
597
|
}
|
|
505
598
|
|
|
599
|
+
declare class InboxesResource {
|
|
600
|
+
private readonly http;
|
|
601
|
+
constructor(http: HttpClient);
|
|
602
|
+
/**
|
|
603
|
+
* Create a new inbox
|
|
604
|
+
*/
|
|
605
|
+
create(data: CreateInboxRequest): Promise<Inbox>;
|
|
606
|
+
/**
|
|
607
|
+
* List all inboxes for the organization
|
|
608
|
+
*/
|
|
609
|
+
list(): Promise<Inbox[]>;
|
|
610
|
+
/**
|
|
611
|
+
* Get inbox by ID
|
|
612
|
+
*/
|
|
613
|
+
get(id: string): Promise<Inbox>;
|
|
614
|
+
/**
|
|
615
|
+
* Update an inbox
|
|
616
|
+
*/
|
|
617
|
+
update(id: string, data: UpdateInboxRequest): Promise<Inbox>;
|
|
618
|
+
/**
|
|
619
|
+
* Delete an inbox
|
|
620
|
+
*/
|
|
621
|
+
delete(id: string): Promise<SuccessResponse>;
|
|
622
|
+
}
|
|
623
|
+
|
|
506
624
|
declare class EmailsResource {
|
|
507
625
|
private readonly http;
|
|
508
626
|
constructor(http: HttpClient);
|
|
@@ -884,6 +1002,27 @@ declare class ForwardingRulesResource {
|
|
|
884
1002
|
delete(id: string): Promise<SuccessResponse>;
|
|
885
1003
|
}
|
|
886
1004
|
|
|
1005
|
+
declare class ThreadsResource {
|
|
1006
|
+
private readonly http;
|
|
1007
|
+
constructor(http: HttpClient);
|
|
1008
|
+
/**
|
|
1009
|
+
* List email threads with optional filtering by label, search, and inbox
|
|
1010
|
+
*/
|
|
1011
|
+
list(params?: ListThreadsParams): Promise<PaginatedResponse<Thread>>;
|
|
1012
|
+
/**
|
|
1013
|
+
* Get thread detail with all messages
|
|
1014
|
+
*/
|
|
1015
|
+
get(threadId: string): Promise<ThreadDetail>;
|
|
1016
|
+
/**
|
|
1017
|
+
* Add or remove labels from all emails in a thread
|
|
1018
|
+
*/
|
|
1019
|
+
updateLabels(threadId: string, data: UpdateLabelsRequest): Promise<UpdateThreadLabelsResponse>;
|
|
1020
|
+
/**
|
|
1021
|
+
* Add or remove labels from a single email
|
|
1022
|
+
*/
|
|
1023
|
+
updateEmailLabels(emailId: string, data: UpdateLabelsRequest): Promise<UpdateLabelsResponse>;
|
|
1024
|
+
}
|
|
1025
|
+
|
|
887
1026
|
/**
|
|
888
1027
|
* Configuration options for the Emailr client
|
|
889
1028
|
*/
|
|
@@ -971,6 +1110,14 @@ declare class Emailr {
|
|
|
971
1110
|
* Email forwarding rules
|
|
972
1111
|
*/
|
|
973
1112
|
readonly forwardingRules: ForwardingRulesResource;
|
|
1113
|
+
/**
|
|
1114
|
+
* Inbox management
|
|
1115
|
+
*/
|
|
1116
|
+
readonly inboxes: InboxesResource;
|
|
1117
|
+
/**
|
|
1118
|
+
* Thread and label management
|
|
1119
|
+
*/
|
|
1120
|
+
readonly threads: ThreadsResource;
|
|
974
1121
|
private readonly http;
|
|
975
1122
|
constructor(config: EmailrConfig);
|
|
976
1123
|
}
|
|
@@ -1018,4 +1165,4 @@ declare class ValidationError extends EmailrError {
|
|
|
1018
1165
|
constructor(message: string, details?: Record<string, unknown>, requestId?: string);
|
|
1019
1166
|
}
|
|
1020
1167
|
|
|
1021
|
-
export { type AddDomainRequest, type ApiKey, type Attachment, AuthenticationError, type Broadcast, type BulkCreateContactsRequest, type BulkCreateContactsResponse, type Contact, type ContactListResponse, type CreateApiKeyRequest, type CreateBroadcastRequest, type CreateContactRequest, type CreateForwardingRuleRequest, type CreateSegmentRequest, type CreateTemplateRequest, type CreateWebhookRequest, type DnsRecord, type DnsVerificationStatus, type Domain, type DomainDnsRecords, type DomainVerificationStatus, type Email, Emailr, Emailr as EmailrClient, type EmailrConfig, EmailrError, type FetchTemplateOptions, type ForwardEmailRequest, type ForwardingRule, type ListApiKeysParams, type ListBroadcastsParams, type ListContactsParams, type ListEmailsParams, type ListSegmentsParams, type ListTemplatesParams, type ListWebhooksParams, NetworkError, NotFoundError, type PaginatedResponse, type PushPreviewResponse, RateLimitError, type ReplyTo, type Segment, type SendBroadcastResponse, type SendEmailRequest, type SendEmailResponse, type SuccessResponse, type Template, type UpdateBroadcastRequest, type UpdateContactRequest, type UpdateDomainRequest, type UpdateSegmentRequest, type UpdateTemplateRequest, type UpdateWebhookRequest, ValidationError, type Webhook, type WebhookDelivery, type WebhookToggleResponse };
|
|
1168
|
+
export { type AddDomainRequest, type ApiKey, type Attachment, AuthenticationError, type Broadcast, type BulkCreateContactsRequest, type BulkCreateContactsResponse, type Contact, type ContactListResponse, type CreateApiKeyRequest, type CreateBroadcastRequest, type CreateContactRequest, type CreateForwardingRuleRequest, type CreateInboxRequest, type CreateSegmentRequest, type CreateTemplateRequest, type CreateWebhookRequest, type DnsRecord, type DnsVerificationStatus, type Domain, type DomainDnsRecords, type DomainVerificationStatus, type Email, Emailr, Emailr as EmailrClient, type EmailrConfig, EmailrError, type FetchTemplateOptions, type ForwardEmailRequest, type ForwardingRule, type Inbox, type ListApiKeysParams, type ListBroadcastsParams, type ListContactsParams, type ListEmailsParams, type ListInboxesParams, type ListSegmentsParams, type ListTemplatesParams, type ListThreadsParams, type ListWebhooksParams, NetworkError, NotFoundError, type PaginatedResponse, type PushPreviewResponse, RateLimitError, type ReplyTo, type Segment, type SendBroadcastResponse, type SendEmailRequest, type SendEmailResponse, type SuccessResponse, type Template, type Thread, type ThreadDetail, type ThreadMessage, type UpdateBroadcastRequest, type UpdateContactRequest, type UpdateDomainRequest, type UpdateInboxRequest, type UpdateLabelsRequest, type UpdateLabelsResponse, type UpdateSegmentRequest, type UpdateTemplateRequest, type UpdateThreadLabelsResponse, type UpdateWebhookRequest, ValidationError, type Webhook, type WebhookDelivery, type WebhookToggleResponse };
|
package/dist/index.js
CHANGED
|
@@ -179,6 +179,43 @@ var HttpClient = class {
|
|
|
179
179
|
}
|
|
180
180
|
};
|
|
181
181
|
|
|
182
|
+
// src/resources/inboxes.ts
|
|
183
|
+
var InboxesResource = class {
|
|
184
|
+
constructor(http) {
|
|
185
|
+
this.http = http;
|
|
186
|
+
}
|
|
187
|
+
/**
|
|
188
|
+
* Create a new inbox
|
|
189
|
+
*/
|
|
190
|
+
async create(data) {
|
|
191
|
+
return this.http.post("/v1/inboxes", data);
|
|
192
|
+
}
|
|
193
|
+
/**
|
|
194
|
+
* List all inboxes for the organization
|
|
195
|
+
*/
|
|
196
|
+
async list() {
|
|
197
|
+
return this.http.get("/v1/inboxes");
|
|
198
|
+
}
|
|
199
|
+
/**
|
|
200
|
+
* Get inbox by ID
|
|
201
|
+
*/
|
|
202
|
+
async get(id) {
|
|
203
|
+
return this.http.get(`/v1/inboxes/${id}`);
|
|
204
|
+
}
|
|
205
|
+
/**
|
|
206
|
+
* Update an inbox
|
|
207
|
+
*/
|
|
208
|
+
async update(id, data) {
|
|
209
|
+
return this.http.put(`/v1/inboxes/${id}`, data);
|
|
210
|
+
}
|
|
211
|
+
/**
|
|
212
|
+
* Delete an inbox
|
|
213
|
+
*/
|
|
214
|
+
async delete(id) {
|
|
215
|
+
return this.http.delete(`/v1/inboxes/${id}`);
|
|
216
|
+
}
|
|
217
|
+
};
|
|
218
|
+
|
|
182
219
|
// src/resources/emails.ts
|
|
183
220
|
var EmailsResource = class {
|
|
184
221
|
constructor(http) {
|
|
@@ -705,6 +742,39 @@ var ForwardingRulesResource = class {
|
|
|
705
742
|
}
|
|
706
743
|
};
|
|
707
744
|
|
|
745
|
+
// src/resources/threads.ts
|
|
746
|
+
var ThreadsResource = class {
|
|
747
|
+
constructor(http) {
|
|
748
|
+
this.http = http;
|
|
749
|
+
}
|
|
750
|
+
/**
|
|
751
|
+
* List email threads with optional filtering by label, search, and inbox
|
|
752
|
+
*/
|
|
753
|
+
async list(params) {
|
|
754
|
+
return this.http.get("/v1/threads", {
|
|
755
|
+
params
|
|
756
|
+
});
|
|
757
|
+
}
|
|
758
|
+
/**
|
|
759
|
+
* Get thread detail with all messages
|
|
760
|
+
*/
|
|
761
|
+
async get(threadId) {
|
|
762
|
+
return this.http.get(`/v1/threads/${threadId}`);
|
|
763
|
+
}
|
|
764
|
+
/**
|
|
765
|
+
* Add or remove labels from all emails in a thread
|
|
766
|
+
*/
|
|
767
|
+
async updateLabels(threadId, data) {
|
|
768
|
+
return this.http.patch(`/v1/threads/${threadId}/labels`, data);
|
|
769
|
+
}
|
|
770
|
+
/**
|
|
771
|
+
* Add or remove labels from a single email
|
|
772
|
+
*/
|
|
773
|
+
async updateEmailLabels(emailId, data) {
|
|
774
|
+
return this.http.patch(`/v1/threads/emails/${emailId}/labels`, data);
|
|
775
|
+
}
|
|
776
|
+
};
|
|
777
|
+
|
|
708
778
|
// src/client.ts
|
|
709
779
|
var Emailr = class {
|
|
710
780
|
constructor(config) {
|
|
@@ -728,6 +798,8 @@ var Emailr = class {
|
|
|
728
798
|
this.settings = new SettingsResource(this.http);
|
|
729
799
|
this.metrics = new MetricsResource(this.http);
|
|
730
800
|
this.forwardingRules = new ForwardingRulesResource(this.http);
|
|
801
|
+
this.inboxes = new InboxesResource(this.http);
|
|
802
|
+
this.threads = new ThreadsResource(this.http);
|
|
731
803
|
}
|
|
732
804
|
};
|
|
733
805
|
// Annotate the CommonJS export names for ESM import in node:
|
package/dist/index.mjs
CHANGED
|
@@ -146,6 +146,43 @@ var HttpClient = class {
|
|
|
146
146
|
}
|
|
147
147
|
};
|
|
148
148
|
|
|
149
|
+
// src/resources/inboxes.ts
|
|
150
|
+
var InboxesResource = class {
|
|
151
|
+
constructor(http) {
|
|
152
|
+
this.http = http;
|
|
153
|
+
}
|
|
154
|
+
/**
|
|
155
|
+
* Create a new inbox
|
|
156
|
+
*/
|
|
157
|
+
async create(data) {
|
|
158
|
+
return this.http.post("/v1/inboxes", data);
|
|
159
|
+
}
|
|
160
|
+
/**
|
|
161
|
+
* List all inboxes for the organization
|
|
162
|
+
*/
|
|
163
|
+
async list() {
|
|
164
|
+
return this.http.get("/v1/inboxes");
|
|
165
|
+
}
|
|
166
|
+
/**
|
|
167
|
+
* Get inbox by ID
|
|
168
|
+
*/
|
|
169
|
+
async get(id) {
|
|
170
|
+
return this.http.get(`/v1/inboxes/${id}`);
|
|
171
|
+
}
|
|
172
|
+
/**
|
|
173
|
+
* Update an inbox
|
|
174
|
+
*/
|
|
175
|
+
async update(id, data) {
|
|
176
|
+
return this.http.put(`/v1/inboxes/${id}`, data);
|
|
177
|
+
}
|
|
178
|
+
/**
|
|
179
|
+
* Delete an inbox
|
|
180
|
+
*/
|
|
181
|
+
async delete(id) {
|
|
182
|
+
return this.http.delete(`/v1/inboxes/${id}`);
|
|
183
|
+
}
|
|
184
|
+
};
|
|
185
|
+
|
|
149
186
|
// src/resources/emails.ts
|
|
150
187
|
var EmailsResource = class {
|
|
151
188
|
constructor(http) {
|
|
@@ -672,6 +709,39 @@ var ForwardingRulesResource = class {
|
|
|
672
709
|
}
|
|
673
710
|
};
|
|
674
711
|
|
|
712
|
+
// src/resources/threads.ts
|
|
713
|
+
var ThreadsResource = class {
|
|
714
|
+
constructor(http) {
|
|
715
|
+
this.http = http;
|
|
716
|
+
}
|
|
717
|
+
/**
|
|
718
|
+
* List email threads with optional filtering by label, search, and inbox
|
|
719
|
+
*/
|
|
720
|
+
async list(params) {
|
|
721
|
+
return this.http.get("/v1/threads", {
|
|
722
|
+
params
|
|
723
|
+
});
|
|
724
|
+
}
|
|
725
|
+
/**
|
|
726
|
+
* Get thread detail with all messages
|
|
727
|
+
*/
|
|
728
|
+
async get(threadId) {
|
|
729
|
+
return this.http.get(`/v1/threads/${threadId}`);
|
|
730
|
+
}
|
|
731
|
+
/**
|
|
732
|
+
* Add or remove labels from all emails in a thread
|
|
733
|
+
*/
|
|
734
|
+
async updateLabels(threadId, data) {
|
|
735
|
+
return this.http.patch(`/v1/threads/${threadId}/labels`, data);
|
|
736
|
+
}
|
|
737
|
+
/**
|
|
738
|
+
* Add or remove labels from a single email
|
|
739
|
+
*/
|
|
740
|
+
async updateEmailLabels(emailId, data) {
|
|
741
|
+
return this.http.patch(`/v1/threads/emails/${emailId}/labels`, data);
|
|
742
|
+
}
|
|
743
|
+
};
|
|
744
|
+
|
|
675
745
|
// src/client.ts
|
|
676
746
|
var Emailr = class {
|
|
677
747
|
constructor(config) {
|
|
@@ -695,6 +765,8 @@ var Emailr = class {
|
|
|
695
765
|
this.settings = new SettingsResource(this.http);
|
|
696
766
|
this.metrics = new MetricsResource(this.http);
|
|
697
767
|
this.forwardingRules = new ForwardingRulesResource(this.http);
|
|
768
|
+
this.inboxes = new InboxesResource(this.http);
|
|
769
|
+
this.threads = new ThreadsResource(this.http);
|
|
698
770
|
}
|
|
699
771
|
};
|
|
700
772
|
export {
|