staticTokenconstconst staticToken: (token: string) => TokenSourceThe token that is always the same text, for a program that holds one for a short time.
The client of Microsoft Graph: it puts the bearer token of the token source on every request to the service, asks again once with a new token when the service refuses the first, follows the redirect of a download to its pre-authenticated address without the token (and only to an https address), and gives what the service answered, or why it did not, as a value. It knows nothing of what an item is.
import { makeGraph } from "./graph.ts";
// const graph = makeGraph({ endpoint: "https://graph.microsoft.com/v1.0", token, transport, timeoutMs: 30000 });
// await graph.send({ method: "GET", address: "/me/drive/root" });staticTokenconstconst staticToken: (token: string) => TokenSourceThe token that is always the same text, for a program that holds one for a short time.
TokenSourcetypetype TokenSource = () => Promise<Result<string, string>>;Where a bearer token comes from: a function that gives one, or says why it cannot. It is asked for every request, so that it may refresh.