@snehal96/unimail
Version:
Unified email fetching & document extraction layer for modern web apps
30 lines (29 loc) • 1.16 kB
TypeScript
import { IOAuthProvider, OAuthOptions, OAuthFlowState, TokenData } from '../interfaces.js';
/**
* Microsoft-specific OAuth implementation for Outlook/Microsoft 365
*/
export declare class OutlookOAuthProvider implements IOAuthProvider {
/**
* Initialize the Microsoft OAuth flow and generate an authorization URL
*/
initializeOAuthFlow(options: OAuthOptions): Promise<OAuthFlowState>;
/**
* Handle the OAuth callback and exchange the code for tokens
*/
handleCallback(code: string, options: OAuthOptions): Promise<TokenData>;
/**
* Refresh an access token using a refresh token
*/
refreshToken(refreshToken: string, options: OAuthOptions): Promise<TokenData>;
/**
* Revoke a token
* Note: Microsoft identity platform doesn't have a specific token revocation endpoint like Google
* Best practice is to clear the token from storage and implement a short token lifetime
*/
revokeToken(token: string, options: OAuthOptions): Promise<boolean>;
/**
* Create a MSAL ConfidentialClientApplication with the provided options
* @private
*/
private createMsalApp;
}