emailr 1.7.0 → 1.7.2

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
@@ -165,6 +165,7 @@ interface ReplyTo {
165
165
  interface SendEmailRequest {
166
166
  to: string | string[];
167
167
  from?: string;
168
+ from_name?: string;
168
169
  cc?: string | string[];
169
170
  bcc?: string | string[];
170
171
  subject?: string;
@@ -178,6 +179,7 @@ interface SendEmailRequest {
178
179
  reply_to_email?: string;
179
180
  preview_text?: string;
180
181
  scheduled_at?: string;
182
+ inbox_id?: string;
181
183
  }
182
184
  interface SendEmailResponse {
183
185
  success: boolean;
@@ -407,7 +409,9 @@ interface Webhook {
407
409
  organization_id: string;
408
410
  name: string;
409
411
  url: string;
412
+ type: 'transactional' | 'domain' | 'receiving';
410
413
  events: string[];
414
+ inbox_ids: string[] | null;
411
415
  secret: string;
412
416
  active: boolean;
413
417
  created_by: string | null;
@@ -416,12 +420,8 @@ interface Webhook {
416
420
  interface CreateWebhookRequest {
417
421
  name: string;
418
422
  url: string;
419
- events: string[];
420
- }
421
- interface UpdateWebhookRequest {
422
- name?: string;
423
- url?: string;
424
- events?: string[];
423
+ type: 'transactional' | 'domain' | 'receiving';
424
+ inbox_ids?: string[];
425
425
  }
426
426
  interface WebhookToggleResponse {
427
427
  success: boolean;
@@ -438,10 +438,6 @@ interface WebhookDelivery {
438
438
  delivered_at: string | null;
439
439
  created_at: string;
440
440
  }
441
- interface ListWebhooksParams {
442
- page?: number;
443
- limit?: number;
444
- }
445
441
  interface Broadcast {
446
442
  id: string;
447
443
  organization_id: string;
@@ -868,39 +864,21 @@ declare class WebhooksResource {
868
864
  */
869
865
  create(data: CreateWebhookRequest): Promise<Webhook>;
870
866
  /**
871
- * Get webhook by ID
867
+ * List all webhooks
872
868
  */
873
- get(id: string): Promise<Webhook>;
874
- /**
875
- * List webhooks with pagination
876
- */
877
- list(params?: ListWebhooksParams): Promise<PaginatedResponse<Webhook>>;
878
- /**
879
- * Update a webhook
880
- */
881
- update(id: string, data: UpdateWebhookRequest): Promise<Webhook>;
869
+ list(): Promise<Webhook[]>;
882
870
  /**
883
871
  * Delete a webhook
884
872
  */
885
873
  delete(id: string): Promise<SuccessResponse>;
886
874
  /**
887
- * Enable a webhook
875
+ * Toggle a webhook's active state (enable/disable)
888
876
  */
889
- enable(id: string): Promise<WebhookToggleResponse>;
890
- /**
891
- * Disable a webhook
892
- */
893
- disable(id: string): Promise<WebhookToggleResponse>;
877
+ toggle(id: string): Promise<WebhookToggleResponse>;
894
878
  /**
895
879
  * List webhook deliveries
896
880
  */
897
- listDeliveries(id: string): Promise<{
898
- data: WebhookDelivery[];
899
- }>;
900
- /**
901
- * Retry a failed webhook delivery
902
- */
903
- retryDelivery(webhookId: string, deliveryId: string): Promise<SuccessResponse>;
881
+ listDeliveries(id: string): Promise<WebhookDelivery[]>;
904
882
  }
905
883
 
906
884
  declare class BroadcastsResource {
@@ -1350,4 +1328,4 @@ declare class ValidationError extends EmailrError {
1350
1328
  constructor(message: string, details?: Record<string, unknown>, requestId?: string);
1351
1329
  }
1352
1330
 
1353
- 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, 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 Topic, type UpdateBroadcastRequest, type UpdateContactRequest, type UpdateDomainRequest, type UpdateInboxRequest, type UpdateLabelsRequest, type UpdateLabelsResponse, type UpdateSegmentRequest, type UpdateTemplateRequest, type UpdateThreadLabelsResponse, type UpdateTopicRequest, type UpdateWebhookRequest, ValidationError, type Webhook, type WebhookDelivery, type WebhookToggleResponse };
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 };
package/dist/index.d.ts CHANGED
@@ -165,6 +165,7 @@ interface ReplyTo {
165
165
  interface SendEmailRequest {
166
166
  to: string | string[];
167
167
  from?: string;
168
+ from_name?: string;
168
169
  cc?: string | string[];
169
170
  bcc?: string | string[];
170
171
  subject?: string;
@@ -178,6 +179,7 @@ interface SendEmailRequest {
178
179
  reply_to_email?: string;
179
180
  preview_text?: string;
180
181
  scheduled_at?: string;
182
+ inbox_id?: string;
181
183
  }
182
184
  interface SendEmailResponse {
183
185
  success: boolean;
@@ -407,7 +409,9 @@ interface Webhook {
407
409
  organization_id: string;
408
410
  name: string;
409
411
  url: string;
412
+ type: 'transactional' | 'domain' | 'receiving';
410
413
  events: string[];
414
+ inbox_ids: string[] | null;
411
415
  secret: string;
412
416
  active: boolean;
413
417
  created_by: string | null;
@@ -416,12 +420,8 @@ interface Webhook {
416
420
  interface CreateWebhookRequest {
417
421
  name: string;
418
422
  url: string;
419
- events: string[];
420
- }
421
- interface UpdateWebhookRequest {
422
- name?: string;
423
- url?: string;
424
- events?: string[];
423
+ type: 'transactional' | 'domain' | 'receiving';
424
+ inbox_ids?: string[];
425
425
  }
426
426
  interface WebhookToggleResponse {
427
427
  success: boolean;
@@ -438,10 +438,6 @@ interface WebhookDelivery {
438
438
  delivered_at: string | null;
439
439
  created_at: string;
440
440
  }
441
- interface ListWebhooksParams {
442
- page?: number;
443
- limit?: number;
444
- }
445
441
  interface Broadcast {
446
442
  id: string;
447
443
  organization_id: string;
@@ -868,39 +864,21 @@ declare class WebhooksResource {
868
864
  */
869
865
  create(data: CreateWebhookRequest): Promise<Webhook>;
870
866
  /**
871
- * Get webhook by ID
867
+ * List all webhooks
872
868
  */
873
- get(id: string): Promise<Webhook>;
874
- /**
875
- * List webhooks with pagination
876
- */
877
- list(params?: ListWebhooksParams): Promise<PaginatedResponse<Webhook>>;
878
- /**
879
- * Update a webhook
880
- */
881
- update(id: string, data: UpdateWebhookRequest): Promise<Webhook>;
869
+ list(): Promise<Webhook[]>;
882
870
  /**
883
871
  * Delete a webhook
884
872
  */
885
873
  delete(id: string): Promise<SuccessResponse>;
886
874
  /**
887
- * Enable a webhook
875
+ * Toggle a webhook's active state (enable/disable)
888
876
  */
889
- enable(id: string): Promise<WebhookToggleResponse>;
890
- /**
891
- * Disable a webhook
892
- */
893
- disable(id: string): Promise<WebhookToggleResponse>;
877
+ toggle(id: string): Promise<WebhookToggleResponse>;
894
878
  /**
895
879
  * List webhook deliveries
896
880
  */
897
- listDeliveries(id: string): Promise<{
898
- data: WebhookDelivery[];
899
- }>;
900
- /**
901
- * Retry a failed webhook delivery
902
- */
903
- retryDelivery(webhookId: string, deliveryId: string): Promise<SuccessResponse>;
881
+ listDeliveries(id: string): Promise<WebhookDelivery[]>;
904
882
  }
905
883
 
906
884
  declare class BroadcastsResource {
@@ -1350,4 +1328,4 @@ declare class ValidationError extends EmailrError {
1350
1328
  constructor(message: string, details?: Record<string, unknown>, requestId?: string);
1351
1329
  }
1352
1330
 
1353
- 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, 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 Topic, type UpdateBroadcastRequest, type UpdateContactRequest, type UpdateDomainRequest, type UpdateInboxRequest, type UpdateLabelsRequest, type UpdateLabelsResponse, type UpdateSegmentRequest, type UpdateTemplateRequest, type UpdateThreadLabelsResponse, type UpdateTopicRequest, type UpdateWebhookRequest, ValidationError, type Webhook, type WebhookDelivery, type WebhookToggleResponse };
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 };
package/dist/index.js CHANGED
@@ -455,24 +455,10 @@ var WebhooksResource = class {
455
455
  return this.http.post("/v1/webhooks", data);
456
456
  }
457
457
  /**
458
- * Get webhook by ID
458
+ * List all webhooks
459
459
  */
460
- async get(id) {
461
- return this.http.get(`/v1/webhooks/${id}`);
462
- }
463
- /**
464
- * List webhooks with pagination
465
- */
466
- async list(params) {
467
- return this.http.get("/v1/webhooks", {
468
- params
469
- });
470
- }
471
- /**
472
- * Update a webhook
473
- */
474
- async update(id, data) {
475
- return this.http.put(`/v1/webhooks/${id}`, data);
460
+ async list() {
461
+ return this.http.get("/v1/webhooks");
476
462
  }
477
463
  /**
478
464
  * Delete a webhook
@@ -481,16 +467,10 @@ var WebhooksResource = class {
481
467
  return this.http.delete(`/v1/webhooks/${id}`);
482
468
  }
483
469
  /**
484
- * Enable a webhook
470
+ * Toggle a webhook's active state (enable/disable)
485
471
  */
486
- async enable(id) {
487
- return this.http.post(`/v1/webhooks/${id}/enable`);
488
- }
489
- /**
490
- * Disable a webhook
491
- */
492
- async disable(id) {
493
- return this.http.post(`/v1/webhooks/${id}/disable`);
472
+ async toggle(id) {
473
+ return this.http.put(`/v1/webhooks/${id}/toggle`);
494
474
  }
495
475
  /**
496
476
  * List webhook deliveries
@@ -498,12 +478,6 @@ var WebhooksResource = class {
498
478
  async listDeliveries(id) {
499
479
  return this.http.get(`/v1/webhooks/${id}/deliveries`);
500
480
  }
501
- /**
502
- * Retry a failed webhook delivery
503
- */
504
- async retryDelivery(webhookId, deliveryId) {
505
- return this.http.post(`/v1/webhooks/${webhookId}/deliveries/${deliveryId}/retry`);
506
- }
507
481
  };
508
482
 
509
483
  // src/resources/broadcasts.ts
package/dist/index.mjs CHANGED
@@ -422,24 +422,10 @@ var WebhooksResource = class {
422
422
  return this.http.post("/v1/webhooks", data);
423
423
  }
424
424
  /**
425
- * Get webhook by ID
425
+ * List all webhooks
426
426
  */
427
- async get(id) {
428
- return this.http.get(`/v1/webhooks/${id}`);
429
- }
430
- /**
431
- * List webhooks with pagination
432
- */
433
- async list(params) {
434
- return this.http.get("/v1/webhooks", {
435
- params
436
- });
437
- }
438
- /**
439
- * Update a webhook
440
- */
441
- async update(id, data) {
442
- return this.http.put(`/v1/webhooks/${id}`, data);
427
+ async list() {
428
+ return this.http.get("/v1/webhooks");
443
429
  }
444
430
  /**
445
431
  * Delete a webhook
@@ -448,16 +434,10 @@ var WebhooksResource = class {
448
434
  return this.http.delete(`/v1/webhooks/${id}`);
449
435
  }
450
436
  /**
451
- * Enable a webhook
437
+ * Toggle a webhook's active state (enable/disable)
452
438
  */
453
- async enable(id) {
454
- return this.http.post(`/v1/webhooks/${id}/enable`);
455
- }
456
- /**
457
- * Disable a webhook
458
- */
459
- async disable(id) {
460
- return this.http.post(`/v1/webhooks/${id}/disable`);
439
+ async toggle(id) {
440
+ return this.http.put(`/v1/webhooks/${id}/toggle`);
461
441
  }
462
442
  /**
463
443
  * List webhook deliveries
@@ -465,12 +445,6 @@ var WebhooksResource = class {
465
445
  async listDeliveries(id) {
466
446
  return this.http.get(`/v1/webhooks/${id}/deliveries`);
467
447
  }
468
- /**
469
- * Retry a failed webhook delivery
470
- */
471
- async retryDelivery(webhookId, deliveryId) {
472
- return this.http.post(`/v1/webhooks/${webhookId}/deliveries/${deliveryId}/retry`);
473
- }
474
448
  };
475
449
 
476
450
  // src/resources/broadcasts.ts
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "emailr",
3
- "version": "1.7.0",
3
+ "version": "1.7.2",
4
4
  "description": "Official Emailr API SDK for TypeScript/JavaScript",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.mjs",