diff --git a/packages/aris-source-google-calendar/src/types.ts b/packages/aris-source-google-calendar/src/types.ts index f44c747..307de0d 100644 --- a/packages/aris-source-google-calendar/src/types.ts +++ b/packages/aris-source-google-calendar/src/types.ts @@ -1,14 +1,6 @@ -/** - * Provider interface for Google OAuth credentials. - * Consumers implement this to supply tokens from their auth storage/flow. - * The source never stores or manages tokens itself. - */ export interface GoogleOAuthProvider { - /** Return a valid access token, refreshing internally if necessary. */ fetchAccessToken(): Promise - /** Force a token refresh and return the new access token. */ refresh(): Promise - /** Revoke the current credentials. */ revoke(): Promise } @@ -20,14 +12,13 @@ export const EventStatus = { export type EventStatus = (typeof EventStatus)[keyof typeof EventStatus] -/** Google Calendar API event datetime object. Exactly one of dateTime or date is present. */ +/** Exactly one of dateTime or date is present. */ export interface ApiEventDateTime { dateTime?: string date?: string timeZone?: string } -/** Google Calendar API event resource shape. */ export interface ApiCalendarEvent { id: string status: EventStatus @@ -58,33 +49,24 @@ export interface ListEventsOptions { timeMax: Date } -/** - * Abstraction over the Google Calendar REST API. - * Inject a mock for testing. - */ export interface GoogleCalendarClient { - /** List all calendar IDs accessible by the user. */ listCalendarIds(): Promise - /** List events matching the given options. Returns raw API event objects. */ listEvents(options: ListEventsOptions): Promise } interface GoogleCalendarSourceBaseOptions { - /** Calendar IDs to fetch. Defaults to all user calendars. */ calendarIds?: string[] - /** How far ahead to look for events, in hours. Default: 24 */ + /** Default: 24 */ lookaheadHours?: number } interface GoogleCalendarSourceWithProvider extends GoogleCalendarSourceBaseOptions { - /** OAuth provider for authenticating with Google Calendar API */ oauthProvider: GoogleOAuthProvider client?: never } interface GoogleCalendarSourceWithClient extends GoogleCalendarSourceBaseOptions { oauthProvider?: never - /** Injectable API client (for testing) */ client: GoogleCalendarClient }