@armi-wave/common 1.23.41 → 1.23.43
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/index.d.ts +13 -3
- package/build/index.js +25 -5
- package/build/models/TextPostComment.d.ts +17 -0
- package/build/models/TextPostComment.js +73 -0
- package/build/models/TextPostCommentDownvote.d.ts +10 -0
- package/build/models/TextPostCommentDownvote.js +63 -0
- package/build/models/TextPostCommentUpvote.d.ts +10 -0
- package/build/models/TextPostCommentUpvote.js +63 -0
- package/build/models/TextPostReply.d.ts +17 -0
- package/build/models/TextPostReply.js +79 -0
- package/build/models/TextPostReplyDownvote.d.ts +10 -0
- package/build/models/TextPostReplyDownvote.js +63 -0
- package/build/models/TextPostReplyUpvote.d.ts +10 -0
- package/build/models/TextPostReplyUpvote.js +63 -0
- package/build/models/VideoPostComment.d.ts +17 -0
- package/build/models/VideoPostComment.js +73 -0
- package/build/models/VideoPostCommentLike.d.ts +10 -0
- package/build/models/VideoPostCommentLike.js +63 -0
- package/build/models/VideoPostReply.d.ts +17 -0
- package/build/models/VideoPostReply.js +79 -0
- package/build/models/VideoPostReplyLike.d.ts +10 -0
- package/build/models/VideoPostReplyLike.js +63 -0
- package/build/models/chat/Conversation.js +3 -3
- package/package.json +1 -1
package/build/index.d.ts
CHANGED
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
import User from './models/User';
|
|
2
2
|
import Post from './models/Post';
|
|
3
|
-
import TextPost from './models/TextPost';
|
|
4
|
-
import VideoPost from './models/VideoPost';
|
|
5
3
|
import Comment from './models/Comment';
|
|
6
4
|
import Reply from './models/Reply';
|
|
7
5
|
import Follow from './models/Follow';
|
|
@@ -12,9 +10,21 @@ import PostCommentDownvote from './models/PostCommentDownvote';
|
|
|
12
10
|
import PostReplyLike from './models/PostReplyLike';
|
|
13
11
|
import PostReplyUpvote from './models/PostReplyUpvote';
|
|
14
12
|
import PostReplyDownvote from './models/PostReplyDownvote';
|
|
13
|
+
import TextPost from './models/TextPost';
|
|
15
14
|
import TextPostUpvote from './models/TextPostUpvote';
|
|
16
15
|
import TextPostDownvote from './models/TextPostDownvote';
|
|
16
|
+
import TextPostComment from './models/TextPostComment';
|
|
17
|
+
import TextPostCommentUpvote from './models/TextPostCommentUpvote';
|
|
18
|
+
import TextPostCommentDownvote from './models/TextPostCommentDownvote';
|
|
19
|
+
import TextPostReply from './models/TextPostReply';
|
|
20
|
+
import TextPostReplyUpvote from './models/TextPostReplyUpvote';
|
|
21
|
+
import TextPostReplyDownvote from './models/TextPostReplyDownvote';
|
|
22
|
+
import VideoPost from './models/VideoPost';
|
|
17
23
|
import VideoPostLike from './models/VideoPostLike';
|
|
24
|
+
import VideoPostComment from './models/VideoPostComment';
|
|
25
|
+
import VideoPostCommentLike from './models/VideoPostCommentLike';
|
|
26
|
+
import VideoPostReply from './models/VideoPostReply';
|
|
27
|
+
import VideoPostReplyLike from './models/VideoPostReplyLike';
|
|
18
28
|
export { default as Conversation } from './models/chat/Conversation';
|
|
19
29
|
export { default as Message } from './models/chat/Message';
|
|
20
30
|
export { ChatSocketEvents } from './enums/chat/ChatSocketEvents';
|
|
@@ -28,7 +38,7 @@ import CustomError from './errors/custom-error';
|
|
|
28
38
|
import NotAuthorizedError from './errors/not-authorized-error';
|
|
29
39
|
import NotFoundError from './errors/not-found-error';
|
|
30
40
|
import RequestValidationError from './errors/request-validation-error';
|
|
31
|
-
export { User, Post,
|
|
41
|
+
export { User, Post, Comment, Reply, Follow, Like, PostCommentLike, PostCommentUpvote, PostCommentDownvote, PostReplyLike, PostReplyUpvote, PostReplyDownvote, TextPost, TextPostUpvote, TextPostDownvote, TextPostComment, TextPostCommentUpvote, TextPostCommentDownvote, TextPostReply, TextPostReplyUpvote, TextPostReplyDownvote, VideoPost, VideoPostLike, VideoPostComment, VideoPostCommentLike, VideoPostReply, VideoPostReplyLike, };
|
|
32
42
|
export { BadRequestError, DatabaseConnectionError, CustomError, NotAuthorizedError, NotFoundError, RequestValidationError, };
|
|
33
43
|
export * from './middlewares/current-user';
|
|
34
44
|
export * from './middlewares/error-handler';
|
package/build/index.js
CHANGED
|
@@ -17,15 +17,11 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
17
17
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
18
18
|
};
|
|
19
19
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
20
|
-
exports.createUploadMiddleware = exports.textPostMiddleware = exports.videoMiddleware = exports.imageMiddleware = exports.MongoDBs = exports.ensureBucketExists = exports.minioClient = exports.RequestValidationError = exports.NotFoundError = exports.NotAuthorizedError = exports.CustomError = exports.DatabaseConnectionError = exports.BadRequestError = exports.VideoPostLike = exports.TextPostDownvote = exports.TextPostUpvote = exports.PostReplyDownvote = exports.PostReplyUpvote = exports.PostReplyLike = exports.PostCommentDownvote = exports.PostCommentUpvote = exports.PostCommentLike = exports.Like = exports.Follow = exports.Reply = exports.Comment = exports.
|
|
20
|
+
exports.createUploadMiddleware = exports.textPostMiddleware = exports.videoMiddleware = exports.imageMiddleware = exports.MongoDBs = exports.ensureBucketExists = exports.minioClient = exports.RequestValidationError = exports.NotFoundError = exports.NotAuthorizedError = exports.CustomError = exports.DatabaseConnectionError = exports.BadRequestError = exports.VideoPostReplyLike = exports.VideoPostReply = exports.VideoPostCommentLike = exports.VideoPostComment = exports.VideoPostLike = exports.VideoPost = exports.TextPostReplyDownvote = exports.TextPostReplyUpvote = exports.TextPostReply = exports.TextPostCommentDownvote = exports.TextPostCommentUpvote = exports.TextPostComment = exports.TextPostDownvote = exports.TextPostUpvote = exports.TextPost = exports.PostReplyDownvote = exports.PostReplyUpvote = exports.PostReplyLike = exports.PostCommentDownvote = exports.PostCommentUpvote = exports.PostCommentLike = exports.Like = exports.Follow = exports.Reply = exports.Comment = exports.Post = exports.User = exports.MessageType = exports.MessageStatus = exports.ConversationType = exports.ChatSocketEvents = exports.Message = exports.Conversation = void 0;
|
|
21
21
|
const User_1 = __importDefault(require("./models/User"));
|
|
22
22
|
exports.User = User_1.default;
|
|
23
23
|
const Post_1 = __importDefault(require("./models/Post"));
|
|
24
24
|
exports.Post = Post_1.default;
|
|
25
|
-
const TextPost_1 = __importDefault(require("./models/TextPost"));
|
|
26
|
-
exports.TextPost = TextPost_1.default;
|
|
27
|
-
const VideoPost_1 = __importDefault(require("./models/VideoPost"));
|
|
28
|
-
exports.VideoPost = VideoPost_1.default;
|
|
29
25
|
const Comment_1 = __importDefault(require("./models/Comment"));
|
|
30
26
|
exports.Comment = Comment_1.default;
|
|
31
27
|
const Reply_1 = __importDefault(require("./models/Reply"));
|
|
@@ -46,12 +42,36 @@ const PostReplyUpvote_1 = __importDefault(require("./models/PostReplyUpvote"));
|
|
|
46
42
|
exports.PostReplyUpvote = PostReplyUpvote_1.default;
|
|
47
43
|
const PostReplyDownvote_1 = __importDefault(require("./models/PostReplyDownvote"));
|
|
48
44
|
exports.PostReplyDownvote = PostReplyDownvote_1.default;
|
|
45
|
+
const TextPost_1 = __importDefault(require("./models/TextPost"));
|
|
46
|
+
exports.TextPost = TextPost_1.default;
|
|
49
47
|
const TextPostUpvote_1 = __importDefault(require("./models/TextPostUpvote"));
|
|
50
48
|
exports.TextPostUpvote = TextPostUpvote_1.default;
|
|
51
49
|
const TextPostDownvote_1 = __importDefault(require("./models/TextPostDownvote"));
|
|
52
50
|
exports.TextPostDownvote = TextPostDownvote_1.default;
|
|
51
|
+
const TextPostComment_1 = __importDefault(require("./models/TextPostComment"));
|
|
52
|
+
exports.TextPostComment = TextPostComment_1.default;
|
|
53
|
+
const TextPostCommentUpvote_1 = __importDefault(require("./models/TextPostCommentUpvote"));
|
|
54
|
+
exports.TextPostCommentUpvote = TextPostCommentUpvote_1.default;
|
|
55
|
+
const TextPostCommentDownvote_1 = __importDefault(require("./models/TextPostCommentDownvote"));
|
|
56
|
+
exports.TextPostCommentDownvote = TextPostCommentDownvote_1.default;
|
|
57
|
+
const TextPostReply_1 = __importDefault(require("./models/TextPostReply"));
|
|
58
|
+
exports.TextPostReply = TextPostReply_1.default;
|
|
59
|
+
const TextPostReplyUpvote_1 = __importDefault(require("./models/TextPostReplyUpvote"));
|
|
60
|
+
exports.TextPostReplyUpvote = TextPostReplyUpvote_1.default;
|
|
61
|
+
const TextPostReplyDownvote_1 = __importDefault(require("./models/TextPostReplyDownvote"));
|
|
62
|
+
exports.TextPostReplyDownvote = TextPostReplyDownvote_1.default;
|
|
63
|
+
const VideoPost_1 = __importDefault(require("./models/VideoPost"));
|
|
64
|
+
exports.VideoPost = VideoPost_1.default;
|
|
53
65
|
const VideoPostLike_1 = __importDefault(require("./models/VideoPostLike"));
|
|
54
66
|
exports.VideoPostLike = VideoPostLike_1.default;
|
|
67
|
+
const VideoPostComment_1 = __importDefault(require("./models/VideoPostComment"));
|
|
68
|
+
exports.VideoPostComment = VideoPostComment_1.default;
|
|
69
|
+
const VideoPostCommentLike_1 = __importDefault(require("./models/VideoPostCommentLike"));
|
|
70
|
+
exports.VideoPostCommentLike = VideoPostCommentLike_1.default;
|
|
71
|
+
const VideoPostReply_1 = __importDefault(require("./models/VideoPostReply"));
|
|
72
|
+
exports.VideoPostReply = VideoPostReply_1.default;
|
|
73
|
+
const VideoPostReplyLike_1 = __importDefault(require("./models/VideoPostReplyLike"));
|
|
74
|
+
exports.VideoPostReplyLike = VideoPostReplyLike_1.default;
|
|
55
75
|
var Conversation_1 = require("./models/chat/Conversation");
|
|
56
76
|
Object.defineProperty(exports, "Conversation", { enumerable: true, get: function () { return __importDefault(Conversation_1).default; } });
|
|
57
77
|
var Message_1 = require("./models/chat/Message");
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import mongoose, { Document } from 'mongoose';
|
|
2
|
+
import { Mention } from './Mention';
|
|
3
|
+
interface TextPostComment extends Document {
|
|
4
|
+
textPostId: mongoose.Types.ObjectId;
|
|
5
|
+
userId: mongoose.Types.ObjectId;
|
|
6
|
+
username: string;
|
|
7
|
+
profilePicUrl: string;
|
|
8
|
+
text: string;
|
|
9
|
+
mentions?: Mention[];
|
|
10
|
+
upVotes?: number;
|
|
11
|
+
reportsNr?: number;
|
|
12
|
+
replyNr?: number;
|
|
13
|
+
}
|
|
14
|
+
interface TextPostCommentModel extends mongoose.Model<TextPostComment> {
|
|
15
|
+
}
|
|
16
|
+
declare const TextPostComment: TextPostCommentModel;
|
|
17
|
+
export default TextPostComment;
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
const mongoose_1 = __importStar(require("mongoose"));
|
|
37
|
+
const textPostCommentSchema = new mongoose_1.Schema({
|
|
38
|
+
textPostId: {
|
|
39
|
+
type: mongoose_1.Schema.Types.ObjectId,
|
|
40
|
+
ref: 'TextPost',
|
|
41
|
+
required: true,
|
|
42
|
+
index: true,
|
|
43
|
+
},
|
|
44
|
+
userId: {
|
|
45
|
+
type: mongoose_1.Schema.Types.ObjectId,
|
|
46
|
+
ref: 'User',
|
|
47
|
+
required: true,
|
|
48
|
+
},
|
|
49
|
+
username: { type: String, required: true },
|
|
50
|
+
profilePicUrl: { type: String, default: '' },
|
|
51
|
+
text: { type: String, required: true },
|
|
52
|
+
mentions: [
|
|
53
|
+
{
|
|
54
|
+
userId: { type: mongoose_1.Schema.Types.ObjectId, ref: 'User', required: true },
|
|
55
|
+
username: { type: String, required: true },
|
|
56
|
+
},
|
|
57
|
+
],
|
|
58
|
+
upVotes: { type: Number, required: false, default: 0 },
|
|
59
|
+
reportsNr: { type: Number, required: false, default: 0 },
|
|
60
|
+
replyNr: { type: Number, required: false, default: 0 },
|
|
61
|
+
}, {
|
|
62
|
+
timestamps: true,
|
|
63
|
+
toJSON: {
|
|
64
|
+
transform(doc, ret) {
|
|
65
|
+
ret.id = ret._id;
|
|
66
|
+
delete ret.__v;
|
|
67
|
+
delete ret._id;
|
|
68
|
+
delete ret.reportsNr;
|
|
69
|
+
},
|
|
70
|
+
},
|
|
71
|
+
});
|
|
72
|
+
const TextPostComment = mongoose_1.default.model('TextPostComment', textPostCommentSchema);
|
|
73
|
+
exports.default = TextPostComment;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import mongoose, { Document, Model } from 'mongoose';
|
|
2
|
+
interface TextPostCommentDownvote extends Document {
|
|
3
|
+
userId: mongoose.Types.ObjectId;
|
|
4
|
+
textPostCommentId: mongoose.Types.ObjectId;
|
|
5
|
+
createdAt: Date;
|
|
6
|
+
}
|
|
7
|
+
interface PostCommentDownvoteModel extends Model<TextPostCommentDownvote> {
|
|
8
|
+
}
|
|
9
|
+
declare const TextPostCommentDownvote: PostCommentDownvoteModel;
|
|
10
|
+
export default TextPostCommentDownvote;
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
const mongoose_1 = __importStar(require("mongoose"));
|
|
37
|
+
// Define the schema
|
|
38
|
+
const postCommentDownvoteSchema = new mongoose_1.Schema({
|
|
39
|
+
userId: {
|
|
40
|
+
type: mongoose_1.Schema.Types.ObjectId,
|
|
41
|
+
ref: 'User',
|
|
42
|
+
required: true,
|
|
43
|
+
index: true,
|
|
44
|
+
},
|
|
45
|
+
textPostCommentId: {
|
|
46
|
+
type: mongoose_1.Schema.Types.ObjectId,
|
|
47
|
+
ref: 'TextPostComment',
|
|
48
|
+
required: true,
|
|
49
|
+
index: true,
|
|
50
|
+
},
|
|
51
|
+
createdAt: { type: Date, default: Date.now },
|
|
52
|
+
}, {
|
|
53
|
+
toJSON: {
|
|
54
|
+
transform(doc, ret) {
|
|
55
|
+
ret.id = ret._id;
|
|
56
|
+
delete ret.__v;
|
|
57
|
+
delete ret._id;
|
|
58
|
+
},
|
|
59
|
+
},
|
|
60
|
+
});
|
|
61
|
+
postCommentDownvoteSchema.index({ userId: 1, textPostCommentId: 1 }, { unique: true });
|
|
62
|
+
const TextPostCommentDownvote = mongoose_1.default.model('TextPostCommentDownvote', postCommentDownvoteSchema);
|
|
63
|
+
exports.default = TextPostCommentDownvote;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import mongoose, { Document, Model } from 'mongoose';
|
|
2
|
+
interface TextPostCommentUpvote extends Document {
|
|
3
|
+
userId: mongoose.Types.ObjectId;
|
|
4
|
+
textPostCommentId: mongoose.Types.ObjectId;
|
|
5
|
+
createdAt: Date;
|
|
6
|
+
}
|
|
7
|
+
interface PostCommentUpvoteModel extends Model<TextPostCommentUpvote> {
|
|
8
|
+
}
|
|
9
|
+
declare const TextPostCommentUpvote: PostCommentUpvoteModel;
|
|
10
|
+
export default TextPostCommentUpvote;
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
const mongoose_1 = __importStar(require("mongoose"));
|
|
37
|
+
// Define the schema
|
|
38
|
+
const postCommentUpvoteSchema = new mongoose_1.Schema({
|
|
39
|
+
userId: {
|
|
40
|
+
type: mongoose_1.Schema.Types.ObjectId,
|
|
41
|
+
ref: 'User',
|
|
42
|
+
required: true,
|
|
43
|
+
index: true,
|
|
44
|
+
},
|
|
45
|
+
textPostCommentId: {
|
|
46
|
+
type: mongoose_1.Schema.Types.ObjectId,
|
|
47
|
+
ref: 'TextPostComment',
|
|
48
|
+
required: true,
|
|
49
|
+
index: true,
|
|
50
|
+
},
|
|
51
|
+
createdAt: { type: Date, default: Date.now },
|
|
52
|
+
}, {
|
|
53
|
+
toJSON: {
|
|
54
|
+
transform(doc, ret) {
|
|
55
|
+
ret.id = ret._id;
|
|
56
|
+
delete ret.__v;
|
|
57
|
+
delete ret._id;
|
|
58
|
+
},
|
|
59
|
+
},
|
|
60
|
+
});
|
|
61
|
+
postCommentUpvoteSchema.index({ userId: 1, textPostCommentId: 1 }, { unique: true });
|
|
62
|
+
const TextPostCommentUpvote = mongoose_1.default.model('TextPostCommentUpvote', postCommentUpvoteSchema);
|
|
63
|
+
exports.default = TextPostCommentUpvote;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import mongoose, { Document } from 'mongoose';
|
|
2
|
+
import { Mention } from './Mention';
|
|
3
|
+
interface TextPostReply extends Document {
|
|
4
|
+
textPostCommentId: mongoose.Types.ObjectId;
|
|
5
|
+
postId: mongoose.Types.ObjectId;
|
|
6
|
+
userId: mongoose.Types.ObjectId;
|
|
7
|
+
username: string;
|
|
8
|
+
profilePicUrl: string;
|
|
9
|
+
text: string;
|
|
10
|
+
mentions?: Mention[];
|
|
11
|
+
upVotes?: number;
|
|
12
|
+
reportsNr?: number;
|
|
13
|
+
}
|
|
14
|
+
interface TextPostReplyModel extends mongoose.Model<TextPostReply> {
|
|
15
|
+
}
|
|
16
|
+
declare const TextPostReply: TextPostReplyModel;
|
|
17
|
+
export default TextPostReply;
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
const mongoose_1 = __importStar(require("mongoose"));
|
|
37
|
+
const textPostReplySchema = new mongoose_1.default.Schema({
|
|
38
|
+
textPostCommentId: {
|
|
39
|
+
type: mongoose_1.Schema.Types.ObjectId,
|
|
40
|
+
ref: 'TextPostComment',
|
|
41
|
+
index: true,
|
|
42
|
+
required: true,
|
|
43
|
+
},
|
|
44
|
+
postId: {
|
|
45
|
+
type: mongoose_1.Schema.Types.ObjectId,
|
|
46
|
+
ref: 'TextPost',
|
|
47
|
+
index: true,
|
|
48
|
+
required: true,
|
|
49
|
+
},
|
|
50
|
+
userId: {
|
|
51
|
+
type: mongoose_1.Schema.Types.ObjectId,
|
|
52
|
+
ref: 'User',
|
|
53
|
+
index: true,
|
|
54
|
+
required: true,
|
|
55
|
+
},
|
|
56
|
+
username: { type: String, required: true },
|
|
57
|
+
profilePicUrl: { type: String, default: '' },
|
|
58
|
+
text: { type: String, required: true },
|
|
59
|
+
mentions: [
|
|
60
|
+
{
|
|
61
|
+
userId: { type: mongoose_1.Schema.Types.ObjectId, ref: 'User', required: true },
|
|
62
|
+
username: { type: String, required: true },
|
|
63
|
+
},
|
|
64
|
+
],
|
|
65
|
+
upVotes: { type: Number, required: false, default: 0 },
|
|
66
|
+
reportsNr: { type: Number, required: false, default: 0 },
|
|
67
|
+
}, {
|
|
68
|
+
timestamps: true,
|
|
69
|
+
toJSON: {
|
|
70
|
+
transform(doc, ret) {
|
|
71
|
+
ret.id = ret._id;
|
|
72
|
+
delete ret.__v;
|
|
73
|
+
delete ret._id;
|
|
74
|
+
delete ret.reportsNr;
|
|
75
|
+
},
|
|
76
|
+
},
|
|
77
|
+
});
|
|
78
|
+
const TextPostReply = mongoose_1.default.model('TextPostReply', textPostReplySchema);
|
|
79
|
+
exports.default = TextPostReply;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import mongoose, { Document, Model } from 'mongoose';
|
|
2
|
+
interface TextPostReplyDownvote extends Document {
|
|
3
|
+
userId: mongoose.Types.ObjectId;
|
|
4
|
+
textPostReplyId: mongoose.Types.ObjectId;
|
|
5
|
+
createdAt: Date;
|
|
6
|
+
}
|
|
7
|
+
interface PostReplyDownvoteModel extends Model<TextPostReplyDownvote> {
|
|
8
|
+
}
|
|
9
|
+
declare const TextPostReplyDownvote: PostReplyDownvoteModel;
|
|
10
|
+
export default TextPostReplyDownvote;
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
const mongoose_1 = __importStar(require("mongoose"));
|
|
37
|
+
// Define the schema
|
|
38
|
+
const textPostReplyDownvoteSchema = new mongoose_1.Schema({
|
|
39
|
+
userId: {
|
|
40
|
+
type: mongoose_1.Schema.Types.ObjectId,
|
|
41
|
+
ref: 'User',
|
|
42
|
+
required: true,
|
|
43
|
+
index: true,
|
|
44
|
+
},
|
|
45
|
+
textPostReplyId: {
|
|
46
|
+
type: mongoose_1.Schema.Types.ObjectId,
|
|
47
|
+
ref: 'TextPostReply',
|
|
48
|
+
required: true,
|
|
49
|
+
index: true,
|
|
50
|
+
},
|
|
51
|
+
createdAt: { type: Date, default: Date.now },
|
|
52
|
+
}, {
|
|
53
|
+
toJSON: {
|
|
54
|
+
transform(doc, ret) {
|
|
55
|
+
ret.id = ret._id;
|
|
56
|
+
delete ret.__v;
|
|
57
|
+
delete ret._id;
|
|
58
|
+
},
|
|
59
|
+
},
|
|
60
|
+
});
|
|
61
|
+
textPostReplyDownvoteSchema.index({ userId: 1, textPostReplyId: 1 }, { unique: true });
|
|
62
|
+
const TextPostReplyDownvote = mongoose_1.default.model('TextPostReplyDownvote', textPostReplyDownvoteSchema);
|
|
63
|
+
exports.default = TextPostReplyDownvote;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import mongoose, { Document, Model } from 'mongoose';
|
|
2
|
+
interface TextPostReplyUpvote extends Document {
|
|
3
|
+
userId: mongoose.Types.ObjectId;
|
|
4
|
+
textPostReplyId: mongoose.Types.ObjectId;
|
|
5
|
+
createdAt: Date;
|
|
6
|
+
}
|
|
7
|
+
interface PostReplyUpvoteModel extends Model<TextPostReplyUpvote> {
|
|
8
|
+
}
|
|
9
|
+
declare const TextPostReplyUpvote: PostReplyUpvoteModel;
|
|
10
|
+
export default TextPostReplyUpvote;
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
const mongoose_1 = __importStar(require("mongoose"));
|
|
37
|
+
// Define the schema
|
|
38
|
+
const textPostReplyUpvoteSchema = new mongoose_1.Schema({
|
|
39
|
+
userId: {
|
|
40
|
+
type: mongoose_1.Schema.Types.ObjectId,
|
|
41
|
+
ref: 'User',
|
|
42
|
+
required: true,
|
|
43
|
+
index: true,
|
|
44
|
+
},
|
|
45
|
+
textPostReplyId: {
|
|
46
|
+
type: mongoose_1.Schema.Types.ObjectId,
|
|
47
|
+
ref: 'TextPostReply',
|
|
48
|
+
required: true,
|
|
49
|
+
index: true,
|
|
50
|
+
},
|
|
51
|
+
createdAt: { type: Date, default: Date.now },
|
|
52
|
+
}, {
|
|
53
|
+
toJSON: {
|
|
54
|
+
transform(doc, ret) {
|
|
55
|
+
ret.id = ret._id;
|
|
56
|
+
delete ret.__v;
|
|
57
|
+
delete ret._id;
|
|
58
|
+
},
|
|
59
|
+
},
|
|
60
|
+
});
|
|
61
|
+
textPostReplyUpvoteSchema.index({ userId: 1, textPostReplyId: 1 }, { unique: true });
|
|
62
|
+
const TextPostReplyUpvote = mongoose_1.default.model('TextPostReplyUpvote', textPostReplyUpvoteSchema);
|
|
63
|
+
exports.default = TextPostReplyUpvote;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import mongoose, { Document } from 'mongoose';
|
|
2
|
+
import { Mention } from './Mention';
|
|
3
|
+
interface VideoPostComment extends Document {
|
|
4
|
+
videoPostId: mongoose.Types.ObjectId;
|
|
5
|
+
userId: mongoose.Types.ObjectId;
|
|
6
|
+
username: string;
|
|
7
|
+
profilePicUrl: string;
|
|
8
|
+
text: string;
|
|
9
|
+
mentions?: Mention[];
|
|
10
|
+
likesNr?: number;
|
|
11
|
+
reportsNr?: number;
|
|
12
|
+
replyNr?: number;
|
|
13
|
+
}
|
|
14
|
+
interface VideoPostCommentModel extends mongoose.Model<VideoPostComment> {
|
|
15
|
+
}
|
|
16
|
+
declare const VideoPostComment: VideoPostCommentModel;
|
|
17
|
+
export default VideoPostComment;
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
const mongoose_1 = __importStar(require("mongoose"));
|
|
37
|
+
const videoPostCommentSchema = new mongoose_1.Schema({
|
|
38
|
+
videoPostId: {
|
|
39
|
+
type: mongoose_1.Schema.Types.ObjectId,
|
|
40
|
+
ref: 'VideoPost',
|
|
41
|
+
required: true,
|
|
42
|
+
index: true,
|
|
43
|
+
},
|
|
44
|
+
userId: {
|
|
45
|
+
type: mongoose_1.Schema.Types.ObjectId,
|
|
46
|
+
ref: 'User',
|
|
47
|
+
required: true,
|
|
48
|
+
},
|
|
49
|
+
username: { type: String, required: true },
|
|
50
|
+
profilePicUrl: { type: String, default: '' },
|
|
51
|
+
text: { type: String, required: true },
|
|
52
|
+
mentions: [
|
|
53
|
+
{
|
|
54
|
+
userId: { type: mongoose_1.Schema.Types.ObjectId, ref: 'User', required: true },
|
|
55
|
+
username: { type: String, required: true },
|
|
56
|
+
},
|
|
57
|
+
],
|
|
58
|
+
likesNr: { type: Number, required: false, default: 0 },
|
|
59
|
+
reportsNr: { type: Number, required: false, default: 0 },
|
|
60
|
+
replyNr: { type: Number, required: false, default: 0 },
|
|
61
|
+
}, {
|
|
62
|
+
timestamps: true,
|
|
63
|
+
toJSON: {
|
|
64
|
+
transform(doc, ret) {
|
|
65
|
+
ret.id = ret._id;
|
|
66
|
+
delete ret.__v;
|
|
67
|
+
delete ret._id;
|
|
68
|
+
delete ret.reportsNr;
|
|
69
|
+
},
|
|
70
|
+
},
|
|
71
|
+
});
|
|
72
|
+
const VideoPostComment = mongoose_1.default.model('VideoPostComment', videoPostCommentSchema);
|
|
73
|
+
exports.default = VideoPostComment;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import mongoose, { Document, Model } from 'mongoose';
|
|
2
|
+
interface VideoPostCommentLike extends Document {
|
|
3
|
+
userId: mongoose.Types.ObjectId;
|
|
4
|
+
videoPostCommentId: mongoose.Types.ObjectId;
|
|
5
|
+
createdAt: Date;
|
|
6
|
+
}
|
|
7
|
+
interface VideoPostCommentLikeModel extends Model<VideoPostCommentLike> {
|
|
8
|
+
}
|
|
9
|
+
declare const VideoPostCommentLike: VideoPostCommentLikeModel;
|
|
10
|
+
export default VideoPostCommentLike;
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
const mongoose_1 = __importStar(require("mongoose"));
|
|
37
|
+
// Define the schema
|
|
38
|
+
const videoPostCommentLikeSchema = new mongoose_1.Schema({
|
|
39
|
+
userId: {
|
|
40
|
+
type: mongoose_1.Schema.Types.ObjectId,
|
|
41
|
+
ref: 'User',
|
|
42
|
+
required: true,
|
|
43
|
+
index: true,
|
|
44
|
+
},
|
|
45
|
+
videoPostCommentId: {
|
|
46
|
+
type: mongoose_1.Schema.Types.ObjectId,
|
|
47
|
+
ref: 'VideoPostComment',
|
|
48
|
+
required: true,
|
|
49
|
+
index: true,
|
|
50
|
+
},
|
|
51
|
+
createdAt: { type: Date, default: Date.now },
|
|
52
|
+
}, {
|
|
53
|
+
toJSON: {
|
|
54
|
+
transform(doc, ret) {
|
|
55
|
+
ret.id = ret._id;
|
|
56
|
+
delete ret.__v;
|
|
57
|
+
delete ret._id;
|
|
58
|
+
},
|
|
59
|
+
},
|
|
60
|
+
});
|
|
61
|
+
videoPostCommentLikeSchema.index({ userId: 1, videoPostCommentId: 1 }, { unique: true });
|
|
62
|
+
const VideoPostCommentLike = mongoose_1.default.model('VideoPostCommentLike', videoPostCommentLikeSchema);
|
|
63
|
+
exports.default = VideoPostCommentLike;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import mongoose, { Document } from 'mongoose';
|
|
2
|
+
import { Mention } from './Mention';
|
|
3
|
+
interface VideoPostReply extends Document {
|
|
4
|
+
videoPostCommentId: mongoose.Types.ObjectId;
|
|
5
|
+
postId: mongoose.Types.ObjectId;
|
|
6
|
+
userId: mongoose.Types.ObjectId;
|
|
7
|
+
username: string;
|
|
8
|
+
profilePicUrl: string;
|
|
9
|
+
text: string;
|
|
10
|
+
mentions?: Mention[];
|
|
11
|
+
likesNr?: number;
|
|
12
|
+
reportsNr?: number;
|
|
13
|
+
}
|
|
14
|
+
interface VideoPostReplyModel extends mongoose.Model<VideoPostReply> {
|
|
15
|
+
}
|
|
16
|
+
declare const VideoPostReply: VideoPostReplyModel;
|
|
17
|
+
export default VideoPostReply;
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
const mongoose_1 = __importStar(require("mongoose"));
|
|
37
|
+
const videoPostReplySchema = new mongoose_1.default.Schema({
|
|
38
|
+
videoPostCommentId: {
|
|
39
|
+
type: mongoose_1.Schema.Types.ObjectId,
|
|
40
|
+
ref: 'VideoPostComment',
|
|
41
|
+
index: true,
|
|
42
|
+
required: true,
|
|
43
|
+
},
|
|
44
|
+
postId: {
|
|
45
|
+
type: mongoose_1.Schema.Types.ObjectId,
|
|
46
|
+
ref: 'VideoPost',
|
|
47
|
+
index: true,
|
|
48
|
+
required: true,
|
|
49
|
+
},
|
|
50
|
+
userId: {
|
|
51
|
+
type: mongoose_1.Schema.Types.ObjectId,
|
|
52
|
+
ref: 'User',
|
|
53
|
+
index: true,
|
|
54
|
+
required: true,
|
|
55
|
+
},
|
|
56
|
+
username: { type: String, required: true },
|
|
57
|
+
profilePicUrl: { type: String, default: '' },
|
|
58
|
+
text: { type: String, required: true },
|
|
59
|
+
mentions: [
|
|
60
|
+
{
|
|
61
|
+
userId: { type: mongoose_1.Schema.Types.ObjectId, ref: 'User', required: true },
|
|
62
|
+
username: { type: String, required: true },
|
|
63
|
+
},
|
|
64
|
+
],
|
|
65
|
+
likesNr: { type: Number, required: false, default: 0 },
|
|
66
|
+
reportsNr: { type: Number, required: false, default: 0 },
|
|
67
|
+
}, {
|
|
68
|
+
timestamps: true,
|
|
69
|
+
toJSON: {
|
|
70
|
+
transform(doc, ret) {
|
|
71
|
+
ret.id = ret._id;
|
|
72
|
+
delete ret.__v;
|
|
73
|
+
delete ret._id;
|
|
74
|
+
delete ret.reportsNr;
|
|
75
|
+
},
|
|
76
|
+
},
|
|
77
|
+
});
|
|
78
|
+
const VideoPostReply = mongoose_1.default.model('VideoPostReply', videoPostReplySchema);
|
|
79
|
+
exports.default = VideoPostReply;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import mongoose, { Document, Model } from 'mongoose';
|
|
2
|
+
interface VideoPostReplyLike extends Document {
|
|
3
|
+
userId: mongoose.Types.ObjectId;
|
|
4
|
+
videoPostReplyId: mongoose.Types.ObjectId;
|
|
5
|
+
createdAt: Date;
|
|
6
|
+
}
|
|
7
|
+
interface VideoPostReplyLikeModel extends Model<VideoPostReplyLike> {
|
|
8
|
+
}
|
|
9
|
+
declare const VideoPostReplyLike: VideoPostReplyLikeModel;
|
|
10
|
+
export default VideoPostReplyLike;
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
const mongoose_1 = __importStar(require("mongoose"));
|
|
37
|
+
// Define the schema
|
|
38
|
+
const videoPostReplyLikeSchema = new mongoose_1.Schema({
|
|
39
|
+
userId: {
|
|
40
|
+
type: mongoose_1.Schema.Types.ObjectId,
|
|
41
|
+
ref: 'User',
|
|
42
|
+
required: true,
|
|
43
|
+
index: true,
|
|
44
|
+
},
|
|
45
|
+
videoPostReplyId: {
|
|
46
|
+
type: mongoose_1.Schema.Types.ObjectId,
|
|
47
|
+
ref: 'VideoPostReply',
|
|
48
|
+
required: true,
|
|
49
|
+
index: true,
|
|
50
|
+
},
|
|
51
|
+
createdAt: { type: Date, default: Date.now },
|
|
52
|
+
}, {
|
|
53
|
+
toJSON: {
|
|
54
|
+
transform(doc, ret) {
|
|
55
|
+
ret.id = ret._id;
|
|
56
|
+
delete ret.__v;
|
|
57
|
+
delete ret._id;
|
|
58
|
+
},
|
|
59
|
+
},
|
|
60
|
+
});
|
|
61
|
+
videoPostReplyLikeSchema.index({ userId: 1, videoPostReplyId: 1 }, { unique: true });
|
|
62
|
+
const VideoPostReplyLike = mongoose_1.default.model('VideoPostReplyLike', videoPostReplyLikeSchema);
|
|
63
|
+
exports.default = VideoPostReplyLike;
|
|
@@ -53,9 +53,9 @@ const conversationSchema = new mongoose_1.Schema({
|
|
|
53
53
|
default: ConversationType_1.ConversationType.Direct,
|
|
54
54
|
},
|
|
55
55
|
lastMessage: {
|
|
56
|
-
content: { type: String, required:
|
|
57
|
-
senderId: { type: mongoose_1.Schema.Types.ObjectId, ref: 'User', required:
|
|
58
|
-
timestamp: { type: Date, required:
|
|
56
|
+
content: { type: String, required: false },
|
|
57
|
+
senderId: { type: mongoose_1.Schema.Types.ObjectId, ref: 'User', required: false },
|
|
58
|
+
timestamp: { type: Date, required: false },
|
|
59
59
|
},
|
|
60
60
|
unreadCount: {
|
|
61
61
|
type: Map,
|