@ozdao/prometheus-framework 0.2.252 → 0.2.253
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/auth.server.js +298 -14
- package/dist/auth.server.mjs +298 -14
- package/dist/builder.js +4 -4
- package/dist/builder.mjs +4 -4
- package/dist/community.server.js +38 -21
- package/dist/community.server.mjs +38 -21
- package/dist/events.server.js +38 -18
- package/dist/events.server.mjs +38 -17
- package/dist/gallery.server.js +17 -4
- package/dist/gallery.server.mjs +17 -4
- package/dist/organizations.server.js +43 -26
- package/dist/organizations.server.mjs +43 -26
- package/dist/products.server.js +49 -23
- package/dist/products.server.mjs +49 -22
- package/dist/prometheus-framework/src/modules/auth/auth.client.cjs +15 -3
- package/dist/prometheus-framework/src/modules/auth/auth.client.cjs.map +1 -1
- package/dist/prometheus-framework/src/modules/auth/auth.client.js +16 -4
- package/dist/prometheus-framework/src/modules/auth/auth.client.js.map +1 -1
- package/dist/prometheus-framework/src/modules/auth/views/components/blocks/CardUser.vue.cjs +95 -0
- package/dist/prometheus-framework/src/modules/auth/views/components/blocks/CardUser.vue.cjs.map +1 -0
- package/dist/prometheus-framework/src/modules/auth/views/components/blocks/CardUser.vue.js +95 -0
- package/dist/prometheus-framework/src/modules/auth/views/components/blocks/CardUser.vue.js.map +1 -0
- package/dist/prometheus-framework/src/modules/auth/views/components/pages/Profile.vue.cjs +284 -0
- package/dist/prometheus-framework/src/modules/auth/views/components/pages/Profile.vue.cjs.map +1 -0
- package/dist/prometheus-framework/src/modules/auth/views/components/pages/Profile.vue.js +284 -0
- package/dist/prometheus-framework/src/modules/auth/views/components/pages/Profile.vue.js.map +1 -0
- package/dist/prometheus-framework/src/modules/auth/views/components/pages/Profile.vue2.cjs +2 -0
- package/dist/prometheus-framework/src/modules/auth/views/components/pages/Profile.vue2.cjs.map +1 -0
- package/dist/prometheus-framework/src/modules/auth/views/components/pages/Profile.vue2.js +2 -0
- package/dist/prometheus-framework/src/modules/auth/views/components/pages/Profile.vue2.js.map +1 -0
- package/dist/prometheus-framework/src/modules/auth/views/components/pages/ProfileBlogposts.vue.cjs +85 -0
- package/dist/prometheus-framework/src/modules/auth/views/components/pages/ProfileBlogposts.vue.cjs.map +1 -0
- package/dist/prometheus-framework/src/modules/auth/views/components/pages/ProfileBlogposts.vue.js +85 -0
- package/dist/prometheus-framework/src/modules/auth/views/components/pages/ProfileBlogposts.vue.js.map +1 -0
- package/dist/prometheus-framework/src/modules/auth/views/components/pages/ProfileEdit.vue.cjs +176 -0
- package/dist/prometheus-framework/src/modules/auth/views/components/pages/ProfileEdit.vue.cjs.map +1 -0
- package/dist/prometheus-framework/src/modules/auth/views/components/pages/ProfileEdit.vue.js +176 -0
- package/dist/prometheus-framework/src/modules/auth/views/components/pages/ProfileEdit.vue.js.map +1 -0
- package/dist/prometheus-framework/src/modules/auth/views/components/pages/ProfileEdit.vue2.cjs +2 -0
- package/dist/prometheus-framework/src/modules/auth/views/components/pages/ProfileEdit.vue2.cjs.map +1 -0
- package/dist/prometheus-framework/src/modules/auth/views/components/pages/ProfileEdit.vue2.js +2 -0
- package/dist/prometheus-framework/src/modules/auth/views/components/pages/ProfileEdit.vue2.js.map +1 -0
- package/dist/prometheus-framework/src/modules/auth/views/components/sections/FeaturedUsers.vue.cjs +114 -0
- package/dist/prometheus-framework/src/modules/auth/views/components/sections/FeaturedUsers.vue.cjs.map +1 -0
- package/dist/prometheus-framework/src/modules/auth/views/components/sections/FeaturedUsers.vue.js +114 -0
- package/dist/prometheus-framework/src/modules/auth/views/components/sections/FeaturedUsers.vue.js.map +1 -0
- package/dist/prometheus-framework/src/modules/auth/views/components/sections/ProfileCompletion.vue.cjs +72 -0
- package/dist/prometheus-framework/src/modules/auth/views/components/sections/ProfileCompletion.vue.cjs.map +1 -0
- package/dist/prometheus-framework/src/modules/auth/views/components/sections/ProfileCompletion.vue.js +72 -0
- package/dist/prometheus-framework/src/modules/auth/views/components/sections/ProfileCompletion.vue.js.map +1 -0
- package/dist/prometheus-framework/src/modules/auth/views/router/users.cjs +97 -0
- package/dist/prometheus-framework/src/modules/auth/views/router/users.cjs.map +1 -0
- package/dist/prometheus-framework/src/modules/auth/views/router/users.js +97 -0
- package/dist/prometheus-framework/src/modules/auth/views/router/users.js.map +1 -0
- package/dist/prometheus-framework/src/modules/auth/views/store/users.cjs +95 -0
- package/dist/prometheus-framework/src/modules/auth/views/store/users.cjs.map +1 -0
- package/dist/prometheus-framework/src/modules/auth/views/store/users.js +95 -0
- package/dist/prometheus-framework/src/modules/auth/views/store/users.js.map +1 -0
- package/dist/prometheus-framework/src/modules/backoffice/backoffice.client.cjs +32 -2
- package/dist/prometheus-framework/src/modules/backoffice/backoffice.client.cjs.map +1 -1
- package/dist/prometheus-framework/src/modules/backoffice/backoffice.client.js +32 -2
- package/dist/prometheus-framework/src/modules/backoffice/backoffice.client.js.map +1 -1
- package/dist/prometheus-framework/src/modules/backoffice/router/backoffice.cjs +2 -2
- package/dist/prometheus-framework/src/modules/backoffice/router/backoffice.cjs.map +1 -1
- package/dist/prometheus-framework/src/modules/backoffice/router/backoffice.js +2 -2
- package/dist/prometheus-framework/src/modules/backoffice/router/backoffice.js.map +1 -1
- package/dist/prometheus-framework/src/modules/community/community.client.cjs +42 -7
- package/dist/prometheus-framework/src/modules/community/community.client.cjs.map +1 -1
- package/dist/prometheus-framework/src/modules/community/community.client.js +59 -24
- package/dist/prometheus-framework/src/modules/community/community.client.js.map +1 -1
- package/dist/prometheus-framework/src/modules/community/router/blogposts.cjs +68 -70
- package/dist/prometheus-framework/src/modules/community/router/blogposts.cjs.map +1 -1
- package/dist/prometheus-framework/src/modules/community/router/blogposts.js +68 -70
- package/dist/prometheus-framework/src/modules/community/router/blogposts.js.map +1 -1
- package/dist/prometheus-framework/src/modules/gallery/gallery.client.cjs +26 -3
- package/dist/prometheus-framework/src/modules/gallery/gallery.client.cjs.map +1 -1
- package/dist/prometheus-framework/src/modules/gallery/gallery.client.js +27 -4
- package/dist/prometheus-framework/src/modules/gallery/gallery.client.js.map +1 -1
- package/dist/prometheus-framework/src/modules/gallery/router/gallery.router.cjs +2 -2
- package/dist/prometheus-framework/src/modules/gallery/router/gallery.router.cjs.map +1 -1
- package/dist/prometheus-framework/src/modules/gallery/router/gallery.router.js +2 -2
- package/dist/prometheus-framework/src/modules/gallery/router/gallery.router.js.map +1 -1
- package/dist/prometheus-framework/src/modules/orders/components/pages/OrderCreate.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/orders/components/pages/OrderCreate.vue.cjs.map +1 -1
- package/dist/prometheus-framework/src/modules/orders/components/pages/OrderCreate.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/orders/components/pages/OrderCreate.vue.js.map +1 -1
- 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.cjs.map +1 -1
- package/dist/prometheus-framework/src/modules/orders/components/pages/OrderCreateBackoffice.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/orders/components/pages/OrderCreateBackoffice.vue.js.map +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.cjs.map +1 -1
- package/dist/prometheus-framework/src/modules/orders/components/sections/FormAddCustomer.vue.js +2 -2
- package/dist/prometheus-framework/src/modules/orders/components/sections/FormAddCustomer.vue.js.map +1 -1
- package/dist/prometheus-framework/src/modules/orders/orders.client.cjs +4 -1
- package/dist/prometheus-framework/src/modules/orders/orders.client.cjs.map +1 -1
- package/dist/prometheus-framework/src/modules/orders/orders.client.js +4 -1
- package/dist/prometheus-framework/src/modules/orders/orders.client.js.map +1 -1
- package/dist/prometheus-framework/src/modules/orders/store/testimonials.cjs +63 -0
- package/dist/prometheus-framework/src/modules/orders/store/testimonials.cjs.map +1 -0
- package/dist/prometheus-framework/src/modules/orders/store/testimonials.js +63 -0
- package/dist/prometheus-framework/src/modules/orders/store/testimonials.js.map +1 -0
- package/dist/prometheus-framework/src/modules/organizations/components/blocks/CardDepartment.vue.cjs +2 -2
- package/dist/prometheus-framework/src/modules/organizations/components/blocks/CardDepartment.vue.cjs.map +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/blocks/CardDepartment.vue.js +2 -2
- package/dist/prometheus-framework/src/modules/organizations/components/blocks/CardDepartment.vue.js.map +1 -1
- 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.cjs.map +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/CardOrganization.vue.js.map +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.cjs.map +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/pages/Department.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/pages/Department.vue.js.map +1 -1
- 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.cjs.map +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/pages/DepartmentEdit.vue.js +1 -1
- 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.cjs.map +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/Members.vue.js.map +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/pages/Organization.vue.cjs.map +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/pages/Organization.vue.js.map +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.cjs.map +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/sections/MembersAdd.vue.js +2 -2
- package/dist/prometheus-framework/src/modules/organizations/components/sections/MembersAdd.vue.js.map +1 -1
- package/dist/prometheus-framework/src/modules/organizations/organizations.client.cjs +60 -11
- package/dist/prometheus-framework/src/modules/organizations/organizations.client.cjs.map +1 -1
- package/dist/prometheus-framework/src/modules/organizations/organizations.client.js +95 -46
- package/dist/prometheus-framework/src/modules/organizations/organizations.client.js.map +1 -1
- package/dist/prometheus-framework/src/modules/organizations/router/organizations.cjs +6 -10
- package/dist/prometheus-framework/src/modules/organizations/router/organizations.cjs.map +1 -1
- package/dist/prometheus-framework/src/modules/organizations/router/organizations.js +8 -12
- package/dist/prometheus-framework/src/modules/organizations/router/organizations.js.map +1 -1
- package/dist/prometheus-framework/src/modules/pages/pages.client.cjs +544 -544
- package/dist/prometheus-framework/src/modules/pages/pages.client.js +544 -544
- package/dist/prometheus-framework/src/modules/products/components/layouts/Marketplace.vue.cjs +178 -0
- package/dist/prometheus-framework/src/modules/products/components/layouts/Marketplace.vue.cjs.map +1 -0
- package/dist/prometheus-framework/src/modules/products/components/layouts/Marketplace.vue.js +178 -0
- package/dist/prometheus-framework/src/modules/products/components/layouts/Marketplace.vue.js.map +1 -0
- package/dist/prometheus-framework/src/modules/products/components/pages/Catalog.vue.cjs +62 -0
- package/dist/prometheus-framework/src/modules/products/components/pages/Catalog.vue.cjs.map +1 -0
- package/dist/prometheus-framework/src/modules/products/components/pages/Catalog.vue.js +62 -0
- package/dist/prometheus-framework/src/modules/products/components/pages/Catalog.vue.js.map +1 -0
- package/dist/prometheus-framework/src/modules/products/components/pages/ProductRecommmendation.vue.cjs +2 -2
- package/dist/prometheus-framework/src/modules/products/components/pages/ProductRecommmendation.vue.js +2 -2
- 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.cjs.map +1 -1
- package/dist/prometheus-framework/src/modules/products/components/pages/Products.vue.js +2 -2
- package/dist/prometheus-framework/src/modules/products/components/pages/Products.vue.js.map +1 -1
- package/dist/prometheus-framework/src/modules/products/components/sections/FilterProducts.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/products/components/sections/FilterProducts.vue.cjs.map +1 -1
- package/dist/prometheus-framework/src/modules/products/components/sections/FilterProducts.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/products/components/sections/FilterProducts.vue.js.map +1 -1
- package/dist/prometheus-framework/src/modules/products/components/sections/Filters.vue.cjs +156 -0
- package/dist/prometheus-framework/src/modules/products/components/sections/Filters.vue.cjs.map +1 -0
- package/dist/prometheus-framework/src/modules/products/components/sections/Filters.vue.js +157 -0
- package/dist/prometheus-framework/src/modules/products/components/sections/Filters.vue.js.map +1 -0
- package/dist/prometheus-framework/src/modules/products/components/sections/HeroRecommendation.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/products/components/sections/HeroRecommendation.vue.cjs.map +1 -1
- package/dist/prometheus-framework/src/modules/products/components/sections/HeroRecommendation.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/products/components/sections/HeroRecommendation.vue.js.map +1 -1
- 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.cjs.map +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/PopularProducts.vue.js.map +1 -1
- package/dist/prometheus-framework/src/modules/products/products.client.cjs +72 -7
- package/dist/prometheus-framework/src/modules/products/products.client.cjs.map +1 -1
- package/dist/prometheus-framework/src/modules/products/products.client.js +114 -49
- package/dist/prometheus-framework/src/modules/products/products.client.js.map +1 -1
- package/dist/prometheus-framework/src/modules/products/router/marketplace.router.cjs +46 -0
- package/dist/prometheus-framework/src/modules/products/router/marketplace.router.cjs.map +1 -0
- package/dist/prometheus-framework/src/modules/products/router/marketplace.router.js +46 -0
- package/dist/prometheus-framework/src/modules/products/router/marketplace.router.js.map +1 -0
- package/dist/prometheus-framework/src/modules/products/router/products.router.cjs +79 -36
- package/dist/prometheus-framework/src/modules/products/router/products.router.cjs.map +1 -1
- package/dist/prometheus-framework/src/modules/products/router/products.router.js +78 -35
- package/dist/prometheus-framework/src/modules/products/router/products.router.js.map +1 -1
- package/dist/prometheus-framework/src/modules/products/store/marketplace.cjs +57 -0
- package/dist/prometheus-framework/src/modules/products/store/marketplace.cjs.map +1 -0
- package/dist/prometheus-framework/src/modules/products/store/marketplace.js +57 -0
- package/dist/prometheus-framework/src/modules/products/store/marketplace.js.map +1 -0
- 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.cjs.map +1 -1
- package/dist/prometheus-framework/src/modules/spots/components/layouts/Spots.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/spots/components/layouts/Spots.vue.js.map +1 -1
- package/dist/prometheus-framework/src/modules/spots/components/pages/Map.vue.cjs +2 -2
- package/dist/prometheus-framework/src/modules/spots/components/pages/Map.vue.cjs.map +1 -1
- package/dist/prometheus-framework/src/modules/spots/components/pages/Map.vue.js +2 -2
- package/dist/prometheus-framework/src/modules/spots/components/pages/Map.vue.js.map +1 -1
- package/dist/prometheus-framework/src/modules/spots/components/pages/Spot.vue.cjs +2 -2
- package/dist/prometheus-framework/src/modules/spots/components/pages/Spot.vue.cjs.map +1 -1
- package/dist/prometheus-framework/src/modules/spots/components/pages/Spot.vue.js +2 -2
- package/dist/prometheus-framework/src/modules/spots/components/pages/Spot.vue.js.map +1 -1
- package/package.json +1 -1
- package/src/builder/webpack/webpack.config.client.js +2 -2
- package/src/builder/webpack/webpack.config.server.js +1 -1
- package/src/builder/webpack/webpack.config.spa.js +1 -1
- package/src/builder/webpack/webpack.config.ssr.js +1 -1
- package/src/modules/auth/auth.client.js +16 -3
- package/src/modules/auth/auth.server.js +22 -1
- package/src/modules/{users → auth/controllers}/routes/users.routes.js +1 -1
- package/src/modules/auth/controllers/services/auth.service.js +0 -1
- package/src/modules/{users → auth/views}/components/pages/Profile.vue +1 -1
- package/src/modules/{users → auth/views}/components/pages/ProfileEdit.vue +2 -2
- package/src/modules/{users → auth/views}/components/sections/FeaturedUsers.vue +2 -2
- package/src/modules/auth/views/router/users.js +79 -0
- package/src/modules/backoffice/backoffice.client.js +53 -11
- package/src/modules/backoffice/router/backoffice.js +29 -2
- package/src/modules/community/community.client.js +56 -10
- package/src/modules/community/community.server.js +35 -14
- package/src/modules/community/models/comment.model.js +7 -7
- package/src/modules/community/models/reaction.model.js +5 -5
- package/src/modules/community/router/blogposts.js +55 -57
- package/src/modules/events/events.server.js +37 -16
- package/src/modules/events/models/ticket.model.js +6 -6
- package/src/modules/gallery/gallery.client.js +44 -8
- package/src/modules/gallery/gallery.server.js +28 -9
- package/src/modules/gallery/router/gallery.router.js +2 -2
- package/src/modules/orders/components/pages/OrderCreate.vue +1 -1
- package/src/modules/orders/components/pages/OrderCreateBackoffice.vue +1 -1
- package/src/modules/orders/components/sections/FormAddCustomer.vue +2 -2
- package/src/modules/orders/orders.client.js +4 -1
- package/src/modules/orders/orders.server.js +1 -0
- package/src/modules/organizations/components/blocks/CardDepartment.vue +1 -1
- package/src/modules/organizations/components/blocks/CardOrganization.vue +1 -1
- package/src/modules/organizations/components/pages/Department.vue +1 -1
- package/src/modules/organizations/components/pages/DepartmentEdit.vue +1 -1
- package/src/modules/organizations/components/pages/Members.vue +1 -1
- package/src/modules/organizations/components/pages/Organization.vue +1 -1
- package/src/modules/organizations/components/sections/MembersAdd.vue +2 -2
- package/src/modules/organizations/controllers/organizations.controller.js +0 -2
- package/src/modules/organizations/models/department.model.js +7 -7
- package/src/modules/organizations/models/membership.model.js +5 -5
- package/src/modules/organizations/organizations.client.js +71 -16
- package/src/modules/organizations/organizations.server.js +43 -18
- package/src/modules/organizations/router/organizations.js +6 -13
- package/src/modules/{marketplace → products}/components/layouts/Marketplace.vue +19 -19
- package/src/modules/{marketplace → products}/components/pages/Catalog.vue +0 -2
- package/src/modules/products/components/pages/Products.vue +2 -2
- package/src/modules/products/components/sections/FilterProducts.vue +1 -1
- package/src/modules/{marketplace → products}/components/sections/Filters.vue +12 -15
- package/src/modules/products/components/sections/HeroRecommendation.vue +1 -1
- package/src/modules/products/components/sections/PopularProducts.vue +1 -1
- package/src/modules/products/models/category.model.js +3 -3
- package/src/modules/products/models/product.model.js +7 -7
- package/src/modules/products/products.client.js +93 -25
- package/src/modules/products/products.server.js +47 -16
- package/src/modules/products/router/marketplace.router.js +38 -0
- package/src/modules/products/router/products.router.js +72 -32
- package/src/modules/spots/components/layouts/Spots.vue +1 -1
- package/src/modules/spots/components/pages/Map.vue +1 -1
- package/src/modules/spots/components/pages/Spot.vue +1 -1
- package/src/modules/backoffice/router/admin.js +0 -51
- package/src/modules/landing/components/pages/404.vue +0 -3
- package/src/modules/landing/components/pages/Farming.vue +0 -226
- package/src/modules/landing/components/pages/Governance.vue +0 -144
- package/src/modules/landing/components/pages/Home.vue +0 -51
- package/src/modules/landing/components/pages/Hotel.vue +0 -43
- package/src/modules/landing/router/landing.js +0 -39
- package/src/modules/legal/components/pages/Legal.vue +0 -62
- package/src/modules/legal/components/pages/legal/Cookies.vue +0 -370
- package/src/modules/legal/components/pages/legal/EULA.vue +0 -2145
- package/src/modules/legal/components/pages/legal/Privacy.vue +0 -4284
- package/src/modules/legal/components/pages/legal/Terms.vue +0 -1283
- package/src/modules/legal/legal.client.js +0 -18
- package/src/modules/legal/router/legal.js +0 -59
- package/src/modules/marketplace/router/marketplace.js +0 -54
- package/src/modules/users/router/users.js +0 -90
- package/src/modules/users/users.client.js +0 -22
- package/src/modules/users/users.server.js +0 -13
- /package/src/modules/{users → auth/controllers}/middlewares/visitor.logger.js +0 -0
- /package/src/modules/{users/controllers/users.controller.js → auth/controllers/services/users.service.js} +0 -0
- /package/src/modules/{users → auth}/models/request.model.js +0 -0
- /package/src/modules/{users → auth}/models/user.model.js +0 -0
- /package/src/modules/{users → auth}/models/visitor.model.js +0 -0
- /package/src/modules/{users → auth/views}/components/blocks/CardUser.vue +0 -0
- /package/src/modules/{users → auth/views}/components/pages/ProfileBlogposts.vue +0 -0
- /package/src/modules/{users → auth/views}/components/pages/ProfileComments.vue +0 -0
- /package/src/modules/{users → auth/views}/components/pages/ProfileLikes.vue +0 -0
- /package/src/modules/{users → auth/views}/components/sections/ProfileCompletion.vue +0 -0
- /package/src/modules/{users → auth/views}/router/account.js +0 -0
- /package/src/modules/{users → auth/views}/store/users.js +0 -0
- /package/src/modules/{projects/controller → governance/controllers/factories}/projects.controller.js +0 -0
- /package/src/modules/{projects → governance/controllers}/routes/projects.routes.js +0 -0
- /package/src/modules/{projects → governance}/models/project.model.js +0 -0
- /package/src/modules/{projects → governance/views}/store/projects.js +0 -0
- /package/src/modules/{marketplace → products}/store/marketplace.js +0 -0
package/dist/auth.server.mjs
CHANGED
@@ -1,10 +1,72 @@
|
|
1
1
|
import { g as getDefaultExportFromCjs } from "./_commonjsHelpers-CUmg6egw.mjs";
|
2
|
+
import { p as profile_schema } from "./profile.schema-24ZpZQJe.mjs";
|
3
|
+
import { c as credentials_schema } from "./credentials.schema-C9dmNy7o.mjs";
|
2
4
|
import require$$0 from "jsonwebtoken";
|
3
5
|
import require$$1$1 from "bcryptjs";
|
4
6
|
import require$$0$1 from "mongoose";
|
5
7
|
import require$$1 from "jwk-to-pem";
|
6
8
|
import { m as mailing } from "./mailing-C3VD4l0h.mjs";
|
7
9
|
import { m as middlewares } from "./index-UIHE6Rk3.mjs";
|
10
|
+
import "uuid";
|
11
|
+
import { a as addUserStatusFields_1, b as addMembersQuantity_1 } from "./addMembersQuantity-BXp_LeQd.mjs";
|
12
|
+
import require$$0$2 from "crypto";
|
13
|
+
var socials_schema = function applySocialsSchema(schema, db) {
|
14
|
+
schema.add({
|
15
|
+
socials: {
|
16
|
+
telegram: {
|
17
|
+
type: String,
|
18
|
+
default: ""
|
19
|
+
},
|
20
|
+
twitter: {
|
21
|
+
type: String,
|
22
|
+
default: ""
|
23
|
+
},
|
24
|
+
facebook: {
|
25
|
+
type: String,
|
26
|
+
default: ""
|
27
|
+
},
|
28
|
+
instagram: {
|
29
|
+
type: String,
|
30
|
+
default: ""
|
31
|
+
}
|
32
|
+
}
|
33
|
+
});
|
34
|
+
};
|
35
|
+
const applyProfileSchema = profile_schema;
|
36
|
+
const applySocialsSchema2 = socials_schema;
|
37
|
+
const applyCredentialsSchema = credentials_schema;
|
38
|
+
var user_model = (db) => {
|
39
|
+
const UserSchema = new db.mongoose.Schema({
|
40
|
+
username: {
|
41
|
+
type: String,
|
42
|
+
unique: true
|
43
|
+
},
|
44
|
+
password: {
|
45
|
+
type: String,
|
46
|
+
required: true
|
47
|
+
},
|
48
|
+
status: {
|
49
|
+
type: String,
|
50
|
+
enum: ["active", "banned", "removed", "inactive"],
|
51
|
+
default: "active",
|
52
|
+
required: true
|
53
|
+
},
|
54
|
+
roles: [{
|
55
|
+
type: db.mongoose.Schema.Types.ObjectId,
|
56
|
+
ref: "Role"
|
57
|
+
}]
|
58
|
+
}, {
|
59
|
+
// Creation Date
|
60
|
+
timestamps: {
|
61
|
+
currentTime: () => Date.now()
|
62
|
+
}
|
63
|
+
});
|
64
|
+
applyProfileSchema(UserSchema);
|
65
|
+
applySocialsSchema2(UserSchema);
|
66
|
+
applyCredentialsSchema(UserSchema);
|
67
|
+
const User = db.mongoose.model("User", UserSchema);
|
68
|
+
return User;
|
69
|
+
};
|
8
70
|
var role_model = (db) => {
|
9
71
|
const RoleSchema = new db.mongoose.Schema({
|
10
72
|
name: String
|
@@ -12,6 +74,31 @@ var role_model = (db) => {
|
|
12
74
|
const Role = db.mongoose.model("Role", RoleSchema);
|
13
75
|
return Role;
|
14
76
|
};
|
77
|
+
var visitor_model = (db) => {
|
78
|
+
const VisitorSchema = new db.mongoose.Schema({
|
79
|
+
ip: String,
|
80
|
+
userAgent: String,
|
81
|
+
acceptLanguage: String,
|
82
|
+
fingerprint: { type: String, unique: true }
|
83
|
+
});
|
84
|
+
VisitorSchema.index({ fingerprint: 1 });
|
85
|
+
const Visitor = db.mongoose.model("Visitor", VisitorSchema);
|
86
|
+
return Visitor;
|
87
|
+
};
|
88
|
+
var request_model = (db) => {
|
89
|
+
const RequestSchema = new db.mongoose.Schema({
|
90
|
+
visitor: {
|
91
|
+
type: db.mongoose.Schema.Types.ObjectId,
|
92
|
+
ref: "Visitor"
|
93
|
+
},
|
94
|
+
path: String,
|
95
|
+
method: String,
|
96
|
+
timestamp: { type: Date, default: Date.now }
|
97
|
+
});
|
98
|
+
RequestSchema.index({ visitor: 1 });
|
99
|
+
const Request = db.mongoose.model("Request", RequestSchema);
|
100
|
+
return Request;
|
101
|
+
};
|
15
102
|
const jwt$1 = require$$0;
|
16
103
|
const jwkToPem = require$$1;
|
17
104
|
async function verifyAppleIdToken$1(id_token) {
|
@@ -51,9 +138,9 @@ async function verifyAppleIdToken$1(id_token) {
|
|
51
138
|
var verifyAppleIdToken_1 = { verifyAppleIdToken: verifyAppleIdToken$1 };
|
52
139
|
const jwt = require$$0;
|
53
140
|
const bcrypt = require$$1$1;
|
54
|
-
const ObjectId = require$$0$1.Types.ObjectId;
|
141
|
+
const ObjectId$1 = require$$0$1.Types.ObjectId;
|
55
142
|
const { verifyAppleIdToken } = verifyAppleIdToken_1;
|
56
|
-
const controllerFactory$
|
143
|
+
const controllerFactory$5 = (db) => {
|
57
144
|
const User = db.user;
|
58
145
|
const Membership = db.membership;
|
59
146
|
const Department = db.department;
|
@@ -162,8 +249,8 @@ const controllerFactory$3 = (db) => {
|
|
162
249
|
await invite.save();
|
163
250
|
const newMembership = new Membership({
|
164
251
|
type: "organization",
|
165
|
-
user: new ObjectId(user._id),
|
166
|
-
target: new ObjectId(invite.owner.target),
|
252
|
+
user: new ObjectId$1(user._id),
|
253
|
+
target: new ObjectId$1(invite.owner.target),
|
167
254
|
role: invite.role,
|
168
255
|
label: invite.role
|
169
256
|
});
|
@@ -290,9 +377,9 @@ const controllerFactory$3 = (db) => {
|
|
290
377
|
checkAccesses
|
291
378
|
};
|
292
379
|
};
|
293
|
-
var auth_service = controllerFactory$
|
380
|
+
var auth_service = controllerFactory$5;
|
294
381
|
const { sendEmail, sendSms } = mailing;
|
295
|
-
const controllerFactory$
|
382
|
+
const controllerFactory$4 = (db) => {
|
296
383
|
const sendcode = async (req, res) => {
|
297
384
|
const code = Math.floor(1e3 + Math.random() * 9e3);
|
298
385
|
const type = req.body.type;
|
@@ -319,12 +406,12 @@ const controllerFactory$2 = (db) => {
|
|
319
406
|
sendcode
|
320
407
|
};
|
321
408
|
};
|
322
|
-
var twofa_service = controllerFactory$
|
323
|
-
const controllerFactory$
|
409
|
+
var twofa_service = controllerFactory$4;
|
410
|
+
const controllerFactory$3 = auth_service;
|
324
411
|
const controllerFactoryTwofa = twofa_service;
|
325
412
|
const middlewareFactory$1 = middlewares;
|
326
413
|
var auth_routes = function(app, db, origins) {
|
327
|
-
const controller = controllerFactory$
|
414
|
+
const controller = controllerFactory$3(db);
|
328
415
|
const controllerTwofa = controllerFactoryTwofa();
|
329
416
|
const { verifySignUp, verifyUser, authJwt } = middlewareFactory$1(db);
|
330
417
|
app.post(
|
@@ -358,10 +445,10 @@ var auth_routes = function(app, db, origins) {
|
|
358
445
|
controller.checkAccesses
|
359
446
|
);
|
360
447
|
};
|
361
|
-
const controllerFactory = twofa_service;
|
448
|
+
const controllerFactory$2 = twofa_service;
|
362
449
|
const middlewareFactory = middlewares;
|
363
450
|
var twofa_routes = function(app, db) {
|
364
|
-
const controller = controllerFactory();
|
451
|
+
const controller = controllerFactory$2();
|
365
452
|
const { verifySignUp, verifyUser } = middlewareFactory(db);
|
366
453
|
app.post(
|
367
454
|
"/api/twofa/sendcode",
|
@@ -378,30 +465,227 @@ var twofa_routes = function(app, db) {
|
|
378
465
|
controller.sendcode
|
379
466
|
);
|
380
467
|
};
|
468
|
+
const ObjectId = require$$0$1.Types.ObjectId;
|
469
|
+
const addUserStatusFields = addUserStatusFields_1;
|
470
|
+
const addMembersQuantity = addMembersQuantity_1;
|
471
|
+
const controllerFactory$1 = (db) => {
|
472
|
+
const User = db.user;
|
473
|
+
const read = async (req, res) => {
|
474
|
+
let query = [];
|
475
|
+
let skip = parseInt(req.query.skip) || 0;
|
476
|
+
let limit = parseInt(req.query.limit) || 10;
|
477
|
+
console.log(req.query);
|
478
|
+
const matchConditions = [
|
479
|
+
...req.query._id ? [{ _id: new ObjectId(req.query._id) }] : []
|
480
|
+
];
|
481
|
+
let search = req.query.search;
|
482
|
+
if (search) {
|
483
|
+
let regexPattern = "";
|
484
|
+
const escapedSearch = search.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
485
|
+
if (escapedSearch.includes("@")) {
|
486
|
+
regexPattern = escapedSearch;
|
487
|
+
} else if (escapedSearch.match(/^\+?\d{0,14}$/)) {
|
488
|
+
regexPattern = escapedSearch;
|
489
|
+
} else {
|
490
|
+
regexPattern = `.*${escapedSearch}.*`;
|
491
|
+
}
|
492
|
+
matchConditions.push({
|
493
|
+
$or: [
|
494
|
+
{ "profile.name": { $regex: regexPattern, $options: "i" } },
|
495
|
+
{ "email": { $regex: regexPattern, $options: "i" } },
|
496
|
+
{ "phone": { $regex: regexPattern, $options: "i" } },
|
497
|
+
{ "username": { $regex: regexPattern, $options: "i" } }
|
498
|
+
]
|
499
|
+
});
|
500
|
+
}
|
501
|
+
if (matchConditions.length > 0) query.push({ $match: { $and: matchConditions } });
|
502
|
+
query.push({
|
503
|
+
$lookup: {
|
504
|
+
from: "orders",
|
505
|
+
localField: "_id",
|
506
|
+
foreignField: "user",
|
507
|
+
as: "orders"
|
508
|
+
}
|
509
|
+
});
|
510
|
+
query.push({
|
511
|
+
$lookup: {
|
512
|
+
from: "roles",
|
513
|
+
localField: "roles",
|
514
|
+
foreignField: "_id",
|
515
|
+
as: "roles"
|
516
|
+
}
|
517
|
+
});
|
518
|
+
query.push({
|
519
|
+
$lookup: {
|
520
|
+
from: "memberships",
|
521
|
+
localField: "_id",
|
522
|
+
foreignField: "target",
|
523
|
+
as: "memberships"
|
524
|
+
}
|
525
|
+
});
|
526
|
+
query.push(addMembersQuantity());
|
527
|
+
if (req.query.user) query.push(addUserStatusFields(req.query.user));
|
528
|
+
query.push({
|
529
|
+
$skip: skip
|
530
|
+
});
|
531
|
+
query.push({
|
532
|
+
$limit: limit
|
533
|
+
});
|
534
|
+
try {
|
535
|
+
const users = await User.aggregate(query);
|
536
|
+
if (!users) {
|
537
|
+
return res.status(404).send({ message: "Users not found." });
|
538
|
+
}
|
539
|
+
res.status(200).send(users);
|
540
|
+
} catch (err) {
|
541
|
+
console.log(err);
|
542
|
+
res.status(500).send({ message: err });
|
543
|
+
}
|
544
|
+
};
|
545
|
+
const create = async (req, res) => {
|
546
|
+
try {
|
547
|
+
const newUser = {
|
548
|
+
phone: req.body.phone,
|
549
|
+
email: req.body.email,
|
550
|
+
roles: req.body.roles ? req.body.roles : []
|
551
|
+
};
|
552
|
+
const user = await User.create(newUser);
|
553
|
+
if (!user) {
|
554
|
+
return res.status(404).send({ errorCode: "USER_NOT_CREATED", message: "User is not created." });
|
555
|
+
}
|
556
|
+
res.status(200).send(user);
|
557
|
+
} catch (err) {
|
558
|
+
return res.status(500).send({ errorCode: "INTERNAL_SERVER_ERROR", message: err });
|
559
|
+
}
|
560
|
+
};
|
561
|
+
const update = async (req, res) => {
|
562
|
+
try {
|
563
|
+
const user = await User.findOneAndUpdate({ _id: req.params._id }, req.body, { new: true });
|
564
|
+
if (!user) {
|
565
|
+
return res.status(404).send({ errorCode: "UPDATE_FAILED", message: "Something wrong when updating user." });
|
566
|
+
}
|
567
|
+
res.status(200).send(user);
|
568
|
+
} catch (err) {
|
569
|
+
return res.status(500).send({ errorCode: "INTERNAL_SERVER_ERROR", message: err });
|
570
|
+
}
|
571
|
+
};
|
572
|
+
const remove = async (req, res) => {
|
573
|
+
try {
|
574
|
+
const user = await User.findOneAndDelete({ phone: req.params.phone });
|
575
|
+
if (!user) {
|
576
|
+
return res.status(404).send({ errorCode: "DELETION_FAILED", message: "User is not deleted." });
|
577
|
+
}
|
578
|
+
res.status(200).send(user);
|
579
|
+
} catch (err) {
|
580
|
+
return res.status(500).send({ errorCode: "INTERNAL_SERVER_ERROR", message: err });
|
581
|
+
}
|
582
|
+
};
|
583
|
+
return {
|
584
|
+
read,
|
585
|
+
create,
|
586
|
+
update,
|
587
|
+
remove
|
588
|
+
};
|
589
|
+
};
|
590
|
+
var users_service = controllerFactory$1;
|
591
|
+
const controllerFactory = users_service;
|
592
|
+
var users_routes = function(app, db, origins) {
|
593
|
+
const controller = controllerFactory(db);
|
594
|
+
app.post("/api/users", controller.create);
|
595
|
+
app.get("/api/users", controller.read);
|
596
|
+
app.put("/api/users/:_id", controller.update);
|
597
|
+
app.delete("/api/users/:_id", controller.remove);
|
598
|
+
};
|
599
|
+
const crypto = require$$0$2;
|
600
|
+
const fingerprintCache = /* @__PURE__ */ new Map();
|
601
|
+
const generateFingerprint = (req) => {
|
602
|
+
const { ip, headers } = req;
|
603
|
+
const userAgent = headers["user-agent"];
|
604
|
+
const acceptLanguage = headers["accept-language"];
|
605
|
+
const key = `${ip}-${userAgent}-${acceptLanguage}`;
|
606
|
+
if (fingerprintCache.has(key)) {
|
607
|
+
return fingerprintCache.get(key);
|
608
|
+
}
|
609
|
+
const hash = crypto.createHash("sha256");
|
610
|
+
hash.update(key);
|
611
|
+
const digest = hash.digest("hex");
|
612
|
+
fingerprintCache.set(key, digest);
|
613
|
+
return digest;
|
614
|
+
};
|
615
|
+
const modelsFactory = (db) => {
|
616
|
+
const Visitor = db.visitor;
|
617
|
+
const Request = db.request;
|
618
|
+
const visitorLogger = async (req, res, next) => {
|
619
|
+
const fingerprint = generateFingerprint(req);
|
620
|
+
try {
|
621
|
+
let visitor = await Visitor.findOne({ fingerprint });
|
622
|
+
if (!visitor) {
|
623
|
+
visitor = new Visitor({
|
624
|
+
ip: req.ip,
|
625
|
+
userAgent: req.headers["user-agent"],
|
626
|
+
acceptLanguage: req.headers["accept-language"],
|
627
|
+
fingerprint
|
628
|
+
});
|
629
|
+
await visitor.save();
|
630
|
+
}
|
631
|
+
const newRequest = new Request({
|
632
|
+
visitor: visitor._id,
|
633
|
+
path: req.path,
|
634
|
+
method: req.method,
|
635
|
+
timestamp: /* @__PURE__ */ new Date()
|
636
|
+
});
|
637
|
+
await newRequest.save();
|
638
|
+
next();
|
639
|
+
} catch (error) {
|
640
|
+
console.error("Error processing visitor and request data:", error);
|
641
|
+
next();
|
642
|
+
}
|
643
|
+
};
|
644
|
+
return {
|
645
|
+
visitorLogger
|
646
|
+
};
|
647
|
+
};
|
648
|
+
var visitor_logger = modelsFactory;
|
649
|
+
const UserModel = user_model;
|
381
650
|
const RoleModel = role_model;
|
651
|
+
const VisitorModel = visitor_model;
|
652
|
+
const RequestModel = request_model;
|
382
653
|
const authRoutes = auth_routes;
|
383
654
|
const twofaRoutes = twofa_routes;
|
655
|
+
const usersRoutes = users_routes;
|
384
656
|
const AuthController = auth_service;
|
385
657
|
const TwoFaController = twofa_service;
|
658
|
+
const UsersController = users_service;
|
659
|
+
const visitors = visitor_logger;
|
386
660
|
function initializeAuth(app, db, origins, publicPath) {
|
387
661
|
db.role = RoleModel(db);
|
662
|
+
db.user = UserModel(db);
|
663
|
+
db.visitor = VisitorModel(db);
|
664
|
+
db.request = RequestModel(db);
|
388
665
|
if (app) {
|
389
666
|
authRoutes(app, db);
|
390
667
|
twofaRoutes(app, db);
|
668
|
+
usersRoutes(app, db);
|
669
|
+
const visitorModule = visitors(db);
|
670
|
+
app.use(visitorModule.visitorLogger);
|
391
671
|
}
|
392
672
|
}
|
393
673
|
var auth_server = {
|
394
674
|
initialize: initializeAuth,
|
395
675
|
models: {
|
396
|
-
RoleModel
|
676
|
+
RoleModel,
|
677
|
+
UserModel,
|
678
|
+
VisitorModel
|
397
679
|
},
|
398
680
|
routes: {
|
399
681
|
authRoutes,
|
400
|
-
twofaRoutes
|
682
|
+
twofaRoutes,
|
683
|
+
usersRoutes
|
401
684
|
},
|
402
685
|
controllers: {
|
403
686
|
AuthController,
|
404
|
-
TwoFaController
|
687
|
+
TwoFaController,
|
688
|
+
UsersController
|
405
689
|
}
|
406
690
|
};
|
407
691
|
const auth_server$1 = /* @__PURE__ */ getDefaultExportFromCjs(auth_server);
|
package/dist/builder.js
CHANGED
@@ -599,7 +599,7 @@ var webpack_config_client = (projectRoot) => {
|
|
599
599
|
mode: !isProd2 ? "development" : "production",
|
600
600
|
devtool: !isProd2 ? "inline-source-map" : "source-map",
|
601
601
|
entry: {
|
602
|
-
main: !isProd2 ? [path$3.resolve("../utils/hot-reload.js"), path$3.resolve(projectRoot, "src/
|
602
|
+
main: !isProd2 ? [path$3.resolve("../utils/hot-reload.js"), path$3.resolve(projectRoot, "src/client.js")] : path$3.resolve(projectRoot, "src/client.js")
|
603
603
|
},
|
604
604
|
module: {
|
605
605
|
rules: []
|
@@ -670,7 +670,7 @@ var webpack_config_server = (projectRoot) => {
|
|
670
670
|
mode: "development",
|
671
671
|
entry: [
|
672
672
|
"webpack/hot/poll?1000",
|
673
|
-
path$2.resolve(projectRoot, "
|
673
|
+
path$2.resolve(projectRoot, "src/server.js")
|
674
674
|
],
|
675
675
|
output: {
|
676
676
|
filename: "server.[fullhash].js",
|
@@ -707,7 +707,7 @@ var webpack_config_spa = (projectRoot) => {
|
|
707
707
|
mode: !isProd ? "development" : "production",
|
708
708
|
devtool: "source-map",
|
709
709
|
entry: {
|
710
|
-
main: path$1.resolve(projectRoot, "src/
|
710
|
+
main: path$1.resolve(projectRoot, "src/client.js")
|
711
711
|
},
|
712
712
|
output: {
|
713
713
|
filename: "main.js",
|
@@ -768,7 +768,7 @@ var webpack_config_ssr = (projectRoot) => {
|
|
768
768
|
target: "node",
|
769
769
|
mode: !isProd2 ? "development" : "production",
|
770
770
|
entry: {
|
771
|
-
main: path.resolve(projectRoot, "src/
|
771
|
+
main: path.resolve(projectRoot, "src/client.js")
|
772
772
|
},
|
773
773
|
output: {
|
774
774
|
filename: "main.[fullhash].js",
|
package/dist/builder.mjs
CHANGED
@@ -576,7 +576,7 @@ var webpack_config_client = (projectRoot) => {
|
|
576
576
|
mode: !isProd2 ? "development" : "production",
|
577
577
|
devtool: !isProd2 ? "inline-source-map" : "source-map",
|
578
578
|
entry: {
|
579
|
-
main: !isProd2 ? [path$3.resolve("../utils/hot-reload.js"), path$3.resolve(projectRoot, "src/
|
579
|
+
main: !isProd2 ? [path$3.resolve("../utils/hot-reload.js"), path$3.resolve(projectRoot, "src/client.js")] : path$3.resolve(projectRoot, "src/client.js")
|
580
580
|
},
|
581
581
|
module: {
|
582
582
|
rules: []
|
@@ -647,7 +647,7 @@ var webpack_config_server = (projectRoot) => {
|
|
647
647
|
mode: "development",
|
648
648
|
entry: [
|
649
649
|
"webpack/hot/poll?1000",
|
650
|
-
path$2.resolve(projectRoot, "
|
650
|
+
path$2.resolve(projectRoot, "src/server.js")
|
651
651
|
],
|
652
652
|
output: {
|
653
653
|
filename: "server.[fullhash].js",
|
@@ -684,7 +684,7 @@ var webpack_config_spa = (projectRoot) => {
|
|
684
684
|
mode: !isProd ? "development" : "production",
|
685
685
|
devtool: "source-map",
|
686
686
|
entry: {
|
687
|
-
main: path$1.resolve(projectRoot, "src/
|
687
|
+
main: path$1.resolve(projectRoot, "src/client.js")
|
688
688
|
},
|
689
689
|
output: {
|
690
690
|
filename: "main.js",
|
@@ -745,7 +745,7 @@ var webpack_config_ssr = (projectRoot) => {
|
|
745
745
|
target: "node",
|
746
746
|
mode: !isProd2 ? "development" : "production",
|
747
747
|
entry: {
|
748
|
-
main: path.resolve(projectRoot, "src/
|
748
|
+
main: path.resolve(projectRoot, "src/client.js")
|
749
749
|
},
|
750
750
|
output: {
|
751
751
|
filename: "main.[fullhash].js",
|
package/dist/community.server.js
CHANGED
@@ -757,10 +757,10 @@ var blogpost_model = (db) => {
|
|
757
757
|
const Blogpost = db.mongoose.model("Blogpost", BlogpostSchema);
|
758
758
|
return Blogpost;
|
759
759
|
};
|
760
|
-
var comment_model = (
|
761
|
-
const CommentSchema = new mongoose.Schema({
|
760
|
+
var comment_model = (db) => {
|
761
|
+
const CommentSchema = new db.mongoose.Schema({
|
762
762
|
user: {
|
763
|
-
type: mongoose.Schema.Types.ObjectId,
|
763
|
+
type: db.mongoose.Schema.Types.ObjectId,
|
764
764
|
ref: "User",
|
765
765
|
required: true
|
766
766
|
},
|
@@ -772,7 +772,7 @@ var comment_model = (mongoose) => {
|
|
772
772
|
},
|
773
773
|
target: {
|
774
774
|
// заменяем 'organization' на 'target', так как это может быть или User, или Organization
|
775
|
-
type: mongoose.Schema.Types.ObjectId,
|
775
|
+
type: db.mongoose.Schema.Types.ObjectId,
|
776
776
|
ref: function(value) {
|
777
777
|
if (this.type === "blogpost") return "Blogpost";
|
778
778
|
if (this.type === "comment") return "Comment";
|
@@ -782,12 +782,12 @@ var comment_model = (mongoose) => {
|
|
782
782
|
required: true
|
783
783
|
},
|
784
784
|
parent: {
|
785
|
-
type: mongoose.Schema.Types.ObjectId,
|
785
|
+
type: db.mongoose.Schema.Types.ObjectId,
|
786
786
|
ref: "Comment",
|
787
787
|
default: null
|
788
788
|
},
|
789
789
|
children: [{
|
790
|
-
type: mongoose.Schema.Types.ObjectId,
|
790
|
+
type: db.mongoose.Schema.Types.ObjectId,
|
791
791
|
ref: "Comment"
|
792
792
|
}],
|
793
793
|
depth: {
|
@@ -804,13 +804,13 @@ var comment_model = (mongoose) => {
|
|
804
804
|
}
|
805
805
|
});
|
806
806
|
CommentSchema.index({ target: 1, parent: 1, depth: 1 });
|
807
|
-
const Comment = mongoose.model("Comment", CommentSchema);
|
807
|
+
const Comment = db.mongoose.model("Comment", CommentSchema);
|
808
808
|
return Comment;
|
809
809
|
};
|
810
|
-
var reaction_model = (
|
811
|
-
const ReactionSchema = new mongoose.Schema({
|
810
|
+
var reaction_model = (db) => {
|
811
|
+
const ReactionSchema = new db.mongoose.Schema({
|
812
812
|
user: {
|
813
|
-
type: mongoose.Schema.Types.ObjectId,
|
813
|
+
type: db.mongoose.Schema.Types.ObjectId,
|
814
814
|
ref: function(value) {
|
815
815
|
if (this.owner.type === "user") return "User";
|
816
816
|
if (this.owner.type === "organization") return "Organization";
|
@@ -824,7 +824,7 @@ var reaction_model = (mongoose) => {
|
|
824
824
|
required: true
|
825
825
|
},
|
826
826
|
target: {
|
827
|
-
type: mongoose.Schema.Types.ObjectId,
|
827
|
+
type: db.mongoose.Schema.Types.ObjectId,
|
828
828
|
ref: function(value) {
|
829
829
|
if (this.owner.type === "event") return "Event";
|
830
830
|
if (this.owner.type === "comment") return "Comment";
|
@@ -850,7 +850,7 @@ var reaction_model = (mongoose) => {
|
|
850
850
|
}, {
|
851
851
|
strict: false
|
852
852
|
});
|
853
|
-
const Reaction = mongoose.model("Reaction", ReactionSchema);
|
853
|
+
const Reaction = db.mongoose.model("Reaction", ReactionSchema);
|
854
854
|
return Reaction;
|
855
855
|
};
|
856
856
|
const BlogController = blog_controller;
|
@@ -862,16 +862,33 @@ const reactionsRoutes = reactions_routes;
|
|
862
862
|
const BlogpostModel = blogpost_model;
|
863
863
|
const CommentModel = comment_model;
|
864
864
|
const ReactionModel = reaction_model;
|
865
|
+
function initializeCommunity(app, db, origins, publicPath) {
|
866
|
+
db.blogpost = BlogpostModel(db);
|
867
|
+
db.comment = CommentModel(db);
|
868
|
+
db.reaction = ReactionModel(db);
|
869
|
+
if (app) {
|
870
|
+
blogRoutes(app, db);
|
871
|
+
commentsRoutes(app, db);
|
872
|
+
reactionsRoutes(app, db);
|
873
|
+
}
|
874
|
+
}
|
865
875
|
var community_server = {
|
866
|
-
|
867
|
-
|
868
|
-
|
869
|
-
|
870
|
-
|
871
|
-
|
872
|
-
|
873
|
-
|
874
|
-
|
876
|
+
initialize: initializeCommunity,
|
877
|
+
models: {
|
878
|
+
BlogpostModel,
|
879
|
+
CommentModel,
|
880
|
+
ReactionModel
|
881
|
+
},
|
882
|
+
routes: {
|
883
|
+
blogRoutes,
|
884
|
+
commentsRoutes,
|
885
|
+
reactionsRoutes
|
886
|
+
},
|
887
|
+
controllers: {
|
888
|
+
BlogController,
|
889
|
+
CommentsController,
|
890
|
+
ReactionsController
|
891
|
+
}
|
875
892
|
};
|
876
893
|
const community_server$1 = /* @__PURE__ */ _commonjsHelpers.getDefaultExportFromCjs(community_server);
|
877
894
|
module.exports = community_server$1;
|
@@ -756,10 +756,10 @@ var blogpost_model = (db) => {
|
|
756
756
|
const Blogpost = db.mongoose.model("Blogpost", BlogpostSchema);
|
757
757
|
return Blogpost;
|
758
758
|
};
|
759
|
-
var comment_model = (
|
760
|
-
const CommentSchema = new mongoose.Schema({
|
759
|
+
var comment_model = (db) => {
|
760
|
+
const CommentSchema = new db.mongoose.Schema({
|
761
761
|
user: {
|
762
|
-
type: mongoose.Schema.Types.ObjectId,
|
762
|
+
type: db.mongoose.Schema.Types.ObjectId,
|
763
763
|
ref: "User",
|
764
764
|
required: true
|
765
765
|
},
|
@@ -771,7 +771,7 @@ var comment_model = (mongoose) => {
|
|
771
771
|
},
|
772
772
|
target: {
|
773
773
|
// заменяем 'organization' на 'target', так как это может быть или User, или Organization
|
774
|
-
type: mongoose.Schema.Types.ObjectId,
|
774
|
+
type: db.mongoose.Schema.Types.ObjectId,
|
775
775
|
ref: function(value) {
|
776
776
|
if (this.type === "blogpost") return "Blogpost";
|
777
777
|
if (this.type === "comment") return "Comment";
|
@@ -781,12 +781,12 @@ var comment_model = (mongoose) => {
|
|
781
781
|
required: true
|
782
782
|
},
|
783
783
|
parent: {
|
784
|
-
type: mongoose.Schema.Types.ObjectId,
|
784
|
+
type: db.mongoose.Schema.Types.ObjectId,
|
785
785
|
ref: "Comment",
|
786
786
|
default: null
|
787
787
|
},
|
788
788
|
children: [{
|
789
|
-
type: mongoose.Schema.Types.ObjectId,
|
789
|
+
type: db.mongoose.Schema.Types.ObjectId,
|
790
790
|
ref: "Comment"
|
791
791
|
}],
|
792
792
|
depth: {
|
@@ -803,13 +803,13 @@ var comment_model = (mongoose) => {
|
|
803
803
|
}
|
804
804
|
});
|
805
805
|
CommentSchema.index({ target: 1, parent: 1, depth: 1 });
|
806
|
-
const Comment = mongoose.model("Comment", CommentSchema);
|
806
|
+
const Comment = db.mongoose.model("Comment", CommentSchema);
|
807
807
|
return Comment;
|
808
808
|
};
|
809
|
-
var reaction_model = (
|
810
|
-
const ReactionSchema = new mongoose.Schema({
|
809
|
+
var reaction_model = (db) => {
|
810
|
+
const ReactionSchema = new db.mongoose.Schema({
|
811
811
|
user: {
|
812
|
-
type: mongoose.Schema.Types.ObjectId,
|
812
|
+
type: db.mongoose.Schema.Types.ObjectId,
|
813
813
|
ref: function(value) {
|
814
814
|
if (this.owner.type === "user") return "User";
|
815
815
|
if (this.owner.type === "organization") return "Organization";
|
@@ -823,7 +823,7 @@ var reaction_model = (mongoose) => {
|
|
823
823
|
required: true
|
824
824
|
},
|
825
825
|
target: {
|
826
|
-
type: mongoose.Schema.Types.ObjectId,
|
826
|
+
type: db.mongoose.Schema.Types.ObjectId,
|
827
827
|
ref: function(value) {
|
828
828
|
if (this.owner.type === "event") return "Event";
|
829
829
|
if (this.owner.type === "comment") return "Comment";
|
@@ -849,7 +849,7 @@ var reaction_model = (mongoose) => {
|
|
849
849
|
}, {
|
850
850
|
strict: false
|
851
851
|
});
|
852
|
-
const Reaction = mongoose.model("Reaction", ReactionSchema);
|
852
|
+
const Reaction = db.mongoose.model("Reaction", ReactionSchema);
|
853
853
|
return Reaction;
|
854
854
|
};
|
855
855
|
const BlogController = blog_controller;
|
@@ -861,16 +861,33 @@ const reactionsRoutes = reactions_routes;
|
|
861
861
|
const BlogpostModel = blogpost_model;
|
862
862
|
const CommentModel = comment_model;
|
863
863
|
const ReactionModel = reaction_model;
|
864
|
+
function initializeCommunity(app, db, origins, publicPath) {
|
865
|
+
db.blogpost = BlogpostModel(db);
|
866
|
+
db.comment = CommentModel(db);
|
867
|
+
db.reaction = ReactionModel(db);
|
868
|
+
if (app) {
|
869
|
+
blogRoutes(app, db);
|
870
|
+
commentsRoutes(app, db);
|
871
|
+
reactionsRoutes(app, db);
|
872
|
+
}
|
873
|
+
}
|
864
874
|
var community_server = {
|
865
|
-
|
866
|
-
|
867
|
-
|
868
|
-
|
869
|
-
|
870
|
-
|
871
|
-
|
872
|
-
|
873
|
-
|
875
|
+
initialize: initializeCommunity,
|
876
|
+
models: {
|
877
|
+
BlogpostModel,
|
878
|
+
CommentModel,
|
879
|
+
ReactionModel
|
880
|
+
},
|
881
|
+
routes: {
|
882
|
+
blogRoutes,
|
883
|
+
commentsRoutes,
|
884
|
+
reactionsRoutes
|
885
|
+
},
|
886
|
+
controllers: {
|
887
|
+
BlogController,
|
888
|
+
CommentsController,
|
889
|
+
ReactionsController
|
890
|
+
}
|
874
891
|
};
|
875
892
|
const community_server$1 = /* @__PURE__ */ getDefaultExportFromCjs(community_server);
|
876
893
|
export {
|