@teamnovu/kit-shopware-composables 0.0.2 → 0.0.4
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.localhost.http +1 -1
- package/dist/helpers/checkout/index.d.ts +5 -0
- package/dist/helpers/checkout/useAddresses.d.ts +210 -0
- package/dist/helpers/checkout/useOrderDetails.d.ts +186 -0
- package/dist/helpers/checkout/useOrderPayment.d.ts +73 -0
- package/dist/helpers/checkout/usePaymentMethods.d.ts +155 -0
- package/dist/helpers/checkout/useShippingMethods.d.ts +173 -0
- package/dist/helpers/general/index.d.ts +2 -0
- package/dist/{usePagination.d.ts → helpers/general/usePagination.d.ts} +1 -1
- package/dist/{general → helpers/general}/useSeoUrl.d.ts +1 -1
- package/dist/helpers/index.d.ts +4 -0
- package/dist/helpers/product/index.d.ts +2 -0
- package/dist/helpers/product/useProductPrice.d.ts +61 -0
- package/dist/{products → helpers/product}/useProductVariantForOptions.d.ts +1 -1
- package/dist/helpers/user/index.d.ts +2 -0
- package/dist/helpers/user/useIsLoggedIn.d.ts +2 -0
- package/dist/helpers/user/useUser.d.ts +167 -0
- package/dist/index.d.ts +3 -188
- package/dist/index.mjs +871 -185
- package/dist/inject.d.ts +2 -2
- package/dist/keys.d.ts +35 -0
- package/dist/query/address/index.d.ts +3 -0
- package/dist/query/address/useCreateCustomerAddressMutation.d.ts +166 -0
- package/dist/query/address/useDeleteCustomerAddressMutation.d.ts +5 -0
- package/dist/query/address/useListAddressQuery.d.ts +48 -0
- package/dist/query/cart/index.d.ts +4 -0
- package/dist/query/cart/useAddLineItemMutation.d.ts +131 -0
- package/dist/query/cart/useReadCartQuery.d.ts +108 -0
- package/dist/query/cart/useRemoveLineItemMutation.d.ts +136 -0
- package/dist/query/cart/useUpdateLineItemMutation.d.ts +131 -0
- package/dist/query/checkout/index.d.ts +2 -0
- package/dist/query/checkout/useCheckout.d.ts +1 -0
- package/dist/query/checkout/useCreateOrderMutation.d.ts +281 -0
- package/dist/query/context/index.d.ts +2 -0
- package/dist/query/context/useReadContextQuery.d.ts +153 -0
- package/dist/query/context/useUpdateContextMutation.d.ts +60 -0
- package/dist/query/customer/index.d.ts +6 -0
- package/dist/query/customer/useChangeEmailMutation.d.ts +15 -0
- package/dist/query/customer/useChangeProfileMutation.d.ts +15 -0
- package/dist/query/customer/useLoginCustomerMutation.d.ts +30 -0
- package/dist/query/customer/useLogoutCustomerMutation.d.ts +15 -0
- package/dist/query/customer/useReadCustomerQuery.d.ts +220 -0
- package/dist/query/customer/useRegisterCustomerMutation.d.ts +266 -0
- package/dist/query/index.d.ts +10 -0
- package/dist/query/order/index.d.ts +1 -0
- package/dist/query/order/useReadOrderQuery.d.ts +44 -0
- package/dist/query/payment/index.d.ts +3 -0
- package/dist/query/payment/useHandlePaymentMutation.d.ts +15 -0
- package/dist/query/payment/useOrderSetPaymentMutation.d.ts +15 -0
- package/dist/query/payment/useReadPaymentMethodQuery.d.ts +31 -0
- package/dist/query/products/index.d.ts +3 -0
- package/dist/query/products/useReadCategoryListQuery.d.ts +48 -0
- package/dist/query/products/useReadCompactProductListingQuery.d.ts +35 -0
- package/dist/query/products/useReadCustomProductDetailQuery.d.ts +67 -0
- package/dist/query/shipping/index.d.ts +1 -0
- package/dist/query/shipping/useReadShippingMethodQuery.d.ts +55 -0
- package/dist/query/types/index.d.ts +2 -0
- package/dist/query/types/operations.d.ts +5 -0
- package/dist/query/types/query.d.ts +17 -0
- package/dist/util/index.d.ts +3 -0
- package/dist/util/unrefOptions.d.ts +4 -0
- package/dist/util/useOptimistic.d.ts +12 -0
- package/docs/index.md +457 -0
- package/docs/info.json +3 -0
- package/package.json +6 -2
- package/src/helpers/checkout/index.ts +5 -0
- package/src/helpers/checkout/useAddresses.ts +57 -0
- package/src/helpers/checkout/useOrderDetails.ts +94 -0
- package/src/helpers/checkout/useOrderPayment.ts +28 -0
- package/src/helpers/checkout/usePaymentMethods.ts +35 -0
- package/src/helpers/checkout/useShippingMethods.ts +35 -0
- package/src/helpers/general/index.ts +2 -0
- package/src/helpers/index.ts +4 -0
- package/src/helpers/product/index.ts +2 -0
- package/src/{products → helpers/product}/useProductPrice.ts +4 -45
- package/src/{products → helpers/product}/useProductVariantForOptions.ts +8 -2
- package/src/helpers/user/index.ts +2 -0
- package/src/helpers/user/useIsLoggedIn.ts +10 -0
- package/src/helpers/user/useUser.ts +53 -0
- package/src/index.ts +4 -21
- package/src/inject.ts +3 -3
- package/src/keys.ts +61 -0
- package/src/query/address/index.ts +3 -0
- package/src/query/address/useCreateCustomerAddressMutation.ts +32 -0
- package/src/query/address/useDeleteCustomerAddressMutation.ts +32 -0
- package/src/query/address/useListAddressQuery.ts +29 -0
- package/src/query/cart/index.ts +4 -0
- package/src/query/cart/useAddLineItemMutation.ts +45 -0
- package/src/query/cart/useReadCartQuery.ts +28 -0
- package/src/query/cart/useRemoveLineItemMutation.ts +32 -0
- package/src/query/cart/useUpdateLineItemMutation.ts +45 -0
- package/src/query/checkout/index.ts +2 -0
- package/src/query/checkout/useCheckout.ts +2 -0
- package/src/query/checkout/useCreateOrderMutation.ts +35 -0
- package/src/query/context/index.ts +2 -0
- package/src/query/context/useReadContextQuery.ts +19 -0
- package/src/query/context/useUpdateContextMutation.ts +36 -0
- package/src/query/customer/index.ts +6 -0
- package/src/query/customer/useChangeEmailMutation.ts +32 -0
- package/src/query/customer/useChangeProfileMutation.ts +32 -0
- package/src/query/customer/useLoginCustomerMutation.ts +42 -0
- package/src/query/customer/useLogoutCustomerMutation.ts +32 -0
- package/src/query/customer/useReadCustomerQuery.ts +27 -0
- package/src/query/customer/useRegisterCustomerMutation.ts +32 -0
- package/src/query/index.ts +10 -0
- package/src/query/order/index.ts +1 -0
- package/src/query/order/useReadOrderQuery.ts +33 -0
- package/src/query/payment/index.ts +3 -0
- package/src/query/payment/useHandlePaymentMutation.ts +27 -0
- package/src/query/payment/useOrderSetPaymentMutation.ts +32 -0
- package/src/query/payment/useReadPaymentMethodQuery.ts +30 -0
- package/src/query/products/index.ts +3 -0
- package/src/query/products/useReadCategoryListQuery.ts +28 -0
- package/src/query/products/useReadCompactProductListingQuery.ts +41 -0
- package/src/query/products/useReadCustomProductDetailQuery.ts +41 -0
- package/src/query/shipping/index.ts +1 -0
- package/src/query/shipping/useReadShippingMethodQuery.ts +29 -0
- package/src/query/types/index.ts +2 -0
- package/src/query/types/operations.ts +6 -0
- package/src/query/types/query.ts +39 -0
- package/src/util/index.ts +3 -0
- package/src/util/unrefOptions.ts +19 -0
- package/src/util/useOptimistic.ts +49 -0
- package/tsconfig.json +5 -2
- package/dist/context/useContextOptions.d.ts +0 -9
- package/dist/context/useContextUpdate.d.ts +0 -4
- package/dist/products/useCategoryQueryOptions.d.ts +0 -17
- package/dist/products/useProductListingQueryOptions.d.ts +0 -19
- package/dist/products/useProductListingQueryOptions.test.d.ts +0 -1
- package/dist/products/useProductPrice.d.ts +0 -48
- package/dist/products/useProductQueryOptions.d.ts +0 -19
- package/dist/types/query.d.ts +0 -7
- package/eslint.config.mjs +0 -84
- package/src/context/useContextOptions.ts +0 -16
- package/src/context/useContextUpdate.ts +0 -16
- package/src/products/useCategoryQueryOptions.ts +0 -25
- package/src/products/useProductListingQueryOptions.test.ts +0 -24
- package/src/products/useProductListingQueryOptions.ts +0 -28
- package/src/products/useProductQueryOptions.ts +0 -28
- package/src/types/query.ts +0 -18
- /package/src/{usePagination.ts → helpers/general/usePagination.ts} +0 -0
- /package/src/{general → helpers/general}/useSeoUrl.ts +0 -0
|
@@ -0,0 +1,173 @@
|
|
|
1
|
+
import { UseMutationReturnType, MutationObserverIdleResult, MutationObserverLoadingResult, MutationObserverErrorResult, MutationObserverSuccessResult, UseQueryReturnType } from '@tanstack/vue-query';
|
|
2
|
+
import { components, GenericRecord } from '../../../api-types/storeApiTypes';
|
|
3
|
+
import { ComputedRef } from 'vue';
|
|
4
|
+
export declare function useShippingMethods(): {
|
|
5
|
+
contextUpdateMutation: UseMutationReturnType<{
|
|
6
|
+
redirectUrl?: string;
|
|
7
|
+
}, unknown, {
|
|
8
|
+
billingAddressId?: string;
|
|
9
|
+
countryId?: string;
|
|
10
|
+
countryStateId?: string;
|
|
11
|
+
currencyId?: string;
|
|
12
|
+
languageId?: string;
|
|
13
|
+
paymentMethodId?: string;
|
|
14
|
+
shippingAddressId?: string;
|
|
15
|
+
shippingMethodId?: string;
|
|
16
|
+
}, unknown, Omit< MutationObserverIdleResult<{
|
|
17
|
+
redirectUrl?: string;
|
|
18
|
+
}, unknown, {
|
|
19
|
+
billingAddressId?: string;
|
|
20
|
+
countryId?: string;
|
|
21
|
+
countryStateId?: string;
|
|
22
|
+
currencyId?: string;
|
|
23
|
+
languageId?: string;
|
|
24
|
+
paymentMethodId?: string;
|
|
25
|
+
shippingAddressId?: string;
|
|
26
|
+
shippingMethodId?: string;
|
|
27
|
+
}, unknown>, "mutate" | "reset"> | Omit< MutationObserverLoadingResult<{
|
|
28
|
+
redirectUrl?: string;
|
|
29
|
+
}, unknown, {
|
|
30
|
+
billingAddressId?: string;
|
|
31
|
+
countryId?: string;
|
|
32
|
+
countryStateId?: string;
|
|
33
|
+
currencyId?: string;
|
|
34
|
+
languageId?: string;
|
|
35
|
+
paymentMethodId?: string;
|
|
36
|
+
shippingAddressId?: string;
|
|
37
|
+
shippingMethodId?: string;
|
|
38
|
+
}, unknown>, "mutate" | "reset"> | Omit< MutationObserverErrorResult<{
|
|
39
|
+
redirectUrl?: string;
|
|
40
|
+
}, unknown, {
|
|
41
|
+
billingAddressId?: string;
|
|
42
|
+
countryId?: string;
|
|
43
|
+
countryStateId?: string;
|
|
44
|
+
currencyId?: string;
|
|
45
|
+
languageId?: string;
|
|
46
|
+
paymentMethodId?: string;
|
|
47
|
+
shippingAddressId?: string;
|
|
48
|
+
shippingMethodId?: string;
|
|
49
|
+
}, unknown>, "mutate" | "reset"> | Omit< MutationObserverSuccessResult<{
|
|
50
|
+
redirectUrl?: string;
|
|
51
|
+
}, unknown, {
|
|
52
|
+
billingAddressId?: string;
|
|
53
|
+
countryId?: string;
|
|
54
|
+
countryStateId?: string;
|
|
55
|
+
currencyId?: string;
|
|
56
|
+
languageId?: string;
|
|
57
|
+
paymentMethodId?: string;
|
|
58
|
+
shippingAddressId?: string;
|
|
59
|
+
shippingMethodId?: string;
|
|
60
|
+
}, unknown>, "mutate" | "reset">>;
|
|
61
|
+
contextQuery: UseQueryReturnType<{
|
|
62
|
+
apiAlias: "sales_channel_context";
|
|
63
|
+
context?: {
|
|
64
|
+
currencyFactor?: number;
|
|
65
|
+
currencyId?: string;
|
|
66
|
+
currencyPrecision?: number;
|
|
67
|
+
languageIdChain?: string[];
|
|
68
|
+
scope?: string;
|
|
69
|
+
source?: string;
|
|
70
|
+
taxState?: string;
|
|
71
|
+
useCache?: boolean;
|
|
72
|
+
versionId?: string;
|
|
73
|
+
};
|
|
74
|
+
currency?: components["schemas"]["Currency"];
|
|
75
|
+
currentCustomerGroup?: {
|
|
76
|
+
displayGross?: boolean;
|
|
77
|
+
name?: string;
|
|
78
|
+
};
|
|
79
|
+
customer?: components["schemas"]["Customer"];
|
|
80
|
+
fallbackCustomerGroup?: {
|
|
81
|
+
displayGross?: boolean;
|
|
82
|
+
name?: string;
|
|
83
|
+
};
|
|
84
|
+
paymentMethod?: components["schemas"]["PaymentMethod"];
|
|
85
|
+
salesChannel: components["schemas"]["SalesChannel"];
|
|
86
|
+
shippingLocation?: {
|
|
87
|
+
address?: components["schemas"]["CustomerAddress"];
|
|
88
|
+
apiAlias?: "cart_delivery_shipping_location";
|
|
89
|
+
country?: components["schemas"]["Country"];
|
|
90
|
+
};
|
|
91
|
+
shippingMethod?: components["schemas"]["ShippingMethod"];
|
|
92
|
+
taxRules?: {
|
|
93
|
+
name?: string;
|
|
94
|
+
taxRate?: number;
|
|
95
|
+
}[];
|
|
96
|
+
token?: string;
|
|
97
|
+
}, Error>;
|
|
98
|
+
shippingMethodsQuery: UseQueryReturnType<{
|
|
99
|
+
aggregations?: GenericRecord;
|
|
100
|
+
elements: components["schemas"]["ShippingMethod"][];
|
|
101
|
+
total?: number;
|
|
102
|
+
} & {
|
|
103
|
+
aggregations?: GenericRecord[];
|
|
104
|
+
entity?: string;
|
|
105
|
+
limit?: number;
|
|
106
|
+
page?: number;
|
|
107
|
+
total?: number;
|
|
108
|
+
}, Error>;
|
|
109
|
+
activeShippingMethod: ComputedRef<{
|
|
110
|
+
active?: boolean;
|
|
111
|
+
availabilityRule?: components["schemas"]["Rule"];
|
|
112
|
+
readonly createdAt?: string;
|
|
113
|
+
customFields?: GenericRecord;
|
|
114
|
+
deliveryTime?: components["schemas"]["DeliveryTime"];
|
|
115
|
+
deliveryTimeId: string;
|
|
116
|
+
description?: string;
|
|
117
|
+
id: string;
|
|
118
|
+
media?: components["schemas"]["Media"];
|
|
119
|
+
mediaId?: string;
|
|
120
|
+
name: string;
|
|
121
|
+
position?: number;
|
|
122
|
+
prices?: components["schemas"]["ShippingMethodPrice"][];
|
|
123
|
+
tags?: components["schemas"]["Tag"][];
|
|
124
|
+
tax?: components["schemas"]["Tax"];
|
|
125
|
+
taxType?: string;
|
|
126
|
+
technicalName: string;
|
|
127
|
+
trackingUrl?: string;
|
|
128
|
+
translated: {
|
|
129
|
+
deliveryTimeId: string;
|
|
130
|
+
description: string;
|
|
131
|
+
mediaId: string;
|
|
132
|
+
name: string;
|
|
133
|
+
taxType: string;
|
|
134
|
+
technicalName: string;
|
|
135
|
+
trackingUrl: string;
|
|
136
|
+
};
|
|
137
|
+
readonly updatedAt?: string;
|
|
138
|
+
} | undefined>;
|
|
139
|
+
setShippingMethod: (shippingMethodId: string) => Promise<{
|
|
140
|
+
redirectUrl?: string;
|
|
141
|
+
}>;
|
|
142
|
+
isSaving: ComputedRef<boolean>;
|
|
143
|
+
shippingMethods: ComputedRef<{
|
|
144
|
+
active?: boolean;
|
|
145
|
+
availabilityRule?: components["schemas"]["Rule"];
|
|
146
|
+
readonly createdAt?: string;
|
|
147
|
+
customFields?: GenericRecord;
|
|
148
|
+
deliveryTime?: components["schemas"]["DeliveryTime"];
|
|
149
|
+
deliveryTimeId: string;
|
|
150
|
+
description?: string;
|
|
151
|
+
id: string;
|
|
152
|
+
media?: components["schemas"]["Media"];
|
|
153
|
+
mediaId?: string;
|
|
154
|
+
name: string;
|
|
155
|
+
position?: number;
|
|
156
|
+
prices?: components["schemas"]["ShippingMethodPrice"][];
|
|
157
|
+
tags?: components["schemas"]["Tag"][];
|
|
158
|
+
tax?: components["schemas"]["Tax"];
|
|
159
|
+
taxType?: string;
|
|
160
|
+
technicalName: string;
|
|
161
|
+
trackingUrl?: string;
|
|
162
|
+
translated: {
|
|
163
|
+
deliveryTimeId: string;
|
|
164
|
+
description: string;
|
|
165
|
+
mediaId: string;
|
|
166
|
+
name: string;
|
|
167
|
+
taxType: string;
|
|
168
|
+
technicalName: string;
|
|
169
|
+
trackingUrl: string;
|
|
170
|
+
};
|
|
171
|
+
readonly updatedAt?: string;
|
|
172
|
+
}[] | undefined>;
|
|
173
|
+
};
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { Schemas, components } from '../../../api-types/storeApiTypes.d.ts';
|
|
2
|
+
import { ComputedRef, Ref } from 'vue';
|
|
3
|
+
import { TierPrice } from '@shopware/helpers';
|
|
4
|
+
/**
|
|
5
|
+
* The purpose of the `useProductPrice` function is to abstract the logic
|
|
6
|
+
* to expose most useful helpers for price displaying.
|
|
7
|
+
*
|
|
8
|
+
* @public
|
|
9
|
+
* @category Product
|
|
10
|
+
*/
|
|
11
|
+
export declare function useProductPrice(product: Ref<Schemas['Product'] | undefined>): {
|
|
12
|
+
price: ComputedRef<{
|
|
13
|
+
apiAlias: "calculated_price";
|
|
14
|
+
calculatedTaxes: {
|
|
15
|
+
apiAlias: "cart_tax_calculated";
|
|
16
|
+
price: number;
|
|
17
|
+
tax: number;
|
|
18
|
+
taxRate: number;
|
|
19
|
+
}[];
|
|
20
|
+
hasRange: boolean;
|
|
21
|
+
listPrice: components["schemas"]["CartListPrice"] | null;
|
|
22
|
+
netPrice: number;
|
|
23
|
+
positionPrice: number;
|
|
24
|
+
quantity: number;
|
|
25
|
+
rawTotal: number;
|
|
26
|
+
referencePrice: components["schemas"]["CartPriceReference"] | null;
|
|
27
|
+
regulationPrice: {
|
|
28
|
+
apiAlias?: "cart_regulation_price";
|
|
29
|
+
price?: number;
|
|
30
|
+
} | null;
|
|
31
|
+
taxRules: {
|
|
32
|
+
name?: string;
|
|
33
|
+
taxRate?: number;
|
|
34
|
+
}[];
|
|
35
|
+
taxStatus: "net" | "tax-free";
|
|
36
|
+
totalPrice: number;
|
|
37
|
+
unitPrice: number;
|
|
38
|
+
variantId?: string | null;
|
|
39
|
+
} | undefined>;
|
|
40
|
+
totalPrice: ComputedRef<number | undefined>;
|
|
41
|
+
unitPrice: ComputedRef<number | undefined>;
|
|
42
|
+
displayFromVariants: ComputedRef<number | false | undefined>;
|
|
43
|
+
displayFrom: ComputedRef<boolean>;
|
|
44
|
+
tierPrices: ComputedRef< TierPrice[]>;
|
|
45
|
+
referencePrice: ComputedRef<{
|
|
46
|
+
apiAlias: "cart_price_reference";
|
|
47
|
+
hasRange: boolean;
|
|
48
|
+
listPrice: components["schemas"]["CartListPrice"] | null;
|
|
49
|
+
price?: number;
|
|
50
|
+
purchaseUnit?: number;
|
|
51
|
+
referenceUnit?: number;
|
|
52
|
+
regulationPrice: {
|
|
53
|
+
apiAlias?: "cart_regulation_price";
|
|
54
|
+
price?: number;
|
|
55
|
+
} | null;
|
|
56
|
+
unitName: string;
|
|
57
|
+
variantId?: string | null;
|
|
58
|
+
} | null | undefined>;
|
|
59
|
+
isListPrice: ComputedRef<boolean>;
|
|
60
|
+
regulationPrice: ComputedRef<number | undefined>;
|
|
61
|
+
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Schemas, components, GenericRecord } from '
|
|
1
|
+
import { Schemas, components, GenericRecord } from '../../../api-types/storeApiTypes.d.ts';
|
|
2
2
|
import { MaybeRef, ComputedRef } from 'vue';
|
|
3
3
|
type DetailProduct<S extends Schemas> = S['CustomProductDetailResponse']['product'];
|
|
4
4
|
export declare function getProductVariantForOptions<S extends Schemas>(product: DetailProduct<S>, optionIds: string[]): {
|
|
@@ -0,0 +1,167 @@
|
|
|
1
|
+
import { Schemas } from '../../query/types';
|
|
2
|
+
import { ComputedRef } from 'vue';
|
|
3
|
+
import { components, GenericRecord } from '../../../api-types/storeApiTypes';
|
|
4
|
+
import { UseQueryReturnType } from '@tanstack/vue-query';
|
|
5
|
+
export declare function useUser(criteria?: Schemas['Criteria']): {
|
|
6
|
+
user: ComputedRef<({
|
|
7
|
+
active?: boolean;
|
|
8
|
+
activeBillingAddress: components["schemas"]["CustomerAddress"];
|
|
9
|
+
activeShippingAddress: components["schemas"]["CustomerAddress"];
|
|
10
|
+
addresses?: components["schemas"]["CustomerAddress"][];
|
|
11
|
+
affiliateCode?: string;
|
|
12
|
+
apiAlias: "customer";
|
|
13
|
+
birthday?: string;
|
|
14
|
+
campaignCode?: string;
|
|
15
|
+
readonly createdAt?: string;
|
|
16
|
+
createdById?: string;
|
|
17
|
+
customerNumber: string;
|
|
18
|
+
customFields?: GenericRecord;
|
|
19
|
+
defaultBillingAddress?: components["schemas"]["CustomerAddress"];
|
|
20
|
+
defaultBillingAddressId: string;
|
|
21
|
+
defaultShippingAddress?: components["schemas"]["CustomerAddress"];
|
|
22
|
+
defaultShippingAddressId: string;
|
|
23
|
+
doubleOptInConfirmDate?: string;
|
|
24
|
+
doubleOptInEmailSentDate?: string;
|
|
25
|
+
doubleOptInRegistration?: boolean;
|
|
26
|
+
email: string;
|
|
27
|
+
firstLogin?: string;
|
|
28
|
+
firstName: string;
|
|
29
|
+
group?: components["schemas"]["CustomerGroup"];
|
|
30
|
+
groupId: string;
|
|
31
|
+
guest?: boolean;
|
|
32
|
+
hash?: string;
|
|
33
|
+
id: string;
|
|
34
|
+
language?: components["schemas"]["Language"];
|
|
35
|
+
languageId: string;
|
|
36
|
+
lastLogin?: string;
|
|
37
|
+
lastName: string;
|
|
38
|
+
readonly lastOrderDate?: string;
|
|
39
|
+
lastPaymentMethod?: components["schemas"]["PaymentMethod"];
|
|
40
|
+
lastPaymentMethodId?: string;
|
|
41
|
+
readonly orderCount?: number;
|
|
42
|
+
readonly orderTotalAmount?: number;
|
|
43
|
+
readonly reviewCount?: number;
|
|
44
|
+
salesChannelId: string;
|
|
45
|
+
salutation?: components["schemas"]["Salutation"];
|
|
46
|
+
salutationId?: string;
|
|
47
|
+
readonly tagIds?: string[];
|
|
48
|
+
tags?: components["schemas"]["Tag"][];
|
|
49
|
+
title?: string;
|
|
50
|
+
readonly updatedAt?: string;
|
|
51
|
+
updatedById?: string;
|
|
52
|
+
} & ({
|
|
53
|
+
accountType: "private";
|
|
54
|
+
} | {
|
|
55
|
+
accountType: "business";
|
|
56
|
+
company: string;
|
|
57
|
+
vatIds: [string, ...string[]];
|
|
58
|
+
})) | undefined>;
|
|
59
|
+
isLoggedIn: ComputedRef<boolean>;
|
|
60
|
+
isCustomerSession: ComputedRef<boolean>;
|
|
61
|
+
isGuestSession: ComputedRef<boolean>;
|
|
62
|
+
defaultBillingAddressId: ComputedRef<string | null>;
|
|
63
|
+
defaultShippingAddressId: ComputedRef<string | null>;
|
|
64
|
+
userDefaultBillingAddress: ComputedRef<{
|
|
65
|
+
additionalAddressLine1?: string;
|
|
66
|
+
additionalAddressLine2?: string;
|
|
67
|
+
city: string;
|
|
68
|
+
company?: string;
|
|
69
|
+
country?: components["schemas"]["Country"];
|
|
70
|
+
countryId: string;
|
|
71
|
+
countryState?: components["schemas"]["CountryState"];
|
|
72
|
+
countryStateId?: string;
|
|
73
|
+
readonly createdAt?: string;
|
|
74
|
+
customerId: string;
|
|
75
|
+
customFields?: GenericRecord;
|
|
76
|
+
department?: string;
|
|
77
|
+
firstName: string;
|
|
78
|
+
hash?: string;
|
|
79
|
+
id: string;
|
|
80
|
+
lastName: string;
|
|
81
|
+
phoneNumber?: string;
|
|
82
|
+
salutation?: components["schemas"]["Salutation"];
|
|
83
|
+
salutationId?: string;
|
|
84
|
+
street: string;
|
|
85
|
+
title?: string;
|
|
86
|
+
readonly updatedAt?: string;
|
|
87
|
+
zipcode?: string;
|
|
88
|
+
} | null>;
|
|
89
|
+
userDefaultShippingAddress: ComputedRef<{
|
|
90
|
+
additionalAddressLine1?: string;
|
|
91
|
+
additionalAddressLine2?: string;
|
|
92
|
+
city: string;
|
|
93
|
+
company?: string;
|
|
94
|
+
country?: components["schemas"]["Country"];
|
|
95
|
+
countryId: string;
|
|
96
|
+
countryState?: components["schemas"]["CountryState"];
|
|
97
|
+
countryStateId?: string;
|
|
98
|
+
readonly createdAt?: string;
|
|
99
|
+
customerId: string;
|
|
100
|
+
customFields?: GenericRecord;
|
|
101
|
+
department?: string;
|
|
102
|
+
firstName: string;
|
|
103
|
+
hash?: string;
|
|
104
|
+
id: string;
|
|
105
|
+
lastName: string;
|
|
106
|
+
phoneNumber?: string;
|
|
107
|
+
salutation?: components["schemas"]["Salutation"];
|
|
108
|
+
salutationId?: string;
|
|
109
|
+
street: string;
|
|
110
|
+
title?: string;
|
|
111
|
+
readonly updatedAt?: string;
|
|
112
|
+
zipcode?: string;
|
|
113
|
+
} | null>;
|
|
114
|
+
customerQuery: UseQueryReturnType<{
|
|
115
|
+
active?: boolean;
|
|
116
|
+
activeBillingAddress: components["schemas"]["CustomerAddress"];
|
|
117
|
+
activeShippingAddress: components["schemas"]["CustomerAddress"];
|
|
118
|
+
addresses?: components["schemas"]["CustomerAddress"][];
|
|
119
|
+
affiliateCode?: string;
|
|
120
|
+
apiAlias: "customer";
|
|
121
|
+
birthday?: string;
|
|
122
|
+
campaignCode?: string;
|
|
123
|
+
readonly createdAt?: string;
|
|
124
|
+
createdById?: string;
|
|
125
|
+
customerNumber: string;
|
|
126
|
+
customFields?: GenericRecord;
|
|
127
|
+
defaultBillingAddress?: components["schemas"]["CustomerAddress"];
|
|
128
|
+
defaultBillingAddressId: string;
|
|
129
|
+
defaultShippingAddress?: components["schemas"]["CustomerAddress"];
|
|
130
|
+
defaultShippingAddressId: string;
|
|
131
|
+
doubleOptInConfirmDate?: string;
|
|
132
|
+
doubleOptInEmailSentDate?: string;
|
|
133
|
+
doubleOptInRegistration?: boolean;
|
|
134
|
+
email: string;
|
|
135
|
+
firstLogin?: string;
|
|
136
|
+
firstName: string;
|
|
137
|
+
group?: components["schemas"]["CustomerGroup"];
|
|
138
|
+
groupId: string;
|
|
139
|
+
guest?: boolean;
|
|
140
|
+
hash?: string;
|
|
141
|
+
id: string;
|
|
142
|
+
language?: components["schemas"]["Language"];
|
|
143
|
+
languageId: string;
|
|
144
|
+
lastLogin?: string;
|
|
145
|
+
lastName: string;
|
|
146
|
+
readonly lastOrderDate?: string;
|
|
147
|
+
lastPaymentMethod?: components["schemas"]["PaymentMethod"];
|
|
148
|
+
lastPaymentMethodId?: string;
|
|
149
|
+
readonly orderCount?: number;
|
|
150
|
+
readonly orderTotalAmount?: number;
|
|
151
|
+
readonly reviewCount?: number;
|
|
152
|
+
salesChannelId: string;
|
|
153
|
+
salutation?: components["schemas"]["Salutation"];
|
|
154
|
+
salutationId?: string;
|
|
155
|
+
readonly tagIds?: string[];
|
|
156
|
+
tags?: components["schemas"]["Tag"][];
|
|
157
|
+
title?: string;
|
|
158
|
+
readonly updatedAt?: string;
|
|
159
|
+
updatedById?: string;
|
|
160
|
+
} & ({
|
|
161
|
+
accountType: "private";
|
|
162
|
+
} | {
|
|
163
|
+
accountType: "business";
|
|
164
|
+
company: string;
|
|
165
|
+
vatIds: [string, ...string[]];
|
|
166
|
+
}), Error>;
|
|
167
|
+
};
|
package/dist/index.d.ts
CHANGED
|
@@ -1,190 +1,5 @@
|
|
|
1
|
-
import { Schemas as BaseSchemas, operations, components, GenericRecord } from '../api-types/storeApiTypes.d.ts';
|
|
2
|
-
import { MaybeRef, ComputedRef } from 'vue';
|
|
3
|
-
import { OperationProp } from '@teamnovu/kit-shopware-api-client';
|
|
4
|
-
import { UndefinedInitialQueryOptions, UseMutationReturnType, MutationObserverIdleResult, MutationObserverLoadingResult, MutationObserverErrorResult, MutationObserverSuccessResult } from '@tanstack/vue-query';
|
|
5
|
-
export * from './general/useSeoUrl';
|
|
6
1
|
export * from './inject';
|
|
7
2
|
export * from './keys';
|
|
8
|
-
export * from './
|
|
9
|
-
export * from './
|
|
10
|
-
export * from './
|
|
11
|
-
export * from './util/url';
|
|
12
|
-
export default class ShopwareComposables<Operations extends operations, Schemas extends BaseSchemas> {
|
|
13
|
-
useProductListingQueryOptions: (seoUrl: MaybeRef<string>, body?: MaybeRef<OperationProp<Operations, "readCompactProductListing post /novu/headless/product-listing/{seoUrl}", "body">> | undefined) => UndefinedInitialQueryOptions<OperationProp<operations & Operations, "readCompactProductListing post /novu/headless/product-listing/{seoUrl}", "response">, Error, OperationProp<operations & Operations, "readCompactProductListing post /novu/headless/product-listing/{seoUrl}", "response">, readonly ["product", "list", {
|
|
14
|
-
readonly url: MaybeRef<string>;
|
|
15
|
-
readonly body: unknown;
|
|
16
|
-
}]> & {
|
|
17
|
-
queryKey: readonly ["product", "list", {
|
|
18
|
-
readonly url: MaybeRef<string>;
|
|
19
|
-
readonly body: unknown;
|
|
20
|
-
}] & {
|
|
21
|
-
[dataTagSymbol]: OperationProp<operations & Operations, "readCompactProductListing post /novu/headless/product-listing/{seoUrl}", "response">;
|
|
22
|
-
[dataTagErrorSymbol]: Error;
|
|
23
|
-
};
|
|
24
|
-
};
|
|
25
|
-
useCategoryQueryOptions: (body?: MaybeRef<OperationProp<Operations, "readCategoryList post /category", "body">> | undefined) => UndefinedInitialQueryOptions<OperationProp<operations & Operations, "readCategoryList post /category", "response">, Error, OperationProp<operations & Operations, "readCategoryList post /category", "response">, readonly ["category", "list", {
|
|
26
|
-
readonly body: unknown;
|
|
27
|
-
}]> & {
|
|
28
|
-
queryKey: readonly ["category", "list", {
|
|
29
|
-
readonly body: unknown;
|
|
30
|
-
}] & {
|
|
31
|
-
[dataTagSymbol]: OperationProp<operations & Operations, "readCategoryList post /category", "response">;
|
|
32
|
-
[dataTagErrorSymbol]: Error;
|
|
33
|
-
};
|
|
34
|
-
};
|
|
35
|
-
useContextOptions: () => UndefinedInitialQueryOptions<OperationProp<operations & Operations, "readContext get /context", "response">, Error, OperationProp<operations & Operations, "readContext get /context", "response">, readonly ["context"]> & {
|
|
36
|
-
queryKey: readonly ["context"] & {
|
|
37
|
-
[dataTagSymbol]: OperationProp<operations & Operations, "readContext get /context", "response">;
|
|
38
|
-
[dataTagErrorSymbol]: Error;
|
|
39
|
-
};
|
|
40
|
-
};
|
|
41
|
-
useContextUpdate: () => UseMutationReturnType<OperationProp<operations & Operations, "updateContext patch /context", "response">, Error, void, unknown, Omit< MutationObserverIdleResult<OperationProp<operations & Operations, "updateContext patch /context", "response">, Error, void, unknown>, "mutate" | "reset"> | Omit< MutationObserverLoadingResult<OperationProp<operations & Operations, "updateContext patch /context", "response">, Error, void, unknown>, "mutate" | "reset"> | Omit< MutationObserverErrorResult<OperationProp<operations & Operations, "updateContext patch /context", "response">, Error, void, unknown>, "mutate" | "reset"> | Omit< MutationObserverSuccessResult<OperationProp<operations & Operations, "updateContext patch /context", "response">, Error, void, unknown>, "mutate" | "reset">>;
|
|
42
|
-
useProductQueryOptions: (seoUrl: MaybeRef<string>, body?: MaybeRef<OperationProp<Operations, "readCustomProductDetail post /novu/headless/product/{seoUrl}", "body">> | undefined) => UndefinedInitialQueryOptions<OperationProp<operations & Operations, "readCustomProductDetail post /novu/headless/product/{seoUrl}", "response">, Error, OperationProp<operations & Operations, "readCustomProductDetail post /novu/headless/product/{seoUrl}", "response">, readonly ["product", "detail", {
|
|
43
|
-
readonly url: MaybeRef<string>;
|
|
44
|
-
readonly body: unknown;
|
|
45
|
-
}]> & {
|
|
46
|
-
queryKey: readonly ["product", "detail", {
|
|
47
|
-
readonly url: MaybeRef<string>;
|
|
48
|
-
readonly body: unknown;
|
|
49
|
-
}] & {
|
|
50
|
-
[dataTagSymbol]: OperationProp<operations & Operations, "readCustomProductDetail post /novu/headless/product/{seoUrl}", "response">;
|
|
51
|
-
[dataTagErrorSymbol]: Error;
|
|
52
|
-
};
|
|
53
|
-
};
|
|
54
|
-
useProductVariantForOptions: (product: MaybeRef<Schemas["CustomProductDetailResponse"]["product"]>, optionIds: MaybeRef<string[]>) => ComputedRef<{
|
|
55
|
-
active?: boolean;
|
|
56
|
-
apiAlias: "product";
|
|
57
|
-
readonly available?: boolean;
|
|
58
|
-
readonly availableStock?: number;
|
|
59
|
-
calculatedCheapestPrice?: {
|
|
60
|
-
apiAlias?: "calculated_cheapest_price";
|
|
61
|
-
hasRange?: boolean;
|
|
62
|
-
listPrice?: components["schemas"]["ListPrice"] | null;
|
|
63
|
-
quantity?: number;
|
|
64
|
-
referencePrice?: components["schemas"]["ReferencePrice"] | null;
|
|
65
|
-
regulationPrice?: {
|
|
66
|
-
price: number;
|
|
67
|
-
} | null;
|
|
68
|
-
totalPrice?: number;
|
|
69
|
-
unitPrice?: number;
|
|
70
|
-
variantId?: string | null;
|
|
71
|
-
};
|
|
72
|
-
calculatedMaxPurchase?: number;
|
|
73
|
-
calculatedPrice: components["schemas"]["CalculatedPrice"];
|
|
74
|
-
calculatedPrices: components["schemas"]["CalculatedPrice"][];
|
|
75
|
-
canonicalProduct?: components["schemas"]["Product"];
|
|
76
|
-
canonicalProductId?: string;
|
|
77
|
-
canonicalProductVersionId?: string;
|
|
78
|
-
categories?: components["schemas"]["Category"][];
|
|
79
|
-
categoriesRo?: components["schemas"]["Category"][];
|
|
80
|
-
readonly categoryIds?: string[];
|
|
81
|
-
readonly categoryTree?: string[];
|
|
82
|
-
readonly childCount?: number;
|
|
83
|
-
children?: components["schemas"]["Product"][];
|
|
84
|
-
cmsPage?: components["schemas"]["CmsPage"];
|
|
85
|
-
cmsPageId?: string;
|
|
86
|
-
cmsPageVersionId?: string;
|
|
87
|
-
configuratorSettings?: components["schemas"]["ProductConfiguratorSetting"][];
|
|
88
|
-
cover?: components["schemas"]["ProductMedia"];
|
|
89
|
-
coverId?: string;
|
|
90
|
-
readonly createdAt?: string;
|
|
91
|
-
crossSellings?: components["schemas"]["ProductCrossSelling"][];
|
|
92
|
-
customFields?: GenericRecord;
|
|
93
|
-
deliveryTime?: components["schemas"]["DeliveryTime"];
|
|
94
|
-
deliveryTimeId?: string;
|
|
95
|
-
description?: string;
|
|
96
|
-
readonly displayGroup?: string;
|
|
97
|
-
downloads?: components["schemas"]["ProductDownload"][];
|
|
98
|
-
ean?: string;
|
|
99
|
-
extensions?: {
|
|
100
|
-
novuSeoUrls?: GenericRecord;
|
|
101
|
-
variants?: GenericRecord;
|
|
102
|
-
};
|
|
103
|
-
height?: number;
|
|
104
|
-
id: string;
|
|
105
|
-
isCloseout?: boolean;
|
|
106
|
-
isNew?: boolean;
|
|
107
|
-
keywords?: string;
|
|
108
|
-
length?: number;
|
|
109
|
-
mainCategories?: components["schemas"]["MainCategory"][];
|
|
110
|
-
manufacturer?: components["schemas"]["ProductManufacturer"];
|
|
111
|
-
manufacturerId?: string;
|
|
112
|
-
manufacturerNumber?: string;
|
|
113
|
-
markAsTopseller?: boolean;
|
|
114
|
-
maxPurchase?: number;
|
|
115
|
-
media?: components["schemas"]["ProductMedia"][];
|
|
116
|
-
metaDescription?: string;
|
|
117
|
-
metaTitle?: string;
|
|
118
|
-
minPurchase?: number;
|
|
119
|
-
name: string;
|
|
120
|
-
readonly optionIds?: string[];
|
|
121
|
-
options?: components["schemas"]["PropertyGroupOption"][];
|
|
122
|
-
packUnit?: string;
|
|
123
|
-
packUnitPlural?: string;
|
|
124
|
-
parent?: components["schemas"]["Product"];
|
|
125
|
-
parentId?: string;
|
|
126
|
-
parentVersionId?: string;
|
|
127
|
-
productManufacturerVersionId?: string;
|
|
128
|
-
productMediaVersionId?: string;
|
|
129
|
-
productNumber: string;
|
|
130
|
-
productReviews?: components["schemas"]["ProductReview"][];
|
|
131
|
-
properties?: components["schemas"]["PropertyGroupOption"][];
|
|
132
|
-
readonly propertyIds?: string[];
|
|
133
|
-
purchaseSteps?: number;
|
|
134
|
-
purchaseUnit?: number;
|
|
135
|
-
readonly ratingAverage?: number;
|
|
136
|
-
referenceUnit?: number;
|
|
137
|
-
releaseDate?: string;
|
|
138
|
-
restockTime?: number;
|
|
139
|
-
readonly sales?: number;
|
|
140
|
-
seoCategory: components["schemas"]["Category"];
|
|
141
|
-
seoUrls?: components["schemas"]["SeoUrl"][];
|
|
142
|
-
shippingFree?: boolean;
|
|
143
|
-
sortedProperties?: GenericRecord;
|
|
144
|
-
readonly states?: string[];
|
|
145
|
-
stock: number;
|
|
146
|
-
readonly streamIds?: string[];
|
|
147
|
-
streams?: components["schemas"]["ProductStream"][];
|
|
148
|
-
readonly tagIds?: string[];
|
|
149
|
-
tags?: components["schemas"]["Tag"][];
|
|
150
|
-
tax?: components["schemas"]["Tax"];
|
|
151
|
-
taxId: string;
|
|
152
|
-
translated: {
|
|
153
|
-
canonicalProductId: string;
|
|
154
|
-
canonicalProductVersionId: string;
|
|
155
|
-
cmsPageId: string;
|
|
156
|
-
cmsPageVersionId: string;
|
|
157
|
-
coverId: string;
|
|
158
|
-
deliveryTimeId: string;
|
|
159
|
-
description: string;
|
|
160
|
-
displayGroup: string;
|
|
161
|
-
ean: string;
|
|
162
|
-
keywords: string;
|
|
163
|
-
manufacturerId: string;
|
|
164
|
-
manufacturerNumber: string;
|
|
165
|
-
metaDescription: string;
|
|
166
|
-
metaTitle: string;
|
|
167
|
-
name: string;
|
|
168
|
-
packUnit: string;
|
|
169
|
-
packUnitPlural: string;
|
|
170
|
-
parentId: string;
|
|
171
|
-
parentVersionId: string;
|
|
172
|
-
productManufacturerVersionId: string;
|
|
173
|
-
productMediaVersionId: string;
|
|
174
|
-
productNumber: string;
|
|
175
|
-
releaseDate: string;
|
|
176
|
-
taxId: string;
|
|
177
|
-
unitId: string;
|
|
178
|
-
versionId: string;
|
|
179
|
-
};
|
|
180
|
-
unit?: components["schemas"]["Unit"];
|
|
181
|
-
unitId?: string;
|
|
182
|
-
readonly updatedAt?: string;
|
|
183
|
-
variantListingConfig?: {
|
|
184
|
-
displayParent?: boolean;
|
|
185
|
-
} | null;
|
|
186
|
-
versionId?: string;
|
|
187
|
-
weight?: number;
|
|
188
|
-
width?: number;
|
|
189
|
-
} | undefined>;
|
|
190
|
-
}
|
|
3
|
+
export * from './helpers';
|
|
4
|
+
export * from './query';
|
|
5
|
+
export * from './util';
|