Initial commit 🍀
This commit is contained in:
@@ -0,0 +1,7 @@
|
||||
const collection = global.db.collection('apps');
|
||||
|
||||
collection.createIndex('name_id');
|
||||
collection.createIndex('name_id_lower');
|
||||
collection.createIndex('secret');
|
||||
|
||||
export default collection;
|
||||
@@ -0,0 +1 @@
|
||||
export default global.db.collection('appdata');
|
||||
@@ -0,0 +1 @@
|
||||
export default global.db.collection('auth_sessions');
|
||||
@@ -0,0 +1,11 @@
|
||||
export default global.db.collection('drive_files');
|
||||
|
||||
export function validateFileName(name: string): boolean {
|
||||
return (
|
||||
(name.trim().length > 0) &&
|
||||
(name.length <= 200) &&
|
||||
(name.indexOf('\\') === -1) &&
|
||||
(name.indexOf('/') === -1) &&
|
||||
(name.indexOf('..') === -1)
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
export default global.db.collection('drive_folders');
|
||||
|
||||
export function isValidFolderName(name: string): boolean {
|
||||
return (
|
||||
(name.trim().length > 0) &&
|
||||
(name.length <= 200)
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
export default global.db.collection('drive_tags');
|
||||
@@ -0,0 +1 @@
|
||||
export default global.db.collection('favorites');
|
||||
@@ -0,0 +1 @@
|
||||
export default global.db.collection('following');
|
||||
@@ -0,0 +1 @@
|
||||
export default global.db.collection('likes');
|
||||
@@ -0,0 +1 @@
|
||||
export default global.db.collection('messaging_histories');
|
||||
@@ -0,0 +1 @@
|
||||
export default global.db.collection('messaging_messages');
|
||||
@@ -0,0 +1 @@
|
||||
export default global.db.collection('notifications');
|
||||
@@ -0,0 +1 @@
|
||||
export default global.db.collection('posts');
|
||||
@@ -0,0 +1 @@
|
||||
export default global.db.collection('signin');
|
||||
@@ -0,0 +1,10 @@
|
||||
const collection = global.db.collection('users');
|
||||
|
||||
collection.createIndex('username');
|
||||
collection.createIndex('token');
|
||||
|
||||
export default collection;
|
||||
|
||||
export function validateUsername(username: string): boolean {
|
||||
return /^[a-zA-Z0-9\-]{3,20}$/.test(username);
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
const collection = global.db.collection('userkeys');
|
||||
|
||||
collection.createIndex('key');
|
||||
|
||||
export default collection;
|
||||
Reference in New Issue
Block a user