mcp-s-oauth
Version:
Express middleware library for MCP (Model Context Protocol) OAuth authentication
38 lines • 1.25 kB
TypeScript
/**
* Type for JSONata string expressions that will be applied to objects
* @template T The type of object that the JSONata string will be applied to
*/
export type JsonataString<T> = string | {
__jsonataInput?: T;
};
export interface OAuthCredentials {
access_token: string;
expires_at: string | null;
refresh_token: string | null;
refresh_token_expires_at: string | null;
scope: string | null;
token_type: "Bearer";
}
/** OAuth provider's token response structure */
export interface OAuthTokenResponse {
access_token: string;
expires_in?: number;
refresh_token?: string;
refresh_token_expires_in?: number;
scope?: string;
token_type?: string;
[key: string]: unknown;
}
export interface Connector {
authUrl?: string;
tokenUrl?: string;
refreshTokenUrl?: string;
scopes?: string[] | readonly string[];
codeExchangeConfig?: {
modelCredentialsMapping?: JsonataString<OAuthCredentials> | ((config: OAuthTokenResponse) => OAuthCredentials);
isForm?: boolean;
authorizationMapping?: JsonataString<string> | ((config: Record<string, unknown>) => string);
};
authInitUrlParams?: Record<string, string>;
}
//# sourceMappingURL=connector.types.d.ts.map