emailr 1.7.2 → 1.9.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
@@ -112,6 +112,19 @@ interface UpdateThreadLabelsResponse {
112
112
  success: boolean;
113
113
  updated: number;
114
114
  }
115
+ interface UpdateTagsResponse {
116
+ success: boolean;
117
+ tags: string[];
118
+ }
119
+ interface EmailComment {
120
+ id: string;
121
+ email_id: string;
122
+ organization_id: string;
123
+ user_id: string;
124
+ content: string;
125
+ created_at: string;
126
+ updated_at: string;
127
+ }
115
128
  interface ThreadReplyRequest {
116
129
  html?: string;
117
130
  text?: string;
@@ -473,10 +486,8 @@ interface CreateBroadcastRequest {
473
486
  from_name?: string;
474
487
  reply_to?: string;
475
488
  preview_text?: string;
476
- template_id?: string;
489
+ template_id: string;
477
490
  segment_id?: string;
478
- html_content?: string;
479
- text_content?: string;
480
491
  scheduled_at?: string;
481
492
  tags?: string[];
482
493
  inbox_id?: string;
@@ -492,8 +503,6 @@ interface UpdateBroadcastRequest {
492
503
  preview_text?: string;
493
504
  template_id?: string;
494
505
  segment_id?: string;
495
- html_content?: string;
496
- text_content?: string;
497
506
  scheduled_at?: string;
498
507
  tags?: string[];
499
508
  inbox_id?: string;
@@ -1123,6 +1132,37 @@ declare class ThreadsResource {
1123
1132
  deleteDraft(threadId: string): Promise<{
1124
1133
  success: boolean;
1125
1134
  }>;
1135
+ /**
1136
+ * Add tags to an email
1137
+ */
1138
+ addEmailTags(emailId: string, tags: string[]): Promise<UpdateTagsResponse>;
1139
+ /**
1140
+ * Remove tags from an email
1141
+ */
1142
+ removeEmailTags(emailId: string, tags: string[]): Promise<UpdateTagsResponse>;
1143
+ /**
1144
+ * Add a comment to an email
1145
+ */
1146
+ addEmailComment(emailId: string, content: string): Promise<EmailComment>;
1147
+ /**
1148
+ * List all comments for an email
1149
+ */
1150
+ listEmailComments(emailId: string): Promise<{
1151
+ data: EmailComment[];
1152
+ }>;
1153
+ /**
1154
+ * Delete a comment from an email
1155
+ */
1156
+ deleteEmailComment(emailId: string, commentId: string): Promise<{
1157
+ success: boolean;
1158
+ }>;
1159
+ /**
1160
+ * Mark all unread received emails in a thread as read
1161
+ */
1162
+ markAsRead(threadId: string): Promise<{
1163
+ success: boolean;
1164
+ updated: number;
1165
+ }>;
1126
1166
  }
1127
1167
 
1128
1168
  declare class TopicsResource {
@@ -1328,4 +1368,4 @@ declare class ValidationError extends EmailrError {
1328
1368
  constructor(message: string, details?: Record<string, unknown>, requestId?: string);
1329
1369
  }
1330
1370
 
1331
- export { type AddDomainRequest, type ApiKey, type Attachment, AuthenticationError, type Broadcast, type BulkCreateContactsRequest, type BulkCreateContactsResponse, type Contact, type ContactListResponse, type ContactPropertyDefinition, type CreateApiKeyRequest, type CreateBroadcastRequest, type CreateContactPropertyDefinitionRequest, type CreateContactRequest, type CreateForwardingRuleRequest, type CreateInboxRequest, type CreateSegmentRequest, type CreateTemplateRequest, type CreateTopicRequest, type CreateWebhookRequest, type DnsRecord, type DnsVerificationStatus, type Domain, type DomainDnsRecords, type DomainVerificationStatus, type Email, type EmailEvent, 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 ListLogsParams, type ListSegmentsParams, type ListTemplatesParams, type ListThreadsParams, 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 Topic, type UpdateBroadcastRequest, type UpdateContactRequest, type UpdateDomainRequest, type UpdateInboxRequest, type UpdateLabelsRequest, type UpdateLabelsResponse, type UpdateSegmentRequest, type UpdateTemplateRequest, type UpdateThreadLabelsResponse, type UpdateTopicRequest, ValidationError, type Webhook, type WebhookDelivery, type WebhookToggleResponse };
1371
+ export { type AddDomainRequest, type ApiKey, type Attachment, AuthenticationError, type Broadcast, type BulkCreateContactsRequest, type BulkCreateContactsResponse, type Contact, type ContactListResponse, type ContactPropertyDefinition, type CreateApiKeyRequest, type CreateBroadcastRequest, type CreateContactPropertyDefinitionRequest, type CreateContactRequest, type CreateForwardingRuleRequest, type CreateInboxRequest, type CreateSegmentRequest, type CreateTemplateRequest, type CreateTopicRequest, type CreateWebhookRequest, type DnsRecord, type DnsVerificationStatus, type Domain, type DomainDnsRecords, type DomainVerificationStatus, type Email, type EmailComment, type EmailEvent, 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 ListLogsParams, type ListSegmentsParams, type ListTemplatesParams, type ListThreadsParams, 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 Topic, type UpdateBroadcastRequest, type UpdateContactRequest, type UpdateDomainRequest, type UpdateInboxRequest, type UpdateLabelsRequest, type UpdateLabelsResponse, type UpdateSegmentRequest, type UpdateTagsResponse, type UpdateTemplateRequest, type UpdateThreadLabelsResponse, type UpdateTopicRequest, ValidationError, type Webhook, type WebhookDelivery, type WebhookToggleResponse };
package/dist/index.d.ts CHANGED
@@ -112,6 +112,19 @@ interface UpdateThreadLabelsResponse {
112
112
  success: boolean;
113
113
  updated: number;
114
114
  }
115
+ interface UpdateTagsResponse {
116
+ success: boolean;
117
+ tags: string[];
118
+ }
119
+ interface EmailComment {
120
+ id: string;
121
+ email_id: string;
122
+ organization_id: string;
123
+ user_id: string;
124
+ content: string;
125
+ created_at: string;
126
+ updated_at: string;
127
+ }
115
128
  interface ThreadReplyRequest {
116
129
  html?: string;
117
130
  text?: string;
@@ -473,10 +486,8 @@ interface CreateBroadcastRequest {
473
486
  from_name?: string;
474
487
  reply_to?: string;
475
488
  preview_text?: string;
476
- template_id?: string;
489
+ template_id: string;
477
490
  segment_id?: string;
478
- html_content?: string;
479
- text_content?: string;
480
491
  scheduled_at?: string;
481
492
  tags?: string[];
482
493
  inbox_id?: string;
@@ -492,8 +503,6 @@ interface UpdateBroadcastRequest {
492
503
  preview_text?: string;
493
504
  template_id?: string;
494
505
  segment_id?: string;
495
- html_content?: string;
496
- text_content?: string;
497
506
  scheduled_at?: string;
498
507
  tags?: string[];
499
508
  inbox_id?: string;
@@ -1123,6 +1132,37 @@ declare class ThreadsResource {
1123
1132
  deleteDraft(threadId: string): Promise<{
1124
1133
  success: boolean;
1125
1134
  }>;
1135
+ /**
1136
+ * Add tags to an email
1137
+ */
1138
+ addEmailTags(emailId: string, tags: string[]): Promise<UpdateTagsResponse>;
1139
+ /**
1140
+ * Remove tags from an email
1141
+ */
1142
+ removeEmailTags(emailId: string, tags: string[]): Promise<UpdateTagsResponse>;
1143
+ /**
1144
+ * Add a comment to an email
1145
+ */
1146
+ addEmailComment(emailId: string, content: string): Promise<EmailComment>;
1147
+ /**
1148
+ * List all comments for an email
1149
+ */
1150
+ listEmailComments(emailId: string): Promise<{
1151
+ data: EmailComment[];
1152
+ }>;
1153
+ /**
1154
+ * Delete a comment from an email
1155
+ */
1156
+ deleteEmailComment(emailId: string, commentId: string): Promise<{
1157
+ success: boolean;
1158
+ }>;
1159
+ /**
1160
+ * Mark all unread received emails in a thread as read
1161
+ */
1162
+ markAsRead(threadId: string): Promise<{
1163
+ success: boolean;
1164
+ updated: number;
1165
+ }>;
1126
1166
  }
1127
1167
 
1128
1168
  declare class TopicsResource {
@@ -1328,4 +1368,4 @@ declare class ValidationError extends EmailrError {
1328
1368
  constructor(message: string, details?: Record<string, unknown>, requestId?: string);
1329
1369
  }
1330
1370
 
1331
- export { type AddDomainRequest, type ApiKey, type Attachment, AuthenticationError, type Broadcast, type BulkCreateContactsRequest, type BulkCreateContactsResponse, type Contact, type ContactListResponse, type ContactPropertyDefinition, type CreateApiKeyRequest, type CreateBroadcastRequest, type CreateContactPropertyDefinitionRequest, type CreateContactRequest, type CreateForwardingRuleRequest, type CreateInboxRequest, type CreateSegmentRequest, type CreateTemplateRequest, type CreateTopicRequest, type CreateWebhookRequest, type DnsRecord, type DnsVerificationStatus, type Domain, type DomainDnsRecords, type DomainVerificationStatus, type Email, type EmailEvent, 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 ListLogsParams, type ListSegmentsParams, type ListTemplatesParams, type ListThreadsParams, 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 Topic, type UpdateBroadcastRequest, type UpdateContactRequest, type UpdateDomainRequest, type UpdateInboxRequest, type UpdateLabelsRequest, type UpdateLabelsResponse, type UpdateSegmentRequest, type UpdateTemplateRequest, type UpdateThreadLabelsResponse, type UpdateTopicRequest, ValidationError, type Webhook, type WebhookDelivery, type WebhookToggleResponse };
1371
+ export { type AddDomainRequest, type ApiKey, type Attachment, AuthenticationError, type Broadcast, type BulkCreateContactsRequest, type BulkCreateContactsResponse, type Contact, type ContactListResponse, type ContactPropertyDefinition, type CreateApiKeyRequest, type CreateBroadcastRequest, type CreateContactPropertyDefinitionRequest, type CreateContactRequest, type CreateForwardingRuleRequest, type CreateInboxRequest, type CreateSegmentRequest, type CreateTemplateRequest, type CreateTopicRequest, type CreateWebhookRequest, type DnsRecord, type DnsVerificationStatus, type Domain, type DomainDnsRecords, type DomainVerificationStatus, type Email, type EmailComment, type EmailEvent, 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 ListLogsParams, type ListSegmentsParams, type ListTemplatesParams, type ListThreadsParams, 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 Topic, type UpdateBroadcastRequest, type UpdateContactRequest, type UpdateDomainRequest, type UpdateInboxRequest, type UpdateLabelsRequest, type UpdateLabelsResponse, type UpdateSegmentRequest, type UpdateTagsResponse, type UpdateTemplateRequest, type UpdateThreadLabelsResponse, type UpdateTopicRequest, ValidationError, type Webhook, type WebhookDelivery, type WebhookToggleResponse };
package/dist/index.js CHANGED
@@ -793,6 +793,42 @@ var ThreadsResource = class {
793
793
  async deleteDraft(threadId) {
794
794
  return this.http.delete(`/v1/threads/${threadId}/draft`);
795
795
  }
796
+ /**
797
+ * Add tags to an email
798
+ */
799
+ async addEmailTags(emailId, tags) {
800
+ return this.http.patch(`/v1/threads/emails/${emailId}/tags`, { add: tags });
801
+ }
802
+ /**
803
+ * Remove tags from an email
804
+ */
805
+ async removeEmailTags(emailId, tags) {
806
+ return this.http.patch(`/v1/threads/emails/${emailId}/tags`, { remove: tags });
807
+ }
808
+ /**
809
+ * Add a comment to an email
810
+ */
811
+ async addEmailComment(emailId, content) {
812
+ return this.http.post(`/v1/threads/emails/${emailId}/comments`, { content });
813
+ }
814
+ /**
815
+ * List all comments for an email
816
+ */
817
+ async listEmailComments(emailId) {
818
+ return this.http.get(`/v1/threads/emails/${emailId}/comments`);
819
+ }
820
+ /**
821
+ * Delete a comment from an email
822
+ */
823
+ async deleteEmailComment(emailId, commentId) {
824
+ return this.http.delete(`/v1/threads/emails/${emailId}/comments/${commentId}`);
825
+ }
826
+ /**
827
+ * Mark all unread received emails in a thread as read
828
+ */
829
+ async markAsRead(threadId) {
830
+ return this.http.post(`/v1/threads/${threadId}/mark-read`);
831
+ }
796
832
  };
797
833
 
798
834
  // src/resources/topics.ts
package/dist/index.mjs CHANGED
@@ -760,6 +760,42 @@ var ThreadsResource = class {
760
760
  async deleteDraft(threadId) {
761
761
  return this.http.delete(`/v1/threads/${threadId}/draft`);
762
762
  }
763
+ /**
764
+ * Add tags to an email
765
+ */
766
+ async addEmailTags(emailId, tags) {
767
+ return this.http.patch(`/v1/threads/emails/${emailId}/tags`, { add: tags });
768
+ }
769
+ /**
770
+ * Remove tags from an email
771
+ */
772
+ async removeEmailTags(emailId, tags) {
773
+ return this.http.patch(`/v1/threads/emails/${emailId}/tags`, { remove: tags });
774
+ }
775
+ /**
776
+ * Add a comment to an email
777
+ */
778
+ async addEmailComment(emailId, content) {
779
+ return this.http.post(`/v1/threads/emails/${emailId}/comments`, { content });
780
+ }
781
+ /**
782
+ * List all comments for an email
783
+ */
784
+ async listEmailComments(emailId) {
785
+ return this.http.get(`/v1/threads/emails/${emailId}/comments`);
786
+ }
787
+ /**
788
+ * Delete a comment from an email
789
+ */
790
+ async deleteEmailComment(emailId, commentId) {
791
+ return this.http.delete(`/v1/threads/emails/${emailId}/comments/${commentId}`);
792
+ }
793
+ /**
794
+ * Mark all unread received emails in a thread as read
795
+ */
796
+ async markAsRead(threadId) {
797
+ return this.http.post(`/v1/threads/${threadId}/mark-read`);
798
+ }
763
799
  };
764
800
 
765
801
  // src/resources/topics.ts
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "emailr",
3
- "version": "1.7.2",
3
+ "version": "1.9.0",
4
4
  "description": "Official Emailr API SDK for TypeScript/JavaScript",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.mjs",
@@ -15,11 +15,6 @@
15
15
  "files": [
16
16
  "dist"
17
17
  ],
18
- "scripts": {
19
- "build": "tsup src/index.ts --format cjs,esm --dts --clean",
20
- "test": "vitest run",
21
- "typecheck": "tsc --noEmit"
22
- },
23
18
  "keywords": [
24
19
  "emailr",
25
20
  "email",
@@ -36,5 +31,10 @@
36
31
  },
37
32
  "engines": {
38
33
  "node": ">=18.0.0"
34
+ },
35
+ "scripts": {
36
+ "build": "tsup src/index.ts --format cjs,esm --dts --clean",
37
+ "test": "vitest run",
38
+ "typecheck": "tsc --noEmit"
39
39
  }
40
- }
40
+ }