import type { OAuthConfig } from '#auth-utils'; export interface OAuthStravaConfig { /** * Strava OAuth Client ID * @default process.env.NUXT_OAUTH_STRAVA_CLIENT_ID */ clientId?: string; /** * Strava OAuth Client Secret * @default process.env.NUXT_OAUTH_STRAVA_CLIENT_SECRET */ clientSecret?: string; /** * Strava OAuth Scope * @default [] * @see https://developers.strava.com/docs/authentication/ # Details About Requesting Access * @example ['read', 'read_all', 'profile:read_all', 'profile:write', 'activity:read', 'activity:read_all', 'activity:write'] */ scope?: string[]; /** * Redirect URL to allow overriding for situations like prod failing to determine public hostname * @default process.env.NUXT_OAUTH_STRAVA_REDIRECT_URL or current URL */ redirectURL?: string; /** * To show the authorization prompt to the user, 'force' will always show the prompt * @default 'auto' * @see https://developers.strava.com/docs/authentication/ # Details About Requesting Access */ approvalPrompt?: 'auto' | 'force'; } export interface OAuthStravaUser { /** * The unique identifier of the athlete */ id: number; /** * The username of the athlete */ username: string; /** * Resource state, indicates level of detail. * - Meta (1): Basic information * - Summary (2): Summary information * - Detail (3): Detailed information * @see https://developers.strava.com/docs/reference/#api-models-DetailedAthlete */ resource_state: 1 | 2 | 3; /** * The athlete's first name */ firstname: string; /** * The athlete's last name */ lastname: string; /** * The athlete's bio */ bio: string; /** * The athlete's city */ city: string; /** * The athlete's state or geographical region */ state: string; /** * The athlete's country */ country: string; /** * The athlete's sex */ sex: string; /** * Whether the athlete has any Summit subscription * @see https://developers.strava.com/docs/reference/#api-models-DetailedAthlete */ summit: boolean; /** * The time at which the athlete was created */ created_at: Date; /** * The time at which the athlete was last updated */ updated_at: Date; /** * The athlete's weight */ weight: number; /** * URL to a 124x124 pixel profile picture */ profile_medium: string; /** * URL to a 62x62 pixel profile picture */ profile: string; /** * The athlete's timezone */ timezone: string; } export interface OAuthStravaTokens { token_type: 'Bearer'; expires_at: number; expires_in: number; access_token: string; refresh_token: string; athlete: OAuthStravaUser; error?: string; } export declare function defineOAuthStravaEventHandler({ config, onSuccess, onError, }: OAuthConfig): import("nuxt/server").EventHandler>;