@shoppexio/storefront 1.0.79 → 1.0.81

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-QNHOMMRG.js";
26
26
 
27
27
  // ../sdk/src/core/errors.ts
28
28
  var CURRENCY_UNAVAILABLE_ERROR_CODE = "errors.storefront.currency_unavailable";
@@ -2519,10 +2519,11 @@ var publicInvoiceWireSchema = external_exports.object({
2519
2519
  cashapp_qrcode: external_exports.string().nullable().optional(),
2520
2520
  created_at: external_exports.string().optional(),
2521
2521
  crypto_address: external_exports.string().nullable().optional(),
2522
- crypto_amount: stringOrNumberSchema.optional(),
2522
+ // null when the invoice has no crypto leg (card, PayPal, unselected gateway).
2523
+ crypto_amount: stringOrNumberSchema.nullable().optional(),
2523
2524
  crypto_confirmations_needed: external_exports.number().nullable().optional(),
2524
2525
  crypto_exchange_rate: stringOrNumberSchema.nullable().optional(),
2525
- crypto_received: stringOrNumberSchema.optional(),
2526
+ crypto_received: stringOrNumberSchema.nullable().optional(),
2526
2527
  crypto_uri: external_exports.string().nullable().optional(),
2527
2528
  developer_invoice: external_exports.unknown().optional(),
2528
2529
  developer_return_url: external_exports.string().nullable().optional(),
@@ -4121,8 +4122,7 @@ async function captureAffiliateFromUrl(param = "ref") {
4121
4122
  if (!code) return null;
4122
4123
  const held = getStoredAffiliate();
4123
4124
  const holdsOtherCode = held !== null && held.code !== code;
4124
- const mayHoldFirstClick = holdsOtherCode && held.mode === "FIRST_CLICK";
4125
- if (!mayHoldFirstClick) {
4125
+ if (!holdsOtherCode) {
4126
4126
  setAffiliateCode(code, held?.windowDays ?? DEFAULT_TTL_DAYS, held?.mode);
4127
4127
  }
4128
4128
  if (isInitialized()) {
@@ -4145,14 +4145,12 @@ async function captureAffiliateFromUrl(param = "ref") {
4145
4145
  const heldMode = res.success && res.data?.held_attribution_mode ? normalizeMode(res.data.held_attribution_mode) : null;
4146
4146
  const holdsFirstClick = holdsOtherCode && (heldMode ?? held?.mode) === "FIRST_CLICK";
4147
4147
  if (holdsFirstClick && held) {
4148
- if (!mayHoldFirstClick) {
4149
- restoreStoredAffiliate({
4150
- code: held.code,
4151
- expiresAt: held.expiresAt,
4152
- windowDays: held.windowDays,
4153
- mode: heldMode ?? "FIRST_CLICK"
4154
- });
4155
- }
4148
+ restoreStoredAffiliate({
4149
+ code: held.code,
4150
+ expiresAt: held.expiresAt,
4151
+ windowDays: held.windowDays,
4152
+ mode: heldMode ?? held.mode
4153
+ });
4156
4154
  return held.code;
4157
4155
  }
4158
4156
  if (res.success && res.data?.accepted && res.data.affiliate_code) {
@@ -4160,15 +4158,16 @@ async function captureAffiliateFromUrl(param = "ref") {
4160
4158
  return res.data.affiliate_code;
4161
4159
  }
4162
4160
  if (res.success && res.data && res.data.accepted === false) {
4161
+ if (holdsOtherCode) return held.code;
4163
4162
  clearAffiliateCode();
4164
4163
  return null;
4165
4164
  }
4166
- return mayHoldFirstClick ? held.code : code;
4165
+ return holdsOtherCode ? held.code : code;
4167
4166
  } catch {
4168
- return mayHoldFirstClick ? held.code : code;
4167
+ return holdsOtherCode ? held.code : code;
4169
4168
  }
4170
4169
  }
4171
- return mayHoldFirstClick ? held.code : code;
4170
+ return holdsOtherCode ? held.code : code;
4172
4171
  }
4173
4172
 
4174
4173
  // ../sdk/src/utils/cart-line-id.ts