export type OAuthClient = {
  id: string
  name: string
  redirectUris: string[]
  scopes: string[]
  confidential: boolean
  createdAt: Date
}

export type RegisterOAuthClientResult = {
  clientId: string
  clientSecret?: string
}

export type RegisterOAuthClientInput = {
  id?: string
  name: string
  redirectUris: string[]
  scopes: string[]
  confidential: boolean
}

export type AuthorizeInput = {
  clientId: string
  redirectUri: string
  codeChallenge: string
  codeChallengeMethod: 'S256'
  scope: string
}

export type ExchangeTokenInput = {
  code: string
  codeVerifier: string
  clientId: string
  clientSecret?: string
}

export type OAuthTokenResult = {
  accessToken: string
  tokenType: 'Bearer'
  expiresIn: number
  scope: string
}
