emailr 1.7.2 → 1.8.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;
@@ -1123,6 +1136,37 @@ declare class ThreadsResource {
1123
1136
  deleteDraft(threadId: string): Promise<{
1124
1137
  success: boolean;
1125
1138
  }>;
1139
+ /**
1140
+ * Add tags to an email
1141
+ */
1142
+ addEmailTags(emailId: string, tags: string[]): Promise<UpdateTagsResponse>;
1143
+ /**
1144
+ * Remove tags from an email
1145
+ */
1146
+ removeEmailTags(emailId: string, tags: string[]): Promise<UpdateTagsResponse>;
1147
+ /**
1148
+ * Add a comment to an email
1149
+ */
1150
+ addEmailComment(emailId: string, content: string): Promise<EmailComment>;
1151
+ /**
1152
+ * List all comments for an email
1153
+ */
1154
+ listEmailComments(emailId: string): Promise<{
1155
+ data: EmailComment[];
1156
+ }>;
1157
+ /**
1158
+ * Delete a comment from an email
1159
+ */
1160
+ deleteEmailComment(emailId: string, commentId: string): Promise<{
1161
+ success: boolean;
1162
+ }>;
1163
+ /**
1164
+ * Mark all unread received emails in a thread as read
1165
+ */
1166
+ markAsRead(threadId: string): Promise<{
1167
+ success: boolean;
1168
+ updated: number;
1169
+ }>;
1126
1170
  }
1127
1171
 
1128
1172
  declare class TopicsResource {
@@ -1328,4 +1372,4 @@ declare class ValidationError extends EmailrError {
1328
1372
  constructor(message: string, details?: Record<string, unknown>, requestId?: string);
1329
1373
  }
1330
1374
 
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 };
1375
+ 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;
@@ -1123,6 +1136,37 @@ declare class ThreadsResource {
1123
1136
  deleteDraft(threadId: string): Promise<{
1124
1137
  success: boolean;
1125
1138
  }>;
1139
+ /**
1140
+ * Add tags to an email
1141
+ */
1142
+ addEmailTags(emailId: string, tags: string[]): Promise<UpdateTagsResponse>;
1143
+ /**
1144
+ * Remove tags from an email
1145
+ */
1146
+ removeEmailTags(emailId: string, tags: string[]): Promise<UpdateTagsResponse>;
1147
+ /**
1148
+ * Add a comment to an email
1149
+ */
1150
+ addEmailComment(emailId: string, content: string): Promise<EmailComment>;
1151
+ /**
1152
+ * List all comments for an email
1153
+ */
1154
+ listEmailComments(emailId: string): Promise<{
1155
+ data: EmailComment[];
1156
+ }>;
1157
+ /**
1158
+ * Delete a comment from an email
1159
+ */
1160
+ deleteEmailComment(emailId: string, commentId: string): Promise<{
1161
+ success: boolean;
1162
+ }>;
1163
+ /**
1164
+ * Mark all unread received emails in a thread as read
1165
+ */
1166
+ markAsRead(threadId: string): Promise<{
1167
+ success: boolean;
1168
+ updated: number;
1169
+ }>;
1126
1170
  }
1127
1171
 
1128
1172
  declare class TopicsResource {
@@ -1328,4 +1372,4 @@ declare class ValidationError extends EmailrError {
1328
1372
  constructor(message: string, details?: Record<string, unknown>, requestId?: string);
1329
1373
  }
1330
1374
 
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 };
1375
+ 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.8.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
+ }