// SPDX-License-Identifier: MIT export * from "./app.ts"; export * from "./sp.ts"; import { Client } from "@microsoft/microsoft-graph-client"; import { RESOURCE_SCOPE_BY_NAME, getTokenCredential } from "../azure/index.ts"; export async function getGraphClient(): Promise { return Client.init({ authProvider: (done) => { void getTokenCredential() .then((credential) => credential.getToken(RESOURCE_SCOPE_BY_NAME.graph)) .then((accessToken) => done(null, accessToken?.token ?? null)) .catch((err) => done(err as Error, null)); }, }); }