Page MenuHomePhabricator

D12029.diff
No OneTemporary

D12029.diff

diff --git a/keyserver/src/uploads/uploads.js b/keyserver/src/uploads/uploads.js
--- a/keyserver/src/uploads/uploads.js
+++ b/keyserver/src/uploads/uploads.js
@@ -9,10 +9,11 @@
import {
type UploadMediaMetadataRequest,
type UploadMultimediaResult,
- uploadMultimediaResultValidator,
type UploadDeletionRequest,
type Dimensions,
+ type MultimediaUploadResult,
} from 'lib/types/media-types.js';
+import { MultimediaUploadResultValidator } from 'lib/types/validators/upload-validators.js';
import { ServerError } from 'lib/utils/errors.js';
import { tShape, tID } from 'lib/utils/validation-utils.js';
@@ -32,13 +33,6 @@
const upload = multer();
const multerProcessor: Middleware<> = upload.array('multimedia');
-type MultimediaUploadResult = {
- results: UploadMultimediaResult[],
-};
-const MultimediaUploadResultValidator = tShape<MultimediaUploadResult>({
- results: t.list(uploadMultimediaResultValidator),
-});
-
async function multimediaUploadResponder(
viewer: Viewer,
req: MulterRequest,
diff --git a/lib/types/media-types.js b/lib/types/media-types.js
--- a/lib/types/media-types.js
+++ b/lib/types/media-types.js
@@ -817,3 +817,7 @@
encryptedImageValidator,
encryptedVideoValidator,
]);
+
+export type MultimediaUploadResult = {
+ results: UploadMultimediaResult[],
+};
diff --git a/lib/types/validators/upload-validators.js b/lib/types/validators/upload-validators.js
new file mode 100644
--- /dev/null
+++ b/lib/types/validators/upload-validators.js
@@ -0,0 +1,12 @@
+// @flow
+
+import t, { type TInterface } from 'tcomb';
+
+import { tShape } from '../../utils/validation-utils.js';
+import { uploadMultimediaResultValidator } from '../media-types.js';
+import { type MultimediaUploadResult } from '../media-types.js';
+
+export const MultimediaUploadResultValidator: TInterface<MultimediaUploadResult> =
+ tShape<MultimediaUploadResult>({
+ results: t.list(uploadMultimediaResultValidator),
+ });

File Metadata

Mime Type
text/plain
Expires
Fri, Dec 27, 8:35 PM (8 h, 11 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2719880
Default Alt Text
D12029.diff (1 KB)

Event Timeline