longcelot-sheet-db
Version:
Google Sheets-backed staging database adapter for Node.js with schema-first design
24 lines • 1.13 kB
TypeScript
export interface OAuthConfig {
clientId: string;
clientSecret: string;
redirectUri: string;
}
export declare class OAuthManager {
private client;
private defaultScopes;
constructor(config: OAuthConfig, defaultScopes?: string[]);
getAuthUrl(scopes?: string[]): string;
getTokens(code: string): Promise<unknown>;
refreshTokens(refreshToken: string): Promise<unknown>;
/** Verifies a Google ID token. Only works when `openid` scope was requested (use createLoginOAuthManager). */
verifyToken(idToken: string): Promise<unknown>;
}
/** Standard adapter-only OAuth — for backend-to-Sheets communication. Does NOT produce id_token. */
export declare function createOAuthManager(config: OAuthConfig): OAuthManager;
/**
* Login OAuth manager — pre-configured with `openid email profile` scopes alongside
* Sheets scopes. Use this for user-facing Google Sign-In. The tokens it produces include
* an `id_token` that can be verified with `manager.verifyToken(idToken)`.
*/
export declare function createLoginOAuthManager(config: OAuthConfig): OAuthManager;
//# sourceMappingURL=oauth.d.ts.map