@ozdao/prometheus-framework 0.0.86 → 0.0.88

Sign up to get free protection for your applications and to get access to all the features.
Files changed (101) hide show
  1. package/dist/Breadcrumbs.vue_vue_type_style_index_0_lang-15e71ec4.js +1 -0
  2. package/dist/Breadcrumbs.vue_vue_type_style_index_0_lang-cdbafd07.mjs +1944 -0
  3. package/dist/CardOrganization-ee5c34ab.js +1 -0
  4. package/dist/CardOrganization-f70bd169.mjs +202 -0
  5. package/dist/Comments-63f154a6.js +9 -0
  6. package/dist/Comments-c5afa4d6.mjs +459 -0
  7. package/dist/Feed-51e4e232.js +1 -0
  8. package/dist/Feed-8fd41524.js +1 -0
  9. package/dist/Feed-dc8b66bf.mjs +367 -0
  10. package/dist/Feed-ecf37814.mjs +367 -0
  11. package/dist/IconEdit-736c89be.js +1 -0
  12. package/dist/IconEdit-e9fd4c6c.mjs +21 -0
  13. package/dist/Image-6c7584f5.mjs +477 -0
  14. package/dist/Image-9a870c88.js +9 -0
  15. package/dist/Popup-105ef2c3.js +1 -0
  16. package/dist/Popup-82fb2c8a.mjs +76 -0
  17. package/dist/Product-1724d88d.mjs +837 -0
  18. package/dist/Product-2f3d592f.mjs +837 -0
  19. package/dist/Product-2fbf9d99.js +7 -0
  20. package/dist/Product-a94d8b65.js +7 -0
  21. package/dist/ProductEdit-20709821.mjs +349 -0
  22. package/dist/ProductEdit-57484f1e.mjs +349 -0
  23. package/dist/ProductEdit-a81d13b9.js +1 -0
  24. package/dist/ProductEdit-ef301baa.js +1 -0
  25. package/dist/ProfileBlogposts-eca9916c.js +1 -0
  26. package/dist/ProfileBlogposts-fb014bc6.mjs +63 -0
  27. package/dist/ProfileComments-58094a50.mjs +43 -0
  28. package/dist/ProfileComments-b919f021.js +1 -0
  29. package/dist/ProfileEvents-05485e20.js +1 -0
  30. package/dist/ProfileEvents-1cfe6858.mjs +55 -0
  31. package/dist/ProfileEvents-5d206e3d.mjs +55 -0
  32. package/dist/ProfileEvents-d8e16509.js +1 -0
  33. package/dist/ProfileLikes-2f3a4488.js +1 -0
  34. package/dist/ProfileLikes-b5ac7f48.mjs +43 -0
  35. package/dist/ProfileOrganizations-0b76e38f.js +1 -0
  36. package/dist/ProfileOrganizations-32ab1e30.mjs +211 -0
  37. package/dist/Publics-3f277c17.js +1 -0
  38. package/dist/Publics-9ebffff1.mjs +122 -0
  39. package/dist/Tab-58cd105f.mjs +46 -0
  40. package/dist/Tab-6f0a4909.js +1 -0
  41. package/dist/UploadImage-441e8526.js +1 -0
  42. package/dist/UploadImage-ff8f9a0c.mjs +83 -0
  43. package/dist/auth.client.cjs +2 -2
  44. package/dist/auth.client.js +60 -40
  45. package/dist/community.client.cjs +1 -9
  46. package/dist/community.client.js +361 -750
  47. package/dist/community.server.js +16 -4
  48. package/dist/community.server.mjs +16 -4
  49. package/dist/events.client.cjs +1 -1
  50. package/dist/events.client.js +442 -321
  51. package/dist/events.server.js +96 -2
  52. package/dist/events.server.mjs +96 -2
  53. package/dist/inputs.validation-24ae76b9.js +1 -0
  54. package/dist/modules/constructor/components/elements/Bullets.vue.d.ts +15 -0
  55. package/dist/modules/constructor/components/elements/Caption.vue.d.ts +15 -0
  56. package/dist/modules/constructor/components/elements/H2.vue.d.ts +16 -0
  57. package/dist/modules/constructor/components/elements/Image.vue.d.ts +8 -0
  58. package/dist/modules/constructor/components/elements/ImageUpload.vue.d.ts +9 -0
  59. package/dist/modules/constructor/components/elements/Textarea.vue.d.ts +12 -0
  60. package/dist/modules/constructor/components/sections/Constructor.vue.d.ts +7 -0
  61. package/dist/modules/events/components/sections/Feed.vue.d.ts +1 -0
  62. package/dist/organizations-1b4c84ee.mjs +121 -0
  63. package/dist/organizations-af43bda4.js +1 -0
  64. package/dist/organizations.client-253c8068.mjs +3179 -0
  65. package/dist/organizations.client-686845be.mjs +3179 -0
  66. package/dist/organizations.client-99bfc474.js +3 -0
  67. package/dist/organizations.client-c60d7659.js +3 -0
  68. package/dist/organizations.client.cjs +1 -3
  69. package/dist/organizations.client.js +49 -3025
  70. package/dist/style.css +1 -1
  71. package/dist/users.client.cjs +1 -1
  72. package/dist/users.client.js +10 -10
  73. package/package.json +1 -1
  74. package/src/modules/auth/router/auth.js +28 -7
  75. package/src/modules/community/community.client.js +1 -12
  76. package/src/modules/community/components/pages/BlogPost.vue +1 -1
  77. package/src/modules/community/components/pages/CreateBlogPost.vue +8 -151
  78. package/src/modules/community/middlewares/server/verifyBlogpost.js +24 -11
  79. package/src/modules/{community → constructor}/components/elements/Textarea.vue +3 -11
  80. package/src/modules/constructor/components/sections/Constructor.vue +167 -0
  81. package/src/modules/events/components/blocks/CardEvent.vue +15 -7
  82. package/src/modules/events/components/pages/EditEvent.vue +233 -133
  83. package/src/modules/events/components/pages/Event.vue +43 -4
  84. package/src/modules/events/components/sections/Feed.vue +7 -1
  85. package/src/modules/events/controllers/events.controller.js +9 -0
  86. package/src/modules/events/controllers/tickets.controller.js +2 -1
  87. package/src/modules/events/middlewares/server/index.js +10 -0
  88. package/src/modules/events/middlewares/server/verifyEvent.js +60 -0
  89. package/src/modules/events/models/event.model.js +10 -0
  90. package/src/modules/events/routes/events.routes.js +14 -1
  91. package/src/modules/events/store/events.js +15 -19
  92. package/src/modules/organizations/components/blocks/CardOrganization.vue +1 -3
  93. package/src/modules/organizations/components/sections/Publics.vue +2 -3
  94. package/src/modules/organizations/organizations.client.js +0 -2
  95. package/src/modules/users/components/pages/ProfileEvents.vue +3 -3
  96. package/src/modules/organizations/components/blocks/CardOrganizationSocial.vue +0 -46
  97. /package/src/modules/{community → constructor}/components/elements/Bullets.vue +0 -0
  98. /package/src/modules/{community → constructor}/components/elements/Caption.vue +0 -0
  99. /package/src/modules/{community → constructor}/components/elements/H2.vue +0 -0
  100. /package/src/modules/{community → constructor}/components/elements/Image.vue +0 -0
  101. /package/src/modules/{community → constructor}/components/elements/ImageUpload.vue +0 -0
@@ -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;
@@ -83,7 +86,8 @@ const middlewareFactory = (db) => {
83
86
  const matchConditions = [
84
87
  ...dateConditions.length > 0 ? [{ $and: dateConditions }] : [],
85
88
  ...req.query.url ? [{ url: req.query.url }] : [],
86
- ...req.query.owner ? [{ "owner.target": new ObjectId(req.query.owner) }] : []
89
+ ...req.query.owner ? [{ "owner.target": new ObjectId(req.query.owner) }] : [],
90
+ ...req.query.creator ? [{ "creator.target": new ObjectId(req.query.creator) }] : []
87
91
  ];
88
92
  const matchStage = matchConditions.length > 0 ? { $match: { $and: matchConditions } } : null;
89
93
  console.log(dateConditions);
@@ -194,6 +198,7 @@ const middlewareFactory = (db) => {
194
198
  url: 1,
195
199
  cover: 1,
196
200
  name: 1,
201
+ status: 1,
197
202
  description: 1,
198
203
  content: 1,
199
204
  owner: 1,
@@ -241,12 +246,15 @@ const middlewareFactory = (db) => {
241
246
  };
242
247
  const create = async (req, res) => {
243
248
  try {
249
+ delete req.body._id;
250
+ req.body.url = req.body.name.toLowerCase().replace(/ /g, "-").replace(/[^\w-]+/g, "");
244
251
  const event = await Event.create(req.body);
245
252
  if (!event) {
246
253
  return res.status(404).send({ message: "Event is not created." });
247
254
  }
248
255
  res.status(200).send(event);
249
256
  } catch (err) {
257
+ console.log(err);
250
258
  return res.status(500).send({ message: err.message });
251
259
  }
252
260
  };
@@ -269,6 +277,7 @@ const middlewareFactory = (db) => {
269
277
  }
270
278
  res.status(200).send(event);
271
279
  } catch (err) {
280
+ console.log(err);
272
281
  return res.status(500).send({ message: err.message });
273
282
  }
274
283
  };
@@ -281,9 +290,75 @@ const middlewareFactory = (db) => {
281
290
  };
282
291
  var events_controller = middlewareFactory;
283
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;
284
355
  const controllerFactory$2 = events_controller;
356
+ const middlewareFactoryGlobal = index.server;
357
+ const middlewareFactoryEvents = server;
285
358
  var events_routes = function(app, db) {
286
359
  const controller = controllerFactory$2(db);
360
+ middlewareFactoryGlobal(db);
361
+ const { verifyEvent: verifyEvent2 } = middlewareFactoryEvents(db);
287
362
  app.use(function(req, res, next) {
288
363
  res.header(
289
364
  "Access-Control-Allow-Headers",
@@ -298,10 +373,18 @@ var events_routes = function(app, db) {
298
373
  );
299
374
  app.post(
300
375
  "/api/events/create",
376
+ [
377
+ verifyEvent2.checkNameNotEmpty,
378
+ verifyEvent2.checkEventExistOrNot
379
+ ],
301
380
  controller.create
302
381
  );
303
382
  app.post(
304
383
  "/api/events/update",
384
+ [
385
+ verifyEvent2.checkNameNotEmpty,
386
+ verifyEvent2.checkEventExistOrNot
387
+ ],
305
388
  controller.update
306
389
  );
307
390
  app.delete(
@@ -369,9 +452,10 @@ const controllerFactory$1 = (db) => {
369
452
  if (!ticket) {
370
453
  return res.status(404).send({ errorCode: "TICKET_NOT_FOUND" });
371
454
  }
372
- await ticket.remove();
455
+ await Ticket.deleteOne({ _id: ticket._id });
373
456
  res.status(200).send(ticket);
374
457
  } catch (error) {
458
+ console.log(error);
375
459
  res.status(500).send({ errorCode: "SERVER_ERROR" });
376
460
  }
377
461
  };
@@ -425,6 +509,12 @@ var event_model = (mongoose) => {
425
509
  type: String,
426
510
  required: true
427
511
  },
512
+ status: {
513
+ type: String,
514
+ enum: ["draft", "published", "removed"],
515
+ default: "draft",
516
+ required: true
517
+ },
428
518
  description: {
429
519
  type: String,
430
520
  required: true
@@ -461,6 +551,10 @@ var event_model = (mongoose) => {
461
551
  }
462
552
  },
463
553
  creator: {
554
+ hidden: {
555
+ type: Boolean,
556
+ required: true
557
+ },
464
558
  type: {
465
559
  type: String,
466
560
  required: true
@@ -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;
@@ -81,7 +84,8 @@ const middlewareFactory = (db) => {
81
84
  const matchConditions = [
82
85
  ...dateConditions.length > 0 ? [{ $and: dateConditions }] : [],
83
86
  ...req.query.url ? [{ url: req.query.url }] : [],
84
- ...req.query.owner ? [{ "owner.target": new ObjectId(req.query.owner) }] : []
87
+ ...req.query.owner ? [{ "owner.target": new ObjectId(req.query.owner) }] : [],
88
+ ...req.query.creator ? [{ "creator.target": new ObjectId(req.query.creator) }] : []
85
89
  ];
86
90
  const matchStage = matchConditions.length > 0 ? { $match: { $and: matchConditions } } : null;
87
91
  console.log(dateConditions);
@@ -192,6 +196,7 @@ const middlewareFactory = (db) => {
192
196
  url: 1,
193
197
  cover: 1,
194
198
  name: 1,
199
+ status: 1,
195
200
  description: 1,
196
201
  content: 1,
197
202
  owner: 1,
@@ -239,12 +244,15 @@ const middlewareFactory = (db) => {
239
244
  };
240
245
  const create = async (req, res) => {
241
246
  try {
247
+ delete req.body._id;
248
+ req.body.url = req.body.name.toLowerCase().replace(/ /g, "-").replace(/[^\w-]+/g, "");
242
249
  const event = await Event.create(req.body);
243
250
  if (!event) {
244
251
  return res.status(404).send({ message: "Event is not created." });
245
252
  }
246
253
  res.status(200).send(event);
247
254
  } catch (err) {
255
+ console.log(err);
248
256
  return res.status(500).send({ message: err.message });
249
257
  }
250
258
  };
@@ -267,6 +275,7 @@ const middlewareFactory = (db) => {
267
275
  }
268
276
  res.status(200).send(event);
269
277
  } catch (err) {
278
+ console.log(err);
270
279
  return res.status(500).send({ message: err.message });
271
280
  }
272
281
  };
@@ -279,9 +288,75 @@ const middlewareFactory = (db) => {
279
288
  };
280
289
  var events_controller = middlewareFactory;
281
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;
282
353
  const controllerFactory$2 = events_controller;
354
+ const middlewareFactoryGlobal = server$1;
355
+ const middlewareFactoryEvents = server;
283
356
  var events_routes = function(app, db) {
284
357
  const controller = controllerFactory$2(db);
358
+ middlewareFactoryGlobal(db);
359
+ const { verifyEvent: verifyEvent2 } = middlewareFactoryEvents(db);
285
360
  app.use(function(req, res, next) {
286
361
  res.header(
287
362
  "Access-Control-Allow-Headers",
@@ -296,10 +371,18 @@ var events_routes = function(app, db) {
296
371
  );
297
372
  app.post(
298
373
  "/api/events/create",
374
+ [
375
+ verifyEvent2.checkNameNotEmpty,
376
+ verifyEvent2.checkEventExistOrNot
377
+ ],
299
378
  controller.create
300
379
  );
301
380
  app.post(
302
381
  "/api/events/update",
382
+ [
383
+ verifyEvent2.checkNameNotEmpty,
384
+ verifyEvent2.checkEventExistOrNot
385
+ ],
303
386
  controller.update
304
387
  );
305
388
  app.delete(
@@ -367,9 +450,10 @@ const controllerFactory$1 = (db) => {
367
450
  if (!ticket) {
368
451
  return res.status(404).send({ errorCode: "TICKET_NOT_FOUND" });
369
452
  }
370
- await ticket.remove();
453
+ await Ticket.deleteOne({ _id: ticket._id });
371
454
  res.status(200).send(ticket);
372
455
  } catch (error) {
456
+ console.log(error);
373
457
  res.status(500).send({ errorCode: "SERVER_ERROR" });
374
458
  }
375
459
  };
@@ -423,6 +507,12 @@ var event_model = (mongoose) => {
423
507
  type: String,
424
508
  required: true
425
509
  },
510
+ status: {
511
+ type: String,
512
+ enum: ["draft", "published", "removed"],
513
+ default: "draft",
514
+ required: true
515
+ },
426
516
  description: {
427
517
  type: String,
428
518
  required: true
@@ -459,6 +549,10 @@ var event_model = (mongoose) => {
459
549
  }
460
550
  },
461
551
  creator: {
552
+ hidden: {
553
+ type: Boolean,
554
+ required: true
555
+ },
462
556
  type: {
463
557
  type: String,
464
558
  required: true
@@ -0,0 +1 @@
1
+ "use strict";const a=require("./globals-928eb13c.js");const l={ru:{validation:{length:"Содержимое должно быть не менее 1 символа.",maxLength:"Содержимое не должно превышать {maxLength} символов.",phone:"Неверный формат номера",email:"Неверный формат email",password:{minLength:"Пароль должен быть больше 8 символов",lowercase:"Должен быть символ в нижнем регистре",uppercase:"Должен быть символ в верхнем регистре",number:"Должна быть 1 цифра",specialChar:"Должен быть 1 специальный символ"}}},en:{validation:{length:"Content must be at least 1 character long.",maxLength:"Content should not exceed {maxLength} characters.",phone:"Invalid number format",email:"Invalid email format",password:{minLength:"Password must be longer than 8 characters",lowercase:"Must contain a lowercase character",uppercase:"Must contain an uppercase character",number:"Must contain at least 1 digit",specialChar:"Must contain at least 1 special character"}}}};a.i18n.global.mergeLocaleMessage("ru",l.ru);a.i18n.global.mergeLocaleMessage("en",l.en);function o(e){return e.length<1?{status:!1,message:a.i18n.global.t("validation.length")}:{status:!0,message:null}}function r(e){return console.log(e),console.log(e.valid),e.valid?{status:!0,message:null}:{status:!1,message:a.i18n.global.t("validation.phone")}}function u(e){return/^[\w-\.]+@([\w-]+\.)+[\w-]{2,12}$/.test(e)?{status:!0,message:null}:{status:!1,message:a.i18n.global.t("validation.email")}}function g(e){return e.length<8?{status:!1,message:a.i18n.global.t("validation.password.minLength")}:{status:!0,message:null}}async function c(e,t,n,i){if(n){const s=t(n);if(!s.status)throw e.value=s,setTimeout(()=>{e.value=null},3e3),new Error(i)}else throw e.value={status:!1,message:a.i18n.global.t("validation.length")},setTimeout(()=>{e.value=null},3e3),new Error(a.i18n.global.t("validation.length"))}exports.validateEmail=u;exports.validateInputs=c;exports.validateLength=o;exports.validatePassword=g;exports.validatePhone=r;
@@ -0,0 +1,15 @@
1
+ declare const _default: import("vue").DefineComponent<{}, {
2
+ $props: {
3
+ readonly ref?: any;
4
+ readonly label?: any;
5
+ readonly textarea?: any;
6
+ readonly placeholder?: any;
7
+ readonly index?: any;
8
+ readonly value?: any;
9
+ readonly content?: any;
10
+ readonly prop?: any;
11
+ readonly obj?: any;
12
+ };
13
+ $emit: (event: "focus" | "deleteBlock" | "addBlock", ...args: any[]) => void;
14
+ }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
15
+ export default _default;
@@ -0,0 +1,15 @@
1
+ declare const _default: import("vue").DefineComponent<{}, {
2
+ $props: {
3
+ readonly ref?: any;
4
+ readonly label?: any;
5
+ readonly textarea?: any;
6
+ readonly placeholder?: any;
7
+ readonly index?: any;
8
+ readonly value?: any;
9
+ readonly content?: any;
10
+ readonly prop?: any;
11
+ readonly obj?: any;
12
+ };
13
+ $emit: (event: "focus" | "deleteBlock" | "addBlock", ...args: any[]) => void;
14
+ }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
15
+ export default _default;
@@ -0,0 +1,16 @@
1
+ declare const _default: import("vue").DefineComponent<{}, {
2
+ $props: {
3
+ readonly ref?: any;
4
+ readonly label?: any;
5
+ readonly textarea?: any;
6
+ readonly placeholder?: any;
7
+ readonly index?: any;
8
+ readonly value?: any;
9
+ readonly content?: any;
10
+ readonly prop?: any;
11
+ readonly obj?: any;
12
+ readonly setFocus?: any;
13
+ };
14
+ $emit: (event: "focus" | "deleteBlock" | "addBlock" | "updateBlock", ...args: any[]) => void;
15
+ }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
16
+ export default _default;
@@ -0,0 +1,8 @@
1
+ declare const _default: import("vue").DefineComponent<{}, {
2
+ $props: {
3
+ readonly label?: any;
4
+ readonly value?: any;
5
+ readonly prop?: any;
6
+ };
7
+ }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
8
+ export default _default;
@@ -0,0 +1,9 @@
1
+ declare const _default: import("vue").DefineComponent<{}, {
2
+ $props: {
3
+ readonly label?: any;
4
+ readonly value?: any;
5
+ readonly prop?: any;
6
+ };
7
+ $emit: (event: "input" | "updateBlock", ...args: any[]) => void;
8
+ }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
9
+ export default _default;
@@ -0,0 +1,12 @@
1
+ declare const _default: import("vue").DefineComponent<{}, {
2
+ $props: {
3
+ readonly placeholder?: any;
4
+ readonly index?: any;
5
+ readonly value?: any;
6
+ readonly content?: any;
7
+ readonly prop?: any;
8
+ readonly setFocus?: any;
9
+ };
10
+ $emit: (event: "focus" | "deleteBlock" | "addBlock" | "updateBlock", ...args: any[]) => void;
11
+ }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
12
+ export default _default;
@@ -0,0 +1,7 @@
1
+ declare const _default: import("vue").DefineComponent<{}, {
2
+ $props: {
3
+ readonly content?: any;
4
+ };
5
+ $emit: (event: "update", ...args: any[]) => void;
6
+ }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
7
+ export default _default;
@@ -1,6 +1,7 @@
1
1
  declare const _default: import("vue").DefineComponent<{}, {
2
2
  $props: {
3
3
  readonly owner?: string | undefined;
4
+ readonly creator?: string | undefined;
4
5
  readonly user?: string | number | undefined;
5
6
  readonly selectedDate?: string | undefined;
6
7
  readonly status?: string | undefined;
@@ -0,0 +1,121 @@
1
+ import { a as i, C as m } from "./auth-35ef1791.mjs";
2
+ import { reactive as u, watch as d } from "vue";
3
+ import { s as c } from "./globals-96ba60e4.mjs";
4
+ const t = i.create({ baseURL: process.env.API_URL, withCredentials: !0 }), s = u({
5
+ all: [],
6
+ current: {
7
+ _id: null,
8
+ profile: {
9
+ tags: [],
10
+ photo: "",
11
+ name: "",
12
+ description: ""
13
+ },
14
+ structure: [],
15
+ owner: null,
16
+ types: "",
17
+ contacts: {
18
+ email: "",
19
+ website: "",
20
+ phone: "",
21
+ address: ""
22
+ },
23
+ social: {
24
+ telegram: "",
25
+ line: "",
26
+ facebook: "",
27
+ instagram: ""
28
+ },
29
+ rating: {
30
+ popularity: 0,
31
+ median: 0,
32
+ amount: 0
33
+ }
34
+ }
35
+ }), g = {
36
+ // Create
37
+ async create(a, e) {
38
+ a.owner = e;
39
+ try {
40
+ const r = await t.post("/api/organizations/create", a);
41
+ return console.log("Organization created successfully"), s.current = r.data, r.data;
42
+ } catch (r) {
43
+ throw console.log("Organization creation failed"), c(r), r;
44
+ }
45
+ },
46
+ // Read
47
+ async read(a = {}) {
48
+ console.log(a), a.params = a.params || {}, a.location && (a.params.location = a.location), a.country && (a.params.country = a.country), a.state && (a.params.state = a.state), a.city && (a.params.city = a.city), a.categories && (a.params.categories = a.categories), a.prices && (a.params.prices = a.prices), a.delivery && (a.params.delivery = a.delivery), a._id && (a.params = a.params || {}, a.params._id = a._id), a.types && (a.params = a.params || [], a.params.types = a.types), a.owner && (a.params = a.params || {}, a.params.owner = a.owner), a.user && (a.params = a.params || {}, a.params.user = a.user), a.member && (a.params = a.params || {}, a.params.member = a.member), a.subscriber && (a.params = a.params || {}, a.params.subscriber = a.subscriber), a.postable && (a.params = a.params || {}, a.params.postable = a.postable), a.params = a.params || {}, a.params.skip = a.skip || 0, a.params.limit = a.limit || 9, a.params.sortParam = a.sort;
49
+ try {
50
+ console.log("Request params:" + a.params);
51
+ const e = await t.get("/api/organizations", { params: a.params });
52
+ return a._id ? (console.log(e.data), Object.assign(s.current || {}, e.data[0]), console.log(s.current)) : console.log(e.data), Promise.resolve(e.data);
53
+ } catch (e) {
54
+ return c(e), Promise.reject(e);
55
+ }
56
+ },
57
+ // Update
58
+ async update(a, e) {
59
+ return console.log(a, e), await t.post(`/api/organizations/${a}/update`, e).then(
60
+ (r) => (console.log("Organization updated successfully"), Promise.resolve(r.data)),
61
+ (r) => (console.log("Updating organization failed"), Promise.reject(r))
62
+ );
63
+ },
64
+ // Remove
65
+ async remove(a) {
66
+ await t.delete(`/api/organizations/${a}/delete`).then(
67
+ (e) => {
68
+ s.error = null;
69
+ let r = m.get("user"), l = JSON.parse(r);
70
+ return l.organization = null, m.set("user", JSON.stringify(l), { expires: 7, domain: ".osi.plus", sameSite: "none", secure: !0 }), Promise.resolve(e.data);
71
+ },
72
+ (e) => (c(e), Promise.reject(e))
73
+ ).catch((e) => {
74
+ c(e);
75
+ });
76
+ },
77
+ // Reset
78
+ async reset() {
79
+ s.current = {
80
+ _id: null,
81
+ profile: {
82
+ categories: [],
83
+ photo: "",
84
+ name: "",
85
+ description: ""
86
+ },
87
+ structure: [],
88
+ owner: null,
89
+ types: "",
90
+ contacts: {
91
+ email: "",
92
+ website: "",
93
+ phone: "",
94
+ address: ""
95
+ },
96
+ social: {
97
+ telegram: "",
98
+ line: "",
99
+ facebook: "",
100
+ instagram: ""
101
+ },
102
+ rating: {
103
+ popularity: 0,
104
+ median: 0,
105
+ amount: 0
106
+ }
107
+ };
108
+ }
109
+ };
110
+ d(s, (a, e) => {
111
+ });
112
+ const b = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
113
+ __proto__: null,
114
+ actions: g,
115
+ state: s
116
+ }, Symbol.toStringTag, { value: "Module" }));
117
+ export {
118
+ g as a,
119
+ b as o,
120
+ s
121
+ };
@@ -0,0 +1 @@
1
+ "use strict";const l=require("./auth-5aa8e90c.js"),i=require("vue"),t=require("./globals-928eb13c.js"),c=l.axios.create({baseURL:process.env.API_URL,withCredentials:!0}),s=i.reactive({all:[],current:{_id:null,profile:{tags:[],photo:"",name:"",description:""},structure:[],owner:null,types:"",contacts:{email:"",website:"",phone:"",address:""},social:{telegram:"",line:"",facebook:"",instagram:""},rating:{popularity:0,median:0,amount:0}}}),u={async create(e,a){e.owner=a;try{const r=await c.post("/api/organizations/create",e);return console.log("Organization created successfully"),s.current=r.data,r.data}catch(r){throw console.log("Organization creation failed"),t.setError(r),r}},async read(e={}){console.log(e),e.params=e.params||{},e.location&&(e.params.location=e.location),e.country&&(e.params.country=e.country),e.state&&(e.params.state=e.state),e.city&&(e.params.city=e.city),e.categories&&(e.params.categories=e.categories),e.prices&&(e.params.prices=e.prices),e.delivery&&(e.params.delivery=e.delivery),e._id&&(e.params=e.params||{},e.params._id=e._id),e.types&&(e.params=e.params||[],e.params.types=e.types),e.owner&&(e.params=e.params||{},e.params.owner=e.owner),e.user&&(e.params=e.params||{},e.params.user=e.user),e.member&&(e.params=e.params||{},e.params.member=e.member),e.subscriber&&(e.params=e.params||{},e.params.subscriber=e.subscriber),e.postable&&(e.params=e.params||{},e.params.postable=e.postable),e.params=e.params||{},e.params.skip=e.skip||0,e.params.limit=e.limit||9,e.params.sortParam=e.sort;try{console.log("Request params:"+e.params);const a=await c.get("/api/organizations",{params:e.params});return e._id?(console.log(a.data),Object.assign(s.current||{},a.data[0]),console.log(s.current)):console.log(a.data),Promise.resolve(a.data)}catch(a){return t.setError(a),Promise.reject(a)}},async update(e,a){return console.log(e,a),await c.post(`/api/organizations/${e}/update`,a).then(r=>(console.log("Organization updated successfully"),Promise.resolve(r.data)),r=>(console.log("Updating organization failed"),Promise.reject(r)))},async remove(e){await c.delete(`/api/organizations/${e}/delete`).then(a=>{s.error=null;let r=l.Cookies.get("user"),m=JSON.parse(r);return m.organization=null,l.Cookies.set("user",JSON.stringify(m),{expires:7,domain:".osi.plus",sameSite:"none",secure:!0}),Promise.resolve(a.data)},a=>(t.setError(a),Promise.reject(a))).catch(a=>{t.setError(a)})},async reset(){s.current={_id:null,profile:{categories:[],photo:"",name:"",description:""},structure:[],owner:null,types:"",contacts:{email:"",website:"",phone:"",address:""},social:{telegram:"",line:"",facebook:"",instagram:""},rating:{popularity:0,median:0,amount:0}}}};i.watch(s,(e,a)=>{});const n=Object.freeze(Object.defineProperty({__proto__:null,actions:u,state:s},Symbol.toStringTag,{value:"Module"}));exports.actions=u;exports.organizations=n;exports.state=s;