@teamnovu/kit-shopware-composables 0.0.32 → 0.0.34
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
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { inject as Y, unref as o, 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
|
|
3
|
+
import { queryOptions as h, useQuery as q, useQueryClient as C, 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 R = {
|
|
13
13
|
all: () => ["context"]
|
|
14
14
|
}, ee = {
|
|
15
15
|
all: () => ["language"]
|
|
@@ -23,19 +23,19 @@ const A = {
|
|
|
23
23
|
body: e
|
|
24
24
|
}
|
|
25
25
|
]
|
|
26
|
-
},
|
|
26
|
+
}, k = {
|
|
27
27
|
all: () => ["navigation"],
|
|
28
|
-
lists: () => [...
|
|
28
|
+
lists: () => [...k.all(), "list"],
|
|
29
29
|
list: (e) => [
|
|
30
|
-
...
|
|
30
|
+
...k.all(),
|
|
31
31
|
"list",
|
|
32
32
|
{
|
|
33
33
|
body: e
|
|
34
34
|
}
|
|
35
35
|
],
|
|
36
|
-
details: () => [...
|
|
36
|
+
details: () => [...k.all(), "detail"],
|
|
37
37
|
detail: (e, s, t) => [
|
|
38
|
-
...
|
|
38
|
+
...k.all(),
|
|
39
39
|
"detail",
|
|
40
40
|
{
|
|
41
41
|
activeId: e,
|
|
@@ -96,33 +96,33 @@ const A = {
|
|
|
96
96
|
all: () => ["customer"],
|
|
97
97
|
detail: (e) => ["customer", { body: e }],
|
|
98
98
|
imitateLogin: (e) => ["customer", "imitateLogin", { body: e }]
|
|
99
|
-
},
|
|
99
|
+
}, A = {
|
|
100
100
|
all: () => ["address"],
|
|
101
|
-
lists: () => [...
|
|
101
|
+
lists: () => [...A.all(), "list"],
|
|
102
102
|
list: (e) => [
|
|
103
|
-
...
|
|
103
|
+
...A.all(),
|
|
104
104
|
"list",
|
|
105
105
|
{
|
|
106
106
|
body: e
|
|
107
107
|
}
|
|
108
108
|
],
|
|
109
|
-
details: () => [...
|
|
110
|
-
detail: (e, s) => [...
|
|
111
|
-
},
|
|
109
|
+
details: () => [...A.all(), "detail"],
|
|
110
|
+
detail: (e, s) => [...A.details(), e, ...s ? [{ body: s }] : []]
|
|
111
|
+
}, D = {
|
|
112
112
|
all: () => ["shippingMethod"],
|
|
113
|
-
lists: () => [...
|
|
113
|
+
lists: () => [...D.all(), "list"],
|
|
114
114
|
list: (e) => [
|
|
115
|
-
...
|
|
115
|
+
...D.all(),
|
|
116
116
|
"list",
|
|
117
117
|
{
|
|
118
118
|
body: e
|
|
119
119
|
}
|
|
120
120
|
]
|
|
121
|
-
},
|
|
121
|
+
}, b = {
|
|
122
122
|
all: () => ["paymentMethod"],
|
|
123
|
-
lists: () => [...
|
|
123
|
+
lists: () => [...b.all(), "list"],
|
|
124
124
|
list: (e) => [
|
|
125
|
-
...
|
|
125
|
+
...b.lists(),
|
|
126
126
|
{
|
|
127
127
|
body: e
|
|
128
128
|
}
|
|
@@ -179,11 +179,11 @@ function y(e) {
|
|
|
179
179
|
}
|
|
180
180
|
const te = "listAddress post /account/list-address";
|
|
181
181
|
function ne(e) {
|
|
182
|
-
const s = g(), t =
|
|
182
|
+
const s = g(), t = A.list(c(() => {
|
|
183
183
|
var n;
|
|
184
184
|
return (n = y(e)) == null ? void 0 : n.body;
|
|
185
185
|
}));
|
|
186
|
-
return
|
|
186
|
+
return h({
|
|
187
187
|
queryKey: t,
|
|
188
188
|
queryFn: ({ signal: n }) => s.query(te, {
|
|
189
189
|
...y(e),
|
|
@@ -197,9 +197,9 @@ function se(e) {
|
|
|
197
197
|
const V = (e) => {
|
|
198
198
|
const s = e.replace(/\/?$/, "");
|
|
199
199
|
return s.startsWith("/") ? s.slice(1) : s;
|
|
200
|
-
},
|
|
201
|
-
function
|
|
202
|
-
const n =
|
|
200
|
+
}, Qt = (e) => `/${V(e)}`;
|
|
201
|
+
function St(e, s, t) {
|
|
202
|
+
const n = C();
|
|
203
203
|
return {
|
|
204
204
|
onMutate: async (r) => {
|
|
205
205
|
await n.cancelQueries({ queryKey: e });
|
|
@@ -212,8 +212,8 @@ function Ct(e, s, t) {
|
|
|
212
212
|
},
|
|
213
213
|
onError: (r, a, u) => {
|
|
214
214
|
if (u && n.setQueryData(e, u.previousValue), t) {
|
|
215
|
-
const i = o(t),
|
|
216
|
-
|
|
215
|
+
const i = o(t), v = o(i.onError);
|
|
216
|
+
v == null || v(r, a, u);
|
|
217
217
|
}
|
|
218
218
|
},
|
|
219
219
|
onSettled: (...r) => {
|
|
@@ -227,8 +227,8 @@ function Ct(e, s, t) {
|
|
|
227
227
|
const re = "readContext get /context";
|
|
228
228
|
function ae(e) {
|
|
229
229
|
const s = g();
|
|
230
|
-
return
|
|
231
|
-
queryKey:
|
|
230
|
+
return h({
|
|
231
|
+
queryKey: R.all(),
|
|
232
232
|
queryFn: ({ signal: t }) => s.query(re, {
|
|
233
233
|
...y(e),
|
|
234
234
|
signal: t
|
|
@@ -240,22 +240,24 @@ function B(e) {
|
|
|
240
240
|
}
|
|
241
241
|
const ue = "updateContext patch /context";
|
|
242
242
|
function $(e) {
|
|
243
|
-
const s = g(), t =
|
|
244
|
-
return
|
|
243
|
+
const s = g(), t = C();
|
|
244
|
+
return f({
|
|
245
245
|
...e,
|
|
246
|
-
mutationFn: async (n) => (t.cancelQueries({ queryKey:
|
|
246
|
+
mutationFn: async (n) => (t.cancelQueries({ queryKey: R.all() }), s.query(ue, {
|
|
247
247
|
body: n
|
|
248
248
|
})),
|
|
249
249
|
onSuccess: async (n, r, a) => {
|
|
250
250
|
var u, i;
|
|
251
251
|
await Promise.all([
|
|
252
|
-
t.invalidateQueries({ queryKey:
|
|
253
|
-
t.invalidateQueries({ queryKey: L.get() })
|
|
252
|
+
t.invalidateQueries({ queryKey: R.all() }),
|
|
253
|
+
t.invalidateQueries({ queryKey: L.get() }),
|
|
254
|
+
t.invalidateQueries({ queryKey: b.lists() }),
|
|
255
|
+
t.invalidateQueries({ queryKey: D.lists() })
|
|
254
256
|
]), await ((i = o((u = o(e)) == null ? void 0 : u.onSuccess)) == null ? void 0 : i(n, r, a));
|
|
255
257
|
}
|
|
256
258
|
});
|
|
257
259
|
}
|
|
258
|
-
function
|
|
260
|
+
function Ct() {
|
|
259
261
|
const e = $(), s = B(), t = se(), n = c(() => s.isFetching.value || e.isPending.value), r = async (d) => {
|
|
260
262
|
await e.mutateAsync({
|
|
261
263
|
billingAddressId: d.id
|
|
@@ -265,25 +267,25 @@ function Qt() {
|
|
|
265
267
|
shippingAddressId: d.id
|
|
266
268
|
}), await J(n).toBe(!1);
|
|
267
269
|
}, u = c(() => {
|
|
268
|
-
var d,
|
|
269
|
-
return (
|
|
270
|
+
var d, K;
|
|
271
|
+
return (K = (d = s.data.value) == null ? void 0 : d.customer) == null ? void 0 : K.activeBillingAddress;
|
|
270
272
|
}), i = c(() => {
|
|
271
|
-
var d,
|
|
272
|
-
return (
|
|
273
|
-
}),
|
|
273
|
+
var d, K;
|
|
274
|
+
return (K = (d = s.data.value) == null ? void 0 : d.customer) == null ? void 0 : K.activeShippingAddress;
|
|
275
|
+
}), v = c(() => {
|
|
274
276
|
var d;
|
|
275
277
|
return ((d = t.data.value) == null ? void 0 : d.elements.filter(
|
|
276
|
-
(
|
|
277
|
-
var
|
|
278
|
-
return
|
|
278
|
+
(K) => {
|
|
279
|
+
var M;
|
|
280
|
+
return K.id !== ((M = u.value) == null ? void 0 : M.id);
|
|
279
281
|
}
|
|
280
282
|
)) ?? [];
|
|
281
283
|
}), P = c(() => {
|
|
282
284
|
var d;
|
|
283
285
|
return ((d = t.data.value) == null ? void 0 : d.elements.filter(
|
|
284
|
-
(
|
|
285
|
-
var
|
|
286
|
-
return
|
|
286
|
+
(K) => {
|
|
287
|
+
var M;
|
|
288
|
+
return K.id !== ((M = i.value) == null ? void 0 : M.id);
|
|
287
289
|
}
|
|
288
290
|
)) ?? [];
|
|
289
291
|
});
|
|
@@ -296,14 +298,14 @@ function Qt() {
|
|
|
296
298
|
isSaving: n,
|
|
297
299
|
activeBillingAddress: u,
|
|
298
300
|
activeShippingAddress: i,
|
|
299
|
-
inactiveBillingAddresses:
|
|
301
|
+
inactiveBillingAddresses: v,
|
|
300
302
|
inactiveShippingAddresses: P
|
|
301
303
|
};
|
|
302
304
|
}
|
|
303
305
|
const ie = "readOrder post /order";
|
|
304
306
|
function oe(e) {
|
|
305
307
|
const s = g(), t = U.detail(e);
|
|
306
|
-
return
|
|
308
|
+
return h({
|
|
307
309
|
queryKey: t,
|
|
308
310
|
queryFn: async ({ signal: n }) => {
|
|
309
311
|
const r = y(e);
|
|
@@ -335,18 +337,18 @@ function Pt(e, s) {
|
|
|
335
337
|
}
|
|
336
338
|
};
|
|
337
339
|
}), n = ce(t.value), r = c(() => {
|
|
338
|
-
var l, m,
|
|
339
|
-
return (x = (
|
|
340
|
+
var l, m, S, x;
|
|
341
|
+
return (x = (S = (m = (l = n.data) == null ? void 0 : l.value) == null ? void 0 : m.orders) == null ? void 0 : S.elements) == null ? void 0 : x[0];
|
|
340
342
|
}), a = c(() => {
|
|
341
343
|
var l, m;
|
|
342
344
|
return ((m = (l = n.data) == null ? void 0 : l.value) == null ? void 0 : m.paymentChangeable) || {};
|
|
343
345
|
}), u = c(() => {
|
|
344
|
-
var l, m,
|
|
345
|
-
return (
|
|
346
|
+
var l, m, S;
|
|
347
|
+
return (S = (m = (l = r.value) == null ? void 0 : l.stateMachineState) == null ? void 0 : m.translated) == null ? void 0 : S.name;
|
|
346
348
|
}), i = c(() => {
|
|
347
349
|
var l, m;
|
|
348
350
|
return (m = (l = r.value) == null ? void 0 : l.stateMachineState) == null ? void 0 : m.technicalName;
|
|
349
|
-
}),
|
|
351
|
+
}), v = c(() => {
|
|
350
352
|
var l, m;
|
|
351
353
|
return (m = (l = r.value) == null ? void 0 : l.price) == null ? void 0 : m.totalPrice;
|
|
352
354
|
}), P = c(() => {
|
|
@@ -355,37 +357,37 @@ function Pt(e, s) {
|
|
|
355
357
|
}), d = c(() => {
|
|
356
358
|
var l;
|
|
357
359
|
return (l = r.value) == null ? void 0 : l.shippingTotal;
|
|
358
|
-
}),
|
|
359
|
-
var l, m,
|
|
360
|
+
}), K = c(() => {
|
|
361
|
+
var l, m, S, x, z, G;
|
|
360
362
|
return {
|
|
361
363
|
email: (m = (l = r.value) == null ? void 0 : l.orderCustomer) == null ? void 0 : m.email,
|
|
362
|
-
firstName: (x = (
|
|
364
|
+
firstName: (x = (S = r.value) == null ? void 0 : S.orderCustomer) == null ? void 0 : x.firstName,
|
|
363
365
|
lastName: (G = (z = r.value) == null ? void 0 : z.orderCustomer) == null ? void 0 : G.lastName
|
|
364
366
|
};
|
|
365
|
-
}),
|
|
367
|
+
}), M = c(() => {
|
|
366
368
|
var l, m;
|
|
367
369
|
return (m = (l = r.value) == null ? void 0 : l.addresses) == null ? void 0 : m.find(
|
|
368
|
-
({ id:
|
|
370
|
+
({ id: S }) => {
|
|
369
371
|
var x;
|
|
370
|
-
return
|
|
372
|
+
return S === ((x = r.value) == null ? void 0 : x.billingAddressId);
|
|
371
373
|
}
|
|
372
374
|
);
|
|
373
375
|
}), p = c(
|
|
374
376
|
() => {
|
|
375
|
-
var l, m,
|
|
376
|
-
return (
|
|
377
|
+
var l, m, S;
|
|
378
|
+
return (S = (m = (l = r.value) == null ? void 0 : l.deliveries) == null ? void 0 : m[0]) == null ? void 0 : S.shippingOrderAddress;
|
|
377
379
|
}
|
|
378
|
-
),
|
|
379
|
-
var m,
|
|
380
|
+
), Q = c(() => {
|
|
381
|
+
var m, S;
|
|
380
382
|
const l = (m = r.value) == null ? void 0 : m.transactions;
|
|
381
383
|
if (l != null && l.length)
|
|
382
|
-
return (
|
|
384
|
+
return (S = l.at(-1)) == null ? void 0 : S.paymentMethod;
|
|
383
385
|
}), w = c(() => {
|
|
384
|
-
var m,
|
|
386
|
+
var m, S;
|
|
385
387
|
const l = (m = r.value) == null ? void 0 : m.deliveries;
|
|
386
388
|
if (l != null && l.length)
|
|
387
|
-
return (
|
|
388
|
-
}),
|
|
389
|
+
return (S = l.at(-1)) == null ? void 0 : S.shippingMethod;
|
|
390
|
+
}), F = c(() => {
|
|
389
391
|
var m;
|
|
390
392
|
const l = o(e);
|
|
391
393
|
return ((m = a.value) == null ? void 0 : m[l]) ?? !1;
|
|
@@ -394,19 +396,19 @@ function Pt(e, s) {
|
|
|
394
396
|
order: r,
|
|
395
397
|
status: u,
|
|
396
398
|
statusTechnicalName: i,
|
|
397
|
-
total:
|
|
399
|
+
total: v,
|
|
398
400
|
subtotal: P,
|
|
399
401
|
shippingCosts: d,
|
|
400
402
|
shippingAddress: p,
|
|
401
|
-
billingAddress:
|
|
402
|
-
personalDetails:
|
|
403
|
+
billingAddress: M,
|
|
404
|
+
personalDetails: K,
|
|
403
405
|
shippingMethod: w,
|
|
404
|
-
paymentMethod:
|
|
405
|
-
paymentChangeable:
|
|
406
|
+
paymentMethod: Q,
|
|
407
|
+
paymentChangeable: F,
|
|
406
408
|
orderQuery: n
|
|
407
409
|
};
|
|
408
410
|
}
|
|
409
|
-
function
|
|
411
|
+
function Kt(e) {
|
|
410
412
|
const s = c(() => {
|
|
411
413
|
var r, a;
|
|
412
414
|
return (a = (r = o(e)) == null ? void 0 : r.transactions) == null ? void 0 : a.find((u) => {
|
|
@@ -427,52 +429,52 @@ function Mt(e) {
|
|
|
427
429
|
};
|
|
428
430
|
}
|
|
429
431
|
const le = "createCustomerAddress post /account/address";
|
|
430
|
-
function
|
|
431
|
-
const s = g(), t =
|
|
432
|
-
return
|
|
432
|
+
function Mt(e) {
|
|
433
|
+
const s = g(), t = C();
|
|
434
|
+
return f({
|
|
433
435
|
...e,
|
|
434
436
|
mutationFn: async (n) => s.query(le, y(n)),
|
|
435
437
|
onSuccess: async (n, r, a) => {
|
|
436
438
|
var u, i;
|
|
437
|
-
await t.invalidateQueries({ queryKey:
|
|
439
|
+
await t.invalidateQueries({ queryKey: A.lists() }), await ((i = o((u = o(e)) == null ? void 0 : u.onSuccess)) == null ? void 0 : i(n, r, a));
|
|
438
440
|
}
|
|
439
441
|
});
|
|
440
442
|
}
|
|
441
443
|
const de = "deleteCustomerAddress delete /account/address/{addressId}";
|
|
442
444
|
function Ot(e) {
|
|
443
|
-
const s = g(), t =
|
|
444
|
-
return
|
|
445
|
+
const s = g(), t = C();
|
|
446
|
+
return f({
|
|
445
447
|
...e,
|
|
446
448
|
mutationFn: async (n) => s.query(de, y(n)),
|
|
447
449
|
onSuccess: async (n, r, a) => {
|
|
448
450
|
var u, i;
|
|
449
|
-
await t.invalidateQueries({ queryKey:
|
|
451
|
+
await t.invalidateQueries({ queryKey: A.lists() }), await ((i = o((u = o(e)) == null ? void 0 : u.onSuccess)) == null ? void 0 : i(n, r, a));
|
|
450
452
|
}
|
|
451
453
|
});
|
|
452
454
|
}
|
|
453
455
|
const ye = "updateCustomerAddress patch /account/address/{addressId}";
|
|
454
456
|
function wt(e) {
|
|
455
|
-
const s = g(), t =
|
|
456
|
-
return
|
|
457
|
+
const s = g(), t = C();
|
|
458
|
+
return f({
|
|
457
459
|
...e,
|
|
458
460
|
mutationFn: async (n) => s.query(ye, y(n)),
|
|
459
461
|
onSuccess: async (n, r, a) => {
|
|
460
|
-
var i,
|
|
462
|
+
var i, v;
|
|
461
463
|
const { addressId: u } = y(r).params;
|
|
462
|
-
t.setQueryData(
|
|
463
|
-
t.invalidateQueries({ queryKey:
|
|
464
|
+
t.setQueryData(A.detail(u), n), await Promise.all([
|
|
465
|
+
t.invalidateQueries({ queryKey: A.lists() }),
|
|
464
466
|
t.invalidateQueries({
|
|
465
|
-
queryKey:
|
|
467
|
+
queryKey: A.detail(y(r).params.addressId),
|
|
466
468
|
predicate: (P) => P.queryKey.at(-1) !== u
|
|
467
469
|
})
|
|
468
|
-
]), await ((
|
|
470
|
+
]), await ((v = o((i = o(e)) == null ? void 0 : i.onSuccess)) == null ? void 0 : v(n, r, a));
|
|
469
471
|
}
|
|
470
472
|
});
|
|
471
473
|
}
|
|
472
474
|
const pe = "addLineItem post /checkout/cart/line-item";
|
|
473
475
|
function At(e) {
|
|
474
|
-
const s = g(), t =
|
|
475
|
-
return
|
|
476
|
+
const s = g(), t = C();
|
|
477
|
+
return f({
|
|
476
478
|
...e,
|
|
477
479
|
mutationFn: async (n) => s.query(pe, {
|
|
478
480
|
body: n
|
|
@@ -480,8 +482,8 @@ function At(e) {
|
|
|
480
482
|
onSuccess: async (n, r, a) => {
|
|
481
483
|
var u, i;
|
|
482
484
|
t.setQueryData(L.get(), n), await Promise.all([
|
|
483
|
-
t.invalidateQueries({ queryKey:
|
|
484
|
-
t.invalidateQueries({ queryKey:
|
|
485
|
+
t.invalidateQueries({ queryKey: b.lists() }),
|
|
486
|
+
t.invalidateQueries({ queryKey: D.lists() })
|
|
485
487
|
]), await ((i = o((u = o(e)) == null ? void 0 : u.onSuccess)) == null ? void 0 : i(
|
|
486
488
|
n,
|
|
487
489
|
r,
|
|
@@ -493,7 +495,7 @@ function At(e) {
|
|
|
493
495
|
const ge = "readCart get /checkout/cart";
|
|
494
496
|
function me(e) {
|
|
495
497
|
const s = g(), t = L.get();
|
|
496
|
-
return
|
|
498
|
+
return h({
|
|
497
499
|
queryKey: t,
|
|
498
500
|
queryFn: async ({ signal: n }) => s.query(ge, {
|
|
499
501
|
...y(e),
|
|
@@ -504,19 +506,19 @@ function me(e) {
|
|
|
504
506
|
function Rt() {
|
|
505
507
|
return q(me());
|
|
506
508
|
}
|
|
507
|
-
const
|
|
509
|
+
const ve = "removeLineItem post /checkout/cart/line-item/delete";
|
|
508
510
|
function Ft(e) {
|
|
509
|
-
const s = g(), t =
|
|
510
|
-
return
|
|
511
|
+
const s = g(), t = C();
|
|
512
|
+
return f({
|
|
511
513
|
...e,
|
|
512
|
-
mutationFn: async (n) => s.query(
|
|
514
|
+
mutationFn: async (n) => s.query(ve, {
|
|
513
515
|
body: n
|
|
514
516
|
}),
|
|
515
517
|
onSuccess: async (n, r, a) => {
|
|
516
518
|
var u, i;
|
|
517
519
|
t.setQueryData(L.get(), n), await Promise.all([
|
|
518
|
-
t.invalidateQueries({ queryKey:
|
|
519
|
-
t.invalidateQueries({ queryKey:
|
|
520
|
+
t.invalidateQueries({ queryKey: b.lists() }),
|
|
521
|
+
t.invalidateQueries({ queryKey: D.lists() })
|
|
520
522
|
]), await ((i = o((u = o(e)) == null ? void 0 : u.onSuccess)) == null ? void 0 : i(
|
|
521
523
|
n,
|
|
522
524
|
r,
|
|
@@ -525,12 +527,12 @@ function Ft(e) {
|
|
|
525
527
|
}
|
|
526
528
|
});
|
|
527
529
|
}
|
|
528
|
-
const
|
|
530
|
+
const fe = "updateLineItem patch /checkout/cart/line-item";
|
|
529
531
|
function Lt(e) {
|
|
530
|
-
const s = g(), t =
|
|
531
|
-
return
|
|
532
|
+
const s = g(), t = C();
|
|
533
|
+
return f({
|
|
532
534
|
...e,
|
|
533
|
-
mutationFn: async (n) => s.query(
|
|
535
|
+
mutationFn: async (n) => s.query(fe, {
|
|
534
536
|
body: n
|
|
535
537
|
}),
|
|
536
538
|
onSuccess: async (n, r, a) => {
|
|
@@ -539,12 +541,12 @@ function Lt(e) {
|
|
|
539
541
|
}
|
|
540
542
|
});
|
|
541
543
|
}
|
|
542
|
-
const
|
|
544
|
+
const he = "createOrder post /checkout/order";
|
|
543
545
|
function It(e) {
|
|
544
|
-
const s = g(), t =
|
|
545
|
-
return
|
|
546
|
+
const s = g(), t = C();
|
|
547
|
+
return f({
|
|
546
548
|
...e,
|
|
547
|
-
mutationFn: async (n) => s.query(
|
|
549
|
+
mutationFn: async (n) => s.query(he, y(n)),
|
|
548
550
|
onSuccess: async (n, r, a) => {
|
|
549
551
|
var u, i;
|
|
550
552
|
await Promise.all([
|
|
@@ -557,9 +559,9 @@ function It(e) {
|
|
|
557
559
|
});
|
|
558
560
|
}
|
|
559
561
|
const qe = "readLanguages post /language";
|
|
560
|
-
function
|
|
562
|
+
function Qe(e) {
|
|
561
563
|
const s = g();
|
|
562
|
-
return
|
|
564
|
+
return h({
|
|
563
565
|
queryKey: ee.all(),
|
|
564
566
|
queryFn: ({ signal: t }) => s.query(qe, {
|
|
565
567
|
...y(e),
|
|
@@ -568,15 +570,15 @@ function Se(e) {
|
|
|
568
570
|
});
|
|
569
571
|
}
|
|
570
572
|
function xt(e) {
|
|
571
|
-
return q(
|
|
573
|
+
return q(Qe(e));
|
|
572
574
|
}
|
|
573
|
-
const
|
|
575
|
+
const Se = "readCountry post /country", Ce = function(s) {
|
|
574
576
|
const t = g(), n = j.list(s);
|
|
575
|
-
return
|
|
577
|
+
return h({
|
|
576
578
|
queryKey: n,
|
|
577
579
|
queryFn: async ({ signal: r }) => {
|
|
578
580
|
const a = y(s);
|
|
579
|
-
return t.query(
|
|
581
|
+
return t.query(Se, {
|
|
580
582
|
...a,
|
|
581
583
|
signal: r
|
|
582
584
|
});
|
|
@@ -584,42 +586,42 @@ const Ce = "readCountry post /country", Qe = function(s) {
|
|
|
584
586
|
});
|
|
585
587
|
};
|
|
586
588
|
function Ut(e) {
|
|
587
|
-
return q(
|
|
589
|
+
return q(Ce(e));
|
|
588
590
|
}
|
|
589
591
|
const Pe = "changeEmail post /account/change-email";
|
|
590
592
|
function Dt(e) {
|
|
591
|
-
const s = g(), t =
|
|
592
|
-
return
|
|
593
|
+
const s = g(), t = C();
|
|
594
|
+
return f({
|
|
593
595
|
...e,
|
|
594
596
|
mutationFn: async (n) => s.query(Pe, y(n)),
|
|
595
597
|
onSuccess: async (n, r, a) => {
|
|
596
598
|
var u, i;
|
|
597
|
-
await t.invalidateQueries({ queryKey: I.all() }), await t.invalidateQueries({ queryKey:
|
|
599
|
+
await t.invalidateQueries({ queryKey: I.all() }), await t.invalidateQueries({ queryKey: R.all() }), await ((i = o((u = o(e)) == null ? void 0 : u.onSuccess)) == null ? void 0 : i(n, r, a));
|
|
598
600
|
}
|
|
599
601
|
});
|
|
600
602
|
}
|
|
601
|
-
const
|
|
603
|
+
const Ke = "changeProfile post /account/change-profile";
|
|
602
604
|
function bt(e) {
|
|
603
|
-
const s = g(), t =
|
|
604
|
-
return
|
|
605
|
+
const s = g(), t = C();
|
|
606
|
+
return f({
|
|
605
607
|
...e,
|
|
606
|
-
mutationFn: async (n) => s.query(
|
|
608
|
+
mutationFn: async (n) => s.query(Ke, y(n)),
|
|
607
609
|
onSuccess: async (n, r, a) => {
|
|
608
610
|
var u, i;
|
|
609
611
|
await Promise.all([
|
|
610
612
|
t.invalidateQueries({ queryKey: I.all() }),
|
|
611
|
-
t.invalidateQueries({ queryKey:
|
|
613
|
+
t.invalidateQueries({ queryKey: R.all() })
|
|
612
614
|
]), await ((i = o((u = o(e)) == null ? void 0 : u.onSuccess)) == null ? void 0 : i(n, r, a));
|
|
613
615
|
}
|
|
614
616
|
});
|
|
615
617
|
}
|
|
616
|
-
const
|
|
618
|
+
const Me = "loginCustomer post /account/login";
|
|
617
619
|
function kt(e) {
|
|
618
|
-
const s = g(), t =
|
|
619
|
-
return
|
|
620
|
+
const s = g(), t = C();
|
|
621
|
+
return f({
|
|
620
622
|
...e,
|
|
621
623
|
mutationFn: async (n) => {
|
|
622
|
-
const r = await s.queryRaw(
|
|
624
|
+
const r = await s.queryRaw(Me, {
|
|
623
625
|
body: n
|
|
624
626
|
}), a = r.headers.get("sw-context-token");
|
|
625
627
|
return a && (s.contextToken = a), r.json();
|
|
@@ -627,7 +629,7 @@ function kt(e) {
|
|
|
627
629
|
onSuccess: async (n, r, a) => {
|
|
628
630
|
var u, i;
|
|
629
631
|
await Promise.all([
|
|
630
|
-
t.resetQueries({ queryKey:
|
|
632
|
+
t.resetQueries({ queryKey: R.all() }),
|
|
631
633
|
t.invalidateQueries({ queryKey: L.get() }),
|
|
632
634
|
t.invalidateQueries({ queryKey: I.all() })
|
|
633
635
|
]), await ((i = o((u = o(e)) == null ? void 0 : u.onSuccess)) == null ? void 0 : i(n, r, a));
|
|
@@ -636,16 +638,20 @@ function kt(e) {
|
|
|
636
638
|
}
|
|
637
639
|
const Oe = "logoutCustomer post /account/logout";
|
|
638
640
|
function Bt(e) {
|
|
639
|
-
const s = g(), t =
|
|
640
|
-
return
|
|
641
|
+
const s = g(), t = C();
|
|
642
|
+
return f({
|
|
641
643
|
...e,
|
|
642
644
|
mutationFn: async (n) => s.query(Oe, y(n)),
|
|
643
645
|
onSuccess: async (n, r, a) => {
|
|
644
646
|
var u, i;
|
|
645
647
|
await Promise.all([
|
|
646
|
-
t.resetQueries({ queryKey:
|
|
648
|
+
t.resetQueries({ queryKey: R.all() }),
|
|
647
649
|
t.invalidateQueries({ queryKey: L.get() }),
|
|
648
|
-
t.invalidateQueries({ queryKey: I.all() })
|
|
650
|
+
t.invalidateQueries({ queryKey: I.all() }),
|
|
651
|
+
t.invalidateQueries({ queryKey: A.all() }),
|
|
652
|
+
t.invalidateQueries({ queryKey: D.all() }),
|
|
653
|
+
t.invalidateQueries({ queryKey: b.all() }),
|
|
654
|
+
t.invalidateQueries({ queryKey: U.all() })
|
|
649
655
|
]), await ((i = o((u = o(e)) == null ? void 0 : u.onSuccess)) == null ? void 0 : i(n, r, a));
|
|
650
656
|
}
|
|
651
657
|
});
|
|
@@ -653,7 +659,7 @@ function Bt(e) {
|
|
|
653
659
|
const we = "readCustomer post /account/customer";
|
|
654
660
|
function Ae(e) {
|
|
655
661
|
const s = g(), t = I.detail(c(() => y(e).body ?? {}));
|
|
656
|
-
return
|
|
662
|
+
return h({
|
|
657
663
|
queryKey: t,
|
|
658
664
|
queryFn: async () => s.query(we, y(e))
|
|
659
665
|
});
|
|
@@ -663,14 +669,14 @@ function Re(e) {
|
|
|
663
669
|
}
|
|
664
670
|
const Fe = "register post /account/register";
|
|
665
671
|
function Nt(e) {
|
|
666
|
-
const s = g(), t =
|
|
667
|
-
return
|
|
672
|
+
const s = g(), t = C();
|
|
673
|
+
return f({
|
|
668
674
|
...e,
|
|
669
675
|
mutationFn: async (n) => s.query(Fe, y(n)),
|
|
670
676
|
onSuccess: async (n, r, a) => {
|
|
671
677
|
var u, i;
|
|
672
678
|
await Promise.all([
|
|
673
|
-
t.resetQueries({ queryKey:
|
|
679
|
+
t.resetQueries({ queryKey: R.all() }),
|
|
674
680
|
t.invalidateQueries({ queryKey: I.all() })
|
|
675
681
|
]), await ((i = o((u = o(e)) == null ? void 0 : u.onSuccess)) == null ? void 0 : i(n, r, a));
|
|
676
682
|
}
|
|
@@ -678,45 +684,45 @@ function Nt(e) {
|
|
|
678
684
|
}
|
|
679
685
|
const Le = "defaultBillingAddress patch /account/address/default-billing/{addressId}";
|
|
680
686
|
function Tt(e) {
|
|
681
|
-
const s = g(), t =
|
|
682
|
-
return
|
|
687
|
+
const s = g(), t = C();
|
|
688
|
+
return f({
|
|
683
689
|
...e,
|
|
684
690
|
mutationFn: async (n) => s.query(Le, y(n)),
|
|
685
691
|
onSuccess: async (n, r, a) => {
|
|
686
692
|
var u, i;
|
|
687
693
|
await Promise.all([
|
|
688
694
|
t.invalidateQueries({ queryKey: I.all() }),
|
|
689
|
-
t.invalidateQueries({ queryKey:
|
|
695
|
+
t.invalidateQueries({ queryKey: R.all() })
|
|
690
696
|
]), await ((i = o((u = o(e)) == null ? void 0 : u.onSuccess)) == null ? void 0 : i(n, r, a));
|
|
691
697
|
}
|
|
692
698
|
});
|
|
693
699
|
}
|
|
694
700
|
const Ie = "defaultShippingAddress patch /account/address/default-shipping/{addressId}";
|
|
695
701
|
function Et(e) {
|
|
696
|
-
const s = g(), t =
|
|
697
|
-
return
|
|
702
|
+
const s = g(), t = C();
|
|
703
|
+
return f({
|
|
698
704
|
...e,
|
|
699
705
|
mutationFn: async (n) => s.query(Ie, y(n)),
|
|
700
706
|
onSuccess: async (n, r, a) => {
|
|
701
707
|
var u, i;
|
|
702
708
|
await Promise.all([
|
|
703
709
|
t.invalidateQueries({ queryKey: I.all() }),
|
|
704
|
-
t.invalidateQueries({ queryKey:
|
|
710
|
+
t.invalidateQueries({ queryKey: R.all() })
|
|
705
711
|
]), await ((i = o((u = o(e)) == null ? void 0 : u.onSuccess)) == null ? void 0 : i(n, r, a));
|
|
706
712
|
}
|
|
707
713
|
});
|
|
708
714
|
}
|
|
709
715
|
const xe = "deleteCustomer delete /account/customer";
|
|
710
716
|
function jt(e) {
|
|
711
|
-
const s = g(), t =
|
|
712
|
-
return
|
|
717
|
+
const s = g(), t = C();
|
|
718
|
+
return f({
|
|
713
719
|
...e,
|
|
714
720
|
mutationFn: async (n) => s.query(xe, y(n)),
|
|
715
721
|
onSuccess: async (n, r, a) => {
|
|
716
722
|
var u, i;
|
|
717
723
|
await Promise.all([
|
|
718
724
|
t.resetQueries({ queryKey: I.all() }),
|
|
719
|
-
t.resetQueries({ queryKey:
|
|
725
|
+
t.resetQueries({ queryKey: R.all() }),
|
|
720
726
|
t.resetQueries({ queryKey: L.get() })
|
|
721
727
|
]), await ((i = o((u = o(e)) == null ? void 0 : u.onSuccess)) == null ? void 0 : i(n, r, a));
|
|
722
728
|
}
|
|
@@ -725,7 +731,7 @@ function jt(e) {
|
|
|
725
731
|
const Ue = "registerConfirm post /account/register-confirm";
|
|
726
732
|
function Vt(e) {
|
|
727
733
|
const s = g();
|
|
728
|
-
return
|
|
734
|
+
return f({
|
|
729
735
|
...e,
|
|
730
736
|
mutationFn: async (t) => {
|
|
731
737
|
const n = await s.queryRaw(Ue, {
|
|
@@ -742,7 +748,7 @@ function Vt(e) {
|
|
|
742
748
|
const De = "sendRecoveryMail post /account/recovery-password";
|
|
743
749
|
function $t(e) {
|
|
744
750
|
const s = g();
|
|
745
|
-
return
|
|
751
|
+
return f({
|
|
746
752
|
...e,
|
|
747
753
|
mutationFn: async (t) => s.query(De, y(t)),
|
|
748
754
|
onSuccess: async (t, n, r) => {
|
|
@@ -754,7 +760,7 @@ function $t(e) {
|
|
|
754
760
|
const be = "changePassword post /account/change-password";
|
|
755
761
|
function zt(e) {
|
|
756
762
|
const s = g();
|
|
757
|
-
return
|
|
763
|
+
return f({
|
|
758
764
|
...e,
|
|
759
765
|
mutationFn: async (t) => s.query(be, y(t)),
|
|
760
766
|
onSuccess: async (t, n, r) => {
|
|
@@ -766,7 +772,7 @@ function zt(e) {
|
|
|
766
772
|
const ke = "imitateCustomerLogin post /account/login/imitate-customer";
|
|
767
773
|
function Be(e) {
|
|
768
774
|
const s = g(), t = I.imitateLogin(c(() => y(e).body ?? {}));
|
|
769
|
-
return
|
|
775
|
+
return h({
|
|
770
776
|
queryKey: t,
|
|
771
777
|
queryFn: async () => s.query(ke, y(e))
|
|
772
778
|
});
|
|
@@ -777,7 +783,7 @@ function Gt(e) {
|
|
|
777
783
|
const Ne = "recoveryPassword post /account/recovery-password-confirm";
|
|
778
784
|
function Ht(e) {
|
|
779
785
|
const s = g();
|
|
780
|
-
return
|
|
786
|
+
return f({
|
|
781
787
|
...e,
|
|
782
788
|
mutationFn: async (t) => s.query(Ne, y(t)),
|
|
783
789
|
onSuccess: async (t, n, r) => {
|
|
@@ -787,16 +793,16 @@ function Ht(e) {
|
|
|
787
793
|
});
|
|
788
794
|
}
|
|
789
795
|
const Te = "readNavigation post /navigation/{activeId}/{rootId}", Ee = function(s, t, n) {
|
|
790
|
-
const r = g(), a =
|
|
791
|
-
return
|
|
796
|
+
const r = g(), a = k.detail(s, t, n);
|
|
797
|
+
return h({
|
|
792
798
|
queryKey: a,
|
|
793
799
|
queryFn: async ({ signal: u }) => {
|
|
794
|
-
const i = o(s),
|
|
800
|
+
const i = o(s), v = o(t), P = y(n);
|
|
795
801
|
return r.query(Te, {
|
|
796
802
|
...P,
|
|
797
803
|
params: {
|
|
798
804
|
activeId: i,
|
|
799
|
-
rootId:
|
|
805
|
+
rootId: v
|
|
800
806
|
},
|
|
801
807
|
signal: u
|
|
802
808
|
});
|
|
@@ -808,11 +814,11 @@ function Wt(e, s, t) {
|
|
|
808
814
|
}
|
|
809
815
|
const je = "readPaymentMethod post /payment-method";
|
|
810
816
|
function Ve(e) {
|
|
811
|
-
const s = g(), t =
|
|
817
|
+
const s = g(), t = b.list(c(() => {
|
|
812
818
|
var n;
|
|
813
819
|
return (n = y(e)) == null ? void 0 : n.body;
|
|
814
820
|
}));
|
|
815
|
-
return
|
|
821
|
+
return h({
|
|
816
822
|
queryKey: t,
|
|
817
823
|
queryFn: ({ signal: n }) => s.query(je, {
|
|
818
824
|
...y(e),
|
|
@@ -825,8 +831,8 @@ function $e(e) {
|
|
|
825
831
|
}
|
|
826
832
|
const ze = "handlePaymentMethod post /handle-payment";
|
|
827
833
|
function Jt(e) {
|
|
828
|
-
const s = g(), t =
|
|
829
|
-
return
|
|
834
|
+
const s = g(), t = C();
|
|
835
|
+
return f({
|
|
830
836
|
...e,
|
|
831
837
|
mutationFn: async (n) => s.query(ze, y(n)),
|
|
832
838
|
onSuccess: async (n, r, a) => {
|
|
@@ -837,8 +843,8 @@ function Jt(e) {
|
|
|
837
843
|
}
|
|
838
844
|
const Ge = "orderSetPayment post /order/payment";
|
|
839
845
|
function Xt(e) {
|
|
840
|
-
const s = g(), t =
|
|
841
|
-
return
|
|
846
|
+
const s = g(), t = C();
|
|
847
|
+
return f({
|
|
842
848
|
...e,
|
|
843
849
|
mutationFn: async (n) => s.query(Ge, y(n)),
|
|
844
850
|
onSuccess: async (n, r, a) => {
|
|
@@ -849,7 +855,7 @@ function Xt(e) {
|
|
|
849
855
|
}
|
|
850
856
|
const He = "readCategoryList post /category", We = function(s) {
|
|
851
857
|
const t = g(), n = N.list(s);
|
|
852
|
-
return
|
|
858
|
+
return h({
|
|
853
859
|
queryKey: n,
|
|
854
860
|
queryFn: async ({ signal: r }) => t.query(He, {
|
|
855
861
|
...y(s),
|
|
@@ -863,7 +869,7 @@ function Yt(e) {
|
|
|
863
869
|
const Je = "readCompactProductListing post /novu/headless/product-listing/{seoUrl}";
|
|
864
870
|
function Xe(e, s) {
|
|
865
871
|
const t = g(), n = O.list(e, s);
|
|
866
|
-
return
|
|
872
|
+
return h({
|
|
867
873
|
queryKey: n,
|
|
868
874
|
queryFn: async ({ signal: r }) => {
|
|
869
875
|
const a = y(s);
|
|
@@ -884,7 +890,7 @@ function Zt(e, s) {
|
|
|
884
890
|
const Ye = "readCustomProductDetail post /novu/headless/product/{seoUrl}";
|
|
885
891
|
function Ze(e, s) {
|
|
886
892
|
const t = g(), n = O.customDetail(e, s);
|
|
887
|
-
return
|
|
893
|
+
return h({
|
|
888
894
|
queryKey: n,
|
|
889
895
|
queryFn: async ({ signal: r }) => {
|
|
890
896
|
const a = y(s);
|
|
@@ -905,7 +911,7 @@ function _t(e, s) {
|
|
|
905
911
|
const _e = "searchPage post /search";
|
|
906
912
|
function et(e) {
|
|
907
913
|
const s = g(), t = O.search(e);
|
|
908
|
-
return
|
|
914
|
+
return h({
|
|
909
915
|
queryKey: t,
|
|
910
916
|
queryFn: async ({ signal: n }) => {
|
|
911
917
|
const r = y(e);
|
|
@@ -922,7 +928,7 @@ function en(e) {
|
|
|
922
928
|
const tt = "searchSuggest post /search-suggest";
|
|
923
929
|
function nt(e) {
|
|
924
930
|
const s = g(), t = O.searchSuggest(e);
|
|
925
|
-
return
|
|
931
|
+
return h({
|
|
926
932
|
queryKey: t,
|
|
927
933
|
queryFn: async ({ signal: n }) => {
|
|
928
934
|
const r = y(e);
|
|
@@ -939,7 +945,7 @@ function tn(e) {
|
|
|
939
945
|
const st = "readProduct post /product";
|
|
940
946
|
function rt(e) {
|
|
941
947
|
const s = g(), t = O.headlessDetail(e);
|
|
942
|
-
return
|
|
948
|
+
return h({
|
|
943
949
|
queryKey: t,
|
|
944
950
|
queryFn: async ({ signal: n }) => {
|
|
945
951
|
const r = y(e);
|
|
@@ -956,7 +962,7 @@ function nn(e) {
|
|
|
956
962
|
const at = "readProductDetail post /product/{productId}";
|
|
957
963
|
function ut(e, s) {
|
|
958
964
|
const t = g(), n = O.detail(e, s);
|
|
959
|
-
return
|
|
965
|
+
return h({
|
|
960
966
|
queryKey: n,
|
|
961
967
|
queryFn: async ({ signal: r }) => {
|
|
962
968
|
const a = y(s);
|
|
@@ -976,7 +982,7 @@ function sn(e, s) {
|
|
|
976
982
|
}
|
|
977
983
|
const it = "readSalutation post /salutation", ot = function(s) {
|
|
978
984
|
const t = g(), n = E.list(s);
|
|
979
|
-
return
|
|
985
|
+
return h({
|
|
980
986
|
queryKey: n,
|
|
981
987
|
queryFn: async ({ signal: r }) => {
|
|
982
988
|
const a = y(s);
|
|
@@ -992,7 +998,7 @@ function rn(e) {
|
|
|
992
998
|
}
|
|
993
999
|
const ct = "readSeoUrl post /seo-url", lt = function(s) {
|
|
994
1000
|
const t = g(), n = T.list(s);
|
|
995
|
-
return
|
|
1001
|
+
return h({
|
|
996
1002
|
queryKey: n,
|
|
997
1003
|
queryFn: async ({ signal: r }) => {
|
|
998
1004
|
const a = y(s);
|
|
@@ -1008,11 +1014,11 @@ function an(e) {
|
|
|
1008
1014
|
}
|
|
1009
1015
|
const dt = "readShippingMethod post /shipping-method";
|
|
1010
1016
|
function yt(e) {
|
|
1011
|
-
const s = g(), t =
|
|
1017
|
+
const s = g(), t = D.list(c(() => {
|
|
1012
1018
|
var n;
|
|
1013
1019
|
return (n = y(e)) == null ? void 0 : n.body;
|
|
1014
1020
|
}));
|
|
1015
|
-
return
|
|
1021
|
+
return h({
|
|
1016
1022
|
queryKey: t,
|
|
1017
1023
|
queryFn: ({ signal: n }) => s.query(dt, {
|
|
1018
1024
|
...y(e),
|
|
@@ -1031,11 +1037,11 @@ function un() {
|
|
|
1031
1037
|
}), n = c(() => s.isPending.value), r = async (i) => s.mutateAsync({
|
|
1032
1038
|
paymentMethodId: i
|
|
1033
1039
|
}), a = c(() => {
|
|
1034
|
-
var i,
|
|
1035
|
-
return (
|
|
1040
|
+
var i, v;
|
|
1041
|
+
return (v = (i = e.data) == null ? void 0 : i.value) == null ? void 0 : v.paymentMethod;
|
|
1036
1042
|
}), u = c(() => {
|
|
1037
|
-
var i,
|
|
1038
|
-
return ((P = (
|
|
1043
|
+
var i, v, P;
|
|
1044
|
+
return ((P = (v = (i = t.data) == null ? void 0 : i.value) == null ? void 0 : v.elements) == null ? void 0 : P.sort((d, K) => (d.position ?? 0) - (K.position ?? 0))) ?? [];
|
|
1039
1045
|
});
|
|
1040
1046
|
return {
|
|
1041
1047
|
contextUpdateMutation: s,
|
|
@@ -1055,11 +1061,11 @@ function on() {
|
|
|
1055
1061
|
}), n = c(() => s.isPending.value), r = async (i) => s.mutateAsync({
|
|
1056
1062
|
shippingMethodId: i
|
|
1057
1063
|
}), a = c(() => {
|
|
1058
|
-
var i,
|
|
1059
|
-
return (
|
|
1064
|
+
var i, v;
|
|
1065
|
+
return (v = (i = e.data) == null ? void 0 : i.value) == null ? void 0 : v.shippingMethod;
|
|
1060
1066
|
}), u = c(() => {
|
|
1061
|
-
var i,
|
|
1062
|
-
return ((
|
|
1067
|
+
var i, v;
|
|
1068
|
+
return ((v = (i = t.data) == null ? void 0 : i.value) == null ? void 0 : v.elements.sort((P, d) => (P.position ?? 0) - (d.position ?? 0))) ?? [];
|
|
1063
1069
|
});
|
|
1064
1070
|
return {
|
|
1065
1071
|
contextUpdateMutation: s,
|
|
@@ -1099,22 +1105,22 @@ function ln(e) {
|
|
|
1099
1105
|
get() {
|
|
1100
1106
|
return a.page;
|
|
1101
1107
|
},
|
|
1102
|
-
set(
|
|
1103
|
-
a.page = Math.max(1, Math.min(o(u),
|
|
1108
|
+
set(M) {
|
|
1109
|
+
a.page = Math.max(1, Math.min(o(u), M));
|
|
1104
1110
|
}
|
|
1105
1111
|
});
|
|
1106
1112
|
H(
|
|
1107
1113
|
[() => o(u), () => a],
|
|
1108
|
-
([
|
|
1109
|
-
a.page = Math.min(
|
|
1114
|
+
([M, p]) => {
|
|
1115
|
+
a.page = Math.min(M, a.page), a.total = p.total ?? 0, a.limit = p.limit;
|
|
1110
1116
|
}
|
|
1111
1117
|
);
|
|
1112
|
-
const
|
|
1118
|
+
const v = c(() => a.page === o(u)), P = c(() => a.page === 1), d = c(() => ({
|
|
1113
1119
|
p: a.page,
|
|
1114
1120
|
limit: a.limit,
|
|
1115
1121
|
"total-count-mode": a.totalCountMode ?? "none"
|
|
1116
|
-
})),
|
|
1117
|
-
H(() => o(
|
|
1122
|
+
})), K = (M) => {
|
|
1123
|
+
H(() => o(M), (p) => {
|
|
1118
1124
|
p && (a.total = (p == null ? void 0 : p.total) ?? 0, a.limit = (p == null ? void 0 : p.limit) ?? 0);
|
|
1119
1125
|
});
|
|
1120
1126
|
};
|
|
@@ -1123,9 +1129,9 @@ function ln(e) {
|
|
|
1123
1129
|
total: W(a, "total"),
|
|
1124
1130
|
limit: W(a, "limit"),
|
|
1125
1131
|
pageCount: u,
|
|
1126
|
-
isLastPage:
|
|
1132
|
+
isLastPage: v,
|
|
1127
1133
|
isFirstPage: P,
|
|
1128
|
-
usePaginationSync:
|
|
1134
|
+
usePaginationSync: K,
|
|
1129
1135
|
// This can be used to pass the pagination options directly to the query options
|
|
1130
1136
|
queryOptions: d
|
|
1131
1137
|
};
|
|
@@ -1147,31 +1153,31 @@ function dn(e) {
|
|
|
1147
1153
|
return (p = e.value) == null ? void 0 : p.calculatedCheapestPrice;
|
|
1148
1154
|
}), t = c(
|
|
1149
1155
|
() => {
|
|
1150
|
-
var p,
|
|
1151
|
-
return (((
|
|
1156
|
+
var p, Q, w, F, l;
|
|
1157
|
+
return (((Q = (p = e.value) == null ? void 0 : p.calculatedPrices) == null ? void 0 : Q.length) ?? 0) > 0 ? (F = (w = e.value) == null ? void 0 : w.calculatedPrices) == null ? void 0 : F[0] : (l = e.value) == null ? void 0 : l.calculatedPrice;
|
|
1152
1158
|
}
|
|
1153
1159
|
), n = c(() => {
|
|
1154
1160
|
var p;
|
|
1155
1161
|
return (p = t == null ? void 0 : t.value) == null ? void 0 : p.referencePrice;
|
|
1156
1162
|
}), r = c(() => {
|
|
1157
|
-
var p,
|
|
1158
|
-
return (((
|
|
1163
|
+
var p, Q;
|
|
1164
|
+
return (((Q = (p = e.value) == null ? void 0 : p.calculatedPrices) == null ? void 0 : Q.length) ?? 0) > 1;
|
|
1159
1165
|
}), a = c(
|
|
1160
1166
|
() => {
|
|
1161
|
-
var p,
|
|
1162
|
-
return !!((p = e.value) != null && p.parentId) && ((w = (
|
|
1167
|
+
var p, Q, w, F, l, m;
|
|
1168
|
+
return !!((p = e.value) != null && p.parentId) && ((w = (Q = e.value) == null ? void 0 : Q.calculatedCheapestPrice) == null ? void 0 : w.hasRange) && ((F = t == null ? void 0 : t.value) == null ? void 0 : F.unitPrice) !== ((l = s == null ? void 0 : s.value) == null ? void 0 : l.unitPrice) && ((m = s == null ? void 0 : s.value) == null ? void 0 : m.unitPrice);
|
|
1163
1169
|
}
|
|
1164
1170
|
), u = c(
|
|
1165
1171
|
() => {
|
|
1166
|
-
var p,
|
|
1167
|
-
return r.value && X(e.value).length > 1 ? (
|
|
1172
|
+
var p, Q;
|
|
1173
|
+
return r.value && X(e.value).length > 1 ? (Q = (p = e.value) == null ? void 0 : p.calculatedPrices) == null ? void 0 : Q.reduce((w, F) => F.unitPrice < w.unitPrice ? F : w) : t.value;
|
|
1168
1174
|
}
|
|
1169
1175
|
), i = c(
|
|
1170
1176
|
() => {
|
|
1171
1177
|
var p;
|
|
1172
1178
|
return (p = u.value) == null ? void 0 : p.unitPrice;
|
|
1173
1179
|
}
|
|
1174
|
-
),
|
|
1180
|
+
), v = c(
|
|
1175
1181
|
() => {
|
|
1176
1182
|
var p;
|
|
1177
1183
|
return (p = u.value) == null ? void 0 : p.totalPrice;
|
|
@@ -1179,24 +1185,24 @@ function dn(e) {
|
|
|
1179
1185
|
), P = c(
|
|
1180
1186
|
() => u.value
|
|
1181
1187
|
), d = c(() => {
|
|
1182
|
-
var p,
|
|
1183
|
-
return !!((
|
|
1184
|
-
}),
|
|
1188
|
+
var p, Q;
|
|
1189
|
+
return !!((Q = (p = u.value) == null ? void 0 : p.listPrice) != null && Q.percentage);
|
|
1190
|
+
}), K = c(
|
|
1185
1191
|
() => {
|
|
1186
|
-
var p,
|
|
1187
|
-
return (w = (
|
|
1192
|
+
var p, Q, w;
|
|
1193
|
+
return (w = (Q = (p = e.value) == null ? void 0 : p.calculatedPrice) == null ? void 0 : Q.regulationPrice) == null ? void 0 : w.price;
|
|
1188
1194
|
}
|
|
1189
|
-
),
|
|
1195
|
+
), M = c(() => X(e.value));
|
|
1190
1196
|
return {
|
|
1191
1197
|
price: P,
|
|
1192
|
-
totalPrice:
|
|
1198
|
+
totalPrice: v,
|
|
1193
1199
|
unitPrice: i,
|
|
1194
1200
|
displayFromVariants: a,
|
|
1195
1201
|
displayFrom: r,
|
|
1196
|
-
tierPrices:
|
|
1202
|
+
tierPrices: M,
|
|
1197
1203
|
referencePrice: n,
|
|
1198
1204
|
isListPrice: d,
|
|
1199
|
-
regulationPrice:
|
|
1205
|
+
regulationPrice: K
|
|
1200
1206
|
};
|
|
1201
1207
|
}
|
|
1202
1208
|
function mt(e, s) {
|
|
@@ -1246,7 +1252,7 @@ function gn(e) {
|
|
|
1246
1252
|
var d;
|
|
1247
1253
|
return ((d = t.value) == null ? void 0 : d.defaultShippingAddressId) || null;
|
|
1248
1254
|
}
|
|
1249
|
-
),
|
|
1255
|
+
), v = c(
|
|
1250
1256
|
() => {
|
|
1251
1257
|
var d;
|
|
1252
1258
|
return ((d = t.value) == null ? void 0 : d.defaultBillingAddress) || null;
|
|
@@ -1265,40 +1271,40 @@ function gn(e) {
|
|
|
1265
1271
|
isGuestSession: a,
|
|
1266
1272
|
defaultBillingAddressId: u,
|
|
1267
1273
|
defaultShippingAddressId: i,
|
|
1268
|
-
userDefaultBillingAddress:
|
|
1274
|
+
userDefaultBillingAddress: v,
|
|
1269
1275
|
userDefaultShippingAddress: P,
|
|
1270
1276
|
// Expose queries and mutations directly
|
|
1271
1277
|
customerQuery: s
|
|
1272
1278
|
};
|
|
1273
1279
|
}
|
|
1274
1280
|
export {
|
|
1275
|
-
|
|
1276
|
-
|
|
1281
|
+
Qt as absolutizeSeoUrl,
|
|
1282
|
+
A as addressKeys,
|
|
1277
1283
|
L as cartKeys,
|
|
1278
1284
|
N as categoryKeys,
|
|
1279
|
-
|
|
1285
|
+
R as contextKeys,
|
|
1280
1286
|
j as countryKeys,
|
|
1281
1287
|
I as customerKeys,
|
|
1282
1288
|
mt as getProductVariantForOptions,
|
|
1283
1289
|
ee as languageKey,
|
|
1284
|
-
|
|
1290
|
+
k as navigationKeys,
|
|
1285
1291
|
U as orderKeys,
|
|
1286
|
-
|
|
1292
|
+
b as paymentKeys,
|
|
1287
1293
|
O as productKeys,
|
|
1288
1294
|
je as readPaymentMethodOperation,
|
|
1289
1295
|
dt as readShippingMethodOperation,
|
|
1290
1296
|
V as relativizeSeoUrl,
|
|
1291
1297
|
E as salutationKeys,
|
|
1292
1298
|
T as seoUrlKeys,
|
|
1293
|
-
|
|
1299
|
+
D as shippingKeys,
|
|
1294
1300
|
_ as shopwareClientKey,
|
|
1295
1301
|
y as unrefOptions,
|
|
1296
1302
|
At as useAddLineItemMutation,
|
|
1297
1303
|
Dt as useChangeEmailMutation,
|
|
1298
1304
|
zt as useChangePasswordMutation,
|
|
1299
1305
|
bt as useChangeProfileMutation,
|
|
1300
|
-
|
|
1301
|
-
|
|
1306
|
+
Ct as useCheckoutAddresses,
|
|
1307
|
+
Mt as useCreateCustomerAddressMutation,
|
|
1302
1308
|
It as useCreateOrderMutation,
|
|
1303
1309
|
Tt as useDefaultBillingAddressMutation,
|
|
1304
1310
|
Et as useDefaultShippingAddressMutation,
|
|
@@ -1312,9 +1318,9 @@ export {
|
|
|
1312
1318
|
ne as useListAddressQueryOptions,
|
|
1313
1319
|
kt as useLoginCustomerMutation,
|
|
1314
1320
|
Bt as useLogoutCustomerMutation,
|
|
1315
|
-
|
|
1321
|
+
St as useOptimistic,
|
|
1316
1322
|
Pt as useOrderDetails,
|
|
1317
|
-
|
|
1323
|
+
Kt as useOrderPayment,
|
|
1318
1324
|
Xt as useOrderSetPaymentMutation,
|
|
1319
1325
|
ln as usePagination,
|
|
1320
1326
|
un as usePaymentMethods,
|
|
@@ -1329,13 +1335,13 @@ export {
|
|
|
1329
1335
|
B as useReadContextQuery,
|
|
1330
1336
|
ae as useReadContextQueryOptions,
|
|
1331
1337
|
Ut as useReadCountryQuery,
|
|
1332
|
-
|
|
1338
|
+
Ce as useReadCountryQueryOptions,
|
|
1333
1339
|
Ze as useReadCustomProductDetailOptions,
|
|
1334
1340
|
_t as useReadCustomProductDetailQuery,
|
|
1335
1341
|
Re as useReadCustomerQuery,
|
|
1336
1342
|
Ae as useReadCustomerQueryOptions,
|
|
1337
1343
|
xt as useReadLanguageQuery,
|
|
1338
|
-
|
|
1344
|
+
Qe as useReadLanguageQueryOptions,
|
|
1339
1345
|
Wt as useReadNavigationQuery,
|
|
1340
1346
|
Ee as useReadNavigationQueryOptions,
|
|
1341
1347
|
ce as useReadOrderQuery,
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@ import { useMutation, type UseMutationOptions, useQueryClient } from '@tanstack/
|
|
|
2
2
|
import { ShopwareApiError } from '@teamnovu/kit-shopware-api-client'
|
|
3
3
|
import { unref } from 'vue'
|
|
4
4
|
import { useShopwareQueryClient } from '../../inject'
|
|
5
|
-
import { cartKeys, contextKeys } from '../../keys'
|
|
5
|
+
import { cartKeys, contextKeys, paymentKeys, shippingKeys } from '../../keys'
|
|
6
6
|
import type { OperationBody, OperationKey, OperationResponse } from '../types/query'
|
|
7
7
|
|
|
8
8
|
const updateContextOperation = 'updateContext patch /context' satisfies OperationKey
|
|
@@ -32,6 +32,8 @@ export function useUpdateContextMutation(
|
|
|
32
32
|
await Promise.all([
|
|
33
33
|
queryClient.invalidateQueries({ queryKey: contextKeys.all() }),
|
|
34
34
|
queryClient.invalidateQueries({ queryKey: cartKeys.get() }),
|
|
35
|
+
queryClient.invalidateQueries({ queryKey: paymentKeys.lists() }),
|
|
36
|
+
queryClient.invalidateQueries({ queryKey: shippingKeys.lists() }),
|
|
35
37
|
])
|
|
36
38
|
|
|
37
39
|
await unref(unref(mutationOptions)?.onSuccess)?.(newContext, variables, context)
|
|
@@ -3,7 +3,7 @@ import { useMutation, type UseMutationOptions, useQueryClient } from '@tanstack/
|
|
|
3
3
|
import { unref } from 'vue'
|
|
4
4
|
import type { OperationKey, OperationOptions, OperationResponse } from '../types/query'
|
|
5
5
|
import { useShopwareQueryClient } from '../../inject'
|
|
6
|
-
import { cartKeys, contextKeys, customerKeys } from '../../keys'
|
|
6
|
+
import { addressKeys, cartKeys, contextKeys, customerKeys, orderKeys, paymentKeys, shippingKeys } from '../../keys'
|
|
7
7
|
import { unrefOptions } from '../../util/unrefOptions'
|
|
8
8
|
|
|
9
9
|
const logoutOperation = 'logoutCustomer post /account/logout' satisfies OperationKey
|
|
@@ -28,6 +28,10 @@ export function useLogoutCustomerMutation(
|
|
|
28
28
|
queryClient.resetQueries({ queryKey: contextKeys.all() }),
|
|
29
29
|
queryClient.invalidateQueries({ queryKey: cartKeys.get() }),
|
|
30
30
|
queryClient.invalidateQueries({ queryKey: customerKeys.all() }),
|
|
31
|
+
queryClient.invalidateQueries({ queryKey: addressKeys.all() }),
|
|
32
|
+
queryClient.invalidateQueries({ queryKey: shippingKeys.all() }),
|
|
33
|
+
queryClient.invalidateQueries({ queryKey: paymentKeys.all() }),
|
|
34
|
+
queryClient.invalidateQueries({ queryKey: orderKeys.all() }),
|
|
31
35
|
])
|
|
32
36
|
|
|
33
37
|
await unref(unref(mutationOptions)?.onSuccess)?.(data, variables, context)
|