growi-info.ts 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  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. installedAtByOldestUser: Date
  44. type: GrowiServiceType
  45. currentUsersCount: number
  46. currentActiveUsersCount: number
  47. wikiType: GrowiWikiType
  48. attachmentType: GrowiAttachmentType
  49. activeExternalAccountTypes?: GrowiExternalAuthProviderType[]
  50. osInfo?: IGrowiOSInfo
  51. deploymentType?: GrowiDeploymentType
  52. }