@ozdao/martyrs 0.2.585 → 0.2.587
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/auth.server.js +175 -97
- package/dist/{authJwt-J1csaMWA.js → authJwt-DKbMMjw0.js} +33 -0
- package/dist/chats.server.js +3 -3
- package/dist/community.server.js +2 -2
- package/dist/core.server.js +201 -13
- package/dist/{core.websocket-C2FxNmZ1.js → core.websocket-Cl76z2wT.js} +41 -5
- package/dist/{crud-q1ye5IhV.js → crud-DpOXTZep.js} +1 -1
- package/dist/events.server.js +3 -3
- package/dist/files.server.js +2 -2
- package/dist/gallery.server.js +2 -2
- package/dist/index-kvBwwb0w.js +427 -0
- package/dist/inventory.server.js +3 -3
- package/dist/{mailing-DuEFRsa3.js → mailing-DT7nbNjZ.js} +16 -3
- package/dist/{main-xL-jtBkT.js → main-BIf-WirR.js} +863 -865
- package/dist/marketplace.server.js +2 -2
- package/dist/martyrs/dist/{main-xL-jtBkT.js → main-BIf-WirR.js} +192 -38
- package/dist/martyrs/dist/main-BIf-WirR.js.map +1 -0
- package/dist/martyrs/dist/{web-BA6h6Z8P.js → web-O7lXcjg0.js} +2 -2
- package/dist/martyrs/dist/{web-BA6h6Z8P.js.map → web-O7lXcjg0.js.map} +1 -1
- package/dist/martyrs/src/components/Button/{Button.vue2.js → Button.vue.js} +8 -7
- package/dist/martyrs/src/components/Button/Button.vue.js.map +1 -0
- package/dist/martyrs/src/components/Feed/Carousel.vue.js +1 -1
- package/dist/martyrs/src/components/Feed/Feed.vue.js +1 -1
- package/dist/martyrs/src/components/FieldBig/FieldBig.vue.js +1 -1
- package/dist/martyrs/src/components/Loader/{Loader.vue.js → Loader.vue2.js} +3 -3
- package/dist/martyrs/src/components/Loader/Loader.vue2.js.map +1 -0
- package/dist/martyrs/src/components/LocationMarker/LocationMarker.vue.js +1 -1
- package/dist/martyrs/src/components/Media/Media.vue.js +1 -1
- package/dist/martyrs/src/components/Menu/{Menu.vue.js → Menu.vue2.js} +2 -2
- package/dist/martyrs/src/components/Menu/Menu.vue2.js.map +1 -0
- package/dist/martyrs/src/components/Select/{Select.vue.js → Select.vue2.js} +2 -2
- package/dist/martyrs/src/components/Select/Select.vue2.js.map +1 -0
- package/dist/martyrs/src/components/Tooltip/Tooltip.vue2.js +17 -22
- package/dist/martyrs/src/components/Tooltip/Tooltip.vue2.js.map +1 -1
- package/dist/martyrs/src/components/UploadImage/UploadImage.vue.js +1 -1
- package/dist/martyrs/src/components/UploadImageMultiple/UploadImageMultiple.vue.js +1 -1
- package/dist/martyrs/src/modules/auth/auth.client.js +18 -24
- package/dist/martyrs/src/modules/auth/auth.client.js.map +1 -1
- package/dist/martyrs/src/modules/auth/views/components/blocks/OtpDialog.vue.js +178 -0
- package/dist/martyrs/src/modules/auth/views/components/blocks/OtpDialog.vue.js.map +1 -0
- package/dist/martyrs/src/modules/auth/views/components/pages/Invite.vue.js +1 -1
- package/dist/martyrs/src/modules/auth/views/components/pages/Profile.vue.js +53 -45
- package/dist/martyrs/src/modules/auth/views/components/pages/Profile.vue.js.map +1 -1
- package/dist/martyrs/src/modules/auth/views/components/pages/ProfileEdit.vue.js +1 -1
- package/dist/martyrs/src/modules/auth/views/components/pages/ProfileEditAccount.vue.js +198 -14
- package/dist/martyrs/src/modules/auth/views/components/pages/ProfileEditAccount.vue.js.map +1 -1
- package/dist/martyrs/src/modules/auth/views/components/pages/ProfileEditProfile.vue.js +1 -1
- package/dist/martyrs/src/modules/auth/views/components/pages/ResetPassword.vue.js +70 -29
- package/dist/martyrs/src/modules/auth/views/components/pages/ResetPassword.vue.js.map +1 -1
- package/dist/martyrs/src/modules/auth/views/components/pages/SignIn.vue.js +2 -2
- package/dist/martyrs/src/modules/auth/views/components/pages/SignIn.vue.js.map +1 -1
- package/dist/martyrs/src/modules/auth/views/components/pages/SignUp.vue.js +86 -30
- package/dist/martyrs/src/modules/auth/views/components/pages/SignUp.vue.js.map +1 -1
- package/dist/martyrs/src/modules/auth/views/plugins/otp.plugin.js +100 -0
- package/dist/martyrs/src/modules/auth/views/plugins/otp.plugin.js.map +1 -0
- package/dist/martyrs/src/modules/auth/views/router/auth.router.js +2 -31
- package/dist/martyrs/src/modules/auth/views/router/auth.router.js.map +1 -1
- package/dist/martyrs/src/modules/auth/views/router/users.router.js +0 -14
- package/dist/martyrs/src/modules/auth/views/router/users.router.js.map +1 -1
- package/dist/martyrs/src/modules/auth/views/store/auth.js +1 -56
- package/dist/martyrs/src/modules/auth/views/store/auth.js.map +1 -1
- package/dist/martyrs/src/modules/auth/views/store/users.js +5 -1
- package/dist/martyrs/src/modules/auth/views/store/users.js.map +1 -1
- package/dist/martyrs/src/modules/community/components/layouts/Community.vue.js +1 -1
- package/dist/martyrs/src/modules/community/components/pages/BlogPost.vue.js +2 -2
- package/dist/martyrs/src/modules/community/components/pages/CreateBlogPost.vue.js +1 -1
- package/dist/martyrs/src/modules/core/views/components/blocks/CardHeader.vue.js +0 -1
- package/dist/martyrs/src/modules/core/views/components/blocks/CardHeader.vue.js.map +1 -1
- package/dist/martyrs/src/modules/core/views/components/blocks/PopupAuth.vue.js +1 -1
- package/dist/martyrs/src/modules/core/views/components/blocks/PopupDateSelector.vue.js +2 -2
- package/dist/martyrs/src/modules/core/views/components/elements/OnlineIndicator.vue.js +74 -0
- package/dist/martyrs/src/modules/core/views/components/elements/OnlineIndicator.vue.js.map +1 -0
- package/dist/martyrs/src/modules/core/views/components/layouts/App.vue.js.map +1 -1
- package/dist/martyrs/src/modules/core/views/components/layouts/Client.vue.js +64 -48
- package/dist/martyrs/src/modules/core/views/components/layouts/Client.vue.js.map +1 -1
- package/dist/martyrs/src/modules/core/views/components/pages/404.vue.js +10 -33
- package/dist/martyrs/src/modules/core/views/components/pages/404.vue.js.map +1 -1
- package/dist/martyrs/src/modules/core/views/components/partials/Header.vue.js +2 -2
- package/dist/martyrs/src/modules/core/views/components/partials/NavigationBar.vue.js +1 -1
- package/dist/martyrs/src/modules/events/components/elements/ButtonCheck.vue.js +1 -1
- package/dist/martyrs/src/modules/events/components/elements/ButtonJoin.vue.js +1 -1
- package/dist/martyrs/src/modules/events/components/pages/EditEvent.vue.js +2 -2
- package/dist/martyrs/src/modules/events/components/pages/EditEventTickets.vue.js +1 -1
- package/dist/martyrs/src/modules/events/components/pages/Event.vue.js +1 -1
- package/dist/martyrs/src/modules/events/components/sections/EditTickets.vue.js +1 -1
- package/dist/martyrs/src/modules/events/components/sections/Feed.vue.js +1 -1
- package/dist/martyrs/src/modules/events/components/sections/List.vue.js +1 -1
- package/dist/martyrs/src/modules/gallery/components/sections/BackofficeGallery.vue.js +2 -2
- package/dist/martyrs/src/modules/inventory/components/forms/AdjustmentForm.vue.js +2 -2
- package/dist/martyrs/src/modules/inventory/components/forms/ColumnSettingsMenu.vue.js +1 -1
- package/dist/martyrs/src/modules/inventory/components/forms/HistoryView.vue.js +1 -1
- package/dist/martyrs/src/modules/inventory/components/forms/StockAlertsForm.vue.js +2 -2
- package/dist/martyrs/src/modules/inventory/components/pages/InventoryEdit.vue.js +2 -2
- package/dist/martyrs/src/modules/marketplace/views/components/sections/SectionMenu.vue.js +1 -1
- package/dist/martyrs/src/modules/music/components/blocks/ActionButtons.vue.js +1 -1
- package/dist/martyrs/src/modules/music/components/cards/AlbumCard.vue.js +1 -1
- package/dist/martyrs/src/modules/music/components/cards/ArtistCardSmall.vue.js +1 -1
- package/dist/martyrs/src/modules/music/components/cards/PlaylistCard.vue.js +1 -1
- package/dist/martyrs/src/modules/music/components/cards/TrackListCard.vue.js +1 -1
- package/dist/martyrs/src/modules/music/components/forms/AlbumForm.vue.js +2 -2
- package/dist/martyrs/src/modules/music/components/forms/ArtistForm.vue.js +3 -3
- package/dist/martyrs/src/modules/music/components/forms/PlaylistForm.vue.js +1 -1
- package/dist/martyrs/src/modules/music/components/forms/SearchForm.vue.js +1 -1
- package/dist/martyrs/src/modules/music/components/forms/TrackForm.vue.js +2 -2
- package/dist/martyrs/src/modules/music/components/pages/Album.vue.js +2 -2
- package/dist/martyrs/src/modules/music/components/pages/Artist.vue.js +2 -2
- package/dist/martyrs/src/modules/music/components/pages/MusicLibrary.vue.js +1 -1
- package/dist/martyrs/src/modules/music/components/pages/Playlist.vue.js +2 -2
- package/dist/martyrs/src/modules/music/components/pages/SearchResults.vue.js +2 -2
- package/dist/martyrs/src/modules/music/components/pages/Track.vue.js +2 -2
- package/dist/martyrs/src/modules/music/components/pages/TrackCreate.vue.js +0 -1
- package/dist/martyrs/src/modules/music/components/pages/TrackCreate.vue.js.map +1 -1
- package/dist/martyrs/src/modules/music/components/player/FullscreenPlayer.vue.js +1 -1
- package/dist/martyrs/src/modules/music/components/player/MusicPlayer.vue.js +1 -1
- package/dist/martyrs/src/modules/music/components/player/PlayerControls.vue.js +1 -1
- package/dist/martyrs/src/modules/music/components/player/VolumeControl.vue.js +1 -1
- package/dist/martyrs/src/modules/notifications/components/sections/NotificationPreferences.vue.js +2 -2
- package/dist/martyrs/src/modules/orders/components/forms/FormApplicationDetails.vue.js +2 -2
- package/dist/martyrs/src/modules/orders/components/forms/FormCustomerDetails.vue.js +2 -2
- package/dist/martyrs/src/modules/orders/components/forms/FormSelectCustomer.vue.js +1 -2
- package/dist/martyrs/src/modules/orders/components/forms/FormSelectCustomer.vue.js.map +1 -1
- package/dist/martyrs/src/modules/orders/components/pages/OrderBackoffice.vue.js +2 -2
- package/dist/martyrs/src/modules/orders/components/pages/OrderCreate.vue.js +1 -1
- package/dist/martyrs/src/modules/orders/components/pages/OrderCreateBackoffice.vue.js +1 -1
- package/dist/martyrs/src/modules/orders/components/sections/ApplicationDetails.vue.js +1 -1
- package/dist/martyrs/src/modules/orders/components/sections/CustomerDetails.vue.js +1 -1
- package/dist/martyrs/src/modules/orders/components/sections/FormDelivery.vue.js +1 -1
- package/dist/martyrs/src/modules/orders/components/sections/FormPayment.vue.js +1 -1
- package/dist/martyrs/src/modules/organizations/components/elements/ButtonToggleMembership.vue.js +1 -1
- package/dist/martyrs/src/modules/organizations/components/forms/AddExistingMembersForm.vue.js +1 -1
- package/dist/martyrs/src/modules/organizations/components/forms/DepartmentForm.vue.js +1 -1
- package/dist/martyrs/src/modules/organizations/components/forms/InviteForm.vue.js +1 -1
- package/dist/martyrs/src/modules/organizations/components/pages/Organization.vue.js +1 -1
- package/dist/martyrs/src/modules/organizations/components/pages/OrganizationBackoffice.vue.js +1 -1
- package/dist/martyrs/src/modules/organizations/components/pages/OrganizationEdit.vue.js +3 -3
- package/dist/martyrs/src/modules/organizations/components/sections/Documents.vue.js +1 -2
- package/dist/martyrs/src/modules/organizations/components/sections/Documents.vue.js.map +1 -1
- package/dist/martyrs/src/modules/organizations/components/sections/MembersAdd.vue.js +2 -2
- package/dist/martyrs/src/modules/organizations/components/sections/Organizations.vue.js +1 -2
- package/dist/martyrs/src/modules/organizations/components/sections/Organizations.vue.js.map +1 -1
- package/dist/martyrs/src/modules/pages/views/components/blocks/CardPage.vue.js +0 -1
- package/dist/martyrs/src/modules/pages/views/components/blocks/CardPage.vue.js.map +1 -1
- package/dist/martyrs/src/modules/pages/views/components/pages/PageEdit.vue.js +1 -1
- package/dist/martyrs/src/modules/pages/views/components/partials/SidebarPages.vue.js +1 -1
- package/dist/martyrs/src/modules/products/components/elements/Image360.vue.js +1 -1
- package/dist/martyrs/src/modules/products/components/pages/Categories.vue.js +0 -1
- package/dist/martyrs/src/modules/products/components/pages/Categories.vue.js.map +1 -1
- package/dist/martyrs/src/modules/products/components/pages/CategoryEdit.vue.js +3 -3
- package/dist/martyrs/src/modules/products/components/pages/Product.vue.js +0 -1
- package/dist/martyrs/src/modules/products/components/pages/Product.vue.js.map +1 -1
- package/dist/martyrs/src/modules/products/components/pages/ProductEdit.vue.js +2 -2
- package/dist/martyrs/src/modules/products/components/pages/Products.vue.js +1 -1
- package/dist/martyrs/src/modules/products/components/pages/Products.vue.js.map +1 -1
- package/dist/martyrs/src/modules/products/components/sections/EditAttributes.vue.js +1 -1
- package/dist/martyrs/src/modules/products/components/sections/EditDiscounts.vue.js +2 -2
- package/dist/martyrs/src/modules/products/components/sections/EditVariants.vue.js +2 -2
- package/dist/martyrs/src/modules/products/components/sections/ProductConfigurator.vue.js +1 -1
- package/dist/martyrs/src/modules/products/components/sections/ProductsRecommended.vue.js +1 -1
- package/dist/martyrs/src/modules/products/components/sections/SectionProduct.vue.js +1 -1
- package/dist/martyrs/src/modules/rents/views/components/pages/Gant/GanttToolbar.vue.js +1 -1
- package/dist/martyrs/src/modules/rents/views/components/pages/RentsEdit.vue.js +1 -1
- package/dist/martyrs/src/modules/reports/components/sections/FormReport.vue.js +2 -2
- package/dist/martyrs/src/modules/spots/components/blocks/SpotMemberModify.vue.js +1 -1
- package/dist/martyrs/src/modules/spots/components/pages/Map.vue.js +1 -1
- package/dist/martyrs/src/modules/spots/components/pages/SpotEdit.vue.js +2 -2
- package/dist/martyrs/src/modules/spots/components/sections/WorktimeEdit.vue.js +2 -2
- package/dist/martyrs.css +1 -1
- package/dist/martyrs.es.js +1 -1
- package/dist/music.server.js +1 -1
- package/dist/notifications.server.js +2 -2
- package/dist/orders.server.js +8 -7
- package/dist/organizations.server.js +3 -3
- package/dist/pages.server.js +1 -1
- package/dist/products.server.js +3 -3
- package/dist/profile.schema-C31Lynn3.js +21 -0
- package/dist/rents.server.js +2 -2
- package/dist/reports.server.js +1 -1
- package/dist/sessions.service-COcwjd0f.js +86 -0
- package/dist/spots.server.js +1 -1
- package/dist/style.css +180 -110
- package/dist/{tickets.controller-B7r0mK-5.js → tickets.controller-DdF85W-i.js} +1 -1
- package/dist/visitors.service-B1dhhuSo.js +83 -0
- package/dist/wallet.server.js +3 -3
- package/dist/{web-BA6h6Z8P.js → web-O7lXcjg0.js} +1 -1
- package/package.json +3 -1
- package/src/components/Button/Button.vue +61 -15
- package/src/components/Loader/Loader.vue +1 -1
- package/src/components/Tooltip/Tooltip.vue +31 -23
- package/src/modules/TASKS.MD +30 -1
- package/src/modules/auth/CLAUDE.md +381 -0
- package/src/modules/auth/FIXES.md +0 -38
- package/src/modules/auth/auth.client.js +4 -6
- package/src/modules/auth/auth.server.js +19 -16
- package/src/modules/auth/controllers/middlewares/authJwt.js +59 -17
- package/src/modules/auth/controllers/middlewares/index.js +4 -1
- package/src/modules/auth/controllers/middlewares/otp.middleware.js +166 -0
- package/src/modules/auth/controllers/middlewares/verifySignUp.js +0 -1
- package/src/modules/auth/controllers/middlewares/verifyUser.js +58 -11
- package/src/modules/auth/controllers/routes/auth.routes.js +48 -6
- package/src/modules/auth/controllers/routes/users.routes.js +29 -8
- package/src/modules/auth/controllers/services/auth.service.js +62 -12
- package/src/modules/auth/controllers/services/otp.service.js +109 -0
- package/src/modules/auth/controllers/services/users.service.js +46 -6
- package/src/modules/auth/models/otp.model.js +20 -0
- package/src/modules/auth/views/components/blocks/OtpDialog.vue +168 -0
- package/src/modules/auth/views/components/pages/Profile.vue +18 -13
- package/src/modules/auth/views/components/pages/ProfileEditAccount.vue +199 -45
- package/src/modules/auth/views/components/pages/ResetPassword.vue +170 -132
- package/src/modules/auth/views/components/pages/SignIn.vue +2 -1
- package/src/modules/auth/views/components/pages/SignUp.vue +203 -147
- package/src/modules/auth/views/plugins/otp.plugin.js +104 -0
- package/src/modules/auth/views/router/auth.router.js +1 -24
- package/src/modules/auth/views/router/users.router.js +1 -12
- package/src/modules/auth/views/store/auth.js +0 -68
- package/src/modules/auth/views/store/users.js +6 -2
- package/src/modules/chats/chats.server.js +1 -1
- package/src/modules/community/community.server.js +1 -1
- package/src/modules/core/controllers/classes/core.websocket.js +57 -6
- package/src/modules/core/controllers/middlewares/visitor.logger.js +49 -0
- package/src/modules/core/controllers/services/requests.service.js +53 -0
- package/src/modules/core/controllers/services/sessions.service.js +98 -0
- package/src/modules/core/controllers/services/visitors.service.js +102 -0
- package/src/modules/core/controllers/utils/mailing.js +16 -3
- package/src/modules/core/core.server.js +31 -16
- package/src/modules/core/models/log.model.js +24 -0
- package/src/modules/core/models/request.model.js +30 -0
- package/src/modules/core/models/session.model.js +43 -0
- package/src/modules/core/models/visitor.model.js +28 -0
- package/src/modules/core/views/components/elements/OnlineIndicator.vue +115 -0
- package/src/modules/core/views/components/layouts/App.vue +2 -2
- package/src/modules/core/views/components/layouts/Client.vue +443 -477
- package/src/modules/core/views/components/pages/404.vue +2 -3
- package/src/modules/events/events.server.js +1 -1
- package/src/modules/files/files.server.js +1 -1
- package/src/modules/gallery/gallery.server.js +1 -1
- package/src/modules/governance/governance.server.js +1 -1
- package/src/modules/icons/icons.server.js +1 -1
- package/src/modules/inventory/inventory.server.js +1 -1
- package/src/modules/marketplace/marketplace.server.js +1 -1
- package/src/modules/notifications/notifications.server.js +1 -1
- package/src/modules/orders/controllers/orders.controller.js +3 -3
- package/src/modules/orders/orders.server.js +1 -1
- package/src/modules/organizations/organizations.server.js +1 -1
- package/src/modules/pages/pages.server.js +1 -1
- package/src/modules/products/components/pages/Products.vue +1 -1
- package/src/modules/products/products.server.js +1 -1
- package/src/modules/rents/rents.server.js +1 -1
- package/src/modules/reports/reports.server.js +1 -1
- package/src/modules/spots/spots.server.js +1 -1
- package/src/modules/wallet/wallet.server.js +1 -1
- package/dist/_virtual/alignment-pattern.js +0 -5
- package/dist/_virtual/alignment-pattern.js.map +0 -1
- package/dist/_virtual/browser.js +0 -8
- package/dist/_virtual/browser.js.map +0 -1
- package/dist/_virtual/browser2.js +0 -5
- package/dist/_virtual/browser2.js.map +0 -1
- package/dist/_virtual/canvas.js +0 -5
- package/dist/_virtual/canvas.js.map +0 -1
- package/dist/_virtual/dijkstra.js +0 -5
- package/dist/_virtual/dijkstra.js.map +0 -1
- package/dist/_virtual/error-correction-code.js +0 -5
- package/dist/_virtual/error-correction-code.js.map +0 -1
- package/dist/_virtual/error-correction-level.js +0 -5
- package/dist/_virtual/error-correction-level.js.map +0 -1
- package/dist/_virtual/finder-pattern.js +0 -5
- package/dist/_virtual/finder-pattern.js.map +0 -1
- package/dist/_virtual/format-info.js +0 -5
- package/dist/_virtual/format-info.js.map +0 -1
- package/dist/_virtual/galois-field.js +0 -5
- package/dist/_virtual/galois-field.js.map +0 -1
- package/dist/_virtual/mask-pattern.js +0 -5
- package/dist/_virtual/mask-pattern.js.map +0 -1
- package/dist/_virtual/mode.js +0 -5
- package/dist/_virtual/mode.js.map +0 -1
- package/dist/_virtual/polynomial.js +0 -5
- package/dist/_virtual/polynomial.js.map +0 -1
- package/dist/_virtual/qrcode.js +0 -5
- package/dist/_virtual/qrcode.js.map +0 -1
- package/dist/_virtual/regex.js +0 -5
- package/dist/_virtual/regex.js.map +0 -1
- package/dist/_virtual/segments.js +0 -5
- package/dist/_virtual/segments.js.map +0 -1
- package/dist/_virtual/svg-tag.js +0 -5
- package/dist/_virtual/svg-tag.js.map +0 -1
- package/dist/_virtual/utils.js +0 -5
- package/dist/_virtual/utils.js.map +0 -1
- package/dist/_virtual/utils2.js +0 -5
- package/dist/_virtual/utils2.js.map +0 -1
- package/dist/_virtual/version-check.js +0 -5
- package/dist/_virtual/version-check.js.map +0 -1
- package/dist/_virtual/version.js +0 -5
- package/dist/_virtual/version.js.map +0 -1
- package/dist/index-_Edcmck_.js +0 -170
- package/dist/martyrs/dist/main-xL-jtBkT.js.map +0 -1
- package/dist/martyrs/node_modules/.pnpm/bignumber.js@9.1.2/node_modules/bignumber.js/bignumber.js +0 -1336
- package/dist/martyrs/node_modules/.pnpm/bignumber.js@9.1.2/node_modules/bignumber.js/bignumber.js.map +0 -1
- package/dist/martyrs/src/components/Button/Button.vue2.js.map +0 -1
- package/dist/martyrs/src/components/Loader/Loader.vue.js.map +0 -1
- package/dist/martyrs/src/components/Menu/Menu.vue.js.map +0 -1
- package/dist/martyrs/src/components/Select/Select.vue.js.map +0 -1
- package/dist/martyrs/src/modules/auth/views/components/pages/EnterCode.vue.js +0 -166
- package/dist/martyrs/src/modules/auth/views/components/pages/EnterCode.vue.js.map +0 -1
- package/dist/martyrs/src/modules/auth/views/components/pages/EnterPassword.vue.js +0 -118
- package/dist/martyrs/src/modules/auth/views/components/pages/EnterPassword.vue.js.map +0 -1
- package/dist/martyrs/src/modules/auth/views/components/sections/ProfileEditCredentials.vue.js +0 -360
- package/dist/martyrs/src/modules/auth/views/components/sections/ProfileEditCredentials.vue.js.map +0 -1
- package/dist/martyrs/src/modules/auth/views/store/twofa.js +0 -40
- package/dist/martyrs/src/modules/auth/views/store/twofa.js.map +0 -1
- package/dist/martyrs/src/modules/wallet/views/components/blocks/CardBalanceReplenished.vue.js +0 -43
- package/dist/martyrs/src/modules/wallet/views/components/blocks/CardBalanceReplenished.vue.js.map +0 -1
- package/dist/martyrs/src/modules/wallet/views/components/blocks/CardDeposit.vue.js +0 -47
- package/dist/martyrs/src/modules/wallet/views/components/blocks/CardDeposit.vue.js.map +0 -1
- package/dist/martyrs/src/modules/wallet/views/components/blocks/CashDeposit.vue.js +0 -29
- package/dist/martyrs/src/modules/wallet/views/components/blocks/CashDeposit.vue.js.map +0 -1
- package/dist/martyrs/src/modules/wallet/views/components/blocks/CryptoDeposit.vue.js +0 -89
- package/dist/martyrs/src/modules/wallet/views/components/blocks/CryptoDeposit.vue.js.map +0 -1
- package/dist/martyrs/src/modules/wallet/views/components/blocks/CryptoDepositProcessing.vue.js +0 -136
- package/dist/martyrs/src/modules/wallet/views/components/blocks/CryptoDepositProcessing.vue.js.map +0 -1
- package/dist/martyrs/src/modules/wallet/views/components/pages/Wallet.vue.js +0 -238
- package/dist/martyrs/src/modules/wallet/views/components/pages/Wallet.vue.js.map +0 -1
- package/dist/martyrs/src/modules/wallet/views/localization/wallet.json.js +0 -9
- package/dist/martyrs/src/modules/wallet/views/localization/wallet.json.js.map +0 -1
- package/dist/martyrs/src/modules/wallet/views/store/wallet.store.js +0 -134
- package/dist/martyrs/src/modules/wallet/views/store/wallet.store.js.map +0 -1
- package/dist/node_modules/.pnpm/dijkstrajs@1.0.3/node_modules/dijkstrajs/dijkstra.js +0 -106
- package/dist/node_modules/.pnpm/dijkstrajs@1.0.3/node_modules/dijkstrajs/dijkstra.js.map +0 -1
- package/dist/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/browser.js +0 -79
- package/dist/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/browser.js.map +0 -1
- package/dist/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/can-promise.js +0 -14
- package/dist/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/can-promise.js.map +0 -1
- package/dist/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/core/alignment-pattern.js +0 -43
- package/dist/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/core/alignment-pattern.js.map +0 -1
- package/dist/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/core/alphanumeric-data.js +0 -85
- package/dist/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/core/alphanumeric-data.js.map +0 -1
- package/dist/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/core/bit-buffer.js +0 -40
- package/dist/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/core/bit-buffer.js.map +0 -1
- package/dist/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/core/bit-matrix.js +0 -34
- package/dist/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/core/bit-matrix.js.map +0 -1
- package/dist/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/core/byte-data.js +0 -36
- package/dist/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/core/byte-data.js.map +0 -1
- package/dist/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/core/error-correction-code.js +0 -367
- package/dist/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/core/error-correction-code.js.map +0 -1
- package/dist/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/core/error-correction-level.js +0 -52
- package/dist/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/core/error-correction-level.js.map +0 -1
- package/dist/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/core/finder-pattern.js +0 -25
- package/dist/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/core/finder-pattern.js.map +0 -1
- package/dist/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/core/format-info.js +0 -24
- package/dist/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/core/format-info.js.map +0 -1
- package/dist/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/core/galois-field.js +0 -38
- package/dist/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/core/galois-field.js.map +0 -1
- package/dist/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/core/kanji-data.js +0 -46
- package/dist/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/core/kanji-data.js.map +0 -1
- package/dist/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/core/mask-pattern.js +0 -149
- package/dist/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/core/mask-pattern.js.map +0 -1
- package/dist/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/core/mode.js +0 -90
- package/dist/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/core/mode.js.map +0 -1
- package/dist/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/core/numeric-data.js +0 -41
- package/dist/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/core/numeric-data.js.map +0 -1
- package/dist/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/core/polynomial.js +0 -44
- package/dist/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/core/polynomial.js.map +0 -1
- package/dist/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/core/qrcode.js +0 -279
- package/dist/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/core/qrcode.js.map +0 -1
- package/dist/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/core/reed-solomon-encoder.js +0 -38
- package/dist/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/core/reed-solomon-encoder.js.map +0 -1
- package/dist/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/core/regex.js +0 -33
- package/dist/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/core/regex.js.map +0 -1
- package/dist/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/core/segments.js +0 -201
- package/dist/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/core/segments.js.map +0 -1
- package/dist/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/core/utils.js +0 -84
- package/dist/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/core/utils.js.map +0 -1
- package/dist/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/core/version-check.js +0 -14
- package/dist/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/core/version-check.js.map +0 -1
- package/dist/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/core/version.js +0 -107
- package/dist/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/core/version.js.map +0 -1
- package/dist/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/renderer/canvas.js +0 -61
- package/dist/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/renderer/canvas.js.map +0 -1
- package/dist/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/renderer/svg-tag.js +0 -64
- package/dist/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/renderer/svg-tag.js.map +0 -1
- package/dist/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/renderer/utils.js +0 -87
- package/dist/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/renderer/utils.js.map +0 -1
- package/dist/profile.schema-CjLOfG7b.js +0 -92
- package/src/modules/auth/controllers/middlewares/visitor.logger.js +0 -75
- package/src/modules/auth/controllers/routes/twofa.routes.js +0 -8
- package/src/modules/auth/controllers/services/twofa.service.js +0 -30
- package/src/modules/auth/models/request.model.js +0 -14
- package/src/modules/auth/models/visitor.model.js +0 -11
- package/src/modules/auth/views/components/pages/EnterCode.vue +0 -204
- package/src/modules/auth/views/components/pages/EnterPassword.vue +0 -123
- package/src/modules/auth/views/components/sections/ProfileEditCredentials.vue +0 -329
- package/src/modules/auth/views/store/twofa.js +0 -70
- package/src/modules/auth//320/220/320/240/320/245/320/230/320/242/320/225/320/232/320/242/320/243/320/240/320/220.md +0 -445
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
import { __exports as canvas } from "../../../../../../../_virtual/canvas.js";
|
|
2
|
-
import { __require as requireUtils } from "./utils.js";
|
|
3
|
-
var hasRequiredCanvas;
|
|
4
|
-
function requireCanvas() {
|
|
5
|
-
if (hasRequiredCanvas) return canvas;
|
|
6
|
-
hasRequiredCanvas = 1;
|
|
7
|
-
(function(exports) {
|
|
8
|
-
const Utils = requireUtils();
|
|
9
|
-
function clearCanvas(ctx, canvas2, size) {
|
|
10
|
-
ctx.clearRect(0, 0, canvas2.width, canvas2.height);
|
|
11
|
-
if (!canvas2.style) canvas2.style = {};
|
|
12
|
-
canvas2.height = size;
|
|
13
|
-
canvas2.width = size;
|
|
14
|
-
canvas2.style.height = size + "px";
|
|
15
|
-
canvas2.style.width = size + "px";
|
|
16
|
-
}
|
|
17
|
-
function getCanvasElement() {
|
|
18
|
-
try {
|
|
19
|
-
return document.createElement("canvas");
|
|
20
|
-
} catch (e) {
|
|
21
|
-
throw new Error("You need to specify a canvas element");
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
exports.render = function render(qrData, canvas2, options) {
|
|
25
|
-
let opts = options;
|
|
26
|
-
let canvasEl = canvas2;
|
|
27
|
-
if (typeof opts === "undefined" && (!canvas2 || !canvas2.getContext)) {
|
|
28
|
-
opts = canvas2;
|
|
29
|
-
canvas2 = void 0;
|
|
30
|
-
}
|
|
31
|
-
if (!canvas2) {
|
|
32
|
-
canvasEl = getCanvasElement();
|
|
33
|
-
}
|
|
34
|
-
opts = Utils.getOptions(opts);
|
|
35
|
-
const size = Utils.getImageWidth(qrData.modules.size, opts);
|
|
36
|
-
const ctx = canvasEl.getContext("2d");
|
|
37
|
-
const image = ctx.createImageData(size, size);
|
|
38
|
-
Utils.qrToImageData(image.data, qrData, opts);
|
|
39
|
-
clearCanvas(ctx, canvasEl, size);
|
|
40
|
-
ctx.putImageData(image, 0, 0);
|
|
41
|
-
return canvasEl;
|
|
42
|
-
};
|
|
43
|
-
exports.renderToDataURL = function renderToDataURL(qrData, canvas2, options) {
|
|
44
|
-
let opts = options;
|
|
45
|
-
if (typeof opts === "undefined" && (!canvas2 || !canvas2.getContext)) {
|
|
46
|
-
opts = canvas2;
|
|
47
|
-
canvas2 = void 0;
|
|
48
|
-
}
|
|
49
|
-
if (!opts) opts = {};
|
|
50
|
-
const canvasEl = exports.render(qrData, canvas2, opts);
|
|
51
|
-
const type = opts.type || "image/png";
|
|
52
|
-
const rendererOpts = opts.rendererOpts || {};
|
|
53
|
-
return canvasEl.toDataURL(type, rendererOpts.quality);
|
|
54
|
-
};
|
|
55
|
-
})(canvas);
|
|
56
|
-
return canvas;
|
|
57
|
-
}
|
|
58
|
-
export {
|
|
59
|
-
requireCanvas as __require
|
|
60
|
-
};
|
|
61
|
-
//# sourceMappingURL=canvas.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"canvas.js","sources":["../../../../../../../../../node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/renderer/canvas.js"],"sourcesContent":["const Utils = require('./utils')\n\nfunction clearCanvas (ctx, canvas, size) {\n ctx.clearRect(0, 0, canvas.width, canvas.height)\n\n if (!canvas.style) canvas.style = {}\n canvas.height = size\n canvas.width = size\n canvas.style.height = size + 'px'\n canvas.style.width = size + 'px'\n}\n\nfunction getCanvasElement () {\n try {\n return document.createElement('canvas')\n } catch (e) {\n throw new Error('You need to specify a canvas element')\n }\n}\n\nexports.render = function render (qrData, canvas, options) {\n let opts = options\n let canvasEl = canvas\n\n if (typeof opts === 'undefined' && (!canvas || !canvas.getContext)) {\n opts = canvas\n canvas = undefined\n }\n\n if (!canvas) {\n canvasEl = getCanvasElement()\n }\n\n opts = Utils.getOptions(opts)\n const size = Utils.getImageWidth(qrData.modules.size, opts)\n\n const ctx = canvasEl.getContext('2d')\n const image = ctx.createImageData(size, size)\n Utils.qrToImageData(image.data, qrData, opts)\n\n clearCanvas(ctx, canvasEl, size)\n ctx.putImageData(image, 0, 0)\n\n return canvasEl\n}\n\nexports.renderToDataURL = function renderToDataURL (qrData, canvas, options) {\n let opts = options\n\n if (typeof opts === 'undefined' && (!canvas || !canvas.getContext)) {\n opts = canvas\n canvas = undefined\n }\n\n if (!opts) opts = {}\n\n const canvasEl = exports.render(qrData, canvas, opts)\n\n const type = opts.type || 'image/png'\n const rendererOpts = opts.rendererOpts || {}\n\n return canvasEl.toDataURL(type, rendererOpts.quality)\n}\n"],"names":["require$$0","canvas"],"mappings":";;;;;;;AAAA,UAAM,QAAQA,aAAA;AAEd,aAAS,YAAa,KAAKC,SAAQ,MAAM;AACvC,UAAI,UAAU,GAAG,GAAGA,QAAO,OAAOA,QAAO,MAAM;AAE/C,UAAI,CAACA,QAAO,MAAO,CAAAA,QAAO,QAAQ,CAAA;AAClC,MAAAA,QAAO,SAAS;AAChB,MAAAA,QAAO,QAAQ;AACf,MAAAA,QAAO,MAAM,SAAS,OAAO;AAC7B,MAAAA,QAAO,MAAM,QAAQ,OAAO;AAAA,IAC9B;AAEA,aAAS,mBAAoB;AAC3B,UAAI;AACF,eAAO,SAAS,cAAc,QAAQ;AAAA,MAC1C,SAAW,GAAG;AACV,cAAM,IAAI,MAAM,sCAAsC;AAAA,MAC1D;AAAA,IACA;AAEA,YAAA,SAAiB,SAAS,OAAQ,QAAQA,SAAQ,SAAS;AACzD,UAAI,OAAO;AACX,UAAI,WAAWA;AAEf,UAAI,OAAO,SAAS,gBAAgB,CAACA,WAAU,CAACA,QAAO,aAAa;AAClE,eAAOA;AACP,QAAAA,UAAS;AAAA,MACb;AAEE,UAAI,CAACA,SAAQ;AACX,mBAAW,iBAAgB;AAAA,MAC/B;AAEE,aAAO,MAAM,WAAW,IAAI;AAC5B,YAAM,OAAO,MAAM,cAAc,OAAO,QAAQ,MAAM,IAAI;AAE1D,YAAM,MAAM,SAAS,WAAW,IAAI;AACpC,YAAM,QAAQ,IAAI,gBAAgB,MAAM,IAAI;AAC5C,YAAM,cAAc,MAAM,MAAM,QAAQ,IAAI;AAE5C,kBAAY,KAAK,UAAU,IAAI;AAC/B,UAAI,aAAa,OAAO,GAAG,CAAC;AAE5B,aAAO;AAAA,IACT;AAEA,YAAA,kBAA0B,SAAS,gBAAiB,QAAQA,SAAQ,SAAS;AAC3E,UAAI,OAAO;AAEX,UAAI,OAAO,SAAS,gBAAgB,CAACA,WAAU,CAACA,QAAO,aAAa;AAClE,eAAOA;AACP,QAAAA,UAAS;AAAA,MACb;AAEE,UAAI,CAAC,KAAM,QAAO,CAAA;AAElB,YAAM,WAAW,QAAQ,OAAO,QAAQA,SAAQ,IAAI;AAEpD,YAAM,OAAO,KAAK,QAAQ;AAC1B,YAAM,eAAe,KAAK,gBAAgB,CAAA;AAE1C,aAAO,SAAS,UAAU,MAAM,aAAa,OAAO;AAAA,IACtD;AAAA;;;","x_google_ignoreList":[0]}
|
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
import { __exports as svgTag } from "../../../../../../../_virtual/svg-tag.js";
|
|
2
|
-
import { __require as requireUtils } from "./utils.js";
|
|
3
|
-
var hasRequiredSvgTag;
|
|
4
|
-
function requireSvgTag() {
|
|
5
|
-
if (hasRequiredSvgTag) return svgTag;
|
|
6
|
-
hasRequiredSvgTag = 1;
|
|
7
|
-
const Utils = requireUtils();
|
|
8
|
-
function getColorAttrib(color, attrib) {
|
|
9
|
-
const alpha = color.a / 255;
|
|
10
|
-
const str = attrib + '="' + color.hex + '"';
|
|
11
|
-
return alpha < 1 ? str + " " + attrib + '-opacity="' + alpha.toFixed(2).slice(1) + '"' : str;
|
|
12
|
-
}
|
|
13
|
-
function svgCmd(cmd, x, y) {
|
|
14
|
-
let str = cmd + x;
|
|
15
|
-
if (typeof y !== "undefined") str += " " + y;
|
|
16
|
-
return str;
|
|
17
|
-
}
|
|
18
|
-
function qrToPath(data, size, margin) {
|
|
19
|
-
let path = "";
|
|
20
|
-
let moveBy = 0;
|
|
21
|
-
let newRow = false;
|
|
22
|
-
let lineLength = 0;
|
|
23
|
-
for (let i = 0; i < data.length; i++) {
|
|
24
|
-
const col = Math.floor(i % size);
|
|
25
|
-
const row = Math.floor(i / size);
|
|
26
|
-
if (!col && !newRow) newRow = true;
|
|
27
|
-
if (data[i]) {
|
|
28
|
-
lineLength++;
|
|
29
|
-
if (!(i > 0 && col > 0 && data[i - 1])) {
|
|
30
|
-
path += newRow ? svgCmd("M", col + margin, 0.5 + row + margin) : svgCmd("m", moveBy, 0);
|
|
31
|
-
moveBy = 0;
|
|
32
|
-
newRow = false;
|
|
33
|
-
}
|
|
34
|
-
if (!(col + 1 < size && data[i + 1])) {
|
|
35
|
-
path += svgCmd("h", lineLength);
|
|
36
|
-
lineLength = 0;
|
|
37
|
-
}
|
|
38
|
-
} else {
|
|
39
|
-
moveBy++;
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
return path;
|
|
43
|
-
}
|
|
44
|
-
svgTag.render = function render(qrData, options, cb) {
|
|
45
|
-
const opts = Utils.getOptions(options);
|
|
46
|
-
const size = qrData.modules.size;
|
|
47
|
-
const data = qrData.modules.data;
|
|
48
|
-
const qrcodesize = size + opts.margin * 2;
|
|
49
|
-
const bg = !opts.color.light.a ? "" : "<path " + getColorAttrib(opts.color.light, "fill") + ' d="M0 0h' + qrcodesize + "v" + qrcodesize + 'H0z"/>';
|
|
50
|
-
const path = "<path " + getColorAttrib(opts.color.dark, "stroke") + ' d="' + qrToPath(data, size, opts.margin) + '"/>';
|
|
51
|
-
const viewBox = 'viewBox="0 0 ' + qrcodesize + " " + qrcodesize + '"';
|
|
52
|
-
const width = !opts.width ? "" : 'width="' + opts.width + '" height="' + opts.width + '" ';
|
|
53
|
-
const svgTag2 = '<svg xmlns="http://www.w3.org/2000/svg" ' + width + viewBox + ' shape-rendering="crispEdges">' + bg + path + "</svg>\n";
|
|
54
|
-
if (typeof cb === "function") {
|
|
55
|
-
cb(null, svgTag2);
|
|
56
|
-
}
|
|
57
|
-
return svgTag2;
|
|
58
|
-
};
|
|
59
|
-
return svgTag;
|
|
60
|
-
}
|
|
61
|
-
export {
|
|
62
|
-
requireSvgTag as __require
|
|
63
|
-
};
|
|
64
|
-
//# sourceMappingURL=svg-tag.js.map
|
package/dist/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/renderer/svg-tag.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"svg-tag.js","sources":["../../../../../../../../../node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/renderer/svg-tag.js"],"sourcesContent":["const Utils = require('./utils')\n\nfunction getColorAttrib (color, attrib) {\n const alpha = color.a / 255\n const str = attrib + '=\"' + color.hex + '\"'\n\n return alpha < 1\n ? str + ' ' + attrib + '-opacity=\"' + alpha.toFixed(2).slice(1) + '\"'\n : str\n}\n\nfunction svgCmd (cmd, x, y) {\n let str = cmd + x\n if (typeof y !== 'undefined') str += ' ' + y\n\n return str\n}\n\nfunction qrToPath (data, size, margin) {\n let path = ''\n let moveBy = 0\n let newRow = false\n let lineLength = 0\n\n for (let i = 0; i < data.length; i++) {\n const col = Math.floor(i % size)\n const row = Math.floor(i / size)\n\n if (!col && !newRow) newRow = true\n\n if (data[i]) {\n lineLength++\n\n if (!(i > 0 && col > 0 && data[i - 1])) {\n path += newRow\n ? svgCmd('M', col + margin, 0.5 + row + margin)\n : svgCmd('m', moveBy, 0)\n\n moveBy = 0\n newRow = false\n }\n\n if (!(col + 1 < size && data[i + 1])) {\n path += svgCmd('h', lineLength)\n lineLength = 0\n }\n } else {\n moveBy++\n }\n }\n\n return path\n}\n\nexports.render = function render (qrData, options, cb) {\n const opts = Utils.getOptions(options)\n const size = qrData.modules.size\n const data = qrData.modules.data\n const qrcodesize = size + opts.margin * 2\n\n const bg = !opts.color.light.a\n ? ''\n : '<path ' + getColorAttrib(opts.color.light, 'fill') +\n ' d=\"M0 0h' + qrcodesize + 'v' + qrcodesize + 'H0z\"/>'\n\n const path =\n '<path ' + getColorAttrib(opts.color.dark, 'stroke') +\n ' d=\"' + qrToPath(data, size, opts.margin) + '\"/>'\n\n const viewBox = 'viewBox=\"' + '0 0 ' + qrcodesize + ' ' + qrcodesize + '\"'\n\n const width = !opts.width ? '' : 'width=\"' + opts.width + '\" height=\"' + opts.width + '\" '\n\n const svgTag = '<svg xmlns=\"http://www.w3.org/2000/svg\" ' + width + viewBox + ' shape-rendering=\"crispEdges\">' + bg + path + '</svg>\\n'\n\n if (typeof cb === 'function') {\n cb(null, svgTag)\n }\n\n return svgTag\n}\n"],"names":["require$$0","svgTag"],"mappings":";;;;;;AAAA,QAAM,QAAQA,aAAA;AAEd,WAAS,eAAgB,OAAO,QAAQ;AACtC,UAAM,QAAQ,MAAM,IAAI;AACxB,UAAM,MAAM,SAAS,OAAO,MAAM,MAAM;AAExC,WAAO,QAAQ,IACX,MAAM,MAAM,SAAS,eAAe,MAAM,QAAQ,CAAC,EAAE,MAAM,CAAC,IAAI,MAChE;AAAA,EACN;AAEA,WAAS,OAAQ,KAAK,GAAG,GAAG;AAC1B,QAAI,MAAM,MAAM;AAChB,QAAI,OAAO,MAAM,YAAa,QAAO,MAAM;AAE3C,WAAO;AAAA,EACT;AAEA,WAAS,SAAU,MAAM,MAAM,QAAQ;AACrC,QAAI,OAAO;AACX,QAAI,SAAS;AACb,QAAI,SAAS;AACb,QAAI,aAAa;AAEjB,aAAS,IAAI,GAAG,IAAI,KAAK,QAAQ,KAAK;AACpC,YAAM,MAAM,KAAK,MAAM,IAAI,IAAI;AAC/B,YAAM,MAAM,KAAK,MAAM,IAAI,IAAI;AAE/B,UAAI,CAAC,OAAO,CAAC,OAAQ,UAAS;AAE9B,UAAI,KAAK,CAAC,GAAG;AACX;AAEA,YAAI,EAAE,IAAI,KAAK,MAAM,KAAK,KAAK,IAAI,CAAC,IAAI;AACtC,kBAAQ,SACJ,OAAO,KAAK,MAAM,QAAQ,MAAM,MAAM,MAAM,IAC5C,OAAO,KAAK,QAAQ,CAAC;AAEzB,mBAAS;AACT,mBAAS;AAAA,QACjB;AAEM,YAAI,EAAE,MAAM,IAAI,QAAQ,KAAK,IAAI,CAAC,IAAI;AACpC,kBAAQ,OAAO,KAAK,UAAU;AAC9B,uBAAa;AAAA,QACrB;AAAA,MACA,OAAW;AACL;AAAA,MACN;AAAA,IACA;AAEE,WAAO;AAAA,EACT;AAEA,SAAA,SAAiB,SAAS,OAAQ,QAAQ,SAAS,IAAI;AACrD,UAAM,OAAO,MAAM,WAAW,OAAO;AACrC,UAAM,OAAO,OAAO,QAAQ;AAC5B,UAAM,OAAO,OAAO,QAAQ;AAC5B,UAAM,aAAa,OAAO,KAAK,SAAS;AAExC,UAAM,KAAK,CAAC,KAAK,MAAM,MAAM,IACzB,KACA,WAAW,eAAe,KAAK,MAAM,OAAO,MAAM,IAClD,cAAc,aAAa,MAAM,aAAa;AAElD,UAAM,OACJ,WAAW,eAAe,KAAK,MAAM,MAAM,QAAQ,IACnD,SAAS,SAAS,MAAM,MAAM,KAAK,MAAM,IAAI;AAE/C,UAAM,UAAU,kBAAuB,aAAa,MAAM,aAAa;AAEvE,UAAM,QAAQ,CAAC,KAAK,QAAQ,KAAK,YAAY,KAAK,QAAQ,eAAe,KAAK,QAAQ;AAEtF,UAAMC,UAAS,6CAA6C,QAAQ,UAAU,mCAAmC,KAAK,OAAO;AAE7H,QAAI,OAAO,OAAO,YAAY;AAC5B,SAAG,MAAMA,OAAM;AAAA,IACnB;AAEE,WAAOA;AAAA,EACT;;;","x_google_ignoreList":[0]}
|
|
@@ -1,87 +0,0 @@
|
|
|
1
|
-
import { __exports as utils } from "../../../../../../../_virtual/utils.js";
|
|
2
|
-
var hasRequiredUtils;
|
|
3
|
-
function requireUtils() {
|
|
4
|
-
if (hasRequiredUtils) return utils;
|
|
5
|
-
hasRequiredUtils = 1;
|
|
6
|
-
(function(exports) {
|
|
7
|
-
function hex2rgba(hex) {
|
|
8
|
-
if (typeof hex === "number") {
|
|
9
|
-
hex = hex.toString();
|
|
10
|
-
}
|
|
11
|
-
if (typeof hex !== "string") {
|
|
12
|
-
throw new Error("Color should be defined as hex string");
|
|
13
|
-
}
|
|
14
|
-
let hexCode = hex.slice().replace("#", "").split("");
|
|
15
|
-
if (hexCode.length < 3 || hexCode.length === 5 || hexCode.length > 8) {
|
|
16
|
-
throw new Error("Invalid hex color: " + hex);
|
|
17
|
-
}
|
|
18
|
-
if (hexCode.length === 3 || hexCode.length === 4) {
|
|
19
|
-
hexCode = Array.prototype.concat.apply([], hexCode.map(function(c) {
|
|
20
|
-
return [c, c];
|
|
21
|
-
}));
|
|
22
|
-
}
|
|
23
|
-
if (hexCode.length === 6) hexCode.push("F", "F");
|
|
24
|
-
const hexValue = parseInt(hexCode.join(""), 16);
|
|
25
|
-
return {
|
|
26
|
-
r: hexValue >> 24 & 255,
|
|
27
|
-
g: hexValue >> 16 & 255,
|
|
28
|
-
b: hexValue >> 8 & 255,
|
|
29
|
-
a: hexValue & 255,
|
|
30
|
-
hex: "#" + hexCode.slice(0, 6).join("")
|
|
31
|
-
};
|
|
32
|
-
}
|
|
33
|
-
exports.getOptions = function getOptions(options) {
|
|
34
|
-
if (!options) options = {};
|
|
35
|
-
if (!options.color) options.color = {};
|
|
36
|
-
const margin = typeof options.margin === "undefined" || options.margin === null || options.margin < 0 ? 4 : options.margin;
|
|
37
|
-
const width = options.width && options.width >= 21 ? options.width : void 0;
|
|
38
|
-
const scale = options.scale || 4;
|
|
39
|
-
return {
|
|
40
|
-
width,
|
|
41
|
-
scale: width ? 4 : scale,
|
|
42
|
-
margin,
|
|
43
|
-
color: {
|
|
44
|
-
dark: hex2rgba(options.color.dark || "#000000ff"),
|
|
45
|
-
light: hex2rgba(options.color.light || "#ffffffff")
|
|
46
|
-
},
|
|
47
|
-
type: options.type,
|
|
48
|
-
rendererOpts: options.rendererOpts || {}
|
|
49
|
-
};
|
|
50
|
-
};
|
|
51
|
-
exports.getScale = function getScale(qrSize, opts) {
|
|
52
|
-
return opts.width && opts.width >= qrSize + opts.margin * 2 ? opts.width / (qrSize + opts.margin * 2) : opts.scale;
|
|
53
|
-
};
|
|
54
|
-
exports.getImageWidth = function getImageWidth(qrSize, opts) {
|
|
55
|
-
const scale = exports.getScale(qrSize, opts);
|
|
56
|
-
return Math.floor((qrSize + opts.margin * 2) * scale);
|
|
57
|
-
};
|
|
58
|
-
exports.qrToImageData = function qrToImageData(imgData, qr, opts) {
|
|
59
|
-
const size = qr.modules.size;
|
|
60
|
-
const data = qr.modules.data;
|
|
61
|
-
const scale = exports.getScale(size, opts);
|
|
62
|
-
const symbolSize = Math.floor((size + opts.margin * 2) * scale);
|
|
63
|
-
const scaledMargin = opts.margin * scale;
|
|
64
|
-
const palette = [opts.color.light, opts.color.dark];
|
|
65
|
-
for (let i = 0; i < symbolSize; i++) {
|
|
66
|
-
for (let j = 0; j < symbolSize; j++) {
|
|
67
|
-
let posDst = (i * symbolSize + j) * 4;
|
|
68
|
-
let pxColor = opts.color.light;
|
|
69
|
-
if (i >= scaledMargin && j >= scaledMargin && i < symbolSize - scaledMargin && j < symbolSize - scaledMargin) {
|
|
70
|
-
const iSrc = Math.floor((i - scaledMargin) / scale);
|
|
71
|
-
const jSrc = Math.floor((j - scaledMargin) / scale);
|
|
72
|
-
pxColor = palette[data[iSrc * size + jSrc] ? 1 : 0];
|
|
73
|
-
}
|
|
74
|
-
imgData[posDst++] = pxColor.r;
|
|
75
|
-
imgData[posDst++] = pxColor.g;
|
|
76
|
-
imgData[posDst++] = pxColor.b;
|
|
77
|
-
imgData[posDst] = pxColor.a;
|
|
78
|
-
}
|
|
79
|
-
}
|
|
80
|
-
};
|
|
81
|
-
})(utils);
|
|
82
|
-
return utils;
|
|
83
|
-
}
|
|
84
|
-
export {
|
|
85
|
-
requireUtils as __require
|
|
86
|
-
};
|
|
87
|
-
//# sourceMappingURL=utils.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"utils.js","sources":["../../../../../../../../../node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/renderer/utils.js"],"sourcesContent":["function hex2rgba (hex) {\n if (typeof hex === 'number') {\n hex = hex.toString()\n }\n\n if (typeof hex !== 'string') {\n throw new Error('Color should be defined as hex string')\n }\n\n let hexCode = hex.slice().replace('#', '').split('')\n if (hexCode.length < 3 || hexCode.length === 5 || hexCode.length > 8) {\n throw new Error('Invalid hex color: ' + hex)\n }\n\n // Convert from short to long form (fff -> ffffff)\n if (hexCode.length === 3 || hexCode.length === 4) {\n hexCode = Array.prototype.concat.apply([], hexCode.map(function (c) {\n return [c, c]\n }))\n }\n\n // Add default alpha value\n if (hexCode.length === 6) hexCode.push('F', 'F')\n\n const hexValue = parseInt(hexCode.join(''), 16)\n\n return {\n r: (hexValue >> 24) & 255,\n g: (hexValue >> 16) & 255,\n b: (hexValue >> 8) & 255,\n a: hexValue & 255,\n hex: '#' + hexCode.slice(0, 6).join('')\n }\n}\n\nexports.getOptions = function getOptions (options) {\n if (!options) options = {}\n if (!options.color) options.color = {}\n\n const margin = typeof options.margin === 'undefined' ||\n options.margin === null ||\n options.margin < 0\n ? 4\n : options.margin\n\n const width = options.width && options.width >= 21 ? options.width : undefined\n const scale = options.scale || 4\n\n return {\n width: width,\n scale: width ? 4 : scale,\n margin: margin,\n color: {\n dark: hex2rgba(options.color.dark || '#000000ff'),\n light: hex2rgba(options.color.light || '#ffffffff')\n },\n type: options.type,\n rendererOpts: options.rendererOpts || {}\n }\n}\n\nexports.getScale = function getScale (qrSize, opts) {\n return opts.width && opts.width >= qrSize + opts.margin * 2\n ? opts.width / (qrSize + opts.margin * 2)\n : opts.scale\n}\n\nexports.getImageWidth = function getImageWidth (qrSize, opts) {\n const scale = exports.getScale(qrSize, opts)\n return Math.floor((qrSize + opts.margin * 2) * scale)\n}\n\nexports.qrToImageData = function qrToImageData (imgData, qr, opts) {\n const size = qr.modules.size\n const data = qr.modules.data\n const scale = exports.getScale(size, opts)\n const symbolSize = Math.floor((size + opts.margin * 2) * scale)\n const scaledMargin = opts.margin * scale\n const palette = [opts.color.light, opts.color.dark]\n\n for (let i = 0; i < symbolSize; i++) {\n for (let j = 0; j < symbolSize; j++) {\n let posDst = (i * symbolSize + j) * 4\n let pxColor = opts.color.light\n\n if (i >= scaledMargin && j >= scaledMargin &&\n i < symbolSize - scaledMargin && j < symbolSize - scaledMargin) {\n const iSrc = Math.floor((i - scaledMargin) / scale)\n const jSrc = Math.floor((j - scaledMargin) / scale)\n pxColor = palette[data[iSrc * size + jSrc] ? 1 : 0]\n }\n\n imgData[posDst++] = pxColor.r\n imgData[posDst++] = pxColor.g\n imgData[posDst++] = pxColor.b\n imgData[posDst] = pxColor.a\n }\n }\n}\n"],"names":[],"mappings":";;;;;;AAAA,aAAS,SAAU,KAAK;AACtB,UAAI,OAAO,QAAQ,UAAU;AAC3B,cAAM,IAAI,SAAQ;AAAA,MACtB;AAEE,UAAI,OAAO,QAAQ,UAAU;AAC3B,cAAM,IAAI,MAAM,uCAAuC;AAAA,MAC3D;AAEE,UAAI,UAAU,IAAI,MAAK,EAAG,QAAQ,KAAK,EAAE,EAAE,MAAM,EAAE;AACnD,UAAI,QAAQ,SAAS,KAAK,QAAQ,WAAW,KAAK,QAAQ,SAAS,GAAG;AACpE,cAAM,IAAI,MAAM,wBAAwB,GAAG;AAAA,MAC/C;AAGE,UAAI,QAAQ,WAAW,KAAK,QAAQ,WAAW,GAAG;AAChD,kBAAU,MAAM,UAAU,OAAO,MAAM,CAAA,GAAI,QAAQ,IAAI,SAAU,GAAG;AAClE,iBAAO,CAAC,GAAG,CAAC;AAAA,QAClB,CAAK,CAAC;AAAA,MACN;AAGE,UAAI,QAAQ,WAAW,EAAG,SAAQ,KAAK,KAAK,GAAG;AAE/C,YAAM,WAAW,SAAS,QAAQ,KAAK,EAAE,GAAG,EAAE;AAE9C,aAAO;AAAA,QACL,GAAI,YAAY,KAAM;AAAA,QACtB,GAAI,YAAY,KAAM;AAAA,QACtB,GAAI,YAAY,IAAK;AAAA,QACrB,GAAG,WAAW;AAAA,QACd,KAAK,MAAM,QAAQ,MAAM,GAAG,CAAC,EAAE,KAAK,EAAE;AAAA,MAC1C;AAAA,IACA;AAEA,YAAA,aAAqB,SAAS,WAAY,SAAS;AACjD,UAAI,CAAC,QAAS,WAAU,CAAA;AACxB,UAAI,CAAC,QAAQ,MAAO,SAAQ,QAAQ,CAAA;AAEpC,YAAM,SAAS,OAAO,QAAQ,WAAW,eACvC,QAAQ,WAAW,QACnB,QAAQ,SAAS,IACf,IACA,QAAQ;AAEZ,YAAM,QAAQ,QAAQ,SAAS,QAAQ,SAAS,KAAK,QAAQ,QAAQ;AACrE,YAAM,QAAQ,QAAQ,SAAS;AAE/B,aAAO;AAAA,QACL;AAAA,QACA,OAAO,QAAQ,IAAI;AAAA,QACnB;AAAA,QACA,OAAO;AAAA,UACL,MAAM,SAAS,QAAQ,MAAM,QAAQ,WAAW;AAAA,UAChD,OAAO,SAAS,QAAQ,MAAM,SAAS,WAAW;AAAA;QAEpD,MAAM,QAAQ;AAAA,QACd,cAAc,QAAQ,gBAAgB,CAAA;AAAA,MAC1C;AAAA,IACA;AAEA,YAAA,WAAmB,SAAS,SAAU,QAAQ,MAAM;AAClD,aAAO,KAAK,SAAS,KAAK,SAAS,SAAS,KAAK,SAAS,IACtD,KAAK,SAAS,SAAS,KAAK,SAAS,KACrC,KAAK;AAAA,IACX;AAEA,YAAA,gBAAwB,SAAS,cAAe,QAAQ,MAAM;AAC5D,YAAM,QAAQ,QAAQ,SAAS,QAAQ,IAAI;AAC3C,aAAO,KAAK,OAAO,SAAS,KAAK,SAAS,KAAK,KAAK;AAAA,IACtD;AAEA,YAAA,gBAAwB,SAAS,cAAe,SAAS,IAAI,MAAM;AACjE,YAAM,OAAO,GAAG,QAAQ;AACxB,YAAM,OAAO,GAAG,QAAQ;AACxB,YAAM,QAAQ,QAAQ,SAAS,MAAM,IAAI;AACzC,YAAM,aAAa,KAAK,OAAO,OAAO,KAAK,SAAS,KAAK,KAAK;AAC9D,YAAM,eAAe,KAAK,SAAS;AACnC,YAAM,UAAU,CAAC,KAAK,MAAM,OAAO,KAAK,MAAM,IAAI;AAElD,eAAS,IAAI,GAAG,IAAI,YAAY,KAAK;AACnC,iBAAS,IAAI,GAAG,IAAI,YAAY,KAAK;AACnC,cAAI,UAAU,IAAI,aAAa,KAAK;AACpC,cAAI,UAAU,KAAK,MAAM;AAEzB,cAAI,KAAK,gBAAgB,KAAK,gBAC5B,IAAI,aAAa,gBAAgB,IAAI,aAAa,cAAc;AAChE,kBAAM,OAAO,KAAK,OAAO,IAAI,gBAAgB,KAAK;AAClD,kBAAM,OAAO,KAAK,OAAO,IAAI,gBAAgB,KAAK;AAClD,sBAAU,QAAQ,KAAK,OAAO,OAAO,IAAI,IAAI,IAAI,CAAC;AAAA,UAC1D;AAEM,kBAAQ,QAAQ,IAAI,QAAQ;AAC5B,kBAAQ,QAAQ,IAAI,QAAQ;AAC5B,kBAAQ,QAAQ,IAAI,QAAQ;AAC5B,kBAAQ,MAAM,IAAI,QAAQ;AAAA,QAChC;AAAA,MACA;AAAA,IACA;AAAA;;;","x_google_ignoreList":[0]}
|
|
@@ -1,92 +0,0 @@
|
|
|
1
|
-
import crypto from "crypto";
|
|
2
|
-
const fingerprintCache = /* @__PURE__ */ new Map();
|
|
3
|
-
const generateFingerprint = (req) => {
|
|
4
|
-
const { ip, headers } = req;
|
|
5
|
-
const userAgent = headers["user-agent"];
|
|
6
|
-
const acceptLanguage = headers["accept-language"];
|
|
7
|
-
const key = `${ip}-${userAgent}-${acceptLanguage}`;
|
|
8
|
-
if (fingerprintCache.has(key)) {
|
|
9
|
-
return fingerprintCache.get(key);
|
|
10
|
-
}
|
|
11
|
-
const hash = crypto.createHash("sha256");
|
|
12
|
-
hash.update(key);
|
|
13
|
-
const digest = hash.digest("hex");
|
|
14
|
-
fingerprintCache.set(key, digest);
|
|
15
|
-
return digest;
|
|
16
|
-
};
|
|
17
|
-
const modelsFactory = (db) => {
|
|
18
|
-
const Visitor = db.visitor;
|
|
19
|
-
const Request = db.request;
|
|
20
|
-
const visitorLogger = async (req, res, next) => {
|
|
21
|
-
const fingerprint = generateFingerprint(req);
|
|
22
|
-
try {
|
|
23
|
-
let visitor = await Visitor.findOne({ fingerprint });
|
|
24
|
-
if (!visitor) {
|
|
25
|
-
visitor = new Visitor({
|
|
26
|
-
ip: req.ip,
|
|
27
|
-
userAgent: req.headers["user-agent"],
|
|
28
|
-
acceptLanguage: req.headers["accept-language"],
|
|
29
|
-
fingerprint
|
|
30
|
-
});
|
|
31
|
-
await visitor.save();
|
|
32
|
-
}
|
|
33
|
-
const newRequest = new Request({
|
|
34
|
-
visitor: visitor._id,
|
|
35
|
-
path: req.path,
|
|
36
|
-
method: req.method,
|
|
37
|
-
timestamp: /* @__PURE__ */ new Date()
|
|
38
|
-
});
|
|
39
|
-
await newRequest.save();
|
|
40
|
-
next();
|
|
41
|
-
} catch (error) {
|
|
42
|
-
console.error("Error processing visitor and request data:", error);
|
|
43
|
-
next();
|
|
44
|
-
}
|
|
45
|
-
};
|
|
46
|
-
const findOrCreateVisitor = async (req) => {
|
|
47
|
-
const fingerprint = generateFingerprint(req);
|
|
48
|
-
try {
|
|
49
|
-
let visitor = await Visitor.findOne({ fingerprint });
|
|
50
|
-
if (!visitor) {
|
|
51
|
-
visitor = new Visitor({
|
|
52
|
-
ip: req.ip,
|
|
53
|
-
userAgent: req.headers["user-agent"],
|
|
54
|
-
acceptLanguage: req.headers["accept-language"],
|
|
55
|
-
fingerprint
|
|
56
|
-
});
|
|
57
|
-
await visitor.save();
|
|
58
|
-
}
|
|
59
|
-
return visitor;
|
|
60
|
-
} catch (error) {
|
|
61
|
-
console.error("Error creating/finding visitor:", error);
|
|
62
|
-
throw error;
|
|
63
|
-
}
|
|
64
|
-
};
|
|
65
|
-
return {
|
|
66
|
-
visitorLogger,
|
|
67
|
-
generateFingerprint,
|
|
68
|
-
findOrCreateVisitor
|
|
69
|
-
};
|
|
70
|
-
};
|
|
71
|
-
const applyProfileSchema = (function applyProfileSchema2(schema, db) {
|
|
72
|
-
schema.add({
|
|
73
|
-
profile: {
|
|
74
|
-
photo: {
|
|
75
|
-
type: String,
|
|
76
|
-
default: null
|
|
77
|
-
},
|
|
78
|
-
name: {
|
|
79
|
-
type: String,
|
|
80
|
-
default: null
|
|
81
|
-
},
|
|
82
|
-
description: {
|
|
83
|
-
type: String,
|
|
84
|
-
default: null
|
|
85
|
-
}
|
|
86
|
-
}
|
|
87
|
-
});
|
|
88
|
-
});
|
|
89
|
-
export {
|
|
90
|
-
applyProfileSchema as a,
|
|
91
|
-
modelsFactory as m
|
|
92
|
-
};
|
|
@@ -1,75 +0,0 @@
|
|
|
1
|
-
import crypto from 'crypto';
|
|
2
|
-
const fingerprintCache = new Map();
|
|
3
|
-
const generateFingerprint = req => {
|
|
4
|
-
const { ip, headers } = req;
|
|
5
|
-
const userAgent = headers['user-agent'];
|
|
6
|
-
const acceptLanguage = headers['accept-language'];
|
|
7
|
-
const key = `${ip}-${userAgent}-${acceptLanguage}`;
|
|
8
|
-
if (fingerprintCache.has(key)) {
|
|
9
|
-
return fingerprintCache.get(key);
|
|
10
|
-
}
|
|
11
|
-
const hash = crypto.createHash('sha256');
|
|
12
|
-
hash.update(key);
|
|
13
|
-
const digest = hash.digest('hex');
|
|
14
|
-
fingerprintCache.set(key, digest);
|
|
15
|
-
return digest;
|
|
16
|
-
};
|
|
17
|
-
const modelsFactory = db => {
|
|
18
|
-
const Visitor = db.visitor;
|
|
19
|
-
const Request = db.request;
|
|
20
|
-
const visitorLogger = async (req, res, next) => {
|
|
21
|
-
const fingerprint = generateFingerprint(req);
|
|
22
|
-
try {
|
|
23
|
-
// Check if the visitor already exists
|
|
24
|
-
let visitor = await Visitor.findOne({ fingerprint: fingerprint });
|
|
25
|
-
// If visitor does not exist, create a new one
|
|
26
|
-
if (!visitor) {
|
|
27
|
-
visitor = new Visitor({
|
|
28
|
-
ip: req.ip,
|
|
29
|
-
userAgent: req.headers['user-agent'],
|
|
30
|
-
acceptLanguage: req.headers['accept-language'],
|
|
31
|
-
fingerprint: fingerprint,
|
|
32
|
-
});
|
|
33
|
-
await visitor.save();
|
|
34
|
-
}
|
|
35
|
-
// Log the request in a separate model
|
|
36
|
-
const newRequest = new Request({
|
|
37
|
-
visitor: visitor._id,
|
|
38
|
-
path: req.path,
|
|
39
|
-
method: req.method,
|
|
40
|
-
timestamp: new Date(),
|
|
41
|
-
});
|
|
42
|
-
await newRequest.save();
|
|
43
|
-
next();
|
|
44
|
-
} catch (error) {
|
|
45
|
-
console.error('Error processing visitor and request data:', error);
|
|
46
|
-
next();
|
|
47
|
-
}
|
|
48
|
-
};
|
|
49
|
-
const findOrCreateVisitor = async (req) => {
|
|
50
|
-
const fingerprint = generateFingerprint(req);
|
|
51
|
-
try {
|
|
52
|
-
let visitor = await Visitor.findOne({ fingerprint: fingerprint });
|
|
53
|
-
if (!visitor) {
|
|
54
|
-
visitor = new Visitor({
|
|
55
|
-
ip: req.ip,
|
|
56
|
-
userAgent: req.headers['user-agent'],
|
|
57
|
-
acceptLanguage: req.headers['accept-language'],
|
|
58
|
-
fingerprint: fingerprint,
|
|
59
|
-
});
|
|
60
|
-
await visitor.save();
|
|
61
|
-
}
|
|
62
|
-
return visitor;
|
|
63
|
-
} catch (error) {
|
|
64
|
-
console.error('Error creating/finding visitor:', error);
|
|
65
|
-
throw error;
|
|
66
|
-
}
|
|
67
|
-
};
|
|
68
|
-
|
|
69
|
-
return {
|
|
70
|
-
visitorLogger,
|
|
71
|
-
generateFingerprint,
|
|
72
|
-
findOrCreateVisitor,
|
|
73
|
-
};
|
|
74
|
-
};
|
|
75
|
-
export default modelsFactory;
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import middlewareFactory from '@martyrs/src/modules/auth/controllers/middlewares/index.js';
|
|
2
|
-
import controllerFactory from '../services/twofa.service.js';
|
|
3
|
-
export default (function (app, db) {
|
|
4
|
-
const controller = controllerFactory(db);
|
|
5
|
-
const { verifySignUp, verifyUser } = middlewareFactory(db);
|
|
6
|
-
app.post('/api/twofa/sendcode', [verifySignUp.checkDuplicateUsernameOrEmail], controller.sendcode);
|
|
7
|
-
app.post('/api/twofa/sendcodereset', [verifyUser.checkUserExist], controller.sendcode);
|
|
8
|
-
});
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import mailing from '@martyrs/src/modules/core/controllers/utils/mailing.js';
|
|
2
|
-
const { sendEmail, sendSms } = mailing;
|
|
3
|
-
const controllerFactory = db => {
|
|
4
|
-
const sendcode = async (req, res) => {
|
|
5
|
-
const code = Math.floor(1000 + Math.random() * 9000);
|
|
6
|
-
const type = req.body.type;
|
|
7
|
-
const method = req.body.method;
|
|
8
|
-
if (type === 'email') {
|
|
9
|
-
const emailSent = await sendEmail(req.body.email, `${process.env.APP_NAME} Verification Code`, `Your ${process.env.APP_NAME} verification code is ${code}`);
|
|
10
|
-
if (emailSent) {
|
|
11
|
-
res.send({ code, type, method });
|
|
12
|
-
} else {
|
|
13
|
-
console.log(emailSent);
|
|
14
|
-
res.status(500).send('Failed to send email');
|
|
15
|
-
}
|
|
16
|
-
}
|
|
17
|
-
else if (type === 'phone') {
|
|
18
|
-
const smsSent = await sendSms(req.body.phone, `Your ${process.env.APP_NAME} verification code: ${code}`);
|
|
19
|
-
if (smsSent) {
|
|
20
|
-
res.send({ code, type, method });
|
|
21
|
-
} else {
|
|
22
|
-
res.status(500).send('Failed to send SMS');
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
};
|
|
26
|
-
return {
|
|
27
|
-
sendcode,
|
|
28
|
-
};
|
|
29
|
-
};
|
|
30
|
-
export default controllerFactory;
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
export default db => {
|
|
2
|
-
const RequestSchema = new db.mongoose.Schema({
|
|
3
|
-
visitor: {
|
|
4
|
-
type: db.mongoose.Schema.Types.ObjectId,
|
|
5
|
-
ref: 'Visitor',
|
|
6
|
-
},
|
|
7
|
-
path: String,
|
|
8
|
-
method: String,
|
|
9
|
-
timestamp: { type: Date, default: Date.now },
|
|
10
|
-
});
|
|
11
|
-
RequestSchema.index({ visitor: 1 });
|
|
12
|
-
const Request = db.mongoose.model('Request', RequestSchema);
|
|
13
|
-
return Request;
|
|
14
|
-
};
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
export default db => {
|
|
2
|
-
const VisitorSchema = new db.mongoose.Schema({
|
|
3
|
-
ip: String,
|
|
4
|
-
userAgent: String,
|
|
5
|
-
acceptLanguage: String,
|
|
6
|
-
fingerprint: { type: String, unique: true },
|
|
7
|
-
});
|
|
8
|
-
// VisitorSchema.index({ fingerprint: 1 });
|
|
9
|
-
const Visitor = db.mongoose.model('Visitor', VisitorSchema);
|
|
10
|
-
return Visitor;
|
|
11
|
-
};
|