Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F32167695
D4990.1765053494.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
932 B
Referenced Files
None
Subscribers
None
D4990.1765053494.diff
View Options
diff --git a/lib/utils/validation-utils.js b/lib/utils/validation-utils.js
--- a/lib/utils/validation-utils.js
+++ b/lib/utils/validation-utils.js
@@ -7,6 +7,7 @@
TRefinement,
TEnums,
TInterface,
+ TUnion,
} from 'tcomb';
import {
@@ -65,6 +66,22 @@
const tOldValidUsername: TRegex = tRegex(oldValidUsernameRegex);
const tID: TRefinement<string> = t.refinement(t.String, (id: string) => !!id);
+const tMediaMessagePhoto: TInterface = tShape({
+ type: tString('photo'),
+ uploadID: t.String,
+});
+
+const tMediaMessageVideo: TInterface = tShape({
+ type: tString('video'),
+ uploadID: t.String,
+ thumbnailUploadID: t.String,
+});
+
+const tMediaMessageMedia: TUnion<TInterface> = t.union([
+ tMediaMessagePhoto,
+ tMediaMessageVideo,
+]);
+
export {
tBool,
tString,
@@ -82,4 +99,7 @@
tEmail,
tOldValidUsername,
tID,
+ tMediaMessagePhoto,
+ tMediaMessageVideo,
+ tMediaMessageMedia,
};
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sat, Dec 6, 8:38 PM (22 h, 25 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
5840693
Default Alt Text
D4990.1765053494.diff (932 B)
Attached To
Mode
D4990: [lib] Introduce `tMediaMessage[Photo/Video/Media]` to validate requests to `textMessageCreationResponder`
Attached
Detach File
Event Timeline
Log In to Comment