@ozdao/prometheus-framework 0.1.32 → 0.1.34

Sign up to get free protection for your applications and to get access to all the features.
Files changed (67) hide show
  1. package/dist/Chips-41cd6570.mjs +203 -0
  2. package/dist/Chips-c3d7341e.js +1 -0
  3. package/dist/EULA-e05236af.mjs +4210 -0
  4. package/dist/EULA-f5fba925.js +1 -0
  5. package/dist/Feed-046852fc.js +1 -0
  6. package/dist/Feed-4efa2a93.mjs +394 -0
  7. package/dist/Feed-acfbb839.mjs +371 -0
  8. package/dist/Feed-e6e84388.js +1 -0
  9. package/dist/Image-93c3a270.mjs +480 -0
  10. package/dist/Image-de94b883.js +9 -0
  11. package/dist/Product-1892b14a.js +7 -0
  12. package/dist/Product-d3f1d10a.mjs +844 -0
  13. package/dist/ProductEdit-8e779ed8.js +1 -0
  14. package/dist/ProductEdit-ebcc3f98.mjs +306 -0
  15. package/dist/ProfileBlogposts-8c10a505.js +1 -0
  16. package/dist/ProfileBlogposts-a2f7cd4c.mjs +70 -0
  17. package/dist/ProfileEvents-47409c9e.mjs +62 -0
  18. package/dist/ProfileEvents-db12cf78.js +1 -0
  19. package/dist/auth.server.js +4 -4
  20. package/dist/auth.server.mjs +4 -4
  21. package/dist/community.client.cjs +1 -1
  22. package/dist/community.client.js +217 -241
  23. package/dist/community.server.js +2 -2
  24. package/dist/community.server.mjs +2 -2
  25. package/dist/events.client.cjs +1 -1
  26. package/dist/events.client.js +4 -4
  27. package/dist/events.server.js +361 -224
  28. package/dist/events.server.mjs +361 -224
  29. package/dist/files.server.js +1 -1
  30. package/dist/files.server.mjs +1 -1
  31. package/dist/legal.client.cjs +1 -1
  32. package/dist/legal.client.js +1 -1
  33. package/dist/modules/community/components/sections/Feed.vue.d.ts +2 -0
  34. package/dist/organizations.client-76c3660a.mjs +3072 -0
  35. package/dist/organizations.client-ddbf8809.js +3 -0
  36. package/dist/organizations.client.cjs +1 -1
  37. package/dist/organizations.client.js +4 -4
  38. package/dist/organizations.server.js +4 -4
  39. package/dist/organizations.server.mjs +4 -4
  40. package/dist/style.css +1 -1
  41. package/dist/users.client.cjs +1 -1
  42. package/dist/users.client.js +2 -2
  43. package/dist/users.server.js +2 -2
  44. package/dist/users.server.mjs +2 -2
  45. package/package.json +1 -1
  46. package/src/components/CardHeader/CardHeader.vue +3 -3
  47. package/src/modules/community/components/blocks/CardBlogpost.vue +2 -4
  48. package/src/modules/community/components/sections/Feed.vue +44 -39
  49. package/src/modules/community/components/sections/HotPosts.vue +9 -56
  50. package/src/modules/events/components/blocks/CardEvent.vue +0 -2
  51. package/src/modules/events/controllers/events.controller.js +55 -265
  52. package/src/modules/events/controllers/utils/queryProcessor.js +118 -0
  53. package/src/modules/events/models/event.new.model.js +76 -0
  54. package/src/modules/files/middlewares/server/middlewareMulter.js +1 -0
  55. package/src/modules/globals/controllers/utils/queryProcessor.js +228 -0
  56. package/src/modules/globals/models/common.schema.js +14 -0
  57. package/src/modules/globals/models/engagement.schema.js +10 -0
  58. package/src/modules/globals/models/metadata.schema.js +15 -0
  59. package/src/modules/globals/models/ownership.schema.js +34 -0
  60. package/src/modules/globals/utils/seo-friendly-url.js +28 -0
  61. package/src/modules/legal/components/pages/legal/EULA.vue +0 -3
  62. package/src/modules/products/controllers/categories.controller.js +3 -0
  63. package/src/modules/products/models/category.model.js +63 -13
  64. package/src/modules/products/models/leftover.model.js +38 -17
  65. package/src/modules/products/models/modification.model.js +31 -14
  66. package/src/modules/products/models/product.model.js +37 -38
  67. package/src/modules/products/products.server.js +11 -1
@@ -0,0 +1,394 @@
1
+ import { reactive as N, watch as z, openBlock as r, createElementBlock as o, toDisplayString as d, createCommentVNode as i, createElementVNode as f, ref as g, createTextVNode as S, computed as R, createBlock as v, withModifiers as I, createVNode as h, normalizeClass as E, unref as m, renderSlot as L, onMounted as T, Fragment as j, Transition as P, withCtx as $, renderList as F } from "vue";
2
+ import { _ as M } from "./EmptyState-34d85f10.mjs";
3
+ import { _ as V } from "./_plugin-vue_export-helper-dad06003.mjs";
4
+ import { b as B, _ as O, a as U } from "./Chips-41cd6570.mjs";
5
+ import { useRouter as A } from "vue-router";
6
+ import { I as q } from "./IconEdit-680dc269.mjs";
7
+ import { a as D } from "./index-a661083c.mjs";
8
+ import { s as x } from "./globals-96ba60e4.mjs";
9
+ const w = D.create({ baseURL: process.env.API_URL, withCredentials: !0 });
10
+ w.defaults.withCredentials = !0;
11
+ const p = N({
12
+ all: [],
13
+ filter: {
14
+ // query
15
+ tags: [],
16
+ period: ""
17
+ // pagination
18
+ },
19
+ pagination: {
20
+ page: 1,
21
+ perPage: 18
22
+ },
23
+ // Sort
24
+ sort: {
25
+ current: "popularity",
26
+ ascending: !1
27
+ },
28
+ current: {
29
+ _id: "",
30
+ url: "",
31
+ status: "",
32
+ name: "",
33
+ tags: [],
34
+ owner: {},
35
+ date: "",
36
+ views: 0,
37
+ content: []
38
+ }
39
+ });
40
+ async function _(e = {}) {
41
+ e.params = e.params || {}, e.params.skip = e.skip || 0, e.params.limit = e.limit || 9, e.params.tags = e.tags || [], e.period && (e.params.period = e.period), e.url && (e.params = { url: e.url }), e.category && (e.params.category = e.category), e.organization && (e.params.organization = e.organization), e.owner && (e.params.owner = e.owner), e.creator && (e.params.creator = e.creator), e.status && (e.params.status = e.status), e.user && (e.params.user = e.user), e.params.skip = e.skip || 0, e.params.limit = e.limit || 10;
42
+ try {
43
+ console.log("Request params:" + e.params);
44
+ const t = await w.get("/api/blog/read", { params: e.params });
45
+ return e.url ? k(t.data, "current") : k(t.data, "all"), Promise.resolve(t.data);
46
+ } catch (t) {
47
+ return x(t), Promise.reject(t);
48
+ }
49
+ }
50
+ async function G(e) {
51
+ return w.post("/api/blog/create", e).then(
52
+ (t) => (k(t.data, "current"), Promise.resolve(t.data)),
53
+ (t) => (x(t), Promise.reject(t))
54
+ );
55
+ }
56
+ async function H(e) {
57
+ return w.post("/api/blog/update", e).then(
58
+ (t) => (k(t.data, "current"), Promise.resolve(t.data)),
59
+ (t) => (x(t), Promise.reject(t))
60
+ );
61
+ }
62
+ async function J(e) {
63
+ return await w.delete(`/api/blog/delete/${e}`).then(
64
+ (t) => {
65
+ const a = p.all.findIndex((l) => l._id === e);
66
+ return a !== -1 && p.all.splice(a, 1), Promise.resolve(t.data);
67
+ },
68
+ (t) => (x(t), Promise.reject(t))
69
+ );
70
+ }
71
+ function k(e, t) {
72
+ p[t] = e;
73
+ }
74
+ function K() {
75
+ p.current = {
76
+ _id: "",
77
+ url: "",
78
+ status: "",
79
+ name: "",
80
+ tags: [],
81
+ author: "",
82
+ owner: "",
83
+ date: "",
84
+ views: 0,
85
+ content: []
86
+ };
87
+ }
88
+ function Q(e) {
89
+ const t = {
90
+ order: p.project.content.length + 1,
91
+ type: e.type,
92
+ data: e.data,
93
+ class: e.class,
94
+ content: e.content
95
+ };
96
+ p.project.content.push(t);
97
+ }
98
+ z(p, (e, t) => {
99
+ });
100
+ const $e = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
101
+ __proto__: null,
102
+ blockAdd: Q,
103
+ clean: K,
104
+ create: G,
105
+ read: _,
106
+ remove: J,
107
+ set: k,
108
+ state: p,
109
+ update: H
110
+ }, Symbol.toStringTag, { value: "Module" })), W = {
111
+ props: {
112
+ progress: {
113
+ type: Number,
114
+ default: null
115
+ },
116
+ status: {
117
+ type: String,
118
+ default: null
119
+ }
120
+ }
121
+ }, X = { class: "circular-loader" }, Y = /* @__PURE__ */ f("svg", { viewBox: "25 25 50 50" }, [
122
+ /* @__PURE__ */ f("circle", {
123
+ cx: "50",
124
+ cy: "50",
125
+ r: "20",
126
+ fill: "none",
127
+ "stroke-width": "4",
128
+ "stroke-miterlimit": "10"
129
+ })
130
+ ], -1), Z = {
131
+ key: 0,
132
+ class: "progress-text"
133
+ }, ee = {
134
+ key: 1,
135
+ class: "uppercase t-semi w-m-10r status-text"
136
+ };
137
+ function te(e, t, a, l, c, n) {
138
+ return r(), o("div", X, [
139
+ Y,
140
+ a.progress ? (r(), o("div", Z, d(a.progress), 1)) : i("", !0),
141
+ a.status ? (r(), o("div", ee, d(a.status), 1)) : i("", !0)
142
+ ]);
143
+ }
144
+ const ae = /* @__PURE__ */ V(W, [["render", te]]), re = { class: "t-semi br-top-dark flex-nowrap flex-nojustify flex" }, se = /* @__PURE__ */ f("span", { class: "mn-r-small mn-l-small d-block" }, "·", -1), le = { class: "cursor-pointer" }, oe = /* @__PURE__ */ f("span", { class: "mn-r-small mn-l-small d-block" }, "·", -1), ne = {
145
+ __name: "FooterBlogpost",
146
+ props: ["blogpost", "owner", "user"],
147
+ setup(e) {
148
+ const t = e, a = g(t.blogpost.numberOfReactions), l = g(t.blogpost.isReacted), c = g(t.blogpost.reactionId);
149
+ async function n(y) {
150
+ if (!t.user) {
151
+ alert("Please login to add a reaction");
152
+ return;
153
+ }
154
+ try {
155
+ const s = {
156
+ target: t.blogpost._id,
157
+ type: "blogpost",
158
+ user: t.user,
159
+ class: "like"
160
+ }, b = await B.create(s);
161
+ b.reaction.class === "like" && (a.value += 1, l.value = !0, c.value = b.reaction._id);
162
+ } catch (s) {
163
+ console.error(s), alert("Error adding reaction. Please try again later.");
164
+ }
165
+ }
166
+ async function u(y) {
167
+ if (!t.user) {
168
+ alert("Please login to add a reaction");
169
+ return;
170
+ }
171
+ try {
172
+ const s = { _id: c.value };
173
+ await B.delete(s), a.value -= 1, l.value = !1, c.value = null;
174
+ } catch {
175
+ alert("Error adding reaction. Please try again later.");
176
+ }
177
+ }
178
+ return (y, s) => (r(), o("footer", re, [
179
+ S(" 👁️ " + d(e.blogpost.views) + " ", 1),
180
+ se,
181
+ f("div", le, [
182
+ l.value ? i("", !0) : (r(), o("div", {
183
+ key: 0,
184
+ class: "cursor-pointer",
185
+ onClick: s[0] || (s[0] = (b) => n())
186
+ }, " 👍 " + d(a.value), 1)),
187
+ l.value ? (r(), o("div", {
188
+ key: 1,
189
+ class: "cursor-pointer",
190
+ onClick: s[1] || (s[1] = (b) => u())
191
+ }, " 👍 " + d(a.value), 1)) : i("", !0)
192
+ ]),
193
+ oe,
194
+ S(" 💬 " + d(e.blogpost.numberOfComments), 1)
195
+ ]));
196
+ }
197
+ }, ie = { class: "pos-relative bg-grey radius-big" }, ce = ["src"], ue = { class: "pd-t-zero pd-medium" }, de = {
198
+ key: 0,
199
+ class: "cursor-pointer mn-thin flex-nowrap flex w-100"
200
+ }, me = {
201
+ key: 0,
202
+ class: "pd-micro t-white uppercase t-semi p-small flex-center flex pd-r-small pd-l-small mn-l-thin w-min bg-second radius-extra"
203
+ }, ge = {
204
+ key: 1,
205
+ class: "mn-small t-transp p-big"
206
+ }, pe = {
207
+ key: 2,
208
+ class: "mn-small h2"
209
+ }, fe = {
210
+ __name: "CardBlogpost",
211
+ props: ["blogpost", "user", "type"],
212
+ setup(e) {
213
+ const t = e, a = A(), l = R(() => t.blogpost.content.find((n) => n.type === "ImageUpload")), c = R(() => t.blogpost.content.find((n) => n.type === "Textarea"));
214
+ return (n, u) => (r(), o("article", ie, [
215
+ e.user && e.user === e.blogpost.creator.target._id ? (r(), v(q, {
216
+ key: 0,
217
+ onClick: u[0] || (u[0] = I((y) => n.$router.push({
218
+ name: "Edit BlogPost",
219
+ params: {
220
+ url: e.blogpost.url
221
+ }
222
+ }), ["stop"])),
223
+ class: "z-index-2 pos-absolute pos-t-regular pos-r-regular i-regular t-transp"
224
+ })) : i("", !0),
225
+ h(O, {
226
+ class: E({
227
+ "mn-small pd-medium": e.type !== "short",
228
+ "flex-child-order-last flex-child mn-l-small": e.type === "short"
229
+ }),
230
+ entity: e.blogpost,
231
+ entityType: "blogpost",
232
+ user: e.user,
233
+ owner: e.blogpost.owner,
234
+ creator: e.blogpost.creator,
235
+ date: e.blogpost.createdAt
236
+ }, null, 8, ["class", "entity", "user", "owner", "creator", "date"]),
237
+ m(l) && m(l).content && e.type !== "blogpostPage" ? (r(), o("img", {
238
+ key: 1,
239
+ src: (n.FILE_SERVER_URL || "") + m(l).content,
240
+ alt: "Blog post image",
241
+ class: "mn-medium object-fit-cover w-100 h-20r"
242
+ }, null, 8, ce)) : i("", !0),
243
+ f("section", ue, [
244
+ e.type !== "blogpostPage" ? (r(), o("div", de, [
245
+ f("h3", {
246
+ onClick: u[1] || (u[1] = (y) => m(a).push({
247
+ name: "BlogPost",
248
+ params: {
249
+ url: e.blogpost.url
250
+ }
251
+ })),
252
+ class: ""
253
+ }, d(e.blogpost.name), 1),
254
+ e.blogpost.status === "draft" ? (r(), o("div", me, d(e.blogpost.status), 1)) : i("", !0)
255
+ ])) : i("", !0),
256
+ m(c) && m(c).content && e.type !== "blogpostPage" ? (r(), o("p", ge, d(m(c).content.slice(0, 120)) + "... ", 1)) : i("", !0),
257
+ e.type === "blogpostPage" ? (r(), o("h3", pe, d(e.blogpost.name), 1)) : i("", !0),
258
+ L(n.$slots, "default"),
259
+ e.type !== "short" && e.blogpost.tags.length > 0 ? (r(), v(U, {
260
+ key: 3,
261
+ chips: e.blogpost.tags
262
+ }, null, 8, ["chips"])) : i("", !0)
263
+ ]),
264
+ h(ne, {
265
+ class: "pd-t-zero pd-medium",
266
+ blogpost: e.blogpost,
267
+ user: e.user
268
+ }, null, 8, ["blogpost", "user"])
269
+ ]));
270
+ }
271
+ }, _e = {
272
+ __name: "Feed",
273
+ props: {
274
+ category: {
275
+ type: String,
276
+ default: null
277
+ },
278
+ limit: {
279
+ type: Number,
280
+ default: 7
281
+ },
282
+ skip: {
283
+ type: Number,
284
+ default: 0
285
+ },
286
+ owner: {
287
+ type: String,
288
+ default: null
289
+ },
290
+ creator: {
291
+ type: String,
292
+ default: null
293
+ },
294
+ status: {
295
+ type: String,
296
+ default: "published"
297
+ },
298
+ user: {
299
+ type: [String, Number],
300
+ default: null
301
+ },
302
+ period: {
303
+ type: String,
304
+ default: null
305
+ }
306
+ },
307
+ setup(e) {
308
+ const t = e, a = g([]), l = g(!0);
309
+ let c = g(!0), n = g(t.skip), u = g(t.limit);
310
+ const y = async () => {
311
+ if (l.value) {
312
+ n.value += u.value;
313
+ const s = await _({
314
+ skip: n.value,
315
+ limit: u.value,
316
+ category: t.category,
317
+ user: t.user,
318
+ owner: t.owner,
319
+ creator: t.creator,
320
+ status: t.status,
321
+ period: t.period
322
+ });
323
+ s.length === 0 && (l.value = !1), a.value = [...a.value, ...s];
324
+ }
325
+ };
326
+ return T(async () => {
327
+ const s = await _({
328
+ skip: n.value,
329
+ limit: u.value,
330
+ category: t.category,
331
+ user: t.user,
332
+ owner: t.owner,
333
+ status: t.status,
334
+ creator: t.creator,
335
+ period: t.period
336
+ });
337
+ s.length === 0 ? l.value = !1 : l.value = !0, a.value = s, c.value = !1;
338
+ }), (s, b) => (r(), o(j, null, [
339
+ h(P, { name: "scaleTransition" }, {
340
+ default: $(() => [
341
+ m(c) ? (r(), v(ae, {
342
+ key: 0,
343
+ class: "z-index-5 pos-t-50 left-t-50 pos-absolute"
344
+ })) : i("", !0)
345
+ ]),
346
+ _: 1
347
+ }),
348
+ h(P, { name: "scaleTransition" }, {
349
+ default: $(() => [
350
+ !m(c) && a.value.length < 1 ? (r(), v(M, {
351
+ key: 0,
352
+ title: "No Blog Posts Found",
353
+ description: "Currently, there are no posts available in this blog. Please check back later.",
354
+ class: "pd-medium mn-thin bg-grey radius-big"
355
+ })) : (r(), o("div", {
356
+ key: 1,
357
+ class: E(s.$attrs.class)
358
+ }, [
359
+ (r(!0), o(j, null, F(a.value, (C) => (r(), v(fe, {
360
+ key: C._id,
361
+ blogpost: C,
362
+ user: e.user,
363
+ class: "mn-medium"
364
+ }, null, 8, ["blogpost", "user"]))), 128)),
365
+ h(P, { name: "scaleTransition" }, {
366
+ default: $(() => [
367
+ l.value && a.value.length > 0 ? (r(), o("button", {
368
+ key: 0,
369
+ onClick: y,
370
+ class: "w-100 bg-main button"
371
+ }, " Load more ")) : i("", !0)
372
+ ]),
373
+ _: 1
374
+ })
375
+ ], 2))
376
+ ]),
377
+ _: 1
378
+ })
379
+ ], 64));
380
+ }
381
+ };
382
+ export {
383
+ ae as L,
384
+ _e as _,
385
+ G as a,
386
+ J as b,
387
+ K as c,
388
+ fe as d,
389
+ ne as e,
390
+ $e as f,
391
+ _ as r,
392
+ p as s,
393
+ H as u
394
+ };