@teamnovu/kit-shopware-composables 0.0.5 → 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.
Files changed (105) hide show
  1. package/dist/global.d.ts +8 -0
  2. package/dist/helpers/checkout/index.d.ts +1 -1
  3. package/dist/helpers/checkout/{useAddresses.d.ts → useCheckoutAddresses.d.ts} +9 -51
  4. package/dist/helpers/checkout/useOrderDetails.d.ts +3 -8
  5. package/dist/helpers/checkout/usePaymentMethods.d.ts +11 -49
  6. package/dist/helpers/checkout/useShippingMethods.d.ts +11 -55
  7. package/dist/helpers/general/usePagination.d.ts +3 -1
  8. package/dist/helpers/user/useIsLoggedIn.d.ts +3 -2
  9. package/dist/helpers/user/useUser.d.ts +4 -106
  10. package/dist/index.mjs +808 -640
  11. package/dist/keys.d.ts +42 -1
  12. package/dist/query/address/index.d.ts +1 -0
  13. package/dist/query/address/useCreateCustomerAddressMutation.d.ts +7 -6
  14. package/dist/query/address/useDeleteCustomerAddressMutation.d.ts +2 -1
  15. package/dist/query/address/useListAddressQuery.d.ts +5 -36
  16. package/dist/query/address/useUpdateCustomerAddressMutation.d.ts +167 -0
  17. package/dist/query/cart/useAddLineItemMutation.d.ts +7 -6
  18. package/dist/query/cart/useReadCartQuery.d.ts +5 -100
  19. package/dist/query/cart/useRemoveLineItemMutation.d.ts +7 -6
  20. package/dist/query/cart/useUpdateLineItemMutation.d.ts +7 -6
  21. package/dist/query/checkout/index.d.ts +0 -1
  22. package/dist/query/checkout/useCreateOrderMutation.d.ts +7 -6
  23. package/dist/query/context/useReadContextQuery.d.ts +8 -148
  24. package/dist/query/context/useUpdateContextMutation.d.ts +7 -6
  25. package/dist/query/country/index.d.ts +1 -0
  26. package/dist/query/country/useReadCountryQuery.d.ts +17 -0
  27. package/dist/query/customer/useChangeEmailMutation.d.ts +7 -6
  28. package/dist/query/customer/useChangeProfileMutation.d.ts +7 -6
  29. package/dist/query/customer/useLoginCustomerMutation.d.ts +7 -6
  30. package/dist/query/customer/useLogoutCustomerMutation.d.ts +7 -6
  31. package/dist/query/customer/useReadCustomerQuery.d.ts +10 -213
  32. package/dist/query/customer/useRegisterCustomerMutation.d.ts +7 -6
  33. package/dist/query/index.d.ts +4 -0
  34. package/dist/query/navigation/index.d.ts +1 -0
  35. package/dist/query/navigation/useReadNavigationQuery.d.ts +22 -0
  36. package/dist/query/order/useReadOrderQuery.d.ts +5 -32
  37. package/dist/query/payment/useHandlePaymentMutation.d.ts +7 -6
  38. package/dist/query/payment/useOrderSetPaymentMutation.d.ts +7 -6
  39. package/dist/query/payment/useReadPaymentMethodQuery.d.ts +5 -20
  40. package/dist/query/products/useReadCategoryListQuery.d.ts +5 -36
  41. package/dist/query/products/useReadCompactProductListingQuery.d.ts +5 -20
  42. package/dist/query/products/useReadCustomProductDetailQuery.d.ts +5 -52
  43. package/dist/query/salutation/index.d.ts +1 -0
  44. package/dist/query/salutation/useReadSalutationQuery.d.ts +17 -0
  45. package/dist/query/seoUrl/index.d.ts +1 -0
  46. package/dist/query/seoUrl/useReadSeoUrlQuery.d.ts +17 -0
  47. package/dist/query/shipping/useReadShippingMethodQuery.d.ts +5 -44
  48. package/dist/query/types/index.d.ts +1 -0
  49. package/dist/query/types/operations.d.ts +3 -3
  50. package/dist/query/types/query.d.ts +2 -3
  51. package/dist/query/types/util.d.ts +6 -0
  52. package/dist/util/unrefOptions.d.ts +2 -2
  53. package/docs/index.md +3 -3
  54. package/package.json +6 -4
  55. package/src/global.d.ts +8 -0
  56. package/src/helpers/checkout/index.ts +1 -1
  57. package/src/helpers/checkout/{useAddresses.ts → useCheckoutAddresses.ts} +2 -2
  58. package/src/helpers/checkout/useOrderDetails.ts +1 -1
  59. package/src/helpers/checkout/useOrderPayment.ts +1 -1
  60. package/src/helpers/checkout/usePaymentMethods.ts +5 -2
  61. package/src/helpers/checkout/useShippingMethods.ts +5 -2
  62. package/src/helpers/general/usePagination.ts +10 -5
  63. package/src/helpers/user/useIsLoggedIn.ts +6 -8
  64. package/src/helpers/user/useUser.ts +1 -1
  65. package/src/inject.ts +1 -1
  66. package/src/keys.ts +66 -1
  67. package/src/query/address/index.ts +1 -0
  68. package/src/query/address/useCreateCustomerAddressMutation.ts +7 -6
  69. package/src/query/address/useDeleteCustomerAddressMutation.ts +7 -6
  70. package/src/query/address/useUpdateCustomerAddressMutation.ts +42 -0
  71. package/src/query/cart/useAddLineItemMutation.ts +7 -6
  72. package/src/query/cart/useRemoveLineItemMutation.ts +6 -5
  73. package/src/query/cart/useUpdateLineItemMutation.ts +5 -4
  74. package/src/query/checkout/index.ts +0 -1
  75. package/src/query/checkout/useCreateOrderMutation.ts +11 -8
  76. package/src/query/context/useReadContextQuery.ts +14 -5
  77. package/src/query/context/useUpdateContextMutation.ts +6 -5
  78. package/src/query/country/index.ts +1 -0
  79. package/src/query/country/useReadCountryQuery.ts +31 -0
  80. package/src/query/customer/useChangeEmailMutation.ts +7 -7
  81. package/src/query/customer/useChangeProfileMutation.ts +7 -7
  82. package/src/query/customer/useLoginCustomerMutation.ts +12 -9
  83. package/src/query/customer/useLogoutCustomerMutation.ts +11 -7
  84. package/src/query/customer/useReadCustomerQuery.ts +2 -1
  85. package/src/query/customer/useRegisterCustomerMutation.ts +7 -7
  86. package/src/query/index.ts +4 -0
  87. package/src/query/navigation/index.ts +1 -0
  88. package/src/query/navigation/useReadNavigationQuery.ts +43 -0
  89. package/src/query/order/useReadOrderQuery.ts +0 -2
  90. package/src/query/payment/useHandlePaymentMutation.ts +5 -4
  91. package/src/query/payment/useOrderSetPaymentMutation.ts +6 -5
  92. package/src/query/salutation/index.ts +1 -0
  93. package/src/query/salutation/useReadSalutationQuery.ts +31 -0
  94. package/src/query/seoUrl/index.ts +1 -0
  95. package/src/query/seoUrl/useReadSeoUrlQuery.ts +31 -0
  96. package/src/query/types/index.ts +1 -0
  97. package/src/query/types/operations.ts +5 -5
  98. package/src/query/types/query.ts +4 -6
  99. package/src/query/types/util.ts +19 -0
  100. package/src/util/unrefOptions.ts +4 -4
  101. package/src/util/useOptimistic.ts +2 -1
  102. package/tsconfig.json +4 -2
  103. package/vite.config.js +6 -1
  104. package/dist/query/checkout/useCheckout.d.ts +0 -1
  105. package/src/query/checkout/useCheckout.ts +0 -2
@@ -1,8 +1,9 @@
1
1
  import { UseMutationOptions, UseMutationReturnType, MutationObserverIdleResult, MutationObserverLoadingResult, MutationObserverErrorResult, MutationObserverSuccessResult } from '@tanstack/vue-query';
2
+ import { ShopwareApiError } from '@teamnovu/kit-shopware-api-client';
2
3
  import { OperationOptions, OperationResponse } from '../types/query';
3
4
  import { components, GenericRecord } from '../../../api-types/storeApiTypes';
4
5
  declare const registerOperation = "register post /account/register";
5
- export declare function useRegisterCustomerMutation(mutationOptions?: UseMutationOptions<OperationResponse<typeof registerOperation>, unknown, OperationOptions<typeof registerOperation>>): UseMutationReturnType<{
6
+ export declare function useRegisterCustomerMutation(mutationOptions?: UseMutationOptions<OperationResponse<typeof registerOperation>, ShopwareApiError | Error, OperationOptions<typeof registerOperation>>): UseMutationReturnType<{
6
7
  active?: boolean;
7
8
  activeBillingAddress: components["schemas"]["CustomerAddress"];
8
9
  activeShippingAddress: components["schemas"]["CustomerAddress"];
@@ -54,7 +55,7 @@ export declare function useRegisterCustomerMutation(mutationOptions?: UseMutatio
54
55
  accountType: "business";
55
56
  company: string;
56
57
  vatIds: [string, ...string[]];
57
- }), unknown, OperationOptions<"register post /account/register">, unknown, Omit< MutationObserverIdleResult<{
58
+ }), Error | ShopwareApiError, OperationOptions<"register post /account/register">, unknown, Omit< MutationObserverIdleResult<{
58
59
  active?: boolean;
59
60
  activeBillingAddress: components["schemas"]["CustomerAddress"];
60
61
  activeShippingAddress: components["schemas"]["CustomerAddress"];
@@ -106,7 +107,7 @@ export declare function useRegisterCustomerMutation(mutationOptions?: UseMutatio
106
107
  accountType: "business";
107
108
  company: string;
108
109
  vatIds: [string, ...string[]];
109
- }), unknown, OperationOptions<"register post /account/register">, unknown>, "mutate" | "reset"> | Omit< MutationObserverLoadingResult<{
110
+ }), Error | ShopwareApiError, OperationOptions<"register post /account/register">, unknown>, "mutate" | "reset"> | Omit< MutationObserverLoadingResult<{
110
111
  active?: boolean;
111
112
  activeBillingAddress: components["schemas"]["CustomerAddress"];
112
113
  activeShippingAddress: components["schemas"]["CustomerAddress"];
@@ -158,7 +159,7 @@ export declare function useRegisterCustomerMutation(mutationOptions?: UseMutatio
158
159
  accountType: "business";
159
160
  company: string;
160
161
  vatIds: [string, ...string[]];
161
- }), unknown, OperationOptions<"register post /account/register">, unknown>, "mutate" | "reset"> | Omit< MutationObserverErrorResult<{
162
+ }), Error | ShopwareApiError, OperationOptions<"register post /account/register">, unknown>, "mutate" | "reset"> | Omit< MutationObserverErrorResult<{
162
163
  active?: boolean;
163
164
  activeBillingAddress: components["schemas"]["CustomerAddress"];
164
165
  activeShippingAddress: components["schemas"]["CustomerAddress"];
@@ -210,7 +211,7 @@ export declare function useRegisterCustomerMutation(mutationOptions?: UseMutatio
210
211
  accountType: "business";
211
212
  company: string;
212
213
  vatIds: [string, ...string[]];
213
- }), unknown, OperationOptions<"register post /account/register">, unknown>, "mutate" | "reset"> | Omit< MutationObserverSuccessResult<{
214
+ }), Error | ShopwareApiError, OperationOptions<"register post /account/register">, unknown>, "mutate" | "reset"> | Omit< MutationObserverSuccessResult<{
214
215
  active?: boolean;
215
216
  activeBillingAddress: components["schemas"]["CustomerAddress"];
216
217
  activeShippingAddress: components["schemas"]["CustomerAddress"];
@@ -262,5 +263,5 @@ export declare function useRegisterCustomerMutation(mutationOptions?: UseMutatio
262
263
  accountType: "business";
263
264
  company: string;
264
265
  vatIds: [string, ...string[]];
265
- }), unknown, OperationOptions<"register post /account/register">, unknown>, "mutate" | "reset">>;
266
+ }), Error | ShopwareApiError, OperationOptions<"register post /account/register">, unknown>, "mutate" | "reset">>;
266
267
  export {};
@@ -2,9 +2,13 @@ export * from './address';
2
2
  export * from './cart';
3
3
  export * from './checkout';
4
4
  export * from './context';
5
+ export * from './country';
5
6
  export * from './customer';
7
+ export * from './navigation';
6
8
  export * from './order';
7
9
  export * from './payment';
8
10
  export * from './products';
11
+ export * from './salutation';
12
+ export * from './seoUrl';
9
13
  export * from './shipping';
10
14
  export * from './types';
@@ -0,0 +1 @@
1
+ export * from './useReadNavigationQuery';
@@ -0,0 +1,22 @@
1
+ import { MaybeRef } from 'vue';
2
+ import { OperationOptions } from '../types/query';
3
+ import { UndefinedInitialQueryOptions, UseQueryReturnType } from '@tanstack/vue-query';
4
+ import { BrandedResponse } from '@teamnovu/kit-shopware-api-client';
5
+ import { Operations } from '..';
6
+ declare const readNavigationOperation = "readNavigation post /navigation/{activeId}/{rootId}";
7
+ export declare const useReadNavigationQueryOptions: (activeId: MaybeRef<string>, rootId: MaybeRef<string>, options?: OperationOptions<typeof readNavigationOperation>) => UndefinedInitialQueryOptions<BrandedResponse<Operations, "readNavigation post /navigation/{activeId}/{rootId}">, Error, BrandedResponse<Operations, "readNavigation post /navigation/{activeId}/{rootId}">, readonly ["navigation", "detail", {
8
+ readonly activeId: MaybeRef<string>;
9
+ readonly rootId: MaybeRef<string>;
10
+ readonly body: unknown;
11
+ }]> & {
12
+ queryKey: readonly ["navigation", "detail", {
13
+ readonly activeId: MaybeRef<string>;
14
+ readonly rootId: MaybeRef<string>;
15
+ readonly body: unknown;
16
+ }] & {
17
+ [dataTagSymbol]: BrandedResponse<Operations, "readNavigation post /navigation/{activeId}/{rootId}">;
18
+ [dataTagErrorSymbol]: Error;
19
+ };
20
+ };
21
+ export declare function useReadNavigationQuery(activeId: MaybeRef<string>, rootId: MaybeRef<string>, options?: OperationOptions<typeof readNavigationOperation>): UseQueryReturnType<BrandedResponse<Operations, "readNavigation post /navigation/{activeId}/{rootId}">, Error>;
22
+ export {};
@@ -1,44 +1,17 @@
1
1
  import { OperationOptions } from '../types/query';
2
2
  import { UndefinedInitialQueryOptions, UseQueryReturnType } from '@tanstack/vue-query';
3
- import { components } from '../../../api-types/storeApiTypes';
3
+ import { BrandedResponse } from '@teamnovu/kit-shopware-api-client';
4
+ import { Operations } from '..';
4
5
  declare const readOrderOperation = "readOrder post /order";
5
- export declare function useReadOrderQueryOptions(options?: OperationOptions<typeof readOrderOperation>): UndefinedInitialQueryOptions<{
6
- orders: {
7
- elements: components["schemas"]["Order"][];
8
- } & components["schemas"]["EntitySearchResult"];
9
- paymentChangeable?: {
10
- [key: string]: boolean;
11
- };
12
- }, Error, {
13
- orders: {
14
- elements: components["schemas"]["Order"][];
15
- } & components["schemas"]["EntitySearchResult"];
16
- paymentChangeable?: {
17
- [key: string]: boolean;
18
- };
19
- }, readonly ["order", "detail", {
6
+ export declare function useReadOrderQueryOptions(options?: OperationOptions<typeof readOrderOperation>): UndefinedInitialQueryOptions<BrandedResponse<Operations, "readOrder post /order">, Error, BrandedResponse<Operations, "readOrder post /order">, readonly ["order", "detail", {
20
7
  readonly body: unknown;
21
8
  }]> & {
22
9
  queryKey: readonly ["order", "detail", {
23
10
  readonly body: unknown;
24
11
  }] & {
25
- [dataTagSymbol]: {
26
- orders: {
27
- elements: components["schemas"]["Order"][];
28
- } & components["schemas"]["EntitySearchResult"];
29
- paymentChangeable?: {
30
- [key: string]: boolean;
31
- };
32
- };
12
+ [dataTagSymbol]: BrandedResponse<Operations, "readOrder post /order">;
33
13
  [dataTagErrorSymbol]: Error;
34
14
  };
35
15
  };
36
- export declare function useReadOrderQuery(options?: OperationOptions<typeof readOrderOperation>): UseQueryReturnType<{
37
- orders: {
38
- elements: components["schemas"]["Order"][];
39
- } & components["schemas"]["EntitySearchResult"];
40
- paymentChangeable?: {
41
- [key: string]: boolean;
42
- };
43
- }, Error>;
16
+ export declare function useReadOrderQuery(options?: OperationOptions<typeof readOrderOperation>): UseQueryReturnType<BrandedResponse<Operations, "readOrder post /order">, Error>;
44
17
  export {};
@@ -1,15 +1,16 @@
1
+ import { ShopwareApiError } from '@teamnovu/kit-shopware-api-client';
1
2
  import { UseMutationOptions, UseMutationReturnType, MutationObserverIdleResult, MutationObserverLoadingResult, MutationObserverErrorResult, MutationObserverSuccessResult } from '@tanstack/vue-query';
2
3
  import { OperationOptions, OperationResponse } from '../types/query';
3
4
  declare const handlePaymentOperation = "handlePaymentMethod post /handle-payment";
4
- export declare function useHandlePaymentMutation(mutationOptions?: UseMutationOptions<OperationResponse<typeof handlePaymentOperation>, unknown, OperationOptions<typeof handlePaymentOperation>>): UseMutationReturnType<{
5
+ export declare function useHandlePaymentMutation(mutationOptions?: UseMutationOptions<OperationResponse<typeof handlePaymentOperation>, ShopwareApiError | Error, OperationOptions<typeof handlePaymentOperation>>): UseMutationReturnType<{
5
6
  redirectUrl: string;
6
- }, unknown, OperationOptions<"handlePaymentMethod post /handle-payment">, unknown, Omit< MutationObserverIdleResult<{
7
+ }, Error | ShopwareApiError, OperationOptions<"handlePaymentMethod post /handle-payment">, unknown, Omit< MutationObserverIdleResult<{
7
8
  redirectUrl: string;
8
- }, unknown, OperationOptions<"handlePaymentMethod post /handle-payment">, unknown>, "mutate" | "reset"> | Omit< MutationObserverLoadingResult<{
9
+ }, Error | ShopwareApiError, OperationOptions<"handlePaymentMethod post /handle-payment">, unknown>, "mutate" | "reset"> | Omit< MutationObserverLoadingResult<{
9
10
  redirectUrl: string;
10
- }, unknown, OperationOptions<"handlePaymentMethod post /handle-payment">, unknown>, "mutate" | "reset"> | Omit< MutationObserverErrorResult<{
11
+ }, Error | ShopwareApiError, OperationOptions<"handlePaymentMethod post /handle-payment">, unknown>, "mutate" | "reset"> | Omit< MutationObserverErrorResult<{
11
12
  redirectUrl: string;
12
- }, unknown, OperationOptions<"handlePaymentMethod post /handle-payment">, unknown>, "mutate" | "reset"> | Omit< MutationObserverSuccessResult<{
13
+ }, Error | ShopwareApiError, OperationOptions<"handlePaymentMethod post /handle-payment">, unknown>, "mutate" | "reset"> | Omit< MutationObserverSuccessResult<{
13
14
  redirectUrl: string;
14
- }, unknown, OperationOptions<"handlePaymentMethod post /handle-payment">, unknown>, "mutate" | "reset">>;
15
+ }, Error | ShopwareApiError, OperationOptions<"handlePaymentMethod post /handle-payment">, unknown>, "mutate" | "reset">>;
15
16
  export {};
@@ -1,15 +1,16 @@
1
+ import { ShopwareApiError } from '@teamnovu/kit-shopware-api-client';
1
2
  import { UseMutationOptions, UseMutationReturnType, MutationObserverIdleResult, MutationObserverLoadingResult, MutationObserverErrorResult, MutationObserverSuccessResult } from '@tanstack/vue-query';
2
3
  import { OperationOptions, OperationResponse } from '../types/query';
3
4
  declare const orderSetPaymentOperation = "orderSetPayment post /order/payment";
4
- export declare function useOrderSetPaymentMutation(mutationOptions?: UseMutationOptions<OperationResponse<typeof orderSetPaymentOperation>, unknown, OperationOptions<typeof orderSetPaymentOperation>>): UseMutationReturnType<{
5
+ export declare function useOrderSetPaymentMutation(mutationOptions?: UseMutationOptions<OperationResponse<typeof orderSetPaymentOperation>, ShopwareApiError | Error, OperationOptions<typeof orderSetPaymentOperation>>): UseMutationReturnType<{
5
6
  success?: boolean;
6
- }, unknown, OperationOptions<"orderSetPayment post /order/payment">, unknown, Omit< MutationObserverIdleResult<{
7
+ }, Error | ShopwareApiError, OperationOptions<"orderSetPayment post /order/payment">, unknown, Omit< MutationObserverIdleResult<{
7
8
  success?: boolean;
8
- }, unknown, OperationOptions<"orderSetPayment post /order/payment">, unknown>, "mutate" | "reset"> | Omit< MutationObserverLoadingResult<{
9
+ }, Error | ShopwareApiError, OperationOptions<"orderSetPayment post /order/payment">, unknown>, "mutate" | "reset"> | Omit< MutationObserverLoadingResult<{
9
10
  success?: boolean;
10
- }, unknown, OperationOptions<"orderSetPayment post /order/payment">, unknown>, "mutate" | "reset"> | Omit< MutationObserverErrorResult<{
11
+ }, Error | ShopwareApiError, OperationOptions<"orderSetPayment post /order/payment">, unknown>, "mutate" | "reset"> | Omit< MutationObserverErrorResult<{
11
12
  success?: boolean;
12
- }, unknown, OperationOptions<"orderSetPayment post /order/payment">, unknown>, "mutate" | "reset"> | Omit< MutationObserverSuccessResult<{
13
+ }, Error | ShopwareApiError, OperationOptions<"orderSetPayment post /order/payment">, unknown>, "mutate" | "reset"> | Omit< MutationObserverSuccessResult<{
13
14
  success?: boolean;
14
- }, unknown, OperationOptions<"orderSetPayment post /order/payment">, unknown>, "mutate" | "reset">>;
15
+ }, Error | ShopwareApiError, OperationOptions<"orderSetPayment post /order/payment">, unknown>, "mutate" | "reset">>;
15
16
  export {};
@@ -1,31 +1,16 @@
1
1
  import { OperationOptions } from '../types/query';
2
2
  import { UndefinedInitialQueryOptions, UseQueryReturnType } from '@tanstack/vue-query';
3
- import { GenericRecord, components } from '../../../api-types/storeApiTypes';
3
+ import { BrandedResponse } from '@teamnovu/kit-shopware-api-client';
4
+ import { Operations } from '..';
4
5
  export declare const readPaymentMethodOperation = "readPaymentMethod post /payment-method";
5
- export declare function useReadPaymentMethodQueryOptions(options?: OperationOptions<typeof readPaymentMethodOperation>): UndefinedInitialQueryOptions<{
6
- aggregations?: GenericRecord;
7
- elements?: components["schemas"]["PaymentMethod"][];
8
- total?: number;
9
- }, Error, {
10
- aggregations?: GenericRecord;
11
- elements?: components["schemas"]["PaymentMethod"][];
12
- total?: number;
13
- }, readonly ["paymentMethod", "list", {
6
+ export declare function useReadPaymentMethodQueryOptions(options?: OperationOptions<typeof readPaymentMethodOperation>): UndefinedInitialQueryOptions<BrandedResponse<Operations, "readPaymentMethod post /payment-method">, Error, BrandedResponse<Operations, "readPaymentMethod post /payment-method">, readonly ["paymentMethod", "list", {
14
7
  readonly body: unknown;
15
8
  }]> & {
16
9
  queryKey: readonly ["paymentMethod", "list", {
17
10
  readonly body: unknown;
18
11
  }] & {
19
- [dataTagSymbol]: {
20
- aggregations?: GenericRecord;
21
- elements?: components["schemas"]["PaymentMethod"][];
22
- total?: number;
23
- };
12
+ [dataTagSymbol]: BrandedResponse<Operations, "readPaymentMethod post /payment-method">;
24
13
  [dataTagErrorSymbol]: Error;
25
14
  };
26
15
  };
27
- export declare function useReadPaymentMethodQuery(options?: OperationOptions<typeof readPaymentMethodOperation>): UseQueryReturnType<{
28
- aggregations?: GenericRecord;
29
- elements?: components["schemas"]["PaymentMethod"][];
30
- total?: number;
31
- }, Error>;
16
+ export declare function useReadPaymentMethodQuery(options?: OperationOptions<typeof readPaymentMethodOperation>): UseQueryReturnType<BrandedResponse<Operations, "readPaymentMethod post /payment-method">, Error>;
@@ -1,48 +1,17 @@
1
1
  import { OperationOptions } from '../types/query';
2
2
  import { UndefinedInitialQueryOptions, UseQueryReturnType } from '@tanstack/vue-query';
3
- import { components, GenericRecord } from '../../../api-types/storeApiTypes';
3
+ import { BrandedResponse } from '@teamnovu/kit-shopware-api-client';
4
+ import { Operations } from '..';
4
5
  declare const readCategoryListOperation = "readCategoryList post /category";
5
- export declare const useReadCategoryListQueryOptions: (options?: OperationOptions<typeof readCategoryListOperation>) => UndefinedInitialQueryOptions<{
6
- elements?: components["schemas"]["Category"][];
7
- } & {
8
- aggregations?: GenericRecord[];
9
- entity?: string;
10
- limit?: number;
11
- page?: number;
12
- total?: number;
13
- }, Error, {
14
- elements?: components["schemas"]["Category"][];
15
- } & {
16
- aggregations?: GenericRecord[];
17
- entity?: string;
18
- limit?: number;
19
- page?: number;
20
- total?: number;
21
- }, readonly ["category", "list", {
6
+ export declare const useReadCategoryListQueryOptions: (options?: OperationOptions<typeof readCategoryListOperation>) => UndefinedInitialQueryOptions<BrandedResponse<Operations, "readCategoryList post /category">, Error, BrandedResponse<Operations, "readCategoryList post /category">, readonly ["category", "list", {
22
7
  readonly body: unknown;
23
8
  }]> & {
24
9
  queryKey: readonly ["category", "list", {
25
10
  readonly body: unknown;
26
11
  }] & {
27
- [dataTagSymbol]: {
28
- elements?: components["schemas"]["Category"][];
29
- } & {
30
- aggregations?: GenericRecord[];
31
- entity?: string;
32
- limit?: number;
33
- page?: number;
34
- total?: number;
35
- };
12
+ [dataTagSymbol]: BrandedResponse<Operations, "readCategoryList post /category">;
36
13
  [dataTagErrorSymbol]: Error;
37
14
  };
38
15
  };
39
- export declare function useReadCategoryListQuery(options?: OperationOptions<typeof readCategoryListOperation>): UseQueryReturnType<{
40
- elements?: components["schemas"]["Category"][];
41
- } & {
42
- aggregations?: GenericRecord[];
43
- entity?: string;
44
- limit?: number;
45
- page?: number;
46
- total?: number;
47
- }, Error>;
16
+ export declare function useReadCategoryListQuery(options?: OperationOptions<typeof readCategoryListOperation>): UseQueryReturnType<BrandedResponse<Operations, "readCategoryList post /category">, Error>;
48
17
  export {};
@@ -1,17 +1,10 @@
1
1
  import { MaybeRef } from 'vue';
2
2
  import { OperationOptions } from '../types/query';
3
3
  import { UndefinedInitialQueryOptions, UseQueryReturnType } from '@tanstack/vue-query';
4
- import { components } from '../../../api-types/storeApiTypes';
4
+ import { BrandedResponse } from '@teamnovu/kit-shopware-api-client';
5
+ import { Operations } from '..';
5
6
  declare const readListingOperation = "readCompactProductListing post /novu/headless/product-listing/{seoUrl}";
6
- export declare function useReadCompactProductListingQueryOptions(seoUrl: MaybeRef<string>, options?: OperationOptions<typeof readListingOperation, 'params'>): UndefinedInitialQueryOptions<{
7
- apiAlias: "novuProductListing";
8
- category: components["schemas"]["Category"];
9
- listing: components["schemas"]["ProductListingResult"];
10
- }, Error, {
11
- apiAlias: "novuProductListing";
12
- category: components["schemas"]["Category"];
13
- listing: components["schemas"]["ProductListingResult"];
14
- }, readonly ["product", "list", {
7
+ export declare function useReadCompactProductListingQueryOptions(seoUrl: MaybeRef<string>, options?: OperationOptions<typeof readListingOperation, 'params'>): UndefinedInitialQueryOptions<BrandedResponse<Operations, "readCompactProductListing post /novu/headless/product-listing/{seoUrl}">, Error, BrandedResponse<Operations, "readCompactProductListing post /novu/headless/product-listing/{seoUrl}">, readonly ["product", "list", {
15
8
  readonly url: MaybeRef<string>;
16
9
  readonly body: unknown;
17
10
  }]> & {
@@ -19,17 +12,9 @@ export declare function useReadCompactProductListingQueryOptions(seoUrl: MaybeRe
19
12
  readonly url: MaybeRef<string>;
20
13
  readonly body: unknown;
21
14
  }] & {
22
- [dataTagSymbol]: {
23
- apiAlias: "novuProductListing";
24
- category: components["schemas"]["Category"];
25
- listing: components["schemas"]["ProductListingResult"];
26
- };
15
+ [dataTagSymbol]: BrandedResponse<Operations, "readCompactProductListing post /novu/headless/product-listing/{seoUrl}">;
27
16
  [dataTagErrorSymbol]: Error;
28
17
  };
29
18
  };
30
- export declare function useReadCompactProductListingQuery(seoUrl: MaybeRef<string>, options?: OperationOptions<typeof readListingOperation, 'params'>): UseQueryReturnType<{
31
- apiAlias: "novuProductListing";
32
- category: components["schemas"]["Category"];
33
- listing: components["schemas"]["ProductListingResult"];
34
- }, Error>;
19
+ export declare function useReadCompactProductListingQuery(seoUrl: MaybeRef<string>, options?: OperationOptions<typeof readListingOperation, 'params'>): UseQueryReturnType<BrandedResponse<Operations, "readCompactProductListing post /novu/headless/product-listing/{seoUrl}">, Error>;
35
20
  export {};
@@ -1,33 +1,10 @@
1
1
  import { MaybeRef } from 'vue';
2
2
  import { OperationOptions } from '../types/query';
3
3
  import { UndefinedInitialQueryOptions, UseQueryReturnType } from '@tanstack/vue-query';
4
- import { components, GenericRecord } from '../../../api-types/storeApiTypes';
4
+ import { BrandedResponse } from '@teamnovu/kit-shopware-api-client';
5
+ import { Operations } from '..';
5
6
  declare const readCustomProductDetailOperation = "readCustomProductDetail post /novu/headless/product/{seoUrl}";
6
- export declare function useReadCustomProductDetailOptions(seoUrl: MaybeRef<string>, body?: OperationOptions<typeof readCustomProductDetailOperation, 'params'>): UndefinedInitialQueryOptions<{
7
- apiAlias: "product_detail";
8
- configurator: components["schemas"]["PropertyGroup"][];
9
- cross_sellings: components["schemas"]["CrossSellingElementCollection"];
10
- custom_fields: GenericRecord;
11
- product: components["schemas"]["Product"] & {
12
- extensions?: {
13
- novuSeoUrls?: GenericRecord;
14
- search?: GenericRecord;
15
- variants?: components["schemas"]["Product"][];
16
- };
17
- };
18
- }, Error, {
19
- apiAlias: "product_detail";
20
- configurator: components["schemas"]["PropertyGroup"][];
21
- cross_sellings: components["schemas"]["CrossSellingElementCollection"];
22
- custom_fields: GenericRecord;
23
- product: components["schemas"]["Product"] & {
24
- extensions?: {
25
- novuSeoUrls?: GenericRecord;
26
- search?: GenericRecord;
27
- variants?: components["schemas"]["Product"][];
28
- };
29
- };
30
- }, readonly ["product", "detail", {
7
+ export declare function useReadCustomProductDetailOptions(seoUrl: MaybeRef<string>, body?: OperationOptions<typeof readCustomProductDetailOperation, 'params'>): UndefinedInitialQueryOptions<BrandedResponse<Operations, "readCustomProductDetail post /novu/headless/product/{seoUrl}">, Error, BrandedResponse<Operations, "readCustomProductDetail post /novu/headless/product/{seoUrl}">, readonly ["product", "detail", {
31
8
  readonly url: MaybeRef<string>;
32
9
  readonly body: unknown;
33
10
  }]> & {
@@ -35,33 +12,9 @@ export declare function useReadCustomProductDetailOptions(seoUrl: MaybeRef<strin
35
12
  readonly url: MaybeRef<string>;
36
13
  readonly body: unknown;
37
14
  }] & {
38
- [dataTagSymbol]: {
39
- apiAlias: "product_detail";
40
- configurator: components["schemas"]["PropertyGroup"][];
41
- cross_sellings: components["schemas"]["CrossSellingElementCollection"];
42
- custom_fields: GenericRecord;
43
- product: components["schemas"]["Product"] & {
44
- extensions?: {
45
- novuSeoUrls?: GenericRecord;
46
- search?: GenericRecord;
47
- variants?: components["schemas"]["Product"][];
48
- };
49
- };
50
- };
15
+ [dataTagSymbol]: BrandedResponse<Operations, "readCustomProductDetail post /novu/headless/product/{seoUrl}">;
51
16
  [dataTagErrorSymbol]: Error;
52
17
  };
53
18
  };
54
- export declare function useReadCustomProductDetailQuery(seoUrl: MaybeRef<string>, body?: OperationOptions<typeof readCustomProductDetailOperation, 'params'>): UseQueryReturnType<{
55
- apiAlias: "product_detail";
56
- configurator: components["schemas"]["PropertyGroup"][];
57
- cross_sellings: components["schemas"]["CrossSellingElementCollection"];
58
- custom_fields: GenericRecord;
59
- product: components["schemas"]["Product"] & {
60
- extensions?: {
61
- novuSeoUrls?: GenericRecord;
62
- search?: GenericRecord;
63
- variants?: components["schemas"]["Product"][];
64
- };
65
- };
66
- }, Error>;
19
+ export declare function useReadCustomProductDetailQuery(seoUrl: MaybeRef<string>, body?: OperationOptions<typeof readCustomProductDetailOperation, 'params'>): UseQueryReturnType<BrandedResponse<Operations, "readCustomProductDetail post /novu/headless/product/{seoUrl}">, Error>;
67
20
  export {};
@@ -0,0 +1 @@
1
+ export * from './useReadSalutationQuery';
@@ -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 readSalutationOperation = "readSalutation post /salutation";
6
+ export declare const useReadSalutationQueryOptions: (options?: OperationOptions<typeof readSalutationOperation>) => UndefinedInitialQueryOptions<BrandedResponse<Operations, "readSalutation post /salutation">, Error, BrandedResponse<Operations, "readSalutation post /salutation">, readonly ["salutation", "list", {
7
+ readonly body: unknown;
8
+ }]> & {
9
+ queryKey: readonly ["salutation", "list", {
10
+ readonly body: unknown;
11
+ }] & {
12
+ [dataTagSymbol]: BrandedResponse<Operations, "readSalutation post /salutation">;
13
+ [dataTagErrorSymbol]: Error;
14
+ };
15
+ };
16
+ export declare function useReadSalutationQuery(options?: OperationOptions<typeof readSalutationOperation>): UseQueryReturnType<BrandedResponse<Operations, "readSalutation post /salutation">, Error>;
17
+ export {};
@@ -0,0 +1 @@
1
+ export * from './useReadSeoUrlQuery';
@@ -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 readSeoUrlOperation = "readSeoUrl post /seo-url";
6
+ export declare const useReadSeoUrlQueryOptions: (options?: OperationOptions<typeof readSeoUrlOperation>) => UndefinedInitialQueryOptions<BrandedResponse<Operations, "readSeoUrl post /seo-url">, Error, BrandedResponse<Operations, "readSeoUrl post /seo-url">, readonly ["seoUrl", "list", {
7
+ readonly body: unknown;
8
+ }]> & {
9
+ queryKey: readonly ["seoUrl", "list", {
10
+ readonly body: unknown;
11
+ }] & {
12
+ [dataTagSymbol]: BrandedResponse<Operations, "readSeoUrl post /seo-url">;
13
+ [dataTagErrorSymbol]: Error;
14
+ };
15
+ };
16
+ export declare function useReadSeoUrlQuery(options?: OperationOptions<typeof readSeoUrlOperation>): UseQueryReturnType<BrandedResponse<Operations, "readSeoUrl post /seo-url">, Error>;
17
+ export {};
@@ -1,55 +1,16 @@
1
1
  import { OperationOptions } from '../types/query';
2
2
  import { UndefinedInitialQueryOptions, UseQueryReturnType } from '@tanstack/vue-query';
3
- import { GenericRecord, components } from '../../../api-types/storeApiTypes';
3
+ import { BrandedResponse } from '@teamnovu/kit-shopware-api-client';
4
+ import { Operations } from '..';
4
5
  export declare const readShippingMethodOperation = "readShippingMethod post /shipping-method";
5
- export declare function useReadShippingMethodQueryOptions(options?: OperationOptions<typeof readShippingMethodOperation>): UndefinedInitialQueryOptions<{
6
- aggregations?: GenericRecord;
7
- elements: components["schemas"]["ShippingMethod"][];
8
- total?: number;
9
- } & {
10
- aggregations?: GenericRecord[];
11
- entity?: string;
12
- limit?: number;
13
- page?: number;
14
- total?: number;
15
- }, Error, {
16
- aggregations?: GenericRecord;
17
- elements: components["schemas"]["ShippingMethod"][];
18
- total?: number;
19
- } & {
20
- aggregations?: GenericRecord[];
21
- entity?: string;
22
- limit?: number;
23
- page?: number;
24
- total?: number;
25
- }, readonly ["shippingMethod", "list", {
6
+ export declare function useReadShippingMethodQueryOptions(options?: OperationOptions<typeof readShippingMethodOperation>): UndefinedInitialQueryOptions<BrandedResponse<Operations, "readShippingMethod post /shipping-method">, Error, BrandedResponse<Operations, "readShippingMethod post /shipping-method">, readonly ["shippingMethod", "list", {
26
7
  readonly body: unknown;
27
8
  }]> & {
28
9
  queryKey: readonly ["shippingMethod", "list", {
29
10
  readonly body: unknown;
30
11
  }] & {
31
- [dataTagSymbol]: {
32
- aggregations?: GenericRecord;
33
- elements: components["schemas"]["ShippingMethod"][];
34
- total?: number;
35
- } & {
36
- aggregations?: GenericRecord[];
37
- entity?: string;
38
- limit?: number;
39
- page?: number;
40
- total?: number;
41
- };
12
+ [dataTagSymbol]: BrandedResponse<Operations, "readShippingMethod post /shipping-method">;
42
13
  [dataTagErrorSymbol]: Error;
43
14
  };
44
15
  };
45
- export declare function useReadShippingMethodQuery(options?: OperationOptions<typeof readShippingMethodOperation>): UseQueryReturnType<{
46
- aggregations?: GenericRecord;
47
- elements: components["schemas"]["ShippingMethod"][];
48
- total?: number;
49
- } & {
50
- aggregations?: GenericRecord[];
51
- entity?: string;
52
- limit?: number;
53
- page?: number;
54
- total?: number;
55
- }, Error>;
16
+ export declare function useReadShippingMethodQuery(options?: OperationOptions<typeof readShippingMethodOperation>): UseQueryReturnType<BrandedResponse<Operations, "readShippingMethod post /shipping-method">, Error>;
@@ -1,2 +1,3 @@
1
1
  export * from './operations';
2
2
  export * from './query';
3
+ export * from './util';
@@ -1,5 +1,5 @@
1
- import { operations, Schemas as OriginalSchemas } from '../../../api-types/storeApiTypes.d.ts';
2
- export interface Operations extends operations {
1
+ import { operations as OriginalOperations, Schemas as OriginalSchemas } from '../../../api-types/storeApiTypes.d.ts';
2
+ export interface Operations extends ShopwareApi.Operations, OriginalOperations {
3
3
  }
4
- export interface Schemas extends OriginalSchemas {
4
+ export interface Schemas extends ShopwareApi.Schemas, OriginalSchemas {
5
5
  }
@@ -1,16 +1,15 @@
1
- import { operations } from '../../../api-types/storeApiTypes.d.ts';
2
1
  import { QueryKey, UseQueryOptions } from '@tanstack/vue-query';
3
2
  import { OperationProp, OperationOptions as RawOperationOptions } from '@teamnovu/kit-shopware-api-client';
4
3
  import { MaybeRef, UnwrapRef } from 'vue';
5
4
  import { Operations } from './operations';
6
- export type PartialProps<T, K extends keyof T> = Omit<T, K> & Partial<Pick<T, K>>;
5
+ import { PartialProps } from './util';
7
6
  export type ShallowMaybeRefs<T> = {
8
7
  [K in keyof T]: MaybeRef<T[K]>;
9
8
  };
10
9
  export type ShallowUnwrapRefs<T> = {
11
10
  [K in keyof T]: UnwrapRef<T[K]>;
12
11
  };
13
- export type OperationKey = keyof operations;
12
+ export type OperationKey = keyof Operations;
14
13
  export type OperationBody<K extends OperationKey> = OperationProp<Operations, K, 'body'>;
15
14
  export type OperationResponse<K extends OperationKey> = OperationProp<Operations, K, 'response'>;
16
15
  export type OperationOptions<K extends OperationKey, OmitKeys extends keyof RawOperationOptions<Operations, K> = never> = MaybeRef<ShallowMaybeRefs<PartialProps<RawOperationOptions<Operations, K>, OmitKeys>>>;
@@ -0,0 +1,6 @@
1
+ type DeepOverride<T, U> = {
2
+ [K in keyof U]: K extends keyof T ? U[K] extends infer UK ? T[K] extends infer TK ? TK extends Record<string, unknown> ? UK extends Record<string, unknown> ? Override<T[K], U[K]> : U[K] : U[K] : U[K] : never : never;
3
+ };
4
+ export type Override<T, U> = T extends Record<string, unknown> ? DeepOverride<T, U> & Omit<T, keyof U> : U;
5
+ export type PartialProps<T, K extends keyof T> = Omit<T, K> & Partial<Pick<T, K>>;
6
+ export {};
@@ -1,4 +1,4 @@
1
1
  import { OperationOptions as RawOperationOptions } from '@teamnovu/kit-shopware-api-client';
2
- import { OperationOptions, PartialProps } from '../query/types/query';
3
- import { Operations } from '../query/types';
2
+ import { OperationOptions } from '../query/types/query';
3
+ import { Operations, PartialProps } from '../query/types';
4
4
  export declare function unrefOptions<K extends keyof Operations, OmitKeys extends keyof RawOperationOptions<Operations, K> = never>(options: OperationOptions<K, OmitKeys> | undefined): PartialProps<RawOperationOptions<Operations, K>, OmitKeys>;
package/docs/index.md CHANGED
@@ -244,7 +244,7 @@ const {
244
244
  } = useShippingMethods()
245
245
  ```
246
246
 
247
- #### useAddresses
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
- } = useAddresses()
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.5",
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",
@@ -11,13 +11,13 @@
11
11
  "import": "./dist/index.mjs"
12
12
  },
13
13
  "./operations": {
14
- "types": "./dist/types/operations.d.ts"
14
+ "types": "./dist/global.d.ts"
15
15
  }
16
16
  },
17
17
  "peerDependencies": {
18
- "@tanstack/vue-query": "^5.0.0",
18
+ "@tanstack/vue-query": "^5.75.5",
19
19
  "vue": "^3.0.0",
20
- "@teamnovu/kit-shopware-api-client": "0.0.3"
20
+ "@teamnovu/kit-shopware-api-client": "0.0.5"
21
21
  },
22
22
  "repository": {
23
23
  "type": "git",
@@ -32,6 +32,7 @@
32
32
  },
33
33
  "devDependencies": {
34
34
  "@eslint/js": "^9.25.0",
35
+ "@microsoft/api-extractor": "^7.52.8",
35
36
  "@shopware/api-gen": "^1.3.0",
36
37
  "@shopware/helpers": "^1.4.0",
37
38
  "@stylistic/eslint-plugin": "^4.2.0",
@@ -42,6 +43,7 @@
42
43
  "eslint-import-resolver-typescript": "^4.3.3",
43
44
  "eslint-plugin-import": "^2.31.0",
44
45
  "typescript-eslint": "^8.30.1",
46
+ "unplugin-dts": "^1.0.0-beta.4",
45
47
  "vitest": "^3.1.2"
46
48
  },
47
49
  "scripts": {