@liquidcommerce/elements-sdk 2.6.0-beta.54 → 2.6.0-beta.56

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.
@@ -1,6 +1,7 @@
1
1
  import type { IAddProductParams } from '@/core/client/actions/client-cart-action.service';
2
+ import type { IAnonymousCheckoutAddProductItem } from '@/interfaces/api/checkout.interface';
2
3
  import type { IInjectedComponent } from '@/interfaces/component.interface';
3
- import type { ICheckoutPendingItem, ILiquidCommerceElementsDevelopmentConfig } from '@/interfaces/config.interface';
4
+ import type { ILiquidCommerceElementsDevelopmentConfig } from '@/interfaces/config.interface';
4
5
  import type { IInjectCheckoutParams } from '@/interfaces/injection.interface';
5
6
  export interface IQueryParamActions {
6
7
  addProduct: (params: IAddProductParams[], open?: boolean) => Promise<void>;
@@ -37,8 +38,8 @@ export declare function setupCheckout(script: HTMLScriptElement, injectFn: (para
37
38
  }): Promise<void>;
38
39
  export declare function setupExitCheckoutHandlers(exitCheckoutFn: () => void): void;
39
40
  export declare function addProductViaQueryParam(actions: IQueryParamActions, script: HTMLScriptElement, errorPrefix: string): Promise<void>;
40
- export declare function extractProductFromQueryParams(script: HTMLScriptElement, errorPrefix: string): {
41
- pendingItem: ICheckoutPendingItem | null;
42
- promoCode: string | null;
43
- };
41
+ export declare function extractAnonymousProductFromQueryParams(script: HTMLScriptElement, errorPrefix: string): {
42
+ item: IAnonymousCheckoutAddProductItem;
43
+ promoCode?: string;
44
+ } | null;
44
45
  export declare function applyPromoCodeViaQueryParam(actions: IQueryParamActions, script: HTMLScriptElement, errorPrefix: string): Promise<void>;
@@ -19,7 +19,7 @@ export declare class ApiClientService {
19
19
  getAddressDetails(id: string): Promise<ApiResult<IAddressDetailsResult>>;
20
20
  getProductsData(identifier: string[], location?: ILocation): Promise<ApiResult<IProductAvailabilityResponse>>;
21
21
  productListSearch(params: IProductSearchParams): Promise<ApiResult<IProductSearchResponse>>;
22
- getProductAvailabilityByState(identifier: string, state: string): Promise<ApiResult<IProductAvailabilityResponse>>;
22
+ getProductAvailabilityByState(identifiers: string[], state?: string): Promise<ApiResult<IProductAvailabilityResponse>>;
23
23
  getCartData(id: string | null): Promise<ApiResult<ICart>>;
24
24
  updateCart(params: ICartUpdateParams): Promise<ApiResult<ICart>>;
25
25
  prepareCheckout(params: ICheckoutPrepareParams): Promise<ApiResult<ICheckoutPrepare>>;
@@ -1,4 +1,5 @@
1
1
  import type { ICheckoutDetailsEventData } from '@/core/pubsub/interfaces/checkout.interface';
2
+ import type { IAnonymousCheckoutAddProductParams, IAnonymousCheckoutAddProductResponse } from '@/interfaces/api/checkout.interface';
2
3
  import type { IProductAvailabilityResponse } from '@/interfaces/api/product.interface';
3
4
  import type { BillingFieldName, CustomerFieldName, GiftFieldName } from '@/modules/checkout/constant';
4
5
  import { BaseActionService } from './base-action.service';
@@ -20,7 +21,8 @@ export interface ICheckoutActions {
20
21
  updateBillingInfo: (params: Record<BillingFieldName, string>) => void;
21
22
  updateGiftInfo: (params: Record<GiftFieldName, string>) => void;
22
23
  getDetails: () => ICheckoutDetailsEventData;
23
- getProductAvailabilityByState: (identifier: string, state: string) => Promise<IProductAvailabilityResponse>;
24
+ getProductAvailabilityByState: (identifiers: string[], state?: string) => Promise<IProductAvailabilityResponse>;
25
+ addAnonymousProduct: (params: IAnonymousCheckoutAddProductParams) => Promise<IAnonymousCheckoutAddProductResponse>;
24
26
  }
25
27
  export declare class ClientCheckoutActionService extends BaseActionService {
26
28
  private readonly command;
@@ -49,5 +51,6 @@ export declare class ClientCheckoutActionService extends BaseActionService {
49
51
  private updateBillingInfo;
50
52
  private updateGiftInfo;
51
53
  private getDetails;
54
+ private addAnonymousProduct;
52
55
  private getProductAvailabilityByState;
53
56
  }
@@ -3,7 +3,7 @@ import type { IProductAvailabilityResponse } from '@/interfaces/api/product.inte
3
3
  import { BaseActionService } from './base-action.service';
4
4
  export interface IProductActions {
5
5
  getDetails: (identifier: string) => IBaseProductEventData;
6
- getProductAvailabilityByState: (identifier: string, state: string) => Promise<IProductAvailabilityResponse>;
6
+ getProductAvailabilityByState: (identifiers: string[], state?: string) => Promise<IProductAvailabilityResponse>;
7
7
  }
8
8
  export declare class ClientProductActionService extends BaseActionService {
9
9
  private readonly command;
@@ -1,6 +1,6 @@
1
1
  import type { CheckoutEventLevel, CheckoutEventType, FulfillmentType } from '@/enums';
2
2
  import type { IAddressAddress, IAddressCoordinates, ILocation } from '@/interfaces/api/address.interface';
3
- import type { ICart } from '@/interfaces/api/cart.interface';
3
+ import type { ICart, ICartUpdateItem } from '@/interfaces/api/cart.interface';
4
4
  import type { IProductPresale } from '@/interfaces/api/product.interface';
5
5
  export interface ICheckoutComplete {
6
6
  orderNumber: string;
@@ -100,7 +100,8 @@ export interface IAnonymousCheckoutAddProductItem {
100
100
  quantity: number;
101
101
  }
102
102
  export interface IAnonymousCheckoutAddProductParams {
103
- items: IAnonymousCheckoutAddProductItem[];
103
+ items?: IAnonymousCheckoutAddProductItem[];
104
+ cartItems?: ICartUpdateItem[];
104
105
  location: ILocation;
105
106
  promoCode?: string;
106
107
  }
@@ -8,6 +8,12 @@ export interface IProductAvailabilityResponse {
8
8
  products: IProduct[];
9
9
  retailers: Record<string, IRetailer>;
10
10
  }
11
+ export interface IProductPriceInfo {
12
+ currency: string;
13
+ minimum: number;
14
+ average: number;
15
+ maximum: number;
16
+ }
11
17
  export interface IProductVariant {
12
18
  retailerId: string;
13
19
  shippingFulfillmentId: string;
@@ -64,7 +70,7 @@ export interface IProduct {
64
70
  type: string;
65
71
  subType: string;
66
72
  salsifyGrouping: string;
67
- noAvailabilityPrice: number;
73
+ priceInfo: IProductPriceInfo | null;
68
74
  sizes: Record<string, IProductSize>;
69
75
  }
70
76
  export interface IFulfillment {
@@ -1,4 +1,4 @@
1
- import type { DebugMode, ElementsEnv, FulfillmentType } from '@/enums';
1
+ import type { DebugMode, ElementsEnv } from '@/enums';
2
2
  import type { IPromoTicker, UpdateAddressComponent, UpdateCartComponent, UpdateCheckoutComponent, UpdateComponentGlobalConfigs, UpdateProductComponent, UpdateProductListComponent } from './configs';
3
3
  export type DeepPartial<T> = {
4
4
  [P in keyof T]?: T[P] extends object ? DeepPartial<T[P]> : T[P];
@@ -21,15 +21,8 @@ export interface IClientCustomThemeConfig {
21
21
  checkout?: UpdateCheckoutComponent;
22
22
  productList?: UpdateProductListComponent;
23
23
  }
24
- export interface ICheckoutPendingItem {
25
- identifier: string;
26
- fulfillmentType: FulfillmentType;
27
- quantity: number;
28
- }
29
24
  export interface ILiquidCommerceElementsCheckoutConfig {
30
25
  pageUrl?: string;
31
- pendingItems?: ICheckoutPendingItem[];
32
- pendingPromoCode?: string;
33
26
  }
34
27
  export interface ILiquidCommerceElementsBaseConfig {
35
28
  env?: ElementsEnv;
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "description": "LiquidCommerce Elements SDK",
4
4
  "license": "UNLICENSED",
5
5
  "author": "LiquidCommerce Team",
6
- "version": "2.6.0-beta.54",
6
+ "version": "2.6.0-beta.56",
7
7
  "homepage": "https://docs.liquidcommerce.co/elements-sdk",
8
8
  "repository": {
9
9
  "type": "git",