@teamnovu/kit-shopware-composables 0.0.18 → 0.0.19
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 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
|
|
3
|
+
import { queryOptions as S, useQuery as P, useQueryClient as Q, useMutation as h } from "@tanstack/vue-query";
|
|
4
4
|
import "@teamnovu/kit-shopware-api-client";
|
|
5
5
|
const _ = Symbol("shopwareClient");
|
|
6
6
|
function g() {
|
|
@@ -170,7 +170,7 @@ function ne(e) {
|
|
|
170
170
|
var n;
|
|
171
171
|
return (n = p(e)) == null ? void 0 : n.body;
|
|
172
172
|
}));
|
|
173
|
-
return
|
|
173
|
+
return S({
|
|
174
174
|
queryKey: t,
|
|
175
175
|
queryFn: ({ signal: n }) => s.query(te, {
|
|
176
176
|
...p(e),
|
|
@@ -179,14 +179,14 @@ function ne(e) {
|
|
|
179
179
|
});
|
|
180
180
|
}
|
|
181
181
|
function se(e) {
|
|
182
|
-
return
|
|
182
|
+
return P(ne(e));
|
|
183
183
|
}
|
|
184
184
|
const V = (e) => {
|
|
185
185
|
const s = e.replace(/\/?$/, "");
|
|
186
186
|
return s.startsWith("/") ? s.slice(1) : s;
|
|
187
187
|
}, ft = (e) => `/${V(e)}`;
|
|
188
188
|
function ht(e, s, t) {
|
|
189
|
-
const n =
|
|
189
|
+
const n = Q();
|
|
190
190
|
return {
|
|
191
191
|
onMutate: async (r) => {
|
|
192
192
|
await n.cancelQueries({ queryKey: e });
|
|
@@ -214,7 +214,7 @@ function ht(e, s, t) {
|
|
|
214
214
|
const re = "readContext get /context";
|
|
215
215
|
function ae(e) {
|
|
216
216
|
const s = g();
|
|
217
|
-
return
|
|
217
|
+
return S({
|
|
218
218
|
queryKey: F.all(),
|
|
219
219
|
queryFn: ({ signal: t }) => s.query(re, {
|
|
220
220
|
...p(e),
|
|
@@ -223,11 +223,11 @@ function ae(e) {
|
|
|
223
223
|
});
|
|
224
224
|
}
|
|
225
225
|
function k(e) {
|
|
226
|
-
return
|
|
226
|
+
return P(ae(e));
|
|
227
227
|
}
|
|
228
228
|
const ue = "updateContext patch /context";
|
|
229
229
|
function $(e) {
|
|
230
|
-
const s = g(), t =
|
|
230
|
+
const s = g(), t = Q();
|
|
231
231
|
return h({
|
|
232
232
|
...e,
|
|
233
233
|
mutationFn: async (n) => (t.cancelQueries({ queryKey: F.all() }), s.query(ue, {
|
|
@@ -262,7 +262,7 @@ function vt() {
|
|
|
262
262
|
return M.id !== ((O = u.value) == null ? void 0 : O.id);
|
|
263
263
|
}
|
|
264
264
|
)) ?? [];
|
|
265
|
-
}),
|
|
265
|
+
}), C = c(() => {
|
|
266
266
|
var d;
|
|
267
267
|
return ((d = t.data.value) == null ? void 0 : d.elements.filter(
|
|
268
268
|
(M) => {
|
|
@@ -281,13 +281,13 @@ function vt() {
|
|
|
281
281
|
activeBillingAddress: u,
|
|
282
282
|
activeShippingAddress: o,
|
|
283
283
|
inactiveBillingAddresses: f,
|
|
284
|
-
inactiveShippingAddresses:
|
|
284
|
+
inactiveShippingAddresses: C
|
|
285
285
|
};
|
|
286
286
|
}
|
|
287
287
|
const oe = "readOrder post /order";
|
|
288
288
|
function ie(e) {
|
|
289
289
|
const s = g(), t = U.detail(e);
|
|
290
|
-
return
|
|
290
|
+
return S({
|
|
291
291
|
queryKey: t,
|
|
292
292
|
queryFn: async ({ signal: n }) => {
|
|
293
293
|
const r = p(e);
|
|
@@ -299,7 +299,7 @@ function ie(e) {
|
|
|
299
299
|
});
|
|
300
300
|
}
|
|
301
301
|
function ce(e) {
|
|
302
|
-
return
|
|
302
|
+
return P(ie(e));
|
|
303
303
|
}
|
|
304
304
|
function qt(e, s) {
|
|
305
305
|
const t = c(() => {
|
|
@@ -333,7 +333,7 @@ function qt(e, s) {
|
|
|
333
333
|
}), f = c(() => {
|
|
334
334
|
var l, m;
|
|
335
335
|
return (m = (l = r.value) == null ? void 0 : l.price) == null ? void 0 : m.totalPrice;
|
|
336
|
-
}),
|
|
336
|
+
}), C = c(() => {
|
|
337
337
|
var l, m;
|
|
338
338
|
return (m = (l = r.value) == null ? void 0 : l.price) == null ? void 0 : m.positionPrice;
|
|
339
339
|
}), d = c(() => {
|
|
@@ -379,7 +379,7 @@ function qt(e, s) {
|
|
|
379
379
|
status: u,
|
|
380
380
|
statusTechnicalName: o,
|
|
381
381
|
total: f,
|
|
382
|
-
subtotal:
|
|
382
|
+
subtotal: C,
|
|
383
383
|
shippingCosts: d,
|
|
384
384
|
shippingAddress: y,
|
|
385
385
|
billingAddress: O,
|
|
@@ -412,7 +412,7 @@ function Ct(e) {
|
|
|
412
412
|
}
|
|
413
413
|
const le = "createCustomerAddress post /account/address";
|
|
414
414
|
function St(e) {
|
|
415
|
-
const s = g(), t =
|
|
415
|
+
const s = g(), t = Q();
|
|
416
416
|
return h({
|
|
417
417
|
...e,
|
|
418
418
|
mutationFn: async (n) => s.query(le, p(n)),
|
|
@@ -424,7 +424,7 @@ function St(e) {
|
|
|
424
424
|
}
|
|
425
425
|
const de = "deleteCustomerAddress delete /account/address/{addressId}";
|
|
426
426
|
function Pt(e) {
|
|
427
|
-
const s = g(), t =
|
|
427
|
+
const s = g(), t = Q();
|
|
428
428
|
return h({
|
|
429
429
|
...e,
|
|
430
430
|
mutationFn: async (n) => s.query(de, p(n)),
|
|
@@ -436,7 +436,7 @@ function Pt(e) {
|
|
|
436
436
|
}
|
|
437
437
|
const ye = "updateCustomerAddress patch /account/address/{addressId}";
|
|
438
438
|
function Qt(e) {
|
|
439
|
-
const s = g(), t =
|
|
439
|
+
const s = g(), t = Q();
|
|
440
440
|
return h({
|
|
441
441
|
...e,
|
|
442
442
|
mutationFn: async (n) => s.query(ye, p(n)),
|
|
@@ -447,7 +447,7 @@ function Qt(e) {
|
|
|
447
447
|
t.invalidateQueries({ queryKey: R.lists() }),
|
|
448
448
|
t.invalidateQueries({
|
|
449
449
|
queryKey: R.detail(p(r).params.addressId),
|
|
450
|
-
predicate: (
|
|
450
|
+
predicate: (C) => C.queryKey.at(-1) !== u
|
|
451
451
|
})
|
|
452
452
|
]), await ((f = i((o = i(e)) == null ? void 0 : o.onSuccess)) == null ? void 0 : f(n, r, a));
|
|
453
453
|
}
|
|
@@ -455,7 +455,7 @@ function Qt(e) {
|
|
|
455
455
|
}
|
|
456
456
|
const pe = "addLineItem post /checkout/cart/line-item";
|
|
457
457
|
function Mt(e) {
|
|
458
|
-
const s = g(), t =
|
|
458
|
+
const s = g(), t = Q();
|
|
459
459
|
return h({
|
|
460
460
|
...e,
|
|
461
461
|
mutationFn: async (n) => s.query(pe, {
|
|
@@ -470,7 +470,7 @@ function Mt(e) {
|
|
|
470
470
|
const ge = "readCart get /checkout/cart";
|
|
471
471
|
function me(e) {
|
|
472
472
|
const s = g(), t = x.get();
|
|
473
|
-
return
|
|
473
|
+
return S({
|
|
474
474
|
queryKey: t,
|
|
475
475
|
queryFn: async ({ signal: n }) => s.query(ge, {
|
|
476
476
|
...p(e),
|
|
@@ -479,11 +479,11 @@ function me(e) {
|
|
|
479
479
|
});
|
|
480
480
|
}
|
|
481
481
|
function Ot() {
|
|
482
|
-
return
|
|
482
|
+
return P(me());
|
|
483
483
|
}
|
|
484
484
|
const fe = "removeLineItem post /checkout/cart/line-item/delete";
|
|
485
485
|
function Kt(e) {
|
|
486
|
-
const s = g(), t =
|
|
486
|
+
const s = g(), t = Q();
|
|
487
487
|
return h({
|
|
488
488
|
...e,
|
|
489
489
|
mutationFn: async (n) => s.query(fe, {
|
|
@@ -497,7 +497,7 @@ function Kt(e) {
|
|
|
497
497
|
}
|
|
498
498
|
const he = "updateLineItem patch /checkout/cart/line-item";
|
|
499
499
|
function At(e) {
|
|
500
|
-
const s = g(), t =
|
|
500
|
+
const s = g(), t = Q();
|
|
501
501
|
return h({
|
|
502
502
|
...e,
|
|
503
503
|
mutationFn: async (n) => s.query(he, {
|
|
@@ -511,7 +511,7 @@ function At(e) {
|
|
|
511
511
|
}
|
|
512
512
|
const ve = "createOrder post /checkout/order";
|
|
513
513
|
function wt(e) {
|
|
514
|
-
const s = g(), t =
|
|
514
|
+
const s = g(), t = Q();
|
|
515
515
|
return h({
|
|
516
516
|
...e,
|
|
517
517
|
mutationFn: async (n) => s.query(ve, p(n)),
|
|
@@ -527,7 +527,7 @@ function wt(e) {
|
|
|
527
527
|
const qe = "readLanguages post /language";
|
|
528
528
|
function Ce(e) {
|
|
529
529
|
const s = g();
|
|
530
|
-
return
|
|
530
|
+
return S({
|
|
531
531
|
queryKey: ee.all(),
|
|
532
532
|
queryFn: ({ signal: t }) => s.query(qe, {
|
|
533
533
|
...p(e),
|
|
@@ -536,11 +536,11 @@ function Ce(e) {
|
|
|
536
536
|
});
|
|
537
537
|
}
|
|
538
538
|
function Rt(e) {
|
|
539
|
-
return
|
|
539
|
+
return P(Ce(e));
|
|
540
540
|
}
|
|
541
541
|
const Se = "readCountry post /country", Pe = function(s) {
|
|
542
542
|
const t = g(), n = j.list(s);
|
|
543
|
-
return
|
|
543
|
+
return S({
|
|
544
544
|
queryKey: n,
|
|
545
545
|
queryFn: async ({ signal: r }) => {
|
|
546
546
|
const a = p(s);
|
|
@@ -552,11 +552,11 @@ const Se = "readCountry post /country", Pe = function(s) {
|
|
|
552
552
|
});
|
|
553
553
|
};
|
|
554
554
|
function Ft(e) {
|
|
555
|
-
return
|
|
555
|
+
return P(Pe(e));
|
|
556
556
|
}
|
|
557
557
|
const Qe = "changeEmail post /account/change-email";
|
|
558
558
|
function Lt(e) {
|
|
559
|
-
const s = g(), t =
|
|
559
|
+
const s = g(), t = Q();
|
|
560
560
|
return h({
|
|
561
561
|
...e,
|
|
562
562
|
mutationFn: async (n) => s.query(Qe, p(n)),
|
|
@@ -568,7 +568,7 @@ function Lt(e) {
|
|
|
568
568
|
}
|
|
569
569
|
const Me = "changeProfile post /account/change-profile";
|
|
570
570
|
function It(e) {
|
|
571
|
-
const s = g(), t =
|
|
571
|
+
const s = g(), t = Q();
|
|
572
572
|
return h({
|
|
573
573
|
...e,
|
|
574
574
|
mutationFn: async (n) => s.query(Me, p(n)),
|
|
@@ -583,7 +583,7 @@ function It(e) {
|
|
|
583
583
|
}
|
|
584
584
|
const Oe = "loginCustomer post /account/login";
|
|
585
585
|
function xt(e) {
|
|
586
|
-
const s = g(), t =
|
|
586
|
+
const s = g(), t = Q();
|
|
587
587
|
return h({
|
|
588
588
|
...e,
|
|
589
589
|
mutationFn: async (n) => {
|
|
@@ -604,7 +604,7 @@ function xt(e) {
|
|
|
604
604
|
}
|
|
605
605
|
const Ke = "logoutCustomer post /account/logout";
|
|
606
606
|
function Ut(e) {
|
|
607
|
-
const s = g(), t =
|
|
607
|
+
const s = g(), t = Q();
|
|
608
608
|
return h({
|
|
609
609
|
...e,
|
|
610
610
|
mutationFn: async (n) => s.query(Ke, p(n)),
|
|
@@ -621,17 +621,17 @@ function Ut(e) {
|
|
|
621
621
|
const Ae = "readCustomer post /account/customer";
|
|
622
622
|
function we(e) {
|
|
623
623
|
const s = g(), t = L.detail(c(() => p(e).body ?? {}));
|
|
624
|
-
return
|
|
624
|
+
return S({
|
|
625
625
|
queryKey: t,
|
|
626
626
|
queryFn: async () => s.query(Ae, p(e))
|
|
627
627
|
});
|
|
628
628
|
}
|
|
629
629
|
function Re(e) {
|
|
630
|
-
return
|
|
630
|
+
return P(we(e));
|
|
631
631
|
}
|
|
632
632
|
const Fe = "register post /account/register";
|
|
633
633
|
function bt(e) {
|
|
634
|
-
const s = g(), t =
|
|
634
|
+
const s = g(), t = Q();
|
|
635
635
|
return h({
|
|
636
636
|
...e,
|
|
637
637
|
mutationFn: async (n) => s.query(Fe, p(n)),
|
|
@@ -643,7 +643,7 @@ function bt(e) {
|
|
|
643
643
|
}
|
|
644
644
|
const Le = "defaultBillingAddress patch /account/address/default-billing/{addressId}";
|
|
645
645
|
function kt(e) {
|
|
646
|
-
const s = g(), t =
|
|
646
|
+
const s = g(), t = Q();
|
|
647
647
|
return h({
|
|
648
648
|
...e,
|
|
649
649
|
mutationFn: async (n) => s.query(Le, p(n)),
|
|
@@ -658,7 +658,7 @@ function kt(e) {
|
|
|
658
658
|
}
|
|
659
659
|
const Ie = "defaultShippingAddress patch /account/address/default-shipping/{addressId}";
|
|
660
660
|
function Bt(e) {
|
|
661
|
-
const s = g(), t =
|
|
661
|
+
const s = g(), t = Q();
|
|
662
662
|
return h({
|
|
663
663
|
...e,
|
|
664
664
|
mutationFn: async (n) => s.query(Ie, p(n)),
|
|
@@ -673,7 +673,7 @@ function Bt(e) {
|
|
|
673
673
|
}
|
|
674
674
|
const xe = "deleteCustomer delete /account/customer";
|
|
675
675
|
function Dt(e) {
|
|
676
|
-
const s = g(), t =
|
|
676
|
+
const s = g(), t = Q();
|
|
677
677
|
return h({
|
|
678
678
|
...e,
|
|
679
679
|
mutationFn: async (n) => s.query(xe, p(n)),
|
|
@@ -731,13 +731,13 @@ function Et(e) {
|
|
|
731
731
|
const Be = "imitateCustomerLogin post /account/login/imitate-customer";
|
|
732
732
|
function De(e) {
|
|
733
733
|
const s = g(), t = L.imitateLogin(c(() => p(e).body ?? {}));
|
|
734
|
-
return
|
|
734
|
+
return S({
|
|
735
735
|
queryKey: t,
|
|
736
736
|
queryFn: async () => s.query(Be, p(e))
|
|
737
737
|
});
|
|
738
738
|
}
|
|
739
739
|
function jt(e) {
|
|
740
|
-
return
|
|
740
|
+
return P(De(e));
|
|
741
741
|
}
|
|
742
742
|
const Ne = "recoveryPassword post /account/recovery-password-confirm";
|
|
743
743
|
function Vt(e) {
|
|
@@ -753,12 +753,12 @@ function Vt(e) {
|
|
|
753
753
|
}
|
|
754
754
|
const Te = "readNavigation post /navigation/{activeId}/{rootId}", Ee = function(s, t, n) {
|
|
755
755
|
const r = g(), a = b.detail(s, t, n);
|
|
756
|
-
return
|
|
756
|
+
return S({
|
|
757
757
|
queryKey: a,
|
|
758
758
|
queryFn: async ({ signal: u }) => {
|
|
759
|
-
const o = i(s), f = i(t),
|
|
759
|
+
const o = i(s), f = i(t), C = p(n);
|
|
760
760
|
return r.query(Te, {
|
|
761
|
-
...
|
|
761
|
+
...C,
|
|
762
762
|
params: {
|
|
763
763
|
activeId: o,
|
|
764
764
|
rootId: f
|
|
@@ -769,7 +769,7 @@ const Te = "readNavigation post /navigation/{activeId}/{rootId}", Ee = function(
|
|
|
769
769
|
});
|
|
770
770
|
};
|
|
771
771
|
function $t(e, s, t) {
|
|
772
|
-
return
|
|
772
|
+
return P(Ee(e, s, t));
|
|
773
773
|
}
|
|
774
774
|
const je = "readPaymentMethod post /payment-method";
|
|
775
775
|
function Ve(e) {
|
|
@@ -777,7 +777,7 @@ function Ve(e) {
|
|
|
777
777
|
var n;
|
|
778
778
|
return (n = p(e)) == null ? void 0 : n.body;
|
|
779
779
|
}));
|
|
780
|
-
return
|
|
780
|
+
return S({
|
|
781
781
|
queryKey: t,
|
|
782
782
|
queryFn: ({ signal: n }) => s.query(je, {
|
|
783
783
|
...p(e),
|
|
@@ -786,23 +786,23 @@ function Ve(e) {
|
|
|
786
786
|
});
|
|
787
787
|
}
|
|
788
788
|
function $e(e) {
|
|
789
|
-
return
|
|
789
|
+
return P(Ve(e));
|
|
790
790
|
}
|
|
791
791
|
const ze = "handlePaymentMethod post /handle-payment";
|
|
792
792
|
function zt(e) {
|
|
793
|
-
const s = g()
|
|
793
|
+
const s = g();
|
|
794
794
|
return h({
|
|
795
795
|
...e,
|
|
796
|
-
mutationFn: async (
|
|
797
|
-
onSuccess: async (n, r
|
|
798
|
-
var
|
|
799
|
-
await
|
|
796
|
+
mutationFn: async (t) => s.query(ze, p(t)),
|
|
797
|
+
onSuccess: async (t, n, r) => {
|
|
798
|
+
var a, u;
|
|
799
|
+
await ((u = i((a = i(e)) == null ? void 0 : a.onSuccess)) == null ? void 0 : u(t, n, r));
|
|
800
800
|
}
|
|
801
801
|
});
|
|
802
802
|
}
|
|
803
803
|
const Ge = "orderSetPayment post /order/payment";
|
|
804
804
|
function Gt(e) {
|
|
805
|
-
const s = g(), t =
|
|
805
|
+
const s = g(), t = Q();
|
|
806
806
|
return h({
|
|
807
807
|
...e,
|
|
808
808
|
mutationFn: async (n) => s.query(Ge, p(n)),
|
|
@@ -814,7 +814,7 @@ function Gt(e) {
|
|
|
814
814
|
}
|
|
815
815
|
const He = "readCategoryList post /category", We = function(s) {
|
|
816
816
|
const t = g(), n = B.list(s);
|
|
817
|
-
return
|
|
817
|
+
return S({
|
|
818
818
|
queryKey: n,
|
|
819
819
|
queryFn: async ({ signal: r }) => t.query(He, {
|
|
820
820
|
...p(s),
|
|
@@ -823,12 +823,12 @@ const He = "readCategoryList post /category", We = function(s) {
|
|
|
823
823
|
});
|
|
824
824
|
};
|
|
825
825
|
function Ht(e) {
|
|
826
|
-
return
|
|
826
|
+
return P(We(e));
|
|
827
827
|
}
|
|
828
828
|
const Je = "readCompactProductListing post /novu/headless/product-listing/{seoUrl}";
|
|
829
829
|
function Xe(e, s) {
|
|
830
830
|
const t = g(), n = w.list(e, s);
|
|
831
|
-
return
|
|
831
|
+
return S({
|
|
832
832
|
queryKey: n,
|
|
833
833
|
queryFn: async ({ signal: r }) => {
|
|
834
834
|
const a = p(s);
|
|
@@ -844,12 +844,12 @@ function Xe(e, s) {
|
|
|
844
844
|
});
|
|
845
845
|
}
|
|
846
846
|
function Wt(e, s) {
|
|
847
|
-
return
|
|
847
|
+
return P(Xe(e, s));
|
|
848
848
|
}
|
|
849
849
|
const Ye = "readCustomProductDetail post /novu/headless/product/{seoUrl}";
|
|
850
850
|
function Ze(e, s) {
|
|
851
851
|
const t = g(), n = w.customDetail(e, s);
|
|
852
|
-
return
|
|
852
|
+
return S({
|
|
853
853
|
queryKey: n,
|
|
854
854
|
queryFn: async ({ signal: r }) => {
|
|
855
855
|
const a = p(s);
|
|
@@ -865,12 +865,12 @@ function Ze(e, s) {
|
|
|
865
865
|
});
|
|
866
866
|
}
|
|
867
867
|
function Jt(e, s) {
|
|
868
|
-
return
|
|
868
|
+
return P(Ze(e, s));
|
|
869
869
|
}
|
|
870
870
|
const _e = "searchPage post /search";
|
|
871
871
|
function et(e) {
|
|
872
872
|
const s = g(), t = w.search(e);
|
|
873
|
-
return
|
|
873
|
+
return S({
|
|
874
874
|
queryKey: t,
|
|
875
875
|
queryFn: async ({ signal: n }) => {
|
|
876
876
|
const r = p(e);
|
|
@@ -882,12 +882,12 @@ function et(e) {
|
|
|
882
882
|
});
|
|
883
883
|
}
|
|
884
884
|
function Xt(e) {
|
|
885
|
-
return
|
|
885
|
+
return P(et(e));
|
|
886
886
|
}
|
|
887
887
|
const tt = "readProduct post /product";
|
|
888
888
|
function nt(e) {
|
|
889
889
|
const s = g(), t = w.detail(e);
|
|
890
|
-
return
|
|
890
|
+
return S({
|
|
891
891
|
queryKey: t,
|
|
892
892
|
queryFn: async ({ signal: n }) => {
|
|
893
893
|
const r = p(e);
|
|
@@ -899,11 +899,11 @@ function nt(e) {
|
|
|
899
899
|
});
|
|
900
900
|
}
|
|
901
901
|
function Yt(e) {
|
|
902
|
-
return
|
|
902
|
+
return P(nt(e));
|
|
903
903
|
}
|
|
904
904
|
const st = "readSalutation post /salutation", rt = function(s) {
|
|
905
905
|
const t = g(), n = E.list(s);
|
|
906
|
-
return
|
|
906
|
+
return S({
|
|
907
907
|
queryKey: n,
|
|
908
908
|
queryFn: async ({ signal: r }) => {
|
|
909
909
|
const a = p(s);
|
|
@@ -915,11 +915,11 @@ const st = "readSalutation post /salutation", rt = function(s) {
|
|
|
915
915
|
});
|
|
916
916
|
};
|
|
917
917
|
function Zt(e) {
|
|
918
|
-
return
|
|
918
|
+
return P(rt(e));
|
|
919
919
|
}
|
|
920
920
|
const at = "readSeoUrl post /seo-url", ut = function(s) {
|
|
921
921
|
const t = g(), n = T.list(s);
|
|
922
|
-
return
|
|
922
|
+
return S({
|
|
923
923
|
queryKey: n,
|
|
924
924
|
queryFn: async ({ signal: r }) => {
|
|
925
925
|
const a = p(s);
|
|
@@ -931,7 +931,7 @@ const at = "readSeoUrl post /seo-url", ut = function(s) {
|
|
|
931
931
|
});
|
|
932
932
|
};
|
|
933
933
|
function _t(e) {
|
|
934
|
-
return
|
|
934
|
+
return P(ut(e));
|
|
935
935
|
}
|
|
936
936
|
const ot = "readShippingMethod post /shipping-method";
|
|
937
937
|
function it(e) {
|
|
@@ -939,7 +939,7 @@ function it(e) {
|
|
|
939
939
|
var n;
|
|
940
940
|
return (n = p(e)) == null ? void 0 : n.body;
|
|
941
941
|
}));
|
|
942
|
-
return
|
|
942
|
+
return S({
|
|
943
943
|
queryKey: t,
|
|
944
944
|
queryFn: ({ signal: n }) => s.query(ot, {
|
|
945
945
|
...p(e),
|
|
@@ -948,7 +948,7 @@ function it(e) {
|
|
|
948
948
|
});
|
|
949
949
|
}
|
|
950
950
|
function ct(e) {
|
|
951
|
-
return
|
|
951
|
+
return P(it(e));
|
|
952
952
|
}
|
|
953
953
|
function en() {
|
|
954
954
|
const e = k(), s = $(), t = $e({
|
|
@@ -961,8 +961,8 @@ function en() {
|
|
|
961
961
|
var o, f;
|
|
962
962
|
return (f = (o = e.data) == null ? void 0 : o.value) == null ? void 0 : f.paymentMethod;
|
|
963
963
|
}), u = c(() => {
|
|
964
|
-
var o, f,
|
|
965
|
-
return ((
|
|
964
|
+
var o, f, C;
|
|
965
|
+
return ((C = (f = (o = t.data) == null ? void 0 : o.value) == null ? void 0 : f.elements) == null ? void 0 : C.sort((d, M) => (d.position ?? 0) - (M.position ?? 0))) ?? [];
|
|
966
966
|
});
|
|
967
967
|
return {
|
|
968
968
|
contextUpdateMutation: s,
|
|
@@ -986,7 +986,7 @@ function tn() {
|
|
|
986
986
|
return (f = (o = e.data) == null ? void 0 : o.value) == null ? void 0 : f.shippingMethod;
|
|
987
987
|
}), u = c(() => {
|
|
988
988
|
var o, f;
|
|
989
|
-
return ((f = (o = t.data) == null ? void 0 : o.value) == null ? void 0 : f.elements.sort((
|
|
989
|
+
return ((f = (o = t.data) == null ? void 0 : o.value) == null ? void 0 : f.elements.sort((C, d) => (C.position ?? 0) - (d.position ?? 0))) ?? [];
|
|
990
990
|
});
|
|
991
991
|
return {
|
|
992
992
|
contextUpdateMutation: s,
|
|
@@ -1036,7 +1036,7 @@ function sn(e) {
|
|
|
1036
1036
|
a.page = Math.min(O, a.page), a.total = y.total ?? 0, a.limit = y.limit;
|
|
1037
1037
|
}
|
|
1038
1038
|
);
|
|
1039
|
-
const f = c(() => a.page === i(u)),
|
|
1039
|
+
const f = c(() => a.page === i(u)), C = c(() => a.page === 1), d = c(() => ({
|
|
1040
1040
|
p: a.page,
|
|
1041
1041
|
limit: a.limit,
|
|
1042
1042
|
"total-count-mode": a.totalCountMode ?? "none"
|
|
@@ -1051,7 +1051,7 @@ function sn(e) {
|
|
|
1051
1051
|
limit: W(a, "limit"),
|
|
1052
1052
|
pageCount: u,
|
|
1053
1053
|
isLastPage: f,
|
|
1054
|
-
isFirstPage:
|
|
1054
|
+
isFirstPage: C,
|
|
1055
1055
|
usePaginationSync: M,
|
|
1056
1056
|
// This can be used to pass the pagination options directly to the query options
|
|
1057
1057
|
queryOptions: d
|
|
@@ -1103,7 +1103,7 @@ function rn(e) {
|
|
|
1103
1103
|
var y;
|
|
1104
1104
|
return (y = u.value) == null ? void 0 : y.totalPrice;
|
|
1105
1105
|
}
|
|
1106
|
-
),
|
|
1106
|
+
), C = c(
|
|
1107
1107
|
() => u.value
|
|
1108
1108
|
), d = c(() => {
|
|
1109
1109
|
var y, v;
|
|
@@ -1115,7 +1115,7 @@ function rn(e) {
|
|
|
1115
1115
|
}
|
|
1116
1116
|
), O = c(() => X(e.value));
|
|
1117
1117
|
return {
|
|
1118
|
-
price:
|
|
1118
|
+
price: C,
|
|
1119
1119
|
totalPrice: f,
|
|
1120
1120
|
unitPrice: o,
|
|
1121
1121
|
displayFromVariants: a,
|
|
@@ -1178,7 +1178,7 @@ function on(e) {
|
|
|
1178
1178
|
var d;
|
|
1179
1179
|
return ((d = t.value) == null ? void 0 : d.defaultBillingAddress) || null;
|
|
1180
1180
|
}
|
|
1181
|
-
),
|
|
1181
|
+
), C = c(
|
|
1182
1182
|
() => {
|
|
1183
1183
|
var d;
|
|
1184
1184
|
return ((d = t.value) == null ? void 0 : d.defaultShippingAddress) || null;
|
|
@@ -1193,7 +1193,7 @@ function on(e) {
|
|
|
1193
1193
|
defaultBillingAddressId: u,
|
|
1194
1194
|
defaultShippingAddressId: o,
|
|
1195
1195
|
userDefaultBillingAddress: f,
|
|
1196
|
-
userDefaultShippingAddress:
|
|
1196
|
+
userDefaultShippingAddress: C,
|
|
1197
1197
|
// Expose queries and mutations directly
|
|
1198
1198
|
customerQuery: s
|
|
1199
1199
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { ShopwareApiError } from '@teamnovu/kit-shopware-api-client';
|
|
2
1
|
import { UseMutationOptions, UseMutationReturnType, MutationObserverIdleResult, MutationObserverLoadingResult, MutationObserverErrorResult, MutationObserverSuccessResult } from '@tanstack/vue-query';
|
|
2
|
+
import { ShopwareApiError } from '@teamnovu/kit-shopware-api-client';
|
|
3
3
|
import { OperationOptions, OperationResponse } from '../types/query';
|
|
4
4
|
declare const handlePaymentOperation = "handlePaymentMethod post /handle-payment";
|
|
5
5
|
export declare function useHandlePaymentMutation(mutationOptions?: UseMutationOptions<OperationResponse<typeof handlePaymentOperation>, ShopwareApiError | Error, OperationOptions<typeof handlePaymentOperation>>): UseMutationReturnType<OperationResponse<"handlePaymentMethod post /handle-payment">, Error | ShopwareApiError, OperationOptions<"handlePaymentMethod post /handle-payment">, unknown, Omit< MutationObserverIdleResult<OperationResponse<"handlePaymentMethod post /handle-payment">, Error | ShopwareApiError, OperationOptions<"handlePaymentMethod post /handle-payment">, unknown>, "mutate" | "reset"> | Omit< MutationObserverLoadingResult<OperationResponse<"handlePaymentMethod post /handle-payment">, Error | ShopwareApiError, OperationOptions<"handlePaymentMethod post /handle-payment">, unknown>, "mutate" | "reset"> | Omit< MutationObserverErrorResult<OperationResponse<"handlePaymentMethod post /handle-payment">, Error | ShopwareApiError, OperationOptions<"handlePaymentMethod post /handle-payment">, unknown>, "mutate" | "reset"> | Omit< MutationObserverSuccessResult<OperationResponse<"handlePaymentMethod post /handle-payment">, Error | ShopwareApiError, OperationOptions<"handlePaymentMethod post /handle-payment">, unknown>, "mutate" | "reset">>;
|
package/package.json
CHANGED
|
@@ -1,10 +1,9 @@
|
|
|
1
|
+
import { useMutation, type UseMutationOptions } from '@tanstack/vue-query'
|
|
1
2
|
import { ShopwareApiError } from '@teamnovu/kit-shopware-api-client'
|
|
2
|
-
import { useMutation, useQueryClient, type UseMutationOptions } from '@tanstack/vue-query'
|
|
3
3
|
import { unref } from 'vue'
|
|
4
|
-
import type { OperationKey, OperationOptions, OperationResponse } from '../types/query'
|
|
5
4
|
import { useShopwareQueryClient } from '../../inject'
|
|
6
5
|
import { unrefOptions } from '../../util/unrefOptions'
|
|
7
|
-
import {
|
|
6
|
+
import type { OperationKey, OperationOptions, OperationResponse } from '../types/query'
|
|
8
7
|
|
|
9
8
|
const handlePaymentOperation = 'handlePaymentMethod post /handle-payment' satisfies OperationKey
|
|
10
9
|
|
|
@@ -16,7 +15,6 @@ export function useHandlePaymentMutation(
|
|
|
16
15
|
>,
|
|
17
16
|
) {
|
|
18
17
|
const client = useShopwareQueryClient()
|
|
19
|
-
const queryClient = useQueryClient()
|
|
20
18
|
|
|
21
19
|
return useMutation({
|
|
22
20
|
...mutationOptions,
|
|
@@ -24,8 +22,6 @@ export function useHandlePaymentMutation(
|
|
|
24
22
|
return client.query(handlePaymentOperation, unrefOptions(options))
|
|
25
23
|
},
|
|
26
24
|
onSuccess: async (data, variables, context) => {
|
|
27
|
-
await queryClient.invalidateQueries({ queryKey: cartKeys.get() })
|
|
28
|
-
|
|
29
25
|
await unref(unref(mutationOptions)?.onSuccess)?.(data, variables, context)
|
|
30
26
|
},
|
|
31
27
|
})
|