@teamnovu/kit-shopware-composables 0.0.3 → 0.0.5

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 (149) hide show
  1. package/api-types/storeApiSchema.localhost.http +1 -1
  2. package/dist/helpers/checkout/index.d.ts +5 -0
  3. package/dist/helpers/checkout/useAddresses.d.ts +210 -0
  4. package/dist/helpers/checkout/useOrderDetails.d.ts +185 -0
  5. package/dist/helpers/checkout/useOrderPayment.d.ts +73 -0
  6. package/dist/helpers/checkout/usePaymentMethods.d.ts +155 -0
  7. package/dist/helpers/checkout/useShippingMethods.d.ts +173 -0
  8. package/dist/helpers/general/index.d.ts +2 -0
  9. package/dist/{usePagination.d.ts → helpers/general/usePagination.d.ts} +1 -1
  10. package/dist/{general → helpers/general}/useSeoUrl.d.ts +1 -1
  11. package/dist/helpers/index.d.ts +4 -0
  12. package/dist/helpers/product/index.d.ts +2 -0
  13. package/dist/helpers/product/useProductPrice.d.ts +61 -0
  14. package/dist/{products → helpers/product}/useProductVariantForOptions.d.ts +1 -1
  15. package/dist/helpers/user/index.d.ts +2 -0
  16. package/dist/helpers/user/useIsLoggedIn.d.ts +2 -0
  17. package/dist/helpers/user/useUser.d.ts +167 -0
  18. package/dist/index.d.ts +3 -221
  19. package/dist/index.mjs +850 -222
  20. package/dist/inject.d.ts +2 -2
  21. package/dist/keys.d.ts +32 -0
  22. package/dist/query/address/index.d.ts +3 -0
  23. package/dist/query/address/useCreateCustomerAddressMutation.d.ts +166 -0
  24. package/dist/query/address/useDeleteCustomerAddressMutation.d.ts +5 -0
  25. package/dist/query/address/useListAddressQuery.d.ts +48 -0
  26. package/dist/query/cart/index.d.ts +4 -0
  27. package/dist/query/cart/useAddLineItemMutation.d.ts +131 -0
  28. package/dist/query/cart/useReadCartQuery.d.ts +108 -0
  29. package/dist/query/cart/useRemoveLineItemMutation.d.ts +136 -0
  30. package/dist/query/cart/useUpdateLineItemMutation.d.ts +131 -0
  31. package/dist/query/checkout/index.d.ts +2 -0
  32. package/dist/query/checkout/useCheckout.d.ts +1 -0
  33. package/dist/query/checkout/useCreateOrderMutation.d.ts +281 -0
  34. package/dist/query/context/index.d.ts +2 -0
  35. package/dist/query/context/useReadContextQuery.d.ts +153 -0
  36. package/dist/query/context/useUpdateContextMutation.d.ts +60 -0
  37. package/dist/query/customer/index.d.ts +6 -0
  38. package/dist/query/customer/useChangeEmailMutation.d.ts +15 -0
  39. package/dist/query/customer/useChangeProfileMutation.d.ts +15 -0
  40. package/dist/query/customer/useLoginCustomerMutation.d.ts +30 -0
  41. package/dist/query/customer/useLogoutCustomerMutation.d.ts +15 -0
  42. package/dist/query/customer/useReadCustomerQuery.d.ts +220 -0
  43. package/dist/query/customer/useRegisterCustomerMutation.d.ts +266 -0
  44. package/dist/query/index.d.ts +10 -0
  45. package/dist/query/order/index.d.ts +1 -0
  46. package/dist/query/order/useReadOrderQuery.d.ts +44 -0
  47. package/dist/query/payment/index.d.ts +3 -0
  48. package/dist/query/payment/useHandlePaymentMutation.d.ts +15 -0
  49. package/dist/query/payment/useOrderSetPaymentMutation.d.ts +15 -0
  50. package/dist/query/payment/useReadPaymentMethodQuery.d.ts +31 -0
  51. package/dist/query/products/index.d.ts +3 -0
  52. package/dist/query/products/useReadCategoryListQuery.d.ts +48 -0
  53. package/dist/query/products/useReadCompactProductListingQuery.d.ts +35 -0
  54. package/dist/query/products/useReadCustomProductDetailQuery.d.ts +67 -0
  55. package/dist/query/shipping/index.d.ts +1 -0
  56. package/dist/query/shipping/useReadShippingMethodQuery.d.ts +55 -0
  57. package/dist/query/types/index.d.ts +2 -0
  58. package/dist/query/types/operations.d.ts +5 -0
  59. package/dist/query/types/query.d.ts +17 -0
  60. package/dist/util/index.d.ts +3 -0
  61. package/dist/util/unrefOptions.d.ts +4 -0
  62. package/dist/util/useOptimistic.d.ts +12 -0
  63. package/docs/index.md +457 -0
  64. package/docs/info.json +3 -0
  65. package/package.json +5 -1
  66. package/src/helpers/checkout/index.ts +5 -0
  67. package/src/helpers/checkout/useAddresses.ts +57 -0
  68. package/src/helpers/checkout/useOrderDetails.ts +93 -0
  69. package/src/helpers/checkout/useOrderPayment.ts +28 -0
  70. package/src/helpers/checkout/usePaymentMethods.ts +35 -0
  71. package/src/helpers/checkout/useShippingMethods.ts +35 -0
  72. package/src/helpers/general/index.ts +2 -0
  73. package/src/helpers/index.ts +4 -0
  74. package/src/helpers/product/index.ts +2 -0
  75. package/src/{products → helpers/product}/useProductPrice.ts +1 -43
  76. package/src/helpers/user/index.ts +2 -0
  77. package/src/helpers/user/useIsLoggedIn.ts +10 -0
  78. package/src/helpers/user/useUser.ts +53 -0
  79. package/src/index.ts +4 -29
  80. package/src/inject.ts +3 -3
  81. package/src/keys.ts +57 -0
  82. package/src/query/address/index.ts +3 -0
  83. package/src/query/address/useCreateCustomerAddressMutation.ts +32 -0
  84. package/src/query/address/useDeleteCustomerAddressMutation.ts +32 -0
  85. package/src/query/address/useListAddressQuery.ts +29 -0
  86. package/src/query/cart/index.ts +4 -0
  87. package/src/query/cart/useAddLineItemMutation.ts +45 -0
  88. package/src/query/cart/useReadCartQuery.ts +28 -0
  89. package/src/query/cart/useRemoveLineItemMutation.ts +32 -0
  90. package/src/query/cart/useUpdateLineItemMutation.ts +45 -0
  91. package/src/query/checkout/index.ts +2 -0
  92. package/src/query/checkout/useCheckout.ts +2 -0
  93. package/src/query/checkout/useCreateOrderMutation.ts +35 -0
  94. package/src/query/context/index.ts +2 -0
  95. package/src/query/context/useReadContextQuery.ts +19 -0
  96. package/src/query/context/useUpdateContextMutation.ts +36 -0
  97. package/src/query/customer/index.ts +6 -0
  98. package/src/query/customer/useChangeEmailMutation.ts +32 -0
  99. package/src/query/customer/useChangeProfileMutation.ts +32 -0
  100. package/src/query/customer/useLoginCustomerMutation.ts +42 -0
  101. package/src/query/customer/useLogoutCustomerMutation.ts +32 -0
  102. package/src/query/customer/useReadCustomerQuery.ts +27 -0
  103. package/src/query/customer/useRegisterCustomerMutation.ts +32 -0
  104. package/src/query/index.ts +10 -0
  105. package/src/query/order/index.ts +1 -0
  106. package/src/query/order/useReadOrderQuery.ts +33 -0
  107. package/src/query/payment/index.ts +3 -0
  108. package/src/query/payment/useHandlePaymentMutation.ts +27 -0
  109. package/src/query/payment/useOrderSetPaymentMutation.ts +32 -0
  110. package/src/query/payment/useReadPaymentMethodQuery.ts +30 -0
  111. package/src/query/products/index.ts +3 -0
  112. package/src/query/products/useReadCategoryListQuery.ts +28 -0
  113. package/src/query/products/useReadCompactProductListingQuery.ts +41 -0
  114. package/src/query/products/useReadCustomProductDetailQuery.ts +41 -0
  115. package/src/query/shipping/index.ts +1 -0
  116. package/src/query/shipping/useReadShippingMethodQuery.ts +29 -0
  117. package/src/query/types/index.ts +2 -0
  118. package/src/query/types/operations.ts +6 -0
  119. package/src/query/types/query.ts +39 -0
  120. package/src/util/index.ts +3 -0
  121. package/src/util/unrefOptions.ts +19 -0
  122. package/src/util/useOptimistic.ts +49 -0
  123. package/tsconfig.json +5 -2
  124. package/dist/cart/useCartAddItemMutation.d.ts +0 -12
  125. package/dist/cart/useCartQueryOptions.d.ts +0 -9
  126. package/dist/cart/useCartRemoveItemMutation.d.ts +0 -7
  127. package/dist/cart/useCartUpdateItemMutation.d.ts +0 -12
  128. package/dist/context/useContextOptions.d.ts +0 -9
  129. package/dist/context/useContextUpdate.d.ts +0 -4
  130. package/dist/products/useCategoryQueryOptions.d.ts +0 -17
  131. package/dist/products/useProductListingQueryOptions.d.ts +0 -19
  132. package/dist/products/useProductListingQueryOptions.test.d.ts +0 -1
  133. package/dist/products/useProductPrice.d.ts +0 -49
  134. package/dist/products/useProductQueryOptions.d.ts +0 -19
  135. package/dist/types/query.d.ts +0 -7
  136. package/src/cart/useCartAddItemMutation.ts +0 -48
  137. package/src/cart/useCartQueryOptions.ts +0 -19
  138. package/src/cart/useCartRemoveItemMutation.ts +0 -32
  139. package/src/cart/useCartUpdateItemMutation.ts +0 -48
  140. package/src/context/useContextOptions.ts +0 -16
  141. package/src/context/useContextUpdate.ts +0 -16
  142. package/src/products/useCategoryQueryOptions.ts +0 -25
  143. package/src/products/useProductListingQueryOptions.test.ts +0 -24
  144. package/src/products/useProductListingQueryOptions.ts +0 -29
  145. package/src/products/useProductQueryOptions.ts +0 -29
  146. package/src/types/query.ts +0 -18
  147. /package/src/{usePagination.ts → helpers/general/usePagination.ts} +0 -0
  148. /package/src/{general → helpers/general}/useSeoUrl.ts +0 -0
  149. /package/src/{products → helpers/product}/useProductVariantForOptions.ts +0 -0
@@ -1,4 +1,4 @@
1
- @baseUrl = http://localhost:8500/store-api
1
+ @baseUrl = http://localhost:81/store-api
2
2
  @swLanguageId = 2fbb5fe2e29a4d70aa5854ce7ce3e20b
3
3
  @swIncludeSeoUrls = true
4
4
 
@@ -0,0 +1,5 @@
1
+ export * from './useAddresses';
2
+ export * from './useOrderDetails';
3
+ export * from './useOrderPayment';
4
+ export * from './usePaymentMethods';
5
+ export * from './useShippingMethods';
@@ -0,0 +1,210 @@
1
+ import { Schemas, components, GenericRecord } from '../../../api-types/storeApiTypes.d.ts';
2
+ import { UseMutationReturnType, MutationObserverIdleResult, MutationObserverLoadingResult, MutationObserverErrorResult, MutationObserverSuccessResult, UseQueryReturnType } from '@tanstack/vue-query';
3
+ import { ComputedRef } from 'vue';
4
+ export declare function useCheckoutAddresses(): {
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
+ addressListQuery: UseQueryReturnType<{
99
+ elements: components["schemas"]["CustomerAddress"][];
100
+ } & {
101
+ aggregations?: GenericRecord[];
102
+ entity?: string;
103
+ limit?: number;
104
+ page?: number;
105
+ total?: number;
106
+ }, Error>;
107
+ setBillingAddress: (address: Schemas["CustomerAddress"]) => Promise<void>;
108
+ setShippingAddress: (address: Schemas["CustomerAddress"]) => Promise<void>;
109
+ isSaving: ComputedRef<boolean>;
110
+ activeBillingAddress: ComputedRef<{
111
+ additionalAddressLine1?: string;
112
+ additionalAddressLine2?: string;
113
+ city: string;
114
+ company?: string;
115
+ country?: components["schemas"]["Country"];
116
+ countryId: string;
117
+ countryState?: components["schemas"]["CountryState"];
118
+ countryStateId?: string;
119
+ readonly createdAt?: string;
120
+ customerId: string;
121
+ customFields?: GenericRecord;
122
+ department?: string;
123
+ firstName: string;
124
+ hash?: string;
125
+ id: string;
126
+ lastName: string;
127
+ phoneNumber?: string;
128
+ salutation?: components["schemas"]["Salutation"];
129
+ salutationId?: string;
130
+ street: string;
131
+ title?: string;
132
+ readonly updatedAt?: string;
133
+ zipcode?: string;
134
+ } | undefined>;
135
+ activeShippingAddress: ComputedRef<{
136
+ additionalAddressLine1?: string;
137
+ additionalAddressLine2?: string;
138
+ city: string;
139
+ company?: string;
140
+ country?: components["schemas"]["Country"];
141
+ countryId: string;
142
+ countryState?: components["schemas"]["CountryState"];
143
+ countryStateId?: string;
144
+ readonly createdAt?: string;
145
+ customerId: string;
146
+ customFields?: GenericRecord;
147
+ department?: string;
148
+ firstName: string;
149
+ hash?: string;
150
+ id: string;
151
+ lastName: string;
152
+ phoneNumber?: string;
153
+ salutation?: components["schemas"]["Salutation"];
154
+ salutationId?: string;
155
+ street: string;
156
+ title?: string;
157
+ readonly updatedAt?: string;
158
+ zipcode?: string;
159
+ } | undefined>;
160
+ inactiveBillingAddresses: ComputedRef<{
161
+ additionalAddressLine1?: string;
162
+ additionalAddressLine2?: string;
163
+ city: string;
164
+ company?: string;
165
+ country?: components["schemas"]["Country"];
166
+ countryId: string;
167
+ countryState?: components["schemas"]["CountryState"];
168
+ countryStateId?: string;
169
+ readonly createdAt?: string;
170
+ customerId: string;
171
+ customFields?: GenericRecord;
172
+ department?: string;
173
+ firstName: string;
174
+ hash?: string;
175
+ id: string;
176
+ lastName: string;
177
+ phoneNumber?: string;
178
+ salutation?: components["schemas"]["Salutation"];
179
+ salutationId?: string;
180
+ street: string;
181
+ title?: string;
182
+ readonly updatedAt?: string;
183
+ zipcode?: string;
184
+ }[]>;
185
+ inactiveShippingAddresses: ComputedRef<{
186
+ additionalAddressLine1?: string;
187
+ additionalAddressLine2?: string;
188
+ city: string;
189
+ company?: string;
190
+ country?: components["schemas"]["Country"];
191
+ countryId: string;
192
+ countryState?: components["schemas"]["CountryState"];
193
+ countryStateId?: string;
194
+ readonly createdAt?: string;
195
+ customerId: string;
196
+ customFields?: GenericRecord;
197
+ department?: string;
198
+ firstName: string;
199
+ hash?: string;
200
+ id: string;
201
+ lastName: string;
202
+ phoneNumber?: string;
203
+ salutation?: components["schemas"]["Salutation"];
204
+ salutationId?: string;
205
+ street: string;
206
+ title?: string;
207
+ readonly updatedAt?: string;
208
+ zipcode?: string;
209
+ }[]>;
210
+ };
@@ -0,0 +1,185 @@
1
+ import { MaybeRef, ComputedRef } from 'vue';
2
+ import { Schemas } from '../../query/types';
3
+ import { components, GenericRecord } from '../../../api-types/storeApiTypes';
4
+ import { UseQueryReturnType } from '@tanstack/vue-query';
5
+ export declare function useOrderDetails(orderId: MaybeRef<string>, criteria?: Schemas['Criteria']): {
6
+ order: ComputedRef<{
7
+ addresses?: components["schemas"]["OrderAddress"][];
8
+ affiliateCode?: string;
9
+ readonly amountNet?: number;
10
+ readonly amountTotal?: number;
11
+ billingAddress?: components["schemas"]["OrderAddress"];
12
+ billingAddressId: string;
13
+ billingAddressVersionId?: string;
14
+ campaignCode?: string;
15
+ readonly createdAt?: string;
16
+ createdById?: string;
17
+ currency?: components["schemas"]["Currency"];
18
+ currencyFactor: number;
19
+ currencyId: string;
20
+ customerComment?: string;
21
+ customFields?: GenericRecord;
22
+ deepLinkCode?: string;
23
+ deliveries?: components["schemas"]["OrderDelivery"][];
24
+ documents: components["schemas"]["Document"][];
25
+ id: string;
26
+ language?: components["schemas"]["Language"];
27
+ languageId: string;
28
+ lineItems?: components["schemas"]["OrderLineItem"][];
29
+ orderCustomer?: components["schemas"]["OrderCustomer"];
30
+ readonly orderDate: string;
31
+ orderDateTime: string;
32
+ orderNumber?: string;
33
+ readonly positionPrice?: number;
34
+ price: components["schemas"]["CalculatedPrice"];
35
+ salesChannelId: string;
36
+ shippingCosts?: {
37
+ calculatedTaxes?: GenericRecord;
38
+ listPrice?: {
39
+ discount?: number;
40
+ percentage?: number;
41
+ price?: number;
42
+ };
43
+ quantity: number;
44
+ referencePrice?: GenericRecord;
45
+ regulationPrice?: {
46
+ price?: number;
47
+ };
48
+ taxRules?: GenericRecord;
49
+ totalPrice: number;
50
+ unitPrice: number;
51
+ };
52
+ readonly shippingTotal?: number;
53
+ source?: string;
54
+ stateMachineState: components["schemas"]["StateMachineState"];
55
+ tags?: components["schemas"]["Tag"][];
56
+ readonly taxStatus?: string;
57
+ transactions?: components["schemas"]["OrderTransaction"][];
58
+ readonly updatedAt?: string;
59
+ updatedById?: string;
60
+ versionId?: string;
61
+ } | undefined>;
62
+ status: ComputedRef<string | undefined>;
63
+ statusTechnicalName: ComputedRef<string | undefined>;
64
+ total: ComputedRef<number | undefined>;
65
+ subtotal: ComputedRef<number | undefined>;
66
+ shippingCosts: ComputedRef<number | undefined>;
67
+ shippingAddress: ComputedRef<{
68
+ additionalAddressLine1?: string;
69
+ additionalAddressLine2?: string;
70
+ city: string;
71
+ company?: string;
72
+ country?: components["schemas"]["Country"];
73
+ countryId: string;
74
+ countryState?: components["schemas"]["CountryState"];
75
+ countryStateId?: string;
76
+ readonly createdAt?: string;
77
+ customFields?: GenericRecord;
78
+ department?: string;
79
+ firstName: string;
80
+ hash?: string;
81
+ id: string;
82
+ lastName: string;
83
+ phoneNumber?: string;
84
+ salutation?: components["schemas"]["Salutation"];
85
+ street: string;
86
+ title?: string;
87
+ readonly updatedAt?: string;
88
+ vatId?: string;
89
+ versionId?: string;
90
+ zipcode?: string;
91
+ } | undefined>;
92
+ billingAddress: ComputedRef<{
93
+ additionalAddressLine1?: string;
94
+ additionalAddressLine2?: string;
95
+ city: string;
96
+ company?: string;
97
+ country?: components["schemas"]["Country"];
98
+ countryId: string;
99
+ countryState?: components["schemas"]["CountryState"];
100
+ countryStateId?: string;
101
+ readonly createdAt?: string;
102
+ customFields?: GenericRecord;
103
+ department?: string;
104
+ firstName: string;
105
+ hash?: string;
106
+ id: string;
107
+ lastName: string;
108
+ phoneNumber?: string;
109
+ salutation?: components["schemas"]["Salutation"];
110
+ street: string;
111
+ title?: string;
112
+ readonly updatedAt?: string;
113
+ vatId?: string;
114
+ versionId?: string;
115
+ zipcode?: string;
116
+ } | undefined>;
117
+ personalDetails: ComputedRef<{
118
+ email: string | undefined;
119
+ firstName: string | undefined;
120
+ lastName: string | undefined;
121
+ }>;
122
+ shippingMethod: ComputedRef<{
123
+ active?: boolean;
124
+ availabilityRule?: components["schemas"]["Rule"];
125
+ readonly createdAt?: string;
126
+ customFields?: GenericRecord;
127
+ deliveryTime?: components["schemas"]["DeliveryTime"];
128
+ deliveryTimeId: string;
129
+ description?: string;
130
+ id: string;
131
+ media?: components["schemas"]["Media"];
132
+ mediaId?: string;
133
+ name: string;
134
+ position?: number;
135
+ prices?: components["schemas"]["ShippingMethodPrice"][];
136
+ tags?: components["schemas"]["Tag"][];
137
+ tax?: components["schemas"]["Tax"];
138
+ taxType?: string;
139
+ technicalName: string;
140
+ trackingUrl?: string;
141
+ translated: {
142
+ deliveryTimeId: string;
143
+ description: string;
144
+ mediaId: string;
145
+ name: string;
146
+ taxType: string;
147
+ technicalName: string;
148
+ trackingUrl: string;
149
+ };
150
+ readonly updatedAt?: string;
151
+ } | undefined>;
152
+ paymentMethod: ComputedRef<{
153
+ active?: boolean;
154
+ afterOrderEnabled?: boolean;
155
+ readonly createdAt?: string;
156
+ customFields?: GenericRecord;
157
+ description?: string;
158
+ readonly distinguishableName?: string;
159
+ id: string;
160
+ media?: components["schemas"]["Media"];
161
+ mediaId?: string;
162
+ name: string;
163
+ position?: number;
164
+ shortName?: string;
165
+ technicalName: string;
166
+ translated: {
167
+ description: string;
168
+ distinguishableName: string;
169
+ mediaId: string;
170
+ name: string;
171
+ shortName: string;
172
+ technicalName: string;
173
+ };
174
+ readonly updatedAt?: string;
175
+ } | undefined>;
176
+ paymentChangeable: ComputedRef<boolean>;
177
+ orderQuery: UseQueryReturnType<{
178
+ orders: {
179
+ elements: components["schemas"]["Order"][];
180
+ } & components["schemas"]["EntitySearchResult"];
181
+ paymentChangeable?: {
182
+ [key: string]: boolean;
183
+ };
184
+ }, Error>;
185
+ };
@@ -0,0 +1,73 @@
1
+ import { MaybeRef, ComputedRef } from 'vue';
2
+ import { Schemas } from '../../query/types';
3
+ import { GenericRecord, components } from '../../../api-types/storeApiTypes';
4
+ export declare function useOrderPayment(order: MaybeRef<Schemas['Order'] | null | undefined>): {
5
+ isAsynchronous: ComputedRef<any>;
6
+ activeTransaction: ComputedRef<{
7
+ amount: {
8
+ calculatedTaxes?: GenericRecord;
9
+ listPrice?: {
10
+ discount?: number;
11
+ percentage?: number;
12
+ price?: number;
13
+ };
14
+ quantity: number;
15
+ referencePrice?: GenericRecord;
16
+ regulationPrice?: {
17
+ price?: number;
18
+ };
19
+ taxRules?: GenericRecord;
20
+ totalPrice: number;
21
+ unitPrice: number;
22
+ };
23
+ captures?: components["schemas"]["OrderTransactionCapture"][];
24
+ readonly createdAt?: string;
25
+ customFields?: GenericRecord;
26
+ id: string;
27
+ orderId: string;
28
+ orderVersionId?: string;
29
+ paymentMethod?: components["schemas"]["PaymentMethod"];
30
+ paymentMethodId: string;
31
+ stateId: string;
32
+ stateMachineState?: components["schemas"]["StateMachineState"];
33
+ readonly updatedAt?: string;
34
+ validationData?: GenericRecord;
35
+ versionId?: string;
36
+ } | undefined>;
37
+ state: ComputedRef<{
38
+ readonly createdAt?: string;
39
+ customFields?: GenericRecord;
40
+ id?: string;
41
+ name: string;
42
+ technicalName: string;
43
+ translated: {
44
+ name: string;
45
+ technicalName: string;
46
+ };
47
+ readonly updatedAt?: string;
48
+ } | undefined>;
49
+ paymentMethod: ComputedRef<{
50
+ active?: boolean;
51
+ afterOrderEnabled?: boolean;
52
+ readonly createdAt?: string;
53
+ customFields?: GenericRecord;
54
+ description?: string;
55
+ readonly distinguishableName?: string;
56
+ id: string;
57
+ media?: components["schemas"]["Media"];
58
+ mediaId?: string;
59
+ name: string;
60
+ position?: number;
61
+ shortName?: string;
62
+ technicalName: string;
63
+ translated: {
64
+ description: string;
65
+ distinguishableName: string;
66
+ mediaId: string;
67
+ name: string;
68
+ shortName: string;
69
+ technicalName: string;
70
+ };
71
+ readonly updatedAt?: string;
72
+ } | undefined>;
73
+ };
@@ -0,0 +1,155 @@
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 usePaymentMethods(): {
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
+ paymentMethodsQuery: UseQueryReturnType<{
99
+ aggregations?: GenericRecord;
100
+ elements?: components["schemas"]["PaymentMethod"][];
101
+ total?: number;
102
+ }, Error>;
103
+ activePaymentMethod: ComputedRef<{
104
+ active?: boolean;
105
+ afterOrderEnabled?: boolean;
106
+ readonly createdAt?: string;
107
+ customFields?: GenericRecord;
108
+ description?: string;
109
+ readonly distinguishableName?: string;
110
+ id: string;
111
+ media?: components["schemas"]["Media"];
112
+ mediaId?: string;
113
+ name: string;
114
+ position?: number;
115
+ shortName?: string;
116
+ technicalName: string;
117
+ translated: {
118
+ description: string;
119
+ distinguishableName: string;
120
+ mediaId: string;
121
+ name: string;
122
+ shortName: string;
123
+ technicalName: string;
124
+ };
125
+ readonly updatedAt?: string;
126
+ } | undefined>;
127
+ setPaymentMethod: (paymentMethodId: string) => Promise<{
128
+ redirectUrl?: string;
129
+ }>;
130
+ isSaving: ComputedRef<boolean>;
131
+ paymentMethods: ComputedRef<{
132
+ active?: boolean;
133
+ afterOrderEnabled?: boolean;
134
+ readonly createdAt?: string;
135
+ customFields?: GenericRecord;
136
+ description?: string;
137
+ readonly distinguishableName?: string;
138
+ id: string;
139
+ media?: components["schemas"]["Media"];
140
+ mediaId?: string;
141
+ name: string;
142
+ position?: number;
143
+ shortName?: string;
144
+ technicalName: string;
145
+ translated: {
146
+ description: string;
147
+ distinguishableName: string;
148
+ mediaId: string;
149
+ name: string;
150
+ shortName: string;
151
+ technicalName: string;
152
+ };
153
+ readonly updatedAt?: string;
154
+ }[] | undefined>;
155
+ };