Просмотр исходного кода

change FileUploadEnvVarType to FileUploadTypeForEnvVar

Futa Arai 1 год назад
Родитель
Сommit
eac51eba3b

+ 2 - 2
apps/app/src/features/page-bulk-export/interfaces/page-bulk-export.ts

@@ -3,7 +3,7 @@ import type {
   IAttachment, IPage, IRevision, IUser, Ref,
 } from '@growi/core';
 
-import { FileUploadEnvVarType } from '~/interfaces/file-uploader';
+import { FileUploadTypeForEnvVar } from '~/interfaces/file-uploader';
 
 export const PageBulkExportFormat = {
   md: 'md',
@@ -48,4 +48,4 @@ export interface IPageBulkExportPageSnapshot {
   revision: Ref<IRevision>, // page revision when export was stared
 }
 
-export const PageBulkExportEnabledFileUploadTypes = [FileUploadEnvVarType.aws, FileUploadEnvVarType.gcs, FileUploadEnvVarType.gcp] as const;
+export const PageBulkExportEnabledFileUploadTypes = [FileUploadTypeForEnvVar.aws, FileUploadTypeForEnvVar.gcs, FileUploadTypeForEnvVar.gcp] as const;

+ 4 - 2
apps/app/src/interfaces/file-uploader.ts

@@ -1,3 +1,4 @@
+// file upload types actually supported by the app
 export const FileUploadType = {
   aws: 'aws',
   gcs: 'gcs',
@@ -8,11 +9,12 @@ export const FileUploadType = {
 
 export type FileUploadType = typeof FileUploadType[keyof typeof FileUploadType]
 
-export const FileUploadEnvVarType = {
+// file upload type strings you can specify in the env var
+export const FileUploadTypeForEnvVar = {
   ...FileUploadType,
   mongo:   'mongo',
   mongodb: 'mongodb',
   gcp:     'gcp',
 } as const;
 
-export type FileUploadEnvVarType = typeof FileUploadEnvVarType[keyof typeof FileUploadEnvVarType]
+export type FileUploadTypeForEnvVar = typeof FileUploadTypeForEnvVar[keyof typeof FileUploadTypeForEnvVar]

+ 2 - 2
apps/app/src/server/service/file-uploader/index.ts

@@ -1,4 +1,4 @@
-import { FileUploadEnvVarType } from '~/interfaces/file-uploader';
+import { FileUploadTypeForEnvVar } from '~/interfaces/file-uploader';
 import type Crowi from '~/server/crowi';
 import loggerFactory from '~/utils/logger';
 
@@ -11,7 +11,7 @@ export type { FileUploader } from './file-uploader';
 const logger = loggerFactory('growi:service:FileUploaderServise');
 
 const envToModuleMappings = {
-  ...FileUploadEnvVarType,
+  ...FileUploadTypeForEnvVar,
   mongo:   'gridfs',
   mongodb: 'gridfs',
   gcp:     'gcs',