file-uploader.ts 772 B

12345678910111213141516171819202122232425262728293031
  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. none: 'none',
  15. mongo: 'mongo',
  16. mongodb: 'mongodb',
  17. gcp: 'gcp',
  18. } as const;
  19. export type FileUploadTypeForEnvVar =
  20. (typeof FileUploadTypeForEnvVar)[keyof typeof FileUploadTypeForEnvVar];
  21. // mapping from env variable to actual module name
  22. export const EnvToModuleMappings = {
  23. ...FileUploadTypeForEnvVar,
  24. mongo: 'gridfs',
  25. mongodb: 'gridfs',
  26. gcp: 'gcs',
  27. } as const;