@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.
- package/LICENSE +21 -0
- package/README.md +103 -2
- package/dist/browser/account-verification-channel.d.ts +11 -0
- package/dist/browser/account-verification-channel.js +32 -0
- package/dist/browser/actions.d.ts +53 -0
- package/dist/browser/actions.js +1 -0
- package/dist/browser/affiliate-referral.d.ts +152 -0
- package/dist/browser/affiliate-referral.js +85 -0
- package/dist/browser/browser-session.d.ts +3 -0
- package/dist/browser/browser-session.js +27 -0
- package/dist/browser/cart-mutations.d.ts +36 -0
- package/dist/browser/cart-mutations.js +137 -0
- package/dist/browser/cart-refresh.d.ts +11 -0
- package/dist/browser/cart-refresh.js +33 -0
- package/dist/browser/client.d.ts +15 -0
- package/dist/browser/client.js +20 -0
- package/dist/browser/fresh-order-marker.d.ts +11 -0
- package/dist/browser/fresh-order-marker.js +30 -0
- package/dist/browser/index.d.ts +946 -0
- package/dist/browser/index.js +70 -0
- package/dist/browser/query-invalidation.d.ts +4 -0
- package/dist/browser/query-invalidation.js +39 -0
- package/dist/browser/query-keys.d.ts +43 -0
- package/dist/browser/query-keys.js +28 -0
- package/dist/browser/query-options.d.ts +781 -0
- package/dist/browser/query-options.js +165 -0
- package/dist/browser/region.d.ts +5 -0
- package/dist/browser/region.js +15 -0
- package/dist/browser/unwrap-medusa-action.d.ts +7 -0
- package/dist/browser/unwrap-medusa-action.js +25 -0
- package/dist/core/action-result.d.ts +17 -0
- package/dist/core/action-result.js +12 -0
- package/dist/core/addresses.d.ts +46 -0
- package/dist/core/addresses.js +137 -0
- package/dist/core/affiliate/affiliate-application-errors.d.ts +2 -0
- package/dist/core/affiliate/affiliate-application-errors.js +14 -0
- package/dist/core/affiliate/affiliate-commission-presentation.d.ts +15 -0
- package/dist/core/affiliate/affiliate-commission-presentation.js +28 -0
- package/dist/core/affiliate/affiliate-coupon-code-presentation.d.ts +10 -0
- package/dist/core/affiliate/affiliate-coupon-code-presentation.js +22 -0
- package/dist/core/affiliate/affiliate-coupon-label.d.ts +3 -0
- package/dist/core/affiliate/affiliate-coupon-label.js +4 -0
- package/dist/core/affiliate/affiliate-date-range.d.ts +6 -0
- package/dist/core/affiliate/affiliate-date-range.js +16 -0
- package/dist/core/affiliate/affiliate-rate-presentation.d.ts +1 -0
- package/dist/core/affiliate/affiliate-rate-presentation.js +8 -0
- package/dist/core/affiliate/partner-company-address.d.ts +24 -0
- package/dist/core/affiliate/partner-company-address.js +31 -0
- package/dist/core/auth/customer-sign-in.d.ts +36 -0
- package/dist/core/auth/customer-sign-in.js +55 -0
- package/dist/core/auth/link-token.d.ts +8 -0
- package/dist/core/auth/link-token.js +11 -0
- package/dist/core/auth/login-code-auto-send.d.ts +7 -0
- package/dist/core/auth/login-code-auto-send.js +11 -0
- package/dist/core/auth/password-rule-label.d.ts +4 -0
- package/dist/core/auth/password-rule-label.js +13 -0
- package/dist/core/cart/cart-line-item-image-url.d.ts +9 -0
- package/dist/core/cart/cart-line-item-image-url.js +14 -0
- package/dist/core/cart/cart-normalization.d.ts +2 -0
- package/dist/core/cart/cart-normalization.js +11 -0
- package/dist/core/cart/cart-price-breakdown.d.ts +30 -0
- package/dist/core/cart/cart-price-breakdown.js +45 -0
- package/dist/core/cart/cart-tax-breakdown.d.ts +17 -0
- package/dist/core/cart/cart-tax-breakdown.js +18 -0
- package/dist/core/cart/coupon-promotions.d.ts +8 -0
- package/dist/core/cart/coupon-promotions.js +9 -0
- package/dist/core/cart/payment-session.d.ts +3 -0
- package/dist/core/cart/payment-session.js +12 -0
- package/dist/core/cart/refunded-cart.d.ts +27 -0
- package/dist/core/cart/refunded-cart.js +46 -0
- package/dist/core/catalog/category-filter.d.ts +16 -0
- package/dist/core/catalog/category-filter.js +33 -0
- package/dist/core/catalog/inventory.d.ts +10 -0
- package/dist/core/catalog/inventory.js +9 -0
- package/dist/core/catalog/medusa-product-image.d.ts +8 -0
- package/dist/core/catalog/medusa-product-image.js +13 -0
- package/dist/core/catalog/product-price.d.ts +8 -0
- package/dist/core/catalog/product-price.js +21 -0
- package/dist/core/catalog/selected-variant.d.ts +7 -0
- package/dist/core/catalog/selected-variant.js +9 -0
- package/dist/core/checkout/checkout-account-offer-state.d.ts +41 -0
- package/dist/core/checkout/checkout-account-offer-state.js +32 -0
- package/dist/core/checkout/checkout-address-draft.d.ts +39 -0
- package/dist/core/checkout/checkout-address-draft.js +78 -0
- package/dist/core/checkout/checkout-address-form.d.ts +24 -0
- package/dist/core/checkout/checkout-address-form.js +99 -0
- package/dist/core/checkout/checkout-coupon.d.ts +9 -0
- package/dist/core/checkout/checkout-coupon.js +13 -0
- package/dist/core/checkout/checkout-steps.d.ts +20 -0
- package/dist/core/checkout/checkout-steps.js +44 -0
- package/dist/core/checkout/customer-login-required.d.ts +12 -0
- package/dist/core/checkout/customer-login-required.js +14 -0
- package/dist/core/checkout/payment-authorization.d.ts +8 -0
- package/dist/core/checkout/payment-authorization.js +9 -0
- package/dist/core/checkout/stripe-redirect-return.d.ts +13 -0
- package/dist/core/checkout/stripe-redirect-return.js +29 -0
- package/dist/core/errors.d.ts +12 -0
- package/dist/core/errors.js +18 -0
- package/dist/core/fields.d.ts +18 -0
- package/dist/core/fields.js +20 -0
- package/dist/core/form-values.d.ts +162 -0
- package/dist/core/form-values.js +234 -0
- package/dist/core/format/money.d.ts +7 -0
- package/dist/core/format/money.js +6 -0
- package/dist/core/i18n.d.ts +24 -0
- package/dist/core/i18n.js +15 -0
- package/dist/core/image-url.d.ts +18 -0
- package/dist/core/image-url.js +34 -0
- package/dist/core/index.d.ts +48 -0
- package/dist/core/index.js +49 -0
- package/dist/core/order/order-payment-summary.d.ts +15 -0
- package/dist/core/order/order-payment-summary.js +48 -0
- package/dist/core/plugin-features.d.ts +21 -0
- package/dist/core/plugin-features.js +30 -0
- package/dist/core/query-string.d.ts +6 -0
- package/dist/core/query-string.js +16 -0
- package/dist/core/region.d.ts +11 -0
- package/dist/core/region.js +13 -0
- package/dist/core/report-error.d.ts +12 -0
- package/dist/core/report-error.js +1 -0
- package/dist/core/routing-locale.d.ts +1 -0
- package/dist/core/routing-locale.js +25 -0
- package/dist/core/settle-within.d.ts +8 -0
- package/dist/core/settle-within.js +14 -0
- package/dist/core/tax-compliance/address-tax-identification.d.ts +37 -0
- package/dist/core/tax-compliance/address-tax-identification.js +51 -0
- package/dist/core/tax-compliance/tax-identification.d.ts +18 -0
- package/dist/core/tax-compliance/tax-identification.js +58 -0
- package/dist/core/texts-de.d.ts +136 -0
- package/dist/core/texts-de.js +152 -0
- package/dist/react/cart-error-boundary.d.ts +24 -0
- package/dist/react/cart-error-boundary.js +57 -0
- package/dist/react/context.d.ts +17 -0
- package/dist/react/context.js +46 -0
- package/dist/react/index.d.ts +12 -0
- package/dist/react/index.js +14 -0
- package/dist/react/use-account.d.ts +214 -0
- package/dist/react/use-account.js +294 -0
- package/dist/react/use-affiliate.d.ts +566 -0
- package/dist/react/use-affiliate.js +573 -0
- package/dist/react/use-auth.d.ts +136 -0
- package/dist/react/use-auth.js +402 -0
- package/dist/react/use-cart.d.ts +57 -0
- package/dist/react/use-cart.js +137 -0
- package/dist/react/use-checkout-address-form.d.ts +156 -0
- package/dist/react/use-checkout-address-form.js +95 -0
- package/dist/react/use-checkout.d.ts +268 -0
- package/dist/react/use-checkout.js +873 -0
- package/dist/react/use-countdown.d.ts +5 -0
- package/dist/react/use-countdown.js +23 -0
- package/dist/react/use-link-token.d.ts +12 -0
- package/dist/react/use-link-token.js +17 -0
- package/dist/react/use-plugin-feature.d.ts +16 -0
- package/dist/react/use-plugin-feature.js +31 -0
- package/dist/react/use-verification-watch.d.ts +7 -0
- package/dist/react/use-verification-watch.js +49 -0
- package/dist/registry/account.json +248 -0
- package/dist/registry/affiliate.json +302 -0
- package/dist/registry/cart.json +127 -0
- package/dist/registry/checkout.json +169 -0
- package/dist/registry/form.json +145 -0
- package/dist/registry/registry.json +917 -0
- package/dist/registry/setup.json +76 -0
- package/dist/server/affiliate.d.ts +124 -0
- package/dist/server/affiliate.js +145 -0
- package/dist/server/cart.d.ts +10 -0
- package/dist/server/cart.js +113 -0
- package/dist/server/catalog.d.ts +28 -0
- package/dist/server/catalog.js +82 -0
- package/dist/server/checkout.d.ts +6 -0
- package/dist/server/checkout.js +12 -0
- package/dist/server/context.d.ts +38 -0
- package/dist/server/context.js +34 -0
- package/dist/server/customer.d.ts +84 -0
- package/dist/server/customer.js +362 -0
- package/dist/server/documents.d.ts +29 -0
- package/dist/server/documents.js +55 -0
- package/dist/server/index.d.ts +258 -0
- package/dist/server/index.js +45 -0
- package/dist/server/orders.d.ts +9 -0
- package/dist/server/orders.js +31 -0
- package/dist/server/plugin-features.d.ts +13 -0
- package/dist/server/plugin-features.js +52 -0
- package/dist/server/region.d.ts +6 -0
- package/dist/server/region.js +17 -0
- package/dist/server/route-response.d.ts +2 -0
- package/dist/server/route-response.js +17 -0
- package/dist/server/run-medusa-action.d.ts +7 -0
- package/dist/server/run-medusa-action.js +40 -0
- package/dist/server/session.d.ts +29 -0
- package/dist/server/session.js +106 -0
- package/dist/server/tax-compliance.d.ts +26 -0
- package/dist/server/tax-compliance.js +85 -0
- package/package.json +86 -3
|
@@ -0,0 +1,946 @@
|
|
|
1
|
+
import type { HttpTypes } from "@medusajs/types";
|
|
2
|
+
import type { Stripe } from "@stripe/stripe-js";
|
|
3
|
+
import type { Translate } from "../core/i18n.js";
|
|
4
|
+
import type { ReportError } from "../core/report-error.js";
|
|
5
|
+
import type { StorefrontActions } from "./actions.js";
|
|
6
|
+
export type { StorefrontActions } from "./actions.js";
|
|
7
|
+
export type { CredentialedMedusaClient } from "./client.js";
|
|
8
|
+
export type { ApplyCheckoutCouponOptions, CaptureAffiliateReferralInput } from "./affiliate-referral.js";
|
|
9
|
+
export type { UnwrapMedusaAction, UnwrapMedusaActionOptions } from "./unwrap-medusa-action.js";
|
|
10
|
+
export type { RefreshCartAfterMutation } from "./cart-refresh.js";
|
|
11
|
+
export type { BrowserQueryOptions } from "./query-options.js";
|
|
12
|
+
export { affiliateQueryKeys, medusaQueryKeys } from "./query-keys.js";
|
|
13
|
+
export { invalidateAffiliateQueries, invalidateCommerceQueries, resetCustomerScopedQueries } from "./query-invalidation.js";
|
|
14
|
+
export { applyCheckoutCouponWithClient, captureAffiliateReferralAfterCartRefreshWithClient, captureAffiliateReferralWithClient, removeCapturedAffiliateReferral, resolveCouponLabelsWithClient, runAffiliateReferralCapture, waitForAffiliateReferralCapture, } from "./affiliate-referral.js";
|
|
15
|
+
export { endMedusaBrowserSessionWithClient, startMedusaBrowserSessionWithClient } from "./browser-session.js";
|
|
16
|
+
export { canReachOtherTabs, openAccountVerificationChannel, parseAccountVerificationMessage, postAccountVerificationMessage } from "./account-verification-channel.js";
|
|
17
|
+
export type { AccountVerificationMessage } from "./account-verification-channel.js";
|
|
18
|
+
/**
|
|
19
|
+
* What the shop does on top of a storefront event (tracking, its own UI
|
|
20
|
+
* state). Called by the package hooks once the event happened; never throw.
|
|
21
|
+
*/
|
|
22
|
+
export interface StorefrontCallbacks {
|
|
23
|
+
/** A variant was added to the cart (one unit). */
|
|
24
|
+
onAddedToCart?: (variant: HttpTypes.StoreProductVariant) => void;
|
|
25
|
+
/** The checkout page showed a cart (once per page view). */
|
|
26
|
+
onCheckoutStarted?: (cart: HttpTypes.StoreCart) => void;
|
|
27
|
+
/** The customer picked a payment method type in the payment form, e.g. "card". */
|
|
28
|
+
onPaymentMethodSelected?: (type: string) => void;
|
|
29
|
+
/** The customer logged out; runs last, after the session ended. */
|
|
30
|
+
onLoggedOut?: () => void;
|
|
31
|
+
}
|
|
32
|
+
export interface StorefrontBrowserConfig {
|
|
33
|
+
/** The public Medusa URL (the browser's, never an internal host). */
|
|
34
|
+
publicBackendUrl: string;
|
|
35
|
+
publishableKey: string | undefined;
|
|
36
|
+
/** The shop's `"use server"` wrappers of the server functions. */
|
|
37
|
+
actions: StorefrontActions;
|
|
38
|
+
t: Translate;
|
|
39
|
+
reportError: ReportError;
|
|
40
|
+
/** Base path of the shop's Route Handlers (partner portal reads). Default `/api`. */
|
|
41
|
+
apiBasePath?: string;
|
|
42
|
+
/** sessionStorage key prefix of the fresh-order marker. */
|
|
43
|
+
freshOrderKeyPrefix: string;
|
|
44
|
+
callbacks?: StorefrontCallbacks;
|
|
45
|
+
/** Stripe's publishable key (the payment step shows "not configured" without it). */
|
|
46
|
+
stripePublishableKey?: string;
|
|
47
|
+
/** Where the checkout sends the customer after the order; default `/{countryCode}/order/{orderId}/confirmed`. */
|
|
48
|
+
orderConfirmedPath?: (countryCode: string, orderId: string) => string;
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* The storefront's browser side: the credentialed Medusa client, cart and
|
|
52
|
+
* referral calls, react-query options and invalidation. Create it once at
|
|
53
|
+
* module level in the shop (`storefront.client.ts`); the module state it
|
|
54
|
+
* relies on (pending refunded-cart replacements, in-flight referral captures)
|
|
55
|
+
* is shared by the whole page.
|
|
56
|
+
*/
|
|
57
|
+
export declare function createStorefrontBrowser(config: StorefrontBrowserConfig): {
|
|
58
|
+
actions: StorefrontActions;
|
|
59
|
+
t: Translate;
|
|
60
|
+
reportError: ReportError;
|
|
61
|
+
reportCheckoutError: (error: unknown, context?: Record<string, unknown>) => void;
|
|
62
|
+
createCredentialedMedusaClient: () => import("./client.js").CredentialedMedusaClient;
|
|
63
|
+
startMedusaBrowserSession: (token: string) => Promise<void>;
|
|
64
|
+
endMedusaBrowserSession: () => Promise<void>;
|
|
65
|
+
unwrapMedusaAction: import("./unwrap-medusa-action.js").UnwrapMedusaAction;
|
|
66
|
+
cart: {
|
|
67
|
+
createCart: (data: HttpTypes.StoreCreateCart) => Promise<HttpTypes.StoreCart>;
|
|
68
|
+
replaceRefundedCart(cart: HttpTypes.StoreCart): Promise<HttpTypes.StoreCart | null>;
|
|
69
|
+
addCartLineItem: (cartId: string, data: HttpTypes.StoreAddCartLineItem) => Promise<HttpTypes.StoreCart>;
|
|
70
|
+
updateCartLineItem(cartId: string, lineItemId: string, data: HttpTypes.StoreUpdateCartLineItem): Promise<HttpTypes.StoreCart>;
|
|
71
|
+
removeCartLineItem(cartId: string, lineItemId: string): Promise<HttpTypes.StoreLineItemDeleteResponse>;
|
|
72
|
+
updateCart(cartId: string, data: HttpTypes.StoreUpdateCart): Promise<HttpTypes.StoreCart>;
|
|
73
|
+
addCartShippingMethod(cartId: string, data: HttpTypes.StoreAddCartShippingMethods): Promise<HttpTypes.StoreCart>;
|
|
74
|
+
addCartPromotion(cartId: string, data: HttpTypes.StoreCartAddPromotion): Promise<HttpTypes.StoreCart>;
|
|
75
|
+
removeCartPromotion(cartId: string, data: HttpTypes.StoreCartRemovePromotion): Promise<HttpTypes.StoreCart>;
|
|
76
|
+
initiateCartPayment(cartId: string, data: HttpTypes.StoreInitializePaymentSession): Promise<HttpTypes.StorePaymentCollection>;
|
|
77
|
+
checkCartCompletion(cartId: string): Promise<{
|
|
78
|
+
cart_id: string;
|
|
79
|
+
ready: true;
|
|
80
|
+
}>;
|
|
81
|
+
completeCart(cartId: string): Promise<HttpTypes.StoreCompleteCartResponse>;
|
|
82
|
+
addProductToCart({ activeCart, quantity, regionId, variantId }: {
|
|
83
|
+
activeCart: Pick<HttpTypes.StoreCart, "id"> | null;
|
|
84
|
+
quantity?: number;
|
|
85
|
+
regionId: string;
|
|
86
|
+
variantId: string;
|
|
87
|
+
}): Promise<Pick<HttpTypes.StoreCart, "id">>;
|
|
88
|
+
};
|
|
89
|
+
referral: {
|
|
90
|
+
runAffiliateReferralCapture: typeof import("./affiliate-referral.js").runAffiliateReferralCapture;
|
|
91
|
+
waitForAffiliateReferralCapture: typeof import("./affiliate-referral.js").waitForAffiliateReferralCapture;
|
|
92
|
+
removeCapturedAffiliateReferral: typeof import("./affiliate-referral.js").removeCapturedAffiliateReferral;
|
|
93
|
+
captureAffiliateReferral: (input: import("./affiliate-referral.js").CaptureAffiliateReferralInput) => Promise<{
|
|
94
|
+
status: "captured" | "replaced" | "ignored_existing_assignment" | "kept_existing";
|
|
95
|
+
referral: {
|
|
96
|
+
id: string;
|
|
97
|
+
source: "link" | "coupon";
|
|
98
|
+
status: "active" | "replaced" | "ignored_existing_assignment" | "pending_email_validation" | "consumed" | "expired" | "invalidated";
|
|
99
|
+
affiliate: {
|
|
100
|
+
id: string;
|
|
101
|
+
status: "active";
|
|
102
|
+
};
|
|
103
|
+
captured_at: string;
|
|
104
|
+
expires_at: string;
|
|
105
|
+
} | null;
|
|
106
|
+
}>;
|
|
107
|
+
captureAffiliateReferralAfterCartRefresh: (slug: string, refreshActiveCart: () => Promise<Pick<HttpTypes.StoreCart, "id"> | null | undefined>) => Promise<{
|
|
108
|
+
status: "captured" | "replaced" | "ignored_existing_assignment" | "kept_existing";
|
|
109
|
+
referral: {
|
|
110
|
+
id: string;
|
|
111
|
+
source: "link" | "coupon";
|
|
112
|
+
status: "active" | "replaced" | "ignored_existing_assignment" | "pending_email_validation" | "consumed" | "expired" | "invalidated";
|
|
113
|
+
affiliate: {
|
|
114
|
+
id: string;
|
|
115
|
+
status: "active";
|
|
116
|
+
};
|
|
117
|
+
captured_at: string;
|
|
118
|
+
expires_at: string;
|
|
119
|
+
} | null;
|
|
120
|
+
}>;
|
|
121
|
+
applyCheckoutCoupon: (cartId: string, code: string, options: import("./affiliate-referral.js").ApplyCheckoutCouponOptions) => Promise<{
|
|
122
|
+
cart: HttpTypes.StoreCart;
|
|
123
|
+
kind: "promotion";
|
|
124
|
+
response?: undefined;
|
|
125
|
+
} | {
|
|
126
|
+
kind: "affiliate";
|
|
127
|
+
response: {
|
|
128
|
+
status: "captured" | "replaced" | "ignored_existing_assignment" | "kept_existing" | "pending_email_validation" | "expired" | "coupon_already_redeemed";
|
|
129
|
+
referral: {
|
|
130
|
+
id: string;
|
|
131
|
+
source: "link" | "coupon";
|
|
132
|
+
status: "active" | "replaced" | "ignored_existing_assignment" | "pending_email_validation" | "consumed" | "expired" | "invalidated";
|
|
133
|
+
affiliate: {
|
|
134
|
+
id: string;
|
|
135
|
+
status: "active";
|
|
136
|
+
};
|
|
137
|
+
captured_at: string;
|
|
138
|
+
expires_at: string;
|
|
139
|
+
} | null;
|
|
140
|
+
discount_applied: boolean;
|
|
141
|
+
message?: string | undefined;
|
|
142
|
+
};
|
|
143
|
+
cart?: undefined;
|
|
144
|
+
}>;
|
|
145
|
+
getAffiliateCartReferral: (cartId: string) => Promise<{
|
|
146
|
+
referral: {
|
|
147
|
+
id: string;
|
|
148
|
+
source: "link" | "coupon";
|
|
149
|
+
status: "active" | "replaced" | "ignored_existing_assignment" | "pending_email_validation" | "consumed" | "expired" | "invalidated";
|
|
150
|
+
affiliate: {
|
|
151
|
+
id: string;
|
|
152
|
+
status: "active";
|
|
153
|
+
};
|
|
154
|
+
captured_at: string;
|
|
155
|
+
expires_at: string;
|
|
156
|
+
} | null;
|
|
157
|
+
}>;
|
|
158
|
+
resolveCouponLabels: (codes: string[]) => Promise<{
|
|
159
|
+
labels: {
|
|
160
|
+
code: string;
|
|
161
|
+
label: string;
|
|
162
|
+
discount_percentage: number;
|
|
163
|
+
}[];
|
|
164
|
+
}>;
|
|
165
|
+
};
|
|
166
|
+
region: {
|
|
167
|
+
getRegionForCountryClient(countryCode: string): Promise<HttpTypes.StoreRegion | null>;
|
|
168
|
+
};
|
|
169
|
+
queries: {
|
|
170
|
+
activeCart: () => import("@tanstack/react-query").OmitKeyof<import("@tanstack/react-query").UseQueryOptions<HttpTypes.StoreCart | null, Error, HttpTypes.StoreCart | null, readonly ["medusa", "cart", "active"]>, "queryFn"> & {
|
|
171
|
+
queryFn?: import("@tanstack/react-query").QueryFunction<HttpTypes.StoreCart | null, readonly ["medusa", "cart", "active"], never> | undefined;
|
|
172
|
+
} & import("@tanstack/react-query").QueryKeyWithDataTag<readonly ["medusa", "cart", "active"], HttpTypes.StoreCart | null, Error>;
|
|
173
|
+
customer: () => import("@tanstack/react-query").OmitKeyof<import("@tanstack/react-query").UseQueryOptions<HttpTypes.StoreCustomerResponse | null, Error, HttpTypes.StoreCustomerResponse | null, readonly ["medusa", "customer"]>, "queryFn"> & {
|
|
174
|
+
queryFn?: import("@tanstack/react-query").QueryFunction<HttpTypes.StoreCustomerResponse | null, readonly ["medusa", "customer"], never> | undefined;
|
|
175
|
+
} & import("@tanstack/react-query").QueryKeyWithDataTag<readonly ["medusa", "customer"], HttpTypes.StoreCustomerResponse | null, Error>;
|
|
176
|
+
shippingOptions: (cartId: string) => import("@tanstack/react-query").OmitKeyof<import("@tanstack/react-query").UseQueryOptions<HttpTypes.StoreShippingOptionListResponse, Error, HttpTypes.StoreShippingOptionListResponse, readonly ["medusa", "shipping-options", string]>, "queryFn"> & {
|
|
177
|
+
queryFn?: import("@tanstack/react-query").QueryFunction<HttpTypes.StoreShippingOptionListResponse, readonly ["medusa", "shipping-options", string], never> | undefined;
|
|
178
|
+
} & import("@tanstack/react-query").QueryKeyWithDataTag<readonly ["medusa", "shipping-options", string], HttpTypes.StoreShippingOptionListResponse, Error>;
|
|
179
|
+
paymentProviders: (regionId: string) => import("@tanstack/react-query").OmitKeyof<import("@tanstack/react-query").UseQueryOptions<HttpTypes.StorePaymentProviderListResponse, Error, HttpTypes.StorePaymentProviderListResponse, readonly ["medusa", "payment-providers", string]>, "queryFn"> & {
|
|
180
|
+
queryFn?: import("@tanstack/react-query").QueryFunction<HttpTypes.StorePaymentProviderListResponse, readonly ["medusa", "payment-providers", string], never> | undefined;
|
|
181
|
+
} & import("@tanstack/react-query").QueryKeyWithDataTag<readonly ["medusa", "payment-providers", string], HttpTypes.StorePaymentProviderListResponse, Error>;
|
|
182
|
+
region: (countryCode: string) => import("@tanstack/react-query").OmitKeyof<import("@tanstack/react-query").UseQueryOptions<HttpTypes.StoreRegion | null, Error, HttpTypes.StoreRegion | null, readonly ["medusa", "region", string]>, "queryFn"> & {
|
|
183
|
+
queryFn?: import("@tanstack/react-query").QueryFunction<HttpTypes.StoreRegion | null, readonly ["medusa", "region", string], never> | undefined;
|
|
184
|
+
} & import("@tanstack/react-query").QueryKeyWithDataTag<readonly ["medusa", "region", string], HttpTypes.StoreRegion | null, Error>;
|
|
185
|
+
storeRegions: () => import("@tanstack/react-query").OmitKeyof<import("@tanstack/react-query").UseQueryOptions<HttpTypes.StoreRegionListResponse, Error, HttpTypes.StoreRegionListResponse, readonly ["medusa", "regions"]>, "queryFn"> & {
|
|
186
|
+
queryFn?: import("@tanstack/react-query").QueryFunction<HttpTypes.StoreRegionListResponse, readonly ["medusa", "regions"], never> | undefined;
|
|
187
|
+
} & import("@tanstack/react-query").QueryKeyWithDataTag<readonly ["medusa", "regions"], HttpTypes.StoreRegionListResponse, Error>;
|
|
188
|
+
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"> & {
|
|
189
|
+
queryFn?: import("@tanstack/react-query").QueryFunction<import("../core/plugin-features.js").PluginFeatureMap, readonly ["medusa", "plugin-features"], never> | undefined;
|
|
190
|
+
} & import("@tanstack/react-query").QueryKeyWithDataTag<readonly ["medusa", "plugin-features"], import("../core/plugin-features.js").PluginFeatureMap, Error>;
|
|
191
|
+
documents: () => import("@tanstack/react-query").OmitKeyof<import("@tanstack/react-query").UseQueryOptions<{
|
|
192
|
+
documents: {
|
|
193
|
+
id: string;
|
|
194
|
+
kind: "invoice" | "cancellation" | "credit_note";
|
|
195
|
+
number: string;
|
|
196
|
+
order_display_id: number | null;
|
|
197
|
+
issued_at: string;
|
|
198
|
+
total: {
|
|
199
|
+
amount: string;
|
|
200
|
+
currency_code: string;
|
|
201
|
+
};
|
|
202
|
+
}[];
|
|
203
|
+
}, Error, {
|
|
204
|
+
documents: {
|
|
205
|
+
id: string;
|
|
206
|
+
kind: "invoice" | "cancellation" | "credit_note";
|
|
207
|
+
number: string;
|
|
208
|
+
order_display_id: number | null;
|
|
209
|
+
issued_at: string;
|
|
210
|
+
total: {
|
|
211
|
+
amount: string;
|
|
212
|
+
currency_code: string;
|
|
213
|
+
};
|
|
214
|
+
}[];
|
|
215
|
+
}, readonly ["medusa", "documents"]>, "queryFn"> & {
|
|
216
|
+
queryFn?: import("@tanstack/react-query").QueryFunction<{
|
|
217
|
+
documents: {
|
|
218
|
+
id: string;
|
|
219
|
+
kind: "invoice" | "cancellation" | "credit_note";
|
|
220
|
+
number: string;
|
|
221
|
+
order_display_id: number | null;
|
|
222
|
+
issued_at: string;
|
|
223
|
+
total: {
|
|
224
|
+
amount: string;
|
|
225
|
+
currency_code: string;
|
|
226
|
+
};
|
|
227
|
+
}[];
|
|
228
|
+
}, readonly ["medusa", "documents"], never> | undefined;
|
|
229
|
+
} & import("@tanstack/react-query").QueryKeyWithDataTag<readonly ["medusa", "documents"], {
|
|
230
|
+
documents: {
|
|
231
|
+
id: string;
|
|
232
|
+
kind: "invoice" | "cancellation" | "credit_note";
|
|
233
|
+
number: string;
|
|
234
|
+
order_display_id: number | null;
|
|
235
|
+
issued_at: string;
|
|
236
|
+
total: {
|
|
237
|
+
amount: string;
|
|
238
|
+
currency_code: string;
|
|
239
|
+
};
|
|
240
|
+
}[];
|
|
241
|
+
}, Error>;
|
|
242
|
+
orders: ({ limit, offset }?: {
|
|
243
|
+
limit?: number | undefined;
|
|
244
|
+
offset?: number | undefined;
|
|
245
|
+
}) => import("@tanstack/react-query").OmitKeyof<import("@tanstack/react-query").UseQueryOptions<HttpTypes.StoreOrderListResponse, Error, HttpTypes.StoreOrderListResponse, readonly ["medusa", "orders", {
|
|
246
|
+
limit: number;
|
|
247
|
+
offset: number;
|
|
248
|
+
}]>, "queryFn"> & {
|
|
249
|
+
queryFn?: import("@tanstack/react-query").QueryFunction<HttpTypes.StoreOrderListResponse, readonly ["medusa", "orders", {
|
|
250
|
+
limit: number;
|
|
251
|
+
offset: number;
|
|
252
|
+
}], never> | undefined;
|
|
253
|
+
} & import("@tanstack/react-query").QueryKeyWithDataTag<readonly ["medusa", "orders", {
|
|
254
|
+
limit: number;
|
|
255
|
+
offset: number;
|
|
256
|
+
}], HttpTypes.StoreOrderListResponse, Error>;
|
|
257
|
+
orderDetail: (orderId: string) => import("@tanstack/react-query").OmitKeyof<import("@tanstack/react-query").UseQueryOptions<HttpTypes.StoreOrder | null, Error, HttpTypes.StoreOrder | null, readonly ["medusa", "orders", "detail", string]>, "queryFn"> & {
|
|
258
|
+
queryFn?: import("@tanstack/react-query").QueryFunction<HttpTypes.StoreOrder | null, readonly ["medusa", "orders", "detail", string], never> | undefined;
|
|
259
|
+
} & import("@tanstack/react-query").QueryKeyWithDataTag<readonly ["medusa", "orders", "detail", string], HttpTypes.StoreOrder | null, Error>;
|
|
260
|
+
customerPasswordPolicy: () => import("@tanstack/react-query").OmitKeyof<import("@tanstack/react-query").UseQueryOptions<{
|
|
261
|
+
min_length: number;
|
|
262
|
+
require_mixed_case: boolean;
|
|
263
|
+
require_digit: boolean;
|
|
264
|
+
require_symbol: boolean;
|
|
265
|
+
}, Error, {
|
|
266
|
+
min_length: number;
|
|
267
|
+
require_mixed_case: boolean;
|
|
268
|
+
require_digit: boolean;
|
|
269
|
+
require_symbol: boolean;
|
|
270
|
+
}, readonly ["medusa", "customer-password-policy"]>, "queryFn"> & {
|
|
271
|
+
queryFn?: import("@tanstack/react-query").QueryFunction<{
|
|
272
|
+
min_length: number;
|
|
273
|
+
require_mixed_case: boolean;
|
|
274
|
+
require_digit: boolean;
|
|
275
|
+
require_symbol: boolean;
|
|
276
|
+
}, readonly ["medusa", "customer-password-policy"], never> | undefined;
|
|
277
|
+
} & import("@tanstack/react-query").QueryKeyWithDataTag<readonly ["medusa", "customer-password-policy"], {
|
|
278
|
+
min_length: number;
|
|
279
|
+
require_mixed_case: boolean;
|
|
280
|
+
require_digit: boolean;
|
|
281
|
+
require_symbol: boolean;
|
|
282
|
+
}, Error>;
|
|
283
|
+
customerTaxIdentifications: (isEnabled: boolean) => import("@tanstack/react-query").OmitKeyof<import("@tanstack/react-query").UseQueryOptions<{
|
|
284
|
+
identifications: {
|
|
285
|
+
customer_address_id: string;
|
|
286
|
+
status: "eligible" | "ineligible" | "unavailable" | "invalid";
|
|
287
|
+
verified: boolean;
|
|
288
|
+
vat_number: string;
|
|
289
|
+
company_name: string;
|
|
290
|
+
validated_at: string;
|
|
291
|
+
}[];
|
|
292
|
+
}, Error, {
|
|
293
|
+
identifications: {
|
|
294
|
+
customer_address_id: string;
|
|
295
|
+
status: "eligible" | "ineligible" | "unavailable" | "invalid";
|
|
296
|
+
verified: boolean;
|
|
297
|
+
vat_number: string;
|
|
298
|
+
company_name: string;
|
|
299
|
+
validated_at: string;
|
|
300
|
+
}[];
|
|
301
|
+
}, readonly ["medusa", "tax-identifications"]>, "queryFn"> & {
|
|
302
|
+
queryFn?: import("@tanstack/react-query").QueryFunction<{
|
|
303
|
+
identifications: {
|
|
304
|
+
customer_address_id: string;
|
|
305
|
+
status: "eligible" | "ineligible" | "unavailable" | "invalid";
|
|
306
|
+
verified: boolean;
|
|
307
|
+
vat_number: string;
|
|
308
|
+
company_name: string;
|
|
309
|
+
validated_at: string;
|
|
310
|
+
}[];
|
|
311
|
+
}, readonly ["medusa", "tax-identifications"], never> | undefined;
|
|
312
|
+
} & import("@tanstack/react-query").QueryKeyWithDataTag<readonly ["medusa", "tax-identifications"], {
|
|
313
|
+
identifications: {
|
|
314
|
+
customer_address_id: string;
|
|
315
|
+
status: "eligible" | "ineligible" | "unavailable" | "invalid";
|
|
316
|
+
verified: boolean;
|
|
317
|
+
vat_number: string;
|
|
318
|
+
company_name: string;
|
|
319
|
+
validated_at: string;
|
|
320
|
+
}[];
|
|
321
|
+
}, Error>;
|
|
322
|
+
affiliateContext: () => import("@tanstack/react-query").OmitKeyof<import("@tanstack/react-query").UseQueryOptions<{
|
|
323
|
+
portal_state: "no_application";
|
|
324
|
+
} | {
|
|
325
|
+
portal_state: "pending";
|
|
326
|
+
application: {
|
|
327
|
+
id: string;
|
|
328
|
+
requested_slug: string | null;
|
|
329
|
+
created_at: string;
|
|
330
|
+
status: "pending";
|
|
331
|
+
};
|
|
332
|
+
} | {
|
|
333
|
+
portal_state: "rejected";
|
|
334
|
+
application: {
|
|
335
|
+
id: string;
|
|
336
|
+
requested_slug: string | null;
|
|
337
|
+
created_at: string;
|
|
338
|
+
status: "rejected";
|
|
339
|
+
};
|
|
340
|
+
} | {
|
|
341
|
+
portal_state: "active";
|
|
342
|
+
affiliate: {
|
|
343
|
+
id: string;
|
|
344
|
+
commission_rate: number;
|
|
345
|
+
own_order_discount_rate: number;
|
|
346
|
+
effective_customer_discount_rate: number;
|
|
347
|
+
activated_at: string | null;
|
|
348
|
+
inactivated_at: string | null;
|
|
349
|
+
status: "active";
|
|
350
|
+
};
|
|
351
|
+
} | {
|
|
352
|
+
portal_state: "inactive";
|
|
353
|
+
affiliate: {
|
|
354
|
+
id: string;
|
|
355
|
+
commission_rate: number;
|
|
356
|
+
own_order_discount_rate: number;
|
|
357
|
+
effective_customer_discount_rate: number;
|
|
358
|
+
activated_at: string | null;
|
|
359
|
+
inactivated_at: string | null;
|
|
360
|
+
status: "inactive";
|
|
361
|
+
};
|
|
362
|
+
}, Error, {
|
|
363
|
+
portal_state: "no_application";
|
|
364
|
+
} | {
|
|
365
|
+
portal_state: "pending";
|
|
366
|
+
application: {
|
|
367
|
+
id: string;
|
|
368
|
+
requested_slug: string | null;
|
|
369
|
+
created_at: string;
|
|
370
|
+
status: "pending";
|
|
371
|
+
};
|
|
372
|
+
} | {
|
|
373
|
+
portal_state: "rejected";
|
|
374
|
+
application: {
|
|
375
|
+
id: string;
|
|
376
|
+
requested_slug: string | null;
|
|
377
|
+
created_at: string;
|
|
378
|
+
status: "rejected";
|
|
379
|
+
};
|
|
380
|
+
} | {
|
|
381
|
+
portal_state: "active";
|
|
382
|
+
affiliate: {
|
|
383
|
+
id: string;
|
|
384
|
+
commission_rate: number;
|
|
385
|
+
own_order_discount_rate: number;
|
|
386
|
+
effective_customer_discount_rate: number;
|
|
387
|
+
activated_at: string | null;
|
|
388
|
+
inactivated_at: string | null;
|
|
389
|
+
status: "active";
|
|
390
|
+
};
|
|
391
|
+
} | {
|
|
392
|
+
portal_state: "inactive";
|
|
393
|
+
affiliate: {
|
|
394
|
+
id: string;
|
|
395
|
+
commission_rate: number;
|
|
396
|
+
own_order_discount_rate: number;
|
|
397
|
+
effective_customer_discount_rate: number;
|
|
398
|
+
activated_at: string | null;
|
|
399
|
+
inactivated_at: string | null;
|
|
400
|
+
status: "inactive";
|
|
401
|
+
};
|
|
402
|
+
}, readonly ["affiliate", "context"]>, "queryFn"> & {
|
|
403
|
+
queryFn?: import("@tanstack/react-query").QueryFunction<{
|
|
404
|
+
portal_state: "no_application";
|
|
405
|
+
} | {
|
|
406
|
+
portal_state: "pending";
|
|
407
|
+
application: {
|
|
408
|
+
id: string;
|
|
409
|
+
requested_slug: string | null;
|
|
410
|
+
created_at: string;
|
|
411
|
+
status: "pending";
|
|
412
|
+
};
|
|
413
|
+
} | {
|
|
414
|
+
portal_state: "rejected";
|
|
415
|
+
application: {
|
|
416
|
+
id: string;
|
|
417
|
+
requested_slug: string | null;
|
|
418
|
+
created_at: string;
|
|
419
|
+
status: "rejected";
|
|
420
|
+
};
|
|
421
|
+
} | {
|
|
422
|
+
portal_state: "active";
|
|
423
|
+
affiliate: {
|
|
424
|
+
id: string;
|
|
425
|
+
commission_rate: number;
|
|
426
|
+
own_order_discount_rate: number;
|
|
427
|
+
effective_customer_discount_rate: number;
|
|
428
|
+
activated_at: string | null;
|
|
429
|
+
inactivated_at: string | null;
|
|
430
|
+
status: "active";
|
|
431
|
+
};
|
|
432
|
+
} | {
|
|
433
|
+
portal_state: "inactive";
|
|
434
|
+
affiliate: {
|
|
435
|
+
id: string;
|
|
436
|
+
commission_rate: number;
|
|
437
|
+
own_order_discount_rate: number;
|
|
438
|
+
effective_customer_discount_rate: number;
|
|
439
|
+
activated_at: string | null;
|
|
440
|
+
inactivated_at: string | null;
|
|
441
|
+
status: "inactive";
|
|
442
|
+
};
|
|
443
|
+
}, readonly ["affiliate", "context"], never> | undefined;
|
|
444
|
+
} & import("@tanstack/react-query").QueryKeyWithDataTag<readonly ["affiliate", "context"], {
|
|
445
|
+
portal_state: "no_application";
|
|
446
|
+
} | {
|
|
447
|
+
portal_state: "pending";
|
|
448
|
+
application: {
|
|
449
|
+
id: string;
|
|
450
|
+
requested_slug: string | null;
|
|
451
|
+
created_at: string;
|
|
452
|
+
status: "pending";
|
|
453
|
+
};
|
|
454
|
+
} | {
|
|
455
|
+
portal_state: "rejected";
|
|
456
|
+
application: {
|
|
457
|
+
id: string;
|
|
458
|
+
requested_slug: string | null;
|
|
459
|
+
created_at: string;
|
|
460
|
+
status: "rejected";
|
|
461
|
+
};
|
|
462
|
+
} | {
|
|
463
|
+
portal_state: "active";
|
|
464
|
+
affiliate: {
|
|
465
|
+
id: string;
|
|
466
|
+
commission_rate: number;
|
|
467
|
+
own_order_discount_rate: number;
|
|
468
|
+
effective_customer_discount_rate: number;
|
|
469
|
+
activated_at: string | null;
|
|
470
|
+
inactivated_at: string | null;
|
|
471
|
+
status: "active";
|
|
472
|
+
};
|
|
473
|
+
} | {
|
|
474
|
+
portal_state: "inactive";
|
|
475
|
+
affiliate: {
|
|
476
|
+
id: string;
|
|
477
|
+
commission_rate: number;
|
|
478
|
+
own_order_discount_rate: number;
|
|
479
|
+
effective_customer_discount_rate: number;
|
|
480
|
+
activated_at: string | null;
|
|
481
|
+
inactivated_at: string | null;
|
|
482
|
+
status: "inactive";
|
|
483
|
+
};
|
|
484
|
+
}, Error>;
|
|
485
|
+
affiliateCartReferral: (cartId: string, isEnabled: boolean) => import("@tanstack/react-query").OmitKeyof<import("@tanstack/react-query").UseQueryOptions<{
|
|
486
|
+
referral: {
|
|
487
|
+
id: string;
|
|
488
|
+
source: "link" | "coupon";
|
|
489
|
+
status: "active" | "replaced" | "ignored_existing_assignment" | "pending_email_validation" | "consumed" | "expired" | "invalidated";
|
|
490
|
+
affiliate: {
|
|
491
|
+
id: string;
|
|
492
|
+
status: "active";
|
|
493
|
+
};
|
|
494
|
+
captured_at: string;
|
|
495
|
+
expires_at: string;
|
|
496
|
+
} | null;
|
|
497
|
+
}, Error, {
|
|
498
|
+
referral: {
|
|
499
|
+
id: string;
|
|
500
|
+
source: "link" | "coupon";
|
|
501
|
+
status: "active" | "replaced" | "ignored_existing_assignment" | "pending_email_validation" | "consumed" | "expired" | "invalidated";
|
|
502
|
+
affiliate: {
|
|
503
|
+
id: string;
|
|
504
|
+
status: "active";
|
|
505
|
+
};
|
|
506
|
+
captured_at: string;
|
|
507
|
+
expires_at: string;
|
|
508
|
+
} | null;
|
|
509
|
+
}, readonly ["affiliate", "cart-referral", string]>, "queryFn"> & {
|
|
510
|
+
queryFn?: import("@tanstack/react-query").QueryFunction<{
|
|
511
|
+
referral: {
|
|
512
|
+
id: string;
|
|
513
|
+
source: "link" | "coupon";
|
|
514
|
+
status: "active" | "replaced" | "ignored_existing_assignment" | "pending_email_validation" | "consumed" | "expired" | "invalidated";
|
|
515
|
+
affiliate: {
|
|
516
|
+
id: string;
|
|
517
|
+
status: "active";
|
|
518
|
+
};
|
|
519
|
+
captured_at: string;
|
|
520
|
+
expires_at: string;
|
|
521
|
+
} | null;
|
|
522
|
+
}, readonly ["affiliate", "cart-referral", string], never> | undefined;
|
|
523
|
+
} & import("@tanstack/react-query").QueryKeyWithDataTag<readonly ["affiliate", "cart-referral", string], {
|
|
524
|
+
referral: {
|
|
525
|
+
id: string;
|
|
526
|
+
source: "link" | "coupon";
|
|
527
|
+
status: "active" | "replaced" | "ignored_existing_assignment" | "pending_email_validation" | "consumed" | "expired" | "invalidated";
|
|
528
|
+
affiliate: {
|
|
529
|
+
id: string;
|
|
530
|
+
status: "active";
|
|
531
|
+
};
|
|
532
|
+
captured_at: string;
|
|
533
|
+
expires_at: string;
|
|
534
|
+
} | null;
|
|
535
|
+
}, Error>;
|
|
536
|
+
couponLabels: (codes: string[], isEnabled: boolean) => import("@tanstack/react-query").OmitKeyof<import("@tanstack/react-query").UseQueryOptions<{
|
|
537
|
+
labels: {
|
|
538
|
+
code: string;
|
|
539
|
+
label: string;
|
|
540
|
+
discount_percentage: number;
|
|
541
|
+
}[];
|
|
542
|
+
}, Error, {
|
|
543
|
+
labels: {
|
|
544
|
+
code: string;
|
|
545
|
+
label: string;
|
|
546
|
+
discount_percentage: number;
|
|
547
|
+
}[];
|
|
548
|
+
}, readonly ["affiliate", "coupon-labels", string[]]>, "queryFn"> & {
|
|
549
|
+
queryFn?: import("@tanstack/react-query").QueryFunction<{
|
|
550
|
+
labels: {
|
|
551
|
+
code: string;
|
|
552
|
+
label: string;
|
|
553
|
+
discount_percentage: number;
|
|
554
|
+
}[];
|
|
555
|
+
}, readonly ["affiliate", "coupon-labels", string[]], never> | undefined;
|
|
556
|
+
} & import("@tanstack/react-query").QueryKeyWithDataTag<readonly ["affiliate", "coupon-labels", string[]], {
|
|
557
|
+
labels: {
|
|
558
|
+
code: string;
|
|
559
|
+
label: string;
|
|
560
|
+
discount_percentage: number;
|
|
561
|
+
}[];
|
|
562
|
+
}, Error>;
|
|
563
|
+
affiliateSlugs: () => import("@tanstack/react-query").OmitKeyof<import("@tanstack/react-query").UseQueryOptions<{
|
|
564
|
+
slugs: {
|
|
565
|
+
id: string;
|
|
566
|
+
slug: string;
|
|
567
|
+
active: boolean;
|
|
568
|
+
is_primary: boolean;
|
|
569
|
+
created_at: string;
|
|
570
|
+
updated_at: string;
|
|
571
|
+
referral_url: string;
|
|
572
|
+
}[];
|
|
573
|
+
}, Error, {
|
|
574
|
+
slugs: {
|
|
575
|
+
id: string;
|
|
576
|
+
slug: string;
|
|
577
|
+
active: boolean;
|
|
578
|
+
is_primary: boolean;
|
|
579
|
+
created_at: string;
|
|
580
|
+
updated_at: string;
|
|
581
|
+
referral_url: string;
|
|
582
|
+
}[];
|
|
583
|
+
}, readonly ["affiliate", "slugs"]>, "queryFn"> & {
|
|
584
|
+
queryFn?: import("@tanstack/react-query").QueryFunction<{
|
|
585
|
+
slugs: {
|
|
586
|
+
id: string;
|
|
587
|
+
slug: string;
|
|
588
|
+
active: boolean;
|
|
589
|
+
is_primary: boolean;
|
|
590
|
+
created_at: string;
|
|
591
|
+
updated_at: string;
|
|
592
|
+
referral_url: string;
|
|
593
|
+
}[];
|
|
594
|
+
}, readonly ["affiliate", "slugs"], never> | undefined;
|
|
595
|
+
} & import("@tanstack/react-query").QueryKeyWithDataTag<readonly ["affiliate", "slugs"], {
|
|
596
|
+
slugs: {
|
|
597
|
+
id: string;
|
|
598
|
+
slug: string;
|
|
599
|
+
active: boolean;
|
|
600
|
+
is_primary: boolean;
|
|
601
|
+
created_at: string;
|
|
602
|
+
updated_at: string;
|
|
603
|
+
referral_url: string;
|
|
604
|
+
}[];
|
|
605
|
+
}, Error>;
|
|
606
|
+
affiliateCouponCodes: (query: import("@hartl-services/medusa-contracts/types/affiliate-store").ListStoreAffiliateCouponCodesRequest) => import("@tanstack/react-query").OmitKeyof<import("@tanstack/react-query").UseQueryOptions<{
|
|
607
|
+
coupon_codes: {
|
|
608
|
+
id: string;
|
|
609
|
+
code: string;
|
|
610
|
+
status: "active" | "revoked" | "affiliate_inactive" | "provisioning" | "provisioning_failed";
|
|
611
|
+
origin: "default" | "manual" | "rotation";
|
|
612
|
+
created_at: string;
|
|
613
|
+
revoked_at: string | null;
|
|
614
|
+
}[];
|
|
615
|
+
count: number;
|
|
616
|
+
limit: number;
|
|
617
|
+
offset: number;
|
|
618
|
+
}, Error, {
|
|
619
|
+
coupon_codes: {
|
|
620
|
+
id: string;
|
|
621
|
+
code: string;
|
|
622
|
+
status: "active" | "revoked" | "affiliate_inactive" | "provisioning" | "provisioning_failed";
|
|
623
|
+
origin: "default" | "manual" | "rotation";
|
|
624
|
+
created_at: string;
|
|
625
|
+
revoked_at: string | null;
|
|
626
|
+
}[];
|
|
627
|
+
count: number;
|
|
628
|
+
limit: number;
|
|
629
|
+
offset: number;
|
|
630
|
+
}, readonly ["affiliate", "coupon-codes", {
|
|
631
|
+
status?: "enabled" | "revoked" | undefined;
|
|
632
|
+
limit?: string | number | undefined;
|
|
633
|
+
offset?: string | number | undefined;
|
|
634
|
+
}]>, "queryFn"> & {
|
|
635
|
+
queryFn?: import("@tanstack/react-query").QueryFunction<{
|
|
636
|
+
coupon_codes: {
|
|
637
|
+
id: string;
|
|
638
|
+
code: string;
|
|
639
|
+
status: "active" | "revoked" | "affiliate_inactive" | "provisioning" | "provisioning_failed";
|
|
640
|
+
origin: "default" | "manual" | "rotation";
|
|
641
|
+
created_at: string;
|
|
642
|
+
revoked_at: string | null;
|
|
643
|
+
}[];
|
|
644
|
+
count: number;
|
|
645
|
+
limit: number;
|
|
646
|
+
offset: number;
|
|
647
|
+
}, readonly ["affiliate", "coupon-codes", {
|
|
648
|
+
status?: "enabled" | "revoked" | undefined;
|
|
649
|
+
limit?: string | number | undefined;
|
|
650
|
+
offset?: string | number | undefined;
|
|
651
|
+
}], never> | undefined;
|
|
652
|
+
} & import("@tanstack/react-query").QueryKeyWithDataTag<readonly ["affiliate", "coupon-codes", {
|
|
653
|
+
status?: "enabled" | "revoked" | undefined;
|
|
654
|
+
limit?: string | number | undefined;
|
|
655
|
+
offset?: string | number | undefined;
|
|
656
|
+
}], {
|
|
657
|
+
coupon_codes: {
|
|
658
|
+
id: string;
|
|
659
|
+
code: string;
|
|
660
|
+
status: "active" | "revoked" | "affiliate_inactive" | "provisioning" | "provisioning_failed";
|
|
661
|
+
origin: "default" | "manual" | "rotation";
|
|
662
|
+
created_at: string;
|
|
663
|
+
revoked_at: string | null;
|
|
664
|
+
}[];
|
|
665
|
+
count: number;
|
|
666
|
+
limit: number;
|
|
667
|
+
offset: number;
|
|
668
|
+
}, Error>;
|
|
669
|
+
affiliateCommissions: (query: import("@hartl-services/medusa-contracts/types/affiliate-store").PartnerPortalCommissionsRequest) => import("@tanstack/react-query").OmitKeyof<import("@tanstack/react-query").UseQueryOptions<{
|
|
670
|
+
from: string;
|
|
671
|
+
to: string;
|
|
672
|
+
count: number;
|
|
673
|
+
limit: number;
|
|
674
|
+
offset: number;
|
|
675
|
+
totals: {
|
|
676
|
+
currency_code: string;
|
|
677
|
+
direct_commission_amount: number;
|
|
678
|
+
referral_commission_amount: number;
|
|
679
|
+
correction_amount: number;
|
|
680
|
+
net_commission_amount: number;
|
|
681
|
+
commission_base_amount: number;
|
|
682
|
+
attributed_order_count: number;
|
|
683
|
+
commissioned_order_count: number;
|
|
684
|
+
}[];
|
|
685
|
+
commissions: {
|
|
686
|
+
id: string;
|
|
687
|
+
type: "order_commission" | "refund_correction" | "cancellation_correction" | "manual_correction" | "affiliate_referral_bonus" | "affiliate_own_order_referrer_bonus";
|
|
688
|
+
occurred_at: string;
|
|
689
|
+
order_id: string | null;
|
|
690
|
+
base_amount_net: number;
|
|
691
|
+
commission_amount: number;
|
|
692
|
+
currency_code: string;
|
|
693
|
+
}[];
|
|
694
|
+
}, Error, {
|
|
695
|
+
from: string;
|
|
696
|
+
to: string;
|
|
697
|
+
count: number;
|
|
698
|
+
limit: number;
|
|
699
|
+
offset: number;
|
|
700
|
+
totals: {
|
|
701
|
+
currency_code: string;
|
|
702
|
+
direct_commission_amount: number;
|
|
703
|
+
referral_commission_amount: number;
|
|
704
|
+
correction_amount: number;
|
|
705
|
+
net_commission_amount: number;
|
|
706
|
+
commission_base_amount: number;
|
|
707
|
+
attributed_order_count: number;
|
|
708
|
+
commissioned_order_count: number;
|
|
709
|
+
}[];
|
|
710
|
+
commissions: {
|
|
711
|
+
id: string;
|
|
712
|
+
type: "order_commission" | "refund_correction" | "cancellation_correction" | "manual_correction" | "affiliate_referral_bonus" | "affiliate_own_order_referrer_bonus";
|
|
713
|
+
occurred_at: string;
|
|
714
|
+
order_id: string | null;
|
|
715
|
+
base_amount_net: number;
|
|
716
|
+
commission_amount: number;
|
|
717
|
+
currency_code: string;
|
|
718
|
+
}[];
|
|
719
|
+
}, readonly ["affiliate", "commissions", {
|
|
720
|
+
from?: string | undefined;
|
|
721
|
+
to?: string | undefined;
|
|
722
|
+
limit?: string | number | undefined;
|
|
723
|
+
offset?: string | number | undefined;
|
|
724
|
+
}]>, "queryFn"> & {
|
|
725
|
+
queryFn?: import("@tanstack/react-query").QueryFunction<{
|
|
726
|
+
from: string;
|
|
727
|
+
to: string;
|
|
728
|
+
count: number;
|
|
729
|
+
limit: number;
|
|
730
|
+
offset: number;
|
|
731
|
+
totals: {
|
|
732
|
+
currency_code: string;
|
|
733
|
+
direct_commission_amount: number;
|
|
734
|
+
referral_commission_amount: number;
|
|
735
|
+
correction_amount: number;
|
|
736
|
+
net_commission_amount: number;
|
|
737
|
+
commission_base_amount: number;
|
|
738
|
+
attributed_order_count: number;
|
|
739
|
+
commissioned_order_count: number;
|
|
740
|
+
}[];
|
|
741
|
+
commissions: {
|
|
742
|
+
id: string;
|
|
743
|
+
type: "order_commission" | "refund_correction" | "cancellation_correction" | "manual_correction" | "affiliate_referral_bonus" | "affiliate_own_order_referrer_bonus";
|
|
744
|
+
occurred_at: string;
|
|
745
|
+
order_id: string | null;
|
|
746
|
+
base_amount_net: number;
|
|
747
|
+
commission_amount: number;
|
|
748
|
+
currency_code: string;
|
|
749
|
+
}[];
|
|
750
|
+
}, readonly ["affiliate", "commissions", {
|
|
751
|
+
from?: string | undefined;
|
|
752
|
+
to?: string | undefined;
|
|
753
|
+
limit?: string | number | undefined;
|
|
754
|
+
offset?: string | number | undefined;
|
|
755
|
+
}], never> | undefined;
|
|
756
|
+
} & import("@tanstack/react-query").QueryKeyWithDataTag<readonly ["affiliate", "commissions", {
|
|
757
|
+
from?: string | undefined;
|
|
758
|
+
to?: string | undefined;
|
|
759
|
+
limit?: string | number | undefined;
|
|
760
|
+
offset?: string | number | undefined;
|
|
761
|
+
}], {
|
|
762
|
+
from: string;
|
|
763
|
+
to: string;
|
|
764
|
+
count: number;
|
|
765
|
+
limit: number;
|
|
766
|
+
offset: number;
|
|
767
|
+
totals: {
|
|
768
|
+
currency_code: string;
|
|
769
|
+
direct_commission_amount: number;
|
|
770
|
+
referral_commission_amount: number;
|
|
771
|
+
correction_amount: number;
|
|
772
|
+
net_commission_amount: number;
|
|
773
|
+
commission_base_amount: number;
|
|
774
|
+
attributed_order_count: number;
|
|
775
|
+
commissioned_order_count: number;
|
|
776
|
+
}[];
|
|
777
|
+
commissions: {
|
|
778
|
+
id: string;
|
|
779
|
+
type: "order_commission" | "refund_correction" | "cancellation_correction" | "manual_correction" | "affiliate_referral_bonus" | "affiliate_own_order_referrer_bonus";
|
|
780
|
+
occurred_at: string;
|
|
781
|
+
order_id: string | null;
|
|
782
|
+
base_amount_net: number;
|
|
783
|
+
commission_amount: number;
|
|
784
|
+
currency_code: string;
|
|
785
|
+
}[];
|
|
786
|
+
}, Error>;
|
|
787
|
+
affiliateConsignmentInventory: () => import("@tanstack/react-query").OmitKeyof<import("@tanstack/react-query").UseQueryOptions<{
|
|
788
|
+
period_start: string;
|
|
789
|
+
inventory: {
|
|
790
|
+
inventory_item_id: string;
|
|
791
|
+
batch_id: string | null;
|
|
792
|
+
expected_quantity: number;
|
|
793
|
+
}[];
|
|
794
|
+
}, Error, {
|
|
795
|
+
period_start: string;
|
|
796
|
+
inventory: {
|
|
797
|
+
inventory_item_id: string;
|
|
798
|
+
batch_id: string | null;
|
|
799
|
+
expected_quantity: number;
|
|
800
|
+
}[];
|
|
801
|
+
}, readonly ["affiliate", "consignment", "inventory"]>, "queryFn"> & {
|
|
802
|
+
queryFn?: import("@tanstack/react-query").QueryFunction<{
|
|
803
|
+
period_start: string;
|
|
804
|
+
inventory: {
|
|
805
|
+
inventory_item_id: string;
|
|
806
|
+
batch_id: string | null;
|
|
807
|
+
expected_quantity: number;
|
|
808
|
+
}[];
|
|
809
|
+
}, readonly ["affiliate", "consignment", "inventory"], never> | undefined;
|
|
810
|
+
} & import("@tanstack/react-query").QueryKeyWithDataTag<readonly ["affiliate", "consignment", "inventory"], {
|
|
811
|
+
period_start: string;
|
|
812
|
+
inventory: {
|
|
813
|
+
inventory_item_id: string;
|
|
814
|
+
batch_id: string | null;
|
|
815
|
+
expected_quantity: number;
|
|
816
|
+
}[];
|
|
817
|
+
}, Error>;
|
|
818
|
+
affiliateConsignmentReports: () => import("@tanstack/react-query").OmitKeyof<import("@tanstack/react-query").UseQueryOptions<{
|
|
819
|
+
reports: {
|
|
820
|
+
id: string;
|
|
821
|
+
affiliate_id: string;
|
|
822
|
+
period_start: string;
|
|
823
|
+
period_end: string;
|
|
824
|
+
status: "rejected" | "draft" | "approved" | "submitted";
|
|
825
|
+
draft_order_id: string | null;
|
|
826
|
+
order_id: string | null;
|
|
827
|
+
submitted_at: string | null;
|
|
828
|
+
lines: {
|
|
829
|
+
id: string;
|
|
830
|
+
inventory_item_id: string;
|
|
831
|
+
batch_id: string | null;
|
|
832
|
+
expected_quantity: number;
|
|
833
|
+
counted_quantity: number;
|
|
834
|
+
proposed_sale_quantity: number;
|
|
835
|
+
confirmed_sale_quantity: number;
|
|
836
|
+
requires_admin_clarification: boolean;
|
|
837
|
+
non_sale_reason: string | null;
|
|
838
|
+
resolved_unit_price: number | null;
|
|
839
|
+
discounted_line_total: number | null;
|
|
840
|
+
currency_code: string | null;
|
|
841
|
+
}[];
|
|
842
|
+
}[];
|
|
843
|
+
}, Error, {
|
|
844
|
+
reports: {
|
|
845
|
+
id: string;
|
|
846
|
+
affiliate_id: string;
|
|
847
|
+
period_start: string;
|
|
848
|
+
period_end: string;
|
|
849
|
+
status: "rejected" | "draft" | "approved" | "submitted";
|
|
850
|
+
draft_order_id: string | null;
|
|
851
|
+
order_id: string | null;
|
|
852
|
+
submitted_at: string | null;
|
|
853
|
+
lines: {
|
|
854
|
+
id: string;
|
|
855
|
+
inventory_item_id: string;
|
|
856
|
+
batch_id: string | null;
|
|
857
|
+
expected_quantity: number;
|
|
858
|
+
counted_quantity: number;
|
|
859
|
+
proposed_sale_quantity: number;
|
|
860
|
+
confirmed_sale_quantity: number;
|
|
861
|
+
requires_admin_clarification: boolean;
|
|
862
|
+
non_sale_reason: string | null;
|
|
863
|
+
resolved_unit_price: number | null;
|
|
864
|
+
discounted_line_total: number | null;
|
|
865
|
+
currency_code: string | null;
|
|
866
|
+
}[];
|
|
867
|
+
}[];
|
|
868
|
+
}, readonly ["affiliate", "consignment", "reports"]>, "queryFn"> & {
|
|
869
|
+
queryFn?: import("@tanstack/react-query").QueryFunction<{
|
|
870
|
+
reports: {
|
|
871
|
+
id: string;
|
|
872
|
+
affiliate_id: string;
|
|
873
|
+
period_start: string;
|
|
874
|
+
period_end: string;
|
|
875
|
+
status: "rejected" | "draft" | "approved" | "submitted";
|
|
876
|
+
draft_order_id: string | null;
|
|
877
|
+
order_id: string | null;
|
|
878
|
+
submitted_at: string | null;
|
|
879
|
+
lines: {
|
|
880
|
+
id: string;
|
|
881
|
+
inventory_item_id: string;
|
|
882
|
+
batch_id: string | null;
|
|
883
|
+
expected_quantity: number;
|
|
884
|
+
counted_quantity: number;
|
|
885
|
+
proposed_sale_quantity: number;
|
|
886
|
+
confirmed_sale_quantity: number;
|
|
887
|
+
requires_admin_clarification: boolean;
|
|
888
|
+
non_sale_reason: string | null;
|
|
889
|
+
resolved_unit_price: number | null;
|
|
890
|
+
discounted_line_total: number | null;
|
|
891
|
+
currency_code: string | null;
|
|
892
|
+
}[];
|
|
893
|
+
}[];
|
|
894
|
+
}, readonly ["affiliate", "consignment", "reports"], never> | undefined;
|
|
895
|
+
} & import("@tanstack/react-query").QueryKeyWithDataTag<readonly ["affiliate", "consignment", "reports"], {
|
|
896
|
+
reports: {
|
|
897
|
+
id: string;
|
|
898
|
+
affiliate_id: string;
|
|
899
|
+
period_start: string;
|
|
900
|
+
period_end: string;
|
|
901
|
+
status: "rejected" | "draft" | "approved" | "submitted";
|
|
902
|
+
draft_order_id: string | null;
|
|
903
|
+
order_id: string | null;
|
|
904
|
+
submitted_at: string | null;
|
|
905
|
+
lines: {
|
|
906
|
+
id: string;
|
|
907
|
+
inventory_item_id: string;
|
|
908
|
+
batch_id: string | null;
|
|
909
|
+
expected_quantity: number;
|
|
910
|
+
counted_quantity: number;
|
|
911
|
+
proposed_sale_quantity: number;
|
|
912
|
+
confirmed_sale_quantity: number;
|
|
913
|
+
requires_admin_clarification: boolean;
|
|
914
|
+
non_sale_reason: string | null;
|
|
915
|
+
resolved_unit_price: number | null;
|
|
916
|
+
discounted_line_total: number | null;
|
|
917
|
+
currency_code: string | null;
|
|
918
|
+
}[];
|
|
919
|
+
}[];
|
|
920
|
+
}, Error>;
|
|
921
|
+
};
|
|
922
|
+
affiliateApiPaths: {
|
|
923
|
+
commissions: string;
|
|
924
|
+
consignmentInventory: string;
|
|
925
|
+
consignmentReports: string;
|
|
926
|
+
context: string;
|
|
927
|
+
couponCodes: string;
|
|
928
|
+
slugs: string;
|
|
929
|
+
};
|
|
930
|
+
callbacks: StorefrontCallbacks;
|
|
931
|
+
/** Link to the shop's document download Route Handler (`api/documents/[id]/download`). */
|
|
932
|
+
documentDownloadHref: (documentId: string) => string;
|
|
933
|
+
getStripe: () => Promise<Stripe | null> | null;
|
|
934
|
+
hasStripe: boolean;
|
|
935
|
+
orderConfirmedPath: (countryCode: string, orderId: string) => string;
|
|
936
|
+
refreshCartAfterMutation: (queryClient: import("@tanstack/react-query").QueryClient, cartId?: string) => Promise<HttpTypes.StoreCart | null>;
|
|
937
|
+
freshOrder: {
|
|
938
|
+
markFreshOrder(orderId: string): void;
|
|
939
|
+
takeFreshOrder(orderId: string): boolean;
|
|
940
|
+
};
|
|
941
|
+
imageUrls: {
|
|
942
|
+
resolveMedusaImageUrl(url: string | null | undefined): string;
|
|
943
|
+
isMedusaHostedImageUrl(url: string): boolean;
|
|
944
|
+
};
|
|
945
|
+
};
|
|
946
|
+
export type StorefrontBrowser = ReturnType<typeof createStorefrontBrowser>;
|