oauth-token.ts 505 B

12345678910111213
  1. import { OAuthTokenModel } from '@server/models/oauth/oauth-token'
  2. import { PickWith } from '@server/typings/utils'
  3. import { MUserAccountUrl } from '../user/user'
  4. type Use<K extends keyof OAuthTokenModel, M> = PickWith<OAuthTokenModel, K, M>
  5. // ############################################################################
  6. export type MOAuthToken = Omit<OAuthTokenModel, 'User' | 'OAuthClients'>
  7. export type MOAuthTokenUser = MOAuthToken &
  8. Use<'User', MUserAccountUrl> &
  9. { user?: MUserAccountUrl }