file-uploader.ts 758 B

12345678910111213141516171819202122232425262728
  1. // file upload types actually supported by the app
  2. export const FileUploadType = {
  3. aws: 'aws',
  4. gcs: 'gcs',
  5. azure: 'azure',
  6. gridfs: 'gridfs',
  7. local: 'local',
  8. } as const;
  9. export type FileUploadType = typeof FileUploadType[keyof typeof FileUploadType]
  10. // file upload type strings you can specify in the env variable
  11. export const FileUploadTypeForEnvVar = {
  12. ...FileUploadType,
  13. mongo: 'mongo',
  14. mongodb: 'mongodb',
  15. gcp: 'gcp',
  16. } as const;
  17. export type FileUploadTypeForEnvVar = typeof FileUploadTypeForEnvVar[keyof typeof FileUploadTypeForEnvVar]
  18. // mapping from env variable to actual module name
  19. export const EnvToModuleMappings = {
  20. ...FileUploadTypeForEnvVar,
  21. mongo: 'gridfs',
  22. mongodb: 'gridfs',
  23. gcp: 'gcs',
  24. } as const;