@shopify/hydrogen 2026.1.4 → 2026.4.1
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/customer-account-api-types.d.ts +23 -1
- package/dist/customer-account.schema.json +1 -1
- package/dist/development/index.cjs +261 -209
- package/dist/development/index.cjs.map +1 -1
- package/dist/development/index.js +261 -209
- package/dist/development/index.js.map +1 -1
- package/dist/oxygen/index.d.ts +63 -10
- package/dist/oxygen/index.js +21 -35
- package/dist/production/index.cjs +118 -150
- package/dist/production/index.cjs.map +1 -1
- package/dist/production/index.d.cts +173 -115
- package/dist/production/index.d.ts +173 -115
- package/dist/production/index.js +118 -150
- package/dist/production/index.js.map +1 -1
- package/dist/storefront-api-types.d.ts +1467 -443
- package/dist/storefront.schema.json +1 -1
- package/dist/vite/{chunk-ZSWP2RO7.js → chunk-4O5OI3OO.js} +0 -4
- package/dist/vite/{chunk-XTDF5RJS.js → chunk-QXBQVDMY.js} +1 -2
- package/dist/vite/hydrogen-middleware.js +2 -2
- package/dist/vite/plugin.js +2 -3
- package/dist/vite/request-events.d.ts +61 -2
- package/dist/vite/request-events.js +1 -1
- package/package.json +5 -5
|
@@ -267,7 +267,8 @@ function useCustomerPrivacy(props) {
|
|
|
267
267
|
useEffect(() => {
|
|
268
268
|
if (observing.current.customerPrivacy) return;
|
|
269
269
|
observing.current.customerPrivacy = true;
|
|
270
|
-
let
|
|
270
|
+
let backendConsentStub = null;
|
|
271
|
+
let fullCustomerPrivacy = null;
|
|
271
272
|
let customShopify = window.Shopify || void 0;
|
|
272
273
|
Object.defineProperty(window, "Shopify", {
|
|
273
274
|
configurable: true,
|
|
@@ -277,15 +278,16 @@ function useCustomerPrivacy(props) {
|
|
|
277
278
|
set(value) {
|
|
278
279
|
if (typeof value === "object" && value !== null && Object.keys(value).length === 0) {
|
|
279
280
|
customShopify = value;
|
|
281
|
+
backendConsentStub = { backendConsentEnabled: true };
|
|
280
282
|
Object.defineProperty(window.Shopify, "customerPrivacy", {
|
|
281
283
|
configurable: true,
|
|
282
284
|
get() {
|
|
283
|
-
return
|
|
285
|
+
return fullCustomerPrivacy ?? backendConsentStub;
|
|
284
286
|
},
|
|
285
287
|
set(value2) {
|
|
286
288
|
if (typeof value2 === "object" && value2 !== null && "setTrackingConsent" in value2) {
|
|
287
289
|
const customerPrivacy = value2;
|
|
288
|
-
|
|
290
|
+
fullCustomerPrivacy = {
|
|
289
291
|
...customerPrivacy,
|
|
290
292
|
// Note: this method is not used by the privacy-banner,
|
|
291
293
|
// it bundles its own setTrackingConsent.
|
|
@@ -295,7 +297,7 @@ function useCustomerPrivacy(props) {
|
|
|
295
297
|
};
|
|
296
298
|
customShopify = {
|
|
297
299
|
...customShopify,
|
|
298
|
-
customerPrivacy:
|
|
300
|
+
customerPrivacy: fullCustomerPrivacy
|
|
299
301
|
};
|
|
300
302
|
setLoaded.customerPrivacy();
|
|
301
303
|
}
|
|
@@ -420,7 +422,8 @@ function overridePrivacyBannerMethods({
|
|
|
420
422
|
}
|
|
421
423
|
function getCustomerPrivacy() {
|
|
422
424
|
try {
|
|
423
|
-
|
|
425
|
+
const cp = window.Shopify?.customerPrivacy;
|
|
426
|
+
return cp && "setTrackingConsent" in cp ? cp : null;
|
|
424
427
|
} catch (e) {
|
|
425
428
|
return null;
|
|
426
429
|
}
|
|
@@ -434,7 +437,7 @@ function getPrivacyBanner() {
|
|
|
434
437
|
}
|
|
435
438
|
|
|
436
439
|
// package.json
|
|
437
|
-
var version = "2026.1
|
|
440
|
+
var version = "2026.4.1";
|
|
438
441
|
|
|
439
442
|
// src/analytics-manager/ShopifyAnalytics.tsx
|
|
440
443
|
function getCustomerPrivacyRequired() {
|
|
@@ -957,7 +960,7 @@ function register(key) {
|
|
|
957
960
|
}
|
|
958
961
|
function shopifyCanTrack() {
|
|
959
962
|
try {
|
|
960
|
-
return window.Shopify.customerPrivacy
|
|
963
|
+
return window.Shopify.customerPrivacy?.analyticsProcessingAllowed?.() ?? false;
|
|
961
964
|
} catch (e) {
|
|
962
965
|
}
|
|
963
966
|
return false;
|
|
@@ -1830,7 +1833,7 @@ function generateUUID() {
|
|
|
1830
1833
|
}
|
|
1831
1834
|
|
|
1832
1835
|
// src/version.ts
|
|
1833
|
-
var LIB_VERSION = "2026.1
|
|
1836
|
+
var LIB_VERSION = "2026.4.1";
|
|
1834
1837
|
|
|
1835
1838
|
// src/utils/graphql.ts
|
|
1836
1839
|
function minifyQuery(string) {
|
|
@@ -2358,6 +2361,20 @@ function formatAPIResult(data, errors2) {
|
|
|
2358
2361
|
};
|
|
2359
2362
|
}
|
|
2360
2363
|
|
|
2364
|
+
// src/cart/queries/cart-query-helpers.ts
|
|
2365
|
+
function shouldIncludeVisitorConsent(input) {
|
|
2366
|
+
return input?.visitorConsent !== void 0;
|
|
2367
|
+
}
|
|
2368
|
+
function getInContextVariables(includeVisitorConsent = false) {
|
|
2369
|
+
const base = `$country: CountryCode = ZZ
|
|
2370
|
+
$language: LanguageCode`;
|
|
2371
|
+
return includeVisitorConsent ? `${base}
|
|
2372
|
+
$visitorConsent: VisitorConsent` : base;
|
|
2373
|
+
}
|
|
2374
|
+
function getInContextDirective(includeVisitorConsent = false) {
|
|
2375
|
+
return includeVisitorConsent ? "@inContext(country: $country, language: $language, visitorConsent: $visitorConsent)" : "@inContext(country: $country, language: $language)";
|
|
2376
|
+
}
|
|
2377
|
+
|
|
2361
2378
|
// src/cart/queries/cartGetDefault.ts
|
|
2362
2379
|
function cartGetDefault({
|
|
2363
2380
|
storefront,
|
|
@@ -2368,12 +2385,16 @@ function cartGetDefault({
|
|
|
2368
2385
|
return async (cartInput) => {
|
|
2369
2386
|
const cartId = getCartId();
|
|
2370
2387
|
if (!cartId) return null;
|
|
2388
|
+
const includeVisitorConsent = shouldIncludeVisitorConsent(cartInput);
|
|
2371
2389
|
const [isCustomerLoggedIn, { cart, errors: errors2 }] = await Promise.all([
|
|
2372
2390
|
customerAccount ? customerAccount.isLoggedIn() : false,
|
|
2373
|
-
storefront.query(
|
|
2374
|
-
|
|
2375
|
-
|
|
2376
|
-
|
|
2391
|
+
storefront.query(
|
|
2392
|
+
CART_QUERY(cartFragment, { includeVisitorConsent }),
|
|
2393
|
+
{
|
|
2394
|
+
variables: { cartId, ...cartInput },
|
|
2395
|
+
cache: storefront.CacheNone()
|
|
2396
|
+
}
|
|
2397
|
+
)
|
|
2377
2398
|
]);
|
|
2378
2399
|
if (isCustomerLoggedIn && cart?.checkoutUrl) {
|
|
2379
2400
|
const finalCheckoutUrl = new URL(cart.checkoutUrl);
|
|
@@ -2383,14 +2404,12 @@ function cartGetDefault({
|
|
|
2383
2404
|
return cart || errors2 ? formatAPIResult(cart, errors2) : null;
|
|
2384
2405
|
};
|
|
2385
2406
|
}
|
|
2386
|
-
var CART_QUERY = (cartFragment = DEFAULT_CART_FRAGMENT) => `#graphql
|
|
2407
|
+
var CART_QUERY = (cartFragment = DEFAULT_CART_FRAGMENT, options = {}) => `#graphql
|
|
2387
2408
|
query CartQuery(
|
|
2388
2409
|
$cartId: ID!
|
|
2389
2410
|
$numCartLines: Int = 100
|
|
2390
|
-
$
|
|
2391
|
-
|
|
2392
|
-
$visitorConsent: VisitorConsent
|
|
2393
|
-
) @inContext(country: $country, language: $language, visitorConsent: $visitorConsent) {
|
|
2411
|
+
${getInContextVariables(options.includeVisitorConsent)}
|
|
2412
|
+
) ${getInContextDirective(options.includeVisitorConsent)} {
|
|
2394
2413
|
cart(id: $cartId) {
|
|
2395
2414
|
...CartApiQuery
|
|
2396
2415
|
}
|
|
@@ -2544,7 +2563,8 @@ function cartCreateDefault(options) {
|
|
|
2544
2563
|
const buyer = options.customerAccount ? await options.customerAccount.getBuyer() : void 0;
|
|
2545
2564
|
const { cartId, ...restOfOptionalParams } = optionalParams || {};
|
|
2546
2565
|
const { buyerIdentity, ...restOfInput } = input;
|
|
2547
|
-
const
|
|
2566
|
+
const includeVisitorConsent = shouldIncludeVisitorConsent(optionalParams);
|
|
2567
|
+
const { cartCreate, errors: errors2 } = await options.storefront.mutate(CART_CREATE_MUTATION(options.cartFragment, { includeVisitorConsent }), {
|
|
2548
2568
|
variables: {
|
|
2549
2569
|
input: {
|
|
2550
2570
|
...restOfInput,
|
|
@@ -2559,13 +2579,11 @@ function cartCreateDefault(options) {
|
|
|
2559
2579
|
return formatAPIResult(cartCreate, errors2);
|
|
2560
2580
|
};
|
|
2561
2581
|
}
|
|
2562
|
-
var CART_CREATE_MUTATION = (cartFragment = MINIMAL_CART_FRAGMENT) => `#graphql
|
|
2582
|
+
var CART_CREATE_MUTATION = (cartFragment = MINIMAL_CART_FRAGMENT, options = {}) => `#graphql
|
|
2563
2583
|
mutation cartCreate(
|
|
2564
2584
|
$input: CartInput!
|
|
2565
|
-
$
|
|
2566
|
-
|
|
2567
|
-
$visitorConsent: VisitorConsent
|
|
2568
|
-
) @inContext(country: $country, language: $language, visitorConsent: $visitorConsent) {
|
|
2585
|
+
${getInContextVariables(options.includeVisitorConsent)}
|
|
2586
|
+
) ${getInContextDirective(options.includeVisitorConsent)} {
|
|
2569
2587
|
cartCreate(input: $input) {
|
|
2570
2588
|
cart {
|
|
2571
2589
|
...CartApiMutation
|
|
@@ -2587,7 +2605,8 @@ var CART_CREATE_MUTATION = (cartFragment = MINIMAL_CART_FRAGMENT) => `#graphql
|
|
|
2587
2605
|
// src/cart/queries/cartLinesAddDefault.ts
|
|
2588
2606
|
function cartLinesAddDefault(options) {
|
|
2589
2607
|
return async (lines, optionalParams) => {
|
|
2590
|
-
const
|
|
2608
|
+
const includeVisitorConsent = shouldIncludeVisitorConsent(optionalParams);
|
|
2609
|
+
const { cartLinesAdd, errors: errors2 } = await options.storefront.mutate(CART_LINES_ADD_MUTATION(options.cartFragment, { includeVisitorConsent }), {
|
|
2591
2610
|
variables: {
|
|
2592
2611
|
cartId: options.getCartId(),
|
|
2593
2612
|
lines,
|
|
@@ -2597,14 +2616,12 @@ function cartLinesAddDefault(options) {
|
|
|
2597
2616
|
return formatAPIResult(cartLinesAdd, errors2);
|
|
2598
2617
|
};
|
|
2599
2618
|
}
|
|
2600
|
-
var CART_LINES_ADD_MUTATION = (cartFragment = MINIMAL_CART_FRAGMENT) => `#graphql
|
|
2619
|
+
var CART_LINES_ADD_MUTATION = (cartFragment = MINIMAL_CART_FRAGMENT, options = {}) => `#graphql
|
|
2601
2620
|
mutation cartLinesAdd(
|
|
2602
2621
|
$cartId: ID!
|
|
2603
2622
|
$lines: [CartLineInput!]!
|
|
2604
|
-
$
|
|
2605
|
-
|
|
2606
|
-
$visitorConsent: VisitorConsent
|
|
2607
|
-
) @inContext(country: $country, language: $language, visitorConsent: $visitorConsent) {
|
|
2623
|
+
${getInContextVariables(options.includeVisitorConsent)}
|
|
2624
|
+
) ${getInContextDirective(options.includeVisitorConsent)} {
|
|
2608
2625
|
cartLinesAdd(cartId: $cartId, lines: $lines) {
|
|
2609
2626
|
cart {
|
|
2610
2627
|
...CartApiMutation
|
|
@@ -2644,24 +2661,26 @@ function throwIfLinesAreOptimistic(type, lines) {
|
|
|
2644
2661
|
function cartLinesUpdateDefault(options) {
|
|
2645
2662
|
return async (lines, optionalParams) => {
|
|
2646
2663
|
throwIfLinesAreOptimistic("updateLines", lines);
|
|
2647
|
-
const
|
|
2648
|
-
|
|
2649
|
-
|
|
2650
|
-
|
|
2651
|
-
|
|
2664
|
+
const includeVisitorConsent = shouldIncludeVisitorConsent(optionalParams);
|
|
2665
|
+
const { cartLinesUpdate, errors: errors2 } = await options.storefront.mutate(
|
|
2666
|
+
CART_LINES_UPDATE_MUTATION(options.cartFragment, { includeVisitorConsent }),
|
|
2667
|
+
{
|
|
2668
|
+
variables: {
|
|
2669
|
+
cartId: options.getCartId(),
|
|
2670
|
+
lines,
|
|
2671
|
+
...optionalParams
|
|
2672
|
+
}
|
|
2652
2673
|
}
|
|
2653
|
-
|
|
2674
|
+
);
|
|
2654
2675
|
return formatAPIResult(cartLinesUpdate, errors2);
|
|
2655
2676
|
};
|
|
2656
2677
|
}
|
|
2657
|
-
var CART_LINES_UPDATE_MUTATION = (cartFragment = MINIMAL_CART_FRAGMENT) => `#graphql
|
|
2678
|
+
var CART_LINES_UPDATE_MUTATION = (cartFragment = MINIMAL_CART_FRAGMENT, options = {}) => `#graphql
|
|
2658
2679
|
mutation cartLinesUpdate(
|
|
2659
2680
|
$cartId: ID!
|
|
2660
2681
|
$lines: [CartLineUpdateInput!]!
|
|
2661
|
-
$
|
|
2662
|
-
|
|
2663
|
-
$visitorConsent: VisitorConsent
|
|
2664
|
-
) @inContext(country: $country, language: $language, visitorConsent: $visitorConsent) {
|
|
2682
|
+
${getInContextVariables(options.includeVisitorConsent)}
|
|
2683
|
+
) ${getInContextDirective(options.includeVisitorConsent)} {
|
|
2665
2684
|
cartLinesUpdate(cartId: $cartId, lines: $lines) {
|
|
2666
2685
|
cart {
|
|
2667
2686
|
...CartApiMutation
|
|
@@ -2683,24 +2702,26 @@ var CART_LINES_UPDATE_MUTATION = (cartFragment = MINIMAL_CART_FRAGMENT) => `#gra
|
|
|
2683
2702
|
function cartLinesRemoveDefault(options) {
|
|
2684
2703
|
return async (lineIds, optionalParams) => {
|
|
2685
2704
|
throwIfLinesAreOptimistic("removeLines", lineIds);
|
|
2686
|
-
const
|
|
2687
|
-
|
|
2688
|
-
|
|
2689
|
-
|
|
2690
|
-
|
|
2705
|
+
const includeVisitorConsent = shouldIncludeVisitorConsent(optionalParams);
|
|
2706
|
+
const { cartLinesRemove, errors: errors2 } = await options.storefront.mutate(
|
|
2707
|
+
CART_LINES_REMOVE_MUTATION(options.cartFragment, { includeVisitorConsent }),
|
|
2708
|
+
{
|
|
2709
|
+
variables: {
|
|
2710
|
+
cartId: options.getCartId(),
|
|
2711
|
+
lineIds,
|
|
2712
|
+
...optionalParams
|
|
2713
|
+
}
|
|
2691
2714
|
}
|
|
2692
|
-
|
|
2715
|
+
);
|
|
2693
2716
|
return formatAPIResult(cartLinesRemove, errors2);
|
|
2694
2717
|
};
|
|
2695
2718
|
}
|
|
2696
|
-
var CART_LINES_REMOVE_MUTATION = (cartFragment = MINIMAL_CART_FRAGMENT) => `#graphql
|
|
2719
|
+
var CART_LINES_REMOVE_MUTATION = (cartFragment = MINIMAL_CART_FRAGMENT, options = {}) => `#graphql
|
|
2697
2720
|
mutation cartLinesRemove(
|
|
2698
2721
|
$cartId: ID!
|
|
2699
2722
|
$lineIds: [ID!]!
|
|
2700
|
-
$
|
|
2701
|
-
|
|
2702
|
-
$visitorConsent: VisitorConsent
|
|
2703
|
-
) @inContext(country: $country, language: $language, visitorConsent: $visitorConsent) {
|
|
2723
|
+
${getInContextVariables(options.includeVisitorConsent)}
|
|
2724
|
+
) ${getInContextDirective(options.includeVisitorConsent)} {
|
|
2704
2725
|
cartLinesRemove(cartId: $cartId, lineIds: $lineIds) {
|
|
2705
2726
|
cart {
|
|
2706
2727
|
...CartApiMutation
|
|
@@ -2724,24 +2745,28 @@ function cartDiscountCodesUpdateDefault(options) {
|
|
|
2724
2745
|
const uniqueCodes = discountCodes.filter((value, index, array) => {
|
|
2725
2746
|
return array.indexOf(value) === index;
|
|
2726
2747
|
});
|
|
2727
|
-
const
|
|
2728
|
-
|
|
2729
|
-
|
|
2730
|
-
|
|
2731
|
-
|
|
2748
|
+
const includeVisitorConsent = shouldIncludeVisitorConsent(optionalParams);
|
|
2749
|
+
const { cartDiscountCodesUpdate, errors: errors2 } = await options.storefront.mutate(
|
|
2750
|
+
CART_DISCOUNT_CODE_UPDATE_MUTATION(options.cartFragment, {
|
|
2751
|
+
includeVisitorConsent
|
|
2752
|
+
}),
|
|
2753
|
+
{
|
|
2754
|
+
variables: {
|
|
2755
|
+
cartId: options.getCartId(),
|
|
2756
|
+
discountCodes: uniqueCodes,
|
|
2757
|
+
...optionalParams
|
|
2758
|
+
}
|
|
2732
2759
|
}
|
|
2733
|
-
|
|
2760
|
+
);
|
|
2734
2761
|
return formatAPIResult(cartDiscountCodesUpdate, errors2);
|
|
2735
2762
|
};
|
|
2736
2763
|
}
|
|
2737
|
-
var CART_DISCOUNT_CODE_UPDATE_MUTATION = (cartFragment = MINIMAL_CART_FRAGMENT) => `#graphql
|
|
2764
|
+
var CART_DISCOUNT_CODE_UPDATE_MUTATION = (cartFragment = MINIMAL_CART_FRAGMENT, options = {}) => `#graphql
|
|
2738
2765
|
mutation cartDiscountCodesUpdate(
|
|
2739
2766
|
$cartId: ID!
|
|
2740
2767
|
$discountCodes: [String!]!
|
|
2741
|
-
$
|
|
2742
|
-
|
|
2743
|
-
$visitorConsent: VisitorConsent
|
|
2744
|
-
) @inContext(country: $country, language: $language, visitorConsent: $visitorConsent) {
|
|
2768
|
+
${getInContextVariables(options.includeVisitorConsent)}
|
|
2769
|
+
) ${getInContextDirective(options.includeVisitorConsent)} {
|
|
2745
2770
|
cartDiscountCodesUpdate(cartId: $cartId, discountCodes: $discountCodes) {
|
|
2746
2771
|
... @defer {
|
|
2747
2772
|
cart {
|
|
@@ -2770,27 +2795,31 @@ function cartBuyerIdentityUpdateDefault(options) {
|
|
|
2770
2795
|
});
|
|
2771
2796
|
}
|
|
2772
2797
|
const buyer = options.customerAccount ? await options.customerAccount.getBuyer() : void 0;
|
|
2773
|
-
const
|
|
2774
|
-
|
|
2775
|
-
|
|
2776
|
-
|
|
2777
|
-
|
|
2778
|
-
|
|
2779
|
-
|
|
2780
|
-
|
|
2798
|
+
const includeVisitorConsent = shouldIncludeVisitorConsent(optionalParams);
|
|
2799
|
+
const { cartBuyerIdentityUpdate, errors: errors2 } = await options.storefront.mutate(
|
|
2800
|
+
CART_BUYER_IDENTITY_UPDATE_MUTATION(options.cartFragment, {
|
|
2801
|
+
includeVisitorConsent
|
|
2802
|
+
}),
|
|
2803
|
+
{
|
|
2804
|
+
variables: {
|
|
2805
|
+
cartId: options.getCartId(),
|
|
2806
|
+
buyerIdentity: {
|
|
2807
|
+
...buyer,
|
|
2808
|
+
...buyerIdentity
|
|
2809
|
+
},
|
|
2810
|
+
...optionalParams
|
|
2811
|
+
}
|
|
2781
2812
|
}
|
|
2782
|
-
|
|
2813
|
+
);
|
|
2783
2814
|
return formatAPIResult(cartBuyerIdentityUpdate, errors2);
|
|
2784
2815
|
};
|
|
2785
2816
|
}
|
|
2786
|
-
var CART_BUYER_IDENTITY_UPDATE_MUTATION = (cartFragment = MINIMAL_CART_FRAGMENT) => `#graphql
|
|
2817
|
+
var CART_BUYER_IDENTITY_UPDATE_MUTATION = (cartFragment = MINIMAL_CART_FRAGMENT, options = {}) => `#graphql
|
|
2787
2818
|
mutation cartBuyerIdentityUpdate(
|
|
2788
2819
|
$cartId: ID!
|
|
2789
2820
|
$buyerIdentity: CartBuyerIdentityInput!
|
|
2790
|
-
$
|
|
2791
|
-
|
|
2792
|
-
$visitorConsent: VisitorConsent
|
|
2793
|
-
) @inContext(country: $country, language: $language, visitorConsent: $visitorConsent) {
|
|
2821
|
+
${getInContextVariables(options.includeVisitorConsent)}
|
|
2822
|
+
) ${getInContextDirective(options.includeVisitorConsent)} {
|
|
2794
2823
|
cartBuyerIdentityUpdate(cartId: $cartId, buyerIdentity: $buyerIdentity) {
|
|
2795
2824
|
cart {
|
|
2796
2825
|
...CartApiMutation
|
|
@@ -2811,24 +2840,26 @@ var CART_BUYER_IDENTITY_UPDATE_MUTATION = (cartFragment = MINIMAL_CART_FRAGMENT)
|
|
|
2811
2840
|
// src/cart/queries/cartNoteUpdateDefault.ts
|
|
2812
2841
|
function cartNoteUpdateDefault(options) {
|
|
2813
2842
|
return async (note, optionalParams) => {
|
|
2814
|
-
const
|
|
2815
|
-
|
|
2816
|
-
|
|
2817
|
-
|
|
2818
|
-
|
|
2843
|
+
const includeVisitorConsent = shouldIncludeVisitorConsent(optionalParams);
|
|
2844
|
+
const { cartNoteUpdate, errors: errors2 } = await options.storefront.mutate(
|
|
2845
|
+
CART_NOTE_UPDATE_MUTATION(options.cartFragment, { includeVisitorConsent }),
|
|
2846
|
+
{
|
|
2847
|
+
variables: {
|
|
2848
|
+
cartId: options.getCartId(),
|
|
2849
|
+
note,
|
|
2850
|
+
...optionalParams
|
|
2851
|
+
}
|
|
2819
2852
|
}
|
|
2820
|
-
|
|
2853
|
+
);
|
|
2821
2854
|
return formatAPIResult(cartNoteUpdate, errors2);
|
|
2822
2855
|
};
|
|
2823
2856
|
}
|
|
2824
|
-
var CART_NOTE_UPDATE_MUTATION = (cartFragment = MINIMAL_CART_FRAGMENT) => `#graphql
|
|
2857
|
+
var CART_NOTE_UPDATE_MUTATION = (cartFragment = MINIMAL_CART_FRAGMENT, options = {}) => `#graphql
|
|
2825
2858
|
mutation cartNoteUpdate(
|
|
2826
2859
|
$cartId: ID!
|
|
2827
2860
|
$note: String!
|
|
2828
|
-
$
|
|
2829
|
-
|
|
2830
|
-
$visitorConsent: VisitorConsent
|
|
2831
|
-
) @inContext(country: $country, language: $language, visitorConsent: $visitorConsent) {
|
|
2861
|
+
${getInContextVariables(options.includeVisitorConsent)}
|
|
2862
|
+
) ${getInContextDirective(options.includeVisitorConsent)} {
|
|
2832
2863
|
cartNoteUpdate(cartId: $cartId, note: $note) {
|
|
2833
2864
|
cart {
|
|
2834
2865
|
...CartApiMutation
|
|
@@ -2849,24 +2880,28 @@ var CART_NOTE_UPDATE_MUTATION = (cartFragment = MINIMAL_CART_FRAGMENT) => `#grap
|
|
|
2849
2880
|
// src/cart/queries/cartSelectedDeliveryOptionsUpdateDefault.ts
|
|
2850
2881
|
function cartSelectedDeliveryOptionsUpdateDefault(options) {
|
|
2851
2882
|
return async (selectedDeliveryOptions, optionalParams) => {
|
|
2852
|
-
const
|
|
2853
|
-
|
|
2854
|
-
|
|
2855
|
-
|
|
2856
|
-
|
|
2883
|
+
const includeVisitorConsent = shouldIncludeVisitorConsent(optionalParams);
|
|
2884
|
+
const { cartSelectedDeliveryOptionsUpdate, errors: errors2 } = await options.storefront.mutate(
|
|
2885
|
+
CART_SELECTED_DELIVERY_OPTIONS_UPDATE_MUTATION(options.cartFragment, {
|
|
2886
|
+
includeVisitorConsent
|
|
2887
|
+
}),
|
|
2888
|
+
{
|
|
2889
|
+
variables: {
|
|
2890
|
+
cartId: options.getCartId(),
|
|
2891
|
+
selectedDeliveryOptions,
|
|
2892
|
+
...optionalParams
|
|
2893
|
+
}
|
|
2857
2894
|
}
|
|
2858
|
-
|
|
2895
|
+
);
|
|
2859
2896
|
return formatAPIResult(cartSelectedDeliveryOptionsUpdate, errors2);
|
|
2860
2897
|
};
|
|
2861
2898
|
}
|
|
2862
|
-
var CART_SELECTED_DELIVERY_OPTIONS_UPDATE_MUTATION = (cartFragment = MINIMAL_CART_FRAGMENT) => `#graphql
|
|
2899
|
+
var CART_SELECTED_DELIVERY_OPTIONS_UPDATE_MUTATION = (cartFragment = MINIMAL_CART_FRAGMENT, options = {}) => `#graphql
|
|
2863
2900
|
mutation cartSelectedDeliveryOptionsUpdate(
|
|
2864
2901
|
$cartId: ID!
|
|
2865
2902
|
$selectedDeliveryOptions: [CartSelectedDeliveryOptionInput!]!
|
|
2866
|
-
$
|
|
2867
|
-
|
|
2868
|
-
$visitorConsent: VisitorConsent
|
|
2869
|
-
) @inContext(country: $country, language: $language, visitorConsent: $visitorConsent) {
|
|
2903
|
+
${getInContextVariables(options.includeVisitorConsent)}
|
|
2904
|
+
) ${getInContextDirective(options.includeVisitorConsent)} {
|
|
2870
2905
|
cartSelectedDeliveryOptionsUpdate(cartId: $cartId, selectedDeliveryOptions: $selectedDeliveryOptions) {
|
|
2871
2906
|
cart {
|
|
2872
2907
|
...CartApiMutation
|
|
@@ -2887,24 +2922,28 @@ var CART_SELECTED_DELIVERY_OPTIONS_UPDATE_MUTATION = (cartFragment = MINIMAL_CAR
|
|
|
2887
2922
|
// src/cart/queries/cartAttributesUpdateDefault.ts
|
|
2888
2923
|
function cartAttributesUpdateDefault(options) {
|
|
2889
2924
|
return async (attributes, optionalParams) => {
|
|
2890
|
-
const
|
|
2891
|
-
|
|
2892
|
-
|
|
2893
|
-
|
|
2894
|
-
|
|
2925
|
+
const includeVisitorConsent = shouldIncludeVisitorConsent(optionalParams);
|
|
2926
|
+
const { cartAttributesUpdate, errors: errors2 } = await options.storefront.mutate(
|
|
2927
|
+
CART_ATTRIBUTES_UPDATE_MUTATION(options.cartFragment, {
|
|
2928
|
+
includeVisitorConsent
|
|
2929
|
+
}),
|
|
2930
|
+
{
|
|
2931
|
+
variables: {
|
|
2932
|
+
cartId: optionalParams?.cartId || options.getCartId(),
|
|
2933
|
+
attributes,
|
|
2934
|
+
...optionalParams
|
|
2935
|
+
}
|
|
2895
2936
|
}
|
|
2896
|
-
|
|
2937
|
+
);
|
|
2897
2938
|
return formatAPIResult(cartAttributesUpdate, errors2);
|
|
2898
2939
|
};
|
|
2899
2940
|
}
|
|
2900
|
-
var CART_ATTRIBUTES_UPDATE_MUTATION = (cartFragment = MINIMAL_CART_FRAGMENT) => `#graphql
|
|
2941
|
+
var CART_ATTRIBUTES_UPDATE_MUTATION = (cartFragment = MINIMAL_CART_FRAGMENT, options = {}) => `#graphql
|
|
2901
2942
|
mutation cartAttributesUpdate(
|
|
2902
2943
|
$cartId: ID!
|
|
2903
2944
|
$attributes: [AttributeInput!]!
|
|
2904
|
-
$
|
|
2905
|
-
|
|
2906
|
-
$visitorConsent: VisitorConsent
|
|
2907
|
-
) @inContext(country: $country, language: $language, visitorConsent: $visitorConsent) {
|
|
2945
|
+
${getInContextVariables(options.includeVisitorConsent)}
|
|
2946
|
+
) ${getInContextDirective(options.includeVisitorConsent)} {
|
|
2908
2947
|
cartAttributesUpdate(cartId: $cartId, attributes: $attributes) {
|
|
2909
2948
|
cart {
|
|
2910
2949
|
...CartApiMutation
|
|
@@ -2932,7 +2971,8 @@ function cartMetafieldsSetDefault(options) {
|
|
|
2932
2971
|
ownerId
|
|
2933
2972
|
})
|
|
2934
2973
|
);
|
|
2935
|
-
const
|
|
2974
|
+
const includeVisitorConsent = shouldIncludeVisitorConsent(optionalParams);
|
|
2975
|
+
const { cartMetafieldsSet, errors: errors2 } = await options.storefront.mutate(CART_METAFIELD_SET_MUTATION({ includeVisitorConsent }), {
|
|
2936
2976
|
variables: { metafields: metafieldsWithOwnerId, ...optionalParams }
|
|
2937
2977
|
});
|
|
2938
2978
|
return formatAPIResult(
|
|
@@ -2946,13 +2986,11 @@ function cartMetafieldsSetDefault(options) {
|
|
|
2946
2986
|
);
|
|
2947
2987
|
};
|
|
2948
2988
|
}
|
|
2949
|
-
var CART_METAFIELD_SET_MUTATION = () => `#graphql
|
|
2989
|
+
var CART_METAFIELD_SET_MUTATION = (options = {}) => `#graphql
|
|
2950
2990
|
mutation cartMetafieldsSet(
|
|
2951
2991
|
$metafields: [CartMetafieldsSetInput!]!
|
|
2952
|
-
$
|
|
2953
|
-
|
|
2954
|
-
$visitorConsent: VisitorConsent
|
|
2955
|
-
) @inContext(country: $country, language: $language, visitorConsent: $visitorConsent) {
|
|
2992
|
+
${getInContextVariables(options.includeVisitorConsent)}
|
|
2993
|
+
) ${getInContextDirective(options.includeVisitorConsent)} {
|
|
2956
2994
|
cartMetafieldsSet(metafields: $metafields) {
|
|
2957
2995
|
userErrors {
|
|
2958
2996
|
code
|
|
@@ -2968,7 +3006,8 @@ var CART_METAFIELD_SET_MUTATION = () => `#graphql
|
|
|
2968
3006
|
function cartMetafieldDeleteDefault(options) {
|
|
2969
3007
|
return async (key, optionalParams) => {
|
|
2970
3008
|
const ownerId = optionalParams?.cartId || options.getCartId();
|
|
2971
|
-
const
|
|
3009
|
+
const includeVisitorConsent = shouldIncludeVisitorConsent(optionalParams);
|
|
3010
|
+
const { cartMetafieldDelete, errors: errors2 } = await options.storefront.mutate(CART_METAFIELD_DELETE_MUTATION({ includeVisitorConsent }), {
|
|
2972
3011
|
variables: {
|
|
2973
3012
|
input: {
|
|
2974
3013
|
ownerId,
|
|
@@ -2988,13 +3027,11 @@ function cartMetafieldDeleteDefault(options) {
|
|
|
2988
3027
|
);
|
|
2989
3028
|
};
|
|
2990
3029
|
}
|
|
2991
|
-
var CART_METAFIELD_DELETE_MUTATION = () => `#graphql
|
|
3030
|
+
var CART_METAFIELD_DELETE_MUTATION = (options = {}) => `#graphql
|
|
2992
3031
|
mutation cartMetafieldDelete(
|
|
2993
3032
|
$input: CartMetafieldDeleteInput!
|
|
2994
|
-
$
|
|
2995
|
-
|
|
2996
|
-
$visitorConsent: VisitorConsent
|
|
2997
|
-
) @inContext(country: $country, language: $language, visitorConsent: $visitorConsent) {
|
|
3033
|
+
${getInContextVariables(options.includeVisitorConsent)}
|
|
3034
|
+
) ${getInContextDirective(options.includeVisitorConsent)} {
|
|
2998
3035
|
cartMetafieldDelete(input: $input) {
|
|
2999
3036
|
userErrors {
|
|
3000
3037
|
code
|
|
@@ -3008,24 +3045,28 @@ var CART_METAFIELD_DELETE_MUTATION = () => `#graphql
|
|
|
3008
3045
|
// src/cart/queries/cartGiftCardCodeUpdateDefault.ts
|
|
3009
3046
|
function cartGiftCardCodesUpdateDefault(options) {
|
|
3010
3047
|
return async (giftCardCodes, optionalParams) => {
|
|
3011
|
-
const
|
|
3012
|
-
|
|
3013
|
-
|
|
3014
|
-
|
|
3015
|
-
|
|
3048
|
+
const includeVisitorConsent = shouldIncludeVisitorConsent(optionalParams);
|
|
3049
|
+
const { cartGiftCardCodesUpdate, errors: errors2 } = await options.storefront.mutate(
|
|
3050
|
+
CART_GIFT_CARD_CODE_UPDATE_MUTATION(options.cartFragment, {
|
|
3051
|
+
includeVisitorConsent
|
|
3052
|
+
}),
|
|
3053
|
+
{
|
|
3054
|
+
variables: {
|
|
3055
|
+
cartId: options.getCartId(),
|
|
3056
|
+
giftCardCodes,
|
|
3057
|
+
...optionalParams
|
|
3058
|
+
}
|
|
3016
3059
|
}
|
|
3017
|
-
|
|
3060
|
+
);
|
|
3018
3061
|
return formatAPIResult(cartGiftCardCodesUpdate, errors2);
|
|
3019
3062
|
};
|
|
3020
3063
|
}
|
|
3021
|
-
var CART_GIFT_CARD_CODE_UPDATE_MUTATION = (cartFragment = MINIMAL_CART_FRAGMENT) => `#graphql
|
|
3064
|
+
var CART_GIFT_CARD_CODE_UPDATE_MUTATION = (cartFragment = MINIMAL_CART_FRAGMENT, options = {}) => `#graphql
|
|
3022
3065
|
mutation cartGiftCardCodesUpdate(
|
|
3023
3066
|
$cartId: ID!
|
|
3024
3067
|
$giftCardCodes: [String!]!
|
|
3025
|
-
$
|
|
3026
|
-
|
|
3027
|
-
$visitorConsent: VisitorConsent
|
|
3028
|
-
) @inContext(country: $country, language: $language, visitorConsent: $visitorConsent) {
|
|
3068
|
+
${getInContextVariables(options.includeVisitorConsent)}
|
|
3069
|
+
) ${getInContextDirective(options.includeVisitorConsent)} {
|
|
3029
3070
|
cartGiftCardCodesUpdate(cartId: $cartId, giftCardCodes: $giftCardCodes) {
|
|
3030
3071
|
cart {
|
|
3031
3072
|
...CartApiMutation
|
|
@@ -3083,24 +3124,28 @@ var CART_GIFT_CARD_CODES_ADD_MUTATION = (cartFragment = MINIMAL_CART_FRAGMENT) =
|
|
|
3083
3124
|
// src/cart/queries/cartGiftCardCodesRemoveDefault.ts
|
|
3084
3125
|
function cartGiftCardCodesRemoveDefault(options) {
|
|
3085
3126
|
return async (appliedGiftCardIds, optionalParams) => {
|
|
3086
|
-
const
|
|
3087
|
-
|
|
3088
|
-
|
|
3089
|
-
|
|
3090
|
-
|
|
3127
|
+
const includeVisitorConsent = shouldIncludeVisitorConsent(optionalParams);
|
|
3128
|
+
const { cartGiftCardCodesRemove, errors: errors2 } = await options.storefront.mutate(
|
|
3129
|
+
CART_GIFT_CARD_CODES_REMOVE_MUTATION(options.cartFragment, {
|
|
3130
|
+
includeVisitorConsent
|
|
3131
|
+
}),
|
|
3132
|
+
{
|
|
3133
|
+
variables: {
|
|
3134
|
+
cartId: options.getCartId(),
|
|
3135
|
+
appliedGiftCardIds,
|
|
3136
|
+
...optionalParams
|
|
3137
|
+
}
|
|
3091
3138
|
}
|
|
3092
|
-
|
|
3139
|
+
);
|
|
3093
3140
|
return formatAPIResult(cartGiftCardCodesRemove, errors2);
|
|
3094
3141
|
};
|
|
3095
3142
|
}
|
|
3096
|
-
var CART_GIFT_CARD_CODES_REMOVE_MUTATION = (cartFragment = MINIMAL_CART_FRAGMENT) => `#graphql
|
|
3143
|
+
var CART_GIFT_CARD_CODES_REMOVE_MUTATION = (cartFragment = MINIMAL_CART_FRAGMENT, options = {}) => `#graphql
|
|
3097
3144
|
mutation cartGiftCardCodesRemove(
|
|
3098
3145
|
$cartId: ID!
|
|
3099
3146
|
$appliedGiftCardIds: [ID!]!
|
|
3100
|
-
$
|
|
3101
|
-
|
|
3102
|
-
$visitorConsent: VisitorConsent
|
|
3103
|
-
) @inContext(country: $country, language: $language, visitorConsent: $visitorConsent) {
|
|
3147
|
+
${getInContextVariables(options.includeVisitorConsent)}
|
|
3148
|
+
) ${getInContextDirective(options.includeVisitorConsent)} {
|
|
3104
3149
|
cartGiftCardCodesRemove(cartId: $cartId, appliedGiftCardIds: $appliedGiftCardIds) {
|
|
3105
3150
|
cart {
|
|
3106
3151
|
...CartApiMutation
|
|
@@ -3121,24 +3166,28 @@ var CART_GIFT_CARD_CODES_REMOVE_MUTATION = (cartFragment = MINIMAL_CART_FRAGMENT
|
|
|
3121
3166
|
// src/cart/queries/cartDeliveryAddressesAddDefault.tsx
|
|
3122
3167
|
function cartDeliveryAddressesAddDefault(options) {
|
|
3123
3168
|
return async (addresses, optionalParams) => {
|
|
3124
|
-
const
|
|
3125
|
-
|
|
3126
|
-
|
|
3127
|
-
|
|
3128
|
-
|
|
3169
|
+
const includeVisitorConsent = shouldIncludeVisitorConsent(optionalParams);
|
|
3170
|
+
const { cartDeliveryAddressesAdd, errors: errors2 } = await options.storefront.mutate(
|
|
3171
|
+
CART_DELIVERY_ADDRESSES_ADD_MUTATION(options.cartFragment, {
|
|
3172
|
+
includeVisitorConsent
|
|
3173
|
+
}),
|
|
3174
|
+
{
|
|
3175
|
+
variables: {
|
|
3176
|
+
cartId: options.getCartId(),
|
|
3177
|
+
addresses,
|
|
3178
|
+
...optionalParams
|
|
3179
|
+
}
|
|
3129
3180
|
}
|
|
3130
|
-
|
|
3181
|
+
);
|
|
3131
3182
|
return formatAPIResult(cartDeliveryAddressesAdd, errors2);
|
|
3132
3183
|
};
|
|
3133
3184
|
}
|
|
3134
|
-
var CART_DELIVERY_ADDRESSES_ADD_MUTATION = (cartFragment = MINIMAL_CART_FRAGMENT) => `#graphql
|
|
3185
|
+
var CART_DELIVERY_ADDRESSES_ADD_MUTATION = (cartFragment = MINIMAL_CART_FRAGMENT, options = {}) => `#graphql
|
|
3135
3186
|
mutation cartDeliveryAddressesAdd(
|
|
3136
3187
|
$cartId: ID!
|
|
3137
3188
|
$addresses: [CartSelectableAddressInput!]!,
|
|
3138
|
-
$
|
|
3139
|
-
|
|
3140
|
-
$visitorConsent: VisitorConsent
|
|
3141
|
-
) @inContext(country: $country, language: $language, visitorConsent: $visitorConsent) {
|
|
3189
|
+
${getInContextVariables(options.includeVisitorConsent)}
|
|
3190
|
+
) ${getInContextDirective(options.includeVisitorConsent)} {
|
|
3142
3191
|
cartDeliveryAddressesAdd(addresses: $addresses, cartId: $cartId) {
|
|
3143
3192
|
cart {
|
|
3144
3193
|
...CartApiMutation
|
|
@@ -3159,24 +3208,28 @@ var CART_DELIVERY_ADDRESSES_ADD_MUTATION = (cartFragment = MINIMAL_CART_FRAGMENT
|
|
|
3159
3208
|
// src/cart/queries/cartDeliveryAddressesRemoveDefault.tsx
|
|
3160
3209
|
function cartDeliveryAddressesRemoveDefault(options) {
|
|
3161
3210
|
return async (addressIds, optionalParams) => {
|
|
3162
|
-
const
|
|
3163
|
-
|
|
3164
|
-
|
|
3165
|
-
|
|
3166
|
-
|
|
3211
|
+
const includeVisitorConsent = shouldIncludeVisitorConsent(optionalParams);
|
|
3212
|
+
const { cartDeliveryAddressesRemove, errors: errors2 } = await options.storefront.mutate(
|
|
3213
|
+
CART_DELIVERY_ADDRESSES_REMOVE_MUTATION(options.cartFragment, {
|
|
3214
|
+
includeVisitorConsent
|
|
3215
|
+
}),
|
|
3216
|
+
{
|
|
3217
|
+
variables: {
|
|
3218
|
+
cartId: options.getCartId(),
|
|
3219
|
+
addressIds,
|
|
3220
|
+
...optionalParams
|
|
3221
|
+
}
|
|
3167
3222
|
}
|
|
3168
|
-
|
|
3223
|
+
);
|
|
3169
3224
|
return formatAPIResult(cartDeliveryAddressesRemove, errors2);
|
|
3170
3225
|
};
|
|
3171
3226
|
}
|
|
3172
|
-
var CART_DELIVERY_ADDRESSES_REMOVE_MUTATION = (cartFragment = MINIMAL_CART_FRAGMENT) => `#graphql
|
|
3227
|
+
var CART_DELIVERY_ADDRESSES_REMOVE_MUTATION = (cartFragment = MINIMAL_CART_FRAGMENT, options = {}) => `#graphql
|
|
3173
3228
|
mutation cartDeliveryAddressesRemove(
|
|
3174
3229
|
$cartId: ID!
|
|
3175
3230
|
$addressIds: [ID!]!,
|
|
3176
|
-
$
|
|
3177
|
-
|
|
3178
|
-
$visitorConsent: VisitorConsent
|
|
3179
|
-
) @inContext(country: $country, language: $language, visitorConsent: $visitorConsent) {
|
|
3231
|
+
${getInContextVariables(options.includeVisitorConsent)}
|
|
3232
|
+
) ${getInContextDirective(options.includeVisitorConsent)} {
|
|
3180
3233
|
cartDeliveryAddressesRemove(addressIds: $addressIds, cartId: $cartId) {
|
|
3181
3234
|
cart {
|
|
3182
3235
|
...CartApiMutation
|
|
@@ -3197,24 +3250,28 @@ var CART_DELIVERY_ADDRESSES_REMOVE_MUTATION = (cartFragment = MINIMAL_CART_FRAGM
|
|
|
3197
3250
|
// src/cart/queries/cartDeliveryAddressesUpdateDefault.tsx
|
|
3198
3251
|
function cartDeliveryAddressesUpdateDefault(options) {
|
|
3199
3252
|
return async (addresses, optionalParams) => {
|
|
3200
|
-
const
|
|
3201
|
-
|
|
3202
|
-
|
|
3203
|
-
|
|
3204
|
-
|
|
3253
|
+
const includeVisitorConsent = shouldIncludeVisitorConsent(optionalParams);
|
|
3254
|
+
const { cartDeliveryAddressesUpdate, errors: errors2 } = await options.storefront.mutate(
|
|
3255
|
+
CART_DELIVERY_ADDRESSES_UPDATE_MUTATION(options.cartFragment, {
|
|
3256
|
+
includeVisitorConsent
|
|
3257
|
+
}),
|
|
3258
|
+
{
|
|
3259
|
+
variables: {
|
|
3260
|
+
cartId: options.getCartId(),
|
|
3261
|
+
addresses,
|
|
3262
|
+
...optionalParams
|
|
3263
|
+
}
|
|
3205
3264
|
}
|
|
3206
|
-
|
|
3265
|
+
);
|
|
3207
3266
|
return formatAPIResult(cartDeliveryAddressesUpdate, errors2);
|
|
3208
3267
|
};
|
|
3209
3268
|
}
|
|
3210
|
-
var CART_DELIVERY_ADDRESSES_UPDATE_MUTATION = (cartFragment = MINIMAL_CART_FRAGMENT) => `#graphql
|
|
3269
|
+
var CART_DELIVERY_ADDRESSES_UPDATE_MUTATION = (cartFragment = MINIMAL_CART_FRAGMENT, options = {}) => `#graphql
|
|
3211
3270
|
mutation cartDeliveryAddressesUpdate(
|
|
3212
3271
|
$cartId: ID!
|
|
3213
3272
|
$addresses: [CartSelectableAddressUpdateInput!]!,
|
|
3214
|
-
$
|
|
3215
|
-
|
|
3216
|
-
$visitorConsent: VisitorConsent
|
|
3217
|
-
) @inContext(country: $country, language: $language, visitorConsent: $visitorConsent) {
|
|
3273
|
+
${getInContextVariables(options.includeVisitorConsent)}
|
|
3274
|
+
) ${getInContextDirective(options.includeVisitorConsent)} {
|
|
3218
3275
|
cartDeliveryAddressesUpdate(addresses: $addresses, cartId: $cartId) {
|
|
3219
3276
|
cart {
|
|
3220
3277
|
...CartApiMutation
|
|
@@ -3485,7 +3542,7 @@ var hydrogenContext = {
|
|
|
3485
3542
|
};
|
|
3486
3543
|
|
|
3487
3544
|
// src/customer/constants.ts
|
|
3488
|
-
var DEFAULT_CUSTOMER_API_VERSION = "2026-
|
|
3545
|
+
var DEFAULT_CUSTOMER_API_VERSION = "2026-04";
|
|
3489
3546
|
var USER_AGENT = `Shopify Hydrogen ${LIB_VERSION}`;
|
|
3490
3547
|
var CUSTOMER_API_CLIENT_ID = "30243aa5-17c1-465a-8493-944bcc4e88aa";
|
|
3491
3548
|
var CUSTOMER_ACCOUNT_SESSION_KEY = "customerAccount";
|
|
@@ -3763,15 +3820,15 @@ function ensureLocalRedirectUrl({
|
|
|
3763
3820
|
redirectUrl
|
|
3764
3821
|
}) {
|
|
3765
3822
|
const fromUrl = requestUrl;
|
|
3766
|
-
const
|
|
3767
|
-
const toUrl = redirectUrl ? buildURLObject(requestUrl, redirectUrl) :
|
|
3823
|
+
const parsedDefaultUrl = buildURLObject(requestUrl, defaultUrl);
|
|
3824
|
+
const toUrl = redirectUrl ? buildURLObject(requestUrl, redirectUrl) : parsedDefaultUrl;
|
|
3768
3825
|
if (isLocalPath(requestUrl, toUrl.toString())) {
|
|
3769
3826
|
return toUrl.toString();
|
|
3770
3827
|
} else {
|
|
3771
3828
|
console.warn(
|
|
3772
|
-
`Cross-domain redirects are not supported. Tried to redirect from ${fromUrl} to ${toUrl}. Default url ${
|
|
3829
|
+
`Cross-domain redirects are not supported. Tried to redirect from ${fromUrl} to ${toUrl}. Default url ${parsedDefaultUrl} is used instead.`
|
|
3773
3830
|
);
|
|
3774
|
-
return
|
|
3831
|
+
return parsedDefaultUrl.toString();
|
|
3775
3832
|
}
|
|
3776
3833
|
}
|
|
3777
3834
|
function buildURLObject(requestUrl, relativeOrAbsoluteUrl) {
|
|
@@ -4412,8 +4469,7 @@ function createRequestHandler({
|
|
|
4412
4469
|
mode,
|
|
4413
4470
|
poweredByHeader = true,
|
|
4414
4471
|
getLoadContext,
|
|
4415
|
-
collectTrackingInformation = true
|
|
4416
|
-
proxyStandardRoutes = true
|
|
4472
|
+
collectTrackingInformation = true
|
|
4417
4473
|
}) {
|
|
4418
4474
|
const handleRequest = createRequestHandler$1(build, mode);
|
|
4419
4475
|
const appendPoweredByHeader = poweredByHeader ? (response) => response.headers.append("powered-by", "Shopify, Hydrogen") : void 0;
|
|
@@ -4435,32 +4491,28 @@ function createRequestHandler({
|
|
|
4435
4491
|
}
|
|
4436
4492
|
const context = await getLoadContext?.(request);
|
|
4437
4493
|
const storefront = context?.storefront || context?.get?.(storefrontContext);
|
|
4438
|
-
if (
|
|
4439
|
-
|
|
4440
|
-
|
|
4441
|
-
|
|
4442
|
-
|
|
4443
|
-
|
|
4444
|
-
|
|
4445
|
-
|
|
4446
|
-
|
|
4447
|
-
|
|
4448
|
-
|
|
4449
|
-
|
|
4450
|
-
|
|
4451
|
-
|
|
4452
|
-
return response2;
|
|
4453
|
-
}
|
|
4494
|
+
if (!storefront) {
|
|
4495
|
+
throw new Error(
|
|
4496
|
+
"[h2:createRequestHandler] Storefront instance is required in the load context. Make sure to use createHydrogenContext() or provide a storefront instance via getLoadContext."
|
|
4497
|
+
);
|
|
4498
|
+
}
|
|
4499
|
+
if (storefront.isStorefrontApiUrl(request)) {
|
|
4500
|
+
const response2 = await storefront.forward(request);
|
|
4501
|
+
appendPoweredByHeader?.(response2);
|
|
4502
|
+
return response2;
|
|
4503
|
+
}
|
|
4504
|
+
if (storefront.isMcpUrl(request)) {
|
|
4505
|
+
const response2 = await storefront.forwardMcp(request);
|
|
4506
|
+
appendPoweredByHeader?.(response2);
|
|
4507
|
+
return response2;
|
|
4454
4508
|
}
|
|
4455
4509
|
const response = await handleRequest(request, context);
|
|
4456
|
-
if (
|
|
4457
|
-
|
|
4458
|
-
|
|
4459
|
-
|
|
4460
|
-
|
|
4461
|
-
|
|
4462
|
-
appendServerTimingHeader(response, { [HYDROGEN_SFAPI_PROXY_KEY]: "1" });
|
|
4463
|
-
}
|
|
4510
|
+
if (collectTrackingInformation) {
|
|
4511
|
+
storefront.setCollectedSubrequestHeaders(response);
|
|
4512
|
+
}
|
|
4513
|
+
const fetchDest = request.headers.get("sec-fetch-dest");
|
|
4514
|
+
if (fetchDest && fetchDest === "document" || request.headers.get("accept")?.includes("text/html")) {
|
|
4515
|
+
appendServerTimingHeader(response, { [HYDROGEN_SFAPI_PROXY_KEY]: "1" });
|
|
4464
4516
|
}
|
|
4465
4517
|
appendPoweredByHeader?.(response);
|
|
4466
4518
|
return response;
|
|
@@ -6500,14 +6552,14 @@ var QUERIES = {
|
|
|
6500
6552
|
//! @see https://shopify.dev/docs/api/storefront/latest/mutations/cartNoteUpdate
|
|
6501
6553
|
//! @see https://shopify.dev/docs/api/storefront/latest/mutations/cartSelectedDeliveryOptionsUpdate
|
|
6502
6554
|
//! @see https://shopify.dev/docs/api/storefront/latest/mutations/cartMetafieldsSet
|
|
6503
|
-
//! @see https://shopify.dev/docs/api/storefront/2026-
|
|
6555
|
+
//! @see https://shopify.dev/docs/api/storefront/2026-04/mutations/cartMetafieldDelete
|
|
6504
6556
|
//! @see https://shopify.dev/docs/api/storefront/latest/mutations/cartGiftCardCodesUpdate
|
|
6505
6557
|
//! @see https://shopify.dev/docs/api/storefront/latest/mutations/cartGiftCardCodesAdd
|
|
6506
6558
|
//! @see https://shopify.dev/docs/api/storefront/latest/mutations/cartGiftCardCodesRemove
|
|
6507
6559
|
//! @see: https://shopify.dev/docs/api/storefront/latest/mutations/cartDeliveryAddressesAdd
|
|
6508
6560
|
//! @see: https://shopify.dev/docs/api/storefront/latest/mutations/cartDeliveryAddressesRemove
|
|
6509
6561
|
//! @see: https://shopify.dev/docs/api/storefront/latest/mutations/cartDeliveryAddressesUpdate
|
|
6510
|
-
//! @see: https://shopify.dev/docs/api/storefront/2026-
|
|
6562
|
+
//! @see: https://shopify.dev/docs/api/storefront/2026-04/mutations/cartDeliveryAddressesReplace
|
|
6511
6563
|
|
|
6512
6564
|
export { Analytics, AnalyticsEvent, CacheCustom, CacheLong, CacheNone, CacheShort, CartForm, InMemoryCache, NonceProvider, OptimisticInput, Pagination, RichText, Script, Seo, ShopPayButton, VariantSelector, cartAttributesUpdateDefault, cartBuyerIdentityUpdateDefault, cartCreateDefault, cartDiscountCodesUpdateDefault, cartGetDefault, cartGetIdDefault, cartGiftCardCodesAddDefault, cartGiftCardCodesRemoveDefault, cartGiftCardCodesUpdateDefault, cartLinesAddDefault, cartLinesRemoveDefault, cartLinesUpdateDefault, cartMetafieldDeleteDefault, cartMetafieldsSetDefault, cartNoteUpdateDefault, cartSelectedDeliveryOptionsUpdateDefault, cartSetIdDefault, changelogHandler, createCartHandler, createContentSecurityPolicy, createCustomerAccountClient, createHydrogenContext, createRequestHandler, createStorefrontClient, createWithCache, formatAPIResult, generateCacheControlHeader, getPaginationVariables, getSelectedProductOptions, getSeoMeta, getShopAnalytics, getSitemap, getSitemapIndex, graphiqlLoader, hydrogenContext, hydrogenPreset, hydrogenRoutes, storefrontRedirect, useAnalytics, useCustomerPrivacy, useNonce, useOptimisticCart, useOptimisticData, useOptimisticVariant };
|
|
6513
6565
|
//# sourceMappingURL=index.js.map
|