@teamnovu/kit-shopware-composables 0.0.8 → 0.0.10

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.
@@ -1,10 +1,8 @@
1
1
  import { GenericRecord } from '../../../api-types/storeApiTypes.d.ts';
2
- import { MaybeRef, ComputedRef } from 'vue';
3
2
  interface SeoUrlEntity {
4
3
  extensions?: {
5
4
  novuSeoUrls?: GenericRecord;
6
5
  };
7
6
  }
8
- export declare const getSeoUrl: <T extends SeoUrlEntity>(entity: T, languageId: string) => string;
9
- export declare const useSeoUrl: <T extends SeoUrlEntity>(entity: MaybeRef<T>, languageId: MaybeRef<string>) => ComputedRef<string>;
7
+ export declare const useSeoUrl: <T extends SeoUrlEntity>() => (entity: T, languageId: string) => string;
10
8
  export {};
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 M, useQuery as O, useQueryClient as S, useMutation as v } from "@tanstack/vue-query";
3
+ import { queryOptions as M, useQuery as O, useQueryClient as S, useMutation as f } from "@tanstack/vue-query";
4
4
  import "@teamnovu/kit-shopware-api-client";
5
5
  const _ = Symbol("shopwareClient");
6
6
  function g() {
@@ -9,13 +9,13 @@ function g() {
9
9
  throw new Error("Shopware client not provided!");
10
10
  return e;
11
11
  }
12
- const R = {
12
+ const F = {
13
13
  all: () => ["context"]
14
- }, k = {
14
+ }, B = {
15
15
  all: () => ["category"],
16
- lists: () => [...k.all(), "list"],
16
+ lists: () => [...B.all(), "list"],
17
17
  list: (e) => [
18
- ...k.all(),
18
+ ...B.all(),
19
19
  "list",
20
20
  {
21
21
  body: e
@@ -60,10 +60,17 @@ const R = {
60
60
  url: e,
61
61
  body: s
62
62
  }
63
+ ],
64
+ search: (e) => [
65
+ ...x.all(),
66
+ "search",
67
+ {
68
+ body: e
69
+ }
63
70
  ]
64
71
  }, L = {
65
72
  get: () => ["cart"]
66
- }, F = {
73
+ }, R = {
67
74
  all: () => ["customer"],
68
75
  detail: (e) => ["customer", { body: e }]
69
76
  }, w = {
@@ -78,21 +85,21 @@ const R = {
78
85
  ],
79
86
  details: () => [...w.all(), "detail"],
80
87
  detail: (e, s) => [...w.details(), e, ...s ? [{ body: s }] : []]
81
- }, B = {
88
+ }, N = {
82
89
  all: () => ["shippingMethod"],
83
- lists: () => [...B.all(), "list"],
90
+ lists: () => [...N.all(), "list"],
84
91
  list: (e) => [
85
- ...B.all(),
92
+ ...N.all(),
86
93
  "list",
87
94
  {
88
95
  body: e
89
96
  }
90
97
  ]
91
- }, N = {
98
+ }, D = {
92
99
  all: () => ["paymentMethod"],
93
- lists: () => [...N.all(), "list"],
100
+ lists: () => [...D.all(), "list"],
94
101
  list: (e) => [
95
- ...N.all(),
102
+ ...D.all(),
96
103
  "list",
97
104
  {
98
105
  body: e
@@ -109,31 +116,31 @@ const R = {
109
116
  body: e
110
117
  }
111
118
  ]
112
- }, D = {
119
+ }, E = {
113
120
  all: () => ["seoUrl"],
114
- lists: () => [...D.all(), "list"],
121
+ lists: () => [...E.all(), "list"],
115
122
  list: (e) => [
116
- ...D.all(),
123
+ ...E.all(),
117
124
  "list",
118
125
  {
119
126
  body: e
120
127
  }
121
128
  ]
122
- }, E = {
129
+ }, j = {
123
130
  all: () => ["salutation"],
124
- lists: () => [...E.all(), "list"],
131
+ lists: () => [...j.all(), "list"],
125
132
  list: (e) => [
126
- ...E.all(),
133
+ ...j.all(),
127
134
  "list",
128
135
  {
129
136
  body: e
130
137
  }
131
138
  ]
132
- }, j = {
139
+ }, T = {
133
140
  all: () => ["country"],
134
- lists: () => [...j.all(), "list"],
141
+ lists: () => [...T.all(), "list"],
135
142
  list: (e) => [
136
- ...j.all(),
143
+ ...T.all(),
137
144
  "list",
138
145
  {
139
146
  body: e
@@ -165,11 +172,11 @@ function te(e) {
165
172
  function ne(e) {
166
173
  return O(te(e));
167
174
  }
168
- const T = (e) => {
175
+ const V = (e) => {
169
176
  const s = e.replace(/\/?$/, "");
170
177
  return s.startsWith("/") ? s.slice(1) : s;
171
- }, it = (e) => `/${T(e)}`;
172
- function ct(e, s, t) {
178
+ }, lt = (e) => `/${V(e)}`;
179
+ function dt(e, s, t) {
173
180
  const n = S();
174
181
  return {
175
182
  onMutate: async (a) => {
@@ -183,8 +190,8 @@ function ct(e, s, t) {
183
190
  },
184
191
  onError: (a, r, o) => {
185
192
  if (o && n.setQueryData(e, o.previousValue), t) {
186
- const u = i(t), f = i(u.onError);
187
- f == null || f(a, r, o);
193
+ const u = i(t), h = i(u.onError);
194
+ h == null || h(a, r, o);
188
195
  }
189
196
  },
190
197
  onSettled: (...a) => {
@@ -206,32 +213,32 @@ const se = (e) => {
206
213
  function ae(e) {
207
214
  const s = g();
208
215
  return M({
209
- queryKey: R.all(),
216
+ queryKey: F.all(),
210
217
  queryFn: ({ signal: t }) => s.query(re, {
211
218
  ...m(e),
212
219
  signal: t
213
220
  })
214
221
  });
215
222
  }
216
- function V(e) {
223
+ function k(e) {
217
224
  return O(ae(e));
218
225
  }
219
226
  const oe = "updateContext patch /context";
220
227
  function $(e) {
221
228
  const s = g(), t = S();
222
- return v({
229
+ return f({
223
230
  ...e,
224
- mutationFn: async (n) => (t.cancelQueries({ queryKey: R.all() }), s.query(oe, {
231
+ mutationFn: async (n) => (t.cancelQueries({ queryKey: F.all() }), s.query(oe, {
225
232
  body: n
226
233
  })),
227
234
  onSuccess: async (n, a, r) => {
228
235
  var o, u;
229
- await t.invalidateQueries({ queryKey: R.all() }), await ((u = i((o = i(e)) == null ? void 0 : o.onSuccess)) == null ? void 0 : u(n, a, r));
236
+ await t.invalidateQueries({ queryKey: F.all() }), await ((u = i((o = i(e)) == null ? void 0 : o.onSuccess)) == null ? void 0 : u(n, a, r));
230
237
  }
231
238
  });
232
239
  }
233
- function lt() {
234
- const e = $(), s = V(), t = ne(), n = c(() => s.isFetching.value || e.isPending.value), a = async (d) => {
240
+ function yt() {
241
+ const e = $(), s = k(), t = ne(), n = c(() => s.isFetching.value || e.isPending.value), a = async (d) => {
235
242
  await e.mutateAsync({
236
243
  billingAddressId: d.id
237
244
  }), await J(n).toBe(!1);
@@ -245,7 +252,7 @@ function lt() {
245
252
  }), u = c(() => {
246
253
  var d, P;
247
254
  return (P = (d = s.data.value) == null ? void 0 : d.customer) == null ? void 0 : P.activeShippingAddress;
248
- }), f = c(() => {
255
+ }), h = c(() => {
249
256
  var d;
250
257
  return ((d = t.data.value) == null ? void 0 : d.elements.filter(
251
258
  (P) => {
@@ -271,7 +278,7 @@ function lt() {
271
278
  isSaving: n,
272
279
  activeBillingAddress: o,
273
280
  activeShippingAddress: u,
274
- inactiveBillingAddresses: f,
281
+ inactiveBillingAddresses: h,
275
282
  inactiveShippingAddresses: C
276
283
  };
277
284
  }
@@ -292,7 +299,7 @@ function ie(e) {
292
299
  function ce(e) {
293
300
  return O(ie(e));
294
301
  }
295
- function dt(e, s) {
302
+ function pt(e, s) {
296
303
  const t = c(() => {
297
304
  const l = i(e);
298
305
  if (l)
@@ -321,7 +328,7 @@ function dt(e, s) {
321
328
  }), u = c(() => {
322
329
  var l, p;
323
330
  return (p = (l = a.value) == null ? void 0 : l.stateMachineState) == null ? void 0 : p.technicalName;
324
- }), f = c(() => {
331
+ }), h = c(() => {
325
332
  var l, p;
326
333
  return (p = (l = a.value) == null ? void 0 : l.price) == null ? void 0 : p.totalPrice;
327
334
  }), C = c(() => {
@@ -350,7 +357,7 @@ function dt(e, s) {
350
357
  var l, p, q;
351
358
  return (q = (p = (l = a.value) == null ? void 0 : l.deliveries) == null ? void 0 : p[0]) == null ? void 0 : q.shippingOrderAddress;
352
359
  }
353
- ), h = c(() => {
360
+ ), v = c(() => {
354
361
  var p, q;
355
362
  const l = (p = a.value) == null ? void 0 : p.transactions;
356
363
  if (l != null && l.length)
@@ -369,24 +376,24 @@ function dt(e, s) {
369
376
  order: a,
370
377
  status: o,
371
378
  statusTechnicalName: u,
372
- total: f,
379
+ total: h,
373
380
  subtotal: C,
374
381
  shippingCosts: d,
375
382
  shippingAddress: y,
376
383
  billingAddress: Q,
377
384
  personalDetails: P,
378
385
  shippingMethod: A,
379
- paymentMethod: h,
386
+ paymentMethod: v,
380
387
  paymentChangeable: K,
381
388
  orderQuery: n
382
389
  };
383
390
  }
384
- function yt(e) {
391
+ function mt(e) {
385
392
  const s = c(() => {
386
393
  var r, o;
387
394
  return (o = (r = i(e)) == null ? void 0 : r.transactions) == null ? void 0 : o.find((u) => {
388
- var f;
389
- return ((f = u.paymentMethod) == null ? void 0 : f.active) === !0;
395
+ var h;
396
+ return ((h = u.paymentMethod) == null ? void 0 : h.active) === !0;
390
397
  });
391
398
  }), t = c(() => {
392
399
  var r;
@@ -403,9 +410,9 @@ function yt(e) {
403
410
  };
404
411
  }
405
412
  const le = "createCustomerAddress post /account/address";
406
- function pt(e) {
413
+ function gt(e) {
407
414
  const s = g(), t = S();
408
- return v({
415
+ return f({
409
416
  ...e,
410
417
  mutationFn: async (n) => s.query(le, m(n)),
411
418
  onSuccess: async (n, a, r) => {
@@ -415,9 +422,9 @@ function pt(e) {
415
422
  });
416
423
  }
417
424
  const de = "deleteCustomerAddress delete /account/address/{addressId}";
418
- function mt(e) {
425
+ function ht(e) {
419
426
  const s = g(), t = S();
420
- return v({
427
+ return f({
421
428
  ...e,
422
429
  mutationFn: async (n) => s.query(de, m(n)),
423
430
  onSuccess: async (n, a, r) => {
@@ -427,13 +434,13 @@ function mt(e) {
427
434
  });
428
435
  }
429
436
  const ye = "updateCustomerAddress patch /account/address/{addressId}";
430
- function gt(e) {
437
+ function ft(e) {
431
438
  const s = g(), t = S();
432
- return v({
439
+ return f({
433
440
  ...e,
434
441
  mutationFn: async (n) => s.query(ye, m(n)),
435
442
  onSuccess: async (n, a, r) => {
436
- var u, f;
443
+ var u, h;
437
444
  const { addressId: o } = m(a).params;
438
445
  t.setQueryData(w.detail(o), n), await Promise.all([
439
446
  t.invalidateQueries({ queryKey: w.lists() }),
@@ -441,14 +448,14 @@ function gt(e) {
441
448
  queryKey: w.detail(m(a).params.addressId),
442
449
  predicate: (C) => C.queryKey.at(-1) !== o
443
450
  })
444
- ]), await ((f = i((u = i(e)) == null ? void 0 : u.onSuccess)) == null ? void 0 : f(n, a, r));
451
+ ]), await ((h = i((u = i(e)) == null ? void 0 : u.onSuccess)) == null ? void 0 : h(n, a, r));
445
452
  }
446
453
  });
447
454
  }
448
455
  const pe = "addLineItem post /checkout/cart/line-item";
449
- function ft(e) {
456
+ function vt(e) {
450
457
  const s = g(), t = S();
451
- return v({
458
+ return f({
452
459
  ...e,
453
460
  mutationFn: async (n) => s.query(pe, {
454
461
  body: n
@@ -470,15 +477,15 @@ function ge(e) {
470
477
  })
471
478
  });
472
479
  }
473
- function vt() {
480
+ function qt() {
474
481
  return O(ge());
475
482
  }
476
- const fe = "removeLineItem post /checkout/cart/line-item/delete";
477
- function ht(e) {
483
+ const he = "removeLineItem post /checkout/cart/line-item/delete";
484
+ function Ct(e) {
478
485
  const s = g(), t = S();
479
- return v({
486
+ return f({
480
487
  ...e,
481
- mutationFn: async (n) => s.query(fe, {
488
+ mutationFn: async (n) => s.query(he, {
482
489
  body: n
483
490
  }),
484
491
  onSuccess: async (n, a, r) => {
@@ -487,12 +494,12 @@ function ht(e) {
487
494
  }
488
495
  });
489
496
  }
490
- const ve = "updateLineItem patch /checkout/cart/line-item";
491
- function qt(e) {
497
+ const fe = "updateLineItem patch /checkout/cart/line-item";
498
+ function St(e) {
492
499
  const s = g(), t = S();
493
- return v({
500
+ return f({
494
501
  ...e,
495
- mutationFn: async (n) => s.query(ve, {
502
+ mutationFn: async (n) => s.query(fe, {
496
503
  body: n
497
504
  }),
498
505
  onSuccess: async (n, a, r) => {
@@ -501,12 +508,12 @@ function qt(e) {
501
508
  }
502
509
  });
503
510
  }
504
- const he = "createOrder post /checkout/order";
505
- function Ct(e) {
511
+ const ve = "createOrder post /checkout/order";
512
+ function Pt(e) {
506
513
  const s = g(), t = S();
507
- return v({
514
+ return f({
508
515
  ...e,
509
- mutationFn: async (n) => s.query(he, m(n)),
516
+ mutationFn: async (n) => s.query(ve, m(n)),
510
517
  onSuccess: async (n, a, r) => {
511
518
  var o, u;
512
519
  await Promise.all([
@@ -519,7 +526,7 @@ function Ct(e) {
519
526
  });
520
527
  }
521
528
  const qe = "readCountry post /country", Ce = function(s) {
522
- const t = g(), n = j.list(s);
529
+ const t = g(), n = T.list(s);
523
530
  return M({
524
531
  queryKey: n,
525
532
  queryFn: async ({ signal: a }) => {
@@ -531,76 +538,76 @@ const qe = "readCountry post /country", Ce = function(s) {
531
538
  }
532
539
  });
533
540
  };
534
- function St(e) {
541
+ function Qt(e) {
535
542
  return O(Ce(e));
536
543
  }
537
544
  const Se = "changeEmail post /account/change-email";
538
- function Pt(e) {
545
+ function Mt(e) {
539
546
  const s = g(), t = S();
540
- return v({
547
+ return f({
541
548
  ...e,
542
549
  mutationFn: async (n) => s.query(Se, m(n)),
543
550
  onSuccess: async (n, a, r) => {
544
551
  var o, u;
545
- await t.invalidateQueries({ queryKey: F.all() }), await t.invalidateQueries({ queryKey: R.all() }), await ((u = i((o = i(e)) == null ? void 0 : o.onSuccess)) == null ? void 0 : u(n, a, r));
552
+ await t.invalidateQueries({ queryKey: R.all() }), await t.invalidateQueries({ queryKey: F.all() }), await ((u = i((o = i(e)) == null ? void 0 : o.onSuccess)) == null ? void 0 : u(n, a, r));
546
553
  }
547
554
  });
548
555
  }
549
556
  const Pe = "changeProfile post /account/change-profile";
550
- function Qt(e) {
557
+ function Ot(e) {
551
558
  const s = g(), t = S();
552
- return v({
559
+ return f({
553
560
  ...e,
554
561
  mutationFn: async (n) => s.query(Pe, m(n)),
555
562
  onSuccess: async (n, a, r) => {
556
563
  var o, u;
557
564
  await Promise.all([
558
- t.invalidateQueries({ queryKey: F.all() }),
559
- t.invalidateQueries({ queryKey: R.all() })
565
+ t.invalidateQueries({ queryKey: R.all() }),
566
+ t.invalidateQueries({ queryKey: F.all() })
560
567
  ]), await ((u = i((o = i(e)) == null ? void 0 : o.onSuccess)) == null ? void 0 : u(n, a, r));
561
568
  }
562
569
  });
563
570
  }
564
571
  const Qe = "loginCustomer post /account/login";
565
- function Mt(e) {
572
+ function At(e) {
566
573
  const s = g(), t = S();
567
- return v({
574
+ return f({
568
575
  ...e,
569
576
  mutationFn: async (n) => {
570
577
  const a = await s.queryRaw(Qe, {
571
578
  body: n
572
579
  }), r = a.headers.get("sw-context-token");
573
- return r && s.setContextToken(r), a.json();
580
+ return r && (s.contextToken = r), a.json();
574
581
  },
575
582
  onSuccess: async (n, a, r) => {
576
583
  var o, u;
577
584
  await Promise.all([
578
- t.removeQueries({ queryKey: R.all() }),
585
+ t.removeQueries({ queryKey: F.all() }),
579
586
  t.invalidateQueries({ queryKey: L.get() }),
580
- t.invalidateQueries({ queryKey: F.all() })
587
+ t.invalidateQueries({ queryKey: R.all() })
581
588
  ]), await ((u = i((o = i(e)) == null ? void 0 : o.onSuccess)) == null ? void 0 : u(n, a, r));
582
589
  }
583
590
  });
584
591
  }
585
592
  const Me = "logoutCustomer post /account/logout";
586
- function Ot(e) {
593
+ function Kt(e) {
587
594
  const s = g(), t = S();
588
- return v({
595
+ return f({
589
596
  ...e,
590
597
  mutationFn: async (n) => s.query(Me, m(n)),
591
598
  onSuccess: async (n, a, r) => {
592
599
  var o, u;
593
600
  await Promise.all([
594
- t.removeQueries({ queryKey: R.all() }),
601
+ t.removeQueries({ queryKey: F.all() }),
595
602
  t.invalidateQueries({ queryKey: L.get() }),
596
- t.invalidateQueries({ queryKey: F.all() })
603
+ t.invalidateQueries({ queryKey: R.all() })
597
604
  ]), await ((u = i((o = i(e)) == null ? void 0 : o.onSuccess)) == null ? void 0 : u(n, a, r));
598
605
  }
599
606
  });
600
607
  }
601
608
  const Oe = "readCustomer post /account/customer";
602
609
  function Ae(e) {
603
- const s = g(), t = F.detail(c(() => m(e).body ?? {}));
610
+ const s = g(), t = R.detail(c(() => m(e).body ?? {}));
604
611
  return M({
605
612
  queryKey: t,
606
613
  queryFn: async () => s.query(Oe, m(e))
@@ -610,73 +617,73 @@ function Ke(e) {
610
617
  return O(Ae(e));
611
618
  }
612
619
  const we = "register post /account/register";
613
- function At(e) {
620
+ function wt(e) {
614
621
  const s = g(), t = S();
615
- return v({
622
+ return f({
616
623
  ...e,
617
624
  mutationFn: async (n) => s.query(we, m(n)),
618
625
  onSuccess: async (n, a, r) => {
619
626
  var o, u;
620
- await t.invalidateQueries({ queryKey: F.all() }), await ((u = i((o = i(e)) == null ? void 0 : o.onSuccess)) == null ? void 0 : u(n, a, r));
627
+ await t.invalidateQueries({ queryKey: R.all() }), await ((u = i((o = i(e)) == null ? void 0 : o.onSuccess)) == null ? void 0 : u(n, a, r));
621
628
  }
622
629
  });
623
630
  }
624
- const Re = "defaultBillingAddress patch /account/address/default-billing/{addressId}";
625
- function Kt(e) {
631
+ const Fe = "defaultBillingAddress patch /account/address/default-billing/{addressId}";
632
+ function Ft(e) {
626
633
  const s = g(), t = S();
627
- return v({
634
+ return f({
628
635
  ...e,
629
- mutationFn: async (n) => s.query(Re, m(n)),
636
+ mutationFn: async (n) => s.query(Fe, m(n)),
630
637
  onSuccess: async (n, a, r) => {
631
638
  var o, u;
632
639
  await Promise.all([
633
- t.invalidateQueries({ queryKey: F.all() }),
634
- t.invalidateQueries({ queryKey: R.all() })
640
+ t.invalidateQueries({ queryKey: R.all() }),
641
+ t.invalidateQueries({ queryKey: F.all() })
635
642
  ]), await ((u = i((o = i(e)) == null ? void 0 : o.onSuccess)) == null ? void 0 : u(n, a, r));
636
643
  }
637
644
  });
638
645
  }
639
- const Fe = "defaultShippingAddress patch /account/address/default-shipping/{addressId}";
640
- function wt(e) {
646
+ const Re = "defaultShippingAddress patch /account/address/default-shipping/{addressId}";
647
+ function Rt(e) {
641
648
  const s = g(), t = S();
642
- return v({
649
+ return f({
643
650
  ...e,
644
- mutationFn: async (n) => s.query(Fe, m(n)),
651
+ mutationFn: async (n) => s.query(Re, m(n)),
645
652
  onSuccess: async (n, a, r) => {
646
653
  var o, u;
647
654
  await Promise.all([
648
- t.invalidateQueries({ queryKey: F.all() }),
649
- t.invalidateQueries({ queryKey: R.all() })
655
+ t.invalidateQueries({ queryKey: R.all() }),
656
+ t.invalidateQueries({ queryKey: F.all() })
650
657
  ]), await ((u = i((o = i(e)) == null ? void 0 : o.onSuccess)) == null ? void 0 : u(n, a, r));
651
658
  }
652
659
  });
653
660
  }
654
661
  const Ie = "deleteCustomer delete /account/customer";
655
- function Rt(e) {
662
+ function It(e) {
656
663
  const s = g(), t = S();
657
- return v({
664
+ return f({
658
665
  ...e,
659
666
  mutationFn: async (n) => s.query(Ie, m(n)),
660
667
  onSuccess: async (n, a, r) => {
661
668
  var o, u;
662
669
  await Promise.all([
663
- t.resetQueries({ queryKey: F.all() }),
664
670
  t.resetQueries({ queryKey: R.all() }),
671
+ t.resetQueries({ queryKey: F.all() }),
665
672
  t.resetQueries({ queryKey: L.get() })
666
673
  ]), await ((u = i((o = i(e)) == null ? void 0 : o.onSuccess)) == null ? void 0 : u(n, a, r));
667
674
  }
668
675
  });
669
676
  }
670
- const Le = "registerConfirm post /account/register-confirm";
671
- function Ft(e) {
677
+ const xe = "registerConfirm post /account/register-confirm";
678
+ function xt(e) {
672
679
  const s = g();
673
- return v({
680
+ return f({
674
681
  ...e,
675
682
  mutationFn: async (t) => {
676
- const n = await s.queryRaw(Le, {
683
+ const n = await s.queryRaw(xe, {
677
684
  body: t
678
685
  }), a = n.headers.get("sw-context-token");
679
- return a && s.setContextToken(a), n.json();
686
+ return a && (s.contextToken = a), n.json();
680
687
  },
681
688
  onSuccess: async (t, n, a) => {
682
689
  var r, o;
@@ -684,12 +691,12 @@ function Ft(e) {
684
691
  }
685
692
  });
686
693
  }
687
- const xe = "sendRecoveryMail post /account/recovery-password";
688
- function It(e) {
694
+ const Le = "sendRecoveryMail post /account/recovery-password";
695
+ function Lt(e) {
689
696
  const s = g();
690
- return v({
697
+ return f({
691
698
  ...e,
692
- mutationFn: async (t) => s.query(xe, m(t)),
699
+ mutationFn: async (t) => s.query(Le, m(t)),
693
700
  onSuccess: async (t, n, a) => {
694
701
  var r, o;
695
702
  await ((o = i((r = i(e)) == null ? void 0 : r.onSuccess)) == null ? void 0 : o(t, n, a));
@@ -697,9 +704,9 @@ function It(e) {
697
704
  });
698
705
  }
699
706
  const Ue = "changePassword post /account/change-password";
700
- function Lt(e) {
707
+ function Ut(e) {
701
708
  const s = g();
702
- return v({
709
+ return f({
703
710
  ...e,
704
711
  mutationFn: async (t) => s.query(Ue, m(t)),
705
712
  onSuccess: async (t, n, a) => {
@@ -709,9 +716,9 @@ function Lt(e) {
709
716
  });
710
717
  }
711
718
  const be = "recoveryPassword post /account/recovery-password-confirm";
712
- function xt(e) {
719
+ function bt(e) {
713
720
  const s = g();
714
- return v({
721
+ return f({
715
722
  ...e,
716
723
  mutationFn: async (t) => s.query(be, m(t)),
717
724
  onSuccess: async (t, n, a) => {
@@ -725,24 +732,24 @@ const ke = "readNavigation post /navigation/{activeId}/{rootId}", Be = function(
725
732
  return M({
726
733
  queryKey: r,
727
734
  queryFn: async ({ signal: o }) => {
728
- const u = i(s), f = i(t), C = m(n);
735
+ const u = i(s), h = i(t), C = m(n);
729
736
  return a.query(ke, {
730
737
  ...C,
731
738
  params: {
732
739
  activeId: u,
733
- rootId: f
740
+ rootId: h
734
741
  },
735
742
  signal: o
736
743
  });
737
744
  }
738
745
  });
739
746
  };
740
- function Ut(e, s, t) {
747
+ function kt(e, s, t) {
741
748
  return O(Be(e, s, t));
742
749
  }
743
750
  const Ne = "readPaymentMethod post /payment-method";
744
751
  function De(e) {
745
- const s = g(), t = N.list(c(() => {
752
+ const s = g(), t = D.list(c(() => {
746
753
  var n;
747
754
  return (n = m(e)) == null ? void 0 : n.body;
748
755
  }));
@@ -758,9 +765,9 @@ function Ee(e) {
758
765
  return O(De(e));
759
766
  }
760
767
  const je = "handlePaymentMethod post /handle-payment";
761
- function bt(e) {
768
+ function Bt(e) {
762
769
  const s = g();
763
- return v({
770
+ return f({
764
771
  ...e,
765
772
  mutationFn: async (t) => s.query(je, m(t)),
766
773
  onSuccess: async (t, n, a) => {
@@ -770,9 +777,9 @@ function bt(e) {
770
777
  });
771
778
  }
772
779
  const Te = "orderSetPayment post /order/payment";
773
- function kt(e) {
780
+ function Nt(e) {
774
781
  const s = g(), t = S();
775
- return v({
782
+ return f({
776
783
  ...e,
777
784
  mutationFn: async (n) => s.query(Te, m(n)),
778
785
  onSuccess: async (n, a, r) => {
@@ -782,7 +789,7 @@ function kt(e) {
782
789
  });
783
790
  }
784
791
  const Ve = "readCategoryList post /category", $e = function(s) {
785
- const t = g(), n = k.list(s);
792
+ const t = g(), n = B.list(s);
786
793
  return M({
787
794
  queryKey: n,
788
795
  queryFn: async ({ signal: a }) => t.query(Ve, {
@@ -791,7 +798,7 @@ const Ve = "readCategoryList post /category", $e = function(s) {
791
798
  })
792
799
  });
793
800
  };
794
- function Bt(e) {
801
+ function Dt(e) {
795
802
  return O($e(e));
796
803
  }
797
804
  const ze = "readCompactProductListing post /novu/headless/product-listing/{seoUrl}";
@@ -805,14 +812,14 @@ function Ge(e, s) {
805
812
  ...r,
806
813
  params: {
807
814
  ...r.params,
808
- seoUrl: T(i(e))
815
+ seoUrl: V(i(e))
809
816
  },
810
817
  signal: a
811
818
  });
812
819
  }
813
820
  });
814
821
  }
815
- function Nt(e, s) {
822
+ function Et(e, s) {
816
823
  return O(Ge(e, s));
817
824
  }
818
825
  const He = "readCustomProductDetail post /novu/headless/product/{seoUrl}";
@@ -826,78 +833,95 @@ function We(e, s) {
826
833
  ...r,
827
834
  params: {
828
835
  ...r.params,
829
- seoUrl: T(i(e))
836
+ seoUrl: V(i(e))
830
837
  },
831
838
  signal: a
832
839
  });
833
840
  }
834
841
  });
835
842
  }
836
- function Dt(e, s) {
843
+ function jt(e, s) {
837
844
  return O(We(e, s));
838
845
  }
839
- const Je = "readSalutation post /salutation", Xe = function(s) {
840
- const t = g(), n = E.list(s);
846
+ const Je = "searchPage post /search";
847
+ function Xe(e) {
848
+ const s = g(), t = x.search(e);
849
+ return M({
850
+ queryKey: t,
851
+ queryFn: async ({ signal: n }) => {
852
+ const a = m(e);
853
+ return s.query(Je, {
854
+ ...a,
855
+ signal: n
856
+ });
857
+ }
858
+ });
859
+ }
860
+ function Tt(e) {
861
+ return O(Xe(e));
862
+ }
863
+ const Ye = "readSalutation post /salutation", Ze = function(s) {
864
+ const t = g(), n = j.list(s);
841
865
  return M({
842
866
  queryKey: n,
843
867
  queryFn: async ({ signal: a }) => {
844
868
  const r = m(s);
845
- return t.query(Je, {
869
+ return t.query(Ye, {
846
870
  ...r,
847
871
  signal: a
848
872
  });
849
873
  }
850
874
  });
851
875
  };
852
- function Et(e) {
853
- return O(Xe(e));
876
+ function Vt(e) {
877
+ return O(Ze(e));
854
878
  }
855
- const Ye = "readSeoUrl post /seo-url", Ze = function(s) {
856
- const t = g(), n = D.list(s);
879
+ const _e = "readSeoUrl post /seo-url", et = function(s) {
880
+ const t = g(), n = E.list(s);
857
881
  return M({
858
882
  queryKey: n,
859
883
  queryFn: async ({ signal: a }) => {
860
884
  const r = m(s);
861
- return t.query(Ye, {
885
+ return t.query(_e, {
862
886
  ...r,
863
887
  signal: a
864
888
  });
865
889
  }
866
890
  });
867
891
  };
868
- function jt(e) {
869
- return O(Ze(e));
892
+ function $t(e) {
893
+ return O(et(e));
870
894
  }
871
- const _e = "readShippingMethod post /shipping-method";
872
- function et(e) {
873
- const s = g(), t = B.list(c(() => {
895
+ const tt = "readShippingMethod post /shipping-method";
896
+ function nt(e) {
897
+ const s = g(), t = N.list(c(() => {
874
898
  var n;
875
899
  return (n = m(e)) == null ? void 0 : n.body;
876
900
  }));
877
901
  return M({
878
902
  queryKey: t,
879
- queryFn: ({ signal: n }) => s.query(_e, {
903
+ queryFn: ({ signal: n }) => s.query(tt, {
880
904
  ...m(e),
881
905
  signal: n
882
906
  })
883
907
  });
884
908
  }
885
- function tt(e) {
886
- return O(et(e));
909
+ function st(e) {
910
+ return O(nt(e));
887
911
  }
888
- function Tt() {
889
- const e = V(), s = $(), t = Ee({
912
+ function zt() {
913
+ const e = k(), s = $(), t = Ee({
890
914
  query: {
891
915
  onlyAvailable: !0
892
916
  }
893
917
  }), n = c(() => s.isPending.value), a = async (u) => s.mutateAsync({
894
918
  paymentMethodId: u
895
919
  }), r = c(() => {
896
- var u, f;
897
- return (f = (u = e.data) == null ? void 0 : u.value) == null ? void 0 : f.paymentMethod;
920
+ var u, h;
921
+ return (h = (u = e.data) == null ? void 0 : u.value) == null ? void 0 : h.paymentMethod;
898
922
  }), o = c(() => {
899
- var u, f, C;
900
- return ((C = (f = (u = t.data) == null ? void 0 : u.value) == null ? void 0 : f.elements) == null ? void 0 : C.sort((d, P) => (d.position ?? 0) - (P.position ?? 0))) ?? [];
923
+ var u, h, C;
924
+ return ((C = (h = (u = t.data) == null ? void 0 : u.value) == null ? void 0 : h.elements) == null ? void 0 : C.sort((d, P) => (d.position ?? 0) - (P.position ?? 0))) ?? [];
901
925
  });
902
926
  return {
903
927
  contextUpdateMutation: s,
@@ -909,19 +933,19 @@ function Tt() {
909
933
  paymentMethods: o
910
934
  };
911
935
  }
912
- function Vt() {
913
- const e = V(), s = $(), t = tt({
936
+ function Gt() {
937
+ const e = k(), s = $(), t = st({
914
938
  query: {
915
939
  onlyAvailable: !0
916
940
  }
917
941
  }), n = c(() => s.isPending.value), a = async (u) => s.mutateAsync({
918
942
  shippingMethodId: u
919
943
  }), r = c(() => {
920
- var u, f;
921
- return (f = (u = e.data) == null ? void 0 : u.value) == null ? void 0 : f.shippingMethod;
944
+ var u, h;
945
+ return (h = (u = e.data) == null ? void 0 : u.value) == null ? void 0 : h.shippingMethod;
922
946
  }), o = c(() => {
923
- var u, f;
924
- return ((f = (u = t.data) == null ? void 0 : u.value) == null ? void 0 : f.elements.sort((C, d) => (C.position ?? 0) - (d.position ?? 0))) ?? [];
947
+ var u, h;
948
+ return ((h = (u = t.data) == null ? void 0 : u.value) == null ? void 0 : h.elements.sort((C, d) => (C.position ?? 0) - (d.position ?? 0))) ?? [];
925
949
  });
926
950
  return {
927
951
  contextUpdateMutation: s,
@@ -933,12 +957,25 @@ function Vt() {
933
957
  shippingMethods: o
934
958
  };
935
959
  }
936
- const nt = (e, s) => {
960
+ const rt = (e, s) => {
937
961
  var n;
938
- const t = (n = e.extensions) == null ? void 0 : n.novuSeoUrls;
962
+ const t = (n = e == null ? void 0 : e.extensions) == null ? void 0 : n.novuSeoUrls;
963
+ if (Array.isArray(s)) {
964
+ const a = s.find((r) => !!(t != null && t[r]));
965
+ return a ? (t == null ? void 0 : t[a]) ?? "" : "";
966
+ }
939
967
  return (t == null ? void 0 : t[s]) ?? "";
940
- }, $t = (e, s) => c(() => nt(i(e), i(s)));
941
- function zt(e) {
968
+ }, Ht = () => {
969
+ const e = k(), s = c(() => {
970
+ var t, n, a;
971
+ return ((a = (n = (t = e.data) == null ? void 0 : t.value) == null ? void 0 : n.context) == null ? void 0 : a.languageIdChain) ?? [];
972
+ });
973
+ return (t, n) => {
974
+ const a = [n, ...s.value];
975
+ return rt(i(t), i(a));
976
+ };
977
+ };
978
+ function Wt(e) {
942
979
  const { total: s, limit: t, page: n, totalCountMode: a } = e ?? {}, r = Z({
943
980
  page: n ?? 1,
944
981
  total: s ?? 0,
@@ -958,7 +995,7 @@ function zt(e) {
958
995
  r.page = Math.min(Q, r.page), r.total = y.total ?? 0, r.limit = y.limit;
959
996
  }
960
997
  );
961
- const f = c(() => r.page === i(o)), C = c(() => r.page === 1), d = c(() => ({
998
+ const h = c(() => r.page === i(o)), C = c(() => r.page === 1), d = c(() => ({
962
999
  p: r.page,
963
1000
  limit: r.limit,
964
1001
  "total-count-mode": r.totalCountMode ?? "none"
@@ -972,7 +1009,7 @@ function zt(e) {
972
1009
  total: W(r, "total"),
973
1010
  limit: W(r, "limit"),
974
1011
  pageCount: o,
975
- isLastPage: f,
1012
+ isLastPage: h,
976
1013
  isFirstPage: C,
977
1014
  usePaginationSync: P,
978
1015
  // This can be used to pass the pagination options directly to the query options
@@ -990,37 +1027,37 @@ function X(e) {
990
1027
  unitPrice: n
991
1028
  }));
992
1029
  }
993
- function Gt(e) {
1030
+ function Jt(e) {
994
1031
  const s = c(() => {
995
1032
  var y;
996
1033
  return (y = e.value) == null ? void 0 : y.calculatedCheapestPrice;
997
1034
  }), t = c(
998
1035
  () => {
999
- var y, h, A, K, l;
1000
- return (((h = (y = e.value) == null ? void 0 : y.calculatedPrices) == null ? void 0 : h.length) ?? 0) > 0 ? (K = (A = e.value) == null ? void 0 : A.calculatedPrices) == null ? void 0 : K[0] : (l = e.value) == null ? void 0 : l.calculatedPrice;
1036
+ var y, v, A, K, l;
1037
+ return (((v = (y = e.value) == null ? void 0 : y.calculatedPrices) == null ? void 0 : v.length) ?? 0) > 0 ? (K = (A = e.value) == null ? void 0 : A.calculatedPrices) == null ? void 0 : K[0] : (l = e.value) == null ? void 0 : l.calculatedPrice;
1001
1038
  }
1002
1039
  ), n = c(() => {
1003
1040
  var y;
1004
1041
  return (y = t == null ? void 0 : t.value) == null ? void 0 : y.referencePrice;
1005
1042
  }), a = c(() => {
1006
- var y, h;
1007
- return (((h = (y = e.value) == null ? void 0 : y.calculatedPrices) == null ? void 0 : h.length) ?? 0) > 1;
1043
+ var y, v;
1044
+ return (((v = (y = e.value) == null ? void 0 : y.calculatedPrices) == null ? void 0 : v.length) ?? 0) > 1;
1008
1045
  }), r = c(
1009
1046
  () => {
1010
- var y, h, A, K, l, p;
1011
- return !!((y = e.value) != null && y.parentId) && ((A = (h = e.value) == null ? void 0 : h.calculatedCheapestPrice) == null ? void 0 : A.hasRange) && ((K = t == null ? void 0 : t.value) == null ? void 0 : K.unitPrice) !== ((l = s == null ? void 0 : s.value) == null ? void 0 : l.unitPrice) && ((p = s == null ? void 0 : s.value) == null ? void 0 : p.unitPrice);
1047
+ var y, v, A, K, l, p;
1048
+ return !!((y = e.value) != null && y.parentId) && ((A = (v = e.value) == null ? void 0 : v.calculatedCheapestPrice) == null ? void 0 : A.hasRange) && ((K = t == null ? void 0 : t.value) == null ? void 0 : K.unitPrice) !== ((l = s == null ? void 0 : s.value) == null ? void 0 : l.unitPrice) && ((p = s == null ? void 0 : s.value) == null ? void 0 : p.unitPrice);
1012
1049
  }
1013
1050
  ), o = c(
1014
1051
  () => {
1015
- var y, h;
1016
- return a.value && X(e.value).length > 1 ? (h = (y = e.value) == null ? void 0 : y.calculatedPrices) == null ? void 0 : h.reduce((A, K) => K.unitPrice < A.unitPrice ? K : A) : t.value;
1052
+ var y, v;
1053
+ return a.value && X(e.value).length > 1 ? (v = (y = e.value) == null ? void 0 : y.calculatedPrices) == null ? void 0 : v.reduce((A, K) => K.unitPrice < A.unitPrice ? K : A) : t.value;
1017
1054
  }
1018
1055
  ), u = c(
1019
1056
  () => {
1020
1057
  var y;
1021
1058
  return (y = o.value) == null ? void 0 : y.unitPrice;
1022
1059
  }
1023
- ), f = c(
1060
+ ), h = c(
1024
1061
  () => {
1025
1062
  var y;
1026
1063
  return (y = o.value) == null ? void 0 : y.totalPrice;
@@ -1028,17 +1065,17 @@ function Gt(e) {
1028
1065
  ), C = c(
1029
1066
  () => o.value
1030
1067
  ), d = c(() => {
1031
- var y, h;
1032
- return !!((h = (y = o.value) == null ? void 0 : y.listPrice) != null && h.percentage);
1068
+ var y, v;
1069
+ return !!((v = (y = o.value) == null ? void 0 : y.listPrice) != null && v.percentage);
1033
1070
  }), P = c(
1034
1071
  () => {
1035
- var y, h, A;
1036
- return (A = (h = (y = e.value) == null ? void 0 : y.calculatedPrice) == null ? void 0 : h.regulationPrice) == null ? void 0 : A.price;
1072
+ var y, v, A;
1073
+ return (A = (v = (y = e.value) == null ? void 0 : y.calculatedPrice) == null ? void 0 : v.regulationPrice) == null ? void 0 : A.price;
1037
1074
  }
1038
1075
  ), Q = c(() => X(e.value));
1039
1076
  return {
1040
1077
  price: C,
1041
- totalPrice: f,
1078
+ totalPrice: h,
1042
1079
  unitPrice: u,
1043
1080
  displayFromVariants: r,
1044
1081
  displayFrom: a,
@@ -1048,7 +1085,7 @@ function Gt(e) {
1048
1085
  regulationPrice: P
1049
1086
  };
1050
1087
  }
1051
- function st(e, s) {
1088
+ function at(e, s) {
1052
1089
  var n;
1053
1090
  const t = (n = e.extensions) == null ? void 0 : n.variants;
1054
1091
  return s.length === 0 ? (t == null ? void 0 : t.find((a) => {
@@ -1059,16 +1096,16 @@ function st(e, s) {
1059
1096
  return (r = a.optionIds) == null ? void 0 : r.every((o) => s.includes(o));
1060
1097
  });
1061
1098
  }
1062
- function Ht(e, s) {
1063
- return c(() => st(i(e), i(s)));
1099
+ function Xt(e, s) {
1100
+ return c(() => at(i(e), i(s)));
1064
1101
  }
1065
- function Wt(e) {
1102
+ function Yt(e) {
1066
1103
  return c(() => {
1067
1104
  var s, t, n, a, r, o;
1068
1105
  return !!((t = (s = i(e)) == null ? void 0 : s.customer) != null && t.id) && !!((a = (n = i(e)) == null ? void 0 : n.customer) != null && a.active) && !((o = (r = i(e)) == null ? void 0 : r.customer) != null && o.guest);
1069
1106
  });
1070
1107
  }
1071
- function Jt(e) {
1108
+ function Zt(e) {
1072
1109
  const s = Ke(e ? { body: e } : void 0), t = c(() => {
1073
1110
  var d;
1074
1111
  return (d = s.data) == null ? void 0 : d.value;
@@ -1095,7 +1132,7 @@ function Jt(e) {
1095
1132
  var d;
1096
1133
  return ((d = t.value) == null ? void 0 : d.defaultShippingAddressId) || null;
1097
1134
  }
1098
- ), f = c(
1135
+ ), h = c(
1099
1136
  () => {
1100
1137
  var d;
1101
1138
  return ((d = t.value) == null ? void 0 : d.defaultBillingAddress) || null;
@@ -1114,96 +1151,97 @@ function Jt(e) {
1114
1151
  isGuestSession: r,
1115
1152
  defaultBillingAddressId: o,
1116
1153
  defaultShippingAddressId: u,
1117
- userDefaultBillingAddress: f,
1154
+ userDefaultBillingAddress: h,
1118
1155
  userDefaultShippingAddress: C,
1119
1156
  // Expose queries and mutations directly
1120
1157
  customerQuery: s
1121
1158
  };
1122
1159
  }
1123
1160
  export {
1124
- it as absolutizeSeoUrl,
1161
+ lt as absolutizeSeoUrl,
1125
1162
  w as addressKeys,
1126
1163
  L as cartKeys,
1127
- k as categoryKeys,
1128
- R as contextKeys,
1129
- j as countryKeys,
1130
- F as customerKeys,
1131
- st as getProductVariantForOptions,
1132
- nt as getSeoUrl,
1164
+ B as categoryKeys,
1165
+ F as contextKeys,
1166
+ T as countryKeys,
1167
+ R as customerKeys,
1168
+ at as getProductVariantForOptions,
1133
1169
  se as isAsynchronousOrder,
1134
1170
  b as navigationKeys,
1135
1171
  U as orderKeys,
1136
- N as paymentKeys,
1172
+ D as paymentKeys,
1137
1173
  x as productKeys,
1138
1174
  Ne as readPaymentMethodOperation,
1139
- _e as readShippingMethodOperation,
1140
- T as relativizeSeoUrl,
1141
- E as salutationKeys,
1142
- D as seoUrlKeys,
1143
- B as shippingKeys,
1175
+ tt as readShippingMethodOperation,
1176
+ V as relativizeSeoUrl,
1177
+ j as salutationKeys,
1178
+ E as seoUrlKeys,
1179
+ N as shippingKeys,
1144
1180
  _ as shopwareClientKey,
1145
1181
  m as unrefOptions,
1146
- ft as useAddLineItemMutation,
1147
- Pt as useChangeEmailMutation,
1148
- Lt as useChangePasswordMutation,
1149
- Qt as useChangeProfileMutation,
1150
- lt as useCheckoutAddresses,
1151
- pt as useCreateCustomerAddressMutation,
1152
- Ct as useCreateOrderMutation,
1153
- Kt as useDefaultBillingAddressMutation,
1154
- wt as useDefaultShippingAddressMutation,
1155
- mt as useDeleteCustomerAddressMutation,
1156
- Rt as useDeleteCustomerMutation,
1157
- bt as useHandlePaymentMutation,
1158
- Wt as useIsLoggedIn,
1182
+ vt as useAddLineItemMutation,
1183
+ Mt as useChangeEmailMutation,
1184
+ Ut as useChangePasswordMutation,
1185
+ Ot as useChangeProfileMutation,
1186
+ yt as useCheckoutAddresses,
1187
+ gt as useCreateCustomerAddressMutation,
1188
+ Pt as useCreateOrderMutation,
1189
+ Ft as useDefaultBillingAddressMutation,
1190
+ Rt as useDefaultShippingAddressMutation,
1191
+ ht as useDeleteCustomerAddressMutation,
1192
+ It as useDeleteCustomerMutation,
1193
+ Bt as useHandlePaymentMutation,
1194
+ Yt as useIsLoggedIn,
1159
1195
  ne as useListAddressQuery,
1160
1196
  te as useListAddressQueryOptions,
1161
- Mt as useLoginCustomerMutation,
1162
- Ot as useLogoutCustomerMutation,
1163
- ct as useOptimistic,
1164
- dt as useOrderDetails,
1165
- yt as useOrderPayment,
1166
- kt as useOrderSetPaymentMutation,
1167
- zt as usePagination,
1168
- Tt as usePaymentMethods,
1169
- Gt as useProductPrice,
1170
- Ht as useProductVariantForOptions,
1171
- vt as useReadCartQuery,
1197
+ At as useLoginCustomerMutation,
1198
+ Kt as useLogoutCustomerMutation,
1199
+ dt as useOptimistic,
1200
+ pt as useOrderDetails,
1201
+ mt as useOrderPayment,
1202
+ Nt as useOrderSetPaymentMutation,
1203
+ Wt as usePagination,
1204
+ zt as usePaymentMethods,
1205
+ Jt as useProductPrice,
1206
+ Xt as useProductVariantForOptions,
1207
+ qt as useReadCartQuery,
1172
1208
  ge as useReadCartQueryOptions,
1173
- Bt as useReadCategoryListQuery,
1209
+ Dt as useReadCategoryListQuery,
1174
1210
  $e as useReadCategoryListQueryOptions,
1175
- Nt as useReadCompactProductListingQuery,
1211
+ Et as useReadCompactProductListingQuery,
1176
1212
  Ge as useReadCompactProductListingQueryOptions,
1177
- V as useReadContextQuery,
1213
+ k as useReadContextQuery,
1178
1214
  ae as useReadContextQueryOptions,
1179
- St as useReadCountryQuery,
1215
+ Qt as useReadCountryQuery,
1180
1216
  Ce as useReadCountryQueryOptions,
1181
1217
  We as useReadCustomProductDetailOptions,
1182
- Dt as useReadCustomProductDetailQuery,
1218
+ jt as useReadCustomProductDetailQuery,
1183
1219
  Ke as useReadCustomerQuery,
1184
1220
  Ae as useReadCustomerQueryOptions,
1185
- Ut as useReadNavigationQuery,
1221
+ kt as useReadNavigationQuery,
1186
1222
  Be as useReadNavigationQueryOptions,
1187
1223
  ce as useReadOrderQuery,
1188
1224
  ie as useReadOrderQueryOptions,
1189
1225
  Ee as useReadPaymentMethodQuery,
1190
1226
  De as useReadPaymentMethodQueryOptions,
1191
- Et as useReadSalutationQuery,
1192
- Xe as useReadSalutationQueryOptions,
1193
- jt as useReadSeoUrlQuery,
1194
- Ze as useReadSeoUrlQueryOptions,
1195
- tt as useReadShippingMethodQuery,
1196
- et as useReadShippingMethodQueryOptions,
1197
- xt as useRecoveryPasswordMutation,
1198
- Ft as useRegisterConfirmMutation,
1199
- At as useRegisterCustomerMutation,
1200
- ht as useRemoveLineItemMutation,
1201
- It as useSendRecoveryMailMutation,
1202
- $t as useSeoUrl,
1203
- Vt as useShippingMethods,
1227
+ Vt as useReadSalutationQuery,
1228
+ Ze as useReadSalutationQueryOptions,
1229
+ $t as useReadSeoUrlQuery,
1230
+ et as useReadSeoUrlQueryOptions,
1231
+ st as useReadShippingMethodQuery,
1232
+ nt as useReadShippingMethodQueryOptions,
1233
+ bt as useRecoveryPasswordMutation,
1234
+ xt as useRegisterConfirmMutation,
1235
+ wt as useRegisterCustomerMutation,
1236
+ Ct as useRemoveLineItemMutation,
1237
+ Tt as useSearchPageQuery,
1238
+ Xe as useSearchPageQueryOptions,
1239
+ Lt as useSendRecoveryMailMutation,
1240
+ Ht as useSeoUrl,
1241
+ Gt as useShippingMethods,
1204
1242
  g as useShopwareQueryClient,
1205
1243
  $ as useUpdateContextMutation,
1206
- gt as useUpdateCustomerAddressMutation,
1207
- qt as useUpdateLineItemMutation,
1208
- Jt as useUser
1244
+ ft as useUpdateCustomerAddressMutation,
1245
+ St as useUpdateLineItemMutation,
1246
+ Zt as useUser
1209
1247
  };
package/dist/keys.d.ts CHANGED
@@ -34,6 +34,9 @@ export declare const productKeys: {
34
34
  readonly url: MaybeRef<string>;
35
35
  readonly body: unknown;
36
36
  }];
37
+ search: (body: MaybeRef<unknown>) => readonly ["product", "search", {
38
+ readonly body: unknown;
39
+ }];
37
40
  };
38
41
  export declare const cartKeys: {
39
42
  get: () => readonly ["cart"];
@@ -1,3 +1,4 @@
1
1
  export * from './useReadCategoryListQuery';
2
2
  export * from './useReadCompactProductListingQuery';
3
3
  export * from './useReadCustomProductDetailQuery';
4
+ export * from './useSearchPageQuery';
@@ -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 searchPageOperation = "searchPage post /search";
6
+ export declare function useSearchPageQueryOptions(body?: OperationOptions<typeof searchPageOperation, 'params'>): UndefinedInitialQueryOptions<BrandedResponse<Operations, "searchPage post /search">, Error, BrandedResponse<Operations, "searchPage post /search">, readonly ["product", "search", {
7
+ readonly body: unknown;
8
+ }]> & {
9
+ queryKey: readonly ["product", "search", {
10
+ readonly body: unknown;
11
+ }] & {
12
+ [dataTagSymbol]: BrandedResponse<Operations, "searchPage post /search">;
13
+ [dataTagErrorSymbol]: Error;
14
+ };
15
+ };
16
+ export declare function useSearchPageQuery(body?: OperationOptions<typeof searchPageOperation, 'params'>): UseQueryReturnType<BrandedResponse<Operations, "searchPage post /search">, Error>;
17
+ export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@teamnovu/kit-shopware-composables",
3
- "version": "0.0.8",
3
+ "version": "0.0.10",
4
4
  "description": "A collection of composables for the Shopware API",
5
5
  "main": "dist/index.mjs",
6
6
  "module": "dist/index.mjs",
@@ -15,9 +15,9 @@
15
15
  }
16
16
  },
17
17
  "peerDependencies": {
18
- "@tanstack/vue-query": "^5.75.5",
18
+ "@tanstack/vue-query": "^5.85.3",
19
19
  "vue": "^3.0.0",
20
- "@teamnovu/kit-shopware-api-client": "0.0.6"
20
+ "@teamnovu/kit-shopware-api-client": "0.0.8"
21
21
  },
22
22
  "repository": {
23
23
  "type": "git",
@@ -1,6 +1,6 @@
1
1
  import type { GenericRecord } from '#store-types'
2
- import type { MaybeRef } from 'vue'
3
2
  import { computed, unref } from 'vue'
3
+ import { useReadContextQuery } from '../../query'
4
4
 
5
5
  interface SeoUrlEntity {
6
6
  extensions?: {
@@ -8,11 +8,21 @@ interface SeoUrlEntity {
8
8
  }
9
9
  }
10
10
 
11
- export const getSeoUrl = <T extends SeoUrlEntity>(entity: T, languageId: string) => {
12
- const urls = entity.extensions?.novuSeoUrls as Record<string, string>
11
+ const getSeoUrl = <T extends SeoUrlEntity>(entity: T, languageId: string | string[]) => {
12
+ const urls = entity?.extensions?.novuSeoUrls as Record<string, string>
13
+ if (Array.isArray(languageId)) {
14
+ const matchedId = languageId.find(id => !!urls?.[id])
15
+ return matchedId ? urls?.[matchedId] ?? '' : ''
16
+ }
13
17
  return urls?.[languageId] ?? ''
14
18
  }
15
19
 
16
- export const useSeoUrl = <T extends SeoUrlEntity>(entity: MaybeRef<T>, languageId: MaybeRef<string>) => {
17
- return computed(() => getSeoUrl(unref(entity), unref(languageId)))
20
+ export const useSeoUrl = <T extends SeoUrlEntity>() => {
21
+ const contextQuery = useReadContextQuery()
22
+ const contextLanguageChain = computed(() => contextQuery.data?.value?.context?.languageIdChain ?? [])
23
+
24
+ return (entity: T, languageId: string) => {
25
+ const languageChain = [languageId, ...contextLanguageChain.value]
26
+ return getSeoUrl(unref(entity), unref(languageChain))
27
+ }
18
28
  }
package/src/keys.ts CHANGED
@@ -62,6 +62,14 @@ export const productKeys = {
62
62
  body,
63
63
  },
64
64
  ] as const,
65
+ search: (body: MaybeRef<unknown>) =>
66
+ [
67
+ ...productKeys.all(),
68
+ 'search',
69
+ {
70
+ body,
71
+ },
72
+ ] as const,
65
73
  }
66
74
 
67
75
  export const cartKeys = {
@@ -27,7 +27,7 @@ export function useLoginCustomerMutation(
27
27
  const contextToken = response.headers.get('sw-context-token')
28
28
 
29
29
  if (contextToken) {
30
- client.setContextToken(contextToken)
30
+ client.contextToken = contextToken
31
31
  }
32
32
 
33
33
  return response.json()
@@ -25,7 +25,7 @@ export function useRegisterConfirmMutation(
25
25
  const contextToken = response.headers.get('sw-context-token')
26
26
 
27
27
  if (contextToken) {
28
- client.setContextToken(contextToken)
28
+ client.contextToken = contextToken
29
29
  }
30
30
 
31
31
  return response.json() as Promise<never>
@@ -1,3 +1,4 @@
1
1
  export * from './useReadCategoryListQuery'
2
2
  export * from './useReadCompactProductListingQuery'
3
3
  export * from './useReadCustomProductDetailQuery'
4
+ export * from './useSearchPageQuery'
@@ -0,0 +1,31 @@
1
+ import { queryOptions, useQuery } from '@tanstack/vue-query'
2
+ import { useShopwareQueryClient } from '../../inject'
3
+ import { productKeys } from '../../keys'
4
+ import { unrefOptions } from '../../util/unrefOptions'
5
+ import type { OperationKey, OperationOptions } from '../types/query'
6
+
7
+ const searchPageOperation = 'searchPage post /search' satisfies OperationKey
8
+
9
+ export function useSearchPageQueryOptions(
10
+ body?: OperationOptions<typeof searchPageOperation, 'params'>,
11
+ ) {
12
+ const client = useShopwareQueryClient()
13
+ const queryKey = productKeys.search(body)
14
+
15
+ return queryOptions({
16
+ queryKey,
17
+ queryFn: async ({ signal }) => {
18
+ const opts = unrefOptions(body)
19
+ return client.query(searchPageOperation, {
20
+ ...opts,
21
+ signal,
22
+ })
23
+ },
24
+ })
25
+ }
26
+
27
+ export function useSearchPageQuery(
28
+ body?: OperationOptions<typeof searchPageOperation, 'params'>,
29
+ ) {
30
+ return useQuery(useSearchPageQueryOptions(body))
31
+ }