@teamnovu/kit-shopware-composables 0.0.6 → 0.0.7
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/helpers/checkout/index.d.ts +1 -1
- package/dist/index.mjs +63 -65
- package/dist/query/checkout/index.d.ts +0 -1
- package/docs/index.md +3 -3
- package/package.json +2 -2
- package/src/helpers/checkout/index.ts +1 -1
- package/src/helpers/checkout/{useAddresses.ts → useCheckoutAddresses.ts} +1 -1
- package/src/query/checkout/index.ts +0 -1
- package/dist/query/checkout/useCheckout.d.ts +0 -1
- package/src/query/checkout/useCheckout.ts +0 -2
- /package/dist/helpers/checkout/{useAddresses.d.ts → useCheckoutAddresses.d.ts} +0 -0
package/dist/index.mjs
CHANGED
|
@@ -11,11 +11,11 @@ function v() {
|
|
|
11
11
|
}
|
|
12
12
|
const b = {
|
|
13
13
|
all: () => ["context"]
|
|
14
|
-
},
|
|
14
|
+
}, N = {
|
|
15
15
|
all: () => ["category"],
|
|
16
|
-
lists: () => [...
|
|
16
|
+
lists: () => [...N.all(), "list"],
|
|
17
17
|
list: (e) => [
|
|
18
|
-
...
|
|
18
|
+
...N.all(),
|
|
19
19
|
"list",
|
|
20
20
|
{
|
|
21
21
|
body: e
|
|
@@ -78,11 +78,11 @@ const b = {
|
|
|
78
78
|
],
|
|
79
79
|
details: () => [...R.all(), "detail"],
|
|
80
80
|
detail: (e, n) => [...R.details(), e, ...n ? [{ body: n }] : []]
|
|
81
|
-
},
|
|
81
|
+
}, k = {
|
|
82
82
|
all: () => ["shippingMethod"],
|
|
83
|
-
lists: () => [...
|
|
83
|
+
lists: () => [...k.all(), "list"],
|
|
84
84
|
list: (e) => [
|
|
85
|
-
...
|
|
85
|
+
...k.all(),
|
|
86
86
|
"list",
|
|
87
87
|
{
|
|
88
88
|
body: e
|
|
@@ -251,7 +251,7 @@ function nt() {
|
|
|
251
251
|
return ((d = t.data.value) == null ? void 0 : d.elements.filter(
|
|
252
252
|
(C) => {
|
|
253
253
|
var S;
|
|
254
|
-
return C.id !== ((S =
|
|
254
|
+
return C.id !== ((S = u.value) == null ? void 0 : S.id);
|
|
255
255
|
}
|
|
256
256
|
)) ?? [];
|
|
257
257
|
});
|
|
@@ -502,9 +502,8 @@ function dt(e) {
|
|
|
502
502
|
}
|
|
503
503
|
});
|
|
504
504
|
}
|
|
505
|
-
const
|
|
506
|
-
|
|
507
|
-
function pt(e) {
|
|
505
|
+
const he = "createOrder post /checkout/order";
|
|
506
|
+
function yt(e) {
|
|
508
507
|
const n = v(), t = P();
|
|
509
508
|
return Q({
|
|
510
509
|
...e,
|
|
@@ -533,11 +532,11 @@ const fe = "readCountry post /country", qe = function(n) {
|
|
|
533
532
|
}
|
|
534
533
|
});
|
|
535
534
|
};
|
|
536
|
-
function
|
|
535
|
+
function pt(e) {
|
|
537
536
|
return O(qe(e));
|
|
538
537
|
}
|
|
539
538
|
const Ce = "changeEmail post /account/change-email";
|
|
540
|
-
function
|
|
539
|
+
function mt(e) {
|
|
541
540
|
const n = v(), t = P();
|
|
542
541
|
return Q({
|
|
543
542
|
...e,
|
|
@@ -549,7 +548,7 @@ function gt(e) {
|
|
|
549
548
|
});
|
|
550
549
|
}
|
|
551
550
|
const Se = "changeProfile post /account/change-profile";
|
|
552
|
-
function
|
|
551
|
+
function gt(e) {
|
|
553
552
|
const n = v(), t = P();
|
|
554
553
|
return Q({
|
|
555
554
|
...e,
|
|
@@ -561,7 +560,7 @@ function vt(e) {
|
|
|
561
560
|
});
|
|
562
561
|
}
|
|
563
562
|
const Pe = "loginCustomer post /account/login";
|
|
564
|
-
function
|
|
563
|
+
function vt(e) {
|
|
565
564
|
const n = v(), t = P();
|
|
566
565
|
return Q({
|
|
567
566
|
...e,
|
|
@@ -582,7 +581,7 @@ function ht(e) {
|
|
|
582
581
|
});
|
|
583
582
|
}
|
|
584
583
|
const Qe = "logoutCustomer post /account/logout";
|
|
585
|
-
function
|
|
584
|
+
function ht(e) {
|
|
586
585
|
const n = v(), t = P();
|
|
587
586
|
return Q({
|
|
588
587
|
...e,
|
|
@@ -609,7 +608,7 @@ function Ae(e) {
|
|
|
609
608
|
return O(Oe(e));
|
|
610
609
|
}
|
|
611
610
|
const Ke = "register post /account/register";
|
|
612
|
-
function
|
|
611
|
+
function ft(e) {
|
|
613
612
|
const n = v(), t = P();
|
|
614
613
|
return Q({
|
|
615
614
|
...e,
|
|
@@ -637,7 +636,7 @@ const Re = "readNavigation post /navigation/{activeId}/{rootId}", Fe = function(
|
|
|
637
636
|
}
|
|
638
637
|
});
|
|
639
638
|
};
|
|
640
|
-
function
|
|
639
|
+
function qt(e, n, t) {
|
|
641
640
|
return O(Fe(e, n, t));
|
|
642
641
|
}
|
|
643
642
|
const Ie = "readPaymentMethod post /payment-method";
|
|
@@ -658,7 +657,7 @@ function Le(e) {
|
|
|
658
657
|
return O(we(e));
|
|
659
658
|
}
|
|
660
659
|
const xe = "handlePaymentMethod post /handle-payment";
|
|
661
|
-
function
|
|
660
|
+
function Ct(e) {
|
|
662
661
|
const n = v();
|
|
663
662
|
return Q({
|
|
664
663
|
...e,
|
|
@@ -670,7 +669,7 @@ function St(e) {
|
|
|
670
669
|
});
|
|
671
670
|
}
|
|
672
671
|
const Ue = "orderSetPayment post /order/payment";
|
|
673
|
-
function
|
|
672
|
+
function St(e) {
|
|
674
673
|
const n = v(), t = P();
|
|
675
674
|
return Q({
|
|
676
675
|
...e,
|
|
@@ -681,8 +680,8 @@ function Pt(e) {
|
|
|
681
680
|
}
|
|
682
681
|
});
|
|
683
682
|
}
|
|
684
|
-
const be = "readCategoryList post /category",
|
|
685
|
-
const t = v(), s =
|
|
683
|
+
const be = "readCategoryList post /category", Ne = function(n) {
|
|
684
|
+
const t = v(), s = N.list(n);
|
|
686
685
|
return M({
|
|
687
686
|
queryKey: s,
|
|
688
687
|
queryFn: async ({ signal: a }) => t.query(be, {
|
|
@@ -691,17 +690,17 @@ const be = "readCategoryList post /category", ke = function(n) {
|
|
|
691
690
|
})
|
|
692
691
|
});
|
|
693
692
|
};
|
|
694
|
-
function
|
|
695
|
-
return O(
|
|
693
|
+
function Pt(e) {
|
|
694
|
+
return O(Ne(e));
|
|
696
695
|
}
|
|
697
|
-
const
|
|
696
|
+
const ke = "readCompactProductListing post /novu/headless/product-listing/{seoUrl}";
|
|
698
697
|
function Be(e, n) {
|
|
699
698
|
const t = v(), s = w.list(e, n);
|
|
700
699
|
return M({
|
|
701
700
|
queryKey: s,
|
|
702
701
|
queryFn: async ({ signal: a }) => {
|
|
703
702
|
const r = g(n);
|
|
704
|
-
return t.query(
|
|
703
|
+
return t.query(ke, {
|
|
705
704
|
...r,
|
|
706
705
|
params: {
|
|
707
706
|
...r.params,
|
|
@@ -712,7 +711,7 @@ function Be(e, n) {
|
|
|
712
711
|
}
|
|
713
712
|
});
|
|
714
713
|
}
|
|
715
|
-
function
|
|
714
|
+
function Qt(e, n) {
|
|
716
715
|
return O(Be(e, n));
|
|
717
716
|
}
|
|
718
717
|
const Ee = "readCustomProductDetail post /novu/headless/product/{seoUrl}";
|
|
@@ -733,7 +732,7 @@ function De(e, n) {
|
|
|
733
732
|
}
|
|
734
733
|
});
|
|
735
734
|
}
|
|
736
|
-
function
|
|
735
|
+
function Mt(e, n) {
|
|
737
736
|
return O(De(e, n));
|
|
738
737
|
}
|
|
739
738
|
const Te = "readSalutation post /salutation", je = function(n) {
|
|
@@ -749,7 +748,7 @@ const Te = "readSalutation post /salutation", je = function(n) {
|
|
|
749
748
|
}
|
|
750
749
|
});
|
|
751
750
|
};
|
|
752
|
-
function
|
|
751
|
+
function Ot(e) {
|
|
753
752
|
return O(je(e));
|
|
754
753
|
}
|
|
755
754
|
const Ve = "readSeoUrl post /seo-url", $e = function(n) {
|
|
@@ -765,12 +764,12 @@ const Ve = "readSeoUrl post /seo-url", $e = function(n) {
|
|
|
765
764
|
}
|
|
766
765
|
});
|
|
767
766
|
};
|
|
768
|
-
function
|
|
767
|
+
function At(e) {
|
|
769
768
|
return O($e(e));
|
|
770
769
|
}
|
|
771
770
|
const ze = "readShippingMethod post /shipping-method";
|
|
772
771
|
function Ge(e) {
|
|
773
|
-
const n = v(), t =
|
|
772
|
+
const n = v(), t = k.list(o(() => {
|
|
774
773
|
var s;
|
|
775
774
|
return (s = g(e)) == null ? void 0 : s.body;
|
|
776
775
|
}));
|
|
@@ -785,7 +784,7 @@ function Ge(e) {
|
|
|
785
784
|
function He(e) {
|
|
786
785
|
return O(Ge(e));
|
|
787
786
|
}
|
|
788
|
-
function
|
|
787
|
+
function Kt() {
|
|
789
788
|
const e = V(), n = $(), t = Le({
|
|
790
789
|
query: {
|
|
791
790
|
onlyAvailable: !0
|
|
@@ -809,7 +808,7 @@ function Rt() {
|
|
|
809
808
|
paymentMethods: i
|
|
810
809
|
};
|
|
811
810
|
}
|
|
812
|
-
function
|
|
811
|
+
function Rt() {
|
|
813
812
|
const e = V(), n = $(), t = He({
|
|
814
813
|
query: {
|
|
815
814
|
onlyAvailable: !0
|
|
@@ -837,8 +836,8 @@ const We = (e, n) => {
|
|
|
837
836
|
var s;
|
|
838
837
|
const t = (s = e.extensions) == null ? void 0 : s.novuSeoUrls;
|
|
839
838
|
return (t == null ? void 0 : t[n]) ?? "";
|
|
840
|
-
},
|
|
841
|
-
function
|
|
839
|
+
}, Ft = (e, n) => o(() => We(c(e), c(n)));
|
|
840
|
+
function It(e) {
|
|
842
841
|
const { total: n, limit: t, page: s, totalCountMode: a } = e ?? {}, r = Z({
|
|
843
842
|
page: s ?? 1,
|
|
844
843
|
total: n ?? 0,
|
|
@@ -890,7 +889,7 @@ function X(e) {
|
|
|
890
889
|
unitPrice: s
|
|
891
890
|
}));
|
|
892
891
|
}
|
|
893
|
-
function
|
|
892
|
+
function wt(e) {
|
|
894
893
|
const n = o(() => {
|
|
895
894
|
var y;
|
|
896
895
|
return (y = e.value) == null ? void 0 : y.calculatedCheapestPrice;
|
|
@@ -959,16 +958,16 @@ function Je(e, n) {
|
|
|
959
958
|
return (r = a.optionIds) == null ? void 0 : r.every((i) => n.includes(i));
|
|
960
959
|
});
|
|
961
960
|
}
|
|
962
|
-
function
|
|
961
|
+
function Lt(e, n) {
|
|
963
962
|
return o(() => Je(c(e), c(n)));
|
|
964
963
|
}
|
|
965
|
-
function
|
|
964
|
+
function xt(e) {
|
|
966
965
|
return o(() => {
|
|
967
966
|
var n, t, s, a, r, i;
|
|
968
967
|
return !!((t = (n = c(e)) == null ? void 0 : n.customer) != null && t.id) && !!((a = (s = c(e)) == null ? void 0 : s.customer) != null && a.active) && !((i = (r = c(e)) == null ? void 0 : r.customer) != null && i.guest);
|
|
969
968
|
});
|
|
970
969
|
}
|
|
971
|
-
function
|
|
970
|
+
function Ut(e) {
|
|
972
971
|
const n = Ae(e ? { body: e } : void 0), t = o(() => {
|
|
973
972
|
var d;
|
|
974
973
|
return (d = n.data) == null ? void 0 : d.value;
|
|
@@ -1024,7 +1023,7 @@ export {
|
|
|
1024
1023
|
et as absolutizeSeoUrl,
|
|
1025
1024
|
R as addressKeys,
|
|
1026
1025
|
I as cartKeys,
|
|
1027
|
-
|
|
1026
|
+
N as categoryKeys,
|
|
1028
1027
|
b as contextKeys,
|
|
1029
1028
|
T as countryKeys,
|
|
1030
1029
|
x as customerKeys,
|
|
@@ -1039,64 +1038,63 @@ export {
|
|
|
1039
1038
|
j as relativizeSeoUrl,
|
|
1040
1039
|
D as salutationKeys,
|
|
1041
1040
|
E as seoUrlKeys,
|
|
1042
|
-
|
|
1041
|
+
k as shippingKeys,
|
|
1043
1042
|
_ as shopwareClientKey,
|
|
1044
1043
|
g as unrefOptions,
|
|
1045
1044
|
ot as useAddLineItemMutation,
|
|
1046
|
-
|
|
1047
|
-
|
|
1048
|
-
yt as useCheckout,
|
|
1045
|
+
mt as useChangeEmailMutation,
|
|
1046
|
+
gt as useChangeProfileMutation,
|
|
1049
1047
|
nt as useCheckoutAddresses,
|
|
1050
1048
|
at as useCreateCustomerAddressMutation,
|
|
1051
|
-
|
|
1049
|
+
yt as useCreateOrderMutation,
|
|
1052
1050
|
it as useDeleteCustomerAddressMutation,
|
|
1053
|
-
|
|
1054
|
-
|
|
1051
|
+
Ct as useHandlePaymentMutation,
|
|
1052
|
+
xt as useIsLoggedIn,
|
|
1055
1053
|
ne as useListAddressQuery,
|
|
1056
1054
|
te as useListAddressQueryOptions,
|
|
1057
|
-
|
|
1058
|
-
|
|
1055
|
+
vt as useLoginCustomerMutation,
|
|
1056
|
+
ht as useLogoutCustomerMutation,
|
|
1059
1057
|
tt as useOptimistic,
|
|
1060
1058
|
st as useOrderDetails,
|
|
1061
1059
|
rt as useOrderPayment,
|
|
1062
|
-
|
|
1063
|
-
|
|
1064
|
-
|
|
1065
|
-
|
|
1066
|
-
|
|
1060
|
+
St as useOrderSetPaymentMutation,
|
|
1061
|
+
It as usePagination,
|
|
1062
|
+
Kt as usePaymentMethods,
|
|
1063
|
+
wt as useProductPrice,
|
|
1064
|
+
Lt as useProductVariantForOptions,
|
|
1067
1065
|
ct as useReadCartQuery,
|
|
1068
1066
|
me as useReadCartQueryOptions,
|
|
1069
|
-
|
|
1070
|
-
|
|
1071
|
-
|
|
1067
|
+
Pt as useReadCategoryListQuery,
|
|
1068
|
+
Ne as useReadCategoryListQueryOptions,
|
|
1069
|
+
Qt as useReadCompactProductListingQuery,
|
|
1072
1070
|
Be as useReadCompactProductListingQueryOptions,
|
|
1073
1071
|
V as useReadContextQuery,
|
|
1074
1072
|
re as useReadContextQueryOptions,
|
|
1075
|
-
|
|
1073
|
+
pt as useReadCountryQuery,
|
|
1076
1074
|
qe as useReadCountryQueryOptions,
|
|
1077
1075
|
De as useReadCustomProductDetailOptions,
|
|
1078
|
-
|
|
1076
|
+
Mt as useReadCustomProductDetailQuery,
|
|
1079
1077
|
Ae as useReadCustomerQuery,
|
|
1080
1078
|
Oe as useReadCustomerQueryOptions,
|
|
1081
|
-
|
|
1079
|
+
qt as useReadNavigationQuery,
|
|
1082
1080
|
Fe as useReadNavigationQueryOptions,
|
|
1083
1081
|
oe as useReadOrderQuery,
|
|
1084
1082
|
ue as useReadOrderQueryOptions,
|
|
1085
1083
|
Le as useReadPaymentMethodQuery,
|
|
1086
1084
|
we as useReadPaymentMethodQueryOptions,
|
|
1087
|
-
|
|
1085
|
+
Ot as useReadSalutationQuery,
|
|
1088
1086
|
je as useReadSalutationQueryOptions,
|
|
1089
|
-
|
|
1087
|
+
At as useReadSeoUrlQuery,
|
|
1090
1088
|
$e as useReadSeoUrlQueryOptions,
|
|
1091
1089
|
He as useReadShippingMethodQuery,
|
|
1092
1090
|
Ge as useReadShippingMethodQueryOptions,
|
|
1093
|
-
|
|
1091
|
+
ft as useRegisterCustomerMutation,
|
|
1094
1092
|
lt as useRemoveLineItemMutation,
|
|
1095
|
-
|
|
1096
|
-
|
|
1093
|
+
Ft as useSeoUrl,
|
|
1094
|
+
Rt as useShippingMethods,
|
|
1097
1095
|
v as useShopwareQueryClient,
|
|
1098
1096
|
$ as useUpdateContextMutation,
|
|
1099
1097
|
ut as useUpdateCustomerAddressMutation,
|
|
1100
1098
|
dt as useUpdateLineItemMutation,
|
|
1101
|
-
|
|
1099
|
+
Ut as useUser
|
|
1102
1100
|
};
|
package/docs/index.md
CHANGED
|
@@ -244,7 +244,7 @@ const {
|
|
|
244
244
|
} = useShippingMethods()
|
|
245
245
|
```
|
|
246
246
|
|
|
247
|
-
####
|
|
247
|
+
#### useCheckoutAddresses
|
|
248
248
|
Manage customer addresses:
|
|
249
249
|
|
|
250
250
|
```typescript
|
|
@@ -255,7 +255,7 @@ const {
|
|
|
255
255
|
setBillingAddress,
|
|
256
256
|
setShippingAddress,
|
|
257
257
|
isSaving
|
|
258
|
-
} =
|
|
258
|
+
} = useCheckoutAddresses()
|
|
259
259
|
```
|
|
260
260
|
|
|
261
261
|
### Product Helpers
|
|
@@ -454,4 +454,4 @@ const handleCheckout = async () => {
|
|
|
454
454
|
}
|
|
455
455
|
}
|
|
456
456
|
</script>
|
|
457
|
-
```
|
|
457
|
+
```
|
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.7",
|
|
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.75.5",
|
|
19
19
|
"vue": "^3.0.0",
|
|
20
|
-
"@teamnovu/kit-shopware-api-client": "0.0.
|
|
20
|
+
"@teamnovu/kit-shopware-api-client": "0.0.5"
|
|
21
21
|
},
|
|
22
22
|
"repository": {
|
|
23
23
|
"type": "git",
|
|
@@ -39,7 +39,7 @@ export function useCheckoutAddresses() {
|
|
|
39
39
|
|
|
40
40
|
const inactiveShippingAddresses = computed(() =>
|
|
41
41
|
addressListQuery.data.value?.elements.filter(
|
|
42
|
-
address => address.id !==
|
|
42
|
+
address => address.id !== activeShippingAddress.value?.id,
|
|
43
43
|
) ?? [])
|
|
44
44
|
|
|
45
45
|
return {
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const useCheckout: () => void;
|
|
File without changes
|