@lightspeed/ecom-headless 1.1.4 → 1.2.0-rc.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/CHANGELOG.md +10 -0
- package/README.md +8 -3
- package/UPGRADE.md +31 -0
- package/dist/index.cjs +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +2 -2
- package/dist/index.d.mts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.mjs +1 -1
- package/dist/index.mjs.map +1 -1
- package/dist/plugin-visualizer/bundle.html +1 -1
- package/dist/shared/ecom-headless.BF4ITfQc.cjs +2 -0
- package/dist/shared/ecom-headless.BF4ITfQc.cjs.map +1 -0
- package/dist/shared/{ecom-headless.CdAf5aSI.d.cts → ecom-headless.BeJeXdSY.d.mts} +109 -32
- package/dist/shared/{ecom-headless.r8wgepwM.d.mts → ecom-headless.CmRks5zy.d.cts} +109 -32
- package/dist/shared/ecom-headless.CyyXXtdO.mjs +2 -0
- package/dist/shared/ecom-headless.CyyXXtdO.mjs.map +1 -0
- package/dist/shared/{ecom-headless.BTXuBMcG.d.cts → ecom-headless.UNkw31Vf.d.cts} +323 -10
- package/dist/shared/{ecom-headless.BTXuBMcG.d.mts → ecom-headless.UNkw31Vf.d.mts} +323 -10
- package/dist/shared/{ecom-headless.BTXuBMcG.d.ts → ecom-headless.UNkw31Vf.d.ts} +323 -10
- package/dist/shared/{ecom-headless.B47rEAOn.d.ts → ecom-headless.vv_Pbr6W.d.ts} +109 -32
- package/dist/storefront/index.cjs +1 -1
- package/dist/storefront/index.cjs.map +1 -1
- package/dist/storefront/index.d.cts +2 -2
- package/dist/storefront/index.d.mts +2 -2
- package/dist/storefront/index.d.ts +2 -2
- package/dist/storefront/index.mjs +1 -1
- package/dist/storefront/index.mjs.map +1 -1
- package/dist/types/index.d.cts +1 -1
- package/dist/types/index.d.mts +1 -1
- package/dist/types/index.d.ts +1 -1
- package/package.json +11 -7
|
@@ -68,10 +68,13 @@ interface AddProductData {
|
|
|
68
68
|
id: number;
|
|
69
69
|
/** Quantity of the product that will be added to the cart. */
|
|
70
70
|
quantity?: number;
|
|
71
|
-
/**
|
|
72
|
-
|
|
71
|
+
/**
|
|
72
|
+
* Map of selected product options by option name.
|
|
73
|
+
* Checkbox options accept multiple selected values.
|
|
74
|
+
*/
|
|
75
|
+
options?: Record<string, string | readonly string[] | undefined>;
|
|
73
76
|
/** Selected price for the product with the parameter "nameYourPriceEnabled": true. */
|
|
74
|
-
selectedPrice?:
|
|
77
|
+
selectedPrice?: number;
|
|
75
78
|
/** Defines subscription product settings if needed. */
|
|
76
79
|
recurringChargeSettings?: AddProductRecurringChargeSettings;
|
|
77
80
|
}
|
|
@@ -251,16 +254,17 @@ interface Order {
|
|
|
251
254
|
}
|
|
252
255
|
|
|
253
256
|
type CartGetCallback = (cart: CartData) => void;
|
|
254
|
-
type CartAddProductCallback = (success: boolean, product: CartProduct, cart: CartData, error
|
|
255
|
-
type CartRemoveProductCallback = (success: boolean,
|
|
256
|
-
type
|
|
257
|
+
type CartAddProductCallback = (success: boolean, product: CartProduct | null, cart: CartData, error: string | null) => void;
|
|
258
|
+
type CartRemoveProductCallback = (success: boolean, product: CartProduct | undefined, itemsRemovedQuantity: number, cart: CartData, error: string | null) => void;
|
|
259
|
+
type CartRemoveProductsCallback = (success: boolean, products: CartProduct[] | undefined, itemsRemovedQuantity: number, cart: CartData, error: string[] | null) => void;
|
|
260
|
+
type CartClearCallback = (success: boolean, error: string | null) => void;
|
|
257
261
|
type CartCalculateTotalCallback = (order: Order) => void;
|
|
258
262
|
type CartGoToCheckoutCallback = () => void;
|
|
259
263
|
interface CartApi {
|
|
260
264
|
get: (callback?: CartGetCallback) => Promise<void>;
|
|
261
265
|
addProduct: (product: AddProductParameter, callback?: CartAddProductCallback) => Promise<void>;
|
|
262
266
|
removeProduct: (index: number, callback?: CartRemoveProductCallback) => Promise<void>;
|
|
263
|
-
removeProducts: (indices: number[], callback?:
|
|
267
|
+
removeProducts: (indices: number[], callback?: CartRemoveProductsCallback) => Promise<void>;
|
|
264
268
|
clear: (callback?: CartClearCallback) => Promise<void>;
|
|
265
269
|
calculateTotal: (callback?: CartCalculateTotalCallback) => Promise<void>;
|
|
266
270
|
gotoCheckout: (callback?: CartGoToCheckoutCallback) => Promise<void>;
|
|
@@ -268,7 +272,7 @@ interface CartApi {
|
|
|
268
272
|
}
|
|
269
273
|
|
|
270
274
|
type CustomerGetCallback = (customer: CustomerData | null) => void;
|
|
271
|
-
type CustomerSignOutCallback = (success: boolean, error
|
|
275
|
+
type CustomerSignOutCallback = (success: boolean, error: string | null) => void;
|
|
272
276
|
interface CustomerApi {
|
|
273
277
|
get: (callback?: CustomerGetCallback) => Promise<void>;
|
|
274
278
|
signOut: (callback?: CustomerSignOutCallback) => Promise<void>;
|
|
@@ -471,5 +475,314 @@ interface VisitorLocation {
|
|
|
471
475
|
source: VisitorLocationSourceType;
|
|
472
476
|
}
|
|
473
477
|
|
|
474
|
-
|
|
475
|
-
|
|
478
|
+
declare const StorefrontRuntimeBridgeVersion: 1;
|
|
479
|
+
declare const StorefrontRuntimeCapabilityValues: {
|
|
480
|
+
readonly CATALOG_PAGE: "CATALOG_PAGE";
|
|
481
|
+
readonly CATALOG_FILTERS: "CATALOG_FILTERS";
|
|
482
|
+
readonly CATEGORY_MENU: "CATEGORY_MENU";
|
|
483
|
+
readonly CATALOG_SUBSCRIPTION: "CATALOG_SUBSCRIPTION";
|
|
484
|
+
readonly PRODUCT: "PRODUCT";
|
|
485
|
+
readonly PRODUCT_CONFIGURATION: "PRODUCT_CONFIGURATION";
|
|
486
|
+
readonly RELATED_PRODUCTS: "RELATED_PRODUCTS";
|
|
487
|
+
readonly PRODUCTS_SUBSCRIPTION: "PRODUCTS_SUBSCRIPTION";
|
|
488
|
+
readonly FAVORITES_STATE: "FAVORITES_STATE";
|
|
489
|
+
readonly FAVORITES_MUTATION: "FAVORITES_MUTATION";
|
|
490
|
+
readonly FAVORITES_SUBSCRIPTION: "FAVORITES_SUBSCRIPTION";
|
|
491
|
+
};
|
|
492
|
+
type StorefrontRuntimeCapability = typeof StorefrontRuntimeCapabilityValues[keyof typeof StorefrontRuntimeCapabilityValues];
|
|
493
|
+
type StorefrontCatalogProductSortOrder = 'DEFINED_BY_STORE_OWNER' | 'ADDED_TIME_DESC' | 'PRICE_ASC' | 'PRICE_DESC' | 'NAME_ASC' | 'NAME_DESC' | 'IN_STORE_RECEIVED_DATE_DESC';
|
|
494
|
+
interface StorefrontProductFilters {
|
|
495
|
+
readonly categories?: readonly number[];
|
|
496
|
+
readonly keyword?: string;
|
|
497
|
+
readonly priceFrom?: number;
|
|
498
|
+
readonly priceTo?: number;
|
|
499
|
+
readonly inventory?: 'instock' | 'outofstock';
|
|
500
|
+
readonly uncategorized?: boolean;
|
|
501
|
+
readonly onSale?: 'onsale' | 'notonsale';
|
|
502
|
+
readonly attributes?: Readonly<Record<string, readonly string[]>>;
|
|
503
|
+
readonly options?: Readonly<Record<string, readonly string[]>>;
|
|
504
|
+
readonly sku?: string;
|
|
505
|
+
readonly swatch?: Readonly<Record<string, readonly string[]>>;
|
|
506
|
+
readonly locations?: readonly string[];
|
|
507
|
+
}
|
|
508
|
+
interface StorefrontPagination {
|
|
509
|
+
readonly offset: number;
|
|
510
|
+
readonly limit: number;
|
|
511
|
+
}
|
|
512
|
+
interface StorefrontListingRequest {
|
|
513
|
+
readonly filters: StorefrontProductFilters;
|
|
514
|
+
readonly sortBy: StorefrontCatalogProductSortOrder;
|
|
515
|
+
readonly pagination: StorefrontPagination;
|
|
516
|
+
}
|
|
517
|
+
interface StorefrontCatalogPageRequest {
|
|
518
|
+
readonly categoryId?: number;
|
|
519
|
+
readonly isArtificialCategory?: boolean;
|
|
520
|
+
readonly listing: StorefrontListingRequest;
|
|
521
|
+
}
|
|
522
|
+
interface StorefrontCatalogFiltersRequest {
|
|
523
|
+
readonly categoryId?: number;
|
|
524
|
+
readonly isArtificialCategory?: boolean;
|
|
525
|
+
readonly filters: StorefrontProductFilters;
|
|
526
|
+
}
|
|
527
|
+
interface StorefrontCategoryMenuRequest {
|
|
528
|
+
readonly categoryId?: number;
|
|
529
|
+
readonly isArtificialCategory?: boolean;
|
|
530
|
+
readonly pagination: StorefrontPagination;
|
|
531
|
+
}
|
|
532
|
+
interface StorefrontProductRequest {
|
|
533
|
+
readonly productId: number;
|
|
534
|
+
readonly variationId?: number;
|
|
535
|
+
readonly selectedOptionIndexes?: readonly number[];
|
|
536
|
+
}
|
|
537
|
+
type StorefrontSelectedOptions = Readonly<Record<string, string | readonly string[]>>;
|
|
538
|
+
interface StorefrontProductConfigurationRequest {
|
|
539
|
+
readonly productId: number;
|
|
540
|
+
readonly selectedOptions: StorefrontSelectedOptions;
|
|
541
|
+
readonly customPrice?: number;
|
|
542
|
+
}
|
|
543
|
+
interface StorefrontRelatedProductsRequest {
|
|
544
|
+
readonly productId: number;
|
|
545
|
+
}
|
|
546
|
+
interface StorefrontPicture {
|
|
547
|
+
readonly alt?: string;
|
|
548
|
+
readonly width: number;
|
|
549
|
+
readonly height: number;
|
|
550
|
+
readonly image160pxUrl?: string;
|
|
551
|
+
readonly image400pxUrl?: string;
|
|
552
|
+
readonly image800pxUrl?: string;
|
|
553
|
+
readonly image1500pxUrl?: string;
|
|
554
|
+
readonly imageOriginalUrl?: string;
|
|
555
|
+
}
|
|
556
|
+
interface StorefrontProductMedia extends StorefrontPicture {
|
|
557
|
+
readonly id: string;
|
|
558
|
+
readonly type: 'PICTURE' | 'VIDEO';
|
|
559
|
+
readonly isMain: boolean;
|
|
560
|
+
readonly video?: {
|
|
561
|
+
readonly embedHtml: string;
|
|
562
|
+
readonly url: string;
|
|
563
|
+
readonly width?: number;
|
|
564
|
+
readonly height?: number;
|
|
565
|
+
};
|
|
566
|
+
}
|
|
567
|
+
interface StorefrontCategorySummary {
|
|
568
|
+
readonly id: number;
|
|
569
|
+
readonly name: string;
|
|
570
|
+
readonly media?: StorefrontPicture;
|
|
571
|
+
readonly slugs: {
|
|
572
|
+
readonly forRouteWithId: string;
|
|
573
|
+
readonly forRouteWithoutId?: string;
|
|
574
|
+
};
|
|
575
|
+
}
|
|
576
|
+
interface StorefrontCategoryDetails extends StorefrontCategorySummary {
|
|
577
|
+
readonly description: string;
|
|
578
|
+
readonly categoryPath: readonly StorefrontCategorySummary[];
|
|
579
|
+
readonly seo: {
|
|
580
|
+
readonly title?: string;
|
|
581
|
+
readonly description?: string;
|
|
582
|
+
readonly canonicalUrl?: string;
|
|
583
|
+
};
|
|
584
|
+
}
|
|
585
|
+
interface StorefrontProductAttribute {
|
|
586
|
+
readonly id: number;
|
|
587
|
+
readonly name: string;
|
|
588
|
+
readonly type: string;
|
|
589
|
+
readonly value: string;
|
|
590
|
+
readonly separator: string;
|
|
591
|
+
readonly isNameAndValueSwapped: boolean;
|
|
592
|
+
}
|
|
593
|
+
interface StorefrontOptionChoice {
|
|
594
|
+
readonly choiceId: string;
|
|
595
|
+
readonly choiceName: string;
|
|
596
|
+
readonly modifierFormatted: string;
|
|
597
|
+
readonly visibility?: string;
|
|
598
|
+
readonly hexCodes?: readonly string[];
|
|
599
|
+
}
|
|
600
|
+
interface StorefrontProductOption {
|
|
601
|
+
readonly type: string;
|
|
602
|
+
readonly optionId: string;
|
|
603
|
+
readonly optionText: string;
|
|
604
|
+
readonly required: boolean;
|
|
605
|
+
readonly placeholder?: string;
|
|
606
|
+
readonly maxLength?: number;
|
|
607
|
+
readonly useImageAsSwatchSelector?: boolean;
|
|
608
|
+
readonly selected?: string | readonly string[];
|
|
609
|
+
readonly choices: readonly StorefrontOptionChoice[];
|
|
610
|
+
}
|
|
611
|
+
interface StorefrontAppliedTax {
|
|
612
|
+
readonly name: string;
|
|
613
|
+
readonly percent: number;
|
|
614
|
+
readonly price: number;
|
|
615
|
+
}
|
|
616
|
+
interface StorefrontWholesalePrice {
|
|
617
|
+
readonly quantity: number;
|
|
618
|
+
readonly price: number;
|
|
619
|
+
readonly priceFormatted: string;
|
|
620
|
+
readonly discountPercent: number;
|
|
621
|
+
}
|
|
622
|
+
interface StorefrontPriceRange {
|
|
623
|
+
readonly minPrice: number;
|
|
624
|
+
readonly maxPrice: number;
|
|
625
|
+
readonly minPriceFormatted: string;
|
|
626
|
+
readonly maxPriceFormatted: string;
|
|
627
|
+
readonly minCompareToPrice: number;
|
|
628
|
+
readonly maxCompareToPrice: number;
|
|
629
|
+
}
|
|
630
|
+
interface StorefrontProductPrice {
|
|
631
|
+
readonly price: number;
|
|
632
|
+
readonly priceFormatted: string;
|
|
633
|
+
readonly compareToPrice?: number;
|
|
634
|
+
readonly compareToPriceFormatted?: string;
|
|
635
|
+
readonly range?: StorefrontPriceRange;
|
|
636
|
+
readonly lowestPrice?: {
|
|
637
|
+
readonly labelForProductList: string;
|
|
638
|
+
readonly labelForProductDetails: string;
|
|
639
|
+
};
|
|
640
|
+
readonly appliedTaxes: readonly StorefrontAppliedTax[];
|
|
641
|
+
readonly wholesalePrices: readonly StorefrontWholesalePrice[];
|
|
642
|
+
}
|
|
643
|
+
interface StorefrontProductInventory {
|
|
644
|
+
readonly isSoldOut: boolean;
|
|
645
|
+
readonly isPreorderAllowed: boolean;
|
|
646
|
+
readonly isShippingRequired: boolean;
|
|
647
|
+
readonly quantity?: number;
|
|
648
|
+
readonly warningLimit?: number;
|
|
649
|
+
readonly minPurchaseQuantity?: number;
|
|
650
|
+
readonly maxPurchaseQuantity?: number;
|
|
651
|
+
readonly weight?: {
|
|
652
|
+
readonly value: number;
|
|
653
|
+
readonly formattedValue: string;
|
|
654
|
+
};
|
|
655
|
+
readonly dimensions?: {
|
|
656
|
+
readonly length: number;
|
|
657
|
+
readonly width: number;
|
|
658
|
+
readonly height: number;
|
|
659
|
+
};
|
|
660
|
+
}
|
|
661
|
+
type StorefrontPurchaseKind = 'NORMAL' | 'CUSTOM_PRICE' | 'SUBSCRIPTION' | 'UNSUPPORTED';
|
|
662
|
+
interface StorefrontProductConfiguration {
|
|
663
|
+
readonly variationId?: number;
|
|
664
|
+
readonly sku?: string;
|
|
665
|
+
readonly selectedOptions: StorefrontSelectedOptions;
|
|
666
|
+
readonly options: readonly StorefrontProductOption[];
|
|
667
|
+
readonly media: readonly StorefrontProductMedia[];
|
|
668
|
+
readonly price: StorefrontProductPrice;
|
|
669
|
+
readonly inventory: StorefrontProductInventory;
|
|
670
|
+
readonly attributes: readonly StorefrontProductAttribute[];
|
|
671
|
+
readonly purchaseKind: StorefrontPurchaseKind;
|
|
672
|
+
readonly isSelectionComplete: boolean;
|
|
673
|
+
readonly isPurchasable: boolean;
|
|
674
|
+
}
|
|
675
|
+
interface StorefrontProduct {
|
|
676
|
+
readonly id: number;
|
|
677
|
+
readonly variationId?: number;
|
|
678
|
+
readonly name: string;
|
|
679
|
+
readonly subtitle: string;
|
|
680
|
+
readonly description: string;
|
|
681
|
+
readonly sku?: string;
|
|
682
|
+
readonly urls: {
|
|
683
|
+
readonly directPageUrl: string;
|
|
684
|
+
readonly proxyLinkUrl: string;
|
|
685
|
+
};
|
|
686
|
+
readonly categoryPaths: readonly {
|
|
687
|
+
readonly isDefault: boolean;
|
|
688
|
+
readonly items: readonly StorefrontCategorySummary[];
|
|
689
|
+
}[];
|
|
690
|
+
readonly attributes: readonly StorefrontProductAttribute[];
|
|
691
|
+
readonly options: readonly StorefrontProductOption[];
|
|
692
|
+
readonly media: readonly StorefrontProductMedia[];
|
|
693
|
+
readonly gridMedia: readonly StorefrontProductMedia[];
|
|
694
|
+
readonly price: StorefrontProductPrice;
|
|
695
|
+
readonly inventory: StorefrontProductInventory;
|
|
696
|
+
readonly rating: number;
|
|
697
|
+
readonly reviewsPublishedCount: number;
|
|
698
|
+
readonly ribbon?: {
|
|
699
|
+
readonly text: string;
|
|
700
|
+
readonly color: string;
|
|
701
|
+
};
|
|
702
|
+
readonly flags: {
|
|
703
|
+
readonly canAddToBagSilently: boolean;
|
|
704
|
+
readonly hasRelatedProducts: boolean;
|
|
705
|
+
readonly hasSizeChart: boolean;
|
|
706
|
+
readonly isGiftCard: boolean;
|
|
707
|
+
};
|
|
708
|
+
readonly defaultConfiguration: StorefrontProductConfiguration;
|
|
709
|
+
}
|
|
710
|
+
interface StorefrontExpandedCategory {
|
|
711
|
+
readonly category: StorefrontCategoryDetails;
|
|
712
|
+
readonly subcategories: readonly StorefrontCategorySummary[];
|
|
713
|
+
readonly products: readonly StorefrontProduct[];
|
|
714
|
+
readonly totalProductsCount: number;
|
|
715
|
+
readonly hasMoreProducts: boolean;
|
|
716
|
+
}
|
|
717
|
+
interface StorefrontCatalogPage {
|
|
718
|
+
readonly expandedCategories: readonly StorefrontExpandedCategory[];
|
|
719
|
+
readonly collapsedCategories: readonly StorefrontCategorySummary[];
|
|
720
|
+
}
|
|
721
|
+
interface StorefrontFilterValue {
|
|
722
|
+
readonly filterId: string | number;
|
|
723
|
+
readonly filterName?: string;
|
|
724
|
+
readonly productCount: number;
|
|
725
|
+
}
|
|
726
|
+
interface StorefrontCatalogValuesFilter {
|
|
727
|
+
readonly type: 'INVENTORY' | 'ON_SALE' | 'CATEGORIES' | 'LOCATIONS';
|
|
728
|
+
readonly values: readonly StorefrontFilterValue[];
|
|
729
|
+
readonly totalCount?: number;
|
|
730
|
+
}
|
|
731
|
+
interface StorefrontCatalogPriceFilter {
|
|
732
|
+
readonly type: 'PRICE';
|
|
733
|
+
readonly values?: {
|
|
734
|
+
readonly min: number;
|
|
735
|
+
readonly max: number;
|
|
736
|
+
};
|
|
737
|
+
}
|
|
738
|
+
interface StorefrontCatalogOptionFilter {
|
|
739
|
+
readonly type: 'OPTION' | 'SWATCH';
|
|
740
|
+
readonly optionId: string;
|
|
741
|
+
readonly optionName: string;
|
|
742
|
+
readonly displayComponent?: string;
|
|
743
|
+
readonly values: readonly (StorefrontFilterValue & {
|
|
744
|
+
readonly hexCodes?: readonly string[];
|
|
745
|
+
})[];
|
|
746
|
+
}
|
|
747
|
+
interface StorefrontCatalogAttributeFilter {
|
|
748
|
+
readonly type: 'ATTRIBUTE';
|
|
749
|
+
readonly attributeId: string;
|
|
750
|
+
readonly attributeName: string;
|
|
751
|
+
readonly values: readonly StorefrontFilterValue[];
|
|
752
|
+
}
|
|
753
|
+
interface StorefrontCatalogMarkerFilter {
|
|
754
|
+
readonly type: 'SEARCH' | 'SKU';
|
|
755
|
+
}
|
|
756
|
+
type StorefrontCatalogFilter = StorefrontCatalogValuesFilter | StorefrontCatalogPriceFilter | StorefrontCatalogOptionFilter | StorefrontCatalogAttributeFilter | StorefrontCatalogMarkerFilter;
|
|
757
|
+
interface StorefrontCatalogFilters {
|
|
758
|
+
readonly filters: readonly StorefrontCatalogFilter[];
|
|
759
|
+
readonly productCount?: number;
|
|
760
|
+
}
|
|
761
|
+
interface StorefrontCategoryMenuItem {
|
|
762
|
+
readonly id: number;
|
|
763
|
+
readonly name: string;
|
|
764
|
+
readonly slugs?: {
|
|
765
|
+
readonly forRouteWithId: string;
|
|
766
|
+
readonly forRouteWithoutId?: string;
|
|
767
|
+
};
|
|
768
|
+
readonly productCount?: number;
|
|
769
|
+
readonly hasChildren?: boolean;
|
|
770
|
+
readonly uncategorized?: boolean;
|
|
771
|
+
}
|
|
772
|
+
interface StorefrontCategoryMenu {
|
|
773
|
+
readonly currentPath: readonly StorefrontCategoryMenuItem[];
|
|
774
|
+
readonly totalCount: number;
|
|
775
|
+
readonly limit: number;
|
|
776
|
+
readonly offset: number;
|
|
777
|
+
readonly page: number;
|
|
778
|
+
readonly categories: readonly StorefrontCategoryMenuItem[];
|
|
779
|
+
readonly productCount: number;
|
|
780
|
+
}
|
|
781
|
+
interface StorefrontFavoritesState {
|
|
782
|
+
readonly productIds: readonly number[];
|
|
783
|
+
readonly count: number;
|
|
784
|
+
readonly customerState: 'GUEST' | 'AUTHENTICATED';
|
|
785
|
+
}
|
|
786
|
+
|
|
787
|
+
export { LegalPageTypeValues as L, StorefrontRuntimeBridgeVersion as ag, StorefrontRuntimeCapabilityValues as ai, VisitorLocationSourceValues as an, CustomerCookieConsentValues as s, JsApiPageValues as x };
|
|
788
|
+
export type { StorefrontListingRequest as $, AddProductData as A, BaseJsApiPage as B, CartAddProductCallback as C, StorefrontCatalogFilter as D, EcwidApiPromise as E, StorefrontCatalogFilters as F, StorefrontCatalogFiltersRequest as G, StorefrontCatalogMarkerFilter as H, StorefrontCatalogOptionFilter as I, JsApiFilterParams as J, StorefrontCatalogPage as K, StorefrontCatalogPageRequest as M, StorefrontCatalogPriceFilter as N, Order as O, StorefrontCatalogProductSortOrder as P, StorefrontCatalogValuesFilter as Q, RecurringChargeSettings as R, ShippingAddress as S, StorefrontCategoryDetails as T, StorefrontCategoryMenu as U, StorefrontCategoryMenuItem as V, StorefrontCategoryMenuRequest as W, StorefrontCategorySummary as X, StorefrontExpandedCategory as Y, StorefrontFavoritesState as Z, StorefrontFilterValue as _, AddProductParameter as a, StorefrontOptionChoice as a0, StorefrontPagination as a1, StorefrontPicture as a2, StorefrontPriceRange as a3, StorefrontProduct as a4, StorefrontProductAttribute as a5, StorefrontProductConfiguration as a6, StorefrontProductConfigurationRequest as a7, StorefrontProductFilters as a8, StorefrontProductInventory as a9, StorefrontProductMedia as aa, StorefrontProductOption as ab, StorefrontProductPrice as ac, StorefrontProductRequest as ad, StorefrontPurchaseKind as ae, StorefrontRelatedProductsRequest as af, StorefrontRuntimeCapability as ah, StorefrontSelectedOptions as aj, StorefrontWholesalePrice as ak, TrackingConsent as al, VisitorLocation as am, CustomerCookieConsentType as ao, AddProductRecurringChargeSettings as b, BillingPerson as c, CartApi as d, CartCalculateTotalCallback as e, CartClearCallback as f, CartData as g, CartDominatingColor as h, CartGetCallback as i, CartGoToCheckoutCallback as j, CartImageBorderInfo as k, CartItem as l, CartMediaItem as m, CartProduct as n, CartRemoveProductCallback as o, CartRemoveProductsCallback as p, CartVideoInfo as q, CustomerApi as r, CustomerData as t, CustomerGetCallback as u, CustomerSignOutCallback as v, JsApiPage as w, StorefrontAppliedTax as y, StorefrontCatalogAttributeFilter as z };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { E as EcwidApiPromise, g as CartData,
|
|
1
|
+
import { E as EcwidApiPromise, g as CartData, ao as CustomerCookieConsentType, w as JsApiPage, t as CustomerData, al as TrackingConsent, am as VisitorLocation, i as CartGetCallback, a as AddProductParameter, C as CartAddProductCallback, o as CartRemoveProductCallback, p as CartRemoveProductsCallback, f as CartClearCallback, e as CartCalculateTotalCallback, j as CartGoToCheckoutCallback, u as CustomerGetCallback, v as CustomerSignOutCallback, M as StorefrontCatalogPageRequest, K as StorefrontCatalogPage, G as StorefrontCatalogFiltersRequest, F as StorefrontCatalogFilters, W as StorefrontCategoryMenuRequest, U as StorefrontCategoryMenu, ad as StorefrontProductRequest, a4 as StorefrontProduct, a7 as StorefrontProductConfigurationRequest, a6 as StorefrontProductConfiguration, af as StorefrontRelatedProductsRequest, Z as StorefrontFavoritesState } from './ecom-headless.UNkw31Vf.js';
|
|
2
2
|
|
|
3
3
|
declare const EcwidWidgetValues: {
|
|
4
4
|
/** Minicart widget */
|
|
@@ -402,7 +402,7 @@ declare function setTrackingConsent(cookieConsent: CustomerCookieConsentType): P
|
|
|
402
402
|
* });
|
|
403
403
|
* ```
|
|
404
404
|
*/
|
|
405
|
-
declare function get$
|
|
405
|
+
declare function get$2(callback?: CartGetCallback): Promise<void>;
|
|
406
406
|
|
|
407
407
|
/**
|
|
408
408
|
* This method allows you to add a new product position to the shopping cart.
|
|
@@ -421,7 +421,7 @@ declare function get$1(callback?: CartGetCallback): Promise<void>;
|
|
|
421
421
|
*
|
|
422
422
|
* // Add product by ID with default quantity
|
|
423
423
|
* Cart.addProduct(10, (success, product, cart) => {
|
|
424
|
-
* if (success) {
|
|
424
|
+
* if (success && product !== null) {
|
|
425
425
|
* console.log('Product added successfully');
|
|
426
426
|
* }
|
|
427
427
|
* });
|
|
@@ -431,10 +431,11 @@ declare function get$1(callback?: CartGetCallback): Promise<void>;
|
|
|
431
431
|
* id: 10,
|
|
432
432
|
* quantity: 3,
|
|
433
433
|
* options: {
|
|
434
|
-
* "Size": "L"
|
|
434
|
+
* "Size": "L",
|
|
435
|
+
* "Extras": ["Gift wrap", "Greeting card"]
|
|
435
436
|
* }
|
|
436
437
|
* }, (success, product, cart, error) => {
|
|
437
|
-
* if (success) {
|
|
438
|
+
* if (success && product !== null) {
|
|
438
439
|
* console.log(`Added ${product.quantity} items to cart`);
|
|
439
440
|
* } else {
|
|
440
441
|
* console.error('Failed to add product:', error);
|
|
@@ -472,8 +473,8 @@ declare function addProduct(product: AddProductParameter, callback?: CartAddProd
|
|
|
472
473
|
* import { Cart } from '@lightspeed/ecom-headless';
|
|
473
474
|
*
|
|
474
475
|
* // Remove the first product from cart
|
|
475
|
-
* Cart.removeProduct(0, (success,
|
|
476
|
-
* if (success) {
|
|
476
|
+
* Cart.removeProduct(0, (success, product, itemsRemovedQuantity, cart, error) => {
|
|
477
|
+
* if (success && product !== undefined) {
|
|
477
478
|
* console.log(`Removed ${itemsRemovedQuantity} items from cart`);
|
|
478
479
|
* console.log(`Product removed: ${product.name}`);
|
|
479
480
|
* } else {
|
|
@@ -500,9 +501,10 @@ declare function removeProduct(index: number, callback?: CartRemoveProductCallba
|
|
|
500
501
|
* import { Cart } from '@lightspeed/ecom-headless';
|
|
501
502
|
*
|
|
502
503
|
* // Remove first and second products from cart
|
|
503
|
-
* Cart.removeProducts([0, 1], (success,
|
|
504
|
-
* if (success) {
|
|
504
|
+
* Cart.removeProducts([0, 1], (success, products, itemsRemovedQuantity, cart, error) => {
|
|
505
|
+
* if (success && products !== undefined) {
|
|
505
506
|
* console.log(`Removed ${itemsRemovedQuantity} total items from cart`);
|
|
507
|
+
* console.log(`Removed ${products.length} cart positions`);
|
|
506
508
|
* } else {
|
|
507
509
|
* console.error('Failed to remove products:', error);
|
|
508
510
|
* }
|
|
@@ -512,7 +514,7 @@ declare function removeProduct(index: number, callback?: CartRemoveProductCallba
|
|
|
512
514
|
* Cart.removeProducts([0, 2, 3]);
|
|
513
515
|
* ```
|
|
514
516
|
*/
|
|
515
|
-
declare function removeProducts(indices: number[], callback?:
|
|
517
|
+
declare function removeProducts(indices: number[], callback?: CartRemoveProductsCallback): Promise<void>;
|
|
516
518
|
|
|
517
519
|
/**
|
|
518
520
|
* This method allows you to clear all details from the shopping cart.
|
|
@@ -603,23 +605,23 @@ declare function canGotoCheckout(): Promise<boolean>;
|
|
|
603
605
|
*/
|
|
604
606
|
declare function gotoCheckout(callback?: CartGoToCheckoutCallback): Promise<void>;
|
|
605
607
|
|
|
606
|
-
declare const index$
|
|
607
|
-
declare const index$
|
|
608
|
-
declare const index$
|
|
609
|
-
declare const index$
|
|
610
|
-
declare const index$
|
|
611
|
-
declare const index$
|
|
612
|
-
declare const index$
|
|
613
|
-
declare namespace index$
|
|
608
|
+
declare const index$4_addProduct: typeof addProduct;
|
|
609
|
+
declare const index$4_calculateTotal: typeof calculateTotal;
|
|
610
|
+
declare const index$4_canGotoCheckout: typeof canGotoCheckout;
|
|
611
|
+
declare const index$4_clear: typeof clear;
|
|
612
|
+
declare const index$4_gotoCheckout: typeof gotoCheckout;
|
|
613
|
+
declare const index$4_removeProduct: typeof removeProduct;
|
|
614
|
+
declare const index$4_removeProducts: typeof removeProducts;
|
|
615
|
+
declare namespace index$4 {
|
|
614
616
|
export {
|
|
615
|
-
index$
|
|
616
|
-
index$
|
|
617
|
-
index$
|
|
618
|
-
index$
|
|
619
|
-
get$
|
|
620
|
-
index$
|
|
621
|
-
index$
|
|
622
|
-
index$
|
|
617
|
+
index$4_addProduct as addProduct,
|
|
618
|
+
index$4_calculateTotal as calculateTotal,
|
|
619
|
+
index$4_canGotoCheckout as canGotoCheckout,
|
|
620
|
+
index$4_clear as clear,
|
|
621
|
+
get$2 as get,
|
|
622
|
+
index$4_gotoCheckout as gotoCheckout,
|
|
623
|
+
index$4_removeProduct as removeProduct,
|
|
624
|
+
index$4_removeProducts as removeProducts,
|
|
623
625
|
};
|
|
624
626
|
}
|
|
625
627
|
|
|
@@ -641,7 +643,7 @@ declare namespace index$1 {
|
|
|
641
643
|
* });
|
|
642
644
|
* ```
|
|
643
645
|
*/
|
|
644
|
-
declare function get(callback?: CustomerGetCallback): Promise<void>;
|
|
646
|
+
declare function get$1(callback?: CustomerGetCallback): Promise<void>;
|
|
645
647
|
|
|
646
648
|
/**
|
|
647
649
|
* This method signs out customer from their account.
|
|
@@ -664,13 +666,88 @@ declare function get(callback?: CustomerGetCallback): Promise<void>;
|
|
|
664
666
|
*/
|
|
665
667
|
declare function signOut(callback?: CustomerSignOutCallback): Promise<void>;
|
|
666
668
|
|
|
667
|
-
declare const
|
|
668
|
-
declare
|
|
669
|
+
declare const index$3_signOut: typeof signOut;
|
|
670
|
+
declare namespace index$3 {
|
|
671
|
+
export {
|
|
672
|
+
get$1 as get,
|
|
673
|
+
index$3_signOut as signOut,
|
|
674
|
+
};
|
|
675
|
+
}
|
|
676
|
+
|
|
677
|
+
declare function getPage(request: StorefrontCatalogPageRequest): Promise<StorefrontCatalogPage>;
|
|
678
|
+
|
|
679
|
+
declare function getFilters(request: StorefrontCatalogFiltersRequest): Promise<StorefrontCatalogFilters>;
|
|
680
|
+
|
|
681
|
+
declare function getCategoryMenu(request: StorefrontCategoryMenuRequest): Promise<StorefrontCategoryMenu>;
|
|
682
|
+
|
|
683
|
+
/**
|
|
684
|
+
* Subscribes to Storefront changes that can make Catalog or Category data stale.
|
|
685
|
+
* Route and listing-state changes remain part of the Storefront page context.
|
|
686
|
+
*/
|
|
687
|
+
declare function subscribeChanges$1(listener: () => void): Promise<() => void>;
|
|
688
|
+
|
|
689
|
+
declare const index$2_getCategoryMenu: typeof getCategoryMenu;
|
|
690
|
+
declare const index$2_getFilters: typeof getFilters;
|
|
691
|
+
declare const index$2_getPage: typeof getPage;
|
|
692
|
+
declare namespace index$2 {
|
|
693
|
+
export {
|
|
694
|
+
index$2_getCategoryMenu as getCategoryMenu,
|
|
695
|
+
index$2_getFilters as getFilters,
|
|
696
|
+
index$2_getPage as getPage,
|
|
697
|
+
subscribeChanges$1 as subscribeChanges,
|
|
698
|
+
};
|
|
699
|
+
}
|
|
700
|
+
|
|
701
|
+
declare function get(request: StorefrontProductRequest): Promise<StorefrontProduct | null>;
|
|
702
|
+
|
|
703
|
+
declare function resolveConfiguration(request: StorefrontProductConfigurationRequest): Promise<StorefrontProductConfiguration>;
|
|
704
|
+
|
|
705
|
+
declare function getRelated(request: StorefrontRelatedProductsRequest): Promise<readonly StorefrontProduct[]>;
|
|
706
|
+
|
|
707
|
+
/**
|
|
708
|
+
* Subscribes to Storefront changes that can make Product data stale.
|
|
709
|
+
* Refetch the required Products data when the listener runs.
|
|
710
|
+
*/
|
|
711
|
+
declare function subscribeChanges(listener: () => void): Promise<() => void>;
|
|
712
|
+
|
|
713
|
+
declare const index$1_get: typeof get;
|
|
714
|
+
declare const index$1_getRelated: typeof getRelated;
|
|
715
|
+
declare const index$1_resolveConfiguration: typeof resolveConfiguration;
|
|
716
|
+
declare const index$1_subscribeChanges: typeof subscribeChanges;
|
|
717
|
+
declare namespace index$1 {
|
|
718
|
+
export {
|
|
719
|
+
index$1_get as get,
|
|
720
|
+
index$1_getRelated as getRelated,
|
|
721
|
+
index$1_resolveConfiguration as resolveConfiguration,
|
|
722
|
+
index$1_subscribeChanges as subscribeChanges,
|
|
723
|
+
};
|
|
724
|
+
}
|
|
725
|
+
|
|
726
|
+
declare function getState(): Promise<StorefrontFavoritesState>;
|
|
727
|
+
|
|
728
|
+
declare function add(productId: number): Promise<StorefrontFavoritesState>;
|
|
729
|
+
declare function remove(productId: number): Promise<StorefrontFavoritesState>;
|
|
730
|
+
|
|
731
|
+
declare function subscribe(listener: (state: StorefrontFavoritesState) => void): Promise<() => void>;
|
|
732
|
+
|
|
733
|
+
declare const index_add: typeof add;
|
|
734
|
+
declare const index_getState: typeof getState;
|
|
735
|
+
declare const index_remove: typeof remove;
|
|
736
|
+
declare const index_subscribe: typeof subscribe;
|
|
669
737
|
declare namespace index {
|
|
670
738
|
export {
|
|
671
|
-
|
|
672
|
-
|
|
739
|
+
index_add as add,
|
|
740
|
+
index_getState as getState,
|
|
741
|
+
index_remove as remove,
|
|
742
|
+
index_subscribe as subscribe,
|
|
673
743
|
};
|
|
674
744
|
}
|
|
675
745
|
|
|
676
|
-
|
|
746
|
+
type StorefrontRuntimeErrorCode = 'STOREFRONT_RUNTIME_UNAVAILABLE' | 'UNSUPPORTED_STOREFRONT_VERSION' | 'UNSUPPORTED_CAPABILITY' | 'INVALID_REQUEST' | 'NOT_FOUND' | 'UNAUTHORIZED' | 'OUT_OF_STOCK' | 'INCOMPLETE_PRODUCT_SELECTION' | 'PREVIEW_MUTATION_DISABLED' | 'NETWORK_ERROR' | 'UNKNOWN_ERROR';
|
|
747
|
+
declare class StorefrontRuntimeError extends Error {
|
|
748
|
+
readonly code: StorefrontRuntimeErrorCode;
|
|
749
|
+
readonly cause?: unknown;
|
|
750
|
+
constructor(code: StorefrontRuntimeErrorCode, message: string, cause?: unknown);
|
|
751
|
+
}
|
|
752
|
+
|
|
753
|
+
export { EcwidWidgetValues as E, OnCartChanged as O, StorefrontRuntimeError as S, index$2 as a, index$3 as b, index as c, OnConsentChanged as d, OnPageLoad as e, OnPageLoaded as f, OnPageSwitch as g, OnSetProfile as h, index$4 as i, index$1 as j, formatCurrency as k, getAppPublicConfig as l, getAppPublicToken as m, getInitializedWidgets as n, getOwnerId as o, getStoreId as p, getStorefrontLang as q, getTrackingConsent as r, getVisitorLocation as s, isStorefrontV3 as t, openPage as u, setTrackingConsent as v };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";const
|
|
1
|
+
"use strict";const storefront_index=require("../shared/ecom-headless.BF4ITfQc.cjs"),getStoreId=require("../shared/ecom-headless.CiGkSfL9.cjs");exports.Cart=storefront_index.index;exports.Catalog=storefront_index.index$1;exports.Customer=storefront_index.index$2;exports.Favorites=storefront_index.index$3;exports.OnCartChanged=storefront_index.OnCartChanged;exports.OnConsentChanged=storefront_index.OnConsentChanged;exports.OnPageLoad=storefront_index.OnPageLoad;exports.OnPageLoaded=storefront_index.OnPageLoaded;exports.OnPageSwitch=storefront_index.OnPageSwitch;exports.OnSetProfile=storefront_index.OnSetProfile;exports.Products=storefront_index.index$4;exports.StorefrontRuntimeError=storefront_index.StorefrontRuntimeError;exports.formatCurrency=storefront_index.formatCurrency;exports.getAppPublicConfig=storefront_index.getAppPublicConfig;exports.getAppPublicToken=storefront_index.getAppPublicToken;exports.getInitializedWidgets=storefront_index.getInitializedWidgets;exports.getStorefrontLang=storefront_index.getStorefrontLang;exports.getTrackingConsent=storefront_index.getTrackingConsent;exports.getVisitorLocation=storefront_index.getVisitorLocation;exports.isStorefrontV3=storefront_index.isStorefrontV3;exports.openPage=storefront_index.openPage;exports.setTrackingConsent=storefront_index.setTrackingConsent;exports.getOwnerId=getStoreId.getOwnerId;exports.getStoreId=getStoreId.getStoreId;
|
|
2
2
|
//# sourceMappingURL=index.cjs.map
|