@ozdao/prometheus-framework 0.2.81 → 0.2.82

Sign up to get free protection for your applications and to get access to all the features.
Files changed (327) hide show
  1. package/dist/auth.server.js +1 -1
  2. package/dist/auth.server.mjs +1 -1
  3. package/dist/community.server.js +3 -3
  4. package/dist/community.server.mjs +3 -3
  5. package/dist/credentials.schema-CDZCKfEI.mjs +106 -0
  6. package/dist/credentials.schema-CfhPcsuI.js +105 -0
  7. package/dist/events.server.js +4 -15
  8. package/dist/events.server.mjs +3 -14
  9. package/dist/files.server.js +1 -1
  10. package/dist/files.server.mjs +1 -1
  11. package/dist/gallery.server.js +1 -1
  12. package/dist/gallery.server.mjs +1 -1
  13. package/dist/index-B6a1mPgp.mjs +217 -0
  14. package/dist/index-BCCiEK_u.js +216 -0
  15. package/dist/main-8N2Jmsuk.js +91 -0
  16. package/dist/main-CkeuHuCY.mjs +13619 -0
  17. package/dist/main.css +1 -1
  18. package/dist/metadata.schema-Cu_mPkjE.js +77 -0
  19. package/dist/metadata.schema-cbFgazeK.mjs +78 -0
  20. package/dist/middlewares.server.js +1 -1
  21. package/dist/middlewares.server.mjs +1 -1
  22. package/dist/node_modules/@googlemaps/js-api-loader/dist/index.cjs +1 -0
  23. package/dist/node_modules/@googlemaps/js-api-loader/dist/index.js +238 -0
  24. package/dist/organizations.server.js +297 -134
  25. package/dist/organizations.server.mjs +295 -132
  26. package/dist/products.server.js +2 -2
  27. package/dist/products.server.mjs +2 -2
  28. package/dist/prometheus-framework/src/components/Address/Address.vue2.cjs +1 -1
  29. package/dist/prometheus-framework/src/components/Address/Address.vue2.js +33 -24
  30. package/dist/prometheus-framework/src/components/Block/Block.vue.cjs +1 -1
  31. package/dist/prometheus-framework/src/components/Block/Block.vue.js +23 -20
  32. package/dist/prometheus-framework/src/components/Button/Button.vue.cjs +1 -1
  33. package/dist/prometheus-framework/src/components/Button/Button.vue.js +1 -225
  34. package/dist/prometheus-framework/src/components/Button/Button.vue2.cjs +1 -1
  35. package/dist/prometheus-framework/src/components/Button/Button.vue2.js +102 -1
  36. package/dist/prometheus-framework/src/components/Feed/Feed.vue.cjs +1 -1
  37. package/dist/prometheus-framework/src/components/Feed/Feed.vue.js +71 -60
  38. package/dist/prometheus-framework/src/components/Field/Field.vue.cjs +1 -1
  39. package/dist/prometheus-framework/src/components/Field/Field.vue.js +1 -84
  40. package/dist/prometheus-framework/src/components/Field/Field.vue2.cjs +1 -1
  41. package/dist/prometheus-framework/src/components/Field/Field.vue2.js +84 -1
  42. package/dist/prometheus-framework/src/components/FieldBig/FieldBig.vue.cjs +1 -1
  43. package/dist/prometheus-framework/src/components/FieldBig/FieldBig.vue.js +1 -1
  44. package/dist/prometheus-framework/src/components/FieldPhone/FieldPhone.vue.cjs +1 -1
  45. package/dist/prometheus-framework/src/components/FieldPhone/FieldPhone.vue.js +325 -340
  46. package/dist/prometheus-framework/src/components/FieldPhone/FieldPhone2.vue.cjs +1 -1
  47. package/dist/prometheus-framework/src/components/FieldPhone/FieldPhone2.vue.js +2 -2
  48. package/dist/prometheus-framework/src/components/LocationMarker/LocationMarker.vue2.cjs +1 -1
  49. package/dist/prometheus-framework/src/components/LocationMarker/LocationMarker.vue2.js +53 -44
  50. package/dist/prometheus-framework/src/components/Popup/Popup.vue2.cjs +1 -1
  51. package/dist/prometheus-framework/src/components/Popup/Popup.vue2.js +41 -40
  52. package/dist/prometheus-framework/src/components/Select/Select.vue2.cjs +1 -1
  53. package/dist/prometheus-framework/src/components/Select/Select.vue2.js +37 -31
  54. package/dist/prometheus-framework/src/components/Slider/Slider.vue.cjs +1 -1
  55. package/dist/prometheus-framework/src/components/Slider/Slider.vue.js +18 -19
  56. package/dist/prometheus-framework/src/components/Tab/Tab.vue.cjs +1 -1
  57. package/dist/prometheus-framework/src/components/Tab/Tab.vue.js +1 -36
  58. package/dist/prometheus-framework/src/components/Tab/Tab.vue2.cjs +1 -1
  59. package/dist/prometheus-framework/src/components/Tab/Tab.vue2.js +36 -1
  60. package/dist/prometheus-framework/src/components/Tooltip/Tooltip.vue.cjs +1 -1
  61. package/dist/prometheus-framework/src/components/Tooltip/Tooltip.vue.js +45 -1
  62. package/dist/prometheus-framework/src/components/Tooltip/Tooltip.vue2.cjs +1 -1
  63. package/dist/prometheus-framework/src/components/Tooltip/Tooltip.vue2.js +1 -45
  64. package/dist/prometheus-framework/src/modules/auth/components/layouts/Auth.vue.cjs +1 -1
  65. package/dist/prometheus-framework/src/modules/auth/components/layouts/Auth.vue.js +3 -3
  66. package/dist/prometheus-framework/src/modules/auth/components/pages/EnterCode.vue.cjs +1 -1
  67. package/dist/prometheus-framework/src/modules/auth/components/pages/EnterCode.vue.js +1 -1
  68. package/dist/prometheus-framework/src/modules/auth/components/pages/EnterPassword.vue.cjs +1 -1
  69. package/dist/prometheus-framework/src/modules/auth/components/pages/EnterPassword.vue.js +3 -3
  70. package/dist/prometheus-framework/src/modules/auth/components/pages/Invite.vue.cjs +1 -1
  71. package/dist/prometheus-framework/src/modules/auth/components/pages/Invite.vue.js +30 -30
  72. package/dist/prometheus-framework/src/modules/auth/components/pages/ResetPassword.vue.cjs +1 -1
  73. package/dist/prometheus-framework/src/modules/auth/components/pages/ResetPassword.vue.js +3 -3
  74. package/dist/prometheus-framework/src/modules/auth/components/pages/SignIn.vue.cjs +1 -1
  75. package/dist/prometheus-framework/src/modules/auth/components/pages/SignIn.vue.js +3 -3
  76. package/dist/prometheus-framework/src/modules/auth/components/pages/SignUp.vue.cjs +1 -1
  77. package/dist/prometheus-framework/src/modules/auth/components/pages/SignUp.vue.js +3 -3
  78. package/dist/prometheus-framework/src/modules/auth/store/auth.cjs +1 -1
  79. package/dist/prometheus-framework/src/modules/auth/store/auth.js +26 -26
  80. package/dist/prometheus-framework/src/modules/backoffice/components/pages/Dashboard.vue.cjs +1 -1
  81. package/dist/prometheus-framework/src/modules/backoffice/components/pages/Dashboard.vue.js +78 -103
  82. package/dist/prometheus-framework/src/modules/community/components/pages/Community.vue.cjs +1 -1
  83. package/dist/prometheus-framework/src/modules/community/components/pages/Community.vue.js +2 -2
  84. package/dist/prometheus-framework/src/modules/community/components/pages/CreateBlogPost.vue.cjs +1 -1
  85. package/dist/prometheus-framework/src/modules/community/components/pages/CreateBlogPost.vue.js +2 -2
  86. package/dist/prometheus-framework/src/modules/community/components/sections/HotPosts.vue.cjs +1 -1
  87. package/dist/prometheus-framework/src/modules/community/components/sections/HotPosts.vue.js +15 -15
  88. package/dist/prometheus-framework/src/modules/constructor/components/elements/Embed.vue.cjs +1 -1
  89. package/dist/prometheus-framework/src/modules/constructor/components/elements/Embed.vue.js +1 -1
  90. package/dist/prometheus-framework/src/modules/events/components/blocks/CardEvent.vue.cjs +1 -1
  91. package/dist/prometheus-framework/src/modules/events/components/blocks/CardEvent.vue.js +4 -4
  92. package/dist/prometheus-framework/src/modules/events/components/elements/ButtonCheck.vue.cjs +1 -1
  93. package/dist/prometheus-framework/src/modules/events/components/elements/ButtonCheck.vue.js +1 -1
  94. package/dist/prometheus-framework/src/modules/events/components/elements/ButtonJoin.vue.cjs +1 -1
  95. package/dist/prometheus-framework/src/modules/events/components/elements/ButtonJoin.vue.js +1 -1
  96. package/dist/prometheus-framework/src/modules/events/components/pages/EditEvent.vue.cjs +1 -1
  97. package/dist/prometheus-framework/src/modules/events/components/pages/EditEvent.vue.js +2 -2
  98. package/dist/prometheus-framework/src/modules/events/components/pages/EditEventTickets.vue.cjs +1 -1
  99. package/dist/prometheus-framework/src/modules/events/components/pages/EditEventTickets.vue.js +2 -2
  100. package/dist/prometheus-framework/src/modules/events/components/pages/Events.vue.cjs +1 -1
  101. package/dist/prometheus-framework/src/modules/events/components/pages/Events.vue.js +29 -27
  102. package/dist/prometheus-framework/src/modules/gallery/components/sections/BackofficeGallery.vue.cjs +1 -1
  103. package/dist/prometheus-framework/src/modules/gallery/components/sections/BackofficeGallery.vue.js +2 -2
  104. package/dist/prometheus-framework/src/modules/gallery/components/sections/GalleryWithCategories.vue.cjs +1 -1
  105. package/dist/prometheus-framework/src/modules/gallery/components/sections/GalleryWithCategories.vue.js +2 -2
  106. package/dist/prometheus-framework/src/modules/globals/components/blocks/BlockSearch.vue.cjs +1 -1
  107. package/dist/prometheus-framework/src/modules/globals/components/blocks/BlockSearch.vue.js +1 -1
  108. package/dist/prometheus-framework/src/modules/globals/components/blocks/CardHeader.vue.cjs +1 -1
  109. package/dist/prometheus-framework/src/modules/globals/components/blocks/CardHeader.vue.js +2 -2
  110. package/dist/prometheus-framework/src/modules/globals/components/sections/SectionPageTitle.vue.cjs +1 -1
  111. package/dist/prometheus-framework/src/modules/globals/components/sections/SectionPageTitle.vue.js +33 -26
  112. package/dist/prometheus-framework/src/modules/globals/localization/vue-i18n.cjs +1 -1
  113. package/dist/prometheus-framework/src/modules/globals/localization/vue-i18n.js +6 -3
  114. package/dist/prometheus-framework/src/modules/globals/services/globals.store.cjs +1 -0
  115. package/dist/prometheus-framework/src/modules/globals/services/globals.store.js +70 -0
  116. package/dist/prometheus-framework/src/modules/icons/entities/IconGallery.vue.cjs +1 -0
  117. package/dist/prometheus-framework/src/modules/icons/entities/IconGallery.vue.js +28 -0
  118. package/dist/prometheus-framework/src/modules/icons/entities/IconLeftovers.vue.cjs +1 -0
  119. package/dist/prometheus-framework/src/modules/icons/entities/IconLeftovers.vue.js +30 -0
  120. package/dist/prometheus-framework/src/modules/icons/entities/IconOrders.vue.cjs +1 -0
  121. package/dist/prometheus-framework/src/modules/icons/entities/IconOrders.vue.js +35 -0
  122. package/dist/prometheus-framework/src/modules/icons/entities/IconProducts.vue.cjs +1 -0
  123. package/dist/prometheus-framework/src/modules/icons/entities/IconProducts.vue.js +28 -0
  124. package/dist/prometheus-framework/src/modules/landing/components/sections/MobileApp.vue.cjs +1 -1
  125. package/dist/prometheus-framework/src/modules/landing/components/sections/MobileApp.vue.js +63 -86
  126. package/dist/prometheus-framework/src/modules/legal/components/pages/Legal.vue.cjs +1 -1
  127. package/dist/prometheus-framework/src/modules/legal/components/pages/Legal.vue.js +2 -2
  128. package/dist/prometheus-framework/src/modules/orders/components/pages/OrderCreateBackoffice.vue.cjs +1 -1
  129. package/dist/prometheus-framework/src/modules/orders/components/pages/OrderCreateBackoffice.vue.js +174 -114
  130. package/dist/prometheus-framework/src/modules/orders/components/pages/Orders.vue.cjs +1 -1
  131. package/dist/prometheus-framework/src/modules/orders/components/pages/Orders.vue.js +40 -40
  132. package/dist/prometheus-framework/src/modules/orders/components/sections/FormAddCustomer.vue.cjs +1 -0
  133. package/dist/prometheus-framework/src/modules/orders/components/sections/FormAddCustomer.vue.js +141 -0
  134. package/dist/prometheus-framework/src/modules/orders/components/sections/FormClientDetails.vue.cjs +1 -1
  135. package/dist/prometheus-framework/src/modules/orders/components/sections/FormClientDetails.vue.js +1 -1
  136. package/dist/prometheus-framework/src/modules/orders/components/sections/FormCustomerDetails.vue.cjs +1 -0
  137. package/dist/prometheus-framework/src/modules/orders/components/sections/FormCustomerDetails.vue.js +77 -0
  138. package/dist/prometheus-framework/src/modules/orders/components/sections/FormDelivery.vue.cjs +1 -1
  139. package/dist/prometheus-framework/src/modules/orders/components/sections/FormDelivery.vue.js +46 -35
  140. package/dist/prometheus-framework/src/modules/orders/store/customers.store.cjs +1 -0
  141. package/dist/prometheus-framework/src/modules/orders/store/customers.store.js +5 -0
  142. package/dist/prometheus-framework/src/modules/orders/store/models/customer.cjs +1 -0
  143. package/dist/prometheus-framework/src/modules/orders/store/models/customer.js +30 -0
  144. package/dist/prometheus-framework/src/modules/orders/store/orders.cjs +1 -1
  145. package/dist/prometheus-framework/src/modules/orders/store/orders.js +24 -25
  146. package/dist/prometheus-framework/src/modules/organizations/components/blocks/CardDepartment.vue.cjs +1 -1
  147. package/dist/prometheus-framework/src/modules/organizations/components/blocks/CardDepartment.vue.js +16 -16
  148. package/dist/prometheus-framework/src/modules/organizations/components/blocks/CardOrganization.vue.cjs +1 -1
  149. package/dist/prometheus-framework/src/modules/organizations/components/blocks/CardOrganization.vue.js +1 -1
  150. package/dist/prometheus-framework/src/modules/organizations/components/blocks/DepartmentMemberModify.vue.cjs +1 -1
  151. package/dist/prometheus-framework/src/modules/organizations/components/blocks/DepartmentMemberModify.vue.js +38 -49
  152. package/dist/prometheus-framework/src/modules/organizations/components/elements/ButtonToggleMembership.vue.cjs +1 -1
  153. package/dist/prometheus-framework/src/modules/organizations/components/elements/ButtonToggleMembership.vue.js +1 -1
  154. package/dist/prometheus-framework/src/modules/organizations/components/pages/Department.vue.cjs +1 -1
  155. package/dist/prometheus-framework/src/modules/organizations/components/pages/Department.vue.js +6 -6
  156. package/dist/prometheus-framework/src/modules/organizations/components/pages/DepartmentEdit.vue.cjs +1 -1
  157. package/dist/prometheus-framework/src/modules/organizations/components/pages/DepartmentEdit.vue.js +161 -138
  158. package/dist/prometheus-framework/src/modules/organizations/components/pages/Members.vue.cjs +1 -1
  159. package/dist/prometheus-framework/src/modules/organizations/components/pages/Members.vue.js +198 -78
  160. package/dist/prometheus-framework/src/modules/organizations/components/pages/Organization.vue.cjs +1 -1
  161. package/dist/prometheus-framework/src/modules/organizations/components/pages/Organization.vue.js +82 -125
  162. package/dist/prometheus-framework/src/modules/organizations/components/pages/OrganizationEdit.vue.cjs +1 -1
  163. package/dist/prometheus-framework/src/modules/organizations/components/pages/OrganizationEdit.vue.js +3 -3
  164. package/dist/prometheus-framework/src/modules/organizations/components/pages/Organizations.vue.cjs +1 -1
  165. package/dist/prometheus-framework/src/modules/organizations/components/pages/Organizations.vue.js +1 -1
  166. package/dist/prometheus-framework/src/modules/organizations/components/sections/Documents.vue.cjs +1 -1
  167. package/dist/prometheus-framework/src/modules/organizations/components/sections/Documents.vue.js +2 -2
  168. package/dist/prometheus-framework/src/modules/organizations/components/sections/MembersAdd.vue.cjs +1 -1
  169. package/dist/prometheus-framework/src/modules/organizations/components/sections/MembersAdd.vue.js +59 -70
  170. package/dist/prometheus-framework/src/modules/organizations/components/sections/Organizations.vue.cjs +1 -1
  171. package/dist/prometheus-framework/src/modules/organizations/components/sections/Organizations.vue.js +3 -3
  172. package/dist/prometheus-framework/src/modules/organizations/organizations.client.cjs +1 -1
  173. package/dist/prometheus-framework/src/modules/organizations/organizations.client.js +34 -36
  174. package/dist/prometheus-framework/src/modules/organizations/store/departments.cjs +1 -1
  175. package/dist/prometheus-framework/src/modules/organizations/store/departments.js +38 -18
  176. package/dist/prometheus-framework/src/modules/organizations/store/invites.cjs +1 -1
  177. package/dist/prometheus-framework/src/modules/organizations/store/invites.js +34 -35
  178. package/dist/prometheus-framework/src/modules/products/components/blocks/CardPosition.vue.cjs +1 -1
  179. package/dist/prometheus-framework/src/modules/products/components/blocks/CardPosition.vue.js +1 -1
  180. package/dist/prometheus-framework/src/modules/products/components/blocks/CardProduct.vue.cjs +1 -1
  181. package/dist/prometheus-framework/src/modules/products/components/blocks/CardProduct.vue.js +41 -21
  182. package/dist/prometheus-framework/src/modules/products/components/blocks/LeftoverPositions.vue.cjs +1 -1
  183. package/dist/prometheus-framework/src/modules/products/components/blocks/LeftoverPositions.vue.js +1 -1
  184. package/dist/prometheus-framework/src/modules/products/components/blocks/ListPositions.vue.cjs +1 -1
  185. package/dist/prometheus-framework/src/modules/products/components/blocks/ListPositions.vue.js +1 -1
  186. package/dist/prometheus-framework/src/modules/products/components/pages/Categories.vue.cjs +1 -1
  187. package/dist/prometheus-framework/src/modules/products/components/pages/Categories.vue.js +1 -1
  188. package/dist/prometheus-framework/src/modules/products/components/pages/CategoryEdit.vue.cjs +1 -1
  189. package/dist/prometheus-framework/src/modules/products/components/pages/CategoryEdit.vue.js +2 -2
  190. package/dist/prometheus-framework/src/modules/products/components/pages/EditLeftover.vue.cjs +1 -1
  191. package/dist/prometheus-framework/src/modules/products/components/pages/EditLeftover.vue.js +1 -1
  192. package/dist/prometheus-framework/src/modules/products/components/pages/Leftovers.vue.cjs +1 -1
  193. package/dist/prometheus-framework/src/modules/products/components/pages/Leftovers.vue.js +1 -1
  194. package/dist/prometheus-framework/src/modules/products/components/pages/ProductEdit.vue.cjs +1 -1
  195. package/dist/prometheus-framework/src/modules/products/components/pages/ProductEdit.vue.js +3 -3
  196. package/dist/prometheus-framework/src/modules/products/components/pages/Products.vue.cjs +1 -1
  197. package/dist/prometheus-framework/src/modules/products/components/pages/Products.vue.js +3 -3
  198. package/dist/prometheus-framework/src/modules/products/components/sections/EditModifications.vue.cjs +1 -1
  199. package/dist/prometheus-framework/src/modules/products/components/sections/EditModifications.vue.js +1 -1
  200. package/dist/prometheus-framework/src/modules/products/components/sections/EditProductInfo.vue.cjs +1 -1
  201. package/dist/prometheus-framework/src/modules/products/components/sections/EditProductInfo.vue.js +2 -2
  202. package/dist/prometheus-framework/src/modules/products/components/sections/SectionProduct.vue.cjs +1 -1
  203. package/dist/prometheus-framework/src/modules/products/components/sections/SectionProduct.vue.js +1 -1
  204. package/dist/prometheus-framework/src/modules/reports/components/sections/FormReport.vue.cjs +1 -1
  205. package/dist/prometheus-framework/src/modules/reports/components/sections/FormReport.vue.js +24 -26
  206. package/dist/prometheus-framework/src/modules/users/components/blocks/CardUser.vue.cjs +1 -0
  207. package/dist/prometheus-framework/src/modules/users/components/blocks/CardUser.vue.js +78 -0
  208. package/dist/prometheus-framework/src/modules/users/components/pages/Profile.vue.cjs +1 -1
  209. package/dist/prometheus-framework/src/modules/users/components/pages/Profile.vue.js +2 -2
  210. package/dist/prometheus-framework/src/modules/users/components/pages/ProfileBlogposts.vue.cjs +1 -1
  211. package/dist/prometheus-framework/src/modules/users/components/pages/ProfileBlogposts.vue.js +1 -1
  212. package/dist/prometheus-framework/src/modules/users/components/pages/ProfileEdit.vue.cjs +1 -1
  213. package/dist/prometheus-framework/src/modules/users/components/pages/ProfileEdit.vue.js +3 -3
  214. package/dist/prometheus-framework/src/modules/users/components/pages/ProfileEvents.vue.cjs +1 -1
  215. package/dist/prometheus-framework/src/modules/users/components/pages/ProfileEvents.vue.js +1 -1
  216. package/dist/prometheus-framework/src/modules/users/store/users.cjs +1 -1
  217. package/dist/prometheus-framework/src/modules/users/store/users.js +13 -14
  218. package/dist/prometheus-framework/src/modules/wallet/views/components/pages/Wallet.vue.cjs +1 -1
  219. package/dist/prometheus-framework/src/modules/wallet/views/components/pages/Wallet.vue.js +2 -2
  220. package/dist/prometheus-framework.cjs.js +1 -1
  221. package/dist/prometheus-framework.es.js +1 -1
  222. package/dist/queryProcessor-BJdKh0Ow.mjs +162 -0
  223. package/dist/queryProcessor-DRMo_GWK.js +161 -0
  224. package/dist/reports.server.js +1 -1
  225. package/dist/reports.server.mjs +1 -1
  226. package/dist/style.css +1 -1
  227. package/dist/users.server.js +69 -38
  228. package/dist/users.server.mjs +67 -36
  229. package/dist/wallet.server.js +2 -2
  230. package/dist/wallet.server.mjs +2 -2
  231. package/dist/web-CtVocufd.js +1 -0
  232. package/dist/web-DNq1tHCE.mjs +54 -0
  233. package/package.json +1 -1
  234. package/src/components/Address/Address.vue +13 -2
  235. package/src/components/Block/Block.vue +3 -2
  236. package/src/components/Button/Button.vue +9 -12
  237. package/src/components/Feed/Feed.vue +28 -6
  238. package/src/components/FieldPhone/FieldPhone.vue +592 -558
  239. package/src/components/LocationMarker/LocationMarker.vue +26 -22
  240. package/src/components/Popup/Popup.vue +22 -23
  241. package/src/components/Select/Select.vue +43 -32
  242. package/src/components/Slider/Slider.vue +3 -4
  243. package/src/modules/auth/components/pages/Invite.vue +7 -7
  244. package/src/modules/auth/store/auth.js +1 -1
  245. package/src/modules/backoffice/components/pages/Dashboard.vue +44 -29
  246. package/src/modules/community/components/sections/HotPosts.vue +1 -1
  247. package/src/modules/events/components/blocks/CardEvent.vue +4 -3
  248. package/src/modules/events/components/pages/Events.vue +23 -6
  249. package/src/modules/globals/components/sections/SectionPageTitle.vue +19 -7
  250. package/src/modules/globals/controllers/utils/queryProcessor.js +21 -7
  251. package/src/modules/globals/localization/vue-i18n.js +3 -0
  252. package/src/modules/globals/models/credentials.schema.js +7 -0
  253. package/src/modules/globals/models/metadata.schema.js +17 -0
  254. package/src/modules/globals/models/profile.schema.js +23 -0
  255. package/src/modules/globals/models/socials.schema.js +22 -0
  256. package/src/modules/globals/router/routerGuards.js +1 -0
  257. package/src/modules/globals/services/globals.cashe.js +26 -0
  258. package/src/modules/globals/services/globals.crud.js +115 -0
  259. package/src/modules/globals/services/globals.logger.js +41 -0
  260. package/src/modules/globals/services/globals.store.js +114 -0
  261. package/src/modules/icons/entities/IconGallery.vue +14 -0
  262. package/src/modules/icons/entities/IconLeftovers.vue +14 -0
  263. package/src/modules/icons/entities/IconOrders.vue +15 -0
  264. package/src/modules/icons/entities/IconProducts.vue +14 -0
  265. package/src/modules/landing/components/sections/HeroSection.vue +1 -1
  266. package/src/modules/landing/components/sections/MobileApp.vue +4 -4
  267. package/src/modules/landing/router/landing.js +1 -1
  268. package/src/modules/marketplace/components/sections/Filters.vue +3 -3
  269. package/src/modules/middlewares/server/accessors/AccessController.js +33 -0
  270. package/src/modules/middlewares/server/accessors/ReadDepartments.js +101 -0
  271. package/src/modules/middlewares/server/verifyAccesses.js +33 -0
  272. package/src/modules/middlewares/server/verifyInvites.js +4 -4
  273. package/src/modules/orders/components/pages/OrderCreate.vue +2 -2
  274. package/src/modules/orders/components/pages/OrderCreateBackoffice.vue +105 -68
  275. package/src/modules/orders/components/pages/Orders.vue +2 -2
  276. package/src/modules/orders/components/sections/FormAddCustomer.vue +152 -0
  277. package/src/modules/orders/components/sections/FormCustomerDetails.vue +67 -0
  278. package/src/modules/orders/components/sections/FormDelivery.vue +17 -3
  279. package/src/modules/orders/controllers/applications.controller.js +2 -0
  280. package/src/modules/orders/controllers/orders.controller.js +77 -52
  281. package/src/modules/orders/models/customer.model.js +54 -18
  282. package/src/modules/orders/models/order.model.js +1 -1
  283. package/src/modules/orders/orders.client.js +51 -51
  284. package/src/modules/orders/orders.server.js +32 -12
  285. package/src/modules/orders/router/orders.router.js +36 -41
  286. package/src/modules/orders/routes/orders.routes.js +3 -21
  287. package/src/modules/orders/store/customers.store.js +5 -0
  288. package/src/modules/orders/store/models/customer.js +29 -0
  289. package/src/modules/orders/store/orders.js +14 -20
  290. package/src/modules/organizations/components/blocks/CardDepartment.vue +3 -3
  291. package/src/modules/organizations/components/blocks/CardOrganization.vue +1 -1
  292. package/src/modules/organizations/components/blocks/DepartmentMemberModify.vue +1 -12
  293. package/src/modules/organizations/components/pages/Department.vue +1 -1
  294. package/src/modules/organizations/components/pages/DepartmentEdit.vue +72 -48
  295. package/src/modules/organizations/components/pages/Members.vue +178 -64
  296. package/src/modules/organizations/components/pages/Organization.vue +1 -41
  297. package/src/modules/organizations/components/sections/MembersAdd.vue +44 -52
  298. package/src/modules/organizations/controllers/departments.controller.js +2 -4
  299. package/src/modules/organizations/controllers/invites.controller.js +24 -23
  300. package/src/modules/organizations/controllers/organizations.controller.js +1 -1
  301. package/src/modules/organizations/models/department.model.js +52 -2
  302. package/src/modules/organizations/models/invite.model.js +29 -32
  303. package/src/modules/organizations/models/membership.model.js +2 -0
  304. package/src/modules/organizations/models/organization.model.js +2 -1
  305. package/src/modules/organizations/organizations.client.js +0 -2
  306. package/src/modules/organizations/routes/departments.routes.js +18 -7
  307. package/src/modules/organizations/routes/invites.routes.js +2 -2
  308. package/src/modules/organizations/store/departments.js +22 -1
  309. package/src/modules/organizations/store/invites.js +74 -90
  310. package/src/modules/products/components/blocks/CardProduct.vue +24 -0
  311. package/src/modules/products/components/pages/Products.vue +1 -1
  312. package/src/modules/reports/components/sections/FormReport.vue +40 -40
  313. package/src/modules/spots/components/pages/Spot.vue +1 -1
  314. package/src/modules/spots/components/pages/SpotEdit.vue +1 -1
  315. package/src/modules/users/components/blocks/CardUser.vue +85 -0
  316. package/src/modules/users/controllers/users.controller.js +36 -13
  317. package/src/modules/users/middlewares/visitor.logger.js +66 -0
  318. package/src/modules/users/models/request.model.js +18 -0
  319. package/src/modules/users/models/user.model.js +26 -55
  320. package/src/modules/users/models/visitor.model.js +14 -0
  321. package/src/modules/users/store/users.js +2 -11
  322. package/src/modules/wallet/controllers/routes/payments.routes.js +2 -0
  323. package/src/components/FieldPhone/FieldPhone(script-setup).vue +0 -1646
  324. package/src/components/FieldPhone/FieldPhone2.vue +0 -671
  325. package/src/modules/orders/components/sections/FormClientDetails.vue +0 -61
  326. package/src/modules/organizations/components/blocks/User.vue +0 -69
  327. /package/src/modules/backoffice/components/admin/{User.vue → UserEdit.vue} +0 -0
@@ -5,7 +5,7 @@ const require$$1$1 = require("bcryptjs");
5
5
  const require$$0$1 = require("mongoose");
6
6
  const require$$1 = require("jwk-to-pem");
7
7
  const mailing = require("./mailing-BX0q8DIs.js");
8
- const index = require("./index-CL9l0HRS.js");
8
+ const index = require("./index-BCCiEK_u.js");
9
9
  const jwt$1 = require$$0;
10
10
  const jwkToPem = require$$1;
11
11
  async function verifyAppleIdToken$1(id_token) {
@@ -4,7 +4,7 @@ import require$$1$1 from "bcryptjs";
4
4
  import require$$0$1 from "mongoose";
5
5
  import require$$1 from "jwk-to-pem";
6
6
  import { m as mailing } from "./mailing-Cdp8NXhP.mjs";
7
- import { s as server } from "./index-CGIn4v5E.mjs";
7
+ import { s as server } from "./index-B6a1mPgp.mjs";
8
8
  const jwt$1 = require$$0;
9
9
  const jwkToPem = require$$1;
10
10
  async function verifyAppleIdToken$1(id_token) {
@@ -1,11 +1,11 @@
1
1
  "use strict";
2
2
  const _commonjsHelpers = require("./_commonjsHelpers-DHfMLFPC.js");
3
3
  const require$$0 = require("mongoose");
4
- const queryProcessor$3 = require("./queryProcessor-BUDoM96e.js");
4
+ const queryProcessor$3 = require("./queryProcessor-DRMo_GWK.js");
5
5
  require("util");
6
6
  require("uuid");
7
- const index = require("./index-CL9l0HRS.js");
8
- const metadata_schema = require("./metadata.schema-DWR97jhW.js");
7
+ const index = require("./index-BCCiEK_u.js");
8
+ const metadata_schema = require("./metadata.schema-Cu_mPkjE.js");
9
9
  const ownership_schema = require("./ownership.schema-DN0SlQL6.js");
10
10
  function getPeriodConditions(period) {
11
11
  const currentDate = /* @__PURE__ */ new Date();
@@ -1,10 +1,10 @@
1
1
  import { g as getDefaultExportFromCjs } from "./_commonjsHelpers-CUmg6egw.mjs";
2
2
  import require$$0 from "mongoose";
3
- import { q as queryProcessor$3 } from "./queryProcessor-Cl6sU582.mjs";
3
+ import { q as queryProcessor$3 } from "./queryProcessor-BJdKh0Ow.mjs";
4
4
  import "util";
5
5
  import "uuid";
6
- import { s as server$1 } from "./index-CGIn4v5E.mjs";
7
- import { c as common_schema, e as engagement_schema, m as metadata_schema } from "./metadata.schema-BLGSCSmy.mjs";
6
+ import { s as server$1 } from "./index-B6a1mPgp.mjs";
7
+ import { c as common_schema, e as engagement_schema, m as metadata_schema } from "./metadata.schema-cbFgazeK.mjs";
8
8
  import { o as ownership_schema } from "./ownership.schema-oyx6eNkZ.mjs";
9
9
  function getPeriodConditions(period) {
10
10
  const currentDate = /* @__PURE__ */ new Date();
@@ -0,0 +1,106 @@
1
+ import require$$0 from "mongodb";
2
+ const { ObjectId } = require$$0;
3
+ const addUserStatusFields = (user) => {
4
+ return {
5
+ $addFields: {
6
+ isSubscriber: {
7
+ $cond: [
8
+ {
9
+ $anyElementTrue: {
10
+ $map: {
11
+ input: "$memberships",
12
+ as: "membership",
13
+ in: {
14
+ $and: [
15
+ { $eq: ["$$membership.user", new ObjectId(user)] },
16
+ { $eq: ["$$membership.role", "subscriber"] }
17
+ ]
18
+ }
19
+ }
20
+ }
21
+ },
22
+ true,
23
+ false
24
+ ]
25
+ },
26
+ isMember: {
27
+ $cond: [
28
+ {
29
+ $anyElementTrue: {
30
+ $map: {
31
+ input: "$memberships",
32
+ as: "membership",
33
+ in: {
34
+ $and: [
35
+ { $eq: ["$$membership.user", new ObjectId(user)] },
36
+ { $not: [{ $in: ["$$membership.role", ["subscriber", "blocked"]] }] }
37
+ ]
38
+ }
39
+ }
40
+ }
41
+ },
42
+ true,
43
+ false
44
+ ]
45
+ },
46
+ isBlocked: {
47
+ $cond: [
48
+ {
49
+ $anyElementTrue: {
50
+ $map: {
51
+ input: "$memberships",
52
+ as: "membership",
53
+ in: {
54
+ $and: [
55
+ { $eq: ["$$membership.user", new ObjectId(user)] },
56
+ { $eq: ["$$membership.role", "blocked"] }
57
+ ]
58
+ }
59
+ }
60
+ }
61
+ },
62
+ true,
63
+ false
64
+ ]
65
+ }
66
+ }
67
+ };
68
+ };
69
+ var addUserStatusFields_1 = addUserStatusFields;
70
+ const addMembersQuantity = (user) => {
71
+ return {
72
+ $addFields: {
73
+ numberOfSubscribers: {
74
+ $size: {
75
+ $filter: {
76
+ input: "$memberships",
77
+ as: "membership",
78
+ cond: { $eq: ["$$membership.role", "subscriber"] }
79
+ }
80
+ }
81
+ },
82
+ numberOfMembers: {
83
+ $size: {
84
+ $filter: {
85
+ input: "$memberships",
86
+ as: "membership",
87
+ cond: { $not: { $in: ["$$membership.role", ["blocked", "subscriber"]] } }
88
+ }
89
+ }
90
+ }
91
+ }
92
+ };
93
+ };
94
+ var addMembersQuantity_1 = addMembersQuantity;
95
+ var credentials_schema = function applyCredentialsSchema(schema, db) {
96
+ schema.add({
97
+ phone: String,
98
+ email: String,
99
+ apple_id: String
100
+ });
101
+ };
102
+ export {
103
+ addUserStatusFields_1 as a,
104
+ addMembersQuantity_1 as b,
105
+ credentials_schema as c
106
+ };
@@ -0,0 +1,105 @@
1
+ "use strict";
2
+ const require$$0 = require("mongodb");
3
+ const { ObjectId } = require$$0;
4
+ const addUserStatusFields = (user) => {
5
+ return {
6
+ $addFields: {
7
+ isSubscriber: {
8
+ $cond: [
9
+ {
10
+ $anyElementTrue: {
11
+ $map: {
12
+ input: "$memberships",
13
+ as: "membership",
14
+ in: {
15
+ $and: [
16
+ { $eq: ["$$membership.user", new ObjectId(user)] },
17
+ { $eq: ["$$membership.role", "subscriber"] }
18
+ ]
19
+ }
20
+ }
21
+ }
22
+ },
23
+ true,
24
+ false
25
+ ]
26
+ },
27
+ isMember: {
28
+ $cond: [
29
+ {
30
+ $anyElementTrue: {
31
+ $map: {
32
+ input: "$memberships",
33
+ as: "membership",
34
+ in: {
35
+ $and: [
36
+ { $eq: ["$$membership.user", new ObjectId(user)] },
37
+ { $not: [{ $in: ["$$membership.role", ["subscriber", "blocked"]] }] }
38
+ ]
39
+ }
40
+ }
41
+ }
42
+ },
43
+ true,
44
+ false
45
+ ]
46
+ },
47
+ isBlocked: {
48
+ $cond: [
49
+ {
50
+ $anyElementTrue: {
51
+ $map: {
52
+ input: "$memberships",
53
+ as: "membership",
54
+ in: {
55
+ $and: [
56
+ { $eq: ["$$membership.user", new ObjectId(user)] },
57
+ { $eq: ["$$membership.role", "blocked"] }
58
+ ]
59
+ }
60
+ }
61
+ }
62
+ },
63
+ true,
64
+ false
65
+ ]
66
+ }
67
+ }
68
+ };
69
+ };
70
+ var addUserStatusFields_1 = addUserStatusFields;
71
+ const addMembersQuantity = (user) => {
72
+ return {
73
+ $addFields: {
74
+ numberOfSubscribers: {
75
+ $size: {
76
+ $filter: {
77
+ input: "$memberships",
78
+ as: "membership",
79
+ cond: { $eq: ["$$membership.role", "subscriber"] }
80
+ }
81
+ }
82
+ },
83
+ numberOfMembers: {
84
+ $size: {
85
+ $filter: {
86
+ input: "$memberships",
87
+ as: "membership",
88
+ cond: { $not: { $in: ["$$membership.role", ["blocked", "subscriber"]] } }
89
+ }
90
+ }
91
+ }
92
+ }
93
+ };
94
+ };
95
+ var addMembersQuantity_1 = addMembersQuantity;
96
+ var credentials_schema = function applyCredentialsSchema(schema, db) {
97
+ schema.add({
98
+ phone: String,
99
+ email: String,
100
+ apple_id: String
101
+ });
102
+ };
103
+ exports.addMembersQuantity_1 = addMembersQuantity_1;
104
+ exports.addUserStatusFields_1 = addUserStatusFields_1;
105
+ exports.credentials_schema = credentials_schema;
@@ -2,11 +2,11 @@
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
3
  const _commonjsHelpers = require("./_commonjsHelpers-DHfMLFPC.js");
4
4
  const require$$0 = require("mongoose");
5
- const queryProcessor$2 = require("./queryProcessor-BUDoM96e.js");
5
+ const queryProcessor$2 = require("./queryProcessor-DRMo_GWK.js");
6
+ const metadata_schema = require("./metadata.schema-Cu_mPkjE.js");
6
7
  const require$$1 = require("stripe");
7
- const index = require("./index-CL9l0HRS.js");
8
+ const index = require("./index-BCCiEK_u.js");
8
9
  const tickets_controller = require("./tickets.controller-WaQ4qMpv.js");
9
- const metadata_schema = require("./metadata.schema-DWR97jhW.js");
10
10
  const ownership_schema = require("./ownership.schema-DN0SlQL6.js");
11
11
  const ObjectId = require$$0.Types.ObjectId;
12
12
  function getDateConditions(date) {
@@ -207,17 +207,6 @@ var queryProcessor$1 = {
207
207
  getProjectStage,
208
208
  getParticipantStages
209
209
  };
210
- function createFriendlyURL$1(str) {
211
- if (typeof str !== "string") {
212
- throw new Error("Входные данные должны быть строкой");
213
- }
214
- str = str.trim().toLowerCase();
215
- str = str.replace(/ /g, "-").replace(/[^\w-]+/g, "");
216
- str = str.replace(/-+/g, "-");
217
- str = str.replace(/^-+|-+$/g, "");
218
- return str;
219
- }
220
- var seoFriendlyUrl = createFriendlyURL$1;
221
210
  class serviceIntegrations {
222
211
  async createProduct(event) {
223
212
  throw new Error("createProduct method not implemented");
@@ -440,7 +429,7 @@ var stripe_service = servicePaymentStripe;
440
429
  require$$0.Types.ObjectId;
441
430
  const queryProcessor = queryProcessor$1;
442
431
  const queryProcessorGlobals = queryProcessor$2.queryProcessor;
443
- const createFriendlyURL = seoFriendlyUrl;
432
+ const createFriendlyURL = metadata_schema.seoFriendlyUrl;
444
433
  const integrationStripe = stripe_service;
445
434
  const middlewareFactory = (db) => {
446
435
  db.ticket;
@@ -1,10 +1,10 @@
1
1
  import { g as getDefaultExportFromCjs } from "./_commonjsHelpers-CUmg6egw.mjs";
2
2
  import require$$0 from "mongoose";
3
- import { q as queryProcessor$2 } from "./queryProcessor-Cl6sU582.mjs";
3
+ import { q as queryProcessor$2 } from "./queryProcessor-BJdKh0Ow.mjs";
4
+ import { s as seoFriendlyUrl, c as common_schema, e as engagement_schema, m as metadata_schema } from "./metadata.schema-cbFgazeK.mjs";
4
5
  import require$$1 from "stripe";
5
- import { s as server$1 } from "./index-CGIn4v5E.mjs";
6
+ import { s as server$1 } from "./index-B6a1mPgp.mjs";
6
7
  import { t as tickets_controller } from "./tickets.controller-ByZ33N6_.mjs";
7
- import { c as common_schema, e as engagement_schema, m as metadata_schema } from "./metadata.schema-BLGSCSmy.mjs";
8
8
  import { o as ownership_schema } from "./ownership.schema-oyx6eNkZ.mjs";
9
9
  const ObjectId = require$$0.Types.ObjectId;
10
10
  function getDateConditions(date) {
@@ -205,17 +205,6 @@ var queryProcessor$1 = {
205
205
  getProjectStage,
206
206
  getParticipantStages
207
207
  };
208
- function createFriendlyURL$1(str) {
209
- if (typeof str !== "string") {
210
- throw new Error("Входные данные должны быть строкой");
211
- }
212
- str = str.trim().toLowerCase();
213
- str = str.replace(/ /g, "-").replace(/[^\w-]+/g, "");
214
- str = str.replace(/-+/g, "-");
215
- str = str.replace(/^-+|-+$/g, "");
216
- return str;
217
- }
218
- var seoFriendlyUrl = createFriendlyURL$1;
219
208
  class serviceIntegrations {
220
209
  async createProduct(event) {
221
210
  throw new Error("createProduct method not implemented");
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  const _commonjsHelpers = require("./_commonjsHelpers-DHfMLFPC.js");
3
3
  const require$$0 = require("path");
4
- const index = require("./index-CL9l0HRS.js");
4
+ const index = require("./index-BCCiEK_u.js");
5
5
  const require$$0$1 = require("sharp");
6
6
  const require$$1 = require("fs");
7
7
  const require$$2 = require("fs/promises");
@@ -1,6 +1,6 @@
1
1
  import { g as getDefaultExportFromCjs } from "./_commonjsHelpers-CUmg6egw.mjs";
2
2
  import require$$0 from "path";
3
- import { s as server$1 } from "./index-CGIn4v5E.mjs";
3
+ import { s as server$1 } from "./index-B6a1mPgp.mjs";
4
4
  import require$$0$1 from "sharp";
5
5
  import require$$1 from "fs";
6
6
  import require$$2 from "fs/promises";
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  const _commonjsHelpers = require("./_commonjsHelpers-DHfMLFPC.js");
3
3
  const require$$0 = require("path");
4
- const index = require("./index-CL9l0HRS.js");
4
+ const index = require("./index-BCCiEK_u.js");
5
5
  const path = require$$0;
6
6
  const controllerFactory$1 = (db) => {
7
7
  const Photo = db.photo;
@@ -1,6 +1,6 @@
1
1
  import { g as getDefaultExportFromCjs } from "./_commonjsHelpers-CUmg6egw.mjs";
2
2
  import require$$0 from "path";
3
- import { s as server } from "./index-CGIn4v5E.mjs";
3
+ import { s as server } from "./index-B6a1mPgp.mjs";
4
4
  const path = require$$0;
5
5
  const controllerFactory$1 = (db) => {
6
6
  const Photo = db.photo;
@@ -0,0 +1,217 @@
1
+ import require$$0 from "jsonwebtoken";
2
+ import require$$0$1 from "mongodb";
3
+ const jwt = require$$0;
4
+ const middlewareFactory$4 = (db) => {
5
+ const User = db.user;
6
+ const Role = db.role;
7
+ const verifyToken = async (req, res, next) => {
8
+ try {
9
+ console.log(req.cookies);
10
+ let user = JSON.parse(req.cookies.user);
11
+ let token = req.headers["x-access-token"] || user.accessToken;
12
+ if (!token) {
13
+ return res.status(403).send({ message: "No token provided!" });
14
+ }
15
+ const decoded = jwt.verify(token, process.env.SECRET_KEY);
16
+ req.userId = decoded._id;
17
+ console.log("success");
18
+ next();
19
+ } catch (err) {
20
+ console.log(err);
21
+ return res.status(401).send({ message: "Unauthorized!" });
22
+ }
23
+ };
24
+ const checkRole = (roleToCheck) => async (req, res, next) => {
25
+ try {
26
+ const user = await User.findById(req.userId).exec();
27
+ if (!user) {
28
+ return res.status(404).send({ message: "User Not found." });
29
+ }
30
+ const roles = await Role.find({ _id: { $in: user.roles } }).exec();
31
+ for (let role of roles) {
32
+ if (role.name === roleToCheck) {
33
+ next();
34
+ return;
35
+ }
36
+ }
37
+ res.status(403).send({ message: `Require ${roleToCheck} Role!` });
38
+ } catch (err) {
39
+ res.status(500).send({ message: err.message });
40
+ }
41
+ };
42
+ const isAdmin = checkRole("admin");
43
+ const isModerator = checkRole("moderator");
44
+ return {
45
+ verifyToken,
46
+ isAdmin,
47
+ isModerator
48
+ };
49
+ };
50
+ var authJwt = middlewareFactory$4;
51
+ const middlewareFactory$3 = (db) => {
52
+ const User = db.user;
53
+ db.role;
54
+ const checkDuplicateUsernameOrEmail = async (req, res, next) => {
55
+ const { type, email, phone } = req.body;
56
+ console.log(req.body);
57
+ let query;
58
+ if (type === "phone" && phone) {
59
+ query = { phone };
60
+ }
61
+ if (type === "email" && email) {
62
+ query = { email };
63
+ }
64
+ try {
65
+ const user = await User.findOne(query).exec();
66
+ if (user) {
67
+ console.log(`USER_ALREADY_REGISTERED`);
68
+ res.status(400).send({ errorCode: "USER_ALREADY_REGISTERED" });
69
+ return;
70
+ }
71
+ next();
72
+ } catch (err) {
73
+ console.log(err);
74
+ res.status(500).send({ message: err.message });
75
+ }
76
+ };
77
+ const checkRolesExisted = (req, res, next) => {
78
+ if (req.body.roles) {
79
+ for (let i = 0; i < req.body.roles.length; i++) {
80
+ if (!ROLES.includes(req.body.roles[i])) {
81
+ console.log(`Failed! Role ${req.body.roles[i]} does not exist!`);
82
+ res.status(400).send({
83
+ message: `Failed! Role ${req.body.roles[i]} does not exist!`
84
+ });
85
+ return;
86
+ }
87
+ }
88
+ }
89
+ next();
90
+ };
91
+ return {
92
+ checkDuplicateUsernameOrEmail,
93
+ checkRolesExisted
94
+ };
95
+ };
96
+ var verifySignUp = middlewareFactory$3;
97
+ const middlewareFactory$2 = (db) => {
98
+ const User = db.user;
99
+ db.role;
100
+ const checkUserExist = async (req, res, next) => {
101
+ const { type, email, phone } = req.body;
102
+ let query;
103
+ if (type === "phone" && phone) {
104
+ query = { phone };
105
+ }
106
+ if (type === "email" && email) {
107
+ query = { email };
108
+ }
109
+ try {
110
+ const user = await User.findOne(query).exec();
111
+ if (!user) {
112
+ console.log(query);
113
+ res.status(400).send({ errorCode: "USER_NOT_REGISTERED_YET" });
114
+ return;
115
+ }
116
+ next();
117
+ } catch (err) {
118
+ res.status(500).send({ message: err.message });
119
+ }
120
+ };
121
+ return {
122
+ checkUserExist
123
+ };
124
+ };
125
+ var verifyUser = middlewareFactory$2;
126
+ const { ObjectId } = require$$0$1;
127
+ const middlewareFactory$1 = (db) => {
128
+ const User = db.user;
129
+ const Invite = db.invite;
130
+ const Membership = db.membership;
131
+ const checkInviteExist = async (req, res, next) => {
132
+ for (let invite of req.body.invites) {
133
+ let query;
134
+ if (invite.contact.includes("@")) {
135
+ query = { invitedEmail: invite.contact };
136
+ } else {
137
+ query = { invitedPhone: invite.contact };
138
+ }
139
+ query["owner.target"] = req.body.owner.target;
140
+ const userInvite = await Invite.findOne(query).exec();
141
+ if (userInvite) {
142
+ console.log(userInvite);
143
+ res.status(400).send({ message: "Инвайт c таким email или телефоном уже создан!" });
144
+ return;
145
+ }
146
+ }
147
+ next();
148
+ };
149
+ const checkUsersExist = async (req, res, next) => {
150
+ for (let invite of req.body.invites) {
151
+ let query;
152
+ if (invite.contact.includes("@")) {
153
+ query = { email: invite.contact };
154
+ } else {
155
+ query = { phone: invite.contact };
156
+ }
157
+ const user = await User.findOne(query).exec();
158
+ console.log(req.params);
159
+ if (user) {
160
+ const membership = await Membership.findOne({ user: new ObjectId(user._id), "owner.target": req.body.owner.target }).exec();
161
+ if (membership) {
162
+ console.log(membership);
163
+ res.status(400).send({ message: "Пользователь с таким email или телефоном уже добавлен в организацию!" });
164
+ return;
165
+ }
166
+ }
167
+ }
168
+ next();
169
+ };
170
+ return {
171
+ checkInviteExist,
172
+ checkUsersExist
173
+ };
174
+ };
175
+ var verifyInvites = middlewareFactory$1;
176
+ const middlewareFactory = (db) => {
177
+ const Category = db.category;
178
+ const checkCategoryExistOrNot = async (req, res, next) => {
179
+ try {
180
+ const category = await Category.findOne({ url: req.body.url });
181
+ if (category) {
182
+ res.status(400).send({ message: "Failed! Category with this URL is already in use!" });
183
+ return;
184
+ }
185
+ next();
186
+ } catch (err) {
187
+ res.status(500).send({ message: err });
188
+ }
189
+ };
190
+ return {
191
+ checkCategoryExistOrNot
192
+ };
193
+ };
194
+ var verifyCategory = middlewareFactory;
195
+ const middlewareIndexFactory = (db) => {
196
+ const authJwt$1 = authJwt(db);
197
+ const verifySignUp$1 = verifySignUp(db);
198
+ const verifyUser$1 = verifyUser(db);
199
+ const verifyInvites$1 = verifyInvites(db);
200
+ const verifyCategory$1 = verifyCategory(db);
201
+ return {
202
+ authJwt: authJwt$1,
203
+ verifySignUp: verifySignUp$1,
204
+ verifyUser: verifyUser$1,
205
+ verifyInvites: verifyInvites$1,
206
+ verifyCategory: verifyCategory$1
207
+ };
208
+ };
209
+ var server = middlewareIndexFactory;
210
+ export {
211
+ verifyInvites as a,
212
+ authJwt as b,
213
+ verifySignUp as c,
214
+ verifyCategory as d,
215
+ server as s,
216
+ verifyUser as v
217
+ };