@shoppexio/storefront 1.0.92 → 1.0.94

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/dist/index.d.ts CHANGED
@@ -1,10 +1,27 @@
1
- import { createApiClient } from '@shoppex/contracts/api-client';
2
1
  import { NavigationMenuSlot } from '@shoppex/contracts/navigation';
3
2
  export { NavigationMenuSlot } from '@shoppex/contracts/navigation';
3
+ import { StorefrontDeliveryType } from '@shoppex/contracts/storefront-delivery-type';
4
4
  import * as src from 'src';
5
+ import { createApiClient } from '@shoppex/contracts/api-client';
5
6
  import { CustomerWarrantyClaimWire, CustomerPortalAffiliateCreateLinkWire, CustomerPortalDashboardWire, CustomerPortalPaginatedInvoicesWire, CustomerPortalInvoiceDetailWire, CustomerLoyaltyWire, CustomerLoyaltyRedeemWire, CustomerWarrantyListWire, CustomerPortalNotificationPreferencesWire } from '@shoppex/contracts/customer-account-wire';
6
7
  export { CATALOG_UNIT_PRICE_DECIMAL_PLACES, CATALOG_UNIT_PRICE_FORMAT_OPTIONS, PAYABLE_AMOUNT_DECIMAL_PLACES, roundPayableAmount } from '@shoppex/contracts/catalog-unit-price';
7
8
 
9
+ interface CacheStats {
10
+ hits: number;
11
+ misses: number;
12
+ pendingRequests: number;
13
+ entries: number;
14
+ }
15
+ declare function getCacheStats(): CacheStats;
16
+ declare function clearCache(): void;
17
+ declare function invalidateCache(prefixOrKey: string): void;
18
+
19
+ /**
20
+ * Formatting Utilities
21
+ */
22
+ declare function createFormatter(currency?: string, locale?: string): Intl.NumberFormat;
23
+ declare function formatPrice(amount: number | string, currency?: string, locale?: string): string;
24
+
8
25
  /**
9
26
  * SDK Configuration Types
10
27
  */
@@ -321,6 +338,8 @@ interface Product {
321
338
  bestseller?: boolean | number;
322
339
  type?: string;
323
340
  subtype?: string | null;
341
+ /** What the buyer receives, read off the delivery mechanism; null when the mechanism does not say. */
342
+ delivery_type?: StorefrontDeliveryType | null;
324
343
  isSubscription?: boolean;
325
344
  isGroup?: boolean;
326
345
  images: ProductImage[];
@@ -332,11 +351,18 @@ interface Product {
332
351
  soldCount?: number;
333
352
  variants?: ProductVariant[];
334
353
  addons?: ProductAddon[];
354
+ /**
355
+ * Buyers must pick one of `addons`: the server refuses a line that names none
356
+ * (`errors.checkout.addon_required`). Asks nothing when `addons` is empty.
357
+ */
358
+ addons_required?: boolean;
335
359
  price_variants?: PriceVariant[];
336
360
  volume_discounts?: unknown;
337
361
  custom_fields?: string | unknown[] | null;
338
362
  categories?: ProductCategory[];
339
363
  bundles?: ProductBundle[];
364
+ /** The merchant's upsell picks, as product uniqids in the merchant's order; empty when they picked none. */
365
+ upsell_product_ids?: string[];
340
366
  faqs?: ProductFaq[];
341
367
  subscription?: Subscription;
342
368
  feedbacks?: Feedback[];
@@ -425,6 +451,12 @@ interface ProductVariant {
425
451
  /** Merchant-selected storefront highlight. It does not affect selection or availability. */
426
452
  is_featured?: boolean;
427
453
  isFeatured?: boolean;
454
+ /**
455
+ * A private option, sold only through its direct link. The server lists it
456
+ * only on `getProduct(id, { variant })` naming it, never in product lists.
457
+ * Absent on servers older than private variants.
458
+ */
459
+ is_private?: boolean;
428
460
  /** License validity in days for this option. Zero means lifetime. */
429
461
  license_period?: number | null;
430
462
  }
@@ -481,6 +513,12 @@ interface PriceVariant {
481
513
  /** Merchant-selected storefront highlight. It does not affect selection or availability. */
482
514
  is_featured?: boolean;
483
515
  isFeatured?: boolean;
516
+ /**
517
+ * A private option, sold only through its direct link. The server lists it
518
+ * only on `getProduct(id, { variant })` naming it, never in product lists.
519
+ * Absent on servers older than private variants.
520
+ */
521
+ is_private?: boolean;
484
522
  /** License validity in days for this option. Zero means lifetime. */
485
523
  license_period?: number | null;
486
524
  }
@@ -976,6 +1014,11 @@ interface EligibleCartDeal {
976
1014
  label: string;
977
1015
  missing_quantity: number;
978
1016
  required_quantity: number;
1017
+ /** Units of `required_quantity` the deal discounts. */
1018
+ discounted_quantity: number;
1019
+ discount_type: 'PERCENTAGE' | 'FREE';
1020
+ /** The percent off those units as a 2-dp string; `"100.00"` for FREE. */
1021
+ discount_value: string;
979
1022
  }
980
1023
  interface EligibleBundleDealProduct {
981
1024
  product_id: string;
@@ -1133,102 +1176,30 @@ interface CartStats {
1133
1176
  }
1134
1177
 
1135
1178
  /**
1136
- * SDK Configuration Management
1137
- */
1138
-
1139
- declare function getConfig(): ShoppexConfig;
1140
- declare function isInitialized(): boolean;
1141
-
1142
- /**
1143
- * Typed OpenAPI client factory.
1144
- *
1145
- * Surfaces the generated `createApiClient` from `@shoppex/contracts` with the
1146
- * SDK's configured `apiBaseUrl`. This lets consumers of `@shoppexio/storefront`
1147
- * call any public Dev API endpoint with full end-to-end types without
1148
- * rebuilding a client from scratch.
1179
+ * Pages Module
1149
1180
  *
1150
- * Prefer the high-level modules (`shoppex.getProducts()` etc.) for common
1151
- * read flows — they handle caching, pagination defaults, and storefront
1152
- * scoping. Drop down to `shoppex.client()` only when you need an endpoint
1153
- * the high-level API does not cover yet.
1154
- */
1155
-
1156
- type ApiClient = ReturnType<typeof createApiClient>;
1157
- /**
1158
- * Return a typed OpenAPI client bound to the SDK's configured API base URL.
1159
- * The client is cached per base URL and recreated when the SDK is re-initialized
1160
- * against a different host.
1181
+ * API methods for public pages.
1161
1182
  */
1162
- declare function getTypedClient(token?: string): ApiClient;
1163
1183
 
1164
1184
  /**
1165
- * SDK Error Classes
1185
+ * Get all public pages for the store
1166
1186
  */
1187
+ declare function getPages(): Promise<SDKResponse<Page[]>>;
1167
1188
  /**
1168
- * `SDKResponse.code` of a priced read that asked for a currency the shop does
1169
- * not sell in (ADR-0066). `errorParams.requested` names the currency,
1170
- * `errorParams.available` lists the enabled ones.
1189
+ * Get a public page by slug
1171
1190
  */
1172
- declare const CURRENCY_UNAVAILABLE_ERROR_CODE = "errors.storefront.currency_unavailable";
1173
- declare class ShoppexError extends Error {
1174
- readonly code: string;
1175
- readonly statusCode?: number;
1176
- constructor(message: string, code: string, statusCode?: number);
1177
- }
1178
- declare class NotInitializedError extends ShoppexError {
1179
- constructor();
1180
- }
1181
- declare class NetworkError extends ShoppexError {
1182
- constructor(message: string, statusCode?: number);
1183
- }
1191
+ declare function getPage(slug: string): Promise<SDKResponse<Page>>;
1192
+
1184
1193
  /**
1185
- * A refusal the SERVER made and named. `code` is the backend's `error_code`
1186
- * (e.g. `errors.checkout.coupon_no_longer_valid`) — the branchable identity of
1187
- * the refusal, stable across locales, unlike the localized `message`.
1194
+ * Invoices Module
1188
1195
  *
1189
- * Distinct from {@link NetworkError}, whose `code` is always `NETWORK_ERROR`:
1190
- * that one means "the request did not produce a named answer".
1196
+ * Invoice status checking after payment.
1191
1197
  */
1192
- declare class ApiError extends ShoppexError {
1193
- readonly errorParams?: Record<string, unknown>;
1194
- constructor(message: string, code: string, statusCode?: number, errorParams?: Record<string, unknown>);
1195
- }
1196
- declare class ValidationError extends ShoppexError {
1197
- readonly invalidFields?: string[];
1198
- constructor(message: string, invalidFields?: string[]);
1199
- }
1200
- declare class CartError extends ShoppexError {
1201
- constructor(message: string);
1202
- }
1203
-
1204
- interface StorefrontCustomField {
1205
- name: string;
1206
- type: string;
1207
- required: boolean;
1208
- defaultValue: string;
1209
- placeholder: string;
1210
- regex?: string;
1211
- }
1212
- declare function normalizeStorefrontCustomFields(raw: unknown): StorefrontCustomField[];
1213
- declare function isStorefrontCheckboxCustomFieldValueChecked(value: string | undefined): boolean;
1214
- declare function validateStorefrontCustomFieldValue(field: StorefrontCustomField, value: string): string | null;
1215
- declare function buildStorefrontCustomFieldPayload(fields: StorefrontCustomField[], values: Record<string, string>): Record<string, string>;
1216
-
1217
- type VariantLike = Pick<ProductVariant, 'stock' | 'orderable' | 'supplier_backed'> | Pick<PriceVariant, 'stock' | 'orderable' | 'supplier_backed'>;
1218
- type ProductLike = Pick<Product, 'type' | 'stock' | 'orderable' | 'supplier_backed' | 'on_hold' | 'price_variants' | 'variants'> & {
1219
- onHold?: boolean | number | string | null;
1220
- is_on_hold?: boolean | number | string | null;
1221
- isOnHold?: boolean | number | string | null;
1222
- };
1223
- declare function resolveVariantStockValue(variant: VariantLike | null | undefined): number;
1224
- declare function resolveDisplayStock(product: ProductLike | null | undefined): number;
1225
- declare function isProductOutOfStock(product: ProductLike | null | undefined): boolean;
1226
- declare function isProductInStock(product: ProductLike | null | undefined): boolean;
1227
- declare function isVariantOutOfStock(variant: VariantLike | null | undefined): boolean;
1228
1198
 
1229
- declare function buildStorefrontProductLookup(products?: Product[]): Map<string, Product>;
1230
- declare function getStorefrontGroupProducts(group: ProductGroup, productsOrLookup?: Product[] | Map<string, Product>): Product[];
1231
- declare function getMergedStorefrontProducts(products?: Product[]): Product[];
1199
+ declare function getInvoice(invoiceId: string): Promise<SDKResponse<Invoice>>;
1200
+ declare function getInvoiceStatus(invoiceId: string): Promise<SDKResponse<{
1201
+ status: string;
1202
+ }>>;
1232
1203
 
1233
1204
  interface StorefrontSearchFilterOptions {
1234
1205
  hideOutOfStock?: boolean;
@@ -1251,269 +1222,121 @@ declare function filterProductsBySearchQuery(products: Product[], query: string,
1251
1222
  declare function searchMergedStorefrontCatalogItems(products: Product[], groups: ProductGroup[], query: string, options?: StorefrontSearchFilterOptions): StorefrontCatalogSearchItem[];
1252
1223
  declare function searchMergedStorefrontCatalog(products: Product[], groups: ProductGroup[], query: string, options?: StorefrontSearchFilterOptions): Product[];
1253
1224
 
1254
- type StorefrontContactTicketInput = {
1255
- shopSlug: string;
1256
- email: string;
1257
- message: string;
1258
- title?: string;
1259
- name?: string;
1260
- invoiceId?: string;
1261
- apiBaseUrl?: string;
1262
- };
1263
- type StorefrontContactTicketResult = {
1264
- uniqid: string;
1265
- };
1266
- declare function resolveStorefrontApiBaseUrl(options?: {
1267
- apiBaseUrl?: string;
1268
- hostname?: string;
1269
- }): string;
1270
- declare function buildStorefrontContactMessage(input: {
1271
- name?: string;
1272
- message: string;
1273
- maxLength?: number;
1274
- }): string;
1275
- declare function submitStorefrontContactTicket(input: StorefrontContactTicketInput): Promise<StorefrontContactTicketResult>;
1276
- type StorefrontSocialLinks = {
1277
- discord?: string | null;
1278
- telegram?: string | null;
1279
- };
1280
- declare function resolveStorefrontSocialLinks(store: {
1281
- discord_link?: string | null;
1282
- telegram_link?: string | null;
1283
- social?: Record<string, string | null | undefined> | null;
1284
- } | null | undefined): StorefrontSocialLinks;
1225
+ interface SearchOptions {
1226
+ hideOutOfStock?: boolean;
1227
+ maxResults?: number;
1228
+ }
1229
+
1230
+ declare function searchCatalogItems(query: string, options?: SearchOptions): Promise<SDKResponse<StorefrontCatalogSearchItem[]>>;
1231
+ declare function searchProducts(query: string, options?: SearchOptions): Promise<SDKResponse<Product[]>>;
1285
1232
 
1286
1233
  /**
1287
- * Theme configuration types (framework agnostic)
1234
+ * Reviews Module
1235
+ *
1236
+ * Shop-level feedback/reviews.
1237
+ * Note: Shoppex has shop-level feedback, not product-level reviews.
1288
1238
  */
1289
- type SettingFieldType = 'color' | 'text' | 'range' | 'select' | 'boolean' | 'image' | 'font' | 'richtext' | 'products' | 'images';
1290
- interface BaseSettingField {
1291
- type: SettingFieldType;
1292
- label: string;
1293
- description?: string;
1294
- }
1295
- interface ColorField extends BaseSettingField {
1296
- type: 'color';
1297
- default: string;
1298
- }
1299
- interface RangeField extends BaseSettingField {
1300
- type: 'range';
1301
- default: number;
1302
- min: number;
1303
- max: number;
1304
- step?: number;
1305
- unit?: string;
1306
- }
1307
- interface SelectField extends BaseSettingField {
1308
- type: 'select';
1309
- default: string;
1310
- options: string[] | {
1311
- value: string;
1312
- label: string;
1313
- }[];
1314
- }
1315
- interface BooleanField extends BaseSettingField {
1316
- type: 'boolean';
1317
- default: boolean;
1318
- }
1319
- interface TextField extends BaseSettingField {
1320
- type: 'text';
1321
- default: string;
1322
- }
1323
- interface ImageField extends BaseSettingField {
1324
- type: 'image';
1325
- default: string | null;
1326
- }
1327
- interface FontField extends BaseSettingField {
1328
- type: 'font';
1329
- default: string;
1330
- options?: string[];
1331
- }
1332
- interface RichtextField extends BaseSettingField {
1333
- type: 'richtext';
1334
- default: string;
1335
- }
1336
- interface ProductsField extends BaseSettingField {
1337
- type: 'products';
1338
- default: string[];
1339
- max?: number;
1340
- }
1341
- interface ImagesField extends BaseSettingField {
1342
- type: 'images';
1343
- default: string[];
1344
- max?: number;
1345
- }
1346
- type SettingField = ColorField | RangeField | SelectField | BooleanField | TextField | ImageField | FontField | RichtextField | ProductsField | ImagesField;
1347
- interface SectionDefinition {
1348
- name: string;
1349
- description?: string;
1350
- icon?: string;
1351
- settings: Record<string, SettingField>;
1352
- }
1353
- interface BlockDefinition {
1354
- name: string;
1355
- description?: string;
1356
- icon?: string;
1357
- settings: Record<string, SettingField>;
1358
- allowedPages?: string[];
1359
- maxPerPage?: number;
1360
- }
1361
- interface BlockInstance {
1362
- id: string;
1363
- type: string;
1364
- visible?: boolean;
1365
- settings?: Record<string, SettingValue>;
1366
- }
1367
- interface PageLayout {
1368
- blocks: BlockInstance[];
1239
+
1240
+ /** `code` of a filtered request the API answered without applying the filter. */
1241
+ declare const PRODUCT_FILTER_UNSUPPORTED = "reviews_product_filter_unsupported";
1242
+ interface ShopReviewsPageOptions {
1243
+ /**
1244
+ * One product's reviews, by the product's public id (the `id` the catalog
1245
+ * carries). The page's `summary` then counts that product's reviews only.
1246
+ */
1247
+ product?: string | null;
1369
1248
  }
1370
- interface ThemeBlockManifest {
1371
- pages: string[];
1372
- blocks: Record<string, BlockDefinition>;
1373
- defaultLayouts?: Record<string, PageLayout>;
1374
- }
1375
- interface ThemeConfig {
1376
- id: string;
1377
- name: string;
1378
- description?: string;
1379
- version: string;
1380
- author?: string;
1381
- preview?: string;
1382
- settings: Record<string, Record<string, SettingField>>;
1383
- sections: Record<string, SectionDefinition>;
1384
- blocks?: Record<string, BlockDefinition>;
1385
- pageLayouts?: Record<string, PageLayout>;
1386
- builder?: ThemeBlockManifest;
1387
- }
1388
- type SettingValue = string | number | boolean | null | string[] | Record<string, unknown>;
1389
- type ResolvedThemeSettings = {
1390
- [Category: string]: {
1391
- [Key: string]: SettingValue;
1392
- };
1393
- };
1394
-
1395
- type JsonRecord = Record<string, unknown>;
1396
- interface PublishedBuilderSettings {
1397
- version: number;
1398
- revision: number;
1399
- theme: {
1400
- content: JsonRecord;
1401
- layout: JsonRecord;
1402
- style_slots: JsonRecord;
1403
- pages?: unknown[];
1404
- terms?: JsonRecord;
1405
- [key: string]: unknown;
1406
- };
1407
- [key: string]: unknown;
1408
- }
1409
- interface PublishedThemeSettingsPayload {
1410
- settings: ResolvedThemeSettings;
1411
- builder_settings: PublishedBuilderSettings | null;
1412
- content: JsonRecord;
1413
- style_slots: JsonRecord;
1414
- }
1415
- declare function fetchPublishedBuilderSettings(shopSlug: string): Promise<PublishedThemeSettingsPayload | null>;
1416
- declare function fetchPublishedThemeSettings(shopSlug: string): Promise<ResolvedThemeSettings | null>;
1417
- declare function resolveDefaults(config: ThemeConfig): ResolvedThemeSettings;
1418
- declare function mergeSettings(defaults: ResolvedThemeSettings, overrides: Partial<ResolvedThemeSettings>): ResolvedThemeSettings;
1249
+ declare function getShopReviewsPage(cursor?: string | null, options?: ShopReviewsPageOptions): Promise<SDKResponse<ShopReviewsPage>>;
1250
+ declare function getShopReviews(): Promise<SDKResponse<Feedback[]>>;
1419
1251
 
1420
1252
  /**
1421
- * Store Module
1253
+ * Coupons Module
1422
1254
  *
1423
- * API methods for store data.
1255
+ * Coupon validation before checkout.
1424
1256
  */
1425
1257
 
1426
- interface GetStorefrontOptions {
1427
- productsLimit?: number;
1428
- productsCursor?: string | null;
1429
- }
1430
- declare function getStore(): Promise<SDKResponse<Shop>>;
1431
- declare function resolveStoreByDomain(domain?: string, apiBaseUrl?: string): Promise<SDKResponse<Shop>>;
1432
- declare function getStorefront(options?: GetStorefrontOptions): Promise<SDKResponse<StorefrontData>>;
1433
- declare function getStoreLogoUrl(): Promise<string | null>;
1434
- declare function getStoreBannerUrl(): Promise<string | null>;
1258
+ declare function validateCoupon(code: string, productOrOptions?: string | CouponValidationOptions): Promise<SDKResponse<CouponValidation>>;
1435
1259
 
1260
+ type AffiliateAttributionMode = 'LAST_CLICK' | 'FIRST_CLICK';
1261
+ declare function setAffiliateCode(code: string | null | undefined, ttlDays?: number, mode?: AffiliateAttributionMode): string | null;
1436
1262
  /**
1437
- * Products Module
1263
+ * The stored attribution, or null when nothing valid is held.
1438
1264
  *
1439
- * API methods for product data.
1265
+ * Unlike `getAffiliateCode()` this also reports the mode the entry was written
1266
+ * under, which is what `captureAffiliateFromUrl` needs BEFORE it decides
1267
+ * whether it may overwrite.
1440
1268
  */
1441
-
1442
- interface GetStorefrontProductsPageOptions {
1443
- cursor?: string | null;
1444
- limit?: number;
1445
- sort?: 'featured' | 'newest' | 'price-asc' | 'price-desc' | string | null;
1446
- category?: string | null;
1447
- hideOutOfStock?: boolean;
1448
- }
1449
- declare function getProducts(): Promise<SDKResponse<Product[]>>;
1450
- declare function getStorefrontProductsPage(options?: GetStorefrontProductsPageOptions): Promise<SDKResponse<{
1451
- products: Product[];
1452
- pagination: CursorPagination | null;
1453
- }>>;
1454
- declare function getProduct(idOrSlug: string): Promise<SDKResponse<Product>>;
1455
- declare function getCategories(): Promise<SDKResponse<string[]>>;
1456
-
1457
- declare function getCartCoupon(): string | null;
1458
- declare function getCartCouponSource(): CartCodeSource | null;
1459
- declare function setCartCoupon(coupon: string | null | undefined, source?: CartCodeSource): string | null;
1460
- declare function clearCartCoupon(): void;
1461
- declare function getCart(): CartItem[];
1462
- /** Resolve a cart line_id for product+variant. When multiple configs exist, returns the first line. */
1463
- declare function resolveCartLineId(productId: string, variantId: string, cart?: CartItem[]): string;
1464
- declare function getCartItemCount(): number;
1465
- declare function addToCart(productId: string, variantId: string, quantity?: number, options?: CartAddOptions): void;
1466
- declare function setCartItem(productId: string, variantId: string, quantity?: number, options?: CartAddOptions): void;
1269
+ declare function getStoredAffiliate(): {
1270
+ code: string;
1271
+ mode: AffiliateAttributionMode;
1272
+ windowDays: number;
1273
+ /**
1274
+ * When this entry expires, as written. Reported so a hold that has to be put
1275
+ * back after an early overwrite keeps its original expiry — the window runs
1276
+ * from the click that earned it, not from the landing that failed to take it.
1277
+ */
1278
+ expiresAt: number;
1279
+ } | null;
1280
+ declare function clearAffiliateCode(): void;
1281
+ declare function getAffiliateCode(): string | null;
1282
+ declare function trackAffiliateEvent(eventType: 'add_to_cart' | 'checkout_started', options?: {
1283
+ /**
1284
+ * The code the surrounding call actually resolved and submitted (e.g.
1285
+ * checkout()'s tri-state result). `null` means the caller explicitly
1286
+ * submitted WITHOUT a referral — no event is recorded, so an ambient
1287
+ * stored code is never credited for a sale it did not get. Omit the
1288
+ * options object entirely to attribute to the stored ambient code.
1289
+ */
1290
+ code: string | null;
1291
+ /**
1292
+ * Overrides the per-browser-session dedupe key. checkout entry points
1293
+ * pass `inv:<invoiceId>` so every created invoice counts as exactly one
1294
+ * checkout — a session-wide key would drop the second checkout of a
1295
+ * buyer who orders twice in one session while both sales still count.
1296
+ */
1297
+ dedupeKey?: string;
1298
+ }): Promise<void>;
1299
+ declare function validateAffiliateCode(code: string): Promise<SDKResponse<AffiliateValidation>>;
1467
1300
  /**
1468
- * Patch one cart line.
1301
+ * Validate a manually entered code and store it (ADR-0067).
1469
1302
  *
1470
- * TRI-STATE BOUNDS: `min_quantity`/`max_quantity` accept `null` to DELETE the
1471
- * stored bound — see {@link CartItemUpdate}. `undefined` (or an absent key)
1472
- * leaves it alone, which is why a removed ceiling needs its own spelling.
1303
+ * Attribution is governed by the same rules as a `?ref=` landing, deliberately:
1304
+ * a themed "apply code" box must not be a way around first-click, or the rule
1305
+ * is bypassed by any storefront that offers one. So a still-protected hold
1306
+ * keeps the sale, and the stored entry always carries the mode and window the
1307
+ * server just reported — the old unconditional `setAffiliateCode(code)` wrote
1308
+ * a 30-day last-click entry whatever the shop or tier had configured.
1473
1309
  *
1474
- * NO-OP UPDATES DO NOT WRITE. An update that leaves the cart byte-identical
1475
- * returns without touching storage: no metadata bump, no `version` increment,
1476
- * and — because the storage write is what other tabs observe — no `storage`
1477
- * event. Writing anyway made an ineffective heal indistinguishable from a real
1478
- * cart change, and two tabs healing the same line could hand the event back and
1479
- * forth indefinitely. Line-shape healing of a legacy stored row is NOT this
1480
- * function's job: `normalizeCartItems` clamps and repairs on every READ, which
1481
- * is the chokepoint every access already flows through.
1310
+ * The result reports what is now ATTRIBUTED, not merely what was validated:
1311
+ * `affiliate_code` carries the winning code and `applied` says whether that is
1312
+ * the one you passed. The documented integration hands `affiliate_code`
1313
+ * straight to `checkout({ affiliateCode })`, and an explicit checkout code
1314
+ * overrides storage — so returning the losing code here would credit it and
1315
+ * walk right around the hold this function just honoured.
1482
1316
  */
1483
- declare function updateCartItem(lineId: string, updates: CartItemUpdate): void;
1484
- declare function removeFromCart(lineId: string): void;
1317
+ declare function applyAffiliateCode(code: string): Promise<SDKResponse<AffiliateValidation>>;
1485
1318
  /**
1486
- * Discards the cart entirely — and with it the proof that describes it.
1319
+ * Capture an affiliate code from the current URL and store it (ADR-0067).
1487
1320
  *
1488
- * PAYMENT PATH. `latestQuoteToken` is evidence about a specific cart, and this
1489
- * is the one mutation after which that cart does not exist in any form. Held
1490
- * across the clear, the proof outlives its subject: a caller that clears and
1491
- * re-adds (Buy Now REPLACES the cart) hands `/from-cart` a token bound to the
1492
- * previous cart's hash, which is refused as `quote_token_stale` — a hand-off
1493
- * dead-ended by a proof nobody asked for. And with no re-quote in between there
1494
- * is nothing to replace it with, so the retry is refused identically.
1321
+ * Example:
1322
+ * - URL: https://mystore.com/product/abc?ref=deadbeef
1323
+ * - captureAffiliateFromUrl() stores "deadbeef" and returns it.
1495
1324
  *
1496
- * Only this path clears it. Every OTHER mutation turns one cart into another
1497
- * cart, where a proof that no longer matches is the server's to refuse: it
1498
- * answers `quote_token_stale`, the surfaces re-quote, and the buyer approves the
1499
- * new total. Dropping the proof there instead would silently remove the approved
1500
- * -total ceiling from a checkout that raced the re-quote, which is the failure
1501
- * the token exists to prevent.
1325
+ * Under LAST_CLICK (the default, and the only behaviour before ADR-0067) a new
1326
+ * `?ref=` replaces whatever was stored. Under FIRST_CLICK an existing,
1327
+ * unexpired attribution wins and the new code is NOT stored — the landing is
1328
+ * still reported to the server so the affiliate's click statistics stay
1329
+ * honest, but the credit stays with whoever was there first.
1330
+ *
1331
+ * The mode comes from the server, which means the FIRST landing in a browser
1332
+ * can never be blocked by it — correct, because there is nothing to protect
1333
+ * yet. From then on the mode travels with the stored entry.
1334
+ *
1335
+ * Enforcement is client-side. A buyer who edits localStorage can re-attribute
1336
+ * their own visit; this is the same trust level as the window itself and must
1337
+ * not be presented to merchants as fraud protection.
1502
1338
  */
1503
- declare function clearCart(): void;
1504
- declare function createCartBackup(): void;
1505
- declare function restoreCartFromBackup(): boolean;
1506
- declare function mergeBaskets(items: CartBasketMergeLine[]): CartItem[];
1507
- declare function moveBasketItem(fromProductId: string, fromVariantId: string, toProductId: string, toVariantId: string): void;
1508
- declare function validateCartIntegrity(): boolean;
1509
- declare function getCartStats(): CartStats;
1510
- /** @internal — read by checkout(); exported only across module boundaries. */
1511
- declare function getLatestQuoteToken(): string | null;
1512
- declare function quoteCart(coupon?: string, currency?: string): Promise<src.SDKResponse<CartQuote>>;
1513
-
1514
- type CartLineIdentityInput = Pick<CartItem, 'product_id' | 'variant_id' | 'price_variant_id' | 'addons' | 'custom_fields' | 'price_data' | 'pay_what_you_want_price'>;
1515
- declare function computeCartLineId(input: CartLineIdentityInput): string;
1516
- declare function ensureCartLineId(item: CartItem): CartItem;
1339
+ declare function captureAffiliateFromUrl(param?: string): Promise<string | null>;
1517
1340
 
1518
1341
  /**
1519
1342
  * Checkout Module
@@ -1652,121 +1475,376 @@ declare function buildCheckoutUrl(couponOrOptions?: string | CheckoutOptions, op
1652
1475
  */
1653
1476
  declare function buildCheckoutUrlSync(): never;
1654
1477
 
1655
- interface SearchOptions {
1656
- hideOutOfStock?: boolean;
1657
- maxResults?: number;
1658
- }
1659
-
1660
- declare function searchCatalogItems(query: string, options?: SearchOptions): Promise<SDKResponse<StorefrontCatalogSearchItem[]>>;
1661
- declare function searchProducts(query: string, options?: SearchOptions): Promise<SDKResponse<Product[]>>;
1662
-
1663
- type AffiliateAttributionMode = 'LAST_CLICK' | 'FIRST_CLICK';
1664
- declare function setAffiliateCode(code: string | null | undefined, ttlDays?: number, mode?: AffiliateAttributionMode): string | null;
1478
+ declare function getCartCoupon(): string | null;
1479
+ declare function getCartCouponSource(): CartCodeSource | null;
1480
+ declare function setCartCoupon(coupon: string | null | undefined, source?: CartCodeSource): string | null;
1481
+ declare function clearCartCoupon(): void;
1482
+ declare function getCart(): CartItem[];
1483
+ /** Resolve a cart line_id for product+variant. When multiple configs exist, returns the first line. */
1484
+ declare function resolveCartLineId(productId: string, variantId: string, cart?: CartItem[]): string;
1485
+ declare function getCartItemCount(): number;
1486
+ declare function addToCart(productId: string, variantId: string, quantity?: number, options?: CartAddOptions): void;
1487
+ declare function setCartItem(productId: string, variantId: string, quantity?: number, options?: CartAddOptions): void;
1665
1488
  /**
1666
- * The stored attribution, or null when nothing valid is held.
1489
+ * Patch one cart line.
1667
1490
  *
1668
- * Unlike `getAffiliateCode()` this also reports the mode the entry was written
1669
- * under, which is what `captureAffiliateFromUrl` needs BEFORE it decides
1670
- * whether it may overwrite.
1491
+ * TRI-STATE BOUNDS: `min_quantity`/`max_quantity` accept `null` to DELETE the
1492
+ * stored bound — see {@link CartItemUpdate}. `undefined` (or an absent key)
1493
+ * leaves it alone, which is why a removed ceiling needs its own spelling.
1494
+ *
1495
+ * NO-OP UPDATES DO NOT WRITE. An update that leaves the cart byte-identical
1496
+ * returns without touching storage: no metadata bump, no `version` increment,
1497
+ * and — because the storage write is what other tabs observe — no `storage`
1498
+ * event. Writing anyway made an ineffective heal indistinguishable from a real
1499
+ * cart change, and two tabs healing the same line could hand the event back and
1500
+ * forth indefinitely. Line-shape healing of a legacy stored row is NOT this
1501
+ * function's job: `normalizeCartItems` clamps and repairs on every READ, which
1502
+ * is the chokepoint every access already flows through.
1671
1503
  */
1672
- declare function getStoredAffiliate(): {
1673
- code: string;
1674
- mode: AffiliateAttributionMode;
1675
- windowDays: number;
1676
- /**
1677
- * When this entry expires, as written. Reported so a hold that has to be put
1678
- * back after an early overwrite keeps its original expiry — the window runs
1679
- * from the click that earned it, not from the landing that failed to take it.
1680
- */
1681
- expiresAt: number;
1682
- } | null;
1683
- declare function clearAffiliateCode(): void;
1684
- declare function getAffiliateCode(): string | null;
1685
- declare function trackAffiliateEvent(eventType: 'add_to_cart' | 'checkout_started', options?: {
1686
- /**
1687
- * The code the surrounding call actually resolved and submitted (e.g.
1688
- * checkout()'s tri-state result). `null` means the caller explicitly
1689
- * submitted WITHOUT a referral — no event is recorded, so an ambient
1690
- * stored code is never credited for a sale it did not get. Omit the
1691
- * options object entirely to attribute to the stored ambient code.
1692
- */
1693
- code: string | null;
1694
- /**
1695
- * Overrides the per-browser-session dedupe key. checkout entry points
1696
- * pass `inv:<invoiceId>` so every created invoice counts as exactly one
1697
- * checkout — a session-wide key would drop the second checkout of a
1698
- * buyer who orders twice in one session while both sales still count.
1699
- */
1700
- dedupeKey?: string;
1701
- }): Promise<void>;
1702
- declare function validateAffiliateCode(code: string): Promise<SDKResponse<AffiliateValidation>>;
1504
+ declare function updateCartItem(lineId: string, updates: CartItemUpdate): void;
1505
+ declare function removeFromCart(lineId: string): void;
1703
1506
  /**
1704
- * Validate a manually entered code and store it (ADR-0067).
1507
+ * Discards the cart entirely — and with it the proof that describes it.
1705
1508
  *
1706
- * Attribution is governed by the same rules as a `?ref=` landing, deliberately:
1707
- * a themed "apply code" box must not be a way around first-click, or the rule
1708
- * is bypassed by any storefront that offers one. So a still-protected hold
1709
- * keeps the sale, and the stored entry always carries the mode and window the
1710
- * server just reported — the old unconditional `setAffiliateCode(code)` wrote
1711
- * a 30-day last-click entry whatever the shop or tier had configured.
1509
+ * PAYMENT PATH. `latestQuoteToken` is evidence about a specific cart, and this
1510
+ * is the one mutation after which that cart does not exist in any form. Held
1511
+ * across the clear, the proof outlives its subject: a caller that clears and
1512
+ * re-adds (Buy Now REPLACES the cart) hands `/from-cart` a token bound to the
1513
+ * previous cart's hash, which is refused as `quote_token_stale` — a hand-off
1514
+ * dead-ended by a proof nobody asked for. And with no re-quote in between there
1515
+ * is nothing to replace it with, so the retry is refused identically.
1712
1516
  *
1713
- * The result reports what is now ATTRIBUTED, not merely what was validated:
1714
- * `affiliate_code` carries the winning code and `applied` says whether that is
1715
- * the one you passed. The documented integration hands `affiliate_code`
1716
- * straight to `checkout({ affiliateCode })`, and an explicit checkout code
1717
- * overrides storage — so returning the losing code here would credit it and
1718
- * walk right around the hold this function just honoured.
1517
+ * Only this path clears it. Every OTHER mutation turns one cart into another
1518
+ * cart, where a proof that no longer matches is the server's to refuse: it
1519
+ * answers `quote_token_stale`, the surfaces re-quote, and the buyer approves the
1520
+ * new total. Dropping the proof there instead would silently remove the approved
1521
+ * -total ceiling from a checkout that raced the re-quote, which is the failure
1522
+ * the token exists to prevent.
1719
1523
  */
1720
- declare function applyAffiliateCode(code: string): Promise<SDKResponse<AffiliateValidation>>;
1524
+ declare function clearCart(): void;
1525
+ declare function createCartBackup(): void;
1526
+ declare function restoreCartFromBackup(): boolean;
1527
+ declare function mergeBaskets(items: CartBasketMergeLine[]): CartItem[];
1528
+ declare function moveBasketItem(fromProductId: string, fromVariantId: string, toProductId: string, toVariantId: string): void;
1529
+ declare function validateCartIntegrity(): boolean;
1530
+ declare function getCartStats(): CartStats;
1531
+ /** @internal — read by checkout(); exported only across module boundaries. */
1532
+ declare function getLatestQuoteToken(): string | null;
1533
+ declare function quoteCart(coupon?: string, currency?: string): Promise<src.SDKResponse<CartQuote>>;
1534
+
1721
1535
  /**
1722
- * Capture an affiliate code from the current URL and store it (ADR-0067).
1536
+ * Products Module
1723
1537
  *
1724
- * Example:
1725
- * - URL: https://mystore.com/product/abc?ref=deadbeef
1726
- * - captureAffiliateFromUrl() stores "deadbeef" and returns it.
1538
+ * API methods for product data.
1539
+ */
1540
+
1541
+ interface GetStorefrontProductsPageOptions {
1542
+ cursor?: string | null;
1543
+ limit?: number;
1544
+ sort?: 'featured' | 'newest' | 'price-asc' | 'price-desc' | string | null;
1545
+ category?: string | null;
1546
+ hideOutOfStock?: boolean;
1547
+ }
1548
+ declare function getProducts(): Promise<SDKResponse<Product[]>>;
1549
+ declare function getStorefrontProductsPage(options?: GetStorefrontProductsPageOptions): Promise<SDKResponse<{
1550
+ products: Product[];
1551
+ pagination: CursorPagination | null;
1552
+ }>>;
1553
+ declare function getProduct(idOrSlug: string, options?: {
1554
+ /**
1555
+ * A variant id from the page URL (`?variant=<id>`). A private variant is
1556
+ * listed only when it is named here; it then comes first in the variants,
1557
+ * so a buy box that opens on the first sellable option preselects it.
1558
+ */
1559
+ variant?: string;
1560
+ }): Promise<SDKResponse<Product>>;
1561
+ declare function getCategories(): Promise<SDKResponse<string[]>>;
1562
+
1563
+ /**
1564
+ * Store Module
1727
1565
  *
1728
- * Under LAST_CLICK (the default, and the only behaviour before ADR-0067) a new
1729
- * `?ref=` replaces whatever was stored. Under FIRST_CLICK an existing,
1730
- * unexpired attribution wins and the new code is NOT stored — the landing is
1731
- * still reported to the server so the affiliate's click statistics stay
1732
- * honest, but the credit stays with whoever was there first.
1566
+ * API methods for store data.
1567
+ */
1568
+
1569
+ interface GetStorefrontOptions {
1570
+ productsLimit?: number;
1571
+ productsCursor?: string | null;
1572
+ }
1573
+ declare function getStore(): Promise<SDKResponse<Shop>>;
1574
+ declare function resolveStoreByDomain(domain?: string, apiBaseUrl?: string): Promise<SDKResponse<Shop>>;
1575
+ declare function getStorefront(options?: GetStorefrontOptions): Promise<SDKResponse<StorefrontData>>;
1576
+ declare function getStoreLogoUrl(): Promise<string | null>;
1577
+ declare function getStoreBannerUrl(): Promise<string | null>;
1578
+
1579
+ /**
1580
+ * Typed OpenAPI client factory.
1733
1581
  *
1734
- * The mode comes from the server, which means the FIRST landing in a browser
1735
- * can never be blocked by it — correct, because there is nothing to protect
1736
- * yet. From then on the mode travels with the stored entry.
1582
+ * Surfaces the generated `createApiClient` from `@shoppex/contracts` with the
1583
+ * SDK's configured `apiBaseUrl`. This lets consumers of `@shoppexio/storefront`
1584
+ * call any public Dev API endpoint with full end-to-end types without
1585
+ * rebuilding a client from scratch.
1737
1586
  *
1738
- * Enforcement is client-side. A buyer who edits localStorage can re-attribute
1739
- * their own visit; this is the same trust level as the window itself and must
1740
- * not be presented to merchants as fraud protection.
1587
+ * Prefer the high-level modules (`shoppex.getProducts()` etc.) for common
1588
+ * read flows — they handle caching, pagination defaults, and storefront
1589
+ * scoping. Drop down to `shoppex.client()` only when you need an endpoint
1590
+ * the high-level API does not cover yet.
1741
1591
  */
1742
- declare function captureAffiliateFromUrl(param?: string): Promise<string | null>;
1743
1592
 
1593
+ type ApiClient = ReturnType<typeof createApiClient>;
1744
1594
  /**
1745
- * Coupons Module
1746
- *
1747
- * Coupon validation before checkout.
1595
+ * Return a typed OpenAPI client bound to the SDK's configured API base URL.
1596
+ * The client is cached per base URL and recreated when the SDK is re-initialized
1597
+ * against a different host.
1748
1598
  */
1599
+ declare function getTypedClient(token?: string): ApiClient;
1749
1600
 
1750
- declare function validateCoupon(code: string, productOrOptions?: string | CouponValidationOptions): Promise<SDKResponse<CouponValidation>>;
1601
+ /**
1602
+ * SDK Configuration Management
1603
+ */
1604
+
1605
+ declare function getConfig(): ShoppexConfig;
1606
+ declare function isInitialized(): boolean;
1751
1607
 
1752
1608
  /**
1753
- * Reviews Module
1609
+ * SDK Error Classes
1610
+ */
1611
+ /**
1612
+ * `SDKResponse.code` of a priced read that asked for a currency the shop does
1613
+ * not sell in (ADR-0066). `errorParams.requested` names the currency,
1614
+ * `errorParams.available` lists the enabled ones.
1615
+ */
1616
+ declare const CURRENCY_UNAVAILABLE_ERROR_CODE = "errors.storefront.currency_unavailable";
1617
+ declare class ShoppexError extends Error {
1618
+ readonly code: string;
1619
+ readonly statusCode?: number;
1620
+ constructor(message: string, code: string, statusCode?: number);
1621
+ }
1622
+ declare class NotInitializedError extends ShoppexError {
1623
+ constructor();
1624
+ }
1625
+ declare class NetworkError extends ShoppexError {
1626
+ constructor(message: string, statusCode?: number);
1627
+ }
1628
+ /**
1629
+ * A refusal the SERVER made and named. `code` is the backend's `error_code`
1630
+ * (e.g. `errors.checkout.coupon_no_longer_valid`) — the branchable identity of
1631
+ * the refusal, stable across locales, unlike the localized `message`.
1754
1632
  *
1755
- * Shop-level feedback/reviews.
1756
- * Note: Shoppex has shop-level feedback, not product-level reviews.
1633
+ * Distinct from {@link NetworkError}, whose `code` is always `NETWORK_ERROR`:
1634
+ * that one means "the request did not produce a named answer".
1635
+ */
1636
+ declare class ApiError extends ShoppexError {
1637
+ readonly errorParams?: Record<string, unknown>;
1638
+ constructor(message: string, code: string, statusCode?: number, errorParams?: Record<string, unknown>);
1639
+ }
1640
+ declare class ValidationError extends ShoppexError {
1641
+ readonly invalidFields?: string[];
1642
+ constructor(message: string, invalidFields?: string[]);
1643
+ }
1644
+ declare class CartError extends ShoppexError {
1645
+ constructor(message: string);
1646
+ }
1647
+
1648
+ interface StorefrontCustomField {
1649
+ name: string;
1650
+ type: string;
1651
+ required: boolean;
1652
+ defaultValue: string;
1653
+ placeholder: string;
1654
+ regex?: string;
1655
+ /** Only on a `select`: the labels the buyer picks one of. */
1656
+ options?: string[];
1657
+ }
1658
+ declare function normalizeStorefrontCustomFields(raw: unknown): StorefrontCustomField[];
1659
+ declare function isStorefrontCheckboxCustomFieldValueChecked(value: string | undefined): boolean;
1660
+ declare function validateStorefrontCustomFieldValue(field: StorefrontCustomField, value: string): string | null;
1661
+ declare function buildStorefrontCustomFieldPayload(fields: StorefrontCustomField[], values: Record<string, string>): Record<string, string>;
1662
+
1663
+ type VariantLike = Pick<ProductVariant, 'stock' | 'orderable' | 'supplier_backed'> | Pick<PriceVariant, 'stock' | 'orderable' | 'supplier_backed'>;
1664
+ type ProductLike = Pick<Product, 'type' | 'stock' | 'orderable' | 'supplier_backed' | 'on_hold' | 'price_variants' | 'variants'> & {
1665
+ onHold?: boolean | number | string | null;
1666
+ is_on_hold?: boolean | number | string | null;
1667
+ isOnHold?: boolean | number | string | null;
1668
+ };
1669
+ declare function resolveVariantStockValue(variant: VariantLike | null | undefined): number;
1670
+ declare function resolveDisplayStock(product: ProductLike | null | undefined): number;
1671
+ declare function isProductOutOfStock(product: ProductLike | null | undefined): boolean;
1672
+ declare function isProductInStock(product: ProductLike | null | undefined): boolean;
1673
+ declare function isVariantOutOfStock(variant: VariantLike | null | undefined): boolean;
1674
+
1675
+ declare function buildStorefrontProductLookup(products?: Product[]): Map<string, Product>;
1676
+ declare function getStorefrontGroupProducts(group: ProductGroup, productsOrLookup?: Product[] | Map<string, Product>): Product[];
1677
+ declare function getMergedStorefrontProducts(products?: Product[]): Product[];
1678
+
1679
+ type StorefrontContactTicketInput = {
1680
+ shopSlug: string;
1681
+ email: string;
1682
+ message: string;
1683
+ title?: string;
1684
+ name?: string;
1685
+ invoiceId?: string;
1686
+ apiBaseUrl?: string;
1687
+ };
1688
+ type StorefrontContactTicketResult = {
1689
+ uniqid: string;
1690
+ };
1691
+ declare function resolveStorefrontApiBaseUrl(options?: {
1692
+ apiBaseUrl?: string;
1693
+ hostname?: string;
1694
+ }): string;
1695
+ declare function buildStorefrontContactMessage(input: {
1696
+ name?: string;
1697
+ message: string;
1698
+ maxLength?: number;
1699
+ }): string;
1700
+ declare function submitStorefrontContactTicket(input: StorefrontContactTicketInput): Promise<StorefrontContactTicketResult>;
1701
+ type StorefrontSocialLinks = {
1702
+ discord?: string | null;
1703
+ telegram?: string | null;
1704
+ };
1705
+ declare function resolveStorefrontSocialLinks(store: {
1706
+ discord_link?: string | null;
1707
+ telegram_link?: string | null;
1708
+ social?: Record<string, string | null | undefined> | null;
1709
+ } | null | undefined): StorefrontSocialLinks;
1710
+
1711
+ /**
1712
+ * Theme configuration types (framework agnostic)
1757
1713
  */
1714
+ type SettingFieldType = 'color' | 'text' | 'range' | 'select' | 'boolean' | 'image' | 'font' | 'richtext' | 'products' | 'images';
1715
+ interface BaseSettingField {
1716
+ type: SettingFieldType;
1717
+ label: string;
1718
+ description?: string;
1719
+ }
1720
+ interface ColorField extends BaseSettingField {
1721
+ type: 'color';
1722
+ default: string;
1723
+ }
1724
+ interface RangeField extends BaseSettingField {
1725
+ type: 'range';
1726
+ default: number;
1727
+ min: number;
1728
+ max: number;
1729
+ step?: number;
1730
+ unit?: string;
1731
+ }
1732
+ interface SelectField extends BaseSettingField {
1733
+ type: 'select';
1734
+ default: string;
1735
+ options: string[] | {
1736
+ value: string;
1737
+ label: string;
1738
+ }[];
1739
+ }
1740
+ interface BooleanField extends BaseSettingField {
1741
+ type: 'boolean';
1742
+ default: boolean;
1743
+ }
1744
+ interface TextField extends BaseSettingField {
1745
+ type: 'text';
1746
+ default: string;
1747
+ }
1748
+ interface ImageField extends BaseSettingField {
1749
+ type: 'image';
1750
+ default: string | null;
1751
+ }
1752
+ interface FontField extends BaseSettingField {
1753
+ type: 'font';
1754
+ default: string;
1755
+ options?: string[];
1756
+ }
1757
+ interface RichtextField extends BaseSettingField {
1758
+ type: 'richtext';
1759
+ default: string;
1760
+ }
1761
+ interface ProductsField extends BaseSettingField {
1762
+ type: 'products';
1763
+ default: string[];
1764
+ max?: number;
1765
+ }
1766
+ interface ImagesField extends BaseSettingField {
1767
+ type: 'images';
1768
+ default: string[];
1769
+ max?: number;
1770
+ }
1771
+ type SettingField = ColorField | RangeField | SelectField | BooleanField | TextField | ImageField | FontField | RichtextField | ProductsField | ImagesField;
1772
+ interface SectionDefinition {
1773
+ name: string;
1774
+ description?: string;
1775
+ icon?: string;
1776
+ settings: Record<string, SettingField>;
1777
+ }
1778
+ interface BlockDefinition {
1779
+ name: string;
1780
+ description?: string;
1781
+ icon?: string;
1782
+ settings: Record<string, SettingField>;
1783
+ allowedPages?: string[];
1784
+ maxPerPage?: number;
1785
+ }
1786
+ interface BlockInstance {
1787
+ id: string;
1788
+ type: string;
1789
+ visible?: boolean;
1790
+ settings?: Record<string, SettingValue>;
1791
+ }
1792
+ interface PageLayout {
1793
+ blocks: BlockInstance[];
1794
+ }
1795
+ interface ThemeBlockManifest {
1796
+ pages: string[];
1797
+ blocks: Record<string, BlockDefinition>;
1798
+ defaultLayouts?: Record<string, PageLayout>;
1799
+ }
1800
+ interface ThemeConfig {
1801
+ id: string;
1802
+ name: string;
1803
+ description?: string;
1804
+ version: string;
1805
+ author?: string;
1806
+ preview?: string;
1807
+ settings: Record<string, Record<string, SettingField>>;
1808
+ sections: Record<string, SectionDefinition>;
1809
+ blocks?: Record<string, BlockDefinition>;
1810
+ pageLayouts?: Record<string, PageLayout>;
1811
+ builder?: ThemeBlockManifest;
1812
+ }
1813
+ type SettingValue = string | number | boolean | null | string[] | Record<string, unknown>;
1814
+ type ResolvedThemeSettings = {
1815
+ [Category: string]: {
1816
+ [Key: string]: SettingValue;
1817
+ };
1818
+ };
1758
1819
 
1759
- /** `code` of a filtered request the API answered without applying the filter. */
1760
- declare const PRODUCT_FILTER_UNSUPPORTED = "reviews_product_filter_unsupported";
1761
- interface ShopReviewsPageOptions {
1762
- /**
1763
- * One product's reviews, by the product's public id (the `id` the catalog
1764
- * carries). The page's `summary` then counts that product's reviews only.
1765
- */
1766
- product?: string | null;
1820
+ type JsonRecord = Record<string, unknown>;
1821
+ interface PublishedBuilderSettings {
1822
+ version: number;
1823
+ revision: number;
1824
+ theme: {
1825
+ content: JsonRecord;
1826
+ layout: JsonRecord;
1827
+ style_slots: JsonRecord;
1828
+ pages?: unknown[];
1829
+ terms?: JsonRecord;
1830
+ [key: string]: unknown;
1831
+ };
1832
+ [key: string]: unknown;
1767
1833
  }
1768
- declare function getShopReviewsPage(cursor?: string | null, options?: ShopReviewsPageOptions): Promise<SDKResponse<ShopReviewsPage>>;
1769
- declare function getShopReviews(): Promise<SDKResponse<Feedback[]>>;
1834
+ interface PublishedThemeSettingsPayload {
1835
+ settings: ResolvedThemeSettings;
1836
+ builder_settings: PublishedBuilderSettings | null;
1837
+ content: JsonRecord;
1838
+ style_slots: JsonRecord;
1839
+ }
1840
+ declare function fetchPublishedBuilderSettings(shopSlug: string): Promise<PublishedThemeSettingsPayload | null>;
1841
+ declare function fetchPublishedThemeSettings(shopSlug: string): Promise<ResolvedThemeSettings | null>;
1842
+ declare function resolveDefaults(config: ThemeConfig): ResolvedThemeSettings;
1843
+ declare function mergeSettings(defaults: ResolvedThemeSettings, overrides: Partial<ResolvedThemeSettings>): ResolvedThemeSettings;
1844
+
1845
+ type CartLineIdentityInput = Pick<CartItem, 'product_id' | 'variant_id' | 'price_variant_id' | 'addons' | 'custom_fields' | 'price_data' | 'pay_what_you_want_price'>;
1846
+ declare function computeCartLineId(input: CartLineIdentityInput): string;
1847
+ declare function ensureCartLineId(item: CartItem): CartItem;
1770
1848
 
1771
1849
  /**
1772
1850
  * Customer Module
@@ -1892,6 +1970,7 @@ declare function subscriptionBillingHistory(uniqid: string): Promise<SDKResponse
1892
1970
  declare function cancelSubscription(uniqid: string, options?: CustomerSubscriptionCancelOptions): Promise<SDKResponse<unknown>>;
1893
1971
  declare function pauseSubscription(uniqid: string): Promise<SDKResponse<unknown>>;
1894
1972
  declare function resumeSubscription(uniqid: string): Promise<SDKResponse<unknown>>;
1973
+ declare function undoSubscriptionCancel(uniqid: string): Promise<SDKResponse<unknown>>;
1895
1974
  declare function favorites(): Promise<SDKResponse<unknown>>;
1896
1975
  /** Idempotent upstream, and a PUT — `customer-favorites.ts` has no POST route. */
1897
1976
  declare function addFavorite(productUniqid: string): Promise<SDKResponse<unknown>>;
@@ -1964,56 +2043,6 @@ declare function resellerOrder(uniqid: string): Promise<SDKResponse<unknown>>;
1964
2043
  declare function resellerWallet(): Promise<SDKResponse<unknown>>;
1965
2044
  declare function resellerApiKeys(): Promise<SDKResponse<unknown>>;
1966
2045
 
1967
- /**
1968
- * Invoices Module
1969
- *
1970
- * Invoice status checking after payment.
1971
- */
1972
-
1973
- declare function getInvoice(invoiceId: string): Promise<SDKResponse<Invoice>>;
1974
- declare function getInvoiceStatus(invoiceId: string): Promise<SDKResponse<{
1975
- status: string;
1976
- }>>;
1977
-
1978
- /**
1979
- * Pages Module
1980
- *
1981
- * API methods for public pages.
1982
- */
1983
-
1984
- /**
1985
- * Get all public pages for the store
1986
- */
1987
- declare function getPages(): Promise<SDKResponse<Page[]>>;
1988
- /**
1989
- * Get a public page by slug
1990
- */
1991
- declare function getPage(slug: string): Promise<SDKResponse<Page>>;
1992
-
1993
- /**
1994
- * Navigation Module
1995
- *
1996
- * API methods for menus and navigation.
1997
- */
1998
-
1999
- /**
2000
- * Get all menus for the store
2001
- */
2002
- declare function getMenus(): Promise<SDKResponse<Menu[]>>;
2003
- /**
2004
- * Get a menu by its exact title.
2005
- */
2006
- declare function getMenuByTitle(title: string): Promise<SDKResponse<Menu>>;
2007
- /**
2008
- * Get a menu by its exact title.
2009
- */
2010
- declare function getMenu(title: string): Promise<SDKResponse<Menu>>;
2011
- /**
2012
- * Get a menu by canonical slot. The backend resolves legacy menu titles too.
2013
- */
2014
- declare function getMenuBySlot(slot: NavigationMenuSlot): Promise<SDKResponse<Menu>>;
2015
- declare function getMenuSlotTitles(slot: NavigationMenuSlot): string[];
2016
-
2017
2046
  /**
2018
2047
  * Counts a page view. Call it once per page load or client-side navigation.
2019
2048
  * Passing the cart also records it for the live visitor map.
@@ -2051,96 +2080,33 @@ declare function touchStorefrontPresence(): Promise<SDKResponse<{
2051
2080
  }>>;
2052
2081
 
2053
2082
  /**
2054
- * Formatting Utilities
2083
+ * Navigation Module
2084
+ *
2085
+ * API methods for menus and navigation.
2055
2086
  */
2056
- declare function createFormatter(currency?: string, locale?: string): Intl.NumberFormat;
2057
- declare function formatPrice(amount: number | string, currency?: string, locale?: string): string;
2058
-
2059
- interface CacheStats {
2060
- hits: number;
2061
- misses: number;
2062
- pendingRequests: number;
2063
- entries: number;
2064
- }
2065
- declare function getCacheStats(): CacheStats;
2066
- declare function clearCache(): void;
2067
- declare function invalidateCache(prefixOrKey: string): void;
2068
2087
 
2069
2088
  /**
2070
- * Shoppex Storefront SDK
2071
- *
2072
- * Usage:
2073
- * ```html
2074
- * <script src="https://cdn.shoppex.io/sdk/v1.0/shoppex.umd.js"></script>
2075
- * <script>
2076
- * shoppex.init('my-store');
2077
- *
2078
- * shoppex.getStore().then(store => console.log(store));
2079
- * shoppex.addToCart('product-id', 'variant-id', 2);
2080
- * shoppex.checkout();
2081
- * </script>
2082
- * ```
2089
+ * Get all menus for the store
2083
2090
  */
2084
-
2091
+ declare function getMenus(): Promise<SDKResponse<Menu[]>>;
2092
+ /**
2093
+ * Get a menu by its exact title.
2094
+ */
2095
+ declare function getMenuByTitle(title: string): Promise<SDKResponse<Menu>>;
2096
+ /**
2097
+ * Get a menu by its exact title.
2098
+ */
2099
+ declare function getMenu(title: string): Promise<SDKResponse<Menu>>;
2085
2100
  /**
2086
- * Initialize the SDK with a store slug
2101
+ * Get a menu by canonical slot. The backend resolves legacy menu titles too.
2087
2102
  */
2088
- declare function init(storeSlug: string, options?: ShoppexInitOptions): void;
2089
- declare function init(options: ShoppexInitOptions & {
2090
- storeId: string;
2091
- }): void;
2103
+ declare function getMenuBySlot(slot: NavigationMenuSlot): Promise<SDKResponse<Menu>>;
2104
+ declare function getMenuSlotTitles(slot: NavigationMenuSlot): string[];
2105
+
2092
2106
  /**
2093
2107
  * Shoppex SDK instance
2094
2108
  */
2095
2109
  declare const shoppex: {
2096
- init: typeof init;
2097
- isInitialized: typeof isInitialized;
2098
- getConfig: typeof getConfig;
2099
- client: typeof getTypedClient;
2100
- getStore: typeof getStore;
2101
- getStorefront: typeof getStorefront;
2102
- getStoreLogoUrl: typeof getStoreLogoUrl;
2103
- getStoreBannerUrl: typeof getStoreBannerUrl;
2104
- resolveStoreByDomain: typeof resolveStoreByDomain;
2105
- getProducts: typeof getProducts;
2106
- getStorefrontProductsPage: typeof getStorefrontProductsPage;
2107
- getProduct: typeof getProduct;
2108
- getCategories: typeof getCategories;
2109
- getCart: typeof getCart;
2110
- getCartItemCount: typeof getCartItemCount;
2111
- getCartCoupon: typeof getCartCoupon;
2112
- getCartCouponSource: typeof getCartCouponSource;
2113
- setCartCoupon: typeof setCartCoupon;
2114
- clearCartCoupon: typeof clearCartCoupon;
2115
- addToCart: typeof addToCart;
2116
- setCartItem: typeof setCartItem;
2117
- updateCartItem: typeof updateCartItem;
2118
- removeFromCart: typeof removeFromCart;
2119
- clearCart: typeof clearCart;
2120
- createCartBackup: typeof createCartBackup;
2121
- restoreCartFromBackup: typeof restoreCartFromBackup;
2122
- mergeBaskets: typeof mergeBaskets;
2123
- moveBasketItem: typeof moveBasketItem;
2124
- getCartStats: typeof getCartStats;
2125
- validateCartIntegrity: typeof validateCartIntegrity;
2126
- quoteCart: typeof quoteCart;
2127
- getLatestQuoteToken: typeof getLatestQuoteToken;
2128
- resolveCartLineId: typeof resolveCartLineId;
2129
- checkout: typeof checkout;
2130
- buildCheckoutUrl: typeof buildCheckoutUrl;
2131
- buildCheckoutUrlSync: typeof buildCheckoutUrlSync;
2132
- getRequestedCheckoutCurrency: typeof getRequestedCheckoutCurrency;
2133
- captureAffiliateFromUrl: typeof captureAffiliateFromUrl;
2134
- validateAffiliateCode: typeof validateAffiliateCode;
2135
- applyAffiliateCode: typeof applyAffiliateCode;
2136
- getAffiliateCode: typeof getAffiliateCode;
2137
- getStoredAffiliate: typeof getStoredAffiliate;
2138
- setAffiliateCode: typeof setAffiliateCode;
2139
- clearAffiliateCode: typeof clearAffiliateCode;
2140
- trackAffiliateEvent: typeof trackAffiliateEvent;
2141
- validateCoupon: typeof validateCoupon;
2142
- getShopReviews: typeof getShopReviews;
2143
- getShopReviewsPage: typeof getShopReviewsPage;
2144
2110
  requestOtp: typeof requestOtp;
2145
2111
  verifyOtp: typeof verifyOtp;
2146
2112
  logout: typeof logout;
@@ -2158,6 +2124,7 @@ declare const shoppex: {
2158
2124
  cancelSubscription: typeof cancelSubscription;
2159
2125
  pauseSubscription: typeof pauseSubscription;
2160
2126
  resumeSubscription: typeof resumeSubscription;
2127
+ undoSubscriptionCancel: typeof undoSubscriptionCancel;
2161
2128
  favorites: typeof favorites;
2162
2129
  addFavorite: typeof addFavorite;
2163
2130
  removeFavorite: typeof removeFavorite;
@@ -2187,31 +2154,84 @@ declare const shoppex: {
2187
2154
  resellerOrder: typeof resellerOrder;
2188
2155
  resellerWallet: typeof resellerWallet;
2189
2156
  resellerApiKeys: typeof resellerApiKeys;
2157
+ init: {
2158
+ (storeSlug: string, options?: src.ShoppexInitOptions): void;
2159
+ (options: src.ShoppexInitOptions & {
2160
+ storeId: string;
2161
+ }): void;
2162
+ };
2163
+ isInitialized: typeof isInitialized;
2164
+ getConfig: typeof getConfig;
2165
+ client: typeof getTypedClient;
2166
+ getStore: typeof getStore;
2167
+ getStorefront: typeof getStorefront;
2168
+ getStoreLogoUrl: typeof getStoreLogoUrl;
2169
+ getStoreBannerUrl: typeof getStoreBannerUrl;
2170
+ resolveStoreByDomain: typeof resolveStoreByDomain;
2171
+ getProducts: typeof getProducts;
2172
+ getStorefrontProductsPage: typeof getStorefrontProductsPage;
2173
+ getProduct: typeof getProduct;
2174
+ getCategories: typeof getCategories;
2175
+ getCart: typeof getCart;
2176
+ getCartItemCount: typeof getCartItemCount;
2177
+ getCartCoupon: typeof getCartCoupon;
2178
+ getCartCouponSource: typeof getCartCouponSource;
2179
+ setCartCoupon: typeof setCartCoupon;
2180
+ clearCartCoupon: typeof clearCartCoupon;
2181
+ addToCart: typeof addToCart;
2182
+ setCartItem: typeof setCartItem;
2183
+ updateCartItem: typeof updateCartItem;
2184
+ removeFromCart: typeof removeFromCart;
2185
+ clearCart: typeof clearCart;
2186
+ createCartBackup: typeof createCartBackup;
2187
+ restoreCartFromBackup: typeof restoreCartFromBackup;
2188
+ mergeBaskets: typeof mergeBaskets;
2189
+ moveBasketItem: typeof moveBasketItem;
2190
+ getCartStats: typeof getCartStats;
2191
+ validateCartIntegrity: typeof validateCartIntegrity;
2192
+ quoteCart: typeof quoteCart;
2193
+ getLatestQuoteToken: typeof getLatestQuoteToken;
2194
+ resolveCartLineId: typeof resolveCartLineId;
2195
+ checkout: typeof checkout;
2196
+ buildCheckoutUrl: typeof buildCheckoutUrl;
2197
+ buildCheckoutUrlSync: typeof buildCheckoutUrlSync;
2198
+ getRequestedCheckoutCurrency: typeof getRequestedCheckoutCurrency;
2199
+ captureAffiliateFromUrl: typeof captureAffiliateFromUrl;
2200
+ validateAffiliateCode: typeof validateAffiliateCode;
2201
+ applyAffiliateCode: typeof applyAffiliateCode;
2202
+ getAffiliateCode: typeof getAffiliateCode;
2203
+ getStoredAffiliate: typeof getStoredAffiliate;
2204
+ setAffiliateCode: typeof setAffiliateCode;
2205
+ clearAffiliateCode: typeof clearAffiliateCode;
2206
+ trackAffiliateEvent: typeof trackAffiliateEvent;
2207
+ validateCoupon: typeof validateCoupon;
2208
+ getShopReviews: typeof getShopReviews;
2209
+ getShopReviewsPage: typeof src.getShopReviewsPage;
2190
2210
  searchProducts: typeof searchProducts;
2191
2211
  searchCatalogItems: typeof searchCatalogItems;
2192
2212
  getInvoice: typeof getInvoice;
2193
2213
  getInvoiceStatus: typeof getInvoiceStatus;
2194
2214
  getPages: typeof getPages;
2195
2215
  getPage: typeof getPage;
2196
- getMenus: typeof getMenus;
2197
- getMenu: typeof getMenu;
2198
- getMenuBySlot: typeof getMenuBySlot;
2199
- getMenuByTitle: typeof getMenuByTitle;
2200
- getMenuSlotTitles: typeof getMenuSlotTitles;
2201
- trackPageView: typeof trackPageView;
2202
- trackCartActivity: typeof trackCartActivity;
2203
- getStorefrontOnlineUsers: typeof getStorefrontOnlineUsers;
2204
- getStorefrontRecentSales: typeof getStorefrontRecentSales;
2205
- touchStorefrontPresence: typeof touchStorefrontPresence;
2216
+ getMenus: typeof src.getMenus;
2217
+ getMenu: typeof src.getMenu;
2218
+ getMenuBySlot: typeof src.getMenuBySlot;
2219
+ getMenuByTitle: typeof src.getMenuByTitle;
2220
+ getMenuSlotTitles: typeof src.getMenuSlotTitles;
2221
+ trackPageView: typeof src.trackPageView;
2222
+ trackCartActivity: typeof src.trackCartActivity;
2223
+ getStorefrontOnlineUsers: typeof src.getStorefrontOnlineUsers;
2224
+ getStorefrontRecentSales: typeof src.getStorefrontRecentSales;
2225
+ touchStorefrontPresence: typeof src.touchStorefrontPresence;
2206
2226
  createFormatter: typeof createFormatter;
2207
2227
  formatPrice: typeof formatPrice;
2208
2228
  clearCache: typeof clearCache;
2209
2229
  invalidateCache: typeof invalidateCache;
2210
2230
  getCacheStats: typeof getCacheStats;
2211
- fetchPublishedBuilderSettings: typeof fetchPublishedBuilderSettings;
2212
- fetchPublishedThemeSettings: typeof fetchPublishedThemeSettings;
2213
- resolveDefaults: typeof resolveDefaults;
2214
- mergeSettings: typeof mergeSettings;
2231
+ fetchPublishedBuilderSettings: typeof src.fetchPublishedBuilderSettings;
2232
+ fetchPublishedThemeSettings: typeof src.fetchPublishedThemeSettings;
2233
+ resolveDefaults: typeof src.resolveDefaults;
2234
+ mergeSettings: typeof src.mergeSettings;
2215
2235
  };
2216
2236
 
2217
- export { type AffiliateValidation, ApiError, type ApiResponse, type BlockDefinition, type BlockInstance, type BuyerRewardActivityItem, type BuyerRewards, CURRENCY_UNAVAILABLE_ERROR_CODE, type CartAddOptions, type CartAddon, type CartAppliedDiscount, type CartBasketMergeLine, type CartCodeSource, CartError, type CartItem, type CartItemUpdate, type CartLineIdentityInput, type CartMetadata, type CartPayload, type CartQuote, type CartQuoteLine, type CartStats, type Category, CheckoutCreateError, type CheckoutOptions, type CheckoutResult, type CouponValidation, type CouponValidationOptions, type CursorPagination, type CustomFieldDefinition, type CustomerAffiliateLinkInput, type CustomerEmailPreferencesPatch, type CustomerInvoicePdf, type CustomerNotificationPreferencesPatch, type CustomerProfilePatch, type CustomerSubscriptionCancelOptions, type CustomerTicketPayload, type EligibleBundleDeal, type EligibleBundleDealProduct, type EligibleCartDeal, type Feedback, type Invoice, type InvoiceProduct, type Menu, type MenuItem, NetworkError, NotInitializedError, PRODUCT_FILTER_UNSUPPORTED, type Page, type PageLayout, type PriceVariant, type Product, type ProductAddon, type ProductBundle, type ProductBundleProduct, type ProductCategory, type ProductDescriptionTab, type ProductFaq, type ProductFeedback, type ProductGroup, type ProductImage, type ProductVariant, type PublishedBuilderSettings, type PublishedThemeSettingsPayload, type ResellerCatalogQuery, type ResellerOrderItem, type ResellerOrdersQuery, type ResolvedThemeSettings, type RewardActionType, type RewardGrantStatus, type RewardProgramSummary, type RewardProgramTeaserItem, type RewardReason, type SDKResponse, type SearchOptions, type SectionDefinition, type SettingField, type Shop, type ShopFeedback, type ShopReviewsPage, type ShopReviewsSummary, type ShopTheme, type ShoppexConfig, ShoppexError, type ShoppexInitOptions, type StorefrontAddon, type StorefrontAddonBootstrap, type StorefrontAnnouncementBarAddon, type StorefrontCatalogSearchItem, type StorefrontContactTicketInput, type StorefrontContactTicketResult, type StorefrontCountdownBarAddon, type StorefrontCouponPopupModalAddon, type StorefrontCustomField, type StorefrontData, type StorefrontItem, type StorefrontOnlineUsers, type StorefrontPromoInfoCardAddon, type StorefrontRecentPurchasePopupAddon, type StorefrontRecentSaleEntry, type StorefrontRecentSales, type StorefrontSearchFilterOptions, type StorefrontSocialLinks, type Subscription, type SubscriptionFlags, type SubscriptionInterval, type ThemeBlockManifest, type ThemeConfig, type TrustedChecks, ValidationError, acceptResellerInvite, addFavorite, affiliate, affiliateStats, applyForReseller, buildStorefrontContactMessage, buildStorefrontCustomFieldPayload, buildStorefrontProductLookup, cancelSubscription, claimWarranty, collectProductSearchHaystack, computeCartLineId, createAffiliateLink, createTicket, dashboard, shoppex as default, emailPreferences, enrollAsReseller, ensureCartLineId, favorites, fetchPublishedBuilderSettings, fetchPublishedThemeSettings, filterProductsBySearchQuery, getMenu, getMenuBySlot, getMenuByTitle, getMenuSlotTitles, getMenus, getMergedStorefrontProducts, getShopReviewsPage, getStorefrontGroupProducts, getStorefrontOnlineUsers, getStorefrontRecentSales, groupMatchesSearchQuery, invoicePdf, isProductInStock, isProductOutOfStock, isStorefrontCheckboxCustomFieldValueChecked, isVariantOutOfStock, logout, loyalty, me, mergeSettings, normalizeSearchQuery, normalizeStorefrontCustomFields, notificationPreferences, order, orders, pauseSubscription, productMatchesSearchQuery, quoteResellerOrder, redeemLoyaltyPoints, removeAvatar, removeFavorite, replyToTicket, requestOtp, reseller, resellerApiKeys, resellerCatalog, resellerOrder, resellerOrders, resellerWallet, resetLicenseHwid, resolveDefaults, resolveDisplayStock, resolveStorefrontApiBaseUrl, resolveStorefrontSocialLinks, resolveVariantStockValue, resumeSubscription, revokeAllSessions, revokeSession, searchMergedStorefrontCatalog, searchMergedStorefrontCatalogItems, sessions, shoppex, stripHtmlFromText, submitStorefrontContactTicket, subscriptionBillingHistory, ticket, touchStorefrontPresence, trackCartActivity, trackPageView, updateAvatar, updateEmailPreferences, updateNotificationPreferences, updateProfile, validateStorefrontCustomFieldValue, verifyOtp, warranties };
2237
+ export { type AffiliateValidation, ApiError, type ApiResponse, type BlockDefinition, type BlockInstance, type BuyerRewardActivityItem, type BuyerRewards, CURRENCY_UNAVAILABLE_ERROR_CODE, type CartAddOptions, type CartAddon, type CartAppliedDiscount, type CartBasketMergeLine, type CartCodeSource, CartError, type CartItem, type CartItemUpdate, type CartLineIdentityInput, type CartMetadata, type CartPayload, type CartQuote, type CartQuoteLine, type CartStats, type Category, CheckoutCreateError, type CheckoutOptions, type CheckoutResult, type CouponValidation, type CouponValidationOptions, type CursorPagination, type CustomFieldDefinition, type CustomerAffiliateLinkInput, type CustomerEmailPreferencesPatch, type CustomerInvoicePdf, type CustomerNotificationPreferencesPatch, type CustomerProfilePatch, type CustomerSubscriptionCancelOptions, type CustomerTicketPayload, type EligibleBundleDeal, type EligibleBundleDealProduct, type EligibleCartDeal, type Feedback, type Invoice, type InvoiceProduct, type Menu, type MenuItem, NetworkError, NotInitializedError, PRODUCT_FILTER_UNSUPPORTED, type Page, type PageLayout, type PriceVariant, type Product, type ProductAddon, type ProductBundle, type ProductBundleProduct, type ProductCategory, type ProductDescriptionTab, type ProductFaq, type ProductFeedback, type ProductGroup, type ProductImage, type ProductVariant, type PublishedBuilderSettings, type PublishedThemeSettingsPayload, type ResellerCatalogQuery, type ResellerOrderItem, type ResellerOrdersQuery, type ResolvedThemeSettings, type RewardActionType, type RewardGrantStatus, type RewardProgramSummary, type RewardProgramTeaserItem, type RewardReason, type SDKResponse, type SearchOptions, type SectionDefinition, type SettingField, type Shop, type ShopFeedback, type ShopReviewsPage, type ShopReviewsSummary, type ShopTheme, type ShoppexConfig, ShoppexError, type ShoppexInitOptions, type StorefrontAddon, type StorefrontAddonBootstrap, type StorefrontAnnouncementBarAddon, type StorefrontCatalogSearchItem, type StorefrontContactTicketInput, type StorefrontContactTicketResult, type StorefrontCountdownBarAddon, type StorefrontCouponPopupModalAddon, type StorefrontCustomField, type StorefrontData, type StorefrontItem, type StorefrontOnlineUsers, type StorefrontPromoInfoCardAddon, type StorefrontRecentPurchasePopupAddon, type StorefrontRecentSaleEntry, type StorefrontRecentSales, type StorefrontSearchFilterOptions, type StorefrontSocialLinks, type Subscription, type SubscriptionFlags, type SubscriptionInterval, type ThemeBlockManifest, type ThemeConfig, type TrustedChecks, ValidationError, acceptResellerInvite, addFavorite, affiliate, affiliateStats, applyForReseller, buildStorefrontContactMessage, buildStorefrontCustomFieldPayload, buildStorefrontProductLookup, cancelSubscription, claimWarranty, collectProductSearchHaystack, computeCartLineId, createAffiliateLink, createTicket, dashboard, shoppex as default, emailPreferences, enrollAsReseller, ensureCartLineId, favorites, fetchPublishedBuilderSettings, fetchPublishedThemeSettings, filterProductsBySearchQuery, getMenu, getMenuBySlot, getMenuByTitle, getMenuSlotTitles, getMenus, getMergedStorefrontProducts, getShopReviewsPage, getStorefrontGroupProducts, getStorefrontOnlineUsers, getStorefrontRecentSales, groupMatchesSearchQuery, invoicePdf, isProductInStock, isProductOutOfStock, isStorefrontCheckboxCustomFieldValueChecked, isVariantOutOfStock, logout, loyalty, me, mergeSettings, normalizeSearchQuery, normalizeStorefrontCustomFields, notificationPreferences, order, orders, pauseSubscription, productMatchesSearchQuery, quoteResellerOrder, redeemLoyaltyPoints, removeAvatar, removeFavorite, replyToTicket, requestOtp, reseller, resellerApiKeys, resellerCatalog, resellerOrder, resellerOrders, resellerWallet, resetLicenseHwid, resolveDefaults, resolveDisplayStock, resolveStorefrontApiBaseUrl, resolveStorefrontSocialLinks, resolveVariantStockValue, resumeSubscription, revokeAllSessions, revokeSession, searchMergedStorefrontCatalog, searchMergedStorefrontCatalogItems, sessions, shoppex, stripHtmlFromText, submitStorefrontContactTicket, subscriptionBillingHistory, ticket, touchStorefrontPresence, trackCartActivity, trackPageView, undoSubscriptionCancel, updateAvatar, updateEmailPreferences, updateNotificationPreferences, updateProfile, validateStorefrontCustomFieldValue, verifyOtp, warranties };