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.8KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125
  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_change_email: boolean
  35. enable_email_code_login: boolean
  36. enable_email_password_login: boolean
  37. enable_social_oauth_login: boolean
  38. is_allow_create_workspace: boolean
  39. is_allow_register: boolean
  40. is_email_setup: boolean
  41. license: License
  42. branding: {
  43. enabled: boolean
  44. login_page_logo: string
  45. workspace_logo: string
  46. favicon: string
  47. application_title: string
  48. }
  49. webapp_auth: {
  50. enabled: boolean
  51. allow_sso: boolean
  52. sso_config: {
  53. protocol: SSOProtocol | ''
  54. }
  55. allow_email_code_login: boolean
  56. allow_email_password_login: boolean
  57. }
  58. }
  59. export const defaultSystemFeatures: SystemFeatures = {
  60. plugin_installation_permission: {
  61. plugin_installation_scope: InstallationScope.ALL,
  62. restrict_to_marketplace_only: false,
  63. },
  64. sso_enforced_for_signin: false,
  65. sso_enforced_for_signin_protocol: '',
  66. sso_enforced_for_web: false,
  67. sso_enforced_for_web_protocol: '',
  68. enable_marketplace: false,
  69. enable_change_email: false,
  70. enable_email_code_login: false,
  71. enable_email_password_login: false,
  72. enable_social_oauth_login: false,
  73. is_allow_create_workspace: false,
  74. is_allow_register: false,
  75. is_email_setup: false,
  76. license: {
  77. status: LicenseStatus.NONE,
  78. expired_at: '',
  79. },
  80. branding: {
  81. enabled: false,
  82. login_page_logo: '',
  83. workspace_logo: '',
  84. favicon: '',
  85. application_title: 'test title',
  86. },
  87. webapp_auth: {
  88. enabled: false,
  89. allow_sso: false,
  90. sso_config: {
  91. protocol: '',
  92. },
  93. allow_email_code_login: false,
  94. allow_email_password_login: false,
  95. },
  96. }
  97. export enum DatasetAttr {
  98. DATA_API_PREFIX = 'data-api-prefix',
  99. DATA_PUBLIC_API_PREFIX = 'data-public-api-prefix',
  100. DATA_MARKETPLACE_API_PREFIX = 'data-marketplace-api-prefix',
  101. DATA_MARKETPLACE_URL_PREFIX = 'data-marketplace-url-prefix',
  102. DATA_PUBLIC_EDITION = 'data-public-edition',
  103. DATA_PUBLIC_SUPPORT_MAIL_LOGIN = 'data-public-support-mail-login',
  104. DATA_PUBLIC_SENTRY_DSN = 'data-public-sentry-dsn',
  105. DATA_PUBLIC_MAINTENANCE_NOTICE = 'data-public-maintenance-notice',
  106. DATA_PUBLIC_SITE_ABOUT = 'data-public-site-about',
  107. DATA_PUBLIC_TEXT_GENERATION_TIMEOUT_MS = 'data-public-text-generation-timeout-ms',
  108. DATA_PUBLIC_MAX_TOOLS_NUM = 'data-public-max-tools-num',
  109. DATA_PUBLIC_MAX_PARALLEL_LIMIT = 'data-public-max-parallel-limit',
  110. DATA_PUBLIC_TOP_K_MAX_VALUE = 'data-public-top-k-max-value',
  111. DATA_PUBLIC_INDEXING_MAX_SEGMENTATION_TOKENS_LENGTH = 'data-public-indexing-max-segmentation-tokens-length',
  112. DATA_PUBLIC_LOOP_NODE_MAX_COUNT = 'data-public-loop-node-max-count',
  113. DATA_PUBLIC_MAX_ITERATIONS_NUM = 'data-public-max-iterations-num',
  114. DATA_PUBLIC_MAX_TREE_DEPTH = 'data-public-max-tree-depth',
  115. DATA_PUBLIC_ALLOW_UNSAFE_DATA_SCHEME = 'data-public-allow-unsafe-data-scheme',
  116. DATA_PUBLIC_ENABLE_WEBSITE_JINAREADER = 'data-public-enable-website-jinareader',
  117. DATA_PUBLIC_ENABLE_WEBSITE_FIRECRAWL = 'data-public-enable-website-firecrawl',
  118. DATA_PUBLIC_ENABLE_WEBSITE_WATERCRAWL = 'data-public-enable-website-watercrawl',
  119. }