@common_ch/common 1.0.159 → 1.0.161
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/app/ai.js +2 -0
- package/build/models/app/blog-category.js +2 -0
- package/build/models/app/blog.js +2 -0
- package/build/models/app/discount.js +2 -0
- package/build/models/app/feedback.js +3 -0
- package/build/models/app/image.js +2 -0
- package/build/models/app/message.js +1 -0
- package/build/models/app/plan.js +1 -0
- package/build/models/app/ticket.js +1 -0
- package/build/models/app/transaction.js +2 -0
- package/build/models/app/user.js +4 -0
- package/build/models/app/voice.d.ts +2 -0
- package/build/models/app/voice.js +6 -0
- package/package.json +1 -1
package/build/models/app/ai.js
CHANGED
|
@@ -36,6 +36,8 @@ const blogCategorySchema = new mongoose_1.default.Schema({
|
|
|
36
36
|
});
|
|
37
37
|
blogCategorySchema.set('versionKey', 'version');
|
|
38
38
|
blogCategorySchema.plugin(mongoose_update_if_current_1.updateIfCurrentPlugin);
|
|
39
|
+
blogCategorySchema.index({ title: 1 });
|
|
40
|
+
blogCategorySchema.index({ status: 1 });
|
|
39
41
|
blogCategorySchema.statics.build = (attrs) => {
|
|
40
42
|
return new BlogCategory(attrs);
|
|
41
43
|
};
|
package/build/models/app/blog.js
CHANGED
|
@@ -58,6 +58,8 @@ const blogSchema = new mongoose_1.default.Schema({
|
|
|
58
58
|
});
|
|
59
59
|
blogSchema.set('versionKey', 'version');
|
|
60
60
|
blogSchema.plugin(mongoose_update_if_current_1.updateIfCurrentPlugin);
|
|
61
|
+
blogSchema.index({ 'categoryId': 1 });
|
|
62
|
+
blogSchema.index({ 'status': 1 });
|
|
61
63
|
blogSchema.statics.build = (attrs) => {
|
|
62
64
|
return new Blog(attrs);
|
|
63
65
|
};
|
|
@@ -54,6 +54,8 @@ const discountSchema = new mongoose_1.default.Schema({
|
|
|
54
54
|
discountSchema.set('versionKey', 'version');
|
|
55
55
|
discountSchema.plugin(mongoose_update_if_current_1.updateIfCurrentPlugin);
|
|
56
56
|
discountSchema.index({ code: 1 });
|
|
57
|
+
discountSchema.index({ plan: 1 });
|
|
58
|
+
discountSchema.index({ status: 1 });
|
|
57
59
|
discountSchema.statics.build = (attrs) => {
|
|
58
60
|
return new Discount(attrs);
|
|
59
61
|
};
|
|
@@ -45,6 +45,9 @@ const feedbackSchema = new mongoose_1.default.Schema({
|
|
|
45
45
|
});
|
|
46
46
|
feedbackSchema.set('versionKey', 'version');
|
|
47
47
|
feedbackSchema.plugin(mongoose_update_if_current_1.updateIfCurrentPlugin);
|
|
48
|
+
feedbackSchema.index({ userId: 1 });
|
|
49
|
+
feedbackSchema.index({ aiId: 1 });
|
|
50
|
+
feedbackSchema.index({ type: 1 });
|
|
48
51
|
feedbackSchema.statics.build = (attrs) => {
|
|
49
52
|
return new Feedback(attrs);
|
|
50
53
|
};
|
|
@@ -58,6 +58,8 @@ const ImageSchema = new mongoose_1.default.Schema({
|
|
|
58
58
|
});
|
|
59
59
|
ImageSchema.set('versionKey', 'version');
|
|
60
60
|
ImageSchema.plugin(mongoose_update_if_current_1.updateIfCurrentPlugin);
|
|
61
|
+
ImageSchema.index({ 'userId': 1 });
|
|
62
|
+
ImageSchema.index({ 'planId': 1 });
|
|
61
63
|
ImageSchema.statics.build = (attrs) => {
|
|
62
64
|
return new ImageModel(attrs);
|
|
63
65
|
};
|
|
@@ -80,6 +80,7 @@ const messageSchema = new mongoose_1.default.Schema({
|
|
|
80
80
|
// messageSchema.plugin(updateIfCurrentPlugin);
|
|
81
81
|
messageSchema.index({ 'updatedAt': 1 });
|
|
82
82
|
messageSchema.index({ 'threadChatgptId': 1 });
|
|
83
|
+
messageSchema.index({ 'userId': 1 });
|
|
83
84
|
messageSchema.index({ 'threadChatgptId': 1, 'userId': 1 });
|
|
84
85
|
messageSchema.statics.build = (attrs) => {
|
|
85
86
|
return new Message(attrs);
|
package/build/models/app/plan.js
CHANGED
|
@@ -71,6 +71,7 @@ const planSchema = new mongoose_1.default.Schema({
|
|
|
71
71
|
});
|
|
72
72
|
planSchema.set('versionKey', 'version');
|
|
73
73
|
planSchema.plugin(mongoose_update_if_current_1.updateIfCurrentPlugin);
|
|
74
|
+
planSchema.index({ 'status': 1 });
|
|
74
75
|
planSchema.statics.build = (attrs) => {
|
|
75
76
|
return new Plan(attrs);
|
|
76
77
|
};
|
|
@@ -70,6 +70,7 @@ const ticketSchema = new mongoose_1.default.Schema({
|
|
|
70
70
|
});
|
|
71
71
|
ticketSchema.set('versionKey', 'version');
|
|
72
72
|
ticketSchema.plugin(mongoose_update_if_current_1.updateIfCurrentPlugin);
|
|
73
|
+
ticketSchema.index({ 'userId': 1 });
|
|
73
74
|
ticketSchema.statics.build = (attrs) => {
|
|
74
75
|
return new Ticket(attrs);
|
|
75
76
|
};
|
|
@@ -64,6 +64,8 @@ const transactionSchema = new mongoose_1.default.Schema({
|
|
|
64
64
|
});
|
|
65
65
|
transactionSchema.set('versionKey', 'version');
|
|
66
66
|
transactionSchema.plugin(mongoose_update_if_current_1.updateIfCurrentPlugin);
|
|
67
|
+
transactionSchema.index({ 'userId': 1 });
|
|
68
|
+
transactionSchema.index({ 'status': 1 });
|
|
67
69
|
transactionSchema.statics.build = (attrs) => {
|
|
68
70
|
return new Transaction(attrs);
|
|
69
71
|
};
|
package/build/models/app/user.js
CHANGED
|
@@ -130,6 +130,10 @@ const userSchema = new mongoose_1.default.Schema({
|
|
|
130
130
|
});
|
|
131
131
|
userSchema.set('versionKey', 'version');
|
|
132
132
|
// userSchema.plugin(updateIfCurrentPlugin);
|
|
133
|
+
userSchema.index({ 'status': 1 });
|
|
134
|
+
userSchema.index({ 'mobile': 1 });
|
|
135
|
+
userSchema.index({ 'username': 1 });
|
|
136
|
+
userSchema.index({ 'email': 1 });
|
|
133
137
|
userSchema.statics.build = (attrs) => {
|
|
134
138
|
return new User(attrs);
|
|
135
139
|
};
|
|
@@ -15,6 +15,7 @@ export interface SpeechAttrs {
|
|
|
15
15
|
content: string;
|
|
16
16
|
createdAt: string;
|
|
17
17
|
};
|
|
18
|
+
chatGptTokenNumber?: number;
|
|
18
19
|
createdAt?: string;
|
|
19
20
|
updatedAt?: string;
|
|
20
21
|
}
|
|
@@ -33,6 +34,7 @@ interface SpeechDoc extends mongoose.Document {
|
|
|
33
34
|
content: string;
|
|
34
35
|
createdAt: string;
|
|
35
36
|
}[];
|
|
37
|
+
chatGptTokenNumber?: number;
|
|
36
38
|
createdAt?: number;
|
|
37
39
|
updatedAt?: number;
|
|
38
40
|
}
|
|
@@ -20,6 +20,10 @@ const SpeechSchema = new mongoose_1.default.Schema({
|
|
|
20
20
|
type: String,
|
|
21
21
|
required: true,
|
|
22
22
|
},
|
|
23
|
+
chatGptTokenNumber: {
|
|
24
|
+
type: Number,
|
|
25
|
+
required: false,
|
|
26
|
+
},
|
|
23
27
|
planId: {
|
|
24
28
|
type: mongoose_1.default.Schema.Types.ObjectId,
|
|
25
29
|
ref: 'Plan',
|
|
@@ -55,6 +59,8 @@ const SpeechSchema = new mongoose_1.default.Schema({
|
|
|
55
59
|
});
|
|
56
60
|
SpeechSchema.set('versionKey', 'version');
|
|
57
61
|
SpeechSchema.plugin(mongoose_update_if_current_1.updateIfCurrentPlugin);
|
|
62
|
+
SpeechSchema.index({ 'userId': 1 });
|
|
63
|
+
SpeechSchema.index({ 'planId': 1 });
|
|
58
64
|
SpeechSchema.statics.build = (attrs) => {
|
|
59
65
|
return new SpeechModel(attrs);
|
|
60
66
|
};
|