brainerce 1.50.0 → 1.52.0

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.mts CHANGED
@@ -1522,6 +1522,30 @@ interface Order {
1522
1522
  shippedAt?: string | null;
1523
1523
  /** ISO-8601 timestamp when the order was delivered. */
1524
1524
  deliveredAt?: string | null;
1525
+ /**
1526
+ * The live carrier service the shopper chose and was charged for at
1527
+ * checkout. Admin reads only (`getOrder` / `getOrders`); the buyer-facing
1528
+ * order endpoints never return it.
1529
+ *
1530
+ * `null` when no live carrier rate was sold — flat-rate or zone shipping,
1531
+ * pickup, or an imported order. Use it to re-find the service the shopper
1532
+ * paid for in a fresh quote from {@link BrainerceClient.getOrderShippingRates}
1533
+ * before buying a label: match on `carrier` + `service`, case- and
1534
+ * whitespace-insensitively. The rate id itself is not carried, because it
1535
+ * names a shipment the carrier created at quote time and does not survive a
1536
+ * re-quote.
1537
+ */
1538
+ shippingSelection?: {
1539
+ /** Carrier code as the carrier reported it, e.g. `"USPS"`. */
1540
+ carrier: string | null;
1541
+ /** Service code as the carrier reported it, e.g. `"Priority"`. */
1542
+ service: string | null;
1543
+ /** The label the shopper actually saw, e.g. `"USPS Priority Mail"`. */
1544
+ methodName: string | null;
1545
+ /** Shipping charged at checkout, in the order's `currency`. `"0"` when a
1546
+ * free-shipping threshold zeroed it — the shopper still chose the service. */
1547
+ amount: string | null;
1548
+ } | null;
1525
1549
  /** Status timeline entries in chronological order. */
1526
1550
  statusHistory?: OrderStatusChange[] | null;
1527
1551
  }
@@ -2278,6 +2302,13 @@ interface Cart {
2278
2302
  currency: string;
2279
2303
  /** Optional notes on the cart */
2280
2304
  notes?: string | null;
2305
+ /**
2306
+ * GA4 gtag.js stitch ids, if the storefront forwarded them (via
2307
+ * `loadGoogleAnalytics()` or manually). Used server-side to join a
2308
+ * server-sent purchase conversion to this browser's GA4 session.
2309
+ */
2310
+ analyticsClientId?: string | null;
2311
+ analyticsSessionId?: string | null;
2281
2312
  /**
2282
2313
  * Cart subtotal as a string (e.g., "59.98").
2283
2314
  * Use parseFloat() for calculations.
@@ -2327,12 +2358,33 @@ interface Cart {
2327
2358
  */
2328
2359
  reservation?: ReservationInfo;
2329
2360
  }
2361
+ interface CreateCartOptions {
2362
+ /** Existing session token to re-attach to (rare — usually omit and let the server mint one). */
2363
+ sessionToken?: string;
2364
+ /** Customer id to associate the cart with (admin / server-to-server callers only). */
2365
+ customerId?: string;
2366
+ /**
2367
+ * GA4 gtag.js stitch ids. Auto-attached by the SDK when
2368
+ * `loadGoogleAnalytics()` has resolved them; pass explicitly to override.
2369
+ */
2370
+ analyticsClientId?: string;
2371
+ analyticsSessionId?: string;
2372
+ }
2330
2373
  interface AddToCartDto {
2331
2374
  productId: string;
2332
2375
  variantId?: string;
2333
2376
  quantity: number;
2334
2377
  notes?: string;
2335
2378
  metadata?: Record<string, unknown>;
2379
+ /**
2380
+ * GA4 gtag.js `client_id` (from `gtag('get', measurementId, 'client_id', cb)`).
2381
+ * Auto-attached by the SDK when `loadGoogleAnalytics()` has resolved one;
2382
+ * pass explicitly to override. Omit if unavailable — never send a
2383
+ * synthesized id.
2384
+ */
2385
+ analyticsClientId?: string;
2386
+ /** GA4 gtag.js `session_id`, forwarded alongside `analyticsClientId`. */
2387
+ analyticsSessionId?: string;
2336
2388
  /**
2337
2389
  * Modifier-group selections for restaurant / customizable products
2338
2390
  * (e.g., toppings, sauces, sides). The server validates against effective
@@ -2785,6 +2837,29 @@ interface ShippingRate {
2785
2837
  carrier?: string;
2786
2838
  /** Service level (e.g., "ground", "express") - only for carrier rates */
2787
2839
  service?: string;
2840
+ /**
2841
+ * Where this rate sits among the live carrier options.
2842
+ *
2843
+ * **Render this and `estimatedDays`, not `name`.** A shopper chooses between
2844
+ * how fast and how much; `name` carries the carrier's own service identifier
2845
+ * — `USPS ExpressMailInternational`, `USAExportPBA USAExportStandard` — which
2846
+ * tells them nothing. Label the tiers in your own words and locale:
2847
+ *
2848
+ * ```typescript
2849
+ * const label = {
2850
+ * cheapest: 'Standard delivery',
2851
+ * balanced: 'Express delivery',
2852
+ * fastest: 'Priority delivery',
2853
+ * }[rate.speedTier ?? 'cheapest'];
2854
+ * ```
2855
+ *
2856
+ * Derived per quote rather than mapped from service names, so a carrier you
2857
+ * have never heard of tiers correctly with no lookup table.
2858
+ *
2859
+ * Absent on manual zone rates — the merchant named those deliberately, and
2860
+ * you should show their name as written.
2861
+ */
2862
+ speedTier?: 'cheapest' | 'balanced' | 'fastest';
2788
2863
  }
2789
2864
  /**
2790
2865
  * Pickup location details for local pickup orders.
@@ -3054,6 +3129,12 @@ interface SetCheckoutCustomerDto {
3054
3129
  * Send an empty string to clear a previously-set note.
3055
3130
  */
3056
3131
  notes?: string;
3132
+ /**
3133
+ * GA4 gtag.js stitch ids. Auto-attached by the SDK when
3134
+ * `loadGoogleAnalytics()` has resolved them; pass explicitly to override.
3135
+ */
3136
+ analyticsClientId?: string;
3137
+ analyticsSessionId?: string;
3057
3138
  }
3058
3139
  /**
3059
3140
  * Shipping address with customer email (required for checkout).
@@ -3081,6 +3162,45 @@ interface SetShippingAddressDto {
3081
3162
  * the dashboard and included in the confirmation email. Max 2000 chars.
3082
3163
  */
3083
3164
  notes?: string;
3165
+ /**
3166
+ * GA4 gtag.js stitch ids. Auto-attached by the SDK when
3167
+ * `loadGoogleAnalytics()` has resolved them; pass explicitly to override.
3168
+ */
3169
+ analyticsClientId?: string;
3170
+ analyticsSessionId?: string;
3171
+ /**
3172
+ * The `placeId` of the autocomplete suggestion the shopper picked (from
3173
+ * `addressAutocomplete()`). Send it whenever the address came from the
3174
+ * autocomplete.
3175
+ *
3176
+ * The server re-resolves it to exact rooftop coordinates and matches
3177
+ * polygon ("draw on map") shipping zones against those. Without it, zone
3178
+ * matching falls back to geocoding the address lines, which is materially
3179
+ * less accurate — a same-named street in a neighbouring city can outrank
3180
+ * the right one, putting the shopper in the wrong zone or in none at all.
3181
+ * If your store uses polygon zones, passing this is the difference between
3182
+ * reliable and roughly-right delivery pricing.
3183
+ *
3184
+ * **Clear it if the shopper edits any address field after picking.** The
3185
+ * coordinates belong to the suggestion, not to whatever is in the inputs
3186
+ * now — a stale `placeId` would match zones against the address they
3187
+ * originally picked. Dropping it falls back to geocoding the edited text,
3188
+ * which is the correct behaviour once the two no longer agree.
3189
+ *
3190
+ * Note there is deliberately no `lat`/`lng` field: zone matching decides
3191
+ * which shipping rate is offered and charged, so coordinates are never
3192
+ * accepted from the client.
3193
+ */
3194
+ placeId?: string;
3195
+ /**
3196
+ * The same `sessionToken` you passed to `addressAutocomplete()` for the
3197
+ * calls that produced `placeId`. Optional — the resolved place is cached
3198
+ * server-side for 24h by `placeId`, so the normal
3199
+ * autocomplete → `getAddressDetails()` → here flow hits that cache. Pass it
3200
+ * when you have it so a cache miss still bills within the original
3201
+ * autocomplete session instead of opening a new one.
3202
+ */
3203
+ placeSessionToken?: string;
3084
3204
  }
3085
3205
  /**
3086
3206
  * Billing address (email not required - already set in shipping address)
@@ -3335,9 +3455,29 @@ interface UpdateOrderShippingDto {
3335
3455
  phone?: string;
3336
3456
  }
3337
3457
  interface FulfillOrderDto {
3458
+ /** Carrier tracking number. Send an empty string to clear a wrong one. */
3338
3459
  trackingNumber?: string;
3460
+ /** Carrier name/code shown to the shopper (`ups`, `Israel Post`, …). */
3339
3461
  trackingCompany?: string;
3462
+ /**
3463
+ * Absolute `http(s)` link to the carrier's tracking page. The shipped email
3464
+ * only renders its "Track Your Order" button when this is present — a bare
3465
+ * tracking number gives the shopper nothing to click. Any other scheme is
3466
+ * rejected.
3467
+ */
3468
+ trackingUrl?: string;
3469
+ /**
3470
+ * Email the shopper. Defaults to `true` on a first fulfilment and to
3471
+ * `false` when correcting the tracking of an order that already shipped.
3472
+ */
3340
3473
  notifyCustomer?: boolean;
3474
+ /**
3475
+ * Ship an order whose payment was never confirmed — COD, bank transfer,
3476
+ * net terms, or an order created through the API. Without it those orders
3477
+ * are refused, and there is no other way to mark them paid. `CANCELLED`,
3478
+ * `REFUNDED` and voided orders are still refused regardless.
3479
+ */
3480
+ allowUnpaidFulfillment?: boolean;
3341
3481
  }
3342
3482
  interface CompleteDraftDto {
3343
3483
  paymentPending?: boolean;
@@ -4660,6 +4800,38 @@ interface PublicMetafieldDefinition {
4660
4800
  defaultValue?: string | null;
4661
4801
  position: number;
4662
4802
  }
4803
+ /**
4804
+ * One facet value bucket with the number of DISTINCT active products carrying
4805
+ * it. For MULTI_SELECT definitions the stored arrays are split — a product
4806
+ * holding `["a","b"]` counts once for `a` and once for `b`. BOOLEAN buckets
4807
+ * normalize to `'true'` / `'false'`. Declared `enumValues` are always present
4808
+ * (including zero-count entries, so the UI can render disabled options);
4809
+ * stray stored values outside `enumValues` are reported as-is.
4810
+ */
4811
+ interface MetafieldFilterValue {
4812
+ value: string;
4813
+ count: number;
4814
+ }
4815
+ /**
4816
+ * A filterable metafield definition plus per-value product counts — one entry
4817
+ * per facet the storefront should render. Returned by
4818
+ * {@link BrainerceClient.getMetafieldFilters}. `name` is localized per the
4819
+ * request locale. Pair the `key` with
4820
+ * `getProducts({ metafields: { [key]: [value] } })`.
4821
+ */
4822
+ interface MetafieldFilter {
4823
+ id: string;
4824
+ key: string;
4825
+ name: string;
4826
+ type: MetafieldType;
4827
+ /** Declared allowed values for SELECT / MULTI_SELECT fields (with optional swatch metadata). */
4828
+ enumValues: CustomizationFieldOption[];
4829
+ values: MetafieldFilterValue[];
4830
+ }
4831
+ /** Response of `GET /metafield-filters` (vibe-coded and storefront modes). */
4832
+ interface MetafieldFiltersResponse {
4833
+ filters: MetafieldFilter[];
4834
+ }
4663
4835
  /**
4664
4836
  * A single selectable option for a SELECT or MULTI_SELECT customization field.
4665
4837
  * Legacy string-only `enumValues` arrays are automatically promoted to this shape.
@@ -6065,6 +6237,12 @@ interface BrainerceApiError {
6065
6237
  details?: unknown;
6066
6238
  }
6067
6239
 
6240
+ declare global {
6241
+ interface Window {
6242
+ dataLayer?: unknown[];
6243
+ gtag?: (...args: unknown[]) => void;
6244
+ }
6245
+ }
6068
6246
  /**
6069
6247
  * BCP-47 primary subtags whose script is written right-to-left. Inlined in the
6070
6248
  * SDK so storefronts don't take a runtime dependency on `@brainerce/types`.
@@ -6123,6 +6301,8 @@ declare class BrainerceClient {
6123
6301
  * so the recovered cart shows up with zero per-store code.
6124
6302
  */
6125
6303
  private _pendingRecoverCartId;
6304
+ private _ga4MeasurementId;
6305
+ private _ga4StitchPromise;
6126
6306
  /** localStorage key for session cart reference (sessionToken + cartId) */
6127
6307
  private readonly SESSION_CART_KEY;
6128
6308
  /**
@@ -6293,6 +6473,58 @@ declare class BrainerceClient {
6293
6473
  * omits credentials (cookieless), and never throws.
6294
6474
  */
6295
6475
  private sendAnalyticsBeacon;
6476
+ /**
6477
+ * Load GA4's `gtag.js` and start resolving the `client_id`/`session_id`
6478
+ * "stitch" ids Google needs to join a later server-side purchase conversion
6479
+ * to this browser's GA4 session (without them, a server-sent purchase event
6480
+ * either gets rejected or creates a phantom user in GA4). Call this once,
6481
+ * as early as possible (app entry / root layout).
6482
+ *
6483
+ * `createCart()`, `addToCart()`, `setCheckoutCustomer()`, and
6484
+ * `setShippingAddress()` all auto-attach the resolved ids once available —
6485
+ * an explicit `analyticsClientId`/`analyticsSessionId` you pass to any of
6486
+ * those always wins over the auto-captured value. You only need to call
6487
+ * this once; every subsequent cart/checkout call benefits automatically.
6488
+ *
6489
+ * Ids are resolved via `gtag('get', measurementId, 'client_id' | 'session_id', cb)`
6490
+ * — Google's documented method — never by parsing the `_ga` cookie, which
6491
+ * is undocumented and breaks silently across cookie-format changes and
6492
+ * Consent Mode v2 states. If the shopper has denied analytics consent,
6493
+ * gtag reports no client_id and the ids are simply omitted — never
6494
+ * synthesized.
6495
+ *
6496
+ * No-op outside the browser (SSR-safe) and never throws — a blocked or
6497
+ * slow gtag just means server-side conversions won't stitch; it never
6498
+ * breaks the storefront or delays checkout by more than `options.timeoutMs`.
6499
+ *
6500
+ * @example
6501
+ * ```typescript
6502
+ * // Call once, e.g. in your root layout / app entry point
6503
+ * client.loadGoogleAnalytics('G-XXXXXXX');
6504
+ *
6505
+ * // Every cart/checkout call from here on auto-forwards the stitch ids —
6506
+ * // no other code changes needed.
6507
+ * const cart = await client.createCart();
6508
+ * await client.addToCart(cart.id, { productId: 'prod_abc', quantity: 1 });
6509
+ * ```
6510
+ */
6511
+ loadGoogleAnalytics(measurementId: string, options?: {
6512
+ timeoutMs?: number;
6513
+ }): void;
6514
+ /**
6515
+ * Resolve GA4's `client_id`/`session_id` via `gtag('get', ...)`, bounded by
6516
+ * `timeoutMs` so a slow/blocked gtag never hangs a cart/checkout call.
6517
+ * Resolves to `{}` (never rejects) on timeout, missing gtag, or denied
6518
+ * consent.
6519
+ */
6520
+ private resolveGa4StitchIds;
6521
+ /**
6522
+ * Merge the resolved GA4 stitch ids onto a request body — only for fields
6523
+ * the caller didn't already set explicitly (explicit values always win).
6524
+ * No-op (returns `dto` unchanged) if `loadGoogleAnalytics()` was never
6525
+ * called, or if it hasn't resolved any ids by the time this is awaited.
6526
+ */
6527
+ private withAnalyticsStitchIds;
6296
6528
  /**
6297
6529
  * Get a list of products with pagination and filtering
6298
6530
  * Works in vibe-coded, storefront (public), and admin mode
@@ -6736,13 +6968,23 @@ declare class BrainerceClient {
6736
6968
  updateOrderShipping(orderId: string, data: UpdateOrderShippingDto): Promise<Order>;
6737
6969
  /**
6738
6970
  * Create a shipping label for an order via the installed App Store shipping app.
6739
- * Pass the rate ID returned from checkout rate shopping. Billing goes directly
6740
- * to the merchant's carrier account Brainerce is not a billing intermediary.
6971
+ * Pass the rate ID returned from rate shopping treat it as opaque and never
6972
+ * parse it. Billing goes directly to the merchant's carrier account; Brainerce
6973
+ * is not a billing intermediary.
6974
+ *
6975
+ * `labelFormat` defaults to `PDF`. Use `ZPL` or `EPL` for warehouse thermal
6976
+ * printers. If the carrier cannot produce the requested format it returns its
6977
+ * closest match rather than failing the purchase — check the response.
6978
+ *
6979
+ * Once the label exists, tracking updates arrive automatically: the carrier's
6980
+ * webhooks move the shipment through in-transit → delivered and complete the
6981
+ * order. No polling required.
6741
6982
  *
6742
6983
  * @example
6743
6984
  * ```typescript
6744
6985
  * const label = await client.createShippingLabel('order_abc', {
6745
6986
  * rateId: 'rate_8f123456789abcdef',
6987
+ * labelFormat: 'ZPL',
6746
6988
  * });
6747
6989
  * console.log('Label URL:', label.labelUrl);
6748
6990
  * console.log('Tracking:', label.trackingNumber);
@@ -6751,12 +6993,83 @@ declare class BrainerceClient {
6751
6993
  createShippingLabel(orderId: string, data: {
6752
6994
  rateId: string;
6753
6995
  parcel?: Record<string, string>;
6996
+ labelFormat?: 'PDF' | 'PNG' | 'ZPL' | 'EPL';
6997
+ /**
6998
+ * Cross-border only. The declaration itself is built from the order's
6999
+ * line items; this just says what the parcel is. Ignored domestically.
7000
+ */
7001
+ customsContentsType?: 'merchandise' | 'gift' | 'documents' | 'sample' | 'return';
6754
7002
  }): Promise<{
6755
7003
  shipmentId: string;
6756
7004
  labelUrl: string;
6757
7005
  trackingNumber: string;
6758
7006
  carrier: string;
7007
+ labelFormat?: string;
6759
7008
  }>;
7009
+ /**
7010
+ * Live carrier rates for an order, from the merchant's installed shipping app.
7011
+ *
7012
+ * Call this immediately before {@link createShippingLabel} and pass the chosen
7013
+ * `id` straight through — the id is opaque and must not be parsed. It is also
7014
+ * short-lived: this call is what creates the shipment at the carrier, so a
7015
+ * rate from an old call may no longer be purchasable.
7016
+ *
7017
+ * Returns `[]` when the store has no shipping app installed, or when the
7018
+ * order has no usable shipping address.
7019
+ *
7020
+ * @example
7021
+ * ```typescript
7022
+ * const rates = await client.getOrderShippingRates('order_abc');
7023
+ * const cheapest = rates[0];
7024
+ * const label = await client.createShippingLabel('order_abc', { rateId: cheapest.id });
7025
+ * ```
7026
+ */
7027
+ getOrderShippingRates(orderId: string): Promise<Array<{
7028
+ id: string;
7029
+ name: string;
7030
+ description: string | null;
7031
+ price: string;
7032
+ currency: string;
7033
+ estimatedDays: number | null;
7034
+ carrier: string | null;
7035
+ service: string | null;
7036
+ }>>;
7037
+ /**
7038
+ * Shipments recorded for an order, each with its tracking history.
7039
+ *
7040
+ * History arrives on its own: the carrier's webhooks flow through the
7041
+ * installed shipping app and append events as the parcel moves. Poll this for
7042
+ * display if you need it; do not poll expecting to *drive* anything.
7043
+ */
7044
+ getOrderShipments(orderId: string): Promise<Array<{
7045
+ id: string;
7046
+ carrier: string;
7047
+ service: string | null;
7048
+ status: string;
7049
+ trackingNumber: string | null;
7050
+ trackingUrl: string | null;
7051
+ labelUrl: string | null;
7052
+ labelFormat: string | null;
7053
+ estimatedDeliveryDate: string | null;
7054
+ actualDeliveryDate: string | null;
7055
+ /** What the carrier charged the merchant, in `rateCurrency`. */
7056
+ rate: string | null;
7057
+ rateCurrency: string;
7058
+ createdAt: string;
7059
+ /** Newest first, capped at the 200 most recent. */
7060
+ events: Array<{
7061
+ status: string;
7062
+ statusDetail: string | null;
7063
+ message: string;
7064
+ location: {
7065
+ city?: string;
7066
+ state?: string;
7067
+ country?: string;
7068
+ zip?: string;
7069
+ } | null;
7070
+ occurredAt: string;
7071
+ }>;
7072
+ }>>;
6760
7073
  /**
6761
7074
  * Cancel an order
6762
7075
  * Works for Shopify and WooCommerce orders that haven't been fulfilled
@@ -6769,16 +7082,31 @@ declare class BrainerceClient {
6769
7082
  */
6770
7083
  cancelOrder(orderId: string): Promise<Order>;
6771
7084
  /**
6772
- * Fulfill an order (mark as shipped)
6773
- * Works for Shopify and WooCommerce orders
7085
+ * Fulfill an order (mark as shipped), or correct the tracking of an order
7086
+ * that has already shipped.
7087
+ *
7088
+ * Pass `trackingUrl` alongside the number — the shipped email only renders
7089
+ * its "Track Your Order" button when a URL is present.
7090
+ *
7091
+ * Calling this again on an order that is already `SHIPPED`/`FULFILLED` with
7092
+ * tracking fields edits only those fields: the status does not move, the
7093
+ * ship date is not rewritten, and no fulfilment event fires. That is the way
7094
+ * to fix a mistyped tracking number.
6774
7095
  *
6775
7096
  * @example
6776
7097
  * ```typescript
6777
- * const order = await client.fulfillOrder('order_123', {
7098
+ * // First fulfilment emails the shopper by default.
7099
+ * await client.fulfillOrder('order_123', {
6778
7100
  * trackingNumber: '1Z999AA10123456784',
6779
7101
  * trackingCompany: 'UPS',
7102
+ * trackingUrl: 'https://www.ups.com/track?tracknum=1Z999AA10123456784',
6780
7103
  * notifyCustomer: true,
6781
7104
  * });
7105
+ *
7106
+ * // Correction — silent unless you opt back in.
7107
+ * await client.fulfillOrder('order_123', {
7108
+ * trackingNumber: '1Z999AA10123456785',
7109
+ * });
6782
7110
  * ```
6783
7111
  */
6784
7112
  fulfillOrder(orderId: string, data?: FulfillOrderDto): Promise<Order>;
@@ -7282,11 +7610,25 @@ declare class BrainerceClient {
7282
7610
  *
7283
7611
  * @param provider - OAuth provider ('GOOGLE', 'FACEBOOK', 'GITHUB')
7284
7612
  * @param options - Optional configuration
7285
- * @param options.redirectUrl - Full absolute URL to redirect to after OAuth completes (must include origin)
7286
- *
7287
- * @example
7288
- * ```typescript
7289
- * // Get authorization URL (redirectUrl MUST be absolute with origin)
7613
+ * @param options.redirectUrl - Where to send the browser once OAuth finishes
7614
+ * on success *and* on failure. Validated server-side against the sales
7615
+ * channel's trusted origins, so what is accepted depends on the mode:
7616
+ * - vibe-coded (`salesChannelId: 'vc_*'`): an absolute URL on the channel's
7617
+ * registered `domain` or one of its `allowedOrigins`; in TEST mode, any
7618
+ * `localhost`/`127.0.0.1` port. A relative path (`/auth/callback`) also
7619
+ * works — it is resolved against the channel's `domain` on the way back,
7620
+ * so the channel must have one registered.
7621
+ * - storefront (`storeId`): **social login cannot round-trip in this mode.**
7622
+ * No channel is bound to the request, so an absolute URL has no
7623
+ * trusted-origin list to match (400 at this call) and a relative path has
7624
+ * no origin to resolve against on the way back. Use a `salesChannelId`
7625
+ * connection for OAuth.
7626
+ * Anything invalid fails fast here, before the shopper ever reaches the
7627
+ * provider.
7628
+ *
7629
+ * @example
7630
+ * ```typescript
7631
+ * // Vibe-coded mode — absolute URL on the registered storefront domain
7290
7632
  * const { authorizationUrl } = await client.getOAuthAuthorizeUrl('GOOGLE', {
7291
7633
  * redirectUrl: window.location.origin + '/auth/callback'
7292
7634
  * });
@@ -7303,7 +7645,17 @@ declare class BrainerceClient {
7303
7645
  * client.setCustomerToken(result.token);
7304
7646
  * // result.customer, result.isNewCustomer, result.redirectUrl, ...
7305
7647
  * } else if (params.get('oauth_error')) {
7306
- * // Show error
7648
+ * // Failures land on this same page, on `redirectUrl` — never on the API
7649
+ * // host. `oauth_error` is a stable snake_case code (see OAuthErrorCode);
7650
+ * // `error_description` is English developer detail, not shopper copy.
7651
+ * const code = params.get('oauth_error') as OAuthErrorCode;
7652
+ * showMessage(
7653
+ * code === 'link_blocked_unverified_password_account'
7654
+ * ? t('auth.verifyEmailFirst') // send them to email verification
7655
+ * : code === 'state_expired'
7656
+ * ? t('auth.sessionExpiredRetry')
7657
+ * : t('auth.signInFailed')
7658
+ * );
7307
7659
  * }
7308
7660
  * ```
7309
7661
  */
@@ -7709,6 +8061,9 @@ declare class BrainerceClient {
7709
8061
  * Create a new cart for a guest user
7710
8062
  * Returns a cart with a sessionToken that identifies this cart
7711
8063
  *
8064
+ * If `loadGoogleAnalytics()` was called and has resolved a GA4 client/session
8065
+ * id, it's auto-attached unless `options` already specifies one.
8066
+ *
7712
8067
  * @example
7713
8068
  * ```typescript
7714
8069
  * const cart = await client.createCart();
@@ -7716,7 +8071,7 @@ declare class BrainerceClient {
7716
8071
  * // Store sessionToken in localStorage or cookie
7717
8072
  * ```
7718
8073
  */
7719
- createCart(): Promise<Cart>;
8074
+ createCart(options?: CreateCartOptions): Promise<Cart>;
7720
8075
  /**
7721
8076
  * Get a cart by session token (for guest users)
7722
8077
  *
@@ -8479,6 +8834,12 @@ declare class BrainerceClient {
8479
8834
  * should include an optional "Order notes" textarea by default and send its
8480
8835
  * value here (or via `setCheckoutCustomer`). The note lands on the order.
8481
8836
  *
8837
+ * **Pass `placeId` whenever the address came from `addressAutocomplete()`.**
8838
+ * The server re-resolves it to exact coordinates and matches polygon
8839
+ * ("draw on map") shipping zones against those instead of re-geocoding the
8840
+ * address text — which is materially less accurate and can place the
8841
+ * shopper in a neighbouring city's zone, or in none at all.
8842
+ *
8482
8843
  * @example
8483
8844
  * ```typescript
8484
8845
  * const { checkout, rates } = await client.setShippingAddress('checkout_123', {
@@ -8491,6 +8852,8 @@ declare class BrainerceClient {
8491
8852
  * postalCode: '10001',
8492
8853
  * country: 'US',
8493
8854
  * notes: 'Please leave the package at the door', // optional order notes
8855
+ * placeId: suggestion.placeId, // from addressAutocomplete()
8856
+ * placeSessionToken: sessionToken, // the same token used for it
8494
8857
  * });
8495
8858
  * console.log('Available rates:', rates);
8496
8859
  * ```
@@ -10144,6 +10507,29 @@ declare class BrainerceClient {
10144
10507
  getPublicMetafieldDefinitions(): Promise<{
10145
10508
  definitions: PublicMetafieldDefinition[];
10146
10509
  }>;
10510
+ /**
10511
+ * Get facet value counts for filterable metafield definitions — one entry
10512
+ * per definition the merchant marked `filterable: true` (types SELECT /
10513
+ * MULTI_SELECT / BOOLEAN), each with DISTINCT-product counts per value.
10514
+ * Powers faceted navigation ("Color: red (12) / blue (3)") without one
10515
+ * `getProducts` round trip per candidate value.
10516
+ *
10517
+ * Available in vibe-coded and storefront modes. On the vibe-coded surface
10518
+ * only definitions published to your connection are returned, and counts
10519
+ * reflect only products published to it.
10520
+ *
10521
+ * @example
10522
+ * ```typescript
10523
+ * const { filters } = await client.getMetafieldFilters();
10524
+ * for (const f of filters) {
10525
+ * // f.key pairs with getProducts({ metafields: { [f.key]: [value] } })
10526
+ * console.log(f.name, f.values); // [{ value: 'red', count: 12 }, ...]
10527
+ * }
10528
+ * ```
10529
+ */
10530
+ getMetafieldFilters(params?: {
10531
+ locale?: string;
10532
+ }): Promise<MetafieldFiltersResponse>;
10147
10533
  /**
10148
10534
  * Get all metafield definitions for the store
10149
10535
  * Requires Admin mode (apiKey)
@@ -10651,7 +11037,7 @@ declare class BrainerceError extends Error {
10651
11037
  constructor(message: string, statusCode: number, details?: unknown);
10652
11038
  }
10653
11039
 
10654
- declare const SDK_VERSION = "1.48.0";
11040
+ declare const SDK_VERSION = "1.52.0";
10655
11041
 
10656
11042
  /**
10657
11043
  * Verify a webhook signature from Brainerce
@@ -10814,6 +11200,53 @@ interface StoreLocalParts {
10814
11200
  * Falls back to UTC parts on an invalid IANA timezone string — never throws.
10815
11201
  */
10816
11202
  declare function resolveStoreLocalParts(instant: Date, timezone: string): StoreLocalParts;
11203
+ interface ParsedDateFieldValue {
11204
+ /**
11205
+ * The absolute instant the value denotes. For a DATE field this is UTC
11206
+ * midnight of the authored day, matching what `isDateValueAllowed`'s DATE
11207
+ * branch expects.
11208
+ */
11209
+ instant: Date;
11210
+ /**
11211
+ * The canonical form to persist: `"YYYY-MM-DD"` for DATE, an ISO-8601 UTC
11212
+ * instant (`"…Z"`) for DATETIME. Storing this instead of the caller's raw
11213
+ * string is what keeps a column from accumulating `"2026-08-06"`,
11214
+ * `"2026-07-16 10:00"` and `"2026-08-13T13:00-14:00"` side by side.
11215
+ */
11216
+ normalized: string;
11217
+ }
11218
+ /**
11219
+ * Discriminated by a STRING, not a boolean: `apps/backend` compiles with
11220
+ * `strictNullChecks: false`, where TypeScript refuses to narrow a union on a
11221
+ * `true`/`false` literal discriminant, so `if (!result.ok)` would leave every
11222
+ * backend call site unable to reach `.reason`. Do not "simplify" this back to
11223
+ * `ok: boolean`.
11224
+ */
11225
+ type DateFieldParseResult = {
11226
+ status: 'valid';
11227
+ value: ParsedDateFieldValue;
11228
+ } | {
11229
+ status: 'invalid';
11230
+ reason: string;
11231
+ };
11232
+ /**
11233
+ * Strict parse of a customer- or admin-submitted DATE/DATETIME field value.
11234
+ *
11235
+ * Replaces a bare `new Date(raw)`, which is far too permissive for a value that
11236
+ * gets persisted: it accepts implementation-defined shapes, silently reads a
11237
+ * trailing `-14:00` slot label as a UTC offset, and resolves an offsetless
11238
+ * datetime in the *server's* timezone rather than the store's.
11239
+ *
11240
+ * Accepted:
11241
+ * - DATE: `YYYY-MM-DD` only. A time-of-day would be meaningless and, worse,
11242
+ * could shift the authored calendar day, so a datetime is truncated to its
11243
+ * literal date part rather than round-tripped through a timezone.
11244
+ * - DATETIME: `YYYY-MM-DDTHH:mm[:ss[.sss]]` with an optional `Z` or
11245
+ * `±HH:mm` offset (a space may replace the `T`). **Without an offset the
11246
+ * value is resolved in the store's timezone**, the only frame a store-scoped
11247
+ * field has. A date with no time at all means midnight, store-local.
11248
+ */
11249
+ declare function parseDateFieldValue(raw: unknown, fieldType: 'DATE' | 'DATETIME', timezone: string): DateFieldParseResult;
10817
11250
  /** Day-level gate: minDate/maxDate/blockedWeekdays/blockedDates only (no time-of-day). */
10818
11251
  declare function isCalendarDateAllowed(dateYYYYMMDD: string, config: DateAvailabilityConstraints | null | undefined): boolean;
10819
11252
  /**
@@ -10833,6 +11266,19 @@ declare function isCalendarDateAllowed(dateYYYYMMDD: string, config: DateAvailab
10833
11266
  * ```
10834
11267
  */
10835
11268
  declare function computeAvailableSlots(config: DateAvailabilityConstraints | null | undefined, dateYYYYMMDD: string): string[];
11269
+ /**
11270
+ * The open/close windows that apply on one calendar date — `[]` when the date
11271
+ * is blocked outright or the weekday has no window (which, per
11272
+ * `BusinessHoursWindow`'s contract, means closed all day).
11273
+ *
11274
+ * Exists because `computeAvailableSlots` returns `[]` in two very different
11275
+ * situations: "nothing is bookable that day" and "this field isn't slot-based
11276
+ * at all" (`slotDurationMinutes` unset). A storefront rendering a picker needs
11277
+ * to tell those apart — non-empty here with empty slots means "bound a free
11278
+ * time input by these windows", which is exactly what `isDateValueAllowed`
11279
+ * enforces on the way back in.
11280
+ */
11281
+ declare function getBusinessHoursForDate(config: DateAvailabilityConstraints | null | undefined, dateYYYYMMDD: string): BusinessHoursWindow[];
10836
11282
  /**
10837
11283
  * Full value validation for a candidate date/datetime a shopper is about to
10838
11284
  * submit — use this to disable a "Continue" button client-side before the
@@ -10989,4 +11435,4 @@ interface CategorySitemapOptions {
10989
11435
  */
10990
11436
  declare function getCategorySitemapEntries(client: BrainerceClient, opts: CategorySitemapOptions): Promise<SitemapEntry[]>;
10991
11437
 
10992
- export { type AddToCartDto, type AddressDetailsResult, type AddressSuggestion, type AnnouncementContent, type AnnouncementSeverity, type AppliedDiscount, type ApplyCouponDto, type AttachModifierGroupInput, type Attribute, type AttributeOption, type AttributeSource, type BlogSitemapOptions, type BrainerceApiError, BrainerceClient, type BrainerceClientOptions, BrainerceError, type Brand, type BulkInventoryResponse, type BulkSaveVariantsDto, type BulkSaveVariantsResponse, type BulkVariantInput, type BusinessHoursWindow, type Cart, type CartAppliedDiscount, type CartBundleOffer, type CartBundlesResponse, type CartIncludeOption, type CartIncludeOptions, type CartItem, type CartItemModifierLine, type CartNudge, type CartRecommendationsResponse, type CartStatus, type CartUpgradeSuggestion, type CartUpgradesResponse, type CartWithIncludes, type Category, type CategoryDetail, type CategoryNode, type CategorySitemapOptions, type CategorySuggestion, type Checkout, type CheckoutAddress, type CheckoutBumpsResponse, type CheckoutCustomFieldDefinition, type CheckoutFieldPricing, type CheckoutFieldVisibility, type CheckoutLineItem, type CheckoutPrefillData, type CheckoutStatus, type CompleteCheckoutResponse, type CompleteDraftDto, type ConfigureOAuthProviderDto as ConfigureOAuthProviderInput, type ConflictStatus, type ConnectorPlatform, type ContactFormFieldType, type ContactFormFieldValidation, type ContactFormPublic, type ContactFormPublicField, type ContactFormSummary, type Content, type ContentDataMap, type ContentStatus, type ContentSummary, type ContentType, type Coupon, type CouponCreateResponse, type CouponQueryParams, type CouponStatus, type CouponType, type CouponValidationWarning, type CreateAddressDto, type CreateAttributeDto as CreateAttributeInput, type CreateAttributeOptionDto as CreateAttributeOptionInput, type CreateBrandDto as CreateBrandInput, type CreateCategoryDto as CreateCategoryInput, type CreateCheckoutDto, type CreateContentInput, type CreateCouponDto, type CreateCustomApiDto, type CreateCustomerDto, type CreateEmailTemplateDto as CreateEmailTemplateInput, type CreateGuestOrderDto, type CreateInquiryInput, type CreateInquiryResponse, type CreateMetafieldDefinitionDto as CreateMetafieldDefinitionInput, type CreateModifierGroupInput, type CreateModifierInput, type CreateOrderDto, type CreateProductDto, type CreateRefundDto, type CreateShippingRateDto as CreateShippingRateInput, type CreateShippingZoneDto as CreateShippingZoneInput, type CreateTagDto as CreateTagInput, type CreateTaxRateDto as CreateTaxRateInput, type CreateVariantDto, type CustomApiAuthType, type CustomApiConnectionStatus, type CustomApiCredentials, type CustomApiIntegration, type CustomApiSyncConfig, type CustomApiSyncDirection, type CustomApiTestResult, type Customer, type CustomerAddress, type CustomerAuthResponse, type CustomerOAuthProvider, type CustomerProfile, type CustomerQueryParams, type DateAvailabilityConstraints, type DeleteProductResponse, type DiscountBanner, type DiscountRuleType, type DownloadFile, type DraftLineItem, type EditInventoryDto, type EmailDomain, type EmailEventSettings, type EmailEventType, type EmailSettings, type EmailTemplate, type EmailTemplatePreview, type EmailTemplatesResponse, type EmailVerificationResponse, type ExtendReservationResponse, type FaqContent, type FaqItem, type FooterColumn, type FooterContent, type FooterLink, type FooterSocialLink, type FormatPriceOptions, type FormatProductPriceOptions, type FreeAllocationPolicy, type FulfillOrderDto, type GuestCheckoutStartResponse, type GuestOrderResponse, type HeaderContent, type HeaderCta, type HeaderLogo, type HeaderNavItem, type InsufficientStockError, type InventoryInfo, type InventoryReservationStrategy, type InventorySyncStatus, type InventoryTrackingMode, type InvitationStatus, type InviteMemberDto as InviteMemberInput, type InviteStoreMemberDto as InviteStoreMemberInput, type JsonLdOptions, type ListModifierGroupsParams, type LocalCart, type LocalCartItem, type LockedVariant, type LoyaltyNextTierSummary, type LoyaltyReward, type LoyaltyStatus, type LoyaltyTierSummary, type MergeCartsDto, type MetafieldConflict, type MetafieldConflictResolution, type MetafieldDefinition, type MetafieldType, type Modifier, type ModifierGroup, type ModifierSelection, type ModifierSelectionType, type ModifierValidationCode, type ModifierValidationError, type MyProductReview, type OAuthAuthorizeResponse, type OAuthCallbackResponse, type OAuthConnection, type OAuthConnectionsResponse, type OAuthProviderConfig, type OAuthProviderType, type OAuthProvidersResponse, type Order, type OrderAddress, type OrderBump, type OrderCustomer, type OrderDownloadLink, type OrderItem, type OrderQueryParams, type OrderStatus, type OrderStatusChange, type PageContent, type PageSeo, type PaginatedResponse, type PaymentClientSdk, type PaymentConfig, type PaymentIntent, type PaymentProvider, type PaymentProviderConfig, type PaymentProvidersConfig, type PaymentStatus, type PaymentUrlOptions, type PickupLocation, type PlatformCouponCapabilities, type PlatformMetafieldMetadata, type PreviewEmailTemplateDto as PreviewEmailTemplateInput, type Product, type ProductAttributeInput, type ProductAvailability, type ProductCustomizationField, type ProductDiscount, type ProductDiscountBadge, type ProductImage, type ProductMetafield, type ProductMetafieldValue, type ProductModifierGroupAttachment, type ProductQueryParams, type ProductRecommendation, type ProductRecommendationsResponse, type ProductRelationType, type ProductReview, type ProductReviewAdmin, type ProductSuggestion, type ProductVariant, type PublicMetafieldDefinition, type PublishProductResponse, RTL_LOCALES, type RecommendationVariant, type ReconcileInventoryResponse, type RedeemRewardResult, type ReferralInfo, type Refund, type RefundLineItem, type RefundLineItemResponse, type RefundType, type RegisterCustomerDto, type ReservationInfo, type ResolveMetafieldConflictDto as ResolveMetafieldConflictInput, type ResolveSyncConflictDto as ResolveSyncConflictInput, type RichTextContent, SDK_VERSION, type SearchSuggestions, type SelectPickupLocationDto, type SelectShippingMethodDto, type SendInvoiceDto, type SessionCartRef, type SetBillingAddressDto, type SetCheckoutCustomFieldsDto, type SetCheckoutCustomerDto, type SetDefinitionProductsDto as SetDefinitionProductsInput, type SetMetafieldPlatformsDto as SetMetafieldPlatformsInput, type SetShippingAddressDto, type SetShippingAddressResponse, type ShippingDestinations, type ShippingLine, type ShippingRate, type ShippingRateConfig, type ShippingRateType, type ShippingSummaryEntry, type ShippingZone, type ShippingZoneQueryParams, type SitemapEntry, type StockAvailabilityRequest, type StockAvailabilityResponse, type StockAvailabilityResult, type StoreInfo, type StoreInvitation, type StoreInvitationDetails, type StoreMember, type StorePermission, type StoreRole, type StoreTeamResponse, type SubmitProductReviewInput, type SupportedLocaleObject, type SyncConflict, type SyncConflictResolution, type SyncJob, type Tag, type TaxBreakdown, type TaxBreakdownItem, type TaxRate, type TaxonomyQueryParams, type TeamInvitation, type TeamInvitationsResponse, type TeamMember, type TeamMembersResponse, type TeamRole, type UpdateAddressDto, type UpdateAttachmentInput, type UpdateAttributeDto as UpdateAttributeInput, type UpdateAttributeOptionDto as UpdateAttributeOptionInput, type UpdateBrandDto as UpdateBrandInput, type UpdateCartItemDto, type UpdateCategoryDto as UpdateCategoryInput, type UpdateContentInput, type UpdateCouponDto, type UpdateCustomApiDto, type UpdateCustomerDto, type UpdateDraftDto, type UpdateEmailSettingsDto as UpdateEmailSettingsInput, type UpdateEmailTemplateDto as UpdateEmailTemplateInput, type UpdateInventoryDto, type UpdateMemberRoleDto as UpdateMemberRoleInput, type UpdateMetafieldDefinitionDto as UpdateMetafieldDefinitionInput, type UpdateModifierGroupInput, type UpdateModifierInput, type UpdateOAuthProviderDto as UpdateOAuthProviderInput, type UpdateOrderDto, type UpdateOrderShippingDto, type UpdateProductDto, type UpdateShippingRateDto as UpdateShippingRateInput, type UpdateShippingZoneDto as UpdateShippingZoneInput, type UpdateStoreMemberDto as UpdateStoreMemberInput, type UpdateTagDto as UpdateTagInput, type UpdateTaxRateDto as UpdateTaxRateInput, type UpdateVariantDto, type UpdateVariantInventoryDto, type UpsertProductMetafieldDto as UpsertProductMetafieldInput, type UserStore, type UserStorePermissions, type VariantInventoryResponse, type VariantPlatformOverlay, type VariantStatus, type WaitForOrderOptions, type WaitForOrderResult, type WebhookEvent, type WebhookEventType, type WriteProductReviewInput, buildArticleJsonLd, buildBreadcrumbJsonLd, buildCollectionPageJsonLd, buildOrganizationJsonLd, buildProductJsonLd, buildWebsiteJsonLd, computeAvailableSlots, createWebhookHandler, deriveSeoDescription, enableDevGuards, formatMoney, formatPrice, formatProductPrice, formatVariantPrice, getBlogSitemapEntries, getCartItemImage, getCartItemName, getCartTotals, getCategorySitemapEntries, getDescriptionContent, getDirectionForLocale, formatPrice as getPriceDisplay, getProductCustomizationFields, getProductMetafield, getProductMetafieldValue, getProductMetafieldsByType, getProductPrice, getProductPriceInfo, getProductSwatches, getStockStatus, getVariantOptions, getVariantPrice, isAllowedPaymentUrl, isCalendarDateAllowed, isCouponApplicableToProduct, isDateValueAllowed, isHtmlDescription, isWebhookEventType, jsonLdScriptProps, parseWebhookEvent, resolveStoreLocalParts, safePaymentRedirect, stripHtml, validateDateAvailabilityConfig, verifyWebhook };
11438
+ export { type AddToCartDto, type AddressDetailsResult, type AddressSuggestion, type AnnouncementContent, type AnnouncementSeverity, type AppliedDiscount, type ApplyCouponDto, type AttachModifierGroupInput, type Attribute, type AttributeOption, type AttributeSource, type BlogSitemapOptions, type BrainerceApiError, BrainerceClient, type BrainerceClientOptions, BrainerceError, type Brand, type BulkInventoryResponse, type BulkSaveVariantsDto, type BulkSaveVariantsResponse, type BulkVariantInput, type BusinessHoursWindow, type Cart, type CartAppliedDiscount, type CartBundleOffer, type CartBundlesResponse, type CartIncludeOption, type CartIncludeOptions, type CartItem, type CartItemModifierLine, type CartNudge, type CartRecommendationsResponse, type CartStatus, type CartUpgradeSuggestion, type CartUpgradesResponse, type CartWithIncludes, type Category, type CategoryDetail, type CategoryNode, type CategorySitemapOptions, type CategorySuggestion, type Checkout, type CheckoutAddress, type CheckoutBumpsResponse, type CheckoutCustomFieldDefinition, type CheckoutFieldPricing, type CheckoutFieldVisibility, type CheckoutLineItem, type CheckoutPrefillData, type CheckoutStatus, type CompleteCheckoutResponse, type CompleteDraftDto, type ConfigureOAuthProviderDto as ConfigureOAuthProviderInput, type ConflictStatus, type ConnectorPlatform, type ContactFormFieldType, type ContactFormFieldValidation, type ContactFormPublic, type ContactFormPublicField, type ContactFormSummary, type Content, type ContentDataMap, type ContentStatus, type ContentSummary, type ContentType, type Coupon, type CouponCreateResponse, type CouponQueryParams, type CouponStatus, type CouponType, type CouponValidationWarning, type CreateAddressDto, type CreateAttributeDto as CreateAttributeInput, type CreateAttributeOptionDto as CreateAttributeOptionInput, type CreateBrandDto as CreateBrandInput, type CreateCategoryDto as CreateCategoryInput, type CreateCheckoutDto, type CreateContentInput, type CreateCouponDto, type CreateCustomApiDto, type CreateCustomerDto, type CreateEmailTemplateDto as CreateEmailTemplateInput, type CreateGuestOrderDto, type CreateInquiryInput, type CreateInquiryResponse, type CreateMetafieldDefinitionDto as CreateMetafieldDefinitionInput, type CreateModifierGroupInput, type CreateModifierInput, type CreateOrderDto, type CreateProductDto, type CreateRefundDto, type CreateShippingRateDto as CreateShippingRateInput, type CreateShippingZoneDto as CreateShippingZoneInput, type CreateTagDto as CreateTagInput, type CreateTaxRateDto as CreateTaxRateInput, type CreateVariantDto, type CustomApiAuthType, type CustomApiConnectionStatus, type CustomApiCredentials, type CustomApiIntegration, type CustomApiSyncConfig, type CustomApiSyncDirection, type CustomApiTestResult, type Customer, type CustomerAddress, type CustomerAuthResponse, type CustomerOAuthProvider, type CustomerProfile, type CustomerQueryParams, type DateAvailabilityConstraints, type DateFieldParseResult, type DeleteProductResponse, type DiscountBanner, type DiscountRuleType, type DownloadFile, type DraftLineItem, type EditInventoryDto, type EmailDomain, type EmailEventSettings, type EmailEventType, type EmailSettings, type EmailTemplate, type EmailTemplatePreview, type EmailTemplatesResponse, type EmailVerificationResponse, type ExtendReservationResponse, type FaqContent, type FaqItem, type FooterColumn, type FooterContent, type FooterLink, type FooterSocialLink, type FormatPriceOptions, type FormatProductPriceOptions, type FreeAllocationPolicy, type FulfillOrderDto, type GuestCheckoutStartResponse, type GuestOrderResponse, type HeaderContent, type HeaderCta, type HeaderLogo, type HeaderNavItem, type InsufficientStockError, type InventoryInfo, type InventoryReservationStrategy, type InventorySyncStatus, type InventoryTrackingMode, type InvitationStatus, type InviteMemberDto as InviteMemberInput, type InviteStoreMemberDto as InviteStoreMemberInput, type JsonLdOptions, type ListModifierGroupsParams, type LocalCart, type LocalCartItem, type LockedVariant, type LoyaltyNextTierSummary, type LoyaltyReward, type LoyaltyStatus, type LoyaltyTierSummary, type MergeCartsDto, type MetafieldConflict, type MetafieldConflictResolution, type MetafieldDefinition, type MetafieldFilter, type MetafieldFilterValue, type MetafieldFiltersResponse, type MetafieldType, type Modifier, type ModifierGroup, type ModifierSelection, type ModifierSelectionType, type ModifierValidationCode, type ModifierValidationError, type MyProductReview, type OAuthAuthorizeResponse, type OAuthCallbackResponse, type OAuthConnection, type OAuthConnectionsResponse, type OAuthProviderConfig, type OAuthProviderType, type OAuthProvidersResponse, type Order, type OrderAddress, type OrderBump, type OrderCustomer, type OrderDownloadLink, type OrderItem, type OrderQueryParams, type OrderStatus, type OrderStatusChange, type PageContent, type PageSeo, type PaginatedResponse, type ParsedDateFieldValue, type PaymentClientSdk, type PaymentConfig, type PaymentIntent, type PaymentProvider, type PaymentProviderConfig, type PaymentProvidersConfig, type PaymentStatus, type PaymentUrlOptions, type PickupLocation, type PlatformCouponCapabilities, type PlatformMetafieldMetadata, type PreviewEmailTemplateDto as PreviewEmailTemplateInput, type Product, type ProductAttributeInput, type ProductAvailability, type ProductCustomizationField, type ProductDiscount, type ProductDiscountBadge, type ProductImage, type ProductMetafield, type ProductMetafieldValue, type ProductModifierGroupAttachment, type ProductQueryParams, type ProductRecommendation, type ProductRecommendationsResponse, type ProductRelationType, type ProductReview, type ProductReviewAdmin, type ProductSuggestion, type ProductVariant, type PublicMetafieldDefinition, type PublishProductResponse, RTL_LOCALES, type RecommendationVariant, type ReconcileInventoryResponse, type RedeemRewardResult, type ReferralInfo, type Refund, type RefundLineItem, type RefundLineItemResponse, type RefundType, type RegisterCustomerDto, type ReservationInfo, type ResolveMetafieldConflictDto as ResolveMetafieldConflictInput, type ResolveSyncConflictDto as ResolveSyncConflictInput, type RichTextContent, SDK_VERSION, type SearchSuggestions, type SelectPickupLocationDto, type SelectShippingMethodDto, type SendInvoiceDto, type SessionCartRef, type SetBillingAddressDto, type SetCheckoutCustomFieldsDto, type SetCheckoutCustomerDto, type SetDefinitionProductsDto as SetDefinitionProductsInput, type SetMetafieldPlatformsDto as SetMetafieldPlatformsInput, type SetShippingAddressDto, type SetShippingAddressResponse, type ShippingDestinations, type ShippingLine, type ShippingRate, type ShippingRateConfig, type ShippingRateType, type ShippingSummaryEntry, type ShippingZone, type ShippingZoneQueryParams, type SitemapEntry, type StockAvailabilityRequest, type StockAvailabilityResponse, type StockAvailabilityResult, type StoreInfo, type StoreInvitation, type StoreInvitationDetails, type StoreMember, type StorePermission, type StoreRole, type StoreTeamResponse, type SubmitProductReviewInput, type SupportedLocaleObject, type SyncConflict, type SyncConflictResolution, type SyncJob, type Tag, type TaxBreakdown, type TaxBreakdownItem, type TaxRate, type TaxonomyQueryParams, type TeamInvitation, type TeamInvitationsResponse, type TeamMember, type TeamMembersResponse, type TeamRole, type UpdateAddressDto, type UpdateAttachmentInput, type UpdateAttributeDto as UpdateAttributeInput, type UpdateAttributeOptionDto as UpdateAttributeOptionInput, type UpdateBrandDto as UpdateBrandInput, type UpdateCartItemDto, type UpdateCategoryDto as UpdateCategoryInput, type UpdateContentInput, type UpdateCouponDto, type UpdateCustomApiDto, type UpdateCustomerDto, type UpdateDraftDto, type UpdateEmailSettingsDto as UpdateEmailSettingsInput, type UpdateEmailTemplateDto as UpdateEmailTemplateInput, type UpdateInventoryDto, type UpdateMemberRoleDto as UpdateMemberRoleInput, type UpdateMetafieldDefinitionDto as UpdateMetafieldDefinitionInput, type UpdateModifierGroupInput, type UpdateModifierInput, type UpdateOAuthProviderDto as UpdateOAuthProviderInput, type UpdateOrderDto, type UpdateOrderShippingDto, type UpdateProductDto, type UpdateShippingRateDto as UpdateShippingRateInput, type UpdateShippingZoneDto as UpdateShippingZoneInput, type UpdateStoreMemberDto as UpdateStoreMemberInput, type UpdateTagDto as UpdateTagInput, type UpdateTaxRateDto as UpdateTaxRateInput, type UpdateVariantDto, type UpdateVariantInventoryDto, type UpsertProductMetafieldDto as UpsertProductMetafieldInput, type UserStore, type UserStorePermissions, type VariantInventoryResponse, type VariantPlatformOverlay, type VariantStatus, type WaitForOrderOptions, type WaitForOrderResult, type WebhookEvent, type WebhookEventType, type WriteProductReviewInput, buildArticleJsonLd, buildBreadcrumbJsonLd, buildCollectionPageJsonLd, buildOrganizationJsonLd, buildProductJsonLd, buildWebsiteJsonLd, computeAvailableSlots, createWebhookHandler, deriveSeoDescription, enableDevGuards, formatMoney, formatPrice, formatProductPrice, formatVariantPrice, getBlogSitemapEntries, getBusinessHoursForDate, getCartItemImage, getCartItemName, getCartTotals, getCategorySitemapEntries, getDescriptionContent, getDirectionForLocale, formatPrice as getPriceDisplay, getProductCustomizationFields, getProductMetafield, getProductMetafieldValue, getProductMetafieldsByType, getProductPrice, getProductPriceInfo, getProductSwatches, getStockStatus, getVariantOptions, getVariantPrice, isAllowedPaymentUrl, isCalendarDateAllowed, isCouponApplicableToProduct, isDateValueAllowed, isHtmlDescription, isWebhookEventType, jsonLdScriptProps, parseDateFieldValue, parseWebhookEvent, resolveStoreLocalParts, safePaymentRedirect, stripHtml, validateDateAvailabilityConfig, verifyWebhook };