@teamnovu/kit-shopware-composables 0.0.16 → 0.0.17
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 +214 -200
- package/dist/keys.d.ts +3 -0
- package/dist/query/customer/index.d.ts +1 -0
- package/dist/query/customer/useImitateCustomerLoginQuery.d.ts +17 -0
- package/package.json +2 -2
- package/src/keys.ts +1 -0
- package/src/query/customer/index.ts +1 -0
- package/src/query/customer/useImitateCustomerLoginQuery.ts +28 -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
|
|
3
|
+
import { queryOptions as P, useQuery as Q, useQueryClient as C, useMutation as v } from "@tanstack/vue-query";
|
|
4
4
|
import "@teamnovu/kit-shopware-api-client";
|
|
5
5
|
const _ = Symbol("shopwareClient");
|
|
6
6
|
function g() {
|
|
@@ -80,7 +80,8 @@ const F = {
|
|
|
80
80
|
get: () => ["cart"]
|
|
81
81
|
}, L = {
|
|
82
82
|
all: () => ["customer"],
|
|
83
|
-
detail: (e) => ["customer", { body: e }]
|
|
83
|
+
detail: (e) => ["customer", { body: e }],
|
|
84
|
+
imitateLogin: (e) => ["customer", "imitateLogin", { body: e }]
|
|
84
85
|
}, R = {
|
|
85
86
|
all: () => ["address"],
|
|
86
87
|
lists: () => [...R.all(), "list"],
|
|
@@ -169,7 +170,7 @@ function ne(e) {
|
|
|
169
170
|
var n;
|
|
170
171
|
return (n = p(e)) == null ? void 0 : n.body;
|
|
171
172
|
}));
|
|
172
|
-
return
|
|
173
|
+
return P({
|
|
173
174
|
queryKey: t,
|
|
174
175
|
queryFn: ({ signal: n }) => s.query(te, {
|
|
175
176
|
...p(e),
|
|
@@ -178,13 +179,13 @@ function ne(e) {
|
|
|
178
179
|
});
|
|
179
180
|
}
|
|
180
181
|
function se(e) {
|
|
181
|
-
return
|
|
182
|
+
return Q(ne(e));
|
|
182
183
|
}
|
|
183
184
|
const V = (e) => {
|
|
184
185
|
const s = e.replace(/\/?$/, "");
|
|
185
186
|
return s.startsWith("/") ? s.slice(1) : s;
|
|
186
|
-
},
|
|
187
|
-
function
|
|
187
|
+
}, ft = (e) => `/${V(e)}`;
|
|
188
|
+
function vt(e, s, t) {
|
|
188
189
|
const n = C();
|
|
189
190
|
return {
|
|
190
191
|
onMutate: async (r) => {
|
|
@@ -213,7 +214,7 @@ function mt(e, s, t) {
|
|
|
213
214
|
const re = "readContext get /context";
|
|
214
215
|
function ae(e) {
|
|
215
216
|
const s = g();
|
|
216
|
-
return
|
|
217
|
+
return P({
|
|
217
218
|
queryKey: F.all(),
|
|
218
219
|
queryFn: ({ signal: t }) => s.query(re, {
|
|
219
220
|
...p(e),
|
|
@@ -222,7 +223,7 @@ function ae(e) {
|
|
|
222
223
|
});
|
|
223
224
|
}
|
|
224
225
|
function k(e) {
|
|
225
|
-
return
|
|
226
|
+
return Q(ae(e));
|
|
226
227
|
}
|
|
227
228
|
const ue = "updateContext patch /context";
|
|
228
229
|
function $(e) {
|
|
@@ -238,7 +239,7 @@ function $(e) {
|
|
|
238
239
|
}
|
|
239
240
|
});
|
|
240
241
|
}
|
|
241
|
-
function
|
|
242
|
+
function ht() {
|
|
242
243
|
const e = $(), s = k(), t = se(), n = c(() => s.isFetching.value || e.isPending.value), r = async (d) => {
|
|
243
244
|
await e.mutateAsync({
|
|
244
245
|
billingAddressId: d.id
|
|
@@ -248,25 +249,25 @@ function ft() {
|
|
|
248
249
|
shippingAddressId: d.id
|
|
249
250
|
}), await J(n).toBe(!1);
|
|
250
251
|
}, u = c(() => {
|
|
251
|
-
var d,
|
|
252
|
-
return (
|
|
252
|
+
var d, M;
|
|
253
|
+
return (M = (d = s.data.value) == null ? void 0 : d.customer) == null ? void 0 : M.activeBillingAddress;
|
|
253
254
|
}), o = c(() => {
|
|
254
|
-
var d,
|
|
255
|
-
return (
|
|
255
|
+
var d, M;
|
|
256
|
+
return (M = (d = s.data.value) == null ? void 0 : d.customer) == null ? void 0 : M.activeShippingAddress;
|
|
256
257
|
}), f = c(() => {
|
|
257
258
|
var d;
|
|
258
259
|
return ((d = t.data.value) == null ? void 0 : d.elements.filter(
|
|
259
|
-
(
|
|
260
|
+
(M) => {
|
|
260
261
|
var O;
|
|
261
|
-
return
|
|
262
|
+
return M.id !== ((O = u.value) == null ? void 0 : O.id);
|
|
262
263
|
}
|
|
263
264
|
)) ?? [];
|
|
264
265
|
}), S = c(() => {
|
|
265
266
|
var d;
|
|
266
267
|
return ((d = t.data.value) == null ? void 0 : d.elements.filter(
|
|
267
|
-
(
|
|
268
|
+
(M) => {
|
|
268
269
|
var O;
|
|
269
|
-
return
|
|
270
|
+
return M.id !== ((O = o.value) == null ? void 0 : O.id);
|
|
270
271
|
}
|
|
271
272
|
)) ?? [];
|
|
272
273
|
});
|
|
@@ -286,7 +287,7 @@ function ft() {
|
|
|
286
287
|
const oe = "readOrder post /order";
|
|
287
288
|
function ie(e) {
|
|
288
289
|
const s = g(), t = U.detail(e);
|
|
289
|
-
return
|
|
290
|
+
return P({
|
|
290
291
|
queryKey: t,
|
|
291
292
|
queryFn: async ({ signal: n }) => {
|
|
292
293
|
const r = p(e);
|
|
@@ -298,9 +299,9 @@ function ie(e) {
|
|
|
298
299
|
});
|
|
299
300
|
}
|
|
300
301
|
function ce(e) {
|
|
301
|
-
return
|
|
302
|
+
return Q(ie(e));
|
|
302
303
|
}
|
|
303
|
-
function
|
|
304
|
+
function qt(e, s) {
|
|
304
305
|
const t = c(() => {
|
|
305
306
|
const l = i(e);
|
|
306
307
|
if (l)
|
|
@@ -338,7 +339,7 @@ function vt(e, s) {
|
|
|
338
339
|
}), d = c(() => {
|
|
339
340
|
var l;
|
|
340
341
|
return (l = r.value) == null ? void 0 : l.shippingTotal;
|
|
341
|
-
}),
|
|
342
|
+
}), M = c(() => {
|
|
342
343
|
var l, m, q, x, z, G;
|
|
343
344
|
return {
|
|
344
345
|
email: (m = (l = r.value) == null ? void 0 : l.orderCustomer) == null ? void 0 : m.email,
|
|
@@ -382,14 +383,14 @@ function vt(e, s) {
|
|
|
382
383
|
shippingCosts: d,
|
|
383
384
|
shippingAddress: y,
|
|
384
385
|
billingAddress: O,
|
|
385
|
-
personalDetails:
|
|
386
|
+
personalDetails: M,
|
|
386
387
|
shippingMethod: K,
|
|
387
388
|
paymentMethod: h,
|
|
388
389
|
paymentChangeable: A,
|
|
389
390
|
orderQuery: n
|
|
390
391
|
};
|
|
391
392
|
}
|
|
392
|
-
function
|
|
393
|
+
function Ct(e) {
|
|
393
394
|
const s = c(() => {
|
|
394
395
|
var r, a;
|
|
395
396
|
return (a = (r = i(e)) == null ? void 0 : r.transactions) == null ? void 0 : a.find((u) => {
|
|
@@ -410,7 +411,7 @@ function ht(e) {
|
|
|
410
411
|
};
|
|
411
412
|
}
|
|
412
413
|
const le = "createCustomerAddress post /account/address";
|
|
413
|
-
function
|
|
414
|
+
function St(e) {
|
|
414
415
|
const s = g(), t = C();
|
|
415
416
|
return v({
|
|
416
417
|
...e,
|
|
@@ -422,7 +423,7 @@ function qt(e) {
|
|
|
422
423
|
});
|
|
423
424
|
}
|
|
424
425
|
const de = "deleteCustomerAddress delete /account/address/{addressId}";
|
|
425
|
-
function
|
|
426
|
+
function Pt(e) {
|
|
426
427
|
const s = g(), t = C();
|
|
427
428
|
return v({
|
|
428
429
|
...e,
|
|
@@ -434,7 +435,7 @@ function Ct(e) {
|
|
|
434
435
|
});
|
|
435
436
|
}
|
|
436
437
|
const ye = "updateCustomerAddress patch /account/address/{addressId}";
|
|
437
|
-
function
|
|
438
|
+
function Qt(e) {
|
|
438
439
|
const s = g(), t = C();
|
|
439
440
|
return v({
|
|
440
441
|
...e,
|
|
@@ -453,7 +454,7 @@ function St(e) {
|
|
|
453
454
|
});
|
|
454
455
|
}
|
|
455
456
|
const pe = "addLineItem post /checkout/cart/line-item";
|
|
456
|
-
function
|
|
457
|
+
function Mt(e) {
|
|
457
458
|
const s = g(), t = C();
|
|
458
459
|
return v({
|
|
459
460
|
...e,
|
|
@@ -469,7 +470,7 @@ function Pt(e) {
|
|
|
469
470
|
const ge = "readCart get /checkout/cart";
|
|
470
471
|
function me(e) {
|
|
471
472
|
const s = g(), t = I.get();
|
|
472
|
-
return
|
|
473
|
+
return P({
|
|
473
474
|
queryKey: t,
|
|
474
475
|
queryFn: async ({ signal: n }) => s.query(ge, {
|
|
475
476
|
...p(e),
|
|
@@ -477,11 +478,11 @@ function me(e) {
|
|
|
477
478
|
})
|
|
478
479
|
});
|
|
479
480
|
}
|
|
480
|
-
function
|
|
481
|
-
return
|
|
481
|
+
function Ot() {
|
|
482
|
+
return Q(me());
|
|
482
483
|
}
|
|
483
484
|
const fe = "removeLineItem post /checkout/cart/line-item/delete";
|
|
484
|
-
function
|
|
485
|
+
function Kt(e) {
|
|
485
486
|
const s = g(), t = C();
|
|
486
487
|
return v({
|
|
487
488
|
...e,
|
|
@@ -495,7 +496,7 @@ function Mt(e) {
|
|
|
495
496
|
});
|
|
496
497
|
}
|
|
497
498
|
const ve = "updateLineItem patch /checkout/cart/line-item";
|
|
498
|
-
function
|
|
499
|
+
function At(e) {
|
|
499
500
|
const s = g(), t = C();
|
|
500
501
|
return v({
|
|
501
502
|
...e,
|
|
@@ -509,7 +510,7 @@ function Ot(e) {
|
|
|
509
510
|
});
|
|
510
511
|
}
|
|
511
512
|
const he = "createOrder post /checkout/order";
|
|
512
|
-
function
|
|
513
|
+
function wt(e) {
|
|
513
514
|
const s = g(), t = C();
|
|
514
515
|
return v({
|
|
515
516
|
...e,
|
|
@@ -528,7 +529,7 @@ function Kt(e) {
|
|
|
528
529
|
const qe = "readLanguages post /language";
|
|
529
530
|
function Ce(e) {
|
|
530
531
|
const s = g();
|
|
531
|
-
return
|
|
532
|
+
return P({
|
|
532
533
|
queryKey: ee.all(),
|
|
533
534
|
queryFn: ({ signal: t }) => s.query(qe, {
|
|
534
535
|
...p(e),
|
|
@@ -536,12 +537,12 @@ function Ce(e) {
|
|
|
536
537
|
})
|
|
537
538
|
});
|
|
538
539
|
}
|
|
539
|
-
function
|
|
540
|
-
return
|
|
540
|
+
function Rt(e) {
|
|
541
|
+
return Q(Ce(e));
|
|
541
542
|
}
|
|
542
543
|
const Se = "readCountry post /country", Pe = function(s) {
|
|
543
544
|
const t = g(), n = j.list(s);
|
|
544
|
-
return
|
|
545
|
+
return P({
|
|
545
546
|
queryKey: n,
|
|
546
547
|
queryFn: async ({ signal: r }) => {
|
|
547
548
|
const a = p(s);
|
|
@@ -552,11 +553,11 @@ const Se = "readCountry post /country", Pe = function(s) {
|
|
|
552
553
|
}
|
|
553
554
|
});
|
|
554
555
|
};
|
|
555
|
-
function
|
|
556
|
-
return
|
|
556
|
+
function Ft(e) {
|
|
557
|
+
return Q(Pe(e));
|
|
557
558
|
}
|
|
558
559
|
const Qe = "changeEmail post /account/change-email";
|
|
559
|
-
function
|
|
560
|
+
function Lt(e) {
|
|
560
561
|
const s = g(), t = C();
|
|
561
562
|
return v({
|
|
562
563
|
...e,
|
|
@@ -568,7 +569,7 @@ function Rt(e) {
|
|
|
568
569
|
});
|
|
569
570
|
}
|
|
570
571
|
const Me = "changeProfile post /account/change-profile";
|
|
571
|
-
function
|
|
572
|
+
function It(e) {
|
|
572
573
|
const s = g(), t = C();
|
|
573
574
|
return v({
|
|
574
575
|
...e,
|
|
@@ -583,7 +584,7 @@ function Ft(e) {
|
|
|
583
584
|
});
|
|
584
585
|
}
|
|
585
586
|
const Oe = "loginCustomer post /account/login";
|
|
586
|
-
function
|
|
587
|
+
function xt(e) {
|
|
587
588
|
const s = g(), t = C();
|
|
588
589
|
return v({
|
|
589
590
|
...e,
|
|
@@ -604,7 +605,7 @@ function It(e) {
|
|
|
604
605
|
});
|
|
605
606
|
}
|
|
606
607
|
const Ke = "logoutCustomer post /account/logout";
|
|
607
|
-
function
|
|
608
|
+
function Ut(e) {
|
|
608
609
|
const s = g(), t = C();
|
|
609
610
|
return v({
|
|
610
611
|
...e,
|
|
@@ -622,16 +623,16 @@ function Lt(e) {
|
|
|
622
623
|
const Ae = "readCustomer post /account/customer";
|
|
623
624
|
function we(e) {
|
|
624
625
|
const s = g(), t = L.detail(c(() => p(e).body ?? {}));
|
|
625
|
-
return
|
|
626
|
+
return P({
|
|
626
627
|
queryKey: t,
|
|
627
628
|
queryFn: async () => s.query(Ae, p(e))
|
|
628
629
|
});
|
|
629
630
|
}
|
|
630
631
|
function Re(e) {
|
|
631
|
-
return
|
|
632
|
+
return Q(we(e));
|
|
632
633
|
}
|
|
633
634
|
const Fe = "register post /account/register";
|
|
634
|
-
function
|
|
635
|
+
function bt(e) {
|
|
635
636
|
const s = g(), t = C();
|
|
636
637
|
return v({
|
|
637
638
|
...e,
|
|
@@ -642,12 +643,12 @@ function xt(e) {
|
|
|
642
643
|
}
|
|
643
644
|
});
|
|
644
645
|
}
|
|
645
|
-
const
|
|
646
|
-
function
|
|
646
|
+
const Le = "defaultBillingAddress patch /account/address/default-billing/{addressId}";
|
|
647
|
+
function kt(e) {
|
|
647
648
|
const s = g(), t = C();
|
|
648
649
|
return v({
|
|
649
650
|
...e,
|
|
650
|
-
mutationFn: async (n) => s.query(
|
|
651
|
+
mutationFn: async (n) => s.query(Le, p(n)),
|
|
651
652
|
onSuccess: async (n, r, a) => {
|
|
652
653
|
var u, o;
|
|
653
654
|
await Promise.all([
|
|
@@ -657,12 +658,12 @@ function Ut(e) {
|
|
|
657
658
|
}
|
|
658
659
|
});
|
|
659
660
|
}
|
|
660
|
-
const
|
|
661
|
-
function
|
|
661
|
+
const Ie = "defaultShippingAddress patch /account/address/default-shipping/{addressId}";
|
|
662
|
+
function Bt(e) {
|
|
662
663
|
const s = g(), t = C();
|
|
663
664
|
return v({
|
|
664
665
|
...e,
|
|
665
|
-
mutationFn: async (n) => s.query(
|
|
666
|
+
mutationFn: async (n) => s.query(Ie, p(n)),
|
|
666
667
|
onSuccess: async (n, r, a) => {
|
|
667
668
|
var u, o;
|
|
668
669
|
await Promise.all([
|
|
@@ -673,7 +674,7 @@ function bt(e) {
|
|
|
673
674
|
});
|
|
674
675
|
}
|
|
675
676
|
const xe = "deleteCustomer delete /account/customer";
|
|
676
|
-
function
|
|
677
|
+
function Dt(e) {
|
|
677
678
|
const s = g(), t = C();
|
|
678
679
|
return v({
|
|
679
680
|
...e,
|
|
@@ -689,7 +690,7 @@ function kt(e) {
|
|
|
689
690
|
});
|
|
690
691
|
}
|
|
691
692
|
const Ue = "registerConfirm post /account/register-confirm";
|
|
692
|
-
function
|
|
693
|
+
function Nt(e) {
|
|
693
694
|
const s = g();
|
|
694
695
|
return v({
|
|
695
696
|
...e,
|
|
@@ -706,7 +707,7 @@ function Bt(e) {
|
|
|
706
707
|
});
|
|
707
708
|
}
|
|
708
709
|
const be = "sendRecoveryMail post /account/recovery-password";
|
|
709
|
-
function
|
|
710
|
+
function Tt(e) {
|
|
710
711
|
const s = g();
|
|
711
712
|
return v({
|
|
712
713
|
...e,
|
|
@@ -718,7 +719,7 @@ function Dt(e) {
|
|
|
718
719
|
});
|
|
719
720
|
}
|
|
720
721
|
const ke = "changePassword post /account/change-password";
|
|
721
|
-
function
|
|
722
|
+
function Et(e) {
|
|
722
723
|
const s = g();
|
|
723
724
|
return v({
|
|
724
725
|
...e,
|
|
@@ -729,25 +730,36 @@ function Nt(e) {
|
|
|
729
730
|
}
|
|
730
731
|
});
|
|
731
732
|
}
|
|
732
|
-
const Be = "
|
|
733
|
-
function
|
|
733
|
+
const Be = "imitateCustomerLogin post /account/login/imitate-customer";
|
|
734
|
+
function De(e) {
|
|
735
|
+
const s = g(), t = L.imitateLogin(c(() => p(e).body ?? {}));
|
|
736
|
+
return P({
|
|
737
|
+
queryKey: t,
|
|
738
|
+
queryFn: async () => s.query(Be, p(e))
|
|
739
|
+
});
|
|
740
|
+
}
|
|
741
|
+
function jt(e) {
|
|
742
|
+
return Q(De(e));
|
|
743
|
+
}
|
|
744
|
+
const Ne = "recoveryPassword post /account/recovery-password-confirm";
|
|
745
|
+
function Vt(e) {
|
|
734
746
|
const s = g();
|
|
735
747
|
return v({
|
|
736
748
|
...e,
|
|
737
|
-
mutationFn: async (t) => s.query(
|
|
749
|
+
mutationFn: async (t) => s.query(Ne, p(t)),
|
|
738
750
|
onSuccess: async (t, n, r) => {
|
|
739
751
|
var a, u;
|
|
740
752
|
await ((u = i((a = i(e)) == null ? void 0 : a.onSuccess)) == null ? void 0 : u(t, n, r));
|
|
741
753
|
}
|
|
742
754
|
});
|
|
743
755
|
}
|
|
744
|
-
const
|
|
756
|
+
const Te = "readNavigation post /navigation/{activeId}/{rootId}", Ee = function(s, t, n) {
|
|
745
757
|
const r = g(), a = b.detail(s, t, n);
|
|
746
|
-
return
|
|
758
|
+
return P({
|
|
747
759
|
queryKey: a,
|
|
748
760
|
queryFn: async ({ signal: u }) => {
|
|
749
761
|
const o = i(s), f = i(t), S = p(n);
|
|
750
|
-
return r.query(
|
|
762
|
+
return r.query(Te, {
|
|
751
763
|
...S,
|
|
752
764
|
params: {
|
|
753
765
|
activeId: o,
|
|
@@ -758,71 +770,71 @@ const De = "readNavigation post /navigation/{activeId}/{rootId}", Ne = function(
|
|
|
758
770
|
}
|
|
759
771
|
});
|
|
760
772
|
};
|
|
761
|
-
function
|
|
762
|
-
return
|
|
773
|
+
function $t(e, s, t) {
|
|
774
|
+
return Q(Ee(e, s, t));
|
|
763
775
|
}
|
|
764
|
-
const
|
|
765
|
-
function
|
|
776
|
+
const je = "readPaymentMethod post /payment-method";
|
|
777
|
+
function Ve(e) {
|
|
766
778
|
const s = g(), t = N.list(c(() => {
|
|
767
779
|
var n;
|
|
768
780
|
return (n = p(e)) == null ? void 0 : n.body;
|
|
769
781
|
}));
|
|
770
|
-
return
|
|
782
|
+
return P({
|
|
771
783
|
queryKey: t,
|
|
772
|
-
queryFn: ({ signal: n }) => s.query(
|
|
784
|
+
queryFn: ({ signal: n }) => s.query(je, {
|
|
773
785
|
...p(e),
|
|
774
786
|
signal: n
|
|
775
787
|
})
|
|
776
788
|
});
|
|
777
789
|
}
|
|
778
|
-
function
|
|
779
|
-
return
|
|
790
|
+
function $e(e) {
|
|
791
|
+
return Q(Ve(e));
|
|
780
792
|
}
|
|
781
|
-
const
|
|
782
|
-
function
|
|
793
|
+
const ze = "handlePaymentMethod post /handle-payment";
|
|
794
|
+
function zt(e) {
|
|
783
795
|
const s = g(), t = C();
|
|
784
796
|
return v({
|
|
785
797
|
...e,
|
|
786
|
-
mutationFn: async (n) => s.query(
|
|
798
|
+
mutationFn: async (n) => s.query(ze, p(n)),
|
|
787
799
|
onSuccess: async (n, r, a) => {
|
|
788
800
|
var u, o;
|
|
789
801
|
await t.invalidateQueries({ queryKey: I.get() }), await ((o = i((u = i(e)) == null ? void 0 : u.onSuccess)) == null ? void 0 : o(n, r, a));
|
|
790
802
|
}
|
|
791
803
|
});
|
|
792
804
|
}
|
|
793
|
-
const
|
|
794
|
-
function
|
|
805
|
+
const Ge = "orderSetPayment post /order/payment";
|
|
806
|
+
function Gt(e) {
|
|
795
807
|
const s = g(), t = C();
|
|
796
808
|
return v({
|
|
797
809
|
...e,
|
|
798
|
-
mutationFn: async (n) => s.query(
|
|
810
|
+
mutationFn: async (n) => s.query(Ge, p(n)),
|
|
799
811
|
onSuccess: async (n, r, a) => {
|
|
800
812
|
var u, o;
|
|
801
813
|
await t.invalidateQueries({ queryKey: U.all() }), await ((o = i((u = i(e)) == null ? void 0 : u.onSuccess)) == null ? void 0 : o(n, r, a));
|
|
802
814
|
}
|
|
803
815
|
});
|
|
804
816
|
}
|
|
805
|
-
const
|
|
817
|
+
const He = "readCategoryList post /category", We = function(s) {
|
|
806
818
|
const t = g(), n = B.list(s);
|
|
807
|
-
return
|
|
819
|
+
return P({
|
|
808
820
|
queryKey: n,
|
|
809
|
-
queryFn: async ({ signal: r }) => t.query(
|
|
821
|
+
queryFn: async ({ signal: r }) => t.query(He, {
|
|
810
822
|
...p(s),
|
|
811
823
|
signal: r
|
|
812
824
|
})
|
|
813
825
|
});
|
|
814
826
|
};
|
|
815
|
-
function
|
|
816
|
-
return
|
|
827
|
+
function Ht(e) {
|
|
828
|
+
return Q(We(e));
|
|
817
829
|
}
|
|
818
|
-
const
|
|
819
|
-
function
|
|
830
|
+
const Je = "readCompactProductListing post /novu/headless/product-listing/{seoUrl}";
|
|
831
|
+
function Xe(e, s) {
|
|
820
832
|
const t = g(), n = w.list(e, s);
|
|
821
|
-
return
|
|
833
|
+
return P({
|
|
822
834
|
queryKey: n,
|
|
823
835
|
queryFn: async ({ signal: r }) => {
|
|
824
836
|
const a = p(s);
|
|
825
|
-
return t.query(
|
|
837
|
+
return t.query(Je, {
|
|
826
838
|
...a,
|
|
827
839
|
params: {
|
|
828
840
|
...a.params,
|
|
@@ -833,17 +845,17 @@ function We(e, s) {
|
|
|
833
845
|
}
|
|
834
846
|
});
|
|
835
847
|
}
|
|
836
|
-
function
|
|
837
|
-
return
|
|
848
|
+
function Wt(e, s) {
|
|
849
|
+
return Q(Xe(e, s));
|
|
838
850
|
}
|
|
839
|
-
const
|
|
840
|
-
function
|
|
851
|
+
const Ye = "readCustomProductDetail post /novu/headless/product/{seoUrl}";
|
|
852
|
+
function Ze(e, s) {
|
|
841
853
|
const t = g(), n = w.customDetail(e, s);
|
|
842
|
-
return
|
|
854
|
+
return P({
|
|
843
855
|
queryKey: n,
|
|
844
856
|
queryFn: async ({ signal: r }) => {
|
|
845
857
|
const a = p(s);
|
|
846
|
-
return t.query(
|
|
858
|
+
return t.query(Ye, {
|
|
847
859
|
...a,
|
|
848
860
|
params: {
|
|
849
861
|
...a.params,
|
|
@@ -854,94 +866,94 @@ function Xe(e, s) {
|
|
|
854
866
|
}
|
|
855
867
|
});
|
|
856
868
|
}
|
|
857
|
-
function
|
|
858
|
-
return
|
|
869
|
+
function Jt(e, s) {
|
|
870
|
+
return Q(Ze(e, s));
|
|
859
871
|
}
|
|
860
|
-
const
|
|
861
|
-
function
|
|
872
|
+
const _e = "searchPage post /search";
|
|
873
|
+
function et(e) {
|
|
862
874
|
const s = g(), t = w.search(e);
|
|
863
|
-
return
|
|
875
|
+
return P({
|
|
864
876
|
queryKey: t,
|
|
865
877
|
queryFn: async ({ signal: n }) => {
|
|
866
878
|
const r = p(e);
|
|
867
|
-
return s.query(
|
|
879
|
+
return s.query(_e, {
|
|
868
880
|
...r,
|
|
869
881
|
signal: n
|
|
870
882
|
});
|
|
871
883
|
}
|
|
872
884
|
});
|
|
873
885
|
}
|
|
874
|
-
function
|
|
875
|
-
return
|
|
886
|
+
function Xt(e) {
|
|
887
|
+
return Q(et(e));
|
|
876
888
|
}
|
|
877
|
-
const
|
|
878
|
-
function
|
|
889
|
+
const tt = "readProduct post /product";
|
|
890
|
+
function nt(e) {
|
|
879
891
|
const s = g(), t = w.detail(e);
|
|
880
|
-
return
|
|
892
|
+
return P({
|
|
881
893
|
queryKey: t,
|
|
882
894
|
queryFn: async ({ signal: n }) => {
|
|
883
895
|
const r = p(e);
|
|
884
|
-
return s.query(
|
|
896
|
+
return s.query(tt, {
|
|
885
897
|
...r,
|
|
886
898
|
signal: n
|
|
887
899
|
});
|
|
888
900
|
}
|
|
889
901
|
});
|
|
890
902
|
}
|
|
891
|
-
function
|
|
892
|
-
return
|
|
903
|
+
function Yt(e) {
|
|
904
|
+
return Q(nt(e));
|
|
893
905
|
}
|
|
894
|
-
const
|
|
906
|
+
const st = "readSalutation post /salutation", rt = function(s) {
|
|
895
907
|
const t = g(), n = E.list(s);
|
|
896
|
-
return
|
|
908
|
+
return P({
|
|
897
909
|
queryKey: n,
|
|
898
910
|
queryFn: async ({ signal: r }) => {
|
|
899
911
|
const a = p(s);
|
|
900
|
-
return t.query(
|
|
912
|
+
return t.query(st, {
|
|
901
913
|
...a,
|
|
902
914
|
signal: r
|
|
903
915
|
});
|
|
904
916
|
}
|
|
905
917
|
});
|
|
906
918
|
};
|
|
907
|
-
function
|
|
908
|
-
return
|
|
919
|
+
function Zt(e) {
|
|
920
|
+
return Q(rt(e));
|
|
909
921
|
}
|
|
910
|
-
const
|
|
922
|
+
const at = "readSeoUrl post /seo-url", ut = function(s) {
|
|
911
923
|
const t = g(), n = T.list(s);
|
|
912
|
-
return
|
|
924
|
+
return P({
|
|
913
925
|
queryKey: n,
|
|
914
926
|
queryFn: async ({ signal: r }) => {
|
|
915
927
|
const a = p(s);
|
|
916
|
-
return t.query(
|
|
928
|
+
return t.query(at, {
|
|
917
929
|
...a,
|
|
918
930
|
signal: r
|
|
919
931
|
});
|
|
920
932
|
}
|
|
921
933
|
});
|
|
922
934
|
};
|
|
923
|
-
function
|
|
924
|
-
return
|
|
935
|
+
function _t(e) {
|
|
936
|
+
return Q(ut(e));
|
|
925
937
|
}
|
|
926
|
-
const
|
|
927
|
-
function
|
|
938
|
+
const ot = "readShippingMethod post /shipping-method";
|
|
939
|
+
function it(e) {
|
|
928
940
|
const s = g(), t = D.list(c(() => {
|
|
929
941
|
var n;
|
|
930
942
|
return (n = p(e)) == null ? void 0 : n.body;
|
|
931
943
|
}));
|
|
932
|
-
return
|
|
944
|
+
return P({
|
|
933
945
|
queryKey: t,
|
|
934
|
-
queryFn: ({ signal: n }) => s.query(
|
|
946
|
+
queryFn: ({ signal: n }) => s.query(ot, {
|
|
935
947
|
...p(e),
|
|
936
948
|
signal: n
|
|
937
949
|
})
|
|
938
950
|
});
|
|
939
951
|
}
|
|
940
|
-
function
|
|
941
|
-
return
|
|
952
|
+
function ct(e) {
|
|
953
|
+
return Q(it(e));
|
|
942
954
|
}
|
|
943
|
-
function
|
|
944
|
-
const e = k(), s = $(), t =
|
|
955
|
+
function en() {
|
|
956
|
+
const e = k(), s = $(), t = $e({
|
|
945
957
|
query: {
|
|
946
958
|
onlyAvailable: !0
|
|
947
959
|
}
|
|
@@ -952,7 +964,7 @@ function Yt() {
|
|
|
952
964
|
return (f = (o = e.data) == null ? void 0 : o.value) == null ? void 0 : f.paymentMethod;
|
|
953
965
|
}), u = c(() => {
|
|
954
966
|
var o, f, S;
|
|
955
|
-
return ((S = (f = (o = t.data) == null ? void 0 : o.value) == null ? void 0 : f.elements) == null ? void 0 : S.sort((d,
|
|
967
|
+
return ((S = (f = (o = t.data) == null ? void 0 : o.value) == null ? void 0 : f.elements) == null ? void 0 : S.sort((d, M) => (d.position ?? 0) - (M.position ?? 0))) ?? [];
|
|
956
968
|
});
|
|
957
969
|
return {
|
|
958
970
|
contextUpdateMutation: s,
|
|
@@ -964,8 +976,8 @@ function Yt() {
|
|
|
964
976
|
paymentMethods: u
|
|
965
977
|
};
|
|
966
978
|
}
|
|
967
|
-
function
|
|
968
|
-
const e = k(), s = $(), t =
|
|
979
|
+
function tn() {
|
|
980
|
+
const e = k(), s = $(), t = ct({
|
|
969
981
|
query: {
|
|
970
982
|
onlyAvailable: !0
|
|
971
983
|
}
|
|
@@ -988,7 +1000,7 @@ function Zt() {
|
|
|
988
1000
|
shippingMethods: u
|
|
989
1001
|
};
|
|
990
1002
|
}
|
|
991
|
-
const
|
|
1003
|
+
const lt = (e, s) => {
|
|
992
1004
|
var n;
|
|
993
1005
|
const t = (n = e == null ? void 0 : e.extensions) == null ? void 0 : n.novuSeoUrls;
|
|
994
1006
|
if (Array.isArray(s)) {
|
|
@@ -996,17 +1008,17 @@ const it = (e, s) => {
|
|
|
996
1008
|
return r ? (t == null ? void 0 : t[r]) ?? "" : "";
|
|
997
1009
|
}
|
|
998
1010
|
return (t == null ? void 0 : t[s]) ?? "";
|
|
999
|
-
},
|
|
1011
|
+
}, nn = () => {
|
|
1000
1012
|
const e = k(), s = c(() => {
|
|
1001
1013
|
var t, n, r;
|
|
1002
1014
|
return ((r = (n = (t = e.data) == null ? void 0 : t.value) == null ? void 0 : n.context) == null ? void 0 : r.languageIdChain) ?? [];
|
|
1003
1015
|
});
|
|
1004
1016
|
return (t, n) => {
|
|
1005
1017
|
const r = [n, ...s.value];
|
|
1006
|
-
return
|
|
1018
|
+
return lt(i(t), i(r));
|
|
1007
1019
|
};
|
|
1008
1020
|
};
|
|
1009
|
-
function
|
|
1021
|
+
function sn(e) {
|
|
1010
1022
|
const { total: s, limit: t, page: n, totalCountMode: r } = e ?? {}, a = Z({
|
|
1011
1023
|
page: n ?? 1,
|
|
1012
1024
|
total: s ?? 0,
|
|
@@ -1030,7 +1042,7 @@ function en(e) {
|
|
|
1030
1042
|
p: a.page,
|
|
1031
1043
|
limit: a.limit,
|
|
1032
1044
|
"total-count-mode": a.totalCountMode ?? "none"
|
|
1033
|
-
})),
|
|
1045
|
+
})), M = (O) => {
|
|
1034
1046
|
H(() => i(O), (y) => {
|
|
1035
1047
|
y && (a.total = (y == null ? void 0 : y.total) ?? 0, a.limit = (y == null ? void 0 : y.limit) ?? 0);
|
|
1036
1048
|
});
|
|
@@ -1042,7 +1054,7 @@ function en(e) {
|
|
|
1042
1054
|
pageCount: u,
|
|
1043
1055
|
isLastPage: f,
|
|
1044
1056
|
isFirstPage: S,
|
|
1045
|
-
usePaginationSync:
|
|
1057
|
+
usePaginationSync: M,
|
|
1046
1058
|
// This can be used to pass the pagination options directly to the query options
|
|
1047
1059
|
queryOptions: d
|
|
1048
1060
|
};
|
|
@@ -1058,7 +1070,7 @@ function X(e) {
|
|
|
1058
1070
|
unitPrice: n
|
|
1059
1071
|
}));
|
|
1060
1072
|
}
|
|
1061
|
-
function
|
|
1073
|
+
function rn(e) {
|
|
1062
1074
|
const s = c(() => {
|
|
1063
1075
|
var y;
|
|
1064
1076
|
return (y = e.value) == null ? void 0 : y.calculatedCheapestPrice;
|
|
@@ -1098,7 +1110,7 @@ function tn(e) {
|
|
|
1098
1110
|
), d = c(() => {
|
|
1099
1111
|
var y, h;
|
|
1100
1112
|
return !!((h = (y = u.value) == null ? void 0 : y.listPrice) != null && h.percentage);
|
|
1101
|
-
}),
|
|
1113
|
+
}), M = c(
|
|
1102
1114
|
() => {
|
|
1103
1115
|
var y, h, K;
|
|
1104
1116
|
return (K = (h = (y = e.value) == null ? void 0 : y.calculatedPrice) == null ? void 0 : h.regulationPrice) == null ? void 0 : K.price;
|
|
@@ -1113,10 +1125,10 @@ function tn(e) {
|
|
|
1113
1125
|
tierPrices: O,
|
|
1114
1126
|
referencePrice: n,
|
|
1115
1127
|
isListPrice: d,
|
|
1116
|
-
regulationPrice:
|
|
1128
|
+
regulationPrice: M
|
|
1117
1129
|
};
|
|
1118
1130
|
}
|
|
1119
|
-
function
|
|
1131
|
+
function dt(e, s) {
|
|
1120
1132
|
var n;
|
|
1121
1133
|
const t = (n = e.extensions) == null ? void 0 : n.variants;
|
|
1122
1134
|
return s.length === 0 ? (t == null ? void 0 : t.find((r) => {
|
|
@@ -1127,16 +1139,16 @@ function ct(e, s) {
|
|
|
1127
1139
|
return (a = r.optionIds) == null ? void 0 : a.every((u) => s.includes(u));
|
|
1128
1140
|
});
|
|
1129
1141
|
}
|
|
1130
|
-
function
|
|
1131
|
-
return c(() =>
|
|
1142
|
+
function an(e, s) {
|
|
1143
|
+
return c(() => dt(i(e), i(s)));
|
|
1132
1144
|
}
|
|
1133
|
-
function
|
|
1145
|
+
function un(e) {
|
|
1134
1146
|
return c(() => {
|
|
1135
1147
|
var s, t, n, r, a, u;
|
|
1136
1148
|
return !!((t = (s = i(e)) == null ? void 0 : s.customer) != null && t.id) && !!((r = (n = i(e)) == null ? void 0 : n.customer) != null && r.active) && !((u = (a = i(e)) == null ? void 0 : a.customer) != null && u.guest);
|
|
1137
1149
|
});
|
|
1138
1150
|
}
|
|
1139
|
-
function
|
|
1151
|
+
function on(e) {
|
|
1140
1152
|
const s = Re(e ? { body: e } : void 0), t = c(() => {
|
|
1141
1153
|
var d;
|
|
1142
1154
|
return (d = s.data) == null ? void 0 : d.value;
|
|
@@ -1189,94 +1201,96 @@ function rn(e) {
|
|
|
1189
1201
|
};
|
|
1190
1202
|
}
|
|
1191
1203
|
export {
|
|
1192
|
-
|
|
1204
|
+
ft as absolutizeSeoUrl,
|
|
1193
1205
|
R as addressKeys,
|
|
1194
1206
|
I as cartKeys,
|
|
1195
1207
|
B as categoryKeys,
|
|
1196
1208
|
F as contextKeys,
|
|
1197
1209
|
j as countryKeys,
|
|
1198
1210
|
L as customerKeys,
|
|
1199
|
-
|
|
1211
|
+
dt as getProductVariantForOptions,
|
|
1200
1212
|
ee as languageKey,
|
|
1201
1213
|
b as navigationKeys,
|
|
1202
1214
|
U as orderKeys,
|
|
1203
1215
|
N as paymentKeys,
|
|
1204
1216
|
w as productKeys,
|
|
1205
|
-
|
|
1206
|
-
|
|
1217
|
+
je as readPaymentMethodOperation,
|
|
1218
|
+
ot as readShippingMethodOperation,
|
|
1207
1219
|
V as relativizeSeoUrl,
|
|
1208
1220
|
E as salutationKeys,
|
|
1209
1221
|
T as seoUrlKeys,
|
|
1210
1222
|
D as shippingKeys,
|
|
1211
1223
|
_ as shopwareClientKey,
|
|
1212
1224
|
p as unrefOptions,
|
|
1213
|
-
|
|
1214
|
-
|
|
1215
|
-
|
|
1216
|
-
|
|
1217
|
-
|
|
1218
|
-
|
|
1219
|
-
|
|
1220
|
-
|
|
1221
|
-
|
|
1222
|
-
|
|
1223
|
-
|
|
1224
|
-
|
|
1225
|
-
|
|
1225
|
+
Mt as useAddLineItemMutation,
|
|
1226
|
+
Lt as useChangeEmailMutation,
|
|
1227
|
+
Et as useChangePasswordMutation,
|
|
1228
|
+
It as useChangeProfileMutation,
|
|
1229
|
+
ht as useCheckoutAddresses,
|
|
1230
|
+
St as useCreateCustomerAddressMutation,
|
|
1231
|
+
wt as useCreateOrderMutation,
|
|
1232
|
+
kt as useDefaultBillingAddressMutation,
|
|
1233
|
+
Bt as useDefaultShippingAddressMutation,
|
|
1234
|
+
Pt as useDeleteCustomerAddressMutation,
|
|
1235
|
+
Dt as useDeleteCustomerMutation,
|
|
1236
|
+
zt as useHandlePaymentMutation,
|
|
1237
|
+
jt as useImitateCustomerLoginQuery,
|
|
1238
|
+
De as useImitateCustomerLoginQueryOptions,
|
|
1239
|
+
un as useIsLoggedIn,
|
|
1226
1240
|
se as useListAddressQuery,
|
|
1227
1241
|
ne as useListAddressQueryOptions,
|
|
1228
|
-
|
|
1229
|
-
|
|
1230
|
-
|
|
1231
|
-
|
|
1232
|
-
|
|
1233
|
-
|
|
1234
|
-
|
|
1235
|
-
|
|
1236
|
-
|
|
1237
|
-
|
|
1238
|
-
|
|
1242
|
+
xt as useLoginCustomerMutation,
|
|
1243
|
+
Ut as useLogoutCustomerMutation,
|
|
1244
|
+
vt as useOptimistic,
|
|
1245
|
+
qt as useOrderDetails,
|
|
1246
|
+
Ct as useOrderPayment,
|
|
1247
|
+
Gt as useOrderSetPaymentMutation,
|
|
1248
|
+
sn as usePagination,
|
|
1249
|
+
en as usePaymentMethods,
|
|
1250
|
+
rn as useProductPrice,
|
|
1251
|
+
an as useProductVariantForOptions,
|
|
1252
|
+
Ot as useReadCartQuery,
|
|
1239
1253
|
me as useReadCartQueryOptions,
|
|
1240
|
-
|
|
1241
|
-
|
|
1242
|
-
|
|
1243
|
-
|
|
1254
|
+
Ht as useReadCategoryListQuery,
|
|
1255
|
+
We as useReadCategoryListQueryOptions,
|
|
1256
|
+
Wt as useReadCompactProductListingQuery,
|
|
1257
|
+
Xe as useReadCompactProductListingQueryOptions,
|
|
1244
1258
|
k as useReadContextQuery,
|
|
1245
1259
|
ae as useReadContextQueryOptions,
|
|
1246
|
-
|
|
1260
|
+
Ft as useReadCountryQuery,
|
|
1247
1261
|
Pe as useReadCountryQueryOptions,
|
|
1248
|
-
|
|
1249
|
-
|
|
1262
|
+
Ze as useReadCustomProductDetailOptions,
|
|
1263
|
+
Jt as useReadCustomProductDetailQuery,
|
|
1250
1264
|
Re as useReadCustomerQuery,
|
|
1251
1265
|
we as useReadCustomerQueryOptions,
|
|
1252
|
-
|
|
1266
|
+
Rt as useReadLanguageQuery,
|
|
1253
1267
|
Ce as useReadLanguageQueryOptions,
|
|
1254
|
-
|
|
1255
|
-
|
|
1268
|
+
$t as useReadNavigationQuery,
|
|
1269
|
+
Ee as useReadNavigationQueryOptions,
|
|
1256
1270
|
ce as useReadOrderQuery,
|
|
1257
1271
|
ie as useReadOrderQueryOptions,
|
|
1258
|
-
|
|
1259
|
-
|
|
1260
|
-
|
|
1261
|
-
|
|
1262
|
-
|
|
1263
|
-
|
|
1264
|
-
|
|
1265
|
-
|
|
1266
|
-
|
|
1267
|
-
|
|
1268
|
-
|
|
1269
|
-
|
|
1270
|
-
|
|
1271
|
-
|
|
1272
|
-
|
|
1273
|
-
|
|
1274
|
-
|
|
1275
|
-
|
|
1276
|
-
|
|
1272
|
+
$e as useReadPaymentMethodQuery,
|
|
1273
|
+
Ve as useReadPaymentMethodQueryOptions,
|
|
1274
|
+
Yt as useReadProductQuery,
|
|
1275
|
+
nt as useReadProductQueryOptions,
|
|
1276
|
+
Zt as useReadSalutationQuery,
|
|
1277
|
+
rt as useReadSalutationQueryOptions,
|
|
1278
|
+
_t as useReadSeoUrlQuery,
|
|
1279
|
+
ut as useReadSeoUrlQueryOptions,
|
|
1280
|
+
ct as useReadShippingMethodQuery,
|
|
1281
|
+
it as useReadShippingMethodQueryOptions,
|
|
1282
|
+
Vt as useRecoveryPasswordMutation,
|
|
1283
|
+
Nt as useRegisterConfirmMutation,
|
|
1284
|
+
bt as useRegisterCustomerMutation,
|
|
1285
|
+
Kt as useRemoveLineItemMutation,
|
|
1286
|
+
Xt as useSearchPageQuery,
|
|
1287
|
+
et as useSearchPageQueryOptions,
|
|
1288
|
+
Tt as useSendRecoveryMailMutation,
|
|
1289
|
+
nn as useSeoUrl,
|
|
1290
|
+
tn as useShippingMethods,
|
|
1277
1291
|
g as useShopwareQueryClient,
|
|
1278
1292
|
$ as useUpdateContextMutation,
|
|
1279
|
-
|
|
1280
|
-
|
|
1281
|
-
|
|
1293
|
+
Qt as useUpdateCustomerAddressMutation,
|
|
1294
|
+
At as useUpdateLineItemMutation,
|
|
1295
|
+
on as useUser
|
|
1282
1296
|
};
|
package/dist/keys.d.ts
CHANGED
|
@@ -52,6 +52,9 @@ export declare const customerKeys: {
|
|
|
52
52
|
detail: (body: MaybeRef<unknown>) => readonly ["customer", {
|
|
53
53
|
readonly body: unknown;
|
|
54
54
|
}];
|
|
55
|
+
imitateLogin: (body: MaybeRef<unknown>) => readonly ["customer", "imitateLogin", {
|
|
56
|
+
readonly body: unknown;
|
|
57
|
+
}];
|
|
55
58
|
};
|
|
56
59
|
export declare const addressKeys: {
|
|
57
60
|
all: () => readonly ["address"];
|
|
@@ -10,4 +10,5 @@ export * from './useDeleteCustomerMutation';
|
|
|
10
10
|
export * from './useRegisterConfirmMutation';
|
|
11
11
|
export * from './useSendRecoveryMailMutation';
|
|
12
12
|
export * from './useChangePasswordMutation';
|
|
13
|
+
export * from './useImitateCustomerLoginQuery';
|
|
13
14
|
export * from './useRecoveryPasswordMutation';
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { OperationOptions } from '../types/query';
|
|
2
|
+
import { UndefinedInitialQueryOptions, UseQueryReturnType } from '@tanstack/vue-query';
|
|
3
|
+
import { BrandedResponse } from '@teamnovu/kit-shopware-api-client';
|
|
4
|
+
import { Operations } from '..';
|
|
5
|
+
declare const imitateCustomerLoginKey = "imitateCustomerLogin post /account/login/imitate-customer";
|
|
6
|
+
export declare function useImitateCustomerLoginQueryOptions(options?: OperationOptions<typeof imitateCustomerLoginKey>): UndefinedInitialQueryOptions<BrandedResponse<Operations, "imitateCustomerLogin post /account/login/imitate-customer">, Error, BrandedResponse<Operations, "imitateCustomerLogin post /account/login/imitate-customer">, readonly ["customer", "imitateLogin", {
|
|
7
|
+
readonly body: unknown;
|
|
8
|
+
}]> & {
|
|
9
|
+
queryKey: readonly ["customer", "imitateLogin", {
|
|
10
|
+
readonly body: unknown;
|
|
11
|
+
}] & {
|
|
12
|
+
[dataTagSymbol]: BrandedResponse<Operations, "imitateCustomerLogin post /account/login/imitate-customer">;
|
|
13
|
+
[dataTagErrorSymbol]: Error;
|
|
14
|
+
};
|
|
15
|
+
};
|
|
16
|
+
export declare function useImitateCustomerLoginQuery(options?: OperationOptions<typeof imitateCustomerLoginKey>): UseQueryReturnType<BrandedResponse<Operations, "imitateCustomerLogin post /account/login/imitate-customer">, Error>;
|
|
17
|
+
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@teamnovu/kit-shopware-composables",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.17",
|
|
4
4
|
"description": "A collection of composables for the Shopware API",
|
|
5
5
|
"main": "dist/index.mjs",
|
|
6
6
|
"module": "dist/index.mjs",
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
"peerDependencies": {
|
|
18
18
|
"@tanstack/vue-query": "^5.85.3",
|
|
19
19
|
"vue": "^3.0.0",
|
|
20
|
-
"@teamnovu/kit-shopware-api-client": "0.0.
|
|
20
|
+
"@teamnovu/kit-shopware-api-client": "0.0.13"
|
|
21
21
|
},
|
|
22
22
|
"repository": {
|
|
23
23
|
"type": "git",
|
package/src/keys.ts
CHANGED
|
@@ -90,6 +90,7 @@ export const cartKeys = {
|
|
|
90
90
|
export const customerKeys = {
|
|
91
91
|
all: () => ['customer'] as const,
|
|
92
92
|
detail: (body: MaybeRef<unknown>) => ['customer', { body }] as const,
|
|
93
|
+
imitateLogin: (body: MaybeRef<unknown>) => ['customer', 'imitateLogin', { body }] as const,
|
|
93
94
|
}
|
|
94
95
|
|
|
95
96
|
export const addressKeys = {
|
|
@@ -10,4 +10,5 @@ export * from './useDeleteCustomerMutation'
|
|
|
10
10
|
export * from './useRegisterConfirmMutation'
|
|
11
11
|
export * from './useSendRecoveryMailMutation'
|
|
12
12
|
export * from './useChangePasswordMutation'
|
|
13
|
+
export * from './useImitateCustomerLoginQuery'
|
|
13
14
|
export * from './useRecoveryPasswordMutation'
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { queryOptions, useQuery } from '@tanstack/vue-query'
|
|
2
|
+
import { useShopwareQueryClient } from '../../inject'
|
|
3
|
+
import { customerKeys } from '../../keys'
|
|
4
|
+
import { unrefOptions } from '../../util'
|
|
5
|
+
import type { OperationKey, OperationOptions } from '../types/query'
|
|
6
|
+
import { computed } from 'vue'
|
|
7
|
+
|
|
8
|
+
const imitateCustomerLoginKey = 'imitateCustomerLogin post /account/login/imitate-customer' satisfies OperationKey
|
|
9
|
+
|
|
10
|
+
export function useImitateCustomerLoginQueryOptions(
|
|
11
|
+
options?: OperationOptions<typeof imitateCustomerLoginKey>,
|
|
12
|
+
) {
|
|
13
|
+
const client = useShopwareQueryClient()
|
|
14
|
+
const queryKey = customerKeys.imitateLogin(computed(() => unrefOptions(options).body ?? {}))
|
|
15
|
+
|
|
16
|
+
return queryOptions({
|
|
17
|
+
queryKey,
|
|
18
|
+
queryFn: async () => {
|
|
19
|
+
return client.query(imitateCustomerLoginKey, unrefOptions(options))
|
|
20
|
+
},
|
|
21
|
+
})
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export function useImitateCustomerLoginQuery(
|
|
25
|
+
options?: OperationOptions<typeof imitateCustomerLoginKey>,
|
|
26
|
+
) {
|
|
27
|
+
return useQuery(useImitateCustomerLoginQueryOptions(options))
|
|
28
|
+
}
|