@shoppexio/storefront 1.0.80 → 1.0.82

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
@@ -205,6 +205,8 @@ interface ProductCategory {
205
205
  image_storage?: string | null;
206
206
  cloudflare_image_id?: string | null;
207
207
  cdn_image_url?: string | null;
208
+ /** The merchant's category order (lower first); the same value the catalog's top-level `categories` carry as `sort_priority`. */
209
+ sort_order?: number;
208
210
  }
209
211
  interface ProductDescriptionTab {
210
212
  title: string;
package/dist/index.d.ts CHANGED
@@ -205,6 +205,8 @@ interface ProductCategory {
205
205
  image_storage?: string | null;
206
206
  cloudflare_image_id?: string | null;
207
207
  cdn_image_url?: string | null;
208
+ /** The merchant's category order (lower first); the same value the catalog's top-level `categories` carry as `sort_priority`. */
209
+ sort_order?: number;
208
210
  }
209
211
  interface ProductDescriptionTab {
210
212
  title: string;
package/dist/index.js CHANGED
@@ -22,7 +22,7 @@ import {
22
22
  union,
23
23
  unknown,
24
24
  url
25
- } from "./chunk-ZVOFFURI.js";
25
+ } from "./chunk-ROQI7BO6.js";
26
26
 
27
27
  // ../sdk/src/core/errors.ts
28
28
  var CURRENCY_UNAVAILABLE_ERROR_CODE = "errors.storefront.currency_unavailable";
@@ -806,11 +806,13 @@ var CHECKOUT_METHOD_ORDER_KEYS = [
806
806
  "SHOPPEXPAY",
807
807
  "MONEYMOTION",
808
808
  "OVGC",
809
+ "MISTICPAY",
809
810
  "WHOP",
810
811
  "DODO",
811
812
  "MAVERICK",
812
813
  "CASHAPP",
813
814
  "VENMO",
815
+ "REWARBLE",
814
816
  "CRYPTO",
815
817
  "CUSTOMER_BALANCE",
816
818
  "EXTERNAL",
@@ -909,13 +911,15 @@ var FINANCE_GATEWAY_KEYS = [
909
911
  "SHOPPEXPAY",
910
912
  "MONEYMOTION",
911
913
  "OVGC",
914
+ "MISTICPAY",
912
915
  "WHOP",
913
916
  "DODO",
914
917
  "MAVERICK",
915
918
  "VENMO",
916
919
  "MOLLIE",
917
920
  "AUTHORIZENET",
918
- "NMI"
921
+ "NMI",
922
+ "REWARBLE"
919
923
  ];
920
924
  var FINANCE_GATEWAY_KEY_SET = new Set(
921
925
  FINANCE_GATEWAY_KEYS.map((gateway) => normalizeGatewayKey(gateway))
@@ -1259,6 +1263,11 @@ var checkoutStyleSlotValues = [
1259
1263
  "status.processing",
1260
1264
  "status.details",
1261
1265
  "status.wait_hint",
1266
+ // The seller's own wording on a paid order waiting for restock. Styleable but
1267
+ // NOT protected: the sentence that states the mechanics — delivery runs by
1268
+ // itself, nothing to resubmit — is `status.processing` above and stays
1269
+ // whatever a theme does with this one.
1270
+ "status.seller_stock_note",
1262
1271
  // The open order kept its gateway: the buyer is told which one, and why the
1263
1272
  // picker is gone.
1264
1273
  "status.method_locked",
@@ -2098,6 +2107,15 @@ var publicInvoiceWireProductSchema = external_exports.object({
2098
2107
  delivery_instruction_config: external_exports.unknown().optional(),
2099
2108
  delivery_instruction_label: external_exports.unknown().optional(),
2100
2109
  delivery_text: external_exports.string().nullable().optional(),
2110
+ // The seller's own wording for this product's delivery, published by
2111
+ // `InvoiceDataLoader` on every catalog-backed line. This schema strips what
2112
+ // it does not declare, so an undeclared field never reaches the buyer's page
2113
+ // however faithfully the API emits it — the four below are what the
2114
+ // completion page and the awaiting-stock card read.
2115
+ label_singular: external_exports.string().nullable().optional(),
2116
+ label_plural: external_exports.string().nullable().optional(),
2117
+ thank_you_message: external_exports.string().nullable().optional(),
2118
+ out_of_stock_message: external_exports.string().nullable().optional(),
2101
2119
  // Delivery wait as a bare COUNT. `0` and `null` both mean instant (the
2102
2120
  // digital-goods default); a positive value is a "within N <unit>" promise.
2103
2121
  delivery_time: external_exports.number().nullable().optional(),
@@ -2180,6 +2198,11 @@ var customerBalanceSchema = external_exports.object({
2180
2198
  available: external_exports.string(),
2181
2199
  currency: external_exports.string()
2182
2200
  });
2201
+ var voucherStoreCreditSchema = external_exports.object({
2202
+ gateway: external_exports.literal("REWARBLE"),
2203
+ amount: external_exports.string(),
2204
+ currency: external_exports.string()
2205
+ });
2183
2206
  var pricingBreakdownSchema = external_exports.object({
2184
2207
  affiliate_code: external_exports.string().nullable().optional(),
2185
2208
  already_paid: stringOrNumberSchema.nullable().optional(),
@@ -2436,6 +2459,7 @@ var publicInvoiceWireSchema = external_exports.object({
2436
2459
  custom_gateways: external_exports.array(customGatewaySchema).optional(),
2437
2460
  external_payment_adapters: external_exports.array(externalPaymentAdapterSchema).optional(),
2438
2461
  customer_balance: customerBalanceSchema.nullable().optional(),
2462
+ voucher_store_credit: voucherStoreCreditSchema.nullable().optional(),
2439
2463
  customer_email_masked: external_exports.string().nullable().optional(),
2440
2464
  dark_mode: external_exports.union([external_exports.literal(0), external_exports.literal(1)]).optional(),
2441
2465
  delivery: deliverySchema.optional(),
@@ -2519,10 +2543,11 @@ var publicInvoiceWireSchema = external_exports.object({
2519
2543
  cashapp_qrcode: external_exports.string().nullable().optional(),
2520
2544
  created_at: external_exports.string().optional(),
2521
2545
  crypto_address: external_exports.string().nullable().optional(),
2522
- crypto_amount: stringOrNumberSchema.optional(),
2546
+ // null when the invoice has no crypto leg (card, PayPal, unselected gateway).
2547
+ crypto_amount: stringOrNumberSchema.nullable().optional(),
2523
2548
  crypto_confirmations_needed: external_exports.number().nullable().optional(),
2524
2549
  crypto_exchange_rate: stringOrNumberSchema.nullable().optional(),
2525
- crypto_received: stringOrNumberSchema.optional(),
2550
+ crypto_received: stringOrNumberSchema.nullable().optional(),
2526
2551
  crypto_uri: external_exports.string().nullable().optional(),
2527
2552
  developer_invoice: external_exports.unknown().optional(),
2528
2553
  developer_return_url: external_exports.string().nullable().optional(),
@@ -6031,10 +6056,38 @@ function resolveUtmParameters(storeSlug) {
6031
6056
  return Object.keys(stored).length > 0 ? stored : void 0;
6032
6057
  }
6033
6058
 
6059
+ // ../sdk/src/core/page-path.ts
6060
+ var MAX_PATH_LENGTH = 256;
6061
+ function resolveStorefrontPagePath() {
6062
+ if (typeof window === "undefined") return void 0;
6063
+ let pathname;
6064
+ try {
6065
+ const location = window.location;
6066
+ pathname = typeof location?.pathname === "string" && location.pathname ? location.pathname : new URL(String(location?.href ?? "")).pathname;
6067
+ } catch {
6068
+ return void 0;
6069
+ }
6070
+ if (!pathname || !pathname.startsWith("/")) return void 0;
6071
+ return pathname.slice(0, MAX_PATH_LENGTH);
6072
+ }
6073
+
6074
+ // ../sdk/src/core/page-tracker.ts
6075
+ var PLATFORM_PAGE_TRACKER_FLAG = "__shoppexPageTracker";
6076
+ function isPlatformPageTrackerActive() {
6077
+ if (typeof window === "undefined") return false;
6078
+ try {
6079
+ return Boolean(window[PLATFORM_PAGE_TRACKER_FLAG]);
6080
+ } catch {
6081
+ return false;
6082
+ }
6083
+ }
6084
+
6034
6085
  // ../sdk/src/modules/analytics.ts
6035
6086
  async function trackPageView(cartValue, itemCount) {
6036
6087
  if (!isInitialized()) return;
6037
6088
  if (typeof document === "undefined") return;
6089
+ const carriesCart = cartValue !== void 0 || itemCount !== void 0;
6090
+ if (isPlatformPageTrackerActive() && !carriesCart) return;
6038
6091
  const config = getConfig();
6039
6092
  const connectionId = getStorefrontConnectionId(config.storeSlug);
6040
6093
  try {
@@ -6049,6 +6102,7 @@ async function trackPageView(cartValue, itemCount) {
6049
6102
  cart_value: cartValue ?? void 0,
6050
6103
  item_count: itemCount ?? void 0,
6051
6104
  connection_id: connectionId ?? void 0,
6105
+ path: resolveStorefrontPagePath(),
6052
6106
  utm: resolveUtmParameters(config.storeSlug)
6053
6107
  })
6054
6108
  });
@@ -6094,6 +6148,9 @@ async function touchStorefrontPresence() {
6094
6148
  if (typeof document === "undefined") {
6095
6149
  return { success: false, message: "Document is not available" };
6096
6150
  }
6151
+ if (isPlatformPageTrackerActive()) {
6152
+ return { success: true, message: "Presence is reported by the storefront page tracker" };
6153
+ }
6097
6154
  const config = getConfig();
6098
6155
  const shopId = getShopId();
6099
6156
  const endpoint = shopId ? buildEndpoint("/v1/storefront/shops/id/:id/ping", { id: shopId }) : buildEndpoint("/v1/storefront/shops/:storeSlug/ping", {
@@ -6104,6 +6161,7 @@ async function touchStorefrontPresence() {
6104
6161
  {
6105
6162
  referer: document.referrer || void 0,
6106
6163
  connection_id: getStorefrontConnectionId(config.storeSlug) ?? void 0,
6164
+ path: resolveStorefrontPagePath(),
6107
6165
  utm: resolveUtmParameters(config.storeSlug)
6108
6166
  },
6109
6167
  {