emailr 1.3.4 → 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 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;
@@ -339,6 +423,7 @@ interface Broadcast {
339
423
  tags?: string[];
340
424
  created_by: string | null;
341
425
  created_at: string;
426
+ inbox_id: string | null;
342
427
  }
343
428
  interface CreateBroadcastRequest {
344
429
  name: string;
@@ -353,6 +438,7 @@ interface CreateBroadcastRequest {
353
438
  text_content?: string;
354
439
  scheduled_at?: string;
355
440
  tags?: string[];
441
+ inbox_id?: string;
356
442
  }
357
443
  interface UpdateBroadcastRequest {
358
444
  name?: string;
@@ -367,6 +453,7 @@ interface UpdateBroadcastRequest {
367
453
  text_content?: string;
368
454
  scheduled_at?: string;
369
455
  tags?: string[];
456
+ inbox_id?: string;
370
457
  }
371
458
  interface SendBroadcastResponse {
372
459
  success: boolean;
@@ -509,6 +596,31 @@ interface EmailMetrics {
509
596
  complained: number;
510
597
  }
511
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
+
512
624
  declare class EmailsResource {
513
625
  private readonly http;
514
626
  constructor(http: HttpClient);
@@ -890,6 +1002,27 @@ declare class ForwardingRulesResource {
890
1002
  delete(id: string): Promise<SuccessResponse>;
891
1003
  }
892
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
+
893
1026
  /**
894
1027
  * Configuration options for the Emailr client
895
1028
  */
@@ -977,6 +1110,14 @@ declare class Emailr {
977
1110
  * Email forwarding rules
978
1111
  */
979
1112
  readonly forwardingRules: ForwardingRulesResource;
1113
+ /**
1114
+ * Inbox management
1115
+ */
1116
+ readonly inboxes: InboxesResource;
1117
+ /**
1118
+ * Thread and label management
1119
+ */
1120
+ readonly threads: ThreadsResource;
980
1121
  private readonly http;
981
1122
  constructor(config: EmailrConfig);
982
1123
  }
@@ -1024,4 +1165,4 @@ declare class ValidationError extends EmailrError {
1024
1165
  constructor(message: string, details?: Record<string, unknown>, requestId?: string);
1025
1166
  }
1026
1167
 
1027
- 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;
@@ -339,6 +423,7 @@ interface Broadcast {
339
423
  tags?: string[];
340
424
  created_by: string | null;
341
425
  created_at: string;
426
+ inbox_id: string | null;
342
427
  }
343
428
  interface CreateBroadcastRequest {
344
429
  name: string;
@@ -353,6 +438,7 @@ interface CreateBroadcastRequest {
353
438
  text_content?: string;
354
439
  scheduled_at?: string;
355
440
  tags?: string[];
441
+ inbox_id?: string;
356
442
  }
357
443
  interface UpdateBroadcastRequest {
358
444
  name?: string;
@@ -367,6 +453,7 @@ interface UpdateBroadcastRequest {
367
453
  text_content?: string;
368
454
  scheduled_at?: string;
369
455
  tags?: string[];
456
+ inbox_id?: string;
370
457
  }
371
458
  interface SendBroadcastResponse {
372
459
  success: boolean;
@@ -509,6 +596,31 @@ interface EmailMetrics {
509
596
  complained: number;
510
597
  }
511
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
+
512
624
  declare class EmailsResource {
513
625
  private readonly http;
514
626
  constructor(http: HttpClient);
@@ -890,6 +1002,27 @@ declare class ForwardingRulesResource {
890
1002
  delete(id: string): Promise<SuccessResponse>;
891
1003
  }
892
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
+
893
1026
  /**
894
1027
  * Configuration options for the Emailr client
895
1028
  */
@@ -977,6 +1110,14 @@ declare class Emailr {
977
1110
  * Email forwarding rules
978
1111
  */
979
1112
  readonly forwardingRules: ForwardingRulesResource;
1113
+ /**
1114
+ * Inbox management
1115
+ */
1116
+ readonly inboxes: InboxesResource;
1117
+ /**
1118
+ * Thread and label management
1119
+ */
1120
+ readonly threads: ThreadsResource;
980
1121
  private readonly http;
981
1122
  constructor(config: EmailrConfig);
982
1123
  }
@@ -1024,4 +1165,4 @@ declare class ValidationError extends EmailrError {
1024
1165
  constructor(message: string, details?: Record<string, unknown>, requestId?: string);
1025
1166
  }
1026
1167
 
1027
- 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 {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "emailr",
3
- "version": "1.3.4",
3
+ "version": "1.4.0",
4
4
  "description": "Official Emailr API SDK for TypeScript/JavaScript",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.mjs",