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 3.6KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122
  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. }
  95. export enum DatasetAttr {
  96. DATA_API_PREFIX = 'data-api-prefix',
  97. DATA_PUBLIC_API_PREFIX = 'data-public-api-prefix',
  98. DATA_MARKETPLACE_API_PREFIX = 'data-marketplace-api-prefix',
  99. DATA_MARKETPLACE_URL_PREFIX = 'data-marketplace-url-prefix',
  100. DATA_PUBLIC_EDITION = 'data-public-edition',
  101. DATA_PUBLIC_SUPPORT_MAIL_LOGIN = 'data-public-support-mail-login',
  102. DATA_PUBLIC_SENTRY_DSN = 'data-public-sentry-dsn',
  103. DATA_PUBLIC_MAINTENANCE_NOTICE = 'data-public-maintenance-notice',
  104. DATA_PUBLIC_SITE_ABOUT = 'data-public-site-about',
  105. DATA_PUBLIC_TEXT_GENERATION_TIMEOUT_MS = 'data-public-text-generation-timeout-ms',
  106. DATA_PUBLIC_MAX_TOOLS_NUM = 'data-public-max-tools-num',
  107. DATA_PUBLIC_MAX_PARALLEL_LIMIT = 'data-public-max-parallel-limit',
  108. DATA_PUBLIC_TOP_K_MAX_VALUE = 'data-public-top-k-max-value',
  109. DATA_PUBLIC_INDEXING_MAX_SEGMENTATION_TOKENS_LENGTH = 'data-public-indexing-max-segmentation-tokens-length',
  110. DATA_PUBLIC_LOOP_NODE_MAX_COUNT = 'data-public-loop-node-max-count',
  111. DATA_PUBLIC_MAX_ITERATIONS_NUM = 'data-public-max-iterations-num',
  112. DATA_PUBLIC_MAX_TREE_DEPTH = 'data-public-max-tree-depth',
  113. DATA_PUBLIC_ENABLE_WEBSITE_JINAREADER = 'data-public-enable-website-jinareader',
  114. DATA_PUBLIC_ENABLE_WEBSITE_FIRECRAWL = 'data-public-enable-website-firecrawl',
  115. DATA_PUBLIC_ENABLE_WEBSITE_WATERCRAWL = 'data-public-enable-website-watercrawl',
  116. }