resend 6.32.1 → 6.33.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
@@ -1760,6 +1760,528 @@ export interface UpdateEventResponseSuccess {
1760
1760
  }
1761
1761
  export type UpdateEventResponse = Response<UpdateEventResponseSuccess>;
1762
1762
  //#endregion
1763
+ //#region src/inboxes/agent/interfaces/agent.d.ts
1764
+ export declare const INBOX_AGENT_ACTIONS: readonly ["draft_reply", "forward_thread", "add_labels", "assign_thread", "mark_as_spam", "archive_thread", "delete_thread"];
1765
+ type InboxAgentAction = (typeof INBOX_AGENT_ACTIONS)[number];
1766
+ interface InboxAgentSettings {
1767
+ object: 'inbox_agent';
1768
+ instructions: string | null;
1769
+ tone: string | null;
1770
+ enabled_actions: InboxAgentAction[];
1771
+ }
1772
+ //#endregion
1773
+ //#region src/inboxes/agent/interfaces/get-inbox-agent.interface.d.ts
1774
+ interface GetInboxAgentOptions {
1775
+ inboxId: string;
1776
+ }
1777
+ type GetInboxAgentResponseSuccess = InboxAgentSettings;
1778
+ type GetInboxAgentResponse = Response<GetInboxAgentResponseSuccess>;
1779
+ //#endregion
1780
+ //#region src/inboxes/agent/interfaces/update-inbox-agent.interface.d.ts
1781
+ type UpdateInboxAgentOptions = {
1782
+ inboxId: string;
1783
+ } & RequireAtLeastOne<{
1784
+ instructions?: string | null;
1785
+ tone?: string | null;
1786
+ enabledActions?: InboxAgentAction[];
1787
+ }>;
1788
+ interface UpdateInboxAgentResponseSuccess {
1789
+ object: 'inbox_agent';
1790
+ id: string;
1791
+ }
1792
+ type UpdateInboxAgentResponse = Response<UpdateInboxAgentResponseSuccess>;
1793
+ //#endregion
1794
+ //#region src/inboxes/drafts/interfaces/draft.d.ts
1795
+ type InboxDraftType = 'standalone' | 'reply';
1796
+ interface InboxDraftAttachment {
1797
+ id: string;
1798
+ filename: string;
1799
+ content_type: string;
1800
+ size: number;
1801
+ }
1802
+ interface InboxDraftAttachmentOptions {
1803
+ /** Content of the file, as a base64 string or a Buffer. */
1804
+ content: string | Buffer;
1805
+ filename: string;
1806
+ contentType: string;
1807
+ }
1808
+ interface InboxDraft {
1809
+ object: 'inbox_draft';
1810
+ id: string;
1811
+ type: InboxDraftType;
1812
+ to: string[] | null;
1813
+ cc: string[];
1814
+ bcc: string[];
1815
+ subject: string | null;
1816
+ html: string | null;
1817
+ text: string | null;
1818
+ thread_id: string | null;
1819
+ reply_to_email_id: string | null;
1820
+ email_id: string | null;
1821
+ created_at: string;
1822
+ updated_at: string;
1823
+ attachments: InboxDraftAttachment[];
1824
+ }
1825
+ interface InboxDraftListItem {
1826
+ id: string;
1827
+ type: InboxDraftType;
1828
+ to: string[] | null;
1829
+ cc: string[];
1830
+ bcc: string[];
1831
+ subject: string | null;
1832
+ snippet: string | null;
1833
+ thread_id: string | null;
1834
+ reply_to_email_id: string | null;
1835
+ updated_at: string;
1836
+ attachments: InboxDraftAttachment[];
1837
+ }
1838
+ //#endregion
1839
+ //#region src/inboxes/drafts/interfaces/create-inbox-draft.interface.d.ts
1840
+ type CreateInboxDraftContent = RequireAtLeastOne<{
1841
+ to?: string | string[] | null;
1842
+ cc?: string | string[] | null;
1843
+ bcc?: string | string[] | null;
1844
+ subject?: string | null;
1845
+ text?: string | null;
1846
+ html?: string | null;
1847
+ /**
1848
+ * Files to store on the draft. Each one needs `content`, `filename` and `contentType`.
1849
+ * The files on a draft can total at most 25 MB. An empty file or a blocked file type returns a 422.
1850
+ */
1851
+ attachments?: InboxDraftAttachmentOptions[];
1852
+ }>;
1853
+ type CreateInboxDraftOptions = {
1854
+ inboxId: string;
1855
+ } & CreateInboxDraftContent & ({
1856
+ threadId: string;
1857
+ replyToEmailId: string;
1858
+ } | {
1859
+ threadId?: never;
1860
+ replyToEmailId?: never;
1861
+ });
1862
+ interface CreateInboxDraftRequestOptions extends PostOptions, IdempotentRequest {}
1863
+ interface CreateInboxDraftResponseSuccess {
1864
+ object: 'inbox_draft';
1865
+ id: string;
1866
+ }
1867
+ type CreateInboxDraftResponse = Response<CreateInboxDraftResponseSuccess>;
1868
+ //#endregion
1869
+ //#region src/inboxes/drafts/interfaces/get-inbox-draft.interface.d.ts
1870
+ interface GetInboxDraftOptions {
1871
+ inboxId: string;
1872
+ draftId: string;
1873
+ }
1874
+ type GetInboxDraftResponseSuccess = InboxDraft;
1875
+ type GetInboxDraftResponse = Response<GetInboxDraftResponseSuccess>;
1876
+ //#endregion
1877
+ //#region src/inboxes/drafts/interfaces/list-inbox-drafts.interface.d.ts
1878
+ type ListInboxDraftsOptions = {
1879
+ inboxId: string;
1880
+ } & PaginationOptions;
1881
+ interface ListInboxDraftsResponseSuccess {
1882
+ object: 'list';
1883
+ has_more: boolean;
1884
+ data: InboxDraftListItem[];
1885
+ }
1886
+ type ListInboxDraftsResponse = Response<ListInboxDraftsResponseSuccess>;
1887
+ //#endregion
1888
+ //#region src/inboxes/drafts/interfaces/remove-inbox-draft.interface.d.ts
1889
+ interface RemoveInboxDraftOptions {
1890
+ inboxId: string;
1891
+ draftId: string;
1892
+ }
1893
+ interface RemoveInboxDraftResponseSuccess {
1894
+ object: 'inbox_draft';
1895
+ id: string;
1896
+ deleted: boolean;
1897
+ }
1898
+ type RemoveInboxDraftResponse = Response<RemoveInboxDraftResponseSuccess>;
1899
+ //#endregion
1900
+ //#region src/inboxes/drafts/interfaces/send-inbox-draft.interface.d.ts
1901
+ interface SendInboxDraftOptions {
1902
+ inboxId: string;
1903
+ draftId: string;
1904
+ /**
1905
+ * Custom headers to add to the email.
1906
+ * The `In-Reply-To`, `References` and `Reply-To` headers are set by Resend and cannot be set here.
1907
+ * Sending one of them, in any letter case, returns a 422.
1908
+ * Header names cannot be empty, and names and values cannot contain line breaks or null characters, or the request returns a 422.
1909
+ * `null` means no custom headers.
1910
+ */
1911
+ headers?: Record<string, string> | null;
1912
+ }
1913
+ interface SendInboxDraftRequestOptions extends PostOptions, IdempotentRequest {}
1914
+ interface SendInboxDraftResponseSuccess {
1915
+ id: string;
1916
+ }
1917
+ type SendInboxDraftResponse = Response<SendInboxDraftResponseSuccess>;
1918
+ //#endregion
1919
+ //#region src/inboxes/drafts/interfaces/update-inbox-draft.interface.d.ts
1920
+ type UpdateInboxDraftOptions = {
1921
+ inboxId: string;
1922
+ draftId: string;
1923
+ } & RequireAtLeastOne<{
1924
+ to?: string | string[] | null;
1925
+ cc?: string | string[] | null;
1926
+ bcc?: string | string[] | null;
1927
+ subject?: string | null;
1928
+ text?: string | null;
1929
+ html?: string | null;
1930
+ /**
1931
+ * Files to store on the draft. Each one needs `content`, `filename` and `contentType`.
1932
+ * The files on a draft can total at most 25 MB. An empty file or a blocked file type returns a 422.
1933
+ * Sending the field replaces every attachment on the draft. Send `[]` or `null` to remove them all.
1934
+ */
1935
+ attachments?: InboxDraftAttachmentOptions[] | null;
1936
+ }>;
1937
+ type UpdateInboxDraftResponseSuccess = InboxDraft;
1938
+ type UpdateInboxDraftResponse = Response<UpdateInboxDraftResponseSuccess>;
1939
+ //#endregion
1940
+ //#region src/inboxes/interfaces/inbox.d.ts
1941
+ export declare const INBOX_MESSAGE_FOLDERS: readonly ["inbox", "archive", "spam", "sent", "trash"];
1942
+ type InboxMessageFolder = (typeof INBOX_MESSAGE_FOLDERS)[number];
1943
+ export declare const MOVE_THREAD_FOLDERS: readonly ["inbox", "archive", "spam", "trash"];
1944
+ type MoveThreadFolder = (typeof MOVE_THREAD_FOLDERS)[number];
1945
+ type InboxLabelColor = `#${string}`;
1946
+ interface Inbox {
1947
+ id: string;
1948
+ name: string | null;
1949
+ email_address: string;
1950
+ from_name: string | null;
1951
+ unread: number;
1952
+ last_received: string | null;
1953
+ }
1954
+ //#endregion
1955
+ //#region src/inboxes/labels/interfaces/create-inbox-label.interface.d.ts
1956
+ interface CreateInboxLabelOptions {
1957
+ inboxId: string;
1958
+ name: string;
1959
+ color?: InboxLabelColor;
1960
+ }
1961
+ interface CreateInboxLabelRequestOptions extends PostOptions {}
1962
+ interface CreateInboxLabelResponseSuccess {
1963
+ object: 'inbox_label';
1964
+ id: string;
1965
+ }
1966
+ type CreateInboxLabelResponse = Response<CreateInboxLabelResponseSuccess>;
1967
+ //#endregion
1968
+ //#region src/inboxes/labels/interfaces/label.d.ts
1969
+ interface InboxLabel {
1970
+ id: string;
1971
+ name: string;
1972
+ color: InboxLabelColor;
1973
+ created_at: string;
1974
+ }
1975
+ //#endregion
1976
+ //#region src/inboxes/labels/interfaces/list-inbox-labels.interface.d.ts
1977
+ interface ListInboxLabelsOptions {
1978
+ inboxId: string;
1979
+ }
1980
+ interface ListInboxLabelsResponseSuccess {
1981
+ object: 'list';
1982
+ data: InboxLabel[];
1983
+ }
1984
+ type ListInboxLabelsResponse = Response<ListInboxLabelsResponseSuccess>;
1985
+ //#endregion
1986
+ //#region src/inboxes/labels/interfaces/remove-inbox-label.interface.d.ts
1987
+ interface RemoveInboxLabelOptions {
1988
+ inboxId: string;
1989
+ labelId: string;
1990
+ }
1991
+ interface RemoveInboxLabelResponseSuccess {
1992
+ object: 'inbox_label';
1993
+ id: string;
1994
+ deleted: boolean;
1995
+ }
1996
+ type RemoveInboxLabelResponse = Response<RemoveInboxLabelResponseSuccess>;
1997
+ //#endregion
1998
+ //#region src/inboxes/labels/interfaces/update-inbox-label.interface.d.ts
1999
+ interface UpdateInboxLabelOptions {
2000
+ inboxId: string;
2001
+ labelId: string;
2002
+ name?: string;
2003
+ color?: InboxLabelColor;
2004
+ }
2005
+ interface UpdateInboxLabelResponseSuccess {
2006
+ object: 'inbox_label';
2007
+ id: string;
2008
+ }
2009
+ type UpdateInboxLabelResponse = Response<UpdateInboxLabelResponseSuccess>;
2010
+ //#endregion
2011
+ //#region src/inboxes/threads/interfaces/forward-inbox-thread-email.interface.d.ts
2012
+ interface ForwardInboxThreadEmailOptions {
2013
+ inboxId: string;
2014
+ threadId: string;
2015
+ emailId: string;
2016
+ to: string | string[];
2017
+ cc?: string | string[];
2018
+ bcc?: string | string[];
2019
+ html?: string;
2020
+ text?: string;
2021
+ subject?: string;
2022
+ /**
2023
+ * Files to attach, as on `POST /emails`. Each one needs `content` or `path`.
2024
+ * They share one limit with the attachments of the original message, which the forward also sends.
2025
+ * Together they can have up to 10 files and at most 25 MB of `content`.
2026
+ * A `path` file counts toward the 10 files only, because it is fetched when the email is sent.
2027
+ * An empty file, a blocked file type, a `path` that is not an `http` or `https` URL or that points to `localhost`, `127.0.0.1` or `0.0.0.0`,
2028
+ * or a `content_type` that is not a valid MIME type returns a 422.
2029
+ * An original attachment that was sent from a URL (`path`) cannot be forwarded, and the request returns a 422.
2030
+ */
2031
+ attachments?: Attachment[];
2032
+ /**
2033
+ * Custom headers to add to the email.
2034
+ * The `In-Reply-To`, `References` and `Reply-To` headers are set by Resend and cannot be set here.
2035
+ * Sending one of them, in any letter case, returns a 422.
2036
+ * Header names cannot be empty, and names and values cannot contain line breaks or null characters, or the request returns a 422.
2037
+ * `null` means no custom headers.
2038
+ */
2039
+ headers?: Record<string, string> | null;
2040
+ }
2041
+ interface ForwardInboxThreadEmailRequestOptions extends PostOptions, IdempotentRequest {}
2042
+ interface ForwardInboxThreadEmailResponseSuccess {
2043
+ id: string;
2044
+ }
2045
+ type ForwardInboxThreadEmailResponse = Response<ForwardInboxThreadEmailResponseSuccess>;
2046
+ //#endregion
2047
+ //#region src/inboxes/threads/interfaces/thread.d.ts
2048
+ interface InboxThreadLabel {
2049
+ id: string;
2050
+ name: string;
2051
+ color: InboxLabelColor;
2052
+ }
2053
+ interface InboxThread {
2054
+ id: string;
2055
+ subject: string | null;
2056
+ from: string | null;
2057
+ to: string[];
2058
+ cc: string[];
2059
+ bcc: string[];
2060
+ labels: InboxThreadLabel[];
2061
+ email_count: number;
2062
+ has_attachment: boolean;
2063
+ has_draft: boolean;
2064
+ read: boolean;
2065
+ received_at: string;
2066
+ folder: InboxMessageFolder;
2067
+ }
2068
+ interface InboxThreadSummary {
2069
+ object: 'inbox_thread';
2070
+ id: string;
2071
+ subject: string | null;
2072
+ folder: InboxMessageFolder;
2073
+ labels: InboxThreadLabel[];
2074
+ read: boolean;
2075
+ }
2076
+ interface InboxMessageAttachment {
2077
+ id: string;
2078
+ filename: string | null;
2079
+ size: number | null;
2080
+ }
2081
+ interface InboxMessage {
2082
+ id: string;
2083
+ direction: 'inbound' | 'outbound';
2084
+ from: string;
2085
+ to: string[];
2086
+ cc: string[];
2087
+ bcc: string[];
2088
+ reply_to: string[];
2089
+ subject: string | null;
2090
+ message_id: string | null;
2091
+ html: string | null;
2092
+ text: string | null;
2093
+ attachments: InboxMessageAttachment[];
2094
+ read: boolean;
2095
+ received_at: string;
2096
+ }
2097
+ //#endregion
2098
+ //#region src/inboxes/threads/interfaces/get-inbox-thread.interface.d.ts
2099
+ interface GetInboxThreadOptions {
2100
+ inboxId: string;
2101
+ threadId: string;
2102
+ }
2103
+ type GetInboxThreadResponseSuccess = InboxThreadSummary;
2104
+ type GetInboxThreadResponse = Response<GetInboxThreadResponseSuccess>;
2105
+ //#endregion
2106
+ //#region src/inboxes/threads/interfaces/get-inbox-thread-email.interface.d.ts
2107
+ interface GetInboxThreadEmailOptions {
2108
+ inboxId: string;
2109
+ threadId: string;
2110
+ emailId: string;
2111
+ }
2112
+ type GetInboxThreadEmailResponseSuccess = InboxMessage;
2113
+ type GetInboxThreadEmailResponse = Response<GetInboxThreadEmailResponseSuccess>;
2114
+ //#endregion
2115
+ //#region src/inboxes/threads/interfaces/list-inbox-thread-emails.interface.d.ts
2116
+ type ListInboxThreadEmailsOptions = {
2117
+ inboxId: string;
2118
+ threadId: string;
2119
+ } & PaginationOptions;
2120
+ interface ListInboxThreadEmailsResponseSuccess {
2121
+ object: 'list';
2122
+ has_more: boolean;
2123
+ data: InboxMessage[];
2124
+ }
2125
+ type ListInboxThreadEmailsResponse = Response<ListInboxThreadEmailsResponseSuccess>;
2126
+ //#endregion
2127
+ //#region src/inboxes/threads/interfaces/list-inbox-threads.interface.d.ts
2128
+ type ListInboxThreadsOptions = {
2129
+ inboxId: string;
2130
+ folders?: InboxMessageFolder[];
2131
+ labels?: string[];
2132
+ read?: boolean;
2133
+ } & PaginationOptions;
2134
+ interface ListInboxThreadsResponseSuccess {
2135
+ object: 'list';
2136
+ has_more: boolean;
2137
+ data: InboxThread[];
2138
+ }
2139
+ type ListInboxThreadsResponse = Response<ListInboxThreadsResponseSuccess>;
2140
+ //#endregion
2141
+ //#region src/inboxes/threads/interfaces/remove-inbox-thread.interface.d.ts
2142
+ interface RemoveInboxThreadOptions {
2143
+ inboxId: string;
2144
+ threadId: string;
2145
+ }
2146
+ interface RemoveInboxThreadResponseSuccess {
2147
+ object: 'inbox_thread';
2148
+ id: string;
2149
+ deleted: boolean;
2150
+ }
2151
+ type RemoveInboxThreadResponse = Response<RemoveInboxThreadResponseSuccess>;
2152
+ //#endregion
2153
+ //#region src/inboxes/threads/interfaces/reply-inbox-thread-email.interface.d.ts
2154
+ type ReplyInboxThreadEmailOptions = {
2155
+ inboxId: string;
2156
+ threadId: string;
2157
+ emailId: string;
2158
+ } & RequireAtLeastOne<{
2159
+ html?: string;
2160
+ text?: string;
2161
+ }> & {
2162
+ cc?: string | string[];
2163
+ bcc?: string | string[];
2164
+ subject?: string;
2165
+ replyAll?: boolean;
2166
+ /**
2167
+ * Files to attach, as on `POST /emails`. Each one needs `content` or `path`.
2168
+ * Up to 10 files. The `content` of all files can total at most 25 MB.
2169
+ * A `path` file counts toward the 10 files only, because it is fetched when the email is sent.
2170
+ * An empty file, a blocked file type, a `path` that is not an `http` or `https` URL or that points to `localhost`, `127.0.0.1` or `0.0.0.0`,
2171
+ * or a `content_type` that is not a valid MIME type returns a 422.
2172
+ */
2173
+ attachments?: Attachment[];
2174
+ /**
2175
+ * Custom headers to add to the email.
2176
+ * The `In-Reply-To`, `References` and `Reply-To` headers are set by Resend and cannot be set here.
2177
+ * Sending one of them, in any letter case, returns a 422.
2178
+ * Header names cannot be empty, and names and values cannot contain line breaks or null characters, or the request returns a 422.
2179
+ * `null` means no custom headers.
2180
+ */
2181
+ headers?: Record<string, string> | null;
2182
+ };
2183
+ interface ReplyInboxThreadEmailRequestOptions extends PostOptions, IdempotentRequest {}
2184
+ interface ReplyInboxThreadEmailResponseSuccess {
2185
+ id: string;
2186
+ }
2187
+ type ReplyInboxThreadEmailResponse = Response<ReplyInboxThreadEmailResponseSuccess>;
2188
+ //#endregion
2189
+ //#region src/inboxes/threads/interfaces/search-inbox-threads.interface.d.ts
2190
+ type SearchInboxThreadsOptions = ListInboxThreadsOptions & {
2191
+ query?: string;
2192
+ from?: string[];
2193
+ to?: string[];
2194
+ cc?: string[];
2195
+ bcc?: string[];
2196
+ hasAttachment?: boolean;
2197
+ startDate?: string;
2198
+ endDate?: string;
2199
+ };
2200
+ type InboxThreadSearchHighlightKey = 'subject' | 'body' | 'from' | 'to' | 'cc' | 'bcc' | 'attachments';
2201
+ interface InboxThreadSearchResult extends InboxThread {
2202
+ matched_email_id: string | null;
2203
+ highlights: Partial<Record<InboxThreadSearchHighlightKey, string[]>>;
2204
+ }
2205
+ interface SearchInboxThreadsResponseSuccess {
2206
+ object: 'list';
2207
+ has_more: boolean;
2208
+ data: InboxThreadSearchResult[];
2209
+ }
2210
+ type SearchInboxThreadsResponse = Response<SearchInboxThreadsResponseSuccess>;
2211
+ //#endregion
2212
+ //#region src/inboxes/threads/interfaces/update-inbox-thread.interface.d.ts
2213
+ type UpdateInboxThreadOptions = {
2214
+ inboxId: string;
2215
+ threadId: string;
2216
+ } & RequireAtLeastOne<{
2217
+ read?: boolean;
2218
+ folder?: MoveThreadFolder;
2219
+ /** Label IDs to apply to the thread. Between 1 and 10 IDs. */
2220
+ addLabelIds?: string[];
2221
+ /** Label IDs to remove from the thread. Between 1 and 10 IDs. The labels themselves are kept. */
2222
+ removeLabelIds?: string[];
2223
+ }>;
2224
+ type UpdateInboxThreadResponseSuccess = InboxThreadSummary;
2225
+ type UpdateInboxThreadResponse = Response<UpdateInboxThreadResponseSuccess>;
2226
+ //#endregion
2227
+ //#region src/inboxes/interfaces/create-inbox.interface.d.ts
2228
+ interface CreateInboxOptions {
2229
+ emailAddress: string;
2230
+ name?: string;
2231
+ forwarding?: boolean;
2232
+ fromName?: string;
2233
+ }
2234
+ interface CreateInboxRequestOptions extends PostOptions {}
2235
+ interface CreateInboxResponseSuccess {
2236
+ object: 'inbox';
2237
+ id: string;
2238
+ }
2239
+ type CreateInboxResponse = Response<CreateInboxResponseSuccess>;
2240
+ //#endregion
2241
+ //#region src/inboxes/interfaces/get-inbox.interface.d.ts
2242
+ interface GetInboxResponseSuccess {
2243
+ object: 'inbox';
2244
+ id: string;
2245
+ name: string;
2246
+ email_address: string;
2247
+ domain_id: string;
2248
+ receiving_address: string | null;
2249
+ from_name: string | null;
2250
+ unread: number;
2251
+ drafts: number;
2252
+ last_received: string | null;
2253
+ created_at: string;
2254
+ }
2255
+ type GetInboxResponse = Response<GetInboxResponseSuccess>;
2256
+ //#endregion
2257
+ //#region src/inboxes/interfaces/list-inboxes.interface.d.ts
2258
+ type ListInboxesOptions = PaginationOptions;
2259
+ interface ListInboxesResponseSuccess {
2260
+ object: 'list';
2261
+ has_more: boolean;
2262
+ data: Inbox[];
2263
+ }
2264
+ type ListInboxesResponse = Response<ListInboxesResponseSuccess>;
2265
+ //#endregion
2266
+ //#region src/inboxes/interfaces/remove-inbox.interface.d.ts
2267
+ interface RemoveInboxResponseSuccess {
2268
+ object: 'inbox';
2269
+ id: string;
2270
+ deleted: boolean;
2271
+ }
2272
+ type RemoveInboxResponse = Response<RemoveInboxResponseSuccess>;
2273
+ //#endregion
2274
+ //#region src/inboxes/interfaces/update-inbox.interface.d.ts
2275
+ type UpdateInboxOptions = RequireAtLeastOne<{
2276
+ name?: string;
2277
+ fromName?: string;
2278
+ }>;
2279
+ interface UpdateInboxResponseSuccess {
2280
+ object: 'inbox';
2281
+ id: string;
2282
+ }
2283
+ type UpdateInboxResponse = Response<UpdateInboxResponseSuccess>;
2284
+ //#endregion
1763
2285
  //#region src/logs/interfaces/log.d.ts
1764
2286
  export interface Log {
1765
2287
  id: string;
@@ -2009,6 +2531,73 @@ declare class Events$1 {
2009
2531
  remove(identifier: string, requestOptions?: RequestOptions): Promise<RemoveEventResponse>;
2010
2532
  }
2011
2533
  //#endregion
2534
+ //#region src/inboxes/agent/agent.d.ts
2535
+ declare class InboxAgent {
2536
+ private readonly resend;
2537
+ constructor(resend: Resend);
2538
+ get(options: GetInboxAgentOptions, requestOptions?: RequestOptions): Promise<GetInboxAgentResponse>;
2539
+ update(options: UpdateInboxAgentOptions, requestOptions?: RequestOptions): Promise<UpdateInboxAgentResponse>;
2540
+ }
2541
+ //#endregion
2542
+ //#region src/inboxes/drafts/drafts.d.ts
2543
+ declare class InboxDrafts {
2544
+ private readonly resend;
2545
+ constructor(resend: Resend);
2546
+ list(options: ListInboxDraftsOptions, requestOptions?: RequestOptions): Promise<ListInboxDraftsResponse>;
2547
+ create(payload: CreateInboxDraftOptions, options?: CreateInboxDraftRequestOptions): Promise<CreateInboxDraftResponse>;
2548
+ get(options: GetInboxDraftOptions, requestOptions?: RequestOptions): Promise<GetInboxDraftResponse>;
2549
+ update(options: UpdateInboxDraftOptions, requestOptions?: RequestOptions): Promise<UpdateInboxDraftResponse>;
2550
+ remove(options: RemoveInboxDraftOptions, requestOptions?: RequestOptions): Promise<RemoveInboxDraftResponse>;
2551
+ send(payload: SendInboxDraftOptions, options?: SendInboxDraftRequestOptions): Promise<SendInboxDraftResponse>;
2552
+ }
2553
+ //#endregion
2554
+ //#region src/inboxes/labels/labels.d.ts
2555
+ declare class InboxLabels {
2556
+ private readonly resend;
2557
+ constructor(resend: Resend);
2558
+ list(options: ListInboxLabelsOptions, requestOptions?: RequestOptions): Promise<ListInboxLabelsResponse>;
2559
+ create(payload: CreateInboxLabelOptions, options?: CreateInboxLabelRequestOptions): Promise<CreateInboxLabelResponse>;
2560
+ update(options: UpdateInboxLabelOptions, requestOptions?: RequestOptions): Promise<UpdateInboxLabelResponse>;
2561
+ remove(options: RemoveInboxLabelOptions, requestOptions?: RequestOptions): Promise<RemoveInboxLabelResponse>;
2562
+ }
2563
+ //#endregion
2564
+ //#region src/inboxes/threads/emails/emails.d.ts
2565
+ declare class InboxThreadEmails {
2566
+ private readonly resend;
2567
+ constructor(resend: Resend);
2568
+ list(options: ListInboxThreadEmailsOptions, requestOptions?: RequestOptions): Promise<ListInboxThreadEmailsResponse>;
2569
+ get(options: GetInboxThreadEmailOptions, requestOptions?: RequestOptions): Promise<GetInboxThreadEmailResponse>;
2570
+ reply(payload: ReplyInboxThreadEmailOptions, options?: ReplyInboxThreadEmailRequestOptions): Promise<ReplyInboxThreadEmailResponse>;
2571
+ forward(payload: ForwardInboxThreadEmailOptions, options?: ForwardInboxThreadEmailRequestOptions): Promise<ForwardInboxThreadEmailResponse>;
2572
+ }
2573
+ //#endregion
2574
+ //#region src/inboxes/threads/threads.d.ts
2575
+ declare class InboxThreads {
2576
+ private readonly resend;
2577
+ readonly emails: InboxThreadEmails;
2578
+ constructor(resend: Resend);
2579
+ list(options: ListInboxThreadsOptions, requestOptions?: RequestOptions): Promise<ListInboxThreadsResponse>;
2580
+ search(options: SearchInboxThreadsOptions, requestOptions?: RequestOptions): Promise<SearchInboxThreadsResponse>;
2581
+ get(options: GetInboxThreadOptions, requestOptions?: RequestOptions): Promise<GetInboxThreadResponse>;
2582
+ update(options: UpdateInboxThreadOptions, requestOptions?: RequestOptions): Promise<UpdateInboxThreadResponse>;
2583
+ remove(options: RemoveInboxThreadOptions, requestOptions?: RequestOptions): Promise<RemoveInboxThreadResponse>;
2584
+ }
2585
+ //#endregion
2586
+ //#region src/inboxes/inboxes.d.ts
2587
+ declare class Inboxes {
2588
+ private readonly resend;
2589
+ readonly threads: InboxThreads;
2590
+ readonly labels: InboxLabels;
2591
+ readonly drafts: InboxDrafts;
2592
+ readonly agent: InboxAgent;
2593
+ constructor(resend: Resend);
2594
+ create(payload: CreateInboxOptions, options?: CreateInboxRequestOptions): Promise<CreateInboxResponse>;
2595
+ list(options?: ListInboxesOptions, requestOptions?: RequestOptions): Promise<ListInboxesResponse>;
2596
+ get(idOrEmail: string, requestOptions?: RequestOptions): Promise<GetInboxResponse>;
2597
+ update(id: string, payload: UpdateInboxOptions, requestOptions?: RequestOptions): Promise<UpdateInboxResponse>;
2598
+ remove(id: string, requestOptions?: RequestOptions): Promise<RemoveInboxResponse>;
2599
+ }
2600
+ //#endregion
2012
2601
  //#region src/logs/logs.d.ts
2013
2602
  declare class Logs {
2014
2603
  private readonly resend;
@@ -2409,7 +2998,7 @@ declare class Usage {
2409
2998
  }
2410
2999
  //#endregion
2411
3000
  //#region src/webhooks/interfaces/webhook-event.interface.d.ts
2412
- type WebhookEvent = 'email.sent' | 'email.scheduled' | 'email.delivered' | 'email.delivery_delayed' | 'email.complained' | 'email.bounced' | 'email.opened' | 'email.clicked' | 'email.received' | 'email.failed' | 'email.suppressed' | 'contact.created' | 'contact.updated' | 'contact.deleted' | 'contact.topics.updated' | 'domain.created' | 'domain.updated' | 'domain.deleted' | 'suppression.added' | 'suppression.removed' | 'topic.created' | 'topic.updated' | 'topic.deleted';
3001
+ type WebhookEvent = 'email.sent' | 'email.scheduled' | 'email.delivered' | 'email.delivery_delayed' | 'email.complained' | 'email.bounced' | 'email.opened' | 'email.clicked' | 'email.received' | 'email.failed' | 'email.suppressed' | 'contact.created' | 'contact.updated' | 'contact.deleted' | 'contact.topics.updated' | 'domain.created' | 'domain.updated' | 'domain.deleted' | 'suppression.added' | 'suppression.removed' | 'topic.created' | 'topic.updated' | 'topic.deleted' | 'inbox.created' | 'inbox.updated' | 'inbox.deleted' | 'inbox.thread.created' | 'inbox.thread.folder.updated' | 'inbox.thread.assigned' | 'inbox.thread.unassigned' | 'inbox.thread.labels.updated' | 'inbox.email.received' | 'inbox.email.sent' | 'inbox.draft.created' | 'inbox.draft.updated' | 'inbox.draft.sent' | 'inbox.draft.deleted';
2413
3002
  interface BaseEmailEventData {
2414
3003
  broadcast_id?: string;
2415
3004
  created_at: string;
@@ -2509,6 +3098,50 @@ interface TopicEventData {
2509
3098
  created_at: string;
2510
3099
  updated_at: string;
2511
3100
  }
3101
+ type InboxEventSource = 'api' | 'dashboard' | 'agent' | 'system';
3102
+ type InboxEventEmail = Omit<InboxMessage, 'html' | 'text'>;
3103
+ type InboxEventDraft = Omit<InboxDraft, 'html' | 'text'>;
3104
+ interface InboxBaseEventData {
3105
+ source: InboxEventSource;
3106
+ inbox_id: string;
3107
+ }
3108
+ interface InboxEventData extends InboxBaseEventData {
3109
+ inbox?: GetInboxResponseSuccess;
3110
+ }
3111
+ interface InboxThreadEventData extends InboxBaseEventData {
3112
+ thread_id: string;
3113
+ thread?: InboxThreadSummary;
3114
+ }
3115
+ interface InboxThreadEmailEventData extends InboxThreadEventData {
3116
+ email_id: string;
3117
+ email?: InboxEventEmail;
3118
+ }
3119
+ interface InboxThreadFolderUpdatedEventData extends InboxThreadEventData {
3120
+ from: MoveThreadFolder;
3121
+ to: MoveThreadFolder;
3122
+ }
3123
+ interface InboxThreadAssignedEventData extends InboxThreadEventData {
3124
+ assignee_email: string | null;
3125
+ assigned_by_email: string | null;
3126
+ previous_assignee_email: string | null;
3127
+ }
3128
+ interface InboxThreadUnassignedEventData extends InboxThreadEventData {
3129
+ previous_assignee_email: string | null;
3130
+ }
3131
+ interface InboxThreadLabelsUpdatedEventData extends InboxThreadEventData {
3132
+ added: InboxThreadLabel[];
3133
+ removed: InboxThreadLabel[];
3134
+ }
3135
+ interface InboxDraftEventData extends InboxBaseEventData {
3136
+ thread_id?: string;
3137
+ draft_id: string;
3138
+ thread?: InboxThreadSummary;
3139
+ draft?: InboxEventDraft;
3140
+ }
3141
+ interface InboxDraftSentEventData extends InboxThreadEmailEventData {
3142
+ draft_id: string;
3143
+ draft?: InboxEventDraft;
3144
+ }
2512
3145
  interface EmailSentEvent {
2513
3146
  type: 'email.sent';
2514
3147
  created_at: string;
@@ -2632,7 +3265,77 @@ interface TopicDeletedEvent {
2632
3265
  created_at: string;
2633
3266
  data: TopicEventData;
2634
3267
  }
2635
- type WebhookEventPayload = EmailSentEvent | EmailScheduledEvent | EmailDeliveredEvent | EmailDeliveryDelayedEvent | EmailComplainedEvent | EmailBouncedEvent | EmailOpenedEvent | EmailClickedEvent | EmailReceivedEvent | EmailFailedEvent | EmailSuppressedEvent | ContactCreatedEvent | ContactUpdatedEvent | ContactDeletedEvent | ContactTopicsUpdatedEvent | DomainCreatedEvent | DomainUpdatedEvent | DomainDeletedEvent | SuppressionAddedEvent | SuppressionRemovedEvent | TopicCreatedEvent | TopicUpdatedEvent | TopicDeletedEvent;
3268
+ interface InboxCreatedEvent {
3269
+ type: 'inbox.created';
3270
+ created_at: string;
3271
+ data: InboxEventData;
3272
+ }
3273
+ interface InboxUpdatedEvent {
3274
+ type: 'inbox.updated';
3275
+ created_at: string;
3276
+ data: InboxEventData;
3277
+ }
3278
+ interface InboxDeletedEvent {
3279
+ type: 'inbox.deleted';
3280
+ created_at: string;
3281
+ data: InboxBaseEventData;
3282
+ }
3283
+ interface InboxThreadCreatedEvent {
3284
+ type: 'inbox.thread.created';
3285
+ created_at: string;
3286
+ data: InboxThreadEmailEventData;
3287
+ }
3288
+ interface InboxThreadFolderUpdatedEvent {
3289
+ type: 'inbox.thread.folder.updated';
3290
+ created_at: string;
3291
+ data: InboxThreadFolderUpdatedEventData;
3292
+ }
3293
+ interface InboxThreadAssignedEvent {
3294
+ type: 'inbox.thread.assigned';
3295
+ created_at: string;
3296
+ data: InboxThreadAssignedEventData;
3297
+ }
3298
+ interface InboxThreadUnassignedEvent {
3299
+ type: 'inbox.thread.unassigned';
3300
+ created_at: string;
3301
+ data: InboxThreadUnassignedEventData;
3302
+ }
3303
+ interface InboxThreadLabelsUpdatedEvent {
3304
+ type: 'inbox.thread.labels.updated';
3305
+ created_at: string;
3306
+ data: InboxThreadLabelsUpdatedEventData;
3307
+ }
3308
+ interface InboxEmailReceivedEvent {
3309
+ type: 'inbox.email.received';
3310
+ created_at: string;
3311
+ data: InboxThreadEmailEventData;
3312
+ }
3313
+ interface InboxEmailSentEvent {
3314
+ type: 'inbox.email.sent';
3315
+ created_at: string;
3316
+ data: InboxThreadEmailEventData;
3317
+ }
3318
+ interface InboxDraftCreatedEvent {
3319
+ type: 'inbox.draft.created';
3320
+ created_at: string;
3321
+ data: InboxDraftEventData;
3322
+ }
3323
+ interface InboxDraftUpdatedEvent {
3324
+ type: 'inbox.draft.updated';
3325
+ created_at: string;
3326
+ data: InboxDraftEventData;
3327
+ }
3328
+ interface InboxDraftSentEvent {
3329
+ type: 'inbox.draft.sent';
3330
+ created_at: string;
3331
+ data: InboxDraftSentEventData;
3332
+ }
3333
+ interface InboxDraftDeletedEvent {
3334
+ type: 'inbox.draft.deleted';
3335
+ created_at: string;
3336
+ data: InboxDraftEventData;
3337
+ }
3338
+ type WebhookEventPayload = EmailSentEvent | EmailScheduledEvent | EmailDeliveredEvent | EmailDeliveryDelayedEvent | EmailComplainedEvent | EmailBouncedEvent | EmailOpenedEvent | EmailClickedEvent | EmailReceivedEvent | EmailFailedEvent | EmailSuppressedEvent | ContactCreatedEvent | ContactUpdatedEvent | ContactDeletedEvent | ContactTopicsUpdatedEvent | DomainCreatedEvent | DomainUpdatedEvent | DomainDeletedEvent | SuppressionAddedEvent | SuppressionRemovedEvent | TopicCreatedEvent | TopicUpdatedEvent | TopicDeletedEvent | InboxCreatedEvent | InboxUpdatedEvent | InboxDeletedEvent | InboxThreadCreatedEvent | InboxThreadFolderUpdatedEvent | InboxThreadAssignedEvent | InboxThreadUnassignedEvent | InboxThreadLabelsUpdatedEvent | InboxEmailReceivedEvent | InboxEmailSentEvent | InboxDraftCreatedEvent | InboxDraftUpdatedEvent | InboxDraftSentEvent | InboxDraftDeletedEvent;
2636
3339
  //#endregion
2637
3340
  //#region src/webhooks/interfaces/list-webhook-events.interface.d.ts
2638
3341
  type WebhookEventLogStatus = 'success' | 'pending' | 'failed' | 'attempting';
@@ -2834,6 +3537,7 @@ export declare class Resend {
2834
3537
  readonly domains: Domains;
2835
3538
  readonly emails: Emails;
2836
3539
  readonly events: Events$1;
3540
+ readonly inboxes: Inboxes;
2837
3541
  readonly logs: Logs;
2838
3542
  readonly oauthGrants: OAuthGrants;
2839
3543
  readonly suppressions: Suppressions;
@@ -2851,4 +3555,4 @@ export declare class Resend {
2851
3555
  delete<T>(path: string, query?: unknown, options?: DeleteOptions): Promise<Response<T>>;
2852
3556
  }
2853
3557
  //#endregion
2854
- export type { ContactCreatedEvent, ContactDeletedEvent, ContactTopicsUpdatedEvent, ContactUpdatedEvent, CreateWebhookOptions, CreateWebhookRequestOptions, CreateWebhookResponse, CreateWebhookResponseSuccess, DomainCreatedEvent, DomainDeletedEvent, DomainUpdatedEvent, EmailBouncedEvent, EmailClickedEvent, EmailComplainedEvent, EmailDeliveredEvent, EmailDeliveryDelayedEvent, EmailFailedEvent, EmailOpenedEvent, EmailReceivedEvent, EmailScheduledEvent, EmailSentEvent, EmailSuppressedEvent, ErrorResponse, GetAttachmentOptions, GetAttachmentResponse, GetAttachmentResponseSuccess, GetWebhookEventOptions, GetWebhookEventResponse, GetWebhookEventResponseSuccess, GetWebhookResponse, GetWebhookResponseSuccess, ListAttachmentsOptions, ListAttachmentsResponse, ListAttachmentsResponseSuccess, ListOAuthGrantsOptions, ListOAuthGrantsResponse, ListOAuthGrantsResponseSuccess, ListWebhookEventAttemptsOptions, ListWebhookEventAttemptsResponse, ListWebhookEventAttemptsResponseSuccess, ListWebhookEventsOptions, ListWebhookEventsResponse, ListWebhookEventsResponseSuccess, ListWebhooksOptions, ListWebhooksResponse, ListWebhooksResponseSuccess, OAuthGrant, RemoveWebhookResponse, RemoveWebhookResponseSuccess, ReplayWebhookEventOptions, ReplayWebhookEventResponse, ReplayWebhookEventResponseSuccess, ResendOptions, Response, RevokeOAuthGrantResponse, RevokeOAuthGrantResponseSuccess, RotateWebhookSigningSecretResponse, RotateWebhookSigningSecretResponseSuccess, SuppressionAddedEvent, SuppressionRemovedEvent, TopicCreatedEvent, TopicDeletedEvent, TopicUpdatedEvent, UpdateWebhookOptions, UpdateWebhookResponse, UpdateWebhookResponseSuccess, Webhook, WebhookEvent, WebhookEventAttempt, WebhookEventLog, WebhookEventLogStatus, WebhookEventPayload };
3558
+ export type { ContactCreatedEvent, ContactDeletedEvent, ContactTopicsUpdatedEvent, ContactUpdatedEvent, CreateInboxDraftOptions, CreateInboxDraftRequestOptions, CreateInboxDraftResponse, CreateInboxDraftResponseSuccess, CreateInboxLabelOptions, CreateInboxLabelRequestOptions, CreateInboxLabelResponse, CreateInboxLabelResponseSuccess, CreateInboxOptions, CreateInboxRequestOptions, CreateInboxResponse, CreateInboxResponseSuccess, CreateWebhookOptions, CreateWebhookRequestOptions, CreateWebhookResponse, CreateWebhookResponseSuccess, DomainCreatedEvent, DomainDeletedEvent, DomainUpdatedEvent, EmailBouncedEvent, EmailClickedEvent, EmailComplainedEvent, EmailDeliveredEvent, EmailDeliveryDelayedEvent, EmailFailedEvent, EmailOpenedEvent, EmailReceivedEvent, EmailScheduledEvent, EmailSentEvent, EmailSuppressedEvent, ErrorResponse, ForwardInboxThreadEmailOptions, ForwardInboxThreadEmailRequestOptions, ForwardInboxThreadEmailResponse, ForwardInboxThreadEmailResponseSuccess, GetAttachmentOptions, GetAttachmentResponse, GetAttachmentResponseSuccess, GetInboxAgentOptions, GetInboxAgentResponse, GetInboxAgentResponseSuccess, GetInboxDraftOptions, GetInboxDraftResponse, GetInboxDraftResponseSuccess, GetInboxResponse, GetInboxResponseSuccess, GetInboxThreadEmailOptions, GetInboxThreadEmailResponse, GetInboxThreadEmailResponseSuccess, GetInboxThreadOptions, GetInboxThreadResponse, GetInboxThreadResponseSuccess, GetWebhookEventOptions, GetWebhookEventResponse, GetWebhookEventResponseSuccess, GetWebhookResponse, GetWebhookResponseSuccess, Inbox, InboxAgentAction, InboxAgentSettings, InboxCreatedEvent, InboxDeletedEvent, InboxDraft, InboxDraftAttachment, InboxDraftAttachmentOptions, InboxDraftCreatedEvent, InboxDraftDeletedEvent, InboxDraftListItem, InboxDraftSentEvent, InboxDraftType, InboxDraftUpdatedEvent, InboxEmailReceivedEvent, InboxEmailSentEvent, InboxLabel, InboxLabelColor, InboxMessage, InboxMessageAttachment, InboxMessageFolder, InboxThread, InboxThreadAssignedEvent, InboxThreadCreatedEvent, InboxThreadFolderUpdatedEvent, InboxThreadLabel, InboxThreadLabelsUpdatedEvent, InboxThreadSearchHighlightKey, InboxThreadSearchResult, InboxThreadSummary, InboxThreadUnassignedEvent, InboxUpdatedEvent, ListAttachmentsOptions, ListAttachmentsResponse, ListAttachmentsResponseSuccess, ListInboxDraftsOptions, ListInboxDraftsResponse, ListInboxDraftsResponseSuccess, ListInboxLabelsOptions, ListInboxLabelsResponse, ListInboxLabelsResponseSuccess, ListInboxThreadEmailsOptions, ListInboxThreadEmailsResponse, ListInboxThreadEmailsResponseSuccess, ListInboxThreadsOptions, ListInboxThreadsResponse, ListInboxThreadsResponseSuccess, ListInboxesOptions, ListInboxesResponse, ListInboxesResponseSuccess, ListOAuthGrantsOptions, ListOAuthGrantsResponse, ListOAuthGrantsResponseSuccess, ListWebhookEventAttemptsOptions, ListWebhookEventAttemptsResponse, ListWebhookEventAttemptsResponseSuccess, ListWebhookEventsOptions, ListWebhookEventsResponse, ListWebhookEventsResponseSuccess, ListWebhooksOptions, ListWebhooksResponse, ListWebhooksResponseSuccess, MoveThreadFolder, OAuthGrant, RemoveInboxDraftOptions, RemoveInboxDraftResponse, RemoveInboxDraftResponseSuccess, RemoveInboxLabelOptions, RemoveInboxLabelResponse, RemoveInboxLabelResponseSuccess, RemoveInboxResponse, RemoveInboxResponseSuccess, RemoveInboxThreadOptions, RemoveInboxThreadResponse, RemoveInboxThreadResponseSuccess, RemoveWebhookResponse, RemoveWebhookResponseSuccess, ReplayWebhookEventOptions, ReplayWebhookEventResponse, ReplayWebhookEventResponseSuccess, ReplyInboxThreadEmailOptions, ReplyInboxThreadEmailRequestOptions, ReplyInboxThreadEmailResponse, ReplyInboxThreadEmailResponseSuccess, ResendOptions, Response, RevokeOAuthGrantResponse, RevokeOAuthGrantResponseSuccess, RotateWebhookSigningSecretResponse, RotateWebhookSigningSecretResponseSuccess, SearchInboxThreadsOptions, SearchInboxThreadsResponse, SearchInboxThreadsResponseSuccess, SendInboxDraftOptions, SendInboxDraftRequestOptions, SendInboxDraftResponse, SendInboxDraftResponseSuccess, SuppressionAddedEvent, SuppressionRemovedEvent, TopicCreatedEvent, TopicDeletedEvent, TopicUpdatedEvent, UpdateInboxAgentOptions, UpdateInboxAgentResponse, UpdateInboxAgentResponseSuccess, UpdateInboxDraftOptions, UpdateInboxDraftResponse, UpdateInboxDraftResponseSuccess, UpdateInboxLabelOptions, UpdateInboxLabelResponse, UpdateInboxLabelResponseSuccess, UpdateInboxOptions, UpdateInboxResponse, UpdateInboxResponseSuccess, UpdateInboxThreadOptions, UpdateInboxThreadResponse, UpdateInboxThreadResponseSuccess, UpdateWebhookOptions, UpdateWebhookResponse, UpdateWebhookResponseSuccess, Webhook, WebhookEvent, WebhookEventAttempt, WebhookEventLog, WebhookEventLogStatus, WebhookEventPayload };