file-uploader.ts 756 B

123456789101112131415161718192021222324252627282930
  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 =
  10. (typeof FileUploadType)[keyof typeof FileUploadType];
  11. // file upload type strings you can specify in the env variable
  12. export const FileUploadTypeForEnvVar = {
  13. ...FileUploadType,
  14. mongo: 'mongo',
  15. mongodb: 'mongodb',
  16. gcp: 'gcp',
  17. } as const;
  18. export type FileUploadTypeForEnvVar =
  19. (typeof FileUploadTypeForEnvVar)[keyof typeof FileUploadTypeForEnvVar];
  20. // mapping from env variable to actual module name
  21. export const EnvToModuleMappings = {
  22. ...FileUploadTypeForEnvVar,
  23. mongo: 'gridfs',
  24. mongodb: 'gridfs',
  25. gcp: 'gcs',
  26. } as const;