ingeniuscliq-core 0.1.42 → 0.1.44

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,22 +1,23 @@
1
1
  import { CoreBuilder } from '../../../classes/CoreBuilder';
2
2
  import { CoreProductBaseService } from '../services/base';
3
3
  import { CoreProduct, CoreProductStore } from '../types/CoreProduct';
4
+ import { CoreProductCategory } from '../types';
4
5
  export declare class CoreProductBuilder implements CoreBuilder {
5
6
  protected productService: CoreProductBaseService;
6
- protected initialState: Pick<CoreProductStore<CoreProduct>, "productDetails" | "products" | "loading" | "error">;
7
+ protected initialState: Pick<CoreProductStore<CoreProduct, CoreProductCategory>, "productDetails" | "products" | "categories" | "loading" | "error">;
7
8
  constructor(service?: CoreProductBaseService, initialState?: any);
8
- build(): import('zustand').UseBoundStore<Omit<import('zustand').StoreApi<CoreProductStore<CoreProduct>>, "persist"> & {
9
+ build(): import('zustand').UseBoundStore<Omit<import('zustand').StoreApi<CoreProductStore<CoreProduct, CoreProductCategory>>, "persist"> & {
9
10
  persist: {
10
- setOptions: (options: Partial<import('zustand/middleware').PersistOptions<CoreProductStore<CoreProduct>, {
11
+ setOptions: (options: Partial<import('zustand/middleware').PersistOptions<CoreProductStore<CoreProduct, CoreProductCategory>, {
11
12
  productDetails: CoreProduct | null;
12
13
  products: import('../../..').BasePagination<CoreProduct> | null;
13
14
  }>>) => void;
14
15
  clearStorage: () => void;
15
16
  rehydrate: () => Promise<void> | void;
16
17
  hasHydrated: () => boolean;
17
- onHydrate: (fn: (state: CoreProductStore<CoreProduct>) => void) => () => void;
18
- onFinishHydration: (fn: (state: CoreProductStore<CoreProduct>) => void) => () => void;
19
- getOptions: () => Partial<import('zustand/middleware').PersistOptions<CoreProductStore<CoreProduct>, {
18
+ onHydrate: (fn: (state: CoreProductStore<CoreProduct, CoreProductCategory>) => void) => () => void;
19
+ onFinishHydration: (fn: (state: CoreProductStore<CoreProduct, CoreProductCategory>) => void) => () => void;
20
+ getOptions: () => Partial<import('zustand/middleware').PersistOptions<CoreProductStore<CoreProduct, CoreProductCategory>, {
20
21
  productDetails: CoreProduct | null;
21
22
  products: import('../../..').BasePagination<CoreProduct> | null;
22
23
  }>>;
@@ -1,7 +1,9 @@
1
1
  import { BaseService } from '../../../services/base';
2
+ import { AxiosResponse } from 'axios';
2
3
  /**
3
4
  * Base class that can be extended by concrete services
4
5
  */
5
6
  export declare class CoreProductBaseService extends BaseService {
6
7
  constructor();
8
+ getAllCategories: <T>(params?: Record<string, any>) => Promise<AxiosResponse<T>>;
7
9
  }
@@ -4,7 +4,7 @@ import { BaseType } from '../../../types/BaseType';
4
4
  import { BaseImagesType } from '../../../types/interfaces/BaseImageType';
5
5
  import { BaseSlugType } from '../../../types/interfaces/BaseSlugType';
6
6
  import { BaseVisibleType } from '../../../types/interfaces/BaseVisibleType';
7
- import { HasProductCategories } from './CoreProductCategory';
7
+ import { CoreProductCategory, HasProductCategories } from './CoreProductCategory';
8
8
  import { BaseApiResponse, BaseApiResponsePagination } from '../../../types/contracts/BaseApiResponse';
9
9
  /**
10
10
  * CoreProduct base type
@@ -21,10 +21,12 @@ export interface CoreProduct extends BaseType, BaseSlugType, BaseImagesType, Bas
21
21
  unit_of_measurement: string;
22
22
  short_description: string;
23
23
  }
24
- export interface CoreProductStore<T extends CoreProduct> extends BaseStore {
24
+ export interface CoreProductStore<T extends CoreProduct, K extends CoreProductCategory> extends BaseStore {
25
25
  productDetails: T | null;
26
26
  products: BasePagination<T> | null;
27
+ categories: BasePagination<K> | null;
27
28
  setProducts: (products: BasePagination<T> | null) => void;
29
+ setCategories: (categories: BasePagination<K> | null) => void;
28
30
  setProductDetails: (product: T | null) => void;
29
31
  fetchProducts: (params?: Record<string, any>) => Promise<BaseApiResponsePagination<T>>;
30
32
  getProducts: () => BasePagination<T> | null;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ingeniuscliq-core",
3
- "version": "0.1.42",
3
+ "version": "0.1.44",
4
4
  "description": "IngeniusCliq Core UI y lógica compartida",
5
5
  "license": "MIT",
6
6
  "type": "module",