@ozdao/prometheus-framework 0.1.78 → 0.1.80
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/main.css +1 -1
- package/dist/prometheus-framework/src/components/Button/Button.vue.cjs +1 -1
- package/dist/prometheus-framework/src/components/Button/Button.vue.js +2 -224
- package/dist/prometheus-framework/src/components/Button/Button.vue2.cjs +1 -1
- package/dist/prometheus-framework/src/components/Button/Button.vue2.js +224 -2
- package/dist/prometheus-framework/src/components/Field/Field.vue2.cjs +1 -1
- package/dist/prometheus-framework/src/components/Field/Field.vue2.js +33 -30
- package/dist/prometheus-framework/src/components/LocationMarker/LocationMarker.vue.cjs +1 -1
- package/dist/prometheus-framework/src/components/LocationMarker/LocationMarker.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/auth/components/layouts/Auth.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/auth/components/layouts/Auth.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/auth/components/pages/EnterCode.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/auth/components/pages/EnterCode.vue.js +41 -43
- package/dist/prometheus-framework/src/modules/auth/components/pages/EnterPassword.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/auth/components/pages/EnterPassword.vue.js +33 -35
- package/dist/prometheus-framework/src/modules/auth/components/pages/Invite.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/auth/components/pages/Invite.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/auth/components/pages/ResetPassword.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/auth/components/pages/ResetPassword.vue.js +44 -46
- package/dist/prometheus-framework/src/modules/auth/components/pages/SignIn.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/auth/components/pages/SignIn.vue.js +83 -81
- package/dist/prometheus-framework/src/modules/auth/components/pages/SignUp.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/auth/components/pages/SignUp.vue.js +44 -46
- package/dist/prometheus-framework/src/modules/auth/localization/SignIn.json.cjs +1 -0
- package/dist/prometheus-framework/src/modules/auth/localization/SignIn.json.js +38 -0
- package/dist/prometheus-framework/src/modules/auth/router/auth.cjs +1 -1
- package/dist/prometheus-framework/src/modules/auth/router/auth.js +114 -111
- package/dist/prometheus-framework/src/modules/auth/store/auth.cjs +1 -1
- package/dist/prometheus-framework/src/modules/auth/store/auth.js +93 -75
- package/dist/prometheus-framework/src/modules/community/components/pages/CreateBlogPost.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/community/components/pages/CreateBlogPost.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/constructor/components/elements/Bullets.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/constructor/components/elements/Bullets.vue.js +4 -3
- package/dist/prometheus-framework/src/modules/constructor/components/elements/Caption.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/constructor/components/elements/Caption.vue.js +12 -11
- package/dist/prometheus-framework/src/modules/constructor/components/elements/H2.vue.cjs +2 -2
- package/dist/prometheus-framework/src/modules/constructor/components/elements/H2.vue.js +12 -11
- package/dist/prometheus-framework/src/modules/constructor/components/elements/ImageUpload.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/constructor/components/elements/ImageUpload.vue.js +5 -4
- package/dist/prometheus-framework/src/modules/constructor/components/elements/Textarea.vue.cjs +2 -2
- package/dist/prometheus-framework/src/modules/constructor/components/elements/Textarea.vue.js +20 -19
- package/dist/prometheus-framework/src/modules/events/components/elements/ButtonJoin.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/events/components/elements/ButtonJoin.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/events/components/pages/EditEvent.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/events/components/pages/EditEvent.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/events/components/pages/Events.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/events/components/pages/Events.vue.js +1 -1
- 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 +1 -1
- package/dist/prometheus-framework/src/modules/gallery/components/sections/GalleryWithCategories.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/gallery/components/sections/GalleryWithCategories.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/globals/components/blocks/CardHeader.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/globals/components/blocks/CardHeader.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/globals/localization/vue-i18n.cjs +1 -1
- package/dist/prometheus-framework/src/modules/globals/localization/vue-i18n.js +15 -13
- package/dist/prometheus-framework/src/modules/legal/components/pages/Legal.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/legal/components/pages/Legal.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/elements/ButtonToggleMembership.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/elements/ButtonToggleMembership.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 +1 -1
- 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/pages/OrganizationEdit.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/pages/OrganizationEdit.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/components/sections/MembersAdd.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/sections/MembersAdd.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/sections/Organizations.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/sections/Organizations.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/reports/components/sections/FormReport.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/reports/components/sections/FormReport.vue.js +1 -1
- 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 +1 -1
- package/dist/prometheus-framework/src/modules/users/components/pages/ProfileEdit.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/users/components/pages/ProfileEdit.vue.js +1 -1
- package/dist/prometheus-framework.cjs.js +10 -10
- package/dist/prometheus-framework.es.js +8 -5
- package/dist/style.css +1 -1
- package/package.json +1 -2
- package/src/components/Field/Field.vue +4 -1
- package/src/modules/auth/components/layouts/Auth.vue +45 -36
- package/src/modules/auth/components/pages/EnterCode.vue +0 -17
- package/src/modules/auth/components/pages/EnterPassword.vue +0 -23
- package/src/modules/auth/components/pages/ResetPassword.vue +0 -27
- package/src/modules/auth/components/pages/SignIn.vue +26 -54
- package/src/modules/auth/components/pages/SignUp.vue +0 -29
- package/src/modules/auth/localization/EnterCode.json +14 -0
- package/src/modules/auth/localization/EnterPassword.json +20 -0
- package/src/modules/auth/localization/ResetPassword.json +24 -0
- package/src/modules/auth/localization/SignIn.json +34 -0
- package/src/modules/auth/localization/SignUp.json +26 -0
- package/src/modules/auth/router/auth.js +95 -86
- package/src/modules/auth/store/auth.js +20 -20
- package/src/modules/constructor/components/elements/Bullets.vue +1 -0
- package/src/modules/constructor/components/elements/Caption.vue +1 -0
- package/src/modules/constructor/components/elements/H2.vue +1 -0
- package/src/modules/constructor/components/elements/ImageUpload.vue +1 -1
- package/src/modules/constructor/components/elements/Textarea.vue +1 -0
- package/src/modules/globals/localization/methods/get-app-locales.js +13 -0
- package/src/modules/globals/localization/vue-i18n.js +20 -14
- package/src/modules/globals/localization/vue-i18n.singleton.js +1 -1
- package/src/modules/middlewares/client/inputs.validation.js +1 -0
- package/src/modules/globals/localization/vue-i18n-new.js +0 -70
@@ -1,118 +1,121 @@
|
|
1
|
-
import
|
1
|
+
import o from "../components/layouts/Auth.vue.js";
|
2
2
|
import { resetUser as t, checkUser as n } from "../../middlewares/client/states.validation.js";
|
3
3
|
import { requiresNoAuth as e } from "../../middlewares/client/auth.validation.js";
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
title: {
|
10
|
-
en: "Sign In",
|
11
|
-
ru: "Вход"
|
12
|
-
}
|
13
|
-
},
|
14
|
-
component: r,
|
15
|
-
children: [{
|
16
|
-
path: "signin",
|
17
|
-
name: "Sign In",
|
18
|
-
beforeEnter: [
|
19
|
-
e,
|
20
|
-
t
|
21
|
-
],
|
4
|
+
function s(r) {
|
5
|
+
return [
|
6
|
+
{
|
7
|
+
path: "auth",
|
8
|
+
name: "Authentication",
|
22
9
|
meta: {
|
23
10
|
title: {
|
24
|
-
en: "
|
25
|
-
ru: "
|
26
|
-
}
|
11
|
+
en: "Аутентификация",
|
12
|
+
ru: "Authentication"
|
13
|
+
},
|
14
|
+
options: r
|
27
15
|
},
|
28
|
-
component:
|
29
|
-
|
30
|
-
"
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
"
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
"
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
"
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
"
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
16
|
+
component: o,
|
17
|
+
children: [{
|
18
|
+
path: "signin",
|
19
|
+
name: "Sign In",
|
20
|
+
beforeEnter: [
|
21
|
+
e,
|
22
|
+
t
|
23
|
+
],
|
24
|
+
meta: {
|
25
|
+
title: {
|
26
|
+
en: "Sign In",
|
27
|
+
ru: "Вход"
|
28
|
+
}
|
29
|
+
},
|
30
|
+
component: () => import(
|
31
|
+
/* webpackChunkName: "signin" */
|
32
|
+
"../components/pages/SignIn.vue.js"
|
33
|
+
)
|
34
|
+
}, {
|
35
|
+
path: "reset-password",
|
36
|
+
name: "Reset Password",
|
37
|
+
beforeEnter: [
|
38
|
+
e,
|
39
|
+
t
|
40
|
+
],
|
41
|
+
meta: {
|
42
|
+
title: {
|
43
|
+
en: "Reset Password",
|
44
|
+
ru: "Сбросить Пароль"
|
45
|
+
}
|
46
|
+
},
|
47
|
+
component: () => import(
|
48
|
+
/* webpackChunkName: "reset-password" */
|
49
|
+
"../components/pages/ResetPassword.vue.js"
|
50
|
+
)
|
51
|
+
}, {
|
52
|
+
path: "signup",
|
53
|
+
name: "Sign Up",
|
54
|
+
beforeEnter: [
|
55
|
+
e,
|
56
|
+
t
|
57
|
+
],
|
58
|
+
meta: {
|
59
|
+
title: {
|
60
|
+
en: "Sign Up",
|
61
|
+
ru: "Регистрация"
|
62
|
+
}
|
63
|
+
},
|
64
|
+
component: () => import(
|
65
|
+
/* webpackChunkName: "signup" */
|
66
|
+
"../components/pages/SignUp.vue.js"
|
67
|
+
)
|
68
|
+
}, {
|
69
|
+
path: "enter-code",
|
70
|
+
name: "Enter Code",
|
71
|
+
beforeEnter: [
|
72
|
+
e,
|
73
|
+
n
|
74
|
+
],
|
75
|
+
meta: {
|
76
|
+
title: {
|
77
|
+
en: "Enter Code",
|
78
|
+
ru: "Введите Код"
|
79
|
+
}
|
80
|
+
},
|
81
|
+
component: () => import(
|
82
|
+
/* webpackChunkName: "signup" */
|
83
|
+
"../components/pages/EnterCode.vue.js"
|
84
|
+
)
|
85
|
+
}, {
|
86
|
+
path: "enter-password",
|
87
|
+
name: "Enter Password",
|
88
|
+
beforeEnter: [
|
89
|
+
e,
|
90
|
+
n
|
91
|
+
],
|
92
|
+
meta: {
|
93
|
+
title: {
|
94
|
+
en: "Enter Password",
|
95
|
+
ru: "Введите Пароль"
|
96
|
+
}
|
97
|
+
},
|
98
|
+
component: () => import(
|
99
|
+
/* webpackChunkName: "signup" */
|
100
|
+
"../components/pages/EnterPassword.vue.js"
|
101
|
+
)
|
102
|
+
}, {
|
103
|
+
path: "invite",
|
104
|
+
name: "Invite",
|
105
|
+
meta: {
|
106
|
+
title: {
|
107
|
+
en: "Invite",
|
108
|
+
ru: "Приглашение"
|
109
|
+
}
|
110
|
+
},
|
111
|
+
component: () => import(
|
112
|
+
/* webpackChunkName: "signup" */
|
113
|
+
"../components/pages/Invite.vue.js"
|
114
|
+
)
|
115
|
+
}]
|
116
|
+
}
|
117
|
+
];
|
118
|
+
}
|
116
119
|
export {
|
117
|
-
|
120
|
+
s as default
|
118
121
|
};
|
@@ -1 +1 @@
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const f=require("../../../../node_modules/axios/lib/axios.cjs"),p=require("../../../../../node_modules/js-cookie/src/js.cookie.cjs"),l=require("../../../../node_modules/@capacitor/core/dist/index.cjs"),w=require("vue"),n=require("../../globals/store/globals.cjs"),O=require("./twofa.cjs"),i=f.default.create({baseURL:process.env.API_URL,withCredentials:!0}),a=w.reactive({user:{_id:void 0,username:"",email:"",phone:"",password:"",passwordRepeat:""},access:{roles:null,token:null,status:!1}});async function k(){const e=await P("user");if(e){const{_id:t,email:s,phone:c,roles:o,accessToken:r}=e;Object.assign(a.user,{_id:t,email:s,phone:c}),Object.assign(a.access,{token:r,roles:o,status:!!r}),i.interceptors.request.use(u=>(r&&(u.headers["x-access-token"]=r),u),u=>Promise.reject(u))}}k();const g={async login(e,t){try{const s=await i.post("/api/auth/signin",{...e,type:t});return d("user",s.data),Object.assign(a.user,{...s.data}),Object.assign(a.access,{token:s.data.accessToken,status:!0,roles:s.data.roles}),s.data}catch(s){return Object.assign(a.access,{token:null,status:!1,roles:null}),n.setError(s),Promise.reject(s)}},async signup(e,t,s){const{password:c,passwordRepeat:o}=a.user;if(c!==o){const r={response:{data:{errorCode:"PASSWORDS_DO_NOT_MATCH"}}};throw n.setError(r),new Error(r.response.status)}try{e.phone=e.phone.number;const r=await i.post("/api/auth/signup",{...e,type:t,inviteCode:s});return r.data.accessToken&&d("user",r.data),Object.assign(a.user,{...r.data}),Object.assign(a.access,{token:r.data.accessToken,status:!0,roles:r.data.roles}),r.data}catch(r){throw n.setError(r),console.log("Sign up falied"),r}},logout(){b("user"),Object.assign(a.user,{email:"",phone:"",password:"",passwordRepeat:""}),Object.assign(a.access,{token:null,status:!1})},async resetPassword(e,t){try{const s=await i.post("/api/auth/reset-password",{email:e.email,phone:e.phone.number,type:t});return Object.assign(O.state.code,{...s.data,isSended:!0}),s.data}catch(s){return n.setError(s),Promise.reject(s)}},async updatePassword(e,t){const{password:s,passwordRepeat:c}=a.user;if(s!==c){const o={response:{data:{errorCode:"PASSWORDS_DO_NOT_MATCH"}}};throw n.setError(o),new Error(o.response.status)}try{const o=await i.post("/api/auth/update-password",{email:e.email,phone:e.phone.number,password:e.password,passwordRepeat:e.passwordRepeat,type:t});return o.data.accessToken&&d("user",o.data),Object.assign(a.user,{...o.data}),Object.assign(a.access,{token:o.data.accessToken,status:!0}),o.data}catch(o){return n.setError(o),Promise.reject(o)}}},h={development:{secure:!1,expires:1},production:{expires:1,domain:process.env.API_URL,sameSite:"none",secure:!0}};function P(e){if(process.env.MOBILE_APP){const t=p.default.get(e);return t?JSON.parse(t):null}else{const t=p.default.get(e);return t?JSON.parse(t):null}}function d(e,t,s=process.env.NODE_ENV){process.env.MOBILE_APP?l.CapacitorCookies.setCookie({url:process.env.API_URL,key:e,value:JSON.stringify(t)}):p.default.set(e,JSON.stringify(t),h[s])}function b(e,t=process.env.NODE_ENV){if(process.env.MOBILE_APP)l.CapacitorCookies.deleteCookie({url:process.env.API_URL,key:e});else{const s=t==="production"?{domain:process.env.API_URL}:{};p.default.remove(e,s)}}w.watch(a,(e,t)=>{});exports.actions=g;exports.state=a;
|
@@ -1,10 +1,10 @@
|
|
1
|
-
import
|
1
|
+
import m from "../../../../node_modules/axios/lib/axios.js";
|
2
2
|
import u from "../../../../../node_modules/js-cookie/src/js.cookie.js";
|
3
|
-
import { CapacitorCookies as
|
4
|
-
import { reactive as
|
3
|
+
import { CapacitorCookies as l } from "../../../../node_modules/@capacitor/core/dist/index.js";
|
4
|
+
import { reactive as w, watch as f } from "vue";
|
5
5
|
import { setError as n } from "../../globals/store/globals.js";
|
6
|
-
import { state as
|
7
|
-
const
|
6
|
+
import { state as O } from "./twofa.js";
|
7
|
+
const i = m.create({ baseURL: process.env.API_URL, withCredentials: !0 }), a = w({
|
8
8
|
user: {
|
9
9
|
_id: void 0,
|
10
10
|
username: "",
|
@@ -18,137 +18,155 @@ const c = l.create({ baseURL: process.env.API_URL, withCredentials: !0 }), r = m
|
|
18
18
|
token: null,
|
19
19
|
status: !1
|
20
20
|
}
|
21
|
-
})
|
22
|
-
|
21
|
+
});
|
22
|
+
async function k() {
|
23
|
+
const e = await h("user");
|
24
|
+
if (e) {
|
25
|
+
const { _id: t, email: s, phone: c, roles: r, accessToken: o } = e;
|
26
|
+
Object.assign(a.user, { _id: t, email: s, phone: c }), Object.assign(a.access, { token: o, roles: r, status: !!o }), i.interceptors.request.use((p) => (o && (p.headers["x-access-token"] = o), p), (p) => Promise.reject(p));
|
27
|
+
}
|
28
|
+
}
|
29
|
+
k();
|
30
|
+
const R = {
|
31
|
+
async login(e, t) {
|
23
32
|
try {
|
24
|
-
const
|
25
|
-
...
|
33
|
+
const s = await i.post("/api/auth/signin", {
|
34
|
+
...e,
|
26
35
|
type: t
|
27
36
|
});
|
28
|
-
return
|
29
|
-
...
|
30
|
-
}), Object.assign(
|
31
|
-
token:
|
37
|
+
return d("user", s.data), Object.assign(a.user, {
|
38
|
+
...s.data
|
39
|
+
}), Object.assign(a.access, {
|
40
|
+
token: s.data.accessToken,
|
32
41
|
status: !0,
|
33
|
-
roles:
|
34
|
-
}),
|
35
|
-
} catch (
|
36
|
-
return Object.assign(
|
42
|
+
roles: s.data.roles
|
43
|
+
}), s.data;
|
44
|
+
} catch (s) {
|
45
|
+
return Object.assign(a.access, {
|
37
46
|
token: null,
|
38
47
|
status: !1,
|
39
48
|
roles: null
|
40
|
-
}), n(
|
49
|
+
}), n(s), Promise.reject(s);
|
41
50
|
}
|
42
51
|
},
|
43
|
-
async signup(
|
44
|
-
const { password:
|
45
|
-
if (
|
46
|
-
const
|
52
|
+
async signup(e, t, s) {
|
53
|
+
const { password: c, passwordRepeat: r } = a.user;
|
54
|
+
if (c !== r) {
|
55
|
+
const o = {
|
47
56
|
response: {
|
48
57
|
data: { errorCode: "PASSWORDS_DO_NOT_MATCH" }
|
49
58
|
}
|
50
59
|
};
|
51
|
-
throw n(
|
60
|
+
throw n(o), new Error(o.response.status);
|
52
61
|
}
|
53
62
|
try {
|
54
|
-
|
55
|
-
const
|
56
|
-
...
|
63
|
+
e.phone = e.phone.number;
|
64
|
+
const o = await i.post("/api/auth/signup", {
|
65
|
+
...e,
|
57
66
|
type: t,
|
58
|
-
inviteCode:
|
67
|
+
inviteCode: s
|
59
68
|
});
|
60
|
-
return
|
61
|
-
...
|
62
|
-
}), Object.assign(
|
63
|
-
token:
|
69
|
+
return o.data.accessToken && d("user", o.data), Object.assign(a.user, {
|
70
|
+
...o.data
|
71
|
+
}), Object.assign(a.access, {
|
72
|
+
token: o.data.accessToken,
|
64
73
|
status: !0,
|
65
|
-
roles:
|
66
|
-
}),
|
67
|
-
} catch (
|
68
|
-
throw n(
|
74
|
+
roles: o.data.roles
|
75
|
+
}), o.data;
|
76
|
+
} catch (o) {
|
77
|
+
throw n(o), console.log("Sign up falied"), o;
|
69
78
|
}
|
70
79
|
},
|
71
80
|
logout() {
|
72
|
-
|
81
|
+
P("user"), Object.assign(a.user, {
|
73
82
|
email: "",
|
74
83
|
phone: "",
|
75
84
|
password: "",
|
76
85
|
passwordRepeat: ""
|
77
|
-
}), Object.assign(
|
86
|
+
}), Object.assign(a.access, {
|
78
87
|
token: null,
|
79
88
|
status: !1
|
80
89
|
});
|
81
90
|
},
|
82
|
-
async resetPassword(
|
91
|
+
async resetPassword(e, t) {
|
83
92
|
try {
|
84
|
-
const
|
85
|
-
email:
|
86
|
-
phone:
|
93
|
+
const s = await i.post("/api/auth/reset-password", {
|
94
|
+
email: e.email,
|
95
|
+
phone: e.phone.number,
|
87
96
|
type: t
|
88
97
|
});
|
89
|
-
return Object.assign(
|
90
|
-
...
|
98
|
+
return Object.assign(O.code, {
|
99
|
+
...s.data,
|
91
100
|
isSended: !0
|
92
|
-
}),
|
93
|
-
} catch (
|
94
|
-
return n(
|
101
|
+
}), s.data;
|
102
|
+
} catch (s) {
|
103
|
+
return n(s), Promise.reject(s);
|
95
104
|
}
|
96
105
|
},
|
97
|
-
async updatePassword(
|
98
|
-
const { password:
|
99
|
-
if (
|
100
|
-
const
|
106
|
+
async updatePassword(e, t) {
|
107
|
+
const { password: s, passwordRepeat: c } = a.user;
|
108
|
+
if (s !== c) {
|
109
|
+
const r = {
|
101
110
|
response: {
|
102
111
|
data: { errorCode: "PASSWORDS_DO_NOT_MATCH" }
|
103
112
|
}
|
104
113
|
};
|
105
|
-
throw n(
|
114
|
+
throw n(r), new Error(r.response.status);
|
106
115
|
}
|
107
116
|
try {
|
108
|
-
const
|
109
|
-
email:
|
110
|
-
phone:
|
111
|
-
password:
|
112
|
-
passwordRepeat:
|
117
|
+
const r = await i.post("/api/auth/update-password", {
|
118
|
+
email: e.email,
|
119
|
+
phone: e.phone.number,
|
120
|
+
password: e.password,
|
121
|
+
passwordRepeat: e.passwordRepeat,
|
113
122
|
type: t
|
114
123
|
});
|
115
|
-
return
|
116
|
-
...
|
117
|
-
}), Object.assign(
|
118
|
-
token:
|
124
|
+
return r.data.accessToken && d("user", r.data), Object.assign(a.user, {
|
125
|
+
...r.data
|
126
|
+
}), Object.assign(a.access, {
|
127
|
+
token: r.data.accessToken,
|
119
128
|
status: !0
|
120
|
-
}),
|
121
|
-
} catch (
|
122
|
-
return n(
|
129
|
+
}), r.data;
|
130
|
+
} catch (r) {
|
131
|
+
return n(r), Promise.reject(r);
|
123
132
|
}
|
124
133
|
}
|
125
|
-
},
|
134
|
+
}, g = {
|
126
135
|
development: { secure: !1, expires: 1 },
|
127
136
|
production: { expires: 1, domain: process.env.API_URL, sameSite: "none", secure: !0 }
|
128
137
|
};
|
129
|
-
function
|
130
|
-
process.env.MOBILE_APP
|
138
|
+
function h(e) {
|
139
|
+
if (process.env.MOBILE_APP) {
|
140
|
+
const t = u.get(e);
|
141
|
+
return t ? JSON.parse(t) : null;
|
142
|
+
} else {
|
143
|
+
const t = u.get(e);
|
144
|
+
return t ? JSON.parse(t) : null;
|
145
|
+
}
|
146
|
+
}
|
147
|
+
function d(e, t, s = process.env.NODE_ENV) {
|
148
|
+
process.env.MOBILE_APP ? l.setCookie({
|
131
149
|
url: process.env.API_URL,
|
132
150
|
// используйте ваш API_URL
|
133
|
-
key:
|
151
|
+
key: e,
|
134
152
|
value: JSON.stringify(t)
|
135
|
-
}) : u.set(
|
153
|
+
}) : u.set(e, JSON.stringify(t), g[s]);
|
136
154
|
}
|
137
|
-
function
|
155
|
+
function P(e, t = process.env.NODE_ENV) {
|
138
156
|
if (process.env.MOBILE_APP)
|
139
|
-
|
157
|
+
l.deleteCookie({
|
140
158
|
url: process.env.API_URL,
|
141
159
|
// используйте ваш API_URL
|
142
|
-
key:
|
160
|
+
key: e
|
143
161
|
});
|
144
162
|
else {
|
145
|
-
const
|
146
|
-
u.remove(
|
163
|
+
const s = t === "production" ? { domain: process.env.API_URL } : {};
|
164
|
+
u.remove(e, s);
|
147
165
|
}
|
148
166
|
}
|
149
|
-
|
167
|
+
f(a, (e, t) => {
|
150
168
|
});
|
151
169
|
export {
|
152
170
|
R as actions,
|
153
|
-
|
171
|
+
a as state
|
154
172
|
};
|
package/dist/prometheus-framework/src/modules/community/components/pages/CreateBlogPost.vue.cjs
CHANGED
@@ -1 +1 @@
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),w=require("../../../constructor/components/elements/Textarea.vue.cjs"),V=require("../../../constructor/components/sections/Constructor.vue.cjs"),y=require("../../../../components/Popup/Popup.vue.cjs");require("../../../../components/FieldTags/tag-input.vue.cjs");require("../../../../components/FieldTags/vue-tags-input.scss.cjs");const B=require("../../../../components/FieldTags/BlockTags.vue.cjs"),N=require("../../../../components/Checkbox/Checkbox.vue.cjs"),P=require("../../../../components/SelectMulti/SelectMulti.vue.cjs"),x=require("../../../../components/Button/Button.
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),w=require("../../../constructor/components/elements/Textarea.vue.cjs"),V=require("../../../constructor/components/sections/Constructor.vue.cjs"),y=require("../../../../components/Popup/Popup.vue.cjs");require("../../../../components/FieldTags/tag-input.vue.cjs");require("../../../../components/FieldTags/vue-tags-input.scss.cjs");const B=require("../../../../components/FieldTags/BlockTags.vue.cjs"),N=require("../../../../components/Checkbox/Checkbox.vue.cjs"),P=require("../../../../components/SelectMulti/SelectMulti.vue.cjs"),x=require("../../../../components/Button/Button.vue2.cjs"),f=require("vue-router"),n=require("../../store/blogposts.cjs"),i=require("../../../auth/store/auth.cjs"),C=require("../../../organizations/store/organizations.cjs"),q={class:"pd-thin"},E={key:0,class:"h-100 w-100 bg-grey pd-big radius-big"},T={class:"w-full h-full"},z={key:1,class:"pd-thin pos-sticky pos-l-0 pos-b-0 w-100"},O={class:"pd-thin radius-big bg-main w-100 flex-nowrap flex"},D=e.createElementVNode("h3",{class:"mn-small"},"Final Touches",-1),M=e.createElementVNode("h5",{class:"mn-thin"},"Add to public:",-1),S={key:0,class:"mn-thin"},U={key:1,class:"mn-medium br-grey br-2px br-solid pd-small radius-big"},A={__name:"CreateBlogPost",setup(R){const s=f.useRoute(),u=f.useRouter();let t=e.ref(null),p=e.ref(null);const c=e.ref([]),r=e.ref(null);e.onMounted(async()=>{if(s.params.url){const a=await n.read({user:i.state.user._id,url:s.params.url});t.value=a.pop()}else n.clean(),t.value=n.state.current;t.value.owner||(t.value.owner={target:i.state.user._id,type:"user"}),t.value.creator||(t.value.creator={target:i.state.user._id,type:"user",hidden:!1}),t.value.owner.type==="organization"&&(r.value={_id:t.value.owner.target._id,name:t.value.owner.target.profile.name,photo:t.value.owner.target.profile.photo});const o=await C.actions.read({user:i.state.user._id,postable:i.state.user._id,limit:100});console.log(o),p.value=o.map(a=>({name:a.profile.name,_id:a._id,photo:a.profile.photo}))});const g=e.ref(""),m=e.ref([{text:"story"},{text:"news"},{text:"guide"},{text:"discussion"},{text:"photos"}]);e.computed(()=>m.value.filter(o=>o.text.toLowerCase().includes(g.value.toLowerCase()))),e.computed(()=>m.value.filter(o=>!c.value.some(a=>a.text===o.text)));const d=e.ref(!1);function v(){d.value=!0}function h(){d.value=!1}function b(){c.value.length>0&&c.value.map(o=>o.text),t.value.status="draft",s.params.url?n.update(t.value).then(o=>{u.push({name:"BlogPost",params:{url:o.url}})}).catch(o=>{console.log(o)}):n.create(t.value).then(o=>{u.push({name:"BlogPost",params:{url:o.url}})}).catch(o=>{console.log(o)})}function k(){r.value&&(t.value.owner={target:r.value._id,type:"organization"}),r.value||(t.value.creator.hidden=!1),r.value||(t.value.organization=t.value.creator),t.value.status="published",console.log(t.value),s.params.url?n.update(t.value).then(o=>{u.push({name:"BlogPost",params:{url:o.url}})}).catch(o=>{console.log(o)}):n.create(t.value).then(o=>{u.push({name:"BlogPost",params:{url:o.url}})}).catch(o=>{console.log(o)})}function _(){confirm("Are you sure you want to delete this post?")&&n.remove(t.value._id).then(o=>{u.push({name:"User Blogposts",params:{_id:t.value.creator.target._id}})}).catch(o=>{console.log(o)})}return(o,a)=>(e.openBlock(),e.createElementBlock("article",q,[e.unref(t)?(e.openBlock(),e.createElementBlock("section",E,[e.createElementVNode("div",T,[e.createVNode(w.default,{prop:e.unref(t),content:"name",placeholder:"Enter post title",class:"h2"},null,8,["prop"])]),e.createVNode(V.default,{content:e.unref(t).content,onUpdate:a[0]||(a[0]=l=>e.unref(t).content=l)},null,8,["content"])])):e.createCommentVNode("",!0),e.unref(t)?(e.openBlock(),e.createElementBlock("section",z,[e.createElementVNode("div",O,[e.unref(s).params.url?(e.openBlock(),e.createElementBlock("a",{key:0,onClick:a[1]||(a[1]=l=>_()),class:"mn-r-auto bg-red t-white t-black button"},"Delete")):e.createCommentVNode("",!0),e.createElementVNode("a",{onClick:a[2]||(a[2]=l=>b()),class:"mn-l-auto bg-white t-black button"},"To Drafts"),e.createElementVNode("a",{onClick:a[3]||(a[3]=l=>v()),class:"mn-l-thin bg-black t-white button"},"Publish")])])):e.createCommentVNode("",!0),e.createVNode(y.default,{title:"Добавить участника",onClosePopup:h,isPopupOpen:d.value,class:"w-m-33r t-left pd-big bg-white radius-big"},{default:e.withCtx(()=>[D,e.createVNode(B.default,{onTagsChanged:a[4]||(a[4]=l=>e.unref(t).tags=l),tags:e.unref(t).tags},null,8,["tags"]),M,e.createVNode(P.default,{modelValue:r.value,"onUpdate:modelValue":a[5]||(a[5]=l=>r.value=l),options:e.unref(p),multiple:!1,taggable:!1,placeholder:"Type to search or add tag",label:"name","track-by":"_id",class:"mn-medium bg-grey radius-medium pd-small"},null,8,["modelValue","options"]),r.value?(e.openBlock(),e.createElementBlock("h5",S,"Options:")):e.createCommentVNode("",!0),r.value?(e.openBlock(),e.createElementBlock("div",U,[e.createVNode(N.default,{label:"Hide Author",radio:e.unref(t).creator.hidden,"onUpdate:radio":a[6]||(a[6]=l=>e.unref(t).creator.hidden=l),name:"prices",class:"w-100"},null,8,["radio"])])):e.createCommentVNode("",!0),e.createVNode(x.default,{submit:k,callback:o.redirectTo,class:"w-100 bg-black t-white"},{default:e.withCtx(()=>[e.createTextVNode("Publish")]),_:1},8,["callback"])]),_:1},8,["isPopupOpen"])]))}};exports.default=A;
|
package/dist/prometheus-framework/src/modules/community/components/pages/CreateBlogPost.vue.js
CHANGED
@@ -7,7 +7,7 @@ import "../../../../components/FieldTags/vue-tags-input.scss.js";
|
|
7
7
|
import U from "../../../../components/FieldTags/BlockTags.vue.js";
|
8
8
|
import A from "../../../../components/Checkbox/Checkbox.vue.js";
|
9
9
|
import E from "../../../../components/SelectMulti/SelectMulti.vue.js";
|
10
|
-
import L from "../../../../components/Button/Button.
|
10
|
+
import L from "../../../../components/Button/Button.vue2.js";
|
11
11
|
import { useRoute as M, useRouter as R } from "vue-router";
|
12
12
|
import { read as S, clean as F, state as H, update as k, create as y, remove as j } from "../../store/blogposts.js";
|
13
13
|
import { state as f } from "../../../auth/store/auth.js";
|
package/dist/prometheus-framework/src/modules/constructor/components/elements/Bullets.vue.cjs
CHANGED
@@ -1,2 +1,2 @@
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),f=["placeholder"],h={__name:"Bullets",props:["obj","label","prop","value","content","textarea","placeholder","index","ref"],emits:["deleteBlock","addBlock","focus"],setup(t,{emit:i}){const l=t;e.ref(l);const r=e.ref(null);function p(n){const o=/^\s*[-*]\s+(.*)/;let s=n.target.value.split(/\n+/).map(u=>{const d=o.exec(u);return d?d[1]:null}).filter(u=>u!==null);s.length>0?(l.prop[l.content]=s,a()):n.target.value.trim()===""&&(l.prop[l.content]=[],a())}function a(){r.value.style.height="1rem",r.value.style.height=r.value.scrollHeight+"px"}return e.onUpdated(()=>{a()}),e.onMounted(()=>{a()}),e.watch(()=>l.prop[l.content],n=>{(!n||n.length===0)&&i("deleteBlock",l.prop)}),(n,o)=>(e.openBlock(),e.createElementBlock("div",null,[e.createTextVNode(e.toDisplayString(t.prop[t.content])+" ",1),e.withDirectives(e.createElementVNode("textarea",{"onUpdate:modelValue":o[0]||(o[0]=c=>t.prop[t.content]=c),placeholder:t.placeholder?t.placeholder:"Enter text",onInput:p,onFocus:o[1]||(o[1]=c=>i("focus",r.value)),ref_key:"textarea",ref:r,class:"text-area mn-small"},`
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),f=["placeholder"],h={__name:"Bullets",props:["obj","label","prop","value","content","textarea","placeholder","index","ref"],emits:["deleteBlock","addBlock","focus"],setup(t,{emit:i}){const l=t;e.ref(l);const r=e.ref(null);function p(n){const o=/^\s*[-*]\s+(.*)/;let s=n.target.value.split(/\n+/).map(u=>{const d=o.exec(u);return d?d[1]:null}).filter(u=>u!==null);s.length>0?(l.prop[l.content]=s,a()):n.target.value.trim()===""&&(l.prop[l.content]=[],a())}function a(){r.value.style.height="1rem",r.value.style.height=r.value.scrollHeight+"px"}return e.onUpdated(()=>{a()}),e.onMounted(()=>{a()}),e.watch(()=>l.prop[l.content],n=>{(!n||n.length===0)&&i("deleteBlock",l.prop)}),(n,o)=>(e.openBlock(),e.createElementBlock("div",null,[e.createTextVNode(e.toDisplayString(t.prop[t.content])+" ",1),e.withDirectives(e.createElementVNode("textarea",{"onUpdate:modelValue":o[0]||(o[0]=c=>t.prop[t.content]=c),placeholder:t.placeholder?t.placeholder:"Enter text",onInput:p,onFocus:o[1]||(o[1]=c=>i("focus",r.value)),ref_key:"textarea",ref:r,tabindex:"-1",class:"text-area mn-small"},`
|
2
2
|
`,40,f),[[e.vModelText,t.prop[t.content]]])]))}};exports.default=h;
|
package/dist/prometheus-framework/src/modules/constructor/components/elements/Bullets.vue.js
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
import { ref as d, onUpdated as f, onMounted as
|
1
|
+
import { ref as d, onUpdated as f, onMounted as x, watch as h, openBlock as m, createElementBlock as v, createTextVNode as g, toDisplayString as k, withDirectives as B, createElementVNode as b, vModelText as y } from "vue";
|
2
2
|
const E = ["placeholder"], I = {
|
3
3
|
__name: "Bullets",
|
4
4
|
props: ["obj", "label", "prop", "value", "content", "textarea", "placeholder", "index", "ref"],
|
@@ -20,9 +20,9 @@ const E = ["placeholder"], I = {
|
|
20
20
|
}
|
21
21
|
return f(() => {
|
22
22
|
a();
|
23
|
-
}),
|
23
|
+
}), x(() => {
|
24
24
|
a();
|
25
|
-
}),
|
25
|
+
}), h(() => t.prop[t.content], (l) => {
|
26
26
|
(!l || l.length === 0) && u("deleteBlock", t.prop);
|
27
27
|
}), (l, n) => (m(), v("div", null, [
|
28
28
|
g(k(e.prop[e.content]) + " ", 1),
|
@@ -33,6 +33,7 @@ const E = ["placeholder"], I = {
|
|
33
33
|
onFocus: n[1] || (n[1] = (r) => u("focus", o.value)),
|
34
34
|
ref_key: "textarea",
|
35
35
|
ref: o,
|
36
|
+
tabindex: "-1",
|
36
37
|
class: "text-area mn-small"
|
37
38
|
}, `
|
38
39
|
`, 40, E), [
|
package/dist/prometheus-framework/src/modules/constructor/components/elements/Caption.vue.cjs
CHANGED
@@ -1,2 +1,2 @@
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),f=["placeholder"],h={__name:"Caption",props:["obj","label","prop","value","content","textarea","placeholder","index","ref"],emits:["deleteBlock","addBlock","focus"],setup(l,{emit:
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),f=["placeholder"],h={__name:"Caption",props:["obj","label","prop","value","content","textarea","placeholder","index","ref"],emits:["deleteBlock","addBlock","focus"],setup(l,{emit:i}){const t=l;e.ref(t);const r=e.ref(null);function p(n){const o=/^\s*[-*]\s+(.*)/;let s=n.target.value.split(/\n+/).map(u=>{const d=o.exec(u);return d?d[1]:null}).filter(u=>u!==null);s.length>0?(t.prop[t.content]=s,a()):n.target.value.trim()===""&&(t.prop[t.content]=[],a())}function a(){r.value.style.height="1rem",r.value.style.height=r.value.scrollHeight+"px"}return e.onUpdated(()=>{a()}),e.onMounted(()=>{a()}),e.watch(()=>t.prop[t.content],n=>{(!n||n.length===0)&&i("deleteBlock",t.prop)}),(n,o)=>(e.openBlock(),e.createElementBlock("div",null,[e.withDirectives(e.createElementVNode("textarea",{"onUpdate:modelValue":o[0]||(o[0]=c=>l.prop[l.content]=c),placeholder:l.placeholder?l.placeholder:"Enter text",onInput:p,onFocus:o[1]||(o[1]=c=>i("focus",r.value)),ref_key:"textarea",ref:r,tabindex:"-1",class:"br-l br-solid br-main pd-l-small text-area mn-small"},`
|
2
2
|
`,40,f),[[e.vModelText,l.prop[l.content]]])]))}};exports.default=h;
|
package/dist/prometheus-framework/src/modules/constructor/components/elements/Caption.vue.js
CHANGED
@@ -1,19 +1,19 @@
|
|
1
|
-
import { ref as
|
1
|
+
import { ref as d, onUpdated as f, onMounted as m, watch as h, openBlock as x, createElementBlock as v, withDirectives as b, createElementVNode as g, vModelText as k } from "vue";
|
2
2
|
const B = ["placeholder"], E = {
|
3
3
|
__name: "Caption",
|
4
4
|
props: ["obj", "label", "prop", "value", "content", "textarea", "placeholder", "index", "ref"],
|
5
5
|
emits: ["deleteBlock", "addBlock", "focus"],
|
6
|
-
setup(t, { emit:
|
6
|
+
setup(t, { emit: i }) {
|
7
7
|
const e = t;
|
8
|
-
|
9
|
-
const o =
|
10
|
-
function
|
8
|
+
d(e);
|
9
|
+
const o = d(null);
|
10
|
+
function p(l) {
|
11
11
|
const n = /^\s*[-*]\s+(.*)/;
|
12
|
-
let
|
12
|
+
let s = l.target.value.split(/\n+/).map((c) => {
|
13
13
|
const u = n.exec(c);
|
14
14
|
return u ? u[1] : null;
|
15
15
|
}).filter((c) => c !== null);
|
16
|
-
|
16
|
+
s.length > 0 ? (e.prop[e.content] = s, a()) : l.target.value.trim() === "" && (e.prop[e.content] = [], a());
|
17
17
|
}
|
18
18
|
function a() {
|
19
19
|
o.value.style.height = "1rem", o.value.style.height = o.value.scrollHeight + "px";
|
@@ -23,15 +23,16 @@ const B = ["placeholder"], E = {
|
|
23
23
|
}), m(() => {
|
24
24
|
a();
|
25
25
|
}), h(() => e.prop[e.content], (l) => {
|
26
|
-
(!l || l.length === 0) &&
|
26
|
+
(!l || l.length === 0) && i("deleteBlock", e.prop);
|
27
27
|
}), (l, n) => (x(), v("div", null, [
|
28
|
-
g(
|
28
|
+
b(g("textarea", {
|
29
29
|
"onUpdate:modelValue": n[0] || (n[0] = (r) => t.prop[t.content] = r),
|
30
30
|
placeholder: t.placeholder ? t.placeholder : "Enter text",
|
31
|
-
onInput:
|
32
|
-
onFocus: n[1] || (n[1] = (r) =>
|
31
|
+
onInput: p,
|
32
|
+
onFocus: n[1] || (n[1] = (r) => i("focus", o.value)),
|
33
33
|
ref_key: "textarea",
|
34
34
|
ref: o,
|
35
|
+
tabindex: "-1",
|
35
36
|
class: "br-l br-solid br-main pd-l-small text-area mn-small"
|
36
37
|
}, `
|
37
38
|
`, 40, B), [
|