]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blob - server/types/models/oauth/oauth-token.ts
6af087e3c1ab9664f4b95f9af17b30f313aabc6b
[github/Chocobozzz/PeerTube.git] / server / types / models / oauth / oauth-token.ts
1 import { OAuthTokenModel } from '@server/models/oauth/oauth-token'
2 import { PickWith } from '@shared/typescript-utils'
3 import { MUserAccountUrl } from '../user/user'
4
5 type Use<K extends keyof OAuthTokenModel, M> = PickWith<OAuthTokenModel, K, M>
6
7 // ############################################################################
8
9 export type MOAuthToken = Omit<OAuthTokenModel, 'User' | 'OAuthClients'>
10
11 export type MOAuthTokenUser =
12 MOAuthToken &
13 Use<'User', MUserAccountUrl> &
14 { user?: MUserAccountUrl }