@armi-wave/common 1.23.14 → 1.23.16
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/models/Comment.d.ts +1 -3
- package/build/models/Comment.js +2 -5
- package/build/models/Post.d.ts +0 -2
- package/build/models/Post.js +1 -4
- package/build/models/Reply.d.ts +1 -3
- package/build/models/Reply.js +2 -5
- package/build/models/User.d.ts +0 -1
- package/build/models/User.js +2 -4
- package/package.json +1 -1
|
@@ -5,15 +5,13 @@ interface Comment extends Document {
|
|
|
5
5
|
username: string;
|
|
6
6
|
profilePicUrl: string;
|
|
7
7
|
text: string;
|
|
8
|
-
|
|
8
|
+
likesNr?: number;
|
|
9
9
|
upVotes?: number;
|
|
10
10
|
downVotes?: number;
|
|
11
11
|
reportsNr?: number;
|
|
12
12
|
replyNr?: number;
|
|
13
|
-
createdAt: Date;
|
|
14
13
|
}
|
|
15
14
|
interface CommentModel extends mongoose.Model<Comment> {
|
|
16
|
-
build(attrs: Comment): Comment;
|
|
17
15
|
}
|
|
18
16
|
declare const Comment: CommentModel;
|
|
19
17
|
export default Comment;
|
package/build/models/Comment.js
CHANGED
|
@@ -49,13 +49,13 @@ const commentSchema = new mongoose_1.Schema({
|
|
|
49
49
|
username: { type: String, required: true },
|
|
50
50
|
profilePicUrl: { type: String, default: '' },
|
|
51
51
|
text: { type: String, required: true },
|
|
52
|
-
|
|
52
|
+
likesNr: { type: Number, required: false, default: 0 },
|
|
53
53
|
upVotes: { type: Number, required: false, default: 0 },
|
|
54
54
|
downVotes: { type: Number, required: false, default: 0 },
|
|
55
55
|
reportsNr: { type: Number, required: false, default: 0 },
|
|
56
56
|
replyNr: { type: Number, required: false, default: 0 },
|
|
57
|
-
createdAt: { type: Date, default: Date.now },
|
|
58
57
|
}, {
|
|
58
|
+
timestamps: true,
|
|
59
59
|
toJSON: {
|
|
60
60
|
transform(doc, ret) {
|
|
61
61
|
ret.id = ret._id;
|
|
@@ -65,9 +65,6 @@ const commentSchema = new mongoose_1.Schema({
|
|
|
65
65
|
},
|
|
66
66
|
},
|
|
67
67
|
});
|
|
68
|
-
commentSchema.statics.build = (attrs) => {
|
|
69
|
-
return new Comment(attrs);
|
|
70
|
-
};
|
|
71
68
|
commentSchema.index({ postId: 1 });
|
|
72
69
|
const Comment = mongoose_1.default.model('Comment', commentSchema);
|
|
73
70
|
exports.default = Comment;
|
package/build/models/Post.d.ts
CHANGED
|
@@ -11,10 +11,8 @@ interface Post extends Document {
|
|
|
11
11
|
postType: PostType;
|
|
12
12
|
reportsNr?: number;
|
|
13
13
|
contentUrl: string;
|
|
14
|
-
createdAt: Date;
|
|
15
14
|
}
|
|
16
15
|
interface PostModel extends Model<Post> {
|
|
17
|
-
build(attrs: Post): Post;
|
|
18
16
|
}
|
|
19
17
|
declare const Post: PostModel;
|
|
20
18
|
export default Post;
|
package/build/models/Post.js
CHANGED
|
@@ -50,8 +50,8 @@ const postSchema = new mongoose_1.Schema({
|
|
|
50
50
|
postType: { type: String, required: true },
|
|
51
51
|
reportsNr: { type: Number, required: false, default: 0 },
|
|
52
52
|
contentUrl: { type: String, required: true },
|
|
53
|
-
createdAt: { type: Date, default: Date.now },
|
|
54
53
|
}, {
|
|
54
|
+
timestamps: true,
|
|
55
55
|
toJSON: {
|
|
56
56
|
transform(doc, ret) {
|
|
57
57
|
ret.id = ret._id;
|
|
@@ -61,9 +61,6 @@ const postSchema = new mongoose_1.Schema({
|
|
|
61
61
|
},
|
|
62
62
|
},
|
|
63
63
|
});
|
|
64
|
-
postSchema.statics.build = (attrs) => {
|
|
65
|
-
return new Post(attrs);
|
|
66
|
-
};
|
|
67
64
|
postSchema.index({ userId: 1 });
|
|
68
65
|
const Post = mongoose_1.default.model('Post', postSchema);
|
|
69
66
|
exports.default = Post;
|
package/build/models/Reply.d.ts
CHANGED
|
@@ -5,14 +5,12 @@ interface Reply extends Document {
|
|
|
5
5
|
username: string;
|
|
6
6
|
profilePicUrl: string;
|
|
7
7
|
text: string;
|
|
8
|
-
|
|
8
|
+
likesNr?: number;
|
|
9
9
|
upVotes?: number;
|
|
10
10
|
downVotes?: number;
|
|
11
11
|
reportsNr?: number;
|
|
12
|
-
createdAt: Date;
|
|
13
12
|
}
|
|
14
13
|
interface ReplyModel extends mongoose.Model<Reply> {
|
|
15
|
-
build(attrs: Reply): Reply;
|
|
16
14
|
}
|
|
17
15
|
declare const Reply: ReplyModel;
|
|
18
16
|
export default Reply;
|
package/build/models/Reply.js
CHANGED
|
@@ -45,12 +45,12 @@ const replySchema = new mongoose_1.default.Schema({
|
|
|
45
45
|
username: { type: String, required: true },
|
|
46
46
|
profilePicUrl: { type: String, default: '' },
|
|
47
47
|
text: { type: String, required: true },
|
|
48
|
-
|
|
48
|
+
likesNr: { type: Number, required: false, default: 0 },
|
|
49
49
|
upVotes: { type: Number, required: false, default: 0 },
|
|
50
50
|
downVotes: { type: Number, required: false, default: 0 },
|
|
51
51
|
reportsNr: { type: Number, required: false, default: 0 },
|
|
52
|
-
createdAt: { type: Date, default: Date.now },
|
|
53
52
|
}, {
|
|
53
|
+
timestamps: true,
|
|
54
54
|
toJSON: {
|
|
55
55
|
transform(doc, ret) {
|
|
56
56
|
ret.id = ret._id;
|
|
@@ -60,9 +60,6 @@ const replySchema = new mongoose_1.default.Schema({
|
|
|
60
60
|
},
|
|
61
61
|
},
|
|
62
62
|
});
|
|
63
|
-
replySchema.statics.build = (attrs) => {
|
|
64
|
-
return new Reply(attrs);
|
|
65
|
-
};
|
|
66
63
|
replySchema.index({ commentId: 1 });
|
|
67
64
|
const Reply = mongoose_1.default.model('Reply', replySchema);
|
|
68
65
|
exports.default = Reply;
|
package/build/models/User.d.ts
CHANGED
package/build/models/User.js
CHANGED
|
@@ -71,8 +71,8 @@ const userSchema = new mongoose_1.Schema({
|
|
|
71
71
|
profession: { type: String, required: false, default: '' },
|
|
72
72
|
grossIncome: { type: Number, required: false, default: 0 },
|
|
73
73
|
netIncome: { type: Number, required: false, default: 0 },
|
|
74
|
-
createdAt: { type: Date, default: Date.now },
|
|
75
74
|
}, {
|
|
75
|
+
timestamps: true,
|
|
76
76
|
toJSON: {
|
|
77
77
|
transform(doc, ret) {
|
|
78
78
|
ret.id = ret._id;
|
|
@@ -88,6 +88,7 @@ const userSchema = new mongoose_1.Schema({
|
|
|
88
88
|
delete ret.grossIncome;
|
|
89
89
|
delete ret.netIncome;
|
|
90
90
|
delete ret.createdAt;
|
|
91
|
+
delete ret.updatedAt;
|
|
91
92
|
},
|
|
92
93
|
},
|
|
93
94
|
});
|
|
@@ -100,9 +101,6 @@ userSchema.pre('save', function (done) {
|
|
|
100
101
|
done();
|
|
101
102
|
});
|
|
102
103
|
});
|
|
103
|
-
userSchema.statics.build = (attrs) => {
|
|
104
|
-
return new User(attrs);
|
|
105
|
-
};
|
|
106
104
|
userSchema.index({ username: 1 }, { unique: true });
|
|
107
105
|
const User = mongoose_1.default.model('User', userSchema);
|
|
108
106
|
exports.default = User;
|