@ikas/storefront 0.0.7 → 0.0.12

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.
Files changed (42) hide show
  1. package/build/__generated__/global-types.d.ts +8 -0
  2. package/build/api/apollo.d.ts +2 -2
  3. package/build/api/category/__generated__/listCategory.d.ts +1 -1
  4. package/build/api/checkout/index.d.ts +4 -4
  5. package/build/api/customer/index.d.ts +6 -6
  6. package/build/api/product/__generated__/listProduct.d.ts +4 -5
  7. package/build/api/product-stock-location/index.d.ts +1 -1
  8. package/build/api/stock-location/index.d.ts +1 -1
  9. package/build/components/checkout/components/address-form/model.d.ts +19 -19
  10. package/build/components/checkout/model.d.ts +4 -4
  11. package/build/components/gtm/functions.d.ts +12 -12
  12. package/build/components/hoc/ThemeComponent.d.ts +2 -1
  13. package/build/components/page-editor/model.d.ts +4 -4
  14. package/build/index.es.js +539 -82
  15. package/build/index.js +538 -80
  16. package/build/models/data/order/line-item/variant/index.d.ts +1 -1
  17. package/build/models/data/product/attribute-value/index.d.ts +1 -1
  18. package/build/models/data/product/index.d.ts +1 -1
  19. package/build/models/data/product/variant/index.d.ts +1 -1
  20. package/build/models/data/variant-type/variant-value/index.d.ts +1 -1
  21. package/build/models/theme/component/prop/index.d.ts +4 -1
  22. package/build/models/theme/index.d.ts +2 -0
  23. package/build/models/theme/page/component/prop-value/category-list.d.ts +9 -0
  24. package/build/models/theme/page/component/prop-value/category.d.ts +5 -0
  25. package/build/models/theme/theme.d.ts +2 -2
  26. package/build/models/ui/brand-list/index.d.ts +1 -1
  27. package/build/models/ui/category-list/index.d.ts +58 -0
  28. package/build/models/ui/index.d.ts +1 -0
  29. package/build/models/ui/product-detail/index.d.ts +1 -1
  30. package/build/models/ui/product-list/index.d.ts +3 -3
  31. package/build/store/cart.d.ts +2 -2
  32. package/build/store/customer.d.ts +2 -2
  33. package/build/utils/providers/page-data.d.ts +3 -2
  34. package/build/utils/providers/prop-value/boolean.d.ts +6 -0
  35. package/build/utils/providers/prop-value/category-list.d.ts +7 -0
  36. package/build/utils/providers/prop-value/category.d.ts +8 -0
  37. package/build/utils/providers/prop-value/image-list.d.ts +7 -0
  38. package/build/utils/providers/prop-value/image.d.ts +7 -0
  39. package/build/utils/providers/prop-value/link.d.ts +1 -1
  40. package/build/utils/providers/prop-value/text.d.ts +6 -0
  41. package/package.json +1 -1
  42. package/build/models/theme/component/prop/value/index.d.ts +0 -14
@@ -293,6 +293,13 @@ export interface OrderAddressStateInput {
293
293
  id?: string | null;
294
294
  name?: string | null;
295
295
  }
296
+ export interface OrderAdjustmentInput {
297
+ amount: number;
298
+ amountType: AmountTypeEnum;
299
+ name: string;
300
+ order: number;
301
+ type: AdjustmentEnum;
302
+ }
296
303
  export interface PaginationInput {
297
304
  limit?: number | null;
298
305
  page?: number | null;
@@ -312,6 +319,7 @@ export interface RetrieveInstallmentInfoInput {
312
319
  price: number;
313
320
  }
314
321
  export interface SaveCheckoutInput {
322
+ adjustments?: OrderAdjustmentInput[] | null;
315
323
  billingAddress?: OrderAddressInput | null;
316
324
  cartId: string;
317
325
  couponCode?: string | null;
@@ -2,8 +2,8 @@ import { ApolloClient, NormalizedCacheObject } from "@apollo/client";
2
2
  declare class Apollo {
3
3
  private _client?;
4
4
  static customerToken?: string;
5
- createApolloClient: (apiKey?: string) => void;
6
- setCustomerToken: (customerToken?: string) => void;
5
+ createApolloClient: (apiKey?: string | undefined) => void;
6
+ setCustomerToken: (customerToken?: string | undefined) => void;
7
7
  getClient: () => ApolloClient<NormalizedCacheObject>;
8
8
  }
9
9
  export declare const apollo: Apollo;
@@ -28,7 +28,7 @@ export interface listCategory {
28
28
  listCategory: listCategory_listCategory;
29
29
  }
30
30
  export interface listCategoryVariables {
31
- id: StringFilterInput;
31
+ id?: StringFilterInput | null;
32
32
  paginationInput?: PaginationInput | null;
33
33
  name?: StringFilterInput | null;
34
34
  }
@@ -6,10 +6,10 @@ export declare class IkasCheckoutAPI {
6
6
  static getCheckoutId(cartId: string): Promise<string | undefined>;
7
7
  static getCheckoutById(id: string): Promise<IkasCheckout | undefined>;
8
8
  static saveCheckout(checkout: IkasCheckout): Promise<string | undefined>;
9
- static createSaleTransactionWithCheckout(checkoutId: string, paymentGatewayId: string, paymentMethodDetail?: IkasPaymentMethodDetail): Promise<SaleTransactionTypes.createSaleTransactionWithCheckout_createSaleTransactionWithCheckout>;
10
- static listPaymentGateway(): Promise<IkasPaymentGateway[]>;
11
- static retrieveInstallmentInfo(input: IkasInstallmentInfoInput): Promise<IkasInstallmentInfo>;
12
- static checkStocks(lines: CheckStocksLineInput[]): Promise<CheckStocksTypes.checkStocks_checkStocks>;
9
+ static createSaleTransactionWithCheckout(checkoutId: string, paymentGatewayId: string, paymentMethodDetail?: IkasPaymentMethodDetail): Promise<SaleTransactionTypes.createSaleTransactionWithCheckout_createSaleTransactionWithCheckout | undefined>;
10
+ static listPaymentGateway(): Promise<IkasPaymentGateway[] | undefined>;
11
+ static retrieveInstallmentInfo(input: IkasInstallmentInfoInput): Promise<IkasInstallmentInfo | undefined>;
12
+ static checkStocks(lines: CheckStocksLineInput[]): Promise<CheckStocksTypes.checkStocks_checkStocks | undefined>;
13
13
  }
14
14
  declare type CheckStocksLineInput = {
15
15
  quantity: number;
@@ -6,20 +6,20 @@ export declare class IkasCustomerAPI {
6
6
  __typename: "CustomerLoginResponse";
7
7
  token: string;
8
8
  tokenExpiry: number;
9
- }>;
9
+ } | undefined>;
10
10
  static register(email: string, password: string, firstName: string, lastName: string): Promise<{
11
11
  customer: IkasCustomer;
12
12
  __typename: "CustomerLoginResponse";
13
13
  token: string;
14
14
  tokenExpiry: number;
15
- }>;
16
- static refreshToken(token: string): Promise<RefreshTokenTypes.customerRefreshToken_customerRefreshToken>;
15
+ } | undefined>;
16
+ static refreshToken(token: string): Promise<RefreshTokenTypes.customerRefreshToken_customerRefreshToken | undefined>;
17
17
  static forgotPassword(email: string): Promise<boolean>;
18
18
  static recoverPassword(password: string, passwordAgain: string, token: string): Promise<boolean>;
19
19
  static checkEmail(email: string): Promise<boolean>;
20
- static getCustomer(): Promise<IkasCustomer>;
21
- static saveCustomer(customer: IkasCustomer): Promise<IkasCustomer>;
22
- static getOrders(id?: string): Promise<IkasOrder[]>;
20
+ static getCustomer(): Promise<IkasCustomer | undefined>;
21
+ static saveCustomer(customer: IkasCustomer): Promise<IkasCustomer | undefined>;
22
+ static getOrders(id?: string): Promise<IkasOrder[] | undefined>;
23
23
  static getOrderTransactions(params?: {
24
24
  checkoutId?: string;
25
25
  id?: string;
@@ -22,8 +22,8 @@ export interface listProduct_listProduct_data_variants_variantValueIds {
22
22
  export interface listProduct_listProduct_data_variants_attributes {
23
23
  __typename: "ProductAttributeValue";
24
24
  value: string | null;
25
- productAttributeId: string;
26
- productAttributeOptionId: string;
25
+ productAttributeId: string | null;
26
+ productAttributeOptionId: string | null;
27
27
  }
28
28
  export interface listProduct_listProduct_data_variants_images {
29
29
  __typename: "ProductImage";
@@ -37,7 +37,6 @@ export interface listProduct_listProduct_data_variants_prices {
37
37
  discountPrice: number | null;
38
38
  buyPrice: number | null;
39
39
  currency: string | null;
40
- salesChannelId: string | null;
41
40
  }
42
41
  export interface listProduct_listProduct_data_variants {
43
42
  __typename: "Variant";
@@ -56,8 +55,8 @@ export interface listProduct_listProduct_data_variants {
56
55
  export interface listProduct_listProduct_data_attributes {
57
56
  __typename: "ProductAttributeValue";
58
57
  value: string | null;
59
- productAttributeId: string;
60
- productAttributeOptionId: string;
58
+ productAttributeId: string | null;
59
+ productAttributeOptionId: string | null;
61
60
  }
62
61
  export interface listProduct_listProduct_data {
63
62
  __typename: "Product";
@@ -1,4 +1,4 @@
1
1
  import * as ListProductStockLocationTypes from "./__generated__/listProductStockLocation";
2
2
  export declare class IkasProductStockLocationAPI {
3
- static listProductStockLocation(stockLocationIdList: string[], variantIdList: string[]): Promise<ListProductStockLocationTypes.listProductStockLocation_listProductStockLocation[]>;
3
+ static listProductStockLocation(stockLocationIdList: string[], variantIdList: string[]): Promise<ListProductStockLocationTypes.listProductStockLocation_listProductStockLocation[] | undefined>;
4
4
  }
@@ -1,4 +1,4 @@
1
1
  import * as ListStockLocationTypes from "./__generated__/listStockLocation";
2
2
  export declare class IkasStockLocationAPI {
3
- static listStockLocation(): Promise<ListStockLocationTypes.listStockLocation_listStockLocation>;
3
+ static listStockLocation(): Promise<ListStockLocationTypes.listStockLocation_listStockLocation | undefined>;
4
4
  }
@@ -9,29 +9,29 @@ export default class AddressFormViewModel {
9
9
  districts: IkasDistrict[];
10
10
  allowedCountryIds?: string[];
11
11
  constructor(data: AddressFormViewModelParams);
12
- get firstName(): string;
13
- get lastName(): string;
14
- get phone(): string;
12
+ get firstName(): string | null | undefined;
13
+ get lastName(): string | null | undefined;
14
+ get phone(): string | null | undefined;
15
15
  get country(): {
16
- id?: string;
17
- name?: string;
18
- code?: string;
19
- };
16
+ id?: string | undefined;
17
+ name?: string | undefined;
18
+ code?: string | undefined;
19
+ } | null | undefined;
20
20
  get state(): {
21
- id?: string;
22
- name?: string;
23
- code?: string;
24
- };
21
+ id?: string | undefined;
22
+ name?: string | undefined;
23
+ code?: string | undefined;
24
+ } | null | undefined;
25
25
  get city(): {
26
- id?: string;
27
- name?: string;
28
- code?: string;
29
- };
26
+ id?: string | undefined;
27
+ name?: string | undefined;
28
+ code?: string | undefined;
29
+ } | null | undefined;
30
30
  get district(): {
31
- id?: string;
32
- name?: string;
33
- code?: string;
34
- };
31
+ id?: string | undefined;
32
+ name?: string | undefined;
33
+ code?: string | undefined;
34
+ } | null | undefined;
35
35
  get countryOptions(): {
36
36
  label: string;
37
37
  value: string;
@@ -30,8 +30,8 @@ export default class CheckoutViewModel {
30
30
  error?: CheckoutError | null;
31
31
  constructor(checkout: IkasCheckout, queryParams: ParsedUrlQuery, router: NextRouter);
32
32
  init: (queryParams: ParsedUrlQuery) => Promise<void>;
33
- get cart(): import("../../models/data/cart/index").IkasCart;
34
- get storefrontRegion(): import("../../models/data/storefront/storefront-region/index").IkasStorefrontRegion;
33
+ get cart(): import("../../models/data/cart/index").IkasCart | null | undefined;
34
+ get storefrontRegion(): import("../../models/data/storefront/storefront-region/index").IkasStorefrontRegion | undefined;
35
35
  get selectedPaymentGatewayIndex(): number;
36
36
  get selectedInstallmentIndex(): number;
37
37
  get checkoutUrl(): string;
@@ -39,8 +39,8 @@ export default class CheckoutViewModel {
39
39
  label: string;
40
40
  value: string;
41
41
  }[];
42
- get installmentPrice(): number;
43
- get installmentExtraPrice(): number;
42
+ get installmentPrice(): number | null | undefined;
43
+ get installmentExtraPrice(): number | undefined;
44
44
  get canProceedToShipping(): boolean;
45
45
  get canProceedToPayment(): boolean;
46
46
  get canPerformPayment(): boolean;
@@ -3,7 +3,7 @@ import { CheckoutStep } from "../checkout/model";
3
3
  export declare function GTMPageView(url: string): {
4
4
  event: string;
5
5
  page: string;
6
- };
6
+ } | undefined;
7
7
  export declare function GTMProductView(productDetail: IkasProductDetail): {
8
8
  event: string;
9
9
  ecommerce: {
@@ -23,7 +23,7 @@ export declare function GTMProductView(productDetail: IkasProductDetail): {
23
23
  quantity: number;
24
24
  }[];
25
25
  };
26
- };
26
+ } | undefined;
27
27
  export declare function GTMAddToCart(item: IkasProductDetail | IkasOrderLineItem, quantity: number): {
28
28
  event: string;
29
29
  ecommerce: {
@@ -57,7 +57,7 @@ export declare function GTMAddToCart(item: IkasProductDetail | IkasOrderLineItem
57
57
  quantity: number;
58
58
  })[];
59
59
  };
60
- };
60
+ } | undefined;
61
61
  export declare function GTMRemoveFromCart(item: IkasProductDetail | IkasOrderLineItem, quantity: number): {
62
62
  event: string;
63
63
  ecommerce: {
@@ -91,7 +91,7 @@ export declare function GTMRemoveFromCart(item: IkasProductDetail | IkasOrderLin
91
91
  quantity: number;
92
92
  })[];
93
93
  };
94
- };
94
+ } | undefined;
95
95
  export declare function GTMBeginCheckout(checkout: IkasCheckout): {
96
96
  event: string;
97
97
  ecommerce: {
@@ -109,9 +109,9 @@ export declare function GTMBeginCheckout(checkout: IkasCheckout): {
109
109
  item_list_id: string;
110
110
  index: number;
111
111
  quantity: number;
112
- }[];
112
+ }[] | undefined;
113
113
  };
114
- };
114
+ } | undefined;
115
115
  export declare function GTMPurchase(checkout: IkasCheckout, orderId: string): {
116
116
  event: string;
117
117
  ecommerce: {
@@ -121,8 +121,8 @@ export declare function GTMPurchase(checkout: IkasCheckout, orderId: string): {
121
121
  value: string;
122
122
  tax: string;
123
123
  shipping: string;
124
- currency: string;
125
- coupon: string;
124
+ currency: string | undefined;
125
+ coupon: string | null | undefined;
126
126
  items: {
127
127
  item_name: string;
128
128
  item_id: string;
@@ -137,10 +137,10 @@ export declare function GTMPurchase(checkout: IkasCheckout, orderId: string): {
137
137
  item_list_id: string;
138
138
  index: number;
139
139
  quantity: number;
140
- }[];
140
+ }[] | undefined;
141
141
  };
142
142
  };
143
- };
143
+ } | undefined;
144
144
  export declare function GTMCheckoutStep(checkout: IkasCheckout, step: CheckoutStep): {
145
145
  event: string;
146
146
  ecommerce: {
@@ -158,7 +158,7 @@ export declare function GTMCheckoutStep(checkout: IkasCheckout, step: CheckoutSt
158
158
  item_list_id: string;
159
159
  index: number;
160
160
  quantity: number;
161
- }[];
161
+ }[] | undefined;
162
162
  };
163
- };
163
+ } | undefined;
164
164
  export declare function GTMDisableHTML(): void;
@@ -1,7 +1,8 @@
1
1
  import * as React from "react";
2
2
  import { IkasThemePageComponent } from "../../models/index";
3
+ import { IkasPageComponentPropValue } from "../../utils/index";
3
4
  declare type Props = {
4
- propValues: any;
5
+ pageComponentPropValue: IkasPageComponentPropValue;
5
6
  pageComponent: IkasThemePageComponent;
6
7
  index: number;
7
8
  };
@@ -14,8 +14,8 @@ export default class PageViewModel {
14
14
  pageDataProvider?: IkasPageDataProvider | null;
15
15
  router: NextRouter;
16
16
  constructor(router: NextRouter);
17
- get selectedPageComponent(): IkasThemePageComponent;
18
- get selectedComponent(): IkasThemeComponent;
17
+ get selectedPageComponent(): IkasThemePageComponent | undefined;
18
+ get selectedComponent(): IkasThemeComponent | undefined;
19
19
  startMessaging: () => void;
20
20
  onMessage: (event: MessageEvent) => Promise<void>;
21
21
  onClick: (id: string) => void;
@@ -45,10 +45,10 @@ export declare enum BridgeMessageType {
45
45
  UPDATE_PROP_VALUE = "UPDATE_PROP_VALUE",
46
46
  UPDATE_PAGE_PARAMS = "UPDATE_PAGE_PARAMS",
47
47
  UPDATE_PAGE_COMPONENT_ORDER = "UPDATE_PAGE_COMPONENT_ORDER",
48
- ADD_NEW_COMPONENT = "ADD_NEW_COMPONENT",
48
+ ADD_COMPONENT = "ADD_COMPONENT",
49
49
  DELETE_COMPONENT = "DELETE_COMPONENT",
50
50
  UPDATE_COMPONENT = "UPDATE_COMPONENT",
51
- ADD_NEW_PAGE_COMPONENT = "ADD_NEW_PAGE_COMPONENT",
51
+ ADD_PAGE_COMPONENT = "ADD_PAGE_COMPONENT",
52
52
  DELETE_PAGE_COMPONENT = "DELETE_PAGE_COMPONENT",
53
53
  COMPONENT_MOUSE_OVER = "COMPONENT_MOUSE_OVER",
54
54
  COMPONENT_MOUSE_LEAVE = "COMPONENT_MOUSE_LEAVE",