@dxv-systems/mail-graph 0.3.0 → 0.3.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/README.md CHANGED
@@ -73,7 +73,7 @@ Only links on `https://graph.microsoft.com/v1.0/` are followed. Any other link t
73
73
  const message = await support.getMessage(id, { bodyType: "text", includeHeaders: true });
74
74
  // message.body, conversationId, internetMessageId, toRecipients…
75
75
  // with includeHeaders: inReplyTo, references[] (null when the message is gone)
76
- const attachments = await support.listAttachments(id); // id, name, contentType, size, isInline, kind
76
+ const attachments = await support.listAttachments(id); // id, name, contentType, size, isInline, kind, contentId (file attachments: the `cid:` the HTML body uses)
77
77
  const bytes = await support.downloadAttachment(id, attachments[0].id); // Uint8Array
78
78
  ```
79
79
 
package/dist/mailbox.js CHANGED
@@ -270,7 +270,9 @@ function createMailboxClient(http, address) {
270
270
  }
271
271
  },
272
272
  async listAttachments(messageId) {
273
- const raw = await collect(`${user}/messages/${requireId(messageId, "message id")}/attachments${query({ $select: "id,name,contentType,size,isInline" })}`);
273
+ const raw = await collect(`${user}/messages/${requireId(messageId, "message id")}/attachments${query({
274
+ $select: "id,name,contentType,size,isInline,microsoft.graph.fileAttachment/contentId",
275
+ })}`);
274
276
  return raw.map((a) => {
275
277
  const odataType = a["@odata.type"] ?? "#microsoft.graph.fileAttachment";
276
278
  const kind = odataType.endsWith("itemAttachment")
@@ -285,6 +287,7 @@ function createMailboxClient(http, address) {
285
287
  size: a.size ?? 0,
286
288
  isInline: a.isInline === true,
287
289
  kind,
290
+ ...(kind === "file" && a.contentId ? { contentId: a.contentId.replace(/^<|>$/g, "") } : {}),
288
291
  };
289
292
  });
290
293
  },
package/dist/types.d.ts CHANGED
@@ -63,6 +63,7 @@ export interface AttachmentInfo {
63
63
  size: number;
64
64
  isInline: boolean;
65
65
  kind: AttachmentKind;
66
+ contentId?: string;
66
67
  }
67
68
  export interface CreateReplyOptions {
68
69
  replyAll?: boolean;
@@ -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.0 @dxv-systems/helpdesk@0.10.1 @vercel/oidc@4.0.1
20
+ npm install --save-exact @dxv-systems/mail-graph@0.3.1 @dxv-systems/helpdesk@0.10.1 @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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dxv-systems/mail-graph",
3
- "version": "0.3.0",
3
+ "version": "0.3.1",
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",