@armi-wave/common 1.23.20 → 1.23.21
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.js +11 -1
- package/build/models/PostCommentDownvote.d.ts +4 -1
- package/build/models/PostCommentDownvote.js +4 -3
- package/build/models/PostCommentLike.d.ts +4 -1
- package/build/models/PostCommentLike.js +4 -3
- package/build/models/PostCommentUpvote.d.ts +4 -1
- package/build/models/PostCommentUpvote.js +4 -3
- package/build/models/PostReplyDownvote.js +3 -3
- package/build/models/PostReplyLike.d.ts +4 -1
- package/build/models/PostReplyLike.js +4 -3
- package/build/models/PostReplyUpvote.d.ts +4 -1
- package/build/models/PostReplyUpvote.js +4 -3
- package/package.json +1 -1
package/build/index.js
CHANGED
|
@@ -17,7 +17,7 @@ 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.multerMiddleware = exports.ensureBucketExists = exports.minioClient = exports.RequestValidationError = exports.NotFoundError = exports.NotAuthorizedError = exports.CustomError = exports.DatabaseConnectionError = exports.BadRequestError = exports.Like = exports.Follow = exports.Reply = exports.Comment = exports.Post = exports.User = void 0;
|
|
20
|
+
exports.multerMiddleware = exports.ensureBucketExists = exports.minioClient = exports.RequestValidationError = exports.NotFoundError = exports.NotAuthorizedError = exports.CustomError = exports.DatabaseConnectionError = exports.BadRequestError = exports.PostReplyUpvote = exports.PostReplyLike = exports.PostCommentDownvote = exports.PostCommentUpvote = exports.PostCommentLike = exports.Like = exports.Follow = exports.Reply = exports.Comment = exports.Post = exports.User = 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"));
|
|
@@ -30,6 +30,16 @@ const Follow_1 = __importDefault(require("./models/Follow"));
|
|
|
30
30
|
exports.Follow = Follow_1.default;
|
|
31
31
|
const Like_1 = __importDefault(require("./models/Like"));
|
|
32
32
|
exports.Like = Like_1.default;
|
|
33
|
+
const PostCommentLike_1 = __importDefault(require("./models/PostCommentLike"));
|
|
34
|
+
exports.PostCommentLike = PostCommentLike_1.default;
|
|
35
|
+
const PostCommentUpvote_1 = __importDefault(require("./models/PostCommentUpvote"));
|
|
36
|
+
exports.PostCommentUpvote = PostCommentUpvote_1.default;
|
|
37
|
+
const PostCommentDownvote_1 = __importDefault(require("./models/PostCommentDownvote"));
|
|
38
|
+
exports.PostCommentDownvote = PostCommentDownvote_1.default;
|
|
39
|
+
const PostReplyLike_1 = __importDefault(require("./models/PostReplyLike"));
|
|
40
|
+
exports.PostReplyLike = PostReplyLike_1.default;
|
|
41
|
+
const PostReplyUpvote_1 = __importDefault(require("./models/PostReplyUpvote"));
|
|
42
|
+
exports.PostReplyUpvote = PostReplyUpvote_1.default;
|
|
33
43
|
const bad_request_error_1 = __importDefault(require("./errors/bad-request-error"));
|
|
34
44
|
exports.BadRequestError = bad_request_error_1.default;
|
|
35
45
|
const database_connection_error_1 = __importDefault(require("./errors/database-connection-error"));
|
|
@@ -1,7 +1,10 @@
|
|
|
1
|
-
import mongoose, { Document } from 'mongoose';
|
|
1
|
+
import mongoose, { Document, Model } from 'mongoose';
|
|
2
2
|
interface PostCommentDownvote extends Document {
|
|
3
3
|
userId: mongoose.Types.ObjectId;
|
|
4
4
|
commentId: mongoose.Types.ObjectId;
|
|
5
5
|
createdAt: Date;
|
|
6
6
|
}
|
|
7
|
+
interface PostCommentDownvoteModel extends Model<PostCommentDownvote> {
|
|
8
|
+
}
|
|
9
|
+
declare const PostCommentDownvote: PostCommentDownvoteModel;
|
|
7
10
|
export default PostCommentDownvote;
|
|
@@ -35,7 +35,7 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
35
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
36
|
const mongoose_1 = __importStar(require("mongoose"));
|
|
37
37
|
// Define the schema
|
|
38
|
-
const
|
|
38
|
+
const postCommentDownvoteSchema = new mongoose_1.Schema({
|
|
39
39
|
userId: {
|
|
40
40
|
type: mongoose_1.Schema.Types.ObjectId,
|
|
41
41
|
ref: 'User',
|
|
@@ -59,6 +59,7 @@ const likeSchema = new mongoose_1.Schema({
|
|
|
59
59
|
},
|
|
60
60
|
});
|
|
61
61
|
// Ensure a user cannot like the same person multiple times
|
|
62
|
-
|
|
62
|
+
postCommentDownvoteSchema.index({ userId: 1, commentId: 1 }, { unique: true });
|
|
63
63
|
// Create and export the model
|
|
64
|
-
const
|
|
64
|
+
const PostCommentDownvote = mongoose_1.default.model('PostCommentDownvote', postCommentDownvoteSchema);
|
|
65
|
+
exports.default = PostCommentDownvote;
|
|
@@ -1,7 +1,10 @@
|
|
|
1
|
-
import mongoose, { Document } from 'mongoose';
|
|
1
|
+
import mongoose, { Document, Model } from 'mongoose';
|
|
2
2
|
interface PostCommentLike extends Document {
|
|
3
3
|
userId: mongoose.Types.ObjectId;
|
|
4
4
|
commentId: mongoose.Types.ObjectId;
|
|
5
5
|
createdAt: Date;
|
|
6
6
|
}
|
|
7
|
+
interface PostCommentLikeModel extends Model<PostCommentLike> {
|
|
8
|
+
}
|
|
9
|
+
declare const PostCommentLike: PostCommentLikeModel;
|
|
7
10
|
export default PostCommentLike;
|
|
@@ -35,7 +35,7 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
35
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
36
|
const mongoose_1 = __importStar(require("mongoose"));
|
|
37
37
|
// Define the schema
|
|
38
|
-
const
|
|
38
|
+
const postCommentLikeSchema = new mongoose_1.Schema({
|
|
39
39
|
userId: {
|
|
40
40
|
type: mongoose_1.Schema.Types.ObjectId,
|
|
41
41
|
ref: 'User',
|
|
@@ -59,6 +59,7 @@ const likeSchema = new mongoose_1.Schema({
|
|
|
59
59
|
},
|
|
60
60
|
});
|
|
61
61
|
// Ensure a user cannot like the same person multiple times
|
|
62
|
-
|
|
62
|
+
postCommentLikeSchema.index({ userId: 1, commentId: 1 }, { unique: true });
|
|
63
63
|
// Create and export the model
|
|
64
|
-
const
|
|
64
|
+
const PostCommentLike = mongoose_1.default.model('PostCommentLike', postCommentLikeSchema);
|
|
65
|
+
exports.default = PostCommentLike;
|
|
@@ -1,7 +1,10 @@
|
|
|
1
|
-
import mongoose, { Document } from 'mongoose';
|
|
1
|
+
import mongoose, { Document, Model } from 'mongoose';
|
|
2
2
|
interface PostCommentUpvote extends Document {
|
|
3
3
|
userId: mongoose.Types.ObjectId;
|
|
4
4
|
commentId: mongoose.Types.ObjectId;
|
|
5
5
|
createdAt: Date;
|
|
6
6
|
}
|
|
7
|
+
interface PostCommentUpvoteModel extends Model<PostCommentUpvote> {
|
|
8
|
+
}
|
|
9
|
+
declare const PostCommentUpvote: PostCommentUpvoteModel;
|
|
7
10
|
export default PostCommentUpvote;
|
|
@@ -35,7 +35,7 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
35
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
36
|
const mongoose_1 = __importStar(require("mongoose"));
|
|
37
37
|
// Define the schema
|
|
38
|
-
const
|
|
38
|
+
const postCommentUpvoteSchema = new mongoose_1.Schema({
|
|
39
39
|
userId: {
|
|
40
40
|
type: mongoose_1.Schema.Types.ObjectId,
|
|
41
41
|
ref: 'User',
|
|
@@ -59,6 +59,7 @@ const likeSchema = new mongoose_1.Schema({
|
|
|
59
59
|
},
|
|
60
60
|
});
|
|
61
61
|
// Ensure a user cannot like the same person multiple times
|
|
62
|
-
|
|
62
|
+
postCommentUpvoteSchema.index({ userId: 1, commentId: 1 }, { unique: true });
|
|
63
63
|
// Create and export the model
|
|
64
|
-
const
|
|
64
|
+
const PostCommentUpvote = mongoose_1.default.model('PostCommentUpvote', postCommentUpvoteSchema);
|
|
65
|
+
exports.default = PostCommentUpvote;
|
|
@@ -35,7 +35,7 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
35
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
36
|
const mongoose_1 = __importStar(require("mongoose"));
|
|
37
37
|
// Define the schema
|
|
38
|
-
const
|
|
38
|
+
const postReplyUpvoteSchema = new mongoose_1.Schema({
|
|
39
39
|
userId: {
|
|
40
40
|
type: mongoose_1.Schema.Types.ObjectId,
|
|
41
41
|
ref: 'User',
|
|
@@ -59,6 +59,6 @@ const likeSchema = new mongoose_1.Schema({
|
|
|
59
59
|
},
|
|
60
60
|
});
|
|
61
61
|
// Ensure a user cannot like the same person multiple times
|
|
62
|
-
|
|
62
|
+
postReplyUpvoteSchema.index({ userId: 1, replyId: 1 }, { unique: true });
|
|
63
63
|
// Create and export the model
|
|
64
|
-
const
|
|
64
|
+
const PostReplyUpvote = mongoose_1.default.model('PostReplyUpvote', postReplyUpvoteSchema);
|
|
@@ -1,7 +1,10 @@
|
|
|
1
|
-
import mongoose, { Document } from 'mongoose';
|
|
1
|
+
import mongoose, { Document, Model } from 'mongoose';
|
|
2
2
|
interface PostReplyLike extends Document {
|
|
3
3
|
userId: mongoose.Types.ObjectId;
|
|
4
4
|
replyId: mongoose.Types.ObjectId;
|
|
5
5
|
createdAt: Date;
|
|
6
6
|
}
|
|
7
|
+
interface PostReplyLikeModel extends Model<PostReplyLike> {
|
|
8
|
+
}
|
|
9
|
+
declare const PostReplyLike: PostReplyLikeModel;
|
|
7
10
|
export default PostReplyLike;
|
|
@@ -35,7 +35,7 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
35
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
36
|
const mongoose_1 = __importStar(require("mongoose"));
|
|
37
37
|
// Define the schema
|
|
38
|
-
const
|
|
38
|
+
const postReplyLikeSchema = new mongoose_1.Schema({
|
|
39
39
|
userId: {
|
|
40
40
|
type: mongoose_1.Schema.Types.ObjectId,
|
|
41
41
|
ref: 'User',
|
|
@@ -59,6 +59,7 @@ const likeSchema = new mongoose_1.Schema({
|
|
|
59
59
|
},
|
|
60
60
|
});
|
|
61
61
|
// Ensure a user cannot like the same person multiple times
|
|
62
|
-
|
|
62
|
+
postReplyLikeSchema.index({ userId: 1, replyId: 1 }, { unique: true });
|
|
63
63
|
// Create and export the model
|
|
64
|
-
const
|
|
64
|
+
const PostReplyLike = mongoose_1.default.model('PostReplyLike', postReplyLikeSchema);
|
|
65
|
+
exports.default = PostReplyLike;
|
|
@@ -1,7 +1,10 @@
|
|
|
1
|
-
import mongoose, { Document } from 'mongoose';
|
|
1
|
+
import mongoose, { Document, Model } from 'mongoose';
|
|
2
2
|
interface PostReplyUpvote extends Document {
|
|
3
3
|
userId: mongoose.Types.ObjectId;
|
|
4
4
|
replyId: mongoose.Types.ObjectId;
|
|
5
5
|
createdAt: Date;
|
|
6
6
|
}
|
|
7
|
+
interface PostReplyUpvoteModel extends Model<PostReplyUpvote> {
|
|
8
|
+
}
|
|
9
|
+
declare const PostReplyUpvote: PostReplyUpvoteModel;
|
|
7
10
|
export default PostReplyUpvote;
|
|
@@ -35,7 +35,7 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
35
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
36
|
const mongoose_1 = __importStar(require("mongoose"));
|
|
37
37
|
// Define the schema
|
|
38
|
-
const
|
|
38
|
+
const postReplyUpvoteSchema = new mongoose_1.Schema({
|
|
39
39
|
userId: {
|
|
40
40
|
type: mongoose_1.Schema.Types.ObjectId,
|
|
41
41
|
ref: 'User',
|
|
@@ -59,6 +59,7 @@ const likeSchema = new mongoose_1.Schema({
|
|
|
59
59
|
},
|
|
60
60
|
});
|
|
61
61
|
// Ensure a user cannot like the same person multiple times
|
|
62
|
-
|
|
62
|
+
postReplyUpvoteSchema.index({ userId: 1, replyId: 1 }, { unique: true });
|
|
63
63
|
// Create and export the model
|
|
64
|
-
const
|
|
64
|
+
const PostReplyUpvote = mongoose_1.default.model('PostReplyUpvote', postReplyUpvoteSchema);
|
|
65
|
+
exports.default = PostReplyUpvote;
|