@lovable.dev/email-js 0.1.0-rc.3 → 0.1.0-rc.5

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
@@ -93,11 +93,16 @@ async function throwIfNotOk(response) {
93
93
  return;
94
94
  const errorText = await response.text();
95
95
  const safeErrorText = errorText.length > 500 ? `${errorText.slice(0, 500)}...` : errorText;
96
+ const retryAfterSeconds = parseRetryAfter(response.headers.get("Retry-After"));
97
+ const code = parseErrorCode(errorText);
98
+ if (response.status === 429) {
99
+ console.error("[email-js] rate limited:", { status: response.status, code, retryAfterSeconds });
100
+ }
96
101
  throw new EmailAPIError(
97
102
  response.status,
98
103
  `Email API error: ${response.status} ${safeErrorText}`,
99
- parseRetryAfter(response.headers.get("Retry-After")),
100
- parseErrorCode(errorText)
104
+ retryAfterSeconds,
105
+ code
101
106
  );
102
107
  }
103
108
  async function emailApiRequest(options, path, init = { method: "GET" }) {
package/dist/index.js CHANGED
@@ -50,11 +50,16 @@ async function throwIfNotOk(response) {
50
50
  return;
51
51
  const errorText = await response.text();
52
52
  const safeErrorText = errorText.length > 500 ? `${errorText.slice(0, 500)}...` : errorText;
53
+ const retryAfterSeconds = parseRetryAfter(response.headers.get("Retry-After"));
54
+ const code = parseErrorCode(errorText);
55
+ if (response.status === 429) {
56
+ console.error("[email-js] rate limited:", { status: response.status, code, retryAfterSeconds });
57
+ }
53
58
  throw new EmailAPIError(
54
59
  response.status,
55
60
  `Email API error: ${response.status} ${safeErrorText}`,
56
- parseRetryAfter(response.headers.get("Retry-After")),
57
- parseErrorCode(errorText)
61
+ retryAfterSeconds,
62
+ code
58
63
  );
59
64
  }
60
65
  async function emailApiRequest(options, path, init = { method: "GET" }) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lovable.dev/email-js",
3
- "version": "0.1.0-rc.3",
3
+ "version": "0.1.0-rc.5",
4
4
  "description": "Lovable Email JS",
5
5
  "repository": {
6
6
  "type": "git",