@storepecker/storefront-core 2.1.1 → 2.2.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.
Files changed (47) hide show
  1. package/dist/{address-DQEZzyUG.d.cts → address-DwBZHzbI.d.cts} +2 -2
  2. package/dist/{address-DQEZzyUG.d.ts → address-DwBZHzbI.d.ts} +2 -2
  3. package/dist/api/index.cjs +25 -17
  4. package/dist/api/index.d.cts +50 -17
  5. package/dist/api/index.d.ts +50 -17
  6. package/dist/api/index.js +9 -2
  7. package/dist/{booking-CZ59BXk3.d.ts → booking-BGvxHd-t.d.cts} +2 -2
  8. package/dist/{booking-BgZoXUBv.d.cts → booking-BSZ6NP-e.d.ts} +2 -2
  9. package/dist/{cart-BY8D8w-s.d.cts → cart-CfsntcpS.d.ts} +38 -5
  10. package/dist/{cart-GuhgeBBt.d.ts → cart-XumsY-y0.d.cts} +38 -5
  11. package/dist/checkout/index.d.cts +3 -3
  12. package/dist/checkout/index.d.ts +3 -3
  13. package/dist/{chunk-26A3EBZI.cjs → chunk-A67PCF55.cjs} +1 -2
  14. package/dist/{chunk-Y6NFUWTH.js → chunk-ERLBPVFK.js} +1 -2
  15. package/dist/{chunk-PWYWNRVO.cjs → chunk-JVSR6THX.cjs} +6 -6
  16. package/dist/{chunk-UOFTDL4D.js → chunk-ZKHQPHT5.js} +1 -1
  17. package/dist/collections-D4tvWcZp.d.ts +23 -0
  18. package/dist/collections-dCr3VEJo.d.cts +23 -0
  19. package/dist/components/index.d.cts +11 -11
  20. package/dist/components/index.d.ts +11 -11
  21. package/dist/hooks/index.cjs +16 -16
  22. package/dist/hooks/index.d.cts +24 -18
  23. package/dist/hooks/index.d.ts +24 -18
  24. package/dist/hooks/index.js +7 -7
  25. package/dist/models/index.d.cts +8 -8
  26. package/dist/models/index.d.ts +8 -8
  27. package/dist/{orders-DHJhJ3xz.d.cts → orders-CvCa7XWm.d.ts} +19 -17
  28. package/dist/{orders-DHJhJ3xz.d.ts → orders-Dm5Dq02y.d.cts} +19 -17
  29. package/dist/{phonepe-D7vn-9SR.d.cts → phonepe-dWMLZel6.d.cts} +3 -3
  30. package/dist/{phonepe-D7vn-9SR.d.ts → phonepe-dWMLZel6.d.ts} +3 -3
  31. package/dist/{product-Dfi0ke-4.d.cts → product-Daxj09p9.d.cts} +64 -61
  32. package/dist/{product-Dfi0ke-4.d.ts → product-Daxj09p9.d.ts} +64 -61
  33. package/dist/store/index.cjs +10 -10
  34. package/dist/store/index.d.cts +8 -4
  35. package/dist/store/index.d.ts +8 -4
  36. package/dist/store/index.js +5 -5
  37. package/dist/{useAddressForm-DgkCP1nG.d.cts → useAddressForm-DGbEn91-.d.cts} +1 -1
  38. package/dist/{useAddressForm-C-Uzug4d.d.ts → useAddressForm-cO3Au33k.d.ts} +1 -1
  39. package/dist/utils/index.d.cts +6 -6
  40. package/dist/utils/index.d.ts +6 -6
  41. package/dist/wishlist-Cow1wVqf.d.cts +10 -0
  42. package/dist/wishlist-gamNg0T1.d.ts +10 -0
  43. package/package.json +1 -1
  44. package/dist/collections-CenI9AlQ.d.cts +0 -40
  45. package/dist/collections-CenI9AlQ.d.ts +0 -40
  46. package/dist/wishlist-DHOvXmJj.d.cts +0 -41
  47. package/dist/wishlist-LfdFxddw.d.ts +0 -41
@@ -1,7 +1,7 @@
1
1
  import * as zustand from 'zustand';
2
- import { a as CartState, C as Cart } from '../cart-BY8D8w-s.cjs';
3
- import { U as User, W as Wishlist } from '../wishlist-DHOvXmJj.cjs';
4
- import { b as Product } from '../product-Dfi0ke-4.cjs';
2
+ import { a as CartState, C as Cart, U as User } from '../cart-XumsY-y0.cjs';
3
+ import { W as Wishlist } from '../wishlist-Cow1wVqf.cjs';
4
+ import { d as Product } from '../product-Daxj09p9.cjs';
5
5
  import 'react-toastify';
6
6
 
7
7
  interface CartStore extends CartState {
@@ -20,7 +20,11 @@ interface CartStore extends CartState {
20
20
  addToCart: (items: Array<{
21
21
  variant_id: number;
22
22
  quantity: number;
23
- }>, customizationInputs?: any, addressId?: number) => Promise<void>;
23
+ }>, customizationInputs?: Array<{
24
+ customization_option: number;
25
+ customer_input: string;
26
+ product_variant: number;
27
+ }>, addressId?: number) => Promise<void>;
24
28
  removeFromCart: (items: Array<{
25
29
  variant_id: number;
26
30
  quantity: number;
@@ -1,7 +1,7 @@
1
1
  import * as zustand from 'zustand';
2
- import { a as CartState, C as Cart } from '../cart-GuhgeBBt.js';
3
- import { U as User, W as Wishlist } from '../wishlist-LfdFxddw.js';
4
- import { b as Product } from '../product-Dfi0ke-4.js';
2
+ import { a as CartState, C as Cart, U as User } from '../cart-CfsntcpS.js';
3
+ import { W as Wishlist } from '../wishlist-gamNg0T1.js';
4
+ import { d as Product } from '../product-Daxj09p9.js';
5
5
  import 'react-toastify';
6
6
 
7
7
  interface CartStore extends CartState {
@@ -20,7 +20,11 @@ interface CartStore extends CartState {
20
20
  addToCart: (items: Array<{
21
21
  variant_id: number;
22
22
  quantity: number;
23
- }>, customizationInputs?: any, addressId?: number) => Promise<void>;
23
+ }>, customizationInputs?: Array<{
24
+ customization_option: number;
25
+ customer_input: string;
26
+ product_variant: number;
27
+ }>, addressId?: number) => Promise<void>;
24
28
  removeFromCart: (items: Array<{
25
29
  variant_id: number;
26
30
  quantity: number;
@@ -1,5 +1,5 @@
1
- export { loginUser, useAuthStore, useCartStore } from '../chunk-UOFTDL4D.js';
2
- import { getWishlist, getProducts } from '../chunk-Y6NFUWTH.js';
1
+ export { loginUser, useAuthStore, useCartStore } from '../chunk-ZKHQPHT5.js';
2
+ import { getWishlist, getProducts } from '../chunk-ERLBPVFK.js';
3
3
  import '../chunk-QAC72HKO.js';
4
4
  import '../chunk-JWKDXFS4.js';
5
5
  import '../chunk-WEMNXIRS.js';
@@ -18,10 +18,10 @@ var useWishlistStore = create((set) => ({
18
18
  syncWishlist: async () => {
19
19
  try {
20
20
  const response = await getWishlist("/customer/wishlist/");
21
- if (response) {
21
+ if (response.data) {
22
22
  set({
23
- wishlist_count: response.wishlist_count,
24
- product_variants: response.product_variants
23
+ wishlist_count: response.data.wishlist_count,
24
+ product_variants: response.data.product_variants
25
25
  });
26
26
  }
27
27
  } catch {
@@ -1,6 +1,6 @@
1
1
  import { ChangeEvent } from 'react';
2
2
  import { useFormik } from 'formik';
3
- import { A as Address } from './address-DQEZzyUG.cjs';
3
+ import { A as Address } from './address-DwBZHzbI.cjs';
4
4
 
5
5
  interface UseAddressFormOptions {
6
6
  /** Existing address for edit mode. When provided, form prefills from this address. */
@@ -1,6 +1,6 @@
1
1
  import { ChangeEvent } from 'react';
2
2
  import { useFormik } from 'formik';
3
- import { A as Address } from './address-DQEZzyUG.js';
3
+ import { A as Address } from './address-DwBZHzbI.js';
4
4
 
5
5
  interface UseAddressFormOptions {
6
6
  /** Existing address for edit mode. When provided, form prefills from this address. */
@@ -1,11 +1,11 @@
1
- import { c as ProductDetail, b as Product, O as OperatingHours, T as TimeSlot, A as Attributes } from '../product-Dfi0ke-4.cjs';
2
- export { e as ADDRESS_FORM_SESSION_KEY, f as ALLOWED_COUNTRIES, D as DEFAULT_TOAST_CONFIG, g as PRODUCT_STATUSES, d as SLICE_STATUS, U as USER_CART, h as USER_CREDENTIALS, i as USER_CRED_REFRESH_TOKEN, j as USER_CRED_TOKEN, p as pathNameMap } from '../product-Dfi0ke-4.cjs';
3
- import { C as Cart, b as Category$1 } from '../cart-BY8D8w-s.cjs';
1
+ import { f as ProductDetail, d as Product, O as OperatingHours, T as TimeSlot, A as Attributes } from '../product-Daxj09p9.cjs';
2
+ export { h as ADDRESS_FORM_SESSION_KEY, i as ALLOWED_COUNTRIES, D as DEFAULT_TOAST_CONFIG, j as PRODUCT_STATUSES, g as SLICE_STATUS, U as USER_CART, k as USER_CREDENTIALS, l as USER_CRED_REFRESH_TOKEN, m as USER_CRED_TOKEN, p as pathNameMap } from '../product-Daxj09p9.cjs';
3
+ import { C as Cart, b as Category$1 } from '../cart-XumsY-y0.cjs';
4
4
  export { S as SnapstoreConfig, g as getApiEndpoint, a as getCloudFront, b as getConfig, c as getPhonePeApiEndpoint, d as getPublicApiEndpoint, e as getSecretKey, f as getStoreId, i as initConfig } from '../index-DTyIuLuI.cjs';
5
- import { C as CollectionResponse } from '../collections-CenI9AlQ.cjs';
5
+ import { C as CollectionResponse } from '../collections-dCr3VEJo.cjs';
6
6
  import { AxiosResponse } from 'axios';
7
- import { a as PhonePe } from '../phonepe-D7vn-9SR.cjs';
8
- import { O as Order } from '../orders-DHJhJ3xz.cjs';
7
+ import { a as PhonePe } from '../phonepe-dWMLZel6.cjs';
8
+ import { O as Order } from '../orders-Dm5Dq02y.cjs';
9
9
  import 'react-toastify';
10
10
 
11
11
  declare function setAuthTokenChangeCallback(callback: (token: string | undefined) => void): void;
@@ -1,11 +1,11 @@
1
- import { c as ProductDetail, b as Product, O as OperatingHours, T as TimeSlot, A as Attributes } from '../product-Dfi0ke-4.js';
2
- export { e as ADDRESS_FORM_SESSION_KEY, f as ALLOWED_COUNTRIES, D as DEFAULT_TOAST_CONFIG, g as PRODUCT_STATUSES, d as SLICE_STATUS, U as USER_CART, h as USER_CREDENTIALS, i as USER_CRED_REFRESH_TOKEN, j as USER_CRED_TOKEN, p as pathNameMap } from '../product-Dfi0ke-4.js';
3
- import { C as Cart, b as Category$1 } from '../cart-GuhgeBBt.js';
1
+ import { f as ProductDetail, d as Product, O as OperatingHours, T as TimeSlot, A as Attributes } from '../product-Daxj09p9.js';
2
+ export { h as ADDRESS_FORM_SESSION_KEY, i as ALLOWED_COUNTRIES, D as DEFAULT_TOAST_CONFIG, j as PRODUCT_STATUSES, g as SLICE_STATUS, U as USER_CART, k as USER_CREDENTIALS, l as USER_CRED_REFRESH_TOKEN, m as USER_CRED_TOKEN, p as pathNameMap } from '../product-Daxj09p9.js';
3
+ import { C as Cart, b as Category$1 } from '../cart-CfsntcpS.js';
4
4
  export { S as SnapstoreConfig, g as getApiEndpoint, a as getCloudFront, b as getConfig, c as getPhonePeApiEndpoint, d as getPublicApiEndpoint, e as getSecretKey, f as getStoreId, i as initConfig } from '../index-DTyIuLuI.js';
5
- import { C as CollectionResponse } from '../collections-CenI9AlQ.js';
5
+ import { C as CollectionResponse } from '../collections-D4tvWcZp.js';
6
6
  import { AxiosResponse } from 'axios';
7
- import { a as PhonePe } from '../phonepe-D7vn-9SR.js';
8
- import { O as Order } from '../orders-DHJhJ3xz.js';
7
+ import { a as PhonePe } from '../phonepe-dWMLZel6.js';
8
+ import { O as Order } from '../orders-CvCa7XWm.js';
9
9
  import 'react-toastify';
10
10
 
11
11
  declare function setAuthTokenChangeCallback(callback: (token: string | undefined) => void): void;
@@ -0,0 +1,10 @@
1
+ import { f as ProductDetail } from './product-Daxj09p9.cjs';
2
+
3
+ declare namespace Wishlist {
4
+ interface Root {
5
+ wishlist_count: number;
6
+ product_variants: ProductDetail.Root[];
7
+ }
8
+ }
9
+
10
+ export { Wishlist as W };
@@ -0,0 +1,10 @@
1
+ import { f as ProductDetail } from './product-Daxj09p9.js';
2
+
3
+ declare namespace Wishlist {
4
+ interface Root {
5
+ wishlist_count: number;
6
+ product_variants: ProductDetail.Root[];
7
+ }
8
+ }
9
+
10
+ export { Wishlist as W };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@storepecker/storefront-core",
3
- "version": "2.1.1",
3
+ "version": "2.2.1",
4
4
  "description": "Shared logic and utilities for Snapstore themes",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -1,40 +0,0 @@
1
- interface CollectionResponse {
2
- id: number;
3
- title: string;
4
- description: string;
5
- slug: string;
6
- is_published: boolean;
7
- image: string | null;
8
- published_at: string | null;
9
- variants?: any[];
10
- }
11
- interface singleCollection {
12
- slug: string;
13
- }
14
- interface Attributes {
15
- [key: string]: {
16
- name: string;
17
- value: string;
18
- };
19
- }
20
- interface CollectionVariant {
21
- id: number;
22
- name: string;
23
- sku: string;
24
- actual_price: string;
25
- selling_price: string;
26
- stock_quantity: number;
27
- product: number;
28
- is_active: boolean;
29
- is_featured: boolean;
30
- product_measurements: string;
31
- attributes: Attributes;
32
- back_order: boolean;
33
- back_order_limit: number;
34
- user_purchase_limit: number;
35
- status: string;
36
- product_photos: any[];
37
- media: string;
38
- }
39
-
40
- export type { Attributes as A, CollectionResponse as C, CollectionVariant as a, singleCollection as s };
@@ -1,40 +0,0 @@
1
- interface CollectionResponse {
2
- id: number;
3
- title: string;
4
- description: string;
5
- slug: string;
6
- is_published: boolean;
7
- image: string | null;
8
- published_at: string | null;
9
- variants?: any[];
10
- }
11
- interface singleCollection {
12
- slug: string;
13
- }
14
- interface Attributes {
15
- [key: string]: {
16
- name: string;
17
- value: string;
18
- };
19
- }
20
- interface CollectionVariant {
21
- id: number;
22
- name: string;
23
- sku: string;
24
- actual_price: string;
25
- selling_price: string;
26
- stock_quantity: number;
27
- product: number;
28
- is_active: boolean;
29
- is_featured: boolean;
30
- product_measurements: string;
31
- attributes: Attributes;
32
- back_order: boolean;
33
- back_order_limit: number;
34
- user_purchase_limit: number;
35
- status: string;
36
- product_photos: any[];
37
- media: string;
38
- }
39
-
40
- export type { Attributes as A, CollectionResponse as C, CollectionVariant as a, singleCollection as s };
@@ -1,41 +0,0 @@
1
- import { d as SLICE_STATUS, c as ProductDetail } from './product-Dfi0ke-4.cjs';
2
-
3
- declare namespace User {
4
- interface Root {
5
- customer_name: string;
6
- phone: string;
7
- email: string;
8
- date_of_birth: string;
9
- country_code: string;
10
- gender: string;
11
- }
12
- interface UserState {
13
- user: LoginUserData | null;
14
- isAuthenticated: boolean;
15
- status: SLICE_STATUS;
16
- }
17
- interface LoginUserData {
18
- email: string;
19
- first_name: string;
20
- last_name: string;
21
- access: string;
22
- refresh: string;
23
- user_id: number;
24
- phone_number: string;
25
- }
26
- interface UserDetailsPayload {
27
- customer_name: string;
28
- gender: string;
29
- date_of_birth: string;
30
- }
31
- type LoginMethod = "email_otp" | "phone_otp";
32
- }
33
-
34
- declare namespace Wishlist {
35
- interface Root {
36
- wishlist_count: number;
37
- product_variants: ProductDetail.Root[];
38
- }
39
- }
40
-
41
- export { User as U, Wishlist as W };
@@ -1,41 +0,0 @@
1
- import { d as SLICE_STATUS, c as ProductDetail } from './product-Dfi0ke-4.js';
2
-
3
- declare namespace User {
4
- interface Root {
5
- customer_name: string;
6
- phone: string;
7
- email: string;
8
- date_of_birth: string;
9
- country_code: string;
10
- gender: string;
11
- }
12
- interface UserState {
13
- user: LoginUserData | null;
14
- isAuthenticated: boolean;
15
- status: SLICE_STATUS;
16
- }
17
- interface LoginUserData {
18
- email: string;
19
- first_name: string;
20
- last_name: string;
21
- access: string;
22
- refresh: string;
23
- user_id: number;
24
- phone_number: string;
25
- }
26
- interface UserDetailsPayload {
27
- customer_name: string;
28
- gender: string;
29
- date_of_birth: string;
30
- }
31
- type LoginMethod = "email_otp" | "phone_otp";
32
- }
33
-
34
- declare namespace Wishlist {
35
- interface Root {
36
- wishlist_count: number;
37
- product_variants: ProductDetail.Root[];
38
- }
39
- }
40
-
41
- export { User as U, Wishlist as W };