@shoppexio/storefront 1.0.91 → 1.0.93

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