@ozdao/prometheus-framework 0.2.48 → 0.2.51
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/auth.server.js +27 -25
- package/dist/auth.server.mjs +27 -25
- package/dist/community.server.js +1 -1
- package/dist/community.server.mjs +1 -1
- package/dist/events.server.js +1 -1
- package/dist/events.server.mjs +1 -1
- package/dist/files.server.js +1 -1
- package/dist/files.server.mjs +1 -1
- package/dist/gallery.server.js +1 -1
- package/dist/gallery.server.mjs +1 -1
- package/dist/index-3981e903.mjs +217 -0
- package/dist/index-4eecfdb9.js +216 -0
- package/dist/main-203b36b6.mjs +13628 -0
- package/dist/main-_b1_i8mt.mjs +13606 -0
- package/dist/main-a7ae4ce5.js +91 -0
- package/dist/main-uiQFxEks.js +91 -0
- package/dist/main.css +1 -1
- package/dist/middlewares.server.js +1 -1
- package/dist/middlewares.server.mjs +1 -1
- package/dist/node_modules/vue-select/dist/vue-select.es.cjs +1 -3
- package/dist/node_modules/vue-select/dist/vue-select.es.js +49 -645
- package/dist/organizations.server.js +35 -43
- package/dist/organizations.server.mjs +35 -43
- package/dist/products.server.js +107 -24
- package/dist/products.server.mjs +107 -24
- package/dist/prometheus-framework/src/components/Button/Button.vue.cjs +1 -1
- package/dist/prometheus-framework/src/components/Button/Button.vue.js +2 -225
- package/dist/prometheus-framework/src/components/Button/Button.vue2.cjs +1 -1
- package/dist/prometheus-framework/src/components/Button/Button.vue2.js +225 -2
- 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 +2 -61
- package/dist/prometheus-framework/src/components/Field/Field.vue.cjs +1 -1
- package/dist/prometheus-framework/src/components/Field/Field.vue.js +2 -76
- package/dist/prometheus-framework/src/components/Field/Field.vue2.cjs +1 -1
- package/dist/prometheus-framework/src/components/Field/Field.vue2.js +76 -2
- package/dist/prometheus-framework/src/components/FieldBig/FieldBig.vue.cjs +1 -1
- package/dist/prometheus-framework/src/components/FieldBig/FieldBig.vue.js +1 -1
- package/dist/prometheus-framework/src/components/SelectMulti/SelectMulti.vue.cjs +1 -1
- package/dist/prometheus-framework/src/components/SelectMulti/SelectMulti.vue.js +6 -6
- package/dist/prometheus-framework/src/components/Tab/Tab.vue.cjs +1 -1
- package/dist/prometheus-framework/src/components/Tab/Tab.vue.js +2 -44
- package/dist/prometheus-framework/src/components/Tab/Tab.vue2.cjs +1 -1
- package/dist/prometheus-framework/src/components/Tab/Tab.vue2.js +44 -2
- package/dist/prometheus-framework/src/modules/auth/components/layouts/Auth.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/auth/components/layouts/Auth.vue.js +3 -3
- package/dist/prometheus-framework/src/modules/auth/components/pages/EnterCode.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/auth/components/pages/EnterCode.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/auth/components/pages/EnterPassword.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/auth/components/pages/EnterPassword.vue.js +3 -3
- package/dist/prometheus-framework/src/modules/auth/components/pages/Invite.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/auth/components/pages/Invite.vue.js +44 -32
- package/dist/prometheus-framework/src/modules/auth/components/pages/ResetPassword.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/auth/components/pages/ResetPassword.vue.js +3 -3
- package/dist/prometheus-framework/src/modules/auth/components/pages/SignIn.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/auth/components/pages/SignIn.vue.js +3 -3
- package/dist/prometheus-framework/src/modules/auth/components/pages/SignUp.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/auth/components/pages/SignUp.vue.js +3 -3
- package/dist/prometheus-framework/src/modules/auth/store/auth.cjs +1 -1
- package/dist/prometheus-framework/src/modules/auth/store/auth.js +45 -44
- package/dist/prometheus-framework/src/modules/auth/store/invites.cjs +1 -1
- package/dist/prometheus-framework/src/modules/auth/store/invites.js +5 -5
- package/dist/prometheus-framework/src/modules/backoffice/components/pages/Dashboard.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/backoffice/components/pages/Dashboard.vue.js +1 -1
- 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/constructor/components/elements/Embed.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/constructor/components/elements/Embed.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/events/components/elements/ButtonJoin.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/events/components/elements/ButtonJoin.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/events/components/pages/EditEvent.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/events/components/pages/EditEvent.vue.js +3 -3
- package/dist/prometheus-framework/src/modules/events/components/pages/Events.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/events/components/pages/Events.vue.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 +2 -2
- package/dist/prometheus-framework/src/modules/gallery/components/sections/GalleryWithCategories.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/gallery/components/sections/GalleryWithCategories.vue.js +2 -2
- package/dist/prometheus-framework/src/modules/globals/components/blocks/CardHeader.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/globals/components/blocks/CardHeader.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/globals/store/globals.cjs +1 -1
- package/dist/prometheus-framework/src/modules/globals/store/globals.js +22 -21
- package/dist/prometheus-framework/src/modules/legal/components/pages/Legal.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/legal/components/pages/Legal.vue.js +3 -3
- 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 +11 -2
- package/dist/prometheus-framework/src/modules/mobile/components/Menu/Menu.vue2.cjs +1 -1
- package/dist/prometheus-framework/src/modules/mobile/components/Menu/Menu.vue2.js +2 -11
- 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/Orders.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/orders/components/pages/Orders.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/orders/components/sections/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/organizations/components/blocks/CardDepartment.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/blocks/CardDepartment.vue.js +17 -17
- 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 +49 -42
- package/dist/prometheus-framework/src/modules/organizations/components/blocks/User.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/blocks/User.vue.js +48 -15
- package/dist/prometheus-framework/src/modules/organizations/components/elements/ButtonToggleMembership.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/elements/ButtonToggleMembership.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/pages/Department.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/pages/Department.vue.js +38 -37
- 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 +249 -61
- package/dist/prometheus-framework/src/modules/organizations/components/pages/Members.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/pages/Members.vue.js +78 -45
- package/dist/prometheus-framework/src/modules/organizations/components/pages/Organization.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/pages/Organization.vue.js +160 -86
- package/dist/prometheus-framework/src/modules/organizations/components/pages/OrganizationEdit.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/pages/OrganizationEdit.vue.js +3 -3
- package/dist/prometheus-framework/src/modules/organizations/components/pages/Organizations.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/pages/Organizations.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/sections/Documents.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/sections/Documents.vue.js +2 -2
- package/dist/prometheus-framework/src/modules/organizations/components/sections/MembersAdd.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/sections/MembersAdd.vue.js +52 -54
- 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 +20 -26
- package/dist/prometheus-framework/src/modules/organizations/organizations.client.cjs +1 -1
- package/dist/prometheus-framework/src/modules/organizations/organizations.client.js +40 -46
- package/dist/prometheus-framework/src/modules/organizations/store/departments.cjs +1 -1
- package/dist/prometheus-framework/src/modules/organizations/store/departments.js +34 -30
- package/dist/prometheus-framework/src/modules/organizations/store/memberships.cjs +1 -1
- package/dist/prometheus-framework/src/modules/organizations/store/memberships.js +30 -28
- 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 +18 -18
- package/dist/prometheus-framework/src/modules/products/components/blocks/LeftoverPositions.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/products/components/blocks/LeftoverPositions.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/products/components/blocks/ListPositions.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/products/components/blocks/ListPositions.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/products/components/pages/EditLeftover.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/products/components/pages/EditLeftover.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/products/components/pages/Leftovers.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/products/components/pages/Leftovers.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/products/components/pages/Product.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/products/components/pages/Product.vue.js +33 -28
- 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 +123 -113
- package/dist/prometheus-framework/src/modules/products/components/pages/ProductsBackoffice.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/products/components/pages/ProductsBackoffice.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/products/components/sections/EditModifications.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/products/components/sections/EditModifications.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/products/components/sections/EditProductInfo.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/products/components/sections/EditProductInfo.vue.js +2 -2
- package/dist/prometheus-framework/src/modules/products/components/sections/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/SectionProduct.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/products/components/sections/SectionProduct.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/products/store/products.cjs +1 -1
- package/dist/prometheus-framework/src/modules/products/store/products.js +1 -1
- package/dist/prometheus-framework/src/modules/reports/components/sections/FormReport.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/reports/components/sections/FormReport.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/users/components/pages/Profile.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/users/components/pages/Profile.vue.js +3 -3
- package/dist/prometheus-framework/src/modules/users/components/pages/ProfileBlogposts.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/users/components/pages/ProfileBlogposts.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/users/components/pages/ProfileEdit.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/users/components/pages/ProfileEdit.vue.js +3 -3
- package/dist/prometheus-framework/src/modules/users/components/pages/ProfileEvents.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/users/components/pages/ProfileEvents.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/wallet/components/pages/Wallet.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/wallet/components/pages/Wallet.vue.js +1 -1
- package/dist/prometheus-framework.cjs.js +1 -1
- package/dist/prometheus-framework.es.js +1 -1
- package/dist/reports.server.js +1 -1
- package/dist/reports.server.mjs +1 -1
- package/dist/style.css +1 -1
- package/dist/web-7p76PGnO.mjs +55 -0
- package/dist/web-c63f0ecc.js +1 -0
- package/dist/web-d8173758.mjs +55 -0
- package/dist/web-dn8vgptQ.js +1 -0
- package/package.json +1 -1
- package/src/components/SelectMulti/SelectMulti.vue +1 -1
- package/src/modules/auth/components/pages/Invite.vue +17 -6
- package/src/modules/auth/controllers/auth.controller.js +24 -16
- package/src/modules/auth/controllers/invites.controller.js +17 -8
- package/src/modules/auth/store/auth.js +8 -1
- package/src/modules/auth/store/invites.js +1 -0
- package/src/modules/globals/store/globals.js +5 -1
- package/src/modules/landing/components/blocks/MapBlock.vue +37 -0
- package/src/modules/landing/components/pages/404.vue +3 -0
- package/src/modules/landing/components/pages/Governance.vue +155 -0
- package/src/modules/landing/components/pages/Home.vue +52 -0
- package/src/modules/landing/components/pages/Hotel.vue +54 -0
- package/src/modules/landing/components/pages/Page.vue +184 -0
- package/src/modules/landing/components/sections/AboutSection.vue +69 -0
- package/src/modules/landing/components/sections/Examples.vue +90 -0
- package/src/modules/landing/components/sections/FeatureSection.vue +80 -0
- package/src/modules/landing/components/sections/GiftSection.vue +63 -0
- package/src/modules/landing/components/sections/HeroSection.vue +74 -0
- package/src/modules/landing/components/sections/HowItWorksSection.vue +88 -0
- package/src/modules/landing/components/sections/HowToBuyWDR.vue +131 -0
- package/src/modules/landing/components/sections/InstagramSection.vue +181 -0
- package/src/modules/landing/components/sections/MapSection.vue +91 -0
- package/src/modules/landing/components/sections/SectionsSection.vue +69 -0
- package/src/modules/landing/components/sections/SliderFeatures.vue +131 -0
- package/src/modules/landing/components/sections/WhatIsWDRSection.vue +116 -0
- package/src/modules/landing/router/landing.js +34 -0
- package/src/modules/middlewares/server/verifySignUp.js +4 -0
- package/src/modules/mobile/components/BottomNavigation/BottomNavigation.vue +86 -0
- package/src/modules/mobile/components/BottomSheet/BottomSheet.vue +86 -0
- package/src/modules/mobile/components/NavigationBar/NavigationBar.vue +132 -0
- package/src/modules/mobile/components/Walkthrough/Walkthrough.vue +195 -0
- package/src/modules/organizations/components/blocks/CardDepartment.vue +3 -3
- package/src/modules/organizations/components/blocks/DepartmentMemberModify.vue +52 -44
- package/src/modules/organizations/components/blocks/User.vue +42 -10
- package/src/modules/organizations/components/pages/Department.vue +7 -6
- package/src/modules/organizations/components/pages/DepartmentEdit.vue +110 -134
- package/src/modules/organizations/components/pages/Members.vue +85 -26
- package/src/modules/organizations/components/pages/Organization.vue +59 -4
- package/src/modules/organizations/components/sections/MembersAdd.vue +27 -34
- package/src/modules/organizations/components/sections/Organizations.vue +0 -1
- package/src/modules/organizations/controllers/memberships.controller.js +33 -26
- package/src/modules/organizations/controllers/organizations.controller.js +1 -1
- package/src/modules/organizations/models/department.model.js +0 -19
- package/src/modules/organizations/models/membership.model.js +4 -0
- package/src/modules/organizations/organizations.client.js +1 -6
- package/src/modules/organizations/store/departments.js +48 -44
- package/src/modules/organizations/store/memberships.js +11 -3
- package/src/modules/products/components/blocks/CardPosition.vue +2 -2
- package/src/modules/products/components/pages/Product.vue +6 -1
- package/src/modules/products/components/pages/ProductEdit.vue +48 -28
- package/src/modules/products/controllers/products.controller.js +99 -33
- package/src/modules/products/models/product.model.js +16 -1
- package/src/modules/products/store/products.js +1 -1
- package/src/modules/users/components/pages/ProfileOrganizations.vue +41 -7
- package/src/styles/layout.scss +1 -1
- package/src/modules/organizations/components/sections/FeedDepartments.vue +0 -64
- package/src/modules/organizations/components/sections/MembersList.vue +0 -85
- package/src/modules/organizations/store/invites.js +0 -93
package/dist/products.server.mjs
CHANGED
@@ -3,7 +3,7 @@ import "uuid";
|
|
3
3
|
import require$$0 from "mongoose";
|
4
4
|
import "path";
|
5
5
|
import require$$3 from "openai";
|
6
|
-
import { s as server } from "./index-
|
6
|
+
import { s as server } from "./index-3981e903.mjs";
|
7
7
|
import "jsonwebtoken";
|
8
8
|
import "mongodb";
|
9
9
|
var product_model = (mongoose) => {
|
@@ -25,7 +25,22 @@ var product_model = (mongoose) => {
|
|
25
25
|
images: { type: Array },
|
26
26
|
popularity: { type: Number },
|
27
27
|
localization: { type: Array },
|
28
|
-
ingredients: {
|
28
|
+
ingredients: [{
|
29
|
+
_id: {
|
30
|
+
type: mongoose.Schema.Types.ObjectId,
|
31
|
+
ref: "Product"
|
32
|
+
},
|
33
|
+
price: {
|
34
|
+
type: Number,
|
35
|
+
required: true,
|
36
|
+
min: [0, "Price cannot be less than 0"]
|
37
|
+
},
|
38
|
+
quantity: {
|
39
|
+
type: Number,
|
40
|
+
required: true,
|
41
|
+
min: [1, "Quantity cannot be less than 1"]
|
42
|
+
}
|
43
|
+
}],
|
29
44
|
information: [{
|
30
45
|
name: { type: String },
|
31
46
|
value: { type: String }
|
@@ -210,7 +225,10 @@ var leftover_model = (mongoose) => {
|
|
210
225
|
const leftover_model$1 = /* @__PURE__ */ getDefaultExportFromCjs(leftover_model);
|
211
226
|
const ObjectId$1 = require$$0.Types.ObjectId;
|
212
227
|
const OpenAI = require$$3;
|
213
|
-
|
228
|
+
console.log(process.env.OPENAI_API_KEY);
|
229
|
+
const openai = new OpenAI({
|
230
|
+
apiKey: process.env.OPENAI_API_KEY
|
231
|
+
});
|
214
232
|
const controllerFactory$5 = (db) => {
|
215
233
|
const Product = db.product;
|
216
234
|
db.modification;
|
@@ -291,7 +309,7 @@ const controllerFactory$5 = (db) => {
|
|
291
309
|
const Update = async (req, res) => {
|
292
310
|
try {
|
293
311
|
const { _id } = req.params;
|
294
|
-
console.log(
|
312
|
+
console.log(req.body.ingredients);
|
295
313
|
const updatedProduct = await Product.findOneAndUpdate(
|
296
314
|
{ _id },
|
297
315
|
{
|
@@ -305,7 +323,8 @@ const controllerFactory$5 = (db) => {
|
|
305
323
|
information: req.body.information,
|
306
324
|
localization: req.body.localization,
|
307
325
|
quantity: req.body.quantity,
|
308
|
-
quantityDiscount: req.body.quantityDiscount
|
326
|
+
quantityDiscount: req.body.quantityDiscount,
|
327
|
+
ingredients: req.body.ingredients
|
309
328
|
},
|
310
329
|
{ new: true }
|
311
330
|
);
|
@@ -336,19 +355,19 @@ const controllerFactory$5 = (db) => {
|
|
336
355
|
"withIngredients": [
|
337
356
|
{
|
338
357
|
$match: {
|
339
|
-
|
358
|
+
ingredients: { $exists: true, $not: { $size: 0 } }
|
340
359
|
// Продукты с ингредиентами
|
341
360
|
}
|
342
361
|
},
|
343
362
|
{
|
344
363
|
$lookup: {
|
345
364
|
from: "products",
|
346
|
-
localField: "
|
365
|
+
localField: "ingredients",
|
347
366
|
foreignField: "_id",
|
348
367
|
as: "ingredientDetails"
|
349
368
|
}
|
350
369
|
},
|
351
|
-
{ $unwind: "$ingredientDetails" },
|
370
|
+
// { $unwind: "$ingredientDetails" },
|
352
371
|
{
|
353
372
|
$lookup: {
|
354
373
|
from: "leftovers",
|
@@ -383,9 +402,9 @@ const controllerFactory$5 = (db) => {
|
|
383
402
|
{
|
384
403
|
$match: {
|
385
404
|
$or: [
|
386
|
-
{
|
405
|
+
{ ingredients: { $exists: false } },
|
387
406
|
// Продукты без ингредиентов
|
388
|
-
{
|
407
|
+
{ ingredients: { $size: 0 } }
|
389
408
|
]
|
390
409
|
}
|
391
410
|
},
|
@@ -447,13 +466,13 @@ const controllerFactory$5 = (db) => {
|
|
447
466
|
console.log("no products");
|
448
467
|
return res.status(404).send({ message: "Products not found." });
|
449
468
|
}
|
450
|
-
const productsList = products.map((p) =>
|
451
|
-
|
452
|
-
|
453
|
-
(${
|
454
|
-
(${
|
455
|
-
|
456
|
-
|
469
|
+
const productsList = products.map((p) => {
|
470
|
+
const info = p.information || [];
|
471
|
+
const value0 = info[0] ? info[0].value : "";
|
472
|
+
const value1 = info[1] ? `(${info[1].value}%)` : "";
|
473
|
+
const value2 = info[2] ? `(${info[2].value})` : "";
|
474
|
+
return `${p._id}: ${p.name} (${value0}) ${value1} ${value2}`;
|
475
|
+
}).join(", ");
|
457
476
|
const prompt = `
|
458
477
|
1. When asked how the client wants to feel, they responded "${mood}".
|
459
478
|
2. Here is a list of products in our store: ${productsList}.
|
@@ -467,7 +486,7 @@ const controllerFactory$5 = (db) => {
|
|
467
486
|
while (true) {
|
468
487
|
try {
|
469
488
|
response = await openai.chat.completions.create({
|
470
|
-
model: "gpt-
|
489
|
+
model: "gpt-3.5-turbo",
|
471
490
|
messages: [{ role: "user", content: prompt }]
|
472
491
|
});
|
473
492
|
console.log(response);
|
@@ -519,13 +538,21 @@ const controllerFactory$5 = (db) => {
|
|
519
538
|
{
|
520
539
|
$lookup: {
|
521
540
|
from: "leftovers",
|
522
|
-
let: { productId: "$_id",
|
541
|
+
let: { productId: "$_id", ingredientsIds: "$ingredients._id" },
|
523
542
|
pipeline: [
|
524
543
|
{
|
525
544
|
$unwind: "$positions"
|
526
545
|
},
|
527
546
|
{
|
528
|
-
|
547
|
+
$match: {
|
548
|
+
$expr: {
|
549
|
+
$or: [
|
550
|
+
{ $eq: ["$positions._id", "$$productId"] },
|
551
|
+
{ $in: ["$positions._id", { $ifNull: ["$$ingredientsIds", []] }] }
|
552
|
+
// Исправлено
|
553
|
+
]
|
554
|
+
}
|
555
|
+
}
|
529
556
|
},
|
530
557
|
{
|
531
558
|
"$addFields": {
|
@@ -546,18 +573,75 @@ const controllerFactory$5 = (db) => {
|
|
546
573
|
}
|
547
574
|
}
|
548
575
|
],
|
549
|
-
as: "
|
576
|
+
as: "leftovers"
|
577
|
+
}
|
578
|
+
},
|
579
|
+
{
|
580
|
+
$addFields: {
|
581
|
+
ingredientsQuantities: {
|
582
|
+
$cond: {
|
583
|
+
if: { $isArray: "$ingredients" },
|
584
|
+
then: {
|
585
|
+
$map: {
|
586
|
+
input: "$ingredients",
|
587
|
+
as: "ingredient",
|
588
|
+
in: {
|
589
|
+
$let: {
|
590
|
+
vars: {
|
591
|
+
ingredientId: "$$ingredient._id",
|
592
|
+
ingredientQuantity: { $ifNull: ["$$ingredient.quantity", 0] }
|
593
|
+
},
|
594
|
+
in: {
|
595
|
+
$divide: [
|
596
|
+
{
|
597
|
+
$sum: {
|
598
|
+
$map: {
|
599
|
+
input: "$leftovers",
|
600
|
+
as: "leftover",
|
601
|
+
in: {
|
602
|
+
$cond: {
|
603
|
+
if: { $eq: ["$$leftover._id", "$$ingredientId"] },
|
604
|
+
then: "$$leftover.quantity",
|
605
|
+
else: 0
|
606
|
+
}
|
607
|
+
}
|
608
|
+
}
|
609
|
+
}
|
610
|
+
},
|
611
|
+
{
|
612
|
+
$cond: {
|
613
|
+
if: { $eq: ["$$ingredientQuantity", 0] },
|
614
|
+
then: 1,
|
615
|
+
else: "$$ingredientQuantity"
|
616
|
+
}
|
617
|
+
}
|
618
|
+
]
|
619
|
+
}
|
620
|
+
}
|
621
|
+
}
|
622
|
+
}
|
623
|
+
},
|
624
|
+
else: []
|
625
|
+
}
|
626
|
+
}
|
550
627
|
}
|
551
628
|
},
|
552
629
|
{
|
553
630
|
$set: {
|
554
631
|
quantity: {
|
555
|
-
$
|
632
|
+
$cond: {
|
633
|
+
if: { $gt: [{ $size: { $ifNull: ["$ingredients", []] } }, 0] },
|
634
|
+
// Снова проверяем, не пустой ли массив ингредиентов
|
635
|
+
then: { $floor: { $min: "$ingredientsQuantities" } },
|
636
|
+
else: { $sum: "$leftovers.quantity" }
|
637
|
+
// Просто суммируем quantity из leftovers, если ингредиентов нет
|
638
|
+
}
|
556
639
|
}
|
557
640
|
}
|
558
641
|
},
|
559
|
-
{ $unset: "
|
642
|
+
{ $unset: ["leftovers", "ingredientsQuantities"] }
|
560
643
|
]);
|
644
|
+
console.log(product);
|
561
645
|
if (!product || product.length < 1) {
|
562
646
|
return res.status(404).send({ message: "Product not found." });
|
563
647
|
}
|
@@ -566,7 +650,6 @@ const controllerFactory$5 = (db) => {
|
|
566
650
|
{ $inc: { popularity: 1 } },
|
567
651
|
{ new: true }
|
568
652
|
);
|
569
|
-
console.log("Popularity updated:", updatedProduct);
|
570
653
|
res.status(200).send(product);
|
571
654
|
} catch (err) {
|
572
655
|
console.error("Error:", err);
|
@@ -1 +1 @@
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e="";exports.default=e;
|
@@ -1,227 +1,4 @@
|
|
1
|
-
|
2
|
-
import "./Button.vue2.js";
|
3
|
-
const k = ["disabled"], x = { key: 0 }, N = {
|
4
|
-
key: 1,
|
5
|
-
class: "loading"
|
6
|
-
}, C = /* @__PURE__ */ e("svg", {
|
7
|
-
class: "i-regular",
|
8
|
-
width: "135",
|
9
|
-
height: "140",
|
10
|
-
viewBox: "0 0 135 140",
|
11
|
-
xmlns: "http://www.w3.org/2000/svg",
|
12
|
-
fill: "#fff"
|
13
|
-
}, [
|
14
|
-
/* @__PURE__ */ e("rect", {
|
15
|
-
y: "10",
|
16
|
-
width: "15",
|
17
|
-
height: "120",
|
18
|
-
rx: "6"
|
19
|
-
}, [
|
20
|
-
/* @__PURE__ */ e("animate", {
|
21
|
-
attributeName: "height",
|
22
|
-
begin: "0.5s",
|
23
|
-
dur: "1s",
|
24
|
-
values: "120;110;100;90;80;70;60;50;40;140;120",
|
25
|
-
calcMode: "linear",
|
26
|
-
repeatCount: "indefinite"
|
27
|
-
}),
|
28
|
-
/* @__PURE__ */ r(),
|
29
|
-
/* @__PURE__ */ e("animate", {
|
30
|
-
attributeName: "y",
|
31
|
-
begin: "0.5s",
|
32
|
-
dur: "1s",
|
33
|
-
values: "10;15;20;25;30;35;40;45;50;0;10",
|
34
|
-
calcMode: "linear",
|
35
|
-
repeatCount: "indefinite"
|
36
|
-
})
|
37
|
-
]),
|
38
|
-
/* @__PURE__ */ e("rect", {
|
39
|
-
x: "30",
|
40
|
-
y: "10",
|
41
|
-
width: "15",
|
42
|
-
height: "120",
|
43
|
-
rx: "6"
|
44
|
-
}, [
|
45
|
-
/* @__PURE__ */ e("animate", {
|
46
|
-
attributeName: "height",
|
47
|
-
begin: "0.25s",
|
48
|
-
dur: "1s",
|
49
|
-
values: "120;110;100;90;80;70;60;50;40;140;120",
|
50
|
-
calcMode: "linear",
|
51
|
-
repeatCount: "indefinite"
|
52
|
-
}),
|
53
|
-
/* @__PURE__ */ r(),
|
54
|
-
/* @__PURE__ */ e("animate", {
|
55
|
-
attributeName: "y",
|
56
|
-
begin: "0.25s",
|
57
|
-
dur: "1s",
|
58
|
-
values: "10;15;20;25;30;35;40;45;50;0;10",
|
59
|
-
calcMode: "linear",
|
60
|
-
repeatCount: "indefinite"
|
61
|
-
})
|
62
|
-
]),
|
63
|
-
/* @__PURE__ */ e("rect", {
|
64
|
-
x: "60",
|
65
|
-
width: "15",
|
66
|
-
height: "140",
|
67
|
-
rx: "6"
|
68
|
-
}, [
|
69
|
-
/* @__PURE__ */ e("animate", {
|
70
|
-
attributeName: "height",
|
71
|
-
begin: "0s",
|
72
|
-
dur: "1s",
|
73
|
-
values: "120;110;100;90;80;70;60;50;40;140;120",
|
74
|
-
calcMode: "linear",
|
75
|
-
repeatCount: "indefinite"
|
76
|
-
}),
|
77
|
-
/* @__PURE__ */ r(),
|
78
|
-
/* @__PURE__ */ e("animate", {
|
79
|
-
attributeName: "y",
|
80
|
-
begin: "0s",
|
81
|
-
dur: "1s",
|
82
|
-
values: "10;15;20;25;30;35;40;45;50;0;10",
|
83
|
-
calcMode: "linear",
|
84
|
-
repeatCount: "indefinite"
|
85
|
-
})
|
86
|
-
]),
|
87
|
-
/* @__PURE__ */ e("rect", {
|
88
|
-
x: "90",
|
89
|
-
y: "10",
|
90
|
-
width: "15",
|
91
|
-
height: "120",
|
92
|
-
rx: "6"
|
93
|
-
}, [
|
94
|
-
/* @__PURE__ */ e("animate", {
|
95
|
-
attributeName: "height",
|
96
|
-
begin: "0.25s",
|
97
|
-
dur: "1s",
|
98
|
-
values: "120;110;100;90;80;70;60;50;40;140;120",
|
99
|
-
calcMode: "linear",
|
100
|
-
repeatCount: "indefinite"
|
101
|
-
}),
|
102
|
-
/* @__PURE__ */ r(),
|
103
|
-
/* @__PURE__ */ e("animate", {
|
104
|
-
attributeName: "y",
|
105
|
-
begin: "0.25s",
|
106
|
-
dur: "1s",
|
107
|
-
values: "10;15;20;25;30;35;40;45;50;0;10",
|
108
|
-
calcMode: "linear",
|
109
|
-
repeatCount: "indefinite"
|
110
|
-
})
|
111
|
-
]),
|
112
|
-
/* @__PURE__ */ e("rect", {
|
113
|
-
x: "120",
|
114
|
-
y: "10",
|
115
|
-
width: "15",
|
116
|
-
height: "120",
|
117
|
-
rx: "6"
|
118
|
-
}, [
|
119
|
-
/* @__PURE__ */ e("animate", {
|
120
|
-
attributeName: "height",
|
121
|
-
begin: "0.5s",
|
122
|
-
dur: "1s",
|
123
|
-
values: "120;110;100;90;80;70;60;50;40;140;120",
|
124
|
-
calcMode: "linear",
|
125
|
-
repeatCount: "indefinite"
|
126
|
-
}),
|
127
|
-
/* @__PURE__ */ r(),
|
128
|
-
/* @__PURE__ */ e("animate", {
|
129
|
-
attributeName: "y",
|
130
|
-
begin: "0.5s",
|
131
|
-
dur: "1s",
|
132
|
-
values: "10;15;20;25;30;35;40;45;50;0;10",
|
133
|
-
calcMode: "linear",
|
134
|
-
repeatCount: "indefinite"
|
135
|
-
})
|
136
|
-
])
|
137
|
-
], -1), M = [
|
138
|
-
C
|
139
|
-
], B = {
|
140
|
-
key: 2,
|
141
|
-
class: "t-semi loading t-black"
|
142
|
-
}, _ = {
|
143
|
-
key: 3,
|
144
|
-
class: "error"
|
145
|
-
}, L = {
|
146
|
-
key: 0,
|
147
|
-
class: "button-counter"
|
148
|
-
}, V = {
|
149
|
-
__name: "Button",
|
150
|
-
props: {
|
151
|
-
submit: {
|
152
|
-
type: Function,
|
153
|
-
default: async () => {
|
154
|
-
console.log("Button click.");
|
155
|
-
}
|
156
|
-
},
|
157
|
-
text: {
|
158
|
-
type: Object,
|
159
|
-
default: (t) => (console.log(t), t = {
|
160
|
-
...t.text,
|
161
|
-
success: "✔",
|
162
|
-
error: "✖"
|
163
|
-
})
|
164
|
-
},
|
165
|
-
counter: {
|
166
|
-
type: Object
|
167
|
-
},
|
168
|
-
callback: {
|
169
|
-
type: Function,
|
170
|
-
default: async () => {
|
171
|
-
console.log("Button callback.");
|
172
|
-
}
|
173
|
-
},
|
174
|
-
callbackDelay: {
|
175
|
-
type: Number,
|
176
|
-
default: 750
|
177
|
-
},
|
178
|
-
showSucces: {
|
179
|
-
type: Boolean,
|
180
|
-
default: !0
|
181
|
-
},
|
182
|
-
showLoader: {
|
183
|
-
type: Boolean,
|
184
|
-
default: !0
|
185
|
-
},
|
186
|
-
validation: {
|
187
|
-
type: Boolean,
|
188
|
-
default: !1
|
189
|
-
}
|
190
|
-
},
|
191
|
-
setup(t) {
|
192
|
-
const n = t, a = d(null), i = d(null), o = d(!1), c = d(!1);
|
193
|
-
async function f() {
|
194
|
-
a.value.style["pointer-events"] = "none", i.value = null, o.value = !0;
|
195
|
-
const u = () => {
|
196
|
-
a.value && (a.value.classList.replace("bg-second", "bg-main"), a.value.style.pointerEvents = "auto", o.value = !1, c.value = !1, i.value = null);
|
197
|
-
};
|
198
|
-
try {
|
199
|
-
await n.submit(), a.value.classList.replace("bg-main", "bg-second"), o.value = !1, n.showSucces ? (c.value = !0, setTimeout(u, 500)) : u(), n.callback && setTimeout(() => n.callback(), n.callbackDelay);
|
200
|
-
} catch {
|
201
|
-
a.value.classList.replace("bg-main", "bg-fourth-nano"), i.value = n.error, setTimeout(() => {
|
202
|
-
u(), a.value.classList.replace("bg-fourth-nano", "bg-main");
|
203
|
-
}, 1330);
|
204
|
-
}
|
205
|
-
}
|
206
|
-
return (u, m) => (l(), s("button", {
|
207
|
-
onClick: v(f, ["stop"]),
|
208
|
-
disabled: t.validation,
|
209
|
-
ref_key: "button",
|
210
|
-
ref: a,
|
211
|
-
class: "button"
|
212
|
-
}, [
|
213
|
-
g(y, { name: "moveFromTopAbsolute" }, {
|
214
|
-
default: p(() => [
|
215
|
-
!o.value && !i.value && !c.value || !t.showLoader ? (l(), s("span", x, [
|
216
|
-
w(u.$slots, "default")
|
217
|
-
])) : o.value && !i.value && t.showLoader ? (l(), s("span", N, M)) : c.value && t.showSucces ? (l(), s("span", B, h(t.text.success), 1)) : i.value ? (l(), s("span", _, h(i.value), 1)) : b("", !0)
|
218
|
-
]),
|
219
|
-
_: 3
|
220
|
-
}),
|
221
|
-
t.counter ? (l(), s("p", L, h(t.counter), 1)) : b("", !0)
|
222
|
-
], 8, k));
|
223
|
-
}
|
224
|
-
};
|
1
|
+
const e = "";
|
225
2
|
export {
|
226
|
-
|
3
|
+
e as default
|
227
4
|
};
|
@@ -1 +1 @@
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e="";
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue");require("./Button.vue.cjs");const u=["disabled"],d={key:0},m={key:1,class:"loading"},b=e.createElementVNode("svg",{class:"i-regular",width:"135",height:"140",viewBox:"0 0 135 140",xmlns:"http://www.w3.org/2000/svg",fill:"#fff"},[e.createElementVNode("rect",{y:"10",width:"15",height:"120",rx:"6"},[e.createElementVNode("animate",{attributeName:"height",begin:"0.5s",dur:"1s",values:"120;110;100;90;80;70;60;50;40;140;120",calcMode:"linear",repeatCount:"indefinite"}),e.createTextVNode(),e.createElementVNode("animate",{attributeName:"y",begin:"0.5s",dur:"1s",values:"10;15;20;25;30;35;40;45;50;0;10",calcMode:"linear",repeatCount:"indefinite"})]),e.createElementVNode("rect",{x:"30",y:"10",width:"15",height:"120",rx:"6"},[e.createElementVNode("animate",{attributeName:"height",begin:"0.25s",dur:"1s",values:"120;110;100;90;80;70;60;50;40;140;120",calcMode:"linear",repeatCount:"indefinite"}),e.createTextVNode(),e.createElementVNode("animate",{attributeName:"y",begin:"0.25s",dur:"1s",values:"10;15;20;25;30;35;40;45;50;0;10",calcMode:"linear",repeatCount:"indefinite"})]),e.createElementVNode("rect",{x:"60",width:"15",height:"140",rx:"6"},[e.createElementVNode("animate",{attributeName:"height",begin:"0s",dur:"1s",values:"120;110;100;90;80;70;60;50;40;140;120",calcMode:"linear",repeatCount:"indefinite"}),e.createTextVNode(),e.createElementVNode("animate",{attributeName:"y",begin:"0s",dur:"1s",values:"10;15;20;25;30;35;40;45;50;0;10",calcMode:"linear",repeatCount:"indefinite"})]),e.createElementVNode("rect",{x:"90",y:"10",width:"15",height:"120",rx:"6"},[e.createElementVNode("animate",{attributeName:"height",begin:"0.25s",dur:"1s",values:"120;110;100;90;80;70;60;50;40;140;120",calcMode:"linear",repeatCount:"indefinite"}),e.createTextVNode(),e.createElementVNode("animate",{attributeName:"y",begin:"0.25s",dur:"1s",values:"10;15;20;25;30;35;40;45;50;0;10",calcMode:"linear",repeatCount:"indefinite"})]),e.createElementVNode("rect",{x:"120",y:"10",width:"15",height:"120",rx:"6"},[e.createElementVNode("animate",{attributeName:"height",begin:"0.5s",dur:"1s",values:"120;110;100;90;80;70;60;50;40;140;120",calcMode:"linear",repeatCount:"indefinite"}),e.createTextVNode(),e.createElementVNode("animate",{attributeName:"y",begin:"0.5s",dur:"1s",values:"10;15;20;25;30;35;40;45;50;0;10",calcMode:"linear",repeatCount:"indefinite"})])],-1),h=[b],f={key:2,class:"t-semi loading t-black"},g={key:3,class:"error"},v={key:0,class:"button-counter"},y={__name:"Button",props:{submit:{type:Function,default:async()=>{console.log("Button click.")}},text:{type:Object,default:t=>(console.log(t),t={...t.text,success:"✔",error:"✖"})},counter:{type:Object},callback:{type:Function,default:async()=>{console.log("Button callback.")}},callbackDelay:{type:Number,default:750},showSucces:{type:Boolean,default:!0},showLoader:{type:Boolean,default:!0},validation:{type:Boolean,default:!1}},setup(t){const n=t,a=e.ref(null),l=e.ref(null),o=e.ref(!1),c=e.ref(!1);async function r(){a.value.style["pointer-events"]="none",l.value=null,o.value=!0;const i=()=>{a.value&&(a.value.classList.replace("bg-second","bg-main"),a.value.style.pointerEvents="auto",o.value=!1,c.value=!1,l.value=null)};try{await n.submit(),a.value.classList.replace("bg-main","bg-second"),o.value=!1,n.showSucces?(c.value=!0,setTimeout(i,500)):i(),n.callback&&setTimeout(()=>n.callback(),n.callbackDelay)}catch{a.value.classList.replace("bg-main","bg-fourth-nano"),l.value=n.error,setTimeout(()=>{i(),a.value.classList.replace("bg-fourth-nano","bg-main")},1330)}}return(i,s)=>(e.openBlock(),e.createElementBlock("button",{onClick:e.withModifiers(r,["stop"]),disabled:t.validation,ref_key:"button",ref:a,class:"button"},[e.createVNode(e.Transition,{name:"moveFromTopAbsolute"},{default:e.withCtx(()=>[!o.value&&!l.value&&!c.value||!t.showLoader?(e.openBlock(),e.createElementBlock("span",d,[e.renderSlot(i.$slots,"default")])):o.value&&!l.value&&t.showLoader?(e.openBlock(),e.createElementBlock("span",m,h)):c.value&&t.showSucces?(e.openBlock(),e.createElementBlock("span",f,e.toDisplayString(t.text.success),1)):l.value?(e.openBlock(),e.createElementBlock("span",g,e.toDisplayString(l.value),1)):e.createCommentVNode("",!0)]),_:3}),t.counter?(e.openBlock(),e.createElementBlock("p",v,e.toDisplayString(t.counter),1)):e.createCommentVNode("",!0)],8,u))}};exports.default=y;
|