ingeniuscliq-core 0.3.32 → 0.3.33
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,22 @@
|
|
|
1
1
|
import { CoreBuilder } from '../../../classes/CoreBuilder';
|
|
2
2
|
import { CoreShipmentBaseService } from '../services/base';
|
|
3
|
-
import { CoreShippingAddress, CoreShipmentStore, CoreShippingMethod } from '../types/CoreShipment';
|
|
4
|
-
export declare class CoreShipmentBuilder<T extends CoreShippingMethod
|
|
5
|
-
protected shipmentService: CoreShipmentBaseService<T, K>;
|
|
6
|
-
protected initialState: Pick<CoreShipmentStore<T, K>, "shippingMethods" | "shippingAddresses" | "loading" | "error">;
|
|
7
|
-
constructor(service?: CoreShipmentBaseService<T, K>, initialState?: any);
|
|
8
|
-
build(): import('zustand').UseBoundStore<Omit<import('zustand').StoreApi<CoreShipmentStore<T, K>>, "persist"> & {
|
|
3
|
+
import { CoreShippingAddress, CoreShipmentStore, CoreShippingMethod, CoreShippingMethodTypes } from '../types/CoreShipment';
|
|
4
|
+
export declare class CoreShipmentBuilder<T extends CoreShippingMethod<Z>, K extends CoreShippingAddress, Z extends CoreShippingMethodTypes> implements CoreBuilder {
|
|
5
|
+
protected shipmentService: CoreShipmentBaseService<T, K, Z>;
|
|
6
|
+
protected initialState: Pick<CoreShipmentStore<T, K, Z>, "shippingMethods" | "shippingAddresses" | "loading" | "error">;
|
|
7
|
+
constructor(service?: CoreShipmentBaseService<T, K, Z>, initialState?: any);
|
|
8
|
+
build(): import('zustand').UseBoundStore<Omit<import('zustand').StoreApi<CoreShipmentStore<T, K, Z>>, "persist"> & {
|
|
9
9
|
persist: {
|
|
10
|
-
setOptions: (options: Partial<import('zustand/middleware').PersistOptions<CoreShipmentStore<T, K>, {
|
|
10
|
+
setOptions: (options: Partial<import('zustand/middleware').PersistOptions<CoreShipmentStore<T, K, Z>, {
|
|
11
11
|
shippingMethods: T[] | null;
|
|
12
12
|
shippingAddresses: import('../../..').BasePagination<K> | null;
|
|
13
13
|
}>>) => void;
|
|
14
14
|
clearStorage: () => void;
|
|
15
15
|
rehydrate: () => Promise<void> | void;
|
|
16
16
|
hasHydrated: () => boolean;
|
|
17
|
-
onHydrate: (fn: (state: CoreShipmentStore<T, K>) => void) => () => void;
|
|
18
|
-
onFinishHydration: (fn: (state: CoreShipmentStore<T, K>) => void) => () => void;
|
|
19
|
-
getOptions: () => Partial<import('zustand/middleware').PersistOptions<CoreShipmentStore<T, K>, {
|
|
17
|
+
onHydrate: (fn: (state: CoreShipmentStore<T, K, Z>) => void) => () => void;
|
|
18
|
+
onFinishHydration: (fn: (state: CoreShipmentStore<T, K, Z>) => void) => () => void;
|
|
19
|
+
getOptions: () => Partial<import('zustand/middleware').PersistOptions<CoreShipmentStore<T, K, Z>, {
|
|
20
20
|
shippingMethods: T[] | null;
|
|
21
21
|
shippingAddresses: import('../../..').BasePagination<K> | null;
|
|
22
22
|
}>>;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { BaseService } from '../../../services/base';
|
|
2
|
-
import { CoreShippingAddress, CoreShippingAddressForm, CoreShippingMethod } from '../types/CoreShipment';
|
|
2
|
+
import { CoreShippingAddress, CoreShippingAddressForm, CoreShippingMethod, CoreShippingMethodTypes } from '../types/CoreShipment';
|
|
3
3
|
import { BaseApiResponse, BaseApiResponsePagination } from '../../../types';
|
|
4
4
|
/**
|
|
5
5
|
* Base class that can be extended by concrete services
|
|
6
6
|
*/
|
|
7
|
-
export declare class CoreShipmentBaseService<T extends CoreShippingMethod
|
|
7
|
+
export declare class CoreShipmentBaseService<T extends CoreShippingMethod<Z>, K extends CoreShippingAddress, Z extends CoreShippingMethodTypes> extends BaseService {
|
|
8
8
|
constructor();
|
|
9
9
|
getShippingMethods(): Promise<import('axios').AxiosResponse<BaseApiResponse<T[]>, any>>;
|
|
10
10
|
getShippingAddresses(): Promise<import('axios').AxiosResponse<BaseApiResponsePagination<K>, any>>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { BaseApiResponse, BaseApiResponsePagination, BasePagination, BaseStore } from '../../../types';
|
|
2
2
|
import { BaseType } from '../../../types/BaseType';
|
|
3
|
-
export interface CoreShipmentStore<T extends CoreShippingMethod
|
|
3
|
+
export interface CoreShipmentStore<T extends CoreShippingMethod<Z>, K extends CoreShippingAddress, Z extends CoreShippingMethodTypes> extends BaseStore {
|
|
4
4
|
shippingMethods: T[] | null;
|
|
5
5
|
shippingAddresses: BasePagination<K> | null;
|
|
6
6
|
setShippingMethods: (shippingMethods: T[] | null) => void;
|
|
@@ -11,11 +11,17 @@ export interface CoreShipmentStore<T extends CoreShippingMethod, K extends CoreS
|
|
|
11
11
|
fetchShippingAddresses: () => Promise<BaseApiResponsePagination<K>>;
|
|
12
12
|
addShippingAddress: (newAddress: K) => void;
|
|
13
13
|
}
|
|
14
|
-
export interface CoreShippingMethod extends BaseType {
|
|
14
|
+
export interface CoreShippingMethod<T extends CoreShippingMethodTypes> extends BaseType {
|
|
15
15
|
name: string;
|
|
16
|
+
type: T;
|
|
16
17
|
calculation_data_rules: CoreShippingCalculationRule[];
|
|
17
18
|
calculation_data_form: CoreShippingCalculationForm[];
|
|
18
19
|
}
|
|
20
|
+
export declare enum CoreShippingMethodTypesEnum {
|
|
21
|
+
home_delivery = "home_delivery",
|
|
22
|
+
local_pickup = "local_pickup"
|
|
23
|
+
}
|
|
24
|
+
export type CoreShippingMethodTypes = keyof typeof CoreShippingMethodTypesEnum;
|
|
19
25
|
export type CoreShippingCalculationRule = Record<string, Array<any>>;
|
|
20
26
|
export interface CoreShippingCalculationForm {
|
|
21
27
|
field: string;
|