@anker-in/shopify-react 1.1.1 → 1.2.0-beta.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/hooks/index.d.mts +39 -44
- package/dist/hooks/index.d.ts +39 -44
- package/dist/hooks/index.js +349 -93
- package/dist/hooks/index.js.map +1 -1
- package/dist/hooks/index.mjs +342 -94
- package/dist/hooks/index.mjs.map +1 -1
- package/dist/index.d.mts +4 -4
- package/dist/index.d.ts +4 -4
- package/dist/index.js +438 -116
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +427 -117
- package/dist/index.mjs.map +1 -1
- package/dist/provider/index.d.mts +26 -14
- package/dist/provider/index.d.ts +26 -14
- package/dist/provider/index.js +155 -32
- package/dist/provider/index.js.map +1 -1
- package/dist/provider/index.mjs +155 -32
- package/dist/provider/index.mjs.map +1 -1
- package/dist/{types-CMMWxyUF.d.mts → types-C4qc-wG4.d.mts} +167 -7
- package/dist/{types-CMMWxyUF.d.ts → types-C4qc-wG4.d.ts} +167 -7
- package/package.json +17 -17
package/dist/hooks/index.d.mts
CHANGED
|
@@ -2,15 +2,15 @@ import * as swr_mutation from 'swr/mutation';
|
|
|
2
2
|
import { SWRMutationConfiguration } from 'swr/mutation';
|
|
3
3
|
import * as _anker_in_shopify_sdk from '@anker-in/shopify-sdk';
|
|
4
4
|
import { CartLineInput, NormalizedCart, NormalizedProduct, NormalizedProductVariant, NormalizedLineItem, UpdateCartLinesOptions, HasMetafieldsIdentifier, Media, NormalizedCollection, CollectionsConnection, NormalizedBlog, NormalizedArticle, NormalizedAttribute } from '@anker-in/shopify-sdk';
|
|
5
|
-
import {
|
|
6
|
-
export {
|
|
7
|
-
import Decimal from 'decimal.js';
|
|
5
|
+
import { h as UseAddToCartOptions, g as AddToCartInput, A as AddToCartLineItem, G as GtmParams, C as BuyNowTrackConfig, e as UseScriptAutoFreeGiftResult, m as PlusMemberShippingMethodConfig, n as PlusMemberSettingsMetafields, D as DeliveryPlusType, o as SelectedPlusMemberVariant } from '../types-C4qc-wG4.mjs';
|
|
6
|
+
export { p as DeliveryCustomData, P as PLUS_MEMBER_TYPE, j as PlusMemberMode, l as PlusMemberShippingMethodMetafields, S as ScriptAutoFreeGiftConfig, k as ShippingMethodMode, U as UseAutoRemoveFreeGiftsOptions, a as UseAutoRemoveFreeGiftsResult, d as isAnyGift, c as isBuyGetGift, i as isFunctionGift, b as isScriptGift, u as useAutoRemoveFreeGifts, f as useScriptAutoFreeGift } from '../types-C4qc-wG4.mjs';
|
|
8
7
|
import * as swr from 'swr';
|
|
9
8
|
import swr__default, { SWRConfiguration } from 'swr';
|
|
10
9
|
import * as swr__internal from 'swr/_internal';
|
|
11
10
|
import * as React$1 from 'react';
|
|
12
11
|
import { Dispatch, SetStateAction, PropsWithChildren, RefObject } from 'react';
|
|
13
12
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
13
|
+
import 'decimal.js';
|
|
14
14
|
|
|
15
15
|
interface CreateCartInput {
|
|
16
16
|
/** Lines to add to the cart */
|
|
@@ -629,43 +629,6 @@ declare function useBuyNow({ withTrack }?: UseBuyNowOptions, swrOptions?: SWRMut
|
|
|
629
629
|
*/
|
|
630
630
|
declare const useCalcAutoFreeGift: (cart: any, autoFreeGiftConfig: AutoFreeGiftConfig, customer: any, lines?: AddToCartLineItem[]) => FunctionGiftResult;
|
|
631
631
|
|
|
632
|
-
interface GiveawayProduct {
|
|
633
|
-
handle: string;
|
|
634
|
-
sku: string;
|
|
635
|
-
}
|
|
636
|
-
interface Breakpoint {
|
|
637
|
-
breakpoint: string;
|
|
638
|
-
giveawayProducts: GiveawayProduct[];
|
|
639
|
-
}
|
|
640
|
-
interface Campaign {
|
|
641
|
-
activityAvailableQuery?: string;
|
|
642
|
-
activityQroperty?: string;
|
|
643
|
-
breakpoints?: Array<{
|
|
644
|
-
breakpoint: string;
|
|
645
|
-
giveawayProducts: GiveawayProduct[];
|
|
646
|
-
}>;
|
|
647
|
-
includeTags?: string[];
|
|
648
|
-
useTotalAmount?: boolean;
|
|
649
|
-
requireLogin?: boolean;
|
|
650
|
-
}
|
|
651
|
-
interface UseScriptAutoFreeGiftResult {
|
|
652
|
-
involvedLines: NormalizedLineItem[];
|
|
653
|
-
reorder: (a: NormalizedLineItem, b: NormalizedLineItem) => number;
|
|
654
|
-
disableCodeRemove: boolean;
|
|
655
|
-
nextFreeGiftLevel: Breakpoint | null;
|
|
656
|
-
freeGiftLevel: Breakpoint | null;
|
|
657
|
-
involvedSubTotal: Decimal;
|
|
658
|
-
giftProductsResult?: NormalizedProduct[];
|
|
659
|
-
}
|
|
660
|
-
declare const useScriptAutoFreeGift: ({ campaign, _giveaway, cart, locale: providedLocale, lines, profile, }: {
|
|
661
|
-
campaign: Campaign | null;
|
|
662
|
-
_giveaway: string;
|
|
663
|
-
cart: NormalizedCart | undefined;
|
|
664
|
-
locale?: string;
|
|
665
|
-
lines?: AddToCartLineItem[];
|
|
666
|
-
profile?: any;
|
|
667
|
-
}) => UseScriptAutoFreeGiftResult;
|
|
668
|
-
|
|
669
632
|
interface UseCalcGiftsFromLinesOptions {
|
|
670
633
|
/** Lines to calculate gifts from (AddToCartLineItem format) */
|
|
671
634
|
lines: AddToCartLineItem[];
|
|
@@ -752,32 +715,64 @@ declare const getReferralAttributes: () => {
|
|
|
752
715
|
key: string;
|
|
753
716
|
value: any;
|
|
754
717
|
}[];
|
|
718
|
+
/**
|
|
719
|
+
* Detect operating system
|
|
720
|
+
*/
|
|
721
|
+
declare const getOperatingSystem: () => "Android" | "IOS" | "Unknown";
|
|
755
722
|
/**
|
|
756
723
|
* Get user type based on customer information
|
|
757
724
|
*/
|
|
758
725
|
declare const getUserType: (customer?: any) => string;
|
|
726
|
+
/**
|
|
727
|
+
* Get GA4 attributes (sync version)
|
|
728
|
+
*/
|
|
729
|
+
declare function getGA4Attributes(ga4Data?: {
|
|
730
|
+
clientId?: string;
|
|
731
|
+
sessionId?: string;
|
|
732
|
+
} | null): Array<{
|
|
733
|
+
key: string;
|
|
734
|
+
value: string;
|
|
735
|
+
}>;
|
|
736
|
+
/**
|
|
737
|
+
* Get GA4 attributes (async version)
|
|
738
|
+
* Fetches GA4 data and returns formatted attributes
|
|
739
|
+
*/
|
|
740
|
+
declare function getGA4AttributesAsync(): Promise<Array<{
|
|
741
|
+
key: string;
|
|
742
|
+
value: string;
|
|
743
|
+
}>>;
|
|
759
744
|
interface GetCartAttributesProps {
|
|
760
745
|
profile?: any;
|
|
761
746
|
customer?: any;
|
|
762
747
|
cart?: NormalizedCart;
|
|
763
748
|
memberType?: string;
|
|
764
749
|
currentUrl?: string;
|
|
750
|
+
appContext?: {
|
|
751
|
+
isInApp?: boolean;
|
|
752
|
+
appName?: string;
|
|
753
|
+
};
|
|
754
|
+
buyPath?: 'hasCart' | 'buyNow';
|
|
765
755
|
}
|
|
766
756
|
/**
|
|
767
|
-
* Get cart attributes (pure function version)
|
|
757
|
+
* Get basic cart attributes (pure function version)
|
|
768
758
|
*/
|
|
769
|
-
declare function
|
|
759
|
+
declare function getCartBasicAttributes({ profile, customer, cart, memberType, currentUrl, appContext, buyPath, }: GetCartAttributesProps): Array<{
|
|
770
760
|
key: string;
|
|
771
761
|
value: any;
|
|
772
762
|
}>;
|
|
773
763
|
/**
|
|
774
764
|
* Hook to get cart attributes
|
|
775
765
|
*/
|
|
776
|
-
declare const useCartAttributes: ({ profile, customer, cart, memberType, }: {
|
|
766
|
+
declare const useCartAttributes: ({ profile, customer, cart, memberType, appContext, buyPath, }: {
|
|
777
767
|
profile: any;
|
|
778
768
|
customer: any;
|
|
779
769
|
cart?: NormalizedCart;
|
|
780
770
|
memberType?: string;
|
|
771
|
+
appContext?: {
|
|
772
|
+
isInApp?: boolean;
|
|
773
|
+
appName?: string;
|
|
774
|
+
};
|
|
775
|
+
buyPath?: "hasCart" | "buyNow";
|
|
781
776
|
}) => {
|
|
782
777
|
attributes: Array<{
|
|
783
778
|
key: string;
|
|
@@ -2039,4 +2034,4 @@ declare function getCachedGeoLocation(cacheKey?: string): GeoLocationData | unde
|
|
|
2039
2034
|
*/
|
|
2040
2035
|
declare function clearGeoLocationCache(cacheKey?: string): void;
|
|
2041
2036
|
|
|
2042
|
-
export { type AddCartLinesInput, AddToCartInput, AddToCartLineItem, type ApplyCartCodesInput, type AutoFreeGift, type AutoFreeGiftCartLineInput, type AutoFreeGiftConfig, type AutoFreeGiftItem, type AutoFreeGiftList, type AutoFreeGiftMainProduct, type BuyNowInput, BuyRuleType, CODE_AMOUNT_KEY, CUSTOMER_ATTRIBUTE_KEY, CUSTOMER_SCRIPT_GIFT_KEY, type Config, type CreateCartInput, DeliveryPlusType, type DiscountLabel, type FormattedGift, type FunctionGiftResult, type GeoLocationData, type GetCartAttributesProps, type GiftProduct, type GiftProductItem, type GiftTier, type HasPlusMemberInCartProps, type HasPlusMemberInCartResult, type HasPlusMemberInLinesResult, type ImageMedia, type LocaleMapping, MAIN_PRODUCT_CODE, MEMBER_PRICE_ATTRIBUTE_KEY, type MainProductInfo, type NormalizedSearchResultItem, type Options, OrderBasePriceType, type OrderDiscountConfig, type OrderDiscountResult, OrderDiscountType, PlusMemberContext, type PlusMemberContextValue, PlusMemberProvider, type PlusMemberProviderProps, PlusMemberSettingsMetafields, PlusMemberShippingMethodConfig, PriceBasePriceType, type PriceDiscountConfig, PriceDiscountType, type RemoveCartCodesInput, type RemoveCartLinesInput, type RewardItem, type RuleCondition, RuleType, SCRIPT_CODE_AMOUNT_KEY, type SearchResult, type SearchResultType, type SelectedOptionsResult, SelectedPlusMemberVariant, type ShippingMethodsContext, type SiteInfo, SpendMoneyType, type TieredDiscount, type UpdateBuyerIdentityInput, type UpdateCartAttributesInput, UseAddToCartOptions, type UseAllBlogsOptions, type UseAllCollectionsOptions, type UseAllProductsOptions, type UseArticleOptions, type UseArticlesInBlogOptions, type UseArticlesOptions, type UseAutoRemovePlusMemberInCartProps, type UseAvailableDeliveryCouponResult, type UseBlogOptions, type UseBuyNowOptions, type UseCalcGiftsFromLinesOptions, type UseCalcGiftsFromLinesResult, type UseCollectionOptions, type UseCollectionsOptions, type UseExposureOptions, type UseGeoLocationOptions, type UseHasPlusMemberInLinesProps, type UseIntersectionOptions, type UsePlusMemberVariantsOptions, type UsePlusMemberVariantsResult, type UsePriceOptions, type UsePriceResult, type UseProductOptions, type UseProductsByHandlesOptions,
|
|
2037
|
+
export { type AddCartLinesInput, AddToCartInput, AddToCartLineItem, type ApplyCartCodesInput, type AutoFreeGift, type AutoFreeGiftCartLineInput, type AutoFreeGiftConfig, type AutoFreeGiftItem, type AutoFreeGiftList, type AutoFreeGiftMainProduct, type BuyNowInput, BuyRuleType, CODE_AMOUNT_KEY, CUSTOMER_ATTRIBUTE_KEY, CUSTOMER_SCRIPT_GIFT_KEY, type Config, type CreateCartInput, DeliveryPlusType, type DiscountLabel, type FormattedGift, type FunctionGiftResult, type GeoLocationData, type GetCartAttributesProps, type GiftProduct, type GiftProductItem, type GiftTier, type HasPlusMemberInCartProps, type HasPlusMemberInCartResult, type HasPlusMemberInLinesResult, type ImageMedia, type LocaleMapping, MAIN_PRODUCT_CODE, MEMBER_PRICE_ATTRIBUTE_KEY, type MainProductInfo, type NormalizedSearchResultItem, type Options, OrderBasePriceType, type OrderDiscountConfig, type OrderDiscountResult, OrderDiscountType, PlusMemberContext, type PlusMemberContextValue, PlusMemberProvider, type PlusMemberProviderProps, PlusMemberSettingsMetafields, PlusMemberShippingMethodConfig, PriceBasePriceType, type PriceDiscountConfig, PriceDiscountType, type RemoveCartCodesInput, type RemoveCartLinesInput, type RewardItem, type RuleCondition, RuleType, SCRIPT_CODE_AMOUNT_KEY, type SearchResult, type SearchResultType, type SelectedOptionsResult, SelectedPlusMemberVariant, type ShippingMethodsContext, type SiteInfo, SpendMoneyType, type TieredDiscount, type UpdateBuyerIdentityInput, type UpdateCartAttributesInput, UseAddToCartOptions, type UseAllBlogsOptions, type UseAllCollectionsOptions, type UseAllProductsOptions, type UseArticleOptions, type UseArticlesInBlogOptions, type UseArticlesOptions, type UseAutoRemovePlusMemberInCartProps, type UseAvailableDeliveryCouponResult, type UseBlogOptions, type UseBuyNowOptions, type UseCalcGiftsFromLinesOptions, type UseCalcGiftsFromLinesResult, type UseCollectionOptions, type UseCollectionsOptions, type UseExposureOptions, type UseGeoLocationOptions, type UseHasPlusMemberInLinesProps, type UseIntersectionOptions, type UsePlusMemberVariantsOptions, type UsePlusMemberVariantsResult, type UsePriceOptions, type UsePriceResult, type UseProductOptions, type UseProductsByHandlesOptions, UseScriptAutoFreeGiftResult, type UseSearchOptions, type UseShippingMethodsOptions, type UseShippingMethodsResult, type UseSiteOptions, type UseUpdateBuyerIdentityOptions, type UseUpdateCartAttributesOptions, type VariantItem, type VariantMedia, type VideoMedia, clearGeoLocationCache, createMockCartFromLines, currencyCodeMapping, defaultSWRMutationConfiguration, formatFunctionAutoFreeGift, formatScriptAutoFreeGift, getCachedGeoLocation, getCartBasicAttributes, getDiscountEnvAttributeValue, getGA4Attributes, getGA4AttributesAsync, getMatchedMainProductSubTotal, getOperatingSystem, getQuery, getReferralAttributes, getUserType, hasPlusMemberInCart, hasPlusMemberInLines, normalizeAddToCartLines, preCheck, safeParse, useAddCartLines, useAddToCart, useAllBlogs, useAllCollections, useAllProducts, useApplyCartCodes, useArticle, useArticles, useArticlesInBlog, useAutoRemovePlusMemberInCart, useAvailableDeliveryCoupon, useBlog, useBuyNow, useCalcAutoFreeGift, useCalcGiftsFromLines, useCalcOrderDiscount, useCartAttributes, useCartItemQuantityLimit, useCollection, useCollections, useCreateCart, useExposure, useGeoLocation, useHasPlusMemberInCart, useHasPlusMemberInLines, useIntersection, usePlusMemberCheckoutCustomAttributes, usePlusMemberContext, usePlusMemberNeedAddToCart, usePlusMemberVariants, usePrice, useProduct, useProductUrl, useProductsByHandles, useRemoveCartCodes, useRemoveCartLines, useReplaceCartPlusMember, useSearch, useSelectedOptions, useShippingMethods, useSite, useUpdateBuyerIdentity, useUpdateCartAttributes, useUpdateCartLines, useUpdateLineCodeAmountAttributes, useUpdateVariantQuery, useVariant, useVariantMedia };
|
package/dist/hooks/index.d.ts
CHANGED
|
@@ -2,15 +2,15 @@ import * as swr_mutation from 'swr/mutation';
|
|
|
2
2
|
import { SWRMutationConfiguration } from 'swr/mutation';
|
|
3
3
|
import * as _anker_in_shopify_sdk from '@anker-in/shopify-sdk';
|
|
4
4
|
import { CartLineInput, NormalizedCart, NormalizedProduct, NormalizedProductVariant, NormalizedLineItem, UpdateCartLinesOptions, HasMetafieldsIdentifier, Media, NormalizedCollection, CollectionsConnection, NormalizedBlog, NormalizedArticle, NormalizedAttribute } from '@anker-in/shopify-sdk';
|
|
5
|
-
import {
|
|
6
|
-
export {
|
|
7
|
-
import Decimal from 'decimal.js';
|
|
5
|
+
import { h as UseAddToCartOptions, g as AddToCartInput, A as AddToCartLineItem, G as GtmParams, C as BuyNowTrackConfig, e as UseScriptAutoFreeGiftResult, m as PlusMemberShippingMethodConfig, n as PlusMemberSettingsMetafields, D as DeliveryPlusType, o as SelectedPlusMemberVariant } from '../types-C4qc-wG4.js';
|
|
6
|
+
export { p as DeliveryCustomData, P as PLUS_MEMBER_TYPE, j as PlusMemberMode, l as PlusMemberShippingMethodMetafields, S as ScriptAutoFreeGiftConfig, k as ShippingMethodMode, U as UseAutoRemoveFreeGiftsOptions, a as UseAutoRemoveFreeGiftsResult, d as isAnyGift, c as isBuyGetGift, i as isFunctionGift, b as isScriptGift, u as useAutoRemoveFreeGifts, f as useScriptAutoFreeGift } from '../types-C4qc-wG4.js';
|
|
8
7
|
import * as swr from 'swr';
|
|
9
8
|
import swr__default, { SWRConfiguration } from 'swr';
|
|
10
9
|
import * as swr__internal from 'swr/_internal';
|
|
11
10
|
import * as React$1 from 'react';
|
|
12
11
|
import { Dispatch, SetStateAction, PropsWithChildren, RefObject } from 'react';
|
|
13
12
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
13
|
+
import 'decimal.js';
|
|
14
14
|
|
|
15
15
|
interface CreateCartInput {
|
|
16
16
|
/** Lines to add to the cart */
|
|
@@ -629,43 +629,6 @@ declare function useBuyNow({ withTrack }?: UseBuyNowOptions, swrOptions?: SWRMut
|
|
|
629
629
|
*/
|
|
630
630
|
declare const useCalcAutoFreeGift: (cart: any, autoFreeGiftConfig: AutoFreeGiftConfig, customer: any, lines?: AddToCartLineItem[]) => FunctionGiftResult;
|
|
631
631
|
|
|
632
|
-
interface GiveawayProduct {
|
|
633
|
-
handle: string;
|
|
634
|
-
sku: string;
|
|
635
|
-
}
|
|
636
|
-
interface Breakpoint {
|
|
637
|
-
breakpoint: string;
|
|
638
|
-
giveawayProducts: GiveawayProduct[];
|
|
639
|
-
}
|
|
640
|
-
interface Campaign {
|
|
641
|
-
activityAvailableQuery?: string;
|
|
642
|
-
activityQroperty?: string;
|
|
643
|
-
breakpoints?: Array<{
|
|
644
|
-
breakpoint: string;
|
|
645
|
-
giveawayProducts: GiveawayProduct[];
|
|
646
|
-
}>;
|
|
647
|
-
includeTags?: string[];
|
|
648
|
-
useTotalAmount?: boolean;
|
|
649
|
-
requireLogin?: boolean;
|
|
650
|
-
}
|
|
651
|
-
interface UseScriptAutoFreeGiftResult {
|
|
652
|
-
involvedLines: NormalizedLineItem[];
|
|
653
|
-
reorder: (a: NormalizedLineItem, b: NormalizedLineItem) => number;
|
|
654
|
-
disableCodeRemove: boolean;
|
|
655
|
-
nextFreeGiftLevel: Breakpoint | null;
|
|
656
|
-
freeGiftLevel: Breakpoint | null;
|
|
657
|
-
involvedSubTotal: Decimal;
|
|
658
|
-
giftProductsResult?: NormalizedProduct[];
|
|
659
|
-
}
|
|
660
|
-
declare const useScriptAutoFreeGift: ({ campaign, _giveaway, cart, locale: providedLocale, lines, profile, }: {
|
|
661
|
-
campaign: Campaign | null;
|
|
662
|
-
_giveaway: string;
|
|
663
|
-
cart: NormalizedCart | undefined;
|
|
664
|
-
locale?: string;
|
|
665
|
-
lines?: AddToCartLineItem[];
|
|
666
|
-
profile?: any;
|
|
667
|
-
}) => UseScriptAutoFreeGiftResult;
|
|
668
|
-
|
|
669
632
|
interface UseCalcGiftsFromLinesOptions {
|
|
670
633
|
/** Lines to calculate gifts from (AddToCartLineItem format) */
|
|
671
634
|
lines: AddToCartLineItem[];
|
|
@@ -752,32 +715,64 @@ declare const getReferralAttributes: () => {
|
|
|
752
715
|
key: string;
|
|
753
716
|
value: any;
|
|
754
717
|
}[];
|
|
718
|
+
/**
|
|
719
|
+
* Detect operating system
|
|
720
|
+
*/
|
|
721
|
+
declare const getOperatingSystem: () => "Android" | "IOS" | "Unknown";
|
|
755
722
|
/**
|
|
756
723
|
* Get user type based on customer information
|
|
757
724
|
*/
|
|
758
725
|
declare const getUserType: (customer?: any) => string;
|
|
726
|
+
/**
|
|
727
|
+
* Get GA4 attributes (sync version)
|
|
728
|
+
*/
|
|
729
|
+
declare function getGA4Attributes(ga4Data?: {
|
|
730
|
+
clientId?: string;
|
|
731
|
+
sessionId?: string;
|
|
732
|
+
} | null): Array<{
|
|
733
|
+
key: string;
|
|
734
|
+
value: string;
|
|
735
|
+
}>;
|
|
736
|
+
/**
|
|
737
|
+
* Get GA4 attributes (async version)
|
|
738
|
+
* Fetches GA4 data and returns formatted attributes
|
|
739
|
+
*/
|
|
740
|
+
declare function getGA4AttributesAsync(): Promise<Array<{
|
|
741
|
+
key: string;
|
|
742
|
+
value: string;
|
|
743
|
+
}>>;
|
|
759
744
|
interface GetCartAttributesProps {
|
|
760
745
|
profile?: any;
|
|
761
746
|
customer?: any;
|
|
762
747
|
cart?: NormalizedCart;
|
|
763
748
|
memberType?: string;
|
|
764
749
|
currentUrl?: string;
|
|
750
|
+
appContext?: {
|
|
751
|
+
isInApp?: boolean;
|
|
752
|
+
appName?: string;
|
|
753
|
+
};
|
|
754
|
+
buyPath?: 'hasCart' | 'buyNow';
|
|
765
755
|
}
|
|
766
756
|
/**
|
|
767
|
-
* Get cart attributes (pure function version)
|
|
757
|
+
* Get basic cart attributes (pure function version)
|
|
768
758
|
*/
|
|
769
|
-
declare function
|
|
759
|
+
declare function getCartBasicAttributes({ profile, customer, cart, memberType, currentUrl, appContext, buyPath, }: GetCartAttributesProps): Array<{
|
|
770
760
|
key: string;
|
|
771
761
|
value: any;
|
|
772
762
|
}>;
|
|
773
763
|
/**
|
|
774
764
|
* Hook to get cart attributes
|
|
775
765
|
*/
|
|
776
|
-
declare const useCartAttributes: ({ profile, customer, cart, memberType, }: {
|
|
766
|
+
declare const useCartAttributes: ({ profile, customer, cart, memberType, appContext, buyPath, }: {
|
|
777
767
|
profile: any;
|
|
778
768
|
customer: any;
|
|
779
769
|
cart?: NormalizedCart;
|
|
780
770
|
memberType?: string;
|
|
771
|
+
appContext?: {
|
|
772
|
+
isInApp?: boolean;
|
|
773
|
+
appName?: string;
|
|
774
|
+
};
|
|
775
|
+
buyPath?: "hasCart" | "buyNow";
|
|
781
776
|
}) => {
|
|
782
777
|
attributes: Array<{
|
|
783
778
|
key: string;
|
|
@@ -2039,4 +2034,4 @@ declare function getCachedGeoLocation(cacheKey?: string): GeoLocationData | unde
|
|
|
2039
2034
|
*/
|
|
2040
2035
|
declare function clearGeoLocationCache(cacheKey?: string): void;
|
|
2041
2036
|
|
|
2042
|
-
export { type AddCartLinesInput, AddToCartInput, AddToCartLineItem, type ApplyCartCodesInput, type AutoFreeGift, type AutoFreeGiftCartLineInput, type AutoFreeGiftConfig, type AutoFreeGiftItem, type AutoFreeGiftList, type AutoFreeGiftMainProduct, type BuyNowInput, BuyRuleType, CODE_AMOUNT_KEY, CUSTOMER_ATTRIBUTE_KEY, CUSTOMER_SCRIPT_GIFT_KEY, type Config, type CreateCartInput, DeliveryPlusType, type DiscountLabel, type FormattedGift, type FunctionGiftResult, type GeoLocationData, type GetCartAttributesProps, type GiftProduct, type GiftProductItem, type GiftTier, type HasPlusMemberInCartProps, type HasPlusMemberInCartResult, type HasPlusMemberInLinesResult, type ImageMedia, type LocaleMapping, MAIN_PRODUCT_CODE, MEMBER_PRICE_ATTRIBUTE_KEY, type MainProductInfo, type NormalizedSearchResultItem, type Options, OrderBasePriceType, type OrderDiscountConfig, type OrderDiscountResult, OrderDiscountType, PlusMemberContext, type PlusMemberContextValue, PlusMemberProvider, type PlusMemberProviderProps, PlusMemberSettingsMetafields, PlusMemberShippingMethodConfig, PriceBasePriceType, type PriceDiscountConfig, PriceDiscountType, type RemoveCartCodesInput, type RemoveCartLinesInput, type RewardItem, type RuleCondition, RuleType, SCRIPT_CODE_AMOUNT_KEY, type SearchResult, type SearchResultType, type SelectedOptionsResult, SelectedPlusMemberVariant, type ShippingMethodsContext, type SiteInfo, SpendMoneyType, type TieredDiscount, type UpdateBuyerIdentityInput, type UpdateCartAttributesInput, UseAddToCartOptions, type UseAllBlogsOptions, type UseAllCollectionsOptions, type UseAllProductsOptions, type UseArticleOptions, type UseArticlesInBlogOptions, type UseArticlesOptions, type UseAutoRemovePlusMemberInCartProps, type UseAvailableDeliveryCouponResult, type UseBlogOptions, type UseBuyNowOptions, type UseCalcGiftsFromLinesOptions, type UseCalcGiftsFromLinesResult, type UseCollectionOptions, type UseCollectionsOptions, type UseExposureOptions, type UseGeoLocationOptions, type UseHasPlusMemberInLinesProps, type UseIntersectionOptions, type UsePlusMemberVariantsOptions, type UsePlusMemberVariantsResult, type UsePriceOptions, type UsePriceResult, type UseProductOptions, type UseProductsByHandlesOptions,
|
|
2037
|
+
export { type AddCartLinesInput, AddToCartInput, AddToCartLineItem, type ApplyCartCodesInput, type AutoFreeGift, type AutoFreeGiftCartLineInput, type AutoFreeGiftConfig, type AutoFreeGiftItem, type AutoFreeGiftList, type AutoFreeGiftMainProduct, type BuyNowInput, BuyRuleType, CODE_AMOUNT_KEY, CUSTOMER_ATTRIBUTE_KEY, CUSTOMER_SCRIPT_GIFT_KEY, type Config, type CreateCartInput, DeliveryPlusType, type DiscountLabel, type FormattedGift, type FunctionGiftResult, type GeoLocationData, type GetCartAttributesProps, type GiftProduct, type GiftProductItem, type GiftTier, type HasPlusMemberInCartProps, type HasPlusMemberInCartResult, type HasPlusMemberInLinesResult, type ImageMedia, type LocaleMapping, MAIN_PRODUCT_CODE, MEMBER_PRICE_ATTRIBUTE_KEY, type MainProductInfo, type NormalizedSearchResultItem, type Options, OrderBasePriceType, type OrderDiscountConfig, type OrderDiscountResult, OrderDiscountType, PlusMemberContext, type PlusMemberContextValue, PlusMemberProvider, type PlusMemberProviderProps, PlusMemberSettingsMetafields, PlusMemberShippingMethodConfig, PriceBasePriceType, type PriceDiscountConfig, PriceDiscountType, type RemoveCartCodesInput, type RemoveCartLinesInput, type RewardItem, type RuleCondition, RuleType, SCRIPT_CODE_AMOUNT_KEY, type SearchResult, type SearchResultType, type SelectedOptionsResult, SelectedPlusMemberVariant, type ShippingMethodsContext, type SiteInfo, SpendMoneyType, type TieredDiscount, type UpdateBuyerIdentityInput, type UpdateCartAttributesInput, UseAddToCartOptions, type UseAllBlogsOptions, type UseAllCollectionsOptions, type UseAllProductsOptions, type UseArticleOptions, type UseArticlesInBlogOptions, type UseArticlesOptions, type UseAutoRemovePlusMemberInCartProps, type UseAvailableDeliveryCouponResult, type UseBlogOptions, type UseBuyNowOptions, type UseCalcGiftsFromLinesOptions, type UseCalcGiftsFromLinesResult, type UseCollectionOptions, type UseCollectionsOptions, type UseExposureOptions, type UseGeoLocationOptions, type UseHasPlusMemberInLinesProps, type UseIntersectionOptions, type UsePlusMemberVariantsOptions, type UsePlusMemberVariantsResult, type UsePriceOptions, type UsePriceResult, type UseProductOptions, type UseProductsByHandlesOptions, UseScriptAutoFreeGiftResult, type UseSearchOptions, type UseShippingMethodsOptions, type UseShippingMethodsResult, type UseSiteOptions, type UseUpdateBuyerIdentityOptions, type UseUpdateCartAttributesOptions, type VariantItem, type VariantMedia, type VideoMedia, clearGeoLocationCache, createMockCartFromLines, currencyCodeMapping, defaultSWRMutationConfiguration, formatFunctionAutoFreeGift, formatScriptAutoFreeGift, getCachedGeoLocation, getCartBasicAttributes, getDiscountEnvAttributeValue, getGA4Attributes, getGA4AttributesAsync, getMatchedMainProductSubTotal, getOperatingSystem, getQuery, getReferralAttributes, getUserType, hasPlusMemberInCart, hasPlusMemberInLines, normalizeAddToCartLines, preCheck, safeParse, useAddCartLines, useAddToCart, useAllBlogs, useAllCollections, useAllProducts, useApplyCartCodes, useArticle, useArticles, useArticlesInBlog, useAutoRemovePlusMemberInCart, useAvailableDeliveryCoupon, useBlog, useBuyNow, useCalcAutoFreeGift, useCalcGiftsFromLines, useCalcOrderDiscount, useCartAttributes, useCartItemQuantityLimit, useCollection, useCollections, useCreateCart, useExposure, useGeoLocation, useHasPlusMemberInCart, useHasPlusMemberInLines, useIntersection, usePlusMemberCheckoutCustomAttributes, usePlusMemberContext, usePlusMemberNeedAddToCart, usePlusMemberVariants, usePrice, useProduct, useProductUrl, useProductsByHandles, useRemoveCartCodes, useRemoveCartLines, useReplaceCartPlusMember, useSearch, useSelectedOptions, useShippingMethods, useSite, useUpdateBuyerIdentity, useUpdateCartAttributes, useUpdateCartLines, useUpdateLineCodeAmountAttributes, useUpdateVariantQuery, useVariant, useVariantMedia };
|