aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/typings/models/oauth/oauth-token.ts
blob: af34129252e9fe97a946f5577f73511046b08420 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
import { OAuthTokenModel } from '@server/models/oauth/oauth-token'
import { PickWith } from '@server/typings/utils'
import { MUserAccountUrl } from '@server/typings/models'

type Use<K extends keyof OAuthTokenModel, M> = PickWith<OAuthTokenModel, K, M>

// ############################################################################

export type MOAuthToken = Omit<OAuthTokenModel, 'User' | 'OAuthClients'>

export type MOAuthTokenUser = MOAuthToken &
  Use<'User', MUserAccountUrl> &
  { user?: MUserAccountUrl }