resend 0.11.0 → 0.11.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/build/package.json +1 -1
- package/build/src/interfaces.d.ts +2 -2
- package/build/src/resend.js +12 -0
- package/package.json +1 -1
package/build/package.json
CHANGED
|
@@ -13,9 +13,9 @@ export interface SendEmailData {
|
|
|
13
13
|
reply_to?: string | string[];
|
|
14
14
|
/** Email subject. */
|
|
15
15
|
subject?: string;
|
|
16
|
-
/** The HTML version of the message. */
|
|
17
|
-
text?: string;
|
|
18
16
|
/** The plain text version of the message. */
|
|
17
|
+
text?: string;
|
|
18
|
+
/** The HTML version of the message. */
|
|
19
19
|
html?: string;
|
|
20
20
|
/** The React version of the message. */
|
|
21
21
|
react?: ReactElement;
|
package/build/src/resend.js
CHANGED
|
@@ -38,6 +38,18 @@ class Resend {
|
|
|
38
38
|
maxContentLength: Infinity,
|
|
39
39
|
maxBodyLength: Infinity,
|
|
40
40
|
});
|
|
41
|
+
this.request.interceptors.response.use((response) => {
|
|
42
|
+
return response;
|
|
43
|
+
}, (error) => {
|
|
44
|
+
var _a, _b, _c;
|
|
45
|
+
if ((_b = (_a = error === null || error === void 0 ? void 0 : error.response) === null || _a === void 0 ? void 0 : _a.data) === null || _b === void 0 ? void 0 : _b.error) {
|
|
46
|
+
return Promise.reject(error.response.data.error);
|
|
47
|
+
}
|
|
48
|
+
if ((_c = error === null || error === void 0 ? void 0 : error.response) === null || _c === void 0 ? void 0 : _c.data) {
|
|
49
|
+
return Promise.reject(error.response.data);
|
|
50
|
+
}
|
|
51
|
+
return Promise.reject(error);
|
|
52
|
+
});
|
|
41
53
|
}
|
|
42
54
|
sendEmail(data) {
|
|
43
55
|
return __awaiter(this, void 0, void 0, function* () {
|