@intelact/bright 0.9.79 → 0.9.81

Sign up to get free protection for your applications and to get access to all the features.
Files changed (323) hide show
  1. package/lib/auth/auth.event.d.ts +9 -0
  2. package/lib/auth/auth.event.js +14 -0
  3. package/lib/auth/auth.event.js.map +1 -0
  4. package/lib/auth/index.d.ts +4 -0
  5. package/lib/auth/index.js +21 -0
  6. package/lib/auth/index.js.map +1 -0
  7. package/lib/auth/password.dto.d.ts +8 -0
  8. package/lib/auth/password.dto.js +44 -0
  9. package/lib/auth/password.dto.js.map +1 -0
  10. package/lib/auth/sign.dto.d.ts +11 -0
  11. package/lib/auth/sign.dto.js +54 -0
  12. package/lib/auth/sign.dto.js.map +1 -0
  13. package/lib/auth/verify.dto.d.ts +10 -0
  14. package/lib/auth/verify.dto.js +47 -0
  15. package/lib/auth/verify.dto.js.map +1 -0
  16. package/lib/author/author.model.d.ts +19 -0
  17. package/lib/author/author.model.js +98 -0
  18. package/lib/author/author.model.js.map +1 -0
  19. package/lib/author/author.sort.d.ts +6 -0
  20. package/lib/author/author.sort.js +11 -0
  21. package/lib/author/author.sort.js.map +1 -0
  22. package/lib/author/index.d.ts +2 -0
  23. package/lib/author/index.js +19 -0
  24. package/lib/author/index.js.map +1 -0
  25. package/lib/boost/boost.dto.d.ts +5 -0
  26. package/lib/boost/boost.dto.js +38 -0
  27. package/lib/boost/boost.dto.js.map +1 -0
  28. package/lib/boost/boost.model.d.ts +16 -0
  29. package/lib/boost/boost.model.js +82 -0
  30. package/lib/boost/boost.model.js.map +1 -0
  31. package/lib/boost/index.d.ts +2 -0
  32. package/lib/boost/index.js +19 -0
  33. package/lib/boost/index.js.map +1 -0
  34. package/lib/brand/brand-setting.model.d.ts +12 -0
  35. package/lib/brand/brand-setting.model.js +58 -0
  36. package/lib/brand/brand-setting.model.js.map +1 -0
  37. package/lib/brand/brand-setting.type.d.ts +10 -0
  38. package/lib/brand/brand-setting.type.js +15 -0
  39. package/lib/brand/brand-setting.type.js.map +1 -0
  40. package/lib/brand/brand.dto.d.ts +6 -0
  41. package/lib/brand/brand.dto.js +41 -0
  42. package/lib/brand/brand.dto.js.map +1 -0
  43. package/lib/brand/brand.model.d.ts +31 -0
  44. package/lib/brand/brand.model.js +201 -0
  45. package/lib/brand/brand.model.js.map +1 -0
  46. package/lib/brand/index.d.ts +4 -0
  47. package/lib/brand/index.js +21 -0
  48. package/lib/brand/index.js.map +1 -0
  49. package/lib/category/category.model.d.ts +18 -0
  50. package/lib/category/category.model.js +94 -0
  51. package/lib/category/category.model.js.map +1 -0
  52. package/lib/category/index.d.ts +1 -0
  53. package/lib/category/index.js +18 -0
  54. package/lib/category/index.js.map +1 -0
  55. package/lib/collection/collection.model.d.ts +16 -0
  56. package/lib/collection/collection.model.js +77 -0
  57. package/lib/collection/collection.model.js.map +1 -0
  58. package/lib/collection/index.d.ts +1 -0
  59. package/lib/collection/index.js +18 -0
  60. package/lib/collection/index.js.map +1 -0
  61. package/lib/common/asset.type.d.ts +7 -0
  62. package/lib/common/asset.type.js +12 -0
  63. package/lib/common/asset.type.js.map +1 -0
  64. package/lib/common/bookmark.dto.d.ts +4 -0
  65. package/lib/common/bookmark.dto.js +24 -0
  66. package/lib/common/bookmark.dto.js.map +1 -0
  67. package/lib/common/browse.dto.d.ts +9 -0
  68. package/lib/common/browse.dto.js +47 -0
  69. package/lib/common/browse.dto.js.map +1 -0
  70. package/lib/common/general.dto.d.ts +25 -0
  71. package/lib/common/general.dto.js +94 -0
  72. package/lib/common/general.dto.js.map +1 -0
  73. package/lib/common/index.d.ts +11 -0
  74. package/lib/common/index.js +28 -0
  75. package/lib/common/index.js.map +1 -0
  76. package/lib/common/module.scope.d.ts +22 -0
  77. package/lib/common/module.scope.js +27 -0
  78. package/lib/common/module.scope.js.map +1 -0
  79. package/lib/common/module.type.d.ts +6 -0
  80. package/lib/common/module.type.js +11 -0
  81. package/lib/common/module.type.js.map +1 -0
  82. package/lib/common/search.dto.d.ts +14 -0
  83. package/lib/common/search.dto.js +74 -0
  84. package/lib/common/search.dto.js.map +1 -0
  85. package/lib/common/sort.type.d.ts +8 -0
  86. package/lib/common/sort.type.js +13 -0
  87. package/lib/common/sort.type.js.map +1 -0
  88. package/lib/common/status.label.d.ts +6 -0
  89. package/lib/common/status.label.js +11 -0
  90. package/lib/common/status.label.js.map +1 -0
  91. package/lib/common/status.type.d.ts +7 -0
  92. package/lib/common/status.type.js +12 -0
  93. package/lib/common/status.type.js.map +1 -0
  94. package/lib/common/user.agent.d.ts +11 -0
  95. package/lib/common/user.agent.js +3 -0
  96. package/lib/common/user.agent.js.map +1 -0
  97. package/lib/contact/contact.dto.d.ts +5 -0
  98. package/lib/contact/contact.dto.js +35 -0
  99. package/lib/contact/contact.dto.js.map +1 -0
  100. package/lib/contact/index.d.ts +1 -0
  101. package/lib/contact/index.js +18 -0
  102. package/lib/contact/index.js.map +1 -0
  103. package/lib/feedback/feedback-item.model.d.ts +15 -0
  104. package/lib/feedback/feedback-item.model.js +81 -0
  105. package/lib/feedback/feedback-item.model.js.map +1 -0
  106. package/lib/feedback/feedback-option.model.d.ts +7 -0
  107. package/lib/feedback/feedback-option.model.js +43 -0
  108. package/lib/feedback/feedback-option.model.js.map +1 -0
  109. package/lib/feedback/feedback.data.d.ts +6 -0
  110. package/lib/feedback/feedback.data.js +3 -0
  111. package/lib/feedback/feedback.data.js.map +1 -0
  112. package/lib/feedback/feedback.dto.d.ts +9 -0
  113. package/lib/feedback/feedback.dto.js +47 -0
  114. package/lib/feedback/feedback.dto.js.map +1 -0
  115. package/lib/feedback/feedback.model.d.ts +18 -0
  116. package/lib/feedback/feedback.model.js +87 -0
  117. package/lib/feedback/feedback.model.js.map +1 -0
  118. package/lib/feedback/index.d.ts +5 -0
  119. package/lib/feedback/index.js +22 -0
  120. package/lib/feedback/index.js.map +1 -0
  121. package/lib/gallery/gallery.model.d.ts +6 -0
  122. package/lib/gallery/gallery.model.js +36 -0
  123. package/lib/gallery/gallery.model.js.map +1 -0
  124. package/lib/gallery/index.d.ts +1 -0
  125. package/lib/gallery/index.js +18 -0
  126. package/lib/gallery/index.js.map +1 -0
  127. package/lib/index.d.ts +27 -4
  128. package/lib/index.js +27 -4
  129. package/lib/index.js.map +1 -1
  130. package/lib/item/index.d.ts +1 -0
  131. package/lib/item/index.js +18 -0
  132. package/lib/item/index.js.map +1 -0
  133. package/lib/item/item.model.d.ts +14 -0
  134. package/lib/item/item.model.js +37 -0
  135. package/lib/item/item.model.js.map +1 -0
  136. package/lib/link/index.d.ts +1 -0
  137. package/lib/link/index.js +18 -0
  138. package/lib/link/index.js.map +1 -0
  139. package/lib/link/link.model.d.ts +16 -0
  140. package/lib/link/link.model.js +35 -0
  141. package/lib/link/link.model.js.map +1 -0
  142. package/lib/log/index.d.ts +2 -0
  143. package/lib/log/index.js +19 -0
  144. package/lib/log/index.js.map +1 -0
  145. package/lib/log/log.event.d.ts +14 -0
  146. package/lib/log/log.event.js +19 -0
  147. package/lib/log/log.event.js.map +1 -0
  148. package/lib/log/log.model.d.ts +12 -0
  149. package/lib/log/log.model.js +16 -0
  150. package/lib/log/log.model.js.map +1 -0
  151. package/lib/metric/index.d.ts +3 -0
  152. package/lib/metric/index.js +20 -0
  153. package/lib/metric/index.js.map +1 -0
  154. package/lib/metric/metric.interface.d.ts +11 -0
  155. package/lib/metric/metric.interface.js +3 -0
  156. package/lib/metric/metric.interface.js.map +1 -0
  157. package/lib/metric/metric.model.d.ts +27 -0
  158. package/lib/metric/metric.model.js +189 -0
  159. package/lib/metric/metric.model.js.map +1 -0
  160. package/lib/metric/metric.type.d.ts +10 -0
  161. package/lib/metric/metric.type.js +15 -0
  162. package/lib/metric/metric.type.js.map +1 -0
  163. package/lib/notification/index.d.ts +5 -0
  164. package/lib/notification/index.js +22 -0
  165. package/lib/notification/index.js.map +1 -0
  166. package/lib/notification/notification.dto.d.ts +4 -0
  167. package/lib/notification/notification.dto.js +29 -0
  168. package/lib/notification/notification.dto.js.map +1 -0
  169. package/lib/notification/notification.event.d.ts +6 -0
  170. package/lib/notification/notification.event.js +11 -0
  171. package/lib/notification/notification.event.js.map +1 -0
  172. package/lib/notification/notification.model.d.ts +9 -0
  173. package/lib/notification/notification.model.js +48 -0
  174. package/lib/notification/notification.model.js.map +1 -0
  175. package/lib/notification/notification.token.d.ts +4 -0
  176. package/lib/notification/notification.token.js +3 -0
  177. package/lib/notification/notification.token.js.map +1 -0
  178. package/lib/notification/notification.type.d.ts +6 -0
  179. package/lib/notification/notification.type.js +11 -0
  180. package/lib/notification/notification.type.js.map +1 -0
  181. package/lib/popularity/index.d.ts +2 -0
  182. package/lib/popularity/index.js +19 -0
  183. package/lib/popularity/index.js.map +1 -0
  184. package/lib/popularity/popularity.model.d.ts +9 -0
  185. package/lib/popularity/popularity.model.js +95 -0
  186. package/lib/popularity/popularity.model.js.map +1 -0
  187. package/lib/popularity/popularity.rate.d.ts +8 -0
  188. package/lib/popularity/popularity.rate.js +13 -0
  189. package/lib/popularity/popularity.rate.js.map +1 -0
  190. package/lib/post/index.d.ts +4 -0
  191. package/lib/post/index.js +21 -0
  192. package/lib/post/index.js.map +1 -0
  193. package/lib/post/post.additionals.d.ts +24 -0
  194. package/lib/post/post.additionals.js +3 -0
  195. package/lib/post/post.additionals.js.map +1 -0
  196. package/lib/post/post.dto.d.ts +26 -0
  197. package/lib/post/post.dto.js +119 -0
  198. package/lib/post/post.dto.js.map +1 -0
  199. package/lib/post/post.model.d.ts +74 -0
  200. package/lib/post/post.model.js +514 -0
  201. package/lib/post/post.model.js.map +1 -0
  202. package/lib/post/post.type.d.ts +8 -0
  203. package/lib/post/post.type.js +13 -0
  204. package/lib/post/post.type.js.map +1 -0
  205. package/lib/promotion/index.d.ts +2 -0
  206. package/lib/promotion/index.js +19 -0
  207. package/lib/promotion/index.js.map +1 -0
  208. package/lib/promotion/promotion.dto.d.ts +5 -0
  209. package/lib/promotion/promotion.dto.js +38 -0
  210. package/lib/promotion/promotion.dto.js.map +1 -0
  211. package/lib/promotion/promotion.model.d.ts +24 -0
  212. package/lib/promotion/promotion.model.js +125 -0
  213. package/lib/promotion/promotion.model.js.map +1 -0
  214. package/lib/publisher/index.d.ts +3 -0
  215. package/lib/publisher/index.js +20 -0
  216. package/lib/publisher/index.js.map +1 -0
  217. package/lib/publisher/publisher.dto.d.ts +8 -0
  218. package/lib/publisher/publisher.dto.js +39 -0
  219. package/lib/publisher/publisher.dto.js.map +1 -0
  220. package/lib/publisher/publisher.enum.d.ts +7 -0
  221. package/lib/publisher/publisher.enum.js +12 -0
  222. package/lib/publisher/publisher.enum.js.map +1 -0
  223. package/lib/publisher/publisher.model.d.ts +29 -0
  224. package/lib/publisher/publisher.model.js +136 -0
  225. package/lib/publisher/publisher.model.js.map +1 -0
  226. package/lib/question/comment.model.d.ts +20 -0
  227. package/lib/question/comment.model.js +99 -0
  228. package/lib/question/comment.model.js.map +1 -0
  229. package/lib/question/index.d.ts +3 -0
  230. package/lib/question/index.js +20 -0
  231. package/lib/question/index.js.map +1 -0
  232. package/lib/question/question.dto.d.ts +15 -0
  233. package/lib/question/question.dto.js +86 -0
  234. package/lib/question/question.dto.js.map +1 -0
  235. package/lib/question/question.model.d.ts +39 -0
  236. package/lib/question/question.model.js +205 -0
  237. package/lib/question/question.model.js.map +1 -0
  238. package/lib/quote/index.d.ts +1 -0
  239. package/lib/quote/index.js +18 -0
  240. package/lib/quote/index.js.map +1 -0
  241. package/lib/quote/quote.model.d.ts +5 -0
  242. package/lib/quote/quote.model.js +31 -0
  243. package/lib/quote/quote.model.js.map +1 -0
  244. package/lib/security/account.status.d.ts +6 -0
  245. package/lib/security/account.status.js +11 -0
  246. package/lib/security/account.status.js.map +1 -0
  247. package/lib/security/account.type.d.ts +5 -0
  248. package/lib/security/account.type.js +10 -0
  249. package/lib/security/account.type.js.map +1 -0
  250. package/lib/security/index.d.ts +3 -0
  251. package/lib/security/index.js +3 -0
  252. package/lib/security/index.js.map +1 -1
  253. package/lib/security/token.interface.d.ts +7 -0
  254. package/lib/security/token.interface.js +3 -0
  255. package/lib/security/token.interface.js.map +1 -0
  256. package/lib/social/index.d.ts +4 -0
  257. package/lib/social/index.js +21 -0
  258. package/lib/social/index.js.map +1 -0
  259. package/lib/social/share.interface.d.ts +6 -0
  260. package/lib/social/share.interface.js +3 -0
  261. package/lib/social/share.interface.js.map +1 -0
  262. package/lib/social/share.provider.d.ts +7 -0
  263. package/lib/social/share.provider.js +12 -0
  264. package/lib/social/share.provider.js.map +1 -0
  265. package/lib/social/social-user.dto.d.ts +11 -0
  266. package/lib/social/social-user.dto.js +59 -0
  267. package/lib/social/social-user.dto.js.map +1 -0
  268. package/lib/social/social.provider.d.ts +7 -0
  269. package/lib/social/social.provider.js +12 -0
  270. package/lib/social/social.provider.js.map +1 -0
  271. package/lib/survey/index.d.ts +5 -0
  272. package/lib/survey/index.js +22 -0
  273. package/lib/survey/index.js.map +1 -0
  274. package/lib/survey/survey-item.model.d.ts +17 -0
  275. package/lib/survey/survey-item.model.js +88 -0
  276. package/lib/survey/survey-item.model.js.map +1 -0
  277. package/lib/survey/survey-option.model.d.ts +9 -0
  278. package/lib/survey/survey-option.model.js +50 -0
  279. package/lib/survey/survey-option.model.js.map +1 -0
  280. package/lib/survey/survey.dto.d.ts +9 -0
  281. package/lib/survey/survey.dto.js +54 -0
  282. package/lib/survey/survey.dto.js.map +1 -0
  283. package/lib/survey/survey.event.d.ts +5 -0
  284. package/lib/survey/survey.event.js +10 -0
  285. package/lib/survey/survey.event.js.map +1 -0
  286. package/lib/survey/survey.model.d.ts +27 -0
  287. package/lib/survey/survey.model.js +138 -0
  288. package/lib/survey/survey.model.js.map +1 -0
  289. package/lib/topic/index.d.ts +1 -0
  290. package/lib/topic/index.js +18 -0
  291. package/lib/topic/index.js.map +1 -0
  292. package/lib/topic/topic.model.d.ts +20 -0
  293. package/lib/topic/topic.model.js +104 -0
  294. package/lib/topic/topic.model.js.map +1 -0
  295. package/lib/tsconfig.tsbuildinfo +1 -1
  296. package/lib/ui/background.enum.d.ts +10 -0
  297. package/lib/ui/background.enum.js +15 -0
  298. package/lib/ui/background.enum.js.map +1 -0
  299. package/lib/ui/color.enum.d.ts +10 -0
  300. package/lib/ui/color.enum.js +15 -0
  301. package/lib/ui/color.enum.js.map +1 -0
  302. package/lib/ui/context.enum.d.ts +10 -0
  303. package/lib/ui/context.enum.js +15 -0
  304. package/lib/ui/context.enum.js.map +1 -0
  305. package/lib/ui/index.d.ts +3 -0
  306. package/lib/ui/index.js +20 -0
  307. package/lib/ui/index.js.map +1 -0
  308. package/lib/user/index.d.ts +2 -0
  309. package/lib/user/index.js +19 -0
  310. package/lib/user/index.js.map +1 -0
  311. package/lib/user/user.dto.d.ts +24 -0
  312. package/lib/user/user.dto.js +99 -0
  313. package/lib/user/user.dto.js.map +1 -0
  314. package/lib/user/user.model.d.ts +38 -0
  315. package/lib/user/user.model.js +258 -0
  316. package/lib/user/user.model.js.map +1 -0
  317. package/lib/verification/index.d.ts +1 -0
  318. package/lib/verification/index.js +18 -0
  319. package/lib/verification/index.js.map +1 -0
  320. package/lib/verification/verification.type.d.ts +5 -0
  321. package/lib/verification/verification.type.js +10 -0
  322. package/lib/verification/verification.type.js.map +1 -0
  323. package/package.json +2 -7
@@ -0,0 +1,514 @@
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.Post = void 0;
13
+ const class_transformer_1 = require("class-transformer");
14
+ const user_model_1 = require("../user/user.model");
15
+ const author_1 = require("../author");
16
+ const publisher_1 = require("../publisher");
17
+ const topic_1 = require("../topic");
18
+ const gallery_1 = require("../gallery");
19
+ const feedback_1 = require("../feedback");
20
+ const item_model_1 = require("../item/item.model");
21
+ const metric_1 = require("../metric");
22
+ const common_1 = require("../common");
23
+ const post_type_1 = require("./post.type");
24
+ const ui_1 = require("../ui");
25
+ const popularity_1 = require("../popularity");
26
+ class Post {
27
+ id;
28
+ slug;
29
+ title;
30
+ description;
31
+ content;
32
+ info;
33
+ duration;
34
+ icon;
35
+ svgIcon;
36
+ pdfUrl;
37
+ imageUrl;
38
+ feedUrl;
39
+ mediaUrl;
40
+ externUrl;
41
+ status;
42
+ postType;
43
+ weight;
44
+ popularity;
45
+ totalSeen;
46
+ totalOpens;
47
+ totalLikes;
48
+ totalShares;
49
+ totalBookmarks;
50
+ totalDownloads;
51
+ totalFeedbacks;
52
+ metrics;
53
+ createdBy;
54
+ createdOn;
55
+ updatedBy;
56
+ updatedOn;
57
+ statusChangedBy;
58
+ statusChangedOn;
59
+ publishedBy;
60
+ publishedOn;
61
+ blockedBy;
62
+ blockedOn;
63
+ publisher;
64
+ author;
65
+ topics;
66
+ feedback;
67
+ collection;
68
+ gallery;
69
+ constructor(props) {
70
+ Object.assign(this, props);
71
+ }
72
+ get type() {
73
+ return this.postType;
74
+ }
75
+ getStatusAuthorizations() {
76
+ switch (this.status) {
77
+ case common_1.StatusType.Draft:
78
+ return {
79
+ draft: false,
80
+ approve: true,
81
+ publish: true,
82
+ unpublish: false,
83
+ archive: true,
84
+ unarchive: false,
85
+ block: true,
86
+ unblock: false
87
+ };
88
+ case common_1.StatusType.ReadyForPublish:
89
+ return {
90
+ draft: true,
91
+ approve: false,
92
+ publish: true,
93
+ unpublish: false,
94
+ archive: false,
95
+ unarchive: false,
96
+ block: true,
97
+ unblock: false
98
+ };
99
+ case common_1.StatusType.Published:
100
+ return {
101
+ draft: false,
102
+ approve: false,
103
+ publish: false,
104
+ unpublish: true,
105
+ archive: true,
106
+ unarchive: false,
107
+ block: true,
108
+ unblock: false
109
+ };
110
+ case common_1.StatusType.Archived:
111
+ return {
112
+ draft: false,
113
+ approve: false,
114
+ publish: false,
115
+ unpublish: false,
116
+ archive: false,
117
+ unarchive: true,
118
+ block: false,
119
+ unblock: false
120
+ };
121
+ case common_1.StatusType.Blocked:
122
+ return {
123
+ draft: false,
124
+ approve: false,
125
+ publish: false,
126
+ unpublish: false,
127
+ archive: false,
128
+ unarchive: false,
129
+ block: false,
130
+ unblock: true
131
+ };
132
+ default:
133
+ return {
134
+ draft: false,
135
+ approve: false,
136
+ publish: false,
137
+ unpublish: false,
138
+ archive: false,
139
+ unarchive: false,
140
+ block: false,
141
+ unblock: false
142
+ };
143
+ }
144
+ }
145
+ getPublishValidators() {
146
+ const postType = this.postType;
147
+ const validators = [];
148
+ validators.push(new item_model_1.Item({
149
+ name: 'author',
150
+ title: 'author',
151
+ icon: 'user'
152
+ }));
153
+ validators.push(new item_model_1.Item({
154
+ name: 'title',
155
+ title: 'title',
156
+ icon: 't'
157
+ }));
158
+ validators.push(new item_model_1.Item({
159
+ name: 'description',
160
+ title: 'daysescription',
161
+ icon: 'align-left'
162
+ }));
163
+ validators.push(new item_model_1.Item({
164
+ name: 'image',
165
+ title: 'image',
166
+ icon: 'image'
167
+ }));
168
+ validators.push(new item_model_1.Item({
169
+ name: 'feed',
170
+ title: 'postFeed',
171
+ icon: 'mobile-screen'
172
+ }));
173
+ if ([post_type_1.PostType.Article, post_type_1.PostType.Event, post_type_1.PostType.News].includes(postType)) {
174
+ validators.push(new item_model_1.Item({
175
+ name: 'content',
176
+ title: 'content',
177
+ icon: 'align-justify'
178
+ }));
179
+ }
180
+ if (postType === post_type_1.PostType.Book) {
181
+ validators.push(new item_model_1.Item({
182
+ name: 'pdf',
183
+ title: 'pdf',
184
+ icon: 'file-pdf'
185
+ }));
186
+ }
187
+ if (postType === post_type_1.PostType.Audio) {
188
+ validators.push(new item_model_1.Item({
189
+ name: 'audio',
190
+ title: 'audio',
191
+ icon: 'microphone'
192
+ }));
193
+ }
194
+ if (postType === post_type_1.PostType.Video) {
195
+ validators.push(new item_model_1.Item({
196
+ name: 'video',
197
+ title: 'video',
198
+ icon: 'file-video'
199
+ }));
200
+ }
201
+ if (postType === post_type_1.PostType.Event) {
202
+ validators.push(new item_model_1.Item({
203
+ name: 'schedule',
204
+ title: 'eventSchedule',
205
+ icon: 'calendar-days'
206
+ }));
207
+ }
208
+ return validators;
209
+ }
210
+ validateForPublish() {
211
+ if (!this.status)
212
+ return false;
213
+ if (!this.author) {
214
+ return false;
215
+ }
216
+ if (this.description?.trim()?.length === 0) {
217
+ return false;
218
+ }
219
+ if (this.imageUrl?.trim()?.length === 0) {
220
+ return false;
221
+ }
222
+ if (this.feedUrl?.trim()?.length) {
223
+ return false;
224
+ }
225
+ const contentMandatory = [post_type_1.PostType.Article, post_type_1.PostType.Event, post_type_1.PostType.News];
226
+ if (contentMandatory.includes(this.type) && !this.content?.trim()) {
227
+ return false;
228
+ }
229
+ if (this.type === post_type_1.PostType.Book && !this.pdfUrl?.trim()) {
230
+ return false;
231
+ }
232
+ if (this.type === post_type_1.PostType.Audio && !this.mediaUrl?.trim()) {
233
+ return false;
234
+ }
235
+ if (this.type === post_type_1.PostType.Video && !this.mediaUrl?.trim()) {
236
+ return false;
237
+ }
238
+ if (this.type === post_type_1.PostType.Event && !this.info?.events || this.info.events?.length === 0) {
239
+ return false;
240
+ }
241
+ return true;
242
+ }
243
+ getStatusContext() {
244
+ if (!this.status)
245
+ return;
246
+ return this.status === common_1.StatusType.Draft
247
+ ? ui_1.Context.Secondary
248
+ : this.status === common_1.StatusType.ReadyForPublish
249
+ ? ui_1.Context.Info
250
+ : this.status === common_1.StatusType.Published
251
+ ? ui_1.Context.Success
252
+ : this.status === common_1.StatusType.Archived
253
+ ? ui_1.Context.Warning
254
+ : this.status === common_1.StatusType.Blocked
255
+ ? ui_1.Context.Danger
256
+ : ui_1.Context.Dark;
257
+ }
258
+ static getIcon(postType, custom) {
259
+ switch (postType) {
260
+ case post_type_1.PostType.Article:
261
+ return custom ? '/assets/icons/content-type-article.svg' : 'file-lines';
262
+ case post_type_1.PostType.Book:
263
+ return custom ? '/assets/icons/content-type-book.svg' : 'book-open';
264
+ case post_type_1.PostType.Audio:
265
+ return custom ? '/assets/icons/content-type-audio.svg' : 'headphones';
266
+ case post_type_1.PostType.Video:
267
+ return custom ? '/assets/icons/content-type-video.svg' : 'circle-play';
268
+ case post_type_1.PostType.News:
269
+ return custom ? '/assets/icons/content-type-news.svg' : 'newspaper';
270
+ case post_type_1.PostType.Event:
271
+ return custom ? '/assets/icons/content-type-event.svg' : 'microphone';
272
+ }
273
+ }
274
+ }
275
+ exports.Post = Post;
276
+ __decorate([
277
+ (0, class_transformer_1.Expose)({ groups: ['admin'] }),
278
+ (0, class_transformer_1.Type)(() => Number),
279
+ __metadata("design:type", Number)
280
+ ], Post.prototype, "id", void 0);
281
+ __decorate([
282
+ (0, class_transformer_1.Expose)(),
283
+ __metadata("design:type", String)
284
+ ], Post.prototype, "slug", void 0);
285
+ __decorate([
286
+ (0, class_transformer_1.Expose)(),
287
+ __metadata("design:type", String)
288
+ ], Post.prototype, "title", void 0);
289
+ __decorate([
290
+ (0, class_transformer_1.Expose)(),
291
+ __metadata("design:type", String)
292
+ ], Post.prototype, "description", void 0);
293
+ __decorate([
294
+ (0, class_transformer_1.Expose)(),
295
+ __metadata("design:type", String)
296
+ ], Post.prototype, "content", void 0);
297
+ __decorate([
298
+ (0, class_transformer_1.Expose)(),
299
+ (0, class_transformer_1.Transform)(({ obj }) => {
300
+ if (obj?.info?.events?.length > 0) {
301
+ obj.info.events = obj.info.events.map((i) => {
302
+ i.date = new Date(i.date);
303
+ return i;
304
+ });
305
+ }
306
+ return obj.info;
307
+ }),
308
+ __metadata("design:type", Object)
309
+ ], Post.prototype, "info", void 0);
310
+ __decorate([
311
+ (0, class_transformer_1.Expose)(),
312
+ (0, class_transformer_1.Type)(() => Number),
313
+ __metadata("design:type", Number)
314
+ ], Post.prototype, "duration", void 0);
315
+ __decorate([
316
+ (0, class_transformer_1.Expose)(),
317
+ (0, class_transformer_1.Transform)(({ obj }) => Post.getIcon(obj?.postType)),
318
+ __metadata("design:type", Object)
319
+ ], Post.prototype, "icon", void 0);
320
+ __decorate([
321
+ (0, class_transformer_1.Expose)(),
322
+ (0, class_transformer_1.Transform)(({ obj }) => Post.getIcon(obj?.postType, true)),
323
+ __metadata("design:type", String)
324
+ ], Post.prototype, "svgIcon", void 0);
325
+ __decorate([
326
+ (0, class_transformer_1.Expose)(),
327
+ __metadata("design:type", String)
328
+ ], Post.prototype, "pdfUrl", void 0);
329
+ __decorate([
330
+ (0, class_transformer_1.Expose)(),
331
+ __metadata("design:type", String)
332
+ ], Post.prototype, "imageUrl", void 0);
333
+ __decorate([
334
+ (0, class_transformer_1.Expose)(),
335
+ __metadata("design:type", String)
336
+ ], Post.prototype, "feedUrl", void 0);
337
+ __decorate([
338
+ (0, class_transformer_1.Expose)(),
339
+ __metadata("design:type", String)
340
+ ], Post.prototype, "mediaUrl", void 0);
341
+ __decorate([
342
+ (0, class_transformer_1.Expose)(),
343
+ __metadata("design:type", String)
344
+ ], Post.prototype, "externUrl", void 0);
345
+ __decorate([
346
+ (0, class_transformer_1.Expose)({ groups: ['admin'] }),
347
+ __metadata("design:type", String)
348
+ ], Post.prototype, "status", void 0);
349
+ __decorate([
350
+ (0, class_transformer_1.Expose)(),
351
+ __metadata("design:type", String)
352
+ ], Post.prototype, "postType", void 0);
353
+ __decorate([
354
+ (0, class_transformer_1.Expose)({ groups: ['admin'] }),
355
+ (0, class_transformer_1.Type)(() => Number),
356
+ __metadata("design:type", Number)
357
+ ], Post.prototype, "weight", void 0);
358
+ __decorate([
359
+ (0, class_transformer_1.Expose)(),
360
+ (0, class_transformer_1.Type)(() => popularity_1.Popularity),
361
+ (0, class_transformer_1.Transform)(({ obj }) => popularity_1.Popularity.get(obj.weight)),
362
+ __metadata("design:type", popularity_1.Popularity)
363
+ ], Post.prototype, "popularity", void 0);
364
+ __decorate([
365
+ (0, class_transformer_1.Expose)(),
366
+ (0, class_transformer_1.Type)(() => Number),
367
+ __metadata("design:type", Number)
368
+ ], Post.prototype, "totalSeen", void 0);
369
+ __decorate([
370
+ (0, class_transformer_1.Expose)(),
371
+ (0, class_transformer_1.Type)(() => Number),
372
+ __metadata("design:type", Number)
373
+ ], Post.prototype, "totalOpens", void 0);
374
+ __decorate([
375
+ (0, class_transformer_1.Expose)(),
376
+ (0, class_transformer_1.Type)(() => Number),
377
+ __metadata("design:type", Number)
378
+ ], Post.prototype, "totalLikes", void 0);
379
+ __decorate([
380
+ (0, class_transformer_1.Expose)(),
381
+ (0, class_transformer_1.Type)(() => Number),
382
+ __metadata("design:type", Number)
383
+ ], Post.prototype, "totalShares", void 0);
384
+ __decorate([
385
+ (0, class_transformer_1.Expose)(),
386
+ (0, class_transformer_1.Type)(() => Number),
387
+ __metadata("design:type", Number)
388
+ ], Post.prototype, "totalBookmarks", void 0);
389
+ __decorate([
390
+ (0, class_transformer_1.Expose)(),
391
+ (0, class_transformer_1.Type)(() => Number),
392
+ __metadata("design:type", Number)
393
+ ], Post.prototype, "totalDownloads", void 0);
394
+ __decorate([
395
+ (0, class_transformer_1.Expose)(),
396
+ (0, class_transformer_1.Type)(() => Number),
397
+ __metadata("design:type", Number)
398
+ ], Post.prototype, "totalFeedbacks", void 0);
399
+ __decorate([
400
+ (0, class_transformer_1.Expose)(),
401
+ (0, class_transformer_1.Type)(() => metric_1.Metric),
402
+ (0, class_transformer_1.Transform)(({ obj }) => metric_1.Metric.getByPost(obj)),
403
+ __metadata("design:type", Array)
404
+ ], Post.prototype, "metrics", void 0);
405
+ __decorate([
406
+ (0, class_transformer_1.Expose)({ groups: ['admin'] }),
407
+ (0, class_transformer_1.Type)(() => user_model_1.User),
408
+ __metadata("design:type", user_model_1.User)
409
+ ], Post.prototype, "createdBy", void 0);
410
+ __decorate([
411
+ (0, class_transformer_1.Expose)(),
412
+ (0, class_transformer_1.Type)(() => Date),
413
+ __metadata("design:type", Date)
414
+ ], Post.prototype, "createdOn", void 0);
415
+ __decorate([
416
+ (0, class_transformer_1.Expose)({ groups: ['admin'] }),
417
+ (0, class_transformer_1.Type)(() => user_model_1.User),
418
+ __metadata("design:type", user_model_1.User)
419
+ ], Post.prototype, "updatedBy", void 0);
420
+ __decorate([
421
+ (0, class_transformer_1.Expose)({ groups: ['admin'] }),
422
+ (0, class_transformer_1.Type)(() => Date),
423
+ __metadata("design:type", Date)
424
+ ], Post.prototype, "updatedOn", void 0);
425
+ __decorate([
426
+ (0, class_transformer_1.Expose)({ groups: ['admin'] }),
427
+ (0, class_transformer_1.Type)(() => user_model_1.User),
428
+ __metadata("design:type", user_model_1.User)
429
+ ], Post.prototype, "statusChangedBy", void 0);
430
+ __decorate([
431
+ (0, class_transformer_1.Expose)({ groups: ['admin'] }),
432
+ (0, class_transformer_1.Type)(() => Date),
433
+ __metadata("design:type", Date)
434
+ ], Post.prototype, "statusChangedOn", void 0);
435
+ __decorate([
436
+ (0, class_transformer_1.Expose)({ groups: ['admin'] }),
437
+ (0, class_transformer_1.Type)(() => user_model_1.User),
438
+ __metadata("design:type", user_model_1.User)
439
+ ], Post.prototype, "publishedBy", void 0);
440
+ __decorate([
441
+ (0, class_transformer_1.Expose)(),
442
+ (0, class_transformer_1.Type)(() => Date),
443
+ __metadata("design:type", Date)
444
+ ], Post.prototype, "publishedOn", void 0);
445
+ __decorate([
446
+ (0, class_transformer_1.Expose)({ groups: ['admin'] }),
447
+ (0, class_transformer_1.Type)(() => user_model_1.User),
448
+ __metadata("design:type", user_model_1.User)
449
+ ], Post.prototype, "blockedBy", void 0);
450
+ __decorate([
451
+ (0, class_transformer_1.Expose)({ groups: ['admin'] }),
452
+ (0, class_transformer_1.Type)(() => Date),
453
+ __metadata("design:type", Date)
454
+ ], Post.prototype, "blockedOn", void 0);
455
+ __decorate([
456
+ (0, class_transformer_1.Expose)(),
457
+ (0, class_transformer_1.Type)(() => publisher_1.Publisher),
458
+ __metadata("design:type", publisher_1.Publisher)
459
+ ], Post.prototype, "publisher", void 0);
460
+ __decorate([
461
+ (0, class_transformer_1.Expose)(),
462
+ (0, class_transformer_1.Type)(() => author_1.Author),
463
+ __metadata("design:type", author_1.Author)
464
+ ], Post.prototype, "author", void 0);
465
+ __decorate([
466
+ (0, class_transformer_1.Type)(() => topic_1.Topic),
467
+ __metadata("design:type", Array)
468
+ ], Post.prototype, "topics", void 0);
469
+ __decorate([
470
+ (0, class_transformer_1.Expose)(),
471
+ (0, class_transformer_1.Type)(() => feedback_1.Feedback),
472
+ __metadata("design:type", feedback_1.Feedback)
473
+ ], Post.prototype, "feedback", void 0);
474
+ __decorate([
475
+ (0, class_transformer_1.Expose)(),
476
+ (0, class_transformer_1.Type)(() => Post),
477
+ __metadata("design:type", Array)
478
+ ], Post.prototype, "collection", void 0);
479
+ __decorate([
480
+ (0, class_transformer_1.Expose)(),
481
+ (0, class_transformer_1.Type)(() => gallery_1.GalleryItem),
482
+ __metadata("design:type", Array)
483
+ ], Post.prototype, "gallery", void 0);
484
+ __decorate([
485
+ (0, class_transformer_1.Expose)({ groups: ['admin'] }),
486
+ __metadata("design:type", Function),
487
+ __metadata("design:paramtypes", []),
488
+ __metadata("design:returntype", Object)
489
+ ], Post.prototype, "getStatusAuthorizations", null);
490
+ __decorate([
491
+ (0, class_transformer_1.Expose)({ groups: ['admin'] }),
492
+ __metadata("design:type", Function),
493
+ __metadata("design:paramtypes", []),
494
+ __metadata("design:returntype", Array)
495
+ ], Post.prototype, "getPublishValidators", null);
496
+ __decorate([
497
+ (0, class_transformer_1.Expose)({ groups: ['admin'] }),
498
+ __metadata("design:type", Function),
499
+ __metadata("design:paramtypes", []),
500
+ __metadata("design:returntype", Boolean)
501
+ ], Post.prototype, "validateForPublish", null);
502
+ __decorate([
503
+ (0, class_transformer_1.Expose)({ groups: ['admin'] }),
504
+ __metadata("design:type", Function),
505
+ __metadata("design:paramtypes", []),
506
+ __metadata("design:returntype", String)
507
+ ], Post.prototype, "getStatusContext", null);
508
+ __decorate([
509
+ (0, class_transformer_1.Expose)(),
510
+ __metadata("design:type", Function),
511
+ __metadata("design:paramtypes", [String, Boolean]),
512
+ __metadata("design:returntype", void 0)
513
+ ], Post, "getIcon", null);
514
+ //# sourceMappingURL=post.model.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"post.model.js","sourceRoot":"","sources":["../../src/post/post.model.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,yDAA4D;AAE5D,mDAA0C;AAC1C,sCAAmC;AACnC,4CAAyC;AACzC,oCAAiC;AACjC,wCAAyC;AACzC,0CAAuC;AACvC,mDAA0C;AAC1C,sCAAmC;AACnC,sCAAuC;AACvC,2CAAuC;AACvC,8BAA+B;AAC/B,8CAA2C;AAI3C,MAAa,IAAI;IAIhB,EAAE,CAAS;IAGX,IAAI,CAAS;IAKb,KAAK,CAAS;IAGd,WAAW,CAAS;IAGpB,OAAO,CAAS;IAahB,IAAI,CAAmB;IAIvB,QAAQ,CAAS;IAOjB,IAAI,CAAW;IAOf,OAAO,CAAS;IAKhB,MAAM,CAAS;IAGf,QAAQ,CAAS;IAGjB,OAAO,CAAS;IAGhB,QAAQ,CAAS;IAGjB,SAAS,CAAS;IAKlB,MAAM,CAAa;IAGnB,QAAQ,CAAW;IAInB,MAAM,CAAS;IAKf,UAAU,CAAa;IAMvB,SAAS,CAAS;IAIlB,UAAU,CAAS;IAInB,UAAU,CAAS;IAInB,WAAW,CAAS;IAIpB,cAAc,CAAS;IAIvB,cAAc,CAAS;IAIvB,cAAc,CAAS;IAKvB,OAAO,CAAW;IAMlB,SAAS,CAAO;IAIhB,SAAS,CAAO;IAIhB,SAAS,CAAO;IAIhB,SAAS,CAAO;IAIhB,eAAe,CAAO;IAItB,eAAe,CAAO;IAItB,WAAW,CAAO;IAIlB,WAAW,CAAO;IAIlB,S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E,CAAC,qBAAS,CAAC;8BACX,qBAAS;uCAAC;AAIrB;IAFC,IAAA,0BAAM,GAAE;IACR,IAAA,wBAAI,EAAC,GAAG,EAAE,CAAC,eAAM,CAAC;8BACX,eAAM;oCAAC;AAGf;IADC,IAAA,wBAAI,EAAC,GAAG,EAAE,CAAC,aAAK,CAAC;;oCACF;AAIhB;IAFC,IAAA,0BAAM,GAAE;IACR,IAAA,wBAAI,EAAC,GAAG,EAAE,CAAC,mBAAQ,CAAC;8BACX,mBAAQ;sCAAC;AAInB;IAFC,IAAA,0BAAM,GAAE;IACR,IAAA,wBAAI,EAAC,GAAG,EAAE,CAAC,IAAI,CAAC;;wCACC;AAIlB;IAFC,IAAA,0BAAM,GAAE;IACR,IAAA,wBAAI,EAAC,GAAG,EAAE,CAAC,qBAAW,CAAC;;qCACD;AAmBvB;IADC,IAAA,0BAAM,EAAC,EAAE,MAAM,EAAE,CAAC,OAAO,CAAC,EAAE,CAAC;;;;mDA+E7B;AAQD;IADC,IAAA,0BAAM,EAAC,EAAE,MAAM,EAAE,CAAC,OAAO,CAAC,EAAE,CAAC;;;;gDAuF7B;AAQD;IADC,IAAA,0BAAM,EAAC,EAAE,MAAM,EAAE,CAAC,OAAO,CAAC,EAAE,CAAC;;;;8CAqD7B;AAQD;IADC,IAAA,0BAAM,EAAC,EAAE,MAAM,EAAE,CAAC,OAAO,CAAC,EAAE,CAAC;;;;4CAgB7B;AAGM;IADN,IAAA,0BAAM,GAAE;;;;yBAgBR"}
@@ -0,0 +1,8 @@
1
+ export declare enum PostType {
2
+ Article = "ARTICLE",
3
+ Book = "BOOK",
4
+ Video = "VIDEO",
5
+ Audio = "AUDIO",
6
+ Event = "EVENT",
7
+ News = "NEWS"
8
+ }
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.PostType = void 0;
4
+ var PostType;
5
+ (function (PostType) {
6
+ PostType["Article"] = "ARTICLE";
7
+ PostType["Book"] = "BOOK";
8
+ PostType["Video"] = "VIDEO";
9
+ PostType["Audio"] = "AUDIO";
10
+ PostType["Event"] = "EVENT";
11
+ PostType["News"] = "NEWS";
12
+ })(PostType || (exports.PostType = PostType = {}));
13
+ //# sourceMappingURL=post.type.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"post.type.js","sourceRoot":"","sources":["../../src/post/post.type.ts"],"names":[],"mappings":";;;AAGA,IAAY,QA+BX;AA/BD,WAAY,QAAQ;IAKnB,+BAAmB,CAAA;IAKnB,yBAAa,CAAA;IAKb,2BAAe,CAAA;IAKf,2BAAe,CAAA;IAKf,2BAAe,CAAA;IAKf,yBAAa,CAAA;AACd,CAAC,EA/BW,QAAQ,wBAAR,QAAQ,QA+BnB"}
@@ -0,0 +1,2 @@
1
+ export * from './promotion.dto';
2
+ export * from './promotion.model';
@@ -0,0 +1,19 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./promotion.dto"), exports);
18
+ __exportStar(require("./promotion.model"), exports);
19
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/promotion/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,kDAAgC;AAChC,oDAAkC"}
@@ -0,0 +1,5 @@
1
+ export declare class CreatePromotionDto {
2
+ title: string;
3
+ startDate: Date;
4
+ endDate: Date;
5
+ }
@@ -0,0 +1,38 @@
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.CreatePromotionDto = void 0;
13
+ const class_validator_1 = require("class-validator");
14
+ const class_transformer_1 = require("class-transformer");
15
+ class CreatePromotionDto {
16
+ title;
17
+ startDate;
18
+ endDate;
19
+ }
20
+ exports.CreatePromotionDto = CreatePromotionDto;
21
+ __decorate([
22
+ (0, class_validator_1.IsNotEmpty)(),
23
+ (0, class_validator_1.IsString)(),
24
+ __metadata("design:type", String)
25
+ ], CreatePromotionDto.prototype, "title", void 0);
26
+ __decorate([
27
+ (0, class_validator_1.IsNotEmpty)(),
28
+ (0, class_validator_1.IsDate)(),
29
+ (0, class_transformer_1.Type)(() => Date),
30
+ __metadata("design:type", Date)
31
+ ], CreatePromotionDto.prototype, "startDate", void 0);
32
+ __decorate([
33
+ (0, class_validator_1.IsNotEmpty)(),
34
+ (0, class_validator_1.IsDate)(),
35
+ (0, class_transformer_1.Type)(() => Date),
36
+ __metadata("design:type", Date)
37
+ ], CreatePromotionDto.prototype, "endDate", void 0);
38
+ //# sourceMappingURL=promotion.dto.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"promotion.dto.js","sourceRoot":"","sources":["../../src/promotion/promotion.dto.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qDAA+D;AAC/D,yDAAyC;AAEzC,MAAa,kBAAkB;IAI9B,KAAK,CAAS;IAKd,SAAS,CAAO;IAKhB,OAAO,CAAO;CACd;AAfD,gDAeC;AAXA;IAFC,IAAA,4BAAU,GAAE;IACZ,IAAA,0BAAQ,GAAE;;iDACG;AAKd;IAHC,IAAA,4BAAU,GAAE;IACZ,IAAA,wBAAM,GAAE;IACR,IAAA,wBAAI,EAAC,GAAG,EAAE,CAAC,IAAI,CAAC;8BACN,IAAI;qDAAC;AAKhB;IAHC,IAAA,4BAAU,GAAE;IACZ,IAAA,wBAAM,GAAE;IACR,IAAA,wBAAI,EAAC,GAAG,EAAE,CAAC,IAAI,CAAC;8BACR,IAAI;mDAAC"}
@@ -0,0 +1,24 @@
1
+ import { StatusLabel, StatusType } from "../common";
2
+ import { Metric } from "../metric";
3
+ import { User } from "../user";
4
+ export declare class Promotion {
5
+ id: number;
6
+ title: string;
7
+ imageUrl: string;
8
+ feedUrl: string;
9
+ url: string;
10
+ status: StatusType;
11
+ startDate: Date;
12
+ endDate: Date;
13
+ label: StatusLabel;
14
+ metrics: Metric[];
15
+ createdBy: User;
16
+ createdOn: Date;
17
+ updatedBy: User;
18
+ updatedOn: Date;
19
+ statusChangedBy: User;
20
+ statusChangedOn: Date;
21
+ publishedBy: User;
22
+ publishedOn: Date;
23
+ constructor(props?: Partial<Promotion>);
24
+ }