@ozdao/prometheus-framework 0.2.44 → 0.2.47
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/main-AMWMdo3t.js +91 -0
- package/dist/main-R6dlNKp-.mjs +13606 -0
- package/dist/main.css +1 -1
- package/dist/node_modules/@noble/hashes/esm/_assert.cjs +1 -1
- package/dist/node_modules/@noble/hashes/esm/_assert.js +6 -6
- package/dist/node_modules/@noble/hashes/esm/_u64.cjs +1 -1
- package/dist/node_modules/@noble/hashes/esm/_u64.js +8 -8
- package/dist/node_modules/@noble/hashes/esm/sha512.cjs +1 -1
- package/dist/node_modules/@noble/hashes/esm/sha512.js +2 -2
- package/dist/node_modules/@ozdao/prometheus-framework/dist/prometheus-framework/node_modules/axios/lib/helpers/isURLSameOrigin.js +1 -1
- package/dist/node_modules/@ozdao/prometheus-framework/dist/prometheus-framework/node_modules/axios/lib/platform/common/utils.cjs +1 -1
- package/dist/node_modules/@ozdao/prometheus-framework/dist/prometheus-framework/node_modules/axios/lib/platform/common/utils.js +2 -2
- package/dist/node_modules/@ozdao/prometheus-framework/dist/prometheus-framework/node_modules/axios/lib/utils.cjs +1 -1
- package/dist/node_modules/@ozdao/prometheus-framework/dist/prometheus-framework/node_modules/axios/lib/utils.js +3 -3
- package/dist/node_modules/@ozdao/prometheus-framework/dist/prometheus-framework.es.cjs +1 -1
- package/dist/node_modules/@ozdao/prometheus-framework/dist/prometheus-framework.es.js +6 -6
- package/dist/node_modules/ethereum-cryptography/esm/utils.cjs +1 -1
- package/dist/node_modules/ethereum-cryptography/esm/utils.js +3 -4
- package/dist/node_modules/vue3-carousel/dist/carousel.css.cjs +1 -1
- package/dist/node_modules/vue3-carousel/dist/carousel.css.js +1 -4
- package/dist/node_modules/web3/lib/esm/accounts.cjs +1 -1
- package/dist/node_modules/web3/lib/esm/accounts.js +36 -36
- package/dist/node_modules/web3-core/lib/esm/web3_batch_request.cjs +1 -1
- package/dist/node_modules/web3-core/lib/esm/web3_batch_request.js +27 -27
- package/dist/node_modules/web3-core/lib/esm/web3_context.cjs +1 -1
- package/dist/node_modules/web3-core/lib/esm/web3_context.js +24 -24
- package/dist/node_modules/web3-core/lib/esm/web3_promi_event.cjs +1 -1
- package/dist/node_modules/web3-core/lib/esm/web3_promi_event.js +33 -33
- package/dist/node_modules/web3-core/lib/esm/web3_request_manager.cjs +1 -1
- package/dist/node_modules/web3-core/lib/esm/web3_request_manager.js +10 -10
- package/dist/node_modules/web3-core/lib/esm/web3_subscription_manager.cjs +1 -1
- package/dist/node_modules/web3-core/lib/esm/web3_subscription_manager.js +1 -1
- package/dist/node_modules/web3-core/lib/esm/web3_subscriptions.cjs +1 -1
- package/dist/node_modules/web3-core/lib/esm/web3_subscriptions.js +13 -13
- package/dist/node_modules/web3-eth/lib/esm/rpc_method_wrappers.cjs +1 -1
- package/dist/node_modules/web3-eth/lib/esm/rpc_method_wrappers.js +110 -110
- package/dist/node_modules/web3-eth/lib/esm/utils/get_revert_reason.cjs +1 -1
- package/dist/node_modules/web3-eth/lib/esm/utils/get_revert_reason.js +26 -26
- package/dist/node_modules/web3-eth/lib/esm/utils/get_transaction_error.cjs +1 -1
- package/dist/node_modules/web3-eth/lib/esm/utils/get_transaction_error.js +14 -14
- package/dist/node_modules/web3-eth/lib/esm/utils/get_transaction_gas_pricing.cjs +1 -1
- package/dist/node_modules/web3-eth/lib/esm/utils/get_transaction_gas_pricing.js +36 -36
- package/dist/node_modules/web3-eth/lib/esm/utils/prepare_transaction_for_signing.cjs +1 -1
- package/dist/node_modules/web3-eth/lib/esm/utils/prepare_transaction_for_signing.js +20 -20
- package/dist/node_modules/web3-eth/lib/esm/utils/reject_if_block_timeout.cjs +1 -1
- package/dist/node_modules/web3-eth/lib/esm/utils/reject_if_block_timeout.js +23 -23
- package/dist/node_modules/web3-eth/lib/esm/utils/send_tx_helper.cjs +1 -1
- package/dist/node_modules/web3-eth/lib/esm/utils/send_tx_helper.js +17 -17
- package/dist/node_modules/web3-eth/lib/esm/utils/transaction_builder.cjs +1 -1
- package/dist/node_modules/web3-eth/lib/esm/utils/transaction_builder.js +11 -11
- package/dist/node_modules/web3-eth/lib/esm/utils/try_send_transaction.cjs +1 -1
- package/dist/node_modules/web3-eth/lib/esm/utils/try_send_transaction.js +24 -24
- package/dist/node_modules/web3-eth/lib/esm/utils/wait_for_transaction_receipt.cjs +1 -1
- package/dist/node_modules/web3-eth/lib/esm/utils/wait_for_transaction_receipt.js +25 -25
- package/dist/node_modules/web3-eth/lib/esm/utils/watch_transaction_by_polling.cjs +1 -1
- package/dist/node_modules/web3-eth/lib/esm/utils/watch_transaction_by_polling.js +19 -19
- package/dist/node_modules/web3-eth/lib/esm/utils/watch_transaction_by_subscription.cjs +1 -1
- package/dist/node_modules/web3-eth/lib/esm/utils/watch_transaction_by_subscription.js +39 -39
- package/dist/node_modules/web3-eth/lib/esm/web3_eth.cjs +1 -1
- package/dist/node_modules/web3-eth/lib/esm/web3_eth.js +7 -7
- package/dist/node_modules/web3-eth-accounts/lib/esm/account.cjs +2 -2
- package/dist/node_modules/web3-eth-accounts/lib/esm/account.js +28 -28
- package/dist/node_modules/web3-eth-accounts/lib/esm/wallet.cjs +1 -1
- package/dist/node_modules/web3-eth-accounts/lib/esm/wallet.js +3 -3
- package/dist/node_modules/web3-eth-contract/lib/esm/contract.cjs +1 -1
- package/dist/node_modules/web3-eth-contract/lib/esm/contract.js +8 -8
- package/dist/node_modules/web3-eth-ens/lib/esm/ens.cjs +1 -1
- package/dist/node_modules/web3-eth-ens/lib/esm/ens.js +15 -15
- package/dist/node_modules/web3-eth-ens/lib/esm/registry.cjs +1 -1
- package/dist/node_modules/web3-eth-ens/lib/esm/registry.js +16 -16
- package/dist/node_modules/web3-eth-ens/lib/esm/resolver.cjs +1 -1
- package/dist/node_modules/web3-eth-ens/lib/esm/resolver.js +26 -26
- package/dist/node_modules/web3-eth-iban/lib/esm/iban.cjs +1 -1
- package/dist/node_modules/web3-eth-iban/lib/esm/iban.js +2 -2
- package/dist/node_modules/web3-eth-personal/lib/esm/personal.cjs +1 -1
- package/dist/node_modules/web3-eth-personal/lib/esm/personal.js +19 -19
- package/dist/node_modules/web3-eth-personal/lib/esm/rpc_method_wrappers.cjs +1 -1
- package/dist/node_modules/web3-eth-personal/lib/esm/rpc_method_wrappers.js +35 -35
- package/dist/node_modules/web3-net/lib/esm/net.cjs +1 -1
- package/dist/node_modules/web3-net/lib/esm/net.js +25 -25
- package/dist/node_modules/web3-net/lib/esm/rpc_method_wrappers.cjs +1 -1
- package/dist/node_modules/web3-net/lib/esm/rpc_method_wrappers.js +25 -25
- package/dist/node_modules/web3-providers-http/lib/esm/index.cjs +1 -1
- package/dist/node_modules/web3-providers-http/lib/esm/index.js +33 -33
- package/dist/node_modules/web3-rpc-methods/lib/esm/eth_rpc_methods.cjs +1 -1
- package/dist/node_modules/web3-rpc-methods/lib/esm/eth_rpc_methods.js +5 -5
- package/dist/node_modules/web3-rpc-methods/lib/esm/net_rpc_methods.cjs +1 -1
- package/dist/node_modules/web3-rpc-methods/lib/esm/net_rpc_methods.js +19 -19
- package/dist/node_modules/web3-rpc-methods/lib/esm/personal_rpc_methods.cjs +1 -1
- package/dist/node_modules/web3-rpc-methods/lib/esm/personal_rpc_methods.js +27 -27
- package/dist/node_modules/web3-types/lib/esm/web3_base_provider.cjs +1 -1
- package/dist/node_modules/web3-types/lib/esm/web3_base_provider.js +25 -25
- package/dist/node_modules/web3-utils/lib/esm/event_emitter.cjs +1 -1
- package/dist/node_modules/web3-utils/lib/esm/event_emitter.js +15 -15
- package/dist/node_modules/web3-utils/lib/esm/promise_helpers.cjs +1 -1
- package/dist/node_modules/web3-utils/lib/esm/promise_helpers.js +19 -19
- package/dist/node_modules/web3-utils/lib/esm/socket_provider.cjs +1 -1
- package/dist/node_modules/web3-utils/lib/esm/socket_provider.js +17 -17
- package/dist/node_modules/web3-utils/lib/esm/web3_deferred_promise.cjs +1 -1
- package/dist/node_modules/web3-utils/lib/esm/web3_deferred_promise.js +5 -5
- package/dist/node_modules/web3-utils/lib/esm/web3_eip1193_provider.cjs +1 -1
- package/dist/node_modules/web3-utils/lib/esm/web3_eip1193_provider.js +5 -5
- package/dist/products.server.js +875 -0
- package/dist/products.server.mjs +875 -0
- package/dist/prometheus-framework/src/components/Address/Address.vue.cjs +1 -1
- package/dist/prometheus-framework/src/components/Address/Address.vue.js +1 -4
- package/dist/prometheus-framework/src/components/Breadcrumbs/Breadcrumbs.vue.cjs +1 -1
- package/dist/prometheus-framework/src/components/Breadcrumbs/Breadcrumbs.vue.js +1 -4
- package/dist/prometheus-framework/src/components/Button/Button.vue.cjs +1 -1
- package/dist/prometheus-framework/src/components/Button/Button.vue.js +1 -4
- package/dist/prometheus-framework/src/components/Checkbox/Checkbox.vue.cjs +1 -1
- package/dist/prometheus-framework/src/components/Checkbox/Checkbox.vue.js +61 -2
- package/dist/prometheus-framework/src/components/Checkbox/Checkbox.vue2.cjs +1 -1
- package/dist/prometheus-framework/src/components/Checkbox/Checkbox.vue2.js +1 -63
- package/dist/prometheus-framework/src/components/Chips/Chips.vue2.cjs +1 -1
- package/dist/prometheus-framework/src/components/Chips/Chips.vue2.js +1 -4
- package/dist/prometheus-framework/src/components/Dropdown/Dropdown.vue2.cjs +1 -1
- package/dist/prometheus-framework/src/components/Dropdown/Dropdown.vue2.js +1 -4
- package/dist/prometheus-framework/src/components/EditImages/EditImages.vue2.cjs +1 -1
- package/dist/prometheus-framework/src/components/EditImages/EditImages.vue2.js +1 -4
- package/dist/prometheus-framework/src/components/Feed/Feed.vue.cjs +1 -1
- package/dist/prometheus-framework/src/components/Feed/Feed.vue.js +20 -20
- package/dist/prometheus-framework/src/components/Field/Field.vue.cjs +1 -1
- package/dist/prometheus-framework/src/components/Field/Field.vue.js +1 -4
- package/dist/prometheus-framework/src/components/FieldBig/FieldBig.vue.cjs +1 -1
- package/dist/prometheus-framework/src/components/FieldBig/FieldBig.vue.js +18 -18
- package/dist/prometheus-framework/src/components/FieldPhone/FieldPhone.vue.cjs +1 -1
- package/dist/prometheus-framework/src/components/FieldPhone/FieldPhone.vue.js +1 -1
- package/dist/prometheus-framework/src/components/FieldPhone/FieldPhone.vue2.cjs +1 -1
- package/dist/prometheus-framework/src/components/FieldPhone/FieldPhone.vue2.js +1 -4
- package/dist/prometheus-framework/src/components/FieldPhone/FieldPhone2.vue.cjs +1 -1
- package/dist/prometheus-framework/src/components/FieldPhone/FieldPhone2.vue.js +1 -1
- package/dist/prometheus-framework/src/components/FieldPhone/FieldPhone2.vue2.cjs +1 -1
- package/dist/prometheus-framework/src/components/FieldPhone/FieldPhone2.vue2.js +1 -4
- package/dist/prometheus-framework/src/components/FieldTags/BlockTags.vue2.cjs +1 -1
- package/dist/prometheus-framework/src/components/FieldTags/BlockTags.vue2.js +1 -4
- package/dist/prometheus-framework/src/components/FieldTags/tag-input.vue.cjs +1 -1
- package/dist/prometheus-framework/src/components/FieldTags/tag-input.vue.js +1 -4
- package/dist/prometheus-framework/src/components/FieldTags/vue-tags-input.scss.cjs +1 -1
- package/dist/prometheus-framework/src/components/FieldTags/vue-tags-input.scss.js +1 -4
- package/dist/prometheus-framework/src/components/Loader/Loader.vue.cjs +1 -1
- package/dist/prometheus-framework/src/components/Loader/Loader.vue.js +1 -4
- package/dist/prometheus-framework/src/components/LocationMarker/LocationMarker.vue.cjs +1 -1
- package/dist/prometheus-framework/src/components/LocationMarker/LocationMarker.vue.js +1 -4
- package/dist/prometheus-framework/src/components/Magnifier/Magnifier.vue2.cjs +1 -1
- package/dist/prometheus-framework/src/components/Magnifier/Magnifier.vue2.js +1 -4
- package/dist/prometheus-framework/src/components/Map/Map.vue.cjs +1 -1
- package/dist/prometheus-framework/src/components/Map/Map.vue.js +1 -4
- package/dist/prometheus-framework/src/components/Popup/Popup.vue.cjs +1 -1
- package/dist/prometheus-framework/src/components/Popup/Popup.vue.js +70 -2
- package/dist/prometheus-framework/src/components/Popup/Popup.vue2.cjs +1 -1
- package/dist/prometheus-framework/src/components/Popup/Popup.vue2.js +1 -72
- package/dist/prometheus-framework/src/components/Select/Select.vue.cjs +1 -1
- package/dist/prometheus-framework/src/components/Select/Select.vue.js +95 -2
- package/dist/prometheus-framework/src/components/Select/Select.vue2.cjs +1 -1
- package/dist/prometheus-framework/src/components/Select/Select.vue2.js +1 -97
- package/dist/prometheus-framework/src/components/SelectMulti/SelectMulti.vue2.cjs +1 -1
- package/dist/prometheus-framework/src/components/SelectMulti/SelectMulti.vue2.js +1 -4
- package/dist/prometheus-framework/src/components/Spoiler/Spoiler.vue.cjs +1 -1
- package/dist/prometheus-framework/src/components/Spoiler/Spoiler.vue.js +1 -4
- package/dist/prometheus-framework/src/components/Tab/Tab.vue.cjs +1 -1
- package/dist/prometheus-framework/src/components/Tab/Tab.vue.js +1 -4
- package/dist/prometheus-framework/src/components/Tooltip/Tooltip.vue2.cjs +1 -1
- package/dist/prometheus-framework/src/components/Tooltip/Tooltip.vue2.js +1 -4
- package/dist/prometheus-framework/src/components/Upload/Upload.vue.cjs +1 -1
- package/dist/prometheus-framework/src/components/Upload/Upload.vue.js +1 -1
- package/dist/prometheus-framework/src/components/Upload/Upload.vue2.cjs +1 -1
- package/dist/prometheus-framework/src/components/Upload/Upload.vue2.js +1 -4
- package/dist/prometheus-framework/src/components/UploadImage/UploadImage.vue.cjs +1 -1
- package/dist/prometheus-framework/src/components/UploadImage/UploadImage.vue.js +1 -1
- package/dist/prometheus-framework/src/components/UploadImageMultiple/UploadImageMultiple.vue.cjs +1 -1
- package/dist/prometheus-framework/src/components/UploadImageMultiple/UploadImageMultiple.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/auth/components/pages/EnterPassword.vue2.cjs +1 -1
- package/dist/prometheus-framework/src/modules/auth/components/pages/EnterPassword.vue2.js +1 -4
- package/dist/prometheus-framework/src/modules/auth/components/pages/Invite.vue2.cjs +1 -1
- package/dist/prometheus-framework/src/modules/auth/components/pages/Invite.vue2.js +1 -4
- package/dist/prometheus-framework/src/modules/auth/components/pages/ResetPassword.vue2.cjs +1 -1
- package/dist/prometheus-framework/src/modules/auth/components/pages/ResetPassword.vue2.js +1 -4
- package/dist/prometheus-framework/src/modules/auth/components/pages/SignIn.vue2.cjs +1 -1
- package/dist/prometheus-framework/src/modules/auth/components/pages/SignIn.vue2.js +1 -4
- package/dist/prometheus-framework/src/modules/auth/components/pages/SignUp.vue2.cjs +1 -1
- package/dist/prometheus-framework/src/modules/auth/components/pages/SignUp.vue2.js +1 -4
- package/dist/prometheus-framework/src/modules/auth/components/sections/SliderFeatures.vue2.cjs +1 -1
- package/dist/prometheus-framework/src/modules/auth/components/sections/SliderFeatures.vue2.js +1 -4
- package/dist/prometheus-framework/src/modules/auth/store/auth.cjs +1 -1
- package/dist/prometheus-framework/src/modules/auth/store/auth.js +2 -2
- package/dist/prometheus-framework/src/modules/auth/store/invites.cjs +1 -1
- package/dist/prometheus-framework/src/modules/auth/store/invites.js +1 -1
- package/dist/prometheus-framework/src/modules/auth/store/twofa.cjs +1 -1
- package/dist/prometheus-framework/src/modules/auth/store/twofa.js +1 -1
- package/dist/prometheus-framework/src/modules/backoffice/components/layouts/Backoffice.vue2.cjs +1 -1
- package/dist/prometheus-framework/src/modules/backoffice/components/layouts/Backoffice.vue2.js +1 -4
- package/dist/prometheus-framework/src/modules/community/components/layouts/Community.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/community/components/layouts/Community.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/community/components/pages/Community.vue2.cjs +1 -1
- package/dist/prometheus-framework/src/modules/community/components/pages/Community.vue2.js +1 -4
- package/dist/prometheus-framework/src/modules/community/components/pages/CreateBlogPost.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/community/components/pages/CreateBlogPost.vue.js +3 -3
- package/dist/prometheus-framework/src/modules/community/components/sections/Comments.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/community/components/sections/Comments.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/community/components/sections/HotPosts.vue2.cjs +1 -1
- package/dist/prometheus-framework/src/modules/community/components/sections/HotPosts.vue2.js +1 -4
- package/dist/prometheus-framework/src/modules/community/components/sections/JoinUs.vue2.cjs +1 -1
- package/dist/prometheus-framework/src/modules/community/components/sections/JoinUs.vue2.js +1 -4
- package/dist/prometheus-framework/src/modules/community/store/blogposts.cjs +1 -1
- package/dist/prometheus-framework/src/modules/community/store/blogposts.js +1 -1
- package/dist/prometheus-framework/src/modules/community/store/reactions.cjs +1 -1
- package/dist/prometheus-framework/src/modules/community/store/reactions.js +1 -1
- package/dist/prometheus-framework/src/modules/constructor/components/elements/H2.vue2.cjs +1 -1
- package/dist/prometheus-framework/src/modules/constructor/components/elements/H2.vue2.js +1 -4
- package/dist/prometheus-framework/src/modules/constructor/components/elements/ImageUpload.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/constructor/components/elements/ImageUpload.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/constructor/components/elements/Textarea.vue.cjs +5 -1
- package/dist/prometheus-framework/src/modules/constructor/components/elements/Textarea.vue.js +65 -2
- package/dist/prometheus-framework/src/modules/constructor/components/elements/Textarea.vue2.cjs +1 -5
- package/dist/prometheus-framework/src/modules/constructor/components/elements/Textarea.vue2.js +0 -66
- package/dist/prometheus-framework/src/modules/constructor/components/sections/Constructor.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/constructor/components/sections/Constructor.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/events/components/elements/ButtonJoin.vue2.cjs +1 -1
- package/dist/prometheus-framework/src/modules/events/components/elements/ButtonJoin.vue2.js +1 -4
- package/dist/prometheus-framework/src/modules/events/components/layouts/layoutEvents.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/events/components/layouts/layoutEvents.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/events/components/pages/EditEvent.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/events/components/pages/EditEvent.vue.js +5 -5
- package/dist/prometheus-framework/src/modules/events/components/pages/EditEvent.vue2.cjs +1 -1
- package/dist/prometheus-framework/src/modules/events/components/pages/EditEvent.vue2.js +1 -4
- package/dist/prometheus-framework/src/modules/events/components/pages/Events.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/events/components/pages/Events.vue.js +2 -2
- package/dist/prometheus-framework/src/modules/events/components/sections/HeroEvent.vue2.cjs +1 -1
- package/dist/prometheus-framework/src/modules/events/components/sections/HeroEvent.vue2.js +1 -4
- package/dist/prometheus-framework/src/modules/events/components/sections/List.vue2.cjs +1 -1
- package/dist/prometheus-framework/src/modules/events/components/sections/List.vue2.js +1 -4
- package/dist/prometheus-framework/src/modules/events/components/sections/SectionMainGuest.vue2.cjs +1 -1
- package/dist/prometheus-framework/src/modules/events/components/sections/SectionMainGuest.vue2.js +1 -4
- package/dist/prometheus-framework/src/modules/events/store/events.cjs +1 -1
- package/dist/prometheus-framework/src/modules/events/store/events.js +1 -1
- package/dist/prometheus-framework/src/modules/events/store/tickets.cjs +1 -1
- package/dist/prometheus-framework/src/modules/events/store/tickets.js +1 -1
- package/dist/prometheus-framework/src/modules/gallery/components/sections/BackofficeGallery.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/gallery/components/sections/BackofficeGallery.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/gallery/components/sections/BackofficeGallery.vue2.cjs +1 -1
- package/dist/prometheus-framework/src/modules/gallery/components/sections/BackofficeGallery.vue2.js +1 -4
- package/dist/prometheus-framework/src/modules/gallery/components/sections/GalleryWithCategories.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/gallery/components/sections/GalleryWithCategories.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/gallery/components/sections/GalleryWithCategories.vue2.cjs +1 -1
- package/dist/prometheus-framework/src/modules/gallery/components/sections/GalleryWithCategories.vue2.js +1 -4
- package/dist/prometheus-framework/src/modules/gallery/store/gallery.cjs +1 -1
- package/dist/prometheus-framework/src/modules/gallery/store/gallery.js +1 -1
- package/dist/prometheus-framework/src/modules/landing/components/sections/MobileApp.vue2.cjs +1 -1
- package/dist/prometheus-framework/src/modules/landing/components/sections/MobileApp.vue2.js +1 -4
- package/dist/prometheus-framework/src/modules/legal/components/pages/Legal.vue2.cjs +1 -1
- package/dist/prometheus-framework/src/modules/legal/components/pages/Legal.vue2.js +1 -4
- package/dist/prometheus-framework/src/modules/marketplace/store/marketplace.cjs +1 -1
- package/dist/prometheus-framework/src/modules/marketplace/store/marketplace.js +1 -1
- package/dist/prometheus-framework/src/modules/mobile/components/Menu/Menu.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/mobile/components/Menu/Menu.vue.js +1 -4
- package/dist/prometheus-framework/src/modules/orders/components/blocks/CardOrder.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/orders/components/blocks/CardOrder.vue.js +1 -4
- package/dist/prometheus-framework/src/modules/orders/components/pages/EditOrder.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/orders/components/pages/EditOrder.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/orders/components/pages/EditOrder.vue2.cjs +1 -1
- package/dist/prometheus-framework/src/modules/orders/components/pages/EditOrder.vue2.js +1 -4
- package/dist/prometheus-framework/src/modules/orders/components/sections/FormOrderDetails.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/orders/components/sections/FormOrderDetails.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/orders/store/orders.cjs +1 -1
- package/dist/prometheus-framework/src/modules/orders/store/orders.js +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/blocks/CardDepartment.vue2.cjs +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/blocks/CardDepartment.vue2.js +1 -4
- package/dist/prometheus-framework/src/modules/organizations/components/blocks/CardOrganization.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/blocks/CardOrganization.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/blocks/DepartmentMemberModify.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/blocks/DepartmentMemberModify.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/blocks/DepartmentMemberModify.vue2.cjs +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/blocks/DepartmentMemberModify.vue2.js +1 -4
- package/dist/prometheus-framework/src/modules/organizations/components/blocks/DepartmentSub.vue2.cjs +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/blocks/DepartmentSub.vue2.js +1 -4
- package/dist/prometheus-framework/src/modules/organizations/components/blocks/EditArray.vue2.cjs +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/blocks/EditArray.vue2.js +1 -4
- package/dist/prometheus-framework/src/modules/organizations/components/blocks/User.vue2.cjs +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/blocks/User.vue2.js +1 -4
- package/dist/prometheus-framework/src/modules/organizations/components/pages/DepartmentEdit.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/pages/DepartmentEdit.vue.js +3 -3
- package/dist/prometheus-framework/src/modules/organizations/components/pages/DepartmentEdit.vue2.cjs +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/pages/DepartmentEdit.vue2.js +1 -4
- package/dist/prometheus-framework/src/modules/organizations/components/pages/Organization.vue2.cjs +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/pages/Organization.vue2.js +1 -4
- package/dist/prometheus-framework/src/modules/organizations/components/pages/OrganizationEdit.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/pages/OrganizationEdit.vue.js +2 -2
- package/dist/prometheus-framework/src/modules/organizations/components/sections/Documents.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/sections/Documents.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/sections/Documents.vue2.cjs +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/sections/Documents.vue2.js +1 -4
- package/dist/prometheus-framework/src/modules/organizations/components/sections/MembersAdd.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/sections/MembersAdd.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/sections/Organizations.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/sections/Organizations.vue.js +2 -2
- package/dist/prometheus-framework/src/modules/organizations/components/sections/Organizations.vue2.cjs +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/sections/Organizations.vue2.js +1 -4
- package/dist/prometheus-framework/src/modules/organizations/components/sections/Publics.vue2.cjs +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/sections/Publics.vue2.js +1 -4
- package/dist/prometheus-framework/src/modules/organizations/components/sections/Unit.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/sections/Unit.vue.js +1 -4
- package/dist/prometheus-framework/src/modules/organizations/store/departments.cjs +1 -1
- package/dist/prometheus-framework/src/modules/organizations/store/departments.js +1 -1
- package/dist/prometheus-framework/src/modules/organizations/store/invites.cjs +1 -1
- package/dist/prometheus-framework/src/modules/organizations/store/invites.js +1 -1
- package/dist/prometheus-framework/src/modules/organizations/store/memberships.cjs +1 -1
- package/dist/prometheus-framework/src/modules/organizations/store/memberships.js +1 -1
- package/dist/prometheus-framework/src/modules/organizations/store/organizations.cjs +1 -1
- package/dist/prometheus-framework/src/modules/organizations/store/organizations.js +1 -1
- package/dist/prometheus-framework/src/modules/payments/components/pages/Payments.vue2.cjs +1 -1
- package/dist/prometheus-framework/src/modules/payments/components/pages/Payments.vue2.js +1 -4
- package/dist/prometheus-framework/src/modules/products/components/blocks/CardLeftover.vue2.cjs +1 -1
- package/dist/prometheus-framework/src/modules/products/components/blocks/CardLeftover.vue2.js +1 -4
- package/dist/prometheus-framework/src/modules/products/components/blocks/CardPosition.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/products/components/blocks/CardPosition.vue.js +14 -14
- package/dist/prometheus-framework/src/modules/products/components/blocks/CardProduct.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/products/components/blocks/CardProduct.vue.js +14 -14
- package/dist/prometheus-framework/src/modules/products/components/blocks/CategoryCard.vue.cjs +1 -0
- package/dist/prometheus-framework/src/modules/products/components/blocks/CategoryCard.vue.js +43 -0
- package/dist/prometheus-framework/src/modules/products/components/blocks/CategoryCard.vue2.cjs +1 -0
- package/dist/prometheus-framework/src/modules/products/components/blocks/CategoryCard.vue2.js +1 -0
- package/dist/prometheus-framework/src/modules/products/components/blocks/Images360.vue2.cjs +1 -1
- package/dist/prometheus-framework/src/modules/products/components/blocks/Images360.vue2.js +1 -4
- package/dist/prometheus-framework/src/modules/products/components/blocks/ImagesThumbnails.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/products/components/blocks/ImagesThumbnails.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/products/components/blocks/ImagesThumbnails.vue2.cjs +1 -1
- package/dist/prometheus-framework/src/modules/products/components/blocks/ImagesThumbnails.vue2.js +1 -4
- package/dist/prometheus-framework/src/modules/products/components/blocks/LeftoverPositions.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/products/components/blocks/LeftoverPositions.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/products/components/blocks/LeftoverPositions.vue2.cjs +1 -1
- package/dist/prometheus-framework/src/modules/products/components/blocks/LeftoverPositions.vue2.js +1 -4
- package/dist/prometheus-framework/src/modules/products/components/blocks/ListPositions.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/products/components/blocks/ListPositions.vue.js +39 -2
- package/dist/prometheus-framework/src/modules/products/components/blocks/ListPositions.vue2.cjs +1 -0
- package/dist/prometheus-framework/src/modules/products/components/blocks/ListPositions.vue2.js +1 -0
- package/dist/prometheus-framework/src/modules/products/components/elements/Price.vue2.cjs +1 -1
- package/dist/prometheus-framework/src/modules/products/components/elements/Price.vue2.js +1 -4
- package/dist/prometheus-framework/src/modules/products/components/elements/THC.vue2.cjs +1 -1
- package/dist/prometheus-framework/src/modules/products/components/elements/THC.vue2.js +1 -4
- package/dist/prometheus-framework/src/modules/products/components/pages/EditLeftover.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/products/components/pages/EditLeftover.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/products/components/pages/EditLeftover.vue2.cjs +1 -1
- package/dist/prometheus-framework/src/modules/products/components/pages/EditLeftover.vue2.js +1 -4
- package/dist/prometheus-framework/src/modules/products/components/pages/Leftovers.vue2.cjs +1 -1
- package/dist/prometheus-framework/src/modules/products/components/pages/Leftovers.vue2.js +1 -4
- package/dist/prometheus-framework/src/modules/products/components/pages/Product.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/products/components/pages/Product.vue.js +20 -21
- package/dist/prometheus-framework/src/modules/products/components/pages/Product.vue2.cjs +1 -1
- package/dist/prometheus-framework/src/modules/products/components/pages/Product.vue2.js +1 -4
- package/dist/prometheus-framework/src/modules/products/components/pages/ProductEdit.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/products/components/pages/ProductEdit.vue.js +90 -80
- package/dist/prometheus-framework/src/modules/products/components/pages/ProductEdit.vue2.cjs +1 -1
- package/dist/prometheus-framework/src/modules/products/components/pages/ProductEdit.vue2.js +1 -4
- package/dist/prometheus-framework/src/modules/products/components/pages/ProductRecommmendation.vue.cjs +1 -0
- package/dist/prometheus-framework/src/modules/products/components/pages/ProductRecommmendation.vue.js +87 -0
- package/dist/prometheus-framework/src/modules/products/components/pages/ProductRecommmendation.vue2.cjs +1 -0
- package/dist/prometheus-framework/src/modules/products/components/pages/ProductRecommmendation.vue2.js +1 -0
- package/dist/prometheus-framework/src/modules/products/components/pages/Products.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/products/components/pages/Products.vue.js +7 -6
- package/dist/prometheus-framework/src/modules/products/components/sections/EditModifications.vue.cjs +1 -0
- package/dist/prometheus-framework/src/modules/products/components/sections/EditModifications.vue.js +138 -0
- package/dist/prometheus-framework/src/modules/products/components/sections/EditProductInfo.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/products/components/sections/EditProductInfo.vue.js +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.js +1 -1
- package/dist/prometheus-framework/src/modules/products/components/sections/FilterProducts.vue2.cjs +1 -1
- package/dist/prometheus-framework/src/modules/products/components/sections/FilterProducts.vue2.js +1 -4
- package/dist/prometheus-framework/src/modules/products/components/sections/HeroRecommendation.vue.cjs +1 -0
- package/dist/prometheus-framework/src/modules/products/components/sections/HeroRecommendation.vue.js +114 -0
- package/dist/prometheus-framework/src/modules/products/components/sections/HeroRecommendation.vue2.cjs +1 -0
- package/dist/prometheus-framework/src/modules/products/components/sections/HeroRecommendation.vue2.js +1 -0
- package/dist/prometheus-framework/src/modules/products/components/sections/PopularProducts.vue2.cjs +1 -1
- package/dist/prometheus-framework/src/modules/products/components/sections/PopularProducts.vue2.js +1 -4
- package/dist/prometheus-framework/src/modules/products/components/sections/SectionProduct.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/products/components/sections/SectionProduct.vue.js +51 -62
- package/dist/prometheus-framework/src/modules/products/components/sections/SortProducts.vue.cjs +1 -0
- package/dist/prometheus-framework/src/modules/products/components/sections/SortProducts.vue.js +53 -0
- package/dist/prometheus-framework/src/modules/products/products.client.cjs +1 -0
- package/dist/prometheus-framework/src/modules/products/products.client.js +56 -0
- package/dist/prometheus-framework/src/modules/products/store/categories.cjs +1 -1
- package/dist/prometheus-framework/src/modules/products/store/categories.js +1 -1
- package/dist/prometheus-framework/src/modules/products/store/leftovers.cjs +1 -1
- package/dist/prometheus-framework/src/modules/products/store/leftovers.js +1 -1
- package/dist/prometheus-framework/src/modules/products/store/products.cjs +1 -1
- package/dist/prometheus-framework/src/modules/products/store/products.js +3 -1
- package/dist/prometheus-framework/src/modules/reports/components/sections/FormReport.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/reports/components/sections/FormReport.vue.js +2 -2
- package/dist/prometheus-framework/src/modules/reports/store/reports.cjs +1 -1
- package/dist/prometheus-framework/src/modules/reports/store/reports.js +1 -1
- package/dist/prometheus-framework/src/modules/spots/components/blocks/CardSpot.vue2.cjs +1 -1
- package/dist/prometheus-framework/src/modules/spots/components/blocks/CardSpot.vue2.js +1 -4
- package/dist/prometheus-framework/src/modules/spots/store/spots.cjs +1 -1
- package/dist/prometheus-framework/src/modules/spots/store/spots.js +1 -1
- package/dist/prometheus-framework/src/modules/users/components/pages/Profile.vue2.cjs +1 -1
- package/dist/prometheus-framework/src/modules/users/components/pages/Profile.vue2.js +1 -4
- package/dist/prometheus-framework/src/modules/users/components/pages/ProfileEdit.vue2.cjs +1 -1
- package/dist/prometheus-framework/src/modules/users/components/pages/ProfileEdit.vue2.js +1 -4
- package/dist/prometheus-framework/src/modules/users/store/users.cjs +1 -1
- package/dist/prometheus-framework/src/modules/users/store/users.js +1 -1
- package/dist/prometheus-framework/src/modules/wallet/components/pages/Wallet.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/wallet/components/pages/Wallet.vue.js +2 -2
- package/dist/prometheus-framework/src/modules/wallet/store/wallet.cjs +1 -1
- package/dist/prometheus-framework/src/modules/wallet/store/wallet.js +2 -2
- package/dist/prometheus-framework.cjs.js +1 -1
- package/dist/prometheus-framework.es.js +1 -1
- package/dist/style.css +1 -1
- package/dist/web-HvAJWryM.js +1 -0
- package/dist/web-XMv5d7hK.mjs +55 -0
- package/package.json +1 -1
- package/src/components/Feed/Feed.vue +9 -7
- package/src/modules/products/components/blocks/CardPosition.vue +1 -1
- package/src/modules/products/components/blocks/CardProduct.vue +2 -3
- package/src/modules/products/components/pages/Product.vue +1 -1
- package/src/modules/products/components/pages/ProductEdit.vue +15 -0
- package/src/modules/products/components/pages/ProductRecommmendation.vue +2 -2
- package/src/modules/products/components/pages/Products.vue +1 -0
- package/src/modules/products/components/sections/SectionProduct.vue +10 -10
- package/src/modules/products/products.client.js +76 -20
- package/src/modules/products/products.server.js +8 -4
- package/src/modules/products/router/products.router.js +4 -2
- package/src/styles/base/all.scss +4 -1
@@ -0,0 +1,875 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
3
|
+
const _commonjsHelpers = require("./_commonjsHelpers-3b53548e.js");
|
4
|
+
require("uuid");
|
5
|
+
const require$$0 = require("mongoose");
|
6
|
+
require("path");
|
7
|
+
const require$$3 = require("openai");
|
8
|
+
const index = require("./index-a8dffc0c.js");
|
9
|
+
require("jsonwebtoken");
|
10
|
+
require("mongodb");
|
11
|
+
var product_model = (mongoose) => {
|
12
|
+
const ProductSchema = new mongoose.Schema({
|
13
|
+
owner: {
|
14
|
+
type: mongoose.Schema.Types.ObjectId,
|
15
|
+
ref: "User"
|
16
|
+
},
|
17
|
+
organization: {
|
18
|
+
type: mongoose.Schema.Types.ObjectId,
|
19
|
+
ref: "Organization"
|
20
|
+
},
|
21
|
+
status: { type: String },
|
22
|
+
name: { type: String },
|
23
|
+
category: { type: Array },
|
24
|
+
description: { type: String },
|
25
|
+
sale: { type: Number },
|
26
|
+
price: { type: Number },
|
27
|
+
images: { type: Array },
|
28
|
+
popularity: { type: Number },
|
29
|
+
localization: { type: Array },
|
30
|
+
ingredients: { type: Array },
|
31
|
+
information: [{
|
32
|
+
name: { type: String },
|
33
|
+
value: { type: String }
|
34
|
+
}],
|
35
|
+
// MoySklad
|
36
|
+
quantity: { type: Number },
|
37
|
+
quantityDiscount: [{
|
38
|
+
quantity: {
|
39
|
+
type: Number,
|
40
|
+
required: true,
|
41
|
+
min: [1, "Quantity cannot be less than 1"]
|
42
|
+
},
|
43
|
+
discount: {
|
44
|
+
type: Number,
|
45
|
+
required: true,
|
46
|
+
min: [0, "Quantity-based discount cannot be less than 0"],
|
47
|
+
max: [100, "Quantity-based discount cannot be more than 100"]
|
48
|
+
}
|
49
|
+
}]
|
50
|
+
}, {
|
51
|
+
timestamps: {
|
52
|
+
currentTime: () => Date.now()
|
53
|
+
}
|
54
|
+
});
|
55
|
+
ProductSchema.index({ organization: 1 });
|
56
|
+
ProductSchema.index({ category: 1 });
|
57
|
+
ProductSchema.index({ price: 1 });
|
58
|
+
const Product = mongoose.model("Product", ProductSchema);
|
59
|
+
return Product;
|
60
|
+
};
|
61
|
+
const product_model$1 = /* @__PURE__ */ _commonjsHelpers.getDefaultExportFromCjs(product_model);
|
62
|
+
var category_model = (mongoose) => {
|
63
|
+
const СategorySchema = new mongoose.Schema({
|
64
|
+
name: {
|
65
|
+
type: String,
|
66
|
+
required: true,
|
67
|
+
trim: true
|
68
|
+
},
|
69
|
+
url: {
|
70
|
+
type: String,
|
71
|
+
required: true,
|
72
|
+
trim: true
|
73
|
+
},
|
74
|
+
subcategories: {
|
75
|
+
type: Array
|
76
|
+
},
|
77
|
+
localization: {
|
78
|
+
type: Array
|
79
|
+
},
|
80
|
+
filters: {
|
81
|
+
type: Array
|
82
|
+
},
|
83
|
+
owner: {
|
84
|
+
type: {
|
85
|
+
type: String,
|
86
|
+
required: true
|
87
|
+
},
|
88
|
+
target: {
|
89
|
+
type: mongoose.Schema.Types.ObjectId,
|
90
|
+
ref: function(value) {
|
91
|
+
if (this.owner.type === "user")
|
92
|
+
return "User";
|
93
|
+
if (this.owner.type === "organization")
|
94
|
+
return "Organization";
|
95
|
+
},
|
96
|
+
required: true
|
97
|
+
}
|
98
|
+
},
|
99
|
+
creator: {
|
100
|
+
hidden: {
|
101
|
+
type: Boolean,
|
102
|
+
required: true
|
103
|
+
},
|
104
|
+
type: {
|
105
|
+
type: String,
|
106
|
+
required: true
|
107
|
+
},
|
108
|
+
target: {
|
109
|
+
type: mongoose.Schema.Types.ObjectId,
|
110
|
+
ref: function(value) {
|
111
|
+
if (this.owner.type === "user")
|
112
|
+
return "User";
|
113
|
+
if (this.owner.type === "organization")
|
114
|
+
return "Organization";
|
115
|
+
},
|
116
|
+
required: true
|
117
|
+
}
|
118
|
+
}
|
119
|
+
}, {
|
120
|
+
timestamps: {
|
121
|
+
currentTime: () => Date.now()
|
122
|
+
}
|
123
|
+
});
|
124
|
+
СategorySchema.index({ "owner.target": 1, "creator.target": 1 });
|
125
|
+
const Сategory = mongoose.model("Сategory", СategorySchema, "categories");
|
126
|
+
return Сategory;
|
127
|
+
};
|
128
|
+
const category_model$1 = /* @__PURE__ */ _commonjsHelpers.getDefaultExportFromCjs(category_model);
|
129
|
+
var modification_model = (mongoose) => {
|
130
|
+
const ModificationSchema = new mongoose.Schema({
|
131
|
+
name: {
|
132
|
+
type: String
|
133
|
+
},
|
134
|
+
product: {
|
135
|
+
type: mongoose.Schema.Types.ObjectId,
|
136
|
+
ref: "Product",
|
137
|
+
required: true
|
138
|
+
},
|
139
|
+
price: {
|
140
|
+
type: Number
|
141
|
+
},
|
142
|
+
quantity: {
|
143
|
+
type: Number
|
144
|
+
},
|
145
|
+
// dups: {type: Array},
|
146
|
+
characteristics: [{
|
147
|
+
_id: {
|
148
|
+
type: String
|
149
|
+
},
|
150
|
+
name: {
|
151
|
+
type: String
|
152
|
+
},
|
153
|
+
value: {
|
154
|
+
type: String
|
155
|
+
}
|
156
|
+
}]
|
157
|
+
}, {
|
158
|
+
timestamps: {
|
159
|
+
currentTime: () => Date.now()
|
160
|
+
}
|
161
|
+
});
|
162
|
+
ModificationSchema.index({ product: 1 });
|
163
|
+
const Modification = mongoose.model("Modification", ModificationSchema);
|
164
|
+
return Modification;
|
165
|
+
};
|
166
|
+
const modification_model$1 = /* @__PURE__ */ _commonjsHelpers.getDefaultExportFromCjs(modification_model);
|
167
|
+
var leftover_model = (mongoose) => {
|
168
|
+
const LeftoverSchema = new mongoose.Schema({
|
169
|
+
organization: {
|
170
|
+
type: mongoose.Schema.Types.ObjectId,
|
171
|
+
ref: "Organization"
|
172
|
+
},
|
173
|
+
type: {
|
174
|
+
type: String,
|
175
|
+
enum: ["stock-in", "stock-out", "write-off"],
|
176
|
+
default: "stock-in",
|
177
|
+
required: true
|
178
|
+
},
|
179
|
+
order: {
|
180
|
+
type: String
|
181
|
+
},
|
182
|
+
store: {
|
183
|
+
type: Object
|
184
|
+
},
|
185
|
+
positions: [{
|
186
|
+
_id: {
|
187
|
+
type: mongoose.Schema.Types.ObjectId,
|
188
|
+
ref: "Product"
|
189
|
+
},
|
190
|
+
name: {
|
191
|
+
type: String
|
192
|
+
},
|
193
|
+
quantity: {
|
194
|
+
type: Number
|
195
|
+
},
|
196
|
+
price: {
|
197
|
+
type: Number
|
198
|
+
},
|
199
|
+
type: {
|
200
|
+
type: String
|
201
|
+
}
|
202
|
+
}]
|
203
|
+
}, {
|
204
|
+
timestamps: {
|
205
|
+
currentTime: () => Date.now()
|
206
|
+
}
|
207
|
+
});
|
208
|
+
LeftoverSchema.index({ user: 1, type: 1, target: 1 });
|
209
|
+
const Leftover = mongoose.model("Leftover", LeftoverSchema);
|
210
|
+
return Leftover;
|
211
|
+
};
|
212
|
+
const leftover_model$1 = /* @__PURE__ */ _commonjsHelpers.getDefaultExportFromCjs(leftover_model);
|
213
|
+
const ObjectId$1 = require$$0.Types.ObjectId;
|
214
|
+
const OpenAI = require$$3;
|
215
|
+
const openai = new OpenAI();
|
216
|
+
const controllerFactory$5 = (db) => {
|
217
|
+
const Product = db.product;
|
218
|
+
db.modification;
|
219
|
+
db.leftover;
|
220
|
+
const Create = async (req, res) => {
|
221
|
+
try {
|
222
|
+
const newProduct = new Product(req.body);
|
223
|
+
const data = await newProduct.save();
|
224
|
+
res.send(data);
|
225
|
+
} catch (err) {
|
226
|
+
console.log(err);
|
227
|
+
res.status(500).send({ message: err.message });
|
228
|
+
}
|
229
|
+
};
|
230
|
+
const Read = async (req, res) => {
|
231
|
+
try {
|
232
|
+
let query = {};
|
233
|
+
let options = {};
|
234
|
+
if (req.query.organization) {
|
235
|
+
query.organization = new ObjectId$1(req.query.organization);
|
236
|
+
}
|
237
|
+
if (req.query._id) {
|
238
|
+
query._id = req.query._id;
|
239
|
+
}
|
240
|
+
if (req.query.status) {
|
241
|
+
query.status = req.query.status;
|
242
|
+
}
|
243
|
+
const categories = req.query.categories?.split(",") || [];
|
244
|
+
if (categories.length) {
|
245
|
+
query.category = { $in: categories };
|
246
|
+
}
|
247
|
+
const deliveryOptions = req.query.delivery?.split(",") || [];
|
248
|
+
if (deliveryOptions.length) {
|
249
|
+
query.delivery = { $in: deliveryOptions };
|
250
|
+
}
|
251
|
+
const prices = req.query.prices?.split(",") || [];
|
252
|
+
console.log(prices);
|
253
|
+
if (prices.length) {
|
254
|
+
const priceConditions = prices.map((priceRange) => {
|
255
|
+
if (priceRange.startsWith("<")) {
|
256
|
+
return { price: { $lt: parseInt(priceRange.slice(1)) } };
|
257
|
+
}
|
258
|
+
if (priceRange.startsWith(">")) {
|
259
|
+
return { price: { $gt: parseInt(priceRange.slice(1)) } };
|
260
|
+
}
|
261
|
+
const [min, max] = priceRange.split("-").map(Number);
|
262
|
+
return { price: { $gte: min, $lte: max } };
|
263
|
+
});
|
264
|
+
console.log(priceConditions);
|
265
|
+
if (priceConditions.length) {
|
266
|
+
query = {
|
267
|
+
...query,
|
268
|
+
...{ $or: priceConditions }
|
269
|
+
};
|
270
|
+
}
|
271
|
+
}
|
272
|
+
options.skip = parseInt(req.query.skip) || 0;
|
273
|
+
options.limit = parseInt(req.query.limit) || 10;
|
274
|
+
options.sort = { createdAt: -1 };
|
275
|
+
if (req.query.count) {
|
276
|
+
try {
|
277
|
+
const count = await Product.countDocuments(query);
|
278
|
+
return res.status(200).json({ count });
|
279
|
+
} catch (err) {
|
280
|
+
return res.status(500).json({ message: err.message });
|
281
|
+
}
|
282
|
+
}
|
283
|
+
console.log(query);
|
284
|
+
const products = await Product.find(query, null, options);
|
285
|
+
if (!products.length) {
|
286
|
+
return res.status(200).json([]);
|
287
|
+
}
|
288
|
+
res.status(200).json(products);
|
289
|
+
} catch (err) {
|
290
|
+
return res.status(500).json({ message: err.message });
|
291
|
+
}
|
292
|
+
};
|
293
|
+
const Update = async (req, res) => {
|
294
|
+
try {
|
295
|
+
const { _id } = req.params;
|
296
|
+
console.log(_id);
|
297
|
+
const updatedProduct = await Product.findOneAndUpdate(
|
298
|
+
{ _id },
|
299
|
+
{
|
300
|
+
name: req.body.name,
|
301
|
+
status: req.body.status,
|
302
|
+
description: req.body.description,
|
303
|
+
price: req.body.price,
|
304
|
+
sale: req.body.sale,
|
305
|
+
category: req.body.category,
|
306
|
+
images: req.body.images,
|
307
|
+
information: req.body.information,
|
308
|
+
localization: req.body.localization,
|
309
|
+
quantity: req.body.quantity,
|
310
|
+
quantityDiscount: req.body.quantityDiscount
|
311
|
+
},
|
312
|
+
{ new: true }
|
313
|
+
);
|
314
|
+
if (!updatedProduct) {
|
315
|
+
return res.status(404).send({ message: "Something wrong when updating product." });
|
316
|
+
}
|
317
|
+
res.status(200).send(updatedProduct);
|
318
|
+
} catch (err) {
|
319
|
+
res.status(500).send({ message: err.message });
|
320
|
+
}
|
321
|
+
};
|
322
|
+
const Delete = async (req, res) => {
|
323
|
+
try {
|
324
|
+
const { _id } = req.params;
|
325
|
+
const deletedProduct = await Product.findOneAndDelete({ _id });
|
326
|
+
if (!deletedProduct) {
|
327
|
+
return res.status(404).send({ message: "Product not found for deletion." });
|
328
|
+
}
|
329
|
+
res.status(200).send(deletedProduct);
|
330
|
+
} catch (err) {
|
331
|
+
res.status(500).send({ message: err.message });
|
332
|
+
}
|
333
|
+
};
|
334
|
+
const getProducts = (req, res) => {
|
335
|
+
Product.aggregate([
|
336
|
+
{
|
337
|
+
$facet: {
|
338
|
+
"withIngredients": [
|
339
|
+
{
|
340
|
+
$match: {
|
341
|
+
ingridients: { $exists: true, $not: { $size: 0 } }
|
342
|
+
// Продукты с ингредиентами
|
343
|
+
}
|
344
|
+
},
|
345
|
+
{
|
346
|
+
$lookup: {
|
347
|
+
from: "products",
|
348
|
+
localField: "ingridients",
|
349
|
+
foreignField: "_id",
|
350
|
+
as: "ingredientDetails"
|
351
|
+
}
|
352
|
+
},
|
353
|
+
{ $unwind: "$ingredientDetails" },
|
354
|
+
{
|
355
|
+
$lookup: {
|
356
|
+
from: "leftovers",
|
357
|
+
let: { "ingredientId": "$ingredientDetails._id" },
|
358
|
+
pipeline: [
|
359
|
+
{ $unwind: "$positions" },
|
360
|
+
{
|
361
|
+
$match: {
|
362
|
+
$expr: {
|
363
|
+
$eq: ["$positions._id", "$$ingredientId"]
|
364
|
+
}
|
365
|
+
}
|
366
|
+
},
|
367
|
+
{
|
368
|
+
$project: {
|
369
|
+
quantity: "$positions.quantity"
|
370
|
+
}
|
371
|
+
}
|
372
|
+
],
|
373
|
+
as: "ingredientLeftovers"
|
374
|
+
}
|
375
|
+
},
|
376
|
+
{
|
377
|
+
$group: {
|
378
|
+
_id: "$_id",
|
379
|
+
name: { $first: "$name" },
|
380
|
+
minQuantity: { $min: "$ingredientLeftovers.quantity" }
|
381
|
+
}
|
382
|
+
}
|
383
|
+
],
|
384
|
+
"withoutIngredients": [
|
385
|
+
{
|
386
|
+
$match: {
|
387
|
+
$or: [
|
388
|
+
{ ingridients: { $exists: false } },
|
389
|
+
// Продукты без ингредиентов
|
390
|
+
{ ingridients: { $size: 0 } }
|
391
|
+
]
|
392
|
+
}
|
393
|
+
},
|
394
|
+
{
|
395
|
+
$lookup: {
|
396
|
+
from: "leftovers",
|
397
|
+
let: { "productId": "$_id" },
|
398
|
+
pipeline: [
|
399
|
+
{ $unwind: "$positions" },
|
400
|
+
{
|
401
|
+
$match: {
|
402
|
+
$expr: {
|
403
|
+
$eq: ["$positions._id", "$$productId"]
|
404
|
+
}
|
405
|
+
}
|
406
|
+
},
|
407
|
+
{
|
408
|
+
$project: {
|
409
|
+
quantity: "$positions.quantity"
|
410
|
+
}
|
411
|
+
}
|
412
|
+
],
|
413
|
+
as: "productLeftovers"
|
414
|
+
}
|
415
|
+
},
|
416
|
+
{
|
417
|
+
$set: {
|
418
|
+
minQuantity: { $sum: "$productLeftovers.quantity" }
|
419
|
+
}
|
420
|
+
}
|
421
|
+
]
|
422
|
+
}
|
423
|
+
},
|
424
|
+
{
|
425
|
+
$project: {
|
426
|
+
products: { $setUnion: ["$withIngredients", "$withoutIngredients"] }
|
427
|
+
}
|
428
|
+
},
|
429
|
+
{ $unwind: "$products" },
|
430
|
+
{ $replaceRoot: { newRoot: "$products" } }
|
431
|
+
]).exec((err, products) => {
|
432
|
+
if (err) {
|
433
|
+
return res.status(500).send({ message: err });
|
434
|
+
}
|
435
|
+
if (!products) {
|
436
|
+
return res.status(404).send({ message: "Products not found." });
|
437
|
+
}
|
438
|
+
res.status(200).send(products);
|
439
|
+
console.log(products);
|
440
|
+
});
|
441
|
+
};
|
442
|
+
const getProductRecommendation = async (req, res) => {
|
443
|
+
const { mood } = req.body;
|
444
|
+
try {
|
445
|
+
const products = await Product.find({
|
446
|
+
status: "published"
|
447
|
+
}).limit(40);
|
448
|
+
if (!products) {
|
449
|
+
console.log("no products");
|
450
|
+
return res.status(404).send({ message: "Products not found." });
|
451
|
+
}
|
452
|
+
const productsList = products.map((p) => `
|
453
|
+
${p._id}:
|
454
|
+
${p.name}
|
455
|
+
(${p.information[0].value})
|
456
|
+
(${p.information[1].value}%)
|
457
|
+
(${p.information[2].value})
|
458
|
+
`).join(", ");
|
459
|
+
const prompt = `
|
460
|
+
1. When asked how the client wants to feel, they responded "${mood}".
|
461
|
+
2. Here is a list of products in our store: ${productsList}.
|
462
|
+
3. Based on the information about the products (strain, THC content) and the user's desires, choose 1 product to recommend to the user.
|
463
|
+
4. The response should be in the language that the user used in mood (${mood}).
|
464
|
+
5. Please format your response as a JSON object '{"_id": "ID of the recommended product (it must correspond to one of the product IDs I sent)", "recommendationText": "Text explaining why this particular product"'. Write only the JSON object without any other text outside of it.
|
465
|
+
`;
|
466
|
+
console.log(prompt);
|
467
|
+
let response;
|
468
|
+
let result;
|
469
|
+
while (true) {
|
470
|
+
try {
|
471
|
+
response = await openai.chat.completions.create({
|
472
|
+
model: "gpt-4",
|
473
|
+
messages: [{ role: "user", content: prompt }]
|
474
|
+
});
|
475
|
+
console.log(response);
|
476
|
+
result = JSON.parse(response.choices[0].message.content);
|
477
|
+
break;
|
478
|
+
} catch (err) {
|
479
|
+
if (err instanceof SyntaxError) {
|
480
|
+
console.log("Received invalid JSON, retrying...");
|
481
|
+
} else {
|
482
|
+
console.log(err);
|
483
|
+
res.status(500).send({ message: err });
|
484
|
+
return;
|
485
|
+
}
|
486
|
+
}
|
487
|
+
}
|
488
|
+
console.log(result._id);
|
489
|
+
console.log(result.recommendationText);
|
490
|
+
const recommendedProduct = await Product.findById(result._id);
|
491
|
+
if (!recommendedProduct) {
|
492
|
+
console.log(`No product found with _id: ${result._id}`);
|
493
|
+
return res.status(404).send({ message: "Recommended product not found." });
|
494
|
+
}
|
495
|
+
res.status(200).json({ product: recommendedProduct, recommendationText: result.recommendationText });
|
496
|
+
} catch (err) {
|
497
|
+
console.log(err);
|
498
|
+
res.status(500).send({ message: err });
|
499
|
+
}
|
500
|
+
};
|
501
|
+
const getProductsPopular = (req, res) => {
|
502
|
+
Product.find({
|
503
|
+
status: "published",
|
504
|
+
popularity: { $gt: 10 }
|
505
|
+
}).populate("modifications").limit(10).exec((err, products) => {
|
506
|
+
if (err) {
|
507
|
+
return res.status(500).send({ message: err });
|
508
|
+
}
|
509
|
+
if (!products) {
|
510
|
+
return res.status(404).send({ message: "Products not found." });
|
511
|
+
}
|
512
|
+
res.status(200).send(products);
|
513
|
+
});
|
514
|
+
};
|
515
|
+
const getProduct = async (req, res) => {
|
516
|
+
try {
|
517
|
+
const product = await Product.aggregate([
|
518
|
+
{
|
519
|
+
$match: { "_id": new ObjectId$1(req.params._id) }
|
520
|
+
},
|
521
|
+
{
|
522
|
+
$lookup: {
|
523
|
+
from: "leftovers",
|
524
|
+
let: { productId: "$_id", ingredients: { $ifNull: ["$ingredients", []] } },
|
525
|
+
pipeline: [
|
526
|
+
{
|
527
|
+
$unwind: "$positions"
|
528
|
+
},
|
529
|
+
{
|
530
|
+
"$match": { "$expr": { "$eq": ["$positions._id", "$$productId"] } }
|
531
|
+
},
|
532
|
+
{
|
533
|
+
"$addFields": {
|
534
|
+
"positions.quantity": {
|
535
|
+
$cond: {
|
536
|
+
if: { $eq: ["$type", "stock-in"] },
|
537
|
+
then: "$positions.quantity",
|
538
|
+
else: { $multiply: ["$positions.quantity", -1] }
|
539
|
+
}
|
540
|
+
}
|
541
|
+
}
|
542
|
+
},
|
543
|
+
{
|
544
|
+
"$project": {
|
545
|
+
_id: "$positions._id",
|
546
|
+
quantity: "$positions.quantity",
|
547
|
+
name: "$positions.name"
|
548
|
+
}
|
549
|
+
}
|
550
|
+
],
|
551
|
+
as: "variants"
|
552
|
+
}
|
553
|
+
},
|
554
|
+
{
|
555
|
+
$set: {
|
556
|
+
quantity: {
|
557
|
+
$sum: ["$quantity", { $sum: "$variants.quantity" }]
|
558
|
+
}
|
559
|
+
}
|
560
|
+
},
|
561
|
+
{ $unset: "variants" }
|
562
|
+
]);
|
563
|
+
if (!product || product.length < 1) {
|
564
|
+
return res.status(404).send({ message: "Product not found." });
|
565
|
+
}
|
566
|
+
const updatedProduct = await Product.findOneAndUpdate(
|
567
|
+
{ _id: req.params._id },
|
568
|
+
{ $inc: { popularity: 1 } },
|
569
|
+
{ new: true }
|
570
|
+
);
|
571
|
+
console.log("Popularity updated:", updatedProduct);
|
572
|
+
res.status(200).send(product);
|
573
|
+
} catch (err) {
|
574
|
+
console.error("Error:", err);
|
575
|
+
res.status(500).send({ message: err });
|
576
|
+
}
|
577
|
+
};
|
578
|
+
return {
|
579
|
+
Create,
|
580
|
+
Read,
|
581
|
+
Update,
|
582
|
+
Delete,
|
583
|
+
getProducts,
|
584
|
+
getProductsPopular,
|
585
|
+
getProduct,
|
586
|
+
getProductRecommendation
|
587
|
+
};
|
588
|
+
};
|
589
|
+
var products_controller = controllerFactory$5;
|
590
|
+
const controllerFactory$4 = products_controller;
|
591
|
+
var products_routes = function(app, db, allowedOrigins) {
|
592
|
+
const controller = controllerFactory$4(db);
|
593
|
+
app.use(function(req, res, next) {
|
594
|
+
res.header(
|
595
|
+
"Access-Control-Allow-Headers",
|
596
|
+
"Access-Control-Allow-Origin: *",
|
597
|
+
"x-access-token, Origin, Content-Type, Accept"
|
598
|
+
);
|
599
|
+
next();
|
600
|
+
});
|
601
|
+
app.post(
|
602
|
+
"/api/products/create",
|
603
|
+
controller.Create
|
604
|
+
);
|
605
|
+
app.get(
|
606
|
+
"/api/products/read",
|
607
|
+
controller.Read
|
608
|
+
);
|
609
|
+
app.post(
|
610
|
+
"/api/products/:_id",
|
611
|
+
controller.Update
|
612
|
+
);
|
613
|
+
app.delete(
|
614
|
+
"/api/products/:_id",
|
615
|
+
controller.Delete
|
616
|
+
);
|
617
|
+
app.post(
|
618
|
+
"/api/product/recommended",
|
619
|
+
controller.getProductRecommendation
|
620
|
+
);
|
621
|
+
app.get(
|
622
|
+
"/api/products/:_id",
|
623
|
+
controller.getProduct
|
624
|
+
);
|
625
|
+
};
|
626
|
+
const products_routes$1 = /* @__PURE__ */ _commonjsHelpers.getDefaultExportFromCjs(products_routes);
|
627
|
+
const controllerFactory$3 = (db) => {
|
628
|
+
const Category = db.category;
|
629
|
+
const getCategories = async (req, res) => {
|
630
|
+
console.log(Category);
|
631
|
+
try {
|
632
|
+
const categories = await Category.find({}).sort({ "order": "asc" }).exec();
|
633
|
+
if (!categories) {
|
634
|
+
return res.status(404).send({ message: "Categories not found." });
|
635
|
+
}
|
636
|
+
res.status(200).send(categories);
|
637
|
+
} catch (err) {
|
638
|
+
console.log(err);
|
639
|
+
res.status(500).send({ message: err });
|
640
|
+
}
|
641
|
+
};
|
642
|
+
const updateCategories = async (req, res) => {
|
643
|
+
try {
|
644
|
+
const updates = req.body.all.map(async (categoryUpdated) => {
|
645
|
+
const category = await Category.findOneAndUpdate(
|
646
|
+
{ url: categoryUpdated.url },
|
647
|
+
{ $set: categoryUpdated },
|
648
|
+
{ new: true }
|
649
|
+
).exec();
|
650
|
+
if (!category) {
|
651
|
+
throw new Error("Categories is not updated.");
|
652
|
+
}
|
653
|
+
});
|
654
|
+
await Promise.all(updates);
|
655
|
+
console.log("success");
|
656
|
+
res.status(200).send({ message: "Categories updated successfully." });
|
657
|
+
} catch (err) {
|
658
|
+
res.send({ message: err.message });
|
659
|
+
}
|
660
|
+
};
|
661
|
+
const getCategory = async (req, res) => {
|
662
|
+
try {
|
663
|
+
const category = await Category.findOne({ url: req.params.url }).exec();
|
664
|
+
if (!category) {
|
665
|
+
return res.status(404).send({ message: "Category not found." });
|
666
|
+
}
|
667
|
+
res.status(200).send(category);
|
668
|
+
} catch (err) {
|
669
|
+
res.status(500).send({ message: err });
|
670
|
+
}
|
671
|
+
};
|
672
|
+
const addCategory = async (req, res) => {
|
673
|
+
try {
|
674
|
+
const category = await Category.create(req.body);
|
675
|
+
if (!category) {
|
676
|
+
return res.status(404).send({ message: "Category is not created." });
|
677
|
+
}
|
678
|
+
res.status(200).send(category);
|
679
|
+
} catch (err) {
|
680
|
+
console.log(req.body);
|
681
|
+
console.log(req.category);
|
682
|
+
res.status(500).send({ message: err });
|
683
|
+
}
|
684
|
+
};
|
685
|
+
const updateCategory = async (req, res) => {
|
686
|
+
try {
|
687
|
+
const category = await Category.findOneAndUpdate(
|
688
|
+
{ url: req.params.url },
|
689
|
+
{ $set: req.body },
|
690
|
+
{ new: true }
|
691
|
+
).exec();
|
692
|
+
if (!category) {
|
693
|
+
return res.status(404).send({ message: "Something wrong when updating category." });
|
694
|
+
}
|
695
|
+
res.status(200).send(category);
|
696
|
+
} catch (err) {
|
697
|
+
res.status(500).send({ message: err });
|
698
|
+
}
|
699
|
+
};
|
700
|
+
const deleteCategory = async (req, res) => {
|
701
|
+
try {
|
702
|
+
const category = await Category.findOneAndDelete({ url: req.params.url }).exec();
|
703
|
+
if (!category) {
|
704
|
+
return res.status(404).send({ message: "Category is not deleted." });
|
705
|
+
}
|
706
|
+
res.status(200).send(category);
|
707
|
+
} catch (err) {
|
708
|
+
res.status(500).send({ message: err });
|
709
|
+
}
|
710
|
+
};
|
711
|
+
return {
|
712
|
+
getCategories,
|
713
|
+
updateCategories,
|
714
|
+
getCategory,
|
715
|
+
addCategory,
|
716
|
+
updateCategory,
|
717
|
+
deleteCategory
|
718
|
+
};
|
719
|
+
};
|
720
|
+
var categories_controller = controllerFactory$3;
|
721
|
+
const controllerFactory$2 = categories_controller;
|
722
|
+
const middlewareFactory = index.server;
|
723
|
+
var categories_routes = function(app, db) {
|
724
|
+
const controller = controllerFactory$2(db);
|
725
|
+
const { verifyCategory } = middlewareFactory(db);
|
726
|
+
app.use(function(req, res, next) {
|
727
|
+
res.header(
|
728
|
+
"Access-Control-Allow-Headers",
|
729
|
+
"Access-Control-Allow-Origin",
|
730
|
+
"x-access-token, Origin, Content-Type, Accept"
|
731
|
+
);
|
732
|
+
next();
|
733
|
+
});
|
734
|
+
app.get(
|
735
|
+
"/categories",
|
736
|
+
controller.getCategories
|
737
|
+
);
|
738
|
+
app.post(
|
739
|
+
"/categories",
|
740
|
+
controller.updateCategories
|
741
|
+
);
|
742
|
+
app.get(
|
743
|
+
"/categories/:url",
|
744
|
+
controller.getCategory
|
745
|
+
);
|
746
|
+
app.post(
|
747
|
+
"/categories/add",
|
748
|
+
[
|
749
|
+
verifyCategory.checkCategoryExistOrNot
|
750
|
+
],
|
751
|
+
controller.addCategory
|
752
|
+
);
|
753
|
+
app.post(
|
754
|
+
"/categories/:url",
|
755
|
+
controller.updateCategory
|
756
|
+
);
|
757
|
+
app.delete(
|
758
|
+
"/categories/:url",
|
759
|
+
controller.deleteCategory
|
760
|
+
);
|
761
|
+
};
|
762
|
+
const categories_routes$1 = /* @__PURE__ */ _commonjsHelpers.getDefaultExportFromCjs(categories_routes);
|
763
|
+
const ObjectId = require$$0.Types.ObjectId;
|
764
|
+
const controllerFactory$1 = (db) => {
|
765
|
+
const Leftover = db.leftover;
|
766
|
+
const getAll = async (req, res) => {
|
767
|
+
try {
|
768
|
+
let query = {};
|
769
|
+
let options = {};
|
770
|
+
if (req.query.organization)
|
771
|
+
query.organization = new ObjectId(req.query.organization);
|
772
|
+
const leftoveres = await Leftover.find(query, null, options).sort({ "createdAt": "desc" }).exec();
|
773
|
+
if (!leftoveres) {
|
774
|
+
return res.status(404).send({ message: "LEFTOVERES_NOT_FOUND" });
|
775
|
+
}
|
776
|
+
res.status(200).send(leftoveres);
|
777
|
+
} catch (err) {
|
778
|
+
res.status(500).send({ message: "ERROR_GET_ALL_LEFTOVERES" });
|
779
|
+
}
|
780
|
+
};
|
781
|
+
const create = async (req, res) => {
|
782
|
+
try {
|
783
|
+
const leftover = await Leftover.create({
|
784
|
+
organization: req.body.organization,
|
785
|
+
type: req.body.type,
|
786
|
+
order: req.body.order,
|
787
|
+
positions: req.body.positions
|
788
|
+
});
|
789
|
+
if (!leftover) {
|
790
|
+
return res.status(404).send({ message: "ERROR_CREATING_LEFTOVER" });
|
791
|
+
}
|
792
|
+
res.status(200).send(leftover);
|
793
|
+
} catch (err) {
|
794
|
+
res.status(500).send({ message: "ERROR_CREATE_LEFTOVER" });
|
795
|
+
}
|
796
|
+
};
|
797
|
+
const get = async (req, res) => {
|
798
|
+
try {
|
799
|
+
const leftover = await Leftover.findOne({ _id: req.params._id }).exec();
|
800
|
+
if (!leftover) {
|
801
|
+
return res.status(404).send({ message: "LEFTOVER_NOT_FOUND" });
|
802
|
+
}
|
803
|
+
res.status(200).send(leftover);
|
804
|
+
} catch (err) {
|
805
|
+
res.status(500).send({ message: "ERROR_GET_LEFTOVER" });
|
806
|
+
}
|
807
|
+
};
|
808
|
+
const update = async (req, res) => {
|
809
|
+
try {
|
810
|
+
const leftover = await Leftover.findOneAndUpdate({ _id: req.params._id }, req.body, { new: true, upsert: true }).exec();
|
811
|
+
if (!leftover) {
|
812
|
+
return res.status(404).send({ message: "LEFTOVER_NOT_FOUND" });
|
813
|
+
}
|
814
|
+
res.status(200).send(leftover);
|
815
|
+
} catch (err) {
|
816
|
+
console.log(err);
|
817
|
+
res.status(500).send({ message: "ERROR_UPDATING_LEFTOVER" });
|
818
|
+
}
|
819
|
+
};
|
820
|
+
const deleteLeftover = async (req, res) => {
|
821
|
+
try {
|
822
|
+
const leftover = await Leftover.findOneAndDelete({ _id: req.params._id });
|
823
|
+
if (!leftover) {
|
824
|
+
return res.status(404).send({ message: "ERROR_DELETING_LEFTOVER" });
|
825
|
+
}
|
826
|
+
res.status(200).send(leftover);
|
827
|
+
} catch (err) {
|
828
|
+
res.status(500).send({ message: "ERROR_DELETE_LEFTOVER" });
|
829
|
+
}
|
830
|
+
};
|
831
|
+
return {
|
832
|
+
getAll,
|
833
|
+
create,
|
834
|
+
get,
|
835
|
+
update,
|
836
|
+
delete: deleteLeftover
|
837
|
+
};
|
838
|
+
};
|
839
|
+
var leftovers_controller = controllerFactory$1;
|
840
|
+
const controllerFactory = leftovers_controller;
|
841
|
+
var leftovers_routes = function(app, db) {
|
842
|
+
const controller = controllerFactory(db);
|
843
|
+
app.use(function(req, res, next) {
|
844
|
+
res.header("Access-Control-Allow-Headers", "Access-Control-Allow-Origin: *", "x-access-token, Origin, Content-Type, Accept");
|
845
|
+
next();
|
846
|
+
});
|
847
|
+
app.get(
|
848
|
+
"/leftovers",
|
849
|
+
controller.getAll
|
850
|
+
);
|
851
|
+
app.get(
|
852
|
+
"/leftovers/:_id",
|
853
|
+
controller.get
|
854
|
+
);
|
855
|
+
app.post(
|
856
|
+
"/leftovers/:_id",
|
857
|
+
controller.update
|
858
|
+
);
|
859
|
+
app.post(
|
860
|
+
"/leftovers",
|
861
|
+
controller.create
|
862
|
+
);
|
863
|
+
app.delete(
|
864
|
+
"/leftovers/:_id",
|
865
|
+
controller.delete
|
866
|
+
);
|
867
|
+
};
|
868
|
+
const leftovers_routes$1 = /* @__PURE__ */ _commonjsHelpers.getDefaultExportFromCjs(leftovers_routes);
|
869
|
+
exports.CategoryModel = category_model$1;
|
870
|
+
exports.LeftoverModel = leftover_model$1;
|
871
|
+
exports.ModificationModel = modification_model$1;
|
872
|
+
exports.ProductModel = product_model$1;
|
873
|
+
exports.categoriesRoutes = categories_routes$1;
|
874
|
+
exports.leftoversRoutes = leftovers_routes$1;
|
875
|
+
exports.productsRoutes = products_routes$1;
|