@teamnovu/kit-shopware-composables 0.0.8 → 0.0.9
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/index.mjs +337 -311
- package/dist/keys.d.ts +3 -0
- package/dist/query/products/index.d.ts +1 -0
- package/dist/query/products/useSearchPageQuery.d.ts +17 -0
- package/package.json +3 -3
- package/src/keys.ts +8 -0
- package/src/query/products/index.ts +1 -0
- package/src/query/products/useSearchPageQuery.ts +31 -0
package/dist/index.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { inject as Y, unref as i, computed as c, reactive as Z, watch as H, toRef as W } from "vue";
|
|
2
2
|
import { until as J } from "@vueuse/core";
|
|
3
|
-
import { queryOptions as M, useQuery as O, useQueryClient as S, useMutation as
|
|
3
|
+
import { queryOptions as M, useQuery as O, useQueryClient as S, useMutation as f } from "@tanstack/vue-query";
|
|
4
4
|
import "@teamnovu/kit-shopware-api-client";
|
|
5
5
|
const _ = Symbol("shopwareClient");
|
|
6
6
|
function g() {
|
|
@@ -9,7 +9,7 @@ function g() {
|
|
|
9
9
|
throw new Error("Shopware client not provided!");
|
|
10
10
|
return e;
|
|
11
11
|
}
|
|
12
|
-
const
|
|
12
|
+
const F = {
|
|
13
13
|
all: () => ["context"]
|
|
14
14
|
}, k = {
|
|
15
15
|
all: () => ["category"],
|
|
@@ -41,29 +41,36 @@ const R = {
|
|
|
41
41
|
body: t
|
|
42
42
|
}
|
|
43
43
|
]
|
|
44
|
-
},
|
|
44
|
+
}, L = {
|
|
45
45
|
all: () => ["product"],
|
|
46
|
-
lists: () => [...
|
|
46
|
+
lists: () => [...L.all(), "list"],
|
|
47
47
|
list: (e, s) => [
|
|
48
|
-
...
|
|
48
|
+
...L.all(),
|
|
49
49
|
"list",
|
|
50
50
|
{
|
|
51
51
|
url: e,
|
|
52
52
|
body: s
|
|
53
53
|
}
|
|
54
54
|
],
|
|
55
|
-
details: () => [...
|
|
55
|
+
details: () => [...L.all(), "detail"],
|
|
56
56
|
detail: (e, s) => [
|
|
57
|
-
...
|
|
57
|
+
...L.all(),
|
|
58
58
|
"detail",
|
|
59
59
|
{
|
|
60
60
|
url: e,
|
|
61
61
|
body: s
|
|
62
62
|
}
|
|
63
|
+
],
|
|
64
|
+
search: (e) => [
|
|
65
|
+
...L.all(),
|
|
66
|
+
"search",
|
|
67
|
+
{
|
|
68
|
+
body: e
|
|
69
|
+
}
|
|
63
70
|
]
|
|
64
|
-
},
|
|
71
|
+
}, x = {
|
|
65
72
|
get: () => ["cart"]
|
|
66
|
-
},
|
|
73
|
+
}, R = {
|
|
67
74
|
all: () => ["customer"],
|
|
68
75
|
detail: (e) => ["customer", { body: e }]
|
|
69
76
|
}, w = {
|
|
@@ -168,45 +175,45 @@ function ne(e) {
|
|
|
168
175
|
const T = (e) => {
|
|
169
176
|
const s = e.replace(/\/?$/, "");
|
|
170
177
|
return s.startsWith("/") ? s.slice(1) : s;
|
|
171
|
-
},
|
|
172
|
-
function
|
|
178
|
+
}, lt = (e) => `/${T(e)}`;
|
|
179
|
+
function dt(e, s, t) {
|
|
173
180
|
const n = S();
|
|
174
181
|
return {
|
|
175
182
|
onMutate: async (a) => {
|
|
176
183
|
await n.cancelQueries({ queryKey: e });
|
|
177
184
|
const r = n.getQueryData(e);
|
|
178
|
-
if (n.setQueryData(e, (
|
|
179
|
-
const
|
|
180
|
-
|
|
185
|
+
if (n.setQueryData(e, (u) => s(a, u)), t) {
|
|
186
|
+
const u = i(t), o = i(u.onMutate);
|
|
187
|
+
o == null || o(a);
|
|
181
188
|
}
|
|
182
189
|
return { previousValue: r };
|
|
183
190
|
},
|
|
184
|
-
onError: (a, r,
|
|
185
|
-
if (
|
|
186
|
-
const
|
|
187
|
-
|
|
191
|
+
onError: (a, r, u) => {
|
|
192
|
+
if (u && n.setQueryData(e, u.previousValue), t) {
|
|
193
|
+
const o = i(t), h = i(o.onError);
|
|
194
|
+
h == null || h(a, r, u);
|
|
188
195
|
}
|
|
189
196
|
},
|
|
190
197
|
onSettled: (...a) => {
|
|
191
198
|
if (n.invalidateQueries({ queryKey: e }), t) {
|
|
192
|
-
const r = i(t),
|
|
193
|
-
|
|
199
|
+
const r = i(t), u = i(r.onSettled);
|
|
200
|
+
u == null || u(...a);
|
|
194
201
|
}
|
|
195
202
|
}
|
|
196
203
|
};
|
|
197
204
|
}
|
|
198
205
|
const se = (e) => {
|
|
199
206
|
var t, n, a, r;
|
|
200
|
-
const s = (n = (t = i(e)) == null ? void 0 : t.transactions) == null ? void 0 : n.find((
|
|
201
|
-
var
|
|
202
|
-
return (
|
|
207
|
+
const s = (n = (t = i(e)) == null ? void 0 : t.transactions) == null ? void 0 : n.find((u) => {
|
|
208
|
+
var o;
|
|
209
|
+
return (o = u.paymentMethod) == null ? void 0 : o.active;
|
|
203
210
|
});
|
|
204
211
|
return ((a = s == null ? void 0 : s.paymentMethod) == null ? void 0 : a.asynchronous) && ((r = s == null ? void 0 : s.paymentMethod) == null ? void 0 : r.afterOrderEnabled);
|
|
205
212
|
}, re = "readContext get /context";
|
|
206
213
|
function ae(e) {
|
|
207
214
|
const s = g();
|
|
208
215
|
return M({
|
|
209
|
-
queryKey:
|
|
216
|
+
queryKey: F.all(),
|
|
210
217
|
queryFn: ({ signal: t }) => s.query(re, {
|
|
211
218
|
...m(e),
|
|
212
219
|
signal: t
|
|
@@ -216,21 +223,21 @@ function ae(e) {
|
|
|
216
223
|
function V(e) {
|
|
217
224
|
return O(ae(e));
|
|
218
225
|
}
|
|
219
|
-
const
|
|
226
|
+
const ue = "updateContext patch /context";
|
|
220
227
|
function $(e) {
|
|
221
228
|
const s = g(), t = S();
|
|
222
|
-
return
|
|
229
|
+
return f({
|
|
223
230
|
...e,
|
|
224
|
-
mutationFn: async (n) => (t.cancelQueries({ queryKey:
|
|
231
|
+
mutationFn: async (n) => (t.cancelQueries({ queryKey: F.all() }), s.query(ue, {
|
|
225
232
|
body: n
|
|
226
233
|
})),
|
|
227
234
|
onSuccess: async (n, a, r) => {
|
|
228
|
-
var
|
|
229
|
-
await t.invalidateQueries({ queryKey:
|
|
235
|
+
var u, o;
|
|
236
|
+
await t.invalidateQueries({ queryKey: F.all() }), await ((o = i((u = i(e)) == null ? void 0 : u.onSuccess)) == null ? void 0 : o(n, a, r));
|
|
230
237
|
}
|
|
231
238
|
});
|
|
232
239
|
}
|
|
233
|
-
function
|
|
240
|
+
function yt() {
|
|
234
241
|
const e = $(), s = V(), t = ne(), n = c(() => s.isFetching.value || e.isPending.value), a = async (d) => {
|
|
235
242
|
await e.mutateAsync({
|
|
236
243
|
billingAddressId: d.id
|
|
@@ -239,18 +246,18 @@ function lt() {
|
|
|
239
246
|
await e.mutateAsync({
|
|
240
247
|
shippingAddressId: d.id
|
|
241
248
|
}), await J(n).toBe(!1);
|
|
242
|
-
},
|
|
249
|
+
}, u = c(() => {
|
|
243
250
|
var d, P;
|
|
244
251
|
return (P = (d = s.data.value) == null ? void 0 : d.customer) == null ? void 0 : P.activeBillingAddress;
|
|
245
|
-
}),
|
|
252
|
+
}), o = c(() => {
|
|
246
253
|
var d, P;
|
|
247
254
|
return (P = (d = s.data.value) == null ? void 0 : d.customer) == null ? void 0 : P.activeShippingAddress;
|
|
248
|
-
}),
|
|
255
|
+
}), h = c(() => {
|
|
249
256
|
var d;
|
|
250
257
|
return ((d = t.data.value) == null ? void 0 : d.elements.filter(
|
|
251
258
|
(P) => {
|
|
252
259
|
var Q;
|
|
253
|
-
return P.id !== ((Q =
|
|
260
|
+
return P.id !== ((Q = u.value) == null ? void 0 : Q.id);
|
|
254
261
|
}
|
|
255
262
|
)) ?? [];
|
|
256
263
|
}), C = c(() => {
|
|
@@ -258,7 +265,7 @@ function lt() {
|
|
|
258
265
|
return ((d = t.data.value) == null ? void 0 : d.elements.filter(
|
|
259
266
|
(P) => {
|
|
260
267
|
var Q;
|
|
261
|
-
return P.id !== ((Q =
|
|
268
|
+
return P.id !== ((Q = o.value) == null ? void 0 : Q.id);
|
|
262
269
|
}
|
|
263
270
|
)) ?? [];
|
|
264
271
|
});
|
|
@@ -269,20 +276,20 @@ function lt() {
|
|
|
269
276
|
setBillingAddress: a,
|
|
270
277
|
setShippingAddress: r,
|
|
271
278
|
isSaving: n,
|
|
272
|
-
activeBillingAddress:
|
|
273
|
-
activeShippingAddress:
|
|
274
|
-
inactiveBillingAddresses:
|
|
279
|
+
activeBillingAddress: u,
|
|
280
|
+
activeShippingAddress: o,
|
|
281
|
+
inactiveBillingAddresses: h,
|
|
275
282
|
inactiveShippingAddresses: C
|
|
276
283
|
};
|
|
277
284
|
}
|
|
278
|
-
const
|
|
285
|
+
const oe = "readOrder post /order";
|
|
279
286
|
function ie(e) {
|
|
280
287
|
const s = g(), t = U.detail(e);
|
|
281
288
|
return M({
|
|
282
289
|
queryKey: t,
|
|
283
290
|
queryFn: async ({ signal: n }) => {
|
|
284
291
|
const a = m(e);
|
|
285
|
-
return s.query(
|
|
292
|
+
return s.query(oe, {
|
|
286
293
|
...a,
|
|
287
294
|
signal: n
|
|
288
295
|
});
|
|
@@ -292,7 +299,7 @@ function ie(e) {
|
|
|
292
299
|
function ce(e) {
|
|
293
300
|
return O(ie(e));
|
|
294
301
|
}
|
|
295
|
-
function
|
|
302
|
+
function pt(e, s) {
|
|
296
303
|
const t = c(() => {
|
|
297
304
|
const l = i(e);
|
|
298
305
|
if (l)
|
|
@@ -315,13 +322,13 @@ function dt(e, s) {
|
|
|
315
322
|
}), r = c(() => {
|
|
316
323
|
var l, p;
|
|
317
324
|
return ((p = (l = n.data) == null ? void 0 : l.value) == null ? void 0 : p.paymentChangeable) || {};
|
|
318
|
-
}),
|
|
325
|
+
}), u = c(() => {
|
|
319
326
|
var l, p, q;
|
|
320
327
|
return (q = (p = (l = a.value) == null ? void 0 : l.stateMachineState) == null ? void 0 : p.translated) == null ? void 0 : q.name;
|
|
321
|
-
}),
|
|
328
|
+
}), o = c(() => {
|
|
322
329
|
var l, p;
|
|
323
330
|
return (p = (l = a.value) == null ? void 0 : l.stateMachineState) == null ? void 0 : p.technicalName;
|
|
324
|
-
}),
|
|
331
|
+
}), h = c(() => {
|
|
325
332
|
var l, p;
|
|
326
333
|
return (p = (l = a.value) == null ? void 0 : l.price) == null ? void 0 : p.totalPrice;
|
|
327
334
|
}), C = c(() => {
|
|
@@ -350,7 +357,7 @@ function dt(e, s) {
|
|
|
350
357
|
var l, p, q;
|
|
351
358
|
return (q = (p = (l = a.value) == null ? void 0 : l.deliveries) == null ? void 0 : p[0]) == null ? void 0 : q.shippingOrderAddress;
|
|
352
359
|
}
|
|
353
|
-
),
|
|
360
|
+
), v = c(() => {
|
|
354
361
|
var p, q;
|
|
355
362
|
const l = (p = a.value) == null ? void 0 : p.transactions;
|
|
356
363
|
if (l != null && l.length)
|
|
@@ -367,26 +374,26 @@ function dt(e, s) {
|
|
|
367
374
|
});
|
|
368
375
|
return {
|
|
369
376
|
order: a,
|
|
370
|
-
status:
|
|
371
|
-
statusTechnicalName:
|
|
372
|
-
total:
|
|
377
|
+
status: u,
|
|
378
|
+
statusTechnicalName: o,
|
|
379
|
+
total: h,
|
|
373
380
|
subtotal: C,
|
|
374
381
|
shippingCosts: d,
|
|
375
382
|
shippingAddress: y,
|
|
376
383
|
billingAddress: Q,
|
|
377
384
|
personalDetails: P,
|
|
378
385
|
shippingMethod: A,
|
|
379
|
-
paymentMethod:
|
|
386
|
+
paymentMethod: v,
|
|
380
387
|
paymentChangeable: K,
|
|
381
388
|
orderQuery: n
|
|
382
389
|
};
|
|
383
390
|
}
|
|
384
|
-
function
|
|
391
|
+
function mt(e) {
|
|
385
392
|
const s = c(() => {
|
|
386
|
-
var r,
|
|
387
|
-
return (
|
|
388
|
-
var
|
|
389
|
-
return ((
|
|
393
|
+
var r, u;
|
|
394
|
+
return (u = (r = i(e)) == null ? void 0 : r.transactions) == null ? void 0 : u.find((o) => {
|
|
395
|
+
var h;
|
|
396
|
+
return ((h = o.paymentMethod) == null ? void 0 : h.active) === !0;
|
|
390
397
|
});
|
|
391
398
|
}), t = c(() => {
|
|
392
399
|
var r;
|
|
@@ -403,65 +410,65 @@ function yt(e) {
|
|
|
403
410
|
};
|
|
404
411
|
}
|
|
405
412
|
const le = "createCustomerAddress post /account/address";
|
|
406
|
-
function
|
|
413
|
+
function gt(e) {
|
|
407
414
|
const s = g(), t = S();
|
|
408
|
-
return
|
|
415
|
+
return f({
|
|
409
416
|
...e,
|
|
410
417
|
mutationFn: async (n) => s.query(le, m(n)),
|
|
411
418
|
onSuccess: async (n, a, r) => {
|
|
412
|
-
var
|
|
413
|
-
await t.invalidateQueries({ queryKey: w.lists() }), await ((
|
|
419
|
+
var u, o;
|
|
420
|
+
await t.invalidateQueries({ queryKey: w.lists() }), await ((o = i((u = i(e)) == null ? void 0 : u.onSuccess)) == null ? void 0 : o(n, a, r));
|
|
414
421
|
}
|
|
415
422
|
});
|
|
416
423
|
}
|
|
417
424
|
const de = "deleteCustomerAddress delete /account/address/{addressId}";
|
|
418
|
-
function
|
|
425
|
+
function ht(e) {
|
|
419
426
|
const s = g(), t = S();
|
|
420
|
-
return
|
|
427
|
+
return f({
|
|
421
428
|
...e,
|
|
422
429
|
mutationFn: async (n) => s.query(de, m(n)),
|
|
423
430
|
onSuccess: async (n, a, r) => {
|
|
424
|
-
var
|
|
425
|
-
await t.invalidateQueries({ queryKey: w.lists() }), await ((
|
|
431
|
+
var u, o;
|
|
432
|
+
await t.invalidateQueries({ queryKey: w.lists() }), await ((o = i((u = i(e)) == null ? void 0 : u.onSuccess)) == null ? void 0 : o(n, a, r));
|
|
426
433
|
}
|
|
427
434
|
});
|
|
428
435
|
}
|
|
429
436
|
const ye = "updateCustomerAddress patch /account/address/{addressId}";
|
|
430
|
-
function
|
|
437
|
+
function ft(e) {
|
|
431
438
|
const s = g(), t = S();
|
|
432
|
-
return
|
|
439
|
+
return f({
|
|
433
440
|
...e,
|
|
434
441
|
mutationFn: async (n) => s.query(ye, m(n)),
|
|
435
442
|
onSuccess: async (n, a, r) => {
|
|
436
|
-
var
|
|
437
|
-
const { addressId:
|
|
438
|
-
t.setQueryData(w.detail(
|
|
443
|
+
var o, h;
|
|
444
|
+
const { addressId: u } = m(a).params;
|
|
445
|
+
t.setQueryData(w.detail(u), n), await Promise.all([
|
|
439
446
|
t.invalidateQueries({ queryKey: w.lists() }),
|
|
440
447
|
t.invalidateQueries({
|
|
441
448
|
queryKey: w.detail(m(a).params.addressId),
|
|
442
|
-
predicate: (C) => C.queryKey.at(-1) !==
|
|
449
|
+
predicate: (C) => C.queryKey.at(-1) !== u
|
|
443
450
|
})
|
|
444
|
-
]), await ((
|
|
451
|
+
]), await ((h = i((o = i(e)) == null ? void 0 : o.onSuccess)) == null ? void 0 : h(n, a, r));
|
|
445
452
|
}
|
|
446
453
|
});
|
|
447
454
|
}
|
|
448
455
|
const pe = "addLineItem post /checkout/cart/line-item";
|
|
449
|
-
function
|
|
456
|
+
function vt(e) {
|
|
450
457
|
const s = g(), t = S();
|
|
451
|
-
return
|
|
458
|
+
return f({
|
|
452
459
|
...e,
|
|
453
460
|
mutationFn: async (n) => s.query(pe, {
|
|
454
461
|
body: n
|
|
455
462
|
}),
|
|
456
463
|
onSuccess: async (n, a, r) => {
|
|
457
|
-
var
|
|
458
|
-
t.setQueryData(
|
|
464
|
+
var u, o;
|
|
465
|
+
t.setQueryData(x.get(), n), await ((o = i((u = i(e)) == null ? void 0 : u.onSuccess)) == null ? void 0 : o(n, a, r));
|
|
459
466
|
}
|
|
460
467
|
});
|
|
461
468
|
}
|
|
462
469
|
const me = "readCart get /checkout/cart";
|
|
463
470
|
function ge(e) {
|
|
464
|
-
const s = g(), t =
|
|
471
|
+
const s = g(), t = x.get();
|
|
465
472
|
return M({
|
|
466
473
|
queryKey: t,
|
|
467
474
|
queryFn: async ({ signal: n }) => s.query(me, {
|
|
@@ -470,51 +477,51 @@ function ge(e) {
|
|
|
470
477
|
})
|
|
471
478
|
});
|
|
472
479
|
}
|
|
473
|
-
function
|
|
480
|
+
function qt() {
|
|
474
481
|
return O(ge());
|
|
475
482
|
}
|
|
476
|
-
const
|
|
477
|
-
function
|
|
483
|
+
const he = "removeLineItem post /checkout/cart/line-item/delete";
|
|
484
|
+
function Ct(e) {
|
|
478
485
|
const s = g(), t = S();
|
|
479
|
-
return
|
|
486
|
+
return f({
|
|
480
487
|
...e,
|
|
481
|
-
mutationFn: async (n) => s.query(
|
|
488
|
+
mutationFn: async (n) => s.query(he, {
|
|
482
489
|
body: n
|
|
483
490
|
}),
|
|
484
491
|
onSuccess: async (n, a, r) => {
|
|
485
|
-
var
|
|
486
|
-
t.setQueryData(
|
|
492
|
+
var u, o;
|
|
493
|
+
t.setQueryData(x.get(), n), await ((o = i((u = i(e)) == null ? void 0 : u.onSuccess)) == null ? void 0 : o(n, a, r));
|
|
487
494
|
}
|
|
488
495
|
});
|
|
489
496
|
}
|
|
490
|
-
const
|
|
491
|
-
function
|
|
497
|
+
const fe = "updateLineItem patch /checkout/cart/line-item";
|
|
498
|
+
function St(e) {
|
|
492
499
|
const s = g(), t = S();
|
|
493
|
-
return
|
|
500
|
+
return f({
|
|
494
501
|
...e,
|
|
495
|
-
mutationFn: async (n) => s.query(
|
|
502
|
+
mutationFn: async (n) => s.query(fe, {
|
|
496
503
|
body: n
|
|
497
504
|
}),
|
|
498
505
|
onSuccess: async (n, a, r) => {
|
|
499
|
-
var
|
|
500
|
-
t.setQueryData(
|
|
506
|
+
var u, o;
|
|
507
|
+
t.setQueryData(x.get(), n), await ((o = i((u = i(e)) == null ? void 0 : u.onSuccess)) == null ? void 0 : o(n, a, r));
|
|
501
508
|
}
|
|
502
509
|
});
|
|
503
510
|
}
|
|
504
|
-
const
|
|
505
|
-
function
|
|
511
|
+
const ve = "createOrder post /checkout/order";
|
|
512
|
+
function Pt(e) {
|
|
506
513
|
const s = g(), t = S();
|
|
507
|
-
return
|
|
514
|
+
return f({
|
|
508
515
|
...e,
|
|
509
|
-
mutationFn: async (n) => s.query(
|
|
516
|
+
mutationFn: async (n) => s.query(ve, m(n)),
|
|
510
517
|
onSuccess: async (n, a, r) => {
|
|
511
|
-
var
|
|
518
|
+
var u, o;
|
|
512
519
|
await Promise.all([
|
|
513
520
|
// Clear cart after successful order creation
|
|
514
|
-
t.invalidateQueries({ queryKey:
|
|
521
|
+
t.invalidateQueries({ queryKey: x.get() }),
|
|
515
522
|
// Invalidate order list to refetch data
|
|
516
523
|
t.invalidateQueries({ queryKey: U.lists() })
|
|
517
|
-
]), await ((
|
|
524
|
+
]), await ((o = i((u = i(e)) == null ? void 0 : u.onSuccess)) == null ? void 0 : o(n, a, r));
|
|
518
525
|
}
|
|
519
526
|
});
|
|
520
527
|
}
|
|
@@ -531,40 +538,40 @@ const qe = "readCountry post /country", Ce = function(s) {
|
|
|
531
538
|
}
|
|
532
539
|
});
|
|
533
540
|
};
|
|
534
|
-
function
|
|
541
|
+
function Qt(e) {
|
|
535
542
|
return O(Ce(e));
|
|
536
543
|
}
|
|
537
544
|
const Se = "changeEmail post /account/change-email";
|
|
538
|
-
function
|
|
545
|
+
function Mt(e) {
|
|
539
546
|
const s = g(), t = S();
|
|
540
|
-
return
|
|
547
|
+
return f({
|
|
541
548
|
...e,
|
|
542
549
|
mutationFn: async (n) => s.query(Se, m(n)),
|
|
543
550
|
onSuccess: async (n, a, r) => {
|
|
544
|
-
var
|
|
545
|
-
await t.invalidateQueries({ queryKey:
|
|
551
|
+
var u, o;
|
|
552
|
+
await t.invalidateQueries({ queryKey: R.all() }), await t.invalidateQueries({ queryKey: F.all() }), await ((o = i((u = i(e)) == null ? void 0 : u.onSuccess)) == null ? void 0 : o(n, a, r));
|
|
546
553
|
}
|
|
547
554
|
});
|
|
548
555
|
}
|
|
549
556
|
const Pe = "changeProfile post /account/change-profile";
|
|
550
|
-
function
|
|
557
|
+
function Ot(e) {
|
|
551
558
|
const s = g(), t = S();
|
|
552
|
-
return
|
|
559
|
+
return f({
|
|
553
560
|
...e,
|
|
554
561
|
mutationFn: async (n) => s.query(Pe, m(n)),
|
|
555
562
|
onSuccess: async (n, a, r) => {
|
|
556
|
-
var
|
|
563
|
+
var u, o;
|
|
557
564
|
await Promise.all([
|
|
558
|
-
t.invalidateQueries({ queryKey:
|
|
559
|
-
t.invalidateQueries({ queryKey:
|
|
560
|
-
]), await ((
|
|
565
|
+
t.invalidateQueries({ queryKey: R.all() }),
|
|
566
|
+
t.invalidateQueries({ queryKey: F.all() })
|
|
567
|
+
]), await ((o = i((u = i(e)) == null ? void 0 : u.onSuccess)) == null ? void 0 : o(n, a, r));
|
|
561
568
|
}
|
|
562
569
|
});
|
|
563
570
|
}
|
|
564
571
|
const Qe = "loginCustomer post /account/login";
|
|
565
|
-
function
|
|
572
|
+
function At(e) {
|
|
566
573
|
const s = g(), t = S();
|
|
567
|
-
return
|
|
574
|
+
return f({
|
|
568
575
|
...e,
|
|
569
576
|
mutationFn: async (n) => {
|
|
570
577
|
const a = await s.queryRaw(Qe, {
|
|
@@ -573,34 +580,34 @@ function Mt(e) {
|
|
|
573
580
|
return r && s.setContextToken(r), a.json();
|
|
574
581
|
},
|
|
575
582
|
onSuccess: async (n, a, r) => {
|
|
576
|
-
var
|
|
583
|
+
var u, o;
|
|
577
584
|
await Promise.all([
|
|
578
|
-
t.removeQueries({ queryKey:
|
|
579
|
-
t.invalidateQueries({ queryKey:
|
|
580
|
-
t.invalidateQueries({ queryKey:
|
|
581
|
-
]), await ((
|
|
585
|
+
t.removeQueries({ queryKey: F.all() }),
|
|
586
|
+
t.invalidateQueries({ queryKey: x.get() }),
|
|
587
|
+
t.invalidateQueries({ queryKey: R.all() })
|
|
588
|
+
]), await ((o = i((u = i(e)) == null ? void 0 : u.onSuccess)) == null ? void 0 : o(n, a, r));
|
|
582
589
|
}
|
|
583
590
|
});
|
|
584
591
|
}
|
|
585
592
|
const Me = "logoutCustomer post /account/logout";
|
|
586
|
-
function
|
|
593
|
+
function Kt(e) {
|
|
587
594
|
const s = g(), t = S();
|
|
588
|
-
return
|
|
595
|
+
return f({
|
|
589
596
|
...e,
|
|
590
597
|
mutationFn: async (n) => s.query(Me, m(n)),
|
|
591
598
|
onSuccess: async (n, a, r) => {
|
|
592
|
-
var
|
|
599
|
+
var u, o;
|
|
593
600
|
await Promise.all([
|
|
594
|
-
t.removeQueries({ queryKey:
|
|
595
|
-
t.invalidateQueries({ queryKey:
|
|
596
|
-
t.invalidateQueries({ queryKey:
|
|
597
|
-
]), await ((
|
|
601
|
+
t.removeQueries({ queryKey: F.all() }),
|
|
602
|
+
t.invalidateQueries({ queryKey: x.get() }),
|
|
603
|
+
t.invalidateQueries({ queryKey: R.all() })
|
|
604
|
+
]), await ((o = i((u = i(e)) == null ? void 0 : u.onSuccess)) == null ? void 0 : o(n, a, r));
|
|
598
605
|
}
|
|
599
606
|
});
|
|
600
607
|
}
|
|
601
608
|
const Oe = "readCustomer post /account/customer";
|
|
602
609
|
function Ae(e) {
|
|
603
|
-
const s = g(), t =
|
|
610
|
+
const s = g(), t = R.detail(c(() => m(e).body ?? {}));
|
|
604
611
|
return M({
|
|
605
612
|
queryKey: t,
|
|
606
613
|
queryFn: async () => s.query(Oe, m(e))
|
|
@@ -610,67 +617,67 @@ function Ke(e) {
|
|
|
610
617
|
return O(Ae(e));
|
|
611
618
|
}
|
|
612
619
|
const we = "register post /account/register";
|
|
613
|
-
function
|
|
620
|
+
function wt(e) {
|
|
614
621
|
const s = g(), t = S();
|
|
615
|
-
return
|
|
622
|
+
return f({
|
|
616
623
|
...e,
|
|
617
624
|
mutationFn: async (n) => s.query(we, m(n)),
|
|
618
625
|
onSuccess: async (n, a, r) => {
|
|
619
|
-
var
|
|
620
|
-
await t.invalidateQueries({ queryKey:
|
|
626
|
+
var u, o;
|
|
627
|
+
await t.invalidateQueries({ queryKey: R.all() }), await ((o = i((u = i(e)) == null ? void 0 : u.onSuccess)) == null ? void 0 : o(n, a, r));
|
|
621
628
|
}
|
|
622
629
|
});
|
|
623
630
|
}
|
|
624
|
-
const
|
|
625
|
-
function
|
|
631
|
+
const Fe = "defaultBillingAddress patch /account/address/default-billing/{addressId}";
|
|
632
|
+
function Ft(e) {
|
|
626
633
|
const s = g(), t = S();
|
|
627
|
-
return
|
|
634
|
+
return f({
|
|
628
635
|
...e,
|
|
629
|
-
mutationFn: async (n) => s.query(
|
|
636
|
+
mutationFn: async (n) => s.query(Fe, m(n)),
|
|
630
637
|
onSuccess: async (n, a, r) => {
|
|
631
|
-
var
|
|
638
|
+
var u, o;
|
|
632
639
|
await Promise.all([
|
|
633
|
-
t.invalidateQueries({ queryKey:
|
|
634
|
-
t.invalidateQueries({ queryKey:
|
|
635
|
-
]), await ((
|
|
640
|
+
t.invalidateQueries({ queryKey: R.all() }),
|
|
641
|
+
t.invalidateQueries({ queryKey: F.all() })
|
|
642
|
+
]), await ((o = i((u = i(e)) == null ? void 0 : u.onSuccess)) == null ? void 0 : o(n, a, r));
|
|
636
643
|
}
|
|
637
644
|
});
|
|
638
645
|
}
|
|
639
|
-
const
|
|
640
|
-
function
|
|
646
|
+
const Re = "defaultShippingAddress patch /account/address/default-shipping/{addressId}";
|
|
647
|
+
function Rt(e) {
|
|
641
648
|
const s = g(), t = S();
|
|
642
|
-
return
|
|
649
|
+
return f({
|
|
643
650
|
...e,
|
|
644
|
-
mutationFn: async (n) => s.query(
|
|
651
|
+
mutationFn: async (n) => s.query(Re, m(n)),
|
|
645
652
|
onSuccess: async (n, a, r) => {
|
|
646
|
-
var
|
|
653
|
+
var u, o;
|
|
647
654
|
await Promise.all([
|
|
648
|
-
t.invalidateQueries({ queryKey:
|
|
649
|
-
t.invalidateQueries({ queryKey:
|
|
650
|
-
]), await ((
|
|
655
|
+
t.invalidateQueries({ queryKey: R.all() }),
|
|
656
|
+
t.invalidateQueries({ queryKey: F.all() })
|
|
657
|
+
]), await ((o = i((u = i(e)) == null ? void 0 : u.onSuccess)) == null ? void 0 : o(n, a, r));
|
|
651
658
|
}
|
|
652
659
|
});
|
|
653
660
|
}
|
|
654
661
|
const Ie = "deleteCustomer delete /account/customer";
|
|
655
|
-
function
|
|
662
|
+
function It(e) {
|
|
656
663
|
const s = g(), t = S();
|
|
657
|
-
return
|
|
664
|
+
return f({
|
|
658
665
|
...e,
|
|
659
666
|
mutationFn: async (n) => s.query(Ie, m(n)),
|
|
660
667
|
onSuccess: async (n, a, r) => {
|
|
661
|
-
var
|
|
668
|
+
var u, o;
|
|
662
669
|
await Promise.all([
|
|
663
|
-
t.resetQueries({ queryKey: F.all() }),
|
|
664
670
|
t.resetQueries({ queryKey: R.all() }),
|
|
665
|
-
t.resetQueries({ queryKey:
|
|
666
|
-
|
|
671
|
+
t.resetQueries({ queryKey: F.all() }),
|
|
672
|
+
t.resetQueries({ queryKey: x.get() })
|
|
673
|
+
]), await ((o = i((u = i(e)) == null ? void 0 : u.onSuccess)) == null ? void 0 : o(n, a, r));
|
|
667
674
|
}
|
|
668
675
|
});
|
|
669
676
|
}
|
|
670
677
|
const Le = "registerConfirm post /account/register-confirm";
|
|
671
|
-
function
|
|
678
|
+
function Lt(e) {
|
|
672
679
|
const s = g();
|
|
673
|
-
return
|
|
680
|
+
return f({
|
|
674
681
|
...e,
|
|
675
682
|
mutationFn: async (t) => {
|
|
676
683
|
const n = await s.queryRaw(Le, {
|
|
@@ -679,44 +686,44 @@ function Ft(e) {
|
|
|
679
686
|
return a && s.setContextToken(a), n.json();
|
|
680
687
|
},
|
|
681
688
|
onSuccess: async (t, n, a) => {
|
|
682
|
-
var r,
|
|
683
|
-
await ((
|
|
689
|
+
var r, u;
|
|
690
|
+
await ((u = i((r = i(e)) == null ? void 0 : r.onSuccess)) == null ? void 0 : u(t, n, a));
|
|
684
691
|
}
|
|
685
692
|
});
|
|
686
693
|
}
|
|
687
694
|
const xe = "sendRecoveryMail post /account/recovery-password";
|
|
688
|
-
function
|
|
695
|
+
function xt(e) {
|
|
689
696
|
const s = g();
|
|
690
|
-
return
|
|
697
|
+
return f({
|
|
691
698
|
...e,
|
|
692
699
|
mutationFn: async (t) => s.query(xe, m(t)),
|
|
693
700
|
onSuccess: async (t, n, a) => {
|
|
694
|
-
var r,
|
|
695
|
-
await ((
|
|
701
|
+
var r, u;
|
|
702
|
+
await ((u = i((r = i(e)) == null ? void 0 : r.onSuccess)) == null ? void 0 : u(t, n, a));
|
|
696
703
|
}
|
|
697
704
|
});
|
|
698
705
|
}
|
|
699
706
|
const Ue = "changePassword post /account/change-password";
|
|
700
|
-
function
|
|
707
|
+
function Ut(e) {
|
|
701
708
|
const s = g();
|
|
702
|
-
return
|
|
709
|
+
return f({
|
|
703
710
|
...e,
|
|
704
711
|
mutationFn: async (t) => s.query(Ue, m(t)),
|
|
705
712
|
onSuccess: async (t, n, a) => {
|
|
706
|
-
var r,
|
|
707
|
-
await ((
|
|
713
|
+
var r, u;
|
|
714
|
+
await ((u = i((r = i(e)) == null ? void 0 : r.onSuccess)) == null ? void 0 : u(t, n, a));
|
|
708
715
|
}
|
|
709
716
|
});
|
|
710
717
|
}
|
|
711
718
|
const be = "recoveryPassword post /account/recovery-password-confirm";
|
|
712
|
-
function
|
|
719
|
+
function bt(e) {
|
|
713
720
|
const s = g();
|
|
714
|
-
return
|
|
721
|
+
return f({
|
|
715
722
|
...e,
|
|
716
723
|
mutationFn: async (t) => s.query(be, m(t)),
|
|
717
724
|
onSuccess: async (t, n, a) => {
|
|
718
|
-
var r,
|
|
719
|
-
await ((
|
|
725
|
+
var r, u;
|
|
726
|
+
await ((u = i((r = i(e)) == null ? void 0 : r.onSuccess)) == null ? void 0 : u(t, n, a));
|
|
720
727
|
}
|
|
721
728
|
});
|
|
722
729
|
}
|
|
@@ -724,20 +731,20 @@ const ke = "readNavigation post /navigation/{activeId}/{rootId}", Be = function(
|
|
|
724
731
|
const a = g(), r = b.detail(s, t, n);
|
|
725
732
|
return M({
|
|
726
733
|
queryKey: r,
|
|
727
|
-
queryFn: async ({ signal:
|
|
728
|
-
const
|
|
734
|
+
queryFn: async ({ signal: u }) => {
|
|
735
|
+
const o = i(s), h = i(t), C = m(n);
|
|
729
736
|
return a.query(ke, {
|
|
730
737
|
...C,
|
|
731
738
|
params: {
|
|
732
|
-
activeId:
|
|
733
|
-
rootId:
|
|
739
|
+
activeId: o,
|
|
740
|
+
rootId: h
|
|
734
741
|
},
|
|
735
|
-
signal:
|
|
742
|
+
signal: u
|
|
736
743
|
});
|
|
737
744
|
}
|
|
738
745
|
});
|
|
739
746
|
};
|
|
740
|
-
function
|
|
747
|
+
function kt(e, s, t) {
|
|
741
748
|
return O(Be(e, s, t));
|
|
742
749
|
}
|
|
743
750
|
const Ne = "readPaymentMethod post /payment-method";
|
|
@@ -758,26 +765,26 @@ function Ee(e) {
|
|
|
758
765
|
return O(De(e));
|
|
759
766
|
}
|
|
760
767
|
const je = "handlePaymentMethod post /handle-payment";
|
|
761
|
-
function
|
|
768
|
+
function Bt(e) {
|
|
762
769
|
const s = g();
|
|
763
|
-
return
|
|
770
|
+
return f({
|
|
764
771
|
...e,
|
|
765
772
|
mutationFn: async (t) => s.query(je, m(t)),
|
|
766
773
|
onSuccess: async (t, n, a) => {
|
|
767
|
-
var r,
|
|
768
|
-
await ((
|
|
774
|
+
var r, u;
|
|
775
|
+
await ((u = i((r = i(e)) == null ? void 0 : r.onSuccess)) == null ? void 0 : u(t, n, a));
|
|
769
776
|
}
|
|
770
777
|
});
|
|
771
778
|
}
|
|
772
779
|
const Te = "orderSetPayment post /order/payment";
|
|
773
|
-
function
|
|
780
|
+
function Nt(e) {
|
|
774
781
|
const s = g(), t = S();
|
|
775
|
-
return
|
|
782
|
+
return f({
|
|
776
783
|
...e,
|
|
777
784
|
mutationFn: async (n) => s.query(Te, m(n)),
|
|
778
785
|
onSuccess: async (n, a, r) => {
|
|
779
|
-
var
|
|
780
|
-
await t.invalidateQueries({ queryKey: U.all() }), await ((
|
|
786
|
+
var u, o;
|
|
787
|
+
await t.invalidateQueries({ queryKey: U.all() }), await ((o = i((u = i(e)) == null ? void 0 : u.onSuccess)) == null ? void 0 : o(n, a, r));
|
|
781
788
|
}
|
|
782
789
|
});
|
|
783
790
|
}
|
|
@@ -791,12 +798,12 @@ const Ve = "readCategoryList post /category", $e = function(s) {
|
|
|
791
798
|
})
|
|
792
799
|
});
|
|
793
800
|
};
|
|
794
|
-
function
|
|
801
|
+
function Dt(e) {
|
|
795
802
|
return O($e(e));
|
|
796
803
|
}
|
|
797
804
|
const ze = "readCompactProductListing post /novu/headless/product-listing/{seoUrl}";
|
|
798
805
|
function Ge(e, s) {
|
|
799
|
-
const t = g(), n =
|
|
806
|
+
const t = g(), n = L.list(e, s);
|
|
800
807
|
return M({
|
|
801
808
|
queryKey: n,
|
|
802
809
|
queryFn: async ({ signal: a }) => {
|
|
@@ -812,12 +819,12 @@ function Ge(e, s) {
|
|
|
812
819
|
}
|
|
813
820
|
});
|
|
814
821
|
}
|
|
815
|
-
function
|
|
822
|
+
function Et(e, s) {
|
|
816
823
|
return O(Ge(e, s));
|
|
817
824
|
}
|
|
818
825
|
const He = "readCustomProductDetail post /novu/headless/product/{seoUrl}";
|
|
819
826
|
function We(e, s) {
|
|
820
|
-
const t = g(), n =
|
|
827
|
+
const t = g(), n = L.detail(e, s);
|
|
821
828
|
return M({
|
|
822
829
|
queryKey: n,
|
|
823
830
|
queryFn: async ({ signal: a }) => {
|
|
@@ -833,71 +840,88 @@ function We(e, s) {
|
|
|
833
840
|
}
|
|
834
841
|
});
|
|
835
842
|
}
|
|
836
|
-
function
|
|
843
|
+
function jt(e, s) {
|
|
837
844
|
return O(We(e, s));
|
|
838
845
|
}
|
|
839
|
-
const Je = "
|
|
846
|
+
const Je = "searchPage post /search";
|
|
847
|
+
function Xe(e) {
|
|
848
|
+
const s = g(), t = L.search(e);
|
|
849
|
+
return M({
|
|
850
|
+
queryKey: t,
|
|
851
|
+
queryFn: async ({ signal: n }) => {
|
|
852
|
+
const a = m(e);
|
|
853
|
+
return s.query(Je, {
|
|
854
|
+
...a,
|
|
855
|
+
signal: n
|
|
856
|
+
});
|
|
857
|
+
}
|
|
858
|
+
});
|
|
859
|
+
}
|
|
860
|
+
function Tt(e) {
|
|
861
|
+
return O(Xe(e));
|
|
862
|
+
}
|
|
863
|
+
const Ye = "readSalutation post /salutation", Ze = function(s) {
|
|
840
864
|
const t = g(), n = E.list(s);
|
|
841
865
|
return M({
|
|
842
866
|
queryKey: n,
|
|
843
867
|
queryFn: async ({ signal: a }) => {
|
|
844
868
|
const r = m(s);
|
|
845
|
-
return t.query(
|
|
869
|
+
return t.query(Ye, {
|
|
846
870
|
...r,
|
|
847
871
|
signal: a
|
|
848
872
|
});
|
|
849
873
|
}
|
|
850
874
|
});
|
|
851
875
|
};
|
|
852
|
-
function
|
|
853
|
-
return O(
|
|
876
|
+
function Vt(e) {
|
|
877
|
+
return O(Ze(e));
|
|
854
878
|
}
|
|
855
|
-
const
|
|
879
|
+
const _e = "readSeoUrl post /seo-url", et = function(s) {
|
|
856
880
|
const t = g(), n = D.list(s);
|
|
857
881
|
return M({
|
|
858
882
|
queryKey: n,
|
|
859
883
|
queryFn: async ({ signal: a }) => {
|
|
860
884
|
const r = m(s);
|
|
861
|
-
return t.query(
|
|
885
|
+
return t.query(_e, {
|
|
862
886
|
...r,
|
|
863
887
|
signal: a
|
|
864
888
|
});
|
|
865
889
|
}
|
|
866
890
|
});
|
|
867
891
|
};
|
|
868
|
-
function
|
|
869
|
-
return O(
|
|
892
|
+
function $t(e) {
|
|
893
|
+
return O(et(e));
|
|
870
894
|
}
|
|
871
|
-
const
|
|
872
|
-
function
|
|
895
|
+
const tt = "readShippingMethod post /shipping-method";
|
|
896
|
+
function nt(e) {
|
|
873
897
|
const s = g(), t = B.list(c(() => {
|
|
874
898
|
var n;
|
|
875
899
|
return (n = m(e)) == null ? void 0 : n.body;
|
|
876
900
|
}));
|
|
877
901
|
return M({
|
|
878
902
|
queryKey: t,
|
|
879
|
-
queryFn: ({ signal: n }) => s.query(
|
|
903
|
+
queryFn: ({ signal: n }) => s.query(tt, {
|
|
880
904
|
...m(e),
|
|
881
905
|
signal: n
|
|
882
906
|
})
|
|
883
907
|
});
|
|
884
908
|
}
|
|
885
|
-
function
|
|
886
|
-
return O(
|
|
909
|
+
function st(e) {
|
|
910
|
+
return O(nt(e));
|
|
887
911
|
}
|
|
888
|
-
function
|
|
912
|
+
function zt() {
|
|
889
913
|
const e = V(), s = $(), t = Ee({
|
|
890
914
|
query: {
|
|
891
915
|
onlyAvailable: !0
|
|
892
916
|
}
|
|
893
|
-
}), n = c(() => s.isPending.value), a = async (
|
|
894
|
-
paymentMethodId:
|
|
917
|
+
}), n = c(() => s.isPending.value), a = async (o) => s.mutateAsync({
|
|
918
|
+
paymentMethodId: o
|
|
895
919
|
}), r = c(() => {
|
|
896
|
-
var
|
|
897
|
-
return (
|
|
898
|
-
}),
|
|
899
|
-
var
|
|
900
|
-
return ((C = (
|
|
920
|
+
var o, h;
|
|
921
|
+
return (h = (o = e.data) == null ? void 0 : o.value) == null ? void 0 : h.paymentMethod;
|
|
922
|
+
}), u = c(() => {
|
|
923
|
+
var o, h, C;
|
|
924
|
+
return ((C = (h = (o = t.data) == null ? void 0 : o.value) == null ? void 0 : h.elements) == null ? void 0 : C.sort((d, P) => (d.position ?? 0) - (P.position ?? 0))) ?? [];
|
|
901
925
|
});
|
|
902
926
|
return {
|
|
903
927
|
contextUpdateMutation: s,
|
|
@@ -906,22 +930,22 @@ function Tt() {
|
|
|
906
930
|
activePaymentMethod: r,
|
|
907
931
|
setPaymentMethod: a,
|
|
908
932
|
isSaving: n,
|
|
909
|
-
paymentMethods:
|
|
933
|
+
paymentMethods: u
|
|
910
934
|
};
|
|
911
935
|
}
|
|
912
|
-
function
|
|
913
|
-
const e = V(), s = $(), t =
|
|
936
|
+
function Gt() {
|
|
937
|
+
const e = V(), s = $(), t = st({
|
|
914
938
|
query: {
|
|
915
939
|
onlyAvailable: !0
|
|
916
940
|
}
|
|
917
|
-
}), n = c(() => s.isPending.value), a = async (
|
|
918
|
-
shippingMethodId:
|
|
941
|
+
}), n = c(() => s.isPending.value), a = async (o) => s.mutateAsync({
|
|
942
|
+
shippingMethodId: o
|
|
919
943
|
}), r = c(() => {
|
|
920
|
-
var
|
|
921
|
-
return (
|
|
922
|
-
}),
|
|
923
|
-
var
|
|
924
|
-
return ((
|
|
944
|
+
var o, h;
|
|
945
|
+
return (h = (o = e.data) == null ? void 0 : o.value) == null ? void 0 : h.shippingMethod;
|
|
946
|
+
}), u = c(() => {
|
|
947
|
+
var o, h;
|
|
948
|
+
return ((h = (o = t.data) == null ? void 0 : o.value) == null ? void 0 : h.elements.sort((C, d) => (C.position ?? 0) - (d.position ?? 0))) ?? [];
|
|
925
949
|
});
|
|
926
950
|
return {
|
|
927
951
|
contextUpdateMutation: s,
|
|
@@ -930,35 +954,35 @@ function Vt() {
|
|
|
930
954
|
activeShippingMethod: r,
|
|
931
955
|
setShippingMethod: a,
|
|
932
956
|
isSaving: n,
|
|
933
|
-
shippingMethods:
|
|
957
|
+
shippingMethods: u
|
|
934
958
|
};
|
|
935
959
|
}
|
|
936
|
-
const
|
|
960
|
+
const rt = (e, s) => {
|
|
937
961
|
var n;
|
|
938
962
|
const t = (n = e.extensions) == null ? void 0 : n.novuSeoUrls;
|
|
939
963
|
return (t == null ? void 0 : t[s]) ?? "";
|
|
940
|
-
},
|
|
941
|
-
function
|
|
964
|
+
}, Ht = (e, s) => c(() => rt(i(e), i(s)));
|
|
965
|
+
function Wt(e) {
|
|
942
966
|
const { total: s, limit: t, page: n, totalCountMode: a } = e ?? {}, r = Z({
|
|
943
967
|
page: n ?? 1,
|
|
944
968
|
total: s ?? 0,
|
|
945
969
|
limit: t,
|
|
946
970
|
totalCountMode: a
|
|
947
|
-
}),
|
|
971
|
+
}), u = c(() => r.limit === void 0 ? 1 : Math.max(1, Math.ceil(r.total / r.limit))), o = c({
|
|
948
972
|
get() {
|
|
949
973
|
return r.page;
|
|
950
974
|
},
|
|
951
975
|
set(Q) {
|
|
952
|
-
r.page = Math.max(1, Math.min(i(
|
|
976
|
+
r.page = Math.max(1, Math.min(i(u), Q));
|
|
953
977
|
}
|
|
954
978
|
});
|
|
955
979
|
H(
|
|
956
|
-
[() => i(
|
|
980
|
+
[() => i(u), () => r],
|
|
957
981
|
([Q, y]) => {
|
|
958
982
|
r.page = Math.min(Q, r.page), r.total = y.total ?? 0, r.limit = y.limit;
|
|
959
983
|
}
|
|
960
984
|
);
|
|
961
|
-
const
|
|
985
|
+
const h = c(() => r.page === i(u)), C = c(() => r.page === 1), d = c(() => ({
|
|
962
986
|
p: r.page,
|
|
963
987
|
limit: r.limit,
|
|
964
988
|
"total-count-mode": r.totalCountMode ?? "none"
|
|
@@ -968,11 +992,11 @@ function zt(e) {
|
|
|
968
992
|
});
|
|
969
993
|
};
|
|
970
994
|
return {
|
|
971
|
-
page: i(
|
|
995
|
+
page: i(o),
|
|
972
996
|
total: W(r, "total"),
|
|
973
997
|
limit: W(r, "limit"),
|
|
974
|
-
pageCount:
|
|
975
|
-
isLastPage:
|
|
998
|
+
pageCount: u,
|
|
999
|
+
isLastPage: h,
|
|
976
1000
|
isFirstPage: C,
|
|
977
1001
|
usePaginationSync: P,
|
|
978
1002
|
// This can be used to pass the pagination options directly to the query options
|
|
@@ -990,56 +1014,56 @@ function X(e) {
|
|
|
990
1014
|
unitPrice: n
|
|
991
1015
|
}));
|
|
992
1016
|
}
|
|
993
|
-
function
|
|
1017
|
+
function Jt(e) {
|
|
994
1018
|
const s = c(() => {
|
|
995
1019
|
var y;
|
|
996
1020
|
return (y = e.value) == null ? void 0 : y.calculatedCheapestPrice;
|
|
997
1021
|
}), t = c(
|
|
998
1022
|
() => {
|
|
999
|
-
var y,
|
|
1000
|
-
return (((
|
|
1023
|
+
var y, v, A, K, l;
|
|
1024
|
+
return (((v = (y = e.value) == null ? void 0 : y.calculatedPrices) == null ? void 0 : v.length) ?? 0) > 0 ? (K = (A = e.value) == null ? void 0 : A.calculatedPrices) == null ? void 0 : K[0] : (l = e.value) == null ? void 0 : l.calculatedPrice;
|
|
1001
1025
|
}
|
|
1002
1026
|
), n = c(() => {
|
|
1003
1027
|
var y;
|
|
1004
1028
|
return (y = t == null ? void 0 : t.value) == null ? void 0 : y.referencePrice;
|
|
1005
1029
|
}), a = c(() => {
|
|
1006
|
-
var y,
|
|
1007
|
-
return (((
|
|
1030
|
+
var y, v;
|
|
1031
|
+
return (((v = (y = e.value) == null ? void 0 : y.calculatedPrices) == null ? void 0 : v.length) ?? 0) > 1;
|
|
1008
1032
|
}), r = c(
|
|
1009
1033
|
() => {
|
|
1010
|
-
var y,
|
|
1011
|
-
return !!((y = e.value) != null && y.parentId) && ((A = (
|
|
1034
|
+
var y, v, A, K, l, p;
|
|
1035
|
+
return !!((y = e.value) != null && y.parentId) && ((A = (v = e.value) == null ? void 0 : v.calculatedCheapestPrice) == null ? void 0 : A.hasRange) && ((K = t == null ? void 0 : t.value) == null ? void 0 : K.unitPrice) !== ((l = s == null ? void 0 : s.value) == null ? void 0 : l.unitPrice) && ((p = s == null ? void 0 : s.value) == null ? void 0 : p.unitPrice);
|
|
1012
1036
|
}
|
|
1013
|
-
),
|
|
1037
|
+
), u = c(
|
|
1014
1038
|
() => {
|
|
1015
|
-
var y,
|
|
1016
|
-
return a.value && X(e.value).length > 1 ? (
|
|
1039
|
+
var y, v;
|
|
1040
|
+
return a.value && X(e.value).length > 1 ? (v = (y = e.value) == null ? void 0 : y.calculatedPrices) == null ? void 0 : v.reduce((A, K) => K.unitPrice < A.unitPrice ? K : A) : t.value;
|
|
1017
1041
|
}
|
|
1018
|
-
),
|
|
1042
|
+
), o = c(
|
|
1019
1043
|
() => {
|
|
1020
1044
|
var y;
|
|
1021
|
-
return (y =
|
|
1045
|
+
return (y = u.value) == null ? void 0 : y.unitPrice;
|
|
1022
1046
|
}
|
|
1023
|
-
),
|
|
1047
|
+
), h = c(
|
|
1024
1048
|
() => {
|
|
1025
1049
|
var y;
|
|
1026
|
-
return (y =
|
|
1050
|
+
return (y = u.value) == null ? void 0 : y.totalPrice;
|
|
1027
1051
|
}
|
|
1028
1052
|
), C = c(
|
|
1029
|
-
() =>
|
|
1053
|
+
() => u.value
|
|
1030
1054
|
), d = c(() => {
|
|
1031
|
-
var y,
|
|
1032
|
-
return !!((
|
|
1055
|
+
var y, v;
|
|
1056
|
+
return !!((v = (y = u.value) == null ? void 0 : y.listPrice) != null && v.percentage);
|
|
1033
1057
|
}), P = c(
|
|
1034
1058
|
() => {
|
|
1035
|
-
var y,
|
|
1036
|
-
return (A = (
|
|
1059
|
+
var y, v, A;
|
|
1060
|
+
return (A = (v = (y = e.value) == null ? void 0 : y.calculatedPrice) == null ? void 0 : v.regulationPrice) == null ? void 0 : A.price;
|
|
1037
1061
|
}
|
|
1038
1062
|
), Q = c(() => X(e.value));
|
|
1039
1063
|
return {
|
|
1040
1064
|
price: C,
|
|
1041
|
-
totalPrice:
|
|
1042
|
-
unitPrice:
|
|
1065
|
+
totalPrice: h,
|
|
1066
|
+
unitPrice: o,
|
|
1043
1067
|
displayFromVariants: r,
|
|
1044
1068
|
displayFrom: a,
|
|
1045
1069
|
tierPrices: Q,
|
|
@@ -1048,7 +1072,7 @@ function Gt(e) {
|
|
|
1048
1072
|
regulationPrice: P
|
|
1049
1073
|
};
|
|
1050
1074
|
}
|
|
1051
|
-
function
|
|
1075
|
+
function at(e, s) {
|
|
1052
1076
|
var n;
|
|
1053
1077
|
const t = (n = e.extensions) == null ? void 0 : n.variants;
|
|
1054
1078
|
return s.length === 0 ? (t == null ? void 0 : t.find((a) => {
|
|
@@ -1056,19 +1080,19 @@ function st(e, s) {
|
|
|
1056
1080
|
return ((r = a.optionIds) == null ? void 0 : r.length) === 0;
|
|
1057
1081
|
})) ?? (t == null ? void 0 : t[0]) : t == null ? void 0 : t.find((a) => {
|
|
1058
1082
|
var r;
|
|
1059
|
-
return (r = a.optionIds) == null ? void 0 : r.every((
|
|
1083
|
+
return (r = a.optionIds) == null ? void 0 : r.every((u) => s.includes(u));
|
|
1060
1084
|
});
|
|
1061
1085
|
}
|
|
1062
|
-
function
|
|
1063
|
-
return c(() =>
|
|
1086
|
+
function Xt(e, s) {
|
|
1087
|
+
return c(() => at(i(e), i(s)));
|
|
1064
1088
|
}
|
|
1065
|
-
function
|
|
1089
|
+
function Yt(e) {
|
|
1066
1090
|
return c(() => {
|
|
1067
|
-
var s, t, n, a, r,
|
|
1068
|
-
return !!((t = (s = i(e)) == null ? void 0 : s.customer) != null && t.id) && !!((a = (n = i(e)) == null ? void 0 : n.customer) != null && a.active) && !((
|
|
1091
|
+
var s, t, n, a, r, u;
|
|
1092
|
+
return !!((t = (s = i(e)) == null ? void 0 : s.customer) != null && t.id) && !!((a = (n = i(e)) == null ? void 0 : n.customer) != null && a.active) && !((u = (r = i(e)) == null ? void 0 : r.customer) != null && u.guest);
|
|
1069
1093
|
});
|
|
1070
1094
|
}
|
|
1071
|
-
function
|
|
1095
|
+
function Zt(e) {
|
|
1072
1096
|
const s = Ke(e ? { body: e } : void 0), t = c(() => {
|
|
1073
1097
|
var d;
|
|
1074
1098
|
return (d = s.data) == null ? void 0 : d.value;
|
|
@@ -1085,17 +1109,17 @@ function Jt(e) {
|
|
|
1085
1109
|
), r = c(() => {
|
|
1086
1110
|
var d;
|
|
1087
1111
|
return !!((d = t.value) != null && d.guest);
|
|
1088
|
-
}),
|
|
1112
|
+
}), u = c(
|
|
1089
1113
|
() => {
|
|
1090
1114
|
var d;
|
|
1091
1115
|
return ((d = t.value) == null ? void 0 : d.defaultBillingAddressId) || null;
|
|
1092
1116
|
}
|
|
1093
|
-
),
|
|
1117
|
+
), o = c(
|
|
1094
1118
|
() => {
|
|
1095
1119
|
var d;
|
|
1096
1120
|
return ((d = t.value) == null ? void 0 : d.defaultShippingAddressId) || null;
|
|
1097
1121
|
}
|
|
1098
|
-
),
|
|
1122
|
+
), h = c(
|
|
1099
1123
|
() => {
|
|
1100
1124
|
var d;
|
|
1101
1125
|
return ((d = t.value) == null ? void 0 : d.defaultBillingAddress) || null;
|
|
@@ -1112,98 +1136,100 @@ function Jt(e) {
|
|
|
1112
1136
|
isLoggedIn: n,
|
|
1113
1137
|
isCustomerSession: a,
|
|
1114
1138
|
isGuestSession: r,
|
|
1115
|
-
defaultBillingAddressId:
|
|
1116
|
-
defaultShippingAddressId:
|
|
1117
|
-
userDefaultBillingAddress:
|
|
1139
|
+
defaultBillingAddressId: u,
|
|
1140
|
+
defaultShippingAddressId: o,
|
|
1141
|
+
userDefaultBillingAddress: h,
|
|
1118
1142
|
userDefaultShippingAddress: C,
|
|
1119
1143
|
// Expose queries and mutations directly
|
|
1120
1144
|
customerQuery: s
|
|
1121
1145
|
};
|
|
1122
1146
|
}
|
|
1123
1147
|
export {
|
|
1124
|
-
|
|
1148
|
+
lt as absolutizeSeoUrl,
|
|
1125
1149
|
w as addressKeys,
|
|
1126
|
-
|
|
1150
|
+
x as cartKeys,
|
|
1127
1151
|
k as categoryKeys,
|
|
1128
|
-
|
|
1152
|
+
F as contextKeys,
|
|
1129
1153
|
j as countryKeys,
|
|
1130
|
-
|
|
1131
|
-
|
|
1132
|
-
|
|
1154
|
+
R as customerKeys,
|
|
1155
|
+
at as getProductVariantForOptions,
|
|
1156
|
+
rt as getSeoUrl,
|
|
1133
1157
|
se as isAsynchronousOrder,
|
|
1134
1158
|
b as navigationKeys,
|
|
1135
1159
|
U as orderKeys,
|
|
1136
1160
|
N as paymentKeys,
|
|
1137
|
-
|
|
1161
|
+
L as productKeys,
|
|
1138
1162
|
Ne as readPaymentMethodOperation,
|
|
1139
|
-
|
|
1163
|
+
tt as readShippingMethodOperation,
|
|
1140
1164
|
T as relativizeSeoUrl,
|
|
1141
1165
|
E as salutationKeys,
|
|
1142
1166
|
D as seoUrlKeys,
|
|
1143
1167
|
B as shippingKeys,
|
|
1144
1168
|
_ as shopwareClientKey,
|
|
1145
1169
|
m as unrefOptions,
|
|
1146
|
-
|
|
1147
|
-
|
|
1148
|
-
|
|
1149
|
-
|
|
1150
|
-
|
|
1151
|
-
|
|
1152
|
-
|
|
1153
|
-
|
|
1154
|
-
|
|
1155
|
-
|
|
1156
|
-
|
|
1157
|
-
|
|
1158
|
-
|
|
1170
|
+
vt as useAddLineItemMutation,
|
|
1171
|
+
Mt as useChangeEmailMutation,
|
|
1172
|
+
Ut as useChangePasswordMutation,
|
|
1173
|
+
Ot as useChangeProfileMutation,
|
|
1174
|
+
yt as useCheckoutAddresses,
|
|
1175
|
+
gt as useCreateCustomerAddressMutation,
|
|
1176
|
+
Pt as useCreateOrderMutation,
|
|
1177
|
+
Ft as useDefaultBillingAddressMutation,
|
|
1178
|
+
Rt as useDefaultShippingAddressMutation,
|
|
1179
|
+
ht as useDeleteCustomerAddressMutation,
|
|
1180
|
+
It as useDeleteCustomerMutation,
|
|
1181
|
+
Bt as useHandlePaymentMutation,
|
|
1182
|
+
Yt as useIsLoggedIn,
|
|
1159
1183
|
ne as useListAddressQuery,
|
|
1160
1184
|
te as useListAddressQueryOptions,
|
|
1161
|
-
|
|
1162
|
-
|
|
1163
|
-
|
|
1164
|
-
|
|
1165
|
-
|
|
1166
|
-
|
|
1167
|
-
|
|
1168
|
-
|
|
1169
|
-
|
|
1170
|
-
|
|
1171
|
-
|
|
1185
|
+
At as useLoginCustomerMutation,
|
|
1186
|
+
Kt as useLogoutCustomerMutation,
|
|
1187
|
+
dt as useOptimistic,
|
|
1188
|
+
pt as useOrderDetails,
|
|
1189
|
+
mt as useOrderPayment,
|
|
1190
|
+
Nt as useOrderSetPaymentMutation,
|
|
1191
|
+
Wt as usePagination,
|
|
1192
|
+
zt as usePaymentMethods,
|
|
1193
|
+
Jt as useProductPrice,
|
|
1194
|
+
Xt as useProductVariantForOptions,
|
|
1195
|
+
qt as useReadCartQuery,
|
|
1172
1196
|
ge as useReadCartQueryOptions,
|
|
1173
|
-
|
|
1197
|
+
Dt as useReadCategoryListQuery,
|
|
1174
1198
|
$e as useReadCategoryListQueryOptions,
|
|
1175
|
-
|
|
1199
|
+
Et as useReadCompactProductListingQuery,
|
|
1176
1200
|
Ge as useReadCompactProductListingQueryOptions,
|
|
1177
1201
|
V as useReadContextQuery,
|
|
1178
1202
|
ae as useReadContextQueryOptions,
|
|
1179
|
-
|
|
1203
|
+
Qt as useReadCountryQuery,
|
|
1180
1204
|
Ce as useReadCountryQueryOptions,
|
|
1181
1205
|
We as useReadCustomProductDetailOptions,
|
|
1182
|
-
|
|
1206
|
+
jt as useReadCustomProductDetailQuery,
|
|
1183
1207
|
Ke as useReadCustomerQuery,
|
|
1184
1208
|
Ae as useReadCustomerQueryOptions,
|
|
1185
|
-
|
|
1209
|
+
kt as useReadNavigationQuery,
|
|
1186
1210
|
Be as useReadNavigationQueryOptions,
|
|
1187
1211
|
ce as useReadOrderQuery,
|
|
1188
1212
|
ie as useReadOrderQueryOptions,
|
|
1189
1213
|
Ee as useReadPaymentMethodQuery,
|
|
1190
1214
|
De as useReadPaymentMethodQueryOptions,
|
|
1191
|
-
|
|
1192
|
-
|
|
1193
|
-
|
|
1194
|
-
|
|
1195
|
-
|
|
1196
|
-
|
|
1197
|
-
|
|
1198
|
-
|
|
1199
|
-
|
|
1200
|
-
|
|
1201
|
-
|
|
1202
|
-
|
|
1203
|
-
|
|
1215
|
+
Vt as useReadSalutationQuery,
|
|
1216
|
+
Ze as useReadSalutationQueryOptions,
|
|
1217
|
+
$t as useReadSeoUrlQuery,
|
|
1218
|
+
et as useReadSeoUrlQueryOptions,
|
|
1219
|
+
st as useReadShippingMethodQuery,
|
|
1220
|
+
nt as useReadShippingMethodQueryOptions,
|
|
1221
|
+
bt as useRecoveryPasswordMutation,
|
|
1222
|
+
Lt as useRegisterConfirmMutation,
|
|
1223
|
+
wt as useRegisterCustomerMutation,
|
|
1224
|
+
Ct as useRemoveLineItemMutation,
|
|
1225
|
+
Tt as useSearchPageQuery,
|
|
1226
|
+
Xe as useSearchPageQueryOptions,
|
|
1227
|
+
xt as useSendRecoveryMailMutation,
|
|
1228
|
+
Ht as useSeoUrl,
|
|
1229
|
+
Gt as useShippingMethods,
|
|
1204
1230
|
g as useShopwareQueryClient,
|
|
1205
1231
|
$ as useUpdateContextMutation,
|
|
1206
|
-
|
|
1207
|
-
|
|
1208
|
-
|
|
1232
|
+
ft as useUpdateCustomerAddressMutation,
|
|
1233
|
+
St as useUpdateLineItemMutation,
|
|
1234
|
+
Zt as useUser
|
|
1209
1235
|
};
|