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