emailr 1.4.0 → 1.6.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
@@ -40,6 +40,7 @@ interface Inbox {
40
40
  name: string;
41
41
  username: string;
42
42
  domain: string;
43
+ reply_to: string;
43
44
  from_address: string;
44
45
  inbound_address: string;
45
46
  created_at: string;
@@ -49,9 +50,11 @@ interface CreateInboxRequest {
49
50
  name: string;
50
51
  username: string;
51
52
  domain: string;
53
+ reply_to?: string;
52
54
  }
53
55
  interface UpdateInboxRequest {
54
56
  name?: string;
57
+ reply_to?: string | null;
55
58
  }
56
59
  interface ListInboxesParams {
57
60
  }
@@ -109,6 +112,46 @@ interface UpdateThreadLabelsResponse {
109
112
  success: boolean;
110
113
  updated: number;
111
114
  }
115
+ interface ThreadReplyRequest {
116
+ html?: string;
117
+ text?: string;
118
+ to?: string | string[];
119
+ cc?: string | string[];
120
+ bcc?: string | string[];
121
+ from?: string;
122
+ from_name?: string;
123
+ reply_to_email?: string;
124
+ attachments?: Attachment[];
125
+ }
126
+ interface ThreadReplyResponse {
127
+ success: boolean;
128
+ message_id: string;
129
+ recipients: number;
130
+ status: string;
131
+ }
132
+ interface ThreadDraftRequest {
133
+ html?: string;
134
+ text?: string;
135
+ to?: string;
136
+ cc?: string;
137
+ bcc?: string;
138
+ from?: string;
139
+ from_name?: string;
140
+ reply_to_email?: string;
141
+ }
142
+ interface ThreadDraft {
143
+ id: string;
144
+ thread_id: string;
145
+ html_content: string | null;
146
+ text_content: string | null;
147
+ to_email: string | null;
148
+ cc_emails: string[] | null;
149
+ bcc_emails: string[] | null;
150
+ from_email: string | null;
151
+ subject: string | null;
152
+ created_at: string;
153
+ updated_at: string;
154
+ }
112
155
  interface Attachment {
113
156
  filename: string;
114
157
  content: string;
@@ -424,6 +467,8 @@ interface Broadcast {
424
467
  created_by: string | null;
425
468
  created_at: string;
426
469
  inbox_id: string | null;
470
+ inbox_ids: string[] | null;
471
+ sending_speed: string | null;
427
472
  }
428
473
  interface CreateBroadcastRequest {
429
474
  name: string;
@@ -439,6 +484,8 @@ interface CreateBroadcastRequest {
439
484
  scheduled_at?: string;
440
485
  tags?: string[];
441
486
  inbox_id?: string;
487
+ inbox_ids?: string[];
488
+ sending_speed?: 'auto' | 'slow' | 'normal' | 'instant';
442
489
  }
443
490
  interface UpdateBroadcastRequest {
444
491
  name?: string;
@@ -454,6 +501,8 @@ interface UpdateBroadcastRequest {
454
501
  scheduled_at?: string;
455
502
  tags?: string[];
456
503
  inbox_id?: string;
504
+ inbox_ids?: string[] | null;
505
+ sending_speed?: 'auto' | 'slow' | 'normal' | 'instant' | null;
457
506
  }
458
507
  interface SendBroadcastResponse {
459
508
  success: boolean;
@@ -1021,6 +1070,25 @@ declare class ThreadsResource {
1021
1070
  * Add or remove labels from a single email
1022
1071
  */
1023
1072
  updateEmailLabels(emailId: string, data: UpdateLabelsRequest): Promise<UpdateLabelsResponse>;
1073
+ /**
1074
+ * Reply to a thread. From, from_name, reply_to, to, and subject are
1075
+ * auto-resolved from the thread's inbox when not provided.
1076
+ */
1077
+ reply(threadId: string, data: ThreadReplyRequest): Promise<ThreadReplyResponse>;
1078
+ /**
1079
+ * Save or update a draft reply for a thread
1080
+ */
1081
+ saveDraft(threadId: string, data: ThreadDraftRequest): Promise<ThreadDraft>;
1082
+ /**
1083
+ * Get the saved draft reply for a thread
1084
+ */
1085
+ getDraft(threadId: string): Promise<ThreadDraft>;
1086
+ /**
1087
+ * Delete the draft reply for a thread
1088
+ */
1089
+ deleteDraft(threadId: string): Promise<{
1090
+ success: boolean;
1091
+ }>;
1024
1092
  }
1025
1093
 
1026
1094
  /**
@@ -1165,4 +1233,4 @@ declare class ValidationError extends EmailrError {
1165
1233
  constructor(message: string, details?: Record<string, unknown>, requestId?: string);
1166
1234
  }
1167
1235
 
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 };
1236
+ 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 ThreadDraft, type ThreadDraftRequest, type ThreadMessage, type ThreadReplyRequest, type ThreadReplyResponse, 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
@@ -40,6 +40,7 @@ interface Inbox {
40
40
  name: string;
41
41
  username: string;
42
42
  domain: string;
43
+ reply_to: string;
43
44
  from_address: string;
44
45
  inbound_address: string;
45
46
  created_at: string;
@@ -49,9 +50,11 @@ interface CreateInboxRequest {
49
50
  name: string;
50
51
  username: string;
51
52
  domain: string;
53
+ reply_to?: string;
52
54
  }
53
55
  interface UpdateInboxRequest {
54
56
  name?: string;
57
+ reply_to?: string | null;
55
58
  }
56
59
  interface ListInboxesParams {
57
60
  }
@@ -109,6 +112,46 @@ interface UpdateThreadLabelsResponse {
109
112
  success: boolean;
110
113
  updated: number;
111
114
  }
115
+ interface ThreadReplyRequest {
116
+ html?: string;
117
+ text?: string;
118
+ to?: string | string[];
119
+ cc?: string | string[];
120
+ bcc?: string | string[];
121
+ from?: string;
122
+ from_name?: string;
123
+ reply_to_email?: string;
124
+ attachments?: Attachment[];
125
+ }
126
+ interface ThreadReplyResponse {
127
+ success: boolean;
128
+ message_id: string;
129
+ recipients: number;
130
+ status: string;
131
+ }
132
+ interface ThreadDraftRequest {
133
+ html?: string;
134
+ text?: string;
135
+ to?: string;
136
+ cc?: string;
137
+ bcc?: string;
138
+ from?: string;
139
+ from_name?: string;
140
+ reply_to_email?: string;
141
+ }
142
+ interface ThreadDraft {
143
+ id: string;
144
+ thread_id: string;
145
+ html_content: string | null;
146
+ text_content: string | null;
147
+ to_email: string | null;
148
+ cc_emails: string[] | null;
149
+ bcc_emails: string[] | null;
150
+ from_email: string | null;
151
+ subject: string | null;
152
+ created_at: string;
153
+ updated_at: string;
154
+ }
112
155
  interface Attachment {
113
156
  filename: string;
114
157
  content: string;
@@ -424,6 +467,8 @@ interface Broadcast {
424
467
  created_by: string | null;
425
468
  created_at: string;
426
469
  inbox_id: string | null;
470
+ inbox_ids: string[] | null;
471
+ sending_speed: string | null;
427
472
  }
428
473
  interface CreateBroadcastRequest {
429
474
  name: string;
@@ -439,6 +484,8 @@ interface CreateBroadcastRequest {
439
484
  scheduled_at?: string;
440
485
  tags?: string[];
441
486
  inbox_id?: string;
487
+ inbox_ids?: string[];
488
+ sending_speed?: 'auto' | 'slow' | 'normal' | 'instant';
442
489
  }
443
490
  interface UpdateBroadcastRequest {
444
491
  name?: string;
@@ -454,6 +501,8 @@ interface UpdateBroadcastRequest {
454
501
  scheduled_at?: string;
455
502
  tags?: string[];
456
503
  inbox_id?: string;
504
+ inbox_ids?: string[] | null;
505
+ sending_speed?: 'auto' | 'slow' | 'normal' | 'instant' | null;
457
506
  }
458
507
  interface SendBroadcastResponse {
459
508
  success: boolean;
@@ -1021,6 +1070,25 @@ declare class ThreadsResource {
1021
1070
  * Add or remove labels from a single email
1022
1071
  */
1023
1072
  updateEmailLabels(emailId: string, data: UpdateLabelsRequest): Promise<UpdateLabelsResponse>;
1073
+ /**
1074
+ * Reply to a thread. From, from_name, reply_to, to, and subject are
1075
+ * auto-resolved from the thread's inbox when not provided.
1076
+ */
1077
+ reply(threadId: string, data: ThreadReplyRequest): Promise<ThreadReplyResponse>;
1078
+ /**
1079
+ * Save or update a draft reply for a thread
1080
+ */
1081
+ saveDraft(threadId: string, data: ThreadDraftRequest): Promise<ThreadDraft>;
1082
+ /**
1083
+ * Get the saved draft reply for a thread
1084
+ */
1085
+ getDraft(threadId: string): Promise<ThreadDraft>;
1086
+ /**
1087
+ * Delete the draft reply for a thread
1088
+ */
1089
+ deleteDraft(threadId: string): Promise<{
1090
+ success: boolean;
1091
+ }>;
1024
1092
  }
1025
1093
 
1026
1094
  /**
@@ -1165,4 +1233,4 @@ declare class ValidationError extends EmailrError {
1165
1233
  constructor(message: string, details?: Record<string, unknown>, requestId?: string);
1166
1234
  }
1167
1235
 
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 };
1236
+ 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 ThreadDraft, type ThreadDraftRequest, type ThreadMessage, type ThreadReplyRequest, type ThreadReplyResponse, 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
@@ -773,6 +773,31 @@ var ThreadsResource = class {
773
773
  async updateEmailLabels(emailId, data) {
774
774
  return this.http.patch(`/v1/threads/emails/${emailId}/labels`, data);
775
775
  }
776
+ /**
777
+ * Reply to a thread. From, from_name, reply_to, to, and subject are
778
+ * auto-resolved from the thread's inbox when not provided.
779
+ */
780
+ async reply(threadId, data) {
781
+ return this.http.post(`/v1/threads/${threadId}/reply`, data);
782
+ }
783
+ /**
784
+ * Save or update a draft reply for a thread
785
+ */
786
+ async saveDraft(threadId, data) {
787
+ return this.http.put(`/v1/threads/${threadId}/draft`, data);
788
+ }
789
+ /**
790
+ * Get the saved draft reply for a thread
791
+ */
792
+ async getDraft(threadId) {
793
+ return this.http.get(`/v1/threads/${threadId}/draft`);
794
+ }
795
+ /**
796
+ * Delete the draft reply for a thread
797
+ */
798
+ async deleteDraft(threadId) {
799
+ return this.http.delete(`/v1/threads/${threadId}/draft`);
800
+ }
776
801
  };
777
802
 
778
803
  // src/client.ts
package/dist/index.mjs CHANGED
@@ -740,6 +740,31 @@ var ThreadsResource = class {
740
740
  async updateEmailLabels(emailId, data) {
741
741
  return this.http.patch(`/v1/threads/emails/${emailId}/labels`, data);
742
742
  }
743
+ /**
744
+ * Reply to a thread. From, from_name, reply_to, to, and subject are
745
+ * auto-resolved from the thread's inbox when not provided.
746
+ */
747
+ async reply(threadId, data) {
748
+ return this.http.post(`/v1/threads/${threadId}/reply`, data);
749
+ }
750
+ /**
751
+ * Save or update a draft reply for a thread
752
+ */
753
+ async saveDraft(threadId, data) {
754
+ return this.http.put(`/v1/threads/${threadId}/draft`, data);
755
+ }
756
+ /**
757
+ * Get the saved draft reply for a thread
758
+ */
759
+ async getDraft(threadId) {
760
+ return this.http.get(`/v1/threads/${threadId}/draft`);
761
+ }
762
+ /**
763
+ * Delete the draft reply for a thread
764
+ */
765
+ async deleteDraft(threadId) {
766
+ return this.http.delete(`/v1/threads/${threadId}/draft`);
767
+ }
743
768
  };
744
769
 
745
770
  // src/client.ts
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "emailr",
3
- "version": "1.4.0",
3
+ "version": "1.6.0",
4
4
  "description": "Official Emailr API SDK for TypeScript/JavaScript",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.mjs",