@sendelius/vue 0.2.8 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{core → api}/index.d.ts +0 -2
- package/dist/auth/index.d.ts +1 -0
- package/dist/captcha/index.d.ts +1 -0
- package/dist/index.d.ts +3 -1
- package/dist/sendelius-vue.js +7 -4
- package/package.json +1 -1
- /package/dist/{core → api}/api.d.ts +0 -0
- /package/dist/{core → api}/errors.d.ts +0 -0
- /package/dist/{core → api}/requests.d.ts +0 -0
- /package/dist/{core → auth}/auth.d.ts +0 -0
- /package/dist/{core → captcha}/captcha.d.ts +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { useAuth } from './auth.js';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { captcha } from './captcha.js';
|
package/dist/index.d.ts
CHANGED
package/dist/sendelius-vue.js
CHANGED
|
@@ -51,7 +51,7 @@ var ae = Object.defineProperty, oe = Object.getOwnPropertyDescriptor, se = Objec
|
|
|
51
51
|
super(r.message), this.name = "ApiError", this.status = e, this.data = t, this.error = r, this.field = r.field;
|
|
52
52
|
}
|
|
53
53
|
};
|
|
54
|
-
// src/
|
|
54
|
+
// src/api/requests.js
|
|
55
55
|
async function ye(e, t = {}, n = {}) {
|
|
56
56
|
return we("get", e, {
|
|
57
57
|
params: t,
|
|
@@ -78,7 +78,10 @@ async function we(e, t, n = {}, r = {}) {
|
|
|
78
78
|
...r
|
|
79
79
|
}) : await _e()[e](t, n, r);
|
|
80
80
|
} catch (e) {
|
|
81
|
-
throw e.response?.status === 401 && me().onUnauthorized?.(), new ve(
|
|
81
|
+
throw e.response?.status === 401 && me().onUnauthorized?.(), new ve({
|
|
82
|
+
status: e.response?.status ?? null,
|
|
83
|
+
data: e.response?.data ?? null
|
|
84
|
+
});
|
|
82
85
|
}
|
|
83
86
|
let a = i.data;
|
|
84
87
|
if (a?.status !== "success") throw new ve({
|
|
@@ -87,7 +90,7 @@ async function we(e, t, n = {}, r = {}) {
|
|
|
87
90
|
});
|
|
88
91
|
return a;
|
|
89
92
|
}
|
|
90
|
-
// src/
|
|
93
|
+
// src/auth/auth.js
|
|
91
94
|
var Te = t("auth", {
|
|
92
95
|
state: () => ({
|
|
93
96
|
user: {},
|
|
@@ -147,7 +150,7 @@ var Te = t("auth", {
|
|
|
147
150
|
function Ee() {
|
|
148
151
|
return Te();
|
|
149
152
|
}
|
|
150
|
-
// src/
|
|
153
|
+
// src/captcha/captcha.js
|
|
151
154
|
async function De() {
|
|
152
155
|
let e = await Oe(), t = await Ae(e.challenge);
|
|
153
156
|
return ke(e.id, t);
|
package/package.json
CHANGED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|