@ozdao/prometheus-framework 0.2.93 → 0.2.95
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/auth.server.js +15 -14
- package/dist/auth.server.mjs +15 -14
- package/dist/main-BJvlNekm.mjs +13631 -0
- package/dist/main-pGo7JpSP.js +92 -0
- package/dist/orders.server.js +31 -27
- package/dist/orders.server.mjs +31 -27
- package/dist/organizations.server.js +31 -10
- package/dist/organizations.server.mjs +31 -10
- package/dist/prometheus-framework/src/components/Block/Block.vue.cjs +1 -1
- package/dist/prometheus-framework/src/components/Block/Block.vue.js +1 -1
- package/dist/prometheus-framework/src/components/EditImages/EditImages.vue.js +19 -19
- package/dist/prometheus-framework/src/components/Popup/Popup.vue.js +12 -12
- package/dist/prometheus-framework/src/components/Spoiler/Spoiler.vue.cjs +1 -1
- package/dist/prometheus-framework/src/components/Spoiler/Spoiler.vue.js +36 -1
- package/dist/prometheus-framework/src/components/Spoiler/Spoiler.vue2.cjs +1 -1
- package/dist/prometheus-framework/src/components/Spoiler/Spoiler.vue2.js +1 -36
- package/dist/prometheus-framework/src/components/Upload/Upload.vue.js +21 -21
- package/dist/prometheus-framework/src/modules/auth/router/auth.cjs +1 -1
- package/dist/prometheus-framework/src/modules/auth/router/auth.js +4 -0
- package/dist/prometheus-framework/src/modules/backoffice/router/backoffice.cjs +1 -1
- package/dist/prometheus-framework/src/modules/backoffice/router/backoffice.js +8 -8
- 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 +58 -58
- package/dist/prometheus-framework/src/modules/icons/navigation/IconCross.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/icons/navigation/IconCross.vue.js +22 -21
- package/dist/prometheus-framework/src/modules/orders/components/blocks/StatusHistory.vue.cjs +2 -2
- package/dist/prometheus-framework/src/modules/orders/components/blocks/StatusHistory.vue.js +48 -37
- package/dist/prometheus-framework/src/modules/orders/components/pages/OrderBackoffice.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/orders/components/pages/OrderBackoffice.vue.js +160 -167
- package/dist/prometheus-framework/src/modules/orders/components/pages/OrderCreateBackoffice.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/orders/components/pages/OrderCreateBackoffice.vue.js +49 -48
- 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 +113 -110
- package/dist/prometheus-framework/src/modules/orders/components/partials/ShopCart.vue.js +14 -14
- package/dist/prometheus-framework/src/modules/orders/store/models/order.cjs +1 -0
- package/dist/prometheus-framework/src/modules/orders/store/models/order.js +28 -0
- package/dist/prometheus-framework/src/modules/orders/store/orders.cjs +1 -1
- package/dist/prometheus-framework/src/modules/orders/store/orders.js +25 -43
- 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 +20 -20
- 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/pages/Department.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/pages/Department.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/pages/DepartmentEdit.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/pages/DepartmentEdit.vue.js +47 -47
- 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 +143 -131
- package/dist/prometheus-framework/src/modules/organizations/components/pages/Organization.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/pages/Organization.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/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/organizations.client.cjs +1 -1
- package/dist/prometheus-framework/src/modules/organizations/organizations.client.js +32 -34
- package/dist/prometheus-framework/src/modules/organizations/router/members.router.cjs +1 -1
- package/dist/prometheus-framework/src/modules/organizations/router/members.router.js +1 -1
- 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/memberships.cjs +1 -1
- package/dist/prometheus-framework/src/modules/organizations/store/memberships.js +30 -32
- 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 +155 -187
- 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 +18 -18
- 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/users/components/blocks/CardUser.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/users/components/blocks/CardUser.vue.js +26 -22
- 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 +66 -63
- 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-B2xhKZNK.js +1 -0
- package/dist/web-DTzbVshr.mjs +54 -0
- package/package.json +1 -1
- package/src/components/Block/Block.vue +1 -1
- package/src/modules/auth/controllers/auth.controller.js +19 -16
- package/src/modules/auth/router/auth.js +4 -0
- package/src/modules/backoffice/router/backoffice.js +3 -3
- package/src/modules/chats/routes/chats.routes.js +1 -2
- package/src/modules/gallery/components/sections/BackofficeGallery.vue +2 -1
- package/src/modules/icons/navigation/IconCross.vue +11 -7
- package/src/modules/orders/components/blocks/StatusHistory.vue +8 -11
- package/src/modules/orders/components/pages/OrderBackoffice.vue +37 -50
- package/src/modules/orders/components/pages/OrderCreateBackoffice.vue +7 -3
- package/src/modules/orders/components/pages/Orders.vue +1 -1
- package/src/modules/orders/controllers/orders.controller.js +25 -25
- package/src/modules/orders/models/order.model.js +1 -1
- package/src/modules/orders/routes/orders.routes.js +6 -0
- package/src/modules/orders/store/models/order.js +33 -0
- package/src/modules/orders/store/orders.js +7 -28
- package/src/modules/organizations/components/blocks/CardDepartment.vue +2 -2
- package/src/modules/organizations/components/pages/DepartmentEdit.vue +7 -5
- package/src/modules/organizations/components/pages/Members.vue +50 -38
- package/src/modules/organizations/components/pages/Organization.vue +1 -1
- package/src/modules/organizations/controllers/invites.controller.js +2 -0
- package/src/modules/organizations/controllers/memberships.controller.js +35 -11
- package/src/modules/organizations/models/invite.model.js +4 -0
- package/src/modules/organizations/organizations.client.js +0 -2
- package/src/modules/organizations/router/members.router.js +1 -1
- package/src/modules/organizations/store/departments.js +0 -1
- package/src/modules/organizations/store/memberships.js +1 -8
- package/src/modules/products/components/pages/ProductEdit.vue +39 -33
- package/src/modules/products/components/sections/EditProductInfo.vue +3 -3
- package/src/modules/users/components/blocks/CardUser.vue +9 -5
- package/src/modules/users/components/pages/Profile.vue +5 -3
- package/src/modules/organizations/components/blocks/DepartmentMemberModify.vue +0 -126
package/dist/orders.server.js
CHANGED
@@ -3,8 +3,8 @@ const _commonjsHelpers = require("./_commonjsHelpers-DHfMLFPC.js");
|
|
3
3
|
const ownership_schema = require("./ownership.schema-DN0SlQL6.js");
|
4
4
|
const profile_schema = require("./profile.schema-CkOhhf37.js");
|
5
5
|
const credentials_schema = require("./credentials.schema-B-KD_ozQ.js");
|
6
|
-
const mailing = require("./mailing-BX0q8DIs.js");
|
7
6
|
const queryProcessor = require("./queryProcessor-DRMo_GWK.js");
|
7
|
+
const mailing = require("./mailing-BX0q8DIs.js");
|
8
8
|
const index = require("./index-BCCiEK_u.js");
|
9
9
|
const require$$0 = require("node-cache");
|
10
10
|
const applyOwnershipSchema$1 = ownership_schema.ownership_schema;
|
@@ -40,7 +40,7 @@ var order_model = (db) => {
|
|
40
40
|
type: String,
|
41
41
|
trim: true
|
42
42
|
},
|
43
|
-
|
43
|
+
user: {
|
44
44
|
type: db.mongoose.Schema.Types.ObjectId,
|
45
45
|
ref: "User"
|
46
46
|
},
|
@@ -200,8 +200,8 @@ var application_model = (db) => {
|
|
200
200
|
const Application = db.mongoose.model("Application", ApplicationSchema);
|
201
201
|
return Application;
|
202
202
|
};
|
203
|
-
const { sendChatMessageTelegram } = mailing.mailing;
|
204
203
|
const queryProcessorGlobals = queryProcessor.queryProcessor;
|
204
|
+
const { sendChatMessageTelegram } = mailing.mailing;
|
205
205
|
function formatPositions(positions) {
|
206
206
|
return positions.map((pos) => `🔹 ${pos.name} - Price: $${pos.price}, Quantity: ${pos.quantity}`).join("\n");
|
207
207
|
}
|
@@ -229,6 +229,7 @@ async function findOrCreateCustomer(Customer, customerInfo, orderOwner, orderCre
|
|
229
229
|
searchCriteria.email = customerInfo.email;
|
230
230
|
}
|
231
231
|
let customer = null;
|
232
|
+
console.log(searchCriteria);
|
232
233
|
if (Object.keys(searchCriteria).length > 0) {
|
233
234
|
customer = await Customer.findOne({ $or: [searchCriteria] });
|
234
235
|
}
|
@@ -237,12 +238,12 @@ async function findOrCreateCustomer(Customer, customerInfo, orderOwner, orderCre
|
|
237
238
|
...customerInfo,
|
238
239
|
owner: orderOwner,
|
239
240
|
creator: {
|
240
|
-
type: customerInfo.creator
|
241
|
-
target: customerInfo.creator
|
241
|
+
type: customerInfo.creator?.type || orderCreator.type,
|
242
|
+
target: customerInfo.creator?.target || orderCreator.target
|
242
243
|
},
|
243
244
|
identity: {
|
244
|
-
type: customerInfo.identity
|
245
|
-
target: customerInfo.identity
|
245
|
+
type: customerInfo.identity?.type || orderCreator.type,
|
246
|
+
target: customerInfo.identity?.target || orderCreator.target
|
246
247
|
}
|
247
248
|
};
|
248
249
|
customer = await Customer.create(newCustomerData);
|
@@ -257,23 +258,20 @@ async function sendOrderMessage(orderData) {
|
|
257
258
|
console.error(err);
|
258
259
|
}
|
259
260
|
}
|
260
|
-
function initializeOrder(orderData, userId) {
|
261
|
-
orderData.status = "created";
|
262
|
-
orderData.status_history = orderData.status_history || [];
|
263
|
-
orderData.status_history.push({
|
264
|
-
status: orderData.status,
|
265
|
-
changedBy: userId,
|
266
|
-
timestamp: /* @__PURE__ */ new Date(),
|
267
|
-
comment: ""
|
268
|
-
});
|
269
|
-
}
|
270
261
|
const controllerFactory$1 = (db) => {
|
271
262
|
const Order = db.order;
|
272
263
|
const Customer = db.customer;
|
273
264
|
const create = async (req, res) => {
|
274
265
|
const orderData = req.body;
|
275
|
-
|
276
|
-
|
266
|
+
req.userId;
|
267
|
+
orderData.status = "created";
|
268
|
+
orderData.status_history = orderData.status_history || [];
|
269
|
+
orderData.status_history.push({
|
270
|
+
status: orderData.status,
|
271
|
+
user: new db.mongoose.Types.ObjectId(req.userId),
|
272
|
+
timestamp: /* @__PURE__ */ new Date(),
|
273
|
+
comment: ""
|
274
|
+
});
|
277
275
|
try {
|
278
276
|
if (!orderData.customer.target) {
|
279
277
|
let customer = await findOrCreateCustomer(Customer, orderData.customer, orderData.owner, orderData.creator);
|
@@ -291,7 +289,7 @@ const controllerFactory$1 = (db) => {
|
|
291
289
|
}
|
292
290
|
};
|
293
291
|
const read = async (req, res) => {
|
294
|
-
stages = [
|
292
|
+
let stages = [
|
295
293
|
...queryProcessorGlobals.getBasicOptions(
|
296
294
|
req.query
|
297
295
|
),
|
@@ -339,16 +337,16 @@ const controllerFactory$1 = (db) => {
|
|
339
337
|
}
|
340
338
|
};
|
341
339
|
const update = async (req, res) => {
|
342
|
-
console.log(req.body);
|
343
340
|
const order = await Order.findOne({ _id: req.body._id });
|
344
341
|
if (!order) {
|
345
342
|
return res.status(404).send({ errorCode: "ORDER_NOT_FOUND", message: "Order not found." });
|
346
343
|
}
|
344
|
+
console.log("order status is", req.userId);
|
347
345
|
if (req.body.status && req.body.status !== order.status) {
|
348
346
|
order.status = req.body.status;
|
349
347
|
order.status_history.push({
|
350
348
|
status: req.body.status,
|
351
|
-
|
349
|
+
user: new db.mongoose.Types.ObjectId(req.userId),
|
352
350
|
timestamp: /* @__PURE__ */ new Date(),
|
353
351
|
comment: ""
|
354
352
|
});
|
@@ -364,7 +362,7 @@ const controllerFactory$1 = (db) => {
|
|
364
362
|
try {
|
365
363
|
const order = await Order.findOneAndUpdate(
|
366
364
|
{ _id: req.params._id },
|
367
|
-
{ status: "
|
365
|
+
{ status: "closed", payment: { type: "Cash", status: "paid" } },
|
368
366
|
{ new: true }
|
369
367
|
).exec();
|
370
368
|
if (!order) {
|
@@ -402,6 +400,9 @@ var orders_routes = function(app, db, origins, publicPath) {
|
|
402
400
|
const middleware = middlewareFactory(db);
|
403
401
|
app.post(
|
404
402
|
"/api/orders/create",
|
403
|
+
[
|
404
|
+
middleware.authJwt.verifyToken
|
405
|
+
],
|
405
406
|
controller.create
|
406
407
|
);
|
407
408
|
app.get(
|
@@ -417,6 +418,9 @@ var orders_routes = function(app, db, origins, publicPath) {
|
|
417
418
|
);
|
418
419
|
app.post(
|
419
420
|
"/api/orders/delete",
|
421
|
+
[
|
422
|
+
middleware.authJwt.verifyToken
|
423
|
+
],
|
420
424
|
controller.deleteOrder
|
421
425
|
);
|
422
426
|
};
|
@@ -505,8 +509,8 @@ let CRUD$1 = class CRUD {
|
|
505
509
|
}
|
506
510
|
async read(req, res) {
|
507
511
|
try {
|
508
|
-
let
|
509
|
-
|
512
|
+
let stages = [];
|
513
|
+
stages = [
|
510
514
|
...globalsQuery.getBasicOptions(
|
511
515
|
req.query
|
512
516
|
),
|
@@ -528,10 +532,10 @@ let CRUD$1 = class CRUD {
|
|
528
532
|
),
|
529
533
|
globalsQuery.removeTempPropeties()
|
530
534
|
];
|
531
|
-
const cacheKey = JSON.stringify({ stages
|
535
|
+
const cacheKey = JSON.stringify({ stages });
|
532
536
|
let data = await this.cache.get(cacheKey);
|
533
537
|
if (!data) {
|
534
|
-
data = await this.model.aggregate(
|
538
|
+
data = await this.model.aggregate(stages).exec();
|
535
539
|
await this.cache.set(cacheKey, data);
|
536
540
|
}
|
537
541
|
res.json(data);
|
package/dist/orders.server.mjs
CHANGED
@@ -2,8 +2,8 @@ import { g as getDefaultExportFromCjs } from "./_commonjsHelpers-CUmg6egw.mjs";
|
|
2
2
|
import { o as ownership_schema } from "./ownership.schema-oyx6eNkZ.mjs";
|
3
3
|
import { p as profile_schema } from "./profile.schema-24ZpZQJe.mjs";
|
4
4
|
import { c as credentials_schema } from "./credentials.schema-C9dmNy7o.mjs";
|
5
|
-
import { m as mailing } from "./mailing-Cdp8NXhP.mjs";
|
6
5
|
import { q as queryProcessor } from "./queryProcessor-BJdKh0Ow.mjs";
|
6
|
+
import { m as mailing } from "./mailing-Cdp8NXhP.mjs";
|
7
7
|
import { s as server } from "./index-B6a1mPgp.mjs";
|
8
8
|
import require$$0 from "node-cache";
|
9
9
|
const applyOwnershipSchema$1 = ownership_schema;
|
@@ -39,7 +39,7 @@ var order_model = (db) => {
|
|
39
39
|
type: String,
|
40
40
|
trim: true
|
41
41
|
},
|
42
|
-
|
42
|
+
user: {
|
43
43
|
type: db.mongoose.Schema.Types.ObjectId,
|
44
44
|
ref: "User"
|
45
45
|
},
|
@@ -199,8 +199,8 @@ var application_model = (db) => {
|
|
199
199
|
const Application = db.mongoose.model("Application", ApplicationSchema);
|
200
200
|
return Application;
|
201
201
|
};
|
202
|
-
const { sendChatMessageTelegram } = mailing;
|
203
202
|
const queryProcessorGlobals = queryProcessor;
|
203
|
+
const { sendChatMessageTelegram } = mailing;
|
204
204
|
function formatPositions(positions) {
|
205
205
|
return positions.map((pos) => `🔹 ${pos.name} - Price: $${pos.price}, Quantity: ${pos.quantity}`).join("\n");
|
206
206
|
}
|
@@ -228,6 +228,7 @@ async function findOrCreateCustomer(Customer, customerInfo, orderOwner, orderCre
|
|
228
228
|
searchCriteria.email = customerInfo.email;
|
229
229
|
}
|
230
230
|
let customer = null;
|
231
|
+
console.log(searchCriteria);
|
231
232
|
if (Object.keys(searchCriteria).length > 0) {
|
232
233
|
customer = await Customer.findOne({ $or: [searchCriteria] });
|
233
234
|
}
|
@@ -236,12 +237,12 @@ async function findOrCreateCustomer(Customer, customerInfo, orderOwner, orderCre
|
|
236
237
|
...customerInfo,
|
237
238
|
owner: orderOwner,
|
238
239
|
creator: {
|
239
|
-
type: customerInfo.creator
|
240
|
-
target: customerInfo.creator
|
240
|
+
type: customerInfo.creator?.type || orderCreator.type,
|
241
|
+
target: customerInfo.creator?.target || orderCreator.target
|
241
242
|
},
|
242
243
|
identity: {
|
243
|
-
type: customerInfo.identity
|
244
|
-
target: customerInfo.identity
|
244
|
+
type: customerInfo.identity?.type || orderCreator.type,
|
245
|
+
target: customerInfo.identity?.target || orderCreator.target
|
245
246
|
}
|
246
247
|
};
|
247
248
|
customer = await Customer.create(newCustomerData);
|
@@ -256,23 +257,20 @@ async function sendOrderMessage(orderData) {
|
|
256
257
|
console.error(err);
|
257
258
|
}
|
258
259
|
}
|
259
|
-
function initializeOrder(orderData, userId) {
|
260
|
-
orderData.status = "created";
|
261
|
-
orderData.status_history = orderData.status_history || [];
|
262
|
-
orderData.status_history.push({
|
263
|
-
status: orderData.status,
|
264
|
-
changedBy: userId,
|
265
|
-
timestamp: /* @__PURE__ */ new Date(),
|
266
|
-
comment: ""
|
267
|
-
});
|
268
|
-
}
|
269
260
|
const controllerFactory$1 = (db) => {
|
270
261
|
const Order = db.order;
|
271
262
|
const Customer = db.customer;
|
272
263
|
const create = async (req, res) => {
|
273
264
|
const orderData = req.body;
|
274
|
-
|
275
|
-
|
265
|
+
req.userId;
|
266
|
+
orderData.status = "created";
|
267
|
+
orderData.status_history = orderData.status_history || [];
|
268
|
+
orderData.status_history.push({
|
269
|
+
status: orderData.status,
|
270
|
+
user: new db.mongoose.Types.ObjectId(req.userId),
|
271
|
+
timestamp: /* @__PURE__ */ new Date(),
|
272
|
+
comment: ""
|
273
|
+
});
|
276
274
|
try {
|
277
275
|
if (!orderData.customer.target) {
|
278
276
|
let customer = await findOrCreateCustomer(Customer, orderData.customer, orderData.owner, orderData.creator);
|
@@ -290,7 +288,7 @@ const controllerFactory$1 = (db) => {
|
|
290
288
|
}
|
291
289
|
};
|
292
290
|
const read = async (req, res) => {
|
293
|
-
stages = [
|
291
|
+
let stages = [
|
294
292
|
...queryProcessorGlobals.getBasicOptions(
|
295
293
|
req.query
|
296
294
|
),
|
@@ -338,16 +336,16 @@ const controllerFactory$1 = (db) => {
|
|
338
336
|
}
|
339
337
|
};
|
340
338
|
const update = async (req, res) => {
|
341
|
-
console.log(req.body);
|
342
339
|
const order = await Order.findOne({ _id: req.body._id });
|
343
340
|
if (!order) {
|
344
341
|
return res.status(404).send({ errorCode: "ORDER_NOT_FOUND", message: "Order not found." });
|
345
342
|
}
|
343
|
+
console.log("order status is", req.userId);
|
346
344
|
if (req.body.status && req.body.status !== order.status) {
|
347
345
|
order.status = req.body.status;
|
348
346
|
order.status_history.push({
|
349
347
|
status: req.body.status,
|
350
|
-
|
348
|
+
user: new db.mongoose.Types.ObjectId(req.userId),
|
351
349
|
timestamp: /* @__PURE__ */ new Date(),
|
352
350
|
comment: ""
|
353
351
|
});
|
@@ -363,7 +361,7 @@ const controllerFactory$1 = (db) => {
|
|
363
361
|
try {
|
364
362
|
const order = await Order.findOneAndUpdate(
|
365
363
|
{ _id: req.params._id },
|
366
|
-
{ status: "
|
364
|
+
{ status: "closed", payment: { type: "Cash", status: "paid" } },
|
367
365
|
{ new: true }
|
368
366
|
).exec();
|
369
367
|
if (!order) {
|
@@ -401,6 +399,9 @@ var orders_routes = function(app, db, origins, publicPath) {
|
|
401
399
|
const middleware = middlewareFactory(db);
|
402
400
|
app.post(
|
403
401
|
"/api/orders/create",
|
402
|
+
[
|
403
|
+
middleware.authJwt.verifyToken
|
404
|
+
],
|
404
405
|
controller.create
|
405
406
|
);
|
406
407
|
app.get(
|
@@ -416,6 +417,9 @@ var orders_routes = function(app, db, origins, publicPath) {
|
|
416
417
|
);
|
417
418
|
app.post(
|
418
419
|
"/api/orders/delete",
|
420
|
+
[
|
421
|
+
middleware.authJwt.verifyToken
|
422
|
+
],
|
419
423
|
controller.deleteOrder
|
420
424
|
);
|
421
425
|
};
|
@@ -504,8 +508,8 @@ let CRUD$1 = class CRUD {
|
|
504
508
|
}
|
505
509
|
async read(req, res) {
|
506
510
|
try {
|
507
|
-
let
|
508
|
-
|
511
|
+
let stages = [];
|
512
|
+
stages = [
|
509
513
|
...globalsQuery.getBasicOptions(
|
510
514
|
req.query
|
511
515
|
),
|
@@ -527,10 +531,10 @@ let CRUD$1 = class CRUD {
|
|
527
531
|
),
|
528
532
|
globalsQuery.removeTempPropeties()
|
529
533
|
];
|
530
|
-
const cacheKey = JSON.stringify({ stages
|
534
|
+
const cacheKey = JSON.stringify({ stages });
|
531
535
|
let data = await this.cache.get(cacheKey);
|
532
536
|
if (!data) {
|
533
|
-
data = await this.model.aggregate(
|
537
|
+
data = await this.model.aggregate(stages).exec();
|
534
538
|
await this.cache.set(cacheKey, data);
|
535
539
|
}
|
536
540
|
res.json(data);
|
@@ -456,16 +456,18 @@ const controllerFactory$4 = (db) => {
|
|
456
456
|
const Membership = db.membership;
|
457
457
|
const read = async (req, res2) => {
|
458
458
|
try {
|
459
|
+
let search = req.query.search;
|
460
|
+
let regexPattern = "";
|
461
|
+
if (search) {
|
462
|
+
search = search.replace(/[-\/\\^$*+?.()|[\]{}]/g, "\\$&");
|
463
|
+
const parts = search.split(".");
|
464
|
+
if (parts.length === 2) {
|
465
|
+
regexPattern = parts.map((part) => part.substr(0, part.length - 1) + ".{1}").join("\\.");
|
466
|
+
} else {
|
467
|
+
regexPattern = search.substr(0, search.length - 1) + ".{1}";
|
468
|
+
}
|
469
|
+
}
|
459
470
|
const memberships = await Membership.aggregate([
|
460
|
-
{
|
461
|
-
$match: {
|
462
|
-
...req.query.user && { user: new ObjectId$1(req.query.user) },
|
463
|
-
...req.query.type && { type: req.query.type },
|
464
|
-
...req.query.target && { target: new ObjectId$1(req.query.target) },
|
465
|
-
// ...(req.query.role && { role: req.query.role }),
|
466
|
-
...req.query.role && { role: { $in: req.query.role } }
|
467
|
-
}
|
468
|
-
},
|
469
471
|
{
|
470
472
|
$lookup: {
|
471
473
|
from: "users",
|
@@ -474,6 +476,21 @@ const controllerFactory$4 = (db) => {
|
|
474
476
|
as: "user"
|
475
477
|
}
|
476
478
|
},
|
479
|
+
{
|
480
|
+
$match: {
|
481
|
+
...req.query.user && { user: new ObjectId$1(req.query.user) },
|
482
|
+
...req.query.type && { type: req.query.type },
|
483
|
+
...req.query.target && { target: new ObjectId$1(req.query.target) },
|
484
|
+
...req.query.role && { role: { $in: req.query.role } },
|
485
|
+
...req.query.search && {
|
486
|
+
$or: [
|
487
|
+
{ "user.profile.name": { $regex: regexPattern, $options: "i" } },
|
488
|
+
{ "user.email": { $regex: regexPattern, $options: "i" } },
|
489
|
+
{ "user.phone": { $regex: regexPattern, $options: "i" } }
|
490
|
+
]
|
491
|
+
}
|
492
|
+
}
|
493
|
+
},
|
477
494
|
{
|
478
495
|
$unwind: "$user"
|
479
496
|
}
|
@@ -481,6 +498,7 @@ const controllerFactory$4 = (db) => {
|
|
481
498
|
if (!memberships || memberships.length === 0) {
|
482
499
|
return res2.status(404).send({ errorCode: "MEMBERSHIPS_NOT_FOUND" });
|
483
500
|
}
|
501
|
+
console.log("membership is", memberships[0].user);
|
484
502
|
res2.send(memberships);
|
485
503
|
} catch (err) {
|
486
504
|
console.log(err);
|
@@ -488,7 +506,6 @@ const controllerFactory$4 = (db) => {
|
|
488
506
|
}
|
489
507
|
};
|
490
508
|
const create = async (req, res2) => {
|
491
|
-
console.log(req.body);
|
492
509
|
const newMembership = new Membership({
|
493
510
|
user: req.body.user,
|
494
511
|
type: req.body.type,
|
@@ -1044,6 +1061,10 @@ var invite_model = (db) => {
|
|
1044
1061
|
type: String,
|
1045
1062
|
enum: ["active", "used", "deactivated"],
|
1046
1063
|
default: "active"
|
1064
|
+
},
|
1065
|
+
role: {
|
1066
|
+
type: String,
|
1067
|
+
default: "member"
|
1047
1068
|
}
|
1048
1069
|
}, {
|
1049
1070
|
timestamps: true
|
@@ -455,16 +455,18 @@ const controllerFactory$4 = (db) => {
|
|
455
455
|
const Membership = db.membership;
|
456
456
|
const read = async (req, res2) => {
|
457
457
|
try {
|
458
|
+
let search = req.query.search;
|
459
|
+
let regexPattern = "";
|
460
|
+
if (search) {
|
461
|
+
search = search.replace(/[-\/\\^$*+?.()|[\]{}]/g, "\\$&");
|
462
|
+
const parts = search.split(".");
|
463
|
+
if (parts.length === 2) {
|
464
|
+
regexPattern = parts.map((part) => part.substr(0, part.length - 1) + ".{1}").join("\\.");
|
465
|
+
} else {
|
466
|
+
regexPattern = search.substr(0, search.length - 1) + ".{1}";
|
467
|
+
}
|
468
|
+
}
|
458
469
|
const memberships = await Membership.aggregate([
|
459
|
-
{
|
460
|
-
$match: {
|
461
|
-
...req.query.user && { user: new ObjectId$1(req.query.user) },
|
462
|
-
...req.query.type && { type: req.query.type },
|
463
|
-
...req.query.target && { target: new ObjectId$1(req.query.target) },
|
464
|
-
// ...(req.query.role && { role: req.query.role }),
|
465
|
-
...req.query.role && { role: { $in: req.query.role } }
|
466
|
-
}
|
467
|
-
},
|
468
470
|
{
|
469
471
|
$lookup: {
|
470
472
|
from: "users",
|
@@ -473,6 +475,21 @@ const controllerFactory$4 = (db) => {
|
|
473
475
|
as: "user"
|
474
476
|
}
|
475
477
|
},
|
478
|
+
{
|
479
|
+
$match: {
|
480
|
+
...req.query.user && { user: new ObjectId$1(req.query.user) },
|
481
|
+
...req.query.type && { type: req.query.type },
|
482
|
+
...req.query.target && { target: new ObjectId$1(req.query.target) },
|
483
|
+
...req.query.role && { role: { $in: req.query.role } },
|
484
|
+
...req.query.search && {
|
485
|
+
$or: [
|
486
|
+
{ "user.profile.name": { $regex: regexPattern, $options: "i" } },
|
487
|
+
{ "user.email": { $regex: regexPattern, $options: "i" } },
|
488
|
+
{ "user.phone": { $regex: regexPattern, $options: "i" } }
|
489
|
+
]
|
490
|
+
}
|
491
|
+
}
|
492
|
+
},
|
476
493
|
{
|
477
494
|
$unwind: "$user"
|
478
495
|
}
|
@@ -480,6 +497,7 @@ const controllerFactory$4 = (db) => {
|
|
480
497
|
if (!memberships || memberships.length === 0) {
|
481
498
|
return res2.status(404).send({ errorCode: "MEMBERSHIPS_NOT_FOUND" });
|
482
499
|
}
|
500
|
+
console.log("membership is", memberships[0].user);
|
483
501
|
res2.send(memberships);
|
484
502
|
} catch (err) {
|
485
503
|
console.log(err);
|
@@ -487,7 +505,6 @@ const controllerFactory$4 = (db) => {
|
|
487
505
|
}
|
488
506
|
};
|
489
507
|
const create = async (req, res2) => {
|
490
|
-
console.log(req.body);
|
491
508
|
const newMembership = new Membership({
|
492
509
|
user: req.body.user,
|
493
510
|
type: req.body.type,
|
@@ -1043,6 +1060,10 @@ var invite_model = (db) => {
|
|
1043
1060
|
type: String,
|
1044
1061
|
enum: ["active", "used", "deactivated"],
|
1045
1062
|
default: "active"
|
1063
|
+
},
|
1064
|
+
role: {
|
1065
|
+
type: String,
|
1066
|
+
default: "member"
|
1046
1067
|
}
|
1047
1068
|
}, {
|
1048
1069
|
timestamps: true
|
@@ -1 +1 @@
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),i=require("../Tooltip/Tooltip.vue.cjs"),a={class:"bg-grey pd-medium radius-
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),i=require("../Tooltip/Tooltip.vue.cjs"),a={class:"bg-grey pd-medium radius-big"},c={key:0,class:"mn-b-small flex-v-center flex-nowrap flex"},s={key:0,class:"mn-r-thin t-medium p-big"},u=["onClick"],d=e.createElementVNode("p",{class:"bg-main radius-small t-center i-medium"},"i",-1),m={key:1,class:"w-100"},k={__name:"Block",props:{title:{type:String,default:null},tooltip:{type:String,default:null},actions:{type:Array,default:null},placeholder:{type:String,default:"Nothing here"},options:{type:Object,default:{theme:"white"}}},setup(t){e.useSlots();const r=(n,o={})=>n?n(o).some(l=>Array.isArray(l.children)?!!l.children.length:l.type!==e.Comment):!1;return(n,o)=>(e.openBlock(),e.createElementBlock("div",a,[t.title||t.actions?(e.openBlock(),e.createElementBlock("div",c,[t.title?(e.openBlock(),e.createElementBlock("p",s,e.toDisplayString(t.title),1)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.actions,l=>(e.openBlock(),e.createElementBlock("button",{onClick:l.function,class:e.normalizeClass(["pd-thin button-delete button",l.class||"bg-main radius-small t-center i-medium"])},e.toDisplayString(l.label),11,u))),256)),t.tooltip?(e.openBlock(),e.createBlock(i.default,{key:1,text:t.tooltip},{default:e.withCtx(()=>[d]),_:1},8,["text"])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),r(n.$slots.default)?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("span",m,e.toDisplayString(t.placeholder),1)),e.renderSlot(n.$slots,"default")]))}};exports.default=k;
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import { useSlots as u, openBlock as l, createElementBlock as n, toDisplayString as o, createCommentVNode as r, Fragment as c, renderList as d, normalizeClass as m, createBlock as h, withCtx as f, renderSlot as y, createElementVNode as p, Comment as g } from "vue";
|
2
2
|
import b from "../Tooltip/Tooltip.vue.js";
|
3
|
-
const k = { class: "bg-grey pd-medium radius-
|
3
|
+
const k = { class: "bg-grey pd-medium radius-big" }, C = {
|
4
4
|
key: 0,
|
5
5
|
class: "mn-b-small flex-v-center flex-nowrap flex"
|
6
6
|
}, S = {
|
@@ -1,12 +1,12 @@
|
|
1
|
-
import { ref as v, watchEffect as _, openBlock as t, createElementBlock as
|
2
|
-
import { VueDraggableNext as
|
1
|
+
import { ref as v, watchEffect as _, openBlock as t, createElementBlock as l, createBlock as u, unref as b, withCtx as k, Fragment as V, renderList as E, createElementVNode as w, createVNode as c, createCommentVNode as n } from "vue";
|
2
|
+
import { VueDraggableNext as C } from "../../../../node_modules/vue-draggable-next/dist/vue-draggable-next.esm-bundler.js";
|
3
3
|
import p from "../UploadImageMultiple/UploadImageMultiple.vue.js";
|
4
|
-
import
|
4
|
+
import y from "../../modules/icons/navigation/IconCross.vue.js";
|
5
5
|
import "./EditImages.vue2.js";
|
6
|
-
const
|
6
|
+
const I = { class: "flex-nowrap flex gap-small" }, P = { class: "pos-relative" }, U = ["src"], j = {
|
7
7
|
key: 1,
|
8
8
|
class: "i-extra uppercase flex-center flex radius-small o-hidden br-solid br-main br-2px pd-small"
|
9
|
-
},
|
9
|
+
}, $ = {
|
10
10
|
__name: "EditImages",
|
11
11
|
props: {
|
12
12
|
images: Array,
|
@@ -23,28 +23,28 @@ const y = { class: "flex-nowrap flex gap-small" }, P = { class: "pos-relative" }
|
|
23
23
|
_(() => {
|
24
24
|
e.value = [...a.images];
|
25
25
|
});
|
26
|
-
const
|
26
|
+
const o = () => {
|
27
27
|
f("update:images", e.value);
|
28
|
-
}, i = (
|
29
|
-
e.value = [...e.value, ...
|
30
|
-
}, x = (
|
31
|
-
e.value.splice(
|
28
|
+
}, i = (s) => {
|
29
|
+
e.value = [...e.value, ...s], o();
|
30
|
+
}, x = (s) => {
|
31
|
+
e.value.splice(s, 1), o();
|
32
32
|
};
|
33
|
-
return (
|
34
|
-
e.value.length > 0 ? (t(), u(b(
|
33
|
+
return (s, d) => (t(), l("div", I, [
|
34
|
+
e.value.length > 0 ? (t(), u(b(C), {
|
35
35
|
key: 0,
|
36
36
|
class: "gap-small flex dragArea list-group w-full",
|
37
37
|
modelValue: e.value,
|
38
38
|
"onUpdate:modelValue": d[0] || (d[0] = (r) => e.value = r),
|
39
|
-
onChange:
|
39
|
+
onChange: o
|
40
40
|
}, {
|
41
41
|
default: k(() => [
|
42
|
-
(t(!0),
|
43
|
-
|
42
|
+
(t(!0), l(V, null, E(e.value, (r, h) => (t(), l("div", P, [
|
43
|
+
w("img", {
|
44
44
|
class: "i-extra object-fit-contain bg-black-transp-5 pd-nano radius-small o-hidden",
|
45
|
-
src: (
|
45
|
+
src: (s.FILE_SERVER_URL || "") + r
|
46
46
|
}, null, 8, U),
|
47
|
-
c(
|
47
|
+
c(y, {
|
48
48
|
onClick: (N) => x(h),
|
49
49
|
class: "cursor-pointer pos-absolute t-center flex-center flex radius-extra i-medium bg-red pos-t-10-negative pos-r-10-negative pd-micro"
|
50
50
|
}, null, 8, ["onClick"])
|
@@ -52,7 +52,7 @@ const y = { class: "flex-nowrap flex gap-small" }, P = { class: "pos-relative" }
|
|
52
52
|
]),
|
53
53
|
_: 1
|
54
54
|
}, 8, ["modelValue"])) : n("", !0),
|
55
|
-
e.value.length > 0 ? (t(),
|
55
|
+
e.value.length > 0 ? (t(), l("div", j, [
|
56
56
|
c(p, {
|
57
57
|
"onUpdate:images": i,
|
58
58
|
text: "Add",
|
@@ -75,5 +75,5 @@ const y = { class: "flex-nowrap flex gap-small" }, P = { class: "pos-relative" }
|
|
75
75
|
}
|
76
76
|
};
|
77
77
|
export {
|
78
|
-
|
78
|
+
$ as default
|
79
79
|
};
|
@@ -1,12 +1,12 @@
|
|
1
|
-
import { watch as v, openBlock as s, createBlock as l, Transition as a, withCtx as i, Teleport as y, createElementBlock as P, createVNode as p, createElementVNode as n, mergeProps as k, toDisplayString as g, renderSlot as
|
1
|
+
import { watch as v, openBlock as s, createBlock as l, Transition as a, withCtx as i, Teleport as y, createElementBlock as P, createVNode as p, createElementVNode as n, mergeProps as k, toDisplayString as g, renderSlot as T, normalizeClass as $, createCommentVNode as u } from "vue";
|
2
2
|
import { useRoute as b, useRouter as x } from "vue-router";
|
3
|
-
import { useI18n as
|
4
|
-
import
|
3
|
+
import { useI18n as C } from "vue-i18n";
|
4
|
+
import O from "../../modules/icons/navigation/IconCross.vue.js";
|
5
5
|
import "./Popup.vue2.js";
|
6
6
|
const z = {
|
7
7
|
key: "popup-content",
|
8
8
|
class: "pd-small popup-wrapper"
|
9
|
-
}, B = { class: "mn-b-small" },
|
9
|
+
}, B = { class: "mn-b-small" }, L = {
|
10
10
|
__name: "Popup",
|
11
11
|
props: {
|
12
12
|
isPopupOpen: {
|
@@ -17,14 +17,14 @@ const z = {
|
|
17
17
|
title: String
|
18
18
|
},
|
19
19
|
emits: ["close-popup"],
|
20
|
-
setup(e, { emit:
|
21
|
-
const
|
20
|
+
setup(e, { emit: m }) {
|
21
|
+
const c = e, d = m;
|
22
22
|
function r() {
|
23
23
|
d("close-popup");
|
24
24
|
}
|
25
|
-
return v(() =>
|
25
|
+
return v(() => c.isPopupOpen, (t) => {
|
26
26
|
t ? document.body.classList.add("no-scroll") : document.body.classList.remove("no-scroll");
|
27
|
-
}), b(), x(),
|
27
|
+
}), b(), x(), C({
|
28
28
|
messages: {
|
29
29
|
en: {},
|
30
30
|
ru: {}
|
@@ -48,18 +48,18 @@ const z = {
|
|
48
48
|
class: t.$attrs.class
|
49
49
|
}), [
|
50
50
|
n("h4", B, g(e.title), 1),
|
51
|
-
p(
|
51
|
+
p(O, {
|
52
52
|
onClick: o[0] || (o[0] = (f) => r()),
|
53
53
|
class: "cursor-pointer pos-absolute pos-t-0 pos-r-0 mn-t-semi mn-r-semi hover-scale-1 i-regular z-index-5"
|
54
54
|
}),
|
55
|
-
|
55
|
+
T(t.$slots, "default")
|
56
56
|
], 16)
|
57
57
|
]),
|
58
58
|
_: 3
|
59
59
|
}),
|
60
60
|
n("div", {
|
61
61
|
onClick: o[1] || (o[1] = (f) => r()),
|
62
|
-
class:
|
62
|
+
class: $([{ active: e.isPopupOpen === !0 }, "color-overlay z-index-3"])
|
63
63
|
}, null, 2)
|
64
64
|
])) : u("", !0)
|
65
65
|
])) : u("", !0)
|
@@ -69,5 +69,5 @@ const z = {
|
|
69
69
|
}
|
70
70
|
};
|
71
71
|
export {
|
72
|
-
|
72
|
+
L as default
|
73
73
|
};
|
@@ -1 +1 @@
|
|
1
|
-
"use strict";
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue");require("./Spoiler.vue2.cjs");const n={key:0,class:"spoiler"},a={__name:"Spoiler",props:{status:{type:Boolean,default:!1}},setup(r){const l=r,t=e.ref(!1);return l.status&&(t.value=l.status),(o,s)=>(e.openBlock(),e.createElementBlock("div",null,[e.createElementVNode("div",{onClick:s[0]||(s[0]=u=>t.value=!t.value),class:"flex-v-center flex-nowrap flex"},[e.renderSlot(o.$slots,"header",{isOpen:t.value})]),e.createVNode(e.Transition,{name:"collapse"},{default:e.withCtx(()=>[t.value?(e.openBlock(),e.createElementBlock("div",n,[e.renderSlot(o.$slots,"content")])):e.createCommentVNode("",!0)]),_:3})]))}};exports.default=a;
|