resend 6.33.0 → 6.34.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 +161 -57
- package/dist/index.d.cts +146 -116
- package/dist/index.d.mts +146 -116
- package/dist/index.mjs +161 -58
- package/package.json +1 -1
- package/readme.md +11 -0
package/dist/index.d.cts
CHANGED
|
@@ -1761,29 +1761,58 @@ export interface UpdateEventResponseSuccess {
|
|
|
1761
1761
|
export type UpdateEventResponse = Response<UpdateEventResponseSuccess>;
|
|
1762
1762
|
//#endregion
|
|
1763
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", "
|
|
1764
|
+
export declare const INBOX_AGENT_ACTIONS: readonly ["draft_reply", "forward_thread", "add_labels", "assign_thread", "mark_as_spam", "archive", "move_to_trash"];
|
|
1765
1765
|
type InboxAgentAction = (typeof INBOX_AGENT_ACTIONS)[number];
|
|
1766
|
+
export declare const INBOX_AGENT_TONES: readonly ["concise_professional", "concise_casual", "expanded_professional", "expanded_casual"];
|
|
1767
|
+
type InboxAgentTone = (typeof INBOX_AGENT_TONES)[number];
|
|
1766
1768
|
interface InboxAgentSettings {
|
|
1767
1769
|
object: 'inbox_agent';
|
|
1768
1770
|
instructions: string | null;
|
|
1769
|
-
tone:
|
|
1770
|
-
|
|
1771
|
+
tone: InboxAgentTone | null;
|
|
1772
|
+
actions: InboxAgentAction[];
|
|
1771
1773
|
}
|
|
1772
1774
|
//#endregion
|
|
1773
|
-
//#region src/inboxes/
|
|
1774
|
-
|
|
1775
|
+
//#region src/inboxes/interfaces/inbox.d.ts
|
|
1776
|
+
export declare const INBOX_MESSAGE_FOLDERS: readonly ["inbox", "archive", "spam", "sent", "trash"];
|
|
1777
|
+
type InboxMessageFolder = (typeof INBOX_MESSAGE_FOLDERS)[number];
|
|
1778
|
+
export declare const MOVE_THREAD_FOLDERS: readonly ["inbox", "archive", "spam", "trash"];
|
|
1779
|
+
type MoveThreadFolder = (typeof MOVE_THREAD_FOLDERS)[number];
|
|
1780
|
+
/**
|
|
1781
|
+
* Hex color in the #RRGGBB format
|
|
1782
|
+
*
|
|
1783
|
+
* @example '#E93D82'
|
|
1784
|
+
*/
|
|
1785
|
+
type InboxLabelColor = string;
|
|
1786
|
+
type InboxSelector = {
|
|
1787
|
+
/** The inbox ID. */
|
|
1775
1788
|
inboxId: string;
|
|
1789
|
+
emailAddress?: never;
|
|
1790
|
+
} | {
|
|
1791
|
+
inboxId?: never;
|
|
1792
|
+
/** The inbox email address, such as `support@example.com`. */
|
|
1793
|
+
emailAddress: string;
|
|
1794
|
+
};
|
|
1795
|
+
interface Inbox {
|
|
1796
|
+
id: string;
|
|
1797
|
+
name: string | null;
|
|
1798
|
+
email_address: string;
|
|
1799
|
+
from_name: string | null;
|
|
1800
|
+
unread: number;
|
|
1801
|
+
last_received: string | null;
|
|
1802
|
+
created_at: string;
|
|
1803
|
+
updated_at: string;
|
|
1776
1804
|
}
|
|
1805
|
+
//#endregion
|
|
1806
|
+
//#region src/inboxes/agent/interfaces/get-inbox-agent.interface.d.ts
|
|
1807
|
+
type GetInboxAgentOptions = InboxSelector;
|
|
1777
1808
|
type GetInboxAgentResponseSuccess = InboxAgentSettings;
|
|
1778
1809
|
type GetInboxAgentResponse = Response<GetInboxAgentResponseSuccess>;
|
|
1779
1810
|
//#endregion
|
|
1780
1811
|
//#region src/inboxes/agent/interfaces/update-inbox-agent.interface.d.ts
|
|
1781
|
-
type UpdateInboxAgentOptions = {
|
|
1782
|
-
inboxId: string;
|
|
1783
|
-
} & RequireAtLeastOne<{
|
|
1812
|
+
type UpdateInboxAgentOptions = InboxSelector & RequireAtLeastOne<{
|
|
1784
1813
|
instructions?: string | null;
|
|
1785
|
-
tone?:
|
|
1786
|
-
|
|
1814
|
+
tone?: InboxAgentTone | null;
|
|
1815
|
+
actions?: InboxAgentAction[];
|
|
1787
1816
|
}>;
|
|
1788
1817
|
interface UpdateInboxAgentResponseSuccess {
|
|
1789
1818
|
object: 'inbox_agent';
|
|
@@ -1850,9 +1879,7 @@ type CreateInboxDraftContent = RequireAtLeastOne<{
|
|
|
1850
1879
|
*/
|
|
1851
1880
|
attachments?: InboxDraftAttachmentOptions[];
|
|
1852
1881
|
}>;
|
|
1853
|
-
type CreateInboxDraftOptions = {
|
|
1854
|
-
inboxId: string;
|
|
1855
|
-
} & CreateInboxDraftContent & ({
|
|
1882
|
+
type CreateInboxDraftOptions = InboxSelector & CreateInboxDraftContent & ({
|
|
1856
1883
|
threadId: string;
|
|
1857
1884
|
replyToEmailId: string;
|
|
1858
1885
|
} | {
|
|
@@ -1867,17 +1894,14 @@ interface CreateInboxDraftResponseSuccess {
|
|
|
1867
1894
|
type CreateInboxDraftResponse = Response<CreateInboxDraftResponseSuccess>;
|
|
1868
1895
|
//#endregion
|
|
1869
1896
|
//#region src/inboxes/drafts/interfaces/get-inbox-draft.interface.d.ts
|
|
1870
|
-
|
|
1871
|
-
inboxId: string;
|
|
1897
|
+
type GetInboxDraftOptions = InboxSelector & {
|
|
1872
1898
|
draftId: string;
|
|
1873
|
-
}
|
|
1899
|
+
};
|
|
1874
1900
|
type GetInboxDraftResponseSuccess = InboxDraft;
|
|
1875
1901
|
type GetInboxDraftResponse = Response<GetInboxDraftResponseSuccess>;
|
|
1876
1902
|
//#endregion
|
|
1877
1903
|
//#region src/inboxes/drafts/interfaces/list-inbox-drafts.interface.d.ts
|
|
1878
|
-
type ListInboxDraftsOptions =
|
|
1879
|
-
inboxId: string;
|
|
1880
|
-
} & PaginationOptions;
|
|
1904
|
+
type ListInboxDraftsOptions = InboxSelector & PaginationOptions;
|
|
1881
1905
|
interface ListInboxDraftsResponseSuccess {
|
|
1882
1906
|
object: 'list';
|
|
1883
1907
|
has_more: boolean;
|
|
@@ -1886,10 +1910,9 @@ interface ListInboxDraftsResponseSuccess {
|
|
|
1886
1910
|
type ListInboxDraftsResponse = Response<ListInboxDraftsResponseSuccess>;
|
|
1887
1911
|
//#endregion
|
|
1888
1912
|
//#region src/inboxes/drafts/interfaces/remove-inbox-draft.interface.d.ts
|
|
1889
|
-
|
|
1890
|
-
inboxId: string;
|
|
1913
|
+
type RemoveInboxDraftOptions = InboxSelector & {
|
|
1891
1914
|
draftId: string;
|
|
1892
|
-
}
|
|
1915
|
+
};
|
|
1893
1916
|
interface RemoveInboxDraftResponseSuccess {
|
|
1894
1917
|
object: 'inbox_draft';
|
|
1895
1918
|
id: string;
|
|
@@ -1898,8 +1921,7 @@ interface RemoveInboxDraftResponseSuccess {
|
|
|
1898
1921
|
type RemoveInboxDraftResponse = Response<RemoveInboxDraftResponseSuccess>;
|
|
1899
1922
|
//#endregion
|
|
1900
1923
|
//#region src/inboxes/drafts/interfaces/send-inbox-draft.interface.d.ts
|
|
1901
|
-
|
|
1902
|
-
inboxId: string;
|
|
1924
|
+
type SendInboxDraftOptions = InboxSelector & {
|
|
1903
1925
|
draftId: string;
|
|
1904
1926
|
/**
|
|
1905
1927
|
* Custom headers to add to the email.
|
|
@@ -1909,7 +1931,7 @@ interface SendInboxDraftOptions {
|
|
|
1909
1931
|
* `null` means no custom headers.
|
|
1910
1932
|
*/
|
|
1911
1933
|
headers?: Record<string, string> | null;
|
|
1912
|
-
}
|
|
1934
|
+
};
|
|
1913
1935
|
interface SendInboxDraftRequestOptions extends PostOptions, IdempotentRequest {}
|
|
1914
1936
|
interface SendInboxDraftResponseSuccess {
|
|
1915
1937
|
id: string;
|
|
@@ -1917,8 +1939,7 @@ interface SendInboxDraftResponseSuccess {
|
|
|
1917
1939
|
type SendInboxDraftResponse = Response<SendInboxDraftResponseSuccess>;
|
|
1918
1940
|
//#endregion
|
|
1919
1941
|
//#region src/inboxes/drafts/interfaces/update-inbox-draft.interface.d.ts
|
|
1920
|
-
type UpdateInboxDraftOptions = {
|
|
1921
|
-
inboxId: string;
|
|
1942
|
+
type UpdateInboxDraftOptions = InboxSelector & {
|
|
1922
1943
|
draftId: string;
|
|
1923
1944
|
} & RequireAtLeastOne<{
|
|
1924
1945
|
to?: string | string[] | null;
|
|
@@ -1934,30 +1955,17 @@ type UpdateInboxDraftOptions = {
|
|
|
1934
1955
|
*/
|
|
1935
1956
|
attachments?: InboxDraftAttachmentOptions[] | null;
|
|
1936
1957
|
}>;
|
|
1937
|
-
|
|
1938
|
-
|
|
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 {
|
|
1958
|
+
interface UpdateInboxDraftResponseSuccess {
|
|
1959
|
+
object: 'inbox_draft';
|
|
1947
1960
|
id: string;
|
|
1948
|
-
name: string | null;
|
|
1949
|
-
email_address: string;
|
|
1950
|
-
from_name: string | null;
|
|
1951
|
-
unread: number;
|
|
1952
|
-
last_received: string | null;
|
|
1953
1961
|
}
|
|
1962
|
+
type UpdateInboxDraftResponse = Response<UpdateInboxDraftResponseSuccess>;
|
|
1954
1963
|
//#endregion
|
|
1955
1964
|
//#region src/inboxes/labels/interfaces/create-inbox-label.interface.d.ts
|
|
1956
|
-
|
|
1957
|
-
inboxId: string;
|
|
1965
|
+
type CreateInboxLabelOptions = InboxSelector & {
|
|
1958
1966
|
name: string;
|
|
1959
1967
|
color?: InboxLabelColor;
|
|
1960
|
-
}
|
|
1968
|
+
};
|
|
1961
1969
|
interface CreateInboxLabelRequestOptions extends PostOptions {}
|
|
1962
1970
|
interface CreateInboxLabelResponseSuccess {
|
|
1963
1971
|
object: 'inbox_label';
|
|
@@ -1974,9 +1982,7 @@ interface InboxLabel {
|
|
|
1974
1982
|
}
|
|
1975
1983
|
//#endregion
|
|
1976
1984
|
//#region src/inboxes/labels/interfaces/list-inbox-labels.interface.d.ts
|
|
1977
|
-
|
|
1978
|
-
inboxId: string;
|
|
1979
|
-
}
|
|
1985
|
+
type ListInboxLabelsOptions = InboxSelector;
|
|
1980
1986
|
interface ListInboxLabelsResponseSuccess {
|
|
1981
1987
|
object: 'list';
|
|
1982
1988
|
data: InboxLabel[];
|
|
@@ -1984,10 +1990,9 @@ interface ListInboxLabelsResponseSuccess {
|
|
|
1984
1990
|
type ListInboxLabelsResponse = Response<ListInboxLabelsResponseSuccess>;
|
|
1985
1991
|
//#endregion
|
|
1986
1992
|
//#region src/inboxes/labels/interfaces/remove-inbox-label.interface.d.ts
|
|
1987
|
-
|
|
1988
|
-
inboxId: string;
|
|
1993
|
+
type RemoveInboxLabelOptions = InboxSelector & {
|
|
1989
1994
|
labelId: string;
|
|
1990
|
-
}
|
|
1995
|
+
};
|
|
1991
1996
|
interface RemoveInboxLabelResponseSuccess {
|
|
1992
1997
|
object: 'inbox_label';
|
|
1993
1998
|
id: string;
|
|
@@ -1996,60 +2001,27 @@ interface RemoveInboxLabelResponseSuccess {
|
|
|
1996
2001
|
type RemoveInboxLabelResponse = Response<RemoveInboxLabelResponseSuccess>;
|
|
1997
2002
|
//#endregion
|
|
1998
2003
|
//#region src/inboxes/labels/interfaces/update-inbox-label.interface.d.ts
|
|
1999
|
-
|
|
2000
|
-
inboxId: string;
|
|
2004
|
+
type UpdateInboxLabelOptions = InboxSelector & {
|
|
2001
2005
|
labelId: string;
|
|
2002
2006
|
name?: string;
|
|
2003
2007
|
color?: InboxLabelColor;
|
|
2004
|
-
}
|
|
2008
|
+
};
|
|
2005
2009
|
interface UpdateInboxLabelResponseSuccess {
|
|
2006
2010
|
object: 'inbox_label';
|
|
2007
2011
|
id: string;
|
|
2008
2012
|
}
|
|
2009
2013
|
type UpdateInboxLabelResponse = Response<UpdateInboxLabelResponseSuccess>;
|
|
2010
2014
|
//#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
2015
|
//#region src/inboxes/threads/interfaces/thread.d.ts
|
|
2048
2016
|
interface InboxThreadLabel {
|
|
2049
2017
|
id: string;
|
|
2050
2018
|
name: string;
|
|
2051
2019
|
color: InboxLabelColor;
|
|
2052
2020
|
}
|
|
2021
|
+
interface InboxThreadLabelList {
|
|
2022
|
+
object: 'list';
|
|
2023
|
+
data: InboxThreadLabel[];
|
|
2024
|
+
}
|
|
2053
2025
|
interface InboxThread {
|
|
2054
2026
|
id: string;
|
|
2055
2027
|
subject: string | null;
|
|
@@ -2095,26 +2067,67 @@ interface InboxMessage {
|
|
|
2095
2067
|
received_at: string;
|
|
2096
2068
|
}
|
|
2097
2069
|
//#endregion
|
|
2098
|
-
//#region src/inboxes/threads/interfaces/
|
|
2099
|
-
|
|
2100
|
-
inboxId: string;
|
|
2070
|
+
//#region src/inboxes/threads/interfaces/add-inbox-thread-labels.interface.d.ts
|
|
2071
|
+
type AddInboxThreadLabelsOptions = InboxSelector & {
|
|
2101
2072
|
threadId: string;
|
|
2073
|
+
/** Between 1 and 10 label IDs. */
|
|
2074
|
+
labels: string[];
|
|
2075
|
+
};
|
|
2076
|
+
type AddInboxThreadLabelsResponseSuccess = InboxThreadLabelList;
|
|
2077
|
+
type AddInboxThreadLabelsResponse = Response<AddInboxThreadLabelsResponseSuccess>;
|
|
2078
|
+
//#endregion
|
|
2079
|
+
//#region src/inboxes/threads/interfaces/forward-inbox-thread-email.interface.d.ts
|
|
2080
|
+
type ForwardInboxThreadEmailOptions = InboxSelector & {
|
|
2081
|
+
threadId: string;
|
|
2082
|
+
emailId: string;
|
|
2083
|
+
to: string | string[];
|
|
2084
|
+
cc?: string | string[];
|
|
2085
|
+
bcc?: string | string[];
|
|
2086
|
+
html?: string;
|
|
2087
|
+
text?: string;
|
|
2088
|
+
subject?: string;
|
|
2089
|
+
/**
|
|
2090
|
+
* Files to attach, as on `POST /emails`. Each one needs `content` or `path`.
|
|
2091
|
+
* They share one limit with the attachments of the original message, which the forward also sends.
|
|
2092
|
+
* Together they can have up to 10 files and at most 25 MB of `content`.
|
|
2093
|
+
* A `path` file counts toward the 10 files only, because it is fetched when the email is sent.
|
|
2094
|
+
* 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`,
|
|
2095
|
+
* or a `content_type` that is not a valid MIME type returns a 422.
|
|
2096
|
+
* An original attachment that was sent from a URL (`path`) cannot be forwarded, and the request returns a 422.
|
|
2097
|
+
*/
|
|
2098
|
+
attachments?: Attachment[];
|
|
2099
|
+
/**
|
|
2100
|
+
* Custom headers to add to the email.
|
|
2101
|
+
* The `In-Reply-To`, `References` and `Reply-To` headers are set by Resend and cannot be set here.
|
|
2102
|
+
* Sending one of them, in any letter case, returns a 422.
|
|
2103
|
+
* Header names cannot be empty, and names and values cannot contain line breaks or null characters, or the request returns a 422.
|
|
2104
|
+
* `null` means no custom headers.
|
|
2105
|
+
*/
|
|
2106
|
+
headers?: Record<string, string> | null;
|
|
2107
|
+
};
|
|
2108
|
+
interface ForwardInboxThreadEmailRequestOptions extends PostOptions, IdempotentRequest {}
|
|
2109
|
+
interface ForwardInboxThreadEmailResponseSuccess {
|
|
2110
|
+
id: string;
|
|
2102
2111
|
}
|
|
2112
|
+
type ForwardInboxThreadEmailResponse = Response<ForwardInboxThreadEmailResponseSuccess>;
|
|
2113
|
+
//#endregion
|
|
2114
|
+
//#region src/inboxes/threads/interfaces/get-inbox-thread.interface.d.ts
|
|
2115
|
+
type GetInboxThreadOptions = InboxSelector & {
|
|
2116
|
+
threadId: string;
|
|
2117
|
+
};
|
|
2103
2118
|
type GetInboxThreadResponseSuccess = InboxThreadSummary;
|
|
2104
2119
|
type GetInboxThreadResponse = Response<GetInboxThreadResponseSuccess>;
|
|
2105
2120
|
//#endregion
|
|
2106
2121
|
//#region src/inboxes/threads/interfaces/get-inbox-thread-email.interface.d.ts
|
|
2107
|
-
|
|
2108
|
-
inboxId: string;
|
|
2122
|
+
type GetInboxThreadEmailOptions = InboxSelector & {
|
|
2109
2123
|
threadId: string;
|
|
2110
2124
|
emailId: string;
|
|
2111
|
-
}
|
|
2125
|
+
};
|
|
2112
2126
|
type GetInboxThreadEmailResponseSuccess = InboxMessage;
|
|
2113
2127
|
type GetInboxThreadEmailResponse = Response<GetInboxThreadEmailResponseSuccess>;
|
|
2114
2128
|
//#endregion
|
|
2115
2129
|
//#region src/inboxes/threads/interfaces/list-inbox-thread-emails.interface.d.ts
|
|
2116
|
-
type ListInboxThreadEmailsOptions = {
|
|
2117
|
-
inboxId: string;
|
|
2130
|
+
type ListInboxThreadEmailsOptions = InboxSelector & {
|
|
2118
2131
|
threadId: string;
|
|
2119
2132
|
} & PaginationOptions;
|
|
2120
2133
|
interface ListInboxThreadEmailsResponseSuccess {
|
|
@@ -2125,8 +2138,7 @@ interface ListInboxThreadEmailsResponseSuccess {
|
|
|
2125
2138
|
type ListInboxThreadEmailsResponse = Response<ListInboxThreadEmailsResponseSuccess>;
|
|
2126
2139
|
//#endregion
|
|
2127
2140
|
//#region src/inboxes/threads/interfaces/list-inbox-threads.interface.d.ts
|
|
2128
|
-
type ListInboxThreadsOptions = {
|
|
2129
|
-
inboxId: string;
|
|
2141
|
+
type ListInboxThreadsOptions = InboxSelector & {
|
|
2130
2142
|
folders?: InboxMessageFolder[];
|
|
2131
2143
|
labels?: string[];
|
|
2132
2144
|
read?: boolean;
|
|
@@ -2139,10 +2151,9 @@ interface ListInboxThreadsResponseSuccess {
|
|
|
2139
2151
|
type ListInboxThreadsResponse = Response<ListInboxThreadsResponseSuccess>;
|
|
2140
2152
|
//#endregion
|
|
2141
2153
|
//#region src/inboxes/threads/interfaces/remove-inbox-thread.interface.d.ts
|
|
2142
|
-
|
|
2143
|
-
inboxId: string;
|
|
2154
|
+
type RemoveInboxThreadOptions = InboxSelector & {
|
|
2144
2155
|
threadId: string;
|
|
2145
|
-
}
|
|
2156
|
+
};
|
|
2146
2157
|
interface RemoveInboxThreadResponseSuccess {
|
|
2147
2158
|
object: 'inbox_thread';
|
|
2148
2159
|
id: string;
|
|
@@ -2150,9 +2161,16 @@ interface RemoveInboxThreadResponseSuccess {
|
|
|
2150
2161
|
}
|
|
2151
2162
|
type RemoveInboxThreadResponse = Response<RemoveInboxThreadResponseSuccess>;
|
|
2152
2163
|
//#endregion
|
|
2164
|
+
//#region src/inboxes/threads/interfaces/remove-inbox-thread-label.interface.d.ts
|
|
2165
|
+
type RemoveInboxThreadLabelOptions = InboxSelector & {
|
|
2166
|
+
threadId: string;
|
|
2167
|
+
labelId: string;
|
|
2168
|
+
};
|
|
2169
|
+
type RemoveInboxThreadLabelResponseSuccess = InboxThreadLabelList;
|
|
2170
|
+
type RemoveInboxThreadLabelResponse = Response<RemoveInboxThreadLabelResponseSuccess>;
|
|
2171
|
+
//#endregion
|
|
2153
2172
|
//#region src/inboxes/threads/interfaces/reply-inbox-thread-email.interface.d.ts
|
|
2154
|
-
type ReplyInboxThreadEmailOptions = {
|
|
2155
|
-
inboxId: string;
|
|
2173
|
+
type ReplyInboxThreadEmailOptions = InboxSelector & {
|
|
2156
2174
|
threadId: string;
|
|
2157
2175
|
emailId: string;
|
|
2158
2176
|
} & RequireAtLeastOne<{
|
|
@@ -2197,10 +2215,8 @@ type SearchInboxThreadsOptions = ListInboxThreadsOptions & {
|
|
|
2197
2215
|
startDate?: string;
|
|
2198
2216
|
endDate?: string;
|
|
2199
2217
|
};
|
|
2200
|
-
type InboxThreadSearchHighlightKey = 'subject' | 'body' | 'from' | 'to' | 'cc' | 'bcc' | 'attachments';
|
|
2201
2218
|
interface InboxThreadSearchResult extends InboxThread {
|
|
2202
2219
|
matched_email_id: string | null;
|
|
2203
|
-
highlights: Partial<Record<InboxThreadSearchHighlightKey, string[]>>;
|
|
2204
2220
|
}
|
|
2205
2221
|
interface SearchInboxThreadsResponseSuccess {
|
|
2206
2222
|
object: 'list';
|
|
@@ -2209,17 +2225,20 @@ interface SearchInboxThreadsResponseSuccess {
|
|
|
2209
2225
|
}
|
|
2210
2226
|
type SearchInboxThreadsResponse = Response<SearchInboxThreadsResponseSuccess>;
|
|
2211
2227
|
//#endregion
|
|
2228
|
+
//#region src/inboxes/threads/interfaces/set-inbox-thread-labels.interface.d.ts
|
|
2229
|
+
type SetInboxThreadLabelsOptions = InboxSelector & {
|
|
2230
|
+
threadId: string;
|
|
2231
|
+
labels: string[];
|
|
2232
|
+
};
|
|
2233
|
+
type SetInboxThreadLabelsResponseSuccess = InboxThreadLabelList;
|
|
2234
|
+
type SetInboxThreadLabelsResponse = Response<SetInboxThreadLabelsResponseSuccess>;
|
|
2235
|
+
//#endregion
|
|
2212
2236
|
//#region src/inboxes/threads/interfaces/update-inbox-thread.interface.d.ts
|
|
2213
|
-
type UpdateInboxThreadOptions = {
|
|
2214
|
-
inboxId: string;
|
|
2237
|
+
type UpdateInboxThreadOptions = InboxSelector & {
|
|
2215
2238
|
threadId: string;
|
|
2216
2239
|
} & RequireAtLeastOne<{
|
|
2217
2240
|
read?: boolean;
|
|
2218
2241
|
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
2242
|
}>;
|
|
2224
2243
|
type UpdateInboxThreadResponseSuccess = InboxThreadSummary;
|
|
2225
2244
|
type UpdateInboxThreadResponse = Response<UpdateInboxThreadResponseSuccess>;
|
|
@@ -2251,6 +2270,7 @@ interface GetInboxResponseSuccess {
|
|
|
2251
2270
|
drafts: number;
|
|
2252
2271
|
last_received: string | null;
|
|
2253
2272
|
created_at: string;
|
|
2273
|
+
updated_at: string;
|
|
2254
2274
|
}
|
|
2255
2275
|
type GetInboxResponse = Response<GetInboxResponseSuccess>;
|
|
2256
2276
|
//#endregion
|
|
@@ -2571,10 +2591,20 @@ declare class InboxThreadEmails {
|
|
|
2571
2591
|
forward(payload: ForwardInboxThreadEmailOptions, options?: ForwardInboxThreadEmailRequestOptions): Promise<ForwardInboxThreadEmailResponse>;
|
|
2572
2592
|
}
|
|
2573
2593
|
//#endregion
|
|
2594
|
+
//#region src/inboxes/threads/labels/labels.d.ts
|
|
2595
|
+
declare class InboxThreadLabels {
|
|
2596
|
+
private readonly resend;
|
|
2597
|
+
constructor(resend: Resend);
|
|
2598
|
+
add(options: AddInboxThreadLabelsOptions, requestOptions?: RequestOptions): Promise<AddInboxThreadLabelsResponse>;
|
|
2599
|
+
set(options: SetInboxThreadLabelsOptions, requestOptions?: RequestOptions): Promise<SetInboxThreadLabelsResponse>;
|
|
2600
|
+
remove(options: RemoveInboxThreadLabelOptions, requestOptions?: RequestOptions): Promise<RemoveInboxThreadLabelResponse>;
|
|
2601
|
+
}
|
|
2602
|
+
//#endregion
|
|
2574
2603
|
//#region src/inboxes/threads/threads.d.ts
|
|
2575
2604
|
declare class InboxThreads {
|
|
2576
2605
|
private readonly resend;
|
|
2577
2606
|
readonly emails: InboxThreadEmails;
|
|
2607
|
+
readonly labels: InboxThreadLabels;
|
|
2578
2608
|
constructor(resend: Resend);
|
|
2579
2609
|
list(options: ListInboxThreadsOptions, requestOptions?: RequestOptions): Promise<ListInboxThreadsResponse>;
|
|
2580
2610
|
search(options: SearchInboxThreadsOptions, requestOptions?: RequestOptions): Promise<SearchInboxThreadsResponse>;
|
|
@@ -2594,8 +2624,8 @@ declare class Inboxes {
|
|
|
2594
2624
|
create(payload: CreateInboxOptions, options?: CreateInboxRequestOptions): Promise<CreateInboxResponse>;
|
|
2595
2625
|
list(options?: ListInboxesOptions, requestOptions?: RequestOptions): Promise<ListInboxesResponse>;
|
|
2596
2626
|
get(idOrEmail: string, requestOptions?: RequestOptions): Promise<GetInboxResponse>;
|
|
2597
|
-
update(
|
|
2598
|
-
remove(
|
|
2627
|
+
update(idOrEmail: string, payload: UpdateInboxOptions, requestOptions?: RequestOptions): Promise<UpdateInboxResponse>;
|
|
2628
|
+
remove(idOrEmail: string, requestOptions?: RequestOptions): Promise<RemoveInboxResponse>;
|
|
2599
2629
|
}
|
|
2600
2630
|
//#endregion
|
|
2601
2631
|
//#region src/logs/logs.d.ts
|
|
@@ -3555,4 +3585,4 @@ export declare class Resend {
|
|
|
3555
3585
|
delete<T>(path: string, query?: unknown, options?: DeleteOptions): Promise<Response<T>>;
|
|
3556
3586
|
}
|
|
3557
3587
|
//#endregion
|
|
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,
|
|
3588
|
+
export type { AddInboxThreadLabelsOptions, AddInboxThreadLabelsResponse, AddInboxThreadLabelsResponseSuccess, 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, InboxAgentTone, InboxCreatedEvent, InboxDeletedEvent, InboxDraft, InboxDraftAttachment, InboxDraftAttachmentOptions, InboxDraftCreatedEvent, InboxDraftDeletedEvent, InboxDraftListItem, InboxDraftSentEvent, InboxDraftType, InboxDraftUpdatedEvent, InboxEmailReceivedEvent, InboxEmailSentEvent, InboxLabel, InboxLabelColor, InboxMessage, InboxMessageAttachment, InboxMessageFolder, InboxSelector, InboxThread, InboxThreadAssignedEvent, InboxThreadCreatedEvent, InboxThreadFolderUpdatedEvent, InboxThreadLabel, InboxThreadLabelList, InboxThreadLabelsUpdatedEvent, 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, RemoveInboxThreadLabelOptions, RemoveInboxThreadLabelResponse, RemoveInboxThreadLabelResponseSuccess, 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, SetInboxThreadLabelsOptions, SetInboxThreadLabelsResponse, SetInboxThreadLabelsResponseSuccess, 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 };
|