@intelact/bright 0.9.177 → 0.9.179

Sign up to get free protection for your applications and to get access to all the features.
Files changed (35) hide show
  1. package/lib/author/author.model.d.ts +1 -1
  2. package/lib/author/author.model.js +4 -4
  3. package/lib/boost/boost.model.d.ts +1 -1
  4. package/lib/boost/boost.model.js +16 -16
  5. package/lib/brand/brand.model.d.ts +4 -0
  6. package/lib/brand/brand.model.js +21 -0
  7. package/lib/brand/brand.model.js.map +1 -1
  8. package/lib/category/category.model.d.ts +1 -1
  9. package/lib/category/category.model.js +4 -4
  10. package/lib/collection/collection.model.d.ts +1 -1
  11. package/lib/collection/collection.model.js +4 -4
  12. package/lib/feedback/feedback-item.model.d.ts +1 -1
  13. package/lib/feedback/feedback-item.model.js +8 -8
  14. package/lib/feedback/feedback.model.d.ts +1 -1
  15. package/lib/feedback/feedback.model.js +6 -6
  16. package/lib/post/post.model.d.ts +1 -1
  17. package/lib/post/post.model.js +48 -48
  18. package/lib/promotion/promotion.model.d.ts +1 -1
  19. package/lib/promotion/promotion.model.js +17 -17
  20. package/lib/publisher/publisher.model.d.ts +1 -1
  21. package/lib/publisher/publisher.model.js +19 -19
  22. package/lib/question/comment.model.d.ts +1 -1
  23. package/lib/question/comment.model.js +8 -8
  24. package/lib/question/question.model.d.ts +1 -1
  25. package/lib/question/question.model.js +10 -10
  26. package/lib/quote/quote.model.d.ts +1 -1
  27. package/lib/quote/quote.model.js +4 -4
  28. package/lib/survey/survey.model.d.ts +1 -1
  29. package/lib/survey/survey.model.js +18 -18
  30. package/lib/topic/topic.model.d.ts +1 -1
  31. package/lib/topic/topic.model.js +4 -4
  32. package/lib/tsconfig.tsbuildinfo +1 -1
  33. package/lib/user/user.model.d.ts +1 -1
  34. package/lib/user/user.model.js +17 -17
  35. package/package.json +1 -1
@@ -39,7 +39,7 @@ class Promotion {
39
39
  statusChangedOn;
40
40
  publishedBy;
41
41
  publishedOn;
42
- authorisation = {
42
+ authorization = {
43
43
  edit: false,
44
44
  publish: false,
45
45
  unpublish: false,
@@ -61,11 +61,11 @@ class Promotion {
61
61
  return this?.metrics?.find(i => i.event === user_1.UserEvent.Click);
62
62
  }
63
63
  authorize(user) {
64
- this.authorisation.edit = false;
65
- this.authorisation.delete = false;
66
- this.authorisation.publish = false;
67
- this.authorisation.unpublish = false;
68
- this.authorisation.end = false;
64
+ this.authorization.edit = false;
65
+ this.authorization.delete = false;
66
+ this.authorization.publish = false;
67
+ this.authorization.unpublish = false;
68
+ this.authorization.end = false;
69
69
  if (!user?.isBrandUser()) {
70
70
  return;
71
71
  }
@@ -79,15 +79,15 @@ class Promotion {
79
79
  const isPublished = this.status === status_type_1.StatusType.Published;
80
80
  const isLive = this.label === status_label_1.StatusLabel.Live;
81
81
  if (isDraft) {
82
- this.authorisation.edit = !isEnded && canManage;
83
- this.authorisation.delete = !isEnded && canManage;
84
- this.authorisation.publish = !isExpired && !isEnded && canPublish;
82
+ this.authorization.edit = !isEnded && canManage;
83
+ this.authorization.delete = !isEnded && canManage;
84
+ this.authorization.publish = !isExpired && !isEnded && canPublish;
85
85
  }
86
86
  if (isPublished && isUpcoming) {
87
- this.authorisation.unpublish = canPublish;
87
+ this.authorization.unpublish = canPublish;
88
88
  }
89
89
  if (isPublished && isLive) {
90
- this.authorisation.end = canPublish;
90
+ this.authorization.end = canPublish;
91
91
  }
92
92
  }
93
93
  setValidators() {
@@ -127,26 +127,26 @@ class Promotion {
127
127
  return i;
128
128
  });
129
129
  let validator;
130
- this.authorisation.isValid = true;
130
+ this.authorization.isValid = true;
131
131
  if (!this.title || this.title.trim().length === 0) {
132
132
  validator = this.validators?.find(i => i.name === 'title');
133
133
  validator.value = false;
134
- this.authorisation.isValid = false;
134
+ this.authorization.isValid = false;
135
135
  }
136
136
  if (!this.startDate || !this.endDate) {
137
137
  validator = this.validators?.find(i => i.name === 'period');
138
138
  validator.value = false;
139
- this.authorisation.isValid = false;
139
+ this.authorization.isValid = false;
140
140
  }
141
141
  if (!this.imageUrl || this.imageUrl.trim().length === 0) {
142
142
  validator = this.validators?.find(i => i.name === 'image');
143
143
  validator.value = false;
144
- this.authorisation.isValid = false;
144
+ this.authorization.isValid = false;
145
145
  }
146
146
  if (!this.feedUrl || this.feedUrl.trim().length === 0) {
147
147
  validator = this.validators?.find(i => i.name === 'feed');
148
148
  validator.value = false;
149
- this.authorisation.isValid = false;
149
+ this.authorization.isValid = false;
150
150
  }
151
151
  }
152
152
  setLabel() {
@@ -277,7 +277,7 @@ __decorate([
277
277
  __decorate([
278
278
  (0, class_transformer_1.Expose)({ groups: ['admin'] }),
279
279
  __metadata("design:type", Object)
280
- ], Promotion.prototype, "authorisation", void 0);
280
+ ], Promotion.prototype, "authorization", void 0);
281
281
  __decorate([
282
282
  (0, class_transformer_1.Expose)({ groups: ['admin'] }),
283
283
  (0, class_transformer_1.Type)(() => item_1.Item),
@@ -25,7 +25,7 @@ export declare class Publisher {
25
25
  statusChangedOn: Date;
26
26
  invitedBy: User;
27
27
  invitedOn: Date;
28
- authorisation: {
28
+ authorization: {
29
29
  edit: boolean;
30
30
  activate: boolean;
31
31
  deactivate: boolean;
@@ -39,7 +39,7 @@ class Publisher {
39
39
  statusChangedOn;
40
40
  invitedBy;
41
41
  invitedOn;
42
- authorisation = {
42
+ authorization = {
43
43
  edit: false,
44
44
  activate: false,
45
45
  deactivate: false,
@@ -87,19 +87,19 @@ class Publisher {
87
87
  return data ? (0, class_transformer_1.plainToInstance)(Publisher, data, { groups: groups || [] }) : [];
88
88
  }
89
89
  authorize(user) {
90
- this.authorisation.edit = false;
91
- this.authorisation.activate = false;
92
- this.authorisation.deactivate = false;
93
- this.authorisation.suspend = false;
94
- this.authorisation.delete = false;
95
- this.authorisation.close = false;
96
- this.authorisation.cancel = false;
90
+ this.authorization.edit = false;
91
+ this.authorization.activate = false;
92
+ this.authorization.deactivate = false;
93
+ this.authorization.suspend = false;
94
+ this.authorization.delete = false;
95
+ this.authorization.close = false;
96
+ this.authorization.cancel = false;
97
97
  if (user?.isPublisherUser()) {
98
98
  const canManage = user.hasPermission(security_1.Permission.PublisherAccountManage);
99
99
  const canClose = user.hasPermission(security_1.Permission.PublisherAccountClose);
100
100
  if (this.status === account_status_1.AccountStatus.Active) {
101
- this.authorisation.edit = canManage;
102
- this.authorisation.close = canClose;
101
+ this.authorization.edit = canManage;
102
+ this.authorization.close = canClose;
103
103
  }
104
104
  return;
105
105
  }
@@ -110,20 +110,20 @@ class Publisher {
110
110
  const canInvite = user?.hasPermission(security_1.Permission.BrandPublisherInvite);
111
111
  switch (this.status) {
112
112
  case account_status_1.AccountStatus.Active:
113
- this.authorisation.suspend = canSuspend;
114
- this.authorisation.deactivate = canDeactivate;
113
+ this.authorization.suspend = canSuspend;
114
+ this.authorization.deactivate = canDeactivate;
115
115
  break;
116
116
  case account_status_1.AccountStatus.Suspended:
117
- this.authorisation.activate = canActivate;
118
- this.authorisation.deactivate = canDeactivate;
119
- this.authorisation.delete = canDelete;
117
+ this.authorization.activate = canActivate;
118
+ this.authorization.deactivate = canDeactivate;
119
+ this.authorization.delete = canDelete;
120
120
  break;
121
121
  case account_status_1.AccountStatus.Disabled:
122
- this.authorisation.activate = canActivate;
123
- this.authorisation.delete = canDelete;
122
+ this.authorization.activate = canActivate;
123
+ this.authorization.delete = canDelete;
124
124
  break;
125
125
  case account_status_1.AccountStatus.Invited:
126
- this.authorisation.cancel = canInvite;
126
+ this.authorization.cancel = canInvite;
127
127
  break;
128
128
  }
129
129
  }
@@ -228,7 +228,7 @@ __decorate([
228
228
  __decorate([
229
229
  (0, class_transformer_1.Expose)({ groups: ['admin'] }),
230
230
  __metadata("design:type", Object)
231
- ], Publisher.prototype, "authorisation", void 0);
231
+ ], Publisher.prototype, "authorization", void 0);
232
232
  __decorate([
233
233
  (0, class_transformer_1.Expose)({ groups: ['admin'] }),
234
234
  __metadata("design:type", Function),
@@ -16,7 +16,7 @@ export declare class QuestionComment {
16
16
  statusChangedOn: Date;
17
17
  publishedBy: User;
18
18
  publishedOn: Date;
19
- authorisation: {
19
+ authorization: {
20
20
  manage: boolean;
21
21
  publish: boolean;
22
22
  unpublish: boolean;
@@ -30,7 +30,7 @@ class QuestionComment {
30
30
  statusChangedOn;
31
31
  publishedBy;
32
32
  publishedOn;
33
- authorisation = {
33
+ authorization = {
34
34
  manage: false,
35
35
  publish: false,
36
36
  unpublish: false,
@@ -45,18 +45,18 @@ class QuestionComment {
45
45
  return data ? (0, class_transformer_1.plainToInstance)(QuestionComment, data, { groups: groups || [] }) : [];
46
46
  }
47
47
  authorize(user) {
48
- this.authorisation.manage = false;
49
- this.authorisation.publish = false;
50
- this.authorisation.unpublish = false;
48
+ this.authorization.manage = false;
49
+ this.authorization.publish = false;
50
+ this.authorization.unpublish = false;
51
51
  if (!user?.isBrandUser()) {
52
52
  return;
53
53
  }
54
54
  const canManage = user.hasPermission(security_1.Permission.QuestionManage);
55
55
  const canPublish = user.hasPermission(security_1.Permission.QuestionPublish);
56
56
  const isPublished = this.status === status_type_1.StatusType.Published;
57
- this.authorisation.manage = canManage && !isPublished;
58
- this.authorisation.publish = canPublish && !isPublished;
59
- this.authorisation.unpublish = canPublish && isPublished;
57
+ this.authorization.manage = canManage && !isPublished;
58
+ this.authorization.publish = canPublish && !isPublished;
59
+ this.authorization.unpublish = canPublish && isPublished;
60
60
  }
61
61
  }
62
62
  exports.QuestionComment = QuestionComment;
@@ -125,7 +125,7 @@ __decorate([
125
125
  __decorate([
126
126
  (0, class_transformer_1.Expose)({ groups: ['admin'] }),
127
127
  __metadata("design:type", Object)
128
- ], QuestionComment.prototype, "authorisation", void 0);
128
+ ], QuestionComment.prototype, "authorization", void 0);
129
129
  __decorate([
130
130
  (0, class_transformer_1.Expose)({ groups: ['admin'] }),
131
131
  __metadata("design:type", Function),
@@ -29,7 +29,7 @@ export declare class Question {
29
29
  user: User;
30
30
  comments: QuestionComment[];
31
31
  categories: Category[];
32
- authorisation: {
32
+ authorization: {
33
33
  manage: boolean;
34
34
  close: boolean;
35
35
  publish: boolean;
@@ -45,7 +45,7 @@ class Question {
45
45
  user;
46
46
  comments;
47
47
  categories;
48
- authorisation = {
48
+ authorization = {
49
49
  manage: false,
50
50
  close: false,
51
51
  publish: false,
@@ -76,17 +76,17 @@ class Question {
76
76
  return data ? (0, class_transformer_1.plainToInstance)(Question, data, { groups: groups || [] }) : [];
77
77
  }
78
78
  authorize(user) {
79
- this.authorisation.manage = false;
80
- this.authorisation.publish = false;
81
- this.authorisation.close = false;
82
- this.authorisation.attention = false;
79
+ this.authorization.manage = false;
80
+ this.authorization.publish = false;
81
+ this.authorization.close = false;
82
+ this.authorization.attention = false;
83
83
  if (!user?.isBrandUser()) {
84
84
  return;
85
85
  }
86
- this.authorisation.manage = user?.hasPermission(security_1.Permission.QuestionManage);
87
- this.authorisation.publish = user?.hasPermission(security_1.Permission.QuestionPublish);
88
- this.authorisation.close = !this.closed;
89
- this.authorisation.attention = !this.attentionOn;
86
+ this.authorization.manage = user?.hasPermission(security_1.Permission.QuestionManage);
87
+ this.authorization.publish = user?.hasPermission(security_1.Permission.QuestionPublish);
88
+ this.authorization.close = !this.closed;
89
+ this.authorization.attention = !this.attentionOn;
90
90
  if (this.comments?.length) {
91
91
  for (const comment of this.comments) {
92
92
  comment.authorize(user);
@@ -216,7 +216,7 @@ __decorate([
216
216
  __decorate([
217
217
  (0, class_transformer_1.Expose)({ groups: ['admin'] }),
218
218
  __metadata("design:type", Object)
219
- ], Question.prototype, "authorisation", void 0);
219
+ ], Question.prototype, "authorization", void 0);
220
220
  __decorate([
221
221
  (0, class_transformer_1.Expose)({ groups: ['admin'] }),
222
222
  __metadata("design:type", Function),
@@ -6,7 +6,7 @@ export declare class Quote {
6
6
  publisher: Publisher;
7
7
  imageUrl: string;
8
8
  post: Post;
9
- authorisation: {
9
+ authorization: {
10
10
  manage: boolean;
11
11
  };
12
12
  constructor(props?: Partial<Quote>);
@@ -20,18 +20,18 @@ class Quote {
20
20
  publisher;
21
21
  imageUrl;
22
22
  post;
23
- authorisation = {
23
+ authorization = {
24
24
  manage: false
25
25
  };
26
26
  constructor(props) {
27
27
  Object.assign(this, props);
28
28
  }
29
29
  authorize(user, publisher) {
30
- this.authorisation.manage = false;
30
+ this.authorization.manage = false;
31
31
  if (!user?.isPublisherUser() || publisher?.status !== security_1.AccountStatus.Active) {
32
32
  return;
33
33
  }
34
- this.authorisation.manage = user?.hasPermission(security_1.Permission.QuoteManage);
34
+ this.authorization.manage = user?.hasPermission(security_1.Permission.QuoteManage);
35
35
  }
36
36
  }
37
37
  exports.Quote = Quote;
@@ -57,7 +57,7 @@ __decorate([
57
57
  __decorate([
58
58
  (0, class_transformer_1.Expose)({ groups: ['admin'] }),
59
59
  __metadata("design:type", Object)
60
- ], Quote.prototype, "authorisation", void 0);
60
+ ], Quote.prototype, "authorization", void 0);
61
61
  __decorate([
62
62
  (0, class_transformer_1.Expose)({ groups: ['admin'] }),
63
63
  __metadata("design:type", Function),
@@ -26,7 +26,7 @@ export declare class Survey {
26
26
  statusChangedOn: Date;
27
27
  publishedBy: User;
28
28
  publishedOn: Date;
29
- authorisation: {
29
+ authorization: {
30
30
  edit: boolean;
31
31
  publish: boolean;
32
32
  unpublish: boolean;
@@ -43,7 +43,7 @@ class Survey {
43
43
  statusChangedOn;
44
44
  publishedBy;
45
45
  publishedOn;
46
- authorisation = {
46
+ authorization = {
47
47
  edit: false,
48
48
  publish: false,
49
49
  unpublish: false,
@@ -68,11 +68,11 @@ class Survey {
68
68
  return this?.metrics?.find(i => i.event === metric_1.MetricType.Items);
69
69
  }
70
70
  authorize(user) {
71
- this.authorisation.edit = false;
72
- this.authorisation.delete = false;
73
- this.authorisation.publish = false;
74
- this.authorisation.unpublish = false;
75
- this.authorisation.end = false;
71
+ this.authorization.edit = false;
72
+ this.authorization.delete = false;
73
+ this.authorization.publish = false;
74
+ this.authorization.unpublish = false;
75
+ this.authorization.end = false;
76
76
  this.setLabel();
77
77
  if (!user?.isBrandUser()) {
78
78
  return;
@@ -86,15 +86,15 @@ class Survey {
86
86
  const isPublished = this.status === status_type_1.StatusType.Published;
87
87
  const isLive = this.label === status_label_1.StatusLabel.Live;
88
88
  if (isDraft) {
89
- this.authorisation.edit = !isEnded && canManage;
90
- this.authorisation.delete = !isEnded && canManage;
91
- this.authorisation.publish = !isExpired && !isEnded && canPublish;
89
+ this.authorization.edit = !isEnded && canManage;
90
+ this.authorization.delete = !isEnded && canManage;
91
+ this.authorization.publish = !isExpired && !isEnded && canPublish;
92
92
  }
93
93
  if (isPublished && isUpcoming) {
94
- this.authorisation.unpublish = canPublish;
94
+ this.authorization.unpublish = canPublish;
95
95
  }
96
96
  if (isPublished && isLive) {
97
- this.authorisation.end = canPublish;
97
+ this.authorization.end = canPublish;
98
98
  }
99
99
  }
100
100
  setValidators() {
@@ -136,7 +136,7 @@ class Survey {
136
136
  this.setValidators();
137
137
  }
138
138
  let validator;
139
- this.authorisation.isValid = true;
139
+ this.authorization.isValid = true;
140
140
  this.validators = this.validators.map(i => {
141
141
  i.value = true;
142
142
  return i;
@@ -144,27 +144,27 @@ class Survey {
144
144
  if (!this.name || this.name.trim().length === 0) {
145
145
  validator = this.validators?.find(i => i.name === 'name');
146
146
  validator.value = false;
147
- this.authorisation.isValid = false;
147
+ this.authorization.isValid = false;
148
148
  }
149
149
  if (!this.description || this.description.trim().length === 0) {
150
150
  validator = this.validators?.find(i => i.name === 'description');
151
151
  validator.value = false;
152
- this.authorisation.isValid = false;
152
+ this.authorization.isValid = false;
153
153
  }
154
154
  if (!this.startDate || !this.endDate) {
155
155
  validator = this.validators?.find(i => i.name === 'period');
156
156
  validator.value = false;
157
- this.authorisation.isValid = false;
157
+ this.authorization.isValid = false;
158
158
  }
159
159
  if (!this.imageUrl || this.imageUrl.trim().length === 0) {
160
160
  validator = this.validators?.find(i => i.name === 'image');
161
161
  validator.value = false;
162
- this.authorisation.isValid = false;
162
+ this.authorization.isValid = false;
163
163
  }
164
164
  if (!this.items || this.items.length === 0) {
165
165
  validator = this.validators?.find(i => i.name === 'items');
166
166
  validator.value = false;
167
- this.authorisation.isValid = false;
167
+ this.authorization.isValid = false;
168
168
  }
169
169
  }
170
170
  setLabel() {
@@ -305,7 +305,7 @@ __decorate([
305
305
  __decorate([
306
306
  (0, class_transformer_1.Expose)({ groups: ['admin'] }),
307
307
  __metadata("design:type", Object)
308
- ], Survey.prototype, "authorisation", void 0);
308
+ ], Survey.prototype, "authorization", void 0);
309
309
  __decorate([
310
310
  (0, class_transformer_1.Expose)({ groups: ['admin'] }),
311
311
  (0, class_transformer_1.Type)(() => item_1.Item),
@@ -15,7 +15,7 @@ export declare class Topic {
15
15
  createdOn: Date;
16
16
  updatedBy: User;
17
17
  updatedOn: Date;
18
- authorisation: {
18
+ authorization: {
19
19
  manage: boolean;
20
20
  };
21
21
  constructor(props?: Partial<Topic>);
@@ -31,7 +31,7 @@ class Topic {
31
31
  createdOn;
32
32
  updatedBy;
33
33
  updatedOn;
34
- authorisation = {
34
+ authorization = {
35
35
  manage: false
36
36
  };
37
37
  constructor(props) {
@@ -70,11 +70,11 @@ class Topic {
70
70
  return data ? (0, class_transformer_1.plainToInstance)(Topic, data, { groups: groups || [] }) : [];
71
71
  }
72
72
  authorize(user) {
73
- this.authorisation.manage = false;
73
+ this.authorization.manage = false;
74
74
  if (!user?.isBrandUser()) {
75
75
  return;
76
76
  }
77
- this.authorisation.manage = user?.hasPermission(security_1.Permission.TopicManage);
77
+ this.authorization.manage = user?.hasPermission(security_1.Permission.TopicManage);
78
78
  }
79
79
  }
80
80
  exports.Topic = Topic;
@@ -139,7 +139,7 @@ __decorate([
139
139
  __decorate([
140
140
  (0, class_transformer_1.Expose)({ groups: ['admin'] }),
141
141
  __metadata("design:type", Object)
142
- ], Topic.prototype, "authorisation", void 0);
142
+ ], Topic.prototype, "authorization", void 0);
143
143
  __decorate([
144
144
  (0, class_transformer_1.Expose)({ groups: ['admin'] }),
145
145
  __metadata("design:type", Function),