@intelact/bright 0.9.77 → 0.9.79
Sign up to get free protection for your applications and to get access to all the features.
- package/lib/dtos/index.d.ts +2 -1
- package/lib/dtos/index.js +2 -1
- package/lib/dtos/index.js.map +1 -1
- package/lib/dtos/notification.dto.d.ts +4 -0
- package/lib/dtos/notification.dto.js +29 -0
- package/lib/dtos/notification.dto.js.map +1 -0
- package/lib/enums/module.enum.d.ts +22 -0
- package/lib/enums/module.enum.js +24 -1
- package/lib/enums/module.enum.js.map +1 -1
- package/lib/enums/tracks.enum.d.ts +12 -8
- package/lib/enums/tracks.enum.js +16 -12
- package/lib/enums/tracks.enum.js.map +1 -1
- package/lib/helpers/index.d.ts +2 -0
- package/lib/helpers/index.js +19 -0
- package/lib/helpers/index.js.map +1 -0
- package/lib/helpers/popularity.helper.d.ts +2 -0
- package/lib/helpers/popularity.helper.js +58 -0
- package/lib/helpers/popularity.helper.js.map +1 -0
- package/lib/helpers/post.helper.d.ts +2 -0
- package/lib/helpers/post.helper.js +22 -0
- package/lib/helpers/post.helper.js.map +1 -0
- package/lib/index.d.ts +1 -0
- package/lib/index.js +1 -0
- package/lib/index.js.map +1 -1
- package/lib/models/author.d.ts +3 -3
- package/lib/models/author.js +7 -7
- package/lib/models/author.js.map +1 -1
- package/lib/models/boost.d.ts +3 -3
- package/lib/models/boost.js +10 -11
- package/lib/models/boost.js.map +1 -1
- package/lib/models/brand.d.ts +4 -4
- package/lib/models/brand.js +19 -19
- package/lib/models/brand.js.map +1 -1
- package/lib/models/category.js +0 -1
- package/lib/models/category.js.map +1 -1
- package/lib/models/collection.d.ts +3 -3
- package/lib/models/collection.js +10 -11
- package/lib/models/collection.js.map +1 -1
- package/lib/models/feedback.d.ts +3 -5
- package/lib/models/feedback.js +12 -36
- package/lib/models/feedback.js.map +1 -1
- package/lib/models/log.d.ts +7 -7
- package/lib/models/log.js +6 -6
- package/lib/models/log.js.map +1 -1
- package/lib/models/post.d.ts +15 -17
- package/lib/models/post.js +69 -160
- package/lib/models/post.js.map +1 -1
- package/lib/models/promotion.d.ts +5 -4
- package/lib/models/promotion.js +18 -14
- package/lib/models/promotion.js.map +1 -1
- package/lib/models/publisher.d.ts +4 -3
- package/lib/models/publisher.js +12 -8
- package/lib/models/publisher.js.map +1 -1
- package/lib/models/question.d.ts +20 -17
- package/lib/models/question.js +80 -61
- package/lib/models/question.js.map +1 -1
- package/lib/models/response.d.ts +1 -0
- package/lib/models/survey.d.ts +9 -11
- package/lib/models/survey.js +37 -47
- package/lib/models/survey.js.map +1 -1
- package/lib/models/topic.d.ts +2 -2
- package/lib/models/topic.js +6 -56
- package/lib/models/topic.js.map +1 -1
- package/lib/models/user.d.ts +4 -4
- package/lib/models/user.js +100 -22
- package/lib/models/user.js.map +1 -1
- package/lib/tsconfig.tsbuildinfo +1 -1
- package/package.json +3 -3
package/lib/models/question.js
CHANGED
@@ -20,29 +20,30 @@ const log_1 = require("./log");
|
|
20
20
|
class Question {
|
21
21
|
id;
|
22
22
|
slug;
|
23
|
-
|
24
|
-
|
25
|
-
categories;
|
23
|
+
title;
|
24
|
+
question;
|
26
25
|
name;
|
27
26
|
email;
|
28
27
|
phone;
|
29
|
-
title;
|
30
|
-
question;
|
31
|
-
tags;
|
32
28
|
status;
|
33
29
|
private;
|
34
30
|
closed;
|
35
31
|
myQuestion;
|
36
|
-
|
37
|
-
|
32
|
+
metricSeen;
|
33
|
+
metricOpens;
|
38
34
|
metricLikes;
|
39
35
|
metricShares;
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
36
|
+
metricBookmarks;
|
37
|
+
metricComments;
|
38
|
+
attention;
|
39
|
+
statusChanged;
|
40
|
+
published;
|
41
|
+
created;
|
42
|
+
updated;
|
43
|
+
deleted;
|
44
|
+
user;
|
45
|
+
comments;
|
46
|
+
categories;
|
46
47
|
constructor(props) {
|
47
48
|
Object.assign(this, props);
|
48
49
|
}
|
@@ -59,19 +60,12 @@ __decorate([
|
|
59
60
|
], Question.prototype, "slug", void 0);
|
60
61
|
__decorate([
|
61
62
|
(0, class_transformer_1.Expose)(),
|
62
|
-
(
|
63
|
-
|
64
|
-
], Question.prototype, "user", void 0);
|
65
|
-
__decorate([
|
66
|
-
(0, class_transformer_1.Expose)(),
|
67
|
-
(0, class_transformer_1.Type)(() => QuestionComment),
|
68
|
-
__metadata("design:type", Array)
|
69
|
-
], Question.prototype, "comments", void 0);
|
63
|
+
__metadata("design:type", String)
|
64
|
+
], Question.prototype, "title", void 0);
|
70
65
|
__decorate([
|
71
66
|
(0, class_transformer_1.Expose)(),
|
72
|
-
(
|
73
|
-
|
74
|
-
], Question.prototype, "categories", void 0);
|
67
|
+
__metadata("design:type", String)
|
68
|
+
], Question.prototype, "question", void 0);
|
75
69
|
__decorate([
|
76
70
|
(0, class_transformer_1.Expose)(),
|
77
71
|
__metadata("design:type", String)
|
@@ -84,19 +78,6 @@ __decorate([
|
|
84
78
|
(0, class_transformer_1.Expose)(),
|
85
79
|
__metadata("design:type", String)
|
86
80
|
], Question.prototype, "phone", void 0);
|
87
|
-
__decorate([
|
88
|
-
(0, class_transformer_1.Expose)(),
|
89
|
-
__metadata("design:type", String)
|
90
|
-
], Question.prototype, "title", void 0);
|
91
|
-
__decorate([
|
92
|
-
(0, class_transformer_1.Expose)(),
|
93
|
-
__metadata("design:type", String)
|
94
|
-
], Question.prototype, "question", void 0);
|
95
|
-
__decorate([
|
96
|
-
(0, class_transformer_1.Expose)(),
|
97
|
-
(0, class_transformer_1.Transform)(({ obj }) => (obj?.categories?.map((i) => i.hash) || [])),
|
98
|
-
__metadata("design:type", Array)
|
99
|
-
], Question.prototype, "tags", void 0);
|
100
81
|
__decorate([
|
101
82
|
(0, class_transformer_1.Expose)({ groups: ['admin'] }),
|
102
83
|
__metadata("design:type", String)
|
@@ -119,15 +100,15 @@ __decorate([
|
|
119
100
|
__decorate([
|
120
101
|
(0, class_transformer_1.Expose)(),
|
121
102
|
(0, class_transformer_1.Type)(() => metric_1.Metric),
|
122
|
-
(0, class_transformer_1.Transform)(({ obj }) => metric_1.Metric.seen(obj?.
|
103
|
+
(0, class_transformer_1.Transform)(({ obj }) => metric_1.Metric.seen(obj?.totalSeen, obj?.hasSeen)),
|
123
104
|
__metadata("design:type", metric_1.Metric)
|
124
|
-
], Question.prototype, "
|
105
|
+
], Question.prototype, "metricSeen", void 0);
|
125
106
|
__decorate([
|
126
107
|
(0, class_transformer_1.Expose)(),
|
127
108
|
(0, class_transformer_1.Type)(() => metric_1.Metric),
|
128
|
-
(0, class_transformer_1.Transform)(({ obj }) => metric_1.Metric.
|
109
|
+
(0, class_transformer_1.Transform)(({ obj }) => metric_1.Metric.seen(obj?.totalOpens, obj?.hasOpen)),
|
129
110
|
__metadata("design:type", metric_1.Metric)
|
130
|
-
], Question.prototype, "
|
111
|
+
], Question.prototype, "metricOpens", void 0);
|
131
112
|
__decorate([
|
132
113
|
(0, class_transformer_1.Expose)(),
|
133
114
|
(0, class_transformer_1.Type)(() => metric_1.Metric),
|
@@ -140,45 +121,73 @@ __decorate([
|
|
140
121
|
(0, class_transformer_1.Transform)(({ obj }) => metric_1.Metric.like(obj?.totalShares, obj?.hasShare)),
|
141
122
|
__metadata("design:type", metric_1.Metric)
|
142
123
|
], Question.prototype, "metricShares", void 0);
|
124
|
+
__decorate([
|
125
|
+
(0, class_transformer_1.Expose)(),
|
126
|
+
(0, class_transformer_1.Type)(() => metric_1.Metric),
|
127
|
+
(0, class_transformer_1.Transform)(({ obj }) => metric_1.Metric.like(obj?.totalBookmarks, obj?.hasBookmark)),
|
128
|
+
__metadata("design:type", metric_1.Metric)
|
129
|
+
], Question.prototype, "metricBookmarks", void 0);
|
143
130
|
__decorate([
|
144
131
|
(0, class_transformer_1.Expose)(),
|
145
132
|
(0, class_transformer_1.Type)(() => metric_1.Metric),
|
146
133
|
(0, class_transformer_1.Transform)(({ obj }) => metric_1.Metric.feedback(obj?.totalComments, obj?.hasComment)),
|
147
134
|
__metadata("design:type", metric_1.Metric)
|
148
|
-
], Question.prototype, "
|
135
|
+
], Question.prototype, "metricComments", void 0);
|
136
|
+
__decorate([
|
137
|
+
(0, class_transformer_1.Expose)(),
|
138
|
+
(0, class_transformer_1.Type)(() => log_1.Log),
|
139
|
+
__metadata("design:type", log_1.Log)
|
140
|
+
], Question.prototype, "attention", void 0);
|
141
|
+
__decorate([
|
142
|
+
(0, class_transformer_1.Expose)(),
|
143
|
+
(0, class_transformer_1.Type)(() => log_1.Log),
|
144
|
+
__metadata("design:type", log_1.Log)
|
145
|
+
], Question.prototype, "statusChanged", void 0);
|
146
|
+
__decorate([
|
147
|
+
(0, class_transformer_1.Expose)(),
|
148
|
+
(0, class_transformer_1.Type)(() => log_1.Log),
|
149
|
+
__metadata("design:type", log_1.Log)
|
150
|
+
], Question.prototype, "published", void 0);
|
149
151
|
__decorate([
|
150
152
|
(0, class_transformer_1.Expose)({ groups: ['admin'] }),
|
151
153
|
(0, class_transformer_1.Type)(() => log_1.Log),
|
152
154
|
__metadata("design:type", log_1.Log)
|
153
|
-
], Question.prototype, "
|
155
|
+
], Question.prototype, "created", void 0);
|
154
156
|
__decorate([
|
155
157
|
(0, class_transformer_1.Expose)({ groups: ['admin'] }),
|
156
158
|
(0, class_transformer_1.Type)(() => log_1.Log),
|
157
159
|
__metadata("design:type", log_1.Log)
|
158
|
-
], Question.prototype, "
|
160
|
+
], Question.prototype, "updated", void 0);
|
159
161
|
__decorate([
|
160
162
|
(0, class_transformer_1.Expose)({ groups: ['console'] }),
|
161
163
|
(0, class_transformer_1.Type)(() => log_1.Log),
|
162
164
|
__metadata("design:type", log_1.Log)
|
163
|
-
], Question.prototype, "
|
165
|
+
], Question.prototype, "deleted", void 0);
|
164
166
|
__decorate([
|
165
167
|
(0, class_transformer_1.Expose)(),
|
166
|
-
(0, class_transformer_1.Type)(() =>
|
167
|
-
__metadata("design:type",
|
168
|
-
], Question.prototype, "
|
168
|
+
(0, class_transformer_1.Type)(() => user_1.User),
|
169
|
+
__metadata("design:type", user_1.User)
|
170
|
+
], Question.prototype, "user", void 0);
|
169
171
|
__decorate([
|
170
172
|
(0, class_transformer_1.Expose)(),
|
171
|
-
(0, class_transformer_1.Type)(() =>
|
172
|
-
__metadata("design:type",
|
173
|
-
], Question.prototype, "
|
173
|
+
(0, class_transformer_1.Type)(() => QuestionComment),
|
174
|
+
__metadata("design:type", Array)
|
175
|
+
], Question.prototype, "comments", void 0);
|
176
|
+
__decorate([
|
177
|
+
(0, class_transformer_1.Expose)(),
|
178
|
+
(0, class_transformer_1.Type)(() => category_1.Category),
|
179
|
+
__metadata("design:type", Array)
|
180
|
+
], Question.prototype, "categories", void 0);
|
174
181
|
class QuestionComment {
|
175
182
|
id;
|
176
|
-
question;
|
177
183
|
author;
|
184
|
+
question;
|
178
185
|
comment;
|
179
186
|
status;
|
180
|
-
|
181
|
-
|
187
|
+
published;
|
188
|
+
statusChanged;
|
189
|
+
created;
|
190
|
+
updated;
|
182
191
|
constructor(props) {
|
183
192
|
Object.assign(this, props);
|
184
193
|
}
|
@@ -189,15 +198,15 @@ __decorate([
|
|
189
198
|
(0, class_transformer_1.Type)(() => Number),
|
190
199
|
__metadata("design:type", Number)
|
191
200
|
], QuestionComment.prototype, "id", void 0);
|
192
|
-
__decorate([
|
193
|
-
(0, class_transformer_1.Expose)(),
|
194
|
-
__metadata("design:type", Question)
|
195
|
-
], QuestionComment.prototype, "question", void 0);
|
196
201
|
__decorate([
|
197
202
|
(0, class_transformer_1.Expose)(),
|
198
203
|
(0, class_transformer_1.Type)(() => author_1.Author),
|
199
204
|
__metadata("design:type", author_1.Author)
|
200
205
|
], QuestionComment.prototype, "author", void 0);
|
206
|
+
__decorate([
|
207
|
+
(0, class_transformer_1.Expose)(),
|
208
|
+
__metadata("design:type", Question)
|
209
|
+
], QuestionComment.prototype, "question", void 0);
|
201
210
|
__decorate([
|
202
211
|
(0, class_transformer_1.Expose)(),
|
203
212
|
__metadata("design:type", String)
|
@@ -210,10 +219,20 @@ __decorate([
|
|
210
219
|
(0, class_transformer_1.Expose)(),
|
211
220
|
(0, class_transformer_1.Type)(() => log_1.Log),
|
212
221
|
__metadata("design:type", log_1.Log)
|
213
|
-
], QuestionComment.prototype, "
|
222
|
+
], QuestionComment.prototype, "published", void 0);
|
223
|
+
__decorate([
|
224
|
+
(0, class_transformer_1.Expose)(),
|
225
|
+
(0, class_transformer_1.Type)(() => log_1.Log),
|
226
|
+
__metadata("design:type", log_1.Log)
|
227
|
+
], QuestionComment.prototype, "statusChanged", void 0);
|
228
|
+
__decorate([
|
229
|
+
(0, class_transformer_1.Expose)(),
|
230
|
+
(0, class_transformer_1.Type)(() => log_1.Log),
|
231
|
+
__metadata("design:type", log_1.Log)
|
232
|
+
], QuestionComment.prototype, "created", void 0);
|
214
233
|
__decorate([
|
215
234
|
(0, class_transformer_1.Expose)(),
|
216
235
|
(0, class_transformer_1.Type)(() => log_1.Log),
|
217
236
|
__metadata("design:type", log_1.Log)
|
218
|
-
], QuestionComment.prototype, "
|
237
|
+
], QuestionComment.prototype, "updated", void 0);
|
219
238
|
//# sourceMappingURL=question.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"question.js","sourceRoot":"","sources":["../../src/models/question.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,yDAA4D;AAC5D,qCAAkC;AAClC,iCAA8B;AAC9B,yCAAsC;AACtC,oCAAsC;AACtC,qCAAkC;AAClC,+BAA4B;
|
1
|
+
{"version":3,"file":"question.js","sourceRoot":"","sources":["../../src/models/question.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,yDAA4D;AAC5D,qCAAkC;AAClC,iCAA8B;AAC9B,yCAAsC;AACtC,oCAAsC;AACtC,qCAAkC;AAClC,+BAA4B;AAG5B,MAAa,QAAQ;IAIpB,EAAE,CAAS;IAGX,IAAI,CAAS;IAKb,KAAK,CAAS;IAGd,QAAQ,CAAS;IAKjB,IAAI,CAAS;IAGb,KAAK,CAAS;IAGd,KAAK,CAAS;IAKd,MAAM,CAAa;IAInB,OAAO,CAAU;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/survey.d.ts
CHANGED
@@ -1,27 +1,26 @@
|
|
1
1
|
import { StatusType, StatusLabel } from '../enums';
|
2
|
-
import { Item } from './item';
|
3
2
|
import { Metric } from './metric';
|
4
3
|
import { Log } from './log';
|
5
4
|
export declare class Survey {
|
6
5
|
id: number;
|
6
|
+
slug: string;
|
7
7
|
name: string;
|
8
8
|
description: string;
|
9
9
|
imageUrl: string;
|
10
|
-
startDate: Date;
|
11
|
-
endDate: Date;
|
12
|
-
slug: string;
|
13
10
|
items: SurveyItem[];
|
14
|
-
isStarted: boolean;
|
15
11
|
status: StatusType;
|
16
12
|
label: StatusLabel;
|
13
|
+
startDate: Date;
|
14
|
+
endDate: Date;
|
15
|
+
isStarted: boolean;
|
17
16
|
metricSeen: Metric;
|
18
17
|
metricOpens: Metric;
|
19
18
|
metricQuestions: Metric;
|
20
19
|
metricUsers: Metric;
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
20
|
+
statusChanged: Log;
|
21
|
+
published: Log;
|
22
|
+
created: Log;
|
23
|
+
updated: Log;
|
25
24
|
constructor(props?: Partial<Survey>);
|
26
25
|
}
|
27
26
|
export declare class SurveyItem {
|
@@ -32,14 +31,13 @@ export declare class SurveyItem {
|
|
32
31
|
sort: number;
|
33
32
|
survey: Survey;
|
34
33
|
options: SurveyOption[];
|
35
|
-
metrics: Item[];
|
36
34
|
constructor(props?: Partial<SurveyItem>);
|
37
35
|
}
|
38
36
|
export declare class SurveyOption {
|
39
37
|
id: number;
|
40
38
|
content: string;
|
41
39
|
sort: number;
|
42
|
-
item: SurveyItem;
|
43
40
|
isSelected: boolean;
|
41
|
+
item: SurveyItem;
|
44
42
|
constructor(props?: Partial<SurveyOption>);
|
45
43
|
}
|
package/lib/models/survey.js
CHANGED
@@ -17,24 +17,24 @@ const metric_1 = require("./metric");
|
|
17
17
|
const log_1 = require("./log");
|
18
18
|
class Survey {
|
19
19
|
id;
|
20
|
+
slug;
|
20
21
|
name;
|
21
22
|
description;
|
22
23
|
imageUrl;
|
23
|
-
startDate;
|
24
|
-
endDate;
|
25
|
-
slug;
|
26
24
|
items;
|
27
|
-
isStarted;
|
28
25
|
status;
|
29
26
|
label;
|
27
|
+
startDate;
|
28
|
+
endDate;
|
29
|
+
isStarted;
|
30
30
|
metricSeen;
|
31
31
|
metricOpens;
|
32
32
|
metricQuestions;
|
33
33
|
metricUsers;
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
34
|
+
statusChanged;
|
35
|
+
published;
|
36
|
+
created;
|
37
|
+
updated;
|
38
38
|
constructor(props) {
|
39
39
|
Object.assign(this, props);
|
40
40
|
}
|
@@ -45,6 +45,10 @@ __decorate([
|
|
45
45
|
(0, class_transformer_1.Type)(() => Number),
|
46
46
|
__metadata("design:type", Number)
|
47
47
|
], Survey.prototype, "id", void 0);
|
48
|
+
__decorate([
|
49
|
+
(0, class_transformer_1.Expose)(),
|
50
|
+
__metadata("design:type", String)
|
51
|
+
], Survey.prototype, "slug", void 0);
|
48
52
|
__decorate([
|
49
53
|
(0, class_transformer_1.Expose)(),
|
50
54
|
__metadata("design:type", String)
|
@@ -57,6 +61,19 @@ __decorate([
|
|
57
61
|
(0, class_transformer_1.Expose)(),
|
58
62
|
__metadata("design:type", String)
|
59
63
|
], Survey.prototype, "imageUrl", void 0);
|
64
|
+
__decorate([
|
65
|
+
(0, class_transformer_1.Expose)(),
|
66
|
+
(0, class_transformer_1.Type)(() => SurveyItem),
|
67
|
+
__metadata("design:type", Array)
|
68
|
+
], Survey.prototype, "items", void 0);
|
69
|
+
__decorate([
|
70
|
+
(0, class_transformer_1.Expose)({ groups: ['admin'] }),
|
71
|
+
__metadata("design:type", String)
|
72
|
+
], Survey.prototype, "status", void 0);
|
73
|
+
__decorate([
|
74
|
+
(0, class_transformer_1.Expose)({ groups: ['admin'] }),
|
75
|
+
__metadata("design:type", String)
|
76
|
+
], Survey.prototype, "label", void 0);
|
60
77
|
__decorate([
|
61
78
|
(0, class_transformer_1.Expose)(),
|
62
79
|
(0, class_transformer_1.Type)(() => Date),
|
@@ -67,72 +84,51 @@ __decorate([
|
|
67
84
|
(0, class_transformer_1.Type)(() => Date),
|
68
85
|
__metadata("design:type", Date)
|
69
86
|
], Survey.prototype, "endDate", void 0);
|
70
|
-
__decorate([
|
71
|
-
(0, class_transformer_1.Expose)(),
|
72
|
-
__metadata("design:type", String)
|
73
|
-
], Survey.prototype, "slug", void 0);
|
74
|
-
__decorate([
|
75
|
-
(0, class_transformer_1.Expose)(),
|
76
|
-
(0, class_transformer_1.Type)(() => SurveyItem),
|
77
|
-
__metadata("design:type", Array)
|
78
|
-
], Survey.prototype, "items", void 0);
|
79
87
|
__decorate([
|
80
88
|
(0, class_transformer_1.Expose)(),
|
81
89
|
(0, class_transformer_1.Type)(() => Boolean),
|
82
90
|
__metadata("design:type", Boolean)
|
83
91
|
], Survey.prototype, "isStarted", void 0);
|
84
|
-
__decorate([
|
85
|
-
(0, class_transformer_1.Expose)({ groups: ['admin'] }),
|
86
|
-
__metadata("design:type", String)
|
87
|
-
], Survey.prototype, "status", void 0);
|
88
|
-
__decorate([
|
89
|
-
(0, class_transformer_1.Expose)({ groups: ['admin'] }),
|
90
|
-
__metadata("design:type", String)
|
91
|
-
], Survey.prototype, "label", void 0);
|
92
92
|
__decorate([
|
93
93
|
(0, class_transformer_1.Expose)(),
|
94
94
|
(0, class_transformer_1.Type)(() => metric_1.Metric),
|
95
|
-
(0, class_transformer_1.Transform)(({ obj }) => metric_1.Metric.seen(obj?.totalSeen, obj?.hasSeen)),
|
96
95
|
__metadata("design:type", metric_1.Metric)
|
97
96
|
], Survey.prototype, "metricSeen", void 0);
|
98
97
|
__decorate([
|
99
98
|
(0, class_transformer_1.Expose)(),
|
100
99
|
(0, class_transformer_1.Type)(() => item_1.Item),
|
101
|
-
(0, class_transformer_1.Transform)(({ obj }) => metric_1.Metric.total('totalClicks', obj?.totalClicks, ['fas', 'computer-mouse'])),
|
102
100
|
__metadata("design:type", metric_1.Metric)
|
103
101
|
], Survey.prototype, "metricOpens", void 0);
|
104
102
|
__decorate([
|
105
103
|
(0, class_transformer_1.Expose)({ groups: ['admin'] }),
|
106
104
|
(0, class_transformer_1.Type)(() => metric_1.Metric),
|
107
|
-
(0, class_transformer_1.Transform)(({ obj }) => metric_1.Metric.total('totalQuestion', obj?.totalPosts, ['fas', 'circle-question'])),
|
108
105
|
__metadata("design:type", metric_1.Metric)
|
109
106
|
], Survey.prototype, "metricQuestions", void 0);
|
110
107
|
__decorate([
|
111
108
|
(0, class_transformer_1.Expose)({ groups: ['admin'] }),
|
112
109
|
(0, class_transformer_1.Type)(() => metric_1.Metric),
|
113
|
-
(0, class_transformer_1.Transform)(({ obj }) => metric_1.Metric.total('totalusers', obj?.totalUsers, ['fas', 'users'])),
|
114
110
|
__metadata("design:type", metric_1.Metric)
|
115
111
|
], Survey.prototype, "metricUsers", void 0);
|
116
112
|
__decorate([
|
117
113
|
(0, class_transformer_1.Expose)({ groups: ['admin'] }),
|
118
114
|
(0, class_transformer_1.Type)(() => log_1.Log),
|
119
115
|
__metadata("design:type", log_1.Log)
|
120
|
-
], Survey.prototype, "
|
116
|
+
], Survey.prototype, "statusChanged", void 0);
|
121
117
|
__decorate([
|
122
|
-
(0, class_transformer_1.Expose)(
|
118
|
+
(0, class_transformer_1.Expose)(),
|
123
119
|
(0, class_transformer_1.Type)(() => log_1.Log),
|
124
120
|
__metadata("design:type", log_1.Log)
|
125
|
-
], Survey.prototype, "
|
121
|
+
], Survey.prototype, "published", void 0);
|
126
122
|
__decorate([
|
127
|
-
(0, class_transformer_1.Expose)(),
|
123
|
+
(0, class_transformer_1.Expose)({ groups: ['admin'] }),
|
128
124
|
(0, class_transformer_1.Type)(() => log_1.Log),
|
129
125
|
__metadata("design:type", log_1.Log)
|
130
|
-
], Survey.prototype, "
|
126
|
+
], Survey.prototype, "created", void 0);
|
131
127
|
__decorate([
|
132
128
|
(0, class_transformer_1.Expose)({ groups: ['admin'] }),
|
133
129
|
(0, class_transformer_1.Type)(() => log_1.Log),
|
134
130
|
__metadata("design:type", log_1.Log)
|
135
|
-
], Survey.prototype, "
|
131
|
+
], Survey.prototype, "updated", void 0);
|
136
132
|
class SurveyItem {
|
137
133
|
id;
|
138
134
|
question;
|
@@ -141,7 +137,6 @@ class SurveyItem {
|
|
141
137
|
sort;
|
142
138
|
survey;
|
143
139
|
options;
|
144
|
-
metrics;
|
145
140
|
constructor(props) {
|
146
141
|
Object.assign(this, props);
|
147
142
|
}
|
@@ -181,17 +176,12 @@ __decorate([
|
|
181
176
|
(0, class_transformer_1.Type)(() => SurveyOption),
|
182
177
|
__metadata("design:type", Array)
|
183
178
|
], SurveyItem.prototype, "options", void 0);
|
184
|
-
__decorate([
|
185
|
-
(0, class_transformer_1.Expose)(),
|
186
|
-
(0, class_transformer_1.Type)(() => item_1.Item),
|
187
|
-
__metadata("design:type", Array)
|
188
|
-
], SurveyItem.prototype, "metrics", void 0);
|
189
179
|
class SurveyOption {
|
190
180
|
id;
|
191
181
|
content;
|
192
182
|
sort;
|
193
|
-
item;
|
194
183
|
isSelected;
|
184
|
+
item;
|
195
185
|
constructor(props) {
|
196
186
|
Object.assign(this, props);
|
197
187
|
}
|
@@ -211,14 +201,14 @@ __decorate([
|
|
211
201
|
(0, class_transformer_1.Type)(() => Number),
|
212
202
|
__metadata("design:type", Number)
|
213
203
|
], SurveyOption.prototype, "sort", void 0);
|
214
|
-
__decorate([
|
215
|
-
(0, class_transformer_1.Expose)(),
|
216
|
-
(0, class_transformer_1.Type)(() => SurveyItem),
|
217
|
-
__metadata("design:type", SurveyItem)
|
218
|
-
], SurveyOption.prototype, "item", void 0);
|
219
204
|
__decorate([
|
220
205
|
(0, class_transformer_1.Expose)(),
|
221
206
|
(0, class_transformer_1.Type)(() => Boolean),
|
222
207
|
__metadata("design:type", Boolean)
|
223
208
|
], SurveyOption.prototype, "isSelected", void 0);
|
209
|
+
__decorate([
|
210
|
+
(0, class_transformer_1.Expose)(),
|
211
|
+
(0, class_transformer_1.Type)(() => SurveyItem),
|
212
|
+
__metadata("design:type", SurveyItem)
|
213
|
+
], SurveyOption.prototype, "item", void 0);
|
224
214
|
//# sourceMappingURL=survey.js.map
|
package/lib/models/survey.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"survey.js","sourceRoot":"","sources":["../../src/models/survey.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,
|
1
|
+
{"version":3,"file":"survey.js","sourceRoot":"","sources":["../../src/models/survey.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,yDAAiD;AACjD,oCAAmD;AACnD,iCAA8B;AAC9B,qCAAkC;AAClC,+BAA4B;AAG5B,MAAa,MAAM;IAIlB,EAAE,CAAS;IAGX,IAAI,CAAS;IAKb,IAAI,CAAS;IAGb,WAAW,CAAS;IAGpB,QAAQ,CAAS;IAIjB,KAAK,CAAe;IAKpB,MAAM,CAAa;IAGnB,KAAK,CAAc;IAInB,SAAS,CAAO;IAIhB,OAAO,CAAO;IAId,SAAS,CAAU;IAMnB,UAAU,CAAS;IAInB,WAAW,CAAS;IAIpB,eAAe,CAAS;IAIxB,WAAW,CAAS;IAMpB,aAAa,CAAM;IAInB,SAAS,CAAM;IAIf,OAAO,CAAM;IAIb,OAAO,CAAM;IAEb,YAAY,KAAuB;QAClC,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;IAC5B,CAAC;CACD;AAnFD,wBAmFC;AA/EA;IAFC,IAAA,0BAAM,EAAC,EAAE,MAAM,EAAE,CAAC,OAAO,CAAC,EAAE,CAAC;IAC7B,IAAA,wBAAI,EAAC,GAAG,EAAE,CAAC,MAAM,CAAC;;kCACR;AAGX;IADC,IAAA,0BAAM,GAAE;;oCACI;AAKb;IADC,IAAA,0BAAM,GAAE;;oCACI;AAGb;IADC,IAAA,0BAAM,GAAE;;2CACW;AAGpB;IADC,IAAA,0BAAM,GAAE;;wCACQ;AAIjB;IAFC,IAAA,0BAAM,GAAE;IACR,IAAA,w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AAE,CAAC,MAAM,CAAC;8BACX,MAAM;0CAAC;AAIf;IAFC,IAAA,0BAAM,GAAE;IACR,IAAA,wBAAI,EAAC,GAAG,EAAE,CAAC,YAAY,CAAC;;2CACD;AAQzB,MAAa,YAAY;IAIxB,EAAE,CAAS;IAKX,OAAO,CAAS;IAMhB,IAAI,CAAS;IAIb,UAAU,CAAU;IAMpB,IAAI,CAAa;IAEjB,YAAY,KAA6B;QACxC,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;IAC5B,CAAC;CACD;AA9BD,oCA8BC;AA1BA;IAFC,IAAA,0BAAM,EAAC,EAAE,MAAM,EAAE,CAAC,OAAO,CAAC,EAAE,CAAC;IAC7B,IAAA,wBAAI,EAAC,GAAG,EAAE,CAAC,MAAM,CAAC;;wCACR;AAKX;IADC,IAAA,0BAAM,GAAE;;6CACO;AAMhB;IAFC,IAAA,0BAAM,EAAC,EAAE,MAAM,EAAE,CAAC,OAAO,CAAC,EAAE,CAAC;IAC7B,IAAA,wBAAI,EAAC,GAAG,EAAE,CAAC,MAAM,CAAC;;0CACN;AAIb;IAFC,IAAA,0BAAM,GAAE;IACR,IAAA,wBAAI,EAAC,GAAG,EAAE,CAAC,OAAO,CAAC;;gDACA;AAMpB;IAFC,IAAA,0BAAM,GAAE;IACR,IAAA,wBAAI,EAAC,GAAG,EAAE,CAAC,UAAU,CAAC;8BACjB,UAAU;0CAAC"}
|
package/lib/models/topic.d.ts
CHANGED
@@ -10,8 +10,8 @@ export declare class Topic {
|
|
10
10
|
weight: number;
|
11
11
|
popularity: Item<number>;
|
12
12
|
metricPosts: Metric;
|
13
|
-
|
14
|
-
|
13
|
+
created: Log;
|
14
|
+
updated: Log;
|
15
15
|
constructor(props?: Partial<Topic>);
|
16
16
|
static toItemList(data: Topic[], key?: 'id' | 'slug'): Item<any>[];
|
17
17
|
}
|
package/lib/models/topic.js
CHANGED
@@ -12,9 +12,9 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
12
|
exports.Topic = void 0;
|
13
13
|
const class_transformer_1 = require("class-transformer");
|
14
14
|
const item_1 = require("./item");
|
15
|
-
const enums_1 = require("../enums");
|
16
15
|
const metric_1 = require("./metric");
|
17
16
|
const log_1 = require("./log");
|
17
|
+
const helpers_1 = require("../helpers");
|
18
18
|
class Topic {
|
19
19
|
id;
|
20
20
|
title;
|
@@ -24,8 +24,8 @@ class Topic {
|
|
24
24
|
weight;
|
25
25
|
popularity;
|
26
26
|
metricPosts;
|
27
|
-
|
28
|
-
|
27
|
+
created;
|
28
|
+
updated;
|
29
29
|
constructor(props) {
|
30
30
|
Object.assign(this, props);
|
31
31
|
}
|
@@ -69,57 +69,7 @@ __decorate([
|
|
69
69
|
__decorate([
|
70
70
|
(0, class_transformer_1.Expose)(),
|
71
71
|
(0, class_transformer_1.Type)(() => item_1.Item),
|
72
|
-
(0, class_transformer_1.Transform)(({ obj }) =>
|
73
|
-
if (!obj.weight) {
|
74
|
-
return new item_1.Item({
|
75
|
-
title: 'n/A',
|
76
|
-
value: 0,
|
77
|
-
context: enums_1.Context.Light
|
78
|
-
});
|
79
|
-
}
|
80
|
-
if (obj.weight < 1.9999) {
|
81
|
-
return new item_1.Item({
|
82
|
-
title: enums_1.Popularity.Poor,
|
83
|
-
value: obj.weight,
|
84
|
-
context: enums_1.Context.Secondary
|
85
|
-
});
|
86
|
-
}
|
87
|
-
if (obj.weight >= 2 && obj.weight < 3.9999) {
|
88
|
-
return new item_1.Item({
|
89
|
-
title: enums_1.Popularity.Week,
|
90
|
-
value: obj.weight,
|
91
|
-
context: enums_1.Context.Dark
|
92
|
-
});
|
93
|
-
}
|
94
|
-
if (obj.weight >= 4 && obj.weight < 5.9999) {
|
95
|
-
return new item_1.Item({
|
96
|
-
title: enums_1.Popularity.Fair,
|
97
|
-
value: obj.weight,
|
98
|
-
context: enums_1.Context.Primary
|
99
|
-
});
|
100
|
-
}
|
101
|
-
if (obj.weight >= 6 && obj.weight < 7.9999) {
|
102
|
-
return new item_1.Item({
|
103
|
-
title: enums_1.Popularity.Great,
|
104
|
-
value: obj.weight,
|
105
|
-
context: enums_1.Context.Info
|
106
|
-
});
|
107
|
-
}
|
108
|
-
if (obj.weight >= 8 && obj.weight < 8.9999) {
|
109
|
-
return new item_1.Item({
|
110
|
-
title: enums_1.Popularity.Excellent,
|
111
|
-
value: obj.weight,
|
112
|
-
context: enums_1.Context.Success
|
113
|
-
});
|
114
|
-
}
|
115
|
-
if (obj.weight >= 9 && obj.weight <= 10) {
|
116
|
-
return new item_1.Item({
|
117
|
-
title: enums_1.Popularity.Exceptional,
|
118
|
-
value: obj.weight,
|
119
|
-
context: enums_1.Context.Danger
|
120
|
-
});
|
121
|
-
}
|
122
|
-
}),
|
72
|
+
(0, class_transformer_1.Transform)(({ obj }) => (0, helpers_1.getPopularityByWeight)(obj.weight)),
|
123
73
|
__metadata("design:type", item_1.Item)
|
124
74
|
], Topic.prototype, "popularity", void 0);
|
125
75
|
__decorate([
|
@@ -131,10 +81,10 @@ __decorate([
|
|
131
81
|
(0, class_transformer_1.Expose)({ groups: ['admin'] }),
|
132
82
|
(0, class_transformer_1.Type)(() => log_1.Log),
|
133
83
|
__metadata("design:type", log_1.Log)
|
134
|
-
], Topic.prototype, "
|
84
|
+
], Topic.prototype, "created", void 0);
|
135
85
|
__decorate([
|
136
86
|
(0, class_transformer_1.Expose)({ groups: ['admin'] }),
|
137
87
|
(0, class_transformer_1.Type)(() => log_1.Log),
|
138
88
|
__metadata("design:type", log_1.Log)
|
139
|
-
], Topic.prototype, "
|
89
|
+
], Topic.prototype, "updated", void 0);
|
140
90
|
//# sourceMappingURL=topic.js.map
|
package/lib/models/topic.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"topic.js","sourceRoot":"","sources":["../../src/models/topic.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,yDAA4D;AAC5D,iCAA8B;AAC9B,
|
1
|
+
{"version":3,"file":"topic.js","sourceRoot":"","sources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