@ozdao/martyrs 0.2.472 → 0.2.474

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (329) hide show
  1. package/dist/{Media-DW8RLbfM.js → Media-_vz04tII.js} +1 -1
  2. package/dist/{Media-y_TX6us_.mjs → Media-sGk7Bp9b.mjs} +1 -1
  3. package/dist/_virtual/index.cjs +1 -1
  4. package/dist/_virtual/index.js +1 -1
  5. package/dist/auth.server.js +6 -2
  6. package/dist/auth.server.mjs +6 -2
  7. package/dist/authJwt-CELQKF2s.js +82 -0
  8. package/dist/authJwt-DnXu3BFq.mjs +83 -0
  9. package/dist/builder.js +7 -4
  10. package/dist/builder.mjs +7 -4
  11. package/dist/chats.server.js +1 -1
  12. package/dist/chats.server.mjs +1 -1
  13. package/dist/community.server.js +4 -4
  14. package/dist/community.server.mjs +4 -4
  15. package/dist/events.server.js +4 -4
  16. package/dist/events.server.mjs +4 -4
  17. package/dist/files.server.js +1 -1
  18. package/dist/files.server.mjs +1 -1
  19. package/dist/gallery.server.js +3 -3
  20. package/dist/gallery.server.mjs +3 -3
  21. package/dist/{globals.abac-DT0VjfaZ.js → globals.abac-Bn-4tbX8.js} +110 -16
  22. package/dist/{globals.abac-CvmZM8XG.mjs → globals.abac-DZpTRxKR.mjs} +110 -16
  23. package/dist/globals.server.js +70 -10
  24. package/dist/globals.server.mjs +70 -10
  25. package/dist/{globals.verifier-C_VZYebB.mjs → globals.verifier-BdJxc8-8.mjs} +34 -0
  26. package/dist/{globals.verifier-ChDpCdy_.js → globals.verifier-CKYpYfQl.js} +34 -0
  27. package/dist/{index-CVXl1rB5.js → index-BOmxJQ5W.js} +7 -86
  28. package/dist/{index-Df8vtZx7.mjs → index-C_Fw0Umg.mjs} +7 -86
  29. package/dist/{main-CgmHzhq5.mjs → main-CqMtW7Hq.mjs} +274 -276
  30. package/dist/{main-CCfQH-Dd.js → main-CsGkbSyK.js} +2 -2
  31. package/dist/martyrs/src/components/Button/{Button.vue.cjs → Button.vue2.cjs} +2 -2
  32. package/dist/martyrs/src/components/Button/Button.vue2.cjs.map +1 -0
  33. package/dist/martyrs/src/components/Button/{Button.vue.js → Button.vue2.js} +2 -2
  34. package/dist/martyrs/src/components/Button/{Button.vue.cjs.map → Button.vue2.js.map} +1 -1
  35. package/dist/martyrs/src/components/Dropdown/{Dropdown.vue2.cjs → Dropdown.vue.cjs} +2 -2
  36. package/dist/martyrs/src/components/Dropdown/{Dropdown.vue2.js.map → Dropdown.vue.cjs.map} +1 -1
  37. package/dist/martyrs/src/components/Dropdown/{Dropdown.vue2.js → Dropdown.vue.js} +2 -2
  38. package/dist/martyrs/src/components/Dropdown/Dropdown.vue.js.map +1 -0
  39. package/dist/martyrs/src/components/Feed/Feed.vue.cjs +1 -1
  40. package/dist/martyrs/src/components/Feed/Feed.vue.js +1 -1
  41. package/dist/martyrs/src/components/Menu/{Menu.vue2.cjs → Menu.vue.cjs} +2 -2
  42. package/dist/martyrs/src/components/Menu/Menu.vue.cjs.map +1 -0
  43. package/dist/martyrs/src/components/Menu/{Menu.vue2.js → Menu.vue.js} +2 -2
  44. package/dist/martyrs/src/components/Menu/Menu.vue.js.map +1 -0
  45. package/dist/martyrs/src/components/Select/Select.vue.cjs +4 -4
  46. package/dist/martyrs/src/components/Select/Select.vue.cjs.map +1 -1
  47. package/dist/martyrs/src/components/Select/Select.vue.js +4 -4
  48. package/dist/martyrs/src/components/Select/Select.vue.js.map +1 -1
  49. package/dist/martyrs/src/components/Tab/{Tab.vue.cjs → Tab.vue2.cjs} +2 -2
  50. package/dist/martyrs/src/components/Tab/Tab.vue2.cjs.map +1 -0
  51. package/dist/martyrs/src/components/Tab/{Tab.vue.js → Tab.vue2.js} +2 -2
  52. package/dist/martyrs/src/components/Tab/{Tab.vue.cjs.map → Tab.vue2.js.map} +1 -1
  53. package/dist/martyrs/src/modules/auth/views/components/layouts/Auth.vue.cjs +2 -2
  54. package/dist/martyrs/src/modules/auth/views/components/layouts/Auth.vue.js +2 -2
  55. package/dist/martyrs/src/modules/auth/views/components/pages/EnterPassword.vue.cjs +2 -2
  56. package/dist/martyrs/src/modules/auth/views/components/pages/EnterPassword.vue.js +2 -2
  57. package/dist/martyrs/src/modules/auth/views/components/pages/Invite.vue.cjs +2 -2
  58. package/dist/martyrs/src/modules/auth/views/components/pages/Invite.vue.js +2 -2
  59. package/dist/martyrs/src/modules/auth/views/components/pages/Profile.vue.cjs +3 -3
  60. package/dist/martyrs/src/modules/auth/views/components/pages/Profile.vue.js +3 -3
  61. package/dist/martyrs/src/modules/auth/views/components/pages/ProfileBlogposts.vue.cjs +1 -1
  62. package/dist/martyrs/src/modules/auth/views/components/pages/ProfileBlogposts.vue.js +1 -1
  63. package/dist/martyrs/src/modules/auth/views/components/pages/ProfileEdit.vue.cjs +2 -2
  64. package/dist/martyrs/src/modules/auth/views/components/pages/ProfileEdit.vue.js +2 -2
  65. package/dist/martyrs/src/modules/auth/views/components/pages/ResetPassword.vue.cjs +2 -2
  66. package/dist/martyrs/src/modules/auth/views/components/pages/ResetPassword.vue.js +2 -2
  67. package/dist/martyrs/src/modules/auth/views/components/pages/SignIn.vue.cjs +2 -2
  68. package/dist/martyrs/src/modules/auth/views/components/pages/SignIn.vue.js +2 -2
  69. package/dist/martyrs/src/modules/auth/views/components/pages/SignUp.vue.cjs +2 -2
  70. package/dist/martyrs/src/modules/auth/views/components/pages/SignUp.vue.js +2 -2
  71. package/dist/martyrs/src/modules/auth/views/components/sections/ProfileEditCredentials.vue.cjs +1 -1
  72. package/dist/martyrs/src/modules/auth/views/components/sections/ProfileEditCredentials.vue.js +1 -1
  73. package/dist/martyrs/src/modules/community/community.client.js +27 -27
  74. package/dist/martyrs/src/modules/community/community.client.js.map +1 -1
  75. package/dist/martyrs/src/modules/community/components/pages/BlogPost.vue.cjs +1 -1
  76. package/dist/martyrs/src/modules/community/components/pages/BlogPost.vue.js +1 -1
  77. package/dist/martyrs/src/modules/community/components/pages/CreateBlogPost.vue.cjs +1 -1
  78. package/dist/martyrs/src/modules/community/components/pages/CreateBlogPost.vue.js +1 -1
  79. package/dist/martyrs/src/modules/community/components/sections/HotPosts.vue.cjs +3 -4
  80. package/dist/martyrs/src/modules/community/components/sections/HotPosts.vue.cjs.map +1 -1
  81. package/dist/martyrs/src/modules/community/components/sections/HotPosts.vue.js +3 -4
  82. package/dist/martyrs/src/modules/community/components/sections/HotPosts.vue.js.map +1 -1
  83. package/dist/martyrs/src/modules/constructor/components/sections/Constructor.vue.cjs +1 -1
  84. package/dist/martyrs/src/modules/constructor/components/sections/Constructor.vue.js +1 -1
  85. package/dist/martyrs/src/modules/events/components/elements/ButtonCheck.vue.cjs +1 -1
  86. package/dist/martyrs/src/modules/events/components/elements/ButtonCheck.vue.js +1 -1
  87. package/dist/martyrs/src/modules/events/components/elements/ButtonJoin.vue.cjs +1 -1
  88. package/dist/martyrs/src/modules/events/components/elements/ButtonJoin.vue.js +1 -1
  89. package/dist/martyrs/src/modules/events/components/pages/EditEvent.vue.cjs +1 -1
  90. package/dist/martyrs/src/modules/events/components/pages/EditEvent.vue.js +1 -1
  91. package/dist/martyrs/src/modules/events/components/pages/EditEventTickets.vue.cjs +1 -1
  92. package/dist/martyrs/src/modules/events/components/pages/EditEventTickets.vue.js +1 -1
  93. package/dist/martyrs/src/modules/events/components/pages/EventsBackoffice.vue.cjs +1 -1
  94. package/dist/martyrs/src/modules/events/components/pages/EventsBackoffice.vue.js +1 -1
  95. package/dist/martyrs/src/modules/events/components/sections/EventsHot.vue.cjs +1 -1
  96. package/dist/martyrs/src/modules/events/components/sections/EventsHot.vue.js +1 -1
  97. package/dist/martyrs/src/modules/gallery/components/sections/BackofficeGallery.vue.cjs +1 -1
  98. package/dist/martyrs/src/modules/gallery/components/sections/BackofficeGallery.vue.js +1 -1
  99. package/dist/martyrs/src/modules/globals/globals.client.cjs +2 -0
  100. package/dist/martyrs/src/modules/globals/globals.client.cjs.map +1 -1
  101. package/dist/martyrs/src/modules/globals/globals.client.js +3 -1
  102. package/dist/martyrs/src/modules/globals/globals.client.js.map +1 -1
  103. package/dist/martyrs/src/modules/globals/views/components/blocks/CardHeader.vue.cjs +2 -2
  104. package/dist/martyrs/src/modules/globals/views/components/blocks/CardHeader.vue.js +2 -2
  105. package/dist/martyrs/src/modules/globals/views/components/blocks/PopupDateSelector.vue.cjs +1 -1
  106. package/dist/martyrs/src/modules/globals/views/components/blocks/PopupDateSelector.vue.js +1 -1
  107. package/dist/martyrs/src/modules/globals/views/components/layouts/Client.vue.cjs +1 -1
  108. package/dist/martyrs/src/modules/globals/views/components/layouts/Client.vue.js +1 -1
  109. package/dist/martyrs/src/modules/globals/views/components/partials/Header.vue.cjs +1 -1
  110. package/dist/martyrs/src/modules/globals/views/components/partials/Header.vue.js +1 -1
  111. package/dist/martyrs/src/modules/globals/views/components/partials/Navigation.vue.cjs +1 -1
  112. package/dist/martyrs/src/modules/globals/views/components/partials/Navigation.vue.js +1 -1
  113. package/dist/martyrs/src/modules/globals/views/components/partials/NavigationBar.vue.cjs +1 -1
  114. package/dist/martyrs/src/modules/globals/views/components/partials/NavigationBar.vue.js +1 -1
  115. package/dist/martyrs/src/modules/globals/views/components/sections/SectionPageTitle.vue.cjs +1 -1
  116. package/dist/martyrs/src/modules/globals/views/components/sections/SectionPageTitle.vue.js +1 -1
  117. package/dist/martyrs/src/modules/globals/views/utils/vue-app-renderer.cjs +1 -1
  118. package/dist/martyrs/src/modules/globals/views/utils/vue-app-renderer.js +1 -1
  119. package/dist/martyrs/src/modules/orders/components/pages/OrderBackoffice.vue.cjs +1 -1
  120. package/dist/martyrs/src/modules/orders/components/pages/OrderBackoffice.vue.js +1 -1
  121. package/dist/martyrs/src/modules/orders/components/pages/OrderCreate.vue.cjs +89 -28
  122. package/dist/martyrs/src/modules/orders/components/pages/OrderCreate.vue.cjs.map +1 -1
  123. package/dist/martyrs/src/modules/orders/components/pages/OrderCreate.vue.js +90 -29
  124. package/dist/martyrs/src/modules/orders/components/pages/OrderCreate.vue.js.map +1 -1
  125. package/dist/martyrs/src/modules/orders/components/pages/OrderCreateBackoffice.vue.cjs +2 -2
  126. package/dist/martyrs/src/modules/orders/components/pages/OrderCreateBackoffice.vue.js +2 -2
  127. package/dist/martyrs/src/modules/orders/components/pages/Orders.vue.cjs +1 -1
  128. package/dist/martyrs/src/modules/orders/components/pages/Orders.vue.js +1 -1
  129. package/dist/martyrs/src/modules/orders/components/sections/FormAddCustomer.vue.cjs +1 -1
  130. package/dist/martyrs/src/modules/orders/components/sections/FormAddCustomer.vue.js +1 -1
  131. package/dist/martyrs/src/modules/orders/components/sections/FormDelivery.vue.cjs +1 -1
  132. package/dist/martyrs/src/modules/orders/components/sections/FormDelivery.vue.js +1 -1
  133. package/dist/martyrs/src/modules/orders/store/shopcart.cjs +1 -0
  134. package/dist/martyrs/src/modules/orders/store/shopcart.cjs.map +1 -1
  135. package/dist/martyrs/src/modules/orders/store/shopcart.js +1 -0
  136. package/dist/martyrs/src/modules/orders/store/shopcart.js.map +1 -1
  137. package/dist/martyrs/src/modules/organizations/components/elements/ButtonToggleMembership.vue.cjs +1 -1
  138. package/dist/martyrs/src/modules/organizations/components/elements/ButtonToggleMembership.vue.js +1 -1
  139. package/dist/martyrs/src/modules/organizations/components/pages/DepartmentEdit.vue.cjs +2 -2
  140. package/dist/martyrs/src/modules/organizations/components/pages/DepartmentEdit.vue.js +2 -2
  141. package/dist/martyrs/src/modules/organizations/components/pages/Members.vue.cjs +2 -2
  142. package/dist/martyrs/src/modules/organizations/components/pages/Members.vue.js +2 -2
  143. package/dist/martyrs/src/modules/organizations/components/pages/Organization.vue.cjs +2 -2
  144. package/dist/martyrs/src/modules/organizations/components/pages/Organization.vue.js +2 -2
  145. package/dist/martyrs/src/modules/organizations/components/pages/OrganizationBackoffice.vue.cjs +1 -1
  146. package/dist/martyrs/src/modules/organizations/components/pages/OrganizationBackoffice.vue.js +1 -1
  147. package/dist/martyrs/src/modules/organizations/components/pages/OrganizationEdit.vue.cjs +2 -2
  148. package/dist/martyrs/src/modules/organizations/components/pages/OrganizationEdit.vue.js +2 -2
  149. package/dist/martyrs/src/modules/organizations/components/pages/Organizations.vue.cjs +1 -1
  150. package/dist/martyrs/src/modules/organizations/components/pages/Organizations.vue.js +1 -1
  151. package/dist/martyrs/src/modules/organizations/components/sections/DetailsTabSection.vue.cjs +1 -1
  152. package/dist/martyrs/src/modules/organizations/components/sections/DetailsTabSection.vue.js +1 -1
  153. package/dist/martyrs/src/modules/organizations/components/sections/Documents.vue.cjs +1 -1
  154. package/dist/martyrs/src/modules/organizations/components/sections/Documents.vue.js +1 -1
  155. package/dist/martyrs/src/modules/organizations/components/sections/MembersAdd.vue.cjs +1 -1
  156. package/dist/martyrs/src/modules/organizations/components/sections/MembersAdd.vue.js +1 -1
  157. package/dist/martyrs/src/modules/organizations/components/sections/Organizations.vue.cjs +2 -2
  158. package/dist/martyrs/src/modules/organizations/components/sections/Organizations.vue.js +2 -2
  159. package/dist/martyrs/src/modules/pages/views/components/blocks/CardPage.vue.cjs +1 -1
  160. package/dist/martyrs/src/modules/pages/views/components/blocks/CardPage.vue.js +1 -1
  161. package/dist/martyrs/src/modules/pages/views/components/pages/PageEdit.vue.cjs +1 -1
  162. package/dist/martyrs/src/modules/pages/views/components/pages/PageEdit.vue.js +1 -1
  163. package/dist/martyrs/src/modules/pages/views/components/partials/SidebarPages.vue.cjs +1 -1
  164. package/dist/martyrs/src/modules/pages/views/components/partials/SidebarPages.vue.js +1 -1
  165. package/dist/martyrs/src/modules/products/components/pages/Categories.vue.cjs +1 -1
  166. package/dist/martyrs/src/modules/products/components/pages/Categories.vue.js +1 -1
  167. package/dist/martyrs/src/modules/products/components/pages/CategoryEdit.vue.cjs +21 -2
  168. package/dist/martyrs/src/modules/products/components/pages/CategoryEdit.vue.cjs.map +1 -1
  169. package/dist/martyrs/src/modules/products/components/pages/CategoryEdit.vue.js +21 -2
  170. package/dist/martyrs/src/modules/products/components/pages/CategoryEdit.vue.js.map +1 -1
  171. package/dist/martyrs/src/modules/products/components/pages/Leftovers.vue.cjs +1 -1
  172. package/dist/martyrs/src/modules/products/components/pages/Leftovers.vue.js +1 -1
  173. package/dist/martyrs/src/modules/products/components/pages/Product.vue.cjs +3 -2
  174. package/dist/martyrs/src/modules/products/components/pages/Product.vue.cjs.map +1 -1
  175. package/dist/martyrs/src/modules/products/components/pages/Product.vue.js +3 -2
  176. package/dist/martyrs/src/modules/products/components/pages/Product.vue.js.map +1 -1
  177. package/dist/martyrs/src/modules/products/components/pages/ProductEdit.vue.cjs +4 -4
  178. package/dist/martyrs/src/modules/products/components/pages/ProductEdit.vue.cjs.map +1 -1
  179. package/dist/martyrs/src/modules/products/components/pages/ProductEdit.vue.js +4 -4
  180. package/dist/martyrs/src/modules/products/components/pages/ProductEdit.vue.js.map +1 -1
  181. package/dist/martyrs/src/modules/products/components/pages/Products.vue.cjs +1 -1
  182. package/dist/martyrs/src/modules/products/components/pages/Products.vue.js +1 -1
  183. package/dist/martyrs/src/modules/products/components/sections/EditProductInfo.vue.cjs +1 -1
  184. package/dist/martyrs/src/modules/products/components/sections/EditProductInfo.vue.js +1 -1
  185. package/dist/martyrs/src/modules/products/components/sections/SectionProduct.vue.cjs +2 -2
  186. package/dist/martyrs/src/modules/products/components/sections/SectionProduct.vue.js +2 -2
  187. package/dist/martyrs/src/modules/products/store/categories.cjs +2 -0
  188. package/dist/martyrs/src/modules/products/store/categories.cjs.map +1 -1
  189. package/dist/martyrs/src/modules/products/store/categories.js +2 -0
  190. package/dist/martyrs/src/modules/products/store/categories.js.map +1 -1
  191. package/dist/martyrs/src/modules/rents/views/components/pages/GanttChart.vue.cjs +1 -1
  192. package/dist/martyrs/src/modules/rents/views/components/pages/GanttChart.vue.js +1 -1
  193. package/dist/martyrs/src/modules/rents/views/components/pages/Rents.vue.cjs +1 -1
  194. package/dist/martyrs/src/modules/rents/views/components/pages/Rents.vue.js +1 -1
  195. package/dist/martyrs/src/modules/reports/components/sections/FormReport.vue.cjs +1 -1
  196. package/dist/martyrs/src/modules/reports/components/sections/FormReport.vue.js +1 -1
  197. package/dist/martyrs/src/modules/spots/components/layouts/Spots.vue.cjs +1 -1
  198. package/dist/martyrs/src/modules/spots/components/layouts/Spots.vue.js +1 -1
  199. package/dist/martyrs/src/modules/spots/components/pages/Map.vue.cjs +1 -1
  200. package/dist/martyrs/src/modules/spots/components/pages/Map.vue.js +1 -1
  201. package/dist/martyrs/src/modules/spots/components/pages/SpotEdit.vue.cjs +32 -26
  202. package/dist/martyrs/src/modules/spots/components/pages/SpotEdit.vue.cjs.map +1 -1
  203. package/dist/martyrs/src/modules/spots/components/pages/SpotEdit.vue.js +32 -26
  204. package/dist/martyrs/src/modules/spots/components/pages/SpotEdit.vue.js.map +1 -1
  205. package/dist/martyrs/src/modules/spots/components/sections/WorktimeEdit.vue.cjs +807 -0
  206. package/dist/martyrs/src/modules/spots/components/sections/WorktimeEdit.vue.cjs.map +1 -0
  207. package/dist/martyrs/src/modules/spots/components/sections/WorktimeEdit.vue.js +807 -0
  208. package/dist/martyrs/src/modules/spots/components/sections/WorktimeEdit.vue.js.map +1 -0
  209. package/dist/martyrs/src/modules/spots/store/spots.cjs +4 -1
  210. package/dist/martyrs/src/modules/spots/store/spots.cjs.map +1 -1
  211. package/dist/martyrs/src/modules/spots/store/spots.js +4 -1
  212. package/dist/martyrs/src/modules/spots/store/spots.js.map +1 -1
  213. package/dist/martyrs.cjs.js +1 -1
  214. package/dist/martyrs.css +1 -1
  215. package/dist/martyrs.es.js +1 -1
  216. package/dist/{martyrs → node_modules/.pnpm/@vue_server-renderer@3.5.13_vue@3.5.13_typescript@5.8.3_}/node_modules/@vue/server-renderer/dist/server-renderer.esm-bundler.cjs +1 -1
  217. package/dist/node_modules/.pnpm/@vue_server-renderer@3.5.13_vue@3.5.13_typescript@5.8.3_/node_modules/@vue/server-renderer/dist/server-renderer.esm-bundler.cjs.map +1 -0
  218. package/dist/{martyrs → node_modules/.pnpm/@vue_server-renderer@3.5.13_vue@3.5.13_typescript@5.8.3_}/node_modules/@vue/server-renderer/dist/server-renderer.esm-bundler.js +1 -1
  219. package/dist/node_modules/.pnpm/@vue_server-renderer@3.5.13_vue@3.5.13_typescript@5.8.3_/node_modules/@vue/server-renderer/dist/server-renderer.esm-bundler.js.map +1 -0
  220. package/dist/node_modules/.pnpm/@vue_shared@3.5.13/node_modules/@vue/shared/dist/shared.esm-bundler.cjs.map +1 -0
  221. package/dist/node_modules/.pnpm/@vue_shared@3.5.13/node_modules/@vue/shared/dist/shared.esm-bundler.js.map +1 -0
  222. package/dist/node_modules/.pnpm/uuid@11.1.0/node_modules/uuid/dist/esm-browser/native.cjs +6 -0
  223. package/dist/node_modules/.pnpm/uuid@11.1.0/node_modules/uuid/dist/esm-browser/native.cjs.map +1 -0
  224. package/dist/node_modules/.pnpm/uuid@11.1.0/node_modules/uuid/dist/esm-browser/native.js +6 -0
  225. package/dist/node_modules/.pnpm/uuid@11.1.0/node_modules/uuid/dist/esm-browser/native.js.map +1 -0
  226. package/dist/{martyrs → node_modules/.pnpm/uuid@11.1.0}/node_modules/uuid/dist/esm-browser/rng.cjs +4 -4
  227. package/dist/node_modules/.pnpm/uuid@11.1.0/node_modules/uuid/dist/esm-browser/rng.cjs.map +1 -0
  228. package/dist/node_modules/.pnpm/uuid@11.1.0/node_modules/uuid/dist/esm-browser/rng.js +15 -0
  229. package/dist/node_modules/.pnpm/uuid@11.1.0/node_modules/uuid/dist/esm-browser/rng.js.map +1 -0
  230. package/dist/node_modules/.pnpm/uuid@11.1.0/node_modules/uuid/dist/esm-browser/stringify.cjs +11 -0
  231. package/dist/node_modules/.pnpm/uuid@11.1.0/node_modules/uuid/dist/esm-browser/stringify.cjs.map +1 -0
  232. package/dist/node_modules/.pnpm/uuid@11.1.0/node_modules/uuid/dist/esm-browser/stringify.js +11 -0
  233. package/dist/node_modules/.pnpm/uuid@11.1.0/node_modules/uuid/dist/esm-browser/stringify.js.map +1 -0
  234. package/dist/node_modules/.pnpm/uuid@11.1.0/node_modules/uuid/dist/esm-browser/v4.cjs +21 -0
  235. package/dist/node_modules/.pnpm/uuid@11.1.0/node_modules/uuid/dist/esm-browser/v4.cjs.map +1 -0
  236. package/dist/node_modules/.pnpm/uuid@11.1.0/node_modules/uuid/dist/esm-browser/v4.js +21 -0
  237. package/dist/node_modules/.pnpm/uuid@11.1.0/node_modules/uuid/dist/esm-browser/v4.js.map +1 -0
  238. package/dist/notifications.server.js +1 -1
  239. package/dist/notifications.server.mjs +1 -1
  240. package/dist/orders.server.js +5 -4
  241. package/dist/orders.server.mjs +5 -4
  242. package/dist/organizations.server.js +120 -47
  243. package/dist/organizations.server.mjs +120 -47
  244. package/dist/{ownership.schema-C0w02Vw1.mjs → ownership.schema-CNCotD3D.mjs} +10 -4
  245. package/dist/{ownership.schema-Ck2H9clB.js → ownership.schema-MxfJlPtq.js} +10 -4
  246. package/dist/products.server.js +415 -149
  247. package/dist/products.server.mjs +415 -149
  248. package/dist/{profile.schema-h61hhB2w.js → profile.schema-BLSuV_VC.js} +0 -4
  249. package/dist/{profile.schema-kP_zKXNt.mjs → profile.schema-BRuvQ7QV.mjs} +0 -4
  250. package/dist/{queryProcessor-CWnMIe2U.mjs → queryProcessor-CVKI651_.mjs} +62 -8
  251. package/dist/{queryProcessor-D6GuKfTV.js → queryProcessor-DSUqSk3I.js} +62 -8
  252. package/dist/rents.server.js +4 -4
  253. package/dist/rents.server.mjs +4 -4
  254. package/dist/spots.server.js +162 -8
  255. package/dist/spots.server.mjs +162 -8
  256. package/dist/style.css +27 -4
  257. package/dist/wallet.server.js +2 -2
  258. package/dist/wallet.server.mjs +2 -2
  259. package/package.json +1 -1
  260. package/src/builder/rspack/rspack.config.base.js +1 -1
  261. package/src/builder/rspack/rspack.config.client.js +13 -5
  262. package/src/components/Select/Select.vue +4 -2
  263. package/src/modules/auth/models/user.model.js +4 -1
  264. package/src/modules/community/components/sections/HotPosts.vue +1 -1
  265. package/src/modules/globals/controllers/classes/globals.abac.js +148 -23
  266. package/src/modules/globals/controllers/classes/globals.validator.js +37 -0
  267. package/src/modules/globals/controllers/classes/globals.verifier.js +2 -0
  268. package/src/modules/globals/controllers/policies/globals.policies.js +91 -74
  269. package/src/modules/globals/controllers/utils/queryProcessor.js +59 -11
  270. package/src/modules/globals/globals.client.js +3 -0
  271. package/src/modules/globals/models/schemas/ownership.schema.js +11 -6
  272. package/src/modules/globals/models/schemas/profile.schema.js +0 -4
  273. package/src/modules/music/components/layouts/MusicLayout.vue +10 -58
  274. package/src/modules/music/components/pages/MusicHome.vue +5 -5
  275. package/src/modules/orders/components/pages/OrderCreate.vue +85 -12
  276. package/src/modules/orders/controllers/orders.controller.js +3 -0
  277. package/src/modules/orders/store/shopcart.js +1 -0
  278. package/src/modules/organizations/models/schemas/accesses.schema.js +18 -0
  279. package/src/modules/organizations/policies/organizations.policies.js +117 -61
  280. package/src/modules/products/components/pages/CategoryEdit.vue +27 -2
  281. package/src/modules/products/components/pages/Product.vue +1 -0
  282. package/src/modules/products/components/pages/ProductEdit.vue +2 -2
  283. package/src/modules/products/controllers/categories.controller.js +297 -133
  284. package/src/modules/products/middlewares/categories.verifier.js +177 -0
  285. package/src/modules/products/models/category.model.js +12 -14
  286. package/src/modules/products/routes/categories.routes.js +50 -11
  287. package/src/modules/products/store/categories.js +2 -0
  288. package/src/modules/spots/components/pages/SpotEdit.vue +21 -17
  289. package/src/modules/spots/components/sections/WorktimeEdit.vue +840 -0
  290. package/src/modules/spots/controllers/queries/getIsOpenNowStage.js +109 -0
  291. package/src/modules/spots/controllers/spots.controller.js +2 -1
  292. package/src/modules/spots/models/spot.model.js +59 -13
  293. package/src/modules/spots/store/spots.js +4 -1
  294. package/dist/martyrs/node_modules/@vue/server-renderer/dist/server-renderer.esm-bundler.cjs.map +0 -1
  295. package/dist/martyrs/node_modules/@vue/server-renderer/dist/server-renderer.esm-bundler.js.map +0 -1
  296. package/dist/martyrs/node_modules/@vue/shared/dist/shared.esm-bundler.cjs.map +0 -1
  297. package/dist/martyrs/node_modules/@vue/shared/dist/shared.esm-bundler.js.map +0 -1
  298. package/dist/martyrs/node_modules/uuid/dist/esm-browser/regex.cjs +0 -5
  299. package/dist/martyrs/node_modules/uuid/dist/esm-browser/regex.cjs.map +0 -1
  300. package/dist/martyrs/node_modules/uuid/dist/esm-browser/regex.js +0 -5
  301. package/dist/martyrs/node_modules/uuid/dist/esm-browser/regex.js.map +0 -1
  302. package/dist/martyrs/node_modules/uuid/dist/esm-browser/rng.cjs.map +0 -1
  303. package/dist/martyrs/node_modules/uuid/dist/esm-browser/rng.js +0 -15
  304. package/dist/martyrs/node_modules/uuid/dist/esm-browser/rng.js.map +0 -1
  305. package/dist/martyrs/node_modules/uuid/dist/esm-browser/stringify.cjs +0 -17
  306. package/dist/martyrs/node_modules/uuid/dist/esm-browser/stringify.cjs.map +0 -1
  307. package/dist/martyrs/node_modules/uuid/dist/esm-browser/stringify.js +0 -17
  308. package/dist/martyrs/node_modules/uuid/dist/esm-browser/stringify.js.map +0 -1
  309. package/dist/martyrs/node_modules/uuid/dist/esm-browser/v4.cjs +0 -13
  310. package/dist/martyrs/node_modules/uuid/dist/esm-browser/v4.cjs.map +0 -1
  311. package/dist/martyrs/node_modules/uuid/dist/esm-browser/v4.js +0 -13
  312. package/dist/martyrs/node_modules/uuid/dist/esm-browser/v4.js.map +0 -1
  313. package/dist/martyrs/node_modules/uuid/dist/esm-browser/validate.cjs +0 -8
  314. package/dist/martyrs/node_modules/uuid/dist/esm-browser/validate.cjs.map +0 -1
  315. package/dist/martyrs/node_modules/uuid/dist/esm-browser/validate.js +0 -8
  316. package/dist/martyrs/node_modules/uuid/dist/esm-browser/validate.js.map +0 -1
  317. package/dist/martyrs/src/components/Button/Button.vue.js.map +0 -1
  318. package/dist/martyrs/src/components/Dropdown/Dropdown.vue2.cjs.map +0 -1
  319. package/dist/martyrs/src/components/Menu/Menu.vue2.cjs.map +0 -1
  320. package/dist/martyrs/src/components/Menu/Menu.vue2.js.map +0 -1
  321. package/dist/martyrs/src/components/Tab/Tab.vue.js.map +0 -1
  322. package/src/modules/products/middlewares/index.js +0 -11
  323. package/src/modules/products/middlewares/verifyCategory.js +0 -25
  324. /package/dist/{martyrs → node_modules/.pnpm/@vue_shared@3.5.13}/node_modules/@vue/shared/dist/shared.esm-bundler.cjs +0 -0
  325. /package/dist/{martyrs → node_modules/.pnpm/@vue_shared@3.5.13}/node_modules/@vue/shared/dist/shared.esm-bundler.js +0 -0
  326. /package/dist/{martyrs/node_modules → node_modules}/fast-deep-equal/index.cjs +0 -0
  327. /package/dist/{martyrs/node_modules → node_modules}/fast-deep-equal/index.cjs.map +0 -0
  328. /package/dist/{martyrs/node_modules → node_modules}/fast-deep-equal/index.js +0 -0
  329. /package/dist/{martyrs/node_modules → node_modules}/fast-deep-equal/index.js.map +0 -0
package/dist/style.css CHANGED
@@ -336,10 +336,10 @@ button[disabled] {
336
336
  .color-overlay.active {
337
337
  background: rgba(0, 0, 0, 0.25);
338
338
  pointer-events: all;
339
- }li[data-v-bf25c24d] {
339
+ }li[data-v-026b7d35] {
340
340
  list-style-type: none;
341
341
  }
342
- ul li[data-v-bf25c24d] {
342
+ ul li[data-v-026b7d35] {
343
343
  line-height: 2;
344
344
  }.vue3-marquee {
345
345
  display: flex !important;
@@ -993,11 +993,11 @@ div.vue-tags-input.disabled * {
993
993
  .fade-leave-to[data-v-a766dedc] {
994
994
  opacity: 0;
995
995
  }
996
- .slider-hotpost .carousel__slide[data-v-e26065cc] {
996
+ .slider-hotpost .carousel__slide {
997
997
  flex: 0 0 25%;
998
998
  }
999
999
  @media screen and (max-width: 1025px) {
1000
- .slider-hotpost .carousel__slide[data-v-e26065cc] {
1000
+ .slider-hotpost .carousel__slide {
1001
1001
  flex: 0 0 75%;
1002
1002
  }
1003
1003
  }.error-wrapper {
@@ -2521,6 +2521,29 @@ to {
2521
2521
  border: 1px solid rgba(0, 0, 0, 0.1);
2522
2522
  margin-top: 1rem;
2523
2523
  }
2524
+
2525
+ .working-hours-editor[data-v-f62ccd5d] {
2526
+ border-radius: 8px;
2527
+ }
2528
+ .schedule-item[data-v-f62ccd5d] {
2529
+ transition: all 0.3s ease;
2530
+ border-bottom: 1px solid rgba(var(--grey), 0.1);
2531
+ }
2532
+ .schedule-item[data-v-f62ccd5d]:last-child {
2533
+ border-bottom: none;
2534
+ }
2535
+ .period[data-v-f62ccd5d] {
2536
+ display: inline-block;
2537
+ }
2538
+ .empty-schedule[data-v-f62ccd5d] {
2539
+ color: rgba(var(--dark), 0.6);
2540
+ }
2541
+ .period-row[data-v-f62ccd5d] {
2542
+ align-items: center;
2543
+ }
2544
+ .error-message[data-v-f62ccd5d] {
2545
+ color: white;
2546
+ }
2524
2547
  #map[data-v-aa4fd3e0]:focus {
2525
2548
  outline: none;
2526
2549
  }
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  const _commonjsHelpers = require("./_commonjsHelpers-DHfMLFPC.js");
3
- const index = require("./index-CVXl1rB5.js");
3
+ const index = require("./index-BOmxJQ5W.js");
4
4
  require("axios");
5
5
  require("bcryptjs");
6
6
  require("crypto");
@@ -9,7 +9,7 @@ const tickets_controller = require("./tickets.controller-zEHIAe_B.js");
9
9
  const require$$0 = require("stripe");
10
10
  const require$$0$1 = require("mongoose");
11
11
  const require$$1 = require("bignumber.js");
12
- const queryProcessor = require("./queryProcessor-D6GuKfTV.js");
12
+ const queryProcessor = require("./queryProcessor-DSUqSk3I.js");
13
13
  var wallet_model;
14
14
  var hasRequiredWallet_model;
15
15
  function requireWallet_model() {
@@ -1,5 +1,5 @@
1
1
  import { g as getDefaultExportFromCjs } from "./_commonjsHelpers-CUmg6egw.mjs";
2
- import { r as requireMiddlewares } from "./index-Df8vtZx7.mjs";
2
+ import { r as requireMiddlewares } from "./index-C_Fw0Umg.mjs";
3
3
  import "axios";
4
4
  import "bcryptjs";
5
5
  import "crypto";
@@ -8,7 +8,7 @@ import { r as requireTickets_controller } from "./tickets.controller-BIhfgjNb.mj
8
8
  import require$$0 from "stripe";
9
9
  import require$$0$1 from "mongoose";
10
10
  import require$$1 from "bignumber.js";
11
- import { r as requireQueryProcessor } from "./queryProcessor-CWnMIe2U.mjs";
11
+ import { r as requireQueryProcessor } from "./queryProcessor-CVKI651_.mjs";
12
12
  var wallet_model;
13
13
  var hasRequiredWallet_model;
14
14
  function requireWallet_model() {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ozdao/martyrs",
3
- "version": "0.2.472",
3
+ "version": "0.2.474",
4
4
  "description": "Fullstack framework focused on user experience and ease of development.",
5
5
  "author": "OZ DAO <hello@ozdao.dev>",
6
6
  "license": "GPL-3.0-or-later",
@@ -88,7 +88,7 @@ module.exports = (projectRoot) => {
88
88
  plugins: [
89
89
  ...(process.env.BUNDLE_ANALYZER ? [new RsdoctorRspackPlugin(), new BundleAnalyzerPlugin()] : []),
90
90
  new VueLoaderPlugin(),
91
- ...(process.env.BUNDLE_ANALYZER ? [new rspack.CssExtractRspackPlugin({
91
+ ...(process.env.NODE_ENV === 'production' ? [new rspack.CssExtractRspackPlugin({
92
92
  filename: '[name].[contenthash].css',
93
93
  chunkFilename: '[id].[contenthash].css',
94
94
  ignoreOrder: true,
@@ -47,15 +47,23 @@ module.exports = (projectRoot) => {
47
47
  safelist: {
48
48
  standard: ["safelisted", /^html/, /^:root/],
49
49
  deep: [/^safelisted-deep-/, /^html/, /^:root/],
50
- greedy: [ /data-v-.*/ ]
50
+ greedy: [/^data-v-/, /\[data-v-.*\]/, /\[data-v-[a-zA-Z0-9]*\]/]
51
51
  },
52
+ rejected: true,
52
53
  extractors: [
53
54
  {
54
- extractor: (content)=>{
55
- // fix for escaped tailwind prefixes (sm:, lg:, etc)
56
- return content.match(/[A-Za-z0-9-_:\/]+/g) || []
55
+ extractor: (content) => {
56
+ // Ищем классы и селекторы с префиксами Tailwind
57
+ const normalClasses = content.match(/[A-Za-z0-9-_:\/]+/g) || [];
58
+
59
+ // Дополнительно ищем Vue атрибуты data-v-*
60
+ // Это важно для правильного распознавания scoped стилей
61
+ const scopedAttrs = content.match(/\[data-v-[a-zA-Z0-9]*\]/g) || [];
62
+
63
+ // Объединяем результаты
64
+ return [...normalClasses, ...scopedAttrs];
57
65
  },
58
- extensions: ['vue'],
66
+ extensions: ['vue', 'js', 'css', 'scss'],
59
67
  },
60
68
  ],
61
69
  }),
@@ -15,7 +15,7 @@
15
15
  <li class="w-100">
16
16
  <!-- Selected Value -->
17
17
  <span>
18
- {{ optionsSelected?.name ? optionsSelected?.name : optionsSelected || placeholder }}
18
+ {{ optionsSelected ? (optionsSelected.name || optionsSelected[props.value] || optionsSelected) : placeholder }}
19
19
  </span>
20
20
  </li>
21
21
 
@@ -29,7 +29,8 @@
29
29
  >
30
30
  <li @click.stop="selectOption(option)" v-for="option in optionsListed">
31
31
  <span v-if="option" class="w-100">
32
- {{ option.name || option }}
32
+
33
+ {{ option.name || option[props.value] || option }}
33
34
  </span>
34
35
  </li>
35
36
  </ul>
@@ -62,6 +63,7 @@ const props = defineProps({
62
63
  placeholder: { type: String, default: 'Please select an item' },
63
64
  select: [String, Object],
64
65
  property: String,
66
+ value: String,
65
67
  options: { type: Array, default: () => [] },
66
68
  validation: Boolean,
67
69
  })
@@ -21,7 +21,10 @@ module.exports = (db) => {
21
21
  default: 'active',
22
22
  required: true,
23
23
  },
24
-
24
+ birthday: {
25
+ type: Date,
26
+ default: null
27
+ },
25
28
  roles: [{
26
29
  type: db.mongoose.Schema.Types.ObjectId,
27
30
  ref: "Role"
@@ -63,7 +63,7 @@ const props = defineProps({
63
63
  })
64
64
  </script>
65
65
 
66
- <style lang="scss" scoped>
66
+ <style lang="scss">
67
67
  .slider-hotpost .carousel__slide {
68
68
  flex: 0 0 25%;
69
69
  }
@@ -49,7 +49,7 @@ class GlobalABAC {
49
49
 
50
50
  // Автоматическое определение модели по имени ресурса
51
51
  getResourceModel(resourceName) {
52
- if (resourceName === 'posts') resourceName = 'blogposts'
52
+ if (resourceName === 'posts') resourceName = 'blogposts';
53
53
 
54
54
  // Преобразуем название ресурса в singural форму модели
55
55
  const modelName = resourceName.endsWith('s')
@@ -66,8 +66,45 @@ class GlobalABAC {
66
66
  return model;
67
67
  }
68
68
 
69
+ /**
70
+ * Нормализация результата политики для единообразной обработки
71
+ * @param {any} result - Результат выполнения политики
72
+ * @param {string} policyName - Имя политики для формирования причины
73
+ * @returns {Object} Нормализованный результат
74
+ */
75
+ _normalizeResult(result, policyName) {
76
+ // Результат уже в формате объекта с нужными полями
77
+ if (result && typeof result === 'object' && ('allow' in result || 'force' in result)) {
78
+ return {
79
+ allow: !!result.allow,
80
+ force: !!result.force,
81
+ reason: result.reason || `POLICY_${policyName.toUpperCase()}`
82
+ };
83
+ }
84
+
85
+ // Boolean результаты
86
+ if (result === true) {
87
+ return { allow: true, force: false, reason: `ALLOWED_BY_${policyName.toUpperCase()}` };
88
+ }
89
+
90
+ if (result === false) {
91
+ return { allow: false, force: false, reason: `DENIED_BY_${policyName.toUpperCase()}` };
92
+ }
93
+
94
+ // Специальные случаи для adminAccessGranted и подобных
95
+ if (result === undefined && policyName === 'AdminModeratorAccessPolicy' &&
96
+ (this._context && this._context.adminAccessGranted)) {
97
+ return { allow: true, force: true, reason: 'ADMIN_MODERATOR_ACCESS_GRANTED' };
98
+ }
99
+
100
+ // Нейтральный результат (пропуск политики)
101
+ return { allow: true, force: false, reason: `NEUTRAL_${policyName.toUpperCase()}` };
102
+ }
103
+
69
104
  // Базовый метод проверки доступа
70
105
  async checkAccess(context) {
106
+ this._context = context; // Сохраняем контекст для использования в _normalizeResult
107
+
71
108
  const {
72
109
  user, // Пользователь
73
110
  resource, // Тип ресурса
@@ -124,34 +161,122 @@ class GlobalABAC {
124
161
  }
125
162
  }
126
163
 
127
- // Выполнение глобальных политик
128
- for (const [policyName, policyFn] of Object.entries(this.policies.global)) {
129
- const result = await policyFn(context);
130
- if (result === false) {
131
- return {
132
- allowed: false,
133
- reason: `DENIED_BY_GLOBAL_POLICY_${policyName.toUpperCase()}`
134
- };
164
+ // Выполнение всех глобальных политик параллельно
165
+ const policyEntries = Object.entries(this.policies.global);
166
+ const policyPromises = policyEntries.map(async ([policyName, policyFn]) => {
167
+ try {
168
+ const result = await policyFn(context);
169
+ return { policyName, result };
170
+ } catch (error) {
171
+ console.error(`Error in policy ${policyName}:`, error);
172
+ // При ошибке возвращаем нейтральный результат
173
+ return { policyName, result: undefined, error };
135
174
  }
136
- }
175
+ });
137
176
 
138
- // Проверка политик для конкретного ресурса
177
+ // Ожидаем выполнения всех политик
178
+ const policyResults = await Promise.all(policyPromises);
179
+
180
+ // Обработка результатов глобальных политик
181
+ let hasForceAllow = false;
182
+ let hasForceDisallow = false;
183
+ let hasDeny = false;
184
+ let denyReason = '';
185
+ let allowReason = '';
186
+
187
+ for (const { policyName, result, error } of policyResults) {
188
+ if (error) continue; // Пропускаем политики с ошибками
189
+
190
+ // Нормализуем результат для унифицированной обработки
191
+ const normalizedResult = this._normalizeResult(result, policyName);
192
+
193
+ if (normalizedResult.force) {
194
+ if (normalizedResult.allow) {
195
+ hasForceAllow = true;
196
+ allowReason = normalizedResult.reason;
197
+ } else {
198
+ hasForceDisallow = true;
199
+ denyReason = normalizedResult.reason;
200
+ }
201
+ } else if (!normalizedResult.allow) {
202
+ hasDeny = true;
203
+ if (!denyReason) denyReason = normalizedResult.reason;
204
+ }
205
+ }
206
+
207
+ // Принятие решения на основе результатов
208
+ // 1. Проверка на стопроцентный запрет
209
+ if (hasForceDisallow) {
210
+ return {
211
+ allowed: false,
212
+ reason: denyReason || 'FORCE_DENIED_BY_POLICY'
213
+ };
214
+ }
215
+
216
+ // 2. Проверка на стопроцентный доступ
217
+ if (hasForceAllow) {
218
+ return {
219
+ allowed: true,
220
+ reason: allowReason || 'FORCE_ALLOWED_BY_POLICY'
221
+ };
222
+ }
223
+
224
+ // 3. Проверка на обычный запрет
225
+ if (hasDeny) {
226
+ return {
227
+ allowed: false,
228
+ reason: denyReason || 'DENIED_BY_POLICY'
229
+ };
230
+ }
231
+
232
+ // 4. Проверка политик ресурсов (возможно асинхронное выполнение)
139
233
  if (this.policies.resources[resource]) {
140
- const resourceResult = await this.policies.resources[resource](context);
141
- if (resourceResult === true) {
142
- return {
143
- allowed: true,
144
- reason: 'RESOURCE_POLICY_ALLOWED'
145
- };
234
+ try {
235
+ const resourceResult = await this.policies.resources[resource](context);
236
+ const normalizedResult = this._normalizeResult(resourceResult, `RESOURCE_${resource}`);
237
+
238
+ if (normalizedResult.force) {
239
+ return {
240
+ allowed: normalizedResult.allow,
241
+ reason: normalizedResult.reason
242
+ };
243
+ }
244
+
245
+ if (!normalizedResult.allow) {
246
+ return {
247
+ allowed: false,
248
+ reason: normalizedResult.reason
249
+ };
250
+ }
251
+
252
+ if (normalizedResult.allow) {
253
+ return {
254
+ allowed: true,
255
+ reason: normalizedResult.reason
256
+ };
257
+ }
258
+ } catch (error) {
259
+ console.error(`Error in resource policy for ${resource}:`, error);
146
260
  }
147
261
  }
148
262
 
149
- // Выполнение расширений от внешних модулей
150
- for (const [moduleName, extensionFn] of Object.entries(this.policies.extensions)) {
151
- const extensionResult = await extensionFn(context);
263
+ // 5. Выполнение расширений от внешних модулей
264
+ const extensionPromises = Object.entries(this.policies.extensions).map(async ([moduleName, extensionFn]) => {
265
+ try {
266
+ const extensionResult = await extensionFn(context);
267
+ return { moduleName, result: extensionResult };
268
+ } catch (error) {
269
+ console.error(`Error in extension ${moduleName}:`, error);
270
+ return { moduleName, result: null, error };
271
+ }
272
+ });
273
+
274
+ const extensionResults = await Promise.all(extensionPromises);
275
+
276
+ for (const { moduleName, result, error } of extensionResults) {
277
+ if (error) continue;
152
278
 
153
- // Если расширение вернуло положительный результат
154
- if (extensionResult && extensionResult.allowed) {
279
+ if (result && result.allowed) {
155
280
  return {
156
281
  allowed: true,
157
282
  reason: `ALLOWED_BY_${moduleName.toUpperCase()}_EXTENSION`
@@ -159,7 +284,7 @@ class GlobalABAC {
159
284
  }
160
285
  }
161
286
 
162
- // Финальное решение на основе настроек
287
+ // 6. Финальное решение на основе настроек
163
288
  return {
164
289
  allowed: !this.options.defaultDeny,
165
290
  reason: this.options.defaultDeny ? 'ACCESS_DENIED' : 'ACCESS_ALLOWED'
@@ -269,6 +269,42 @@ class Validator {
269
269
  return this;
270
270
  }
271
271
 
272
+ /**
273
+ * Проверяет, что значение соответствует одному из указанных типов через уже существующие правила валидатора
274
+ * @param {string[]} types - Массив допустимых типов (например: ['string', 'number', 'null', 'array'])
275
+ * @param {string} [message] - Сообщение об ошибке
276
+ * @returns {Validator}
277
+ */
278
+ oneOfTypes(types, message) {
279
+ const validators = types.map(type => {
280
+ const schema = Validator.schema();
281
+ if (type === 'string') return schema.string();
282
+ if (type === 'number') return schema.number();
283
+ if (type === 'integer') return schema.integer();
284
+ if (type === 'boolean') return schema.boolean();
285
+ if (type === 'array') return schema.array();
286
+ if (type === 'object') return schema.object({});
287
+ if (type === 'date') return schema.date();
288
+ if (type === 'null') {
289
+ // Кастомный валидатор для null
290
+ return Validator.schema().custom(val => val === null, 'Значение должно быть null');
291
+ }
292
+ throw new Error(`Unsupported type in oneOfTypes: ${type}`);
293
+ });
294
+
295
+ this.rules.push({
296
+ type: 'oneOfTypes',
297
+ check: value => {
298
+ return validators.some(validator => validator.validate(value).isValid);
299
+ },
300
+ param: types,
301
+ message
302
+ });
303
+
304
+ return this;
305
+ }
306
+
307
+
272
308
  /**
273
309
  * Добавляет пользовательскую проверку
274
310
  * @param {function} fn - Функция проверки
@@ -412,6 +448,7 @@ class Validator {
412
448
  case 'pattern': return `${context}не соответствует требуемому формату`;
413
449
  case 'email': return `${context}должно быть корректным email-адресом`;
414
450
  case 'oneOf': return `${context}должно быть одним из: ${rule.param.join(', ')}`;
451
+ case 'oneOfTypes': return `${context}должно быть одного из типов: ${rule.param.join(', ')}`;
415
452
  case 'custom': return rule.param;
416
453
  case 'items': return `${context}содержит невалидные элементы`;
417
454
  case 'object': return `${context}не соответствует типу объекта`;
@@ -192,6 +192,8 @@ class Verifier {
192
192
  if (Object.keys(result.verificationErrors).length === 0) {
193
193
  result.verificationErrors = null;
194
194
  }
195
+
196
+ console.log('Verification result:', result)
195
197
 
196
198
  return result;
197
199
  }
@@ -1,12 +1,67 @@
1
1
  module.exports = function initializeDefaultPolicies(abacAccessControl) {
2
2
  // Политика личного владения ресурсом
3
+ abacAccessControl.registerGlobalPolicy('AdminModeratorAccessPolicy', async (context) => {
4
+ const { user, req } = context;
5
+
6
+ // Если пользователь не указан, политика не применяется
7
+ if (!user) {
8
+ return { allow: true, force: false };
9
+ }
10
+
11
+ try {
12
+ // Вариант 3: загружаем пользователя из базы данных
13
+ const userModel = abacAccessControl.db.user;
14
+ const userDoc = await userModel.findById(user).populate('roles');
15
+
16
+ if (userDoc && userDoc.roles) {
17
+ // Сохраняем документ пользователя в контексте для других политик
18
+ context.userDoc = userDoc;
19
+
20
+ // Извлекаем роли из документа
21
+ userRoles = userDoc.roles.map(role =>
22
+ typeof role === 'string' ? role : role.name || role
23
+ );
24
+ }
25
+
26
+ // Проверяем наличие ролей администратора или модератора
27
+ const isAdmin = userRoles.includes('admin');
28
+ const isModerator = userRoles.includes('moderator');
29
+
30
+
31
+ if (isAdmin || isModerator) {
32
+ // Возвращаем стопроцентный доступ
33
+ return {
34
+ allow: true,
35
+ force: true,
36
+ reason: isAdmin ? 'ADMIN_ACCESS_GRANTED' : 'MODERATOR_ACCESS_GRANTED'
37
+ };
38
+ }
39
+
40
+ // Для обычных пользователей не влияем на решение
41
+ return { allow: true, force: false };
42
+ } catch (error) {
43
+ console.error('Error in AdminModeratorPolicy:', error);
44
+ // При ошибке не блокируем доступ, продолжаем другие проверки
45
+ return { allow: true, force: false };
46
+ }
47
+ });
48
+
3
49
  abacAccessControl.registerGlobalPolicy('PersonalResourceOwnerPolicy', async (context) => {
4
50
  let { user, action, data, currentResource, options } = context;
5
51
  const ObjectId = abacAccessControl.db.mongoose.Types.ObjectId;
6
52
 
7
53
  // Для create операций с владением пользователя
8
- if (action === 'create' && data.owner.type === 'user') {
9
- return data.owner.target === user && data.creator.target === user;
54
+ if (action === 'create' && data.owner?.type === 'user') {
55
+ // Проверяем, что пользователь создает ресурс от своего имени
56
+ if (data.owner.target === user && data.creator.target === user) {
57
+ return { allow: true, force: false };
58
+ } else {
59
+ return {
60
+ allow: false,
61
+ force: false,
62
+ reason: 'UNAUTHORIZED_RESOURCE_CREATION'
63
+ };
64
+ }
10
65
  }
11
66
 
12
67
  if (action === 'read') {
@@ -14,7 +69,8 @@ module.exports = function initializeDefaultPolicies(abacAccessControl) {
14
69
  const allowedPublicStatuses = ['published', 'active', 'featured'];
15
70
 
16
71
  // Для неавторизованных пользователей или не владельцев
17
- if (!user || (currentResource && currentResource.creator && !currentResource.creator.target.equals(new ObjectId(user)))) {
72
+ if (!user || (currentResource && currentResource.creator &&
73
+ !currentResource.creator.target.equals(new ObjectId(user)))) {
18
74
 
19
75
  if (context.req && context.req.query) {
20
76
  // Если статус указан в запросе, проверяем его
@@ -24,13 +80,21 @@ module.exports = function initializeDefaultPolicies(abacAccessControl) {
24
80
  // Проверяем, что каждый статус из массива находится в списке разрешенных
25
81
  for (const queryStatus of context.req.query.status) {
26
82
  if (!allowedPublicStatuses.includes(queryStatus)) {
27
- return false;
83
+ return {
84
+ allow: false,
85
+ force: true, // Стопроцентный запрет для неразрешенных статусов
86
+ reason: 'UNAUTHORIZED_STATUS_ACCESS'
87
+ };
28
88
  }
29
89
  }
30
90
  } else {
31
91
  // Проверка одиночного статуса
32
92
  if (!allowedPublicStatuses.includes(context.req.query.status)) {
33
- return false;
93
+ return {
94
+ allow: false,
95
+ force: true, // Стопроцентный запрет для неразрешенных статусов
96
+ reason: 'UNAUTHORIZED_STATUS_ACCESS'
97
+ };
34
98
  }
35
99
  }
36
100
  }
@@ -38,82 +102,35 @@ module.exports = function initializeDefaultPolicies(abacAccessControl) {
38
102
 
39
103
  // Для единичного ресурса
40
104
  if (currentResource && !allowedPublicStatuses.includes(currentResource.status)) {
41
- return false;
105
+ return {
106
+ allow: false,
107
+ force: true, // Стопроцентный запрет для неразрешенных статусов
108
+ reason: 'UNAUTHORIZED_RESOURCE_ACCESS'
109
+ };
42
110
  }
43
111
  }
44
112
 
45
- return true;
113
+ // По умолчанию не влияем на решение для read
114
+ return { allow: true, force: false };
46
115
  }
116
+
47
117
  // Для update и delete операций
48
- if ((action === 'edit' || action === 'delete') && currentResource && currentResource.owner.type === 'user') {
49
- return currentResource.creator.target.equals(new ObjectId(user));
118
+ if ((action === 'edit' || action === 'delete') && currentResource && currentResource.owner?.type === 'user') {
119
+ // Проверяем владельца
120
+ if (currentResource.creator.target.equals(new ObjectId(user))) {
121
+ return { allow: true, force: false };
122
+ } else {
123
+ return {
124
+ allow: false,
125
+ force: false,
126
+ reason: 'NOT_RESOURCE_OWNER'
127
+ };
128
+ }
50
129
  }
51
- return true;
130
+
131
+ // По умолчанию не влияем на решение
132
+ return { allow: true, force: false };
52
133
  });
53
134
 
54
- // Политика публичного доступа к опубликованным ресурсам
55
- // abacAccessControl.registerGlobalPolicy('PublishedResourceAccessPolicy', async (context) => {
56
- // const { currentResource, action } = context;
57
-
58
- // // Разрешаем чтение опубликованных ресурсов
59
- // if (
60
- // action === 'read' &&
61
- // currentResource?.status === 'published'
62
- // ) {
63
- // return true;
64
- // }
65
-
66
- // return false;
67
- // });
68
-
69
- // Политика ограничения доступа для удаления
70
- // abacAccessControl.registerGlobalPolicy('DeleteRestrictionPolicy', async (context) => {
71
- // const { action, currentResource } = context;
72
-
73
- // // Запрещаем удаление ресурсов с определенным статусом
74
- // if (
75
- // action === 'delete' &&
76
- // currentResource?.status === 'in_use'
77
- // ) {
78
- // return false;
79
- // }
80
-
81
- // return true;
82
- // });
83
-
84
- // Политика проверки статуса пользователя
85
- // abacAccessControl.registerGlobalPolicy('UserStatusPolicy', async (context) => {
86
- // const { user, action } = context;
87
-
88
- // // Блокировка действий для заблокированных пользователей
89
- // if (user.status === 'blocked') {
90
- // // Разрешаем только чтение
91
- // return action === 'read';
92
- // }
93
-
94
- // return true;
95
- // });
96
-
97
- // // Политика ограничения по времени
98
- // abacAccessControl.registerGlobalPolicy('TimeBasedAccessPolicy', async (context) => {
99
- // const { action, currentResource } = context;
100
-
101
- // // Проверка времени создания ресурса
102
- // if (currentResource?.createdAt) {
103
- // const resourceAge = Date.now() - currentResource.createdAt.getTime();
104
- // const MAX_RESOURCE_AGE = 30 * 24 * 60 * 60 * 1000; // 30 дней
105
-
106
- // // Ограничение на изменение старых ресурсов
107
- // if (
108
- // ['edit', 'delete'].includes(action) &&
109
- // resourceAge > MAX_RESOURCE_AGE
110
- // ) {
111
- // return false;
112
- // }
113
- // }
114
-
115
- // return true;
116
- // });
117
-
118
135
  return abacAccessControl;
119
136
  };