@dxv-systems/mail-graph 0.3.3 → 0.3.4
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/docs/app-integration.md +19 -13
- package/package.json +1 -1
package/docs/app-integration.md
CHANGED
|
@@ -17,7 +17,7 @@ The code below was compiled, linted, knip-checked, built and tested against a fr
|
|
|
17
17
|
## 1. Install
|
|
18
18
|
|
|
19
19
|
```bash
|
|
20
|
-
npm install --save-exact @dxv-systems/mail-graph@0.3.
|
|
20
|
+
npm install --save-exact @dxv-systems/mail-graph@0.3.4 @dxv-systems/helpdesk@0.13.0 @vercel/oidc@4.0.1
|
|
21
21
|
```
|
|
22
22
|
|
|
23
23
|
Use the published versions (exact, never a range; upgrading is a deliberate change). **Vendored variant** (before publication, e.g. the rehearsal): `npm pack` each package into `vendor/` and install `file:vendor/dxv-systems-mail-graph-<version>.tgz file:vendor/dxv-systems-helpdesk-<version>.tgz` instead; commit the tarballs with `package.json` and the lockfile.
|
|
@@ -1735,7 +1735,7 @@ export default async function MicrosoftSetupPage() {
|
|
|
1735
1735
|
```tsx
|
|
1736
1736
|
"use client";
|
|
1737
1737
|
|
|
1738
|
-
import {
|
|
1738
|
+
import { useEffect, useState } from "react";
|
|
1739
1739
|
import { toast } from "sonner";
|
|
1740
1740
|
import { createHelpdeskClient, HelpdeskClientError } from "@dxv-systems/helpdesk/client";
|
|
1741
1741
|
import type { InboxHistory } from "@dxv-systems/helpdesk/server";
|
|
@@ -1772,21 +1772,27 @@ function MailboxHistory({ mailbox }: { mailbox: string }) {
|
|
|
1772
1772
|
const [error, setError] = useState<string | null>(null);
|
|
1773
1773
|
const [busy, setBusy] = useState(false);
|
|
1774
1774
|
|
|
1775
|
-
const load = useCallback(async () => {
|
|
1776
|
-
try {
|
|
1777
|
-
setHistory(await helpdesk.history(mailbox));
|
|
1778
|
-
setError(null);
|
|
1779
|
-
} catch (e) {
|
|
1780
|
-
setError(errorText(e));
|
|
1781
|
-
}
|
|
1782
|
-
}, [mailbox]);
|
|
1783
|
-
|
|
1784
1775
|
useEffect(() => {
|
|
1776
|
+
let live = true;
|
|
1777
|
+
const load = () =>
|
|
1778
|
+
helpdesk.history(mailbox).then(
|
|
1779
|
+
(h) => {
|
|
1780
|
+
if (!live) return;
|
|
1781
|
+
setHistory(h);
|
|
1782
|
+
setError(null);
|
|
1783
|
+
},
|
|
1784
|
+
(e: unknown) => {
|
|
1785
|
+
if (live) setError(errorText(e));
|
|
1786
|
+
},
|
|
1787
|
+
);
|
|
1785
1788
|
void load();
|
|
1786
1789
|
// The cron imports every few minutes: refresh the counts while the page is open.
|
|
1787
1790
|
const timer = window.setInterval(() => void load(), 60_000);
|
|
1788
|
-
return () =>
|
|
1789
|
-
|
|
1791
|
+
return () => {
|
|
1792
|
+
live = false;
|
|
1793
|
+
window.clearInterval(timer);
|
|
1794
|
+
};
|
|
1795
|
+
}, [mailbox]);
|
|
1790
1796
|
|
|
1791
1797
|
async function run(action: "start" | "pause") {
|
|
1792
1798
|
setBusy(true);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dxv-systems/mail-graph",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.4",
|
|
4
4
|
"description": "Microsoft Graph mail for DXV apps — app-only auth via a caller-supplied client assertion (federated or certificate), per-mailbox delta sync, messages, attachments, threaded replies, folders, forward and send. Never deletes. Guided Microsoft 365 setup (route handlers and a React page) under ./setup. Zero runtime dependencies.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"dxv",
|