@ozdao/prometheus-framework 0.0.87 → 0.0.89

Sign up to get free protection for your applications and to get access to all the features.
Files changed (102) hide show
  1. package/dist/Breadcrumbs.vue_vue_type_style_index_0_lang-300fcb55.js +1 -0
  2. package/dist/Breadcrumbs.vue_vue_type_style_index_0_lang-afba007a.mjs +1944 -0
  3. package/dist/ButtonFollow-001c4a65.mjs +130 -0
  4. package/dist/ButtonFollow-48043cc7.js +1 -0
  5. package/dist/CardHeader-0677d446.js +1 -0
  6. package/dist/CardHeader-e361dada.mjs +96 -0
  7. package/dist/CardOrganization-51309400.js +1 -0
  8. package/dist/CardOrganization-bacc2ef6.mjs +202 -0
  9. package/dist/Feed-4b28adc5.mjs +423 -0
  10. package/dist/Feed-51e4e232.js +1 -0
  11. package/dist/Feed-5d8d5c21.js +1 -0
  12. package/dist/Feed-76b2997e.mjs +367 -0
  13. package/dist/Feed-dc8b66bf.mjs +367 -0
  14. package/dist/Feed-eeb63363.js +1 -0
  15. package/dist/IconEdit-3028a3b7.js +1 -0
  16. package/dist/IconEdit-8df23653.mjs +205 -0
  17. package/dist/Image-30f04604.js +9 -0
  18. package/dist/Image-6c7584f5.mjs +477 -0
  19. package/dist/Image-6ec294f3.mjs +477 -0
  20. package/dist/Image-9a870c88.js +9 -0
  21. package/dist/PlaceholderUserpic-10fd9026.js +1 -0
  22. package/dist/PlaceholderUserpic-eb9820ce.mjs +28 -0
  23. package/dist/Popup-7c331e1c.js +1 -0
  24. package/dist/Popup-bdf043ba.mjs +76 -0
  25. package/dist/Product-1724d88d.mjs +837 -0
  26. package/dist/Product-a94d8b65.js +7 -0
  27. package/dist/Product-b233e2a3.js +7 -0
  28. package/dist/Product-eb00f35e.mjs +837 -0
  29. package/dist/ProductEdit-57484f1e.mjs +349 -0
  30. package/dist/ProductEdit-61413d02.mjs +349 -0
  31. package/dist/ProductEdit-ef301baa.js +1 -0
  32. package/dist/ProductEdit-fca68ff9.js +1 -0
  33. package/dist/ProfileBlogposts-6704a38c.js +1 -0
  34. package/dist/ProfileBlogposts-775b1cfa.mjs +63 -0
  35. package/dist/ProfileComments-175e42da.js +1 -0
  36. package/dist/ProfileComments-fd7d66bf.mjs +43 -0
  37. package/dist/ProfileEvents-1cfe6858.mjs +55 -0
  38. package/dist/ProfileEvents-4f2a5f00.js +1 -0
  39. package/dist/ProfileEvents-7a51a9e6.mjs +55 -0
  40. package/dist/ProfileEvents-d8e16509.js +1 -0
  41. package/dist/ProfileLikes-20a8a3c9.mjs +43 -0
  42. package/dist/ProfileLikes-b3b1350a.js +1 -0
  43. package/dist/ProfileOrganizations-4b866823.mjs +211 -0
  44. package/dist/ProfileOrganizations-6d3a43e4.js +1 -0
  45. package/dist/Publics-0e44c61e.mjs +122 -0
  46. package/dist/Publics-4e1c14fc.js +1 -0
  47. package/dist/Tab-a243605d.mjs +46 -0
  48. package/dist/UploadImage-6e312c46.mjs +83 -0
  49. package/dist/UploadImage-9e7e7468.js +1 -0
  50. package/dist/auth-2bc18d1e.js +8 -0
  51. package/dist/auth-fefd15a3.mjs +1503 -0
  52. package/dist/auth.client.cjs +1 -1
  53. package/dist/auth.client.js +5 -5
  54. package/dist/auth.validation-4a617c0b.mjs +20 -0
  55. package/dist/auth.validation-78a90fed.js +1 -0
  56. package/dist/community.client.cjs +1 -1
  57. package/dist/community.client.js +206 -222
  58. package/dist/components/Field/Field.vue.d.ts.map +1 -1
  59. package/dist/components/FieldPhone/FieldPhone(script-setup).vue.d.ts +3 -3
  60. package/dist/components/FieldPhone/FieldPhone.vue.d.ts +1 -1
  61. package/dist/events.client.cjs +1 -1
  62. package/dist/events.client.js +332 -312
  63. package/dist/events.server.js +77 -0
  64. package/dist/events.server.mjs +77 -0
  65. package/dist/inputs.validation-14e8e01f.mjs +93 -0
  66. package/dist/main.css +1 -1
  67. package/dist/organizations-1581c013.mjs +121 -0
  68. package/dist/organizations-c455dad7.js +1 -0
  69. package/dist/organizations.client-040ec107.js +3 -0
  70. package/dist/organizations.client-686845be.mjs +3179 -0
  71. package/dist/organizations.client-7937e180.mjs +3037 -0
  72. package/dist/organizations.client-99bfc474.js +3 -0
  73. package/dist/organizations.client.cjs +1 -1
  74. package/dist/organizations.client.js +39 -39
  75. package/dist/organizations.server.js +7 -3
  76. package/dist/organizations.server.mjs +7 -3
  77. package/dist/prometheus-framework.cjs.js +1 -1
  78. package/dist/prometheus-framework.es.js +3 -2
  79. package/dist/style.css +1 -1
  80. package/dist/users.client.cjs +1 -1
  81. package/dist/users.client.js +265 -256
  82. package/dist/users.server.js +2 -2
  83. package/dist/users.server.mjs +2 -2
  84. package/package.json +1 -1
  85. package/src/components/Field/Field.vue +2 -1
  86. package/src/modules/community/components/pages/CreateBlogPost.vue +2 -1
  87. package/src/modules/events/components/blocks/CardEvent.vue +1 -1
  88. package/src/modules/events/components/pages/EditEvent.vue +9 -3
  89. package/src/modules/events/components/pages/Event.vue +43 -4
  90. package/src/modules/events/middlewares/server/index.js +10 -0
  91. package/src/modules/events/middlewares/server/verifyEvent.js +60 -0
  92. package/src/modules/events/routes/events.routes.js +14 -1
  93. package/src/modules/organizations/components/blocks/Socials.vue +16 -3
  94. package/src/modules/organizations/components/pages/OrganizationEdit.vue +39 -15
  95. package/src/modules/organizations/components/sections/DetailsTab.vue +13 -9
  96. package/src/modules/organizations/controllers/organizations.controller.js +1 -1
  97. package/src/modules/organizations/models/organization.model.js +6 -2
  98. package/src/modules/organizations/store/organizations.js +2 -2
  99. package/src/modules/users/components/pages/Profile.vue +26 -11
  100. package/src/modules/users/components/pages/ProfileEdit.vue +28 -10
  101. package/src/modules/users/models/user.model.js +2 -2
  102. package/src/modules/users/store/users.js +1 -2
@@ -2,6 +2,9 @@
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
3
  const _commonjsHelpers = require("./_commonjsHelpers-3b53548e.js");
4
4
  const require$$1 = require("mongoose");
5
+ const index = require("./index-21dfdbd9.js");
6
+ require("jsonwebtoken");
7
+ require("mongodb");
5
8
  const ObjectId = require$$1.Types.ObjectId;
6
9
  const middlewareFactory = (db) => {
7
10
  db.ticket;
@@ -287,9 +290,75 @@ const middlewareFactory = (db) => {
287
290
  };
288
291
  var events_controller = middlewareFactory;
289
292
  const events_controller$1 = /* @__PURE__ */ _commonjsHelpers.getDefaultExportFromCjs(events_controller);
293
+ var verifyEvent;
294
+ var hasRequiredVerifyEvent;
295
+ function requireVerifyEvent() {
296
+ if (hasRequiredVerifyEvent)
297
+ return verifyEvent;
298
+ hasRequiredVerifyEvent = 1;
299
+ const middlewareFactory2 = (db) => {
300
+ const Event = db.event;
301
+ const checkEventExistOrNot = async (req, res, next) => {
302
+ try {
303
+ const url = req.body.url ? req.body.url : req.body.name.toLowerCase().replace(/ /g, "-").replace(/[^\w-]+/g, "");
304
+ if (!req.body._id) {
305
+ const event = await Event.findOne({ url });
306
+ if (event) {
307
+ res.status(400).send({ errorCode: "EVENT_URL_ALREADY_IN_USE", accessToken: null });
308
+ return;
309
+ }
310
+ next();
311
+ return;
312
+ }
313
+ const updatingEventId = req.body._id;
314
+ const existingEvent = await Event.findById(updatingEventId);
315
+ if (!existingEvent) {
316
+ res.status(404).send({ errorCode: "EVENT_NOT_FOUND", accessToken: null });
317
+ return;
318
+ }
319
+ if (existingEvent.url !== url) {
320
+ const event = await Event.findOne({ url });
321
+ if (event) {
322
+ res.status(400).send({ errorCode: "EVENT_URL_ALREADY_IN_USE", accessToken: null });
323
+ return;
324
+ }
325
+ }
326
+ next();
327
+ } catch (err) {
328
+ console.log(err);
329
+ res.status(500).send({ message: err });
330
+ }
331
+ };
332
+ const checkNameNotEmpty = (req, res, next) => {
333
+ if (!req.body.name || req.body.name.trim() === "") {
334
+ res.status(400).send({ errorCode: "NAME_CANNOT_BE_EMPTY", accessToken: null });
335
+ return;
336
+ }
337
+ next();
338
+ };
339
+ return {
340
+ checkEventExistOrNot,
341
+ // Изменено с checkBlogpostExistOrNot на checkEventExistOrNot
342
+ checkNameNotEmpty
343
+ };
344
+ };
345
+ verifyEvent = middlewareFactory2;
346
+ return verifyEvent;
347
+ }
348
+ const middlewareIndexFactory = (db) => {
349
+ const verifyEvent2 = requireVerifyEvent()(db);
350
+ return {
351
+ verifyEvent: verifyEvent2
352
+ };
353
+ };
354
+ var server = middlewareIndexFactory;
290
355
  const controllerFactory$2 = events_controller;
356
+ const middlewareFactoryGlobal = index.server;
357
+ const middlewareFactoryEvents = server;
291
358
  var events_routes = function(app, db) {
292
359
  const controller = controllerFactory$2(db);
360
+ middlewareFactoryGlobal(db);
361
+ const { verifyEvent: verifyEvent2 } = middlewareFactoryEvents(db);
293
362
  app.use(function(req, res, next) {
294
363
  res.header(
295
364
  "Access-Control-Allow-Headers",
@@ -304,10 +373,18 @@ var events_routes = function(app, db) {
304
373
  );
305
374
  app.post(
306
375
  "/api/events/create",
376
+ [
377
+ verifyEvent2.checkNameNotEmpty,
378
+ verifyEvent2.checkEventExistOrNot
379
+ ],
307
380
  controller.create
308
381
  );
309
382
  app.post(
310
383
  "/api/events/update",
384
+ [
385
+ verifyEvent2.checkNameNotEmpty,
386
+ verifyEvent2.checkEventExistOrNot
387
+ ],
311
388
  controller.update
312
389
  );
313
390
  app.delete(
@@ -1,5 +1,8 @@
1
1
  import { g as getDefaultExportFromCjs } from "./_commonjsHelpers-83b1d755.mjs";
2
2
  import require$$1 from "mongoose";
3
+ import { s as server$1 } from "./index-fa8d5df4.mjs";
4
+ import "jsonwebtoken";
5
+ import "mongodb";
3
6
  const ObjectId = require$$1.Types.ObjectId;
4
7
  const middlewareFactory = (db) => {
5
8
  db.ticket;
@@ -285,9 +288,75 @@ const middlewareFactory = (db) => {
285
288
  };
286
289
  var events_controller = middlewareFactory;
287
290
  const events_controller$1 = /* @__PURE__ */ getDefaultExportFromCjs(events_controller);
291
+ var verifyEvent;
292
+ var hasRequiredVerifyEvent;
293
+ function requireVerifyEvent() {
294
+ if (hasRequiredVerifyEvent)
295
+ return verifyEvent;
296
+ hasRequiredVerifyEvent = 1;
297
+ const middlewareFactory2 = (db) => {
298
+ const Event = db.event;
299
+ const checkEventExistOrNot = async (req, res, next) => {
300
+ try {
301
+ const url = req.body.url ? req.body.url : req.body.name.toLowerCase().replace(/ /g, "-").replace(/[^\w-]+/g, "");
302
+ if (!req.body._id) {
303
+ const event = await Event.findOne({ url });
304
+ if (event) {
305
+ res.status(400).send({ errorCode: "EVENT_URL_ALREADY_IN_USE", accessToken: null });
306
+ return;
307
+ }
308
+ next();
309
+ return;
310
+ }
311
+ const updatingEventId = req.body._id;
312
+ const existingEvent = await Event.findById(updatingEventId);
313
+ if (!existingEvent) {
314
+ res.status(404).send({ errorCode: "EVENT_NOT_FOUND", accessToken: null });
315
+ return;
316
+ }
317
+ if (existingEvent.url !== url) {
318
+ const event = await Event.findOne({ url });
319
+ if (event) {
320
+ res.status(400).send({ errorCode: "EVENT_URL_ALREADY_IN_USE", accessToken: null });
321
+ return;
322
+ }
323
+ }
324
+ next();
325
+ } catch (err) {
326
+ console.log(err);
327
+ res.status(500).send({ message: err });
328
+ }
329
+ };
330
+ const checkNameNotEmpty = (req, res, next) => {
331
+ if (!req.body.name || req.body.name.trim() === "") {
332
+ res.status(400).send({ errorCode: "NAME_CANNOT_BE_EMPTY", accessToken: null });
333
+ return;
334
+ }
335
+ next();
336
+ };
337
+ return {
338
+ checkEventExistOrNot,
339
+ // Изменено с checkBlogpostExistOrNot на checkEventExistOrNot
340
+ checkNameNotEmpty
341
+ };
342
+ };
343
+ verifyEvent = middlewareFactory2;
344
+ return verifyEvent;
345
+ }
346
+ const middlewareIndexFactory = (db) => {
347
+ const verifyEvent2 = requireVerifyEvent()(db);
348
+ return {
349
+ verifyEvent: verifyEvent2
350
+ };
351
+ };
352
+ var server = middlewareIndexFactory;
288
353
  const controllerFactory$2 = events_controller;
354
+ const middlewareFactoryGlobal = server$1;
355
+ const middlewareFactoryEvents = server;
289
356
  var events_routes = function(app, db) {
290
357
  const controller = controllerFactory$2(db);
358
+ middlewareFactoryGlobal(db);
359
+ const { verifyEvent: verifyEvent2 } = middlewareFactoryEvents(db);
291
360
  app.use(function(req, res, next) {
292
361
  res.header(
293
362
  "Access-Control-Allow-Headers",
@@ -302,10 +371,18 @@ var events_routes = function(app, db) {
302
371
  );
303
372
  app.post(
304
373
  "/api/events/create",
374
+ [
375
+ verifyEvent2.checkNameNotEmpty,
376
+ verifyEvent2.checkEventExistOrNot
377
+ ],
305
378
  controller.create
306
379
  );
307
380
  app.post(
308
381
  "/api/events/update",
382
+ [
383
+ verifyEvent2.checkNameNotEmpty,
384
+ verifyEvent2.checkEventExistOrNot
385
+ ],
309
386
  controller.update
310
387
  );
311
388
  app.delete(
@@ -0,0 +1,93 @@
1
+ import { i as a } from "./globals-96ba60e4.mjs";
2
+ const n = {
3
+ ru: {
4
+ validation: {
5
+ length: "Содержимое должно быть не менее 1 символа.",
6
+ maxLength: "Содержимое не должно превышать {maxLength} символов.",
7
+ phone: "Неверный формат номера",
8
+ email: "Неверный формат email",
9
+ password: {
10
+ minLength: "Пароль должен быть больше 8 символов",
11
+ lowercase: "Должен быть символ в нижнем регистре",
12
+ uppercase: "Должен быть символ в верхнем регистре",
13
+ number: "Должна быть 1 цифра",
14
+ specialChar: "Должен быть 1 специальный символ"
15
+ }
16
+ }
17
+ },
18
+ en: {
19
+ validation: {
20
+ length: "Content must be at least 1 character long.",
21
+ maxLength: "Content should not exceed {maxLength} characters.",
22
+ phone: "Invalid number format",
23
+ email: "Invalid email format",
24
+ password: {
25
+ minLength: "Password must be longer than 8 characters",
26
+ lowercase: "Must contain a lowercase character",
27
+ uppercase: "Must contain an uppercase character",
28
+ number: "Must contain at least 1 digit",
29
+ specialChar: "Must contain at least 1 special character"
30
+ }
31
+ }
32
+ }
33
+ };
34
+ a.global.mergeLocaleMessage("ru", n.ru);
35
+ a.global.mergeLocaleMessage("en", n.en);
36
+ function i(e) {
37
+ return e.length < 1 ? {
38
+ status: !1,
39
+ message: a.global.t("validation.length")
40
+ } : {
41
+ status: !0,
42
+ message: null
43
+ };
44
+ }
45
+ function u(e) {
46
+ return console.log(e), console.log(e.valid), e.valid ? {
47
+ status: !0,
48
+ message: null
49
+ } : {
50
+ status: !1,
51
+ message: a.global.t("validation.phone")
52
+ };
53
+ }
54
+ function g(e) {
55
+ return /^[\w-\.]+@([\w-]+\.)+[\w-]{2,12}$/.test(e) ? {
56
+ status: !0,
57
+ message: null
58
+ } : {
59
+ status: !1,
60
+ message: a.global.t("validation.email")
61
+ };
62
+ }
63
+ function c(e) {
64
+ return e.length < 8 ? {
65
+ status: !1,
66
+ message: a.global.t("validation.password.minLength")
67
+ } : {
68
+ status: !0,
69
+ message: null
70
+ };
71
+ }
72
+ async function m(e, t, s, o) {
73
+ if (s) {
74
+ const l = t(s);
75
+ if (!l.status)
76
+ throw e.value = l, setTimeout(() => {
77
+ e.value = null;
78
+ }, 3e3), new Error(o);
79
+ } else
80
+ throw e.value = {
81
+ status: !1,
82
+ message: a.global.t("validation.length")
83
+ }, setTimeout(() => {
84
+ e.value = null;
85
+ }, 3e3), new Error(a.global.t("validation.length"));
86
+ }
87
+ export {
88
+ i as a,
89
+ c as b,
90
+ u as c,
91
+ g as d,
92
+ m as v
93
+ };