You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

feature.ts 2.3KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  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. export enum InstallationScope {
  15. ALL = 'all',
  16. NONE = 'none',
  17. OFFICIAL_ONLY = 'official_only',
  18. OFFICIAL_AND_PARTNER = 'official_and_specific_partners',
  19. }
  20. type License = {
  21. status: LicenseStatus
  22. expired_at: string | null
  23. }
  24. export type SystemFeatures = {
  25. plugin_installation_permission: {
  26. plugin_installation_scope: InstallationScope,
  27. restrict_to_marketplace_only: boolean
  28. },
  29. sso_enforced_for_signin: boolean
  30. sso_enforced_for_signin_protocol: SSOProtocol | ''
  31. sso_enforced_for_web: boolean
  32. sso_enforced_for_web_protocol: SSOProtocol | ''
  33. enable_marketplace: boolean
  34. enable_email_code_login: boolean
  35. enable_email_password_login: boolean
  36. enable_social_oauth_login: boolean
  37. is_allow_create_workspace: boolean
  38. is_allow_register: boolean
  39. is_email_setup: boolean
  40. license: License
  41. branding: {
  42. enabled: boolean
  43. login_page_logo: string
  44. workspace_logo: string
  45. favicon: string
  46. application_title: string
  47. }
  48. webapp_auth: {
  49. enabled: boolean
  50. allow_sso: boolean
  51. sso_config: {
  52. protocol: SSOProtocol | ''
  53. }
  54. allow_email_code_login: boolean
  55. allow_email_password_login: boolean
  56. }
  57. }
  58. export const defaultSystemFeatures: SystemFeatures = {
  59. plugin_installation_permission: {
  60. plugin_installation_scope: InstallationScope.ALL,
  61. restrict_to_marketplace_only: false,
  62. },
  63. sso_enforced_for_signin: false,
  64. sso_enforced_for_signin_protocol: '',
  65. sso_enforced_for_web: false,
  66. sso_enforced_for_web_protocol: '',
  67. enable_marketplace: false,
  68. enable_email_code_login: false,
  69. enable_email_password_login: false,
  70. enable_social_oauth_login: false,
  71. is_allow_create_workspace: false,
  72. is_allow_register: false,
  73. is_email_setup: false,
  74. license: {
  75. status: LicenseStatus.NONE,
  76. expired_at: '',
  77. },
  78. branding: {
  79. enabled: false,
  80. login_page_logo: '',
  81. workspace_logo: '',
  82. favicon: '',
  83. application_title: 'test title',
  84. },
  85. webapp_auth: {
  86. enabled: false,
  87. allow_sso: false,
  88. sso_config: {
  89. protocol: '',
  90. },
  91. allow_email_code_login: false,
  92. allow_email_password_login: false,
  93. },
  94. }