@bobfrankston/mailx 1.0.55 → 1.0.61

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/client/app.js CHANGED
@@ -561,6 +561,44 @@ onWsEvent((event) => {
561
561
  statusSync.textContent = `Error: ${event.message}`;
562
562
  showAlert(event.message, "ws-error");
563
563
  break;
564
+ case "accountError": {
565
+ const acctEl = document.getElementById("status-accounts");
566
+ if (acctEl) {
567
+ acctEl.innerHTML = "";
568
+ acctEl.style.color = "oklch(0.65 0.2 25)";
569
+ const text = document.createElement("span");
570
+ text.textContent = `${event.accountId}: ${event.hint} `;
571
+ acctEl.appendChild(text);
572
+ // Add re-auth button for auth errors
573
+ if (event.error.includes("token") || event.error.includes("auth") || event.error.includes("Command failed")) {
574
+ const btn = document.createElement("button");
575
+ btn.textContent = "Re-authenticate";
576
+ btn.className = "status-action";
577
+ btn.addEventListener("click", async () => {
578
+ btn.disabled = true;
579
+ btn.textContent = "Authenticating...";
580
+ try {
581
+ const res = await fetch(`/api/reauth/${event.accountId}`, { method: "POST" });
582
+ const data = await res.json();
583
+ if (data.ok) {
584
+ acctEl.textContent = `${event.accountId}: reconnected`;
585
+ acctEl.style.color = "";
586
+ }
587
+ else {
588
+ btn.textContent = "Re-authenticate";
589
+ btn.disabled = false;
590
+ }
591
+ }
592
+ catch {
593
+ btn.textContent = "Re-authenticate";
594
+ btn.disabled = false;
595
+ }
596
+ });
597
+ acctEl.appendChild(btn);
598
+ }
599
+ }
600
+ break;
601
+ }
564
602
  }
565
603
  });
566
604
  // ── Keyboard shortcuts ──
@@ -564,6 +564,18 @@ button.tb-menu-item { background: none; border: none; color: inherit; width: 100
564
564
  font-size: var(--font-size-sm);
565
565
  color: var(--color-text-muted);
566
566
  }
567
+ .status-action {
568
+ border: 1px solid oklch(0.65 0.15 25);
569
+ background: transparent;
570
+ color: oklch(0.75 0.15 25);
571
+ padding: 1px 8px;
572
+ border-radius: var(--radius-sm);
573
+ font-size: var(--font-size-sm);
574
+ cursor: pointer;
575
+ margin-left: var(--gap-xs);
576
+ }
577
+ .status-action:hover { background: oklch(0.65 0.15 25); color: #fff; }
578
+ .status-action:disabled { opacity: 0.5; cursor: default; }
567
579
 
568
580
  /* ── Startup Overlay ── */
569
581
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bobfrankston/mailx",
3
- "version": "1.0.55",
3
+ "version": "1.0.61",
4
4
  "description": "Local-first email client with IMAP sync and standalone native app",
5
5
  "type": "module",
6
6
  "main": "bin/mailx.js",
@@ -1,9 +1,10 @@
1
1
  /**
2
2
  * @bobfrankston/mailx-api
3
- * Express Router with all REST endpoints for the mailx client.
3
+ * Thin Express Router delegates all logic to mailx-service.
4
4
  */
5
5
  import { Router } from "express";
6
6
  import { MailxDB } from "@bobfrankston/mailx-store";
7
7
  import { ImapManager } from "@bobfrankston/mailx-imap";
8
8
  export declare function createApiRouter(db: MailxDB, imapManager: ImapManager): Router;
9
+ export { MailxService } from "@bobfrankston/mailx-service";
9
10
  //# sourceMappingURL=index.d.ts.map