joye-backend-utility 5.1.11 → 5.1.13
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/README.md +2 -2
- package/dist/config/index.d.ts +2 -2
- package/dist/config/index.js +8 -8
- package/dist/database.d.ts +26 -26
- package/dist/database.js +142 -142
- package/dist/dateTime.d.ts +11 -11
- package/dist/dateTime.js +82 -82
- package/dist/index.d.ts +6 -6
- package/dist/index.js +26 -26
- package/dist/jwt.d.ts +3 -3
- package/dist/jwt.js +40 -40
- package/dist/redisClient.d.ts +6 -6
- package/dist/redisClient.js +34 -34
- package/dist/schema/brew.d.ts +2 -2
- package/dist/schema/brew.js +160 -160
- package/dist/schema/databaseInfo.d.ts +2 -2
- package/dist/schema/databaseInfo.js +35 -35
- package/dist/schema/index.d.ts +38 -38
- package/dist/schema/index.js +79 -79
- package/dist/schema/masterAppSetting.d.ts +2 -2
- package/dist/schema/masterAppSetting.js +24 -24
- package/dist/schema/masterBlessingsData.d.ts +2 -2
- package/dist/schema/masterBlessingsData.js +41 -41
- package/dist/schema/masterData.d.ts +2 -2
- package/dist/schema/masterData.js +28 -28
- package/dist/schema/masterEmotion.d.ts +2 -2
- package/dist/schema/masterEmotion.js +115 -115
- package/dist/schema/masterEmotionMessageMapping.d.ts +2 -2
- package/dist/schema/masterEmotionMessageMapping.js +16 -16
- package/dist/schema/masterEmotionMessageTypeThemeMapping.d.ts +2 -2
- package/dist/schema/masterEmotionMessageTypeThemeMapping.js +23 -23
- package/dist/schema/masterLinkCard.d.ts +2 -2
- package/dist/schema/masterLinkCard.js +28 -28
- package/dist/schema/masterPodcast.d.ts +2 -2
- package/dist/schema/masterPodcast.js +37 -37
- package/dist/schema/masterPredictionEmotion.d.ts +2 -2
- package/dist/schema/masterPredictionEmotion.js +27 -27
- package/dist/schema/masterPredictionEmotionMessage.d.ts +2 -2
- package/dist/schema/masterPredictionEmotionMessage.js +26 -26
- package/dist/schema/masterPredictionEmotionMessageMapping.d.ts +2 -2
- package/dist/schema/masterPredictionEmotionMessageMapping.js +16 -16
- package/dist/schema/masterSuggestionsMessage.model.d.ts +2 -2
- package/dist/schema/masterSuggestionsMessage.model.js +31 -31
- package/dist/schema/masterSuggestionsParameter.model.d.ts +2 -2
- package/dist/schema/masterSuggestionsParameter.model.js +23 -23
- package/dist/schema/masterThemeData.d.ts +2 -2
- package/dist/schema/masterThemeData.js +48 -48
- package/dist/schema/masterThemeMessage.d.ts +2 -2
- package/dist/schema/masterThemeMessage.js +13 -13
- package/dist/schema/masterTraining.d.ts +2 -2
- package/dist/schema/masterTraining.js +29 -29
- package/dist/schema/masterTrainingWeek.d.ts +2 -2
- package/dist/schema/masterTrainingWeek.js +32 -32
- package/dist/schema/masterVideo.d.ts +2 -2
- package/dist/schema/masterVideo.js +33 -33
- package/dist/schema/organization.d.ts +2 -2
- package/dist/schema/organization.js +79 -79
- package/dist/schema/organizationUserAttrPermission.d.ts +2 -2
- package/dist/schema/organizationUserAttrPermission.js +59 -59
- package/dist/schema/platform.d.ts +2 -2
- package/dist/schema/platform.js +28 -28
- package/dist/schema/timezones.d.ts +2 -2
- package/dist/schema/timezones.js +26 -26
- package/dist/schema/user.d.ts +2 -2
- package/dist/schema/user.js +202 -202
- package/dist/schema/userFeedback.d.ts +2 -2
- package/dist/schema/userFeedback.js +24 -24
- package/dist/schema/userGoal.d.ts +2 -2
- package/dist/schema/userGoal.js +38 -38
- package/dist/schema/userJoyLevelQa.d.ts +2 -2
- package/dist/schema/userJoyLevelQa.js +49 -49
- package/dist/schema/userLog.d.ts +2 -2
- package/dist/schema/userLog.js +22 -22
- package/dist/schema/userMeeting.d.ts +2 -2
- package/dist/schema/userMeeting.js +22 -22
- package/dist/schema/userMessages.d.ts +2 -2
- package/dist/schema/userMessages.js +24 -24
- package/dist/schema/userMessagesLog.d.ts +2 -2
- package/dist/schema/userMessagesLog.js +69 -69
- package/dist/schema/userRecommendation.d.ts +2 -2
- package/dist/schema/userRecommendation.js +24 -24
- package/dist/schema/userReminder.d.ts +2 -2
- package/dist/schema/userReminder.js +61 -61
- package/dist/schema/userTrainingData.d.ts +2 -2
- package/dist/schema/userTrainingData.js +41 -37
- package/dist/schema/userTrainingWeekData.d.ts +2 -2
- package/dist/schema/userTrainingWeekData.js +40 -36
- package/dist/schema/userVideo.d.ts +2 -2
- package/dist/schema/userVideo.js +50 -50
- package/dist/schema/userWeekActivity.d.ts +2 -2
- package/dist/schema/userWeekActivity.js +90 -90
- package/dist/util.d.ts +2 -2
- package/dist/util.js +13 -13
- package/package.json +62 -62
package/dist/jwt.js
CHANGED
|
@@ -1,40 +1,40 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.decodeToken = exports.jwtVerify = exports.createToken = void 0;
|
|
4
|
-
const jwt = require('jsonwebtoken');
|
|
5
|
-
const fs = require('fs');
|
|
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');
|
|
10
|
-
const createToken = async (payload, expiresIn) => {
|
|
11
|
-
const token = jwt.sign(payload, { key: JWT_PRIVATE_KEY.replace(/\\n/gm, '\n'), passphrase: process.env.JWT_SECRET }, {
|
|
12
|
-
expiresIn,
|
|
13
|
-
algorithm: 'RS256',
|
|
14
|
-
});
|
|
15
|
-
return token;
|
|
16
|
-
};
|
|
17
|
-
exports.createToken = createToken;
|
|
18
|
-
const jwtVerify = async (token) => new Promise(resolve => {
|
|
19
|
-
jwt.verify(token, JWT_PUBLIC_KEY.replace(/\\n/gm, '\n'), async (err, decoded) => {
|
|
20
|
-
if (err) {
|
|
21
|
-
return resolve(err);
|
|
22
|
-
}
|
|
23
|
-
return resolve(decoded);
|
|
24
|
-
});
|
|
25
|
-
});
|
|
26
|
-
exports.jwtVerify = jwtVerify;
|
|
27
|
-
const decodeToken = (token) => {
|
|
28
|
-
try {
|
|
29
|
-
const decodedHeader = jwt.decode(token, { complete: true });
|
|
30
|
-
if (!decodedHeader) {
|
|
31
|
-
console.log('Invalid token Error');
|
|
32
|
-
}
|
|
33
|
-
return decodedHeader;
|
|
34
|
-
}
|
|
35
|
-
catch (err) {
|
|
36
|
-
console.log('Token decode failed: ', err);
|
|
37
|
-
return null;
|
|
38
|
-
}
|
|
39
|
-
};
|
|
40
|
-
exports.decodeToken = decodeToken;
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.decodeToken = exports.jwtVerify = exports.createToken = void 0;
|
|
4
|
+
const jwt = require('jsonwebtoken');
|
|
5
|
+
const fs = require('fs');
|
|
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');
|
|
10
|
+
const createToken = async (payload, expiresIn) => {
|
|
11
|
+
const token = jwt.sign(payload, { key: JWT_PRIVATE_KEY.replace(/\\n/gm, '\n'), passphrase: process.env.JWT_SECRET }, {
|
|
12
|
+
expiresIn,
|
|
13
|
+
algorithm: 'RS256',
|
|
14
|
+
});
|
|
15
|
+
return token;
|
|
16
|
+
};
|
|
17
|
+
exports.createToken = createToken;
|
|
18
|
+
const jwtVerify = async (token) => new Promise(resolve => {
|
|
19
|
+
jwt.verify(token, JWT_PUBLIC_KEY.replace(/\\n/gm, '\n'), async (err, decoded) => {
|
|
20
|
+
if (err) {
|
|
21
|
+
return resolve(err);
|
|
22
|
+
}
|
|
23
|
+
return resolve(decoded);
|
|
24
|
+
});
|
|
25
|
+
});
|
|
26
|
+
exports.jwtVerify = jwtVerify;
|
|
27
|
+
const decodeToken = (token) => {
|
|
28
|
+
try {
|
|
29
|
+
const decodedHeader = jwt.decode(token, { complete: true });
|
|
30
|
+
if (!decodedHeader) {
|
|
31
|
+
console.log('Invalid token Error');
|
|
32
|
+
}
|
|
33
|
+
return decodedHeader;
|
|
34
|
+
}
|
|
35
|
+
catch (err) {
|
|
36
|
+
console.log('Token decode failed: ', err);
|
|
37
|
+
return null;
|
|
38
|
+
}
|
|
39
|
+
};
|
|
40
|
+
exports.decodeToken = decodeToken;
|
package/dist/redisClient.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { createClient } from 'redis';
|
|
2
|
-
declare class RedisClient {
|
|
3
|
-
private static instance;
|
|
4
|
-
static getInstance(): Promise<ReturnType<typeof createClient>>;
|
|
5
|
-
}
|
|
6
|
-
export { RedisClient };
|
|
1
|
+
import { createClient } from 'redis';
|
|
2
|
+
declare class RedisClient {
|
|
3
|
+
private static instance;
|
|
4
|
+
static getInstance(): Promise<ReturnType<typeof createClient>>;
|
|
5
|
+
}
|
|
6
|
+
export { RedisClient };
|
package/dist/redisClient.js
CHANGED
|
@@ -1,34 +1,34 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.RedisClient = void 0;
|
|
4
|
-
const redis_1 = require("redis");
|
|
5
|
-
class RedisClient {
|
|
6
|
-
static async getInstance() {
|
|
7
|
-
if (!RedisClient.instance) {
|
|
8
|
-
const cachePort = process.env.REDIS_CACHE_PORT;
|
|
9
|
-
const cacheHostName = process.env.REDIS_CACHE_HOST;
|
|
10
|
-
const cachePassword = process.env.REDIS_CACHE_PASSWORD;
|
|
11
|
-
RedisClient.instance = await (0, redis_1.createClient)({
|
|
12
|
-
// redis for TLS
|
|
13
|
-
url: `rediss://${cacheHostName}:${cachePort}`,
|
|
14
|
-
password: cachePassword,
|
|
15
|
-
})
|
|
16
|
-
.on('error', err => {
|
|
17
|
-
console.log('Redis Client Error', err);
|
|
18
|
-
})
|
|
19
|
-
.on('connect', () => {
|
|
20
|
-
console.log('Connected to Redis');
|
|
21
|
-
})
|
|
22
|
-
.on('end', () => {
|
|
23
|
-
console.log('Connection to Redis end');
|
|
24
|
-
})
|
|
25
|
-
.connect();
|
|
26
|
-
}
|
|
27
|
-
if (!RedisClient.instance.isOpen) {
|
|
28
|
-
return await RedisClient.instance.connect();
|
|
29
|
-
}
|
|
30
|
-
return RedisClient.instance;
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
exports.RedisClient = RedisClient;
|
|
34
|
-
RedisClient.instance = null;
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.RedisClient = void 0;
|
|
4
|
+
const redis_1 = require("redis");
|
|
5
|
+
class RedisClient {
|
|
6
|
+
static async getInstance() {
|
|
7
|
+
if (!RedisClient.instance) {
|
|
8
|
+
const cachePort = process.env.REDIS_CACHE_PORT;
|
|
9
|
+
const cacheHostName = process.env.REDIS_CACHE_HOST;
|
|
10
|
+
const cachePassword = process.env.REDIS_CACHE_PASSWORD;
|
|
11
|
+
RedisClient.instance = await (0, redis_1.createClient)({
|
|
12
|
+
// redis for TLS
|
|
13
|
+
url: `rediss://${cacheHostName}:${cachePort}`,
|
|
14
|
+
password: cachePassword,
|
|
15
|
+
})
|
|
16
|
+
.on('error', err => {
|
|
17
|
+
console.log('Redis Client Error', err);
|
|
18
|
+
})
|
|
19
|
+
.on('connect', () => {
|
|
20
|
+
console.log('Connected to Redis');
|
|
21
|
+
})
|
|
22
|
+
.on('end', () => {
|
|
23
|
+
console.log('Connection to Redis end');
|
|
24
|
+
})
|
|
25
|
+
.connect();
|
|
26
|
+
}
|
|
27
|
+
if (!RedisClient.instance.isOpen) {
|
|
28
|
+
return await RedisClient.instance.connect();
|
|
29
|
+
}
|
|
30
|
+
return RedisClient.instance;
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
exports.RedisClient = RedisClient;
|
|
34
|
+
RedisClient.instance = null;
|
package/dist/schema/brew.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { Schema } from 'mongoose';
|
|
2
|
-
export declare const BrewSchema: Schema<import("mongoose").Document<any, any, any>, import("mongoose").Model<import("mongoose").Document<any, any, any>, any, any>, undefined, {}>;
|
|
1
|
+
import { Schema } from 'mongoose';
|
|
2
|
+
export declare const BrewSchema: Schema<import("mongoose").Document<any, any, any>, import("mongoose").Model<import("mongoose").Document<any, any, any>, any, any>, undefined, {}>;
|
package/dist/schema/brew.js
CHANGED
|
@@ -1,160 +1,160 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.BrewSchema = void 0;
|
|
4
|
-
const mongoose_1 = require("mongoose");
|
|
5
|
-
const Brew = 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
|
-
joyLevel: {
|
|
43
|
-
type: Number,
|
|
44
|
-
required: false,
|
|
45
|
-
},
|
|
46
|
-
theme: {
|
|
47
|
-
type: Number,
|
|
48
|
-
required: false,
|
|
49
|
-
},
|
|
50
|
-
isSkip: {
|
|
51
|
-
type: Boolean,
|
|
52
|
-
required: false,
|
|
53
|
-
},
|
|
54
|
-
journalText: {
|
|
55
|
-
type: String,
|
|
56
|
-
required: false,
|
|
57
|
-
},
|
|
58
|
-
fellingBetter: {
|
|
59
|
-
type: Boolean,
|
|
60
|
-
required: false,
|
|
61
|
-
},
|
|
62
|
-
todaysFeeling: {
|
|
63
|
-
type: String,
|
|
64
|
-
required: false,
|
|
65
|
-
},
|
|
66
|
-
journalCheck: {
|
|
67
|
-
type: String,
|
|
68
|
-
required: false,
|
|
69
|
-
},
|
|
70
|
-
count: {
|
|
71
|
-
type: Number,
|
|
72
|
-
required: false,
|
|
73
|
-
},
|
|
74
|
-
cardBrewCount: {
|
|
75
|
-
type: Number,
|
|
76
|
-
required: false,
|
|
77
|
-
},
|
|
78
|
-
smartTipCount: {
|
|
79
|
-
type: Number,
|
|
80
|
-
required: false,
|
|
81
|
-
},
|
|
82
|
-
currentAverage: {
|
|
83
|
-
type: Number,
|
|
84
|
-
required: false,
|
|
85
|
-
},
|
|
86
|
-
congratulationQuestion: {
|
|
87
|
-
type: String,
|
|
88
|
-
required: false,
|
|
89
|
-
},
|
|
90
|
-
journalQuestion: {
|
|
91
|
-
type: String,
|
|
92
|
-
required: false,
|
|
93
|
-
},
|
|
94
|
-
visualJournalQuestion: {
|
|
95
|
-
type: String,
|
|
96
|
-
required: false,
|
|
97
|
-
},
|
|
98
|
-
podcastKey: {
|
|
99
|
-
type: String,
|
|
100
|
-
required: false,
|
|
101
|
-
},
|
|
102
|
-
videoKey: {
|
|
103
|
-
type: String,
|
|
104
|
-
required: false,
|
|
105
|
-
},
|
|
106
|
-
journalCount: {
|
|
107
|
-
type: Number,
|
|
108
|
-
required: false,
|
|
109
|
-
},
|
|
110
|
-
happinessCounter: {
|
|
111
|
-
type: Object,
|
|
112
|
-
yesCount: {
|
|
113
|
-
type: Number,
|
|
114
|
-
},
|
|
115
|
-
noCount: {
|
|
116
|
-
type: Number,
|
|
117
|
-
},
|
|
118
|
-
required: false,
|
|
119
|
-
},
|
|
120
|
-
stressBustersStartCount: {
|
|
121
|
-
type: Number,
|
|
122
|
-
required: false,
|
|
123
|
-
},
|
|
124
|
-
stressBustersEndCount: {
|
|
125
|
-
type: Number,
|
|
126
|
-
required: false,
|
|
127
|
-
},
|
|
128
|
-
podcastViewCount: {
|
|
129
|
-
type: Number,
|
|
130
|
-
required: false,
|
|
131
|
-
},
|
|
132
|
-
creationDate: {
|
|
133
|
-
type: String,
|
|
134
|
-
required: true,
|
|
135
|
-
},
|
|
136
|
-
rating: {
|
|
137
|
-
type: Number,
|
|
138
|
-
required: false,
|
|
139
|
-
},
|
|
140
|
-
sessionData: {
|
|
141
|
-
type: Object,
|
|
142
|
-
required: false,
|
|
143
|
-
},
|
|
144
|
-
cardSessionData: {
|
|
145
|
-
type: Object,
|
|
146
|
-
required: false,
|
|
147
|
-
},
|
|
148
|
-
pie: {
|
|
149
|
-
type: Object,
|
|
150
|
-
required: false,
|
|
151
|
-
},
|
|
152
|
-
pieMessage: {
|
|
153
|
-
type: Object,
|
|
154
|
-
required: false,
|
|
155
|
-
},
|
|
156
|
-
});
|
|
157
|
-
Brew.index({ userId: 1, date: -1 }, {
|
|
158
|
-
unique: false,
|
|
159
|
-
});
|
|
160
|
-
exports.BrewSchema = Brew;
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.BrewSchema = void 0;
|
|
4
|
+
const mongoose_1 = require("mongoose");
|
|
5
|
+
const Brew = 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
|
+
joyLevel: {
|
|
43
|
+
type: Number,
|
|
44
|
+
required: false,
|
|
45
|
+
},
|
|
46
|
+
theme: {
|
|
47
|
+
type: Number,
|
|
48
|
+
required: false,
|
|
49
|
+
},
|
|
50
|
+
isSkip: {
|
|
51
|
+
type: Boolean,
|
|
52
|
+
required: false,
|
|
53
|
+
},
|
|
54
|
+
journalText: {
|
|
55
|
+
type: String,
|
|
56
|
+
required: false,
|
|
57
|
+
},
|
|
58
|
+
fellingBetter: {
|
|
59
|
+
type: Boolean,
|
|
60
|
+
required: false,
|
|
61
|
+
},
|
|
62
|
+
todaysFeeling: {
|
|
63
|
+
type: String,
|
|
64
|
+
required: false,
|
|
65
|
+
},
|
|
66
|
+
journalCheck: {
|
|
67
|
+
type: String,
|
|
68
|
+
required: false,
|
|
69
|
+
},
|
|
70
|
+
count: {
|
|
71
|
+
type: Number,
|
|
72
|
+
required: false,
|
|
73
|
+
},
|
|
74
|
+
cardBrewCount: {
|
|
75
|
+
type: Number,
|
|
76
|
+
required: false,
|
|
77
|
+
},
|
|
78
|
+
smartTipCount: {
|
|
79
|
+
type: Number,
|
|
80
|
+
required: false,
|
|
81
|
+
},
|
|
82
|
+
currentAverage: {
|
|
83
|
+
type: Number,
|
|
84
|
+
required: false,
|
|
85
|
+
},
|
|
86
|
+
congratulationQuestion: {
|
|
87
|
+
type: String,
|
|
88
|
+
required: false,
|
|
89
|
+
},
|
|
90
|
+
journalQuestion: {
|
|
91
|
+
type: String,
|
|
92
|
+
required: false,
|
|
93
|
+
},
|
|
94
|
+
visualJournalQuestion: {
|
|
95
|
+
type: String,
|
|
96
|
+
required: false,
|
|
97
|
+
},
|
|
98
|
+
podcastKey: {
|
|
99
|
+
type: String,
|
|
100
|
+
required: false,
|
|
101
|
+
},
|
|
102
|
+
videoKey: {
|
|
103
|
+
type: String,
|
|
104
|
+
required: false,
|
|
105
|
+
},
|
|
106
|
+
journalCount: {
|
|
107
|
+
type: Number,
|
|
108
|
+
required: false,
|
|
109
|
+
},
|
|
110
|
+
happinessCounter: {
|
|
111
|
+
type: Object,
|
|
112
|
+
yesCount: {
|
|
113
|
+
type: Number,
|
|
114
|
+
},
|
|
115
|
+
noCount: {
|
|
116
|
+
type: Number,
|
|
117
|
+
},
|
|
118
|
+
required: false,
|
|
119
|
+
},
|
|
120
|
+
stressBustersStartCount: {
|
|
121
|
+
type: Number,
|
|
122
|
+
required: false,
|
|
123
|
+
},
|
|
124
|
+
stressBustersEndCount: {
|
|
125
|
+
type: Number,
|
|
126
|
+
required: false,
|
|
127
|
+
},
|
|
128
|
+
podcastViewCount: {
|
|
129
|
+
type: Number,
|
|
130
|
+
required: false,
|
|
131
|
+
},
|
|
132
|
+
creationDate: {
|
|
133
|
+
type: String,
|
|
134
|
+
required: true,
|
|
135
|
+
},
|
|
136
|
+
rating: {
|
|
137
|
+
type: Number,
|
|
138
|
+
required: false,
|
|
139
|
+
},
|
|
140
|
+
sessionData: {
|
|
141
|
+
type: Object,
|
|
142
|
+
required: false,
|
|
143
|
+
},
|
|
144
|
+
cardSessionData: {
|
|
145
|
+
type: Object,
|
|
146
|
+
required: false,
|
|
147
|
+
},
|
|
148
|
+
pie: {
|
|
149
|
+
type: Object,
|
|
150
|
+
required: false,
|
|
151
|
+
},
|
|
152
|
+
pieMessage: {
|
|
153
|
+
type: Object,
|
|
154
|
+
required: false,
|
|
155
|
+
},
|
|
156
|
+
});
|
|
157
|
+
Brew.index({ userId: 1, date: -1 }, {
|
|
158
|
+
unique: false,
|
|
159
|
+
});
|
|
160
|
+
exports.BrewSchema = Brew;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { Schema } from 'mongoose';
|
|
2
|
-
export declare const DatabaseInfoSchema: Schema<import("mongoose").Document<any, any, any>, import("mongoose").Model<import("mongoose").Document<any, any, any>, any, any>, undefined, {}>;
|
|
1
|
+
import { Schema } from 'mongoose';
|
|
2
|
+
export declare const DatabaseInfoSchema: Schema<import("mongoose").Document<any, any, any>, import("mongoose").Model<import("mongoose").Document<any, any, any>, any, any>, undefined, {}>;
|
|
@@ -1,35 +1,35 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.DatabaseInfoSchema = 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
|
-
exports.DatabaseInfoSchema = DatabaseInfo;
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DatabaseInfoSchema = 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
|
+
exports.DatabaseInfoSchema = DatabaseInfo;
|
package/dist/schema/index.d.ts
CHANGED
|
@@ -1,38 +1,38 @@
|
|
|
1
|
-
export { BrewSchema } from './brew';
|
|
2
|
-
export { MasterAppSettingSchema } from './masterAppSetting';
|
|
3
|
-
export { MasterDataSchema } from './masterData';
|
|
4
|
-
export { MasterEmotionsSchema } from './masterEmotion';
|
|
5
|
-
export { MasterEmotionsMessageMappingSchema } from './masterEmotionMessageMapping';
|
|
6
|
-
export { MasterEmotionMessageTypeThemeMappingSchema } from './masterEmotionMessageTypeThemeMapping';
|
|
7
|
-
export { MasterPodcastSchema } from './masterPodcast';
|
|
8
|
-
export { MasterPredictionEmotionSchema } from './masterPredictionEmotion';
|
|
9
|
-
export { MasterPredictionEmotionMessageSchema } from './masterPredictionEmotionMessage';
|
|
10
|
-
export { MasterPredictionEmotionsMessageMappingSchema } from './masterPredictionEmotionMessageMapping';
|
|
11
|
-
export { MasterThemeDataSchema } from './masterThemeData';
|
|
12
|
-
export { MasterThemeMessageSchema } from './masterThemeMessage';
|
|
13
|
-
export { OrganizationSchema } from './organization';
|
|
14
|
-
export { PlatformSchema } from './platform';
|
|
15
|
-
export { UserLogSchema } from './userLog';
|
|
16
|
-
export { UserMeetingSchema } from './userMeeting';
|
|
17
|
-
export { UserMessageSchema } from './userMessages';
|
|
18
|
-
export { UserMessageLogSchema } from './userMessagesLog';
|
|
19
|
-
export { UserSchema } from './user';
|
|
20
|
-
export { DatabaseInfoSchema } from './databaseInfo';
|
|
21
|
-
export { MasterVideoSchema } from './masterVideo';
|
|
22
|
-
export { MasterBlessingsDataSchema } from './masterBlessingsData';
|
|
23
|
-
export { MasterSuggestionsMessageSchema } from './masterSuggestionsMessage.model';
|
|
24
|
-
export { MasterSuggestionsParameterSchema } from './masterSuggestionsParameter.model';
|
|
25
|
-
export { UserRecommendationSchema } from './userRecommendation';
|
|
26
|
-
export { MasterLinkCardSchema } from './masterLinkCard';
|
|
27
|
-
export { UserReminderSchema } from '../schema/userReminder';
|
|
28
|
-
export { UserFeedbackSchema } from '../schema/userFeedback';
|
|
29
|
-
export { UserVideoSchema } from '../schema/userVideo';
|
|
30
|
-
export { TimezoneSchema } from './timezones';
|
|
31
|
-
export { OrganizationUserAttrPermissionSchema } from './organizationUserAttrPermission';
|
|
32
|
-
export { userGoalSchema } from './userGoal';
|
|
33
|
-
export { userJoyLevelQaSchema } from './userJoyLevelQa';
|
|
34
|
-
export { MasterTrainingSchema } from './masterTraining';
|
|
35
|
-
export { MasterTrainingWeekSchema } from './masterTrainingWeek';
|
|
36
|
-
export { UserTrainingDataSchema } from './userTrainingData';
|
|
37
|
-
export { UserTrainingWeekDataSchema } from './userTrainingWeekData';
|
|
38
|
-
export { UserWeekActivitySchema } from './userWeekActivity';
|
|
1
|
+
export { BrewSchema } from './brew';
|
|
2
|
+
export { MasterAppSettingSchema } from './masterAppSetting';
|
|
3
|
+
export { MasterDataSchema } from './masterData';
|
|
4
|
+
export { MasterEmotionsSchema } from './masterEmotion';
|
|
5
|
+
export { MasterEmotionsMessageMappingSchema } from './masterEmotionMessageMapping';
|
|
6
|
+
export { MasterEmotionMessageTypeThemeMappingSchema } from './masterEmotionMessageTypeThemeMapping';
|
|
7
|
+
export { MasterPodcastSchema } from './masterPodcast';
|
|
8
|
+
export { MasterPredictionEmotionSchema } from './masterPredictionEmotion';
|
|
9
|
+
export { MasterPredictionEmotionMessageSchema } from './masterPredictionEmotionMessage';
|
|
10
|
+
export { MasterPredictionEmotionsMessageMappingSchema } from './masterPredictionEmotionMessageMapping';
|
|
11
|
+
export { MasterThemeDataSchema } from './masterThemeData';
|
|
12
|
+
export { MasterThemeMessageSchema } from './masterThemeMessage';
|
|
13
|
+
export { OrganizationSchema } from './organization';
|
|
14
|
+
export { PlatformSchema } from './platform';
|
|
15
|
+
export { UserLogSchema } from './userLog';
|
|
16
|
+
export { UserMeetingSchema } from './userMeeting';
|
|
17
|
+
export { UserMessageSchema } from './userMessages';
|
|
18
|
+
export { UserMessageLogSchema } from './userMessagesLog';
|
|
19
|
+
export { UserSchema } from './user';
|
|
20
|
+
export { DatabaseInfoSchema } from './databaseInfo';
|
|
21
|
+
export { MasterVideoSchema } from './masterVideo';
|
|
22
|
+
export { MasterBlessingsDataSchema } from './masterBlessingsData';
|
|
23
|
+
export { MasterSuggestionsMessageSchema } from './masterSuggestionsMessage.model';
|
|
24
|
+
export { MasterSuggestionsParameterSchema } from './masterSuggestionsParameter.model';
|
|
25
|
+
export { UserRecommendationSchema } from './userRecommendation';
|
|
26
|
+
export { MasterLinkCardSchema } from './masterLinkCard';
|
|
27
|
+
export { UserReminderSchema } from '../schema/userReminder';
|
|
28
|
+
export { UserFeedbackSchema } from '../schema/userFeedback';
|
|
29
|
+
export { UserVideoSchema } from '../schema/userVideo';
|
|
30
|
+
export { TimezoneSchema } from './timezones';
|
|
31
|
+
export { OrganizationUserAttrPermissionSchema } from './organizationUserAttrPermission';
|
|
32
|
+
export { userGoalSchema } from './userGoal';
|
|
33
|
+
export { userJoyLevelQaSchema } from './userJoyLevelQa';
|
|
34
|
+
export { MasterTrainingSchema } from './masterTraining';
|
|
35
|
+
export { MasterTrainingWeekSchema } from './masterTrainingWeek';
|
|
36
|
+
export { UserTrainingDataSchema } from './userTrainingData';
|
|
37
|
+
export { UserTrainingWeekDataSchema } from './userTrainingWeekData';
|
|
38
|
+
export { UserWeekActivitySchema } from './userWeekActivity';
|