feature.ts 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. export enum SSOProtocol {
  2. SAML = 'saml',
  3. OIDC = 'oidc',
  4. OAuth2 = 'oauth2',
  5. }
  6. export enum LicenseStatus {
  7. NONE = 'none',
  8. INACTIVE = 'inactive',
  9. ACTIVE = 'active',
  10. EXPIRING = 'expiring',
  11. EXPIRED = 'expired',
  12. LOST = 'lost',
  13. }
  14. type License = {
  15. status: LicenseStatus
  16. expired_at: string | null
  17. }
  18. export type SystemFeatures = {
  19. sso_enforced_for_signin: boolean
  20. sso_enforced_for_signin_protocol: SSOProtocol | ''
  21. sso_enforced_for_web: boolean
  22. sso_enforced_for_web_protocol: SSOProtocol | ''
  23. enable_web_sso_switch_component: boolean
  24. enable_email_code_login: boolean
  25. enable_email_password_login: boolean
  26. enable_social_oauth_login: boolean
  27. is_allow_create_workspace: boolean
  28. is_allow_register: boolean
  29. license: License
  30. }
  31. export const defaultSystemFeatures: SystemFeatures = {
  32. sso_enforced_for_signin: false,
  33. sso_enforced_for_signin_protocol: '',
  34. sso_enforced_for_web: false,
  35. sso_enforced_for_web_protocol: '',
  36. enable_web_sso_switch_component: false,
  37. enable_email_code_login: false,
  38. enable_email_password_login: false,
  39. enable_social_oauth_login: false,
  40. is_allow_create_workspace: false,
  41. is_allow_register: false,
  42. license: {
  43. status: LicenseStatus.NONE,
  44. expired_at: '',
  45. },
  46. }