@duxweb/dvha-core 0.1.22 → 0.1.23
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/cjs/components/overlay/overlay.cjs +1 -1
- package/dist/cjs/hooks/data.cjs +1 -1
- package/dist/cjs/hooks/select.cjs +1 -1
- package/dist/cjs/hooks/theme.cjs +1 -1
- package/dist/cjs/hooks/tree.cjs +1 -0
- package/dist/cjs/hooks/upload.cjs +1 -1
- package/dist/cjs/index.cjs +1 -1
- package/dist/cjs/preset/dataProvider.cjs +1 -1
- package/dist/esm/components/overlay/overlay.js +3 -4
- package/dist/esm/hooks/data.js +273 -263
- package/dist/esm/hooks/select.js +48 -46
- package/dist/esm/hooks/theme.js +1 -1
- package/dist/esm/hooks/tree.js +41 -0
- package/dist/esm/hooks/upload.js +1 -0
- package/dist/esm/index.js +62 -60
- package/dist/esm/preset/dataProvider.js +67 -63
- package/dist/types/hooks/data.d.ts +72 -0
- package/dist/types/hooks/index.d.ts +2 -2
- package/dist/types/hooks/select.d.ts +30 -1
- package/dist/types/hooks/tree.d.ts +2 -3
- package/dist/types/hooks/upload.d.ts +1 -1
- package/dist/types/preset/dataProvider.d.ts +1 -0
- package/dist/types/types/data.d.ts +3 -0
- package/package.json +2 -1
package/dist/esm/hooks/select.js
CHANGED
|
@@ -1,85 +1,87 @@
|
|
|
1
|
-
import { debounce as
|
|
2
|
-
import { ref as
|
|
3
|
-
import { useList as
|
|
4
|
-
function
|
|
5
|
-
const r =
|
|
1
|
+
import { debounce as k, isArray as A } from "lodash-es";
|
|
2
|
+
import { ref as u, computed as c, watch as E } from "vue";
|
|
3
|
+
import { useList as L, useMany as O } from "./data.js";
|
|
4
|
+
function D(t) {
|
|
5
|
+
const r = u(), s = u({
|
|
6
6
|
page: 1,
|
|
7
|
-
pageSize: typeof
|
|
8
|
-
}), d =
|
|
7
|
+
pageSize: typeof t.pagination == "number" ? t.pagination : t.pagination ? 20 : 0
|
|
8
|
+
}), d = u(!1), h = k((e) => {
|
|
9
9
|
r.value = e;
|
|
10
|
-
},
|
|
10
|
+
}, t.debounce || 300), V = (e) => {
|
|
11
11
|
h(e);
|
|
12
|
-
}, { data: f, isLoading:
|
|
12
|
+
}, { data: f, isLoading: b, total: w, pageCount: S } = L({
|
|
13
13
|
get path() {
|
|
14
|
-
return
|
|
14
|
+
return t.path || "";
|
|
15
15
|
},
|
|
16
16
|
get filters() {
|
|
17
|
-
const e = { ...
|
|
18
|
-
return r.value && (e[
|
|
17
|
+
const e = { ...t.params };
|
|
18
|
+
return r.value && (e[t.keywordField || "keyword"] = r.value), e;
|
|
19
19
|
},
|
|
20
20
|
get pagination() {
|
|
21
|
-
return
|
|
21
|
+
return t.pagination ? s.value : void 0;
|
|
22
22
|
},
|
|
23
23
|
get providerName() {
|
|
24
|
-
return
|
|
24
|
+
return t.providerName;
|
|
25
25
|
}
|
|
26
|
-
}),
|
|
27
|
-
const
|
|
28
|
-
return typeof
|
|
29
|
-
},
|
|
30
|
-
const { optionLabel:
|
|
26
|
+
}), g = u([]), v = (e) => {
|
|
27
|
+
const a = t.optionField || t.optionValue;
|
|
28
|
+
return typeof a == "string" ? e[a] || e.value || e.id : typeof a == "function" ? a(e) : e.value || e.id;
|
|
29
|
+
}, x = (e) => {
|
|
30
|
+
const { optionLabel: a = "label", optionValue: o = "value" } = t;
|
|
31
31
|
let l;
|
|
32
|
-
typeof
|
|
33
|
-
let
|
|
34
|
-
return typeof
|
|
32
|
+
typeof a == "function" ? l = a(e) : typeof a == "string" ? l = e[a] || e.label || e.name || e.title || String(e.value || e.id || "") : l = e.label || e.name || e.title || String(e.value || e.id || "");
|
|
33
|
+
let n;
|
|
34
|
+
return typeof o == "function" ? n = o(e) : typeof o == "string" ? n = e[o] || e.value || e.id : n = e.value || e.id, {
|
|
35
35
|
label: l,
|
|
36
|
-
value:
|
|
36
|
+
value: n,
|
|
37
37
|
raw: e
|
|
38
38
|
};
|
|
39
39
|
}, y = c(() => {
|
|
40
|
-
var
|
|
41
|
-
const e = ((
|
|
40
|
+
var o;
|
|
41
|
+
const e = ((o = f.value) == null ? void 0 : o.data) || [], a = [...g.value];
|
|
42
42
|
return e.forEach((l) => {
|
|
43
|
-
|
|
44
|
-
(i) =>
|
|
45
|
-
) ||
|
|
46
|
-
}),
|
|
47
|
-
}),
|
|
43
|
+
a.some(
|
|
44
|
+
(i) => v(i) === v(l)
|
|
45
|
+
) || a.push(l);
|
|
46
|
+
}), a.map((l) => x(l));
|
|
47
|
+
}), p = c(() => {
|
|
48
48
|
var e;
|
|
49
49
|
return ((e = f.value) == null ? void 0 : e.meta) || {};
|
|
50
|
-
}), { refetch:
|
|
50
|
+
}), { refetch: F } = O({
|
|
51
51
|
get path() {
|
|
52
|
-
return
|
|
52
|
+
return t.path || "";
|
|
53
53
|
},
|
|
54
54
|
get ids() {
|
|
55
|
-
return
|
|
55
|
+
return t.defaultValue ? A(t.defaultValue) ? t.defaultValue : [t.defaultValue] : [];
|
|
56
56
|
},
|
|
57
57
|
options: {
|
|
58
58
|
enabled: !1
|
|
59
59
|
},
|
|
60
|
-
providerName:
|
|
60
|
+
providerName: t.providerName
|
|
61
61
|
});
|
|
62
|
-
|
|
62
|
+
E(() => t.defaultValue, async (e) => {
|
|
63
63
|
var l;
|
|
64
64
|
if (!(d.value || !e || (d.value = !0, (Array.isArray(e) ? e : [e]).every(
|
|
65
|
-
(
|
|
65
|
+
(n) => y.value.some((i) => i.value === n)
|
|
66
66
|
))))
|
|
67
67
|
try {
|
|
68
|
-
const
|
|
69
|
-
|
|
70
|
-
} catch (
|
|
71
|
-
console.warn("Failed to fetch selected items:",
|
|
68
|
+
const n = await F();
|
|
69
|
+
g.value = ((l = n == null ? void 0 : n.data) == null ? void 0 : l.data) || [];
|
|
70
|
+
} catch (n) {
|
|
71
|
+
console.warn("Failed to fetch selected items:", n);
|
|
72
72
|
}
|
|
73
73
|
}, { immediate: !0 });
|
|
74
|
-
const
|
|
74
|
+
const N = c(() => b.value);
|
|
75
75
|
return {
|
|
76
|
-
onSearch:
|
|
76
|
+
onSearch: V,
|
|
77
77
|
options: y,
|
|
78
|
-
meta:
|
|
79
|
-
loading:
|
|
80
|
-
pagination: s
|
|
78
|
+
meta: p,
|
|
79
|
+
loading: N,
|
|
80
|
+
pagination: s,
|
|
81
|
+
total: w,
|
|
82
|
+
pageCount: S
|
|
81
83
|
};
|
|
82
84
|
}
|
|
83
85
|
export {
|
|
84
|
-
|
|
86
|
+
D as useSelect
|
|
85
87
|
};
|
package/dist/esm/hooks/theme.js
CHANGED
|
@@ -65,7 +65,7 @@ function de() {
|
|
|
65
65
|
dark: {
|
|
66
66
|
text: { dimmed: "600", muted: "500", toned: "300", base: "400", highlighted: "100", inverted: "black" },
|
|
67
67
|
bg: { base: "950", muted: "900", elevated: "800", accented: "700", inverted: "100" },
|
|
68
|
-
border: { base: "
|
|
68
|
+
border: { base: "900", muted: "800", accented: "700", inverted: "100" }
|
|
69
69
|
}
|
|
70
70
|
},
|
|
71
71
|
colorBase: { white: "#ffffff", black: "#000000" }
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { computed as a } from "vue";
|
|
2
|
+
import { arrayToTree as y, treeToArr as m } from "../utils/tree.js";
|
|
3
|
+
import { useList as v } from "./data.js";
|
|
4
|
+
function g(e) {
|
|
5
|
+
const { data: o, isLoading: c } = v({
|
|
6
|
+
get path() {
|
|
7
|
+
return e.path || "";
|
|
8
|
+
},
|
|
9
|
+
get filters() {
|
|
10
|
+
return e.params;
|
|
11
|
+
},
|
|
12
|
+
get providerName() {
|
|
13
|
+
return e.providerName;
|
|
14
|
+
}
|
|
15
|
+
}), d = a(() => {
|
|
16
|
+
var r, n, i, t, l, s;
|
|
17
|
+
return e.converTree ? y(((n = o.value) == null ? void 0 : n.data) || [], {
|
|
18
|
+
idKey: ((i = e.treeOptions) == null ? void 0 : i.valueKey) || "id",
|
|
19
|
+
parentKey: ((t = e.treeOptions) == null ? void 0 : t.parentKey) || "parentId",
|
|
20
|
+
sortKey: ((l = e.treeOptions) == null ? void 0 : l.sortKey) || "sort",
|
|
21
|
+
childrenKey: ((s = e.treeOptions) == null ? void 0 : s.childrenKey) || "children"
|
|
22
|
+
}) : ((r = o.value) == null ? void 0 : r.data) || [];
|
|
23
|
+
}), u = a(() => {
|
|
24
|
+
var r, n;
|
|
25
|
+
return m(d.value, ((r = e.treeOptions) == null ? void 0 : r.valueKey) || "id", ((n = e.treeOptions) == null ? void 0 : n.childrenKey) || "children");
|
|
26
|
+
}), h = a(() => c.value);
|
|
27
|
+
return {
|
|
28
|
+
options: a(() => {
|
|
29
|
+
const r = (n) => n.map((i) => {
|
|
30
|
+
const t = { ...i };
|
|
31
|
+
return Array.isArray(t.children) && (t.children.length === 0 ? delete t.children : t.children = r(t.children)), t;
|
|
32
|
+
});
|
|
33
|
+
return r(d.value || []);
|
|
34
|
+
}),
|
|
35
|
+
loading: h,
|
|
36
|
+
expanded: u
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
export {
|
|
40
|
+
g as useTree
|
|
41
|
+
};
|
package/dist/esm/hooks/upload.js
CHANGED
|
@@ -3,6 +3,7 @@ import { uniqueId as R } from "lodash-es";
|
|
|
3
3
|
import { ref as g, computed as v, watch as V } from "vue";
|
|
4
4
|
import { createLocalUploadDriver as W } from "./upload/local.js";
|
|
5
5
|
function ne(l) {
|
|
6
|
+
l = l || {};
|
|
6
7
|
const w = g(!1), i = g([]), u = g(-1), d = g(/* @__PURE__ */ new Map()), A = l.driver || W(), $ = v(() => {
|
|
7
8
|
const { onProgress: e, onDataCallback: n, onCancel: a, onComplete: t, maxFileSize: c, maxFileCount: o, accept: s, multiple: r, autoUpload: f, options: U, onSuccess: P, onError: x, method: Y, driver: Z, ...J } = l;
|
|
8
9
|
return J;
|
package/dist/esm/index.js
CHANGED
|
@@ -8,7 +8,7 @@ import { DuxException as l } from "./components/status/exception.js";
|
|
|
8
8
|
import { DuxNotAuthorized as D } from "./components/status/notAuthorized.js";
|
|
9
9
|
import { DuxNotFound as h } from "./components/status/notFound.js";
|
|
10
10
|
import { themeColor as c } from "./config/color.js";
|
|
11
|
-
import { useCan as
|
|
11
|
+
import { useCan as T, useCheck as g, useError as I, useForgotPassword as L, useGetAuth as M, useIsLogin as y, useLogin as E, useLogout as F, useRegister as P, useUpdatePassword as U } from "./hooks/auth.js";
|
|
12
12
|
import { useConfig as O } from "./hooks/config.js";
|
|
13
13
|
import { useClient as b, useCreate as V, useCreateMany as N, useCustom as k, useCustomMutation as z, useDelete as G, useDeleteMany as J, useInfiniteList as j, useInvalidate as q, useList as B, useMany as H, useOne as K, useUpdate as Q, useUpdateMany as W } from "./hooks/data.js";
|
|
14
14
|
import { useExport as Y } from "./hooks/export.js";
|
|
@@ -24,35 +24,36 @@ import { defaultAdaptors as ve } from "./hooks/json/index.js";
|
|
|
24
24
|
import { useExtendList as Ae } from "./hooks/list.js";
|
|
25
25
|
import { useManage as Ce } from "./hooks/manage.js";
|
|
26
26
|
import { useMenu as Se } from "./hooks/menu.js";
|
|
27
|
-
import { useOverlay as
|
|
28
|
-
import { useSelect as
|
|
27
|
+
import { useOverlay as ge } from "./hooks/overlay.js";
|
|
28
|
+
import { useSelect as Le } from "./hooks/select.js";
|
|
29
29
|
import { useTheme as ye } from "./hooks/theme.js";
|
|
30
|
-
import {
|
|
31
|
-
import {
|
|
32
|
-
import {
|
|
33
|
-
import {
|
|
34
|
-
import {
|
|
35
|
-
import {
|
|
36
|
-
import {
|
|
37
|
-
import {
|
|
38
|
-
import {
|
|
39
|
-
import {
|
|
40
|
-
import {
|
|
41
|
-
import {
|
|
42
|
-
import {
|
|
43
|
-
import {
|
|
44
|
-
import {
|
|
45
|
-
import {
|
|
46
|
-
import {
|
|
47
|
-
import {
|
|
48
|
-
import {
|
|
49
|
-
import {
|
|
50
|
-
import {
|
|
51
|
-
import {
|
|
52
|
-
import {
|
|
53
|
-
import {
|
|
30
|
+
import { useTree as Fe } from "./hooks/tree.js";
|
|
31
|
+
import { useUpload as Ue } from "./hooks/upload.js";
|
|
32
|
+
import { createLocalUploadDriver as Oe } from "./hooks/upload/local.js";
|
|
33
|
+
import { createS3UploadDriver as be } from "./hooks/upload/s3.js";
|
|
34
|
+
import { createDux as Ne } from "./main.js";
|
|
35
|
+
import { simpleAuthProvider as ze } from "./preset/authProvider.js";
|
|
36
|
+
import { simpleDataProvider as Je } from "./preset/dataProvider.js";
|
|
37
|
+
import { i18nProvider as qe } from "./preset/i18nProvider.js";
|
|
38
|
+
import { DuxAppProvider as He } from "./provider/app.js";
|
|
39
|
+
import { DuxTabRouterView as Qe } from "./provider/tab.js";
|
|
40
|
+
import { initRouter as Xe } from "./router/route.js";
|
|
41
|
+
import { useAuthStore as Ze } from "./stores/auth.js";
|
|
42
|
+
import { useI18nStore as $e } from "./stores/i18n.js";
|
|
43
|
+
import { useManageStore as rr } from "./stores/manage.js";
|
|
44
|
+
import { useRouteStore as tr } from "./stores/route.js";
|
|
45
|
+
import { createTabStore as ur, useTabStore as xr } from "./stores/tab.js";
|
|
46
|
+
import { useThemeStore as sr } from "./stores/theme.js";
|
|
47
|
+
import { themePreset as ar } from "./utils/theme.js";
|
|
48
|
+
import { arrayToTree as ir, searchTree as nr, treeToArr as lr } from "./utils/tree.js";
|
|
49
|
+
import { vForAdaptor as Dr } from "./hooks/json/vFor.js";
|
|
50
|
+
import { vIfAdaptor as hr } from "./hooks/json/vIf.js";
|
|
51
|
+
import { vModelAdaptor as cr } from "./hooks/json/vModel.js";
|
|
52
|
+
import { vOnAdaptor as Tr } from "./hooks/json/vOn.js";
|
|
53
|
+
import { vShowAdaptor as Ir } from "./hooks/json/vShow.js";
|
|
54
|
+
import { vTextAdaptor as Mr } from "./hooks/json/vText.js";
|
|
54
55
|
export {
|
|
55
|
-
|
|
56
|
+
He as DuxAppProvider,
|
|
56
57
|
o as DuxCan,
|
|
57
58
|
i as DuxError,
|
|
58
59
|
l as DuxException,
|
|
@@ -62,25 +63,25 @@ export {
|
|
|
62
63
|
D as DuxNotAuthorized,
|
|
63
64
|
h as DuxNotFound,
|
|
64
65
|
a as DuxOverlay,
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
66
|
+
Qe as DuxTabRouterView,
|
|
67
|
+
ir as arrayToTree,
|
|
68
|
+
Ne as createDux,
|
|
69
|
+
Oe as createLocalUploadDriver,
|
|
70
|
+
be as createS3UploadDriver,
|
|
71
|
+
ur as createTabStore,
|
|
71
72
|
ve as defaultAdaptors,
|
|
72
|
-
|
|
73
|
+
qe as i18nProvider,
|
|
73
74
|
pe as initFormValidate,
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
75
|
+
Xe as initRouter,
|
|
76
|
+
nr as searchTree,
|
|
77
|
+
ze as simpleAuthProvider,
|
|
78
|
+
Je as simpleDataProvider,
|
|
78
79
|
c as themeColor,
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
80
|
+
ar as themePreset,
|
|
81
|
+
lr as treeToArr,
|
|
82
|
+
Ze as useAuthStore,
|
|
83
|
+
T as useCan,
|
|
84
|
+
g as useCheck,
|
|
84
85
|
b as useClient,
|
|
85
86
|
O as useConfig,
|
|
86
87
|
V as useCreate,
|
|
@@ -89,16 +90,16 @@ export {
|
|
|
89
90
|
z as useCustomMutation,
|
|
90
91
|
G as useDelete,
|
|
91
92
|
J as useDeleteMany,
|
|
92
|
-
|
|
93
|
+
I as useError,
|
|
93
94
|
Y as useExport,
|
|
94
95
|
_ as useExportCsv,
|
|
95
96
|
oe as useExtendForm,
|
|
96
97
|
Ae as useExtendList,
|
|
97
|
-
|
|
98
|
+
L as useForgotPassword,
|
|
98
99
|
ee as useForm,
|
|
99
100
|
M as useGetAuth,
|
|
100
101
|
me as useI18n,
|
|
101
|
-
|
|
102
|
+
$e as useI18nStore,
|
|
102
103
|
fe as useImport,
|
|
103
104
|
de as useImportCsv,
|
|
104
105
|
j as useInfiniteList,
|
|
@@ -109,26 +110,27 @@ export {
|
|
|
109
110
|
E as useLogin,
|
|
110
111
|
F as useLogout,
|
|
111
112
|
Ce as useManage,
|
|
112
|
-
|
|
113
|
+
rr as useManageStore,
|
|
113
114
|
H as useMany,
|
|
114
115
|
Se as useMenu,
|
|
115
116
|
K as useOne,
|
|
116
|
-
|
|
117
|
+
ge as useOverlay,
|
|
117
118
|
P as useRegister,
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
119
|
+
tr as useRouteStore,
|
|
120
|
+
Le as useSelect,
|
|
121
|
+
xr as useTabStore,
|
|
121
122
|
ye as useTheme,
|
|
122
|
-
|
|
123
|
+
sr as useThemeStore,
|
|
124
|
+
Fe as useTree,
|
|
123
125
|
Q as useUpdate,
|
|
124
126
|
W as useUpdateMany,
|
|
125
127
|
U as useUpdatePassword,
|
|
126
|
-
|
|
128
|
+
Ue as useUpload,
|
|
127
129
|
ue as useValidateForm,
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
130
|
+
Dr as vForAdaptor,
|
|
131
|
+
hr as vIfAdaptor,
|
|
132
|
+
cr as vModelAdaptor,
|
|
133
|
+
Tr as vOnAdaptor,
|
|
134
|
+
Ir as vShowAdaptor,
|
|
135
|
+
Mr as vTextAdaptor
|
|
134
136
|
};
|
|
@@ -1,99 +1,99 @@
|
|
|
1
1
|
import k from "axios";
|
|
2
|
-
import { trimStart as
|
|
3
|
-
function w(
|
|
4
|
-
const
|
|
2
|
+
import { trimStart as h } from "lodash-es";
|
|
3
|
+
function w(l) {
|
|
4
|
+
const d = (a) => a ? `${l.apiUrl}/${h(a || "", "/")}` : l.apiUrl;
|
|
5
5
|
return {
|
|
6
|
-
apiUrl:
|
|
7
|
-
getList: (a,
|
|
6
|
+
apiUrl: d,
|
|
7
|
+
getList: (a, r, c) => {
|
|
8
8
|
const e = {};
|
|
9
|
-
return a.pagination && typeof a.pagination == "object" && (e.page = a.pagination.page, e.pageSize = a.pagination.pageSize), k.get(
|
|
9
|
+
return a.pagination && typeof a.pagination == "object" && (e.page = a.pagination.page, e.pageSize = a.pagination.pageSize), k.get(d(a.path) || "", {
|
|
10
10
|
params: {
|
|
11
11
|
...e,
|
|
12
12
|
...a.filters,
|
|
13
13
|
...a.sorters
|
|
14
14
|
},
|
|
15
15
|
headers: {
|
|
16
|
-
Authorization:
|
|
16
|
+
Authorization: c == null ? void 0 : c.token
|
|
17
17
|
},
|
|
18
18
|
...a.meta
|
|
19
|
-
}).then((t) =>
|
|
20
|
-
throw
|
|
19
|
+
}).then((t) => l.successCallback ? l.successCallback(t) : n(t)).catch((t) => {
|
|
20
|
+
throw l.errorCallback ? l.errorCallback(t) : m(t);
|
|
21
21
|
});
|
|
22
22
|
},
|
|
23
|
-
create: (a,
|
|
23
|
+
create: (a, r, c) => k.post(d(a.path) || "", a.data, {
|
|
24
24
|
headers: {
|
|
25
|
-
Authorization:
|
|
25
|
+
Authorization: c == null ? void 0 : c.token
|
|
26
26
|
},
|
|
27
27
|
...a.meta
|
|
28
|
-
}).then((e) =>
|
|
29
|
-
throw
|
|
28
|
+
}).then((e) => l.successCallback ? l.successCallback(e) : n(e)).catch((e) => {
|
|
29
|
+
throw l.errorCallback ? l.errorCallback(e) : m(e);
|
|
30
30
|
}),
|
|
31
|
-
update: (a,
|
|
31
|
+
update: (a, r, c) => k.put(d(a.id ? `${a.path}/${a.id}` : a.path) || "", a.data, {
|
|
32
32
|
headers: {
|
|
33
|
-
Authorization:
|
|
33
|
+
Authorization: c == null ? void 0 : c.token
|
|
34
34
|
},
|
|
35
35
|
...a.meta
|
|
36
|
-
}).then((e) =>
|
|
37
|
-
throw
|
|
36
|
+
}).then((e) => l.successCallback ? l.successCallback(e) : n(e)).catch((e) => {
|
|
37
|
+
throw l.errorCallback ? l.errorCallback(e) : m(e);
|
|
38
38
|
}),
|
|
39
|
-
deleteOne: (a,
|
|
39
|
+
deleteOne: (a, r, c) => k.delete(d(a.id ? `${a.path}/${a.id}` : a.path) || "", {
|
|
40
40
|
headers: {
|
|
41
|
-
Authorization:
|
|
41
|
+
Authorization: c == null ? void 0 : c.token
|
|
42
42
|
},
|
|
43
43
|
...a.meta
|
|
44
|
-
}).then((e) =>
|
|
45
|
-
throw
|
|
44
|
+
}).then((e) => l.successCallback ? l.successCallback(e) : n(e)).catch((e) => {
|
|
45
|
+
throw l.errorCallback ? l.errorCallback(e) : m(e);
|
|
46
46
|
}),
|
|
47
|
-
getOne: (a,
|
|
47
|
+
getOne: (a, r, c) => k.get(d(a.id ? `${a.path}/${a.id}` : a.path) || "", {
|
|
48
48
|
headers: {
|
|
49
|
-
Authorization:
|
|
49
|
+
Authorization: c == null ? void 0 : c.token
|
|
50
50
|
},
|
|
51
51
|
...a.meta
|
|
52
|
-
}).then((e) =>
|
|
53
|
-
throw
|
|
52
|
+
}).then((e) => l.successCallback ? l.successCallback(e) : n(e)).catch((e) => {
|
|
53
|
+
throw l.errorCallback ? l.errorCallback(e) : m(e);
|
|
54
54
|
}),
|
|
55
|
-
getMany: (a,
|
|
55
|
+
getMany: (a, r, c) => k.get(d(a.path) || "", {
|
|
56
56
|
params: {
|
|
57
57
|
ids: a.ids
|
|
58
58
|
},
|
|
59
59
|
headers: {
|
|
60
|
-
Authorization:
|
|
60
|
+
Authorization: c == null ? void 0 : c.token
|
|
61
61
|
},
|
|
62
62
|
...a.meta
|
|
63
|
-
}).then((e) =>
|
|
64
|
-
throw
|
|
63
|
+
}).then((e) => l.successCallback ? l.successCallback(e) : n(e)).catch((e) => {
|
|
64
|
+
throw l.errorCallback ? l.errorCallback(e) : m(e);
|
|
65
65
|
}),
|
|
66
|
-
createMany: (a,
|
|
66
|
+
createMany: (a, r, c) => k.post(d(a.path) || "", a.data, {
|
|
67
67
|
headers: {
|
|
68
|
-
Authorization:
|
|
68
|
+
Authorization: c == null ? void 0 : c.token
|
|
69
69
|
},
|
|
70
70
|
...a.meta
|
|
71
|
-
}).then((e) =>
|
|
72
|
-
throw
|
|
71
|
+
}).then((e) => l.successCallback ? l.successCallback(e) : n(e)).catch((e) => {
|
|
72
|
+
throw l.errorCallback ? l.errorCallback(e) : m(e);
|
|
73
73
|
}),
|
|
74
|
-
updateMany: (a,
|
|
74
|
+
updateMany: (a, r, c) => k.put(d(a.path) || "", {
|
|
75
75
|
ids: a.ids,
|
|
76
76
|
data: a.data
|
|
77
77
|
}, {
|
|
78
78
|
headers: {
|
|
79
|
-
Authorization:
|
|
79
|
+
Authorization: c == null ? void 0 : c.token
|
|
80
80
|
},
|
|
81
81
|
...a.meta
|
|
82
|
-
}).then((e) =>
|
|
83
|
-
throw
|
|
82
|
+
}).then((e) => l.successCallback ? l.successCallback(e) : n(e)).catch((e) => {
|
|
83
|
+
throw l.errorCallback ? l.errorCallback(e) : m(e);
|
|
84
84
|
}),
|
|
85
|
-
deleteMany: (a,
|
|
85
|
+
deleteMany: (a, r, c) => k.delete(d(a.path) || "", {
|
|
86
86
|
params: {
|
|
87
87
|
ids: a.ids
|
|
88
88
|
},
|
|
89
89
|
headers: {
|
|
90
|
-
Authorization:
|
|
90
|
+
Authorization: c == null ? void 0 : c.token
|
|
91
91
|
},
|
|
92
92
|
...a.meta
|
|
93
|
-
}).then((e) =>
|
|
94
|
-
throw
|
|
93
|
+
}).then((e) => l.successCallback ? l.successCallback(e) : n(e)).catch((e) => {
|
|
94
|
+
throw l.errorCallback ? l.errorCallback(e) : m(e);
|
|
95
95
|
}),
|
|
96
|
-
custom: (a,
|
|
96
|
+
custom: (a, r, c) => {
|
|
97
97
|
let e = {
|
|
98
98
|
...a.query
|
|
99
99
|
};
|
|
@@ -104,57 +104,61 @@ function w(c) {
|
|
|
104
104
|
...e,
|
|
105
105
|
...a.filters
|
|
106
106
|
}), k.request({
|
|
107
|
-
url:
|
|
107
|
+
url: d(a.path || ""),
|
|
108
108
|
method: a.method || "GET",
|
|
109
109
|
data: a.payload,
|
|
110
110
|
params: e,
|
|
111
111
|
signal: a.signal,
|
|
112
112
|
headers: {
|
|
113
|
-
Authorization:
|
|
113
|
+
Authorization: c == null ? void 0 : c.token,
|
|
114
114
|
...a.headers
|
|
115
115
|
},
|
|
116
116
|
onUploadProgress: (t) => {
|
|
117
|
-
var
|
|
117
|
+
var b;
|
|
118
118
|
const C = Math.round(t.loaded * 100 / (t.total || 1));
|
|
119
|
-
(
|
|
119
|
+
(b = a.onUploadProgress) == null || b.call(a, {
|
|
120
120
|
loaded: t.loaded,
|
|
121
121
|
total: t.total,
|
|
122
122
|
percent: C
|
|
123
123
|
});
|
|
124
124
|
},
|
|
125
125
|
onDownloadProgress: (t) => {
|
|
126
|
-
var
|
|
126
|
+
var b;
|
|
127
127
|
const C = Math.round(t.loaded * 100 / (t.total || 1));
|
|
128
|
-
(
|
|
128
|
+
(b = a.onDownloadProgress) == null || b.call(a, {
|
|
129
129
|
loaded: t.loaded,
|
|
130
130
|
total: t.total,
|
|
131
131
|
percent: C
|
|
132
132
|
});
|
|
133
133
|
},
|
|
134
134
|
...a.meta
|
|
135
|
-
}).then((t) =>
|
|
136
|
-
throw
|
|
135
|
+
}).then((t) => l.successCallback ? l.successCallback(t) : n(t)).catch((t) => {
|
|
136
|
+
throw l.errorCallback ? l.errorCallback(t) : m(t);
|
|
137
137
|
});
|
|
138
|
+
},
|
|
139
|
+
getTotal: (a) => {
|
|
140
|
+
var r;
|
|
141
|
+
return l.getTotal ? l.getTotal(a) : ((r = a.meta) == null ? void 0 : r.total) || 0;
|
|
138
142
|
}
|
|
139
143
|
};
|
|
140
144
|
}
|
|
141
|
-
function n(
|
|
142
|
-
var
|
|
145
|
+
function n(l) {
|
|
146
|
+
var d, a, r;
|
|
143
147
|
return {
|
|
144
|
-
message: (
|
|
145
|
-
data: (a =
|
|
146
|
-
meta: (
|
|
147
|
-
raw:
|
|
148
|
+
message: (d = l.data) == null ? void 0 : d.message,
|
|
149
|
+
data: (a = l.data) == null ? void 0 : a.data,
|
|
150
|
+
meta: (r = l.data) == null ? void 0 : r.meta,
|
|
151
|
+
raw: l.data
|
|
148
152
|
};
|
|
149
153
|
}
|
|
150
|
-
function
|
|
151
|
-
var
|
|
154
|
+
function m(l) {
|
|
155
|
+
var d, a, r, c, e, t, C, b, g, u;
|
|
152
156
|
return {
|
|
153
|
-
message: ((a = (
|
|
154
|
-
data: (
|
|
155
|
-
meta: (t = (e =
|
|
156
|
-
status: ((
|
|
157
|
-
raw: (
|
|
157
|
+
message: ((a = (d = l.response) == null ? void 0 : d.data) == null ? void 0 : a.message) || (l == null ? void 0 : l.message),
|
|
158
|
+
data: (c = (r = l.response) == null ? void 0 : r.data) == null ? void 0 : c.data,
|
|
159
|
+
meta: (t = (e = l.response) == null ? void 0 : e.data) == null ? void 0 : t.meta,
|
|
160
|
+
status: ((b = (C = l.response) == null ? void 0 : C.data) == null ? void 0 : b.code) || ((g = l.response) == null ? void 0 : g.status) || 500,
|
|
161
|
+
raw: (u = l.response) == null ? void 0 : u.data
|
|
158
162
|
};
|
|
159
163
|
}
|
|
160
164
|
export {
|