joye-backend-utility 4.1.22-test17 → 4.1.22-test2
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/jwt.js +4 -8
- package/dist/models/brew.model.d.ts +2 -0
- package/dist/models/brew.model.js +122 -0
- package/dist/models/counterSchema.model.d.ts +2 -0
- package/dist/models/counterSchema.model.js +19 -0
- package/dist/models/databaseInfo.model.d.ts +2 -0
- package/dist/models/databaseInfo.model.js +37 -0
- package/dist/models/index.d.ts +20 -0
- package/dist/models/index.js +43 -0
- package/dist/models/masterAppSetting.model.d.ts +2 -0
- package/dist/models/masterAppSetting.model.js +24 -0
- package/dist/models/masterData.model.d.ts +2 -0
- package/dist/models/masterData.model.js +28 -0
- package/dist/models/masterEmotion.model.d.ts +2 -0
- package/dist/models/masterEmotion.model.js +114 -0
- package/dist/models/masterEmotionMessage.model.d.ts +2 -0
- package/dist/models/masterEmotionMessage.model.js +34 -0
- package/dist/models/masterEmotionMessageMapping.model.d.ts +2 -0
- package/dist/models/masterEmotionMessageMapping.model.js +16 -0
- package/dist/models/masterEmotionMessageTypeThemeMapping.model.d.ts +2 -0
- package/dist/models/masterEmotionMessageTypeThemeMapping.model.js +23 -0
- package/dist/models/masterPodcast.model.d.ts +2 -0
- package/dist/models/masterPodcast.model.js +33 -0
- package/dist/models/masterPredictionEmotion .model.d.ts +2 -0
- package/dist/models/masterPredictionEmotion .model.js +27 -0
- package/dist/models/masterPredictionEmotionMessage.model.d.ts +2 -0
- package/dist/models/masterPredictionEmotionMessage.model.js +26 -0
- package/dist/models/masterPredictionEmotionMessageMapping.model.d.ts +2 -0
- package/dist/models/masterPredictionEmotionMessageMapping.model.js +16 -0
- package/dist/models/masterThemeData.model.d.ts +2 -0
- package/dist/models/masterThemeData.model.js +36 -0
- package/dist/models/masterThemeMessage.model.d.ts +2 -0
- package/dist/models/masterThemeMessage.model.js +13 -0
- package/dist/models/organization.model.d.ts +2 -0
- package/dist/models/organization.model.js +50 -0
- package/dist/models/platform.model.d.ts +2 -0
- package/dist/models/platform.model.js +28 -0
- package/dist/models/user.model.d.ts +2 -0
- package/dist/models/user.model.js +136 -0
- package/dist/models/userLog.model.d.ts +2 -0
- package/dist/models/userLog.model.js +24 -0
- package/dist/models/userMeeting.model.d.ts +2 -0
- package/dist/models/userMeeting.model.js +24 -0
- package/dist/models/userMessages.model.d.ts +2 -0
- package/dist/models/userMessages.model.js +24 -0
- package/dist/models/userMessagesLog.model.d.ts +2 -0
- package/dist/models/userMessagesLog.model.js +52 -0
- package/dist/models/userTest.model.d.ts +2 -0
- package/dist/models/userTest.model.js +16 -0
- package/package.json +3 -8
- package/dist/jwtKeys/jwtRS256.key +0 -54
- package/dist/jwtKeys/jwtRS256.key.pub +0 -14
package/dist/jwt.js
CHANGED
|
@@ -2,21 +2,17 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.jwtVerify = exports.createToken = void 0;
|
|
4
4
|
const jwt = require('jsonwebtoken');
|
|
5
|
-
const
|
|
6
|
-
const path = require('path');
|
|
7
|
-
const folderPath = path.resolve(`${__dirname}`);
|
|
8
|
-
const JWT_PRIVATE_KEY = fs.readFileSync(`${folderPath}/jwtKeys/jwtRS256.key`, 'utf8');
|
|
9
|
-
const JWT_PUBLIC_KEY = fs.readFileSync(`${folderPath}/jwtKeys/jwtRS256.key.pub`, 'utf8');
|
|
5
|
+
const JWT_SECRET = '3s6v9y$B&E)H+MbQeThWmZq4t7w!z%C*F-JaNcRfUjXn2r5u8x/A?D(G+KbPeSgV';
|
|
10
6
|
const createToken = async (payload, expiresIn) => {
|
|
11
|
-
const token = jwt.sign(payload,
|
|
7
|
+
const token = jwt.sign(payload, process.env.JWT_SECRET || JWT_SECRET, {
|
|
12
8
|
expiresIn,
|
|
13
|
-
algorithm: '
|
|
9
|
+
algorithm: 'HS256',
|
|
14
10
|
});
|
|
15
11
|
return token;
|
|
16
12
|
};
|
|
17
13
|
exports.createToken = createToken;
|
|
18
14
|
const jwtVerify = async (token) => new Promise(resolve => {
|
|
19
|
-
jwt.verify(token,
|
|
15
|
+
jwt.verify(token, process.env.JWT_SECRET || JWT_SECRET, async (err, decoded) => {
|
|
20
16
|
if (err) {
|
|
21
17
|
return resolve(err);
|
|
22
18
|
}
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.BrewModel = void 0;
|
|
4
|
+
const mongoose_1 = require("mongoose");
|
|
5
|
+
const BrewSchema = new mongoose_1.Schema({
|
|
6
|
+
userId: {
|
|
7
|
+
type: mongoose_1.Types.ObjectId,
|
|
8
|
+
required: true,
|
|
9
|
+
},
|
|
10
|
+
date: {
|
|
11
|
+
type: String,
|
|
12
|
+
required: true,
|
|
13
|
+
},
|
|
14
|
+
emotionData: {
|
|
15
|
+
type: Object,
|
|
16
|
+
required: false,
|
|
17
|
+
},
|
|
18
|
+
pieData: {
|
|
19
|
+
type: Object,
|
|
20
|
+
required: false,
|
|
21
|
+
},
|
|
22
|
+
total: {
|
|
23
|
+
type: Number,
|
|
24
|
+
required: false,
|
|
25
|
+
},
|
|
26
|
+
dayTotal: {
|
|
27
|
+
type: Number,
|
|
28
|
+
required: false,
|
|
29
|
+
},
|
|
30
|
+
average: {
|
|
31
|
+
type: Number,
|
|
32
|
+
required: false,
|
|
33
|
+
},
|
|
34
|
+
dominanteMotion: {
|
|
35
|
+
type: String,
|
|
36
|
+
required: false,
|
|
37
|
+
},
|
|
38
|
+
type: {
|
|
39
|
+
type: String,
|
|
40
|
+
required: false,
|
|
41
|
+
},
|
|
42
|
+
theme: {
|
|
43
|
+
type: Number,
|
|
44
|
+
required: false,
|
|
45
|
+
},
|
|
46
|
+
isSkip: {
|
|
47
|
+
type: Boolean,
|
|
48
|
+
required: false,
|
|
49
|
+
},
|
|
50
|
+
journalText: {
|
|
51
|
+
type: String,
|
|
52
|
+
required: false,
|
|
53
|
+
},
|
|
54
|
+
fellingBetter: {
|
|
55
|
+
type: Boolean,
|
|
56
|
+
required: false,
|
|
57
|
+
},
|
|
58
|
+
todaysFeeling: {
|
|
59
|
+
type: String,
|
|
60
|
+
required: false,
|
|
61
|
+
},
|
|
62
|
+
journalCheck: {
|
|
63
|
+
type: String,
|
|
64
|
+
required: false,
|
|
65
|
+
},
|
|
66
|
+
count: {
|
|
67
|
+
type: Number,
|
|
68
|
+
required: false,
|
|
69
|
+
},
|
|
70
|
+
currentAverage: {
|
|
71
|
+
type: Number,
|
|
72
|
+
required: false,
|
|
73
|
+
},
|
|
74
|
+
congratulationQuestion: {
|
|
75
|
+
type: String,
|
|
76
|
+
required: false,
|
|
77
|
+
},
|
|
78
|
+
journalQuestion: {
|
|
79
|
+
type: String,
|
|
80
|
+
required: false,
|
|
81
|
+
},
|
|
82
|
+
visualJournalQuestion: {
|
|
83
|
+
type: String,
|
|
84
|
+
required: false,
|
|
85
|
+
},
|
|
86
|
+
podcastKey: {
|
|
87
|
+
type: String,
|
|
88
|
+
required: false,
|
|
89
|
+
},
|
|
90
|
+
journalCount: {
|
|
91
|
+
type: Number,
|
|
92
|
+
required: false,
|
|
93
|
+
},
|
|
94
|
+
happinessCounter: {
|
|
95
|
+
type: Object,
|
|
96
|
+
yesCount: {
|
|
97
|
+
type: Number,
|
|
98
|
+
},
|
|
99
|
+
noCount: {
|
|
100
|
+
type: Number,
|
|
101
|
+
},
|
|
102
|
+
required: false,
|
|
103
|
+
},
|
|
104
|
+
stressBustersStartCount: {
|
|
105
|
+
type: Number,
|
|
106
|
+
required: false,
|
|
107
|
+
},
|
|
108
|
+
stressBustersEndCount: {
|
|
109
|
+
type: Number,
|
|
110
|
+
required: false,
|
|
111
|
+
},
|
|
112
|
+
creationDate: {
|
|
113
|
+
type: String,
|
|
114
|
+
required: true,
|
|
115
|
+
},
|
|
116
|
+
});
|
|
117
|
+
BrewSchema.index({ userId: 1, date: -1 }, {
|
|
118
|
+
unique: false,
|
|
119
|
+
});
|
|
120
|
+
const brewModel = (0, mongoose_1.model)('Brew', BrewSchema);
|
|
121
|
+
brewModel.syncIndexes();
|
|
122
|
+
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);
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DatabaseInfoModel = void 0;
|
|
4
|
+
const mongoose_1 = require("mongoose");
|
|
5
|
+
const DatabaseInfo = new mongoose_1.Schema({
|
|
6
|
+
key: {
|
|
7
|
+
type: String,
|
|
8
|
+
required: true,
|
|
9
|
+
index: true,
|
|
10
|
+
},
|
|
11
|
+
platformKey: {
|
|
12
|
+
type: String,
|
|
13
|
+
required: true,
|
|
14
|
+
},
|
|
15
|
+
tId: {
|
|
16
|
+
type: String,
|
|
17
|
+
required: false,
|
|
18
|
+
},
|
|
19
|
+
uri: {
|
|
20
|
+
type: String,
|
|
21
|
+
required: true,
|
|
22
|
+
},
|
|
23
|
+
baseUrl: {
|
|
24
|
+
type: String,
|
|
25
|
+
required: true,
|
|
26
|
+
},
|
|
27
|
+
subscriptionKey: {
|
|
28
|
+
type: String,
|
|
29
|
+
required: true,
|
|
30
|
+
},
|
|
31
|
+
});
|
|
32
|
+
DatabaseInfo.index({ platformKey: 1, tId: -1 }, {
|
|
33
|
+
unique: false,
|
|
34
|
+
});
|
|
35
|
+
const databaseInfoModel = (0, mongoose_1.model)('Database_Info', DatabaseInfo);
|
|
36
|
+
databaseInfoModel.syncIndexes();
|
|
37
|
+
exports.DatabaseInfoModel = databaseInfoModel;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export { MasterAppSettingModel } from './masterAppSetting.model';
|
|
2
|
+
export { MasterDataModel } from './masterData.model';
|
|
3
|
+
export { UserModel } from './user.model';
|
|
4
|
+
export { MasterPredictionEmotionMessageModel } from './masterPredictionEmotionMessage.model';
|
|
5
|
+
export { MasterPredictionEmotionModel } from './masterPredictionEmotion .model';
|
|
6
|
+
export { OrganizationModel } from './organization.model';
|
|
7
|
+
export { PlatformModel } from './platform.model';
|
|
8
|
+
export { MasterEmotionsModel } from './masterEmotion.model';
|
|
9
|
+
export { MasterThemeMessageModel } from './masterThemeMessage.model';
|
|
10
|
+
export { MasterEmotionsMessageMappingModel } from './masterEmotionMessageMapping.model';
|
|
11
|
+
export { MasterThemeDataModel } from './masterThemeData.model';
|
|
12
|
+
export { MasterEmotionMessageTypeThemeMappingModel } from './masterEmotionMessageTypeThemeMapping.model';
|
|
13
|
+
export { MasterPodcastModel } from './masterPodcast.model';
|
|
14
|
+
export { BrewModel } from './brew.model';
|
|
15
|
+
export { MasterPredictionEmotionsMessageMappingModel } from './masterPredictionEmotionMessageMapping.model';
|
|
16
|
+
export { UserMessageModel } from './userMessages.model';
|
|
17
|
+
export { UserMessageLogModel } from './userMessagesLog.model';
|
|
18
|
+
export { UserLogModel } from './userLog.model';
|
|
19
|
+
export { UserMeetingModel } from './userMeeting.model';
|
|
20
|
+
export { DatabaseInfoModel } from './databaseInfo.model';
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DatabaseInfoModel = exports.UserMeetingModel = exports.UserLogModel = exports.UserMessageLogModel = exports.UserMessageModel = exports.MasterPredictionEmotionsMessageMappingModel = exports.BrewModel = exports.MasterPodcastModel = exports.MasterEmotionMessageTypeThemeMappingModel = exports.MasterThemeDataModel = exports.MasterEmotionsMessageMappingModel = exports.MasterThemeMessageModel = exports.MasterEmotionsModel = exports.PlatformModel = exports.OrganizationModel = exports.MasterPredictionEmotionModel = exports.MasterPredictionEmotionMessageModel = exports.UserModel = exports.MasterDataModel = exports.MasterAppSettingModel = void 0;
|
|
4
|
+
var masterAppSetting_model_1 = require("./masterAppSetting.model");
|
|
5
|
+
Object.defineProperty(exports, "MasterAppSettingModel", { enumerable: true, get: function () { return masterAppSetting_model_1.MasterAppSettingModel; } });
|
|
6
|
+
var masterData_model_1 = require("./masterData.model");
|
|
7
|
+
Object.defineProperty(exports, "MasterDataModel", { enumerable: true, get: function () { return masterData_model_1.MasterDataModel; } });
|
|
8
|
+
var user_model_1 = require("./user.model");
|
|
9
|
+
Object.defineProperty(exports, "UserModel", { enumerable: true, get: function () { return user_model_1.UserModel; } });
|
|
10
|
+
var masterPredictionEmotionMessage_model_1 = require("./masterPredictionEmotionMessage.model");
|
|
11
|
+
Object.defineProperty(exports, "MasterPredictionEmotionMessageModel", { enumerable: true, get: function () { return masterPredictionEmotionMessage_model_1.MasterPredictionEmotionMessageModel; } });
|
|
12
|
+
var masterPredictionEmotion__model_1 = require("./masterPredictionEmotion .model");
|
|
13
|
+
Object.defineProperty(exports, "MasterPredictionEmotionModel", { enumerable: true, get: function () { return masterPredictionEmotion__model_1.MasterPredictionEmotionModel; } });
|
|
14
|
+
var organization_model_1 = require("./organization.model");
|
|
15
|
+
Object.defineProperty(exports, "OrganizationModel", { enumerable: true, get: function () { return organization_model_1.OrganizationModel; } });
|
|
16
|
+
var platform_model_1 = require("./platform.model");
|
|
17
|
+
Object.defineProperty(exports, "PlatformModel", { enumerable: true, get: function () { return platform_model_1.PlatformModel; } });
|
|
18
|
+
var masterEmotion_model_1 = require("./masterEmotion.model");
|
|
19
|
+
Object.defineProperty(exports, "MasterEmotionsModel", { enumerable: true, get: function () { return masterEmotion_model_1.MasterEmotionsModel; } });
|
|
20
|
+
var masterThemeMessage_model_1 = require("./masterThemeMessage.model");
|
|
21
|
+
Object.defineProperty(exports, "MasterThemeMessageModel", { enumerable: true, get: function () { return masterThemeMessage_model_1.MasterThemeMessageModel; } });
|
|
22
|
+
var masterEmotionMessageMapping_model_1 = require("./masterEmotionMessageMapping.model");
|
|
23
|
+
Object.defineProperty(exports, "MasterEmotionsMessageMappingModel", { enumerable: true, get: function () { return masterEmotionMessageMapping_model_1.MasterEmotionsMessageMappingModel; } });
|
|
24
|
+
var masterThemeData_model_1 = require("./masterThemeData.model");
|
|
25
|
+
Object.defineProperty(exports, "MasterThemeDataModel", { enumerable: true, get: function () { return masterThemeData_model_1.MasterThemeDataModel; } });
|
|
26
|
+
var masterEmotionMessageTypeThemeMapping_model_1 = require("./masterEmotionMessageTypeThemeMapping.model");
|
|
27
|
+
Object.defineProperty(exports, "MasterEmotionMessageTypeThemeMappingModel", { enumerable: true, get: function () { return masterEmotionMessageTypeThemeMapping_model_1.MasterEmotionMessageTypeThemeMappingModel; } });
|
|
28
|
+
var masterPodcast_model_1 = require("./masterPodcast.model");
|
|
29
|
+
Object.defineProperty(exports, "MasterPodcastModel", { enumerable: true, get: function () { return masterPodcast_model_1.MasterPodcastModel; } });
|
|
30
|
+
var brew_model_1 = require("./brew.model");
|
|
31
|
+
Object.defineProperty(exports, "BrewModel", { enumerable: true, get: function () { return brew_model_1.BrewModel; } });
|
|
32
|
+
var masterPredictionEmotionMessageMapping_model_1 = require("./masterPredictionEmotionMessageMapping.model");
|
|
33
|
+
Object.defineProperty(exports, "MasterPredictionEmotionsMessageMappingModel", { enumerable: true, get: function () { return masterPredictionEmotionMessageMapping_model_1.MasterPredictionEmotionsMessageMappingModel; } });
|
|
34
|
+
var userMessages_model_1 = require("./userMessages.model");
|
|
35
|
+
Object.defineProperty(exports, "UserMessageModel", { enumerable: true, get: function () { return userMessages_model_1.UserMessageModel; } });
|
|
36
|
+
var userMessagesLog_model_1 = require("./userMessagesLog.model");
|
|
37
|
+
Object.defineProperty(exports, "UserMessageLogModel", { enumerable: true, get: function () { return userMessagesLog_model_1.UserMessageLogModel; } });
|
|
38
|
+
var userLog_model_1 = require("./userLog.model");
|
|
39
|
+
Object.defineProperty(exports, "UserLogModel", { enumerable: true, get: function () { return userLog_model_1.UserLogModel; } });
|
|
40
|
+
var userMeeting_model_1 = require("./userMeeting.model");
|
|
41
|
+
Object.defineProperty(exports, "UserMeetingModel", { enumerable: true, get: function () { return userMeeting_model_1.UserMeetingModel; } });
|
|
42
|
+
var databaseInfo_model_1 = require("./databaseInfo.model");
|
|
43
|
+
Object.defineProperty(exports, "DatabaseInfoModel", { enumerable: true, get: function () { return databaseInfo_model_1.DatabaseInfoModel; } });
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.MasterAppSettingModel = void 0;
|
|
4
|
+
const mongoose_1 = require("mongoose");
|
|
5
|
+
const MasterAppSettingSchema = new mongoose_1.Schema({
|
|
6
|
+
key: {
|
|
7
|
+
type: String,
|
|
8
|
+
required: true,
|
|
9
|
+
index: true,
|
|
10
|
+
},
|
|
11
|
+
name: {
|
|
12
|
+
type: String,
|
|
13
|
+
required: true,
|
|
14
|
+
},
|
|
15
|
+
description: {
|
|
16
|
+
type: String,
|
|
17
|
+
required: false,
|
|
18
|
+
},
|
|
19
|
+
value: {
|
|
20
|
+
type: String,
|
|
21
|
+
required: false,
|
|
22
|
+
},
|
|
23
|
+
});
|
|
24
|
+
exports.MasterAppSettingModel = (0, mongoose_1.model)('Master_App_Setting', MasterAppSettingSchema);
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.MasterDataModel = void 0;
|
|
4
|
+
const mongoose_1 = require("mongoose");
|
|
5
|
+
const MasterDataSchema = new mongoose_1.Schema({
|
|
6
|
+
key: {
|
|
7
|
+
type: String,
|
|
8
|
+
required: true,
|
|
9
|
+
index: true,
|
|
10
|
+
},
|
|
11
|
+
dataType: {
|
|
12
|
+
type: String,
|
|
13
|
+
required: false,
|
|
14
|
+
},
|
|
15
|
+
valueArray: {
|
|
16
|
+
type: Array,
|
|
17
|
+
required: false,
|
|
18
|
+
},
|
|
19
|
+
valueJson: {
|
|
20
|
+
type: 'object',
|
|
21
|
+
required: false,
|
|
22
|
+
},
|
|
23
|
+
valueJsonArray: {
|
|
24
|
+
type: Array,
|
|
25
|
+
required: false,
|
|
26
|
+
},
|
|
27
|
+
});
|
|
28
|
+
exports.MasterDataModel = (0, mongoose_1.model)('Master_Data', MasterDataSchema);
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.MasterEmotionsModel = void 0;
|
|
4
|
+
const mongoose_1 = require("mongoose");
|
|
5
|
+
const MasterEmotionsSchema = new mongoose_1.Schema({
|
|
6
|
+
key: {
|
|
7
|
+
type: String,
|
|
8
|
+
required: true,
|
|
9
|
+
index: true,
|
|
10
|
+
},
|
|
11
|
+
name: {
|
|
12
|
+
type: String,
|
|
13
|
+
required: true,
|
|
14
|
+
},
|
|
15
|
+
emotionCategory: {
|
|
16
|
+
type: String,
|
|
17
|
+
required: true,
|
|
18
|
+
},
|
|
19
|
+
type: {
|
|
20
|
+
type: String,
|
|
21
|
+
required: true,
|
|
22
|
+
},
|
|
23
|
+
weight: {
|
|
24
|
+
type: String,
|
|
25
|
+
required: true,
|
|
26
|
+
},
|
|
27
|
+
color: {
|
|
28
|
+
type: String,
|
|
29
|
+
required: false,
|
|
30
|
+
},
|
|
31
|
+
sColor: {
|
|
32
|
+
type: String,
|
|
33
|
+
required: false,
|
|
34
|
+
},
|
|
35
|
+
cColor: {
|
|
36
|
+
type: String,
|
|
37
|
+
required: false,
|
|
38
|
+
},
|
|
39
|
+
startColor: {
|
|
40
|
+
type: String,
|
|
41
|
+
required: false,
|
|
42
|
+
},
|
|
43
|
+
stopColor: {
|
|
44
|
+
type: String,
|
|
45
|
+
required: false,
|
|
46
|
+
},
|
|
47
|
+
active: {
|
|
48
|
+
type: Boolean,
|
|
49
|
+
required: false,
|
|
50
|
+
},
|
|
51
|
+
value: {
|
|
52
|
+
type: Number,
|
|
53
|
+
required: false,
|
|
54
|
+
},
|
|
55
|
+
pieValue: {
|
|
56
|
+
type: Number,
|
|
57
|
+
required: false,
|
|
58
|
+
},
|
|
59
|
+
questions: { type: Array, required: false },
|
|
60
|
+
suggestionData: {
|
|
61
|
+
type: Object,
|
|
62
|
+
pie: {
|
|
63
|
+
type: Array,
|
|
64
|
+
},
|
|
65
|
+
prePieMessage: {
|
|
66
|
+
type: Array,
|
|
67
|
+
},
|
|
68
|
+
required: false,
|
|
69
|
+
},
|
|
70
|
+
appreciationData: {
|
|
71
|
+
type: Object,
|
|
72
|
+
pie: {
|
|
73
|
+
type: Array,
|
|
74
|
+
},
|
|
75
|
+
prePieMessage: {
|
|
76
|
+
type: Array,
|
|
77
|
+
},
|
|
78
|
+
required: false,
|
|
79
|
+
},
|
|
80
|
+
voice: {
|
|
81
|
+
type: Object,
|
|
82
|
+
suggestionData: {
|
|
83
|
+
type: Object,
|
|
84
|
+
pie: {
|
|
85
|
+
type: Array,
|
|
86
|
+
},
|
|
87
|
+
prePieMessage: {
|
|
88
|
+
type: Array,
|
|
89
|
+
},
|
|
90
|
+
},
|
|
91
|
+
appreciationData: {
|
|
92
|
+
type: Object,
|
|
93
|
+
pie: {
|
|
94
|
+
type: Array,
|
|
95
|
+
},
|
|
96
|
+
prePieMessage: {
|
|
97
|
+
type: Array,
|
|
98
|
+
},
|
|
99
|
+
required: false,
|
|
100
|
+
},
|
|
101
|
+
},
|
|
102
|
+
pie: { type: Array, required: false },
|
|
103
|
+
dailyChart: { type: Array, required: false },
|
|
104
|
+
prePieMessage: { type: Array, required: false },
|
|
105
|
+
suggestionEmotionColor: {
|
|
106
|
+
type: String,
|
|
107
|
+
required: false,
|
|
108
|
+
},
|
|
109
|
+
appreciationEmotionColor: {
|
|
110
|
+
type: String,
|
|
111
|
+
required: false,
|
|
112
|
+
},
|
|
113
|
+
});
|
|
114
|
+
exports.MasterEmotionsModel = (0, mongoose_1.model)('Master_Emotion', MasterEmotionsSchema);
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.MasterEmotionsMessageModel = void 0;
|
|
4
|
+
const mongoose_1 = require("mongoose");
|
|
5
|
+
const MasterEmotionsMessageSchema = new mongoose_1.Schema({
|
|
6
|
+
masterEmotionKey: {
|
|
7
|
+
type: String,
|
|
8
|
+
required: true,
|
|
9
|
+
},
|
|
10
|
+
messageType: {
|
|
11
|
+
type: String,
|
|
12
|
+
required: true,
|
|
13
|
+
},
|
|
14
|
+
detail: {
|
|
15
|
+
type: String,
|
|
16
|
+
required: false,
|
|
17
|
+
},
|
|
18
|
+
messages: {
|
|
19
|
+
type: Array,
|
|
20
|
+
items: {
|
|
21
|
+
type: Object,
|
|
22
|
+
properties: {
|
|
23
|
+
message: {
|
|
24
|
+
type: String,
|
|
25
|
+
},
|
|
26
|
+
theme: {
|
|
27
|
+
type: String,
|
|
28
|
+
},
|
|
29
|
+
},
|
|
30
|
+
},
|
|
31
|
+
required: false,
|
|
32
|
+
},
|
|
33
|
+
});
|
|
34
|
+
exports.MasterEmotionsMessageModel = (0, mongoose_1.model)('Master_Emotion_Message', MasterEmotionsMessageSchema);
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.MasterEmotionsMessageMappingModel = void 0;
|
|
4
|
+
const mongoose_1 = require("mongoose");
|
|
5
|
+
const MasterEmotionsMessageMappingSchema = new mongoose_1.Schema({
|
|
6
|
+
masterEmotionKey: {
|
|
7
|
+
type: String,
|
|
8
|
+
required: true,
|
|
9
|
+
},
|
|
10
|
+
type: {
|
|
11
|
+
type: String,
|
|
12
|
+
required: true,
|
|
13
|
+
},
|
|
14
|
+
mapping: { type: Array, required: false },
|
|
15
|
+
});
|
|
16
|
+
exports.MasterEmotionsMessageMappingModel = (0, mongoose_1.model)('Master_Emotion_Message_Mapping', MasterEmotionsMessageMappingSchema);
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.MasterEmotionMessageTypeThemeMappingModel = void 0;
|
|
4
|
+
const mongoose_1 = require("mongoose");
|
|
5
|
+
const MasterEmotionMessageTypeThemeMappingSchema = new mongoose_1.Schema({
|
|
6
|
+
masterEmotionKey: {
|
|
7
|
+
type: String,
|
|
8
|
+
required: true,
|
|
9
|
+
},
|
|
10
|
+
messageType: {
|
|
11
|
+
type: String,
|
|
12
|
+
required: true,
|
|
13
|
+
},
|
|
14
|
+
detail: {
|
|
15
|
+
type: String,
|
|
16
|
+
required: false,
|
|
17
|
+
},
|
|
18
|
+
themes: {
|
|
19
|
+
type: Array,
|
|
20
|
+
required: false,
|
|
21
|
+
},
|
|
22
|
+
});
|
|
23
|
+
exports.MasterEmotionMessageTypeThemeMappingModel = (0, mongoose_1.model)('Master_Emotion_Message_Type_Theme_Mapping', MasterEmotionMessageTypeThemeMappingSchema);
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.MasterPodcastModel = void 0;
|
|
4
|
+
const mongoose_1 = require("mongoose");
|
|
5
|
+
const MasterPodcastSchema = new mongoose_1.Schema({
|
|
6
|
+
key: {
|
|
7
|
+
type: String,
|
|
8
|
+
required: true,
|
|
9
|
+
index: true,
|
|
10
|
+
},
|
|
11
|
+
file: {
|
|
12
|
+
type: String,
|
|
13
|
+
required: false,
|
|
14
|
+
},
|
|
15
|
+
title: {
|
|
16
|
+
type: String,
|
|
17
|
+
required: false,
|
|
18
|
+
},
|
|
19
|
+
url: {
|
|
20
|
+
type: String,
|
|
21
|
+
required: false,
|
|
22
|
+
},
|
|
23
|
+
duration: {
|
|
24
|
+
type: String,
|
|
25
|
+
required: false,
|
|
26
|
+
},
|
|
27
|
+
morningPodcast: {
|
|
28
|
+
type: Boolean,
|
|
29
|
+
default: false,
|
|
30
|
+
required: false,
|
|
31
|
+
},
|
|
32
|
+
});
|
|
33
|
+
exports.MasterPodcastModel = (0, mongoose_1.model)('Master_Podcast', MasterPodcastSchema);
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.MasterPredictionEmotionModel = void 0;
|
|
4
|
+
const mongoose_1 = require("mongoose");
|
|
5
|
+
const MasterPredictionEmotionSchema = new mongoose_1.Schema({
|
|
6
|
+
key: {
|
|
7
|
+
type: String,
|
|
8
|
+
required: true,
|
|
9
|
+
},
|
|
10
|
+
name: {
|
|
11
|
+
type: String,
|
|
12
|
+
required: true,
|
|
13
|
+
},
|
|
14
|
+
emotionCategory: {
|
|
15
|
+
type: String,
|
|
16
|
+
required: true,
|
|
17
|
+
},
|
|
18
|
+
themes: {
|
|
19
|
+
type: Array,
|
|
20
|
+
required: false,
|
|
21
|
+
},
|
|
22
|
+
inverse: {
|
|
23
|
+
type: Boolean,
|
|
24
|
+
required: true,
|
|
25
|
+
},
|
|
26
|
+
});
|
|
27
|
+
exports.MasterPredictionEmotionModel = (0, mongoose_1.model)('Master_Prediction_Emotion', MasterPredictionEmotionSchema);
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.MasterPredictionEmotionMessageModel = void 0;
|
|
4
|
+
const mongoose_1 = require("mongoose");
|
|
5
|
+
const MasterPredictionEmotionMessageSchema = new mongoose_1.Schema({
|
|
6
|
+
masterPredictionEmotionKey: {
|
|
7
|
+
type: String,
|
|
8
|
+
required: true,
|
|
9
|
+
index: true,
|
|
10
|
+
},
|
|
11
|
+
messages: {
|
|
12
|
+
type: Array,
|
|
13
|
+
items: {
|
|
14
|
+
type: 'object',
|
|
15
|
+
properties: {
|
|
16
|
+
message: {
|
|
17
|
+
type: String,
|
|
18
|
+
},
|
|
19
|
+
theme: {
|
|
20
|
+
type: String,
|
|
21
|
+
},
|
|
22
|
+
},
|
|
23
|
+
},
|
|
24
|
+
},
|
|
25
|
+
});
|
|
26
|
+
exports.MasterPredictionEmotionMessageModel = (0, mongoose_1.model)('Master_Prediction_Emotion_Message', MasterPredictionEmotionMessageSchema);
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.MasterPredictionEmotionsMessageMappingModel = void 0;
|
|
4
|
+
const mongoose_1 = require("mongoose");
|
|
5
|
+
const MasterPredictionEmotionsMessageMappingSchema = new mongoose_1.Schema({
|
|
6
|
+
masterEmotionKey: {
|
|
7
|
+
type: String,
|
|
8
|
+
required: true,
|
|
9
|
+
},
|
|
10
|
+
type: {
|
|
11
|
+
type: String,
|
|
12
|
+
required: true,
|
|
13
|
+
},
|
|
14
|
+
mapping: { type: Array, required: false },
|
|
15
|
+
});
|
|
16
|
+
exports.MasterPredictionEmotionsMessageMappingModel = (0, mongoose_1.model)('Master_Prediction_Emotion_Message_Mapping', MasterPredictionEmotionsMessageMappingSchema);
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.MasterThemeDataModel = void 0;
|
|
4
|
+
const mongoose_1 = require("mongoose");
|
|
5
|
+
const MasterThemeDataSchema = new mongoose_1.Schema({
|
|
6
|
+
theme: {
|
|
7
|
+
type: Number,
|
|
8
|
+
required: true,
|
|
9
|
+
index: true,
|
|
10
|
+
},
|
|
11
|
+
appreciationMessages: {
|
|
12
|
+
type: Array,
|
|
13
|
+
required: false,
|
|
14
|
+
},
|
|
15
|
+
suggestionMessages: {
|
|
16
|
+
type: Array,
|
|
17
|
+
required: false,
|
|
18
|
+
},
|
|
19
|
+
predictionMessages: {
|
|
20
|
+
type: Array,
|
|
21
|
+
required: false,
|
|
22
|
+
},
|
|
23
|
+
congratulationsQuestions: {
|
|
24
|
+
type: Array,
|
|
25
|
+
required: false,
|
|
26
|
+
},
|
|
27
|
+
journalQuestions: {
|
|
28
|
+
type: Array,
|
|
29
|
+
required: false,
|
|
30
|
+
},
|
|
31
|
+
podcasts: {
|
|
32
|
+
type: Array,
|
|
33
|
+
required: false,
|
|
34
|
+
},
|
|
35
|
+
});
|
|
36
|
+
exports.MasterThemeDataModel = (0, mongoose_1.model)('Master_Theme_Data', MasterThemeDataSchema);
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.MasterThemeMessageModel = void 0;
|
|
4
|
+
const mongoose_1 = require("mongoose");
|
|
5
|
+
const MasterThemeMessageSchema = new mongoose_1.Schema({
|
|
6
|
+
theme: {
|
|
7
|
+
type: String,
|
|
8
|
+
required: true,
|
|
9
|
+
},
|
|
10
|
+
congratulationsQuestions: [{ type: String, required: false }],
|
|
11
|
+
journalQuestion: [{ type: String, required: false }],
|
|
12
|
+
});
|
|
13
|
+
exports.MasterThemeMessageModel = (0, mongoose_1.model)('Master_Theme_Message', MasterThemeMessageSchema);
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.OrganizationModel = void 0;
|
|
4
|
+
const mongoose_1 = require("mongoose");
|
|
5
|
+
const OrganizationSchema = new mongoose_1.Schema({
|
|
6
|
+
platformKey: {
|
|
7
|
+
type: String,
|
|
8
|
+
required: true,
|
|
9
|
+
},
|
|
10
|
+
key: {
|
|
11
|
+
type: String,
|
|
12
|
+
required: true,
|
|
13
|
+
},
|
|
14
|
+
name: {
|
|
15
|
+
type: String,
|
|
16
|
+
required: true,
|
|
17
|
+
},
|
|
18
|
+
tId: {
|
|
19
|
+
type: String,
|
|
20
|
+
required: true,
|
|
21
|
+
index: true,
|
|
22
|
+
},
|
|
23
|
+
emergency: {
|
|
24
|
+
type: Object,
|
|
25
|
+
helpline: {
|
|
26
|
+
type: Boolean,
|
|
27
|
+
required: false,
|
|
28
|
+
},
|
|
29
|
+
required: false,
|
|
30
|
+
},
|
|
31
|
+
paidSubscription: {
|
|
32
|
+
type: Boolean,
|
|
33
|
+
required: false,
|
|
34
|
+
},
|
|
35
|
+
pilot: {
|
|
36
|
+
type: Boolean,
|
|
37
|
+
required: false,
|
|
38
|
+
},
|
|
39
|
+
subscriptionEndDate: {
|
|
40
|
+
type: Number,
|
|
41
|
+
required: false,
|
|
42
|
+
},
|
|
43
|
+
timezone: {
|
|
44
|
+
type: String,
|
|
45
|
+
required: false,
|
|
46
|
+
},
|
|
47
|
+
});
|
|
48
|
+
const organizationModel = (0, mongoose_1.model)('Organization', OrganizationSchema);
|
|
49
|
+
organizationModel.syncIndexes();
|
|
50
|
+
exports.OrganizationModel = organizationModel;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.PlatformModel = void 0;
|
|
4
|
+
const mongoose_1 = require("mongoose");
|
|
5
|
+
const PlatformSchema = new mongoose_1.Schema({
|
|
6
|
+
key: {
|
|
7
|
+
type: String,
|
|
8
|
+
required: true,
|
|
9
|
+
index: true,
|
|
10
|
+
},
|
|
11
|
+
name: {
|
|
12
|
+
type: String,
|
|
13
|
+
required: true,
|
|
14
|
+
},
|
|
15
|
+
email: {
|
|
16
|
+
type: String,
|
|
17
|
+
required: false,
|
|
18
|
+
},
|
|
19
|
+
subscriptionEndDate: {
|
|
20
|
+
type: Number,
|
|
21
|
+
required: false,
|
|
22
|
+
},
|
|
23
|
+
timezone: {
|
|
24
|
+
type: String,
|
|
25
|
+
required: false,
|
|
26
|
+
},
|
|
27
|
+
});
|
|
28
|
+
exports.PlatformModel = (0, mongoose_1.model)('Platform', PlatformSchema);
|
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.UserModel = void 0;
|
|
4
|
+
const mongoose_1 = require("mongoose");
|
|
5
|
+
const UserSchema = new mongoose_1.Schema({
|
|
6
|
+
organizationId: {
|
|
7
|
+
type: String,
|
|
8
|
+
required: true,
|
|
9
|
+
},
|
|
10
|
+
employeeId: {
|
|
11
|
+
type: String,
|
|
12
|
+
required: true,
|
|
13
|
+
index: true,
|
|
14
|
+
},
|
|
15
|
+
happinessCounterLifetime: {
|
|
16
|
+
type: Object,
|
|
17
|
+
yesCount: {
|
|
18
|
+
type: Number,
|
|
19
|
+
},
|
|
20
|
+
noCount: {
|
|
21
|
+
type: Number,
|
|
22
|
+
},
|
|
23
|
+
required: false,
|
|
24
|
+
},
|
|
25
|
+
delegatedAccessToken: {
|
|
26
|
+
type: String,
|
|
27
|
+
required: false,
|
|
28
|
+
},
|
|
29
|
+
email: {
|
|
30
|
+
type: String,
|
|
31
|
+
required: false,
|
|
32
|
+
},
|
|
33
|
+
displayName: {
|
|
34
|
+
type: String,
|
|
35
|
+
required: false,
|
|
36
|
+
},
|
|
37
|
+
jobTitle: {
|
|
38
|
+
type: String,
|
|
39
|
+
required: false,
|
|
40
|
+
},
|
|
41
|
+
dateFormat: {
|
|
42
|
+
type: String,
|
|
43
|
+
required: false,
|
|
44
|
+
},
|
|
45
|
+
timeFormat: {
|
|
46
|
+
type: String,
|
|
47
|
+
required: false,
|
|
48
|
+
},
|
|
49
|
+
timeZone: {
|
|
50
|
+
type: String,
|
|
51
|
+
required: false,
|
|
52
|
+
},
|
|
53
|
+
language: {
|
|
54
|
+
type: Object,
|
|
55
|
+
displayName: {
|
|
56
|
+
type: String,
|
|
57
|
+
},
|
|
58
|
+
locale: {
|
|
59
|
+
type: String,
|
|
60
|
+
},
|
|
61
|
+
required: false,
|
|
62
|
+
},
|
|
63
|
+
preferredLanguage: {
|
|
64
|
+
type: String,
|
|
65
|
+
required: false,
|
|
66
|
+
},
|
|
67
|
+
userPurpose: {
|
|
68
|
+
type: String,
|
|
69
|
+
required: false,
|
|
70
|
+
},
|
|
71
|
+
notificationDate: {
|
|
72
|
+
type: String,
|
|
73
|
+
required: false,
|
|
74
|
+
},
|
|
75
|
+
notificationCount: {
|
|
76
|
+
type: Number,
|
|
77
|
+
required: false,
|
|
78
|
+
},
|
|
79
|
+
timeNotificationCount: {
|
|
80
|
+
type: Number,
|
|
81
|
+
required: false,
|
|
82
|
+
},
|
|
83
|
+
workingHours: {
|
|
84
|
+
type: Object,
|
|
85
|
+
daysOfWeek: {
|
|
86
|
+
type: Array,
|
|
87
|
+
},
|
|
88
|
+
endTime: {
|
|
89
|
+
type: String,
|
|
90
|
+
},
|
|
91
|
+
startTime: {
|
|
92
|
+
type: String,
|
|
93
|
+
},
|
|
94
|
+
timeZone: {
|
|
95
|
+
type: Object,
|
|
96
|
+
name: {
|
|
97
|
+
type: String,
|
|
98
|
+
},
|
|
99
|
+
},
|
|
100
|
+
},
|
|
101
|
+
createdAt: {
|
|
102
|
+
type: Number,
|
|
103
|
+
required: false,
|
|
104
|
+
},
|
|
105
|
+
botDetails: {
|
|
106
|
+
type: Object,
|
|
107
|
+
index: true,
|
|
108
|
+
},
|
|
109
|
+
uniqueCode: {
|
|
110
|
+
type: String,
|
|
111
|
+
required: false,
|
|
112
|
+
},
|
|
113
|
+
accessToken: {
|
|
114
|
+
type: String,
|
|
115
|
+
required: false,
|
|
116
|
+
},
|
|
117
|
+
refreshToken: {
|
|
118
|
+
type: String,
|
|
119
|
+
required: false,
|
|
120
|
+
},
|
|
121
|
+
jId: {
|
|
122
|
+
type: String,
|
|
123
|
+
required: false,
|
|
124
|
+
},
|
|
125
|
+
roleName: {
|
|
126
|
+
type: String,
|
|
127
|
+
required: false,
|
|
128
|
+
},
|
|
129
|
+
cardPodcastClickCount: {
|
|
130
|
+
type: Number,
|
|
131
|
+
required: false,
|
|
132
|
+
},
|
|
133
|
+
});
|
|
134
|
+
const userModel = (0, mongoose_1.model)('User', UserSchema);
|
|
135
|
+
userModel.syncIndexes();
|
|
136
|
+
exports.UserModel = userModel;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.UserLogModel = void 0;
|
|
4
|
+
const mongoose_1 = require("mongoose");
|
|
5
|
+
const UserLogSchema = new mongoose_1.Schema({
|
|
6
|
+
userId: {
|
|
7
|
+
type: mongoose_1.Types.ObjectId,
|
|
8
|
+
required: true,
|
|
9
|
+
},
|
|
10
|
+
date: {
|
|
11
|
+
type: String,
|
|
12
|
+
required: true,
|
|
13
|
+
},
|
|
14
|
+
log: {
|
|
15
|
+
type: Object,
|
|
16
|
+
required: false,
|
|
17
|
+
},
|
|
18
|
+
});
|
|
19
|
+
UserLogSchema.index({ userId: 1, date: -1 }, {
|
|
20
|
+
unique: true,
|
|
21
|
+
});
|
|
22
|
+
const userLogModel = (0, mongoose_1.model)('User_Log', UserLogSchema);
|
|
23
|
+
userLogModel.syncIndexes();
|
|
24
|
+
exports.UserLogModel = userLogModel;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.UserMeetingModel = void 0;
|
|
4
|
+
const mongoose_1 = require("mongoose");
|
|
5
|
+
const UserMeetingSchema = new mongoose_1.Schema({
|
|
6
|
+
employeeId: {
|
|
7
|
+
type: String,
|
|
8
|
+
required: true,
|
|
9
|
+
},
|
|
10
|
+
date: {
|
|
11
|
+
type: String,
|
|
12
|
+
required: true,
|
|
13
|
+
},
|
|
14
|
+
meetings: {
|
|
15
|
+
type: Array,
|
|
16
|
+
required: false,
|
|
17
|
+
},
|
|
18
|
+
});
|
|
19
|
+
UserMeetingSchema.index({ employeeId: 1, date: -1 }, {
|
|
20
|
+
unique: true,
|
|
21
|
+
});
|
|
22
|
+
const userMeetingModel = (0, mongoose_1.model)('User_Meeting', UserMeetingSchema);
|
|
23
|
+
userMeetingModel.syncIndexes();
|
|
24
|
+
exports.UserMeetingModel = userMeetingModel;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.UserMessageModel = void 0;
|
|
4
|
+
const mongoose_1 = require("mongoose");
|
|
5
|
+
const UserMessageSchema = new mongoose_1.Schema({
|
|
6
|
+
userId: {
|
|
7
|
+
type: String,
|
|
8
|
+
required: false,
|
|
9
|
+
},
|
|
10
|
+
employeeId: {
|
|
11
|
+
type: String,
|
|
12
|
+
required: true,
|
|
13
|
+
},
|
|
14
|
+
date: {
|
|
15
|
+
type: String,
|
|
16
|
+
},
|
|
17
|
+
activityId: {
|
|
18
|
+
type: String,
|
|
19
|
+
},
|
|
20
|
+
praiseThanks: {
|
|
21
|
+
type: Boolean,
|
|
22
|
+
},
|
|
23
|
+
});
|
|
24
|
+
exports.UserMessageModel = (0, mongoose_1.model)('User_Message', UserMessageSchema);
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.UserMessageLogModel = void 0;
|
|
4
|
+
const mongoose_1 = require("mongoose");
|
|
5
|
+
const UserMessageLogSchema = new mongoose_1.Schema({
|
|
6
|
+
userId: {
|
|
7
|
+
type: String,
|
|
8
|
+
required: false,
|
|
9
|
+
},
|
|
10
|
+
employeeId: {
|
|
11
|
+
type: String,
|
|
12
|
+
required: true,
|
|
13
|
+
},
|
|
14
|
+
date: {
|
|
15
|
+
type: String,
|
|
16
|
+
required: true,
|
|
17
|
+
},
|
|
18
|
+
activityId: {
|
|
19
|
+
type: String,
|
|
20
|
+
required: true,
|
|
21
|
+
},
|
|
22
|
+
messageType: {
|
|
23
|
+
type: String,
|
|
24
|
+
required: true,
|
|
25
|
+
},
|
|
26
|
+
status: {
|
|
27
|
+
type: String,
|
|
28
|
+
required: true,
|
|
29
|
+
},
|
|
30
|
+
sentTime: {
|
|
31
|
+
type: Number,
|
|
32
|
+
required: false,
|
|
33
|
+
},
|
|
34
|
+
messageSeen: {
|
|
35
|
+
type: Boolean,
|
|
36
|
+
required: false,
|
|
37
|
+
},
|
|
38
|
+
saved: {
|
|
39
|
+
type: Boolean,
|
|
40
|
+
default: false,
|
|
41
|
+
required: false,
|
|
42
|
+
},
|
|
43
|
+
deleted: {
|
|
44
|
+
type: Boolean,
|
|
45
|
+
default: false,
|
|
46
|
+
required: false,
|
|
47
|
+
},
|
|
48
|
+
});
|
|
49
|
+
// UserMessageLogSchema.index({ employeeId: 1, activityId: -1 });
|
|
50
|
+
const userMessageLogModel = (0, mongoose_1.model)('User_Message_Log', UserMessageLogSchema);
|
|
51
|
+
// userMessageLogModel.syncIndexes();
|
|
52
|
+
exports.UserMessageLogModel = userMessageLogModel;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.userTestModel = void 0;
|
|
4
|
+
const mongoose_1 = require("mongoose");
|
|
5
|
+
const userSchema = new mongoose_1.Schema({
|
|
6
|
+
email: {
|
|
7
|
+
type: String,
|
|
8
|
+
required: true,
|
|
9
|
+
unique: true,
|
|
10
|
+
},
|
|
11
|
+
password: {
|
|
12
|
+
type: String,
|
|
13
|
+
required: true,
|
|
14
|
+
},
|
|
15
|
+
});
|
|
16
|
+
exports.userTestModel = (0, mongoose_1.model)('User_Test', userSchema);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "joye-backend-utility",
|
|
3
|
-
"version": "4.1.22-
|
|
3
|
+
"version": "4.1.22-test2",
|
|
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",
|
|
@@ -11,13 +11,12 @@
|
|
|
11
11
|
"node": "17.1.0"
|
|
12
12
|
},
|
|
13
13
|
"scripts": {
|
|
14
|
-
"build": "tsc
|
|
14
|
+
"build": "tsc",
|
|
15
15
|
"test": "echo \"Error: no test specified\"",
|
|
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
|
-
"copy-files": "copyfiles -u 1 lib/jwtKeys/**/* dist/"
|
|
19
|
+
"prepare": "husky install && yarn build"
|
|
21
20
|
},
|
|
22
21
|
"repository": {
|
|
23
22
|
"type": "git",
|
|
@@ -32,11 +31,9 @@
|
|
|
32
31
|
"dependencies": {
|
|
33
32
|
"bcrypt": "^5.0.1",
|
|
34
33
|
"dotenv": "^16.0.0",
|
|
35
|
-
"fs": "^0.0.1-security",
|
|
36
34
|
"jsonwebtoken": "^9.0.0",
|
|
37
35
|
"moment": "^2.29.3",
|
|
38
36
|
"mongoose": "^5.10.1",
|
|
39
|
-
"path": "^0.12.7",
|
|
40
37
|
"uuid": "^9.0.0"
|
|
41
38
|
},
|
|
42
39
|
"devDependencies": {
|
|
@@ -44,14 +41,12 @@
|
|
|
44
41
|
"@types/node": "^17.0.25",
|
|
45
42
|
"@typescript-eslint/eslint-plugin": "^4.28.2",
|
|
46
43
|
"@typescript-eslint/parser": "^4.28.2",
|
|
47
|
-
"copyfiles": "^2.4.1",
|
|
48
44
|
"eslint": "^7.30.0",
|
|
49
45
|
"eslint-config-prettier": "^8.3.0",
|
|
50
46
|
"eslint-plugin-prettier": "^3.4.0",
|
|
51
47
|
"husky": "^7.0.0",
|
|
52
48
|
"lint-staged": "^11.0.0",
|
|
53
49
|
"prettier": "^2.3.2",
|
|
54
|
-
"rimraf": "^5.0.1",
|
|
55
50
|
"ts-node": "^10.4.0",
|
|
56
51
|
"tsc-alias": "^1.4.1",
|
|
57
52
|
"tsconfig-paths": "^3.10.1",
|
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
-----BEGIN ENCRYPTED PRIVATE KEY-----
|
|
2
|
-
MIIJrTBXBgkqhkiG9w0BBQ0wSjApBgkqhkiG9w0BBQwwHAQIYVdqBFl9jNsCAggA
|
|
3
|
-
MAwGCCqGSIb3DQIJBQAwHQYJYIZIAWUDBAEqBBBFCT8k6QGn/RGNg6M/mZvSBIIJ
|
|
4
|
-
UAizpM8szOgBHCEQAXV2wf2/FNlc1ltsMWdmTPME1Csp8/Fxr68c+Z7Wel2IOSuh
|
|
5
|
-
I7IjgHok/YIAEhmhyglpC8+59p4XYLUckUgdHs1t+ZEcdCaEziMWaLueZgNQUUcL
|
|
6
|
-
RXYi+PtDDtr26p75c9lq39TaOZDInPdfla/39lW5nu4FE9/1P8cHxCmBFejmmDtT
|
|
7
|
-
OMFiT+yKpnUJZfqkCiibxia8DARRv17iUOJHtyn3EzVUxKC4oiXlsM2K93FjUiZs
|
|
8
|
-
LsymoqPH3cFD5o9T/WAJ6kj/90p1XHoIv2YCKJnnv7Lm1V6XMBD1iWCRCxqot+XV
|
|
9
|
-
Cx/nAtYoDqLXKN8VKUuN4b1bcf7XiHcR5jRmciqAkh5aMXnY4dYVGanVT5y3CCAL
|
|
10
|
-
zw0T5gPGkOYzFOvkhYf1PHVEcT8wZiabF5cuC37555je/jb3E/XNvG5+sXg2BWNa
|
|
11
|
-
ikI+66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