@ozdao/prometheus-framework 0.2.81 → 0.2.83

Sign up to get free protection for your applications and to get access to all the features.
Files changed (388) 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-B-KD_ozQ.js +9 -0
  6. package/dist/credentials.schema-C9dmNy7o.mjs +10 -0
  7. package/dist/credentials.schema-CDZCKfEI.mjs +106 -0
  8. package/dist/credentials.schema-CfhPcsuI.js +105 -0
  9. package/dist/events.server.js +4 -15
  10. package/dist/events.server.mjs +3 -14
  11. package/dist/files.server.js +1 -1
  12. package/dist/files.server.mjs +1 -1
  13. package/dist/gallery.server.js +1 -1
  14. package/dist/gallery.server.mjs +1 -1
  15. package/dist/index-B6a1mPgp.mjs +217 -0
  16. package/dist/index-BCCiEK_u.js +216 -0
  17. package/dist/main-8N2Jmsuk.js +91 -0
  18. package/dist/main-CkeuHuCY.mjs +13619 -0
  19. package/dist/main.css +1 -1
  20. package/dist/metadata.schema-Cu_mPkjE.js +77 -0
  21. package/dist/metadata.schema-cbFgazeK.mjs +78 -0
  22. package/dist/middlewares.server.js +1 -1
  23. package/dist/middlewares.server.mjs +1 -1
  24. package/dist/node_modules/@googlemaps/js-api-loader/dist/index.cjs +1 -0
  25. package/dist/node_modules/@googlemaps/js-api-loader/dist/index.js +238 -0
  26. package/dist/orders.server.js +592 -0
  27. package/dist/orders.server.mjs +593 -0
  28. package/dist/organizations.server.js +295 -131
  29. package/dist/organizations.server.mjs +295 -131
  30. package/dist/products.server.js +2 -2
  31. package/dist/products.server.mjs +2 -2
  32. package/dist/profile.schema-24ZpZQJe.mjs +25 -0
  33. package/dist/profile.schema-CkOhhf37.js +24 -0
  34. package/dist/prometheus-framework/src/components/Address/Address.vue2.cjs +1 -1
  35. package/dist/prometheus-framework/src/components/Address/Address.vue2.js +33 -24
  36. package/dist/prometheus-framework/src/components/Block/Block.vue.cjs +1 -1
  37. package/dist/prometheus-framework/src/components/Block/Block.vue.js +23 -20
  38. package/dist/prometheus-framework/src/components/Button/Button.vue.cjs +1 -1
  39. package/dist/prometheus-framework/src/components/Button/Button.vue.js +1 -225
  40. package/dist/prometheus-framework/src/components/Button/Button.vue2.cjs +1 -1
  41. package/dist/prometheus-framework/src/components/Button/Button.vue2.js +102 -1
  42. package/dist/prometheus-framework/src/components/Feed/Feed.vue.cjs +1 -1
  43. package/dist/prometheus-framework/src/components/Feed/Feed.vue.js +71 -60
  44. package/dist/prometheus-framework/src/components/Field/Field.vue.cjs +1 -1
  45. package/dist/prometheus-framework/src/components/Field/Field.vue.js +1 -84
  46. package/dist/prometheus-framework/src/components/Field/Field.vue2.cjs +1 -1
  47. package/dist/prometheus-framework/src/components/Field/Field.vue2.js +84 -1
  48. package/dist/prometheus-framework/src/components/FieldBig/FieldBig.vue.cjs +1 -1
  49. package/dist/prometheus-framework/src/components/FieldBig/FieldBig.vue.js +1 -1
  50. package/dist/prometheus-framework/src/components/FieldPhone/FieldPhone.vue.cjs +1 -1
  51. package/dist/prometheus-framework/src/components/FieldPhone/FieldPhone.vue.js +325 -340
  52. package/dist/prometheus-framework/src/components/FieldPhone/FieldPhone2.vue.cjs +1 -1
  53. package/dist/prometheus-framework/src/components/FieldPhone/FieldPhone2.vue.js +2 -2
  54. package/dist/prometheus-framework/src/components/LocationMarker/LocationMarker.vue2.cjs +1 -1
  55. package/dist/prometheus-framework/src/components/LocationMarker/LocationMarker.vue2.js +53 -44
  56. package/dist/prometheus-framework/src/components/Popup/Popup.vue2.cjs +1 -1
  57. package/dist/prometheus-framework/src/components/Popup/Popup.vue2.js +41 -40
  58. package/dist/prometheus-framework/src/components/Select/Select.vue2.cjs +1 -1
  59. package/dist/prometheus-framework/src/components/Select/Select.vue2.js +37 -31
  60. package/dist/prometheus-framework/src/components/Slider/Slider.vue.cjs +1 -1
  61. package/dist/prometheus-framework/src/components/Slider/Slider.vue.js +18 -19
  62. package/dist/prometheus-framework/src/components/Tab/Tab.vue.cjs +1 -1
  63. package/dist/prometheus-framework/src/components/Tab/Tab.vue.js +1 -36
  64. package/dist/prometheus-framework/src/components/Tab/Tab.vue2.cjs +1 -1
  65. package/dist/prometheus-framework/src/components/Tab/Tab.vue2.js +36 -1
  66. package/dist/prometheus-framework/src/components/Tooltip/Tooltip.vue.cjs +1 -1
  67. package/dist/prometheus-framework/src/components/Tooltip/Tooltip.vue.js +45 -1
  68. package/dist/prometheus-framework/src/components/Tooltip/Tooltip.vue2.cjs +1 -1
  69. package/dist/prometheus-framework/src/components/Tooltip/Tooltip.vue2.js +1 -45
  70. package/dist/prometheus-framework/src/modules/auth/components/layouts/Auth.vue.cjs +1 -1
  71. package/dist/prometheus-framework/src/modules/auth/components/layouts/Auth.vue.js +3 -3
  72. package/dist/prometheus-framework/src/modules/auth/components/pages/EnterCode.vue.cjs +1 -1
  73. package/dist/prometheus-framework/src/modules/auth/components/pages/EnterCode.vue.js +1 -1
  74. package/dist/prometheus-framework/src/modules/auth/components/pages/EnterPassword.vue.cjs +1 -1
  75. package/dist/prometheus-framework/src/modules/auth/components/pages/EnterPassword.vue.js +3 -3
  76. package/dist/prometheus-framework/src/modules/auth/components/pages/Invite.vue.cjs +1 -1
  77. package/dist/prometheus-framework/src/modules/auth/components/pages/Invite.vue.js +30 -30
  78. package/dist/prometheus-framework/src/modules/auth/components/pages/ResetPassword.vue.cjs +1 -1
  79. package/dist/prometheus-framework/src/modules/auth/components/pages/ResetPassword.vue.js +3 -3
  80. package/dist/prometheus-framework/src/modules/auth/components/pages/SignIn.vue.cjs +1 -1
  81. package/dist/prometheus-framework/src/modules/auth/components/pages/SignIn.vue.js +3 -3
  82. package/dist/prometheus-framework/src/modules/auth/components/pages/SignUp.vue.cjs +1 -1
  83. package/dist/prometheus-framework/src/modules/auth/components/pages/SignUp.vue.js +3 -3
  84. package/dist/prometheus-framework/src/modules/auth/store/auth.cjs +1 -1
  85. package/dist/prometheus-framework/src/modules/auth/store/auth.js +26 -26
  86. package/dist/prometheus-framework/src/modules/backoffice/components/pages/Dashboard.vue.cjs +1 -1
  87. package/dist/prometheus-framework/src/modules/backoffice/components/pages/Dashboard.vue.js +78 -103
  88. package/dist/prometheus-framework/src/modules/chats/components/blocks/ChatMessage.vue.cjs +1 -0
  89. package/dist/prometheus-framework/src/modules/chats/components/blocks/ChatMessage.vue.js +28 -0
  90. package/dist/prometheus-framework/src/modules/chats/components/pages/ChatPage.vue.cjs +1 -0
  91. package/dist/prometheus-framework/src/modules/chats/components/pages/ChatPage.vue.js +26 -0
  92. package/dist/prometheus-framework/src/modules/chats/components/pages/ChatPage.vue2.cjs +1 -0
  93. package/dist/prometheus-framework/src/modules/chats/components/pages/ChatPage.vue2.js +1 -0
  94. package/dist/prometheus-framework/src/modules/chats/components/sections/ChatWindow.vue.cjs +1 -0
  95. package/dist/prometheus-framework/src/modules/chats/components/sections/ChatWindow.vue.js +77 -0
  96. package/dist/prometheus-framework/src/modules/chats/components/sections/ChatWindow.vue2.cjs +1 -0
  97. package/dist/prometheus-framework/src/modules/chats/components/sections/ChatWindow.vue2.js +1 -0
  98. package/dist/prometheus-framework/src/modules/chats/store/chat.store.cjs +1 -0
  99. package/dist/prometheus-framework/src/modules/chats/store/chat.store.js +40 -0
  100. package/dist/prometheus-framework/src/modules/community/components/pages/Community.vue.cjs +1 -1
  101. package/dist/prometheus-framework/src/modules/community/components/pages/Community.vue.js +2 -2
  102. package/dist/prometheus-framework/src/modules/community/components/pages/CreateBlogPost.vue.cjs +1 -1
  103. package/dist/prometheus-framework/src/modules/community/components/pages/CreateBlogPost.vue.js +3 -3
  104. package/dist/prometheus-framework/src/modules/community/components/sections/HotPosts.vue.cjs +1 -1
  105. package/dist/prometheus-framework/src/modules/community/components/sections/HotPosts.vue.js +15 -15
  106. package/dist/prometheus-framework/src/modules/constructor/components/elements/Embed.vue.cjs +1 -1
  107. package/dist/prometheus-framework/src/modules/constructor/components/elements/Embed.vue.js +1 -1
  108. package/dist/prometheus-framework/src/modules/constructor/components/elements/Textarea.vue.cjs +1 -5
  109. package/dist/prometheus-framework/src/modules/constructor/components/elements/Textarea.vue.js +0 -66
  110. package/dist/prometheus-framework/src/modules/constructor/components/elements/Textarea.vue2.cjs +5 -1
  111. package/dist/prometheus-framework/src/modules/constructor/components/elements/Textarea.vue2.js +66 -0
  112. package/dist/prometheus-framework/src/modules/constructor/components/sections/Constructor.vue.cjs +1 -1
  113. package/dist/prometheus-framework/src/modules/constructor/components/sections/Constructor.vue.js +1 -1
  114. package/dist/prometheus-framework/src/modules/events/components/blocks/CardEvent.vue.cjs +1 -1
  115. package/dist/prometheus-framework/src/modules/events/components/blocks/CardEvent.vue.js +4 -4
  116. package/dist/prometheus-framework/src/modules/events/components/elements/ButtonCheck.vue.cjs +1 -1
  117. package/dist/prometheus-framework/src/modules/events/components/elements/ButtonCheck.vue.js +1 -1
  118. package/dist/prometheus-framework/src/modules/events/components/elements/ButtonJoin.vue.cjs +1 -1
  119. package/dist/prometheus-framework/src/modules/events/components/elements/ButtonJoin.vue.js +1 -1
  120. package/dist/prometheus-framework/src/modules/events/components/pages/EditEvent.vue.cjs +1 -1
  121. package/dist/prometheus-framework/src/modules/events/components/pages/EditEvent.vue.js +3 -3
  122. package/dist/prometheus-framework/src/modules/events/components/pages/EditEventTickets.vue.cjs +1 -1
  123. package/dist/prometheus-framework/src/modules/events/components/pages/EditEventTickets.vue.js +2 -2
  124. package/dist/prometheus-framework/src/modules/events/components/pages/Events.vue.cjs +1 -1
  125. package/dist/prometheus-framework/src/modules/events/components/pages/Events.vue.js +29 -27
  126. package/dist/prometheus-framework/src/modules/gallery/components/sections/BackofficeGallery.vue.cjs +1 -1
  127. package/dist/prometheus-framework/src/modules/gallery/components/sections/BackofficeGallery.vue.js +2 -2
  128. package/dist/prometheus-framework/src/modules/gallery/components/sections/GalleryWithCategories.vue.cjs +1 -1
  129. package/dist/prometheus-framework/src/modules/gallery/components/sections/GalleryWithCategories.vue.js +2 -2
  130. package/dist/prometheus-framework/src/modules/globals/components/blocks/BlockSearch.vue.cjs +1 -1
  131. package/dist/prometheus-framework/src/modules/globals/components/blocks/BlockSearch.vue.js +1 -1
  132. package/dist/prometheus-framework/src/modules/globals/components/blocks/CardHeader.vue.cjs +1 -1
  133. package/dist/prometheus-framework/src/modules/globals/components/blocks/CardHeader.vue.js +2 -2
  134. package/dist/prometheus-framework/src/modules/globals/components/sections/SectionPageTitle.vue.cjs +1 -1
  135. package/dist/prometheus-framework/src/modules/globals/components/sections/SectionPageTitle.vue.js +33 -26
  136. package/dist/prometheus-framework/src/modules/globals/localization/vue-i18n.cjs +1 -1
  137. package/dist/prometheus-framework/src/modules/globals/localization/vue-i18n.js +6 -3
  138. package/dist/prometheus-framework/src/modules/globals/services/globals.store.cjs +1 -0
  139. package/dist/prometheus-framework/src/modules/globals/services/globals.store.js +70 -0
  140. package/dist/prometheus-framework/src/modules/icons/entities/IconGallery.vue.cjs +1 -0
  141. package/dist/prometheus-framework/src/modules/icons/entities/IconGallery.vue.js +28 -0
  142. package/dist/prometheus-framework/src/modules/icons/entities/IconLeftovers.vue.cjs +1 -0
  143. package/dist/prometheus-framework/src/modules/icons/entities/IconLeftovers.vue.js +30 -0
  144. package/dist/prometheus-framework/src/modules/icons/entities/IconOrders.vue.cjs +1 -0
  145. package/dist/prometheus-framework/src/modules/icons/entities/IconOrders.vue.js +35 -0
  146. package/dist/prometheus-framework/src/modules/icons/entities/IconProducts.vue.cjs +1 -0
  147. package/dist/prometheus-framework/src/modules/icons/entities/IconProducts.vue.js +28 -0
  148. package/dist/prometheus-framework/src/modules/icons/navigation/IconCheckmark.vue.cjs +1 -0
  149. package/dist/prometheus-framework/src/modules/icons/navigation/IconCheckmark.vue.js +29 -0
  150. package/dist/prometheus-framework/src/modules/icons/placeholders/PlaceholderChat.vue.cjs +1 -0
  151. package/dist/prometheus-framework/src/modules/icons/placeholders/PlaceholderChat.vue.js +30 -0
  152. package/dist/prometheus-framework/src/modules/landing/components/sections/MobileApp.vue.cjs +1 -1
  153. package/dist/prometheus-framework/src/modules/landing/components/sections/MobileApp.vue.js +63 -86
  154. package/dist/prometheus-framework/src/modules/legal/components/pages/Legal.vue.cjs +1 -1
  155. package/dist/prometheus-framework/src/modules/legal/components/pages/Legal.vue.js +2 -2
  156. package/dist/prometheus-framework/src/modules/orders/components/blocks/CardOrder.vue.cjs +1 -1
  157. package/dist/prometheus-framework/src/modules/orders/components/blocks/CardOrder.vue.js +121 -1
  158. package/dist/prometheus-framework/src/modules/orders/components/blocks/CardOrder.vue2.cjs +1 -0
  159. package/dist/prometheus-framework/src/modules/orders/components/blocks/CardOrder.vue2.js +1 -0
  160. package/dist/prometheus-framework/src/modules/orders/components/blocks/StatusHistory.vue.cjs +3 -0
  161. package/dist/prometheus-framework/src/modules/orders/components/blocks/StatusHistory.vue.js +92 -0
  162. package/dist/prometheus-framework/src/modules/orders/components/pages/Order.vue.cjs +1 -0
  163. package/dist/prometheus-framework/src/modules/orders/components/pages/Order.vue.js +202 -0
  164. package/dist/prometheus-framework/src/modules/orders/components/pages/Order.vue2.cjs +1 -0
  165. package/dist/prometheus-framework/src/modules/orders/components/pages/Order.vue2.js +1 -0
  166. package/dist/prometheus-framework/src/modules/orders/components/pages/OrderCreate.vue.cjs +1 -0
  167. package/dist/prometheus-framework/src/modules/orders/components/pages/OrderCreate.vue.js +127 -0
  168. package/dist/prometheus-framework/src/modules/orders/components/pages/OrderCreate.vue2.cjs +1 -0
  169. package/dist/prometheus-framework/src/modules/orders/components/pages/OrderCreate.vue2.js +1 -0
  170. package/dist/prometheus-framework/src/modules/orders/components/pages/OrderCreateBackoffice.vue.cjs +1 -1
  171. package/dist/prometheus-framework/src/modules/orders/components/pages/OrderCreateBackoffice.vue.js +174 -114
  172. package/dist/prometheus-framework/src/modules/orders/components/pages/Orders.vue.cjs +1 -1
  173. package/dist/prometheus-framework/src/modules/orders/components/pages/Orders.vue.js +41 -41
  174. package/dist/prometheus-framework/src/modules/orders/components/partials/ShopCart.vue.cjs +1 -0
  175. package/dist/prometheus-framework/src/modules/orders/components/partials/ShopCart.vue.js +89 -0
  176. package/dist/prometheus-framework/src/modules/orders/components/partials/ShopCart.vue2.cjs +1 -0
  177. package/dist/prometheus-framework/src/modules/orders/components/partials/ShopCart.vue2.js +1 -0
  178. package/dist/prometheus-framework/src/modules/orders/components/sections/AskToLogin.vue.cjs +1 -0
  179. package/dist/prometheus-framework/src/modules/orders/components/sections/AskToLogin.vue.js +24 -0
  180. package/dist/prometheus-framework/src/modules/orders/components/sections/EmptyState.vue.cjs +1 -0
  181. package/dist/prometheus-framework/src/modules/orders/components/sections/EmptyState.vue.js +13 -0
  182. package/dist/prometheus-framework/src/modules/orders/components/sections/FormAddCustomer.vue.cjs +1 -0
  183. package/dist/prometheus-framework/src/modules/orders/components/sections/FormAddCustomer.vue.js +141 -0
  184. package/dist/prometheus-framework/src/modules/orders/components/sections/FormClientDetails.vue.cjs +1 -1
  185. package/dist/prometheus-framework/src/modules/orders/components/sections/FormClientDetails.vue.js +1 -1
  186. package/dist/prometheus-framework/src/modules/orders/components/sections/FormCustomerDetails.vue.cjs +1 -0
  187. package/dist/prometheus-framework/src/modules/orders/components/sections/FormCustomerDetails.vue.js +77 -0
  188. package/dist/prometheus-framework/src/modules/orders/components/sections/FormDelivery.vue.cjs +1 -1
  189. package/dist/prometheus-framework/src/modules/orders/components/sections/FormDelivery.vue.js +46 -35
  190. package/dist/prometheus-framework/src/modules/orders/components/sections/Succes.vue.cjs +1 -0
  191. package/dist/prometheus-framework/src/modules/orders/components/sections/Succes.vue.js +25 -0
  192. package/dist/prometheus-framework/src/modules/orders/orders.client.cjs +1 -0
  193. package/dist/prometheus-framework/src/modules/orders/orders.client.js +56 -0
  194. package/dist/prometheus-framework/src/modules/orders/router/orders.router.cjs +1 -0
  195. package/dist/prometheus-framework/src/modules/orders/router/orders.router.js +58 -0
  196. package/dist/prometheus-framework/src/modules/orders/store/customers.store.cjs +1 -0
  197. package/dist/prometheus-framework/src/modules/orders/store/customers.store.js +5 -0
  198. package/dist/prometheus-framework/src/modules/orders/store/models/customer.cjs +1 -0
  199. package/dist/prometheus-framework/src/modules/orders/store/models/customer.js +30 -0
  200. package/dist/prometheus-framework/src/modules/orders/store/orders.cjs +1 -1
  201. package/dist/prometheus-framework/src/modules/orders/store/orders.js +24 -25
  202. package/dist/prometheus-framework/src/modules/orders/store/shopcart.cjs +1 -1
  203. package/dist/prometheus-framework/src/modules/orders/store/shopcart.js +5 -1
  204. package/dist/prometheus-framework/src/modules/organizations/components/blocks/CardDepartment.vue.cjs +1 -1
  205. package/dist/prometheus-framework/src/modules/organizations/components/blocks/CardDepartment.vue.js +16 -16
  206. package/dist/prometheus-framework/src/modules/organizations/components/blocks/CardOrganization.vue.cjs +1 -1
  207. package/dist/prometheus-framework/src/modules/organizations/components/blocks/CardOrganization.vue.js +1 -1
  208. package/dist/prometheus-framework/src/modules/organizations/components/blocks/DepartmentMemberModify.vue.cjs +1 -1
  209. package/dist/prometheus-framework/src/modules/organizations/components/blocks/DepartmentMemberModify.vue.js +38 -49
  210. package/dist/prometheus-framework/src/modules/organizations/components/elements/ButtonToggleMembership.vue.cjs +1 -1
  211. package/dist/prometheus-framework/src/modules/organizations/components/elements/ButtonToggleMembership.vue.js +1 -1
  212. package/dist/prometheus-framework/src/modules/organizations/components/pages/Department.vue.cjs +1 -1
  213. package/dist/prometheus-framework/src/modules/organizations/components/pages/Department.vue.js +6 -6
  214. package/dist/prometheus-framework/src/modules/organizations/components/pages/DepartmentEdit.vue.cjs +1 -1
  215. package/dist/prometheus-framework/src/modules/organizations/components/pages/DepartmentEdit.vue.js +161 -138
  216. package/dist/prometheus-framework/src/modules/organizations/components/pages/Members.vue.cjs +1 -1
  217. package/dist/prometheus-framework/src/modules/organizations/components/pages/Members.vue.js +198 -78
  218. package/dist/prometheus-framework/src/modules/organizations/components/pages/Organization.vue.cjs +1 -1
  219. package/dist/prometheus-framework/src/modules/organizations/components/pages/Organization.vue.js +82 -125
  220. package/dist/prometheus-framework/src/modules/organizations/components/pages/OrganizationEdit.vue.cjs +1 -1
  221. package/dist/prometheus-framework/src/modules/organizations/components/pages/OrganizationEdit.vue.js +3 -3
  222. package/dist/prometheus-framework/src/modules/organizations/components/pages/Organizations.vue.cjs +1 -1
  223. package/dist/prometheus-framework/src/modules/organizations/components/pages/Organizations.vue.js +1 -1
  224. package/dist/prometheus-framework/src/modules/organizations/components/sections/Documents.vue.cjs +1 -1
  225. package/dist/prometheus-framework/src/modules/organizations/components/sections/Documents.vue.js +2 -2
  226. package/dist/prometheus-framework/src/modules/organizations/components/sections/MembersAdd.vue.cjs +1 -1
  227. package/dist/prometheus-framework/src/modules/organizations/components/sections/MembersAdd.vue.js +59 -70
  228. package/dist/prometheus-framework/src/modules/organizations/components/sections/Organizations.vue.cjs +1 -1
  229. package/dist/prometheus-framework/src/modules/organizations/components/sections/Organizations.vue.js +3 -3
  230. package/dist/prometheus-framework/src/modules/organizations/organizations.client.cjs +1 -1
  231. package/dist/prometheus-framework/src/modules/organizations/organizations.client.js +34 -36
  232. package/dist/prometheus-framework/src/modules/organizations/store/departments.cjs +1 -1
  233. package/dist/prometheus-framework/src/modules/organizations/store/departments.js +38 -18
  234. package/dist/prometheus-framework/src/modules/organizations/store/invites.cjs +1 -1
  235. package/dist/prometheus-framework/src/modules/organizations/store/invites.js +34 -35
  236. package/dist/prometheus-framework/src/modules/products/components/blocks/CardPosition.vue.cjs +1 -1
  237. package/dist/prometheus-framework/src/modules/products/components/blocks/CardPosition.vue.js +1 -1
  238. package/dist/prometheus-framework/src/modules/products/components/blocks/CardProduct.vue.cjs +1 -1
  239. package/dist/prometheus-framework/src/modules/products/components/blocks/CardProduct.vue.js +41 -21
  240. package/dist/prometheus-framework/src/modules/products/components/blocks/LeftoverPositions.vue.cjs +1 -1
  241. package/dist/prometheus-framework/src/modules/products/components/blocks/LeftoverPositions.vue.js +1 -1
  242. package/dist/prometheus-framework/src/modules/products/components/blocks/ListPositions.vue.cjs +1 -1
  243. package/dist/prometheus-framework/src/modules/products/components/blocks/ListPositions.vue.js +1 -1
  244. package/dist/prometheus-framework/src/modules/products/components/pages/Categories.vue.cjs +1 -1
  245. package/dist/prometheus-framework/src/modules/products/components/pages/Categories.vue.js +1 -1
  246. package/dist/prometheus-framework/src/modules/products/components/pages/CategoryEdit.vue.cjs +1 -1
  247. package/dist/prometheus-framework/src/modules/products/components/pages/CategoryEdit.vue.js +2 -2
  248. package/dist/prometheus-framework/src/modules/products/components/pages/EditLeftover.vue.cjs +1 -1
  249. package/dist/prometheus-framework/src/modules/products/components/pages/EditLeftover.vue.js +1 -1
  250. package/dist/prometheus-framework/src/modules/products/components/pages/Leftovers.vue.cjs +1 -1
  251. package/dist/prometheus-framework/src/modules/products/components/pages/Leftovers.vue.js +1 -1
  252. package/dist/prometheus-framework/src/modules/products/components/pages/ProductEdit.vue.cjs +1 -1
  253. package/dist/prometheus-framework/src/modules/products/components/pages/ProductEdit.vue.js +3 -3
  254. package/dist/prometheus-framework/src/modules/products/components/pages/Products.vue.cjs +1 -1
  255. package/dist/prometheus-framework/src/modules/products/components/pages/Products.vue.js +3 -3
  256. package/dist/prometheus-framework/src/modules/products/components/sections/EditModifications.vue.cjs +1 -1
  257. package/dist/prometheus-framework/src/modules/products/components/sections/EditModifications.vue.js +1 -1
  258. package/dist/prometheus-framework/src/modules/products/components/sections/EditProductInfo.vue.cjs +1 -1
  259. package/dist/prometheus-framework/src/modules/products/components/sections/EditProductInfo.vue.js +2 -2
  260. package/dist/prometheus-framework/src/modules/products/components/sections/SectionProduct.vue.cjs +1 -1
  261. package/dist/prometheus-framework/src/modules/products/components/sections/SectionProduct.vue.js +1 -1
  262. package/dist/prometheus-framework/src/modules/reports/components/sections/FormReport.vue.cjs +1 -1
  263. package/dist/prometheus-framework/src/modules/reports/components/sections/FormReport.vue.js +24 -26
  264. package/dist/prometheus-framework/src/modules/users/components/blocks/CardUser.vue.cjs +1 -0
  265. package/dist/prometheus-framework/src/modules/users/components/blocks/CardUser.vue.js +78 -0
  266. package/dist/prometheus-framework/src/modules/users/components/pages/Profile.vue.cjs +1 -1
  267. package/dist/prometheus-framework/src/modules/users/components/pages/Profile.vue.js +2 -2
  268. package/dist/prometheus-framework/src/modules/users/components/pages/ProfileBlogposts.vue.cjs +1 -1
  269. package/dist/prometheus-framework/src/modules/users/components/pages/ProfileBlogposts.vue.js +1 -1
  270. package/dist/prometheus-framework/src/modules/users/components/pages/ProfileEdit.vue.cjs +1 -1
  271. package/dist/prometheus-framework/src/modules/users/components/pages/ProfileEdit.vue.js +3 -3
  272. package/dist/prometheus-framework/src/modules/users/components/pages/ProfileEvents.vue.cjs +1 -1
  273. package/dist/prometheus-framework/src/modules/users/components/pages/ProfileEvents.vue.js +1 -1
  274. package/dist/prometheus-framework/src/modules/users/store/users.cjs +1 -1
  275. package/dist/prometheus-framework/src/modules/users/store/users.js +13 -14
  276. package/dist/prometheus-framework/src/modules/wallet/views/components/pages/Wallet.vue.cjs +1 -1
  277. package/dist/prometheus-framework/src/modules/wallet/views/components/pages/Wallet.vue.js +2 -2
  278. package/dist/prometheus-framework.cjs.js +1 -1
  279. package/dist/prometheus-framework.es.js +1 -1
  280. package/dist/queryProcessor-BJdKh0Ow.mjs +162 -0
  281. package/dist/queryProcessor-DRMo_GWK.js +161 -0
  282. package/dist/reports.server.js +1 -1
  283. package/dist/reports.server.mjs +1 -1
  284. package/dist/style.css +1 -1
  285. package/dist/users.server.js +58 -47
  286. package/dist/users.server.mjs +58 -47
  287. package/dist/wallet.server.js +2 -2
  288. package/dist/wallet.server.mjs +2 -2
  289. package/dist/web-CtVocufd.js +1 -0
  290. package/dist/web-DNq1tHCE.mjs +54 -0
  291. package/package.json +1 -1
  292. package/src/components/Address/Address.vue +13 -2
  293. package/src/components/Block/Block.vue +3 -2
  294. package/src/components/Button/Button.vue +9 -12
  295. package/src/components/Feed/Feed.vue +28 -6
  296. package/src/components/FieldPhone/FieldPhone.vue +592 -558
  297. package/src/components/LocationMarker/LocationMarker.vue +26 -22
  298. package/src/components/Popup/Popup.vue +22 -23
  299. package/src/components/Select/Select.vue +43 -32
  300. package/src/components/Slider/Slider.vue +3 -4
  301. package/src/modules/auth/components/pages/Invite.vue +7 -7
  302. package/src/modules/auth/store/auth.js +1 -1
  303. package/src/modules/backoffice/components/pages/Dashboard.vue +44 -29
  304. package/src/modules/chats/components/blocks/ChatMessage.vue +1 -1
  305. package/src/modules/community/components/sections/HotPosts.vue +1 -1
  306. package/src/modules/events/components/blocks/CardEvent.vue +4 -3
  307. package/src/modules/events/components/pages/Events.vue +23 -6
  308. package/src/modules/globals/components/sections/SectionPageTitle.vue +19 -7
  309. package/src/modules/globals/controllers/utils/queryProcessor.js +21 -7
  310. package/src/modules/globals/localization/vue-i18n.js +3 -0
  311. package/src/modules/globals/models/credentials.schema.js +7 -0
  312. package/src/modules/globals/models/metadata.schema.js +17 -0
  313. package/src/modules/globals/models/profile.schema.js +23 -0
  314. package/src/modules/globals/models/socials.schema.js +22 -0
  315. package/src/modules/globals/router/routerGuards.js +1 -0
  316. package/src/modules/globals/services/globals.cashe.js +26 -0
  317. package/src/modules/globals/services/globals.crud.js +115 -0
  318. package/src/modules/globals/services/globals.logger.js +41 -0
  319. package/src/modules/globals/services/globals.store.js +114 -0
  320. package/src/modules/icons/entities/IconGallery.vue +14 -0
  321. package/src/modules/icons/entities/IconLeftovers.vue +14 -0
  322. package/src/modules/icons/entities/IconOrders.vue +15 -0
  323. package/src/modules/icons/entities/IconProducts.vue +14 -0
  324. package/src/modules/landing/components/sections/HeroSection.vue +1 -1
  325. package/src/modules/landing/components/sections/MobileApp.vue +4 -4
  326. package/src/modules/landing/router/landing.js +1 -1
  327. package/src/modules/marketplace/components/sections/Filters.vue +3 -3
  328. package/src/modules/middlewares/server/accessors/AccessController.js +33 -0
  329. package/src/modules/middlewares/server/accessors/ReadDepartments.js +101 -0
  330. package/src/modules/middlewares/server/verifyAccesses.js +33 -0
  331. package/src/modules/middlewares/server/verifyInvites.js +4 -4
  332. package/src/modules/orders/components/pages/OrderCreate.vue +2 -2
  333. package/src/modules/orders/components/pages/OrderCreateBackoffice.vue +105 -68
  334. package/src/modules/orders/components/pages/Orders.vue +2 -2
  335. package/src/modules/orders/components/sections/FormAddCustomer.vue +152 -0
  336. package/src/modules/orders/components/sections/FormCustomerDetails.vue +67 -0
  337. package/src/modules/orders/components/sections/FormDelivery.vue +17 -3
  338. package/src/modules/orders/controllers/applications.controller.js +2 -0
  339. package/src/modules/orders/controllers/orders.controller.js +77 -52
  340. package/src/modules/orders/models/application.model.js +25 -25
  341. package/src/modules/orders/models/customer.model.js +54 -18
  342. package/src/modules/orders/models/order.model.js +1 -1
  343. package/src/modules/orders/models/testimonial.model.js +22 -23
  344. package/src/modules/orders/orders.client.js +51 -51
  345. package/src/modules/orders/orders.server.js +36 -12
  346. package/src/modules/orders/router/orders.router.js +36 -41
  347. package/src/modules/orders/routes/orders.routes.js +3 -21
  348. package/src/modules/orders/store/customers.store.js +5 -0
  349. package/src/modules/orders/store/models/customer.js +29 -0
  350. package/src/modules/orders/store/orders.js +14 -20
  351. package/src/modules/organizations/components/blocks/CardDepartment.vue +3 -3
  352. package/src/modules/organizations/components/blocks/CardOrganization.vue +1 -1
  353. package/src/modules/organizations/components/blocks/DepartmentMemberModify.vue +1 -12
  354. package/src/modules/organizations/components/pages/Department.vue +1 -1
  355. package/src/modules/organizations/components/pages/DepartmentEdit.vue +72 -48
  356. package/src/modules/organizations/components/pages/Members.vue +178 -64
  357. package/src/modules/organizations/components/pages/Organization.vue +1 -41
  358. package/src/modules/organizations/components/sections/MembersAdd.vue +44 -52
  359. package/src/modules/organizations/controllers/departments.controller.js +2 -4
  360. package/src/modules/organizations/controllers/invites.controller.js +24 -23
  361. package/src/modules/organizations/controllers/organizations.controller.js +1 -1
  362. package/src/modules/organizations/models/department.model.js +52 -2
  363. package/src/modules/organizations/models/invite.model.js +29 -32
  364. package/src/modules/organizations/models/membership.model.js +2 -0
  365. package/src/modules/organizations/models/organization.model.js +2 -1
  366. package/src/modules/organizations/organizations.client.js +0 -2
  367. package/src/modules/organizations/routes/departments.routes.js +18 -7
  368. package/src/modules/organizations/routes/invites.routes.js +2 -2
  369. package/src/modules/organizations/store/departments.js +22 -1
  370. package/src/modules/organizations/store/invites.js +74 -90
  371. package/src/modules/products/components/blocks/CardProduct.vue +24 -0
  372. package/src/modules/products/components/pages/Products.vue +1 -1
  373. package/src/modules/reports/components/sections/FormReport.vue +40 -40
  374. package/src/modules/spots/components/pages/Spot.vue +1 -1
  375. package/src/modules/spots/components/pages/SpotEdit.vue +1 -1
  376. package/src/modules/users/components/blocks/CardUser.vue +85 -0
  377. package/src/modules/users/controllers/users.controller.js +36 -13
  378. package/src/modules/users/middlewares/visitor.logger.js +66 -0
  379. package/src/modules/users/models/request.model.js +18 -0
  380. package/src/modules/users/models/user.model.js +26 -55
  381. package/src/modules/users/models/visitor.model.js +14 -0
  382. package/src/modules/users/store/users.js +2 -11
  383. package/src/modules/wallet/controllers/routes/payments.routes.js +2 -0
  384. package/src/components/FieldPhone/FieldPhone(script-setup).vue +0 -1646
  385. package/src/components/FieldPhone/FieldPhone2.vue +0 -671
  386. package/src/modules/orders/components/sections/FormClientDetails.vue +0 -61
  387. package/src/modules/organizations/components/blocks/User.vue +0 -69
  388. /package/src/modules/backoffice/components/admin/{User.vue → UserEdit.vue} +0 -0
@@ -7,24 +7,25 @@ import require$$0 from "mongoose";
7
7
  import require$$5 from "@googlemaps/google-maps-services-js";
8
8
  import { a as addUserStatusFields_1, b as addMembersQuantity_1 } from "./addMembersQuantity-BXp_LeQd.mjs";
9
9
  import { m as mailing } from "./mailing-Cdp8NXhP.mjs";
10
- import { s as server } from "./index-CGIn4v5E.mjs";
10
+ import { s as server } from "./index-B6a1mPgp.mjs";
11
11
  import require$$0$2 from "mongodb";
12
+ import { o as ownership_schema } from "./ownership.schema-oyx6eNkZ.mjs";
13
+ import { c as credentials_schema } from "./credentials.schema-C9dmNy7o.mjs";
12
14
  const controllerFactory$6 = (db) => {
13
15
  const Department = db.department;
14
- const readOne = (req, res) => {
16
+ const readOne = (req, res2) => {
15
17
  Department.findOne({ _id: req.params._id }).populate("members.user").populate("subdepartments").then((department) => {
16
18
  if (!department) {
17
- return res.status(404).send({ message: "Отдел не найден" });
19
+ return res2.status(404).send({ message: "Отдел не найден" });
18
20
  }
19
- res.send(department);
21
+ res2.send(department);
20
22
  }).catch((err) => {
21
- res.status(500).send({ message: err.message });
23
+ res2.status(500).send({ message: err.message });
22
24
  });
23
25
  };
24
- const read = (req, res) => {
26
+ const read = (req, res2) => {
25
27
  let query = {};
26
28
  let options = {};
27
- console.log(req.query);
28
29
  if (req.query.organization) {
29
30
  query.organization = new db.mongoose.Types.ObjectId(req.query.organization);
30
31
  }
@@ -33,43 +34,43 @@ const controllerFactory$6 = (db) => {
33
34
  }
34
35
  Department.find(query, null, options).populate("members.user").populate("subdepartments").then((departments) => {
35
36
  if (!departments) {
36
- return res.status(404).send({ message: "Departments not found" });
37
+ return res2.status(404).send({ message: "Departments not found" });
37
38
  }
38
- res.send(departments);
39
+ res2.send(departments);
39
40
  }).catch((err) => {
40
- res.status(500).send({ message: err.message });
41
+ res2.status(500).send({ message: err.message });
41
42
  });
42
43
  };
43
- const create = async (req, res) => {
44
+ const create = async (req, res2) => {
44
45
  try {
45
46
  const newDepartment = new Department({
46
47
  ...req.body,
47
48
  organization: req.params._id
48
49
  });
49
50
  const data = await newDepartment.save();
50
- res.send(data);
51
+ res2.send(data);
51
52
  } catch (err) {
52
- res.status(500).send({ message: err.message });
53
+ res2.status(500).send({ message: err.message });
53
54
  }
54
55
  };
55
- const update = (req, res) => {
56
+ const update = (req, res2) => {
56
57
  Department.findOneAndUpdate({ _id: req.body._id }, req.body, { new: true }).then((department) => {
57
58
  if (!department) {
58
- return res.status(404).send({ message: "Department not found" });
59
+ return res2.status(404).send({ message: "Department not found" });
59
60
  }
60
- res.send(department);
61
+ res2.send(department);
61
62
  }).catch((err) => {
62
- res.status(500).send({ message: err.message });
63
+ res2.status(500).send({ message: err.message });
63
64
  });
64
65
  };
65
- const deleteDepartment = (req, res) => {
66
+ const deleteDepartment = (req, res2) => {
66
67
  Department.findOneAndRemove({ _id: req.body._id, organization: req.params._id }).then((department) => {
67
68
  if (!department) {
68
- return res.status(404).send({ message: "Department not found" });
69
+ return res2.status(404).send({ message: "Department not found" });
69
70
  }
70
- res.send({ message: "Department deleted successfully" });
71
+ res2.send({ message: "Department deleted successfully" });
71
72
  }).catch((err) => {
72
- res.status(500).send({ message: err.message });
73
+ res2.status(500).send({ message: err.message });
73
74
  });
74
75
  };
75
76
  return {
@@ -92,7 +93,7 @@ const controllerFactory$5 = (db) => {
92
93
  const Membership = db.membership;
93
94
  db.user;
94
95
  db.role;
95
- const read = async (req, res) => {
96
+ const read = async (req, res2) => {
96
97
  const Organization2 = db.organization;
97
98
  db.membership;
98
99
  db.user;
@@ -160,11 +161,11 @@ const controllerFactory$5 = (db) => {
160
161
  ];
161
162
  console.log(userLocation);
162
163
  } else {
163
- return res.status(400).send({ message: "Unable to geocode the provided location." });
164
+ return res2.status(400).send({ message: "Unable to geocode the provided location." });
164
165
  }
165
166
  } catch (err) {
166
167
  console.log(err);
167
- return res.status(500).send({ message: "Error occurred while geocoding." });
168
+ return res2.status(500).send({ message: "Error occurred while geocoding." });
168
169
  }
169
170
  const radius = city ? 500 : state ? 1e3 : 5e3;
170
171
  matchConditions.push({
@@ -350,13 +351,13 @@ const controllerFactory$5 = (db) => {
350
351
  console.log(stages);
351
352
  const organizations = await Organization2.aggregate(stages);
352
353
  console.log(organizations);
353
- res.status(200).send(organizations);
354
+ res2.status(200).send(organizations);
354
355
  } catch (err) {
355
356
  console.log(err);
356
- return res.status(500).send({ message: err });
357
+ return res2.status(500).send({ message: err });
357
358
  }
358
359
  };
359
- const fetch = async (req, res) => {
360
+ const fetch = async (req, res2) => {
360
361
  const Organization2 = db.organization;
361
362
  let query = {};
362
363
  console.log(req.query);
@@ -375,14 +376,14 @@ const controllerFactory$5 = (db) => {
375
376
  try {
376
377
  const organizations = await Organization2.find(query, null, options);
377
378
  if (!organizations || organizations.length === 0) {
378
- return res.status(404).send({ message: "Organizations not found." });
379
+ return res2.status(404).send({ message: "Organizations not found." });
379
380
  }
380
- res.status(200).send(organizations);
381
+ res2.status(200).send(organizations);
381
382
  } catch (err) {
382
- return res.status(500).send({ message: err });
383
+ return res2.status(500).send({ message: err });
383
384
  }
384
385
  };
385
- const create = async (req, res) => {
386
+ const create = async (req, res2) => {
386
387
  if (req.body._id === null) {
387
388
  delete req.body._id;
388
389
  }
@@ -396,13 +397,13 @@ const controllerFactory$5 = (db) => {
396
397
  role: "owner"
397
398
  });
398
399
  const savedMembership = await membership.save();
399
- res.status(201).json(savedOrganization);
400
+ res2.status(201).json(savedOrganization);
400
401
  } catch (error) {
401
402
  console.error("Error:", error);
402
- res.status(500).send(error);
403
+ res2.status(500).send(error);
403
404
  }
404
405
  };
405
- const update = async (req, res) => {
406
+ const update = async (req, res2) => {
406
407
  try {
407
408
  const organizationId = req.params._id;
408
409
  const updatedData = req.body;
@@ -411,17 +412,17 @@ const controllerFactory$5 = (db) => {
411
412
  runValidators: true
412
413
  });
413
414
  if (!organization) {
414
- return res.status(404).json({ message: "Organization not found" });
415
+ return res2.status(404).json({ message: "Organization not found" });
415
416
  }
416
- res.status(200).json({ message: "Organization updated successfully", organization });
417
+ res2.status(200).json({ message: "Organization updated successfully", organization });
417
418
  } catch (error) {
418
- res.status(500).json({ error: error.message });
419
+ res2.status(500).json({ error: error.message });
419
420
  }
420
421
  };
421
- const deleteOrganization = async (req, res) => {
422
+ const deleteOrganization = async (req, res2) => {
422
423
  Organization.findOneAndRemove({ _id: req.params._id }).then((organization) => {
423
424
  if (!organization) {
424
- return res.status(404).send({ message: "Organization not found" });
425
+ return res2.status(404).send({ message: "Organization not found" });
425
426
  }
426
427
  Membership.deleteMany({ organization: req.params._id }).then(() => {
427
428
  const newToken = jwt.sign({
@@ -431,12 +432,12 @@ const controllerFactory$5 = (db) => {
431
432
  expiresIn: 86400
432
433
  // 24 hours
433
434
  });
434
- res.send({ newToken });
435
+ res2.send({ newToken });
435
436
  }).catch((err) => {
436
- res.status(500).send({ message: "Error deleting memberships: " + err.message });
437
+ res2.status(500).send({ message: "Error deleting memberships: " + err.message });
437
438
  });
438
439
  }).catch((err) => {
439
- res.status(500).send({ message: err.message });
440
+ res2.status(500).send({ message: err.message });
440
441
  });
441
442
  };
442
443
  return {
@@ -452,7 +453,7 @@ var organizations_controller = controllerFactory$5;
452
453
  const ObjectId$1 = require$$0.Types.ObjectId;
453
454
  const controllerFactory$4 = (db) => {
454
455
  const Membership = db.membership;
455
- const read = async (req, res) => {
456
+ const read = async (req, res2) => {
456
457
  try {
457
458
  const memberships = await Membership.aggregate([
458
459
  {
@@ -476,15 +477,15 @@ const controllerFactory$4 = (db) => {
476
477
  }
477
478
  ]);
478
479
  if (!memberships || memberships.length === 0) {
479
- return res.status(404).send({ errorCode: "MEMBERSHIPS_NOT_FOUND" });
480
+ return res2.status(404).send({ errorCode: "MEMBERSHIPS_NOT_FOUND" });
480
481
  }
481
- res.send(memberships);
482
+ res2.send(memberships);
482
483
  } catch (err) {
483
484
  console.log(err);
484
- res.status(500).send({ errorCode: "SERVER_ERROR" });
485
+ res2.status(500).send({ errorCode: "SERVER_ERROR" });
485
486
  }
486
487
  };
487
- const create = async (req, res) => {
488
+ const create = async (req, res2) => {
488
489
  console.log(req.body);
489
490
  const newMembership = new Membership({
490
491
  user: req.body.user,
@@ -494,35 +495,35 @@ const controllerFactory$4 = (db) => {
494
495
  });
495
496
  try {
496
497
  const data = await newMembership.save();
497
- res.send(data);
498
+ res2.send(data);
498
499
  } catch (err) {
499
- res.status(500).send({ errorCode: "SERVER_ERROR" });
500
+ res2.status(500).send({ errorCode: "SERVER_ERROR" });
500
501
  }
501
502
  };
502
- const update = async (req, res) => {
503
+ const update = async (req, res2) => {
503
504
  try {
504
505
  const membership = await Membership.findByIdAndUpdate(req.body._id, req.body, { new: true });
505
506
  if (!membership) {
506
- return res.status(404).send({ errorCode: "MEMBERSHIP_NOT_FOUND" });
507
+ return res2.status(404).send({ errorCode: "MEMBERSHIP_NOT_FOUND" });
507
508
  }
508
- res.send(membership);
509
+ res2.send(membership);
509
510
  } catch (err) {
510
- res.status(500).send({ errorCode: "SERVER_ERROR" });
511
+ res2.status(500).send({ errorCode: "SERVER_ERROR" });
511
512
  }
512
513
  };
513
- const deleteMembership = async (req, res) => {
514
+ const deleteMembership = async (req, res2) => {
514
515
  console.log(req.body);
515
516
  try {
516
517
  const membership = await Membership.findOneAndDelete({ _id: new ObjectId$1(req.body._id) });
517
518
  if (!membership) {
518
- return res.status(404).send({ errorCode: "MEMBERSHIP_NOT_FOUND" });
519
+ return res2.status(404).send({ errorCode: "MEMBERSHIP_NOT_FOUND" });
519
520
  } else {
520
521
  await Membership.deleteOne({ _id: membership._id });
521
- res.status(200).send(membership);
522
+ res2.status(200).send(membership);
522
523
  }
523
524
  } catch (error) {
524
525
  console.log(error);
525
- res.status(500).send({ errorCode: "SERVER_ERROR" });
526
+ res2.status(500).send({ errorCode: "SERVER_ERROR" });
526
527
  }
527
528
  };
528
529
  return {
@@ -539,34 +540,34 @@ const сontrollerFactory = (db) => {
539
540
  const User = db.user;
540
541
  const Invite = db.invite;
541
542
  const Membership = db.membership;
542
- const getOneByCode = async (req, res) => {
543
+ const getOneByCode = async (req, res2) => {
543
544
  try {
544
545
  const invite = await Invite.findOne({ code: req.params._id });
545
546
  if (!invite) {
546
- return res.status(404).send({ message: "Приглашение не найдено" });
547
+ return res2.status(404).send({ message: "Приглашение не найдено" });
547
548
  }
548
- res.send(invite);
549
+ res2.send(invite);
549
550
  } catch (err) {
550
- res.status(500).send({ message: err.message });
551
+ res2.status(500).send({ message: err.message });
551
552
  }
552
553
  };
553
- const read = async (req, res) => {
554
+ const read = async (req, res2) => {
554
555
  try {
555
- const invites = await Invite.find({ organization: req.params._id });
556
- if (!invites) {
557
- return res.status(404).send({ message: "Invites not found" });
556
+ const invites = await Invite.find({ "owner.target": req.params._id });
557
+ if (!invites || invites.length === 0) {
558
+ return res2.status(200).send([]);
558
559
  }
559
- res.send(invites);
560
+ res2.send(invites);
560
561
  } catch (err) {
561
- res.status(500).send({ message: err.message });
562
+ res2.status(500).send({ message: err.message });
562
563
  }
563
564
  };
564
- const create = async (req, res) => {
565
- const userInviter = JSON.parse(req.cookies.user);
566
- const organizationId = req.params._id;
565
+ const create = async (req, res2) => {
566
+ const creator = req.body.creator;
567
+ const owner = req.body.owner;
568
+ const list = req.body.invites;
567
569
  try {
568
- const invites = req.body;
569
- for (let invite of invites) {
570
+ for (let invite of list) {
570
571
  let user2 = null;
571
572
  if (invite.contact.includes("@")) {
572
573
  user2 = await User.findOne({ email: invite.contact });
@@ -574,53 +575,52 @@ const сontrollerFactory = (db) => {
574
575
  user2 = await User.findOne({ phone: invite.contact });
575
576
  }
576
577
  if (user2) {
577
- console.log(invite);
578
578
  const membership = new Membership({
579
579
  user: user2._id,
580
580
  type: "organization",
581
- target: organizationId,
582
- role: invite.role
581
+ target: req.body.owner.target,
582
+ role: "member",
583
+ label: "member"
583
584
  });
584
585
  await membership.save();
585
- res.status(200).json({ message: "Invites sent successfully!" });
586
586
  } else {
587
587
  const newInvite = new Invite({
588
588
  code: uuid(),
589
- organization: organizationId,
590
- role: invite.role,
591
- createdBy: userInviter._id,
592
- invitedEmail: invite.contact.includes("@") ? invite.contact : null,
593
- invitedPhone: !invite.contact.includes("@") ? invite.contact : null
589
+ creator,
590
+ owner,
591
+ role: "member",
592
+ email: invite.contact.includes("@") ? invite.contact : null,
593
+ phone: !invite.contact.includes("@") ? invite.contact : null
594
594
  });
595
595
  const savedInvite = await newInvite.save();
596
- if (savedInvite.invitedEmail) {
597
- const to = savedInvite.invitedEmail;
596
+ if (savedInvite.email !== null) {
597
+ const to = savedInvite.email;
598
598
  const subject = "You have been added to the organization";
599
599
  const text = `You have been invited to join an organization on ${process.env.APP_NAME}! Use this link to register: ${process.env.API_URL}/auth/invite?inviteCode=${newInvite.code}&type=email"`;
600
600
  await sendEmail(to, subject, text);
601
601
  }
602
- if (savedInvite.invitedPhone !== null) {
603
- const phone = savedInvite.invitedPhone;
602
+ if (savedInvite.phone !== null) {
603
+ const phone = savedInvite.phone;
604
604
  const message = `You have been invited to join an organization on ${process.env.APP_NAME}! Use this link to register: ${process.env.API_URL}/auth/invite?inviteCode=${newInvite.code}&type=phone`;
605
605
  await sendSms(phone, message);
606
606
  }
607
- res.status(200).json({ message: "Invites sent successfully!" });
608
607
  }
609
608
  }
609
+ res2.status(200).json({ message: "Invites sent successfully!" });
610
610
  } catch (error) {
611
611
  console.error(error);
612
- res.status(500).json({ message: "Something went wrong" });
612
+ res2.status(500).json({ message: "Something went wrong" });
613
613
  }
614
614
  };
615
- const deleteInvite = async (req, res) => {
615
+ const deleteInvite = async (req, res2) => {
616
616
  try {
617
617
  const invite = await Invite.findOneAndDelete({ _id: req.params._id });
618
618
  if (!invite) {
619
- return res.status(404).send({ message: "Invite not found" });
619
+ return res2.status(404).send({ message: "Invite not found" });
620
620
  }
621
- res.send({ message: "Invite deleted successfully" });
621
+ res2.send({ message: "Invite deleted successfully" });
622
622
  } catch (err) {
623
- res.status(500).send({ message: err.message });
623
+ res2.status(500).send({ message: err.message });
624
624
  }
625
625
  };
626
626
  return {
@@ -631,18 +631,135 @@ const сontrollerFactory = (db) => {
631
631
  };
632
632
  };
633
633
  var invites_controller = сontrollerFactory;
634
+ let AccessController$1 = class AccessController {
635
+ db = null;
636
+ rule = null;
637
+ next = null;
638
+ entity = null;
639
+ /**
640
+ * @param {String} rule - Права на проверку (read, create, ...)
641
+ * @param {String} entity - Сущность на проверку (departments, post, ...)
642
+ */
643
+ check(rule, entity) {
644
+ if (this.rule === rule && this.entity === entity) {
645
+ return this.access.bind(this);
646
+ } else if (this.next) {
647
+ this.next.check(rule, entity);
648
+ } else {
649
+ console.error("Неудачная попытка вызова посредника verifyAccesses");
650
+ console.error("Переданные аргументы:", this.rule, this.entity);
651
+ return async (req, res2, next) => {
652
+ return res2.status(403).send({ message: "Access Denied. Middleware not founded" });
653
+ };
654
+ }
655
+ }
656
+ };
657
+ var AccessController_1 = AccessController$1;
658
+ const AccessController2 = AccessController_1;
659
+ let ReadDepartments$1 = class ReadDepartments extends AccessController2 {
660
+ rule = "read";
661
+ entity = "departments";
662
+ async access(req, res2, next) {
663
+ const Department = this.db.department;
664
+ try {
665
+ const userId = req.cookies.user._id;
666
+ const organization = req.query.organization;
667
+ const departments = await Department.find({
668
+ organization: { $eq: organization },
669
+ members: { $elemMatch: { user: userId } }
670
+ });
671
+ if (!departments.length) {
672
+ return res2.status(403).send({
673
+ message: "Access Denied. Read Departments. Департаменты не найдены"
674
+ });
675
+ }
676
+ let hasAccess = false;
677
+ departments.forEach((departament) => {
678
+ const accesses = departament.accesses;
679
+ if (getNestedProperty(accesses, rulePath)) {
680
+ hasAccess = true;
681
+ }
682
+ });
683
+ if (hasAccess) {
684
+ next();
685
+ } else {
686
+ return res2.status(403).send({ message: "Access Denied. Read Departments. No access" });
687
+ }
688
+ } catch (error) {
689
+ console.error("[canReadDepartments]", error);
690
+ return res2.status(500).send({ message: error.message });
691
+ }
692
+ }
693
+ /**
694
+ * // note: пока не использовался метод
695
+ * @param {Object} req объект
696
+ * @returns
697
+ */
698
+ async departmentsWhereUserIsMember(req) {
699
+ const Department = this.db.department;
700
+ try {
701
+ const userId = req.cookies.user._id;
702
+ const organization = req.query.organization;
703
+ const departments = await Department.find({
704
+ organization: { $eq: organization },
705
+ members: { $elemMatch: { user: userId } }
706
+ });
707
+ return departments;
708
+ } catch (error) {
709
+ console.error("[canReadDepartments]", error);
710
+ return res.status(500).send({ message: error.message });
711
+ }
712
+ }
713
+ };
714
+ var ReadDepartments_1 = ReadDepartments$1;
715
+ function getNestedProperty(obj, propertyPath) {
716
+ const properties = propertyPath.split(".");
717
+ let value = obj;
718
+ for (const property of properties) {
719
+ if (!value.hasOwnProperty(property)) {
720
+ return void 0;
721
+ }
722
+ value = value[property];
723
+ }
724
+ return value;
725
+ }
726
+ const ReadDepartments2 = ReadDepartments_1;
727
+ var verifyAccesses = (db) => {
728
+ const instances = [];
729
+ const middlewares = [
730
+ ReadDepartments2
731
+ ];
732
+ let nextMiddleware = null;
733
+ for (let i = middlewares.length - 1; i >= 0; i--) {
734
+ const Middleware = middlewares[i];
735
+ const middleware = new Middleware();
736
+ middleware.db = db;
737
+ middleware.next = nextMiddleware;
738
+ instances.unshift(middleware);
739
+ nextMiddleware = middleware;
740
+ }
741
+ return (rule, entity) => instances[0].check(rule, entity);
742
+ };
634
743
  const controllerFactory$3 = departments_controller;
744
+ const accessMiddlewaresFactory = verifyAccesses;
635
745
  var departments_routes = function(app, db) {
636
746
  const controller = controllerFactory$3(db);
637
- app.use(function(req, res, next) {
638
- res.header(
747
+ accessMiddlewaresFactory(db);
748
+ app.use(function(req, res2, next) {
749
+ res2.header(
639
750
  "Access-Control-Allow-Headers",
640
751
  "Access-Control-Allow-Origin",
641
752
  "x-access-token, Origin, Content-Type, Accept"
642
753
  );
643
754
  next();
644
755
  });
645
- app.get("/api/departments/read", controller.read);
756
+ app.get(
757
+ "/api/departments/read",
758
+ // [
759
+ // verifyAccesses('read', 'departments'),
760
+ // ],
761
+ controller.read
762
+ );
646
763
  app.get("/api/departments/get/:_id", controller.readOne);
647
764
  app.post("/api/departments/:_id/create", controller.create);
648
765
  app.post("/api/departments/:_id/update", controller.update);
@@ -651,8 +768,8 @@ var departments_routes = function(app, db) {
651
768
  const controllerFactory$2 = organizations_controller;
652
769
  var organizations_routes = function(app, db) {
653
770
  const controller = controllerFactory$2(db);
654
- app.use(function(req, res, next) {
655
- res.header(
771
+ app.use(function(req, res2, next) {
772
+ res2.header(
656
773
  "Access-Control-Allow-Headers",
657
774
  "Access-Control-Allow-Origin",
658
775
  "x-access-token, Origin, Content-Type, Accept"
@@ -679,8 +796,8 @@ var organizations_routes = function(app, db) {
679
796
  const controllerFactory$1 = memberships_controller;
680
797
  var memberships_routes = function(app, db) {
681
798
  const controller = controllerFactory$1(db);
682
- app.use(function(req, res, next) {
683
- res.header(
799
+ app.use(function(req, res2, next) {
800
+ res2.header(
684
801
  "Access-Control-Allow-Headers",
685
802
  "Access-Control-Allow-Origin",
686
803
  "x-access-token, Origin, Content-Type, Accept"
@@ -709,8 +826,8 @@ const middlewareFactory = server;
709
826
  var invites_routes = function(app, db) {
710
827
  const controller = controllerFactory(db);
711
828
  const { verifyInvites } = middlewareFactory(db);
712
- app.use(function(req, res, next) {
713
- res.header(
829
+ app.use(function(req, res2, next) {
830
+ res2.header(
714
831
  "Access-Control-Allow-Headers",
715
832
  "Access-Control-Allow-Origin",
716
833
  "x-access-token, Origin, Content-Type, Accept"
@@ -726,7 +843,7 @@ var invites_routes = function(app, db) {
726
843
  controller.read
727
844
  );
728
845
  app.post(
729
- "/api/invites/:_id/create",
846
+ "/api/invites/create",
730
847
  [
731
848
  verifyInvites.checkInviteExist,
732
849
  verifyInvites.checkUsersExist
@@ -734,7 +851,7 @@ var invites_routes = function(app, db) {
734
851
  controller.create
735
852
  );
736
853
  app.delete(
737
- "/api/invites/:_id/delete",
854
+ "/api/invites/delete/:_id",
738
855
  controller.delete
739
856
  );
740
857
  };
@@ -765,6 +882,50 @@ var department_model = (mongoose) => {
765
882
  type: Boolean,
766
883
  default: false
767
884
  },
885
+ accesses: {
886
+ products: {
887
+ read: {
888
+ type: Boolean,
889
+ default: false
890
+ },
891
+ edit: {
892
+ type: Boolean,
893
+ default: false
894
+ },
895
+ delete: {
896
+ type: Boolean,
897
+ default: false
898
+ }
899
+ },
900
+ orders: {
901
+ read: {
902
+ type: Boolean,
903
+ default: false
904
+ },
905
+ confirm: {
906
+ type: Boolean,
907
+ default: false
908
+ },
909
+ delete: {
910
+ type: Boolean,
911
+ default: false
912
+ }
913
+ },
914
+ departments: {
915
+ read: {
916
+ type: Boolean,
917
+ default: false
918
+ },
919
+ edit: {
920
+ type: Boolean,
921
+ default: false
922
+ },
923
+ delete: {
924
+ type: Boolean,
925
+ default: false
926
+ }
927
+ }
928
+ },
768
929
  // Marketplace options
769
930
  delivery: [String],
770
931
  payment: [String],
@@ -786,6 +947,8 @@ var department_model = (mongoose) => {
786
947
  ref: "Department"
787
948
  }
788
949
  ]
950
+ }, {
951
+ timestamps: true
789
952
  });
790
953
  departmentSchema.index({ organization: 1 });
791
954
  const Department = mongoose.model("Department", departmentSchema);
@@ -854,6 +1017,8 @@ var organization_model = (mongoose) => {
854
1017
  },
855
1018
  amount: Number
856
1019
  }
1020
+ }, {
1021
+ timestamps: true
857
1022
  });
858
1023
  const Organization = mongoose.model("Organization", OrganizationSchema);
859
1024
  return Organization;
@@ -890,51 +1055,50 @@ var membership_model = (mongoose) => {
890
1055
  },
891
1056
  required: true
892
1057
  }
1058
+ }, {
1059
+ timestamps: true
893
1060
  });
894
1061
  const Membership = mongoose.model("Membership", MembershipSchema);
895
1062
  return Membership;
896
1063
  };
897
- var invite_model = (mongoose) => {
898
- const InviteSchema = new mongoose.Schema({
1064
+ const applyOwnershipSchema = ownership_schema;
1065
+ const applyCredentialsSchema = credentials_schema;
1066
+ var invite_model = (db) => {
1067
+ const InviteSchema = new db.mongoose.Schema({
899
1068
  code: {
900
1069
  type: String,
901
1070
  required: true,
902
1071
  unique: true
903
1072
  },
904
- organization: {
905
- type: mongoose.Schema.Types.ObjectId,
906
- ref: "Organization",
907
- required: true
908
- },
909
1073
  status: {
910
1074
  type: String,
911
- enum: ["active", "used"],
1075
+ enum: ["active", "used", "deactivated"],
912
1076
  default: "active"
913
- },
914
- role: {
915
- name: {
916
- type: String,
917
- default: "Сотрудник"
918
- },
919
- value: {
920
- type: String,
921
- default: "member"
922
- }
923
- },
924
- createdBy: {
925
- type: mongoose.Schema.Types.ObjectId,
926
- ref: "User"
927
- },
928
- invitedEmail: {
929
- type: String
930
- },
931
- invitedPhone: {
932
- type: String
933
1077
  }
934
1078
  }, {
935
1079
  timestamps: true
936
1080
  });
937
- const Invite = mongoose.model("Invite", InviteSchema);
1081
+ applyOwnershipSchema(InviteSchema, db);
1082
+ applyCredentialsSchema(InviteSchema);
1083
+ InviteSchema.index({
1084
+ owner: 1,
1085
+ email: 1
1086
+ }, {
1087
+ unique: true,
1088
+ partialFilterExpression: {
1089
+ email: { $exists: true, $ne: "" }
1090
+ }
1091
+ });
1092
+ InviteSchema.index({
1093
+ owner: 1,
1094
+ phone: 1
1095
+ }, {
1096
+ unique: true,
1097
+ partialFilterExpression: {
1098
+ phone: { $exists: true, $ne: "" }
1099
+ }
1100
+ });
1101
+ const Invite = db.mongoose.model("Invite", InviteSchema);
938
1102
  return Invite;
939
1103
  };
940
1104
  const DepartmentsController = departments_controller;