joye-backend-utility 5.0.46 → 5.0.49
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 +136 -136
- package/dist/dateTime.d.ts +11 -11
- package/dist/dateTime.js +82 -82
- package/dist/index.d.ts +6 -6
- package/dist/index.js +25 -25
- package/dist/jwt.d.ts +3 -3
- package/dist/jwt.js +40 -40
- package/dist/jwtKeys/jwtRS256.key +54 -0
- package/dist/jwtKeys/jwtRS256.key.pub +14 -0
- 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 +32 -32
- package/dist/schema/index.js +67 -67
- 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 +33 -33
- 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 -23
- 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/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 +35 -35
- 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 +221 -221
- 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 +42 -34
- 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/userVideo.d.ts +2 -2
- package/dist/schema/userVideo.js +50 -50
- 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;
|
|
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YZj2/EDV9kuVkkiIpTHiHOlh/C+7fQ
|
|
5
|
+
fiOoKHC6auEfeoh5yEgi57dy0md0bKnQ8WPpklkdoZrHJdRyneZY0/dnsv7PQ3Wx
|
|
6
|
+
pIL56LGPJA1SkhfyhhCQn+Kh/aOE6fuecnxmkKDlp33351vu7M7obR2ozr/wBUBs
|
|
7
|
+
Q2W61S9EcdBwx9PWQNsLPDEC8XuW7KvfetTzp+ZoLwMDLnoiDD1eyMiuHi7kq3KC
|
|
8
|
+
9lt+Ymf1FfrBTfLhIo7BI3py0pKgoUYNgmkaYzw57BfcPcq4BR1LsavRh2qbBb+e
|
|
9
|
+
cGoZQMqmgfiz4DyyXC2zJjruTMBheOhfA/fkMOSgsjTh3v5yno6ledgYTbJR3czf
|
|
10
|
+
2FH43dpGEgop/NHwfoMuV/pPJ3ZKqaeqZMm61wEgugUiVwT+aHOijkfIApRGuu8u
|
|
11
|
+
NQcfLXHcxT4lQ/XJ7rejwUibZBc0iv4pMT9jfap/Aycv7F49R8Mtwaj3vfKw9tNK
|
|
12
|
+
TTIHxl0KUIOd0byDkmGE+kzNVMWLCC3xL+S0TgUxbehNLQRS0xK6DdGmDXUfki0F
|
|
13
|
+
vuaVrQnfE/VvOnDBSksVu40CAwEAAQ==
|
|
14
|
+
-----END PUBLIC KEY-----
|
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;
|