resend 6.10.0-preview-workflows.0 → 6.10.0-preview-workflows.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.cjs CHANGED
@@ -31,7 +31,7 @@ postal_mime = __toESM(postal_mime);
31
31
  let svix = require("svix");
32
32
 
33
33
  //#region package.json
34
- var version = "6.10.0-preview-workflows.0";
34
+ var version = "6.10.0-preview-workflows.1";
35
35
 
36
36
  //#endregion
37
37
  //#region src/common/utils/build-pagination-query.ts
@@ -756,8 +756,8 @@ function parseWorkflowToApiOptions(workflow) {
756
756
  return {
757
757
  name: workflow.name,
758
758
  status: workflow.status,
759
- steps: workflow.steps?.map(parseStepConfig),
760
- edges: workflow.edges?.map(parseEdge)
759
+ steps: workflow.steps.map(parseStepConfig),
760
+ edges: workflow.edges.map(parseEdge)
761
761
  };
762
762
  }
763
763
  function parseWorkflowEventToApiOptions(event) {
@@ -999,11 +999,45 @@ var Webhooks = class {
999
999
  }
1000
1000
  };
1001
1001
 
1002
+ //#endregion
1003
+ //#region src/workflow-run-steps/workflow-run-steps.ts
1004
+ var WorkflowRunSteps = class {
1005
+ constructor(resend) {
1006
+ this.resend = resend;
1007
+ }
1008
+ async get(options) {
1009
+ return await this.resend.get(`/workflows/${options.workflowId}/runs/${options.runId}/steps/${options.stepId}`);
1010
+ }
1011
+ async list(options) {
1012
+ const queryString = buildPaginationQuery(options);
1013
+ const url = queryString ? `/workflows/${options.workflowId}/runs/${options.runId}/steps?${queryString}` : `/workflows/${options.workflowId}/runs/${options.runId}/steps`;
1014
+ return await this.resend.get(url);
1015
+ }
1016
+ };
1017
+
1018
+ //#endregion
1019
+ //#region src/workflow-runs/workflow-runs.ts
1020
+ var WorkflowRuns = class {
1021
+ constructor(resend) {
1022
+ this.resend = resend;
1023
+ this.steps = new WorkflowRunSteps(resend);
1024
+ }
1025
+ async get(options) {
1026
+ return await this.resend.get(`/workflows/${options.workflowId}/runs/${options.runId}`);
1027
+ }
1028
+ async list(options) {
1029
+ const queryString = buildPaginationQuery(options);
1030
+ const url = queryString ? `/workflows/${options.workflowId}/runs?${queryString}` : `/workflows/${options.workflowId}/runs`;
1031
+ return await this.resend.get(url);
1032
+ }
1033
+ };
1034
+
1002
1035
  //#endregion
1003
1036
  //#region src/workflows/workflows.ts
1004
1037
  var Workflows = class {
1005
1038
  constructor(resend) {
1006
1039
  this.resend = resend;
1040
+ this.runs = new WorkflowRuns(this.resend);
1007
1041
  }
1008
1042
  async create(payload) {
1009
1043
  return await this.resend.post("/workflows", parseWorkflowToApiOptions(payload));
package/dist/index.d.cts CHANGED
@@ -1119,7 +1119,6 @@ type ListReceivingEmailsResponse = {
1119
1119
  type EventSchemaType = 'string' | 'number' | 'boolean' | 'date';
1120
1120
  type EventSchemaMap = Record<string, EventSchemaType>;
1121
1121
  interface Event {
1122
- object: 'event';
1123
1122
  id: string;
1124
1123
  name: string;
1125
1124
  schema: EventSchemaMap | null;
@@ -1139,7 +1138,9 @@ interface CreateEventResponseSuccess {
1139
1138
  type CreateEventResponse = Response<CreateEventResponseSuccess>;
1140
1139
  //#endregion
1141
1140
  //#region src/events/interfaces/get-event.interface.d.ts
1142
- type GetEventResponseSuccess = Event;
1141
+ interface GetEventResponseSuccess extends Event {
1142
+ object: 'event';
1143
+ }
1143
1144
  type GetEventResponse = Response<GetEventResponseSuccess>;
1144
1145
  //#endregion
1145
1146
  //#region src/events/interfaces/list-events.interface.d.ts
@@ -1147,15 +1148,14 @@ type ListEventsOptions = PaginationOptions;
1147
1148
  interface ListEventsResponseSuccess {
1148
1149
  object: 'list';
1149
1150
  has_more: boolean;
1150
- data: Omit<Event, 'object'>[];
1151
+ data: Event[];
1151
1152
  }
1152
1153
  type ListEventsResponse = Response<ListEventsResponseSuccess>;
1153
1154
  //#endregion
1154
1155
  //#region src/events/interfaces/remove-event.interface.d.ts
1155
- interface RemoveEventResponseSuccess {
1156
+ interface RemoveEventResponseSuccess extends Pick<Event, 'id'> {
1156
1157
  object: 'event';
1157
- id: string;
1158
- deleted: true;
1158
+ deleted: boolean;
1159
1159
  }
1160
1160
  type RemoveEventResponse = Response<RemoveEventResponseSuccess>;
1161
1161
  //#endregion
@@ -1824,6 +1824,12 @@ type ConditionRule = {
1824
1824
  type: 'rule';
1825
1825
  field: string;
1826
1826
  operator: 'exists' | 'is_empty';
1827
+ } | {
1828
+ type: 'and';
1829
+ rules: ConditionRule[];
1830
+ } | {
1831
+ type: 'or';
1832
+ rules: ConditionRule[];
1827
1833
  };
1828
1834
  type TemplateVariableValue = string | number | boolean | {
1829
1835
  var: string;
@@ -1874,44 +1880,126 @@ interface WorkflowEdge {
1874
1880
  to: string;
1875
1881
  edgeType?: WorkflowEdgeType;
1876
1882
  }
1883
+ type WorkflowStepType = WorkflowStep['type'];
1877
1884
  interface WorkflowResponseStep {
1878
1885
  id: string;
1879
- type: string;
1880
- config: unknown;
1881
- ref?: string;
1886
+ type: WorkflowStepType;
1887
+ config: Record<string, unknown>;
1882
1888
  }
1883
1889
  interface WorkflowResponseEdge {
1884
1890
  id: string;
1885
1891
  from_step_id: string;
1886
1892
  to_step_id: string;
1887
- edge_type: string;
1893
+ edge_type: WorkflowEdgeType;
1888
1894
  }
1889
1895
  //#endregion
1890
- //#region src/workflows/interfaces/create-workflow-options.interface.d.ts
1891
- interface CreateWorkflowOptions {
1892
- name: string;
1893
- status?: 'enabled' | 'disabled';
1894
- steps: WorkflowStep[];
1895
- edges: WorkflowEdge[];
1896
+ //#region src/workflow-run-steps/interfaces/workflow-run-step.d.ts
1897
+ type WorkflowRunStepStatus = 'pending' | 'running' | 'completed' | 'failed' | 'skipped' | 'waiting';
1898
+ interface WorkflowRunStep {
1899
+ object: 'workflow_run_step';
1900
+ id: string;
1901
+ step_id: string;
1902
+ type: WorkflowStepType;
1903
+ config: Record<string, unknown>;
1904
+ status: WorkflowRunStepStatus;
1905
+ started_at: string | null;
1906
+ completed_at: string | null;
1907
+ created_at: string;
1896
1908
  }
1897
- interface CreateWorkflowResponseSuccess {
1898
- object: 'workflow';
1909
+ type WorkflowRunStepItem = Pick<WorkflowRunStep, 'id' | 'step_id' | 'type' | 'status' | 'started_at' | 'completed_at' | 'created_at'>;
1910
+ //#endregion
1911
+ //#region src/workflow-run-steps/interfaces/get-workflow-run-step.interface.d.ts
1912
+ interface GetWorkflowRunStepOptions {
1913
+ workflowId: string;
1914
+ runId: string;
1915
+ stepId: string;
1916
+ }
1917
+ type GetWorkflowRunStepResponseSuccess = WorkflowRunStep;
1918
+ type GetWorkflowRunStepResponse = Response<GetWorkflowRunStepResponseSuccess>;
1919
+ //#endregion
1920
+ //#region src/workflow-run-steps/interfaces/list-workflow-run-steps.interface.d.ts
1921
+ type ListWorkflowRunStepsOptions = PaginationOptions & {
1922
+ workflowId: string;
1923
+ runId: string;
1924
+ };
1925
+ type ListWorkflowRunStepsResponseSuccess = PaginatedData<WorkflowRunStepItem[]>;
1926
+ type ListWorkflowRunStepsResponse = Response<ListWorkflowRunStepsResponseSuccess>;
1927
+ //#endregion
1928
+ //#region src/workflow-run-steps/workflow-run-steps.d.ts
1929
+ declare class WorkflowRunSteps {
1930
+ private readonly resend;
1931
+ constructor(resend: Resend);
1932
+ get(options: GetWorkflowRunStepOptions): Promise<GetWorkflowRunStepResponse>;
1933
+ list(options: ListWorkflowRunStepsOptions): Promise<ListWorkflowRunStepsResponse>;
1934
+ }
1935
+ //#endregion
1936
+ //#region src/workflow-runs/interfaces/workflow-run.d.ts
1937
+ interface WorkflowRunTrigger {
1938
+ event_name: string;
1939
+ payload?: Record<string, unknown>;
1940
+ }
1941
+ type WorkflowRunStatus = 'running' | 'completed' | 'failed' | 'cancelled';
1942
+ interface WorkflowRun {
1943
+ object: 'workflow_run';
1899
1944
  id: string;
1945
+ status: WorkflowRunStatus;
1946
+ trigger: WorkflowRunTrigger | null;
1947
+ started_at: string | null;
1948
+ completed_at: string | null;
1949
+ created_at: string;
1950
+ }
1951
+ type WorkflowRunItem = Pick<WorkflowRun, 'id' | 'status' | 'trigger' | 'started_at' | 'completed_at' | 'created_at'>;
1952
+ //#endregion
1953
+ //#region src/workflow-runs/interfaces/get-workflow-run.interface.d.ts
1954
+ interface GetWorkflowRunOptions {
1955
+ workflowId: string;
1956
+ runId: string;
1957
+ }
1958
+ type GetWorkflowRunResponseSuccess = WorkflowRun;
1959
+ type GetWorkflowRunResponse = Response<GetWorkflowRunResponseSuccess>;
1960
+ //#endregion
1961
+ //#region src/workflow-runs/interfaces/list-workflow-runs.interface.d.ts
1962
+ type ListWorkflowRunsOptions = PaginationOptions & {
1963
+ workflowId: string;
1964
+ };
1965
+ type ListWorkflowRunsResponseSuccess = PaginatedData<WorkflowRunItem[]>;
1966
+ type ListWorkflowRunsResponse = Response<ListWorkflowRunsResponseSuccess>;
1967
+ //#endregion
1968
+ //#region src/workflow-runs/workflow-runs.d.ts
1969
+ declare class WorkflowRuns {
1970
+ private readonly resend;
1971
+ readonly steps: WorkflowRunSteps;
1972
+ constructor(resend: Resend);
1973
+ get(options: GetWorkflowRunOptions): Promise<GetWorkflowRunResponse>;
1974
+ list(options: ListWorkflowRunsOptions): Promise<ListWorkflowRunsResponse>;
1900
1975
  }
1901
- type CreateWorkflowResponse = Response<CreateWorkflowResponseSuccess>;
1902
1976
  //#endregion
1903
1977
  //#region src/workflows/interfaces/workflow.d.ts
1904
1978
  interface Workflow {
1905
- object: 'workflow';
1906
1979
  id: string;
1907
1980
  name: string;
1908
1981
  status: 'enabled' | 'disabled';
1909
1982
  created_at: string;
1910
1983
  updated_at: string | null;
1911
1984
  }
1985
+ type WorkflowStatus = Workflow['status'];
1986
+ //#endregion
1987
+ //#region src/workflows/interfaces/create-workflow-options.interface.d.ts
1988
+ interface CreateWorkflowOptions {
1989
+ name: string;
1990
+ status?: WorkflowStatus;
1991
+ steps: WorkflowStep[];
1992
+ edges: WorkflowEdge[];
1993
+ }
1994
+ interface CreateWorkflowResponseSuccess {
1995
+ object: 'workflow';
1996
+ id: string;
1997
+ }
1998
+ type CreateWorkflowResponse = Response<CreateWorkflowResponseSuccess>;
1912
1999
  //#endregion
1913
2000
  //#region src/workflows/interfaces/get-workflow.interface.d.ts
1914
2001
  interface GetWorkflowResponseSuccess extends Workflow {
2002
+ object: 'workflow';
1915
2003
  steps: WorkflowResponseStep[];
1916
2004
  edges: WorkflowResponseEdge[];
1917
2005
  }
@@ -1919,11 +2007,7 @@ type GetWorkflowResponse = Response<GetWorkflowResponseSuccess>;
1919
2007
  //#endregion
1920
2008
  //#region src/workflows/interfaces/list-workflows.interface.d.ts
1921
2009
  type ListWorkflowsOptions = PaginationOptions;
1922
- interface ListWorkflowsResponseSuccess {
1923
- object: 'list';
1924
- has_more: boolean;
1925
- data: Workflow[];
1926
- }
2010
+ type ListWorkflowsResponseSuccess = PaginatedData<Workflow[]>;
1927
2011
  type ListWorkflowsResponse = Response<ListWorkflowsResponseSuccess>;
1928
2012
  //#endregion
1929
2013
  //#region src/workflows/interfaces/remove-workflow.interface.d.ts
@@ -1935,18 +2019,17 @@ type RemoveWorkflowResponse = Response<RemoveWorkflowResponseSuccess>;
1935
2019
  //#endregion
1936
2020
  //#region src/workflows/interfaces/update-workflow.interface.d.ts
1937
2021
  interface UpdateWorkflowOptions {
1938
- status: 'enabled' | 'disabled';
2022
+ status: WorkflowStatus;
1939
2023
  }
1940
- interface UpdateWorkflowResponseSuccess {
2024
+ interface UpdateWorkflowResponseSuccess extends Pick<Workflow, 'id' | 'status'> {
1941
2025
  object: 'workflow';
1942
- id: string;
1943
- status: 'enabled' | 'disabled';
1944
2026
  }
1945
2027
  type UpdateWorkflowResponse = Response<UpdateWorkflowResponseSuccess>;
1946
2028
  //#endregion
1947
2029
  //#region src/workflows/workflows.d.ts
1948
2030
  declare class Workflows {
1949
2031
  private readonly resend;
2032
+ readonly runs: WorkflowRuns;
1950
2033
  constructor(resend: Resend);
1951
2034
  create(payload: CreateWorkflowOptions): Promise<CreateWorkflowResponse>;
1952
2035
  list(options?: ListWorkflowsOptions): Promise<ListWorkflowsResponse>;
@@ -1985,4 +2068,4 @@ declare class Resend {
1985
2068
  delete<T>(path: string, query?: unknown): Promise<Response<T>>;
1986
2069
  }
1987
2070
  //#endregion
1988
- export { AddContactSegmentOptions, AddContactSegmentResponse, AddContactSegmentResponseSuccess, ApiContactProperty, ApiKey, Attachment, AttachmentData, Broadcast, CancelEmailResponse, CancelEmailResponseSuccess, ConditionRule, ConditionStepConfig, Contact, ContactCreatedEvent, ContactDeletedEvent, ContactProperty, ContactSegmentsBaseOptions, ContactTopic, ContactUpdatedEvent, CreateApiKeyOptions, CreateApiKeyRequestOptions, CreateApiKeyResponse, CreateApiKeyResponseSuccess, CreateBatchEmailOptions, CreateBatchOptions, CreateBatchRequestOptions, CreateBatchResponse, CreateBatchSuccessResponse, CreateBroadcastOptions, CreateBroadcastRequestOptions, CreateBroadcastResponse, CreateBroadcastResponseSuccess, CreateContactOptions, CreateContactPropertyApiOptions, CreateContactPropertyOptions, CreateContactPropertyResponse, CreateContactPropertyResponseSuccess, CreateContactRequestOptions, CreateContactResponse, CreateContactResponseSuccess, CreateDomainOptions, CreateDomainRequestOptions, CreateDomainResponse, CreateDomainResponseSuccess, CreateEmailOptions, CreateEmailRequestOptions, CreateEmailResponse, CreateEmailResponseSuccess, CreateEventOptions, CreateEventResponse, CreateEventResponseSuccess, CreateSegmentOptions, CreateSegmentRequestOptions, CreateSegmentResponse, CreateSegmentResponseSuccess, CreateTemplateOptions, CreateTemplateRequestOptions, CreateTemplateResponse, CreateTemplateResponseSuccess, CreateTopicOptions, CreateTopicResponse, CreateTopicResponseSuccess, CreateWebhookOptions, CreateWebhookRequestOptions, CreateWebhookResponse, CreateWebhookResponseSuccess, CreateWorkflowOptions, CreateWorkflowResponse, CreateWorkflowResponseSuccess, DelayStepConfig, Domain, DomainApiOptions, DomainCapabilities, DomainCapabilityStatus, DomainCreatedEvent, DomainDeletedEvent, DomainDkimRecord, DomainNameservers, DomainRecords, DomainRegion, DomainSpfRecord, DomainStatus, DomainUpdatedEvent, DuplicateTemplateResponse, DuplicateTemplateResponseSuccess, EmailApiAttachment, EmailApiOptions, EmailBouncedEvent, EmailClickedEvent, EmailComplainedEvent, EmailDeliveredEvent, EmailDeliveryDelayedEvent, EmailFailedEvent, EmailOpenedEvent, EmailReceivedEvent, EmailScheduledEvent, EmailSentEvent, EmailSuppressedEvent, type ErrorResponse, Event, EventSchemaMap, EventSchemaType, ForwardReceivingEmailOptions, ForwardReceivingEmailResponse, ForwardReceivingEmailResponseSuccess, GetAttachmentOptions, GetAttachmentResponse, GetAttachmentResponseSuccess, GetBroadcastResponse, GetBroadcastResponseSuccess, GetContactOptions, GetContactPropertyResponse, GetContactPropertyResponseSuccess, GetContactResponse, GetContactResponseSuccess, GetDomainResponse, GetDomainResponseSuccess, GetEmailResponse, GetEmailResponseSuccess, GetEventResponse, GetEventResponseSuccess, GetOptions, GetReceivingEmailResponse, GetReceivingEmailResponseSuccess, GetSegmentResponse, GetSegmentResponseSuccess, GetTemplateResponse, GetTemplateResponseSuccess, GetTopicOptions, GetTopicResponse, GetTopicResponseSuccess, GetWebhookResponse, GetWebhookResponseSuccess, GetWorkflowResponse, GetWorkflowResponseSuccess, IdempotentRequest, InboundAttachment, LegacyCreateContactOptions, ListApiKeysOptions, ListApiKeysResponse, ListApiKeysResponseSuccess, ListAttachmentsOptions, ListAttachmentsResponse, ListAttachmentsResponseSuccess, ListBroadcastsOptions, ListBroadcastsResponse, ListBroadcastsResponseSuccess, ListContactPropertiesOptions, ListContactPropertiesResponse, ListContactPropertiesResponseSuccess, ListContactSegmentsOptions, ListContactSegmentsResponse, ListContactSegmentsResponseSuccess, ListContactTopicsOptions, ListContactTopicsRequestOptions, ListContactTopicsResponse, ListContactTopicsResponseSuccess, ListContactsOptions, ListContactsResponse, ListContactsResponseSuccess, ListDomainsOptions, ListDomainsResponse, ListDomainsResponseSuccess, ListEmail, ListEmailsOptions, ListEmailsResponse, ListEmailsResponseSuccess, ListEventsOptions, ListEventsResponse, ListEventsResponseSuccess, ListReceivingEmail, ListReceivingEmailsOptions, ListReceivingEmailsResponse, ListReceivingEmailsResponseSuccess, ListSegmentsOptions, ListSegmentsResponse, ListSegmentsResponseSuccess, ListTemplatesOptions, ListTemplatesResponse, ListTemplatesResponseSuccess, ListTopicsResponse, ListTopicsResponseSuccess, ListWebhooksOptions, ListWebhooksResponse, ListWebhooksResponseSuccess, ListWorkflowsOptions, ListWorkflowsResponse, ListWorkflowsResponseSuccess, PaginatedData, PaginationOptions, PatchOptions, PostOptions, PublishTemplateResponse, PublishTemplateResponseSuccess, PutOptions, ReceivingRecord, RemoveApiKeyResponse, RemoveApiKeyResponseSuccess, RemoveBroadcastResponse, RemoveBroadcastResponseSuccess, RemoveContactOptions, RemoveContactPropertyResponse, RemoveContactPropertyResponseSuccess, RemoveContactSegmentOptions, RemoveContactSegmentResponse, RemoveContactSegmentResponseSuccess, RemoveContactsResponse, RemoveContactsResponseSuccess, RemoveDomainsResponse, RemoveDomainsResponseSuccess, RemoveEventResponse, RemoveEventResponseSuccess, RemoveSegmentResponse, RemoveSegmentResponseSuccess, RemoveTemplateResponse, RemoveTemplateResponseSuccess, RemoveTopicResponse, RemoveTopicResponseSuccess, RemoveWebhookResponse, RemoveWebhookResponseSuccess, RemoveWorkflowResponse, RemoveWorkflowResponseSuccess, RequireAtLeastOne, Resend, type Response, Segment, SelectingField, SendBroadcastOptions, SendBroadcastRequestOptions, SendBroadcastResponse, SendBroadcastResponseSuccess, SendEmailStepConfig, SendEventOptions, SendEventResponse, SendEventResponseSuccess, Tag, Template, TemplateVariable, TemplateVariableValue, Topic, TriggerStepConfig, UpdateBroadcastOptions, UpdateBroadcastResponse, UpdateBroadcastResponseSuccess, UpdateContactOptions, UpdateContactPropertyApiOptions, UpdateContactPropertyOptions, UpdateContactPropertyResponse, UpdateContactPropertyResponseSuccess, UpdateContactResponse, UpdateContactResponseSuccess, UpdateContactTopicsOptions, UpdateContactTopicsRequestOptions, UpdateContactTopicsResponse, UpdateContactTopicsResponseSuccess, UpdateDomainsOptions, UpdateDomainsResponse, UpdateDomainsResponseSuccess, UpdateEmailOptions, UpdateEmailResponse, UpdateEmailResponseSuccess, UpdateEventOptions, UpdateEventResponse, UpdateEventResponseSuccess, UpdateTemplateOptions, UpdateTemplateResponse, UpdateTemplateResponseSuccess, UpdateTopicOptions, UpdateTopicResponse, UpdateTopicResponseSuccess, UpdateWebhookOptions, UpdateWebhookResponse, UpdateWebhookResponseSuccess, UpdateWorkflowOptions, UpdateWorkflowResponse, UpdateWorkflowResponseSuccess, VerifyDomainsResponse, VerifyDomainsResponseSuccess, WaitForEventStepConfig, Webhook, WebhookEvent, WebhookEventPayload, Workflow, WorkflowEdge, WorkflowEdgeType, WorkflowResponseEdge, WorkflowResponseStep, WorkflowStep };
2071
+ export { AddContactSegmentOptions, AddContactSegmentResponse, AddContactSegmentResponseSuccess, ApiContactProperty, ApiKey, Attachment, AttachmentData, Broadcast, CancelEmailResponse, CancelEmailResponseSuccess, ConditionRule, ConditionStepConfig, Contact, ContactCreatedEvent, ContactDeletedEvent, ContactProperty, ContactSegmentsBaseOptions, ContactTopic, ContactUpdatedEvent, CreateApiKeyOptions, CreateApiKeyRequestOptions, CreateApiKeyResponse, CreateApiKeyResponseSuccess, CreateBatchEmailOptions, CreateBatchOptions, CreateBatchRequestOptions, CreateBatchResponse, CreateBatchSuccessResponse, CreateBroadcastOptions, CreateBroadcastRequestOptions, CreateBroadcastResponse, CreateBroadcastResponseSuccess, CreateContactOptions, CreateContactPropertyApiOptions, CreateContactPropertyOptions, CreateContactPropertyResponse, CreateContactPropertyResponseSuccess, CreateContactRequestOptions, CreateContactResponse, CreateContactResponseSuccess, CreateDomainOptions, CreateDomainRequestOptions, CreateDomainResponse, CreateDomainResponseSuccess, CreateEmailOptions, CreateEmailRequestOptions, CreateEmailResponse, CreateEmailResponseSuccess, CreateEventOptions, CreateEventResponse, CreateEventResponseSuccess, CreateSegmentOptions, CreateSegmentRequestOptions, CreateSegmentResponse, CreateSegmentResponseSuccess, CreateTemplateOptions, CreateTemplateRequestOptions, CreateTemplateResponse, CreateTemplateResponseSuccess, CreateTopicOptions, CreateTopicResponse, CreateTopicResponseSuccess, CreateWebhookOptions, CreateWebhookRequestOptions, CreateWebhookResponse, CreateWebhookResponseSuccess, CreateWorkflowOptions, CreateWorkflowResponse, CreateWorkflowResponseSuccess, DelayStepConfig, Domain, DomainApiOptions, DomainCapabilities, DomainCapabilityStatus, DomainCreatedEvent, DomainDeletedEvent, DomainDkimRecord, DomainNameservers, DomainRecords, DomainRegion, DomainSpfRecord, DomainStatus, DomainUpdatedEvent, DuplicateTemplateResponse, DuplicateTemplateResponseSuccess, EmailApiAttachment, EmailApiOptions, EmailBouncedEvent, EmailClickedEvent, EmailComplainedEvent, EmailDeliveredEvent, EmailDeliveryDelayedEvent, EmailFailedEvent, EmailOpenedEvent, EmailReceivedEvent, EmailScheduledEvent, EmailSentEvent, EmailSuppressedEvent, type ErrorResponse, Event, EventSchemaMap, EventSchemaType, ForwardReceivingEmailOptions, ForwardReceivingEmailResponse, ForwardReceivingEmailResponseSuccess, GetAttachmentOptions, GetAttachmentResponse, GetAttachmentResponseSuccess, GetBroadcastResponse, GetBroadcastResponseSuccess, GetContactOptions, GetContactPropertyResponse, GetContactPropertyResponseSuccess, GetContactResponse, GetContactResponseSuccess, GetDomainResponse, GetDomainResponseSuccess, GetEmailResponse, GetEmailResponseSuccess, GetEventResponse, GetEventResponseSuccess, GetOptions, GetReceivingEmailResponse, GetReceivingEmailResponseSuccess, GetSegmentResponse, GetSegmentResponseSuccess, GetTemplateResponse, GetTemplateResponseSuccess, GetTopicOptions, GetTopicResponse, GetTopicResponseSuccess, GetWebhookResponse, GetWebhookResponseSuccess, GetWorkflowResponse, GetWorkflowResponseSuccess, GetWorkflowRunOptions, GetWorkflowRunResponse, GetWorkflowRunResponseSuccess, GetWorkflowRunStepOptions, GetWorkflowRunStepResponse, GetWorkflowRunStepResponseSuccess, IdempotentRequest, InboundAttachment, LegacyCreateContactOptions, ListApiKeysOptions, ListApiKeysResponse, ListApiKeysResponseSuccess, ListAttachmentsOptions, ListAttachmentsResponse, ListAttachmentsResponseSuccess, ListBroadcastsOptions, ListBroadcastsResponse, ListBroadcastsResponseSuccess, ListContactPropertiesOptions, ListContactPropertiesResponse, ListContactPropertiesResponseSuccess, ListContactSegmentsOptions, ListContactSegmentsResponse, ListContactSegmentsResponseSuccess, ListContactTopicsOptions, ListContactTopicsRequestOptions, ListContactTopicsResponse, ListContactTopicsResponseSuccess, ListContactsOptions, ListContactsResponse, ListContactsResponseSuccess, ListDomainsOptions, ListDomainsResponse, ListDomainsResponseSuccess, ListEmail, ListEmailsOptions, ListEmailsResponse, ListEmailsResponseSuccess, ListEventsOptions, ListEventsResponse, ListEventsResponseSuccess, ListReceivingEmail, ListReceivingEmailsOptions, ListReceivingEmailsResponse, ListReceivingEmailsResponseSuccess, ListSegmentsOptions, ListSegmentsResponse, ListSegmentsResponseSuccess, ListTemplatesOptions, ListTemplatesResponse, ListTemplatesResponseSuccess, ListTopicsResponse, ListTopicsResponseSuccess, ListWebhooksOptions, ListWebhooksResponse, ListWebhooksResponseSuccess, ListWorkflowRunStepsOptions, ListWorkflowRunStepsResponse, ListWorkflowRunStepsResponseSuccess, ListWorkflowRunsOptions, ListWorkflowRunsResponse, ListWorkflowRunsResponseSuccess, ListWorkflowsOptions, ListWorkflowsResponse, ListWorkflowsResponseSuccess, PaginatedData, PaginationOptions, PatchOptions, PostOptions, PublishTemplateResponse, PublishTemplateResponseSuccess, PutOptions, ReceivingRecord, RemoveApiKeyResponse, RemoveApiKeyResponseSuccess, RemoveBroadcastResponse, RemoveBroadcastResponseSuccess, RemoveContactOptions, RemoveContactPropertyResponse, RemoveContactPropertyResponseSuccess, RemoveContactSegmentOptions, RemoveContactSegmentResponse, RemoveContactSegmentResponseSuccess, RemoveContactsResponse, RemoveContactsResponseSuccess, RemoveDomainsResponse, RemoveDomainsResponseSuccess, RemoveEventResponse, RemoveEventResponseSuccess, RemoveSegmentResponse, RemoveSegmentResponseSuccess, RemoveTemplateResponse, RemoveTemplateResponseSuccess, RemoveTopicResponse, RemoveTopicResponseSuccess, RemoveWebhookResponse, RemoveWebhookResponseSuccess, RemoveWorkflowResponse, RemoveWorkflowResponseSuccess, RequireAtLeastOne, Resend, type Response, Segment, SelectingField, SendBroadcastOptions, SendBroadcastRequestOptions, SendBroadcastResponse, SendBroadcastResponseSuccess, SendEmailStepConfig, SendEventOptions, SendEventResponse, SendEventResponseSuccess, Tag, Template, TemplateVariable, TemplateVariableValue, Topic, TriggerStepConfig, UpdateBroadcastOptions, UpdateBroadcastResponse, UpdateBroadcastResponseSuccess, UpdateContactOptions, UpdateContactPropertyApiOptions, UpdateContactPropertyOptions, UpdateContactPropertyResponse, UpdateContactPropertyResponseSuccess, UpdateContactResponse, UpdateContactResponseSuccess, UpdateContactTopicsOptions, UpdateContactTopicsRequestOptions, UpdateContactTopicsResponse, UpdateContactTopicsResponseSuccess, UpdateDomainsOptions, UpdateDomainsResponse, UpdateDomainsResponseSuccess, UpdateEmailOptions, UpdateEmailResponse, UpdateEmailResponseSuccess, UpdateEventOptions, UpdateEventResponse, UpdateEventResponseSuccess, UpdateTemplateOptions, UpdateTemplateResponse, UpdateTemplateResponseSuccess, UpdateTopicOptions, UpdateTopicResponse, UpdateTopicResponseSuccess, UpdateWebhookOptions, UpdateWebhookResponse, UpdateWebhookResponseSuccess, UpdateWorkflowOptions, UpdateWorkflowResponse, UpdateWorkflowResponseSuccess, VerifyDomainsResponse, VerifyDomainsResponseSuccess, WaitForEventStepConfig, Webhook, WebhookEvent, WebhookEventPayload, Workflow, WorkflowEdge, WorkflowEdgeType, WorkflowResponseEdge, WorkflowResponseStep, WorkflowRun, WorkflowRunItem, WorkflowRunStatus, WorkflowRunStep, WorkflowRunStepItem, WorkflowRunStepStatus, WorkflowRunTrigger, WorkflowStatus, WorkflowStep, WorkflowStepType };
package/dist/index.d.mts CHANGED
@@ -1119,7 +1119,6 @@ type ListReceivingEmailsResponse = {
1119
1119
  type EventSchemaType = 'string' | 'number' | 'boolean' | 'date';
1120
1120
  type EventSchemaMap = Record<string, EventSchemaType>;
1121
1121
  interface Event {
1122
- object: 'event';
1123
1122
  id: string;
1124
1123
  name: string;
1125
1124
  schema: EventSchemaMap | null;
@@ -1139,7 +1138,9 @@ interface CreateEventResponseSuccess {
1139
1138
  type CreateEventResponse = Response<CreateEventResponseSuccess>;
1140
1139
  //#endregion
1141
1140
  //#region src/events/interfaces/get-event.interface.d.ts
1142
- type GetEventResponseSuccess = Event;
1141
+ interface GetEventResponseSuccess extends Event {
1142
+ object: 'event';
1143
+ }
1143
1144
  type GetEventResponse = Response<GetEventResponseSuccess>;
1144
1145
  //#endregion
1145
1146
  //#region src/events/interfaces/list-events.interface.d.ts
@@ -1147,15 +1148,14 @@ type ListEventsOptions = PaginationOptions;
1147
1148
  interface ListEventsResponseSuccess {
1148
1149
  object: 'list';
1149
1150
  has_more: boolean;
1150
- data: Omit<Event, 'object'>[];
1151
+ data: Event[];
1151
1152
  }
1152
1153
  type ListEventsResponse = Response<ListEventsResponseSuccess>;
1153
1154
  //#endregion
1154
1155
  //#region src/events/interfaces/remove-event.interface.d.ts
1155
- interface RemoveEventResponseSuccess {
1156
+ interface RemoveEventResponseSuccess extends Pick<Event, 'id'> {
1156
1157
  object: 'event';
1157
- id: string;
1158
- deleted: true;
1158
+ deleted: boolean;
1159
1159
  }
1160
1160
  type RemoveEventResponse = Response<RemoveEventResponseSuccess>;
1161
1161
  //#endregion
@@ -1824,6 +1824,12 @@ type ConditionRule = {
1824
1824
  type: 'rule';
1825
1825
  field: string;
1826
1826
  operator: 'exists' | 'is_empty';
1827
+ } | {
1828
+ type: 'and';
1829
+ rules: ConditionRule[];
1830
+ } | {
1831
+ type: 'or';
1832
+ rules: ConditionRule[];
1827
1833
  };
1828
1834
  type TemplateVariableValue = string | number | boolean | {
1829
1835
  var: string;
@@ -1874,44 +1880,126 @@ interface WorkflowEdge {
1874
1880
  to: string;
1875
1881
  edgeType?: WorkflowEdgeType;
1876
1882
  }
1883
+ type WorkflowStepType = WorkflowStep['type'];
1877
1884
  interface WorkflowResponseStep {
1878
1885
  id: string;
1879
- type: string;
1880
- config: unknown;
1881
- ref?: string;
1886
+ type: WorkflowStepType;
1887
+ config: Record<string, unknown>;
1882
1888
  }
1883
1889
  interface WorkflowResponseEdge {
1884
1890
  id: string;
1885
1891
  from_step_id: string;
1886
1892
  to_step_id: string;
1887
- edge_type: string;
1893
+ edge_type: WorkflowEdgeType;
1888
1894
  }
1889
1895
  //#endregion
1890
- //#region src/workflows/interfaces/create-workflow-options.interface.d.ts
1891
- interface CreateWorkflowOptions {
1892
- name: string;
1893
- status?: 'enabled' | 'disabled';
1894
- steps: WorkflowStep[];
1895
- edges: WorkflowEdge[];
1896
+ //#region src/workflow-run-steps/interfaces/workflow-run-step.d.ts
1897
+ type WorkflowRunStepStatus = 'pending' | 'running' | 'completed' | 'failed' | 'skipped' | 'waiting';
1898
+ interface WorkflowRunStep {
1899
+ object: 'workflow_run_step';
1900
+ id: string;
1901
+ step_id: string;
1902
+ type: WorkflowStepType;
1903
+ config: Record<string, unknown>;
1904
+ status: WorkflowRunStepStatus;
1905
+ started_at: string | null;
1906
+ completed_at: string | null;
1907
+ created_at: string;
1896
1908
  }
1897
- interface CreateWorkflowResponseSuccess {
1898
- object: 'workflow';
1909
+ type WorkflowRunStepItem = Pick<WorkflowRunStep, 'id' | 'step_id' | 'type' | 'status' | 'started_at' | 'completed_at' | 'created_at'>;
1910
+ //#endregion
1911
+ //#region src/workflow-run-steps/interfaces/get-workflow-run-step.interface.d.ts
1912
+ interface GetWorkflowRunStepOptions {
1913
+ workflowId: string;
1914
+ runId: string;
1915
+ stepId: string;
1916
+ }
1917
+ type GetWorkflowRunStepResponseSuccess = WorkflowRunStep;
1918
+ type GetWorkflowRunStepResponse = Response<GetWorkflowRunStepResponseSuccess>;
1919
+ //#endregion
1920
+ //#region src/workflow-run-steps/interfaces/list-workflow-run-steps.interface.d.ts
1921
+ type ListWorkflowRunStepsOptions = PaginationOptions & {
1922
+ workflowId: string;
1923
+ runId: string;
1924
+ };
1925
+ type ListWorkflowRunStepsResponseSuccess = PaginatedData<WorkflowRunStepItem[]>;
1926
+ type ListWorkflowRunStepsResponse = Response<ListWorkflowRunStepsResponseSuccess>;
1927
+ //#endregion
1928
+ //#region src/workflow-run-steps/workflow-run-steps.d.ts
1929
+ declare class WorkflowRunSteps {
1930
+ private readonly resend;
1931
+ constructor(resend: Resend);
1932
+ get(options: GetWorkflowRunStepOptions): Promise<GetWorkflowRunStepResponse>;
1933
+ list(options: ListWorkflowRunStepsOptions): Promise<ListWorkflowRunStepsResponse>;
1934
+ }
1935
+ //#endregion
1936
+ //#region src/workflow-runs/interfaces/workflow-run.d.ts
1937
+ interface WorkflowRunTrigger {
1938
+ event_name: string;
1939
+ payload?: Record<string, unknown>;
1940
+ }
1941
+ type WorkflowRunStatus = 'running' | 'completed' | 'failed' | 'cancelled';
1942
+ interface WorkflowRun {
1943
+ object: 'workflow_run';
1899
1944
  id: string;
1945
+ status: WorkflowRunStatus;
1946
+ trigger: WorkflowRunTrigger | null;
1947
+ started_at: string | null;
1948
+ completed_at: string | null;
1949
+ created_at: string;
1950
+ }
1951
+ type WorkflowRunItem = Pick<WorkflowRun, 'id' | 'status' | 'trigger' | 'started_at' | 'completed_at' | 'created_at'>;
1952
+ //#endregion
1953
+ //#region src/workflow-runs/interfaces/get-workflow-run.interface.d.ts
1954
+ interface GetWorkflowRunOptions {
1955
+ workflowId: string;
1956
+ runId: string;
1957
+ }
1958
+ type GetWorkflowRunResponseSuccess = WorkflowRun;
1959
+ type GetWorkflowRunResponse = Response<GetWorkflowRunResponseSuccess>;
1960
+ //#endregion
1961
+ //#region src/workflow-runs/interfaces/list-workflow-runs.interface.d.ts
1962
+ type ListWorkflowRunsOptions = PaginationOptions & {
1963
+ workflowId: string;
1964
+ };
1965
+ type ListWorkflowRunsResponseSuccess = PaginatedData<WorkflowRunItem[]>;
1966
+ type ListWorkflowRunsResponse = Response<ListWorkflowRunsResponseSuccess>;
1967
+ //#endregion
1968
+ //#region src/workflow-runs/workflow-runs.d.ts
1969
+ declare class WorkflowRuns {
1970
+ private readonly resend;
1971
+ readonly steps: WorkflowRunSteps;
1972
+ constructor(resend: Resend);
1973
+ get(options: GetWorkflowRunOptions): Promise<GetWorkflowRunResponse>;
1974
+ list(options: ListWorkflowRunsOptions): Promise<ListWorkflowRunsResponse>;
1900
1975
  }
1901
- type CreateWorkflowResponse = Response<CreateWorkflowResponseSuccess>;
1902
1976
  //#endregion
1903
1977
  //#region src/workflows/interfaces/workflow.d.ts
1904
1978
  interface Workflow {
1905
- object: 'workflow';
1906
1979
  id: string;
1907
1980
  name: string;
1908
1981
  status: 'enabled' | 'disabled';
1909
1982
  created_at: string;
1910
1983
  updated_at: string | null;
1911
1984
  }
1985
+ type WorkflowStatus = Workflow['status'];
1986
+ //#endregion
1987
+ //#region src/workflows/interfaces/create-workflow-options.interface.d.ts
1988
+ interface CreateWorkflowOptions {
1989
+ name: string;
1990
+ status?: WorkflowStatus;
1991
+ steps: WorkflowStep[];
1992
+ edges: WorkflowEdge[];
1993
+ }
1994
+ interface CreateWorkflowResponseSuccess {
1995
+ object: 'workflow';
1996
+ id: string;
1997
+ }
1998
+ type CreateWorkflowResponse = Response<CreateWorkflowResponseSuccess>;
1912
1999
  //#endregion
1913
2000
  //#region src/workflows/interfaces/get-workflow.interface.d.ts
1914
2001
  interface GetWorkflowResponseSuccess extends Workflow {
2002
+ object: 'workflow';
1915
2003
  steps: WorkflowResponseStep[];
1916
2004
  edges: WorkflowResponseEdge[];
1917
2005
  }
@@ -1919,11 +2007,7 @@ type GetWorkflowResponse = Response<GetWorkflowResponseSuccess>;
1919
2007
  //#endregion
1920
2008
  //#region src/workflows/interfaces/list-workflows.interface.d.ts
1921
2009
  type ListWorkflowsOptions = PaginationOptions;
1922
- interface ListWorkflowsResponseSuccess {
1923
- object: 'list';
1924
- has_more: boolean;
1925
- data: Workflow[];
1926
- }
2010
+ type ListWorkflowsResponseSuccess = PaginatedData<Workflow[]>;
1927
2011
  type ListWorkflowsResponse = Response<ListWorkflowsResponseSuccess>;
1928
2012
  //#endregion
1929
2013
  //#region src/workflows/interfaces/remove-workflow.interface.d.ts
@@ -1935,18 +2019,17 @@ type RemoveWorkflowResponse = Response<RemoveWorkflowResponseSuccess>;
1935
2019
  //#endregion
1936
2020
  //#region src/workflows/interfaces/update-workflow.interface.d.ts
1937
2021
  interface UpdateWorkflowOptions {
1938
- status: 'enabled' | 'disabled';
2022
+ status: WorkflowStatus;
1939
2023
  }
1940
- interface UpdateWorkflowResponseSuccess {
2024
+ interface UpdateWorkflowResponseSuccess extends Pick<Workflow, 'id' | 'status'> {
1941
2025
  object: 'workflow';
1942
- id: string;
1943
- status: 'enabled' | 'disabled';
1944
2026
  }
1945
2027
  type UpdateWorkflowResponse = Response<UpdateWorkflowResponseSuccess>;
1946
2028
  //#endregion
1947
2029
  //#region src/workflows/workflows.d.ts
1948
2030
  declare class Workflows {
1949
2031
  private readonly resend;
2032
+ readonly runs: WorkflowRuns;
1950
2033
  constructor(resend: Resend);
1951
2034
  create(payload: CreateWorkflowOptions): Promise<CreateWorkflowResponse>;
1952
2035
  list(options?: ListWorkflowsOptions): Promise<ListWorkflowsResponse>;
@@ -1985,4 +2068,4 @@ declare class Resend {
1985
2068
  delete<T>(path: string, query?: unknown): Promise<Response<T>>;
1986
2069
  }
1987
2070
  //#endregion
1988
- export { AddContactSegmentOptions, AddContactSegmentResponse, AddContactSegmentResponseSuccess, ApiContactProperty, ApiKey, Attachment, AttachmentData, Broadcast, CancelEmailResponse, CancelEmailResponseSuccess, ConditionRule, ConditionStepConfig, Contact, ContactCreatedEvent, ContactDeletedEvent, ContactProperty, ContactSegmentsBaseOptions, ContactTopic, ContactUpdatedEvent, CreateApiKeyOptions, CreateApiKeyRequestOptions, CreateApiKeyResponse, CreateApiKeyResponseSuccess, CreateBatchEmailOptions, CreateBatchOptions, CreateBatchRequestOptions, CreateBatchResponse, CreateBatchSuccessResponse, CreateBroadcastOptions, CreateBroadcastRequestOptions, CreateBroadcastResponse, CreateBroadcastResponseSuccess, CreateContactOptions, CreateContactPropertyApiOptions, CreateContactPropertyOptions, CreateContactPropertyResponse, CreateContactPropertyResponseSuccess, CreateContactRequestOptions, CreateContactResponse, CreateContactResponseSuccess, CreateDomainOptions, CreateDomainRequestOptions, CreateDomainResponse, CreateDomainResponseSuccess, CreateEmailOptions, CreateEmailRequestOptions, CreateEmailResponse, CreateEmailResponseSuccess, CreateEventOptions, CreateEventResponse, CreateEventResponseSuccess, CreateSegmentOptions, CreateSegmentRequestOptions, CreateSegmentResponse, CreateSegmentResponseSuccess, CreateTemplateOptions, CreateTemplateRequestOptions, CreateTemplateResponse, CreateTemplateResponseSuccess, CreateTopicOptions, CreateTopicResponse, CreateTopicResponseSuccess, CreateWebhookOptions, CreateWebhookRequestOptions, CreateWebhookResponse, CreateWebhookResponseSuccess, CreateWorkflowOptions, CreateWorkflowResponse, CreateWorkflowResponseSuccess, DelayStepConfig, Domain, DomainApiOptions, DomainCapabilities, DomainCapabilityStatus, DomainCreatedEvent, DomainDeletedEvent, DomainDkimRecord, DomainNameservers, DomainRecords, DomainRegion, DomainSpfRecord, DomainStatus, DomainUpdatedEvent, DuplicateTemplateResponse, DuplicateTemplateResponseSuccess, EmailApiAttachment, EmailApiOptions, EmailBouncedEvent, EmailClickedEvent, EmailComplainedEvent, EmailDeliveredEvent, EmailDeliveryDelayedEvent, EmailFailedEvent, EmailOpenedEvent, EmailReceivedEvent, EmailScheduledEvent, EmailSentEvent, EmailSuppressedEvent, type ErrorResponse, Event, EventSchemaMap, EventSchemaType, ForwardReceivingEmailOptions, ForwardReceivingEmailResponse, ForwardReceivingEmailResponseSuccess, GetAttachmentOptions, GetAttachmentResponse, GetAttachmentResponseSuccess, GetBroadcastResponse, GetBroadcastResponseSuccess, GetContactOptions, GetContactPropertyResponse, GetContactPropertyResponseSuccess, GetContactResponse, GetContactResponseSuccess, GetDomainResponse, GetDomainResponseSuccess, GetEmailResponse, GetEmailResponseSuccess, GetEventResponse, GetEventResponseSuccess, GetOptions, GetReceivingEmailResponse, GetReceivingEmailResponseSuccess, GetSegmentResponse, GetSegmentResponseSuccess, GetTemplateResponse, GetTemplateResponseSuccess, GetTopicOptions, GetTopicResponse, GetTopicResponseSuccess, GetWebhookResponse, GetWebhookResponseSuccess, GetWorkflowResponse, GetWorkflowResponseSuccess, IdempotentRequest, InboundAttachment, LegacyCreateContactOptions, ListApiKeysOptions, ListApiKeysResponse, ListApiKeysResponseSuccess, ListAttachmentsOptions, ListAttachmentsResponse, ListAttachmentsResponseSuccess, ListBroadcastsOptions, ListBroadcastsResponse, ListBroadcastsResponseSuccess, ListContactPropertiesOptions, ListContactPropertiesResponse, ListContactPropertiesResponseSuccess, ListContactSegmentsOptions, ListContactSegmentsResponse, ListContactSegmentsResponseSuccess, ListContactTopicsOptions, ListContactTopicsRequestOptions, ListContactTopicsResponse, ListContactTopicsResponseSuccess, ListContactsOptions, ListContactsResponse, ListContactsResponseSuccess, ListDomainsOptions, ListDomainsResponse, ListDomainsResponseSuccess, ListEmail, ListEmailsOptions, ListEmailsResponse, ListEmailsResponseSuccess, ListEventsOptions, ListEventsResponse, ListEventsResponseSuccess, ListReceivingEmail, ListReceivingEmailsOptions, ListReceivingEmailsResponse, ListReceivingEmailsResponseSuccess, ListSegmentsOptions, ListSegmentsResponse, ListSegmentsResponseSuccess, ListTemplatesOptions, ListTemplatesResponse, ListTemplatesResponseSuccess, ListTopicsResponse, ListTopicsResponseSuccess, ListWebhooksOptions, ListWebhooksResponse, ListWebhooksResponseSuccess, ListWorkflowsOptions, ListWorkflowsResponse, ListWorkflowsResponseSuccess, PaginatedData, PaginationOptions, PatchOptions, PostOptions, PublishTemplateResponse, PublishTemplateResponseSuccess, PutOptions, ReceivingRecord, RemoveApiKeyResponse, RemoveApiKeyResponseSuccess, RemoveBroadcastResponse, RemoveBroadcastResponseSuccess, RemoveContactOptions, RemoveContactPropertyResponse, RemoveContactPropertyResponseSuccess, RemoveContactSegmentOptions, RemoveContactSegmentResponse, RemoveContactSegmentResponseSuccess, RemoveContactsResponse, RemoveContactsResponseSuccess, RemoveDomainsResponse, RemoveDomainsResponseSuccess, RemoveEventResponse, RemoveEventResponseSuccess, RemoveSegmentResponse, RemoveSegmentResponseSuccess, RemoveTemplateResponse, RemoveTemplateResponseSuccess, RemoveTopicResponse, RemoveTopicResponseSuccess, RemoveWebhookResponse, RemoveWebhookResponseSuccess, RemoveWorkflowResponse, RemoveWorkflowResponseSuccess, RequireAtLeastOne, Resend, type Response, Segment, SelectingField, SendBroadcastOptions, SendBroadcastRequestOptions, SendBroadcastResponse, SendBroadcastResponseSuccess, SendEmailStepConfig, SendEventOptions, SendEventResponse, SendEventResponseSuccess, Tag, Template, TemplateVariable, TemplateVariableValue, Topic, TriggerStepConfig, UpdateBroadcastOptions, UpdateBroadcastResponse, UpdateBroadcastResponseSuccess, UpdateContactOptions, UpdateContactPropertyApiOptions, UpdateContactPropertyOptions, UpdateContactPropertyResponse, UpdateContactPropertyResponseSuccess, UpdateContactResponse, UpdateContactResponseSuccess, UpdateContactTopicsOptions, UpdateContactTopicsRequestOptions, UpdateContactTopicsResponse, UpdateContactTopicsResponseSuccess, UpdateDomainsOptions, UpdateDomainsResponse, UpdateDomainsResponseSuccess, UpdateEmailOptions, UpdateEmailResponse, UpdateEmailResponseSuccess, UpdateEventOptions, UpdateEventResponse, UpdateEventResponseSuccess, UpdateTemplateOptions, UpdateTemplateResponse, UpdateTemplateResponseSuccess, UpdateTopicOptions, UpdateTopicResponse, UpdateTopicResponseSuccess, UpdateWebhookOptions, UpdateWebhookResponse, UpdateWebhookResponseSuccess, UpdateWorkflowOptions, UpdateWorkflowResponse, UpdateWorkflowResponseSuccess, VerifyDomainsResponse, VerifyDomainsResponseSuccess, WaitForEventStepConfig, Webhook, WebhookEvent, WebhookEventPayload, Workflow, WorkflowEdge, WorkflowEdgeType, WorkflowResponseEdge, WorkflowResponseStep, WorkflowStep };
2071
+ export { AddContactSegmentOptions, AddContactSegmentResponse, AddContactSegmentResponseSuccess, ApiContactProperty, ApiKey, Attachment, AttachmentData, Broadcast, CancelEmailResponse, CancelEmailResponseSuccess, ConditionRule, ConditionStepConfig, Contact, ContactCreatedEvent, ContactDeletedEvent, ContactProperty, ContactSegmentsBaseOptions, ContactTopic, ContactUpdatedEvent, CreateApiKeyOptions, CreateApiKeyRequestOptions, CreateApiKeyResponse, CreateApiKeyResponseSuccess, CreateBatchEmailOptions, CreateBatchOptions, CreateBatchRequestOptions, CreateBatchResponse, CreateBatchSuccessResponse, CreateBroadcastOptions, CreateBroadcastRequestOptions, CreateBroadcastResponse, CreateBroadcastResponseSuccess, CreateContactOptions, CreateContactPropertyApiOptions, CreateContactPropertyOptions, CreateContactPropertyResponse, CreateContactPropertyResponseSuccess, CreateContactRequestOptions, CreateContactResponse, CreateContactResponseSuccess, CreateDomainOptions, CreateDomainRequestOptions, CreateDomainResponse, CreateDomainResponseSuccess, CreateEmailOptions, CreateEmailRequestOptions, CreateEmailResponse, CreateEmailResponseSuccess, CreateEventOptions, CreateEventResponse, CreateEventResponseSuccess, CreateSegmentOptions, CreateSegmentRequestOptions, CreateSegmentResponse, CreateSegmentResponseSuccess, CreateTemplateOptions, CreateTemplateRequestOptions, CreateTemplateResponse, CreateTemplateResponseSuccess, CreateTopicOptions, CreateTopicResponse, CreateTopicResponseSuccess, CreateWebhookOptions, CreateWebhookRequestOptions, CreateWebhookResponse, CreateWebhookResponseSuccess, CreateWorkflowOptions, CreateWorkflowResponse, CreateWorkflowResponseSuccess, DelayStepConfig, Domain, DomainApiOptions, DomainCapabilities, DomainCapabilityStatus, DomainCreatedEvent, DomainDeletedEvent, DomainDkimRecord, DomainNameservers, DomainRecords, DomainRegion, DomainSpfRecord, DomainStatus, DomainUpdatedEvent, DuplicateTemplateResponse, DuplicateTemplateResponseSuccess, EmailApiAttachment, EmailApiOptions, EmailBouncedEvent, EmailClickedEvent, EmailComplainedEvent, EmailDeliveredEvent, EmailDeliveryDelayedEvent, EmailFailedEvent, EmailOpenedEvent, EmailReceivedEvent, EmailScheduledEvent, EmailSentEvent, EmailSuppressedEvent, type ErrorResponse, Event, EventSchemaMap, EventSchemaType, ForwardReceivingEmailOptions, ForwardReceivingEmailResponse, ForwardReceivingEmailResponseSuccess, GetAttachmentOptions, GetAttachmentResponse, GetAttachmentResponseSuccess, GetBroadcastResponse, GetBroadcastResponseSuccess, GetContactOptions, GetContactPropertyResponse, GetContactPropertyResponseSuccess, GetContactResponse, GetContactResponseSuccess, GetDomainResponse, GetDomainResponseSuccess, GetEmailResponse, GetEmailResponseSuccess, GetEventResponse, GetEventResponseSuccess, GetOptions, GetReceivingEmailResponse, GetReceivingEmailResponseSuccess, GetSegmentResponse, GetSegmentResponseSuccess, GetTemplateResponse, GetTemplateResponseSuccess, GetTopicOptions, GetTopicResponse, GetTopicResponseSuccess, GetWebhookResponse, GetWebhookResponseSuccess, GetWorkflowResponse, GetWorkflowResponseSuccess, GetWorkflowRunOptions, GetWorkflowRunResponse, GetWorkflowRunResponseSuccess, GetWorkflowRunStepOptions, GetWorkflowRunStepResponse, GetWorkflowRunStepResponseSuccess, IdempotentRequest, InboundAttachment, LegacyCreateContactOptions, ListApiKeysOptions, ListApiKeysResponse, ListApiKeysResponseSuccess, ListAttachmentsOptions, ListAttachmentsResponse, ListAttachmentsResponseSuccess, ListBroadcastsOptions, ListBroadcastsResponse, ListBroadcastsResponseSuccess, ListContactPropertiesOptions, ListContactPropertiesResponse, ListContactPropertiesResponseSuccess, ListContactSegmentsOptions, ListContactSegmentsResponse, ListContactSegmentsResponseSuccess, ListContactTopicsOptions, ListContactTopicsRequestOptions, ListContactTopicsResponse, ListContactTopicsResponseSuccess, ListContactsOptions, ListContactsResponse, ListContactsResponseSuccess, ListDomainsOptions, ListDomainsResponse, ListDomainsResponseSuccess, ListEmail, ListEmailsOptions, ListEmailsResponse, ListEmailsResponseSuccess, ListEventsOptions, ListEventsResponse, ListEventsResponseSuccess, ListReceivingEmail, ListReceivingEmailsOptions, ListReceivingEmailsResponse, ListReceivingEmailsResponseSuccess, ListSegmentsOptions, ListSegmentsResponse, ListSegmentsResponseSuccess, ListTemplatesOptions, ListTemplatesResponse, ListTemplatesResponseSuccess, ListTopicsResponse, ListTopicsResponseSuccess, ListWebhooksOptions, ListWebhooksResponse, ListWebhooksResponseSuccess, ListWorkflowRunStepsOptions, ListWorkflowRunStepsResponse, ListWorkflowRunStepsResponseSuccess, ListWorkflowRunsOptions, ListWorkflowRunsResponse, ListWorkflowRunsResponseSuccess, ListWorkflowsOptions, ListWorkflowsResponse, ListWorkflowsResponseSuccess, PaginatedData, PaginationOptions, PatchOptions, PostOptions, PublishTemplateResponse, PublishTemplateResponseSuccess, PutOptions, ReceivingRecord, RemoveApiKeyResponse, RemoveApiKeyResponseSuccess, RemoveBroadcastResponse, RemoveBroadcastResponseSuccess, RemoveContactOptions, RemoveContactPropertyResponse, RemoveContactPropertyResponseSuccess, RemoveContactSegmentOptions, RemoveContactSegmentResponse, RemoveContactSegmentResponseSuccess, RemoveContactsResponse, RemoveContactsResponseSuccess, RemoveDomainsResponse, RemoveDomainsResponseSuccess, RemoveEventResponse, RemoveEventResponseSuccess, RemoveSegmentResponse, RemoveSegmentResponseSuccess, RemoveTemplateResponse, RemoveTemplateResponseSuccess, RemoveTopicResponse, RemoveTopicResponseSuccess, RemoveWebhookResponse, RemoveWebhookResponseSuccess, RemoveWorkflowResponse, RemoveWorkflowResponseSuccess, RequireAtLeastOne, Resend, type Response, Segment, SelectingField, SendBroadcastOptions, SendBroadcastRequestOptions, SendBroadcastResponse, SendBroadcastResponseSuccess, SendEmailStepConfig, SendEventOptions, SendEventResponse, SendEventResponseSuccess, Tag, Template, TemplateVariable, TemplateVariableValue, Topic, TriggerStepConfig, UpdateBroadcastOptions, UpdateBroadcastResponse, UpdateBroadcastResponseSuccess, UpdateContactOptions, UpdateContactPropertyApiOptions, UpdateContactPropertyOptions, UpdateContactPropertyResponse, UpdateContactPropertyResponseSuccess, UpdateContactResponse, UpdateContactResponseSuccess, UpdateContactTopicsOptions, UpdateContactTopicsRequestOptions, UpdateContactTopicsResponse, UpdateContactTopicsResponseSuccess, UpdateDomainsOptions, UpdateDomainsResponse, UpdateDomainsResponseSuccess, UpdateEmailOptions, UpdateEmailResponse, UpdateEmailResponseSuccess, UpdateEventOptions, UpdateEventResponse, UpdateEventResponseSuccess, UpdateTemplateOptions, UpdateTemplateResponse, UpdateTemplateResponseSuccess, UpdateTopicOptions, UpdateTopicResponse, UpdateTopicResponseSuccess, UpdateWebhookOptions, UpdateWebhookResponse, UpdateWebhookResponseSuccess, UpdateWorkflowOptions, UpdateWorkflowResponse, UpdateWorkflowResponseSuccess, VerifyDomainsResponse, VerifyDomainsResponseSuccess, WaitForEventStepConfig, Webhook, WebhookEvent, WebhookEventPayload, Workflow, WorkflowEdge, WorkflowEdgeType, WorkflowResponseEdge, WorkflowResponseStep, WorkflowRun, WorkflowRunItem, WorkflowRunStatus, WorkflowRunStep, WorkflowRunStepItem, WorkflowRunStepStatus, WorkflowRunTrigger, WorkflowStatus, WorkflowStep, WorkflowStepType };
package/dist/index.mjs CHANGED
@@ -2,7 +2,7 @@ import PostalMime from "postal-mime";
2
2
  import { Webhook } from "svix";
3
3
 
4
4
  //#region package.json
5
- var version = "6.10.0-preview-workflows.0";
5
+ var version = "6.10.0-preview-workflows.1";
6
6
 
7
7
  //#endregion
8
8
  //#region src/common/utils/build-pagination-query.ts
@@ -727,8 +727,8 @@ function parseWorkflowToApiOptions(workflow) {
727
727
  return {
728
728
  name: workflow.name,
729
729
  status: workflow.status,
730
- steps: workflow.steps?.map(parseStepConfig),
731
- edges: workflow.edges?.map(parseEdge)
730
+ steps: workflow.steps.map(parseStepConfig),
731
+ edges: workflow.edges.map(parseEdge)
732
732
  };
733
733
  }
734
734
  function parseWorkflowEventToApiOptions(event) {
@@ -970,11 +970,45 @@ var Webhooks = class {
970
970
  }
971
971
  };
972
972
 
973
+ //#endregion
974
+ //#region src/workflow-run-steps/workflow-run-steps.ts
975
+ var WorkflowRunSteps = class {
976
+ constructor(resend) {
977
+ this.resend = resend;
978
+ }
979
+ async get(options) {
980
+ return await this.resend.get(`/workflows/${options.workflowId}/runs/${options.runId}/steps/${options.stepId}`);
981
+ }
982
+ async list(options) {
983
+ const queryString = buildPaginationQuery(options);
984
+ const url = queryString ? `/workflows/${options.workflowId}/runs/${options.runId}/steps?${queryString}` : `/workflows/${options.workflowId}/runs/${options.runId}/steps`;
985
+ return await this.resend.get(url);
986
+ }
987
+ };
988
+
989
+ //#endregion
990
+ //#region src/workflow-runs/workflow-runs.ts
991
+ var WorkflowRuns = class {
992
+ constructor(resend) {
993
+ this.resend = resend;
994
+ this.steps = new WorkflowRunSteps(resend);
995
+ }
996
+ async get(options) {
997
+ return await this.resend.get(`/workflows/${options.workflowId}/runs/${options.runId}`);
998
+ }
999
+ async list(options) {
1000
+ const queryString = buildPaginationQuery(options);
1001
+ const url = queryString ? `/workflows/${options.workflowId}/runs?${queryString}` : `/workflows/${options.workflowId}/runs`;
1002
+ return await this.resend.get(url);
1003
+ }
1004
+ };
1005
+
973
1006
  //#endregion
974
1007
  //#region src/workflows/workflows.ts
975
1008
  var Workflows = class {
976
1009
  constructor(resend) {
977
1010
  this.resend = resend;
1011
+ this.runs = new WorkflowRuns(this.resend);
978
1012
  }
979
1013
  async create(payload) {
980
1014
  return await this.resend.post("/workflows", parseWorkflowToApiOptions(payload));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "resend",
3
- "version": "6.10.0-preview-workflows.0",
3
+ "version": "6.10.0-preview-workflows.1",
4
4
  "description": "Node.js library for the Resend API",
5
5
  "main": "./dist/index.cjs",
6
6
  "module": "./dist/index.mjs",