@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.
- package/dist/auth.server.js +1 -1
- package/dist/auth.server.mjs +1 -1
- package/dist/community.server.js +3 -3
- package/dist/community.server.mjs +3 -3
- package/dist/credentials.schema-B-KD_ozQ.js +9 -0
- package/dist/credentials.schema-C9dmNy7o.mjs +10 -0
- package/dist/credentials.schema-CDZCKfEI.mjs +106 -0
- package/dist/credentials.schema-CfhPcsuI.js +105 -0
- package/dist/events.server.js +4 -15
- package/dist/events.server.mjs +3 -14
- package/dist/files.server.js +1 -1
- package/dist/files.server.mjs +1 -1
- package/dist/gallery.server.js +1 -1
- package/dist/gallery.server.mjs +1 -1
- package/dist/index-B6a1mPgp.mjs +217 -0
- package/dist/index-BCCiEK_u.js +216 -0
- package/dist/main-8N2Jmsuk.js +91 -0
- package/dist/main-CkeuHuCY.mjs +13619 -0
- package/dist/main.css +1 -1
- package/dist/metadata.schema-Cu_mPkjE.js +77 -0
- package/dist/metadata.schema-cbFgazeK.mjs +78 -0
- package/dist/middlewares.server.js +1 -1
- package/dist/middlewares.server.mjs +1 -1
- package/dist/node_modules/@googlemaps/js-api-loader/dist/index.cjs +1 -0
- package/dist/node_modules/@googlemaps/js-api-loader/dist/index.js +238 -0
- package/dist/orders.server.js +592 -0
- package/dist/orders.server.mjs +593 -0
- package/dist/organizations.server.js +295 -131
- package/dist/organizations.server.mjs +295 -131
- package/dist/products.server.js +2 -2
- package/dist/products.server.mjs +2 -2
- package/dist/profile.schema-24ZpZQJe.mjs +25 -0
- package/dist/profile.schema-CkOhhf37.js +24 -0
- package/dist/prometheus-framework/src/components/Address/Address.vue2.cjs +1 -1
- package/dist/prometheus-framework/src/components/Address/Address.vue2.js +33 -24
- package/dist/prometheus-framework/src/components/Block/Block.vue.cjs +1 -1
- package/dist/prometheus-framework/src/components/Block/Block.vue.js +23 -20
- package/dist/prometheus-framework/src/components/Button/Button.vue.cjs +1 -1
- package/dist/prometheus-framework/src/components/Button/Button.vue.js +1 -225
- package/dist/prometheus-framework/src/components/Button/Button.vue2.cjs +1 -1
- package/dist/prometheus-framework/src/components/Button/Button.vue2.js +102 -1
- package/dist/prometheus-framework/src/components/Feed/Feed.vue.cjs +1 -1
- package/dist/prometheus-framework/src/components/Feed/Feed.vue.js +71 -60
- package/dist/prometheus-framework/src/components/Field/Field.vue.cjs +1 -1
- package/dist/prometheus-framework/src/components/Field/Field.vue.js +1 -84
- package/dist/prometheus-framework/src/components/Field/Field.vue2.cjs +1 -1
- package/dist/prometheus-framework/src/components/Field/Field.vue2.js +84 -1
- package/dist/prometheus-framework/src/components/FieldBig/FieldBig.vue.cjs +1 -1
- package/dist/prometheus-framework/src/components/FieldBig/FieldBig.vue.js +1 -1
- package/dist/prometheus-framework/src/components/FieldPhone/FieldPhone.vue.cjs +1 -1
- package/dist/prometheus-framework/src/components/FieldPhone/FieldPhone.vue.js +325 -340
- package/dist/prometheus-framework/src/components/FieldPhone/FieldPhone2.vue.cjs +1 -1
- package/dist/prometheus-framework/src/components/FieldPhone/FieldPhone2.vue.js +2 -2
- package/dist/prometheus-framework/src/components/LocationMarker/LocationMarker.vue2.cjs +1 -1
- package/dist/prometheus-framework/src/components/LocationMarker/LocationMarker.vue2.js +53 -44
- package/dist/prometheus-framework/src/components/Popup/Popup.vue2.cjs +1 -1
- package/dist/prometheus-framework/src/components/Popup/Popup.vue2.js +41 -40
- package/dist/prometheus-framework/src/components/Select/Select.vue2.cjs +1 -1
- package/dist/prometheus-framework/src/components/Select/Select.vue2.js +37 -31
- package/dist/prometheus-framework/src/components/Slider/Slider.vue.cjs +1 -1
- package/dist/prometheus-framework/src/components/Slider/Slider.vue.js +18 -19
- package/dist/prometheus-framework/src/components/Tab/Tab.vue.cjs +1 -1
- package/dist/prometheus-framework/src/components/Tab/Tab.vue.js +1 -36
- package/dist/prometheus-framework/src/components/Tab/Tab.vue2.cjs +1 -1
- package/dist/prometheus-framework/src/components/Tab/Tab.vue2.js +36 -1
- package/dist/prometheus-framework/src/components/Tooltip/Tooltip.vue.cjs +1 -1
- package/dist/prometheus-framework/src/components/Tooltip/Tooltip.vue.js +45 -1
- package/dist/prometheus-framework/src/components/Tooltip/Tooltip.vue2.cjs +1 -1
- package/dist/prometheus-framework/src/components/Tooltip/Tooltip.vue2.js +1 -45
- package/dist/prometheus-framework/src/modules/auth/components/layouts/Auth.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/auth/components/layouts/Auth.vue.js +3 -3
- package/dist/prometheus-framework/src/modules/auth/components/pages/EnterCode.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/auth/components/pages/EnterCode.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/auth/components/pages/EnterPassword.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/auth/components/pages/EnterPassword.vue.js +3 -3
- package/dist/prometheus-framework/src/modules/auth/components/pages/Invite.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/auth/components/pages/Invite.vue.js +30 -30
- package/dist/prometheus-framework/src/modules/auth/components/pages/ResetPassword.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/auth/components/pages/ResetPassword.vue.js +3 -3
- package/dist/prometheus-framework/src/modules/auth/components/pages/SignIn.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/auth/components/pages/SignIn.vue.js +3 -3
- package/dist/prometheus-framework/src/modules/auth/components/pages/SignUp.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/auth/components/pages/SignUp.vue.js +3 -3
- package/dist/prometheus-framework/src/modules/auth/store/auth.cjs +1 -1
- package/dist/prometheus-framework/src/modules/auth/store/auth.js +26 -26
- package/dist/prometheus-framework/src/modules/backoffice/components/pages/Dashboard.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/backoffice/components/pages/Dashboard.vue.js +78 -103
- package/dist/prometheus-framework/src/modules/chats/components/blocks/ChatMessage.vue.cjs +1 -0
- package/dist/prometheus-framework/src/modules/chats/components/blocks/ChatMessage.vue.js +28 -0
- package/dist/prometheus-framework/src/modules/chats/components/pages/ChatPage.vue.cjs +1 -0
- package/dist/prometheus-framework/src/modules/chats/components/pages/ChatPage.vue.js +26 -0
- package/dist/prometheus-framework/src/modules/chats/components/pages/ChatPage.vue2.cjs +1 -0
- package/dist/prometheus-framework/src/modules/chats/components/pages/ChatPage.vue2.js +1 -0
- package/dist/prometheus-framework/src/modules/chats/components/sections/ChatWindow.vue.cjs +1 -0
- package/dist/prometheus-framework/src/modules/chats/components/sections/ChatWindow.vue.js +77 -0
- package/dist/prometheus-framework/src/modules/chats/components/sections/ChatWindow.vue2.cjs +1 -0
- package/dist/prometheus-framework/src/modules/chats/components/sections/ChatWindow.vue2.js +1 -0
- package/dist/prometheus-framework/src/modules/chats/store/chat.store.cjs +1 -0
- package/dist/prometheus-framework/src/modules/chats/store/chat.store.js +40 -0
- package/dist/prometheus-framework/src/modules/community/components/pages/Community.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/community/components/pages/Community.vue.js +2 -2
- package/dist/prometheus-framework/src/modules/community/components/pages/CreateBlogPost.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/community/components/pages/CreateBlogPost.vue.js +3 -3
- package/dist/prometheus-framework/src/modules/community/components/sections/HotPosts.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/community/components/sections/HotPosts.vue.js +15 -15
- package/dist/prometheus-framework/src/modules/constructor/components/elements/Embed.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/constructor/components/elements/Embed.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/constructor/components/elements/Textarea.vue.cjs +1 -5
- package/dist/prometheus-framework/src/modules/constructor/components/elements/Textarea.vue.js +0 -66
- package/dist/prometheus-framework/src/modules/constructor/components/elements/Textarea.vue2.cjs +5 -1
- package/dist/prometheus-framework/src/modules/constructor/components/elements/Textarea.vue2.js +66 -0
- package/dist/prometheus-framework/src/modules/constructor/components/sections/Constructor.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/constructor/components/sections/Constructor.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/events/components/blocks/CardEvent.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/events/components/blocks/CardEvent.vue.js +4 -4
- package/dist/prometheus-framework/src/modules/events/components/elements/ButtonCheck.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/events/components/elements/ButtonCheck.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/events/components/elements/ButtonJoin.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/events/components/elements/ButtonJoin.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/events/components/pages/EditEvent.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/events/components/pages/EditEvent.vue.js +3 -3
- package/dist/prometheus-framework/src/modules/events/components/pages/EditEventTickets.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/events/components/pages/EditEventTickets.vue.js +2 -2
- package/dist/prometheus-framework/src/modules/events/components/pages/Events.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/events/components/pages/Events.vue.js +29 -27
- package/dist/prometheus-framework/src/modules/gallery/components/sections/BackofficeGallery.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/gallery/components/sections/BackofficeGallery.vue.js +2 -2
- package/dist/prometheus-framework/src/modules/gallery/components/sections/GalleryWithCategories.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/gallery/components/sections/GalleryWithCategories.vue.js +2 -2
- package/dist/prometheus-framework/src/modules/globals/components/blocks/BlockSearch.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/globals/components/blocks/BlockSearch.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/globals/components/blocks/CardHeader.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/globals/components/blocks/CardHeader.vue.js +2 -2
- package/dist/prometheus-framework/src/modules/globals/components/sections/SectionPageTitle.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/globals/components/sections/SectionPageTitle.vue.js +33 -26
- package/dist/prometheus-framework/src/modules/globals/localization/vue-i18n.cjs +1 -1
- package/dist/prometheus-framework/src/modules/globals/localization/vue-i18n.js +6 -3
- package/dist/prometheus-framework/src/modules/globals/services/globals.store.cjs +1 -0
- package/dist/prometheus-framework/src/modules/globals/services/globals.store.js +70 -0
- package/dist/prometheus-framework/src/modules/icons/entities/IconGallery.vue.cjs +1 -0
- package/dist/prometheus-framework/src/modules/icons/entities/IconGallery.vue.js +28 -0
- package/dist/prometheus-framework/src/modules/icons/entities/IconLeftovers.vue.cjs +1 -0
- package/dist/prometheus-framework/src/modules/icons/entities/IconLeftovers.vue.js +30 -0
- package/dist/prometheus-framework/src/modules/icons/entities/IconOrders.vue.cjs +1 -0
- package/dist/prometheus-framework/src/modules/icons/entities/IconOrders.vue.js +35 -0
- package/dist/prometheus-framework/src/modules/icons/entities/IconProducts.vue.cjs +1 -0
- package/dist/prometheus-framework/src/modules/icons/entities/IconProducts.vue.js +28 -0
- package/dist/prometheus-framework/src/modules/icons/navigation/IconCheckmark.vue.cjs +1 -0
- package/dist/prometheus-framework/src/modules/icons/navigation/IconCheckmark.vue.js +29 -0
- package/dist/prometheus-framework/src/modules/icons/placeholders/PlaceholderChat.vue.cjs +1 -0
- package/dist/prometheus-framework/src/modules/icons/placeholders/PlaceholderChat.vue.js +30 -0
- package/dist/prometheus-framework/src/modules/landing/components/sections/MobileApp.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/landing/components/sections/MobileApp.vue.js +63 -86
- package/dist/prometheus-framework/src/modules/legal/components/pages/Legal.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/legal/components/pages/Legal.vue.js +2 -2
- package/dist/prometheus-framework/src/modules/orders/components/blocks/CardOrder.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/orders/components/blocks/CardOrder.vue.js +121 -1
- package/dist/prometheus-framework/src/modules/orders/components/blocks/CardOrder.vue2.cjs +1 -0
- package/dist/prometheus-framework/src/modules/orders/components/blocks/CardOrder.vue2.js +1 -0
- package/dist/prometheus-framework/src/modules/orders/components/blocks/StatusHistory.vue.cjs +3 -0
- package/dist/prometheus-framework/src/modules/orders/components/blocks/StatusHistory.vue.js +92 -0
- package/dist/prometheus-framework/src/modules/orders/components/pages/Order.vue.cjs +1 -0
- package/dist/prometheus-framework/src/modules/orders/components/pages/Order.vue.js +202 -0
- package/dist/prometheus-framework/src/modules/orders/components/pages/Order.vue2.cjs +1 -0
- package/dist/prometheus-framework/src/modules/orders/components/pages/Order.vue2.js +1 -0
- package/dist/prometheus-framework/src/modules/orders/components/pages/OrderCreate.vue.cjs +1 -0
- package/dist/prometheus-framework/src/modules/orders/components/pages/OrderCreate.vue.js +127 -0
- package/dist/prometheus-framework/src/modules/orders/components/pages/OrderCreate.vue2.cjs +1 -0
- package/dist/prometheus-framework/src/modules/orders/components/pages/OrderCreate.vue2.js +1 -0
- package/dist/prometheus-framework/src/modules/orders/components/pages/OrderCreateBackoffice.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/orders/components/pages/OrderCreateBackoffice.vue.js +174 -114
- package/dist/prometheus-framework/src/modules/orders/components/pages/Orders.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/orders/components/pages/Orders.vue.js +41 -41
- package/dist/prometheus-framework/src/modules/orders/components/partials/ShopCart.vue.cjs +1 -0
- package/dist/prometheus-framework/src/modules/orders/components/partials/ShopCart.vue.js +89 -0
- package/dist/prometheus-framework/src/modules/orders/components/partials/ShopCart.vue2.cjs +1 -0
- package/dist/prometheus-framework/src/modules/orders/components/partials/ShopCart.vue2.js +1 -0
- package/dist/prometheus-framework/src/modules/orders/components/sections/AskToLogin.vue.cjs +1 -0
- package/dist/prometheus-framework/src/modules/orders/components/sections/AskToLogin.vue.js +24 -0
- package/dist/prometheus-framework/src/modules/orders/components/sections/EmptyState.vue.cjs +1 -0
- package/dist/prometheus-framework/src/modules/orders/components/sections/EmptyState.vue.js +13 -0
- package/dist/prometheus-framework/src/modules/orders/components/sections/FormAddCustomer.vue.cjs +1 -0
- package/dist/prometheus-framework/src/modules/orders/components/sections/FormAddCustomer.vue.js +141 -0
- package/dist/prometheus-framework/src/modules/orders/components/sections/FormClientDetails.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/orders/components/sections/FormClientDetails.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/orders/components/sections/FormCustomerDetails.vue.cjs +1 -0
- package/dist/prometheus-framework/src/modules/orders/components/sections/FormCustomerDetails.vue.js +77 -0
- package/dist/prometheus-framework/src/modules/orders/components/sections/FormDelivery.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/orders/components/sections/FormDelivery.vue.js +46 -35
- package/dist/prometheus-framework/src/modules/orders/components/sections/Succes.vue.cjs +1 -0
- package/dist/prometheus-framework/src/modules/orders/components/sections/Succes.vue.js +25 -0
- package/dist/prometheus-framework/src/modules/orders/orders.client.cjs +1 -0
- package/dist/prometheus-framework/src/modules/orders/orders.client.js +56 -0
- package/dist/prometheus-framework/src/modules/orders/router/orders.router.cjs +1 -0
- package/dist/prometheus-framework/src/modules/orders/router/orders.router.js +58 -0
- package/dist/prometheus-framework/src/modules/orders/store/customers.store.cjs +1 -0
- package/dist/prometheus-framework/src/modules/orders/store/customers.store.js +5 -0
- package/dist/prometheus-framework/src/modules/orders/store/models/customer.cjs +1 -0
- package/dist/prometheus-framework/src/modules/orders/store/models/customer.js +30 -0
- package/dist/prometheus-framework/src/modules/orders/store/orders.cjs +1 -1
- package/dist/prometheus-framework/src/modules/orders/store/orders.js +24 -25
- package/dist/prometheus-framework/src/modules/orders/store/shopcart.cjs +1 -1
- package/dist/prometheus-framework/src/modules/orders/store/shopcart.js +5 -1
- package/dist/prometheus-framework/src/modules/organizations/components/blocks/CardDepartment.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/blocks/CardDepartment.vue.js +16 -16
- package/dist/prometheus-framework/src/modules/organizations/components/blocks/CardOrganization.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/blocks/CardOrganization.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/blocks/DepartmentMemberModify.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/blocks/DepartmentMemberModify.vue.js +38 -49
- package/dist/prometheus-framework/src/modules/organizations/components/elements/ButtonToggleMembership.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/elements/ButtonToggleMembership.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/pages/Department.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/pages/Department.vue.js +6 -6
- package/dist/prometheus-framework/src/modules/organizations/components/pages/DepartmentEdit.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/pages/DepartmentEdit.vue.js +161 -138
- package/dist/prometheus-framework/src/modules/organizations/components/pages/Members.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/pages/Members.vue.js +198 -78
- package/dist/prometheus-framework/src/modules/organizations/components/pages/Organization.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/pages/Organization.vue.js +82 -125
- package/dist/prometheus-framework/src/modules/organizations/components/pages/OrganizationEdit.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/pages/OrganizationEdit.vue.js +3 -3
- package/dist/prometheus-framework/src/modules/organizations/components/pages/Organizations.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/pages/Organizations.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/sections/Documents.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/sections/Documents.vue.js +2 -2
- package/dist/prometheus-framework/src/modules/organizations/components/sections/MembersAdd.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/sections/MembersAdd.vue.js +59 -70
- package/dist/prometheus-framework/src/modules/organizations/components/sections/Organizations.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/sections/Organizations.vue.js +3 -3
- package/dist/prometheus-framework/src/modules/organizations/organizations.client.cjs +1 -1
- package/dist/prometheus-framework/src/modules/organizations/organizations.client.js +34 -36
- package/dist/prometheus-framework/src/modules/organizations/store/departments.cjs +1 -1
- package/dist/prometheus-framework/src/modules/organizations/store/departments.js +38 -18
- package/dist/prometheus-framework/src/modules/organizations/store/invites.cjs +1 -1
- package/dist/prometheus-framework/src/modules/organizations/store/invites.js +34 -35
- package/dist/prometheus-framework/src/modules/products/components/blocks/CardPosition.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/products/components/blocks/CardPosition.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/products/components/blocks/CardProduct.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/products/components/blocks/CardProduct.vue.js +41 -21
- package/dist/prometheus-framework/src/modules/products/components/blocks/LeftoverPositions.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/products/components/blocks/LeftoverPositions.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/products/components/blocks/ListPositions.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/products/components/blocks/ListPositions.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/products/components/pages/Categories.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/products/components/pages/Categories.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/products/components/pages/CategoryEdit.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/products/components/pages/CategoryEdit.vue.js +2 -2
- package/dist/prometheus-framework/src/modules/products/components/pages/EditLeftover.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/products/components/pages/EditLeftover.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/products/components/pages/Leftovers.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/products/components/pages/Leftovers.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/products/components/pages/ProductEdit.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/products/components/pages/ProductEdit.vue.js +3 -3
- package/dist/prometheus-framework/src/modules/products/components/pages/Products.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/products/components/pages/Products.vue.js +3 -3
- package/dist/prometheus-framework/src/modules/products/components/sections/EditModifications.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/products/components/sections/EditModifications.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/products/components/sections/EditProductInfo.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/products/components/sections/EditProductInfo.vue.js +2 -2
- package/dist/prometheus-framework/src/modules/products/components/sections/SectionProduct.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/products/components/sections/SectionProduct.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/reports/components/sections/FormReport.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/reports/components/sections/FormReport.vue.js +24 -26
- package/dist/prometheus-framework/src/modules/users/components/blocks/CardUser.vue.cjs +1 -0
- package/dist/prometheus-framework/src/modules/users/components/blocks/CardUser.vue.js +78 -0
- package/dist/prometheus-framework/src/modules/users/components/pages/Profile.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/users/components/pages/Profile.vue.js +2 -2
- package/dist/prometheus-framework/src/modules/users/components/pages/ProfileBlogposts.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/users/components/pages/ProfileBlogposts.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/users/components/pages/ProfileEdit.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/users/components/pages/ProfileEdit.vue.js +3 -3
- package/dist/prometheus-framework/src/modules/users/components/pages/ProfileEvents.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/users/components/pages/ProfileEvents.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/users/store/users.cjs +1 -1
- package/dist/prometheus-framework/src/modules/users/store/users.js +13 -14
- package/dist/prometheus-framework/src/modules/wallet/views/components/pages/Wallet.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/wallet/views/components/pages/Wallet.vue.js +2 -2
- package/dist/prometheus-framework.cjs.js +1 -1
- package/dist/prometheus-framework.es.js +1 -1
- package/dist/queryProcessor-BJdKh0Ow.mjs +162 -0
- package/dist/queryProcessor-DRMo_GWK.js +161 -0
- package/dist/reports.server.js +1 -1
- package/dist/reports.server.mjs +1 -1
- package/dist/style.css +1 -1
- package/dist/users.server.js +58 -47
- package/dist/users.server.mjs +58 -47
- package/dist/wallet.server.js +2 -2
- package/dist/wallet.server.mjs +2 -2
- package/dist/web-CtVocufd.js +1 -0
- package/dist/web-DNq1tHCE.mjs +54 -0
- package/package.json +1 -1
- package/src/components/Address/Address.vue +13 -2
- package/src/components/Block/Block.vue +3 -2
- package/src/components/Button/Button.vue +9 -12
- package/src/components/Feed/Feed.vue +28 -6
- package/src/components/FieldPhone/FieldPhone.vue +592 -558
- package/src/components/LocationMarker/LocationMarker.vue +26 -22
- package/src/components/Popup/Popup.vue +22 -23
- package/src/components/Select/Select.vue +43 -32
- package/src/components/Slider/Slider.vue +3 -4
- package/src/modules/auth/components/pages/Invite.vue +7 -7
- package/src/modules/auth/store/auth.js +1 -1
- package/src/modules/backoffice/components/pages/Dashboard.vue +44 -29
- package/src/modules/chats/components/blocks/ChatMessage.vue +1 -1
- package/src/modules/community/components/sections/HotPosts.vue +1 -1
- package/src/modules/events/components/blocks/CardEvent.vue +4 -3
- package/src/modules/events/components/pages/Events.vue +23 -6
- package/src/modules/globals/components/sections/SectionPageTitle.vue +19 -7
- package/src/modules/globals/controllers/utils/queryProcessor.js +21 -7
- package/src/modules/globals/localization/vue-i18n.js +3 -0
- package/src/modules/globals/models/credentials.schema.js +7 -0
- package/src/modules/globals/models/metadata.schema.js +17 -0
- package/src/modules/globals/models/profile.schema.js +23 -0
- package/src/modules/globals/models/socials.schema.js +22 -0
- package/src/modules/globals/router/routerGuards.js +1 -0
- package/src/modules/globals/services/globals.cashe.js +26 -0
- package/src/modules/globals/services/globals.crud.js +115 -0
- package/src/modules/globals/services/globals.logger.js +41 -0
- package/src/modules/globals/services/globals.store.js +114 -0
- package/src/modules/icons/entities/IconGallery.vue +14 -0
- package/src/modules/icons/entities/IconLeftovers.vue +14 -0
- package/src/modules/icons/entities/IconOrders.vue +15 -0
- package/src/modules/icons/entities/IconProducts.vue +14 -0
- package/src/modules/landing/components/sections/HeroSection.vue +1 -1
- package/src/modules/landing/components/sections/MobileApp.vue +4 -4
- package/src/modules/landing/router/landing.js +1 -1
- package/src/modules/marketplace/components/sections/Filters.vue +3 -3
- package/src/modules/middlewares/server/accessors/AccessController.js +33 -0
- package/src/modules/middlewares/server/accessors/ReadDepartments.js +101 -0
- package/src/modules/middlewares/server/verifyAccesses.js +33 -0
- package/src/modules/middlewares/server/verifyInvites.js +4 -4
- package/src/modules/orders/components/pages/OrderCreate.vue +2 -2
- package/src/modules/orders/components/pages/OrderCreateBackoffice.vue +105 -68
- package/src/modules/orders/components/pages/Orders.vue +2 -2
- package/src/modules/orders/components/sections/FormAddCustomer.vue +152 -0
- package/src/modules/orders/components/sections/FormCustomerDetails.vue +67 -0
- package/src/modules/orders/components/sections/FormDelivery.vue +17 -3
- package/src/modules/orders/controllers/applications.controller.js +2 -0
- package/src/modules/orders/controllers/orders.controller.js +77 -52
- package/src/modules/orders/models/application.model.js +25 -25
- package/src/modules/orders/models/customer.model.js +54 -18
- package/src/modules/orders/models/order.model.js +1 -1
- package/src/modules/orders/models/testimonial.model.js +22 -23
- package/src/modules/orders/orders.client.js +51 -51
- package/src/modules/orders/orders.server.js +36 -12
- package/src/modules/orders/router/orders.router.js +36 -41
- package/src/modules/orders/routes/orders.routes.js +3 -21
- package/src/modules/orders/store/customers.store.js +5 -0
- package/src/modules/orders/store/models/customer.js +29 -0
- package/src/modules/orders/store/orders.js +14 -20
- package/src/modules/organizations/components/blocks/CardDepartment.vue +3 -3
- package/src/modules/organizations/components/blocks/CardOrganization.vue +1 -1
- package/src/modules/organizations/components/blocks/DepartmentMemberModify.vue +1 -12
- package/src/modules/organizations/components/pages/Department.vue +1 -1
- package/src/modules/organizations/components/pages/DepartmentEdit.vue +72 -48
- package/src/modules/organizations/components/pages/Members.vue +178 -64
- package/src/modules/organizations/components/pages/Organization.vue +1 -41
- package/src/modules/organizations/components/sections/MembersAdd.vue +44 -52
- package/src/modules/organizations/controllers/departments.controller.js +2 -4
- package/src/modules/organizations/controllers/invites.controller.js +24 -23
- package/src/modules/organizations/controllers/organizations.controller.js +1 -1
- package/src/modules/organizations/models/department.model.js +52 -2
- package/src/modules/organizations/models/invite.model.js +29 -32
- package/src/modules/organizations/models/membership.model.js +2 -0
- package/src/modules/organizations/models/organization.model.js +2 -1
- package/src/modules/organizations/organizations.client.js +0 -2
- package/src/modules/organizations/routes/departments.routes.js +18 -7
- package/src/modules/organizations/routes/invites.routes.js +2 -2
- package/src/modules/organizations/store/departments.js +22 -1
- package/src/modules/organizations/store/invites.js +74 -90
- package/src/modules/products/components/blocks/CardProduct.vue +24 -0
- package/src/modules/products/components/pages/Products.vue +1 -1
- package/src/modules/reports/components/sections/FormReport.vue +40 -40
- package/src/modules/spots/components/pages/Spot.vue +1 -1
- package/src/modules/spots/components/pages/SpotEdit.vue +1 -1
- package/src/modules/users/components/blocks/CardUser.vue +85 -0
- package/src/modules/users/controllers/users.controller.js +36 -13
- package/src/modules/users/middlewares/visitor.logger.js +66 -0
- package/src/modules/users/models/request.model.js +18 -0
- package/src/modules/users/models/user.model.js +26 -55
- package/src/modules/users/models/visitor.model.js +14 -0
- package/src/modules/users/store/users.js +2 -11
- package/src/modules/wallet/controllers/routes/payments.routes.js +2 -0
- package/src/components/FieldPhone/FieldPhone(script-setup).vue +0 -1646
- package/src/components/FieldPhone/FieldPhone2.vue +0 -671
- package/src/modules/orders/components/sections/FormClientDetails.vue +0 -61
- package/src/modules/organizations/components/blocks/User.vue +0 -69
- /package/src/modules/backoffice/components/admin/{User.vue → UserEdit.vue} +0 -0
@@ -8,24 +8,25 @@ const require$$0 = require("mongoose");
|
|
8
8
|
const require$$5 = require("@googlemaps/google-maps-services-js");
|
9
9
|
const addMembersQuantity$1 = require("./addMembersQuantity-B8UgqlUM.js");
|
10
10
|
const mailing = require("./mailing-BX0q8DIs.js");
|
11
|
-
const index = require("./index-
|
11
|
+
const index = require("./index-BCCiEK_u.js");
|
12
12
|
const require$$0$2 = require("mongodb");
|
13
|
+
const ownership_schema = require("./ownership.schema-DN0SlQL6.js");
|
14
|
+
const credentials_schema = require("./credentials.schema-B-KD_ozQ.js");
|
13
15
|
const controllerFactory$6 = (db) => {
|
14
16
|
const Department = db.department;
|
15
|
-
const readOne = (req,
|
17
|
+
const readOne = (req, res2) => {
|
16
18
|
Department.findOne({ _id: req.params._id }).populate("members.user").populate("subdepartments").then((department) => {
|
17
19
|
if (!department) {
|
18
|
-
return
|
20
|
+
return res2.status(404).send({ message: "Отдел не найден" });
|
19
21
|
}
|
20
|
-
|
22
|
+
res2.send(department);
|
21
23
|
}).catch((err) => {
|
22
|
-
|
24
|
+
res2.status(500).send({ message: err.message });
|
23
25
|
});
|
24
26
|
};
|
25
|
-
const read = (req,
|
27
|
+
const read = (req, res2) => {
|
26
28
|
let query = {};
|
27
29
|
let options = {};
|
28
|
-
console.log(req.query);
|
29
30
|
if (req.query.organization) {
|
30
31
|
query.organization = new db.mongoose.Types.ObjectId(req.query.organization);
|
31
32
|
}
|
@@ -34,43 +35,43 @@ const controllerFactory$6 = (db) => {
|
|
34
35
|
}
|
35
36
|
Department.find(query, null, options).populate("members.user").populate("subdepartments").then((departments) => {
|
36
37
|
if (!departments) {
|
37
|
-
return
|
38
|
+
return res2.status(404).send({ message: "Departments not found" });
|
38
39
|
}
|
39
|
-
|
40
|
+
res2.send(departments);
|
40
41
|
}).catch((err) => {
|
41
|
-
|
42
|
+
res2.status(500).send({ message: err.message });
|
42
43
|
});
|
43
44
|
};
|
44
|
-
const create = async (req,
|
45
|
+
const create = async (req, res2) => {
|
45
46
|
try {
|
46
47
|
const newDepartment = new Department({
|
47
48
|
...req.body,
|
48
49
|
organization: req.params._id
|
49
50
|
});
|
50
51
|
const data = await newDepartment.save();
|
51
|
-
|
52
|
+
res2.send(data);
|
52
53
|
} catch (err) {
|
53
|
-
|
54
|
+
res2.status(500).send({ message: err.message });
|
54
55
|
}
|
55
56
|
};
|
56
|
-
const update = (req,
|
57
|
+
const update = (req, res2) => {
|
57
58
|
Department.findOneAndUpdate({ _id: req.body._id }, req.body, { new: true }).then((department) => {
|
58
59
|
if (!department) {
|
59
|
-
return
|
60
|
+
return res2.status(404).send({ message: "Department not found" });
|
60
61
|
}
|
61
|
-
|
62
|
+
res2.send(department);
|
62
63
|
}).catch((err) => {
|
63
|
-
|
64
|
+
res2.status(500).send({ message: err.message });
|
64
65
|
});
|
65
66
|
};
|
66
|
-
const deleteDepartment = (req,
|
67
|
+
const deleteDepartment = (req, res2) => {
|
67
68
|
Department.findOneAndRemove({ _id: req.body._id, organization: req.params._id }).then((department) => {
|
68
69
|
if (!department) {
|
69
|
-
return
|
70
|
+
return res2.status(404).send({ message: "Department not found" });
|
70
71
|
}
|
71
|
-
|
72
|
+
res2.send({ message: "Department deleted successfully" });
|
72
73
|
}).catch((err) => {
|
73
|
-
|
74
|
+
res2.status(500).send({ message: err.message });
|
74
75
|
});
|
75
76
|
};
|
76
77
|
return {
|
@@ -93,7 +94,7 @@ const controllerFactory$5 = (db) => {
|
|
93
94
|
const Membership = db.membership;
|
94
95
|
db.user;
|
95
96
|
db.role;
|
96
|
-
const read = async (req,
|
97
|
+
const read = async (req, res2) => {
|
97
98
|
const Organization2 = db.organization;
|
98
99
|
db.membership;
|
99
100
|
db.user;
|
@@ -161,11 +162,11 @@ const controllerFactory$5 = (db) => {
|
|
161
162
|
];
|
162
163
|
console.log(userLocation);
|
163
164
|
} else {
|
164
|
-
return
|
165
|
+
return res2.status(400).send({ message: "Unable to geocode the provided location." });
|
165
166
|
}
|
166
167
|
} catch (err) {
|
167
168
|
console.log(err);
|
168
|
-
return
|
169
|
+
return res2.status(500).send({ message: "Error occurred while geocoding." });
|
169
170
|
}
|
170
171
|
const radius = city ? 500 : state ? 1e3 : 5e3;
|
171
172
|
matchConditions.push({
|
@@ -351,13 +352,13 @@ const controllerFactory$5 = (db) => {
|
|
351
352
|
console.log(stages);
|
352
353
|
const organizations = await Organization2.aggregate(stages);
|
353
354
|
console.log(organizations);
|
354
|
-
|
355
|
+
res2.status(200).send(organizations);
|
355
356
|
} catch (err) {
|
356
357
|
console.log(err);
|
357
|
-
return
|
358
|
+
return res2.status(500).send({ message: err });
|
358
359
|
}
|
359
360
|
};
|
360
|
-
const fetch = async (req,
|
361
|
+
const fetch = async (req, res2) => {
|
361
362
|
const Organization2 = db.organization;
|
362
363
|
let query = {};
|
363
364
|
console.log(req.query);
|
@@ -376,14 +377,14 @@ const controllerFactory$5 = (db) => {
|
|
376
377
|
try {
|
377
378
|
const organizations = await Organization2.find(query, null, options);
|
378
379
|
if (!organizations || organizations.length === 0) {
|
379
|
-
return
|
380
|
+
return res2.status(404).send({ message: "Organizations not found." });
|
380
381
|
}
|
381
|
-
|
382
|
+
res2.status(200).send(organizations);
|
382
383
|
} catch (err) {
|
383
|
-
return
|
384
|
+
return res2.status(500).send({ message: err });
|
384
385
|
}
|
385
386
|
};
|
386
|
-
const create = async (req,
|
387
|
+
const create = async (req, res2) => {
|
387
388
|
if (req.body._id === null) {
|
388
389
|
delete req.body._id;
|
389
390
|
}
|
@@ -397,13 +398,13 @@ const controllerFactory$5 = (db) => {
|
|
397
398
|
role: "owner"
|
398
399
|
});
|
399
400
|
const savedMembership = await membership.save();
|
400
|
-
|
401
|
+
res2.status(201).json(savedOrganization);
|
401
402
|
} catch (error) {
|
402
403
|
console.error("Error:", error);
|
403
|
-
|
404
|
+
res2.status(500).send(error);
|
404
405
|
}
|
405
406
|
};
|
406
|
-
const update = async (req,
|
407
|
+
const update = async (req, res2) => {
|
407
408
|
try {
|
408
409
|
const organizationId = req.params._id;
|
409
410
|
const updatedData = req.body;
|
@@ -412,17 +413,17 @@ const controllerFactory$5 = (db) => {
|
|
412
413
|
runValidators: true
|
413
414
|
});
|
414
415
|
if (!organization) {
|
415
|
-
return
|
416
|
+
return res2.status(404).json({ message: "Organization not found" });
|
416
417
|
}
|
417
|
-
|
418
|
+
res2.status(200).json({ message: "Organization updated successfully", organization });
|
418
419
|
} catch (error) {
|
419
|
-
|
420
|
+
res2.status(500).json({ error: error.message });
|
420
421
|
}
|
421
422
|
};
|
422
|
-
const deleteOrganization = async (req,
|
423
|
+
const deleteOrganization = async (req, res2) => {
|
423
424
|
Organization.findOneAndRemove({ _id: req.params._id }).then((organization) => {
|
424
425
|
if (!organization) {
|
425
|
-
return
|
426
|
+
return res2.status(404).send({ message: "Organization not found" });
|
426
427
|
}
|
427
428
|
Membership.deleteMany({ organization: req.params._id }).then(() => {
|
428
429
|
const newToken = jwt.sign({
|
@@ -432,12 +433,12 @@ const controllerFactory$5 = (db) => {
|
|
432
433
|
expiresIn: 86400
|
433
434
|
// 24 hours
|
434
435
|
});
|
435
|
-
|
436
|
+
res2.send({ newToken });
|
436
437
|
}).catch((err) => {
|
437
|
-
|
438
|
+
res2.status(500).send({ message: "Error deleting memberships: " + err.message });
|
438
439
|
});
|
439
440
|
}).catch((err) => {
|
440
|
-
|
441
|
+
res2.status(500).send({ message: err.message });
|
441
442
|
});
|
442
443
|
};
|
443
444
|
return {
|
@@ -453,7 +454,7 @@ var organizations_controller = controllerFactory$5;
|
|
453
454
|
const ObjectId$1 = require$$0.Types.ObjectId;
|
454
455
|
const controllerFactory$4 = (db) => {
|
455
456
|
const Membership = db.membership;
|
456
|
-
const read = async (req,
|
457
|
+
const read = async (req, res2) => {
|
457
458
|
try {
|
458
459
|
const memberships = await Membership.aggregate([
|
459
460
|
{
|
@@ -477,15 +478,15 @@ const controllerFactory$4 = (db) => {
|
|
477
478
|
}
|
478
479
|
]);
|
479
480
|
if (!memberships || memberships.length === 0) {
|
480
|
-
return
|
481
|
+
return res2.status(404).send({ errorCode: "MEMBERSHIPS_NOT_FOUND" });
|
481
482
|
}
|
482
|
-
|
483
|
+
res2.send(memberships);
|
483
484
|
} catch (err) {
|
484
485
|
console.log(err);
|
485
|
-
|
486
|
+
res2.status(500).send({ errorCode: "SERVER_ERROR" });
|
486
487
|
}
|
487
488
|
};
|
488
|
-
const create = async (req,
|
489
|
+
const create = async (req, res2) => {
|
489
490
|
console.log(req.body);
|
490
491
|
const newMembership = new Membership({
|
491
492
|
user: req.body.user,
|
@@ -495,35 +496,35 @@ const controllerFactory$4 = (db) => {
|
|
495
496
|
});
|
496
497
|
try {
|
497
498
|
const data = await newMembership.save();
|
498
|
-
|
499
|
+
res2.send(data);
|
499
500
|
} catch (err) {
|
500
|
-
|
501
|
+
res2.status(500).send({ errorCode: "SERVER_ERROR" });
|
501
502
|
}
|
502
503
|
};
|
503
|
-
const update = async (req,
|
504
|
+
const update = async (req, res2) => {
|
504
505
|
try {
|
505
506
|
const membership = await Membership.findByIdAndUpdate(req.body._id, req.body, { new: true });
|
506
507
|
if (!membership) {
|
507
|
-
return
|
508
|
+
return res2.status(404).send({ errorCode: "MEMBERSHIP_NOT_FOUND" });
|
508
509
|
}
|
509
|
-
|
510
|
+
res2.send(membership);
|
510
511
|
} catch (err) {
|
511
|
-
|
512
|
+
res2.status(500).send({ errorCode: "SERVER_ERROR" });
|
512
513
|
}
|
513
514
|
};
|
514
|
-
const deleteMembership = async (req,
|
515
|
+
const deleteMembership = async (req, res2) => {
|
515
516
|
console.log(req.body);
|
516
517
|
try {
|
517
518
|
const membership = await Membership.findOneAndDelete({ _id: new ObjectId$1(req.body._id) });
|
518
519
|
if (!membership) {
|
519
|
-
return
|
520
|
+
return res2.status(404).send({ errorCode: "MEMBERSHIP_NOT_FOUND" });
|
520
521
|
} else {
|
521
522
|
await Membership.deleteOne({ _id: membership._id });
|
522
|
-
|
523
|
+
res2.status(200).send(membership);
|
523
524
|
}
|
524
525
|
} catch (error) {
|
525
526
|
console.log(error);
|
526
|
-
|
527
|
+
res2.status(500).send({ errorCode: "SERVER_ERROR" });
|
527
528
|
}
|
528
529
|
};
|
529
530
|
return {
|
@@ -540,34 +541,34 @@ const сontrollerFactory = (db) => {
|
|
540
541
|
const User = db.user;
|
541
542
|
const Invite = db.invite;
|
542
543
|
const Membership = db.membership;
|
543
|
-
const getOneByCode = async (req,
|
544
|
+
const getOneByCode = async (req, res2) => {
|
544
545
|
try {
|
545
546
|
const invite = await Invite.findOne({ code: req.params._id });
|
546
547
|
if (!invite) {
|
547
|
-
return
|
548
|
+
return res2.status(404).send({ message: "Приглашение не найдено" });
|
548
549
|
}
|
549
|
-
|
550
|
+
res2.send(invite);
|
550
551
|
} catch (err) {
|
551
|
-
|
552
|
+
res2.status(500).send({ message: err.message });
|
552
553
|
}
|
553
554
|
};
|
554
|
-
const read = async (req,
|
555
|
+
const read = async (req, res2) => {
|
555
556
|
try {
|
556
|
-
const invites = await Invite.find({
|
557
|
-
if (!invites) {
|
558
|
-
return
|
557
|
+
const invites = await Invite.find({ "owner.target": req.params._id });
|
558
|
+
if (!invites || invites.length === 0) {
|
559
|
+
return res2.status(200).send([]);
|
559
560
|
}
|
560
|
-
|
561
|
+
res2.send(invites);
|
561
562
|
} catch (err) {
|
562
|
-
|
563
|
+
res2.status(500).send({ message: err.message });
|
563
564
|
}
|
564
565
|
};
|
565
|
-
const create = async (req,
|
566
|
-
const
|
567
|
-
const
|
566
|
+
const create = async (req, res2) => {
|
567
|
+
const creator = req.body.creator;
|
568
|
+
const owner = req.body.owner;
|
569
|
+
const list = req.body.invites;
|
568
570
|
try {
|
569
|
-
|
570
|
-
for (let invite of invites) {
|
571
|
+
for (let invite of list) {
|
571
572
|
let user2 = null;
|
572
573
|
if (invite.contact.includes("@")) {
|
573
574
|
user2 = await User.findOne({ email: invite.contact });
|
@@ -575,53 +576,52 @@ const сontrollerFactory = (db) => {
|
|
575
576
|
user2 = await User.findOne({ phone: invite.contact });
|
576
577
|
}
|
577
578
|
if (user2) {
|
578
|
-
console.log(invite);
|
579
579
|
const membership = new Membership({
|
580
580
|
user: user2._id,
|
581
581
|
type: "organization",
|
582
|
-
target:
|
583
|
-
role:
|
582
|
+
target: req.body.owner.target,
|
583
|
+
role: "member",
|
584
|
+
label: "member"
|
584
585
|
});
|
585
586
|
await membership.save();
|
586
|
-
res.status(200).json({ message: "Invites sent successfully!" });
|
587
587
|
} else {
|
588
588
|
const newInvite = new Invite({
|
589
589
|
code: uuid(),
|
590
|
-
|
591
|
-
|
592
|
-
|
593
|
-
|
594
|
-
|
590
|
+
creator,
|
591
|
+
owner,
|
592
|
+
role: "member",
|
593
|
+
email: invite.contact.includes("@") ? invite.contact : null,
|
594
|
+
phone: !invite.contact.includes("@") ? invite.contact : null
|
595
595
|
});
|
596
596
|
const savedInvite = await newInvite.save();
|
597
|
-
if (savedInvite.
|
598
|
-
const to = savedInvite.
|
597
|
+
if (savedInvite.email !== null) {
|
598
|
+
const to = savedInvite.email;
|
599
599
|
const subject = "You have been added to the organization";
|
600
600
|
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"`;
|
601
601
|
await sendEmail(to, subject, text);
|
602
602
|
}
|
603
|
-
if (savedInvite.
|
604
|
-
const phone = savedInvite.
|
603
|
+
if (savedInvite.phone !== null) {
|
604
|
+
const phone = savedInvite.phone;
|
605
605
|
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`;
|
606
606
|
await sendSms(phone, message);
|
607
607
|
}
|
608
|
-
res.status(200).json({ message: "Invites sent successfully!" });
|
609
608
|
}
|
610
609
|
}
|
610
|
+
res2.status(200).json({ message: "Invites sent successfully!" });
|
611
611
|
} catch (error) {
|
612
612
|
console.error(error);
|
613
|
-
|
613
|
+
res2.status(500).json({ message: "Something went wrong" });
|
614
614
|
}
|
615
615
|
};
|
616
|
-
const deleteInvite = async (req,
|
616
|
+
const deleteInvite = async (req, res2) => {
|
617
617
|
try {
|
618
618
|
const invite = await Invite.findOneAndDelete({ _id: req.params._id });
|
619
619
|
if (!invite) {
|
620
|
-
return
|
620
|
+
return res2.status(404).send({ message: "Invite not found" });
|
621
621
|
}
|
622
|
-
|
622
|
+
res2.send({ message: "Invite deleted successfully" });
|
623
623
|
} catch (err) {
|
624
|
-
|
624
|
+
res2.status(500).send({ message: err.message });
|
625
625
|
}
|
626
626
|
};
|
627
627
|
return {
|
@@ -632,18 +632,135 @@ const сontrollerFactory = (db) => {
|
|
632
632
|
};
|
633
633
|
};
|
634
634
|
var invites_controller = сontrollerFactory;
|
635
|
+
let AccessController$1 = class AccessController {
|
636
|
+
db = null;
|
637
|
+
rule = null;
|
638
|
+
next = null;
|
639
|
+
entity = null;
|
640
|
+
/**
|
641
|
+
* @param {String} rule - Права на проверку (read, create, ...)
|
642
|
+
* @param {String} entity - Сущность на проверку (departments, post, ...)
|
643
|
+
*/
|
644
|
+
check(rule, entity) {
|
645
|
+
if (this.rule === rule && this.entity === entity) {
|
646
|
+
return this.access.bind(this);
|
647
|
+
} else if (this.next) {
|
648
|
+
this.next.check(rule, entity);
|
649
|
+
} else {
|
650
|
+
console.error("Неудачная попытка вызова посредника verifyAccesses");
|
651
|
+
console.error("Переданные аргументы:", this.rule, this.entity);
|
652
|
+
return async (req, res2, next) => {
|
653
|
+
return res2.status(403).send({ message: "Access Denied. Middleware not founded" });
|
654
|
+
};
|
655
|
+
}
|
656
|
+
}
|
657
|
+
};
|
658
|
+
var AccessController_1 = AccessController$1;
|
659
|
+
const AccessController2 = AccessController_1;
|
660
|
+
let ReadDepartments$1 = class ReadDepartments extends AccessController2 {
|
661
|
+
rule = "read";
|
662
|
+
entity = "departments";
|
663
|
+
async access(req, res2, next) {
|
664
|
+
const Department = this.db.department;
|
665
|
+
try {
|
666
|
+
const userId = req.cookies.user._id;
|
667
|
+
const organization = req.query.organization;
|
668
|
+
const departments = await Department.find({
|
669
|
+
organization: { $eq: organization },
|
670
|
+
members: { $elemMatch: { user: userId } }
|
671
|
+
});
|
672
|
+
if (!departments.length) {
|
673
|
+
return res2.status(403).send({
|
674
|
+
message: "Access Denied. Read Departments. Департаменты не найдены"
|
675
|
+
});
|
676
|
+
}
|
677
|
+
let hasAccess = false;
|
678
|
+
departments.forEach((departament) => {
|
679
|
+
const accesses = departament.accesses;
|
680
|
+
if (getNestedProperty(accesses, rulePath)) {
|
681
|
+
hasAccess = true;
|
682
|
+
}
|
683
|
+
});
|
684
|
+
if (hasAccess) {
|
685
|
+
next();
|
686
|
+
} else {
|
687
|
+
return res2.status(403).send({ message: "Access Denied. Read Departments. No access" });
|
688
|
+
}
|
689
|
+
} catch (error) {
|
690
|
+
console.error("[canReadDepartments]", error);
|
691
|
+
return res2.status(500).send({ message: error.message });
|
692
|
+
}
|
693
|
+
}
|
694
|
+
/**
|
695
|
+
* // note: пока не использовался метод
|
696
|
+
* @param {Object} req объект
|
697
|
+
* @returns
|
698
|
+
*/
|
699
|
+
async departmentsWhereUserIsMember(req) {
|
700
|
+
const Department = this.db.department;
|
701
|
+
try {
|
702
|
+
const userId = req.cookies.user._id;
|
703
|
+
const organization = req.query.organization;
|
704
|
+
const departments = await Department.find({
|
705
|
+
organization: { $eq: organization },
|
706
|
+
members: { $elemMatch: { user: userId } }
|
707
|
+
});
|
708
|
+
return departments;
|
709
|
+
} catch (error) {
|
710
|
+
console.error("[canReadDepartments]", error);
|
711
|
+
return res.status(500).send({ message: error.message });
|
712
|
+
}
|
713
|
+
}
|
714
|
+
};
|
715
|
+
var ReadDepartments_1 = ReadDepartments$1;
|
716
|
+
function getNestedProperty(obj, propertyPath) {
|
717
|
+
const properties = propertyPath.split(".");
|
718
|
+
let value = obj;
|
719
|
+
for (const property of properties) {
|
720
|
+
if (!value.hasOwnProperty(property)) {
|
721
|
+
return void 0;
|
722
|
+
}
|
723
|
+
value = value[property];
|
724
|
+
}
|
725
|
+
return value;
|
726
|
+
}
|
727
|
+
const ReadDepartments2 = ReadDepartments_1;
|
728
|
+
var verifyAccesses = (db) => {
|
729
|
+
const instances = [];
|
730
|
+
const middlewares = [
|
731
|
+
ReadDepartments2
|
732
|
+
];
|
733
|
+
let nextMiddleware = null;
|
734
|
+
for (let i = middlewares.length - 1; i >= 0; i--) {
|
735
|
+
const Middleware = middlewares[i];
|
736
|
+
const middleware = new Middleware();
|
737
|
+
middleware.db = db;
|
738
|
+
middleware.next = nextMiddleware;
|
739
|
+
instances.unshift(middleware);
|
740
|
+
nextMiddleware = middleware;
|
741
|
+
}
|
742
|
+
return (rule, entity) => instances[0].check(rule, entity);
|
743
|
+
};
|
635
744
|
const controllerFactory$3 = departments_controller;
|
745
|
+
const accessMiddlewaresFactory = verifyAccesses;
|
636
746
|
var departments_routes = function(app, db) {
|
637
747
|
const controller = controllerFactory$3(db);
|
638
|
-
|
639
|
-
|
748
|
+
accessMiddlewaresFactory(db);
|
749
|
+
app.use(function(req, res2, next) {
|
750
|
+
res2.header(
|
640
751
|
"Access-Control-Allow-Headers",
|
641
752
|
"Access-Control-Allow-Origin",
|
642
753
|
"x-access-token, Origin, Content-Type, Accept"
|
643
754
|
);
|
644
755
|
next();
|
645
756
|
});
|
646
|
-
app.get(
|
757
|
+
app.get(
|
758
|
+
"/api/departments/read",
|
759
|
+
// [
|
760
|
+
// verifyAccesses('read', 'departments'),
|
761
|
+
// ],
|
762
|
+
controller.read
|
763
|
+
);
|
647
764
|
app.get("/api/departments/get/:_id", controller.readOne);
|
648
765
|
app.post("/api/departments/:_id/create", controller.create);
|
649
766
|
app.post("/api/departments/:_id/update", controller.update);
|
@@ -652,8 +769,8 @@ var departments_routes = function(app, db) {
|
|
652
769
|
const controllerFactory$2 = organizations_controller;
|
653
770
|
var organizations_routes = function(app, db) {
|
654
771
|
const controller = controllerFactory$2(db);
|
655
|
-
app.use(function(req,
|
656
|
-
|
772
|
+
app.use(function(req, res2, next) {
|
773
|
+
res2.header(
|
657
774
|
"Access-Control-Allow-Headers",
|
658
775
|
"Access-Control-Allow-Origin",
|
659
776
|
"x-access-token, Origin, Content-Type, Accept"
|
@@ -680,8 +797,8 @@ var organizations_routes = function(app, db) {
|
|
680
797
|
const controllerFactory$1 = memberships_controller;
|
681
798
|
var memberships_routes = function(app, db) {
|
682
799
|
const controller = controllerFactory$1(db);
|
683
|
-
app.use(function(req,
|
684
|
-
|
800
|
+
app.use(function(req, res2, next) {
|
801
|
+
res2.header(
|
685
802
|
"Access-Control-Allow-Headers",
|
686
803
|
"Access-Control-Allow-Origin",
|
687
804
|
"x-access-token, Origin, Content-Type, Accept"
|
@@ -710,8 +827,8 @@ const middlewareFactory = index.server;
|
|
710
827
|
var invites_routes = function(app, db) {
|
711
828
|
const controller = controllerFactory(db);
|
712
829
|
const { verifyInvites } = middlewareFactory(db);
|
713
|
-
app.use(function(req,
|
714
|
-
|
830
|
+
app.use(function(req, res2, next) {
|
831
|
+
res2.header(
|
715
832
|
"Access-Control-Allow-Headers",
|
716
833
|
"Access-Control-Allow-Origin",
|
717
834
|
"x-access-token, Origin, Content-Type, Accept"
|
@@ -727,7 +844,7 @@ var invites_routes = function(app, db) {
|
|
727
844
|
controller.read
|
728
845
|
);
|
729
846
|
app.post(
|
730
|
-
"/api/invites
|
847
|
+
"/api/invites/create",
|
731
848
|
[
|
732
849
|
verifyInvites.checkInviteExist,
|
733
850
|
verifyInvites.checkUsersExist
|
@@ -735,7 +852,7 @@ var invites_routes = function(app, db) {
|
|
735
852
|
controller.create
|
736
853
|
);
|
737
854
|
app.delete(
|
738
|
-
"/api/invites/:_id
|
855
|
+
"/api/invites/delete/:_id",
|
739
856
|
controller.delete
|
740
857
|
);
|
741
858
|
};
|
@@ -766,6 +883,50 @@ var department_model = (mongoose) => {
|
|
766
883
|
type: Boolean,
|
767
884
|
default: false
|
768
885
|
},
|
886
|
+
accesses: {
|
887
|
+
products: {
|
888
|
+
read: {
|
889
|
+
type: Boolean,
|
890
|
+
default: false
|
891
|
+
},
|
892
|
+
edit: {
|
893
|
+
type: Boolean,
|
894
|
+
default: false
|
895
|
+
},
|
896
|
+
delete: {
|
897
|
+
type: Boolean,
|
898
|
+
default: false
|
899
|
+
}
|
900
|
+
},
|
901
|
+
orders: {
|
902
|
+
read: {
|
903
|
+
type: Boolean,
|
904
|
+
default: false
|
905
|
+
},
|
906
|
+
confirm: {
|
907
|
+
type: Boolean,
|
908
|
+
default: false
|
909
|
+
},
|
910
|
+
delete: {
|
911
|
+
type: Boolean,
|
912
|
+
default: false
|
913
|
+
}
|
914
|
+
},
|
915
|
+
departments: {
|
916
|
+
read: {
|
917
|
+
type: Boolean,
|
918
|
+
default: false
|
919
|
+
},
|
920
|
+
edit: {
|
921
|
+
type: Boolean,
|
922
|
+
default: false
|
923
|
+
},
|
924
|
+
delete: {
|
925
|
+
type: Boolean,
|
926
|
+
default: false
|
927
|
+
}
|
928
|
+
}
|
929
|
+
},
|
769
930
|
// Marketplace options
|
770
931
|
delivery: [String],
|
771
932
|
payment: [String],
|
@@ -787,6 +948,8 @@ var department_model = (mongoose) => {
|
|
787
948
|
ref: "Department"
|
788
949
|
}
|
789
950
|
]
|
951
|
+
}, {
|
952
|
+
timestamps: true
|
790
953
|
});
|
791
954
|
departmentSchema.index({ organization: 1 });
|
792
955
|
const Department = mongoose.model("Department", departmentSchema);
|
@@ -855,6 +1018,8 @@ var organization_model = (mongoose) => {
|
|
855
1018
|
},
|
856
1019
|
amount: Number
|
857
1020
|
}
|
1021
|
+
}, {
|
1022
|
+
timestamps: true
|
858
1023
|
});
|
859
1024
|
const Organization = mongoose.model("Organization", OrganizationSchema);
|
860
1025
|
return Organization;
|
@@ -891,51 +1056,50 @@ var membership_model = (mongoose) => {
|
|
891
1056
|
},
|
892
1057
|
required: true
|
893
1058
|
}
|
1059
|
+
}, {
|
1060
|
+
timestamps: true
|
894
1061
|
});
|
895
1062
|
const Membership = mongoose.model("Membership", MembershipSchema);
|
896
1063
|
return Membership;
|
897
1064
|
};
|
898
|
-
|
899
|
-
|
1065
|
+
const applyOwnershipSchema = ownership_schema.ownership_schema;
|
1066
|
+
const applyCredentialsSchema = credentials_schema.credentials_schema;
|
1067
|
+
var invite_model = (db) => {
|
1068
|
+
const InviteSchema = new db.mongoose.Schema({
|
900
1069
|
code: {
|
901
1070
|
type: String,
|
902
1071
|
required: true,
|
903
1072
|
unique: true
|
904
1073
|
},
|
905
|
-
organization: {
|
906
|
-
type: mongoose.Schema.Types.ObjectId,
|
907
|
-
ref: "Organization",
|
908
|
-
required: true
|
909
|
-
},
|
910
1074
|
status: {
|
911
1075
|
type: String,
|
912
|
-
enum: ["active", "used"],
|
1076
|
+
enum: ["active", "used", "deactivated"],
|
913
1077
|
default: "active"
|
914
|
-
},
|
915
|
-
role: {
|
916
|
-
name: {
|
917
|
-
type: String,
|
918
|
-
default: "Сотрудник"
|
919
|
-
},
|
920
|
-
value: {
|
921
|
-
type: String,
|
922
|
-
default: "member"
|
923
|
-
}
|
924
|
-
},
|
925
|
-
createdBy: {
|
926
|
-
type: mongoose.Schema.Types.ObjectId,
|
927
|
-
ref: "User"
|
928
|
-
},
|
929
|
-
invitedEmail: {
|
930
|
-
type: String
|
931
|
-
},
|
932
|
-
invitedPhone: {
|
933
|
-
type: String
|
934
1078
|
}
|
935
1079
|
}, {
|
936
1080
|
timestamps: true
|
937
1081
|
});
|
938
|
-
|
1082
|
+
applyOwnershipSchema(InviteSchema, db);
|
1083
|
+
applyCredentialsSchema(InviteSchema);
|
1084
|
+
InviteSchema.index({
|
1085
|
+
owner: 1,
|
1086
|
+
email: 1
|
1087
|
+
}, {
|
1088
|
+
unique: true,
|
1089
|
+
partialFilterExpression: {
|
1090
|
+
email: { $exists: true, $ne: "" }
|
1091
|
+
}
|
1092
|
+
});
|
1093
|
+
InviteSchema.index({
|
1094
|
+
owner: 1,
|
1095
|
+
phone: 1
|
1096
|
+
}, {
|
1097
|
+
unique: true,
|
1098
|
+
partialFilterExpression: {
|
1099
|
+
phone: { $exists: true, $ne: "" }
|
1100
|
+
}
|
1101
|
+
});
|
1102
|
+
const Invite = db.mongoose.model("Invite", InviteSchema);
|
939
1103
|
return Invite;
|
940
1104
|
};
|
941
1105
|
const DepartmentsController = departments_controller;
|