@emailens/cli 0.14.2 → 0.14.3
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.js +12 -3
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -43706,7 +43706,7 @@ Href: ${href}`
|
|
|
43706
43706
|
// package.json
|
|
43707
43707
|
var package_default = {
|
|
43708
43708
|
name: "@emailens/cli",
|
|
43709
|
-
version: "0.14.
|
|
43709
|
+
version: "0.14.3",
|
|
43710
43710
|
description: "CLI tool for email compatibility analysis: lint, preview and export HTML, MJML, Maizzle and React Email rendering across 21 email clients.",
|
|
43711
43711
|
type: "module",
|
|
43712
43712
|
bin: {
|
|
@@ -46194,6 +46194,7 @@ function printQualitySummary(report, skip, options) {
|
|
|
46194
46194
|
// src/commands/inbox.ts
|
|
46195
46195
|
var import_picocolors5 = __toESM(require_picocolors(), 1);
|
|
46196
46196
|
var API_URL = () => process.env.EMAILENS_API_URL ?? "https://app.emailens.dev";
|
|
46197
|
+
var SERVER_WAIT_SECONDS = 20;
|
|
46197
46198
|
function parseSince(value, now = Date.now()) {
|
|
46198
46199
|
if (!value) return now - 2 * 6e4;
|
|
46199
46200
|
const d = /^(\d+)\s*(s|m|h)$/i.exec(value.trim());
|
|
@@ -46208,7 +46209,15 @@ async function waitForEmail(o, fetchImpl = fetch) {
|
|
|
46208
46209
|
while (Date.now() < deadline) {
|
|
46209
46210
|
const q = new URLSearchParams({
|
|
46210
46211
|
since: String(o.since),
|
|
46211
|
-
timeout: String(
|
|
46212
|
+
timeout: String(
|
|
46213
|
+
Math.max(
|
|
46214
|
+
1,
|
|
46215
|
+
Math.min(
|
|
46216
|
+
SERVER_WAIT_SECONDS,
|
|
46217
|
+
Math.ceil((deadline - Date.now()) / 1e3)
|
|
46218
|
+
)
|
|
46219
|
+
)
|
|
46220
|
+
)
|
|
46212
46221
|
});
|
|
46213
46222
|
if (o.subject) q.set("subject", o.subject);
|
|
46214
46223
|
if (o.sender) q.set("sender", o.sender);
|
|
@@ -46223,7 +46232,7 @@ async function waitForEmail(o, fetchImpl = fetch) {
|
|
|
46223
46232
|
} catch (e) {
|
|
46224
46233
|
return { code: 2, error: `Could not reach Emailens: ${e.message}`, failures: [] };
|
|
46225
46234
|
}
|
|
46226
|
-
if (res.status
|
|
46235
|
+
if ([408, 502, 503, 504].includes(res.status)) continue;
|
|
46227
46236
|
const body = await res.json().catch(() => ({}));
|
|
46228
46237
|
if (res.status === 401)
|
|
46229
46238
|
return { code: 2, error: "Invalid or revoked API key (EMAILENS_API_KEY).", failures: [] };
|
package/package.json
CHANGED