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 the Drive API: it puts the bearer token of the token source on every request, says supportsAllDrives on every one so that a shared drive is served as a personal one, asks again once with a new token when the service refuses the first, and gives what the service answered, or why it did not, as a value. It knows nothing of what a file is.
import { makeDrive } from "./api.ts";
// const drive = makeDrive({ endpoint: "https://www.googleapis.com", token, transport, timeoutMs: 30000 });
// await drive.send({ method: "GET", path: "/drive/v3/files/ID", query: { fields: "id" } });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.