IF Commons GitHub

api

Written to: 2 requirements: 2 proved, 0 partly, 0 failing, 0 with no test recorded. 0002-anyfs-gdrive-store FR-001, 0002-anyfs-gdrive-store FR-008

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" } });

Source: commons/anyfs-gdrive/src/api.ts

2 of 2 exports are imported by a test of the run. A test that imports an export may not call it or check what it returns.

staticTokenconst
const staticToken: (token: string) => TokenSource

The token that is always the same text, for a program that holds one for a short time.

Imported by 1 test of the run (0 passed, 0 failed): the library's results

TokenSourcetype
type 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.

Imported by 9 tests of the run (9 passed, 0 failed): the library's results

Titles, headings, exports, tables, columns and requirements. Esc closes.