growi-info.ts 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  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. azure: 'azure',
  15. gridfs: 'gridfs',
  16. mongo: 'mongo',
  17. mongodb: 'mongodb',
  18. local: 'local',
  19. none: 'none',
  20. } as const;
  21. export const GrowiDeploymentType = {
  22. officialHelmChart: 'official-helm-chart',
  23. growiDockerCompose: 'growi-docker-compose',
  24. node: 'node',
  25. others: 'others',
  26. } as const;
  27. export const GrowiExternalAuthProviderType = IExternalAuthProviderType;
  28. export type GrowiServiceType = typeof GrowiServiceType[keyof typeof GrowiServiceType]
  29. type GrowiWikiType = typeof GrowiWikiType[keyof typeof GrowiWikiType]
  30. export type GrowiAttachmentType = typeof GrowiAttachmentType[keyof typeof GrowiAttachmentType]
  31. export type GrowiDeploymentType = typeof GrowiDeploymentType[keyof typeof GrowiDeploymentType]
  32. export type GrowiExternalAuthProviderType = typeof GrowiExternalAuthProviderType[keyof typeof GrowiExternalAuthProviderType]
  33. interface IGrowiOSInfo {
  34. type?: ReturnType<typeof os.type>
  35. platform?: ReturnType<typeof os.platform>
  36. arch?: ReturnType<typeof os.arch>
  37. totalmem?: ReturnType<typeof os.totalmem>
  38. }
  39. export interface IGrowiInfo {
  40. version: string
  41. appSiteUrl?: string
  42. appSiteUrlHashed: string
  43. installedAt: Date
  44. installedAtByOldestUser: Date
  45. type: GrowiServiceType
  46. currentUsersCount: number
  47. currentActiveUsersCount: number
  48. wikiType: GrowiWikiType
  49. attachmentType: GrowiAttachmentType
  50. activeExternalAccountTypes?: GrowiExternalAuthProviderType[]
  51. osInfo?: IGrowiOSInfo
  52. deploymentType?: GrowiDeploymentType
  53. }