@teamnovu/kit-shopware-composables 0.0.25 → 0.0.27
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/api-types/storeApiSchema.json +5236 -3756
- package/api-types/storeApiTypes.d.ts +5316 -4169
- package/dist/helpers/product/useProductVariantForOptions.d.ts +12 -0
- package/dist/index.mjs +35 -32
- package/docker/boot_end.sh +2 -0
- package/docker/docker-compose.yaml +8 -1
- package/docker/types.sh +4 -2
- package/package.json +2 -2
- package/src/query/customer/useRegisterCustomerMutation.ts +5 -2
|
@@ -49,6 +49,11 @@ export declare function getProductVariantForOptions<S extends DetailProduct>(pro
|
|
|
49
49
|
ean?: string;
|
|
50
50
|
extensions?: {
|
|
51
51
|
novuSeoUrls?: GenericRecord;
|
|
52
|
+
productVariantListingConfig?: {
|
|
53
|
+
configuratorGroupConfig?: GenericRecord[];
|
|
54
|
+
displayParent?: boolean;
|
|
55
|
+
mainVariantId?: string;
|
|
56
|
+
};
|
|
52
57
|
variants?: GenericRecord;
|
|
53
58
|
};
|
|
54
59
|
height?: number;
|
|
@@ -63,6 +68,7 @@ export declare function getProductVariantForOptions<S extends DetailProduct>(pro
|
|
|
63
68
|
manufacturerNumber?: string;
|
|
64
69
|
markAsTopseller?: boolean;
|
|
65
70
|
maxPurchase?: number;
|
|
71
|
+
measurements?: components["schemas"]["ProductMeasurements"];
|
|
66
72
|
media?: components["schemas"]["ProductMedia"][];
|
|
67
73
|
metaDescription?: string;
|
|
68
74
|
metaTitle?: string;
|
|
@@ -185,6 +191,11 @@ export declare function useProductVariantForOptions<S extends DetailProduct>(pro
|
|
|
185
191
|
ean?: string;
|
|
186
192
|
extensions?: {
|
|
187
193
|
novuSeoUrls?: GenericRecord;
|
|
194
|
+
productVariantListingConfig?: {
|
|
195
|
+
configuratorGroupConfig?: GenericRecord[];
|
|
196
|
+
displayParent?: boolean;
|
|
197
|
+
mainVariantId?: string;
|
|
198
|
+
};
|
|
188
199
|
variants?: GenericRecord;
|
|
189
200
|
};
|
|
190
201
|
height?: number;
|
|
@@ -199,6 +210,7 @@ export declare function useProductVariantForOptions<S extends DetailProduct>(pro
|
|
|
199
210
|
manufacturerNumber?: string;
|
|
200
211
|
markAsTopseller?: boolean;
|
|
201
212
|
maxPurchase?: number;
|
|
213
|
+
measurements?: components["schemas"]["ProductMeasurements"];
|
|
202
214
|
media?: components["schemas"]["ProductMedia"][];
|
|
203
215
|
metaDescription?: string;
|
|
204
216
|
metaTitle?: string;
|
package/dist/index.mjs
CHANGED
|
@@ -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 w = {
|
|
13
13
|
all: () => ["context"]
|
|
14
14
|
}, ee = {
|
|
15
15
|
all: () => ["language"]
|
|
@@ -96,18 +96,18 @@ const F = {
|
|
|
96
96
|
all: () => ["customer"],
|
|
97
97
|
detail: (e) => ["customer", { body: e }],
|
|
98
98
|
imitateLogin: (e) => ["customer", "imitateLogin", { body: e }]
|
|
99
|
-
},
|
|
99
|
+
}, F = {
|
|
100
100
|
all: () => ["address"],
|
|
101
|
-
lists: () => [...
|
|
101
|
+
lists: () => [...F.all(), "list"],
|
|
102
102
|
list: (e) => [
|
|
103
|
-
...
|
|
103
|
+
...F.all(),
|
|
104
104
|
"list",
|
|
105
105
|
{
|
|
106
106
|
body: e
|
|
107
107
|
}
|
|
108
108
|
],
|
|
109
|
-
details: () => [...
|
|
110
|
-
detail: (e, s) => [...
|
|
109
|
+
details: () => [...F.all(), "detail"],
|
|
110
|
+
detail: (e, s) => [...F.details(), e, ...s ? [{ body: s }] : []]
|
|
111
111
|
}, B = {
|
|
112
112
|
all: () => ["shippingMethod"],
|
|
113
113
|
lists: () => [...B.all(), "list"],
|
|
@@ -180,7 +180,7 @@ function y(e) {
|
|
|
180
180
|
}
|
|
181
181
|
const te = "listAddress post /account/list-address";
|
|
182
182
|
function ne(e) {
|
|
183
|
-
const s = g(), t =
|
|
183
|
+
const s = g(), t = F.list(c(() => {
|
|
184
184
|
var n;
|
|
185
185
|
return (n = y(e)) == null ? void 0 : n.body;
|
|
186
186
|
}));
|
|
@@ -229,7 +229,7 @@ const re = "readContext get /context";
|
|
|
229
229
|
function ae(e) {
|
|
230
230
|
const s = g();
|
|
231
231
|
return v({
|
|
232
|
-
queryKey:
|
|
232
|
+
queryKey: w.all(),
|
|
233
233
|
queryFn: ({ signal: t }) => s.query(re, {
|
|
234
234
|
...y(e),
|
|
235
235
|
signal: t
|
|
@@ -244,13 +244,13 @@ function $(e) {
|
|
|
244
244
|
const s = g(), t = P();
|
|
245
245
|
return h({
|
|
246
246
|
...e,
|
|
247
|
-
mutationFn: async (n) => (t.cancelQueries({ queryKey:
|
|
247
|
+
mutationFn: async (n) => (t.cancelQueries({ queryKey: w.all() }), s.query(ue, {
|
|
248
248
|
body: n
|
|
249
249
|
})),
|
|
250
250
|
onSuccess: async (n, r, a) => {
|
|
251
251
|
var u, o;
|
|
252
252
|
await Promise.all([
|
|
253
|
-
t.invalidateQueries({ queryKey:
|
|
253
|
+
t.invalidateQueries({ queryKey: w.all() }),
|
|
254
254
|
t.invalidateQueries({ queryKey: L.get() })
|
|
255
255
|
]), await ((o = i((u = i(e)) == null ? void 0 : u.onSuccess)) == null ? void 0 : o(n, r, a));
|
|
256
256
|
}
|
|
@@ -386,7 +386,7 @@ function Qt(e, s) {
|
|
|
386
386
|
const l = (m = r.value) == null ? void 0 : m.deliveries;
|
|
387
387
|
if (l != null && l.length)
|
|
388
388
|
return (C = l.at(-1)) == null ? void 0 : C.shippingMethod;
|
|
389
|
-
}),
|
|
389
|
+
}), R = c(() => {
|
|
390
390
|
var m;
|
|
391
391
|
const l = i(e);
|
|
392
392
|
return ((m = a.value) == null ? void 0 : m[l]) ?? !1;
|
|
@@ -403,7 +403,7 @@ function Qt(e, s) {
|
|
|
403
403
|
personalDetails: M,
|
|
404
404
|
shippingMethod: A,
|
|
405
405
|
paymentMethod: S,
|
|
406
|
-
paymentChangeable:
|
|
406
|
+
paymentChangeable: R,
|
|
407
407
|
orderQuery: n
|
|
408
408
|
};
|
|
409
409
|
}
|
|
@@ -435,7 +435,7 @@ function Ot(e) {
|
|
|
435
435
|
mutationFn: async (n) => s.query(le, y(n)),
|
|
436
436
|
onSuccess: async (n, r, a) => {
|
|
437
437
|
var u, o;
|
|
438
|
-
await t.invalidateQueries({ queryKey:
|
|
438
|
+
await t.invalidateQueries({ queryKey: F.lists() }), await ((o = i((u = i(e)) == null ? void 0 : u.onSuccess)) == null ? void 0 : o(n, r, a));
|
|
439
439
|
}
|
|
440
440
|
});
|
|
441
441
|
}
|
|
@@ -447,7 +447,7 @@ function Kt(e) {
|
|
|
447
447
|
mutationFn: async (n) => s.query(de, y(n)),
|
|
448
448
|
onSuccess: async (n, r, a) => {
|
|
449
449
|
var u, o;
|
|
450
|
-
await t.invalidateQueries({ queryKey:
|
|
450
|
+
await t.invalidateQueries({ queryKey: F.lists() }), await ((o = i((u = i(e)) == null ? void 0 : u.onSuccess)) == null ? void 0 : o(n, r, a));
|
|
451
451
|
}
|
|
452
452
|
});
|
|
453
453
|
}
|
|
@@ -460,10 +460,10 @@ function At(e) {
|
|
|
460
460
|
onSuccess: async (n, r, a) => {
|
|
461
461
|
var o, f;
|
|
462
462
|
const { addressId: u } = y(r).params;
|
|
463
|
-
t.setQueryData(
|
|
464
|
-
t.invalidateQueries({ queryKey:
|
|
463
|
+
t.setQueryData(F.detail(u), n), await Promise.all([
|
|
464
|
+
t.invalidateQueries({ queryKey: F.lists() }),
|
|
465
465
|
t.invalidateQueries({
|
|
466
|
-
queryKey:
|
|
466
|
+
queryKey: F.detail(y(r).params.addressId),
|
|
467
467
|
predicate: (Q) => Q.queryKey.at(-1) !== u
|
|
468
468
|
})
|
|
469
469
|
]), await ((f = i((o = i(e)) == null ? void 0 : o.onSuccess)) == null ? void 0 : f(n, r, a));
|
|
@@ -581,7 +581,7 @@ function Dt(e) {
|
|
|
581
581
|
mutationFn: async (n) => s.query(Qe, y(n)),
|
|
582
582
|
onSuccess: async (n, r, a) => {
|
|
583
583
|
var u, o;
|
|
584
|
-
await t.invalidateQueries({ queryKey: I.all() }), await t.invalidateQueries({ queryKey:
|
|
584
|
+
await t.invalidateQueries({ queryKey: I.all() }), await t.invalidateQueries({ queryKey: w.all() }), await ((o = i((u = i(e)) == null ? void 0 : u.onSuccess)) == null ? void 0 : o(n, r, a));
|
|
585
585
|
}
|
|
586
586
|
});
|
|
587
587
|
}
|
|
@@ -595,7 +595,7 @@ function bt(e) {
|
|
|
595
595
|
var u, o;
|
|
596
596
|
await Promise.all([
|
|
597
597
|
t.invalidateQueries({ queryKey: I.all() }),
|
|
598
|
-
t.invalidateQueries({ queryKey:
|
|
598
|
+
t.invalidateQueries({ queryKey: w.all() })
|
|
599
599
|
]), await ((o = i((u = i(e)) == null ? void 0 : u.onSuccess)) == null ? void 0 : o(n, r, a));
|
|
600
600
|
}
|
|
601
601
|
});
|
|
@@ -614,7 +614,7 @@ function kt(e) {
|
|
|
614
614
|
onSuccess: async (n, r, a) => {
|
|
615
615
|
var u, o;
|
|
616
616
|
await Promise.all([
|
|
617
|
-
t.resetQueries({ queryKey:
|
|
617
|
+
t.resetQueries({ queryKey: w.all() }),
|
|
618
618
|
t.invalidateQueries({ queryKey: L.get() }),
|
|
619
619
|
t.invalidateQueries({ queryKey: I.all() })
|
|
620
620
|
]), await ((o = i((u = i(e)) == null ? void 0 : u.onSuccess)) == null ? void 0 : o(n, r, a));
|
|
@@ -630,7 +630,7 @@ function Bt(e) {
|
|
|
630
630
|
onSuccess: async (n, r, a) => {
|
|
631
631
|
var u, o;
|
|
632
632
|
await Promise.all([
|
|
633
|
-
t.resetQueries({ queryKey:
|
|
633
|
+
t.resetQueries({ queryKey: w.all() }),
|
|
634
634
|
t.invalidateQueries({ queryKey: L.get() }),
|
|
635
635
|
t.invalidateQueries({ queryKey: I.all() })
|
|
636
636
|
]), await ((o = i((u = i(e)) == null ? void 0 : u.onSuccess)) == null ? void 0 : o(n, r, a));
|
|
@@ -656,7 +656,10 @@ function Nt(e) {
|
|
|
656
656
|
mutationFn: async (n) => s.query(Fe, y(n)),
|
|
657
657
|
onSuccess: async (n, r, a) => {
|
|
658
658
|
var u, o;
|
|
659
|
-
await
|
|
659
|
+
await Promise.all([
|
|
660
|
+
t.resetQueries({ queryKey: w.all() }),
|
|
661
|
+
t.invalidateQueries({ queryKey: I.all() })
|
|
662
|
+
]), await ((o = i((u = i(e)) == null ? void 0 : u.onSuccess)) == null ? void 0 : o(n, r, a));
|
|
660
663
|
}
|
|
661
664
|
});
|
|
662
665
|
}
|
|
@@ -670,7 +673,7 @@ function Tt(e) {
|
|
|
670
673
|
var u, o;
|
|
671
674
|
await Promise.all([
|
|
672
675
|
t.invalidateQueries({ queryKey: I.all() }),
|
|
673
|
-
t.invalidateQueries({ queryKey:
|
|
676
|
+
t.invalidateQueries({ queryKey: w.all() })
|
|
674
677
|
]), await ((o = i((u = i(e)) == null ? void 0 : u.onSuccess)) == null ? void 0 : o(n, r, a));
|
|
675
678
|
}
|
|
676
679
|
});
|
|
@@ -685,7 +688,7 @@ function Et(e) {
|
|
|
685
688
|
var u, o;
|
|
686
689
|
await Promise.all([
|
|
687
690
|
t.invalidateQueries({ queryKey: I.all() }),
|
|
688
|
-
t.invalidateQueries({ queryKey:
|
|
691
|
+
t.invalidateQueries({ queryKey: w.all() })
|
|
689
692
|
]), await ((o = i((u = i(e)) == null ? void 0 : u.onSuccess)) == null ? void 0 : o(n, r, a));
|
|
690
693
|
}
|
|
691
694
|
});
|
|
@@ -700,7 +703,7 @@ function jt(e) {
|
|
|
700
703
|
var u, o;
|
|
701
704
|
await Promise.all([
|
|
702
705
|
t.resetQueries({ queryKey: I.all() }),
|
|
703
|
-
t.resetQueries({ queryKey:
|
|
706
|
+
t.resetQueries({ queryKey: w.all() }),
|
|
704
707
|
t.resetQueries({ queryKey: L.get() })
|
|
705
708
|
]), await ((o = i((u = i(e)) == null ? void 0 : u.onSuccess)) == null ? void 0 : o(n, r, a));
|
|
706
709
|
}
|
|
@@ -1131,8 +1134,8 @@ function dn(e) {
|
|
|
1131
1134
|
return (p = e.value) == null ? void 0 : p.calculatedCheapestPrice;
|
|
1132
1135
|
}), t = c(
|
|
1133
1136
|
() => {
|
|
1134
|
-
var p, S, A,
|
|
1135
|
-
return (((S = (p = e.value) == null ? void 0 : p.calculatedPrices) == null ? void 0 : S.length) ?? 0) > 0 ? (
|
|
1137
|
+
var p, S, A, R, l;
|
|
1138
|
+
return (((S = (p = e.value) == null ? void 0 : p.calculatedPrices) == null ? void 0 : S.length) ?? 0) > 0 ? (R = (A = e.value) == null ? void 0 : A.calculatedPrices) == null ? void 0 : R[0] : (l = e.value) == null ? void 0 : l.calculatedPrice;
|
|
1136
1139
|
}
|
|
1137
1140
|
), n = c(() => {
|
|
1138
1141
|
var p;
|
|
@@ -1142,13 +1145,13 @@ function dn(e) {
|
|
|
1142
1145
|
return (((S = (p = e.value) == null ? void 0 : p.calculatedPrices) == null ? void 0 : S.length) ?? 0) > 1;
|
|
1143
1146
|
}), a = c(
|
|
1144
1147
|
() => {
|
|
1145
|
-
var p, S, A,
|
|
1146
|
-
return !!((p = e.value) != null && p.parentId) && ((A = (S = e.value) == null ? void 0 : S.calculatedCheapestPrice) == null ? void 0 : A.hasRange) && ((
|
|
1148
|
+
var p, S, A, R, l, m;
|
|
1149
|
+
return !!((p = e.value) != null && p.parentId) && ((A = (S = e.value) == null ? void 0 : S.calculatedCheapestPrice) == null ? void 0 : A.hasRange) && ((R = t == null ? void 0 : t.value) == null ? void 0 : R.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);
|
|
1147
1150
|
}
|
|
1148
1151
|
), u = c(
|
|
1149
1152
|
() => {
|
|
1150
1153
|
var p, S;
|
|
1151
|
-
return r.value && X(e.value).length > 1 ? (S = (p = e.value) == null ? void 0 : p.calculatedPrices) == null ? void 0 : S.reduce((A,
|
|
1154
|
+
return r.value && X(e.value).length > 1 ? (S = (p = e.value) == null ? void 0 : p.calculatedPrices) == null ? void 0 : S.reduce((A, R) => R.unitPrice < A.unitPrice ? R : A) : t.value;
|
|
1152
1155
|
}
|
|
1153
1156
|
), o = c(
|
|
1154
1157
|
() => {
|
|
@@ -1257,10 +1260,10 @@ function gn(e) {
|
|
|
1257
1260
|
}
|
|
1258
1261
|
export {
|
|
1259
1262
|
St as absolutizeSeoUrl,
|
|
1260
|
-
|
|
1263
|
+
F as addressKeys,
|
|
1261
1264
|
L as cartKeys,
|
|
1262
1265
|
k as categoryKeys,
|
|
1263
|
-
|
|
1266
|
+
w as contextKeys,
|
|
1264
1267
|
j as countryKeys,
|
|
1265
1268
|
I as customerKeys,
|
|
1266
1269
|
mt as getProductVariantForOptions,
|
package/docker/boot_end.sh
CHANGED
|
@@ -2,8 +2,15 @@ name: shopware-for-kit
|
|
|
2
2
|
|
|
3
3
|
services:
|
|
4
4
|
shopware-for-kit:
|
|
5
|
-
image: dockware/dev:6.7.
|
|
5
|
+
image: dockware/dev:6.7.2.2
|
|
6
6
|
container_name: shopware-for-kit
|
|
7
|
+
environment:
|
|
8
|
+
COMPOSER_AUTH: |-
|
|
9
|
+
{
|
|
10
|
+
"bearer": {
|
|
11
|
+
"satis.novu.ch": "${INBUDGET_TOKEN}"
|
|
12
|
+
}
|
|
13
|
+
}
|
|
7
14
|
ports:
|
|
8
15
|
- "8500:80"
|
|
9
16
|
volumes:
|
package/docker/types.sh
CHANGED
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
|
|
2
|
-
cd docker && docker compose up
|
|
2
|
+
cd docker && docker compose up -d
|
|
3
3
|
|
|
4
4
|
# This currently works but it goes on with the script before all plugins are installed.
|
|
5
5
|
# thus the first time this runs we may have to run the script twice.
|
|
6
|
-
until curl --output /dev/null --silent --head --fail http://localhost:8500; do
|
|
6
|
+
until curl --output /dev/null --silent --head --fail http://localhost:8500/admin; do
|
|
7
7
|
sleep 3
|
|
8
8
|
done
|
|
9
9
|
|
|
10
|
+
cd ..
|
|
11
|
+
|
|
10
12
|
|
|
11
13
|
pnpm dlx @shopware/api-gen loadSchema --apiType=store
|
|
12
14
|
pnpm dlx @shopware/api-gen generate --apiType=store
|
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.27",
|
|
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.14"
|
|
21
21
|
},
|
|
22
22
|
"repository": {
|
|
23
23
|
"type": "git",
|
|
@@ -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 { customerKeys } from '../../keys'
|
|
5
|
+
import { contextKeys, customerKeys } from '../../keys'
|
|
6
6
|
import { unrefOptions } from '../../util/unrefOptions'
|
|
7
7
|
import type { OperationKey, OperationOptions, OperationResponse } from '../types/query'
|
|
8
8
|
|
|
@@ -24,7 +24,10 @@ export function useRegisterCustomerMutation(
|
|
|
24
24
|
return client.query(registerOperation, unrefOptions(options))
|
|
25
25
|
},
|
|
26
26
|
onSuccess: async (data, variables, context) => {
|
|
27
|
-
await
|
|
27
|
+
await Promise.all([
|
|
28
|
+
queryClient.resetQueries({ queryKey: contextKeys.all() }),
|
|
29
|
+
queryClient.invalidateQueries({ queryKey: customerKeys.all() }),
|
|
30
|
+
])
|
|
28
31
|
|
|
29
32
|
await unref(unref(mutationOptions)?.onSuccess)?.(data, variables, context)
|
|
30
33
|
},
|