@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.
@@ -1,5 +1,3 @@
1
1
  export { initApi, getClient } from './api.js';
2
- export { useAuth } from './auth.js';
3
2
  export { get, post, put, patch, remove, request } from './requests.js';
4
3
  export { ApiError } from './errors.js';
5
- export { captcha } from './captcha.js';
@@ -0,0 +1 @@
1
+ export { useAuth } from './auth.js';
@@ -0,0 +1 @@
1
+ export { captcha } from './captcha.js';
package/dist/index.d.ts CHANGED
@@ -1,4 +1,6 @@
1
1
  export * from './config';
2
- export * from './core';
2
+ export * from './api';
3
+ export * from './auth';
4
+ export * from './captcha';
3
5
  export * from './helpers';
4
6
  export * from './ui';
@@ -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/core/requests.js
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(e);
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/core/auth.js
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/core/captcha.js
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
@@ -45,5 +45,5 @@
45
45
  "@parcel/watcher@2.6.0": true,
46
46
  "vue-demi@0.14.10": true
47
47
  },
48
- "version": "0.2.8"
48
+ "version": "0.3.0"
49
49
  }
File without changes
File without changes
File without changes
File without changes
File without changes