@ozdao/prometheus-framework 0.2.222 → 0.2.224
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/auth.server.js +4 -4
- package/dist/auth.server.mjs +4 -4
- package/dist/builder.js +53 -53
- package/dist/builder.mjs +53 -53
- package/dist/community.server.js +8 -3
- package/dist/community.server.mjs +8 -3
- package/dist/events.server.js +14 -24
- package/dist/events.server.mjs +14 -24
- package/dist/files.server.js +1 -1
- package/dist/files.server.mjs +1 -1
- package/dist/gallery.server.js +42 -76
- package/dist/gallery.server.mjs +41 -75
- package/dist/index-CsS7qx1d.js +243 -0
- package/dist/index-UIHE6Rk3.mjs +244 -0
- package/dist/node_modules/@capacitor/core/dist/index.cjs +529 -0
- package/dist/node_modules/@capacitor/core/dist/index.cjs.map +1 -0
- package/dist/node_modules/@capacitor/core/dist/index.js +530 -0
- package/dist/node_modules/@capacitor/core/dist/index.js.map +1 -0
- package/dist/node_modules/@capacitor-mlkit/barcode-scanning/dist/esm/definitions.cjs +51 -0
- package/dist/node_modules/@capacitor-mlkit/barcode-scanning/dist/esm/definitions.cjs.map +1 -0
- package/dist/node_modules/@capacitor-mlkit/barcode-scanning/dist/esm/definitions.js +55 -0
- package/dist/node_modules/@capacitor-mlkit/barcode-scanning/dist/esm/definitions.js.map +1 -0
- package/dist/node_modules/@capacitor-mlkit/barcode-scanning/dist/esm/index.cjs +25 -0
- package/dist/node_modules/@capacitor-mlkit/barcode-scanning/dist/esm/index.cjs.map +1 -0
- package/dist/node_modules/@capacitor-mlkit/barcode-scanning/dist/esm/index.js +13 -0
- package/dist/node_modules/@capacitor-mlkit/barcode-scanning/dist/esm/index.js.map +1 -0
- package/dist/node_modules/@capacitor-mlkit/barcode-scanning/dist/esm/web.cjs +67 -0
- package/dist/node_modules/@capacitor-mlkit/barcode-scanning/dist/esm/web.cjs.map +1 -0
- package/dist/node_modules/@capacitor-mlkit/barcode-scanning/dist/esm/web.js +67 -0
- package/dist/node_modules/@capacitor-mlkit/barcode-scanning/dist/esm/web.js.map +1 -0
- package/dist/node_modules/@unhead/shared/dist/index.cjs +7 -0
- package/dist/node_modules/@unhead/shared/dist/index.cjs.map +1 -0
- package/dist/node_modules/@unhead/shared/dist/index.js +7 -0
- package/dist/node_modules/@unhead/shared/dist/index.js.map +1 -0
- package/dist/node_modules/@unhead/ssr/dist/index.cjs +87 -0
- package/dist/node_modules/@unhead/ssr/dist/index.cjs.map +1 -0
- package/dist/node_modules/@unhead/ssr/dist/index.js +87 -0
- package/dist/node_modules/@unhead/ssr/dist/index.js.map +1 -0
- package/dist/orders.server.js +2 -2
- package/dist/orders.server.mjs +2 -2
- package/dist/organizations.server.js +149 -107
- package/dist/organizations.server.mjs +149 -107
- package/dist/pages.server.js +1 -1
- package/dist/pages.server.mjs +1 -1
- package/dist/products.server.js +119 -266
- package/dist/products.server.mjs +119 -266
- package/dist/prometheus-framework/node_modules/@vue/server-renderer/dist/server-renderer.esm-bundler.cjs +814 -0
- package/dist/prometheus-framework/node_modules/@vue/server-renderer/dist/server-renderer.esm-bundler.cjs.map +1 -0
- package/dist/prometheus-framework/node_modules/@vue/server-renderer/dist/server-renderer.esm-bundler.js +814 -0
- package/dist/prometheus-framework/node_modules/@vue/server-renderer/dist/server-renderer.esm-bundler.js.map +1 -0
- package/dist/prometheus-framework/node_modules/@vue/shared/dist/shared.esm-bundler.cjs +210 -0
- package/dist/prometheus-framework/node_modules/@vue/shared/dist/shared.esm-bundler.cjs.map +1 -0
- package/dist/prometheus-framework/node_modules/@vue/shared/dist/shared.esm-bundler.js +210 -0
- package/dist/prometheus-framework/node_modules/@vue/shared/dist/shared.esm-bundler.js.map +1 -0
- package/dist/prometheus-framework/src/components/Button/Button.vue.cjs +1 -2
- package/dist/prometheus-framework/src/components/Button/Button.vue.cjs.map +1 -1
- package/dist/prometheus-framework/src/components/Button/Button.vue.js +1 -2
- package/dist/prometheus-framework/src/components/Button/Button.vue.js.map +1 -1
- package/dist/prometheus-framework/src/components/Button/Button.vue2.cjs +0 -1
- package/dist/prometheus-framework/src/components/Button/Button.vue2.cjs.map +1 -1
- package/dist/prometheus-framework/src/components/Button/Button.vue2.js +0 -1
- package/dist/prometheus-framework/src/components/Button/Button.vue2.js.map +1 -1
- package/dist/prometheus-framework/src/components/Feed/Feed.vue.cjs +25 -40
- package/dist/prometheus-framework/src/components/Feed/Feed.vue.cjs.map +1 -1
- package/dist/prometheus-framework/src/components/Feed/Feed.vue.js +26 -41
- package/dist/prometheus-framework/src/components/Feed/Feed.vue.js.map +1 -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/FieldTags/BlockTags.vue.cjs +6 -8
- package/dist/prometheus-framework/src/components/FieldTags/BlockTags.vue.cjs.map +1 -1
- package/dist/prometheus-framework/src/components/FieldTags/BlockTags.vue.js +6 -8
- package/dist/prometheus-framework/src/components/FieldTags/BlockTags.vue.js.map +1 -1
- package/dist/prometheus-framework/src/components/LocationMarker/LocationMarker.vue2.cjs +1 -1
- package/dist/prometheus-framework/src/components/LocationMarker/LocationMarker.vue2.js +1 -1
- package/dist/prometheus-framework/src/components/Slider/Slider.vue.cjs +1 -1
- package/dist/prometheus-framework/src/components/Slider/Slider.vue.js +1 -1
- package/dist/prometheus-framework/src/components/UploadImage/UploadImage.vue.cjs +2 -1
- package/dist/prometheus-framework/src/components/UploadImage/UploadImage.vue.cjs.map +1 -1
- package/dist/prometheus-framework/src/components/UploadImage/UploadImage.vue.js +2 -1
- package/dist/prometheus-framework/src/components/UploadImage/UploadImage.vue.js.map +1 -1
- package/dist/prometheus-framework/src/components/UploadImageMultiple/UploadImageMultiple.vue.cjs +1 -1
- package/dist/prometheus-framework/src/components/UploadImageMultiple/UploadImageMultiple.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/auth/views/components/layouts/Auth.vue.cjs +4 -4
- package/dist/prometheus-framework/src/modules/auth/views/components/layouts/Auth.vue.js +4 -4
- package/dist/prometheus-framework/src/modules/auth/views/components/pages/EnterCode.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/auth/views/components/pages/EnterCode.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/auth/views/components/pages/EnterPassword.vue.cjs +3 -3
- package/dist/prometheus-framework/src/modules/auth/views/components/pages/EnterPassword.vue.js +3 -3
- package/dist/prometheus-framework/src/modules/auth/views/components/pages/Invite.vue.cjs +3 -3
- package/dist/prometheus-framework/src/modules/auth/views/components/pages/Invite.vue.js +3 -3
- package/dist/prometheus-framework/src/modules/auth/views/components/pages/ResetPassword.vue.cjs +3 -3
- package/dist/prometheus-framework/src/modules/auth/views/components/pages/ResetPassword.vue.js +3 -3
- package/dist/prometheus-framework/src/modules/auth/views/components/pages/SignIn.vue.cjs +4 -3
- package/dist/prometheus-framework/src/modules/auth/views/components/pages/SignIn.vue.cjs.map +1 -1
- package/dist/prometheus-framework/src/modules/auth/views/components/pages/SignIn.vue.js +4 -3
- package/dist/prometheus-framework/src/modules/auth/views/components/pages/SignIn.vue.js.map +1 -1
- package/dist/prometheus-framework/src/modules/auth/views/components/pages/SignUp.vue.cjs +3 -3
- package/dist/prometheus-framework/src/modules/auth/views/components/pages/SignUp.vue.js +3 -3
- package/dist/prometheus-framework/src/modules/auth/views/middlewares/auth.validation.cjs +5 -0
- package/dist/prometheus-framework/src/modules/auth/views/middlewares/auth.validation.cjs.map +1 -1
- package/dist/prometheus-framework/src/modules/auth/views/middlewares/auth.validation.js +5 -0
- package/dist/prometheus-framework/src/modules/auth/views/middlewares/auth.validation.js.map +1 -1
- package/dist/prometheus-framework/src/modules/auth/views/middlewares/ownership.validation.cjs +11 -0
- package/dist/prometheus-framework/src/modules/auth/views/middlewares/ownership.validation.cjs.map +1 -1
- package/dist/prometheus-framework/src/modules/auth/views/middlewares/ownership.validation.js +11 -0
- package/dist/prometheus-framework/src/modules/auth/views/middlewares/ownership.validation.js.map +1 -1
- package/dist/prometheus-framework/src/modules/auth/views/store/auth.cjs +37 -35
- package/dist/prometheus-framework/src/modules/auth/views/store/auth.cjs.map +1 -1
- package/dist/prometheus-framework/src/modules/auth/views/store/auth.js +33 -31
- package/dist/prometheus-framework/src/modules/auth/views/store/auth.js.map +1 -1
- package/dist/prometheus-framework/src/modules/auth/views/store/twofa.cjs +3 -5
- package/dist/prometheus-framework/src/modules/auth/views/store/twofa.cjs.map +1 -1
- package/dist/prometheus-framework/src/modules/auth/views/store/twofa.js +2 -4
- package/dist/prometheus-framework/src/modules/auth/views/store/twofa.js.map +1 -1
- package/dist/prometheus-framework/src/modules/auth/views/validations/inputs.validation.cjs +8 -5
- package/dist/prometheus-framework/src/modules/auth/views/validations/inputs.validation.cjs.map +1 -1
- package/dist/prometheus-framework/src/modules/auth/views/validations/inputs.validation.js +8 -5
- package/dist/prometheus-framework/src/modules/auth/views/validations/inputs.validation.js.map +1 -1
- package/dist/prometheus-framework/src/modules/community/components/layouts/Community.vue.cjs +6 -3
- package/dist/prometheus-framework/src/modules/community/components/layouts/Community.vue.cjs.map +1 -1
- package/dist/prometheus-framework/src/modules/community/components/layouts/Community.vue.js +6 -3
- package/dist/prometheus-framework/src/modules/community/components/layouts/Community.vue.js.map +1 -1
- package/dist/prometheus-framework/src/modules/community/components/pages/BlogPost.vue.cjs +50 -35
- package/dist/prometheus-framework/src/modules/community/components/pages/BlogPost.vue.cjs.map +1 -1
- package/dist/prometheus-framework/src/modules/community/components/pages/BlogPost.vue.js +55 -40
- package/dist/prometheus-framework/src/modules/community/components/pages/BlogPost.vue.js.map +1 -1
- package/dist/prometheus-framework/src/modules/community/components/pages/Community.vue.cjs +3 -3
- package/dist/prometheus-framework/src/modules/community/components/pages/Community.vue.js +3 -3
- package/dist/prometheus-framework/src/modules/community/components/pages/CreateBlogPost.vue.cjs +2 -2
- package/dist/prometheus-framework/src/modules/community/components/pages/CreateBlogPost.vue.cjs.map +1 -1
- package/dist/prometheus-framework/src/modules/community/components/pages/CreateBlogPost.vue.js +2 -2
- package/dist/prometheus-framework/src/modules/community/components/pages/CreateBlogPost.vue.js.map +1 -1
- package/dist/prometheus-framework/src/modules/community/components/sections/Comments.vue.cjs +16 -15
- package/dist/prometheus-framework/src/modules/community/components/sections/Comments.vue.cjs.map +1 -1
- package/dist/prometheus-framework/src/modules/community/components/sections/Comments.vue.js +16 -15
- package/dist/prometheus-framework/src/modules/community/components/sections/Comments.vue.js.map +1 -1
- package/dist/prometheus-framework/src/modules/community/components/sections/HotPosts.vue.cjs +2 -2
- package/dist/prometheus-framework/src/modules/community/components/sections/HotPosts.vue.js +2 -2
- package/dist/prometheus-framework/src/modules/community/router/blogposts.cjs +46 -49
- package/dist/prometheus-framework/src/modules/community/router/blogposts.cjs.map +1 -1
- package/dist/prometheus-framework/src/modules/community/router/blogposts.js +46 -49
- package/dist/prometheus-framework/src/modules/community/router/blogposts.js.map +1 -1
- package/dist/prometheus-framework/src/modules/community/store/blogposts.cjs +13 -20
- package/dist/prometheus-framework/src/modules/community/store/blogposts.cjs.map +1 -1
- package/dist/prometheus-framework/src/modules/community/store/blogposts.js +9 -16
- package/dist/prometheus-framework/src/modules/community/store/blogposts.js.map +1 -1
- package/dist/prometheus-framework/src/modules/community/store/reactions.cjs +5 -9
- package/dist/prometheus-framework/src/modules/community/store/reactions.cjs.map +1 -1
- package/dist/prometheus-framework/src/modules/community/store/reactions.js +1 -5
- package/dist/prometheus-framework/src/modules/community/store/reactions.js.map +1 -1
- 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/events/components/elements/ButtonCheck.vue.cjs +30 -55
- package/dist/prometheus-framework/src/modules/events/components/elements/ButtonCheck.vue.cjs.map +1 -1
- package/dist/prometheus-framework/src/modules/events/components/elements/ButtonCheck.vue.js +31 -56
- package/dist/prometheus-framework/src/modules/events/components/elements/ButtonCheck.vue.js.map +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 +164 -135
- package/dist/prometheus-framework/src/modules/events/components/pages/EditEvent.vue.cjs.map +1 -1
- package/dist/prometheus-framework/src/modules/events/components/pages/EditEvent.vue.js +165 -136
- package/dist/prometheus-framework/src/modules/events/components/pages/EditEvent.vue.js.map +1 -1
- package/dist/prometheus-framework/src/modules/events/components/pages/EditEventTickets.vue.cjs +2 -2
- package/dist/prometheus-framework/src/modules/events/components/pages/EditEventTickets.vue.js +2 -2
- package/dist/prometheus-framework/src/modules/events/components/pages/Event.vue.cjs +124 -135
- package/dist/prometheus-framework/src/modules/events/components/pages/Event.vue.cjs.map +1 -1
- package/dist/prometheus-framework/src/modules/events/components/pages/Event.vue.js +133 -144
- package/dist/prometheus-framework/src/modules/events/components/pages/Event.vue.js.map +1 -1
- package/dist/prometheus-framework/src/modules/events/components/pages/Events.vue.cjs.map +1 -1
- package/dist/prometheus-framework/src/modules/events/components/pages/Events.vue.js.map +1 -1
- package/dist/prometheus-framework/src/modules/events/components/pages/EventsBackoffice.vue.cjs +96 -0
- package/dist/prometheus-framework/src/modules/events/components/pages/EventsBackoffice.vue.cjs.map +1 -0
- package/dist/prometheus-framework/src/modules/events/components/pages/EventsBackoffice.vue.js +96 -0
- package/dist/prometheus-framework/src/modules/events/components/pages/EventsBackoffice.vue.js.map +1 -0
- package/dist/prometheus-framework/src/modules/events/components/sections/Feed.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/events/components/sections/Feed.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/events/components/sections/HeroEvent.vue.cjs +39 -25
- package/dist/prometheus-framework/src/modules/events/components/sections/HeroEvent.vue.cjs.map +1 -1
- package/dist/prometheus-framework/src/modules/events/components/sections/HeroEvent.vue.js +40 -26
- package/dist/prometheus-framework/src/modules/events/components/sections/HeroEvent.vue.js.map +1 -1
- package/dist/prometheus-framework/src/modules/events/components/sections/List.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/events/components/sections/List.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/events/components/sections/SectionPreviousEvents.vue.cjs +4 -3
- package/dist/prometheus-framework/src/modules/events/components/sections/SectionPreviousEvents.vue.cjs.map +1 -1
- package/dist/prometheus-framework/src/modules/events/components/sections/SectionPreviousEvents.vue.js +4 -3
- package/dist/prometheus-framework/src/modules/events/components/sections/SectionPreviousEvents.vue.js.map +1 -1
- package/dist/prometheus-framework/src/modules/events/router/events.cjs +16 -5
- package/dist/prometheus-framework/src/modules/events/router/events.cjs.map +1 -1
- package/dist/prometheus-framework/src/modules/events/router/events.js +16 -5
- package/dist/prometheus-framework/src/modules/events/router/events.js.map +1 -1
- package/dist/prometheus-framework/src/modules/events/store/events.cjs +5 -6
- package/dist/prometheus-framework/src/modules/events/store/events.cjs.map +1 -1
- package/dist/prometheus-framework/src/modules/events/store/events.js +1 -2
- package/dist/prometheus-framework/src/modules/events/store/events.js.map +1 -1
- package/dist/prometheus-framework/src/modules/gallery/components/sections/BackofficeGallery.vue.cjs +20 -11
- package/dist/prometheus-framework/src/modules/gallery/components/sections/BackofficeGallery.vue.cjs.map +1 -1
- package/dist/prometheus-framework/src/modules/gallery/components/sections/BackofficeGallery.vue.js +20 -11
- package/dist/prometheus-framework/src/modules/gallery/components/sections/BackofficeGallery.vue.js.map +1 -1
- package/dist/prometheus-framework/src/modules/gallery/router/gallery.backoffice.router.cjs +5 -2
- package/dist/prometheus-framework/src/modules/gallery/router/gallery.backoffice.router.cjs.map +1 -1
- package/dist/prometheus-framework/src/modules/gallery/router/gallery.backoffice.router.js +5 -2
- package/dist/prometheus-framework/src/modules/gallery/router/gallery.backoffice.router.js.map +1 -1
- package/dist/prometheus-framework/src/modules/globals/globals.client.cjs +2 -0
- package/dist/prometheus-framework/src/modules/globals/globals.client.cjs.map +1 -1
- package/dist/prometheus-framework/src/modules/globals/globals.client.js +2 -0
- package/dist/prometheus-framework/src/modules/globals/globals.client.js.map +1 -1
- package/dist/prometheus-framework/src/modules/globals/views/classes/globals.store.cjs +4 -3
- package/dist/prometheus-framework/src/modules/globals/views/classes/globals.store.cjs.map +1 -1
- package/dist/prometheus-framework/src/modules/globals/views/classes/globals.store.js +4 -3
- package/dist/prometheus-framework/src/modules/globals/views/classes/globals.store.js.map +1 -1
- package/dist/prometheus-framework/src/modules/globals/views/components/blocks/BlockSearch.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/globals/views/components/blocks/BlockSearch.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/globals/views/components/blocks/Card.vue.cjs +64 -0
- package/dist/prometheus-framework/src/modules/globals/views/components/blocks/Card.vue.cjs.map +1 -0
- package/dist/prometheus-framework/src/modules/globals/views/components/blocks/Card.vue.js +64 -0
- package/dist/prometheus-framework/src/modules/globals/views/components/blocks/Card.vue.js.map +1 -0
- package/dist/prometheus-framework/src/modules/globals/views/components/blocks/CardHeader.vue.cjs +3 -3
- package/dist/prometheus-framework/src/modules/globals/views/components/blocks/CardHeader.vue.cjs.map +1 -1
- package/dist/prometheus-framework/src/modules/globals/views/components/blocks/CardHeader.vue.js +3 -3
- package/dist/prometheus-framework/src/modules/globals/views/components/blocks/CardHeader.vue.js.map +1 -1
- package/dist/prometheus-framework/src/modules/globals/views/components/layouts/App.vue.cjs +1 -0
- package/dist/prometheus-framework/src/modules/globals/views/components/layouts/App.vue.cjs.map +1 -1
- package/dist/prometheus-framework/src/modules/globals/views/components/layouts/App.vue.js +1 -0
- package/dist/prometheus-framework/src/modules/globals/views/components/layouts/App.vue.js.map +1 -1
- package/dist/prometheus-framework/src/modules/globals/views/components/layouts/Client.vue.cjs +1 -19
- package/dist/prometheus-framework/src/modules/globals/views/components/layouts/Client.vue.cjs.map +1 -1
- package/dist/prometheus-framework/src/modules/globals/views/components/layouts/Client.vue.js +1 -19
- package/dist/prometheus-framework/src/modules/globals/views/components/layouts/Client.vue.js.map +1 -1
- package/dist/prometheus-framework/src/modules/globals/views/components/partials/Header.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/globals/views/components/partials/Header.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/globals/views/components/partials/NavigationBar.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/globals/views/components/partials/NavigationBar.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/globals/views/components/sections/SectionPageTitle.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/globals/views/components/sections/SectionPageTitle.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/globals/views/store/globals.cjs +3 -2
- package/dist/prometheus-framework/src/modules/globals/views/store/globals.cjs.map +1 -1
- package/dist/prometheus-framework/src/modules/globals/views/store/globals.js +3 -2
- package/dist/prometheus-framework/src/modules/globals/views/store/globals.js.map +1 -1
- package/dist/prometheus-framework/src/modules/globals/views/utils/axios-instance.cjs +17 -0
- package/dist/prometheus-framework/src/modules/globals/views/utils/axios-instance.cjs.map +1 -0
- package/dist/prometheus-framework/src/modules/globals/views/utils/axios-instance.js +17 -0
- package/dist/prometheus-framework/src/modules/globals/views/utils/axios-instance.js.map +1 -0
- package/dist/prometheus-framework/src/modules/globals/views/utils/vue-app-renderer.cjs +57 -0
- package/dist/prometheus-framework/src/modules/globals/views/utils/vue-app-renderer.cjs.map +1 -0
- package/dist/prometheus-framework/src/modules/globals/views/utils/vue-app-renderer.js +57 -0
- package/dist/prometheus-framework/src/modules/globals/views/utils/vue-app-renderer.js.map +1 -0
- package/dist/prometheus-framework/src/modules/legal/components/pages/Legal.vue.cjs +3 -3
- package/dist/prometheus-framework/src/modules/legal/components/pages/Legal.vue.js +3 -3
- package/dist/prometheus-framework/src/modules/orders/components/pages/OrderBackoffice.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/orders/components/pages/OrderBackoffice.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/orders/components/pages/OrderCreateBackoffice.vue.cjs +3 -3
- package/dist/prometheus-framework/src/modules/orders/components/pages/OrderCreateBackoffice.vue.js +3 -3
- 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 +1 -1
- package/dist/prometheus-framework/src/modules/orders/components/sections/FormAddCustomer.vue.cjs +2 -2
- package/dist/prometheus-framework/src/modules/orders/components/sections/FormAddCustomer.vue.js +2 -2
- package/dist/prometheus-framework/src/modules/orders/components/sections/FormCustomerDetails.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/orders/components/sections/FormCustomerDetails.vue.js +1 -1
- 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 +1 -1
- package/dist/prometheus-framework/src/modules/orders/store/orders.cjs +6 -7
- package/dist/prometheus-framework/src/modules/orders/store/orders.cjs.map +1 -1
- package/dist/prometheus-framework/src/modules/orders/store/orders.js +1 -2
- package/dist/prometheus-framework/src/modules/orders/store/orders.js.map +1 -1
- 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/DepartmentEdit.vue.cjs +60 -23
- package/dist/prometheus-framework/src/modules/organizations/components/pages/DepartmentEdit.vue.cjs.map +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/pages/DepartmentEdit.vue.js +60 -23
- package/dist/prometheus-framework/src/modules/organizations/components/pages/DepartmentEdit.vue.js.map +1 -1
- 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 +1 -1
- 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 +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/pages/OrganizationBackoffice.vue.cjs +2 -1
- package/dist/prometheus-framework/src/modules/organizations/components/pages/OrganizationBackoffice.vue.cjs.map +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/pages/OrganizationBackoffice.vue.js +3 -2
- package/dist/prometheus-framework/src/modules/organizations/components/pages/OrganizationBackoffice.vue.js.map +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/pages/OrganizationEdit.vue.cjs +3 -3
- 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 +3 -3
- package/dist/prometheus-framework/src/modules/organizations/components/sections/Documents.vue.js +3 -3
- package/dist/prometheus-framework/src/modules/organizations/components/sections/Feed.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/sections/Feed.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/sections/MembersAdd.vue.cjs +2 -2
- package/dist/prometheus-framework/src/modules/organizations/components/sections/MembersAdd.vue.js +2 -2
- package/dist/prometheus-framework/src/modules/organizations/components/sections/Organizations.vue.cjs +4 -4
- package/dist/prometheus-framework/src/modules/organizations/components/sections/Organizations.vue.js +4 -4
- package/dist/prometheus-framework/src/modules/organizations/router/organizations.cjs +2 -0
- package/dist/prometheus-framework/src/modules/organizations/router/organizations.cjs.map +1 -1
- package/dist/prometheus-framework/src/modules/organizations/router/organizations.js +2 -0
- package/dist/prometheus-framework/src/modules/organizations/router/organizations.js.map +1 -1
- package/dist/prometheus-framework/src/modules/organizations/store/departments.cjs +11 -9
- package/dist/prometheus-framework/src/modules/organizations/store/departments.cjs.map +1 -1
- package/dist/prometheus-framework/src/modules/organizations/store/departments.js +6 -4
- package/dist/prometheus-framework/src/modules/organizations/store/departments.js.map +1 -1
- package/dist/prometheus-framework/src/modules/organizations/store/organizations.cjs +5 -11
- package/dist/prometheus-framework/src/modules/organizations/store/organizations.cjs.map +1 -1
- package/dist/prometheus-framework/src/modules/organizations/store/organizations.js +1 -7
- package/dist/prometheus-framework/src/modules/organizations/store/organizations.js.map +1 -1
- package/dist/prometheus-framework/src/modules/pages/pages.client.cjs +637 -631
- package/dist/prometheus-framework/src/modules/pages/pages.client.js +637 -631
- package/dist/prometheus-framework/src/modules/pages/views/components/blocks/CardPage.vue.cjs +3 -3
- package/dist/prometheus-framework/src/modules/pages/views/components/blocks/CardPage.vue.js +3 -3
- package/dist/prometheus-framework/src/modules/pages/views/components/pages/PageEdit.vue.cjs +2 -2
- package/dist/prometheus-framework/src/modules/pages/views/components/pages/PageEdit.vue.js +2 -2
- package/dist/prometheus-framework/src/modules/pages/views/components/partials/SidebarPages.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/pages/views/components/partials/SidebarPages.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/pages/views/router/pages.backoffice.router.cjs +5 -10
- package/dist/prometheus-framework/src/modules/pages/views/router/pages.backoffice.router.cjs.map +1 -1
- package/dist/prometheus-framework/src/modules/pages/views/router/pages.backoffice.router.js +5 -10
- package/dist/prometheus-framework/src/modules/pages/views/router/pages.backoffice.router.js.map +1 -1
- 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 +12 -7
- package/dist/prometheus-framework/src/modules/products/components/blocks/CardProduct.vue.cjs.map +1 -1
- package/dist/prometheus-framework/src/modules/products/components/blocks/CardProduct.vue.js +12 -7
- package/dist/prometheus-framework/src/modules/products/components/blocks/CardProduct.vue.js.map +1 -1
- package/dist/prometheus-framework/src/modules/products/components/blocks/Images360.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/products/components/blocks/Images360.vue.js +1 -1
- 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 +2 -2
- 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/Product.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/products/components/pages/Product.vue.cjs.map +1 -1
- package/dist/prometheus-framework/src/modules/products/components/pages/Product.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/products/components/pages/Product.vue.js.map +1 -1
- package/dist/prometheus-framework/src/modules/products/components/pages/ProductEdit.vue.cjs +3 -3
- package/dist/prometheus-framework/src/modules/products/components/pages/ProductEdit.vue.js +3 -3
- package/dist/prometheus-framework/src/modules/products/components/pages/ProductRecommmendation.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/products/components/pages/ProductRecommmendation.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/products/components/pages/Products.vue.cjs +2 -2
- package/dist/prometheus-framework/src/modules/products/components/pages/Products.vue.js +2 -2
- 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 +3 -3
- package/dist/prometheus-framework/src/modules/products/components/sections/EditProductInfo.vue.js +3 -3
- package/dist/prometheus-framework/src/modules/products/components/sections/PopularProducts.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/products/components/sections/PopularProducts.vue.js +1 -1
- 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/products/store/categories.cjs +7 -8
- package/dist/prometheus-framework/src/modules/products/store/categories.cjs.map +1 -1
- package/dist/prometheus-framework/src/modules/products/store/categories.js +1 -2
- package/dist/prometheus-framework/src/modules/products/store/categories.js.map +1 -1
- package/dist/prometheus-framework/src/modules/products/store/leftovers.cjs +6 -7
- package/dist/prometheus-framework/src/modules/products/store/leftovers.cjs.map +1 -1
- package/dist/prometheus-framework/src/modules/products/store/leftovers.js +1 -2
- package/dist/prometheus-framework/src/modules/products/store/leftovers.js.map +1 -1
- package/dist/prometheus-framework/src/modules/products/store/products.cjs +10 -21
- package/dist/prometheus-framework/src/modules/products/store/products.cjs.map +1 -1
- package/dist/prometheus-framework/src/modules/products/store/products.js +1 -12
- package/dist/prometheus-framework/src/modules/products/store/products.js.map +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.cjs.map +1 -1
- package/dist/prometheus-framework/src/modules/reports/components/sections/FormReport.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/reports/components/sections/FormReport.vue.js.map +1 -1
- package/dist/prometheus-framework/src/modules/spots/components/blocks/SpotMemberModify.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/spots/components/blocks/SpotMemberModify.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/spots/components/layouts/Spots.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/spots/components/layouts/Spots.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/spots/components/pages/Map.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/spots/components/pages/Map.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/spots/components/pages/SpotEdit.vue.cjs +3 -3
- package/dist/prometheus-framework/src/modules/spots/components/pages/SpotEdit.vue.js +3 -3
- package/dist/prometheus-framework/src/modules/spots/store/spots.cjs +6 -9
- package/dist/prometheus-framework/src/modules/spots/store/spots.cjs.map +1 -1
- package/dist/prometheus-framework/src/modules/spots/store/spots.js +1 -4
- package/dist/prometheus-framework/src/modules/spots/store/spots.js.map +1 -1
- package/dist/prometheus-framework/src/modules/users/components/pages/Profile.vue.cjs +4 -4
- package/dist/prometheus-framework/src/modules/users/components/pages/Profile.vue.cjs.map +1 -1
- package/dist/prometheus-framework/src/modules/users/components/pages/Profile.vue.js +4 -4
- package/dist/prometheus-framework/src/modules/users/components/pages/Profile.vue.js.map +1 -1
- 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 +3 -3
- package/dist/prometheus-framework/src/modules/users/components/pages/ProfileEdit.vue.js +3 -3
- package/dist/prometheus-framework/src/modules/users/router/users.cjs +2 -2
- package/dist/prometheus-framework/src/modules/users/router/users.cjs.map +1 -1
- package/dist/prometheus-framework/src/modules/users/router/users.js +2 -2
- package/dist/prometheus-framework/src/modules/users/router/users.js.map +1 -1
- package/dist/prometheus-framework/src/modules/users/store/users.cjs +5 -6
- package/dist/prometheus-framework/src/modules/users/store/users.cjs.map +1 -1
- package/dist/prometheus-framework/src/modules/users/store/users.js +1 -2
- package/dist/prometheus-framework/src/modules/users/store/users.js.map +1 -1
- package/dist/prometheus-framework/src/modules/wallet/views/components/blocks/CardDeposit.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/wallet/views/components/blocks/CardDeposit.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/wallet/views/components/blocks/CryptoDeposit.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/wallet/views/components/blocks/CryptoDeposit.vue.js +1 -1
- 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 +1 -1
- package/dist/prometheus-framework.cjs.js +17 -17
- package/dist/prometheus-framework.es.js +1790 -1790
- package/dist/queryProcessor-CU4A6Y4N.mjs +197 -0
- package/dist/queryProcessor-CcsJEUBr.js +196 -0
- package/dist/spots.server.js +1 -1
- package/dist/spots.server.mjs +1 -1
- package/dist/verifyAccesses-BsrJOct8.mjs +90 -0
- package/dist/verifyAccesses-BvLnOtBN.js +89 -0
- package/dist/wallet.server.js +2 -2
- package/dist/wallet.server.mjs +2 -2
- package/package.json +1 -1
- package/src/builder/modes/ssr.dev.js +2 -2
- package/src/builder/modes/ssr.prod.js +4 -4
- package/src/builder/ssr/ssr-render-html.js +10 -14
- package/src/builder/templates/page.html +37 -0
- package/src/builder/templates/page.js +4 -0
- package/src/builder/webpack/webpack.config.client.js +2 -2
- package/src/builder/webpack/webpack.config.ssr.js +1 -1
- package/src/components/Button/Button.vue +0 -1
- package/src/components/Feed/Feed.vue +34 -55
- package/src/components/FieldTags/BlockTags.vue +0 -1
- package/src/components/UploadImage/UploadImage.vue +2 -1
- package/src/modules/auth/controllers/middlewares/authJwt.js +1 -1
- package/src/modules/auth/controllers/middlewares/verifySignUp.js +11 -11
- package/src/modules/auth/controllers/routes/auth.routes.js +2 -2
- package/src/modules/auth/controllers/services/auth.service.js +1 -0
- package/src/modules/auth/views/components/pages/SignIn.vue +1 -0
- package/src/modules/auth/views/middlewares/auth.validation.js +17 -1
- package/src/modules/auth/views/middlewares/ownership.validation.js +16 -1
- package/src/modules/auth/views/store/auth.js +43 -39
- package/src/modules/auth/views/store/twofa.js +2 -5
- package/src/modules/auth/views/validations/inputs.validation.js +12 -6
- package/src/modules/community/components/layouts/Community.vue +3 -3
- package/src/modules/community/components/pages/BlogPost.vue +122 -120
- package/src/modules/community/components/pages/CreateBlogPost.vue +1 -1
- package/src/modules/community/components/sections/Comments.vue +5 -5
- package/src/modules/community/controllers/blog.controller.js +1 -1
- package/src/modules/community/router/blogposts.js +37 -38
- package/src/modules/community/routes/blog.routes.js +4 -0
- package/src/modules/community/store/blogposts.js +11 -19
- package/src/modules/community/store/reactions.js +1 -7
- package/src/modules/events/components/elements/ButtonCheck.vue +36 -66
- package/src/modules/events/components/pages/EditEvent.vue +76 -59
- package/src/modules/events/components/pages/Event.vue +2 -15
- package/src/modules/events/components/pages/Events.vue +2 -1
- package/src/modules/events/components/pages/EventsBackoffice.vue +122 -0
- package/src/modules/events/components/sections/HeroEvent.vue +15 -17
- package/src/modules/events/components/sections/SectionPreviousEvents.vue +4 -13
- package/src/modules/events/router/events.js +11 -4
- package/src/modules/events/store/events.js +2 -4
- package/src/modules/gallery/components/sections/BackofficeGallery.vue +24 -13
- package/src/modules/gallery/controllers/gallery.controller.js +30 -31
- package/src/modules/gallery/router/gallery.backoffice.router.js +5 -1
- package/src/modules/gallery/routes/gallery.routes.js +22 -4
- package/src/modules/globals/controllers/utils/queryProcessor.js +24 -4
- package/src/modules/globals/globals.client.js +2 -0
- package/src/modules/globals/views/classes/globals.store.js +4 -3
- package/src/modules/globals/views/components/blocks/Card.vue +56 -0
- package/src/modules/globals/views/components/blocks/CardHeader.vue +1 -3
- package/src/modules/globals/views/components/layouts/App.vue +1 -0
- package/src/modules/globals/views/components/layouts/Client.vue +0 -30
- package/src/modules/globals/views/store/globals.js +4 -2
- package/src/modules/globals/views/utils/axios-instance.js +18 -0
- package/src/modules/globals/views/utils/vue-app-renderer.js +87 -0
- package/src/modules/integrations/stripe/controllers/services/stripe.service.js +15 -30
- package/src/modules/landing/components/pages/Governance.vue +4 -2
- package/src/modules/landing/components/sections/SectionHeroToken.vue +12 -10
- package/src/modules/landing/components/sections/SectionsSection.vue +5 -8
- package/src/modules/landing/router/landing.js +2 -1
- package/src/modules/orders/store/orders.js +1 -3
- package/src/modules/organizations/components/pages/DepartmentEdit.vue +36 -0
- package/src/modules/organizations/components/pages/OrganizationBackoffice.vue +3 -1
- package/src/modules/organizations/controllers/organizations.controller.js +2 -1
- package/src/modules/organizations/middlewares/verifyAccesses.js +117 -0
- package/src/modules/organizations/models/department.model.js +3 -100
- package/src/modules/organizations/models/organization.model.js +6 -4
- package/src/modules/organizations/models/schemas/accesses.schema.js +142 -0
- package/src/modules/organizations/router/organizations.js +2 -0
- package/src/modules/organizations/store/departments.js +6 -6
- package/src/modules/organizations/store/organizations.js +2 -16
- package/src/modules/pages/views/router/pages.backoffice.router.js +5 -7
- package/src/modules/products/components/blocks/CardProduct.vue +2 -0
- package/src/modules/products/components/pages/Product.vue +1 -1
- package/src/modules/products/components/sections/MenuSection.vue +2 -2
- package/src/modules/products/controllers/products.controller.js +201 -367
- package/src/modules/products/routes/products.routes.js +0 -5
- package/src/modules/products/store/categories.js +1 -2
- package/src/modules/products/store/leftovers.js +1 -2
- package/src/modules/products/store/products.js +1 -13
- package/src/modules/reports/components/sections/FormReport.vue +20 -20
- package/src/modules/spots/store/spots.js +1 -6
- package/src/modules/users/components/pages/Profile.vue +1 -1
- package/src/modules/users/router/users.js +2 -2
- package/src/modules/users/store/users.js +1 -3
- package/src/modules/auth/controllers/middlewares/verifyAccesses.js +0 -114
- package/src/modules/users/components/pages/ProfileEvents.vue +0 -69
@@ -0,0 +1,243 @@
|
|
1
|
+
"use strict";
|
2
|
+
const require$$0 = require("jsonwebtoken");
|
3
|
+
const require$$0$1 = require("crypto");
|
4
|
+
const require$$0$2 = require("mongodb");
|
5
|
+
var authJwt;
|
6
|
+
var hasRequiredAuthJwt;
|
7
|
+
function requireAuthJwt() {
|
8
|
+
if (hasRequiredAuthJwt) return authJwt;
|
9
|
+
hasRequiredAuthJwt = 1;
|
10
|
+
const jwt = require$$0;
|
11
|
+
const middlewareFactory = (db) => {
|
12
|
+
const User = db.user;
|
13
|
+
const Role = db.role;
|
14
|
+
const verifyToken = (continueOnFail = false) => {
|
15
|
+
return async (req, res, next) => {
|
16
|
+
try {
|
17
|
+
let token = req.headers["x-access-token"];
|
18
|
+
if (!token && req.cookies.user) {
|
19
|
+
let user = JSON.parse(req.cookies.user);
|
20
|
+
token = user.accessToken;
|
21
|
+
}
|
22
|
+
if (!token) {
|
23
|
+
req.userId = null;
|
24
|
+
if (continueOnFail) {
|
25
|
+
return next();
|
26
|
+
} else {
|
27
|
+
return res.status(401).send({ message: "Unauthorized: No token provided" });
|
28
|
+
}
|
29
|
+
}
|
30
|
+
const decoded = jwt.verify(token, process.env.SECRET_KEY);
|
31
|
+
req.userId = decoded._id;
|
32
|
+
next();
|
33
|
+
} catch (err) {
|
34
|
+
console.log(err);
|
35
|
+
req.userId = null;
|
36
|
+
if (continueOnFail) {
|
37
|
+
next();
|
38
|
+
} else {
|
39
|
+
res.status(401).send({ message: "Unauthorized: Invalid token" });
|
40
|
+
}
|
41
|
+
}
|
42
|
+
};
|
43
|
+
};
|
44
|
+
const checkRole = (roleToCheck) => async (req, res, next) => {
|
45
|
+
try {
|
46
|
+
const user = await User.findById(req.userId).exec();
|
47
|
+
if (!user) {
|
48
|
+
return res.status(404).send({ message: "User Not found." });
|
49
|
+
}
|
50
|
+
const roles = await Role.find({ _id: { $in: user.roles } }).exec();
|
51
|
+
for (let role of roles) {
|
52
|
+
if (role.name === roleToCheck) {
|
53
|
+
next();
|
54
|
+
return;
|
55
|
+
}
|
56
|
+
}
|
57
|
+
res.status(403).send({ message: `Require ${roleToCheck} Role!` });
|
58
|
+
} catch (err) {
|
59
|
+
res.status(500).send({ message: err.message });
|
60
|
+
}
|
61
|
+
};
|
62
|
+
const isAdmin = checkRole("admin");
|
63
|
+
const isModerator = checkRole("moderator");
|
64
|
+
return {
|
65
|
+
verifyToken,
|
66
|
+
isAdmin,
|
67
|
+
isModerator
|
68
|
+
};
|
69
|
+
};
|
70
|
+
authJwt = middlewareFactory;
|
71
|
+
return authJwt;
|
72
|
+
}
|
73
|
+
var authSecret;
|
74
|
+
var hasRequiredAuthSecret;
|
75
|
+
function requireAuthSecret() {
|
76
|
+
if (hasRequiredAuthSecret) return authSecret;
|
77
|
+
hasRequiredAuthSecret = 1;
|
78
|
+
const crypto = require$$0$1;
|
79
|
+
const middlewareFactory = () => {
|
80
|
+
const verifySecret = (method, endpoint, secret) => async (req, res, next) => {
|
81
|
+
const requestSignature = req.headers.signature;
|
82
|
+
const signature = crypto.createHmac("sha256", secret).update(method + endpoint).digest("hex");
|
83
|
+
if (signature === requestSignature) {
|
84
|
+
return next();
|
85
|
+
}
|
86
|
+
res.status(403).send("Forbidden");
|
87
|
+
};
|
88
|
+
return { verifySecret };
|
89
|
+
};
|
90
|
+
authSecret = middlewareFactory;
|
91
|
+
return authSecret;
|
92
|
+
}
|
93
|
+
var verifySignUp;
|
94
|
+
var hasRequiredVerifySignUp;
|
95
|
+
function requireVerifySignUp() {
|
96
|
+
if (hasRequiredVerifySignUp) return verifySignUp;
|
97
|
+
hasRequiredVerifySignUp = 1;
|
98
|
+
const middlewareFactory = (db) => {
|
99
|
+
const User = db.user;
|
100
|
+
db.role;
|
101
|
+
const checkDuplicateUsernameOrEmail = async (req, res, next) => {
|
102
|
+
const { type, email, phone } = req.body;
|
103
|
+
console.log(req.body);
|
104
|
+
let query;
|
105
|
+
if (type === "phone" && phone) {
|
106
|
+
query = { phone };
|
107
|
+
}
|
108
|
+
if (type === "email" && email) {
|
109
|
+
query = { email };
|
110
|
+
}
|
111
|
+
try {
|
112
|
+
const user = await User.findOne(query).exec();
|
113
|
+
if (user) {
|
114
|
+
console.log(`USER_ALREADY_REGISTERED`);
|
115
|
+
res.status(400).send({ errorCode: "USER_ALREADY_REGISTERED" });
|
116
|
+
return;
|
117
|
+
}
|
118
|
+
next();
|
119
|
+
} catch (err) {
|
120
|
+
console.log(err);
|
121
|
+
res.status(500).send({ message: err.message });
|
122
|
+
}
|
123
|
+
};
|
124
|
+
const checkRolesExisted = (req, res, next) => {
|
125
|
+
next();
|
126
|
+
};
|
127
|
+
return {
|
128
|
+
checkDuplicateUsernameOrEmail,
|
129
|
+
checkRolesExisted
|
130
|
+
};
|
131
|
+
};
|
132
|
+
verifySignUp = middlewareFactory;
|
133
|
+
return verifySignUp;
|
134
|
+
}
|
135
|
+
var verifyUser;
|
136
|
+
var hasRequiredVerifyUser;
|
137
|
+
function requireVerifyUser() {
|
138
|
+
if (hasRequiredVerifyUser) return verifyUser;
|
139
|
+
hasRequiredVerifyUser = 1;
|
140
|
+
const middlewareFactory = (db) => {
|
141
|
+
const User = db.user;
|
142
|
+
db.role;
|
143
|
+
const checkUserExist = async (req, res, next) => {
|
144
|
+
const { type, email, phone } = req.body;
|
145
|
+
let query;
|
146
|
+
if (type === "phone" && phone) {
|
147
|
+
query = { phone };
|
148
|
+
}
|
149
|
+
if (type === "email" && email) {
|
150
|
+
query = { email };
|
151
|
+
}
|
152
|
+
try {
|
153
|
+
const user = await User.findOne(query).exec();
|
154
|
+
if (!user) {
|
155
|
+
console.log(query);
|
156
|
+
res.status(400).send({ errorCode: "USER_NOT_REGISTERED_YET" });
|
157
|
+
return;
|
158
|
+
}
|
159
|
+
next();
|
160
|
+
} catch (err) {
|
161
|
+
res.status(500).send({ message: err.message });
|
162
|
+
}
|
163
|
+
};
|
164
|
+
return {
|
165
|
+
checkUserExist
|
166
|
+
};
|
167
|
+
};
|
168
|
+
verifyUser = middlewareFactory;
|
169
|
+
return verifyUser;
|
170
|
+
}
|
171
|
+
var verifyInvites;
|
172
|
+
var hasRequiredVerifyInvites;
|
173
|
+
function requireVerifyInvites() {
|
174
|
+
if (hasRequiredVerifyInvites) return verifyInvites;
|
175
|
+
hasRequiredVerifyInvites = 1;
|
176
|
+
const { ObjectId } = require$$0$2;
|
177
|
+
const middlewareFactory = (db) => {
|
178
|
+
const User = db.user;
|
179
|
+
const Invite = db.invite;
|
180
|
+
const Membership = db.membership;
|
181
|
+
const checkInviteExist = async (req, res, next) => {
|
182
|
+
for (let invite of req.body.invites) {
|
183
|
+
let query;
|
184
|
+
if (invite.contact.includes("@")) {
|
185
|
+
query = { invitedEmail: invite.contact };
|
186
|
+
} else {
|
187
|
+
query = { invitedPhone: invite.contact };
|
188
|
+
}
|
189
|
+
query["owner.target"] = req.body.owner.target;
|
190
|
+
const userInvite = await Invite.findOne(query).exec();
|
191
|
+
if (userInvite) {
|
192
|
+
console.log(userInvite);
|
193
|
+
res.status(400).send({ message: "Инвайт c таким email или телефоном уже создан!" });
|
194
|
+
return;
|
195
|
+
}
|
196
|
+
}
|
197
|
+
next();
|
198
|
+
};
|
199
|
+
const checkUsersExist = async (req, res, next) => {
|
200
|
+
for (let invite of req.body.invites) {
|
201
|
+
let query;
|
202
|
+
if (invite.contact.includes("@")) {
|
203
|
+
query = { email: invite.contact };
|
204
|
+
} else {
|
205
|
+
query = { phone: invite.contact };
|
206
|
+
}
|
207
|
+
const user = await User.findOne(query).exec();
|
208
|
+
console.log(req.params);
|
209
|
+
if (user) {
|
210
|
+
const membership = await Membership.findOne({ user: new ObjectId(user._id), "owner.target": req.body.owner.target }).exec();
|
211
|
+
if (membership) {
|
212
|
+
console.log(membership);
|
213
|
+
res.status(400).send({ message: "Пользователь с таким email или телефоном уже добавлен в организацию!" });
|
214
|
+
return;
|
215
|
+
}
|
216
|
+
}
|
217
|
+
}
|
218
|
+
next();
|
219
|
+
};
|
220
|
+
return {
|
221
|
+
checkInviteExist,
|
222
|
+
checkUsersExist
|
223
|
+
};
|
224
|
+
};
|
225
|
+
verifyInvites = middlewareFactory;
|
226
|
+
return verifyInvites;
|
227
|
+
}
|
228
|
+
const middlewareIndexFactory = (db) => {
|
229
|
+
const authJwt2 = requireAuthJwt()(db);
|
230
|
+
const authSecret2 = requireAuthSecret()();
|
231
|
+
const verifySignUp2 = requireVerifySignUp()(db);
|
232
|
+
const verifyUser2 = requireVerifyUser()(db);
|
233
|
+
const verifyInvites2 = requireVerifyInvites()(db);
|
234
|
+
return {
|
235
|
+
authJwt: authJwt2,
|
236
|
+
authSecret: authSecret2,
|
237
|
+
verifySignUp: verifySignUp2,
|
238
|
+
verifyUser: verifyUser2,
|
239
|
+
verifyInvites: verifyInvites2
|
240
|
+
};
|
241
|
+
};
|
242
|
+
var middlewares = middlewareIndexFactory;
|
243
|
+
exports.middlewares = middlewares;
|
@@ -0,0 +1,244 @@
|
|
1
|
+
import require$$0 from "jsonwebtoken";
|
2
|
+
import require$$0$1 from "crypto";
|
3
|
+
import require$$0$2 from "mongodb";
|
4
|
+
var authJwt;
|
5
|
+
var hasRequiredAuthJwt;
|
6
|
+
function requireAuthJwt() {
|
7
|
+
if (hasRequiredAuthJwt) return authJwt;
|
8
|
+
hasRequiredAuthJwt = 1;
|
9
|
+
const jwt = require$$0;
|
10
|
+
const middlewareFactory = (db) => {
|
11
|
+
const User = db.user;
|
12
|
+
const Role = db.role;
|
13
|
+
const verifyToken = (continueOnFail = false) => {
|
14
|
+
return async (req, res, next) => {
|
15
|
+
try {
|
16
|
+
let token = req.headers["x-access-token"];
|
17
|
+
if (!token && req.cookies.user) {
|
18
|
+
let user = JSON.parse(req.cookies.user);
|
19
|
+
token = user.accessToken;
|
20
|
+
}
|
21
|
+
if (!token) {
|
22
|
+
req.userId = null;
|
23
|
+
if (continueOnFail) {
|
24
|
+
return next();
|
25
|
+
} else {
|
26
|
+
return res.status(401).send({ message: "Unauthorized: No token provided" });
|
27
|
+
}
|
28
|
+
}
|
29
|
+
const decoded = jwt.verify(token, process.env.SECRET_KEY);
|
30
|
+
req.userId = decoded._id;
|
31
|
+
next();
|
32
|
+
} catch (err) {
|
33
|
+
console.log(err);
|
34
|
+
req.userId = null;
|
35
|
+
if (continueOnFail) {
|
36
|
+
next();
|
37
|
+
} else {
|
38
|
+
res.status(401).send({ message: "Unauthorized: Invalid token" });
|
39
|
+
}
|
40
|
+
}
|
41
|
+
};
|
42
|
+
};
|
43
|
+
const checkRole = (roleToCheck) => async (req, res, next) => {
|
44
|
+
try {
|
45
|
+
const user = await User.findById(req.userId).exec();
|
46
|
+
if (!user) {
|
47
|
+
return res.status(404).send({ message: "User Not found." });
|
48
|
+
}
|
49
|
+
const roles = await Role.find({ _id: { $in: user.roles } }).exec();
|
50
|
+
for (let role of roles) {
|
51
|
+
if (role.name === roleToCheck) {
|
52
|
+
next();
|
53
|
+
return;
|
54
|
+
}
|
55
|
+
}
|
56
|
+
res.status(403).send({ message: `Require ${roleToCheck} Role!` });
|
57
|
+
} catch (err) {
|
58
|
+
res.status(500).send({ message: err.message });
|
59
|
+
}
|
60
|
+
};
|
61
|
+
const isAdmin = checkRole("admin");
|
62
|
+
const isModerator = checkRole("moderator");
|
63
|
+
return {
|
64
|
+
verifyToken,
|
65
|
+
isAdmin,
|
66
|
+
isModerator
|
67
|
+
};
|
68
|
+
};
|
69
|
+
authJwt = middlewareFactory;
|
70
|
+
return authJwt;
|
71
|
+
}
|
72
|
+
var authSecret;
|
73
|
+
var hasRequiredAuthSecret;
|
74
|
+
function requireAuthSecret() {
|
75
|
+
if (hasRequiredAuthSecret) return authSecret;
|
76
|
+
hasRequiredAuthSecret = 1;
|
77
|
+
const crypto = require$$0$1;
|
78
|
+
const middlewareFactory = () => {
|
79
|
+
const verifySecret = (method, endpoint, secret) => async (req, res, next) => {
|
80
|
+
const requestSignature = req.headers.signature;
|
81
|
+
const signature = crypto.createHmac("sha256", secret).update(method + endpoint).digest("hex");
|
82
|
+
if (signature === requestSignature) {
|
83
|
+
return next();
|
84
|
+
}
|
85
|
+
res.status(403).send("Forbidden");
|
86
|
+
};
|
87
|
+
return { verifySecret };
|
88
|
+
};
|
89
|
+
authSecret = middlewareFactory;
|
90
|
+
return authSecret;
|
91
|
+
}
|
92
|
+
var verifySignUp;
|
93
|
+
var hasRequiredVerifySignUp;
|
94
|
+
function requireVerifySignUp() {
|
95
|
+
if (hasRequiredVerifySignUp) return verifySignUp;
|
96
|
+
hasRequiredVerifySignUp = 1;
|
97
|
+
const middlewareFactory = (db) => {
|
98
|
+
const User = db.user;
|
99
|
+
db.role;
|
100
|
+
const checkDuplicateUsernameOrEmail = async (req, res, next) => {
|
101
|
+
const { type, email, phone } = req.body;
|
102
|
+
console.log(req.body);
|
103
|
+
let query;
|
104
|
+
if (type === "phone" && phone) {
|
105
|
+
query = { phone };
|
106
|
+
}
|
107
|
+
if (type === "email" && email) {
|
108
|
+
query = { email };
|
109
|
+
}
|
110
|
+
try {
|
111
|
+
const user = await User.findOne(query).exec();
|
112
|
+
if (user) {
|
113
|
+
console.log(`USER_ALREADY_REGISTERED`);
|
114
|
+
res.status(400).send({ errorCode: "USER_ALREADY_REGISTERED" });
|
115
|
+
return;
|
116
|
+
}
|
117
|
+
next();
|
118
|
+
} catch (err) {
|
119
|
+
console.log(err);
|
120
|
+
res.status(500).send({ message: err.message });
|
121
|
+
}
|
122
|
+
};
|
123
|
+
const checkRolesExisted = (req, res, next) => {
|
124
|
+
next();
|
125
|
+
};
|
126
|
+
return {
|
127
|
+
checkDuplicateUsernameOrEmail,
|
128
|
+
checkRolesExisted
|
129
|
+
};
|
130
|
+
};
|
131
|
+
verifySignUp = middlewareFactory;
|
132
|
+
return verifySignUp;
|
133
|
+
}
|
134
|
+
var verifyUser;
|
135
|
+
var hasRequiredVerifyUser;
|
136
|
+
function requireVerifyUser() {
|
137
|
+
if (hasRequiredVerifyUser) return verifyUser;
|
138
|
+
hasRequiredVerifyUser = 1;
|
139
|
+
const middlewareFactory = (db) => {
|
140
|
+
const User = db.user;
|
141
|
+
db.role;
|
142
|
+
const checkUserExist = async (req, res, next) => {
|
143
|
+
const { type, email, phone } = req.body;
|
144
|
+
let query;
|
145
|
+
if (type === "phone" && phone) {
|
146
|
+
query = { phone };
|
147
|
+
}
|
148
|
+
if (type === "email" && email) {
|
149
|
+
query = { email };
|
150
|
+
}
|
151
|
+
try {
|
152
|
+
const user = await User.findOne(query).exec();
|
153
|
+
if (!user) {
|
154
|
+
console.log(query);
|
155
|
+
res.status(400).send({ errorCode: "USER_NOT_REGISTERED_YET" });
|
156
|
+
return;
|
157
|
+
}
|
158
|
+
next();
|
159
|
+
} catch (err) {
|
160
|
+
res.status(500).send({ message: err.message });
|
161
|
+
}
|
162
|
+
};
|
163
|
+
return {
|
164
|
+
checkUserExist
|
165
|
+
};
|
166
|
+
};
|
167
|
+
verifyUser = middlewareFactory;
|
168
|
+
return verifyUser;
|
169
|
+
}
|
170
|
+
var verifyInvites;
|
171
|
+
var hasRequiredVerifyInvites;
|
172
|
+
function requireVerifyInvites() {
|
173
|
+
if (hasRequiredVerifyInvites) return verifyInvites;
|
174
|
+
hasRequiredVerifyInvites = 1;
|
175
|
+
const { ObjectId } = require$$0$2;
|
176
|
+
const middlewareFactory = (db) => {
|
177
|
+
const User = db.user;
|
178
|
+
const Invite = db.invite;
|
179
|
+
const Membership = db.membership;
|
180
|
+
const checkInviteExist = async (req, res, next) => {
|
181
|
+
for (let invite of req.body.invites) {
|
182
|
+
let query;
|
183
|
+
if (invite.contact.includes("@")) {
|
184
|
+
query = { invitedEmail: invite.contact };
|
185
|
+
} else {
|
186
|
+
query = { invitedPhone: invite.contact };
|
187
|
+
}
|
188
|
+
query["owner.target"] = req.body.owner.target;
|
189
|
+
const userInvite = await Invite.findOne(query).exec();
|
190
|
+
if (userInvite) {
|
191
|
+
console.log(userInvite);
|
192
|
+
res.status(400).send({ message: "Инвайт c таким email или телефоном уже создан!" });
|
193
|
+
return;
|
194
|
+
}
|
195
|
+
}
|
196
|
+
next();
|
197
|
+
};
|
198
|
+
const checkUsersExist = async (req, res, next) => {
|
199
|
+
for (let invite of req.body.invites) {
|
200
|
+
let query;
|
201
|
+
if (invite.contact.includes("@")) {
|
202
|
+
query = { email: invite.contact };
|
203
|
+
} else {
|
204
|
+
query = { phone: invite.contact };
|
205
|
+
}
|
206
|
+
const user = await User.findOne(query).exec();
|
207
|
+
console.log(req.params);
|
208
|
+
if (user) {
|
209
|
+
const membership = await Membership.findOne({ user: new ObjectId(user._id), "owner.target": req.body.owner.target }).exec();
|
210
|
+
if (membership) {
|
211
|
+
console.log(membership);
|
212
|
+
res.status(400).send({ message: "Пользователь с таким email или телефоном уже добавлен в организацию!" });
|
213
|
+
return;
|
214
|
+
}
|
215
|
+
}
|
216
|
+
}
|
217
|
+
next();
|
218
|
+
};
|
219
|
+
return {
|
220
|
+
checkInviteExist,
|
221
|
+
checkUsersExist
|
222
|
+
};
|
223
|
+
};
|
224
|
+
verifyInvites = middlewareFactory;
|
225
|
+
return verifyInvites;
|
226
|
+
}
|
227
|
+
const middlewareIndexFactory = (db) => {
|
228
|
+
const authJwt2 = requireAuthJwt()(db);
|
229
|
+
const authSecret2 = requireAuthSecret()();
|
230
|
+
const verifySignUp2 = requireVerifySignUp()(db);
|
231
|
+
const verifyUser2 = requireVerifyUser()(db);
|
232
|
+
const verifyInvites2 = requireVerifyInvites()(db);
|
233
|
+
return {
|
234
|
+
authJwt: authJwt2,
|
235
|
+
authSecret: authSecret2,
|
236
|
+
verifySignUp: verifySignUp2,
|
237
|
+
verifyUser: verifyUser2,
|
238
|
+
verifyInvites: verifyInvites2
|
239
|
+
};
|
240
|
+
};
|
241
|
+
var middlewares = middlewareIndexFactory;
|
242
|
+
export {
|
243
|
+
middlewares as m
|
244
|
+
};
|