emailr 1.7.0 → 1.7.1

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
@@ -407,7 +407,9 @@ interface Webhook {
407
407
  organization_id: string;
408
408
  name: string;
409
409
  url: string;
410
+ type: 'transactional' | 'domain' | 'receiving';
410
411
  events: string[];
412
+ inbox_ids: string[] | null;
411
413
  secret: string;
412
414
  active: boolean;
413
415
  created_by: string | null;
@@ -416,12 +418,8 @@ interface Webhook {
416
418
  interface CreateWebhookRequest {
417
419
  name: string;
418
420
  url: string;
419
- events: string[];
420
- }
421
- interface UpdateWebhookRequest {
422
- name?: string;
423
- url?: string;
424
- events?: string[];
421
+ type: 'transactional' | 'domain' | 'receiving';
422
+ inbox_ids?: string[];
425
423
  }
426
424
  interface WebhookToggleResponse {
427
425
  success: boolean;
@@ -438,10 +436,6 @@ interface WebhookDelivery {
438
436
  delivered_at: string | null;
439
437
  created_at: string;
440
438
  }
441
- interface ListWebhooksParams {
442
- page?: number;
443
- limit?: number;
444
- }
445
439
  interface Broadcast {
446
440
  id: string;
447
441
  organization_id: string;
@@ -868,39 +862,21 @@ declare class WebhooksResource {
868
862
  */
869
863
  create(data: CreateWebhookRequest): Promise<Webhook>;
870
864
  /**
871
- * Get webhook by ID
865
+ * List all webhooks
872
866
  */
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>;
867
+ list(): Promise<Webhook[]>;
882
868
  /**
883
869
  * Delete a webhook
884
870
  */
885
871
  delete(id: string): Promise<SuccessResponse>;
886
872
  /**
887
- * Enable a webhook
888
- */
889
- enable(id: string): Promise<WebhookToggleResponse>;
890
- /**
891
- * Disable a webhook
873
+ * Toggle a webhook's active state (enable/disable)
892
874
  */
893
- disable(id: string): Promise<WebhookToggleResponse>;
875
+ toggle(id: string): Promise<WebhookToggleResponse>;
894
876
  /**
895
877
  * List webhook deliveries
896
878
  */
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>;
879
+ listDeliveries(id: string): Promise<WebhookDelivery[]>;
904
880
  }
905
881
 
906
882
  declare class BroadcastsResource {
@@ -1350,4 +1326,4 @@ declare class ValidationError extends EmailrError {
1350
1326
  constructor(message: string, details?: Record<string, unknown>, requestId?: string);
1351
1327
  }
1352
1328
 
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 };
1329
+ 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
@@ -407,7 +407,9 @@ interface Webhook {
407
407
  organization_id: string;
408
408
  name: string;
409
409
  url: string;
410
+ type: 'transactional' | 'domain' | 'receiving';
410
411
  events: string[];
412
+ inbox_ids: string[] | null;
411
413
  secret: string;
412
414
  active: boolean;
413
415
  created_by: string | null;
@@ -416,12 +418,8 @@ interface Webhook {
416
418
  interface CreateWebhookRequest {
417
419
  name: string;
418
420
  url: string;
419
- events: string[];
420
- }
421
- interface UpdateWebhookRequest {
422
- name?: string;
423
- url?: string;
424
- events?: string[];
421
+ type: 'transactional' | 'domain' | 'receiving';
422
+ inbox_ids?: string[];
425
423
  }
426
424
  interface WebhookToggleResponse {
427
425
  success: boolean;
@@ -438,10 +436,6 @@ interface WebhookDelivery {
438
436
  delivered_at: string | null;
439
437
  created_at: string;
440
438
  }
441
- interface ListWebhooksParams {
442
- page?: number;
443
- limit?: number;
444
- }
445
439
  interface Broadcast {
446
440
  id: string;
447
441
  organization_id: string;
@@ -868,39 +862,21 @@ declare class WebhooksResource {
868
862
  */
869
863
  create(data: CreateWebhookRequest): Promise<Webhook>;
870
864
  /**
871
- * Get webhook by ID
865
+ * List all webhooks
872
866
  */
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>;
867
+ list(): Promise<Webhook[]>;
882
868
  /**
883
869
  * Delete a webhook
884
870
  */
885
871
  delete(id: string): Promise<SuccessResponse>;
886
872
  /**
887
- * Enable a webhook
888
- */
889
- enable(id: string): Promise<WebhookToggleResponse>;
890
- /**
891
- * Disable a webhook
873
+ * Toggle a webhook's active state (enable/disable)
892
874
  */
893
- disable(id: string): Promise<WebhookToggleResponse>;
875
+ toggle(id: string): Promise<WebhookToggleResponse>;
894
876
  /**
895
877
  * List webhook deliveries
896
878
  */
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>;
879
+ listDeliveries(id: string): Promise<WebhookDelivery[]>;
904
880
  }
905
881
 
906
882
  declare class BroadcastsResource {
@@ -1350,4 +1326,4 @@ declare class ValidationError extends EmailrError {
1350
1326
  constructor(message: string, details?: Record<string, unknown>, requestId?: string);
1351
1327
  }
1352
1328
 
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 };
1329
+ 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.1",
4
4
  "description": "Official Emailr API SDK for TypeScript/JavaScript",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.mjs",