@hartl-services/medusa-storefront 0.0.0-stage → 0.2.0

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 (194) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +103 -2
  3. package/dist/browser/account-verification-channel.d.ts +11 -0
  4. package/dist/browser/account-verification-channel.js +32 -0
  5. package/dist/browser/actions.d.ts +53 -0
  6. package/dist/browser/actions.js +1 -0
  7. package/dist/browser/affiliate-referral.d.ts +152 -0
  8. package/dist/browser/affiliate-referral.js +85 -0
  9. package/dist/browser/browser-session.d.ts +3 -0
  10. package/dist/browser/browser-session.js +27 -0
  11. package/dist/browser/cart-mutations.d.ts +36 -0
  12. package/dist/browser/cart-mutations.js +137 -0
  13. package/dist/browser/cart-refresh.d.ts +11 -0
  14. package/dist/browser/cart-refresh.js +33 -0
  15. package/dist/browser/client.d.ts +15 -0
  16. package/dist/browser/client.js +20 -0
  17. package/dist/browser/fresh-order-marker.d.ts +11 -0
  18. package/dist/browser/fresh-order-marker.js +30 -0
  19. package/dist/browser/index.d.ts +946 -0
  20. package/dist/browser/index.js +70 -0
  21. package/dist/browser/query-invalidation.d.ts +4 -0
  22. package/dist/browser/query-invalidation.js +39 -0
  23. package/dist/browser/query-keys.d.ts +43 -0
  24. package/dist/browser/query-keys.js +28 -0
  25. package/dist/browser/query-options.d.ts +781 -0
  26. package/dist/browser/query-options.js +165 -0
  27. package/dist/browser/region.d.ts +5 -0
  28. package/dist/browser/region.js +15 -0
  29. package/dist/browser/unwrap-medusa-action.d.ts +7 -0
  30. package/dist/browser/unwrap-medusa-action.js +25 -0
  31. package/dist/core/action-result.d.ts +17 -0
  32. package/dist/core/action-result.js +12 -0
  33. package/dist/core/addresses.d.ts +46 -0
  34. package/dist/core/addresses.js +137 -0
  35. package/dist/core/affiliate/affiliate-application-errors.d.ts +2 -0
  36. package/dist/core/affiliate/affiliate-application-errors.js +14 -0
  37. package/dist/core/affiliate/affiliate-commission-presentation.d.ts +15 -0
  38. package/dist/core/affiliate/affiliate-commission-presentation.js +28 -0
  39. package/dist/core/affiliate/affiliate-coupon-code-presentation.d.ts +10 -0
  40. package/dist/core/affiliate/affiliate-coupon-code-presentation.js +22 -0
  41. package/dist/core/affiliate/affiliate-coupon-label.d.ts +3 -0
  42. package/dist/core/affiliate/affiliate-coupon-label.js +4 -0
  43. package/dist/core/affiliate/affiliate-date-range.d.ts +6 -0
  44. package/dist/core/affiliate/affiliate-date-range.js +16 -0
  45. package/dist/core/affiliate/affiliate-rate-presentation.d.ts +1 -0
  46. package/dist/core/affiliate/affiliate-rate-presentation.js +8 -0
  47. package/dist/core/affiliate/partner-company-address.d.ts +24 -0
  48. package/dist/core/affiliate/partner-company-address.js +31 -0
  49. package/dist/core/auth/customer-sign-in.d.ts +36 -0
  50. package/dist/core/auth/customer-sign-in.js +55 -0
  51. package/dist/core/auth/link-token.d.ts +8 -0
  52. package/dist/core/auth/link-token.js +11 -0
  53. package/dist/core/auth/login-code-auto-send.d.ts +7 -0
  54. package/dist/core/auth/login-code-auto-send.js +11 -0
  55. package/dist/core/auth/password-rule-label.d.ts +4 -0
  56. package/dist/core/auth/password-rule-label.js +13 -0
  57. package/dist/core/cart/cart-line-item-image-url.d.ts +9 -0
  58. package/dist/core/cart/cart-line-item-image-url.js +14 -0
  59. package/dist/core/cart/cart-normalization.d.ts +2 -0
  60. package/dist/core/cart/cart-normalization.js +11 -0
  61. package/dist/core/cart/cart-price-breakdown.d.ts +30 -0
  62. package/dist/core/cart/cart-price-breakdown.js +45 -0
  63. package/dist/core/cart/cart-tax-breakdown.d.ts +17 -0
  64. package/dist/core/cart/cart-tax-breakdown.js +18 -0
  65. package/dist/core/cart/coupon-promotions.d.ts +8 -0
  66. package/dist/core/cart/coupon-promotions.js +9 -0
  67. package/dist/core/cart/payment-session.d.ts +3 -0
  68. package/dist/core/cart/payment-session.js +12 -0
  69. package/dist/core/cart/refunded-cart.d.ts +27 -0
  70. package/dist/core/cart/refunded-cart.js +46 -0
  71. package/dist/core/catalog/category-filter.d.ts +16 -0
  72. package/dist/core/catalog/category-filter.js +33 -0
  73. package/dist/core/catalog/inventory.d.ts +10 -0
  74. package/dist/core/catalog/inventory.js +9 -0
  75. package/dist/core/catalog/medusa-product-image.d.ts +8 -0
  76. package/dist/core/catalog/medusa-product-image.js +13 -0
  77. package/dist/core/catalog/product-price.d.ts +8 -0
  78. package/dist/core/catalog/product-price.js +21 -0
  79. package/dist/core/catalog/selected-variant.d.ts +7 -0
  80. package/dist/core/catalog/selected-variant.js +9 -0
  81. package/dist/core/checkout/checkout-account-offer-state.d.ts +41 -0
  82. package/dist/core/checkout/checkout-account-offer-state.js +32 -0
  83. package/dist/core/checkout/checkout-address-draft.d.ts +39 -0
  84. package/dist/core/checkout/checkout-address-draft.js +78 -0
  85. package/dist/core/checkout/checkout-address-form.d.ts +24 -0
  86. package/dist/core/checkout/checkout-address-form.js +99 -0
  87. package/dist/core/checkout/checkout-coupon.d.ts +9 -0
  88. package/dist/core/checkout/checkout-coupon.js +13 -0
  89. package/dist/core/checkout/checkout-steps.d.ts +20 -0
  90. package/dist/core/checkout/checkout-steps.js +44 -0
  91. package/dist/core/checkout/customer-login-required.d.ts +12 -0
  92. package/dist/core/checkout/customer-login-required.js +14 -0
  93. package/dist/core/checkout/payment-authorization.d.ts +8 -0
  94. package/dist/core/checkout/payment-authorization.js +9 -0
  95. package/dist/core/checkout/stripe-redirect-return.d.ts +13 -0
  96. package/dist/core/checkout/stripe-redirect-return.js +29 -0
  97. package/dist/core/errors.d.ts +12 -0
  98. package/dist/core/errors.js +18 -0
  99. package/dist/core/fields.d.ts +18 -0
  100. package/dist/core/fields.js +20 -0
  101. package/dist/core/form-values.d.ts +162 -0
  102. package/dist/core/form-values.js +234 -0
  103. package/dist/core/format/money.d.ts +7 -0
  104. package/dist/core/format/money.js +6 -0
  105. package/dist/core/i18n.d.ts +24 -0
  106. package/dist/core/i18n.js +15 -0
  107. package/dist/core/image-url.d.ts +18 -0
  108. package/dist/core/image-url.js +34 -0
  109. package/dist/core/index.d.ts +48 -0
  110. package/dist/core/index.js +49 -0
  111. package/dist/core/order/order-payment-summary.d.ts +15 -0
  112. package/dist/core/order/order-payment-summary.js +48 -0
  113. package/dist/core/plugin-features.d.ts +21 -0
  114. package/dist/core/plugin-features.js +30 -0
  115. package/dist/core/query-string.d.ts +6 -0
  116. package/dist/core/query-string.js +16 -0
  117. package/dist/core/region.d.ts +11 -0
  118. package/dist/core/region.js +13 -0
  119. package/dist/core/report-error.d.ts +12 -0
  120. package/dist/core/report-error.js +1 -0
  121. package/dist/core/routing-locale.d.ts +1 -0
  122. package/dist/core/routing-locale.js +25 -0
  123. package/dist/core/settle-within.d.ts +8 -0
  124. package/dist/core/settle-within.js +14 -0
  125. package/dist/core/tax-compliance/address-tax-identification.d.ts +37 -0
  126. package/dist/core/tax-compliance/address-tax-identification.js +51 -0
  127. package/dist/core/tax-compliance/tax-identification.d.ts +18 -0
  128. package/dist/core/tax-compliance/tax-identification.js +58 -0
  129. package/dist/core/texts-de.d.ts +136 -0
  130. package/dist/core/texts-de.js +152 -0
  131. package/dist/react/cart-error-boundary.d.ts +24 -0
  132. package/dist/react/cart-error-boundary.js +57 -0
  133. package/dist/react/context.d.ts +17 -0
  134. package/dist/react/context.js +46 -0
  135. package/dist/react/index.d.ts +12 -0
  136. package/dist/react/index.js +14 -0
  137. package/dist/react/use-account.d.ts +214 -0
  138. package/dist/react/use-account.js +294 -0
  139. package/dist/react/use-affiliate.d.ts +566 -0
  140. package/dist/react/use-affiliate.js +573 -0
  141. package/dist/react/use-auth.d.ts +136 -0
  142. package/dist/react/use-auth.js +402 -0
  143. package/dist/react/use-cart.d.ts +57 -0
  144. package/dist/react/use-cart.js +137 -0
  145. package/dist/react/use-checkout-address-form.d.ts +156 -0
  146. package/dist/react/use-checkout-address-form.js +95 -0
  147. package/dist/react/use-checkout.d.ts +268 -0
  148. package/dist/react/use-checkout.js +873 -0
  149. package/dist/react/use-countdown.d.ts +5 -0
  150. package/dist/react/use-countdown.js +23 -0
  151. package/dist/react/use-link-token.d.ts +12 -0
  152. package/dist/react/use-link-token.js +17 -0
  153. package/dist/react/use-plugin-feature.d.ts +16 -0
  154. package/dist/react/use-plugin-feature.js +31 -0
  155. package/dist/react/use-verification-watch.d.ts +7 -0
  156. package/dist/react/use-verification-watch.js +49 -0
  157. package/dist/registry/account.json +248 -0
  158. package/dist/registry/affiliate.json +302 -0
  159. package/dist/registry/cart.json +127 -0
  160. package/dist/registry/checkout.json +169 -0
  161. package/dist/registry/form.json +145 -0
  162. package/dist/registry/registry.json +917 -0
  163. package/dist/registry/setup.json +76 -0
  164. package/dist/server/affiliate.d.ts +124 -0
  165. package/dist/server/affiliate.js +145 -0
  166. package/dist/server/cart.d.ts +10 -0
  167. package/dist/server/cart.js +113 -0
  168. package/dist/server/catalog.d.ts +28 -0
  169. package/dist/server/catalog.js +82 -0
  170. package/dist/server/checkout.d.ts +6 -0
  171. package/dist/server/checkout.js +12 -0
  172. package/dist/server/context.d.ts +38 -0
  173. package/dist/server/context.js +34 -0
  174. package/dist/server/customer.d.ts +84 -0
  175. package/dist/server/customer.js +362 -0
  176. package/dist/server/documents.d.ts +29 -0
  177. package/dist/server/documents.js +55 -0
  178. package/dist/server/index.d.ts +258 -0
  179. package/dist/server/index.js +45 -0
  180. package/dist/server/orders.d.ts +9 -0
  181. package/dist/server/orders.js +31 -0
  182. package/dist/server/plugin-features.d.ts +13 -0
  183. package/dist/server/plugin-features.js +52 -0
  184. package/dist/server/region.d.ts +6 -0
  185. package/dist/server/region.js +17 -0
  186. package/dist/server/route-response.d.ts +2 -0
  187. package/dist/server/route-response.js +17 -0
  188. package/dist/server/run-medusa-action.d.ts +7 -0
  189. package/dist/server/run-medusa-action.js +40 -0
  190. package/dist/server/session.d.ts +29 -0
  191. package/dist/server/session.js +106 -0
  192. package/dist/server/tax-compliance.d.ts +26 -0
  193. package/dist/server/tax-compliance.js +85 -0
  194. package/package.json +86 -3
@@ -0,0 +1,781 @@
1
+ import type { ListStoreAffiliateCouponCodesRequest, PartnerPortalCommissionsRequest } from "@hartl-services/medusa-contracts/types/affiliate-store";
2
+ import type { Translate } from "../core/i18n.js";
3
+ import type { StorefrontActions } from "./actions.js";
4
+ import type { BrowserAffiliateReferral } from "./affiliate-referral.js";
5
+ import type { BrowserCartMutations } from "./cart-mutations.js";
6
+ import type { BrowserRegion } from "./region.js";
7
+ import type { UnwrapMedusaAction } from "./unwrap-medusa-action.js";
8
+ /** Paths of the shop's Route Handlers the partner portal polls. */
9
+ export declare function createAffiliateApiPaths(apiBasePath: string): {
10
+ commissions: string;
11
+ consignmentInventory: string;
12
+ consignmentReports: string;
13
+ context: string;
14
+ couponCodes: string;
15
+ slugs: string;
16
+ };
17
+ interface QueryOptionDependencies {
18
+ actions: StorefrontActions;
19
+ affiliateApiPaths: ReturnType<typeof createAffiliateApiPaths>;
20
+ cart: Pick<BrowserCartMutations, "replaceRefundedCart">;
21
+ referral: Pick<BrowserAffiliateReferral, "getAffiliateCartReferral" | "resolveCouponLabels">;
22
+ region: BrowserRegion;
23
+ t: Translate;
24
+ unwrapMedusaAction: UnwrapMedusaAction;
25
+ }
26
+ export declare function createQueryOptions({ actions, affiliateApiPaths, cart, referral, region, t, unwrapMedusaAction }: QueryOptionDependencies): {
27
+ activeCart: () => import("@tanstack/react-query").OmitKeyof<import("@tanstack/react-query").UseQueryOptions<import("@medusajs/types").StoreCart | null, Error, import("@medusajs/types").StoreCart | null, readonly ["medusa", "cart", "active"]>, "queryFn"> & {
28
+ queryFn?: import("@tanstack/react-query").QueryFunction<import("@medusajs/types").StoreCart | null, readonly ["medusa", "cart", "active"], never> | undefined;
29
+ } & import("@tanstack/react-query").QueryKeyWithDataTag<readonly ["medusa", "cart", "active"], import("@medusajs/types").StoreCart | null, Error>;
30
+ customer: () => import("@tanstack/react-query").OmitKeyof<import("@tanstack/react-query").UseQueryOptions<import("@medusajs/types").StoreCustomerResponse | null, Error, import("@medusajs/types").StoreCustomerResponse | null, readonly ["medusa", "customer"]>, "queryFn"> & {
31
+ queryFn?: import("@tanstack/react-query").QueryFunction<import("@medusajs/types").StoreCustomerResponse | null, readonly ["medusa", "customer"], never> | undefined;
32
+ } & import("@tanstack/react-query").QueryKeyWithDataTag<readonly ["medusa", "customer"], import("@medusajs/types").StoreCustomerResponse | null, Error>;
33
+ shippingOptions: (cartId: string) => import("@tanstack/react-query").OmitKeyof<import("@tanstack/react-query").UseQueryOptions<import("@medusajs/types").StoreShippingOptionListResponse, Error, import("@medusajs/types").StoreShippingOptionListResponse, readonly ["medusa", "shipping-options", string]>, "queryFn"> & {
34
+ queryFn?: import("@tanstack/react-query").QueryFunction<import("@medusajs/types").StoreShippingOptionListResponse, readonly ["medusa", "shipping-options", string], never> | undefined;
35
+ } & import("@tanstack/react-query").QueryKeyWithDataTag<readonly ["medusa", "shipping-options", string], import("@medusajs/types").StoreShippingOptionListResponse, Error>;
36
+ paymentProviders: (regionId: string) => import("@tanstack/react-query").OmitKeyof<import("@tanstack/react-query").UseQueryOptions<import("@medusajs/types").StorePaymentProviderListResponse, Error, import("@medusajs/types").StorePaymentProviderListResponse, readonly ["medusa", "payment-providers", string]>, "queryFn"> & {
37
+ queryFn?: import("@tanstack/react-query").QueryFunction<import("@medusajs/types").StorePaymentProviderListResponse, readonly ["medusa", "payment-providers", string], never> | undefined;
38
+ } & import("@tanstack/react-query").QueryKeyWithDataTag<readonly ["medusa", "payment-providers", string], import("@medusajs/types").StorePaymentProviderListResponse, Error>;
39
+ region: (countryCode: string) => import("@tanstack/react-query").OmitKeyof<import("@tanstack/react-query").UseQueryOptions<import("@medusajs/types").StoreRegion | null, Error, import("@medusajs/types").StoreRegion | null, readonly ["medusa", "region", string]>, "queryFn"> & {
40
+ queryFn?: import("@tanstack/react-query").QueryFunction<import("@medusajs/types").StoreRegion | null, readonly ["medusa", "region", string], never> | undefined;
41
+ } & import("@tanstack/react-query").QueryKeyWithDataTag<readonly ["medusa", "region", string], import("@medusajs/types").StoreRegion | null, Error>;
42
+ storeRegions: () => import("@tanstack/react-query").OmitKeyof<import("@tanstack/react-query").UseQueryOptions<import("@medusajs/types").StoreRegionListResponse, Error, import("@medusajs/types").StoreRegionListResponse, readonly ["medusa", "regions"]>, "queryFn"> & {
43
+ queryFn?: import("@tanstack/react-query").QueryFunction<import("@medusajs/types").StoreRegionListResponse, readonly ["medusa", "regions"], never> | undefined;
44
+ } & import("@tanstack/react-query").QueryKeyWithDataTag<readonly ["medusa", "regions"], import("@medusajs/types").StoreRegionListResponse, Error>;
45
+ pluginFeatures: () => import("@tanstack/react-query").OmitKeyof<import("@tanstack/react-query").UseQueryOptions<import("../core/plugin-features.js").PluginFeatureMap, Error, import("../core/plugin-features.js").PluginFeatureMap, readonly ["medusa", "plugin-features"]>, "queryFn"> & {
46
+ queryFn?: import("@tanstack/react-query").QueryFunction<import("../core/plugin-features.js").PluginFeatureMap, readonly ["medusa", "plugin-features"], never> | undefined;
47
+ } & import("@tanstack/react-query").QueryKeyWithDataTag<readonly ["medusa", "plugin-features"], import("../core/plugin-features.js").PluginFeatureMap, Error>;
48
+ documents: () => import("@tanstack/react-query").OmitKeyof<import("@tanstack/react-query").UseQueryOptions<{
49
+ documents: {
50
+ id: string;
51
+ kind: "invoice" | "cancellation" | "credit_note";
52
+ number: string;
53
+ order_display_id: number | null;
54
+ issued_at: string;
55
+ total: {
56
+ amount: string;
57
+ currency_code: string;
58
+ };
59
+ }[];
60
+ }, Error, {
61
+ documents: {
62
+ id: string;
63
+ kind: "invoice" | "cancellation" | "credit_note";
64
+ number: string;
65
+ order_display_id: number | null;
66
+ issued_at: string;
67
+ total: {
68
+ amount: string;
69
+ currency_code: string;
70
+ };
71
+ }[];
72
+ }, readonly ["medusa", "documents"]>, "queryFn"> & {
73
+ queryFn?: import("@tanstack/react-query").QueryFunction<{
74
+ documents: {
75
+ id: string;
76
+ kind: "invoice" | "cancellation" | "credit_note";
77
+ number: string;
78
+ order_display_id: number | null;
79
+ issued_at: string;
80
+ total: {
81
+ amount: string;
82
+ currency_code: string;
83
+ };
84
+ }[];
85
+ }, readonly ["medusa", "documents"], never> | undefined;
86
+ } & import("@tanstack/react-query").QueryKeyWithDataTag<readonly ["medusa", "documents"], {
87
+ documents: {
88
+ id: string;
89
+ kind: "invoice" | "cancellation" | "credit_note";
90
+ number: string;
91
+ order_display_id: number | null;
92
+ issued_at: string;
93
+ total: {
94
+ amount: string;
95
+ currency_code: string;
96
+ };
97
+ }[];
98
+ }, Error>;
99
+ orders: ({ limit, offset }?: {
100
+ limit?: number | undefined;
101
+ offset?: number | undefined;
102
+ }) => import("@tanstack/react-query").OmitKeyof<import("@tanstack/react-query").UseQueryOptions<import("@medusajs/types").StoreOrderListResponse, Error, import("@medusajs/types").StoreOrderListResponse, readonly ["medusa", "orders", {
103
+ limit: number;
104
+ offset: number;
105
+ }]>, "queryFn"> & {
106
+ queryFn?: import("@tanstack/react-query").QueryFunction<import("@medusajs/types").StoreOrderListResponse, readonly ["medusa", "orders", {
107
+ limit: number;
108
+ offset: number;
109
+ }], never> | undefined;
110
+ } & import("@tanstack/react-query").QueryKeyWithDataTag<readonly ["medusa", "orders", {
111
+ limit: number;
112
+ offset: number;
113
+ }], import("@medusajs/types").StoreOrderListResponse, Error>;
114
+ /** One order with its lines and totals; needs the optional `getOrder` action. */
115
+ orderDetail: (orderId: string) => import("@tanstack/react-query").OmitKeyof<import("@tanstack/react-query").UseQueryOptions<import("@medusajs/types").StoreOrder | null, Error, import("@medusajs/types").StoreOrder | null, readonly ["medusa", "orders", "detail", string]>, "queryFn"> & {
116
+ queryFn?: import("@tanstack/react-query").QueryFunction<import("@medusajs/types").StoreOrder | null, readonly ["medusa", "orders", "detail", string], never> | undefined;
117
+ } & import("@tanstack/react-query").QueryKeyWithDataTag<readonly ["medusa", "orders", "detail", string], import("@medusajs/types").StoreOrder | null, Error>;
118
+ customerPasswordPolicy: () => import("@tanstack/react-query").OmitKeyof<import("@tanstack/react-query").UseQueryOptions<{
119
+ min_length: number;
120
+ require_mixed_case: boolean;
121
+ require_digit: boolean;
122
+ require_symbol: boolean;
123
+ }, Error, {
124
+ min_length: number;
125
+ require_mixed_case: boolean;
126
+ require_digit: boolean;
127
+ require_symbol: boolean;
128
+ }, readonly ["medusa", "customer-password-policy"]>, "queryFn"> & {
129
+ queryFn?: import("@tanstack/react-query").QueryFunction<{
130
+ min_length: number;
131
+ require_mixed_case: boolean;
132
+ require_digit: boolean;
133
+ require_symbol: boolean;
134
+ }, readonly ["medusa", "customer-password-policy"], never> | undefined;
135
+ } & import("@tanstack/react-query").QueryKeyWithDataTag<readonly ["medusa", "customer-password-policy"], {
136
+ min_length: number;
137
+ require_mixed_case: boolean;
138
+ require_digit: boolean;
139
+ require_symbol: boolean;
140
+ }, Error>;
141
+ customerTaxIdentifications: (isEnabled: boolean) => import("@tanstack/react-query").OmitKeyof<import("@tanstack/react-query").UseQueryOptions<{
142
+ identifications: {
143
+ customer_address_id: string;
144
+ status: "eligible" | "ineligible" | "unavailable" | "invalid";
145
+ verified: boolean;
146
+ vat_number: string;
147
+ company_name: string;
148
+ validated_at: string;
149
+ }[];
150
+ }, Error, {
151
+ identifications: {
152
+ customer_address_id: string;
153
+ status: "eligible" | "ineligible" | "unavailable" | "invalid";
154
+ verified: boolean;
155
+ vat_number: string;
156
+ company_name: string;
157
+ validated_at: string;
158
+ }[];
159
+ }, readonly ["medusa", "tax-identifications"]>, "queryFn"> & {
160
+ queryFn?: import("@tanstack/react-query").QueryFunction<{
161
+ identifications: {
162
+ customer_address_id: string;
163
+ status: "eligible" | "ineligible" | "unavailable" | "invalid";
164
+ verified: boolean;
165
+ vat_number: string;
166
+ company_name: string;
167
+ validated_at: string;
168
+ }[];
169
+ }, readonly ["medusa", "tax-identifications"], never> | undefined;
170
+ } & import("@tanstack/react-query").QueryKeyWithDataTag<readonly ["medusa", "tax-identifications"], {
171
+ identifications: {
172
+ customer_address_id: string;
173
+ status: "eligible" | "ineligible" | "unavailable" | "invalid";
174
+ verified: boolean;
175
+ vat_number: string;
176
+ company_name: string;
177
+ validated_at: string;
178
+ }[];
179
+ }, Error>;
180
+ affiliateContext: () => import("@tanstack/react-query").OmitKeyof<import("@tanstack/react-query").UseQueryOptions<{
181
+ portal_state: "no_application";
182
+ } | {
183
+ portal_state: "pending";
184
+ application: {
185
+ id: string;
186
+ requested_slug: string | null;
187
+ created_at: string;
188
+ status: "pending";
189
+ };
190
+ } | {
191
+ portal_state: "rejected";
192
+ application: {
193
+ id: string;
194
+ requested_slug: string | null;
195
+ created_at: string;
196
+ status: "rejected";
197
+ };
198
+ } | {
199
+ portal_state: "active";
200
+ affiliate: {
201
+ id: string;
202
+ commission_rate: number;
203
+ own_order_discount_rate: number;
204
+ effective_customer_discount_rate: number;
205
+ activated_at: string | null;
206
+ inactivated_at: string | null;
207
+ status: "active";
208
+ };
209
+ } | {
210
+ portal_state: "inactive";
211
+ affiliate: {
212
+ id: string;
213
+ commission_rate: number;
214
+ own_order_discount_rate: number;
215
+ effective_customer_discount_rate: number;
216
+ activated_at: string | null;
217
+ inactivated_at: string | null;
218
+ status: "inactive";
219
+ };
220
+ }, Error, {
221
+ portal_state: "no_application";
222
+ } | {
223
+ portal_state: "pending";
224
+ application: {
225
+ id: string;
226
+ requested_slug: string | null;
227
+ created_at: string;
228
+ status: "pending";
229
+ };
230
+ } | {
231
+ portal_state: "rejected";
232
+ application: {
233
+ id: string;
234
+ requested_slug: string | null;
235
+ created_at: string;
236
+ status: "rejected";
237
+ };
238
+ } | {
239
+ portal_state: "active";
240
+ affiliate: {
241
+ id: string;
242
+ commission_rate: number;
243
+ own_order_discount_rate: number;
244
+ effective_customer_discount_rate: number;
245
+ activated_at: string | null;
246
+ inactivated_at: string | null;
247
+ status: "active";
248
+ };
249
+ } | {
250
+ portal_state: "inactive";
251
+ affiliate: {
252
+ id: string;
253
+ commission_rate: number;
254
+ own_order_discount_rate: number;
255
+ effective_customer_discount_rate: number;
256
+ activated_at: string | null;
257
+ inactivated_at: string | null;
258
+ status: "inactive";
259
+ };
260
+ }, readonly ["affiliate", "context"]>, "queryFn"> & {
261
+ queryFn?: import("@tanstack/react-query").QueryFunction<{
262
+ portal_state: "no_application";
263
+ } | {
264
+ portal_state: "pending";
265
+ application: {
266
+ id: string;
267
+ requested_slug: string | null;
268
+ created_at: string;
269
+ status: "pending";
270
+ };
271
+ } | {
272
+ portal_state: "rejected";
273
+ application: {
274
+ id: string;
275
+ requested_slug: string | null;
276
+ created_at: string;
277
+ status: "rejected";
278
+ };
279
+ } | {
280
+ portal_state: "active";
281
+ affiliate: {
282
+ id: string;
283
+ commission_rate: number;
284
+ own_order_discount_rate: number;
285
+ effective_customer_discount_rate: number;
286
+ activated_at: string | null;
287
+ inactivated_at: string | null;
288
+ status: "active";
289
+ };
290
+ } | {
291
+ portal_state: "inactive";
292
+ affiliate: {
293
+ id: string;
294
+ commission_rate: number;
295
+ own_order_discount_rate: number;
296
+ effective_customer_discount_rate: number;
297
+ activated_at: string | null;
298
+ inactivated_at: string | null;
299
+ status: "inactive";
300
+ };
301
+ }, readonly ["affiliate", "context"], never> | undefined;
302
+ } & import("@tanstack/react-query").QueryKeyWithDataTag<readonly ["affiliate", "context"], {
303
+ portal_state: "no_application";
304
+ } | {
305
+ portal_state: "pending";
306
+ application: {
307
+ id: string;
308
+ requested_slug: string | null;
309
+ created_at: string;
310
+ status: "pending";
311
+ };
312
+ } | {
313
+ portal_state: "rejected";
314
+ application: {
315
+ id: string;
316
+ requested_slug: string | null;
317
+ created_at: string;
318
+ status: "rejected";
319
+ };
320
+ } | {
321
+ portal_state: "active";
322
+ affiliate: {
323
+ id: string;
324
+ commission_rate: number;
325
+ own_order_discount_rate: number;
326
+ effective_customer_discount_rate: number;
327
+ activated_at: string | null;
328
+ inactivated_at: string | null;
329
+ status: "active";
330
+ };
331
+ } | {
332
+ portal_state: "inactive";
333
+ affiliate: {
334
+ id: string;
335
+ commission_rate: number;
336
+ own_order_discount_rate: number;
337
+ effective_customer_discount_rate: number;
338
+ activated_at: string | null;
339
+ inactivated_at: string | null;
340
+ status: "inactive";
341
+ };
342
+ }, Error>;
343
+ affiliateCartReferral: (cartId: string, isEnabled: boolean) => import("@tanstack/react-query").OmitKeyof<import("@tanstack/react-query").UseQueryOptions<{
344
+ referral: {
345
+ id: string;
346
+ source: "link" | "coupon";
347
+ status: "active" | "replaced" | "ignored_existing_assignment" | "pending_email_validation" | "consumed" | "expired" | "invalidated";
348
+ affiliate: {
349
+ id: string;
350
+ status: "active";
351
+ };
352
+ captured_at: string;
353
+ expires_at: string;
354
+ } | null;
355
+ }, Error, {
356
+ referral: {
357
+ id: string;
358
+ source: "link" | "coupon";
359
+ status: "active" | "replaced" | "ignored_existing_assignment" | "pending_email_validation" | "consumed" | "expired" | "invalidated";
360
+ affiliate: {
361
+ id: string;
362
+ status: "active";
363
+ };
364
+ captured_at: string;
365
+ expires_at: string;
366
+ } | null;
367
+ }, readonly ["affiliate", "cart-referral", string]>, "queryFn"> & {
368
+ queryFn?: import("@tanstack/react-query").QueryFunction<{
369
+ referral: {
370
+ id: string;
371
+ source: "link" | "coupon";
372
+ status: "active" | "replaced" | "ignored_existing_assignment" | "pending_email_validation" | "consumed" | "expired" | "invalidated";
373
+ affiliate: {
374
+ id: string;
375
+ status: "active";
376
+ };
377
+ captured_at: string;
378
+ expires_at: string;
379
+ } | null;
380
+ }, readonly ["affiliate", "cart-referral", string], never> | undefined;
381
+ } & import("@tanstack/react-query").QueryKeyWithDataTag<readonly ["affiliate", "cart-referral", string], {
382
+ referral: {
383
+ id: string;
384
+ source: "link" | "coupon";
385
+ status: "active" | "replaced" | "ignored_existing_assignment" | "pending_email_validation" | "consumed" | "expired" | "invalidated";
386
+ affiliate: {
387
+ id: string;
388
+ status: "active";
389
+ };
390
+ captured_at: string;
391
+ expires_at: string;
392
+ } | null;
393
+ }, Error>;
394
+ couponLabels: (codes: string[], isEnabled: boolean) => import("@tanstack/react-query").OmitKeyof<import("@tanstack/react-query").UseQueryOptions<{
395
+ labels: {
396
+ code: string;
397
+ label: string;
398
+ discount_percentage: number;
399
+ }[];
400
+ }, Error, {
401
+ labels: {
402
+ code: string;
403
+ label: string;
404
+ discount_percentage: number;
405
+ }[];
406
+ }, readonly ["affiliate", "coupon-labels", string[]]>, "queryFn"> & {
407
+ queryFn?: import("@tanstack/react-query").QueryFunction<{
408
+ labels: {
409
+ code: string;
410
+ label: string;
411
+ discount_percentage: number;
412
+ }[];
413
+ }, readonly ["affiliate", "coupon-labels", string[]], never> | undefined;
414
+ } & import("@tanstack/react-query").QueryKeyWithDataTag<readonly ["affiliate", "coupon-labels", string[]], {
415
+ labels: {
416
+ code: string;
417
+ label: string;
418
+ discount_percentage: number;
419
+ }[];
420
+ }, Error>;
421
+ affiliateSlugs: () => import("@tanstack/react-query").OmitKeyof<import("@tanstack/react-query").UseQueryOptions<{
422
+ slugs: {
423
+ id: string;
424
+ slug: string;
425
+ active: boolean;
426
+ is_primary: boolean;
427
+ created_at: string;
428
+ updated_at: string;
429
+ referral_url: string;
430
+ }[];
431
+ }, Error, {
432
+ slugs: {
433
+ id: string;
434
+ slug: string;
435
+ active: boolean;
436
+ is_primary: boolean;
437
+ created_at: string;
438
+ updated_at: string;
439
+ referral_url: string;
440
+ }[];
441
+ }, readonly ["affiliate", "slugs"]>, "queryFn"> & {
442
+ queryFn?: import("@tanstack/react-query").QueryFunction<{
443
+ slugs: {
444
+ id: string;
445
+ slug: string;
446
+ active: boolean;
447
+ is_primary: boolean;
448
+ created_at: string;
449
+ updated_at: string;
450
+ referral_url: string;
451
+ }[];
452
+ }, readonly ["affiliate", "slugs"], never> | undefined;
453
+ } & import("@tanstack/react-query").QueryKeyWithDataTag<readonly ["affiliate", "slugs"], {
454
+ slugs: {
455
+ id: string;
456
+ slug: string;
457
+ active: boolean;
458
+ is_primary: boolean;
459
+ created_at: string;
460
+ updated_at: string;
461
+ referral_url: string;
462
+ }[];
463
+ }, Error>;
464
+ affiliateCouponCodes: (query: ListStoreAffiliateCouponCodesRequest) => import("@tanstack/react-query").OmitKeyof<import("@tanstack/react-query").UseQueryOptions<{
465
+ coupon_codes: {
466
+ id: string;
467
+ code: string;
468
+ status: "active" | "revoked" | "affiliate_inactive" | "provisioning" | "provisioning_failed";
469
+ origin: "default" | "manual" | "rotation";
470
+ created_at: string;
471
+ revoked_at: string | null;
472
+ }[];
473
+ count: number;
474
+ limit: number;
475
+ offset: number;
476
+ }, Error, {
477
+ coupon_codes: {
478
+ id: string;
479
+ code: string;
480
+ status: "active" | "revoked" | "affiliate_inactive" | "provisioning" | "provisioning_failed";
481
+ origin: "default" | "manual" | "rotation";
482
+ created_at: string;
483
+ revoked_at: string | null;
484
+ }[];
485
+ count: number;
486
+ limit: number;
487
+ offset: number;
488
+ }, readonly ["affiliate", "coupon-codes", {
489
+ status?: "enabled" | "revoked" | undefined;
490
+ limit?: string | number | undefined;
491
+ offset?: string | number | undefined;
492
+ }]>, "queryFn"> & {
493
+ queryFn?: import("@tanstack/react-query").QueryFunction<{
494
+ coupon_codes: {
495
+ id: string;
496
+ code: string;
497
+ status: "active" | "revoked" | "affiliate_inactive" | "provisioning" | "provisioning_failed";
498
+ origin: "default" | "manual" | "rotation";
499
+ created_at: string;
500
+ revoked_at: string | null;
501
+ }[];
502
+ count: number;
503
+ limit: number;
504
+ offset: number;
505
+ }, readonly ["affiliate", "coupon-codes", {
506
+ status?: "enabled" | "revoked" | undefined;
507
+ limit?: string | number | undefined;
508
+ offset?: string | number | undefined;
509
+ }], never> | undefined;
510
+ } & import("@tanstack/react-query").QueryKeyWithDataTag<readonly ["affiliate", "coupon-codes", {
511
+ status?: "enabled" | "revoked" | undefined;
512
+ limit?: string | number | undefined;
513
+ offset?: string | number | undefined;
514
+ }], {
515
+ coupon_codes: {
516
+ id: string;
517
+ code: string;
518
+ status: "active" | "revoked" | "affiliate_inactive" | "provisioning" | "provisioning_failed";
519
+ origin: "default" | "manual" | "rotation";
520
+ created_at: string;
521
+ revoked_at: string | null;
522
+ }[];
523
+ count: number;
524
+ limit: number;
525
+ offset: number;
526
+ }, Error>;
527
+ affiliateCommissions: (query: PartnerPortalCommissionsRequest) => import("@tanstack/react-query").OmitKeyof<import("@tanstack/react-query").UseQueryOptions<{
528
+ from: string;
529
+ to: string;
530
+ count: number;
531
+ limit: number;
532
+ offset: number;
533
+ totals: {
534
+ currency_code: string;
535
+ direct_commission_amount: number;
536
+ referral_commission_amount: number;
537
+ correction_amount: number;
538
+ net_commission_amount: number;
539
+ commission_base_amount: number;
540
+ attributed_order_count: number;
541
+ commissioned_order_count: number;
542
+ }[];
543
+ commissions: {
544
+ id: string;
545
+ type: "order_commission" | "refund_correction" | "cancellation_correction" | "manual_correction" | "affiliate_referral_bonus" | "affiliate_own_order_referrer_bonus";
546
+ occurred_at: string;
547
+ order_id: string | null;
548
+ base_amount_net: number;
549
+ commission_amount: number;
550
+ currency_code: string;
551
+ }[];
552
+ }, Error, {
553
+ from: string;
554
+ to: string;
555
+ count: number;
556
+ limit: number;
557
+ offset: number;
558
+ totals: {
559
+ currency_code: string;
560
+ direct_commission_amount: number;
561
+ referral_commission_amount: number;
562
+ correction_amount: number;
563
+ net_commission_amount: number;
564
+ commission_base_amount: number;
565
+ attributed_order_count: number;
566
+ commissioned_order_count: number;
567
+ }[];
568
+ commissions: {
569
+ id: string;
570
+ type: "order_commission" | "refund_correction" | "cancellation_correction" | "manual_correction" | "affiliate_referral_bonus" | "affiliate_own_order_referrer_bonus";
571
+ occurred_at: string;
572
+ order_id: string | null;
573
+ base_amount_net: number;
574
+ commission_amount: number;
575
+ currency_code: string;
576
+ }[];
577
+ }, readonly ["affiliate", "commissions", {
578
+ from?: string | undefined;
579
+ to?: string | undefined;
580
+ limit?: string | number | undefined;
581
+ offset?: string | number | undefined;
582
+ }]>, "queryFn"> & {
583
+ queryFn?: import("@tanstack/react-query").QueryFunction<{
584
+ from: string;
585
+ to: string;
586
+ count: number;
587
+ limit: number;
588
+ offset: number;
589
+ totals: {
590
+ currency_code: string;
591
+ direct_commission_amount: number;
592
+ referral_commission_amount: number;
593
+ correction_amount: number;
594
+ net_commission_amount: number;
595
+ commission_base_amount: number;
596
+ attributed_order_count: number;
597
+ commissioned_order_count: number;
598
+ }[];
599
+ commissions: {
600
+ id: string;
601
+ type: "order_commission" | "refund_correction" | "cancellation_correction" | "manual_correction" | "affiliate_referral_bonus" | "affiliate_own_order_referrer_bonus";
602
+ occurred_at: string;
603
+ order_id: string | null;
604
+ base_amount_net: number;
605
+ commission_amount: number;
606
+ currency_code: string;
607
+ }[];
608
+ }, readonly ["affiliate", "commissions", {
609
+ from?: string | undefined;
610
+ to?: string | undefined;
611
+ limit?: string | number | undefined;
612
+ offset?: string | number | undefined;
613
+ }], never> | undefined;
614
+ } & import("@tanstack/react-query").QueryKeyWithDataTag<readonly ["affiliate", "commissions", {
615
+ from?: string | undefined;
616
+ to?: string | undefined;
617
+ limit?: string | number | undefined;
618
+ offset?: string | number | undefined;
619
+ }], {
620
+ from: string;
621
+ to: string;
622
+ count: number;
623
+ limit: number;
624
+ offset: number;
625
+ totals: {
626
+ currency_code: string;
627
+ direct_commission_amount: number;
628
+ referral_commission_amount: number;
629
+ correction_amount: number;
630
+ net_commission_amount: number;
631
+ commission_base_amount: number;
632
+ attributed_order_count: number;
633
+ commissioned_order_count: number;
634
+ }[];
635
+ commissions: {
636
+ id: string;
637
+ type: "order_commission" | "refund_correction" | "cancellation_correction" | "manual_correction" | "affiliate_referral_bonus" | "affiliate_own_order_referrer_bonus";
638
+ occurred_at: string;
639
+ order_id: string | null;
640
+ base_amount_net: number;
641
+ commission_amount: number;
642
+ currency_code: string;
643
+ }[];
644
+ }, Error>;
645
+ affiliateConsignmentInventory: () => import("@tanstack/react-query").OmitKeyof<import("@tanstack/react-query").UseQueryOptions<{
646
+ period_start: string;
647
+ inventory: {
648
+ inventory_item_id: string;
649
+ batch_id: string | null;
650
+ expected_quantity: number;
651
+ }[];
652
+ }, Error, {
653
+ period_start: string;
654
+ inventory: {
655
+ inventory_item_id: string;
656
+ batch_id: string | null;
657
+ expected_quantity: number;
658
+ }[];
659
+ }, readonly ["affiliate", "consignment", "inventory"]>, "queryFn"> & {
660
+ queryFn?: import("@tanstack/react-query").QueryFunction<{
661
+ period_start: string;
662
+ inventory: {
663
+ inventory_item_id: string;
664
+ batch_id: string | null;
665
+ expected_quantity: number;
666
+ }[];
667
+ }, readonly ["affiliate", "consignment", "inventory"], never> | undefined;
668
+ } & import("@tanstack/react-query").QueryKeyWithDataTag<readonly ["affiliate", "consignment", "inventory"], {
669
+ period_start: string;
670
+ inventory: {
671
+ inventory_item_id: string;
672
+ batch_id: string | null;
673
+ expected_quantity: number;
674
+ }[];
675
+ }, Error>;
676
+ affiliateConsignmentReports: () => import("@tanstack/react-query").OmitKeyof<import("@tanstack/react-query").UseQueryOptions<{
677
+ reports: {
678
+ id: string;
679
+ affiliate_id: string;
680
+ period_start: string;
681
+ period_end: string;
682
+ status: "rejected" | "draft" | "approved" | "submitted";
683
+ draft_order_id: string | null;
684
+ order_id: string | null;
685
+ submitted_at: string | null;
686
+ lines: {
687
+ id: string;
688
+ inventory_item_id: string;
689
+ batch_id: string | null;
690
+ expected_quantity: number;
691
+ counted_quantity: number;
692
+ proposed_sale_quantity: number;
693
+ confirmed_sale_quantity: number;
694
+ requires_admin_clarification: boolean;
695
+ non_sale_reason: string | null;
696
+ resolved_unit_price: number | null;
697
+ discounted_line_total: number | null;
698
+ currency_code: string | null;
699
+ }[];
700
+ }[];
701
+ }, Error, {
702
+ reports: {
703
+ id: string;
704
+ affiliate_id: string;
705
+ period_start: string;
706
+ period_end: string;
707
+ status: "rejected" | "draft" | "approved" | "submitted";
708
+ draft_order_id: string | null;
709
+ order_id: string | null;
710
+ submitted_at: string | null;
711
+ lines: {
712
+ id: string;
713
+ inventory_item_id: string;
714
+ batch_id: string | null;
715
+ expected_quantity: number;
716
+ counted_quantity: number;
717
+ proposed_sale_quantity: number;
718
+ confirmed_sale_quantity: number;
719
+ requires_admin_clarification: boolean;
720
+ non_sale_reason: string | null;
721
+ resolved_unit_price: number | null;
722
+ discounted_line_total: number | null;
723
+ currency_code: string | null;
724
+ }[];
725
+ }[];
726
+ }, readonly ["affiliate", "consignment", "reports"]>, "queryFn"> & {
727
+ queryFn?: import("@tanstack/react-query").QueryFunction<{
728
+ reports: {
729
+ id: string;
730
+ affiliate_id: string;
731
+ period_start: string;
732
+ period_end: string;
733
+ status: "rejected" | "draft" | "approved" | "submitted";
734
+ draft_order_id: string | null;
735
+ order_id: string | null;
736
+ submitted_at: string | null;
737
+ lines: {
738
+ id: string;
739
+ inventory_item_id: string;
740
+ batch_id: string | null;
741
+ expected_quantity: number;
742
+ counted_quantity: number;
743
+ proposed_sale_quantity: number;
744
+ confirmed_sale_quantity: number;
745
+ requires_admin_clarification: boolean;
746
+ non_sale_reason: string | null;
747
+ resolved_unit_price: number | null;
748
+ discounted_line_total: number | null;
749
+ currency_code: string | null;
750
+ }[];
751
+ }[];
752
+ }, readonly ["affiliate", "consignment", "reports"], never> | undefined;
753
+ } & import("@tanstack/react-query").QueryKeyWithDataTag<readonly ["affiliate", "consignment", "reports"], {
754
+ reports: {
755
+ id: string;
756
+ affiliate_id: string;
757
+ period_start: string;
758
+ period_end: string;
759
+ status: "rejected" | "draft" | "approved" | "submitted";
760
+ draft_order_id: string | null;
761
+ order_id: string | null;
762
+ submitted_at: string | null;
763
+ lines: {
764
+ id: string;
765
+ inventory_item_id: string;
766
+ batch_id: string | null;
767
+ expected_quantity: number;
768
+ counted_quantity: number;
769
+ proposed_sale_quantity: number;
770
+ confirmed_sale_quantity: number;
771
+ requires_admin_clarification: boolean;
772
+ non_sale_reason: string | null;
773
+ resolved_unit_price: number | null;
774
+ discounted_line_total: number | null;
775
+ currency_code: string | null;
776
+ }[];
777
+ }[];
778
+ }, Error>;
779
+ };
780
+ export type BrowserQueryOptions = ReturnType<typeof createQueryOptions>;
781
+ export {};