@ozdao/prometheus-framework 0.0.94 → 0.0.95
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/Breadcrumbs.vue_vue_type_style_index_0_lang-6f807eb5.js +1 -0
- package/dist/Breadcrumbs.vue_vue_type_style_index_0_lang-97217d38.mjs +1945 -0
- package/dist/ButtonFollow-4049a57e.js +1 -0
- package/dist/ButtonFollow-6765c266.mjs +131 -0
- package/dist/CardOrganization-b2098e42.js +1 -0
- package/dist/CardOrganization-c2e7e903.mjs +229 -0
- package/dist/Feed-13499a3a.mjs +428 -0
- package/dist/Feed-345d8513.mjs +355 -0
- package/dist/Feed-c6b67df4.js +1 -0
- package/dist/Feed-f0a40b33.js +1 -0
- package/dist/Image-b2131fa0.mjs +477 -0
- package/dist/Image-d01026cf.js +9 -0
- package/dist/Popup-0b38b537.js +1 -0
- package/dist/Popup-e6685f31.mjs +76 -0
- package/dist/Product-3c2ae338.js +7 -0
- package/dist/Product-dccb371a.mjs +838 -0
- package/dist/ProductEdit-777bb9e2.mjs +350 -0
- package/dist/ProductEdit-d5dec3cf.js +1 -0
- package/dist/ProfileBlogposts-39c20b79.mjs +64 -0
- package/dist/ProfileBlogposts-6c715a38.js +1 -0
- package/dist/ProfileComments-1525663e.mjs +44 -0
- package/dist/ProfileComments-1cbf5c45.js +1 -0
- package/dist/ProfileEvents-48c70286.mjs +56 -0
- package/dist/ProfileEvents-a28a4ee5.js +1 -0
- package/dist/ProfileLikes-ca197731.mjs +44 -0
- package/dist/ProfileLikes-e31f28dc.js +1 -0
- package/dist/ProfileOrganizations-600d310d.js +1 -0
- package/dist/ProfileOrganizations-774c6508.mjs +212 -0
- package/dist/Publics-4db36606.js +1 -0
- package/dist/Publics-cbb8eaaa.mjs +123 -0
- package/dist/UploadImage-739cab04.js +1 -0
- package/dist/UploadImage-8835be69.mjs +83 -0
- package/dist/auth-b61483ce.js +8 -0
- package/dist/auth-cfeacd61.mjs +1839 -0
- package/dist/auth.client.cjs +1 -1
- package/dist/auth.client.js +3 -3
- package/dist/auth.validation-2f00457e.js +1 -0
- package/dist/auth.validation-3fd4cc7c.mjs +20 -0
- package/dist/community.client.cjs +1 -1
- package/dist/community.client.js +10 -10
- package/dist/events.client.cjs +1 -1
- package/dist/events.client.js +8 -8
- package/dist/organizations-49a10611.js +1 -0
- package/dist/organizations-8ffdf84d.mjs +121 -0
- package/dist/organizations.client-0071acee.js +3 -0
- package/dist/organizations.client-fa3b0839.mjs +3017 -0
- package/dist/organizations.client.cjs +1 -1
- package/dist/organizations.client.js +10 -10
- package/dist/users.client.cjs +1 -1
- package/dist/users.client.js +9 -9
- package/package.json +2 -1
- package/src/modules/auth/store/auth.js +23 -3
@@ -0,0 +1,428 @@
|
|
1
|
+
import { reactive as L, watch as I, openBlock as o, createElementBlock as l, toDisplayString as u, createCommentVNode as i, createElementVNode as b, ref as g, createTextVNode as z, computed as B, createVNode as w, normalizeClass as O, unref as d, renderSlot as A, createBlock as x, onMounted as T, Transition as $, withCtx as j, Fragment as U, renderList as E } from "vue";
|
2
|
+
import { _ as M } from "./EmptyState-34d85f10.mjs";
|
3
|
+
import { _ as F } from "./_plugin-vue_export-helper-dad06003.mjs";
|
4
|
+
import { _ as V, a as q } from "./Chips-f0b7ce36.mjs";
|
5
|
+
import { useRouter as D } from "vue-router";
|
6
|
+
import { a as N } from "./auth-cfeacd61.mjs";
|
7
|
+
import { s as p } from "./globals-96ba60e4.mjs";
|
8
|
+
const k = N.create({ baseURL: process.env.API_URL, withCredentials: !0 });
|
9
|
+
k.defaults.withCredentials = !0;
|
10
|
+
const f = L({
|
11
|
+
all: [],
|
12
|
+
filter: {
|
13
|
+
// query
|
14
|
+
tags: [],
|
15
|
+
period: ""
|
16
|
+
// pagination
|
17
|
+
},
|
18
|
+
pagination: {
|
19
|
+
page: 1,
|
20
|
+
perPage: 18
|
21
|
+
},
|
22
|
+
// Sort
|
23
|
+
sort: {
|
24
|
+
current: "popularity",
|
25
|
+
ascending: !1
|
26
|
+
},
|
27
|
+
current: {
|
28
|
+
_id: "",
|
29
|
+
url: "",
|
30
|
+
status: "",
|
31
|
+
name: "",
|
32
|
+
tags: [],
|
33
|
+
owner: {},
|
34
|
+
date: "",
|
35
|
+
views: 0,
|
36
|
+
content: []
|
37
|
+
}
|
38
|
+
});
|
39
|
+
async function S(e = {}) {
|
40
|
+
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;
|
41
|
+
try {
|
42
|
+
console.log("Request params:" + e.params);
|
43
|
+
const t = await k.get("/api/blog/read", { params: e.params });
|
44
|
+
return e.url ? _(t.data, "current") : _(t.data, "all"), Promise.resolve(t.data);
|
45
|
+
} catch (t) {
|
46
|
+
return p(t), Promise.reject(t);
|
47
|
+
}
|
48
|
+
}
|
49
|
+
async function G(e) {
|
50
|
+
return k.post("/api/blog/create", e).then(
|
51
|
+
(t) => (_(t.data, "current"), Promise.resolve(t.data)),
|
52
|
+
(t) => (p(t), Promise.reject(t))
|
53
|
+
);
|
54
|
+
}
|
55
|
+
async function H(e) {
|
56
|
+
return k.post("/api/blog/update", e).then(
|
57
|
+
(t) => (_(t.data, "current"), Promise.resolve(t.data)),
|
58
|
+
(t) => (p(t), Promise.reject(t))
|
59
|
+
);
|
60
|
+
}
|
61
|
+
async function J(e) {
|
62
|
+
return await k.delete(`/api/blog/delete/${e}`).then(
|
63
|
+
(t) => {
|
64
|
+
const a = f.all.findIndex((r) => r._id === e);
|
65
|
+
return a !== -1 && f.all.splice(a, 1), Promise.resolve(t.data);
|
66
|
+
},
|
67
|
+
(t) => (p(t), Promise.reject(t))
|
68
|
+
);
|
69
|
+
}
|
70
|
+
function _(e, t) {
|
71
|
+
f[t] = e;
|
72
|
+
}
|
73
|
+
function K() {
|
74
|
+
f.current = {
|
75
|
+
_id: "",
|
76
|
+
url: "",
|
77
|
+
status: "",
|
78
|
+
name: "",
|
79
|
+
tags: [],
|
80
|
+
author: "",
|
81
|
+
owner: "",
|
82
|
+
date: "",
|
83
|
+
views: 0,
|
84
|
+
content: []
|
85
|
+
};
|
86
|
+
}
|
87
|
+
function Q(e) {
|
88
|
+
const t = {
|
89
|
+
order: f.project.content.length + 1,
|
90
|
+
type: e.type,
|
91
|
+
data: e.data,
|
92
|
+
class: e.class,
|
93
|
+
content: e.content
|
94
|
+
};
|
95
|
+
f.project.content.push(t);
|
96
|
+
}
|
97
|
+
I(f, (e, t) => {
|
98
|
+
});
|
99
|
+
const je = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
100
|
+
__proto__: null,
|
101
|
+
blockAdd: Q,
|
102
|
+
clean: K,
|
103
|
+
create: G,
|
104
|
+
read: S,
|
105
|
+
remove: J,
|
106
|
+
set: _,
|
107
|
+
state: f,
|
108
|
+
update: H
|
109
|
+
}, Symbol.toStringTag, { value: "Module" })), W = {
|
110
|
+
props: {
|
111
|
+
progress: {
|
112
|
+
type: Number,
|
113
|
+
default: null
|
114
|
+
},
|
115
|
+
status: {
|
116
|
+
type: String,
|
117
|
+
default: null
|
118
|
+
}
|
119
|
+
}
|
120
|
+
}, X = { class: "circular-loader" }, Y = /* @__PURE__ */ b("svg", { viewBox: "25 25 50 50" }, [
|
121
|
+
/* @__PURE__ */ b("circle", {
|
122
|
+
cx: "50",
|
123
|
+
cy: "50",
|
124
|
+
r: "20",
|
125
|
+
fill: "none",
|
126
|
+
"stroke-width": "4",
|
127
|
+
"stroke-miterlimit": "10"
|
128
|
+
})
|
129
|
+
], -1), Z = {
|
130
|
+
key: 0,
|
131
|
+
class: "progress-text"
|
132
|
+
}, ee = {
|
133
|
+
key: 1,
|
134
|
+
class: "uppercase t-semi w-m-10r status-text"
|
135
|
+
};
|
136
|
+
function te(e, t, a, r, s, c) {
|
137
|
+
return o(), l("div", X, [
|
138
|
+
Y,
|
139
|
+
a.progress ? (o(), l("div", Z, u(a.progress), 1)) : i("", !0),
|
140
|
+
a.status ? (o(), l("div", ee, u(a.status), 1)) : i("", !0)
|
141
|
+
]);
|
142
|
+
}
|
143
|
+
const re = /* @__PURE__ */ F(W, [["render", te]]), P = N.create({
|
144
|
+
baseURL: process.env.API_URL,
|
145
|
+
withCredentials: !0
|
146
|
+
}), y = L({
|
147
|
+
reactions: [],
|
148
|
+
error: null
|
149
|
+
}), C = {
|
150
|
+
async read({ user: e, type: t, target: a, role: r }) {
|
151
|
+
try {
|
152
|
+
const s = await P.get("/api/reactions", { params: { user: e, type: t, target: a, role: r } });
|
153
|
+
return y.error = null, y.reactions = s.data, Promise.resolve(s.data);
|
154
|
+
} catch (s) {
|
155
|
+
return p(s), Promise.reject(s);
|
156
|
+
}
|
157
|
+
},
|
158
|
+
async create(e) {
|
159
|
+
try {
|
160
|
+
const t = await P.post("/api/reactions/create", e);
|
161
|
+
return y.error = null, Promise.resolve(t.data);
|
162
|
+
} catch (t) {
|
163
|
+
return console.log(t), p(t), Promise.reject(t);
|
164
|
+
}
|
165
|
+
},
|
166
|
+
async update(e) {
|
167
|
+
try {
|
168
|
+
const t = await P.post("/api/reactions/update", e);
|
169
|
+
return y.error = null, Promise.resolve(t.data);
|
170
|
+
} catch (t) {
|
171
|
+
return p(t), Promise.reject(t);
|
172
|
+
}
|
173
|
+
},
|
174
|
+
async delete(e) {
|
175
|
+
try {
|
176
|
+
const t = await P.post("/api/reactions/delete", e);
|
177
|
+
return y.error = null, Promise.resolve(t.data);
|
178
|
+
} catch (t) {
|
179
|
+
return p(t), Promise.reject(t);
|
180
|
+
}
|
181
|
+
}
|
182
|
+
}, ae = {
|
183
|
+
handleReactionUpdate(e, t, a) {
|
184
|
+
let r;
|
185
|
+
if (Array.isArray(e) ? r = e.find((s) => s._id === t.target) : typeof e == "object" && e._id === t.target && (r = e), r)
|
186
|
+
if (r.hasReaction = a, a)
|
187
|
+
r.reactions.push(t), r.numberOfReactions += 1;
|
188
|
+
else {
|
189
|
+
const s = r.reactions.findIndex((c) => c._id === t._id);
|
190
|
+
s !== -1 && (r.reactions.splice(s, 1), r.numberOfReactions -= 1);
|
191
|
+
}
|
192
|
+
}
|
193
|
+
};
|
194
|
+
I(y, (e) => {
|
195
|
+
});
|
196
|
+
const Se = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
197
|
+
__proto__: null,
|
198
|
+
actions: C,
|
199
|
+
mutations: ae,
|
200
|
+
state: y
|
201
|
+
}, Symbol.toStringTag, { value: "Module" })), se = { class: "t-semi br-top-dark flex-nowrap flex-nojustify flex" }, oe = /* @__PURE__ */ b("span", { class: "mn-r-small mn-l-small d-block" }, "·", -1), ne = { class: "cursor-pointer" }, le = /* @__PURE__ */ b("span", { class: "mn-r-small mn-l-small d-block" }, "·", -1), ce = {
|
202
|
+
__name: "FooterBlogpost",
|
203
|
+
props: ["blogpost", "owner", "user"],
|
204
|
+
setup(e) {
|
205
|
+
const t = e, a = g(t.blogpost.numberOfReactions), r = g(t.blogpost.isReacted), s = g(t.blogpost.reactionId);
|
206
|
+
async function c(h) {
|
207
|
+
if (!t.user) {
|
208
|
+
alert("Please login to add a reaction");
|
209
|
+
return;
|
210
|
+
}
|
211
|
+
try {
|
212
|
+
const n = {
|
213
|
+
target: t.blogpost._id,
|
214
|
+
type: "blogpost",
|
215
|
+
user: t.user,
|
216
|
+
class: "like"
|
217
|
+
}, v = await C.create(n);
|
218
|
+
v.reaction.class === "like" && (a.value += 1, r.value = !0, s.value = v.reaction._id);
|
219
|
+
} catch (n) {
|
220
|
+
console.error(n), alert("Error adding reaction. Please try again later.");
|
221
|
+
}
|
222
|
+
}
|
223
|
+
async function m(h) {
|
224
|
+
if (!t.user) {
|
225
|
+
alert("Please login to add a reaction");
|
226
|
+
return;
|
227
|
+
}
|
228
|
+
try {
|
229
|
+
const n = { _id: s.value };
|
230
|
+
await C.delete(n), a.value -= 1, r.value = !1, s.value = null;
|
231
|
+
} catch {
|
232
|
+
alert("Error adding reaction. Please try again later.");
|
233
|
+
}
|
234
|
+
}
|
235
|
+
return (h, n) => (o(), l("footer", se, [
|
236
|
+
z(" 👁️ " + u(e.blogpost.views) + " ", 1),
|
237
|
+
oe,
|
238
|
+
b("div", ne, [
|
239
|
+
r.value ? i("", !0) : (o(), l("div", {
|
240
|
+
key: 0,
|
241
|
+
class: "cursor-pointer",
|
242
|
+
onClick: n[0] || (n[0] = (v) => c())
|
243
|
+
}, " 👍 " + u(a.value), 1)),
|
244
|
+
r.value ? (o(), l("div", {
|
245
|
+
key: 1,
|
246
|
+
class: "cursor-pointer",
|
247
|
+
onClick: n[1] || (n[1] = (v) => m())
|
248
|
+
}, " 👍 " + u(a.value), 1)) : i("", !0)
|
249
|
+
]),
|
250
|
+
le,
|
251
|
+
z(" 💬 " + u(e.blogpost.numberOfComments), 1)
|
252
|
+
]));
|
253
|
+
}
|
254
|
+
}, ie = { class: "bg-grey radius-big" }, ue = ["src"], de = { class: "pd-t-zero pd-medium" }, me = {
|
255
|
+
key: 0,
|
256
|
+
class: "cursor-pointer mn-thin flex-nowrap flex w-100"
|
257
|
+
}, ge = {
|
258
|
+
key: 0,
|
259
|
+
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"
|
260
|
+
}, pe = {
|
261
|
+
key: 1,
|
262
|
+
class: "mn-small t-transp p-big"
|
263
|
+
}, fe = {
|
264
|
+
key: 2,
|
265
|
+
class: "mn-small h2"
|
266
|
+
}, ye = {
|
267
|
+
__name: "CardBlogpost",
|
268
|
+
props: ["blogpost", "user", "type"],
|
269
|
+
setup(e) {
|
270
|
+
const t = e, a = D(), r = B(() => t.blogpost.content.find((c) => c.type === "ImageUpload")), s = B(() => t.blogpost.content.find((c) => c.type === "Textarea"));
|
271
|
+
return (c, m) => (o(), l("article", ie, [
|
272
|
+
w(V, {
|
273
|
+
class: O({
|
274
|
+
"mn-small pd-medium": e.type !== "short",
|
275
|
+
"flex-child-order-last flex-child mn-l-small": e.type === "short"
|
276
|
+
}),
|
277
|
+
owner: e.blogpost.owner,
|
278
|
+
creator: e.blogpost.creator,
|
279
|
+
date: e.blogpost.createdAt
|
280
|
+
}, null, 8, ["class", "owner", "creator", "date"]),
|
281
|
+
d(r) && d(r).content && e.type !== "blogpostPage" ? (o(), l("img", {
|
282
|
+
key: 0,
|
283
|
+
src: d(r).content,
|
284
|
+
alt: "Blog post image",
|
285
|
+
class: "mn-medium object-fit-cover w-100 h-20r"
|
286
|
+
}, null, 8, ue)) : i("", !0),
|
287
|
+
b("section", de, [
|
288
|
+
e.type !== "blogpostPage" ? (o(), l("div", me, [
|
289
|
+
b("h3", {
|
290
|
+
onClick: m[0] || (m[0] = (h) => d(a).push({
|
291
|
+
name: "BlogPost",
|
292
|
+
params: {
|
293
|
+
url: e.blogpost.url
|
294
|
+
}
|
295
|
+
})),
|
296
|
+
class: ""
|
297
|
+
}, u(e.blogpost.name), 1),
|
298
|
+
e.blogpost.status === "draft" ? (o(), l("div", ge, u(e.blogpost.status), 1)) : i("", !0)
|
299
|
+
])) : i("", !0),
|
300
|
+
d(s) && d(s).content && e.type !== "blogpostPage" ? (o(), l("p", pe, u(d(s).content.slice(0, 120)) + "... ", 1)) : i("", !0),
|
301
|
+
e.type === "blogpostPage" ? (o(), l("h3", fe, u(e.blogpost.name), 1)) : i("", !0),
|
302
|
+
A(c.$slots, "default"),
|
303
|
+
e.type !== "short" && e.blogpost.tags.length > 0 ? (o(), x(q, {
|
304
|
+
key: 3,
|
305
|
+
chips: e.blogpost.tags
|
306
|
+
}, null, 8, ["chips"])) : i("", !0)
|
307
|
+
]),
|
308
|
+
w(ce, {
|
309
|
+
class: "pd-t-zero pd-medium",
|
310
|
+
blogpost: e.blogpost,
|
311
|
+
user: e.user
|
312
|
+
}, null, 8, ["blogpost", "user"])
|
313
|
+
]));
|
314
|
+
}
|
315
|
+
}, be = { class: "feed" }, he = { key: 1 }, Ce = {
|
316
|
+
__name: "Feed",
|
317
|
+
props: {
|
318
|
+
category: {
|
319
|
+
type: String,
|
320
|
+
default: null
|
321
|
+
},
|
322
|
+
owner: {
|
323
|
+
type: String,
|
324
|
+
default: null
|
325
|
+
},
|
326
|
+
creator: {
|
327
|
+
type: String,
|
328
|
+
default: null
|
329
|
+
},
|
330
|
+
status: {
|
331
|
+
type: String,
|
332
|
+
default: "published"
|
333
|
+
},
|
334
|
+
user: {
|
335
|
+
type: [String, Number],
|
336
|
+
default: null
|
337
|
+
},
|
338
|
+
period: {
|
339
|
+
type: String,
|
340
|
+
default: null
|
341
|
+
}
|
342
|
+
},
|
343
|
+
setup(e) {
|
344
|
+
const t = e, a = g([]), r = g(!0);
|
345
|
+
let s = g(!0), c = g(0), m = g(7);
|
346
|
+
const h = async () => {
|
347
|
+
if (r.value) {
|
348
|
+
c.value += m.value;
|
349
|
+
const n = await S({
|
350
|
+
skip: c.value,
|
351
|
+
limit: m.value,
|
352
|
+
category: t.category,
|
353
|
+
user: t.user,
|
354
|
+
owner: t.owner,
|
355
|
+
status: t.status,
|
356
|
+
creator: t.creator,
|
357
|
+
period: t.period
|
358
|
+
});
|
359
|
+
n.length === 0 && (r.value = !1), a.value = [...a.value, ...n];
|
360
|
+
}
|
361
|
+
};
|
362
|
+
return T(async () => {
|
363
|
+
const n = await S({
|
364
|
+
skip: c.value,
|
365
|
+
limit: m.value,
|
366
|
+
category: t.category,
|
367
|
+
user: t.user,
|
368
|
+
owner: t.owner,
|
369
|
+
status: t.status,
|
370
|
+
creator: t.creator,
|
371
|
+
period: t.period
|
372
|
+
});
|
373
|
+
n.length === 0 ? r.value = !1 : r.value = !0, a.value = n, s.value = !1;
|
374
|
+
}), (n, v) => (o(), l("section", be, [
|
375
|
+
w($, { name: "fade" }, {
|
376
|
+
default: j(() => [
|
377
|
+
d(s) ? (o(), x(re, {
|
378
|
+
key: 0,
|
379
|
+
class: "z-index-5 pos-t-50 left-t-50 pos-absolute"
|
380
|
+
})) : i("", !0)
|
381
|
+
]),
|
382
|
+
_: 1
|
383
|
+
}),
|
384
|
+
w($, { name: "fade" }, {
|
385
|
+
default: j(() => [
|
386
|
+
!d(s) && a.value.length < 1 ? (o(), x(M, {
|
387
|
+
key: 0,
|
388
|
+
title: "No Blog Posts Found",
|
389
|
+
description: "Currently, there are no posts available in this blog. Please check back later.",
|
390
|
+
class: "pd-medium mn-thin bg-grey radius-big"
|
391
|
+
})) : (o(), l("div", he, [
|
392
|
+
(o(!0), l(U, null, E(a.value, (R) => (o(), x(ye, {
|
393
|
+
key: R._id,
|
394
|
+
blogpost: R,
|
395
|
+
user: e.user,
|
396
|
+
class: "mn-medium"
|
397
|
+
}, null, 8, ["blogpost", "user"]))), 128)),
|
398
|
+
w($, { name: "fade" }, {
|
399
|
+
default: j(() => [
|
400
|
+
r.value && a.value.length > 0 ? (o(), l("button", {
|
401
|
+
key: 0,
|
402
|
+
onClick: h,
|
403
|
+
class: "w-100 bg-main button"
|
404
|
+
}, " Load more ")) : i("", !0)
|
405
|
+
]),
|
406
|
+
_: 1
|
407
|
+
})
|
408
|
+
]))
|
409
|
+
]),
|
410
|
+
_: 1
|
411
|
+
})
|
412
|
+
]));
|
413
|
+
}
|
414
|
+
};
|
415
|
+
export {
|
416
|
+
re as L,
|
417
|
+
Ce as _,
|
418
|
+
G as a,
|
419
|
+
J as b,
|
420
|
+
K as c,
|
421
|
+
ye as d,
|
422
|
+
ce as e,
|
423
|
+
je as f,
|
424
|
+
Se as g,
|
425
|
+
S as r,
|
426
|
+
f as s,
|
427
|
+
H as u
|
428
|
+
};
|