@duxweb/dvha-core 0.1.23 → 1.0.15

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.
Files changed (45) hide show
  1. package/dist/cjs/components/auth/can.cjs +1 -1
  2. package/dist/cjs/components/loader/loader.cjs +1 -1
  3. package/dist/cjs/components/loader/remote/loader.cjs +1 -1
  4. package/dist/cjs/directive/permission.cjs +1 -1
  5. package/dist/cjs/hooks/data.cjs +1 -1
  6. package/dist/cjs/hooks/json/vModel.cjs +1 -1
  7. package/dist/cjs/hooks/json.cjs +1 -1
  8. package/dist/cjs/hooks/menu.cjs +1 -1
  9. package/dist/cjs/hooks/overlay.cjs +1 -1
  10. package/dist/cjs/hooks/tree.cjs +1 -1
  11. package/dist/cjs/hooks/upload/local.cjs +1 -1
  12. package/dist/cjs/hooks/upload.cjs +1 -1
  13. package/dist/cjs/index.cjs +1 -1
  14. package/dist/cjs/main.cjs +1 -1
  15. package/dist/cjs/provider/app.cjs +1 -1
  16. package/dist/cjs/stores/jsonSchema.cjs +1 -0
  17. package/dist/cjs/utils/bus.cjs +1 -0
  18. package/dist/esm/components/auth/can.js +3 -2
  19. package/dist/esm/components/loader/loader.js +3 -2
  20. package/dist/esm/components/loader/remote/loader.js +3 -2
  21. package/dist/esm/directive/permission.js +3 -2
  22. package/dist/esm/hooks/data.js +166 -158
  23. package/dist/esm/hooks/json/vModel.js +67 -36
  24. package/dist/esm/hooks/json.js +109 -57
  25. package/dist/esm/hooks/menu.js +14 -13
  26. package/dist/esm/hooks/overlay.js +3 -2
  27. package/dist/esm/hooks/tree.js +8 -7
  28. package/dist/esm/hooks/upload/local.js +8 -8
  29. package/dist/esm/hooks/upload.js +123 -116
  30. package/dist/esm/index.js +93 -88
  31. package/dist/esm/main.js +7 -6
  32. package/dist/esm/provider/app.js +55 -53
  33. package/dist/esm/stores/jsonSchema.js +43 -0
  34. package/dist/esm/utils/bus.js +5 -0
  35. package/dist/types/hooks/data.d.ts +6 -66
  36. package/dist/types/hooks/json.d.ts +13 -3
  37. package/dist/types/hooks/upload/local.d.ts +1 -1
  38. package/dist/types/hooks/upload.d.ts +1 -1
  39. package/dist/types/stores/index.d.ts +1 -0
  40. package/dist/types/stores/jsonSchema.d.ts +27 -0
  41. package/dist/types/types/config.d.ts +6 -0
  42. package/dist/types/types/manage.d.ts +6 -0
  43. package/dist/types/utils/bus.d.ts +1 -0
  44. package/dist/types/utils/index.d.ts +1 -0
  45. package/package.json +2 -2
@@ -1,37 +1,37 @@
1
- import { useQuery as C, useInfiniteQuery as Q, useMutation as M, useQueryClient as k } from "@tanstack/vue-query";
2
- import { toRef as K, computed as h, watch as F, ref as $ } from "vue";
3
- import { useGetAuth as N, useError as S } from "./auth.js";
1
+ import { useQuery as x, useInfiniteQuery as Q, useMutation as A, useQueryClient as k } from "@tanstack/vue-query";
2
+ import { toRef as K, computed as h, watch as S, ref as w } from "vue";
3
+ import { useGetAuth as q, useError as $ } from "./auth.js";
4
4
  import { useManage as P } from "./manage.js";
5
- function _(t) {
5
+ function G(t) {
6
6
  var E;
7
- const i = P(), l = N(), f = t.providerName || "default", { mutate: s } = S(), v = K(t.pagination ? t.pagination : { page: 1, pageSize: 20 }), n = h(() => {
8
- const { onError: g, options: q, pagination: y, ...a } = t;
7
+ const i = P(), l = q(), f = t.providerName || "default", { mutate: g } = $(), d = K(t.pagination ? t.pagination : { page: 1, pageSize: 20 }), n = h(() => {
8
+ const { onError: s, options: N, pagination: y, ...a } = t;
9
9
  return a;
10
10
  });
11
- F(n, () => {
12
- t.pagination && (v.value.page = 1);
11
+ S(n, () => {
12
+ t.pagination && (d.value.page = 1);
13
13
  }, {
14
14
  deep: !0
15
15
  });
16
16
  const c = h(() => ({
17
17
  ...n.value,
18
- pagination: t.pagination ? v.value : void 0
19
- })), u = C({
18
+ pagination: t.pagination ? d.value : void 0
19
+ })), u = x({
20
20
  queryKey: [`${(E = i.config) == null ? void 0 : E.name}:${f}:${t.path}`, c],
21
21
  queryFn: () => {
22
- var g, q, y;
23
- return (y = (q = (g = i.config) == null ? void 0 : g.dataProvider) == null ? void 0 : q[f]) == null ? void 0 : y.getList(c.value, i, l);
22
+ var s, N, y;
23
+ return (y = (N = (s = i.config) == null ? void 0 : s.dataProvider) == null ? void 0 : N[f]) == null ? void 0 : y.getList(c.value, i, l);
24
24
  },
25
25
  ...t.options
26
26
  }), o = h(() => u.isFetching.value);
27
- F(() => u.isError, () => {
28
- var g;
29
- s(u.error), (g = t.onError) == null || g.call(t, u.error);
27
+ S(() => u.isError, () => {
28
+ var s;
29
+ g(u.error), (s = t.onError) == null || s.call(t, u.error);
30
30
  });
31
- const e = $(void 0), r = $(0), d = $(0);
32
- return F(u.data, (g) => {
33
- var q, y, a, w;
34
- g && (e.value = g, r.value = ((w = (a = (y = (q = i.config) == null ? void 0 : q.dataProvider) == null ? void 0 : y[f]) == null ? void 0 : a.getTotal) == null ? void 0 : w.call(a, g)) || 0, d.value = Math.ceil(r.value / (v.value.pageSize || 20)) || 0);
31
+ const e = w(void 0), r = w(0), v = w(0);
32
+ return S(u.data, (s) => {
33
+ var N, y, a, F;
34
+ s && (e.value = s, r.value = ((F = (a = (y = (N = i.config) == null ? void 0 : N.dataProvider) == null ? void 0 : y[f]) == null ? void 0 : a.getTotal) == null ? void 0 : F.call(a, s)) || 0, v.value = Math.ceil(r.value / (d.value.pageSize || 20)) || 0);
35
35
  }, {
36
36
  immediate: !0
37
37
  }), {
@@ -39,94 +39,102 @@ function _(t) {
39
39
  isLoading: o,
40
40
  data: e,
41
41
  refetch: u.refetch,
42
- pagination: v,
42
+ pagination: d,
43
43
  total: r,
44
- pageCount: d
44
+ pageCount: v
45
45
  };
46
46
  }
47
- function G(t) {
47
+ function R(t) {
48
48
  var E;
49
- const i = P(), l = N(), f = t.providerName || "default", { mutate: s } = S(), v = K(t.pagination || { page: 1, pageSize: 20 }), n = h(() => {
50
- const { onError: g, options: q, pagination: y, ...a } = t;
49
+ const i = P(), l = q(), f = t.providerName || "default", { mutate: g } = $(), d = K(t, "pagination", { page: 1, pageSize: 20 }), n = h(() => {
50
+ const { onError: s, options: N, pagination: y, ...a } = t;
51
51
  return a;
52
52
  });
53
- F(n, () => {
54
- t.pagination && (v.value.page = 1);
53
+ S(n, () => {
54
+ d.value.page = 1;
55
55
  }, {
56
56
  deep: !0
57
57
  });
58
- const c = $(0), u = $(0), o = Q({
58
+ const c = w(0), u = w(0), o = Q({
59
59
  queryKey: [`${(E = i.config) == null ? void 0 : E.name}:${f}:${t.path}`, n],
60
- queryFn: ({ pageParam: g }) => {
61
- var q, y, a;
62
- return v.value.page = g, (a = (y = (q = i.config) == null ? void 0 : q.dataProvider) == null ? void 0 : y[f]) == null ? void 0 : a.getList({
60
+ queryFn: ({ pageParam: s }) => {
61
+ var N, y, a;
62
+ return d.value.page = s, (a = (y = (N = i.config) == null ? void 0 : N.dataProvider) == null ? void 0 : y[f]) == null ? void 0 : a.getList({
63
63
  ...n.value,
64
64
  pagination: {
65
- ...v.value,
66
- page: g
65
+ ...d.value,
66
+ page: s
67
67
  }
68
68
  }, i, l);
69
69
  },
70
70
  initialPageParam: 1,
71
- getNextPageParam: (g, q, y) => {
72
- var w, D, L, A, x;
73
- if (!(g != null && g.data) || ((w = g == null ? void 0 : g.data) == null ? void 0 : w.length) === 0)
71
+ getNextPageParam: (s, N, y) => {
72
+ var M, L, D, C, T;
73
+ if (!(s != null && s.data) || ((M = s == null ? void 0 : s.data) == null ? void 0 : M.length) === 0)
74
74
  return;
75
- const a = ((x = (A = (L = (D = i.config) == null ? void 0 : D.dataProvider) == null ? void 0 : L[f]) == null ? void 0 : A.getTotal) == null ? void 0 : x.call(A, g)) || 0;
76
- return u.value = Math.ceil(a / (v.value.pageSize || 20)) || 0, a.value = a, y + 1;
75
+ const a = ((T = (C = (D = (L = i.config) == null ? void 0 : L.dataProvider) == null ? void 0 : D[f]) == null ? void 0 : C.getTotal) == null ? void 0 : T.call(C, s)) || 0;
76
+ if (u.value = Math.ceil(a / (d.value.pageSize || 20)) || 0, c.value = a, !(y * (d.value.pageSize || 20) >= a))
77
+ return y + 1;
77
78
  },
78
- getPreviousPageParam: (g, q, y) => {
79
- var w, D, L, A;
79
+ getPreviousPageParam: (s, N, y) => {
80
+ var F, M, L, D;
80
81
  if (y <= 1)
81
82
  return;
82
- const a = ((A = (L = (D = (w = i.config) == null ? void 0 : w.dataProvider) == null ? void 0 : D[f]) == null ? void 0 : L.getTotal) == null ? void 0 : A.call(L, g)) || 0;
83
- return u.value = Math.ceil(a / (v.value.pageSize || 20)) || 0, a.value = a, y - 1;
83
+ const a = ((D = (L = (M = (F = i.config) == null ? void 0 : F.dataProvider) == null ? void 0 : M[f]) == null ? void 0 : L.getTotal) == null ? void 0 : D.call(L, s)) || 0;
84
+ return u.value = Math.ceil(a / (d.value.pageSize || 20)) || 0, c.value = a, y - 1;
84
85
  },
85
86
  ...t.options
86
87
  }), e = h(() => o.isFetching.value);
87
- F(() => o.isError, () => {
88
- var g;
89
- s(o.error), (g = t.onError) == null || g.call(t, o.error);
88
+ S(() => o.isError, () => {
89
+ var s;
90
+ g(o.error), (s = t.onError) == null || s.call(t, o.error);
90
91
  });
91
92
  const r = () => {
92
93
  if (!(!o.hasNextPage.value || o.isFetching.value))
93
94
  return o.fetchNextPage();
94
- }, d = $(void 0);
95
- return F(o.data, (g) => {
96
- g && (d.value = g);
95
+ }, v = w(void 0);
96
+ return S(o.data, (s) => {
97
+ if (!(s != null && s.pages) || s.pages.length === 0)
98
+ return;
99
+ const N = s.pages.reduce((a, F) => F != null && F.data && F.data.length > 0 ? a.concat(F.data) : a, []), y = s.pages[0];
100
+ y && (v.value = {
101
+ ...y,
102
+ data: N
103
+ });
97
104
  }, {
105
+ deep: !0,
98
106
  immediate: !0
99
107
  }), {
100
108
  ...o,
101
109
  isLoading: e,
102
- data: d,
110
+ data: v,
103
111
  fetchNextPage: r,
104
112
  hasNextPage: o.hasNextPage,
105
113
  refetch: o.refetch,
106
- pagination: v,
114
+ pagination: d,
107
115
  total: c,
108
116
  pageCount: u
109
117
  };
110
118
  }
111
- function R(t) {
119
+ function b(t) {
112
120
  var o;
113
- const i = P(), l = N(), f = t.providerName || "default", { mutate: s } = S(), v = h(() => {
114
- const { onError: e, options: r, ...d } = t;
115
- return d;
116
- }), n = C({
117
- queryKey: [`${(o = i.config) == null ? void 0 : o.name}:${f}:${t.path}`, v],
121
+ const i = P(), l = q(), f = t.providerName || "default", { mutate: g } = $(), d = h(() => {
122
+ const { onError: e, options: r, ...v } = t;
123
+ return v;
124
+ }), n = x({
125
+ queryKey: [`${(o = i.config) == null ? void 0 : o.name}:${f}:${t.path}`, d],
118
126
  queryFn: () => {
119
- var e, r, d;
120
- return (d = (r = (e = i.config) == null ? void 0 : e.dataProvider) == null ? void 0 : r[f]) == null ? void 0 : d.getOne(v.value, i, l);
127
+ var e, r, v;
128
+ return (v = (r = (e = i.config) == null ? void 0 : e.dataProvider) == null ? void 0 : r[f]) == null ? void 0 : v.getOne(d.value, i, l);
121
129
  },
122
130
  ...t.options
123
131
  }), c = h(() => n.isFetched.value ? !1 : n.isFetching.value);
124
- F(() => n.isError, () => {
132
+ S(() => n.isError, () => {
125
133
  var e;
126
- s(n.error), (e = t.onError) == null || e.call(t, n.error);
134
+ g(n.error), (e = t.onError) == null || e.call(t, n.error);
127
135
  });
128
- const u = $(void 0);
129
- return F(n.data, (e) => {
136
+ const u = w(void 0);
137
+ return S(n.data, (e) => {
130
138
  e && (u.value = e);
131
139
  }, {
132
140
  immediate: !0
@@ -137,25 +145,25 @@ function R(t) {
137
145
  refetch: n.refetch
138
146
  };
139
147
  }
140
- function b(t) {
148
+ function j(t) {
141
149
  var o;
142
- const i = P(), l = N(), f = t.providerName || "default", { mutate: s } = S(), v = h(() => {
143
- const { onError: e, options: r, ...d } = t;
144
- return d;
145
- }), n = C({
146
- queryKey: [`${(o = i.config) == null ? void 0 : o.name}:${f}:${t.path}`, v],
150
+ const i = P(), l = q(), f = t.providerName || "default", { mutate: g } = $(), d = h(() => {
151
+ const { onError: e, options: r, ...v } = t;
152
+ return v;
153
+ }), n = x({
154
+ queryKey: [`${(o = i.config) == null ? void 0 : o.name}:${f}:${t.path}`, d],
147
155
  queryFn: () => {
148
- var e, r, d;
149
- return (d = (r = (e = i.config) == null ? void 0 : e.dataProvider) == null ? void 0 : r[f]) == null ? void 0 : d.getMany(v.value, i, l);
156
+ var e, r, v;
157
+ return (v = (r = (e = i.config) == null ? void 0 : e.dataProvider) == null ? void 0 : r[f]) == null ? void 0 : v.getMany(d.value, i, l);
150
158
  },
151
159
  ...t.options
152
160
  }), c = h(() => n.isFetched.value ? !1 : n.isFetching.value);
153
- F(() => n.isError, () => {
161
+ S(() => n.isError, () => {
154
162
  var e;
155
- s(n.error), (e = t.onError) == null || e.call(t, n.error);
163
+ g(n.error), (e = t.onError) == null || e.call(t, n.error);
156
164
  });
157
- const u = $(void 0);
158
- return F(n.data, (e) => {
165
+ const u = w(void 0);
166
+ return S(n.data, (e) => {
159
167
  e && (u.value = e);
160
168
  }, {
161
169
  immediate: !0
@@ -166,27 +174,27 @@ function b(t) {
166
174
  refetch: n.refetch
167
175
  };
168
176
  }
169
- function j(t) {
170
- const i = P(), l = N(), f = t.providerName || "default", { mutate: s } = S(), { invalidate: v } = z(), n = h(() => {
177
+ function B(t) {
178
+ const i = P(), l = q(), f = t.providerName || "default", { mutate: g } = $(), { invalidate: d } = z(), n = h(() => {
171
179
  const { onError: o, options: e, ...r } = t;
172
180
  return r;
173
- }), c = M({
181
+ }), c = A({
174
182
  mutationFn: (o) => {
175
- var e, r, d, E;
183
+ var e, r, v, E;
176
184
  if (!((e = i.config) != null && e.dataProvider))
177
185
  throw new Error("Data provider is not initialized");
178
- return (E = (d = (r = i.config) == null ? void 0 : r.dataProvider) == null ? void 0 : d[f]) == null ? void 0 : E.create({
186
+ return (E = (v = (r = i.config) == null ? void 0 : r.dataProvider) == null ? void 0 : v[f]) == null ? void 0 : E.create({
179
187
  ...n.value,
180
188
  ...o
181
189
  }, i, l);
182
190
  },
183
191
  onSuccess: (o) => {
184
192
  var e;
185
- (e = t.onSuccess) == null || e.call(t, o), t.path && v(t.path);
193
+ (e = t.onSuccess) == null || e.call(t, o), t.path && d(t.path);
186
194
  },
187
195
  onError: (o) => {
188
196
  var e;
189
- s(o), (e = t.onError) == null || e.call(t, o);
197
+ g(o), (e = t.onError) == null || e.call(t, o);
190
198
  },
191
199
  ...t.options
192
200
  }), u = h(() => c.isPending.value);
@@ -196,27 +204,27 @@ function j(t) {
196
204
  mutate: c.mutate
197
205
  };
198
206
  }
199
- function B(t) {
200
- const i = P(), l = N(), f = t.providerName || "default", { mutate: s } = S(), { invalidate: v } = z(), n = h(() => {
207
+ function H(t) {
208
+ const i = P(), l = q(), f = t.providerName || "default", { mutate: g } = $(), { invalidate: d } = z(), n = h(() => {
201
209
  const { onError: o, options: e, ...r } = t;
202
210
  return r;
203
- }), c = M({
211
+ }), c = A({
204
212
  mutationFn: (o) => {
205
- var e, r, d, E;
213
+ var e, r, v, E;
206
214
  if (!((e = i.config) != null && e.dataProvider))
207
215
  throw new Error("Data provider is not initialized");
208
- return (E = (d = (r = i.config) == null ? void 0 : r.dataProvider) == null ? void 0 : d[f]) == null ? void 0 : E.createMany({
216
+ return (E = (v = (r = i.config) == null ? void 0 : r.dataProvider) == null ? void 0 : v[f]) == null ? void 0 : E.createMany({
209
217
  ...n.value,
210
218
  ...o
211
219
  }, i, l);
212
220
  },
213
221
  onSuccess: (o) => {
214
222
  var e;
215
- (e = t.onSuccess) == null || e.call(t, o), t.path && v(t.path);
223
+ (e = t.onSuccess) == null || e.call(t, o), t.path && d(t.path);
216
224
  },
217
225
  onError: (o) => {
218
226
  var e;
219
- s(o), (e = t.onError) == null || e.call(t, o);
227
+ g(o), (e = t.onError) == null || e.call(t, o);
220
228
  },
221
229
  ...t.options
222
230
  }), u = h(() => c.isPending.value);
@@ -226,27 +234,27 @@ function B(t) {
226
234
  mutate: c.mutate
227
235
  };
228
236
  }
229
- function H(t) {
230
- const i = P(), l = N(), f = t.providerName || "default", { mutate: s } = S(), { invalidate: v } = z(), n = h(() => {
237
+ function J(t) {
238
+ const i = P(), l = q(), f = t.providerName || "default", { mutate: g } = $(), { invalidate: d } = z(), n = h(() => {
231
239
  const { onError: o, options: e, ...r } = t;
232
240
  return r;
233
- }), c = M({
241
+ }), c = A({
234
242
  mutationFn: (o) => {
235
- var e, r, d, E;
243
+ var e, r, v, E;
236
244
  if (!((e = i.config) != null && e.dataProvider))
237
245
  throw new Error("Data provider is not initialized");
238
- return (E = (d = (r = i.config) == null ? void 0 : r.dataProvider) == null ? void 0 : d[f]) == null ? void 0 : E.update({
246
+ return (E = (v = (r = i.config) == null ? void 0 : r.dataProvider) == null ? void 0 : v[f]) == null ? void 0 : E.update({
239
247
  ...n.value,
240
248
  ...o
241
249
  }, i, l);
242
250
  },
243
251
  onSuccess: (o) => {
244
252
  var e;
245
- (e = t.onSuccess) == null || e.call(t, o), t.path && v(t.path);
253
+ (e = t.onSuccess) == null || e.call(t, o), t.path && d(t.path);
246
254
  },
247
255
  onError: (o) => {
248
256
  var e;
249
- s(o), (e = t.onError) == null || e.call(t, o);
257
+ g(o), (e = t.onError) == null || e.call(t, o);
250
258
  },
251
259
  ...t.options
252
260
  }), u = h(() => c.isPending.value);
@@ -256,27 +264,27 @@ function H(t) {
256
264
  mutate: c.mutate
257
265
  };
258
266
  }
259
- function J(t) {
260
- const i = P(), l = N(), f = t.providerName || "default", { mutate: s } = S(), { invalidate: v } = z(), n = h(() => {
267
+ function V(t) {
268
+ const i = P(), l = q(), f = t.providerName || "default", { mutate: g } = $(), { invalidate: d } = z(), n = h(() => {
261
269
  const { onError: o, options: e, ...r } = t;
262
270
  return r;
263
- }), c = M({
271
+ }), c = A({
264
272
  mutationFn: (o) => {
265
- var e, r, d, E;
273
+ var e, r, v, E;
266
274
  if (!((e = i.config) != null && e.dataProvider))
267
275
  throw new Error("Data provider is not initialized");
268
- return (E = (d = (r = i.config) == null ? void 0 : r.dataProvider) == null ? void 0 : d[f]) == null ? void 0 : E.updateMany({
276
+ return (E = (v = (r = i.config) == null ? void 0 : r.dataProvider) == null ? void 0 : v[f]) == null ? void 0 : E.updateMany({
269
277
  ...n.value,
270
278
  ...o
271
279
  }, i, l);
272
280
  },
273
281
  onSuccess: (o) => {
274
282
  var e;
275
- (e = t.onSuccess) == null || e.call(t, o), t.path && v(t.path);
283
+ (e = t.onSuccess) == null || e.call(t, o), t.path && d(t.path);
276
284
  },
277
285
  onError: (o) => {
278
286
  var e;
279
- s(o), (e = t.onError) == null || e.call(t, o);
287
+ g(o), (e = t.onError) == null || e.call(t, o);
280
288
  },
281
289
  ...t.options
282
290
  }), u = h(() => c.isPending.value);
@@ -286,27 +294,27 @@ function J(t) {
286
294
  mutate: c.mutate
287
295
  };
288
296
  }
289
- function V(t) {
290
- const i = P(), l = N(), f = t.providerName || "default", { mutate: s } = S(), { invalidate: v } = z(), n = h(() => {
297
+ function W(t) {
298
+ const i = P(), l = q(), f = t.providerName || "default", { mutate: g } = $(), { invalidate: d } = z(), n = h(() => {
291
299
  const { onError: o, options: e, ...r } = t;
292
300
  return r;
293
- }), c = M({
301
+ }), c = A({
294
302
  mutationFn: (o) => {
295
- var e, r, d, E;
303
+ var e, r, v, E;
296
304
  if (!((e = i.config) != null && e.dataProvider))
297
305
  throw new Error("Data provider is not initialized");
298
- return (E = (d = (r = i.config) == null ? void 0 : r.dataProvider) == null ? void 0 : d[f]) == null ? void 0 : E.deleteOne({
306
+ return (E = (v = (r = i.config) == null ? void 0 : r.dataProvider) == null ? void 0 : v[f]) == null ? void 0 : E.deleteOne({
299
307
  ...n.value,
300
308
  ...o
301
309
  }, i, l);
302
310
  },
303
311
  onSuccess: (o) => {
304
312
  var e;
305
- c.reset(), (e = t.onSuccess) == null || e.call(t, o), t.path && v(t.path);
313
+ c.reset(), (e = t.onSuccess) == null || e.call(t, o), t.path && d(t.path);
306
314
  },
307
315
  onError: (o) => {
308
316
  var e;
309
- s(o), (e = t.onError) == null || e.call(t, o);
317
+ g(o), (e = t.onError) == null || e.call(t, o);
310
318
  },
311
319
  ...t.options
312
320
  }), u = h(() => c.isPending.value);
@@ -316,27 +324,27 @@ function V(t) {
316
324
  mutate: c.mutate
317
325
  };
318
326
  }
319
- function W(t) {
320
- const i = P(), l = N(), f = t.providerName || "default", { mutate: s } = S(), { invalidate: v } = z(), n = h(() => {
327
+ function X(t) {
328
+ const i = P(), l = q(), f = t.providerName || "default", { mutate: g } = $(), { invalidate: d } = z(), n = h(() => {
321
329
  const { onError: o, options: e, ...r } = t;
322
330
  return r;
323
- }), c = M({
331
+ }), c = A({
324
332
  mutationFn: (o) => {
325
- var e, r, d, E;
333
+ var e, r, v, E;
326
334
  if (!((e = i.config) != null && e.dataProvider))
327
335
  throw new Error("Data provider is not initialized");
328
- return (E = (d = (r = i.config) == null ? void 0 : r.dataProvider) == null ? void 0 : d[f]) == null ? void 0 : E.deleteMany({
336
+ return (E = (v = (r = i.config) == null ? void 0 : r.dataProvider) == null ? void 0 : v[f]) == null ? void 0 : E.deleteMany({
329
337
  ...n.value,
330
338
  ...o
331
339
  }, i, l);
332
340
  },
333
341
  onSuccess: (o) => {
334
342
  var e;
335
- (e = t.onSuccess) == null || e.call(t, o), t.path && v(t.path);
343
+ (e = t.onSuccess) == null || e.call(t, o), t.path && d(t.path);
336
344
  },
337
345
  onError: (o) => {
338
346
  var e;
339
- s(o), (e = t.onError) == null || e.call(t, o);
347
+ g(o), (e = t.onError) == null || e.call(t, o);
340
348
  },
341
349
  ...t.options
342
350
  }), u = h(() => c.isPending.value);
@@ -346,27 +354,27 @@ function W(t) {
346
354
  mutate: c.mutate
347
355
  };
348
356
  }
349
- function X(t) {
357
+ function Y(t) {
350
358
  var o;
351
- const i = P(), l = N(), f = (t == null ? void 0 : t.providerName) || "default", { mutate: s } = S(), v = h(() => {
359
+ const i = P(), l = q(), f = (t == null ? void 0 : t.providerName) || "default", { mutate: g } = $(), d = h(() => {
352
360
  if (!t)
353
361
  return {};
354
- const { onError: e, options: r, ...d } = t;
355
- return d;
356
- }), n = C({
357
- queryKey: [`${(o = i.config) == null ? void 0 : o.name}:${f}:${t == null ? void 0 : t.path}`, v],
362
+ const { onError: e, options: r, ...v } = t;
363
+ return v;
364
+ }), n = x({
365
+ queryKey: [`${(o = i.config) == null ? void 0 : o.name}:${f}:${t == null ? void 0 : t.path}`, d],
358
366
  queryFn: () => {
359
- var e, r, d;
360
- return (d = (r = (e = i.config) == null ? void 0 : e.dataProvider) == null ? void 0 : r[f]) == null ? void 0 : d.custom(v.value, i, l);
367
+ var e, r, v;
368
+ return (v = (r = (e = i.config) == null ? void 0 : e.dataProvider) == null ? void 0 : r[f]) == null ? void 0 : v.custom(d.value, i, l);
361
369
  },
362
370
  ...t == null ? void 0 : t.options
363
371
  }), c = h(() => n.isFetched.value ? !1 : n.isFetching.value);
364
- F(() => n.isError, () => {
372
+ S(() => n.isError, () => {
365
373
  var e;
366
- s(n.error), (e = t == null ? void 0 : t.onError) == null || e.call(t, n.error);
374
+ g(n.error), (e = t == null ? void 0 : t.onError) == null || e.call(t, n.error);
367
375
  });
368
- const u = $(void 0);
369
- return F(n.data, (e) => {
376
+ const u = w(void 0);
377
+ return S(n.data, (e) => {
370
378
  e && (u.value = e);
371
379
  }, {
372
380
  immediate: !0
@@ -377,19 +385,19 @@ function X(t) {
377
385
  refetch: n.refetch
378
386
  };
379
387
  }
380
- function Y(t) {
381
- const i = P(), l = N(), f = (t == null ? void 0 : t.providerName) || "default", { mutate: s } = S(), v = h(() => {
388
+ function Z(t) {
389
+ const i = P(), l = q(), f = (t == null ? void 0 : t.providerName) || "default", { mutate: g } = $(), d = h(() => {
382
390
  if (!t)
383
391
  return {};
384
392
  const { onError: u, options: o, ...e } = t;
385
393
  return e;
386
- }), n = M({
394
+ }), n = A({
387
395
  mutationFn: (u) => {
388
- var o, e, r, d;
396
+ var o, e, r, v;
389
397
  if (!((o = i.config) != null && o.dataProvider))
390
398
  throw new Error("Data provider is not initialized");
391
- return (d = (r = (e = i.config) == null ? void 0 : e.dataProvider) == null ? void 0 : r[f]) == null ? void 0 : d.custom({
392
- ...v.value,
399
+ return (v = (r = (e = i.config) == null ? void 0 : e.dataProvider) == null ? void 0 : r[f]) == null ? void 0 : v.custom({
400
+ ...d.value,
393
401
  ...u
394
402
  }, i, l);
395
403
  },
@@ -399,7 +407,7 @@ function Y(t) {
399
407
  },
400
408
  onError: (u) => {
401
409
  var o;
402
- s(u), (o = t == null ? void 0 : t.onError) == null || o.call(t, u);
410
+ g(u), (o = t == null ? void 0 : t.onError) == null || o.call(t, u);
403
411
  },
404
412
  ...t == null ? void 0 : t.options
405
413
  }), c = h(() => n.isPending.value);
@@ -409,15 +417,15 @@ function Y(t) {
409
417
  mutate: n.mutate
410
418
  };
411
419
  }
412
- function Z() {
413
- const t = P(), i = N();
420
+ function p() {
421
+ const t = P(), i = q();
414
422
  return {
415
423
  request: (f) => {
416
- var v, n, c, u;
417
- if (!((v = t.config) != null && v.dataProvider))
424
+ var d, n, c, u;
425
+ if (!((d = t.config) != null && d.dataProvider))
418
426
  throw new Error("Data provider is not initialized");
419
- const s = f.providerName || "default";
420
- return (u = (c = (n = t.config) == null ? void 0 : n.dataProvider) == null ? void 0 : c[s]) == null ? void 0 : u.custom({
427
+ const g = f.providerName || "default";
428
+ return (u = (c = (n = t.config) == null ? void 0 : n.dataProvider) == null ? void 0 : c[g]) == null ? void 0 : u.custom({
421
429
  ...f
422
430
  }, t, i);
423
431
  }
@@ -426,12 +434,12 @@ function Z() {
426
434
  function z() {
427
435
  const t = k(), i = P();
428
436
  return {
429
- invalidate: (f, s) => {
437
+ invalidate: (f, g) => {
430
438
  var n;
431
- let v = f;
432
- Array.isArray(f) || (v = [f]);
433
- for (const c of v) {
434
- const u = `${(n = i.config) == null ? void 0 : n.name}:${s || "default"}:${c}`;
439
+ let d = f;
440
+ Array.isArray(f) || (d = [f]);
441
+ for (const c of d) {
442
+ const u = `${(n = i.config) == null ? void 0 : n.name}:${g || "default"}:${c}`;
435
443
  t.invalidateQueries({
436
444
  queryKey: [u]
437
445
  });
@@ -440,18 +448,18 @@ function z() {
440
448
  };
441
449
  }
442
450
  export {
443
- Z as useClient,
444
- j as useCreate,
445
- B as useCreateMany,
446
- X as useCustom,
447
- Y as useCustomMutation,
448
- V as useDelete,
449
- W as useDeleteMany,
450
- G as useInfiniteList,
451
+ p as useClient,
452
+ B as useCreate,
453
+ H as useCreateMany,
454
+ Y as useCustom,
455
+ Z as useCustomMutation,
456
+ W as useDelete,
457
+ X as useDeleteMany,
458
+ R as useInfiniteList,
451
459
  z as useInvalidate,
452
- _ as useList,
453
- b as useMany,
454
- R as useOne,
455
- H as useUpdate,
456
- J as useUpdateMany
460
+ G as useList,
461
+ j as useMany,
462
+ b as useOne,
463
+ J as useUpdate,
464
+ V as useUpdateMany
457
465
  };