emailr 1.4.0 → 1.5.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
@@ -109,6 +109,46 @@ interface UpdateThreadLabelsResponse {
109
109
  success: boolean;
110
110
  updated: number;
111
111
  }
112
+ interface ThreadReplyRequest {
113
+ html?: string;
114
+ text?: string;
115
+ to?: string | string[];
116
+ cc?: string | string[];
117
+ bcc?: string | string[];
118
+ from?: string;
119
+ from_name?: string;
120
+ reply_to_email?: string;
121
+ attachments?: Attachment[];
122
+ }
123
+ interface ThreadReplyResponse {
124
+ success: boolean;
125
+ message_id: string;
126
+ recipients: number;
127
+ status: string;
128
+ }
129
+ interface ThreadDraftRequest {
130
+ html?: string;
131
+ text?: string;
132
+ to?: string;
133
+ cc?: string;
134
+ bcc?: string;
135
+ from?: string;
136
+ from_name?: string;
137
+ reply_to_email?: string;
138
+ }
139
+ interface ThreadDraft {
140
+ id: string;
141
+ thread_id: string;
142
+ html_content: string | null;
143
+ text_content: string | null;
144
+ to_email: string | null;
145
+ cc_emails: string[] | null;
146
+ bcc_emails: string[] | null;
147
+ from_email: string | null;
148
+ subject: string | null;
149
+ created_at: string;
150
+ updated_at: string;
151
+ }
112
152
  interface Attachment {
113
153
  filename: string;
114
154
  content: string;
@@ -1021,6 +1061,25 @@ declare class ThreadsResource {
1021
1061
  * Add or remove labels from a single email
1022
1062
  */
1023
1063
  updateEmailLabels(emailId: string, data: UpdateLabelsRequest): Promise<UpdateLabelsResponse>;
1064
+ /**
1065
+ * Reply to a thread. From, from_name, reply_to, to, and subject are
1066
+ * auto-resolved from the thread's inbox when not provided.
1067
+ */
1068
+ reply(threadId: string, data: ThreadReplyRequest): Promise<ThreadReplyResponse>;
1069
+ /**
1070
+ * Save or update a draft reply for a thread
1071
+ */
1072
+ saveDraft(threadId: string, data: ThreadDraftRequest): Promise<ThreadDraft>;
1073
+ /**
1074
+ * Get the saved draft reply for a thread
1075
+ */
1076
+ getDraft(threadId: string): Promise<ThreadDraft>;
1077
+ /**
1078
+ * Delete the draft reply for a thread
1079
+ */
1080
+ deleteDraft(threadId: string): Promise<{
1081
+ success: boolean;
1082
+ }>;
1024
1083
  }
1025
1084
 
1026
1085
  /**
@@ -1165,4 +1224,4 @@ declare class ValidationError extends EmailrError {
1165
1224
  constructor(message: string, details?: Record<string, unknown>, requestId?: string);
1166
1225
  }
1167
1226
 
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 };
1227
+ 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
@@ -109,6 +109,46 @@ interface UpdateThreadLabelsResponse {
109
109
  success: boolean;
110
110
  updated: number;
111
111
  }
112
+ interface ThreadReplyRequest {
113
+ html?: string;
114
+ text?: string;
115
+ to?: string | string[];
116
+ cc?: string | string[];
117
+ bcc?: string | string[];
118
+ from?: string;
119
+ from_name?: string;
120
+ reply_to_email?: string;
121
+ attachments?: Attachment[];
122
+ }
123
+ interface ThreadReplyResponse {
124
+ success: boolean;
125
+ message_id: string;
126
+ recipients: number;
127
+ status: string;
128
+ }
129
+ interface ThreadDraftRequest {
130
+ html?: string;
131
+ text?: string;
132
+ to?: string;
133
+ cc?: string;
134
+ bcc?: string;
135
+ from?: string;
136
+ from_name?: string;
137
+ reply_to_email?: string;
138
+ }
139
+ interface ThreadDraft {
140
+ id: string;
141
+ thread_id: string;
142
+ html_content: string | null;
143
+ text_content: string | null;
144
+ to_email: string | null;
145
+ cc_emails: string[] | null;
146
+ bcc_emails: string[] | null;
147
+ from_email: string | null;
148
+ subject: string | null;
149
+ created_at: string;
150
+ updated_at: string;
151
+ }
112
152
  interface Attachment {
113
153
  filename: string;
114
154
  content: string;
@@ -1021,6 +1061,25 @@ declare class ThreadsResource {
1021
1061
  * Add or remove labels from a single email
1022
1062
  */
1023
1063
  updateEmailLabels(emailId: string, data: UpdateLabelsRequest): Promise<UpdateLabelsResponse>;
1064
+ /**
1065
+ * Reply to a thread. From, from_name, reply_to, to, and subject are
1066
+ * auto-resolved from the thread's inbox when not provided.
1067
+ */
1068
+ reply(threadId: string, data: ThreadReplyRequest): Promise<ThreadReplyResponse>;
1069
+ /**
1070
+ * Save or update a draft reply for a thread
1071
+ */
1072
+ saveDraft(threadId: string, data: ThreadDraftRequest): Promise<ThreadDraft>;
1073
+ /**
1074
+ * Get the saved draft reply for a thread
1075
+ */
1076
+ getDraft(threadId: string): Promise<ThreadDraft>;
1077
+ /**
1078
+ * Delete the draft reply for a thread
1079
+ */
1080
+ deleteDraft(threadId: string): Promise<{
1081
+ success: boolean;
1082
+ }>;
1024
1083
  }
1025
1084
 
1026
1085
  /**
@@ -1165,4 +1224,4 @@ declare class ValidationError extends EmailrError {
1165
1224
  constructor(message: string, details?: Record<string, unknown>, requestId?: string);
1166
1225
  }
1167
1226
 
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 };
1227
+ 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.5.0",
4
4
  "description": "Official Emailr API SDK for TypeScript/JavaScript",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.mjs",