@intelact/bright 0.9.127 → 0.9.129
Sign up to get free protection for your applications and to get access to all the features.
- package/lib/brand/brand.model.d.ts +1 -0
- package/lib/brand/brand.model.js +6 -0
- package/lib/brand/brand.model.js.map +1 -1
- package/lib/feedback/feedback.model.d.ts +2 -0
- package/lib/feedback/feedback.model.js +9 -0
- package/lib/feedback/feedback.model.js.map +1 -1
- package/lib/publisher/publisher.model.d.ts +2 -0
- package/lib/publisher/publisher.model.js +9 -0
- package/lib/publisher/publisher.model.js.map +1 -1
- package/lib/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/lib/author/author.sort.d.ts +0 -7
- package/lib/author/author.sort.js +0 -12
- package/lib/author/author.sort.js.map +0 -1
- package/lib/common/browse.dto.d.ts +0 -9
- package/lib/common/browse.dto.js +0 -47
- package/lib/common/browse.dto.js.map +0 -1
- package/lib/dtos/asset.dto.d.ts +0 -14
- package/lib/dtos/asset.dto.js +0 -70
- package/lib/dtos/asset.dto.js.map +0 -1
- package/lib/dtos/auth.dto.d.ts +0 -39
- package/lib/dtos/auth.dto.js +0 -162
- package/lib/dtos/auth.dto.js.map +0 -1
- package/lib/dtos/author.dto.d.ts +0 -14
- package/lib/dtos/author.dto.js +0 -57
- package/lib/dtos/author.dto.js.map +0 -1
- package/lib/dtos/boost.dto.d.ts +0 -5
- package/lib/dtos/boost.dto.js +0 -38
- package/lib/dtos/boost.dto.js.map +0 -1
- package/lib/dtos/brand.dto.d.ts +0 -6
- package/lib/dtos/brand.dto.js +0 -41
- package/lib/dtos/brand.dto.js.map +0 -1
- package/lib/dtos/browse.dto.d.ts +0 -11
- package/lib/dtos/browse.dto.js +0 -55
- package/lib/dtos/browse.dto.js.map +0 -1
- package/lib/dtos/bulk.dto.d.ts +0 -3
- package/lib/dtos/bulk.dto.js +0 -22
- package/lib/dtos/bulk.dto.js.map +0 -1
- package/lib/dtos/category.dto.d.ts +0 -7
- package/lib/dtos/category.dto.js +0 -38
- package/lib/dtos/category.dto.js.map +0 -1
- package/lib/dtos/contact.dto.d.ts +0 -5
- package/lib/dtos/contact.dto.js +0 -35
- package/lib/dtos/contact.dto.js.map +0 -1
- package/lib/dtos/feedback.dto.d.ts +0 -9
- package/lib/dtos/feedback.dto.js +0 -47
- package/lib/dtos/feedback.dto.js.map +0 -1
- package/lib/dtos/general.dto.d.ts +0 -25
- package/lib/dtos/general.dto.js +0 -94
- package/lib/dtos/general.dto.js.map +0 -1
- package/lib/dtos/index.d.ts +0 -15
- package/lib/dtos/index.js +0 -32
- package/lib/dtos/index.js.map +0 -1
- package/lib/dtos/notification.d.ts +0 -4
- package/lib/dtos/notification.dto.d.ts +0 -4
- package/lib/dtos/notification.dto.js +0 -29
- package/lib/dtos/notification.dto.js.map +0 -1
- package/lib/dtos/notification.js +0 -29
- package/lib/dtos/notification.js.map +0 -1
- package/lib/dtos/post.dto.d.ts +0 -25
- package/lib/dtos/post.dto.js +0 -118
- package/lib/dtos/post.dto.js.map +0 -1
- package/lib/dtos/promotion.dto.d.ts +0 -5
- package/lib/dtos/promotion.dto.js +0 -38
- package/lib/dtos/promotion.dto.js.map +0 -1
- package/lib/dtos/publisher.dto.d.ts +0 -8
- package/lib/dtos/publisher.dto.js +0 -39
- package/lib/dtos/publisher.dto.js.map +0 -1
- package/lib/dtos/question.dto.d.ts +0 -15
- package/lib/dtos/question.dto.js +0 -86
- package/lib/dtos/question.dto.js.map +0 -1
- package/lib/dtos/search.dto.d.ts +0 -12
- package/lib/dtos/search.dto.js +0 -72
- package/lib/dtos/search.dto.js.map +0 -1
- package/lib/dtos/survey.dto.d.ts +0 -9
- package/lib/dtos/survey.dto.js +0 -54
- package/lib/dtos/survey.dto.js.map +0 -1
- package/lib/dtos/topic.dto.d.ts +0 -12
- package/lib/dtos/topic.dto.js +0 -50
- package/lib/dtos/topic.dto.js.map +0 -1
- package/lib/dtos/user.dto.d.ts +0 -24
- package/lib/dtos/user.dto.js +0 -99
- package/lib/dtos/user.dto.js.map +0 -1
- package/lib/enums/account.enum.d.ts +0 -11
- package/lib/enums/account.enum.js +0 -17
- package/lib/enums/account.enum.js.map +0 -1
- package/lib/enums/asset.enum.d.ts +0 -7
- package/lib/enums/asset.enum.js +0 -12
- package/lib/enums/asset.enum.js.map +0 -1
- package/lib/enums/color.enum.d.ts +0 -30
- package/lib/enums/color.enum.js +0 -37
- package/lib/enums/color.enum.js.map +0 -1
- package/lib/enums/feed.enum.d.ts +0 -5
- package/lib/enums/feed.enum.js +0 -10
- package/lib/enums/feed.enum.js.map +0 -1
- package/lib/enums/index.d.ts +0 -13
- package/lib/enums/index.js +0 -30
- package/lib/enums/index.js.map +0 -1
- package/lib/enums/module.enum.d.ts +0 -28
- package/lib/enums/module.enum.js +0 -34
- package/lib/enums/module.enum.js.map +0 -1
- package/lib/enums/notification.enum.d.ts +0 -12
- package/lib/enums/notification.enum.js +0 -18
- package/lib/enums/notification.enum.js.map +0 -1
- package/lib/enums/popularity.enum.d.ts +0 -8
- package/lib/enums/popularity.enum.js +0 -13
- package/lib/enums/popularity.enum.js.map +0 -1
- package/lib/enums/post.enum.d.ts +0 -8
- package/lib/enums/post.enum.js +0 -13
- package/lib/enums/post.enum.js.map +0 -1
- package/lib/enums/setting.enum.d.ts +0 -10
- package/lib/enums/setting.enum.js +0 -15
- package/lib/enums/setting.enum.js.map +0 -1
- package/lib/enums/social.enum.d.ts +0 -14
- package/lib/enums/social.enum.js +0 -20
- package/lib/enums/social.enum.js.map +0 -1
- package/lib/enums/sort.enum.d.ts +0 -21
- package/lib/enums/sort.enum.js +0 -28
- package/lib/enums/sort.enum.js.map +0 -1
- package/lib/enums/status.enum.d.ts +0 -13
- package/lib/enums/status.enum.js +0 -19
- package/lib/enums/status.enum.js.map +0 -1
- package/lib/enums/survey.enum.d.ts +0 -6
- package/lib/enums/survey.enum.js +0 -11
- package/lib/enums/survey.enum.js.map +0 -1
- package/lib/enums/tracks.enum.d.ts +0 -38
- package/lib/enums/tracks.enum.js +0 -46
- package/lib/enums/tracks.enum.js.map +0 -1
- package/lib/enums/verification.enum.d.ts +0 -5
- package/lib/enums/verification.enum.js +0 -10
- package/lib/enums/verification.enum.js.map +0 -1
- package/lib/helpers/index.d.ts +0 -2
- package/lib/helpers/index.js +0 -19
- package/lib/helpers/index.js.map +0 -1
- package/lib/helpers/popularity.helper.d.ts +0 -2
- package/lib/helpers/popularity.helper.js +0 -58
- package/lib/helpers/popularity.helper.js.map +0 -1
- package/lib/helpers/post.helper.d.ts +0 -2
- package/lib/helpers/post.helper.js +0 -22
- package/lib/helpers/post.helper.js.map +0 -1
- package/lib/metric/metric.interface.d.ts +0 -11
- package/lib/metric/metric.interface.js +0 -3
- package/lib/metric/metric.interface.js.map +0 -1
- package/lib/models/asset.d.ts +0 -10
- package/lib/models/asset.js +0 -54
- package/lib/models/asset.js.map +0 -1
- package/lib/models/author.d.ts +0 -16
- package/lib/models/author.js +0 -83
- package/lib/models/author.js.map +0 -1
- package/lib/models/boost.d.ts +0 -14
- package/lib/models/boost.js +0 -73
- package/lib/models/boost.js.map +0 -1
- package/lib/models/brand.d.ts +0 -38
- package/lib/models/brand.js +0 -241
- package/lib/models/brand.js.map +0 -1
- package/lib/models/category.d.ts +0 -13
- package/lib/models/category.js +0 -69
- package/lib/models/category.js.map +0 -1
- package/lib/models/collection.d.ts +0 -14
- package/lib/models/collection.js +0 -65
- package/lib/models/collection.js.map +0 -1
- package/lib/models/feedback.d.ts +0 -38
- package/lib/models/feedback.js +0 -157
- package/lib/models/feedback.js.map +0 -1
- package/lib/models/gallery.d.ts +0 -6
- package/lib/models/gallery.js +0 -36
- package/lib/models/gallery.js.map +0 -1
- package/lib/models/index.d.ts +0 -23
- package/lib/models/index.js +0 -40
- package/lib/models/index.js.map +0 -1
- package/lib/models/item.d.ts +0 -14
- package/lib/models/item.js +0 -37
- package/lib/models/item.js.map +0 -1
- package/lib/models/link.d.ts +0 -16
- package/lib/models/link.js +0 -35
- package/lib/models/link.js.map +0 -1
- package/lib/models/log.d.ts +0 -11
- package/lib/models/log.js +0 -16
- package/lib/models/log.js.map +0 -1
- package/lib/models/metric.d.ts +0 -20
- package/lib/models/metric.js +0 -186
- package/lib/models/metric.js.map +0 -1
- package/lib/models/notification.d.ts +0 -14
- package/lib/models/notification.js +0 -64
- package/lib/models/notification.js.map +0 -1
- package/lib/models/pagination.d.ts +0 -17
- package/lib/models/pagination.js +0 -3
- package/lib/models/pagination.js.map +0 -1
- package/lib/models/post.d.ts +0 -88
- package/lib/models/post.js +0 -466
- package/lib/models/post.js.map +0 -1
- package/lib/models/promotion.d.ts +0 -21
- package/lib/models/promotion.js +0 -108
- package/lib/models/promotion.js.map +0 -1
- package/lib/models/publisher.d.ts +0 -25
- package/lib/models/publisher.js +0 -118
- package/lib/models/publisher.js.map +0 -1
- package/lib/models/question.d.ts +0 -47
- package/lib/models/question.js +0 -238
- package/lib/models/question.js.map +0 -1
- package/lib/models/quote.d.ts +0 -5
- package/lib/models/quote.js +0 -31
- package/lib/models/quote.js.map +0 -1
- package/lib/models/response.d.ts +0 -6
- package/lib/models/response.js +0 -3
- package/lib/models/response.js.map +0 -1
- package/lib/models/share.d.ts +0 -6
- package/lib/models/share.js +0 -3
- package/lib/models/share.js.map +0 -1
- package/lib/models/survey.d.ts +0 -43
- package/lib/models/survey.js +0 -214
- package/lib/models/survey.js.map +0 -1
- package/lib/models/token.d.ts +0 -7
- package/lib/models/token.js +0 -3
- package/lib/models/token.js.map +0 -1
- package/lib/models/topic.d.ts +0 -17
- package/lib/models/topic.js +0 -90
- package/lib/models/topic.js.map +0 -1
- package/lib/models/user.d.ts +0 -49
- package/lib/models/user.js +0 -258
- package/lib/models/user.js.map +0 -1
- package/lib/survey/survey.event.d.ts +0 -5
- package/lib/survey/survey.event.js +0 -10
- package/lib/survey/survey.event.js.map +0 -1
package/lib/models/survey.js
DELETED
@@ -1,214 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
3
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
4
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
5
|
-
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
6
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
7
|
-
};
|
8
|
-
var __metadata = (this && this.__metadata) || function (k, v) {
|
9
|
-
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
10
|
-
};
|
11
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
12
|
-
exports.SurveyOption = exports.SurveyItem = exports.Survey = void 0;
|
13
|
-
const class_transformer_1 = require("class-transformer");
|
14
|
-
const enums_1 = require("../enums");
|
15
|
-
const item_1 = require("./item");
|
16
|
-
const metric_1 = require("./metric");
|
17
|
-
const log_1 = require("./log");
|
18
|
-
class Survey {
|
19
|
-
id;
|
20
|
-
slug;
|
21
|
-
name;
|
22
|
-
description;
|
23
|
-
imageUrl;
|
24
|
-
items;
|
25
|
-
status;
|
26
|
-
label;
|
27
|
-
startDate;
|
28
|
-
endDate;
|
29
|
-
isStarted;
|
30
|
-
metricSeen;
|
31
|
-
metricOpens;
|
32
|
-
metricQuestions;
|
33
|
-
metricUsers;
|
34
|
-
statusChanged;
|
35
|
-
published;
|
36
|
-
created;
|
37
|
-
updated;
|
38
|
-
constructor(props) {
|
39
|
-
Object.assign(this, props);
|
40
|
-
}
|
41
|
-
}
|
42
|
-
exports.Survey = Survey;
|
43
|
-
__decorate([
|
44
|
-
(0, class_transformer_1.Expose)({ groups: ['admin'] }),
|
45
|
-
(0, class_transformer_1.Type)(() => Number),
|
46
|
-
__metadata("design:type", Number)
|
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);
|
52
|
-
__decorate([
|
53
|
-
(0, class_transformer_1.Expose)(),
|
54
|
-
__metadata("design:type", String)
|
55
|
-
], Survey.prototype, "name", void 0);
|
56
|
-
__decorate([
|
57
|
-
(0, class_transformer_1.Expose)(),
|
58
|
-
__metadata("design:type", String)
|
59
|
-
], Survey.prototype, "description", void 0);
|
60
|
-
__decorate([
|
61
|
-
(0, class_transformer_1.Expose)(),
|
62
|
-
__metadata("design:type", String)
|
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);
|
77
|
-
__decorate([
|
78
|
-
(0, class_transformer_1.Expose)(),
|
79
|
-
(0, class_transformer_1.Type)(() => Date),
|
80
|
-
__metadata("design:type", Date)
|
81
|
-
], Survey.prototype, "startDate", void 0);
|
82
|
-
__decorate([
|
83
|
-
(0, class_transformer_1.Expose)(),
|
84
|
-
(0, class_transformer_1.Type)(() => Date),
|
85
|
-
__metadata("design:type", Date)
|
86
|
-
], Survey.prototype, "endDate", void 0);
|
87
|
-
__decorate([
|
88
|
-
(0, class_transformer_1.Expose)(),
|
89
|
-
(0, class_transformer_1.Type)(() => Boolean),
|
90
|
-
__metadata("design:type", Boolean)
|
91
|
-
], Survey.prototype, "isStarted", void 0);
|
92
|
-
__decorate([
|
93
|
-
(0, class_transformer_1.Expose)(),
|
94
|
-
(0, class_transformer_1.Type)(() => metric_1.Metric),
|
95
|
-
__metadata("design:type", metric_1.Metric)
|
96
|
-
], Survey.prototype, "metricSeen", void 0);
|
97
|
-
__decorate([
|
98
|
-
(0, class_transformer_1.Expose)(),
|
99
|
-
(0, class_transformer_1.Type)(() => item_1.Item),
|
100
|
-
__metadata("design:type", metric_1.Metric)
|
101
|
-
], Survey.prototype, "metricOpens", void 0);
|
102
|
-
__decorate([
|
103
|
-
(0, class_transformer_1.Expose)({ groups: ['admin'] }),
|
104
|
-
(0, class_transformer_1.Type)(() => metric_1.Metric),
|
105
|
-
__metadata("design:type", metric_1.Metric)
|
106
|
-
], Survey.prototype, "metricQuestions", void 0);
|
107
|
-
__decorate([
|
108
|
-
(0, class_transformer_1.Expose)({ groups: ['admin'] }),
|
109
|
-
(0, class_transformer_1.Type)(() => metric_1.Metric),
|
110
|
-
__metadata("design:type", metric_1.Metric)
|
111
|
-
], Survey.prototype, "metricUsers", void 0);
|
112
|
-
__decorate([
|
113
|
-
(0, class_transformer_1.Expose)({ groups: ['admin'] }),
|
114
|
-
(0, class_transformer_1.Type)(() => log_1.Log),
|
115
|
-
__metadata("design:type", log_1.Log)
|
116
|
-
], Survey.prototype, "statusChanged", void 0);
|
117
|
-
__decorate([
|
118
|
-
(0, class_transformer_1.Expose)(),
|
119
|
-
(0, class_transformer_1.Type)(() => log_1.Log),
|
120
|
-
__metadata("design:type", log_1.Log)
|
121
|
-
], Survey.prototype, "published", void 0);
|
122
|
-
__decorate([
|
123
|
-
(0, class_transformer_1.Expose)({ groups: ['admin'] }),
|
124
|
-
(0, class_transformer_1.Type)(() => log_1.Log),
|
125
|
-
__metadata("design:type", log_1.Log)
|
126
|
-
], Survey.prototype, "created", void 0);
|
127
|
-
__decorate([
|
128
|
-
(0, class_transformer_1.Expose)({ groups: ['admin'] }),
|
129
|
-
(0, class_transformer_1.Type)(() => log_1.Log),
|
130
|
-
__metadata("design:type", log_1.Log)
|
131
|
-
], Survey.prototype, "updated", void 0);
|
132
|
-
class SurveyItem {
|
133
|
-
id;
|
134
|
-
question;
|
135
|
-
multiple;
|
136
|
-
readonly;
|
137
|
-
sort;
|
138
|
-
survey;
|
139
|
-
options;
|
140
|
-
constructor(props) {
|
141
|
-
Object.assign(this, props);
|
142
|
-
}
|
143
|
-
}
|
144
|
-
exports.SurveyItem = SurveyItem;
|
145
|
-
__decorate([
|
146
|
-
(0, class_transformer_1.Expose)({ groups: ['admin'] }),
|
147
|
-
(0, class_transformer_1.Type)(() => Number),
|
148
|
-
__metadata("design:type", Number)
|
149
|
-
], SurveyItem.prototype, "id", void 0);
|
150
|
-
__decorate([
|
151
|
-
(0, class_transformer_1.Expose)(),
|
152
|
-
__metadata("design:type", String)
|
153
|
-
], SurveyItem.prototype, "question", void 0);
|
154
|
-
__decorate([
|
155
|
-
(0, class_transformer_1.Expose)(),
|
156
|
-
(0, class_transformer_1.Type)(() => Boolean),
|
157
|
-
__metadata("design:type", Boolean)
|
158
|
-
], SurveyItem.prototype, "multiple", void 0);
|
159
|
-
__decorate([
|
160
|
-
(0, class_transformer_1.Expose)(),
|
161
|
-
(0, class_transformer_1.Type)(() => Boolean),
|
162
|
-
__metadata("design:type", Boolean)
|
163
|
-
], SurveyItem.prototype, "readonly", void 0);
|
164
|
-
__decorate([
|
165
|
-
(0, class_transformer_1.Expose)({ groups: ['admin'] }),
|
166
|
-
(0, class_transformer_1.Type)(() => Number),
|
167
|
-
__metadata("design:type", Number)
|
168
|
-
], SurveyItem.prototype, "sort", void 0);
|
169
|
-
__decorate([
|
170
|
-
(0, class_transformer_1.Expose)(),
|
171
|
-
(0, class_transformer_1.Type)(() => Survey),
|
172
|
-
__metadata("design:type", Survey)
|
173
|
-
], SurveyItem.prototype, "survey", void 0);
|
174
|
-
__decorate([
|
175
|
-
(0, class_transformer_1.Expose)(),
|
176
|
-
(0, class_transformer_1.Type)(() => SurveyOption),
|
177
|
-
__metadata("design:type", Array)
|
178
|
-
], SurveyItem.prototype, "options", void 0);
|
179
|
-
class SurveyOption {
|
180
|
-
id;
|
181
|
-
content;
|
182
|
-
sort;
|
183
|
-
isSelected;
|
184
|
-
item;
|
185
|
-
constructor(props) {
|
186
|
-
Object.assign(this, props);
|
187
|
-
}
|
188
|
-
}
|
189
|
-
exports.SurveyOption = SurveyOption;
|
190
|
-
__decorate([
|
191
|
-
(0, class_transformer_1.Expose)({ groups: ['admin'] }),
|
192
|
-
(0, class_transformer_1.Type)(() => Number),
|
193
|
-
__metadata("design:type", Number)
|
194
|
-
], SurveyOption.prototype, "id", void 0);
|
195
|
-
__decorate([
|
196
|
-
(0, class_transformer_1.Expose)(),
|
197
|
-
__metadata("design:type", String)
|
198
|
-
], SurveyOption.prototype, "content", void 0);
|
199
|
-
__decorate([
|
200
|
-
(0, class_transformer_1.Expose)({ groups: ['admin'] }),
|
201
|
-
(0, class_transformer_1.Type)(() => Number),
|
202
|
-
__metadata("design:type", Number)
|
203
|
-
], SurveyOption.prototype, "sort", void 0);
|
204
|
-
__decorate([
|
205
|
-
(0, class_transformer_1.Expose)(),
|
206
|
-
(0, class_transformer_1.Type)(() => Boolean),
|
207
|
-
__metadata("design:type", Boolean)
|
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);
|
214
|
-
//# sourceMappingURL=survey.js.map
|
package/lib/models/survey.js.map
DELETED
@@ -1 +0,0 @@
|
|
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,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BAAM,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/token.d.ts
DELETED
package/lib/models/token.js
DELETED
package/lib/models/token.js.map
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"token.js","sourceRoot":"","sources":["../../src/models/token.ts"],"names":[],"mappings":""}
|
package/lib/models/topic.d.ts
DELETED
@@ -1,17 +0,0 @@
|
|
1
|
-
import { Item } from "./item";
|
2
|
-
import { Metric } from "./metric";
|
3
|
-
import { Log } from "./log";
|
4
|
-
export declare class Topic {
|
5
|
-
id: number;
|
6
|
-
title: string;
|
7
|
-
hash: string;
|
8
|
-
description: string;
|
9
|
-
sort: number;
|
10
|
-
weight: number;
|
11
|
-
popularity: Item<number>;
|
12
|
-
metricPosts: Metric;
|
13
|
-
created: Log;
|
14
|
-
updated: Log;
|
15
|
-
constructor(props?: Partial<Topic>);
|
16
|
-
static toItemList(data: Topic[], key?: 'id' | 'slug'): Item<any>[];
|
17
|
-
}
|
package/lib/models/topic.js
DELETED
@@ -1,90 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
3
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
4
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
5
|
-
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
6
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
7
|
-
};
|
8
|
-
var __metadata = (this && this.__metadata) || function (k, v) {
|
9
|
-
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
10
|
-
};
|
11
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
12
|
-
exports.Topic = void 0;
|
13
|
-
const class_transformer_1 = require("class-transformer");
|
14
|
-
const item_1 = require("./item");
|
15
|
-
const metric_1 = require("./metric");
|
16
|
-
const log_1 = require("./log");
|
17
|
-
const helpers_1 = require("../helpers");
|
18
|
-
class Topic {
|
19
|
-
id;
|
20
|
-
title;
|
21
|
-
hash;
|
22
|
-
description;
|
23
|
-
sort;
|
24
|
-
weight;
|
25
|
-
popularity;
|
26
|
-
metricPosts;
|
27
|
-
created;
|
28
|
-
updated;
|
29
|
-
constructor(props) {
|
30
|
-
Object.assign(this, props);
|
31
|
-
}
|
32
|
-
static toItemList(data, key = 'id') {
|
33
|
-
if (!data || data.length === 0)
|
34
|
-
return [];
|
35
|
-
return data.map(i => new item_1.Item({
|
36
|
-
title: i.title,
|
37
|
-
value: i[key]
|
38
|
-
}));
|
39
|
-
}
|
40
|
-
}
|
41
|
-
exports.Topic = Topic;
|
42
|
-
__decorate([
|
43
|
-
(0, class_transformer_1.Expose)({ groups: ['admin'] }),
|
44
|
-
(0, class_transformer_1.Type)(() => Number),
|
45
|
-
__metadata("design:type", Number)
|
46
|
-
], Topic.prototype, "id", void 0);
|
47
|
-
__decorate([
|
48
|
-
(0, class_transformer_1.Expose)(),
|
49
|
-
__metadata("design:type", String)
|
50
|
-
], Topic.prototype, "title", void 0);
|
51
|
-
__decorate([
|
52
|
-
(0, class_transformer_1.Expose)(),
|
53
|
-
__metadata("design:type", String)
|
54
|
-
], Topic.prototype, "hash", void 0);
|
55
|
-
__decorate([
|
56
|
-
(0, class_transformer_1.Expose)(),
|
57
|
-
__metadata("design:type", String)
|
58
|
-
], Topic.prototype, "description", void 0);
|
59
|
-
__decorate([
|
60
|
-
(0, class_transformer_1.Expose)({ groups: ['admin'] }),
|
61
|
-
(0, class_transformer_1.Type)(() => Number),
|
62
|
-
__metadata("design:type", Number)
|
63
|
-
], Topic.prototype, "sort", void 0);
|
64
|
-
__decorate([
|
65
|
-
(0, class_transformer_1.Expose)({ groups: ['admin'] }),
|
66
|
-
(0, class_transformer_1.Type)(() => Number),
|
67
|
-
__metadata("design:type", Number)
|
68
|
-
], Topic.prototype, "weight", void 0);
|
69
|
-
__decorate([
|
70
|
-
(0, class_transformer_1.Expose)(),
|
71
|
-
(0, class_transformer_1.Type)(() => item_1.Item),
|
72
|
-
(0, class_transformer_1.Transform)(({ obj }) => (0, helpers_1.getPopularityByWeight)(obj.weight)),
|
73
|
-
__metadata("design:type", item_1.Item)
|
74
|
-
], Topic.prototype, "popularity", void 0);
|
75
|
-
__decorate([
|
76
|
-
(0, class_transformer_1.Type)(() => metric_1.Metric),
|
77
|
-
(0, class_transformer_1.Transform)(({ obj }) => metric_1.Metric.total('totalPosts', obj.totalPosts, ['fas', 'book-open'])),
|
78
|
-
__metadata("design:type", metric_1.Metric)
|
79
|
-
], Topic.prototype, "metricPosts", void 0);
|
80
|
-
__decorate([
|
81
|
-
(0, class_transformer_1.Expose)({ groups: ['admin'] }),
|
82
|
-
(0, class_transformer_1.Type)(() => log_1.Log),
|
83
|
-
__metadata("design:type", log_1.Log)
|
84
|
-
], Topic.prototype, "created", void 0);
|
85
|
-
__decorate([
|
86
|
-
(0, class_transformer_1.Expose)({ groups: ['admin'] }),
|
87
|
-
(0, class_transformer_1.Type)(() => log_1.Log),
|
88
|
-
__metadata("design:type", log_1.Log)
|
89
|
-
], Topic.prototype, "updated", void 0);
|
90
|
-
//# sourceMappingURL=topic.js.map
|
package/lib/models/topic.js.map
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"topic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,CAAC,OAAO,CAAC,EAAE,CAAC;IAC7B,IAAA,wBAAI,EAAC,GAAG,EAAE,CAAC,MAAM,CAAC;;qCACJ;AAKf;IAHC,IAAA,0BAAM,GAAE;IACR,IAAA,wBAAI,EAAC,GAAG,EAAE,CAAC,WAAI,CAAC;IAChB,IAAA,6BAAS,EAAC,CAAC,EAAE,GAAG,EAAE,EAAE,EAAE,CAAC,IAAA,+BAAqB,EAAC,GAAG,CAAC,MAAM,CAAC,CAAC;8BAC9C,WAAI;yCAAS;AAUzB;IANC,IAAA,wBAAI,EAAC,GAAG,EAAE,CAAC,eAAM,CAAC;IAClB,IAAA,6BAAS,EAAC,CAAC,EAAE,GAAG,EAAE,EAAE,EAAE,CAAC,eAAM,CAAC,KAAK,CACnC,YAAY,EACZ,GAAG,CAAC,UAAU,EACd,CAAC,KAAK,EAAE,WAAW,CAAC,CACpB,CAAC;8BACW,eAAM;0CAAC;AAMpB;IAFC,IAAA,0BAAM,EAAC,EAAE,MAAM,EAAE,CAAC,OAAO,CAAC,EAAE,CAAC;IAC7B,IAAA,wBAAI,EAAC,GAAG,EAAE,CAAC,SAAG,CAAC;8BACP,SAAG;sCAAC;AAIb;IAFC,IAAA,0BAAM,EAAC,EAAE,MAAM,EAAE,CAAC,OAAO,CAAC,EAAE,CAAC;IAC7B,IAAA,wBAAI,EAAC,GAAG,EAAE,CAAC,SAAG,CAAC;8BACP,SAAG;sCAAC"}
|
package/lib/models/user.d.ts
DELETED
@@ -1,49 +0,0 @@
|
|
1
|
-
import { SocialLoginType } from '../enums';
|
2
|
-
import { AccountStatusType, AccountType } from '../enums';
|
3
|
-
import { Permission, Role } from '../security';
|
4
|
-
import { Brand } from './brand';
|
5
|
-
import { Publisher } from './publisher';
|
6
|
-
export declare class User {
|
7
|
-
id: number;
|
8
|
-
uid: string;
|
9
|
-
name: string;
|
10
|
-
email: string;
|
11
|
-
phone: string;
|
12
|
-
image: string;
|
13
|
-
status: AccountStatusType;
|
14
|
-
accountType: AccountType;
|
15
|
-
provider: SocialLoginType;
|
16
|
-
isBrand: boolean;
|
17
|
-
isPublisher: boolean;
|
18
|
-
roles: Role[];
|
19
|
-
permissions: Permission[];
|
20
|
-
selectedPublisher: Publisher;
|
21
|
-
accessPublishers: Publisher[];
|
22
|
-
brand: Brand;
|
23
|
-
publisher: Publisher;
|
24
|
-
constructor(props?: Partial<User>);
|
25
|
-
isActive(): boolean;
|
26
|
-
hasRole(role: Role): boolean;
|
27
|
-
hasRoles(roles: Role[]): boolean;
|
28
|
-
hasPermission(permission: Permission): boolean;
|
29
|
-
hasPermissions(permissions: Permission[]): boolean;
|
30
|
-
isBrandUser(): boolean;
|
31
|
-
belongsToBrand(brandId: number): boolean;
|
32
|
-
isPublisherUser(): boolean;
|
33
|
-
belongsToPublisher(publisherId: number): boolean;
|
34
|
-
getPublisher(): Publisher;
|
35
|
-
hasBrandAuthorization(brandId: number): boolean;
|
36
|
-
hasPublisherAuthorization(publisherId: number): boolean;
|
37
|
-
hasPublisherAccess(publisherId: number): boolean;
|
38
|
-
}
|
39
|
-
export interface IUserAgent {
|
40
|
-
origin: string;
|
41
|
-
address: string;
|
42
|
-
model: string;
|
43
|
-
brand: string;
|
44
|
-
os: string;
|
45
|
-
osVersion: string;
|
46
|
-
appVersion: string;
|
47
|
-
language: string;
|
48
|
-
description: string;
|
49
|
-
}
|
package/lib/models/user.js
DELETED
@@ -1,258 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
3
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
4
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
5
|
-
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
6
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
7
|
-
};
|
8
|
-
var __metadata = (this && this.__metadata) || function (k, v) {
|
9
|
-
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
10
|
-
};
|
11
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
12
|
-
exports.User = void 0;
|
13
|
-
const class_transformer_1 = require("class-transformer");
|
14
|
-
const enums_1 = require("../enums");
|
15
|
-
const enums_2 = require("../enums");
|
16
|
-
const security_1 = require("../security");
|
17
|
-
const brand_1 = require("./brand");
|
18
|
-
const publisher_1 = require("./publisher");
|
19
|
-
class User {
|
20
|
-
id;
|
21
|
-
uid;
|
22
|
-
name;
|
23
|
-
email;
|
24
|
-
phone;
|
25
|
-
image;
|
26
|
-
status;
|
27
|
-
accountType;
|
28
|
-
provider;
|
29
|
-
isBrand;
|
30
|
-
isPublisher;
|
31
|
-
roles;
|
32
|
-
permissions;
|
33
|
-
selectedPublisher;
|
34
|
-
accessPublishers;
|
35
|
-
brand;
|
36
|
-
publisher;
|
37
|
-
constructor(props) {
|
38
|
-
Object.assign(this, props);
|
39
|
-
}
|
40
|
-
isActive() {
|
41
|
-
return this.status === enums_2.AccountStatusType.Active;
|
42
|
-
}
|
43
|
-
hasRole(role) {
|
44
|
-
return this?.roles.indexOf(role) > -1 ? true : false;
|
45
|
-
}
|
46
|
-
hasRoles(roles) {
|
47
|
-
return this.roles.some(role => roles.includes(role));
|
48
|
-
}
|
49
|
-
hasPermission(permission) {
|
50
|
-
if (!this.roles) {
|
51
|
-
return false;
|
52
|
-
}
|
53
|
-
if (!this.permissions) {
|
54
|
-
let permissions = [];
|
55
|
-
for (const role of this.roles) {
|
56
|
-
if (security_1.ACL[role]) {
|
57
|
-
permissions = [...permissions, ...security_1.ACL[role]];
|
58
|
-
}
|
59
|
-
}
|
60
|
-
this.permissions = Array.from(new Set(permissions));
|
61
|
-
}
|
62
|
-
return this.permissions.indexOf(permission) > -1 ? true : false;
|
63
|
-
}
|
64
|
-
hasPermissions(permissions) {
|
65
|
-
for (const permission of permissions) {
|
66
|
-
if (this.hasPermission(permission)) {
|
67
|
-
return true;
|
68
|
-
}
|
69
|
-
}
|
70
|
-
return false;
|
71
|
-
}
|
72
|
-
isBrandUser() {
|
73
|
-
return this.publisher ? false : true;
|
74
|
-
}
|
75
|
-
belongsToBrand(brandId) {
|
76
|
-
return this.brand?.id === brandId;
|
77
|
-
}
|
78
|
-
isPublisherUser() {
|
79
|
-
return this.publisher ? true : false;
|
80
|
-
}
|
81
|
-
belongsToPublisher(publisherId) {
|
82
|
-
return this.publisher?.id === publisherId;
|
83
|
-
}
|
84
|
-
getPublisher() {
|
85
|
-
return this.isBrandUser() ? this.selectedPublisher : this.publisher;
|
86
|
-
}
|
87
|
-
hasBrandAuthorization(brandId) {
|
88
|
-
return this.belongsToBrand(brandId) && this.isBrandUser();
|
89
|
-
}
|
90
|
-
hasPublisherAuthorization(publisherId) {
|
91
|
-
return this.belongsToPublisher(publisherId) && this.isPublisherUser();
|
92
|
-
}
|
93
|
-
hasPublisherAccess(publisherId) {
|
94
|
-
const accessPublishers = this.accessPublishers?.map(i => i.id) || [];
|
95
|
-
if (this.publisher) {
|
96
|
-
accessPublishers.push(this.publisher.id);
|
97
|
-
}
|
98
|
-
if (this.selectedPublisher) {
|
99
|
-
accessPublishers.push(this.selectedPublisher.id);
|
100
|
-
}
|
101
|
-
return accessPublishers.indexOf(publisherId) > -1 ? true : false;
|
102
|
-
}
|
103
|
-
}
|
104
|
-
exports.User = User;
|
105
|
-
__decorate([
|
106
|
-
(0, class_transformer_1.Expose)({ groups: ['admin'] }),
|
107
|
-
(0, class_transformer_1.Type)(() => Number),
|
108
|
-
__metadata("design:type", Number)
|
109
|
-
], User.prototype, "id", void 0);
|
110
|
-
__decorate([
|
111
|
-
(0, class_transformer_1.Expose)(),
|
112
|
-
__metadata("design:type", String)
|
113
|
-
], User.prototype, "uid", void 0);
|
114
|
-
__decorate([
|
115
|
-
(0, class_transformer_1.Expose)(),
|
116
|
-
__metadata("design:type", String)
|
117
|
-
], User.prototype, "name", void 0);
|
118
|
-
__decorate([
|
119
|
-
(0, class_transformer_1.Expose)(),
|
120
|
-
__metadata("design:type", String)
|
121
|
-
], User.prototype, "email", void 0);
|
122
|
-
__decorate([
|
123
|
-
(0, class_transformer_1.Expose)(),
|
124
|
-
__metadata("design:type", String)
|
125
|
-
], User.prototype, "phone", void 0);
|
126
|
-
__decorate([
|
127
|
-
(0, class_transformer_1.Expose)(),
|
128
|
-
__metadata("design:type", String)
|
129
|
-
], User.prototype, "image", void 0);
|
130
|
-
__decorate([
|
131
|
-
(0, class_transformer_1.Expose)({ groups: ['admin'] }),
|
132
|
-
__metadata("design:type", String)
|
133
|
-
], User.prototype, "status", void 0);
|
134
|
-
__decorate([
|
135
|
-
(0, class_transformer_1.Expose)({ groups: ['admin'] }),
|
136
|
-
__metadata("design:type", String)
|
137
|
-
], User.prototype, "accountType", void 0);
|
138
|
-
__decorate([
|
139
|
-
(0, class_transformer_1.Expose)(),
|
140
|
-
__metadata("design:type", String)
|
141
|
-
], User.prototype, "provider", void 0);
|
142
|
-
__decorate([
|
143
|
-
(0, class_transformer_1.Expose)({ groups: ['admin'] }),
|
144
|
-
(0, class_transformer_1.Type)(() => Boolean),
|
145
|
-
__metadata("design:type", Boolean)
|
146
|
-
], User.prototype, "isBrand", void 0);
|
147
|
-
__decorate([
|
148
|
-
(0, class_transformer_1.Expose)({ groups: ['admin'] }),
|
149
|
-
(0, class_transformer_1.Type)(() => Boolean),
|
150
|
-
__metadata("design:type", Boolean)
|
151
|
-
], User.prototype, "isPublisher", void 0);
|
152
|
-
__decorate([
|
153
|
-
(0, class_transformer_1.Expose)({ groups: ['admin'] }),
|
154
|
-
__metadata("design:type", Array)
|
155
|
-
], User.prototype, "roles", void 0);
|
156
|
-
__decorate([
|
157
|
-
(0, class_transformer_1.Expose)({ groups: ['admin'] }),
|
158
|
-
__metadata("design:type", Array)
|
159
|
-
], User.prototype, "permissions", void 0);
|
160
|
-
__decorate([
|
161
|
-
(0, class_transformer_1.Expose)({ groups: ['admin'] }),
|
162
|
-
(0, class_transformer_1.Type)(() => publisher_1.Publisher),
|
163
|
-
__metadata("design:type", publisher_1.Publisher)
|
164
|
-
], User.prototype, "selectedPublisher", void 0);
|
165
|
-
__decorate([
|
166
|
-
(0, class_transformer_1.Expose)({ groups: ['admin'] }),
|
167
|
-
(0, class_transformer_1.Type)(() => publisher_1.Publisher),
|
168
|
-
__metadata("design:type", Array)
|
169
|
-
], User.prototype, "accessPublishers", void 0);
|
170
|
-
__decorate([
|
171
|
-
(0, class_transformer_1.Expose)({ groups: ['admin'] }),
|
172
|
-
(0, class_transformer_1.Type)(() => brand_1.Brand),
|
173
|
-
__metadata("design:type", brand_1.Brand)
|
174
|
-
], User.prototype, "brand", void 0);
|
175
|
-
__decorate([
|
176
|
-
(0, class_transformer_1.Expose)({ groups: ['admin'] }),
|
177
|
-
(0, class_transformer_1.Type)(() => publisher_1.Publisher),
|
178
|
-
__metadata("design:type", publisher_1.Publisher)
|
179
|
-
], User.prototype, "publisher", void 0);
|
180
|
-
__decorate([
|
181
|
-
(0, class_transformer_1.Expose)({ groups: ['admin'] }),
|
182
|
-
__metadata("design:type", Function),
|
183
|
-
__metadata("design:paramtypes", []),
|
184
|
-
__metadata("design:returntype", Boolean)
|
185
|
-
], User.prototype, "isActive", null);
|
186
|
-
__decorate([
|
187
|
-
(0, class_transformer_1.Expose)({ groups: ['admin'] }),
|
188
|
-
__metadata("design:type", Function),
|
189
|
-
__metadata("design:paramtypes", [String]),
|
190
|
-
__metadata("design:returntype", Boolean)
|
191
|
-
], User.prototype, "hasRole", null);
|
192
|
-
__decorate([
|
193
|
-
(0, class_transformer_1.Expose)({ groups: ['admin'] }),
|
194
|
-
__metadata("design:type", Function),
|
195
|
-
__metadata("design:paramtypes", [Array]),
|
196
|
-
__metadata("design:returntype", Boolean)
|
197
|
-
], User.prototype, "hasRoles", null);
|
198
|
-
__decorate([
|
199
|
-
(0, class_transformer_1.Expose)({ groups: ['admin'] }),
|
200
|
-
__metadata("design:type", Function),
|
201
|
-
__metadata("design:paramtypes", [String]),
|
202
|
-
__metadata("design:returntype", Boolean)
|
203
|
-
], User.prototype, "hasPermission", null);
|
204
|
-
__decorate([
|
205
|
-
(0, class_transformer_1.Expose)({ groups: ['admin'] }),
|
206
|
-
__metadata("design:type", Function),
|
207
|
-
__metadata("design:paramtypes", [Array]),
|
208
|
-
__metadata("design:returntype", Boolean)
|
209
|
-
], User.prototype, "hasPermissions", null);
|
210
|
-
__decorate([
|
211
|
-
(0, class_transformer_1.Expose)({ groups: ['admin'] }),
|
212
|
-
__metadata("design:type", Function),
|
213
|
-
__metadata("design:paramtypes", []),
|
214
|
-
__metadata("design:returntype", Boolean)
|
215
|
-
], User.prototype, "isBrandUser", null);
|
216
|
-
__decorate([
|
217
|
-
(0, class_transformer_1.Expose)({ groups: ['admin'] }),
|
218
|
-
__metadata("design:type", Function),
|
219
|
-
__metadata("design:paramtypes", [Number]),
|
220
|
-
__metadata("design:returntype", Boolean)
|
221
|
-
], User.prototype, "belongsToBrand", null);
|
222
|
-
__decorate([
|
223
|
-
(0, class_transformer_1.Expose)({ groups: ['admin'] }),
|
224
|
-
__metadata("design:type", Function),
|
225
|
-
__metadata("design:paramtypes", []),
|
226
|
-
__metadata("design:returntype", Boolean)
|
227
|
-
], User.prototype, "isPublisherUser", null);
|
228
|
-
__decorate([
|
229
|
-
(0, class_transformer_1.Expose)({ groups: ['admin'] }),
|
230
|
-
__metadata("design:type", Function),
|
231
|
-
__metadata("design:paramtypes", [Number]),
|
232
|
-
__metadata("design:returntype", void 0)
|
233
|
-
], User.prototype, "belongsToPublisher", null);
|
234
|
-
__decorate([
|
235
|
-
(0, class_transformer_1.Expose)({ groups: ['admin'] }),
|
236
|
-
__metadata("design:type", Function),
|
237
|
-
__metadata("design:paramtypes", []),
|
238
|
-
__metadata("design:returntype", publisher_1.Publisher)
|
239
|
-
], User.prototype, "getPublisher", null);
|
240
|
-
__decorate([
|
241
|
-
(0, class_transformer_1.Expose)({ groups: ['admin'] }),
|
242
|
-
__metadata("design:type", Function),
|
243
|
-
__metadata("design:paramtypes", [Number]),
|
244
|
-
__metadata("design:returntype", void 0)
|
245
|
-
], User.prototype, "hasBrandAuthorization", null);
|
246
|
-
__decorate([
|
247
|
-
(0, class_transformer_1.Expose)({ groups: ['admin'] }),
|
248
|
-
__metadata("design:type", Function),
|
249
|
-
__metadata("design:paramtypes", [Number]),
|
250
|
-
__metadata("design:returntype", void 0)
|
251
|
-
], User.prototype, "hasPublisherAuthorization", null);
|
252
|
-
__decorate([
|
253
|
-
(0, class_transformer_1.Expose)({ groups: ['admin'] }),
|
254
|
-
__metadata("design:type", Function),
|
255
|
-
__metadata("design:paramtypes", [Number]),
|
256
|
-
__metadata("design:returntype", Boolean)
|
257
|
-
], User.prototype, "hasPublisherAccess", null);
|
258
|
-
//# sourceMappingURL=user.js.map
|
package/lib/models/user.js.map
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"user.js","sourceRoot":"","sources":["../../src/models/user.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,yDAAiD;AACjD,oCAA2C;AAC3C,oCAA0D;AAC1D,0CAAqD;AACrD,mCAAgC;AAChC,2CAAwC;AAOxC,MAAa,IAAI;IAQhB,EAAE,CAAS;IAOX,GAAG,CAAS;IAKZ,IAAI,CAAS;IAGb,KAAK,CAAS;IAGd,KAAK,CAAS;IAGd,KAAK,CAAS;IAKd,MAAM,CAAoB;IAG1B,WAAW,CAAc;IAGzB,QAAQ,CAAkB;IAI1B,OAAO,CAAU;IAIjB,WAAW,CAAU;IAKrB,KAAK,CAAS;IAGd,WAAW,CAAe;IAU1B,iBAAiB,CAAY;IAO7B,gBAAgB,CAAc;IAM9B,KAAK,CAAQ;IAIb,SAAS,CAAY;IAErB,YAAY,KAAqB;QAChC,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;IAC5B,CA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