@ozdao/prometheus-framework 0.2.155 → 0.2.157

Sign up to get free protection for your applications and to get access to all the features.
Files changed (321) hide show
  1. package/dist/_virtual/_commonjsHelpers.cjs +1 -1
  2. package/dist/_virtual/_commonjsHelpers.js +5 -3
  3. package/dist/_virtual/purify.cjs +1 -0
  4. package/dist/_virtual/purify.js +4 -0
  5. package/dist/builder.js +822 -0
  6. package/dist/builder.mjs +801 -0
  7. package/dist/{main-D_RRsfEH.mjs → main-Ba3SEUWZ.mjs} +1812 -1774
  8. package/dist/main-ldzk-jIP.js +92 -0
  9. package/dist/main.css +1 -1
  10. package/dist/node_modules/dompurify/dist/purify.cjs +2 -0
  11. package/dist/node_modules/dompurify/dist/purify.js +531 -0
  12. package/dist/node_modules/isomorphic-dompurify/browser.cjs +1 -0
  13. package/dist/node_modules/isomorphic-dompurify/browser.js +7 -0
  14. package/dist/products.server.js +1 -1
  15. package/dist/products.server.mjs +1 -1
  16. package/dist/prometheus-framework/node_modules/uuid/dist/esm-browser/regex.cjs +1 -0
  17. package/dist/prometheus-framework/node_modules/uuid/dist/esm-browser/regex.js +4 -0
  18. package/dist/prometheus-framework/node_modules/uuid/dist/esm-browser/rng.cjs +1 -0
  19. package/dist/prometheus-framework/node_modules/uuid/dist/esm-browser/rng.js +9 -0
  20. package/dist/prometheus-framework/node_modules/uuid/dist/esm-browser/stringify.cjs +1 -0
  21. package/dist/prometheus-framework/node_modules/uuid/dist/esm-browser/stringify.js +13 -0
  22. package/dist/prometheus-framework/node_modules/uuid/dist/esm-browser/v4.cjs +1 -0
  23. package/dist/prometheus-framework/node_modules/uuid/dist/esm-browser/v4.js +10 -0
  24. package/dist/prometheus-framework/node_modules/uuid/dist/esm-browser/validate.cjs +1 -0
  25. package/dist/prometheus-framework/node_modules/uuid/dist/esm-browser/validate.js +7 -0
  26. package/dist/prometheus-framework/src/components/Feed/Feed.vue.cjs +1 -1
  27. package/dist/prometheus-framework/src/components/Feed/Feed.vue.js +1 -1
  28. package/dist/prometheus-framework/src/components/Field/Field.vue2.cjs +1 -1
  29. package/dist/prometheus-framework/src/components/Field/Field.vue2.js +47 -30
  30. package/dist/prometheus-framework/src/components/FieldBig/FieldBig.vue.js +9 -9
  31. package/dist/prometheus-framework/src/components/Popup/Popup.vue2.cjs +1 -1
  32. package/dist/prometheus-framework/src/components/Popup/Popup.vue2.js +10 -10
  33. package/dist/prometheus-framework/src/modules/auth/components/pages/EnterPassword.vue.js +14 -14
  34. package/dist/prometheus-framework/src/modules/auth/components/pages/Invite.vue.js +9 -9
  35. package/dist/prometheus-framework/src/modules/auth/components/pages/ResetPassword.vue.js +11 -11
  36. package/dist/prometheus-framework/src/modules/auth/components/pages/SignIn.vue.js +34 -34
  37. package/dist/prometheus-framework/src/modules/auth/components/pages/SignUp.vue.js +27 -27
  38. package/dist/prometheus-framework/src/modules/backoffice/components/layouts/Backoffice.vue.cjs +1 -0
  39. package/dist/prometheus-framework/src/modules/backoffice/components/layouts/Backoffice.vue.js +58 -0
  40. package/dist/prometheus-framework/src/modules/backoffice/components/pages/Dashboard.vue.cjs +1 -1
  41. package/dist/prometheus-framework/src/modules/backoffice/components/pages/Dashboard.vue.js +11 -180
  42. package/dist/prometheus-framework/src/modules/backoffice/components/partials/Sidebar.vue.cjs +1 -0
  43. package/dist/prometheus-framework/src/modules/backoffice/components/partials/Sidebar.vue.js +190 -0
  44. package/dist/prometheus-framework/src/modules/backoffice/router/backoffice.cjs +1 -1
  45. package/dist/prometheus-framework/src/modules/backoffice/router/backoffice.js +9 -7
  46. package/dist/prometheus-framework/src/modules/community/components/blocks/CardBlogpost.vue.cjs +1 -1
  47. package/dist/prometheus-framework/src/modules/community/components/blocks/CardBlogpost.vue.js +48 -43
  48. package/dist/prometheus-framework/src/modules/community/components/layouts/Community.vue.cjs +1 -1
  49. package/dist/prometheus-framework/src/modules/community/components/layouts/Community.vue.js +1 -1
  50. package/dist/prometheus-framework/src/modules/community/components/pages/BlogPost.vue.cjs +1 -1
  51. package/dist/prometheus-framework/src/modules/community/components/pages/BlogPost.vue.js +41 -63
  52. package/dist/prometheus-framework/src/modules/community/components/pages/Community.vue.cjs +1 -1
  53. package/dist/prometheus-framework/src/modules/community/components/pages/Community.vue.js +1 -1
  54. package/dist/prometheus-framework/src/modules/community/components/pages/CreateBlogPost.vue.cjs +1 -1
  55. package/dist/prometheus-framework/src/modules/community/components/pages/CreateBlogPost.vue.js +37 -36
  56. package/dist/prometheus-framework/src/modules/community/components/sections/Comments.vue.cjs +1 -1
  57. package/dist/prometheus-framework/src/modules/community/components/sections/Comments.vue.js +5 -5
  58. package/dist/prometheus-framework/src/modules/community/components/sections/HotPosts.vue.cjs +1 -1
  59. package/dist/prometheus-framework/src/modules/community/components/sections/HotPosts.vue.js +1 -1
  60. package/dist/prometheus-framework/src/modules/community/router/blogposts.cjs +1 -1
  61. package/dist/prometheus-framework/src/modules/community/router/blogposts.js +3 -0
  62. package/dist/prometheus-framework/src/modules/constructor/components/elements/Embed.vue.js +13 -13
  63. package/dist/prometheus-framework/src/modules/constructor/components/elements/Textarea.vue2.cjs +1 -5
  64. package/dist/prometheus-framework/src/modules/constructor/components/elements/Textarea.vue2.js +105 -53
  65. package/dist/prometheus-framework/src/modules/constructor/components/sections/Constructor.vue.cjs +1 -1
  66. package/dist/prometheus-framework/src/modules/constructor/components/sections/Constructor.vue.js +92 -98
  67. package/dist/prometheus-framework/src/modules/constructor/components/sections/Viewer.vue.cjs +1 -0
  68. package/dist/prometheus-framework/src/modules/constructor/components/sections/Viewer.vue.js +39 -0
  69. package/dist/prometheus-framework/src/modules/events/components/blocks/CardEvent.vue.cjs +1 -1
  70. package/dist/prometheus-framework/src/modules/events/components/blocks/CardEvent.vue.js +1 -1
  71. package/dist/prometheus-framework/src/modules/events/components/elements/ButtonCheck.vue.cjs +1 -1
  72. package/dist/prometheus-framework/src/modules/events/components/elements/ButtonCheck.vue.js +1 -1
  73. package/dist/prometheus-framework/src/modules/events/components/pages/EditEvent.vue.cjs +1 -1
  74. package/dist/prometheus-framework/src/modules/events/components/pages/EditEvent.vue.js +13 -12
  75. package/dist/prometheus-framework/src/modules/events/components/pages/EditEventTickets.vue.cjs +1 -1
  76. package/dist/prometheus-framework/src/modules/events/components/pages/EditEventTickets.vue.js +19 -19
  77. package/dist/prometheus-framework/src/modules/gallery/components/pages/Gallery.vue.cjs +1 -1
  78. package/dist/prometheus-framework/src/modules/gallery/components/pages/Gallery.vue.js +32 -32
  79. package/dist/prometheus-framework/src/modules/gallery/components/sections/BackofficeGallery.vue.cjs +1 -1
  80. package/dist/prometheus-framework/src/modules/gallery/components/sections/BackofficeGallery.vue.js +3 -3
  81. package/dist/prometheus-framework/src/modules/globals/components/blocks/BlockSearch.vue.js +7 -7
  82. package/dist/prometheus-framework/src/modules/globals/components/blocks/CardHeader.vue.cjs +1 -1
  83. package/dist/prometheus-framework/src/modules/globals/components/blocks/CardHeader.vue.js +1 -1
  84. package/dist/prometheus-framework/src/modules/globals/components/sections/SectionPageTitle.vue.cjs +1 -1
  85. package/dist/prometheus-framework/src/modules/globals/components/sections/SectionPageTitle.vue.js +2 -2
  86. package/dist/prometheus-framework/src/modules/legal/components/pages/Legal.vue.cjs +1 -1
  87. package/dist/prometheus-framework/src/modules/legal/components/pages/Legal.vue.js +1 -1
  88. package/dist/prometheus-framework/src/modules/middlewares/client/auth.validation.cjs +1 -1
  89. package/dist/prometheus-framework/src/modules/middlewares/client/auth.validation.js +13 -15
  90. package/dist/prometheus-framework/src/modules/orders/components/pages/OrderBackoffice.vue.cjs +1 -1
  91. package/dist/prometheus-framework/src/modules/orders/components/pages/OrderBackoffice.vue.js +1 -1
  92. package/dist/prometheus-framework/src/modules/orders/components/pages/OrderCreateBackoffice.vue.cjs +1 -1
  93. package/dist/prometheus-framework/src/modules/orders/components/pages/OrderCreateBackoffice.vue.js +2 -2
  94. package/dist/prometheus-framework/src/modules/orders/components/sections/FormAddCustomer.vue.cjs +1 -1
  95. package/dist/prometheus-framework/src/modules/orders/components/sections/FormAddCustomer.vue.js +1 -1
  96. package/dist/prometheus-framework/src/modules/orders/components/sections/FormCustomerDetails.vue.cjs +1 -1
  97. package/dist/prometheus-framework/src/modules/orders/components/sections/FormCustomerDetails.vue.js +4 -4
  98. package/dist/prometheus-framework/src/modules/orders/components/sections/FormDelivery.vue.js +8 -8
  99. package/dist/prometheus-framework/src/modules/orders/components/sections/FormPayment.vue.cjs +1 -1
  100. package/dist/prometheus-framework/src/modules/orders/components/sections/FormPayment.vue.js +1 -1
  101. package/dist/prometheus-framework/src/modules/orders/orders.client.cjs +1 -1
  102. package/dist/prometheus-framework/src/modules/orders/orders.client.js +34 -33
  103. package/dist/prometheus-framework/src/modules/organizations/components/blocks/CardOrganization.vue.cjs +1 -1
  104. package/dist/prometheus-framework/src/modules/organizations/components/blocks/CardOrganization.vue.js +1 -1
  105. package/dist/prometheus-framework/src/modules/organizations/components/pages/DepartmentEdit.vue.cjs +1 -1
  106. package/dist/prometheus-framework/src/modules/organizations/components/pages/DepartmentEdit.vue.js +2 -2
  107. package/dist/prometheus-framework/src/modules/organizations/components/pages/Members.vue.cjs +1 -1
  108. package/dist/prometheus-framework/src/modules/organizations/components/pages/Members.vue.js +2 -2
  109. package/dist/prometheus-framework/src/modules/organizations/components/pages/Organization.vue.cjs +1 -1
  110. package/dist/prometheus-framework/src/modules/organizations/components/pages/Organization.vue.js +1 -1
  111. package/dist/prometheus-framework/src/modules/organizations/components/pages/OrganizationBackoffice.vue.cjs +1 -1
  112. package/dist/prometheus-framework/src/modules/organizations/components/pages/OrganizationBackoffice.vue.js +1 -1
  113. package/dist/prometheus-framework/src/modules/organizations/components/pages/OrganizationEdit.vue.cjs +1 -1
  114. package/dist/prometheus-framework/src/modules/organizations/components/pages/OrganizationEdit.vue.js +14 -14
  115. package/dist/prometheus-framework/src/modules/organizations/components/sections/DetailsTab.vue.cjs +1 -1
  116. package/dist/prometheus-framework/src/modules/organizations/components/sections/DetailsTab.vue.js +2 -2
  117. package/dist/prometheus-framework/src/modules/organizations/components/sections/Documents.vue.cjs +1 -1
  118. package/dist/prometheus-framework/src/modules/organizations/components/sections/Documents.vue.js +10 -10
  119. package/dist/prometheus-framework/src/modules/organizations/components/sections/MembersAdd.vue.cjs +1 -1
  120. package/dist/prometheus-framework/src/modules/organizations/components/sections/MembersAdd.vue.js +5 -5
  121. package/dist/prometheus-framework/src/modules/organizations/components/sections/Organizations.vue.cjs +1 -1
  122. package/dist/prometheus-framework/src/modules/organizations/components/sections/Organizations.vue.js +4 -4
  123. package/dist/prometheus-framework/src/modules/organizations/router/organizations.cjs +1 -1
  124. package/dist/prometheus-framework/src/modules/organizations/router/organizations.js +13 -7
  125. package/dist/prometheus-framework/src/modules/products/components/blocks/CardPosition.vue.cjs +1 -1
  126. package/dist/prometheus-framework/src/modules/products/components/blocks/CardPosition.vue.js +18 -18
  127. package/dist/prometheus-framework/src/modules/products/components/blocks/ImagesThumbnails.vue.cjs +1 -1
  128. package/dist/prometheus-framework/src/modules/products/components/blocks/ImagesThumbnails.vue.js +1 -1
  129. package/dist/prometheus-framework/src/modules/products/components/blocks/LeftoverPositions.vue.js +6 -6
  130. package/dist/prometheus-framework/src/modules/products/components/pages/CategoryEdit.vue.cjs +1 -1
  131. package/dist/prometheus-framework/src/modules/products/components/pages/CategoryEdit.vue.js +11 -11
  132. package/dist/prometheus-framework/src/modules/products/components/pages/EditLeftover.vue.cjs +1 -1
  133. package/dist/prometheus-framework/src/modules/products/components/pages/EditLeftover.vue.js +17 -17
  134. package/dist/prometheus-framework/src/modules/products/components/pages/ProductEdit.vue.cjs +1 -1
  135. package/dist/prometheus-framework/src/modules/products/components/pages/ProductEdit.vue.js +30 -30
  136. package/dist/prometheus-framework/src/modules/products/components/sections/EditModifications.vue.js +9 -9
  137. package/dist/prometheus-framework/src/modules/products/components/sections/EditProductInfo.vue.cjs +1 -1
  138. package/dist/prometheus-framework/src/modules/products/components/sections/EditProductInfo.vue.js +3 -3
  139. package/dist/prometheus-framework/src/modules/reports/components/sections/FormReport.vue.cjs +1 -1
  140. package/dist/prometheus-framework/src/modules/reports/components/sections/FormReport.vue.js +2 -2
  141. package/dist/prometheus-framework/src/modules/spots/components/blocks/CardSpot.vue.cjs +1 -1
  142. package/dist/prometheus-framework/src/modules/spots/components/blocks/CardSpot.vue.js +1 -1
  143. package/dist/prometheus-framework/src/modules/spots/components/blocks/SpotMemberModify.vue.cjs +1 -1
  144. package/dist/prometheus-framework/src/modules/spots/components/blocks/SpotMemberModify.vue.js +1 -1
  145. package/dist/prometheus-framework/src/modules/spots/components/layouts/Spots.vue.cjs +1 -1
  146. package/dist/prometheus-framework/src/modules/spots/components/layouts/Spots.vue.js +1 -1
  147. package/dist/prometheus-framework/src/modules/spots/components/pages/SpotEdit.vue.cjs +1 -1
  148. package/dist/prometheus-framework/src/modules/spots/components/pages/SpotEdit.vue.js +16 -16
  149. package/dist/prometheus-framework/src/modules/spots/router/spots.cjs +1 -1
  150. package/dist/prometheus-framework/src/modules/spots/router/spots.js +4 -0
  151. package/dist/prometheus-framework/src/modules/users/components/pages/Profile.vue.cjs +1 -1
  152. package/dist/prometheus-framework/src/modules/users/components/pages/Profile.vue.js +2 -2
  153. package/dist/prometheus-framework/src/modules/users/components/pages/ProfileEdit.vue.js +22 -22
  154. package/dist/prometheus-framework/src/modules/wallet/views/components/blocks/CardDeposit.vue.js +4 -4
  155. package/dist/prometheus-framework/src/modules/wallet/views/components/blocks/CryptoDeposit.vue.cjs +1 -1
  156. package/dist/prometheus-framework/src/modules/wallet/views/components/blocks/CryptoDeposit.vue.js +17 -17
  157. package/dist/prometheus-framework/src/modules/wallet/views/components/pages/Wallet.vue.cjs +1 -1
  158. package/dist/prometheus-framework/src/modules/wallet/views/components/pages/Wallet.vue.js +4 -4
  159. package/dist/prometheus-framework.cjs.js +1 -1
  160. package/dist/prometheus-framework.es.js +1 -1
  161. package/dist/style.css +1 -1
  162. package/dist/{web-3rnOWrQO.mjs → web-CT2tGYho.mjs} +1 -1
  163. package/dist/{web-C04IcLk4.js → web-DWjMBTNi.js} +1 -1
  164. package/package.json +3 -2
  165. package/src/builder/builder.js +14 -0
  166. package/src/builder/modes/spa.dev.js +100 -0
  167. package/src/builder/modes/spa.prod.js +59 -0
  168. package/src/builder/modes/ssr.dev.js +184 -0
  169. package/src/builder/modes/ssr.prod.js +76 -0
  170. package/src/builder/ssr/ssr-render-html.js +57 -0
  171. package/src/builder/ssr/ssr-transform-webpack-stats.js +54 -0
  172. package/src/builder/templates/page.html +37 -0
  173. package/src/builder/templates/screen.html +33 -0
  174. package/src/builder/utils/hot-reload.js +5 -0
  175. package/src/builder/webpack/index.js +13 -0
  176. package/src/builder/webpack/webpack.config.base.js +127 -0
  177. package/src/builder/webpack/webpack.config.client.js +78 -0
  178. package/src/builder/webpack/webpack.config.server.js +31 -0
  179. package/src/builder/webpack/webpack.config.spa.js +80 -0
  180. package/src/builder/webpack/webpack.config.ssr.js +57 -0
  181. package/src/components/Breadcrumbs/Breadcrumbs.vue +39 -16
  182. package/src/components/Field/Field.vue +21 -2
  183. package/src/components/Popup/Popup.vue +2 -2
  184. package/src/modules/auth/store/auth.js +1 -2
  185. package/src/modules/backoffice/components/layouts/Backoffice.vue +36 -62
  186. package/src/modules/backoffice/components/pages/Dashboard.vue +2 -125
  187. package/src/modules/backoffice/components/partials/Sidebar.vue +176 -0
  188. package/src/modules/backoffice/router/admin.js +0 -15
  189. package/src/modules/backoffice/router/backoffice.js +5 -1
  190. package/src/modules/community/components/blocks/CardBlogpost.vue +6 -1
  191. package/src/modules/community/components/pages/BlogPost.vue +30 -67
  192. package/src/modules/community/components/sections/Comments.vue +1 -1
  193. package/src/modules/community/router/blogposts.js +4 -0
  194. package/src/modules/constructor/components/elements/Textarea.vue +197 -79
  195. package/src/modules/constructor/components/sections/Constructor.vue +19 -32
  196. package/src/modules/constructor/components/sections/Viewer.vue +53 -0
  197. package/src/modules/gallery/components/pages/Gallery.vue +1 -1
  198. package/src/modules/globals/components/layouts/Client.vue +21 -7
  199. package/src/modules/globals/components/layouts/Empty.vue +1 -6
  200. package/src/modules/globals/components/pages/404.vue +1 -1
  201. package/src/modules/globals/components/sections/SectionPageTitle.vue +2 -2
  202. package/src/modules/globals/mixins/mixins.js +129 -97
  203. package/src/modules/landing/router/landing.js +3 -0
  204. package/src/modules/marketplace/components/pages/Catalog.vue +1 -1
  205. package/src/modules/middlewares/client/auth.validation.js +14 -15
  206. package/src/modules/orders/orders.client.js +4 -2
  207. package/src/modules/organizations/router/organizations.js +9 -3
  208. package/src/modules/pages/controllers/factories/pages.factory.js +106 -0
  209. package/src/modules/pages/controllers/routes/pages.routes.js +24 -0
  210. package/src/modules/pages/models/page.model.js +18 -11
  211. package/src/modules/pages/pages.client.js +40 -0
  212. package/src/modules/pages/pages.server.js +32 -0
  213. package/src/modules/pages/views/components/blocks/CardPage.vue +123 -0
  214. package/src/modules/pages/views/components/pages/Page.vue +173 -0
  215. package/src/modules/pages/views/components/pages/PageEdit.vue +121 -0
  216. package/src/modules/pages/views/components/pages/Pages.vue +60 -0
  217. package/src/modules/pages/views/components/partials/SidebarPages.vue +112 -0
  218. package/src/modules/pages/views/router/pages.backoffice.router.js +46 -0
  219. package/src/modules/pages/views/router/pages.router.js +25 -0
  220. package/src/modules/pages/views/store/pages.js +78 -0
  221. package/src/modules/pages/views/store/pages.store.js +5 -0
  222. package/src/modules/products/controllers/leftovers.controller.js +1 -1
  223. package/src/modules/spots/router/spots.js +4 -0
  224. package/src/styles/base/all.scss +66 -53
  225. package/dist/index-BshfsiQG.js +0 -220
  226. package/dist/index-C-8xOJnM.mjs +0 -244
  227. package/dist/index-C-DW6ra2.js +0 -260
  228. package/dist/index-CDbtWkBj.js +0 -243
  229. package/dist/index-D4j29ivg.mjs +0 -261
  230. package/dist/index-DKtnWDNC.mjs +0 -221
  231. package/dist/index-DNI4aUP2.js +0 -259
  232. package/dist/index-Tcyehi73.mjs +0 -260
  233. package/dist/main-3Vn8SU2y.mjs +0 -14509
  234. package/dist/main-5IrI2IOV.js +0 -92
  235. package/dist/main-BFKp44Ze.mjs +0 -14509
  236. package/dist/main-BF_nMkug.js +0 -92
  237. package/dist/main-BHr0-Z3t.mjs +0 -14510
  238. package/dist/main-BY2OvGB9.mjs +0 -14509
  239. package/dist/main-Bcj0J6tP.mjs +0 -14509
  240. package/dist/main-By5Tbyui.js +0 -92
  241. package/dist/main-CEoQQpJV.js +0 -92
  242. package/dist/main-CI9l9xMs.js +0 -92
  243. package/dist/main-Ckn0Sslr.js +0 -92
  244. package/dist/main-DBv451oC.js +0 -92
  245. package/dist/main-DPg58GOU.mjs +0 -14509
  246. package/dist/main-DTHFR7H_.mjs +0 -14510
  247. package/dist/main-DxyAONrm.mjs +0 -14438
  248. package/dist/main-gY_284gJ.js +0 -92
  249. package/dist/main-wXdocsbd.js +0 -92
  250. package/dist/middlewares.server.js +0 -19
  251. package/dist/middlewares.server.mjs +0 -20
  252. package/dist/prometheus-framework/src/components/Address/Address.vue.cjs +0 -1
  253. package/dist/prometheus-framework/src/components/Address/Address.vue.js +0 -89
  254. package/dist/prometheus-framework/src/components/Button/Button.vue.cjs +0 -1
  255. package/dist/prometheus-framework/src/components/Button/Button.vue.js +0 -95
  256. package/dist/prometheus-framework/src/components/Chips/Chips.vue2.cjs +0 -1
  257. package/dist/prometheus-framework/src/components/Chips/Chips.vue2.js +0 -26
  258. package/dist/prometheus-framework/src/components/Dropdown/Dropdown.vue2.cjs +0 -1
  259. package/dist/prometheus-framework/src/components/Dropdown/Dropdown.vue2.js +0 -57
  260. package/dist/prometheus-framework/src/components/Field/Field.vue.cjs +0 -1
  261. package/dist/prometheus-framework/src/components/Field/Field.vue.js +0 -83
  262. package/dist/prometheus-framework/src/components/LocationMarker/LocationMarker.vue.cjs +0 -1
  263. package/dist/prometheus-framework/src/components/LocationMarker/LocationMarker.vue.js +0 -127
  264. package/dist/prometheus-framework/src/components/Menu/Menu.vue.cjs +0 -1
  265. package/dist/prometheus-framework/src/components/Menu/Menu.vue.js +0 -13
  266. package/dist/prometheus-framework/src/components/Popup/Popup.vue.cjs +0 -1
  267. package/dist/prometheus-framework/src/components/Popup/Popup.vue.js +0 -77
  268. package/dist/prometheus-framework/src/components/Select/Select.vue.cjs +0 -1
  269. package/dist/prometheus-framework/src/components/Select/Select.vue.js +0 -103
  270. package/dist/prometheus-framework/src/components/Tab/Tab.vue.cjs +0 -1
  271. package/dist/prometheus-framework/src/components/Tab/Tab.vue.js +0 -36
  272. package/dist/prometheus-framework/src/components/Tooltip/Tooltip.vue2.cjs +0 -1
  273. package/dist/prometheus-framework/src/components/Tooltip/Tooltip.vue2.js +0 -44
  274. package/dist/prometheus-framework/src/modules/community/components/sections/Feed.vue.cjs +0 -1
  275. package/dist/prometheus-framework/src/modules/community/components/sections/Feed.vue.js +0 -125
  276. package/dist/prometheus-framework/src/modules/constructor/components/elements/Bullets.vue.cjs +0 -2
  277. package/dist/prometheus-framework/src/modules/constructor/components/elements/Bullets.vue.js +0 -47
  278. package/dist/prometheus-framework/src/modules/constructor/components/elements/Caption.vue.cjs +0 -2
  279. package/dist/prometheus-framework/src/modules/constructor/components/elements/Caption.vue.js +0 -46
  280. package/dist/prometheus-framework/src/modules/constructor/components/elements/H2.vue.cjs +0 -4
  281. package/dist/prometheus-framework/src/modules/constructor/components/elements/H2.vue.js +0 -65
  282. package/dist/prometheus-framework/src/modules/constructor/components/elements/Textarea.vue.cjs +0 -5
  283. package/dist/prometheus-framework/src/modules/constructor/components/elements/Textarea.vue.js +0 -67
  284. package/dist/prometheus-framework/src/modules/wallet/components/blocks/CardBalanceReplenished.vue.cjs +0 -1
  285. package/dist/prometheus-framework/src/modules/wallet/components/blocks/CardBalanceReplenished.vue.js +0 -30
  286. package/dist/prometheus-framework/src/modules/wallet/components/blocks/CardDeposite.vue.cjs +0 -1
  287. package/dist/prometheus-framework/src/modules/wallet/components/blocks/CardDeposite.vue.js +0 -42
  288. package/dist/prometheus-framework/src/modules/wallet/components/blocks/CashDeposite.vue.cjs +0 -1
  289. package/dist/prometheus-framework/src/modules/wallet/components/blocks/CashDeposite.vue.js +0 -26
  290. package/dist/prometheus-framework/src/modules/wallet/components/blocks/CryptoDeposite.vue.cjs +0 -1
  291. package/dist/prometheus-framework/src/modules/wallet/components/blocks/CryptoDeposite.vue.js +0 -42
  292. package/dist/prometheus-framework/src/modules/wallet/localization/Wallet.json.cjs +0 -1
  293. package/dist/prometheus-framework/src/modules/wallet/localization/Wallet.json.js +0 -26
  294. package/dist/queryProcessor-g8208K6g.mjs +0 -178
  295. package/dist/queryProcessor-haY_gPGg.js +0 -177
  296. package/dist/web-5eyiz9L7.mjs +0 -54
  297. package/dist/web-BPUCAST-.mjs +0 -54
  298. package/dist/web-Be96Xqd4.mjs +0 -54
  299. package/dist/web-BmdKi_fZ.js +0 -1
  300. package/dist/web-Bqpk8Mpk.js +0 -1
  301. package/dist/web-BzUFKqzw.js +0 -1
  302. package/dist/web-CcFPvlkl.js +0 -1
  303. package/dist/web-CgjTW1bL.js +0 -1
  304. package/dist/web-Cw0ijzjY.js +0 -1
  305. package/dist/web-CwTWV4ca.mjs +0 -54
  306. package/dist/web-DZUec7pP.js +0 -1
  307. package/dist/web-Dh669DqQ.mjs +0 -54
  308. package/dist/web-DkWpHYrh.mjs +0 -54
  309. package/dist/web-Dt2RCU54.js +0 -1
  310. package/dist/web-krQQeSb6.mjs +0 -54
  311. package/dist/web-nqFW_Sd1.mjs +0 -54
  312. package/src/modules/community/controllers/comments.controller.aggr.js +0 -280
  313. package/src/modules/community/controllers/comments.controller.populate.js +0 -180
  314. package/src/modules/constructor/components/elements/H2.vue +0 -102
  315. package/src/modules/pages/components/pages/Page.vue +0 -174
  316. package/src/modules/pages/components/pages/PageEdit.vue +0 -159
  317. package/src/modules/pages/components/pages/Pages.vue +0 -108
  318. package/src/modules/pages/controllers/pages.controller.js +0 -71
  319. package/src/modules/pages/router/pages.router.js +0 -15
  320. package/src/modules/pages/routes/pages.routes.js +0 -30
  321. package/src/modules/pages/store/pages.js +0 -94
@@ -0,0 +1,78 @@
1
+ import { reactive, watch } from "vue";
2
+ import axios from "axios";
3
+ import { setError } from "@pf/src/modules/globals/store/globals";
4
+
5
+ const clientUrl = process.env.API_URL;
6
+ const $axios = axios.create({ baseURL: clientUrl });
7
+
8
+ const state = reactive({
9
+ all: [],
10
+ current: {
11
+ name: "",
12
+ localization: [],
13
+ groups: [],
14
+ url: "",
15
+ content: [],
16
+ },
17
+ });
18
+
19
+ const actions = {
20
+ async create(page) {
21
+ try {
22
+ const response = await $axios.post(`/api/pages/create`, page);
23
+
24
+ return response.data;
25
+ } catch (error) {
26
+ setError(error);
27
+ throw error;
28
+ }
29
+ },
30
+
31
+
32
+ async read(options = {}) {
33
+ try {
34
+ const response = await $axios.get('/api/pages/read', { params: options });
35
+
36
+ return response.data;
37
+ } catch (error) {
38
+ setError(error);
39
+ throw error;
40
+ }
41
+ },
42
+
43
+
44
+ async update(page) {
45
+ try {
46
+ const response = await $axios.put(`/api/pages/update`, page);
47
+
48
+ state.current = response.data;
49
+ return response.data;
50
+ } catch (error) {
51
+ setError(error);
52
+ throw error;
53
+ }
54
+ },
55
+
56
+ async delete(page) {
57
+ try {
58
+ const response = await $axios.delete(`/api/pages/delete`, {
59
+ data: page
60
+ });
61
+
62
+ state.all.splice(state.all.findIndex((p) => p._id == page), 1);
63
+ return response.data;
64
+ } catch (error) {
65
+ setError(error);
66
+ throw error;
67
+ }
68
+ },
69
+ };
70
+
71
+ const history = [];
72
+ history.push(state);
73
+
74
+ watch(state, (newState) => {
75
+ history.push(newState);
76
+ });
77
+
78
+ export { state, actions };
@@ -0,0 +1,5 @@
1
+ import Store from '@pf/src/modules/globals/services/globals.store.js'
2
+
3
+ const pages = new Store(`${process.env.API_URL}/api/pages`)
4
+
5
+ export default pages
@@ -25,7 +25,7 @@ const controllerFactory = (db) => {
25
25
 
26
26
  matchConditions.push({
27
27
  $or: [
28
- { "comment ": { $regex: regexPattern, $options: 'i' } },
28
+ { "comment": { $regex: regexPattern, $options: 'i' } },
29
29
  { "positions.name": { $regex: regexPattern, $options: 'i' } }
30
30
  ]
31
31
  });
@@ -11,6 +11,10 @@ const spots = {
11
11
  en: 'Spots',
12
12
  ru: 'Места'
13
13
  },
14
+ breadcrumbs: {
15
+ hide: true,
16
+ hidden: true
17
+ }
14
18
  },
15
19
  children: [
16
20
  {
@@ -177,19 +177,6 @@ body {
177
177
  &-nowrap { flex-wrap: nowrap; }
178
178
  &-wrap { flex-wrap: wrap; }
179
179
  &-center { align-items: center; justify-content: center; }
180
- // &-h-center { justify-content: center; }
181
- // &-justify-start { justify-content: flex-start; }
182
- // &-justify-center { justify-content: center; }
183
- // &-justify-end { justify-content: flex-end; }
184
- // &-justify-between { justify-content: space-between; }
185
- // &-justify-around { justify-content: space-around; }
186
- // &-items-start { align-items: flex-start; }
187
- // &-items-center { align-items: center; }
188
- // &-items-end { align-items: flex-end; }
189
- // &-items-stretch { align-items: stretch; }
190
- // &-items-baseline { align-items: baseline; }
191
- // &-v-center { align-items: center; }
192
- // &-stretch { align-items: stretch }
193
180
  }
194
181
 
195
182
  .align-self-start {
@@ -223,6 +210,72 @@ body {
223
210
  &-order-last { order: 9999; }
224
211
  }
225
212
 
213
+ .cols-1 .col {
214
+ width: var(--col-width);
215
+ }
216
+
217
+ .cols-2 .col {
218
+ width: var(--col-width);
219
+ }
220
+
221
+ .cols-3 .col {
222
+ width: var(--col-width);
223
+ }
224
+
225
+ // COLUMNS AND ROWS
226
+ .cols-1 {display: grid; grid-template-columns: 1fr; }
227
+ .cols-2 {
228
+ display: grid;
229
+ grid-template-columns: 1fr 1fr;
230
+ grid-auto-flow: dense;
231
+
232
+ > *:only-child {
233
+ grid-column: 1 / -1;
234
+ }
235
+ }
236
+ .cols-2-fit-content {display: grid; grid-template-columns: fit-content(100%) 1fr; }
237
+ .cols-3 {display: grid; grid-template-columns: 1fr 1fr 1fr; }
238
+ .cols-4 {display: grid; grid-template-columns: 1fr 1fr 1fr 1fr; }
239
+ .cols-5 {display: grid; grid-template-columns: 1fr 1fr 1fr 1fr 1fr; }
240
+ .cols-6 {display: grid; grid-template-columns: 1fr 1fr 1fr 1fr 1fr 1fr; }
241
+
242
+ .cols-2-golden-ration {display: grid; grid-template-columns: 1.66fr 1.33fr; }
243
+
244
+ .cols-2-2_1 {display: grid; grid-template-columns: 2fr 1fr; }
245
+ .cols-2-1_2 {display: grid; grid-template-columns: 1fr 2fr; }
246
+
247
+ .cols-2-1_2_1 {display: grid; grid-template-columns: 1fr 2fr 1fr; }
248
+
249
+ .cols-2-1_3 {
250
+ display: grid;
251
+ grid-template-columns: 1fr 3fr;
252
+ grid-auto-flow: dense;
253
+
254
+ > *:only-child {
255
+ grid-column: 1 / -1;
256
+ }
257
+ }
258
+
259
+ .cols-2-3_1 {
260
+ display: grid;
261
+ grid-template-columns: 3fr 1fr;
262
+ grid-auto-flow: dense;
263
+
264
+ > *:only-child {
265
+ grid-column: 1 / -1;
266
+ }
267
+ }
268
+
269
+ .cols-2-1_4 {display: grid; grid-template-columns: 1fr 4fr; }
270
+ .cols-2-4_1 {display: grid; grid-template-columns: 4fr 1fr; }
271
+ // COLUMN
272
+ .col-w-100 {
273
+ grid-column: 1 / -1
274
+ }
275
+ // Rows
276
+ .rows-1 {display: grid; grid-template-rows: auto 1fr; }
277
+
278
+ // REFACTOR THIS SHIT
226
279
  .grid {
227
280
  display: grid;
228
281
  }
@@ -279,46 +332,6 @@ body {
279
332
  --cols: 3;
280
333
  }
281
334
 
282
- .cols-1 .col {
283
- width: var(--col-width);
284
- }
285
-
286
- .cols-2 .col {
287
- width: var(--col-width);
288
- }
289
-
290
- .cols-3 .col {
291
- width: var(--col-width);
292
- }
293
-
294
- // COLUMNS AND ROWS
295
- .cols-1 {display: grid; grid-template-columns: 1fr; }
296
- .cols-2 {display: grid; grid-template-columns: 1fr 1fr; }
297
- .cols-2-fit-content {display: grid; grid-template-columns: fit-content(100%) 1fr; }
298
- .cols-3 {display: grid; grid-template-columns: 1fr 1fr 1fr; }
299
- .cols-4 {display: grid; grid-template-columns: 1fr 1fr 1fr 1fr; }
300
- .cols-5 {display: grid; grid-template-columns: 1fr 1fr 1fr 1fr 1fr; }
301
- .cols-6 {display: grid; grid-template-columns: 1fr 1fr 1fr 1fr 1fr 1fr; }
302
-
303
- .cols-2-golden-ration {display: grid; grid-template-columns: 1.66fr 1.33fr; }
304
-
305
- .cols-2-2_1 {display: grid; grid-template-columns: 2fr 1fr; }
306
- .cols-2-1_2 {display: grid; grid-template-columns: 1fr 2fr; }
307
-
308
- .cols-2-1_2_1 {display: grid; grid-template-columns: 1fr 2fr 1fr; }
309
-
310
- .cols-2-1_3 {display: grid; grid-template-columns: 1fr 3fr; }
311
- .cols-2-3_1 {display: grid; grid-template-columns: 3fr 1fr; }
312
-
313
- .cols-2-1_4 {display: grid; grid-template-columns: 1fr 4fr; }
314
- .cols-2-4_1 {display: grid; grid-template-columns: 4fr 1fr; }
315
- // COLUMN
316
- .col-w-100 {
317
- grid-column: 1 / -1
318
- }
319
- // Rows
320
- .rows-1 {display: grid; grid-template-rows: auto 1fr; }
321
-
322
335
 
323
336
  // Gaps
324
337
  // Z-INDEX
@@ -1,220 +0,0 @@
1
- "use strict";
2
- const require$$0 = require("jsonwebtoken");
3
- const require$$0$1 = require("mongodb");
4
- const jwt = require$$0;
5
- const middlewareFactory$4 = (db) => {
6
- const User = db.user;
7
- const Role = db.role;
8
- const verifyToken = async (req, res, next) => {
9
- try {
10
- if (!req.cookies.user) {
11
- req.userId = null;
12
- return next();
13
- }
14
- let user = JSON.parse(req.cookies.user);
15
- let token = req.headers["x-access-token"] || user.accessToken;
16
- if (!token) {
17
- req.userId = null;
18
- return next();
19
- }
20
- const decoded = jwt.verify(token, process.env.SECRET_KEY);
21
- req.userId = decoded._id;
22
- next();
23
- } catch (err) {
24
- console.log(err);
25
- req.userId = null;
26
- next();
27
- }
28
- };
29
- const checkRole = (roleToCheck) => async (req, res, next) => {
30
- try {
31
- const user = await User.findById(req.userId).exec();
32
- if (!user) {
33
- return res.status(404).send({ message: "User Not found." });
34
- }
35
- const roles = await Role.find({ _id: { $in: user.roles } }).exec();
36
- for (let role of roles) {
37
- if (role.name === roleToCheck) {
38
- next();
39
- return;
40
- }
41
- }
42
- res.status(403).send({ message: `Require ${roleToCheck} Role!` });
43
- } catch (err) {
44
- res.status(500).send({ message: err.message });
45
- }
46
- };
47
- const isAdmin = checkRole("admin");
48
- const isModerator = checkRole("moderator");
49
- return {
50
- verifyToken,
51
- isAdmin,
52
- isModerator
53
- };
54
- };
55
- var authJwt = middlewareFactory$4;
56
- const middlewareFactory$3 = (db) => {
57
- const User = db.user;
58
- db.role;
59
- const checkDuplicateUsernameOrEmail = async (req, res, next) => {
60
- const { type, email, phone } = req.body;
61
- console.log(req.body);
62
- let query;
63
- if (type === "phone" && phone) {
64
- query = { phone };
65
- }
66
- if (type === "email" && email) {
67
- query = { email };
68
- }
69
- try {
70
- const user = await User.findOne(query).exec();
71
- if (user) {
72
- console.log(`USER_ALREADY_REGISTERED`);
73
- res.status(400).send({ errorCode: "USER_ALREADY_REGISTERED" });
74
- return;
75
- }
76
- next();
77
- } catch (err) {
78
- console.log(err);
79
- res.status(500).send({ message: err.message });
80
- }
81
- };
82
- const checkRolesExisted = (req, res, next) => {
83
- if (req.body.roles) {
84
- for (let i = 0; i < req.body.roles.length; i++) {
85
- if (!ROLES.includes(req.body.roles[i])) {
86
- console.log(`Failed! Role ${req.body.roles[i]} does not exist!`);
87
- res.status(400).send({
88
- message: `Failed! Role ${req.body.roles[i]} does not exist!`
89
- });
90
- return;
91
- }
92
- }
93
- }
94
- next();
95
- };
96
- return {
97
- checkDuplicateUsernameOrEmail,
98
- checkRolesExisted
99
- };
100
- };
101
- var verifySignUp = middlewareFactory$3;
102
- const middlewareFactory$2 = (db) => {
103
- const User = db.user;
104
- db.role;
105
- const checkUserExist = async (req, res, next) => {
106
- const { type, email, phone } = req.body;
107
- let query;
108
- if (type === "phone" && phone) {
109
- query = { phone };
110
- }
111
- if (type === "email" && email) {
112
- query = { email };
113
- }
114
- try {
115
- const user = await User.findOne(query).exec();
116
- if (!user) {
117
- console.log(query);
118
- res.status(400).send({ errorCode: "USER_NOT_REGISTERED_YET" });
119
- return;
120
- }
121
- next();
122
- } catch (err) {
123
- res.status(500).send({ message: err.message });
124
- }
125
- };
126
- return {
127
- checkUserExist
128
- };
129
- };
130
- var verifyUser = middlewareFactory$2;
131
- const { ObjectId } = require$$0$1;
132
- const middlewareFactory$1 = (db) => {
133
- const User = db.user;
134
- const Invite = db.invite;
135
- const Membership = db.membership;
136
- const checkInviteExist = async (req, res, next) => {
137
- for (let invite of req.body.invites) {
138
- let query;
139
- if (invite.contact.includes("@")) {
140
- query = { invitedEmail: invite.contact };
141
- } else {
142
- query = { invitedPhone: invite.contact };
143
- }
144
- query["owner.target"] = req.body.owner.target;
145
- const userInvite = await Invite.findOne(query).exec();
146
- if (userInvite) {
147
- console.log(userInvite);
148
- res.status(400).send({ message: "Инвайт c таким email или телефоном уже создан!" });
149
- return;
150
- }
151
- }
152
- next();
153
- };
154
- const checkUsersExist = async (req, res, next) => {
155
- for (let invite of req.body.invites) {
156
- let query;
157
- if (invite.contact.includes("@")) {
158
- query = { email: invite.contact };
159
- } else {
160
- query = { phone: invite.contact };
161
- }
162
- const user = await User.findOne(query).exec();
163
- console.log(req.params);
164
- if (user) {
165
- const membership = await Membership.findOne({ user: new ObjectId(user._id), "owner.target": req.body.owner.target }).exec();
166
- if (membership) {
167
- console.log(membership);
168
- res.status(400).send({ message: "Пользователь с таким email или телефоном уже добавлен в организацию!" });
169
- return;
170
- }
171
- }
172
- }
173
- next();
174
- };
175
- return {
176
- checkInviteExist,
177
- checkUsersExist
178
- };
179
- };
180
- var verifyInvites = middlewareFactory$1;
181
- const middlewareFactory = (db) => {
182
- const Category = db.category;
183
- const checkCategoryExistOrNot = async (req, res, next) => {
184
- try {
185
- const category = await Category.findOne({ url: req.body.url });
186
- if (category) {
187
- res.status(400).send({ message: "Failed! Category with this URL is already in use!" });
188
- return;
189
- }
190
- next();
191
- } catch (err) {
192
- res.status(500).send({ message: err });
193
- }
194
- };
195
- return {
196
- checkCategoryExistOrNot
197
- };
198
- };
199
- var verifyCategory = middlewareFactory;
200
- const middlewareIndexFactory = (db) => {
201
- const authJwt$1 = authJwt(db);
202
- const verifySignUp$1 = verifySignUp(db);
203
- const verifyUser$1 = verifyUser(db);
204
- const verifyInvites$1 = verifyInvites(db);
205
- const verifyCategory$1 = verifyCategory(db);
206
- return {
207
- authJwt: authJwt$1,
208
- verifySignUp: verifySignUp$1,
209
- verifyUser: verifyUser$1,
210
- verifyInvites: verifyInvites$1,
211
- verifyCategory: verifyCategory$1
212
- };
213
- };
214
- var server = middlewareIndexFactory;
215
- exports.authJwt = authJwt;
216
- exports.server = server;
217
- exports.verifyCategory = verifyCategory;
218
- exports.verifyInvites = verifyInvites;
219
- exports.verifySignUp = verifySignUp;
220
- exports.verifyUser = verifyUser;
@@ -1,244 +0,0 @@
1
- import require$$0 from "jsonwebtoken";
2
- import require$$0$1 from "crypto";
3
- import require$$0$2 from "mongodb";
4
- const jwt = require$$0;
5
- const middlewareFactory$4 = (db) => {
6
- const User = db.user;
7
- const Role = db.role;
8
- const verifyToken = async (req, res, next) => {
9
- try {
10
- if (!req.cookies.user) {
11
- req.userId = null;
12
- return next();
13
- }
14
- let user = JSON.parse(req.cookies.user);
15
- let token = req.headers["x-access-token"] || user.accessToken;
16
- if (!token) {
17
- req.userId = null;
18
- return next();
19
- }
20
- const decoded = jwt.verify(token, process.env.SECRET_KEY);
21
- req.userId = decoded._id;
22
- next();
23
- } catch (err) {
24
- console.log(err);
25
- req.userId = null;
26
- next();
27
- }
28
- };
29
- const checkRole = (roleToCheck) => async (req, res, next) => {
30
- try {
31
- const user = await User.findById(req.userId).exec();
32
- if (!user) {
33
- return res.status(404).send({ message: "User Not found." });
34
- }
35
- const roles = await Role.find({ _id: { $in: user.roles } }).exec();
36
- for (let role of roles) {
37
- if (role.name === roleToCheck) {
38
- next();
39
- return;
40
- }
41
- }
42
- res.status(403).send({ message: `Require ${roleToCheck} Role!` });
43
- } catch (err) {
44
- res.status(500).send({ message: err.message });
45
- }
46
- };
47
- const isAdmin = checkRole("admin");
48
- const isModerator = checkRole("moderator");
49
- return {
50
- verifyToken,
51
- isAdmin,
52
- isModerator
53
- };
54
- };
55
- var authJwt = middlewareFactory$4;
56
- var authSecret;
57
- var hasRequiredAuthSecret;
58
- function requireAuthSecret() {
59
- if (hasRequiredAuthSecret) return authSecret;
60
- hasRequiredAuthSecret = 1;
61
- const crypto = require$$0$1;
62
- const middlewareFactory2 = () => {
63
- const verifySecret = (method, endpoint, secret) => async (req, res, next) => {
64
- const requestSignature = req.headers.signature;
65
- const signature = crypto.createHmac("sha256", secret).update(method + endpoint).digest("hex");
66
- if (signature === requestSignature) {
67
- return next();
68
- }
69
- res.status(403).send("Forbidden");
70
- };
71
- return { verifySecret };
72
- };
73
- authSecret = middlewareFactory2;
74
- return authSecret;
75
- }
76
- const middlewareFactory$3 = (db) => {
77
- const User = db.user;
78
- db.role;
79
- const checkDuplicateUsernameOrEmail = async (req, res, next) => {
80
- const { type, email, phone } = req.body;
81
- console.log(req.body);
82
- let query;
83
- if (type === "phone" && phone) {
84
- query = { phone };
85
- }
86
- if (type === "email" && email) {
87
- query = { email };
88
- }
89
- try {
90
- const user = await User.findOne(query).exec();
91
- if (user) {
92
- console.log(`USER_ALREADY_REGISTERED`);
93
- res.status(400).send({ errorCode: "USER_ALREADY_REGISTERED" });
94
- return;
95
- }
96
- next();
97
- } catch (err) {
98
- console.log(err);
99
- res.status(500).send({ message: err.message });
100
- }
101
- };
102
- const checkRolesExisted = (req, res, next) => {
103
- if (req.body.roles) {
104
- for (let i = 0; i < req.body.roles.length; i++) {
105
- if (!ROLES.includes(req.body.roles[i])) {
106
- console.log(`Failed! Role ${req.body.roles[i]} does not exist!`);
107
- res.status(400).send({
108
- message: `Failed! Role ${req.body.roles[i]} does not exist!`
109
- });
110
- return;
111
- }
112
- }
113
- }
114
- next();
115
- };
116
- return {
117
- checkDuplicateUsernameOrEmail,
118
- checkRolesExisted
119
- };
120
- };
121
- var verifySignUp = middlewareFactory$3;
122
- const middlewareFactory$2 = (db) => {
123
- const User = db.user;
124
- db.role;
125
- const checkUserExist = async (req, res, next) => {
126
- const { type, email, phone } = req.body;
127
- let query;
128
- if (type === "phone" && phone) {
129
- query = { phone };
130
- }
131
- if (type === "email" && email) {
132
- query = { email };
133
- }
134
- try {
135
- const user = await User.findOne(query).exec();
136
- if (!user) {
137
- console.log(query);
138
- res.status(400).send({ errorCode: "USER_NOT_REGISTERED_YET" });
139
- return;
140
- }
141
- next();
142
- } catch (err) {
143
- res.status(500).send({ message: err.message });
144
- }
145
- };
146
- return {
147
- checkUserExist
148
- };
149
- };
150
- var verifyUser = middlewareFactory$2;
151
- const { ObjectId } = require$$0$2;
152
- const middlewareFactory$1 = (db) => {
153
- const User = db.user;
154
- const Invite = db.invite;
155
- const Membership = db.membership;
156
- const checkInviteExist = async (req, res, next) => {
157
- for (let invite of req.body.invites) {
158
- let query;
159
- if (invite.contact.includes("@")) {
160
- query = { invitedEmail: invite.contact };
161
- } else {
162
- query = { invitedPhone: invite.contact };
163
- }
164
- query["owner.target"] = req.body.owner.target;
165
- const userInvite = await Invite.findOne(query).exec();
166
- if (userInvite) {
167
- console.log(userInvite);
168
- res.status(400).send({ message: "Инвайт c таким email или телефоном уже создан!" });
169
- return;
170
- }
171
- }
172
- next();
173
- };
174
- const checkUsersExist = async (req, res, next) => {
175
- for (let invite of req.body.invites) {
176
- let query;
177
- if (invite.contact.includes("@")) {
178
- query = { email: invite.contact };
179
- } else {
180
- query = { phone: invite.contact };
181
- }
182
- const user = await User.findOne(query).exec();
183
- console.log(req.params);
184
- if (user) {
185
- const membership = await Membership.findOne({ user: new ObjectId(user._id), "owner.target": req.body.owner.target }).exec();
186
- if (membership) {
187
- console.log(membership);
188
- res.status(400).send({ message: "Пользователь с таким email или телефоном уже добавлен в организацию!" });
189
- return;
190
- }
191
- }
192
- }
193
- next();
194
- };
195
- return {
196
- checkInviteExist,
197
- checkUsersExist
198
- };
199
- };
200
- var verifyInvites = middlewareFactory$1;
201
- const middlewareFactory = (db) => {
202
- const Category = db.category;
203
- const checkCategoryExistOrNot = async (req, res, next) => {
204
- try {
205
- const category = await Category.findOne({ url: req.body.url });
206
- if (category) {
207
- res.status(400).send({ message: "Failed! Category with this URL is already in use!" });
208
- return;
209
- }
210
- next();
211
- } catch (err) {
212
- res.status(500).send({ message: err });
213
- }
214
- };
215
- return {
216
- checkCategoryExistOrNot
217
- };
218
- };
219
- var verifyCategory = middlewareFactory;
220
- const middlewareIndexFactory = (db) => {
221
- const authJwt$1 = authJwt(db);
222
- const authSecret2 = requireAuthSecret()();
223
- const verifySignUp$1 = verifySignUp(db);
224
- const verifyUser$1 = verifyUser(db);
225
- const verifyInvites$1 = verifyInvites(db);
226
- const verifyCategory$1 = verifyCategory(db);
227
- return {
228
- authJwt: authJwt$1,
229
- authSecret: authSecret2,
230
- verifySignUp: verifySignUp$1,
231
- verifyUser: verifyUser$1,
232
- verifyInvites: verifyInvites$1,
233
- verifyCategory: verifyCategory$1
234
- };
235
- };
236
- var server = middlewareIndexFactory;
237
- export {
238
- verifyInvites as a,
239
- authJwt as b,
240
- verifySignUp as c,
241
- verifyCategory as d,
242
- server as s,
243
- verifyUser as v
244
- };