@duxweb/dvha-core 0.1.8 → 0.1.10

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