growi-info.ts 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. import * as os from 'node:os';
  2. import { IExternalAuthProviderType } from '@growi/core';
  3. export const GrowiServiceType = {
  4. cloud: 'cloud',
  5. privateCloud: 'private-cloud',
  6. onPremise: 'on-premise',
  7. others: 'others',
  8. } as const;
  9. export const GrowiWikiType = { open: 'open', closed: 'closed' } as const;
  10. export const GrowiAttachmentType = {
  11. aws: 'aws',
  12. gcs: 'gcs',
  13. gcp: 'gcp',
  14. gridfs: 'gridfs',
  15. mongo: 'mongo',
  16. mongodb: 'mongodb',
  17. local: 'local',
  18. none: 'none',
  19. } as const;
  20. export const GrowiDeploymentType = {
  21. officialHelmChart: 'official-helm-chart',
  22. growiDockerCompose: 'growi-docker-compose',
  23. node: 'node',
  24. others: 'others',
  25. } as const;
  26. export const GrowiExternalAuthProviderType = IExternalAuthProviderType;
  27. export type GrowiServiceType = typeof GrowiServiceType[keyof typeof GrowiServiceType]
  28. type GrowiWikiType = typeof GrowiWikiType[keyof typeof GrowiWikiType]
  29. export type GrowiAttachmentType = typeof GrowiAttachmentType[keyof typeof GrowiAttachmentType]
  30. export type GrowiDeploymentType = typeof GrowiDeploymentType[keyof typeof GrowiDeploymentType]
  31. export type GrowiExternalAuthProviderType = typeof GrowiExternalAuthProviderType[keyof typeof GrowiExternalAuthProviderType]
  32. interface IGrowiOSInfo {
  33. type?: ReturnType<typeof os.type>
  34. platform?: ReturnType<typeof os.platform>
  35. arch?: ReturnType<typeof os.arch>
  36. totalmem?: ReturnType<typeof os.totalmem>
  37. }
  38. export interface IGrowiInfo {
  39. version: string
  40. appSiteUrl?: string
  41. appSiteUrlHashed: string
  42. installedAt: Date
  43. type: GrowiServiceType
  44. currentUsersCount: number
  45. currentActiveUsersCount: number
  46. wikiType: GrowiWikiType
  47. attachmentType: GrowiAttachmentType
  48. activeExternalAccountTypes?: GrowiExternalAuthProviderType[]
  49. osInfo?: IGrowiOSInfo
  50. deploymentType?: GrowiDeploymentType
  51. }