common.ts 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  1. export type CommonResponse = {
  2. result: 'success' | 'fail'
  3. }
  4. export type OauthResponse = {
  5. redirect_url: string
  6. }
  7. export type UserProfileResponse = {
  8. id: string
  9. name: string
  10. email: string
  11. interface_language?: string
  12. interface_theme?: string
  13. timezone?: string
  14. last_login_at?: string
  15. last_login_ip?: string
  16. created_at?: string
  17. }
  18. export type UserProfileOriginResponse = {
  19. json: () => Promise<UserProfileResponse>
  20. bodyUsed: boolean
  21. headers: any
  22. }
  23. export type LangGeniusVersionResponse = {
  24. current_version: string
  25. latest_version: string
  26. version: string
  27. release_date: string
  28. release_notes: string
  29. can_auto_update: boolean
  30. current_env: string
  31. }
  32. export type TenantInfoResponse = {
  33. name: string
  34. created_at: string
  35. providers: Array<{
  36. provider: string
  37. provider_name: string
  38. token_is_set: boolean
  39. is_valid: boolean
  40. token_is_valid: boolean
  41. }>
  42. in_trail: boolean
  43. trial_end_reason: null | 'trial_exceeded' | 'using_custom'
  44. }
  45. export type Member = Pick<UserProfileResponse, 'id' | 'name' | 'email' | 'last_login_at' | 'created_at'> & {
  46. avatar: string
  47. status: 'pending' | 'active' | 'banned' | 'closed'
  48. role: 'owner' | 'admin' | 'normal'
  49. }
  50. export type ProviderAzureToken = {
  51. azure_api_base: string
  52. azure_api_key: string
  53. azure_api_type: string
  54. azure_api_version: string
  55. }
  56. export type Provider = {
  57. provider_name: string
  58. provider_type: string
  59. is_valid: boolean
  60. is_enabled: boolean
  61. last_used: string
  62. token?: string | ProviderAzureToken
  63. }
  64. export type ProviderHosted = Provider & {
  65. quota_type: string
  66. quota_limit: number
  67. quota_used: number
  68. }
  69. export type AccountIntegrate = {
  70. provider: 'google' | 'github'
  71. created_at: number
  72. is_bound: boolean
  73. link: string
  74. }
  75. export interface IWorkspace {
  76. id: string
  77. name: string
  78. plan: string
  79. status: string
  80. created_at: number
  81. current: boolean
  82. }