@shoppexio/storefront 1.0.57 → 1.0.59
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/CHANGELOG.md +99 -0
- package/LICENSE +21 -0
- package/README.md +96 -180
- package/dist/chunk-ZVOFFURI.js +15364 -0
- package/dist/chunk-ZVOFFURI.js.map +1 -0
- package/dist/customer.cjs +16013 -1
- package/dist/customer.cjs.map +1 -1
- package/dist/{headless-customer.d.ts → customer.d.cts} +74 -61
- package/dist/customer.d.ts +336 -10
- package/dist/customer.js +726 -2
- package/dist/customer.js.map +1 -1
- package/dist/index.cjs +21533 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +1979 -0
- package/dist/index.d.ts +1859 -49
- package/dist/index.js +6139 -0
- package/dist/index.js.map +1 -0
- package/package.json +18 -37
- package/dist/core/attribution.d.ts +0 -26
- package/dist/core/attribution.d.ts.map +0 -1
- package/dist/core/cache.d.ts +0 -26
- package/dist/core/cache.d.ts.map +0 -1
- package/dist/core/client.d.ts +0 -18
- package/dist/core/client.d.ts.map +0 -1
- package/dist/core/config.d.ts +0 -10
- package/dist/core/config.d.ts.map +0 -1
- package/dist/core/endpoint.d.ts +0 -2
- package/dist/core/endpoint.d.ts.map +0 -1
- package/dist/core/errors.d.ts +0 -34
- package/dist/core/errors.d.ts.map +0 -1
- package/dist/core/telemetry.d.ts +0 -20
- package/dist/core/telemetry.d.ts.map +0 -1
- package/dist/core/typed-client.d.ts +0 -15
- package/dist/core/typed-client.d.ts.map +0 -1
- package/dist/customer.d.ts.map +0 -1
- package/dist/headless-customer.d.ts.map +0 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/modules/affiliates.d.ts +0 -15
- package/dist/modules/affiliates.d.ts.map +0 -1
- package/dist/modules/analytics.d.ts +0 -2
- package/dist/modules/analytics.d.ts.map +0 -1
- package/dist/modules/cart.d.ts +0 -62
- package/dist/modules/cart.d.ts.map +0 -1
- package/dist/modules/checkout.d.ts +0 -133
- package/dist/modules/checkout.d.ts.map +0 -1
- package/dist/modules/coupons.d.ts +0 -3
- package/dist/modules/coupons.d.ts.map +0 -1
- package/dist/modules/customer.d.ts +0 -147
- package/dist/modules/customer.d.ts.map +0 -1
- package/dist/modules/invoices.d.ts +0 -6
- package/dist/modules/invoices.d.ts.map +0 -1
- package/dist/modules/navigation.d.ts +0 -20
- package/dist/modules/navigation.d.ts.map +0 -1
- package/dist/modules/pages.d.ts +0 -10
- package/dist/modules/pages.d.ts.map +0 -1
- package/dist/modules/presence.d.ts +0 -12
- package/dist/modules/presence.d.ts.map +0 -1
- package/dist/modules/products.d.ts +0 -16
- package/dist/modules/products.d.ts.map +0 -1
- package/dist/modules/reviews.d.ts +0 -4
- package/dist/modules/reviews.d.ts.map +0 -1
- package/dist/modules/search.d.ts +0 -10
- package/dist/modules/search.d.ts.map +0 -1
- package/dist/modules/store.d.ts +0 -11
- package/dist/modules/store.d.ts.map +0 -1
- package/dist/modules/theme.d.ts +0 -27
- package/dist/modules/theme.d.ts.map +0 -1
- package/dist/shoppex.esm.js +0 -3
- package/dist/shoppex.esm.js.map +0 -1
- package/dist/shoppex.umd.js +0 -2
- package/dist/shoppex.umd.js.map +0 -1
- package/dist/types/api.d.ts +0 -757
- package/dist/types/api.d.ts.map +0 -1
- package/dist/types/cart.d.ts +0 -239
- package/dist/types/cart.d.ts.map +0 -1
- package/dist/types/config.d.ts +0 -18
- package/dist/types/config.d.ts.map +0 -1
- package/dist/types/index.d.ts +0 -7
- package/dist/types/index.d.ts.map +0 -1
- package/dist/types/theme-config.d.ts +0 -109
- package/dist/types/theme-config.d.ts.map +0 -1
- package/dist/utils/cart-line-id.d.ts +0 -5
- package/dist/utils/cart-line-id.d.ts.map +0 -1
- package/dist/utils/format.d.ts +0 -6
- package/dist/utils/format.d.ts.map +0 -1
- package/dist/utils/requested-currency.d.ts +0 -3
- package/dist/utils/requested-currency.d.ts.map +0 -1
- package/dist/utils/storage.d.ts +0 -10
- package/dist/utils/storage.d.ts.map +0 -1
- package/dist/utils/storefront-catalog.d.ts +0 -5
- package/dist/utils/storefront-catalog.d.ts.map +0 -1
- package/dist/utils/storefront-contact.d.ts +0 -32
- package/dist/utils/storefront-contact.d.ts.map +0 -1
- package/dist/utils/storefront-custom-fields.d.ts +0 -13
- package/dist/utils/storefront-custom-fields.d.ts.map +0 -1
- package/dist/utils/storefront-search.d.ts +0 -22
- package/dist/utils/storefront-search.d.ts.map +0 -1
- package/dist/utils/storefront-stock.d.ts +0 -14
- package/dist/utils/storefront-stock.d.ts.map +0 -1
package/dist/types/api.d.ts
DELETED
|
@@ -1,757 +0,0 @@
|
|
|
1
|
-
import { NavigationMenuSlot } from '@shoppex/contracts/navigation';
|
|
2
|
-
/**
|
|
3
|
-
* API Response Types
|
|
4
|
-
*
|
|
5
|
-
* Backend returns: { status: number, data: T, error: string | null }
|
|
6
|
-
* SDK maps to: { success: boolean, data?: T, message?: string }
|
|
7
|
-
*/
|
|
8
|
-
export interface ApiResponse<T> {
|
|
9
|
-
status: number;
|
|
10
|
-
data: T;
|
|
11
|
-
error: string | null;
|
|
12
|
-
message?: string | null;
|
|
13
|
-
/**
|
|
14
|
-
* Machine-readable refusal identifier (e.g. `errors.checkout.coupon_no_longer_valid`).
|
|
15
|
-
* Emitted by every localized backend error; the localized `error` sentence is
|
|
16
|
-
* for humans, this is what code branches on.
|
|
17
|
-
*/
|
|
18
|
-
error_code?: string | null;
|
|
19
|
-
error_params?: Record<string, unknown> | null;
|
|
20
|
-
}
|
|
21
|
-
export interface ApiChallenge {
|
|
22
|
-
provider: 'turnstile';
|
|
23
|
-
siteKey: string;
|
|
24
|
-
}
|
|
25
|
-
export interface SDKResponse<T> {
|
|
26
|
-
success: boolean;
|
|
27
|
-
data?: T;
|
|
28
|
-
message?: string;
|
|
29
|
-
/**
|
|
30
|
-
* The backend's `error_code`, preserved verbatim on every failure the server
|
|
31
|
-
* answered — including non-2xx HTTP responses. `message` is localized display
|
|
32
|
-
* copy and must never be pattern-matched; branch on `code` instead.
|
|
33
|
-
* Absent when the failure never reached the server (transport, timeout) or
|
|
34
|
-
* when the endpoint emits no machine-readable code.
|
|
35
|
-
*/
|
|
36
|
-
code?: string;
|
|
37
|
-
errorParams?: Record<string, unknown>;
|
|
38
|
-
/**
|
|
39
|
-
* HTTP status of the server's answer, when there was one.
|
|
40
|
-
*
|
|
41
|
-
* Needed to tell "not signed in" (401) apart from "the server broke" (5xx) or
|
|
42
|
-
* a transport failure, which are otherwise indistinguishable. Without it a
|
|
43
|
-
* client has to treat every failure as no-session and show a sign-in form to
|
|
44
|
-
* someone who is signed in — a silent downgrade of the very state it is
|
|
45
|
-
* trying to report.
|
|
46
|
-
*
|
|
47
|
-
* Absent when the request never reached the server.
|
|
48
|
-
*/
|
|
49
|
-
status?: number;
|
|
50
|
-
/**
|
|
51
|
-
* Whether the request received an HTTP response from the server.
|
|
52
|
-
*
|
|
53
|
-
* `false` identifies an ambiguous transport failure: the browser cannot
|
|
54
|
-
* know whether a mutation committed before the connection was lost. Public
|
|
55
|
-
* mutation helpers use this signal to retain their idempotency key for the
|
|
56
|
-
* buyer's retry. Absent on successful responses and older SDK results.
|
|
57
|
-
*/
|
|
58
|
-
responseReceived?: boolean;
|
|
59
|
-
/**
|
|
60
|
-
* True only when a parsed server refusal proves that the mutation did not
|
|
61
|
-
* commit (currently a JSON 4xx other than timeout). Mutation helpers may
|
|
62
|
-
* rotate an idempotency key on this signal. A response whose body is
|
|
63
|
-
* truncated, malformed, or a 5xx remains ambiguous even though headers were
|
|
64
|
-
* received.
|
|
65
|
-
*/
|
|
66
|
-
responseDefinitive?: boolean;
|
|
67
|
-
/** A renewable human-verification challenge returned with a refusal. */
|
|
68
|
-
challenge?: ApiChallenge;
|
|
69
|
-
}
|
|
70
|
-
export interface Shop {
|
|
71
|
-
id: string;
|
|
72
|
-
name: string;
|
|
73
|
-
slug: string;
|
|
74
|
-
domain?: string;
|
|
75
|
-
description?: string;
|
|
76
|
-
title?: string;
|
|
77
|
-
message?: string;
|
|
78
|
-
url?: string;
|
|
79
|
-
logo?: string;
|
|
80
|
-
banner?: string;
|
|
81
|
-
avatar?: string;
|
|
82
|
-
average_score?: number | null;
|
|
83
|
-
rating?: number | null;
|
|
84
|
-
products_sold_count?: number;
|
|
85
|
-
customers_count?: number;
|
|
86
|
-
hide_products_sold?: boolean;
|
|
87
|
-
currency: string;
|
|
88
|
-
tos_enabled?: boolean;
|
|
89
|
-
dark_mode?: boolean;
|
|
90
|
-
search_enabled?: boolean;
|
|
91
|
-
sort_enabled?: boolean;
|
|
92
|
-
cart_enabled?: boolean;
|
|
93
|
-
contact_form_enabled?: boolean;
|
|
94
|
-
require_invoice_for_contact?: boolean;
|
|
95
|
-
hide_out_of_stock?: boolean;
|
|
96
|
-
hide_stock_counter?: boolean;
|
|
97
|
-
center_product_titles?: boolean;
|
|
98
|
-
center_group_titles?: boolean;
|
|
99
|
-
default_sort?: string;
|
|
100
|
-
social?: Record<string, string | null>;
|
|
101
|
-
discord_link?: string | null;
|
|
102
|
-
twitter_link?: string | null;
|
|
103
|
-
instagram_link?: string | null;
|
|
104
|
-
facebook_link?: string | null;
|
|
105
|
-
telegram_link?: string | null;
|
|
106
|
-
youtube_link?: string | null;
|
|
107
|
-
reddit_link?: string | null;
|
|
108
|
-
tiktok_link?: string | null;
|
|
109
|
-
verified?: boolean;
|
|
110
|
-
on_hold?: boolean;
|
|
111
|
-
theme?: ShopTheme | null;
|
|
112
|
-
builder_settings?: Record<string, unknown> | null;
|
|
113
|
-
feedback?: ShopFeedback;
|
|
114
|
-
trusted_checks?: TrustedChecks | null;
|
|
115
|
-
available_gateways?: string[];
|
|
116
|
-
payment_gateways_fees?: unknown[];
|
|
117
|
-
reward_program_summary?: RewardProgramSummary | null;
|
|
118
|
-
}
|
|
119
|
-
export interface RewardProgramTeaserItem {
|
|
120
|
-
trigger_type: RewardReason;
|
|
121
|
-
action_type: RewardActionType;
|
|
122
|
-
label: string;
|
|
123
|
-
}
|
|
124
|
-
export interface RewardProgramSummary {
|
|
125
|
-
enabled: boolean;
|
|
126
|
-
headline: string;
|
|
127
|
-
items: RewardProgramTeaserItem[];
|
|
128
|
-
}
|
|
129
|
-
export interface ShopTheme {
|
|
130
|
-
primary_color?: string;
|
|
131
|
-
secondary_color?: string;
|
|
132
|
-
font?: string;
|
|
133
|
-
logo?: string | null;
|
|
134
|
-
logo_cloudflare_image_id?: string | null;
|
|
135
|
-
background_image?: string | null;
|
|
136
|
-
background_image_cloudflare_image_id?: string | null;
|
|
137
|
-
cards_in_row?: number | string;
|
|
138
|
-
cards_align?: string;
|
|
139
|
-
card_animation?: string;
|
|
140
|
-
dark_color?: string;
|
|
141
|
-
light_color?: string;
|
|
142
|
-
border_color?: string;
|
|
143
|
-
button_color?: string;
|
|
144
|
-
}
|
|
145
|
-
export interface ShopFeedback {
|
|
146
|
-
positive: number;
|
|
147
|
-
neutral: number;
|
|
148
|
-
negative: number;
|
|
149
|
-
total: number;
|
|
150
|
-
}
|
|
151
|
-
export interface TrustedChecks {
|
|
152
|
-
identity_verified?: boolean;
|
|
153
|
-
feedback_score?: string | null;
|
|
154
|
-
trusted_score?: number;
|
|
155
|
-
sales_last14days_metric?: string;
|
|
156
|
-
}
|
|
157
|
-
export interface ProductCategory {
|
|
158
|
-
uniqid: string;
|
|
159
|
-
title: string;
|
|
160
|
-
description?: string | null;
|
|
161
|
-
image_attachment?: string | null;
|
|
162
|
-
image_name?: string | null;
|
|
163
|
-
image_storage?: string | null;
|
|
164
|
-
cloudflare_image_id?: string | null;
|
|
165
|
-
cdn_image_url?: string | null;
|
|
166
|
-
}
|
|
167
|
-
export interface ProductDescriptionTab {
|
|
168
|
-
title: string;
|
|
169
|
-
content: string;
|
|
170
|
-
}
|
|
171
|
-
export interface Product {
|
|
172
|
-
id?: string;
|
|
173
|
-
uniqid: string;
|
|
174
|
-
title: string;
|
|
175
|
-
slug?: string | null;
|
|
176
|
-
description?: string | null;
|
|
177
|
-
/** Merchant-defined description tabs; present when the shop configured them. */
|
|
178
|
-
description_tabs?: ProductDescriptionTab[];
|
|
179
|
-
product_highlights?: string[];
|
|
180
|
-
price: string;
|
|
181
|
-
price_display?: string;
|
|
182
|
-
price_discount?: number;
|
|
183
|
-
currency: string;
|
|
184
|
-
/**
|
|
185
|
-
* RAW local stock only. `-1` (or any negative value) means unlimited, `0` means
|
|
186
|
-
* no local units. This is NEVER on its own a purchasable cap: a supplier-backed
|
|
187
|
-
* product reports `stock: 0` by design and is still buyable. Gate buying on
|
|
188
|
-
* {@link Product.orderable}, and use `resolveDisplayStock` / `isProductInStock`
|
|
189
|
-
* rather than reading this field directly.
|
|
190
|
-
*/
|
|
191
|
-
stock?: number;
|
|
192
|
-
/**
|
|
193
|
-
* Per-product override for the shop's stock-counter setting; `null` inherits.
|
|
194
|
-
* Consumers must resolve it against the shop default rather than reading it
|
|
195
|
-
* alone.
|
|
196
|
-
*
|
|
197
|
-
* Both spellings are declared because both are really sent: the storefront
|
|
198
|
-
* catalog (`getStorefront`) emits camelCase alongside its other product
|
|
199
|
-
* fields, while `getProducts`, `getProduct` and `getStorefrontProductsPage`
|
|
200
|
-
* go through transformStorefrontCatalogProduct, which emits snake_case, and
|
|
201
|
-
* nothing normalizes between them. Declaring only one would have left readers
|
|
202
|
-
* of the other silently seeing `undefined` and falling back to the shop
|
|
203
|
-
* setting — showing a count the merchant hid, or hiding one they wanted shown.
|
|
204
|
-
*/
|
|
205
|
-
hideStockCounter?: boolean | null;
|
|
206
|
-
hide_stock_counter?: boolean | null;
|
|
207
|
-
/**
|
|
208
|
-
* Authoritative buyability predicate, mirrored from the backend's order-time
|
|
209
|
-
* gate: `local stock covers one unit OR an eligible supplier source can fulfil
|
|
210
|
-
* the line`. This — not `stock` — is what a storefront must gate the buy button,
|
|
211
|
-
* the quantity cap and the sold-out badge on.
|
|
212
|
-
*
|
|
213
|
-
* Absent on payloads that predate Dynamic Delivery. When absent, treat
|
|
214
|
-
* availability exactly as `stock` alone dictates; a missing field must never
|
|
215
|
-
* turn a genuinely sold-out product into a buyable one.
|
|
216
|
-
*/
|
|
217
|
-
orderable?: boolean;
|
|
218
|
-
/**
|
|
219
|
-
* True when an enabled supplier source fulfils this product instead of local
|
|
220
|
-
* stock. `orderable` remains the buy/sold-out gate; this field decides the
|
|
221
|
-
* QUANTITY CAP: the supplier purchase — not the local counter — fulfils the line
|
|
222
|
-
* and the completion excludes it from the local decrement, so residual local
|
|
223
|
-
* units bound nothing and the cap is unlimited even at `stock: 1`. Absent on
|
|
224
|
-
* payloads that predate Dynamic Delivery; when absent, the cap stays exactly
|
|
225
|
-
* what `stock` alone dictates.
|
|
226
|
-
*/
|
|
227
|
-
supplier_backed?: boolean;
|
|
228
|
-
quantity_min?: number;
|
|
229
|
-
quantity_max?: number;
|
|
230
|
-
min_quantity?: number;
|
|
231
|
-
max_quantity?: number;
|
|
232
|
-
on_hold?: boolean | number;
|
|
233
|
-
unlisted?: boolean | number;
|
|
234
|
-
private?: boolean | number;
|
|
235
|
-
bestseller?: boolean | number;
|
|
236
|
-
type?: string;
|
|
237
|
-
subtype?: string | null;
|
|
238
|
-
isSubscription?: boolean;
|
|
239
|
-
isGroup?: boolean;
|
|
240
|
-
images: ProductImage[];
|
|
241
|
-
image_name?: string | null;
|
|
242
|
-
image_storage?: string | null;
|
|
243
|
-
cloudflare_image_id?: string | null;
|
|
244
|
-
image_attachment?: string | null;
|
|
245
|
-
sold_count?: number;
|
|
246
|
-
soldCount?: number;
|
|
247
|
-
variants?: ProductVariant[];
|
|
248
|
-
addons?: ProductAddon[];
|
|
249
|
-
price_variants?: PriceVariant[];
|
|
250
|
-
volume_discounts?: unknown;
|
|
251
|
-
custom_fields?: string | unknown[] | null;
|
|
252
|
-
categories?: ProductCategory[];
|
|
253
|
-
bundles?: ProductBundle[];
|
|
254
|
-
faqs?: ProductFaq[];
|
|
255
|
-
subscription?: Subscription;
|
|
256
|
-
feedbacks?: Feedback[];
|
|
257
|
-
feedback?: ProductFeedback;
|
|
258
|
-
cdn_image_url?: string;
|
|
259
|
-
detail_image_url?: string | null;
|
|
260
|
-
recurring_interval?: string | null;
|
|
261
|
-
recurring_interval_count?: number | null;
|
|
262
|
-
trial_period?: number | null;
|
|
263
|
-
setup_cost?: string;
|
|
264
|
-
licensing_enabled?: boolean | number;
|
|
265
|
-
license_period?: string | number | null;
|
|
266
|
-
delivery_text?: string;
|
|
267
|
-
service_text?: string;
|
|
268
|
-
terms_of_service?: string | null;
|
|
269
|
-
warranty?: number;
|
|
270
|
-
warranty_text?: string | null;
|
|
271
|
-
sort_priority?: number;
|
|
272
|
-
pay_what_you_want?: boolean | number;
|
|
273
|
-
video_link?: string | null;
|
|
274
|
-
}
|
|
275
|
-
export interface ProductFeedback {
|
|
276
|
-
total: number;
|
|
277
|
-
positive: number;
|
|
278
|
-
neutral: number;
|
|
279
|
-
negative: number;
|
|
280
|
-
numbers?: Record<number, number>;
|
|
281
|
-
list?: Array<{
|
|
282
|
-
score: number;
|
|
283
|
-
message: string | null;
|
|
284
|
-
reply: string | null;
|
|
285
|
-
created_at: string | null;
|
|
286
|
-
createdAt?: string | null;
|
|
287
|
-
updated_at: string | null;
|
|
288
|
-
updatedAt?: string | null;
|
|
289
|
-
is_automated?: boolean;
|
|
290
|
-
isAutomated?: boolean;
|
|
291
|
-
}>;
|
|
292
|
-
}
|
|
293
|
-
export interface ProductImage {
|
|
294
|
-
id: string;
|
|
295
|
-
url: string;
|
|
296
|
-
cloudflare_image_id?: string;
|
|
297
|
-
alt?: string;
|
|
298
|
-
}
|
|
299
|
-
export interface ProductVariant {
|
|
300
|
-
id: string;
|
|
301
|
-
title: string;
|
|
302
|
-
price?: number;
|
|
303
|
-
/**
|
|
304
|
-
* RAW local stock for this option only. `-1` (or any negative value) means
|
|
305
|
-
* unlimited, `0` means no local units — which a supplier-backed option reports
|
|
306
|
-
* by design. Never render this as a purchasable cap on its own; gate on
|
|
307
|
-
* {@link ProductVariant.orderable}.
|
|
308
|
-
*/
|
|
309
|
-
stock?: number;
|
|
310
|
-
/**
|
|
311
|
-
* Authoritative buyability predicate for this option: `local stock covers one
|
|
312
|
-
* unit OR an eligible supplier source can fulfil the line`. The backend resolves
|
|
313
|
-
* a product-wide supplier mapping onto every variant's own flag, so this alone
|
|
314
|
-
* is authoritative for a selected variant.
|
|
315
|
-
*
|
|
316
|
-
* Absent on payloads that predate Dynamic Delivery; when absent, availability
|
|
317
|
-
* follows `stock` alone, exactly as before.
|
|
318
|
-
*/
|
|
319
|
-
orderable?: boolean;
|
|
320
|
-
/**
|
|
321
|
-
* True when an enabled supplier source fulfils this option instead of local
|
|
322
|
-
* stock. `orderable` remains the buy/sold-out gate; this field decides the
|
|
323
|
-
* QUANTITY CAP — a supplier-backed row is unbounded even when it still holds a
|
|
324
|
-
* few local units, because the supplier purchase fulfils the line and the
|
|
325
|
-
* completion excludes it from the local decrement. Absent on payloads that
|
|
326
|
-
* predate Dynamic Delivery.
|
|
327
|
-
*/
|
|
328
|
-
supplier_backed?: boolean;
|
|
329
|
-
quantity_min?: number;
|
|
330
|
-
quantity_max?: number;
|
|
331
|
-
quantityMin?: number;
|
|
332
|
-
quantityMax?: number;
|
|
333
|
-
image_id?: string | null;
|
|
334
|
-
imageId?: string | null;
|
|
335
|
-
cloudflare_image_id?: string | null;
|
|
336
|
-
cloudflareImageId?: string | null;
|
|
337
|
-
image_url?: string | null;
|
|
338
|
-
imageUrl?: string | null;
|
|
339
|
-
/** Merchant-selected storefront highlight. It does not affect selection or availability. */
|
|
340
|
-
is_featured?: boolean;
|
|
341
|
-
isFeatured?: boolean;
|
|
342
|
-
/** License validity in days for this option. Zero means lifetime. */
|
|
343
|
-
license_period?: number | null;
|
|
344
|
-
}
|
|
345
|
-
export interface ProductAddon {
|
|
346
|
-
id: string;
|
|
347
|
-
name?: string;
|
|
348
|
-
title?: string;
|
|
349
|
-
price: number;
|
|
350
|
-
required?: boolean;
|
|
351
|
-
}
|
|
352
|
-
export interface PriceVariant {
|
|
353
|
-
id: string;
|
|
354
|
-
label?: string;
|
|
355
|
-
title?: string;
|
|
356
|
-
price: number;
|
|
357
|
-
/**
|
|
358
|
-
* RAW local stock for this price variant only. `-1` (or any negative value)
|
|
359
|
-
* means unlimited, `0` means no local units — which a supplier-backed variant
|
|
360
|
-
* reports by design. Never render this as a purchasable cap on its own; gate on
|
|
361
|
-
* {@link PriceVariant.orderable}.
|
|
362
|
-
*/
|
|
363
|
-
stock?: number;
|
|
364
|
-
/**
|
|
365
|
-
* Authoritative buyability predicate for this price variant: `local stock covers
|
|
366
|
-
* one unit OR an eligible supplier source can fulfil the line`. The backend
|
|
367
|
-
* resolves a product-wide supplier mapping onto every variant's own flag, so
|
|
368
|
-
* this alone is authoritative for a selected variant.
|
|
369
|
-
*
|
|
370
|
-
* Absent on payloads that predate Dynamic Delivery; when absent, availability
|
|
371
|
-
* follows `stock` alone, exactly as before.
|
|
372
|
-
*/
|
|
373
|
-
orderable?: boolean;
|
|
374
|
-
/**
|
|
375
|
-
* True when an enabled supplier source fulfils this price variant instead of
|
|
376
|
-
* local stock. `orderable` remains the buy/sold-out gate; this field decides the
|
|
377
|
-
* QUANTITY CAP — a supplier-backed row is unbounded even when it still holds a
|
|
378
|
-
* few local units, because the supplier purchase fulfils the line and the
|
|
379
|
-
* completion excludes it from the local decrement. Absent on payloads that
|
|
380
|
-
* predate Dynamic Delivery.
|
|
381
|
-
*/
|
|
382
|
-
supplier_backed?: boolean;
|
|
383
|
-
quantity_min?: number;
|
|
384
|
-
quantity_max?: number;
|
|
385
|
-
quantityMin?: number;
|
|
386
|
-
quantityMax?: number;
|
|
387
|
-
image_id?: string | null;
|
|
388
|
-
imageId?: string | null;
|
|
389
|
-
cloudflare_image_id?: string | null;
|
|
390
|
-
cloudflareImageId?: string | null;
|
|
391
|
-
image_url?: string | null;
|
|
392
|
-
imageUrl?: string | null;
|
|
393
|
-
/** Merchant-selected storefront highlight. It does not affect selection or availability. */
|
|
394
|
-
is_featured?: boolean;
|
|
395
|
-
isFeatured?: boolean;
|
|
396
|
-
/** License validity in days for this option. Zero means lifetime. */
|
|
397
|
-
license_period?: number | null;
|
|
398
|
-
}
|
|
399
|
-
export interface CustomFieldDefinition {
|
|
400
|
-
id: string;
|
|
401
|
-
name: string;
|
|
402
|
-
type: 'text' | 'textarea' | 'select' | 'checkbox';
|
|
403
|
-
required?: boolean;
|
|
404
|
-
options?: string[];
|
|
405
|
-
}
|
|
406
|
-
export interface Feedback {
|
|
407
|
-
id: string;
|
|
408
|
-
rating: number;
|
|
409
|
-
score?: number;
|
|
410
|
-
author?: string;
|
|
411
|
-
customer_name?: string;
|
|
412
|
-
comment?: string;
|
|
413
|
-
message?: string | null;
|
|
414
|
-
reply?: string | null;
|
|
415
|
-
is_automated?: boolean;
|
|
416
|
-
isAutomated?: boolean;
|
|
417
|
-
product_id?: string | null;
|
|
418
|
-
product_title?: string | null;
|
|
419
|
-
cloudflare_image_id?: string | null;
|
|
420
|
-
created_at: string;
|
|
421
|
-
updated_at?: string | number | null;
|
|
422
|
-
}
|
|
423
|
-
export interface ShopReviewsSummary {
|
|
424
|
-
total: number;
|
|
425
|
-
positive: number;
|
|
426
|
-
neutral: number;
|
|
427
|
-
negative: number;
|
|
428
|
-
average_score: number | null;
|
|
429
|
-
}
|
|
430
|
-
export interface ShopReviewsPage {
|
|
431
|
-
feedback: Feedback[];
|
|
432
|
-
pagination: CursorPagination;
|
|
433
|
-
summary: ShopReviewsSummary;
|
|
434
|
-
}
|
|
435
|
-
export interface ProductBundle {
|
|
436
|
-
id?: string;
|
|
437
|
-
uniqid?: string;
|
|
438
|
-
title?: string;
|
|
439
|
-
discount_type?: 'PERCENTAGE' | 'FIXED';
|
|
440
|
-
discount_amount?: number;
|
|
441
|
-
products?: ProductBundleProduct[];
|
|
442
|
-
}
|
|
443
|
-
export interface ProductBundleProduct {
|
|
444
|
-
id?: string;
|
|
445
|
-
uniqid: string;
|
|
446
|
-
title?: string | null;
|
|
447
|
-
default_variant_id?: string;
|
|
448
|
-
}
|
|
449
|
-
export interface ProductFaq {
|
|
450
|
-
id?: string;
|
|
451
|
-
uniqid?: string;
|
|
452
|
-
question: string;
|
|
453
|
-
answer: string;
|
|
454
|
-
}
|
|
455
|
-
export interface SubscriptionInterval {
|
|
456
|
-
unit?: string;
|
|
457
|
-
count?: number;
|
|
458
|
-
label?: string;
|
|
459
|
-
}
|
|
460
|
-
export interface SubscriptionFlags {
|
|
461
|
-
cancel_anytime?: boolean;
|
|
462
|
-
}
|
|
463
|
-
export interface Subscription {
|
|
464
|
-
id?: string;
|
|
465
|
-
name?: string;
|
|
466
|
-
description?: string;
|
|
467
|
-
badge?: string;
|
|
468
|
-
interval?: SubscriptionInterval;
|
|
469
|
-
flags?: SubscriptionFlags;
|
|
470
|
-
}
|
|
471
|
-
export interface Invoice {
|
|
472
|
-
uniqid: string;
|
|
473
|
-
status: string;
|
|
474
|
-
total: number;
|
|
475
|
-
currency: string;
|
|
476
|
-
gateway?: string;
|
|
477
|
-
products: InvoiceProduct[];
|
|
478
|
-
created_at: string;
|
|
479
|
-
rewards?: BuyerRewards | null;
|
|
480
|
-
}
|
|
481
|
-
export interface InvoiceProduct {
|
|
482
|
-
product_id: string;
|
|
483
|
-
title: string;
|
|
484
|
-
quantity: number;
|
|
485
|
-
price: number;
|
|
486
|
-
}
|
|
487
|
-
export type RewardActionType = 'WALLET_CREDIT' | 'COUPON';
|
|
488
|
-
export type RewardGrantStatus = 'PENDING' | 'FULFILLED' | 'FAILED' | 'REVOKED';
|
|
489
|
-
export type RewardReason = 'ORDER_COMPLETED' | 'ORDER_COUNT_REACHED' | 'SPEND_AMOUNT_REACHED' | 'POSITIVE_REVIEW_LEFT' | 'FIRST_PURCHASE_COMPLETED';
|
|
490
|
-
export interface BuyerRewardActivityItem {
|
|
491
|
-
id: string;
|
|
492
|
-
type: RewardActionType;
|
|
493
|
-
status: RewardGrantStatus;
|
|
494
|
-
amount: string | null;
|
|
495
|
-
currency: string | null;
|
|
496
|
-
coupon_code: string | null;
|
|
497
|
-
reason: RewardReason;
|
|
498
|
-
trigger_reference_type: string;
|
|
499
|
-
trigger_reference_id: string;
|
|
500
|
-
created_at: number;
|
|
501
|
-
fulfilled_at: number | null;
|
|
502
|
-
expires_at: number | null;
|
|
503
|
-
}
|
|
504
|
-
export interface BuyerRewards {
|
|
505
|
-
summary: {
|
|
506
|
-
available: string;
|
|
507
|
-
pending: string;
|
|
508
|
-
lifetime_earned: string;
|
|
509
|
-
redeemed: string | null;
|
|
510
|
-
currency: string;
|
|
511
|
-
};
|
|
512
|
-
activity: BuyerRewardActivityItem[];
|
|
513
|
-
earned_after_invoice: BuyerRewardActivityItem[];
|
|
514
|
-
pending_after_invoice: BuyerRewardActivityItem[];
|
|
515
|
-
}
|
|
516
|
-
export interface CouponValidation {
|
|
517
|
-
valid: boolean;
|
|
518
|
-
discount?: number;
|
|
519
|
-
discount_type?: 'percentage' | 'fixed';
|
|
520
|
-
first_order_only?: boolean;
|
|
521
|
-
source?: 'COUPON' | 'AFFILIATE';
|
|
522
|
-
product_restricted?: boolean;
|
|
523
|
-
variant_restricted?: boolean;
|
|
524
|
-
restriction_scope?: 'all' | 'products' | 'variants' | 'products_and_variants';
|
|
525
|
-
allowed_product_ids?: string[];
|
|
526
|
-
allowed_variant_ids?: string[];
|
|
527
|
-
message?: string;
|
|
528
|
-
}
|
|
529
|
-
export interface CouponValidationOptions {
|
|
530
|
-
productId?: string;
|
|
531
|
-
variantId?: string;
|
|
532
|
-
}
|
|
533
|
-
export interface AffiliateValidation {
|
|
534
|
-
valid: boolean;
|
|
535
|
-
program_enabled?: boolean;
|
|
536
|
-
affiliate_code: string | null;
|
|
537
|
-
discount_active: boolean;
|
|
538
|
-
discount_percent: number;
|
|
539
|
-
message?: string;
|
|
540
|
-
}
|
|
541
|
-
export interface ProductGroup {
|
|
542
|
-
id?: string;
|
|
543
|
-
uniqid: string;
|
|
544
|
-
category_id?: string | null;
|
|
545
|
-
slug?: string | null;
|
|
546
|
-
name?: string | null;
|
|
547
|
-
title: string;
|
|
548
|
-
description?: string | null;
|
|
549
|
-
product_uniqids?: string[];
|
|
550
|
-
products_count?: number;
|
|
551
|
-
image_attachment?: string | null;
|
|
552
|
-
image_name?: string | null;
|
|
553
|
-
image_storage?: string | null;
|
|
554
|
-
cloudflare_image_id?: string | null;
|
|
555
|
-
cdn_image_url?: string | null;
|
|
556
|
-
sort_priority?: number | null;
|
|
557
|
-
}
|
|
558
|
-
export interface Category {
|
|
559
|
-
uniqid: string;
|
|
560
|
-
title: string;
|
|
561
|
-
description?: string | null;
|
|
562
|
-
image_attachment?: string | null;
|
|
563
|
-
image_name?: string | null;
|
|
564
|
-
image_storage?: string | null;
|
|
565
|
-
cloudflare_image_id?: string | null;
|
|
566
|
-
cdn_image_url?: string | null;
|
|
567
|
-
product_uniqids?: string[];
|
|
568
|
-
products_bound?: Product[];
|
|
569
|
-
products_count?: number;
|
|
570
|
-
groups_bound?: ProductGroup[];
|
|
571
|
-
groups_count?: number;
|
|
572
|
-
}
|
|
573
|
-
export interface CursorPagination {
|
|
574
|
-
next_cursor: string | null;
|
|
575
|
-
has_more: boolean;
|
|
576
|
-
}
|
|
577
|
-
export interface StorefrontAnnouncementBarAddon {
|
|
578
|
-
id: string;
|
|
579
|
-
type: 'announcement_bar';
|
|
580
|
-
slot: string;
|
|
581
|
-
component: 'announcement_bar';
|
|
582
|
-
sort_order: number;
|
|
583
|
-
props: {
|
|
584
|
-
addon_id: string;
|
|
585
|
-
text: string;
|
|
586
|
-
link_label?: string | null;
|
|
587
|
-
link_url?: string | null;
|
|
588
|
-
dismissible: boolean;
|
|
589
|
-
display_mode: 'static' | 'marquee';
|
|
590
|
-
theme_preset: 'brand_blue' | 'emerald' | 'sunset' | 'rose' | 'charcoal' | 'custom';
|
|
591
|
-
animation_speed_seconds: number;
|
|
592
|
-
background_color: string;
|
|
593
|
-
text_color: string;
|
|
594
|
-
};
|
|
595
|
-
}
|
|
596
|
-
export interface StorefrontCountdownBarAddon {
|
|
597
|
-
id: string;
|
|
598
|
-
type: 'countdown_bar';
|
|
599
|
-
slot: string;
|
|
600
|
-
component: 'countdown_bar';
|
|
601
|
-
sort_order: number;
|
|
602
|
-
props: {
|
|
603
|
-
addon_id: string;
|
|
604
|
-
text: string;
|
|
605
|
-
end_at: string;
|
|
606
|
-
link_label?: string | null;
|
|
607
|
-
link_url?: string | null;
|
|
608
|
-
dismissible: boolean;
|
|
609
|
-
theme_preset: 'brand_blue' | 'emerald' | 'sunset' | 'rose' | 'charcoal' | 'custom';
|
|
610
|
-
expired_behavior: 'hide' | 'message';
|
|
611
|
-
expired_message?: string | null;
|
|
612
|
-
density: 'compact' | 'comfortable';
|
|
613
|
-
cta_style: 'subtle' | 'outline' | 'solid';
|
|
614
|
-
timer_style: 'minimal' | 'boxed';
|
|
615
|
-
background_color: string;
|
|
616
|
-
text_color: string;
|
|
617
|
-
};
|
|
618
|
-
}
|
|
619
|
-
export interface StorefrontPromoInfoCardAddon {
|
|
620
|
-
id: string;
|
|
621
|
-
type: 'promo_info_card';
|
|
622
|
-
slot: string;
|
|
623
|
-
component: 'promo_info_card';
|
|
624
|
-
sort_order: number;
|
|
625
|
-
props: {
|
|
626
|
-
addon_id: string;
|
|
627
|
-
eyebrow?: string | null;
|
|
628
|
-
title: string;
|
|
629
|
-
body: string;
|
|
630
|
-
link_label?: string | null;
|
|
631
|
-
link_url?: string | null;
|
|
632
|
-
theme_preset: 'indigo' | 'emerald' | 'amber' | 'rose' | 'slate' | 'custom';
|
|
633
|
-
layout_style: 'compact' | 'feature' | 'alert';
|
|
634
|
-
density: 'compact' | 'comfortable';
|
|
635
|
-
cta_style: 'subtle' | 'outline' | 'solid';
|
|
636
|
-
icon: 'sparkles' | 'megaphone' | 'gift' | 'truck' | 'shield' | 'support' | 'none';
|
|
637
|
-
icon_visibility: 'show' | 'hide';
|
|
638
|
-
background_color: string;
|
|
639
|
-
text_color: string;
|
|
640
|
-
accent_color: string;
|
|
641
|
-
};
|
|
642
|
-
}
|
|
643
|
-
export interface StorefrontRecentPurchasePopupAddon {
|
|
644
|
-
id: string;
|
|
645
|
-
type: 'recent_purchase_popup';
|
|
646
|
-
slot: string;
|
|
647
|
-
component: 'recent_purchase_popup';
|
|
648
|
-
sort_order: number;
|
|
649
|
-
props: {
|
|
650
|
-
addon_id: string;
|
|
651
|
-
title: string;
|
|
652
|
-
cooldown_seconds: number;
|
|
653
|
-
items: Array<{
|
|
654
|
-
customer_label: string;
|
|
655
|
-
product_title: string;
|
|
656
|
-
created_at: string;
|
|
657
|
-
}>;
|
|
658
|
-
};
|
|
659
|
-
}
|
|
660
|
-
export interface StorefrontCouponPopupModalAddon {
|
|
661
|
-
id: string;
|
|
662
|
-
type: 'coupon_popup_modal';
|
|
663
|
-
slot: string;
|
|
664
|
-
component: 'coupon_popup_modal';
|
|
665
|
-
sort_order: number;
|
|
666
|
-
props: {
|
|
667
|
-
addon_id: string;
|
|
668
|
-
eyebrow?: string | null;
|
|
669
|
-
title: string;
|
|
670
|
-
body: string;
|
|
671
|
-
coupon_code: string;
|
|
672
|
-
primary_button_label: string;
|
|
673
|
-
secondary_button_label: string;
|
|
674
|
-
disclaimer?: string | null;
|
|
675
|
-
theme_preset: 'midnight' | 'ocean' | 'ember' | 'forest' | 'custom';
|
|
676
|
-
trigger: 'delay' | 'exit_intent';
|
|
677
|
-
delay_seconds: number;
|
|
678
|
-
show_once_per_session: boolean;
|
|
679
|
-
reminder_hours: number;
|
|
680
|
-
background_color: string;
|
|
681
|
-
text_color: string;
|
|
682
|
-
accent_color: string;
|
|
683
|
-
hero_image_url?: string | null;
|
|
684
|
-
discount_display?: string | null;
|
|
685
|
-
expires_at?: string | null;
|
|
686
|
-
};
|
|
687
|
-
}
|
|
688
|
-
export type StorefrontAddon = StorefrontAnnouncementBarAddon | StorefrontCountdownBarAddon | StorefrontPromoInfoCardAddon | StorefrontRecentPurchasePopupAddon | StorefrontCouponPopupModalAddon;
|
|
689
|
-
export interface StorefrontAddonBootstrap {
|
|
690
|
-
items: StorefrontAddon[];
|
|
691
|
-
}
|
|
692
|
-
export interface StorefrontOnlineUsers {
|
|
693
|
-
count: number;
|
|
694
|
-
window_seconds: number;
|
|
695
|
-
}
|
|
696
|
-
export interface StorefrontRecentSaleEntry {
|
|
697
|
-
product_title: string;
|
|
698
|
-
seconds_ago: number;
|
|
699
|
-
}
|
|
700
|
-
export interface StorefrontRecentSales {
|
|
701
|
-
items: StorefrontRecentSaleEntry[];
|
|
702
|
-
window_hours: number;
|
|
703
|
-
}
|
|
704
|
-
export type StorefrontItem = {
|
|
705
|
-
item_type: 'PRODUCT' | 'GROUP';
|
|
706
|
-
uniqid: string;
|
|
707
|
-
sort_priority?: number | null;
|
|
708
|
-
title?: string | null;
|
|
709
|
-
};
|
|
710
|
-
export interface StorefrontData {
|
|
711
|
-
shop: Shop;
|
|
712
|
-
products: Product[];
|
|
713
|
-
products_pagination?: CursorPagination | null;
|
|
714
|
-
groups: ProductGroup[];
|
|
715
|
-
items: StorefrontItem[];
|
|
716
|
-
categories: Category[];
|
|
717
|
-
addons: StorefrontAddonBootstrap;
|
|
718
|
-
}
|
|
719
|
-
export interface Page {
|
|
720
|
-
id: string;
|
|
721
|
-
shop_id?: string;
|
|
722
|
-
slug: string;
|
|
723
|
-
name: string;
|
|
724
|
-
content: string | null;
|
|
725
|
-
template_type: string;
|
|
726
|
-
is_system: boolean;
|
|
727
|
-
settings: Record<string, unknown> | null;
|
|
728
|
-
visible_after: string | null;
|
|
729
|
-
created_at: number;
|
|
730
|
-
updated_at: number;
|
|
731
|
-
}
|
|
732
|
-
export interface Menu {
|
|
733
|
-
id: string;
|
|
734
|
-
shop_id: string;
|
|
735
|
-
title: string;
|
|
736
|
-
slot?: NavigationMenuSlot | null;
|
|
737
|
-
item_count?: number | null;
|
|
738
|
-
items?: MenuItem[];
|
|
739
|
-
created_at: number;
|
|
740
|
-
updated_at: number;
|
|
741
|
-
}
|
|
742
|
-
export interface MenuItem {
|
|
743
|
-
id: string;
|
|
744
|
-
shop_id?: string;
|
|
745
|
-
menu_id: string;
|
|
746
|
-
page_id: string | null;
|
|
747
|
-
title: string;
|
|
748
|
-
url?: string | null;
|
|
749
|
-
link_type?: 'LINK' | 'PAGE' | 'link' | 'page' | null;
|
|
750
|
-
target?: '_self' | '_blank' | null;
|
|
751
|
-
sort_order: number;
|
|
752
|
-
page_slug: string | null;
|
|
753
|
-
created_at: number;
|
|
754
|
-
updated_at: number;
|
|
755
|
-
children?: MenuItem[];
|
|
756
|
-
}
|
|
757
|
-
//# sourceMappingURL=api.d.ts.map
|