/** * Graph upload-session path for outbound attachments above the inline limit. * Shared by every tool that attaches a file; `tool` names the caller for the * Graph call tag and the error prefixes, so a stalled session is greppable back * to the tool that started it. * * Two steps, distinct in auth and host: * 1. `POST /me/messages/{draftId}/attachments/createUploadSession` — through * the Graph SDK (auth handled by `postGraph`), returns a pre-authenticated * `uploadUrl`. * 2. Chunked `PUT` to that `uploadUrl` — a plain fetch to a non-Graph host * with NO bearer token (the URL itself is the credential). Each chunk is a * multiple of 320 KiB except the last, per Graph's contract, and carries a * `Content-Range` header. Graph returns 200 for an intermediate chunk and * 201 for the final one. * * Every non-2xx PUT throws with the response status and body preserved, so a * session that stalls mid-chunk is diagnosable rather than silent. */ import type { GraphClientConfig } from "./graph-client.js"; import type { OutboundAttachment } from "./outbound-attachments.js"; /** Chunk size for the upload PUT: 3.125 MiB, a whole multiple of 320 KiB as * Graph requires for every chunk except the final remainder. */ export declare const UPLOAD_CHUNK_BYTES: number; /** * Upload one large attachment to an existing draft via a Graph upload session. * Returns the number of chunks PUT (for observability). The draft must already * exist; the attachment must have passed `resolveOutboundAttachments`. `tool` * names the calling tool for the Graph call tag and the error prefixes. */ export declare function uploadAttachmentSession(config: GraphClientConfig, draftId: string, att: OutboundAttachment, tool: string): Promise; //# sourceMappingURL=upload-session.d.ts.map