joye-backend-utility 2.0.4 → 2.0.7
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/dist/database.js +1 -0
- package/dist/models/brew.model.js +9 -1
- package/dist/models/counterSchema.model.d.ts +2 -0
- package/dist/models/counterSchema.model.js +19 -0
- package/dist/models/masterAppSetting.model.js +1 -0
- package/dist/models/masterData.model.js +1 -0
- package/dist/models/masterEmotion.model.js +1 -0
- package/dist/models/masterPodcast.model.js +1 -0
- package/dist/models/masterPredictionEmotionMessage.model.js +1 -0
- package/dist/models/masterThemeData.model.js +1 -0
- package/dist/models/organization.model.js +4 -1
- package/dist/models/user.model.js +9 -1
- package/dist/models/userMessagesLog.model.js +4 -1
- package/package.json +2 -3
package/dist/database.js
CHANGED
|
@@ -102,4 +102,12 @@ const BrewSchema = new mongoose_1.Schema({
|
|
|
102
102
|
required: true,
|
|
103
103
|
},
|
|
104
104
|
});
|
|
105
|
-
|
|
105
|
+
/* BrewSchema.index(
|
|
106
|
+
{ userId: 1, date: -1 },
|
|
107
|
+
{
|
|
108
|
+
unique: true,
|
|
109
|
+
},
|
|
110
|
+
); */
|
|
111
|
+
const brewModel = (0, mongoose_1.model)('Brew', BrewSchema);
|
|
112
|
+
brewModel.syncIndexes();
|
|
113
|
+
exports.BrewModel = brewModel;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CounterModel = void 0;
|
|
4
|
+
const mongoose_1 = require("mongoose");
|
|
5
|
+
const CounterSchema = new mongoose_1.Schema({
|
|
6
|
+
counterId: {
|
|
7
|
+
type: mongoose_1.Types.ObjectId,
|
|
8
|
+
required: true,
|
|
9
|
+
},
|
|
10
|
+
counterKey: {
|
|
11
|
+
type: String,
|
|
12
|
+
required: true,
|
|
13
|
+
},
|
|
14
|
+
counterValue: {
|
|
15
|
+
type: Number,
|
|
16
|
+
required: true,
|
|
17
|
+
},
|
|
18
|
+
});
|
|
19
|
+
exports.CounterModel = (0, mongoose_1.model)('Counter', CounterSchema);
|
|
@@ -18,6 +18,7 @@ const OrganizationSchema = new mongoose_1.Schema({
|
|
|
18
18
|
tId: {
|
|
19
19
|
type: String,
|
|
20
20
|
required: true,
|
|
21
|
+
// index: true,
|
|
21
22
|
},
|
|
22
23
|
emergency: {
|
|
23
24
|
type: Object,
|
|
@@ -40,4 +41,6 @@ const OrganizationSchema = new mongoose_1.Schema({
|
|
|
40
41
|
required: false,
|
|
41
42
|
},
|
|
42
43
|
});
|
|
43
|
-
|
|
44
|
+
const organizationModel = (0, mongoose_1.model)('Organization', OrganizationSchema);
|
|
45
|
+
// organizationModel.syncIndexes();
|
|
46
|
+
exports.OrganizationModel = organizationModel;
|
|
@@ -10,6 +10,7 @@ const UserSchema = new mongoose_1.Schema({
|
|
|
10
10
|
employeeId: {
|
|
11
11
|
type: String,
|
|
12
12
|
required: true,
|
|
13
|
+
// index: true,
|
|
13
14
|
},
|
|
14
15
|
happinessCounterLifetime: {
|
|
15
16
|
type: Object,
|
|
@@ -103,6 +104,13 @@ const UserSchema = new mongoose_1.Schema({
|
|
|
103
104
|
},
|
|
104
105
|
botDetails: {
|
|
105
106
|
type: Object,
|
|
107
|
+
// index: true,
|
|
108
|
+
},
|
|
109
|
+
uniqueCode: {
|
|
110
|
+
type: String,
|
|
111
|
+
required: false,
|
|
106
112
|
},
|
|
107
113
|
});
|
|
108
|
-
|
|
114
|
+
const userModel = (0, mongoose_1.model)('User', UserSchema);
|
|
115
|
+
// userModel.syncIndexes();
|
|
116
|
+
exports.UserModel = userModel;
|
|
@@ -37,4 +37,7 @@ const UserMessageLogSchema = new mongoose_1.Schema({
|
|
|
37
37
|
required: false,
|
|
38
38
|
},
|
|
39
39
|
});
|
|
40
|
-
|
|
40
|
+
// UserMessageLogSchema.index({ employeeId: 1, activityId: -1 });
|
|
41
|
+
const userMessageLogModel = (0, mongoose_1.model)('User_Message_Log', UserMessageLogSchema);
|
|
42
|
+
// userMessageLogModel.syncIndexes();
|
|
43
|
+
exports.UserMessageLogModel = userMessageLogModel;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "joye-backend-utility",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.7",
|
|
4
4
|
"description": "Joye backend utility for db functions and common functions",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -16,8 +16,7 @@
|
|
|
16
16
|
"postinstall": "npm run build",
|
|
17
17
|
"lint": "eslint --ignore-path .gitignore --ext .ts .",
|
|
18
18
|
"lint:fix": "npm run lint -- --fix",
|
|
19
|
-
"prepare": "husky install && yarn build"
|
|
20
|
-
"publish": "npm publish"
|
|
19
|
+
"prepare": "husky install && yarn build"
|
|
21
20
|
},
|
|
22
21
|
"repository": {
|
|
23
22
|
"type": "git",
|