Spaces:
Running
Running
Download models/Room.js from 4send/messenger: direct link, hf CLI and curl.
- Browser
- Download file 1.12 kB
-
https://huggingface.co/spaces/4send/messenger/resolve/main/models/Room.js
- Command line
-
hf download hf://spaces/4send/messenger/models/Room.js
-
curl -L -o Room.js https://huggingface.co/spaces/4send/messenger/resolve/main/models/Room.js
1.12 kB
| const mongoose = require('mongoose'); | |
| const RoomSchema = new mongoose.Schema({ | |
| roomId: { type: String, unique: true, index: true }, | |
| name: { type: String, maxlength: 20, match: /^[a-zA-Z]{4,20}$/ }, | |
| description: { type: String, default: '', maxlength: 500 }, | |
| type: { type: String, enum: ['group', 'channel'] }, | |
| isPublic: { type: Boolean, default: false }, | |
| publicLink: { type: String, lowercase: true, trim: true, match: /^[a-z0-9-]{3,30}$/, index: true, sparse: true }, | |
| owner: { type: String, index: true }, | |
| members: [{ type: String }], | |
| joinRequests: [{ type: String }], | |
| avatar: { type: String, default: null }, | |
| isVerified: { type: Boolean, default: false }, | |
| timestamp: { type: Date, default: Date.now }, | |
| copyRestriction: { type: Boolean, default: false }, | |
| autoDeleteTimer: { type: Number, default: 0 }, | |
| forwardRestriction: { type: Boolean, default: false }, | |
| screenshotNotification: { type: Boolean, default: false } | |
| }); | |
| RoomSchema.index({ members: 1 }); | |
| RoomSchema.index({ members: 1, timestamp: -1 }); | |
| module.exports = mongoose.model('Room', RoomSchema); | |