@artisan-commerce/products 0.7.0 → 0.7.3
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.
- package/README.md +93 -93
- package/build/main.bundle.js +2 -2
- package/build/report.json +1 -0
- package/build/src/config/constants.d.ts +23 -23
- package/build/src/errors/api.errors.d.ts +7 -7
- package/build/src/index.d.ts +16 -16
- package/build/src/lib/aritmetics.d.ts +1 -1
- package/build/src/lib/common.d.ts +16 -16
- package/build/src/lib/getCategories/getCategories.d.ts +1 -1
- package/build/src/lib/getCategories/getCategories.test.d.ts +1 -1
- package/build/src/lib/getProductDetails/getProductDetails.d.ts +7 -7
- package/build/src/lib/getProductDetails/getProductDetails.test.d.ts +1 -1
- package/build/src/lib/getProductDetails/getProductDetails.types.d.ts +7 -7
- package/build/src/lib/getProducts/getProducts.d.ts +7 -7
- package/build/src/lib/getProducts/getProducts.test.d.ts +1 -1
- package/build/src/lib/getProducts/getProducts.types.d.ts +3 -3
- package/build/src/lib/getRecommendedProducts/getRecommendedProducts.d.ts +1 -1
- package/build/src/lib/getRecommendedProducts/getRecommendedProducts.test.d.ts +1 -1
- package/build/src/lib/getRelatedProducts/getRelatedProducts.d.ts +1 -1
- package/build/src/lib/getRelatedProducts/getRelatedProducts.test.d.ts +1 -1
- package/build/src/lib/getStoreDetails/getStoreDetails.d.ts +7 -7
- package/build/src/lib/getStoreDetails/getStoreDetails.test.d.ts +1 -1
- package/build/src/lib/getStoreDetails/getStoreDetails.types.d.ts +7 -7
- package/build/src/lib/initProducts/initProducts.d.ts +10 -10
- package/build/src/lib/registerModifiersForm/registerModifiersForm.d.ts +3 -3
- package/build/src/lib/registerModifiersForm/registerModifiersForm.test.d.ts +1 -1
- package/build/src/lib/registerModifiersForm/registerModifiersForm.types.d.ts +34 -34
- package/build/src/lib/validateProduct/validateProduct.d.ts +1 -1
- package/build/src/lib/validateProduct/validateProduct.test.d.ts +1 -1
- package/build/src/lib/validateProduct/validateProduct.types.d.ts +2 -2
- package/build/src/services/fetchProductDetails/fetchProductDetails.service.d.ts +2 -2
- package/build/src/services/fetchProductDetails/fetchProductDetails.service.mock.d.ts +2 -2
- package/build/src/services/fetchProductDetails/fetchProductDetails.service.types.d.ts +1 -1
- package/build/src/services/fetchProducts/fetchPRoducts.service.mock.d.ts +2 -2
- package/build/src/services/fetchProducts/fetchProducts.service.d.ts +2 -2
- package/build/src/services/fetchProducts/fetchProducts.service.types.d.ts +1 -1
- package/build/src/services/fetchStoreDetails/fetchStoreDetails.service.d.ts +2 -2
- package/build/src/services/fetchStoreDetails/fetchStoreDetails.service.types.d.ts +1 -1
- package/build/src/tests/exports.test.d.ts +1 -1
- package/build/src/types/common.types.d.ts +20 -20
- package/build/src/types/http.types.d.ts +66 -66
- package/build/src/types/modifiers.types.d.ts +57 -57
- package/build/src/utils/assertions/assertions.utils.d.ts +8 -8
- package/build/src/utils/bugsnag.d.ts +2 -2
- package/build/src/utils/caculations/calculations.utils.d.ts +17 -17
- package/build/src/utils/caculations/calculations.utils.test.d.ts +1 -1
- package/build/src/utils/caculations/calculations.utils.types.d.ts +6 -6
- package/build/src/utils/common.utils.d.ts +3 -3
- package/build/src/utils/http/cache.utils.d.ts +4 -4
- package/build/src/utils/http/http.utils.d.ts +9 -9
- package/build/src/utils/http/purge.utils.d.ts +38 -38
- package/build/src/utils/http/request.utils.d.ts +7 -7
- package/build/src/utils/modifiers/common.utils.d.ts +12 -12
- package/build/src/utils/modifiers/form.utils.d.ts +3 -3
- package/build/src/utils/modifiers/handleChange.utils.d.ts +1 -1
- package/build/src/utils/modifiers/renderer.utils.d.ts +11 -11
- package/build/src/utils/modifiers/rendererTraversal.utils.d.ts +4 -4
- package/build/src/utils/modifiers/updateRenderer.utils.d.ts +5 -5
- package/build/src/utils/transformers/api.transformer.d.ts +7 -7
- package/build/src/utils/transformers/transformers.utils.d.ts +9 -9
- package/build/src/vendors.d.ts +1 -1
- package/build/vendors.bundle.js +1 -1
- package/package.json +5 -4
- package/build/report.html +0 -53
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { ProductHints } from "../types/common.types";
|
|
2
|
-
import { ID, ProductsHTTPConfig, RequestData } from "../types/http.types";
|
|
3
|
-
export declare const checkAccountId: (accountId: ProductHints["accountId"] | undefined, message?: string) => void;
|
|
4
|
-
export declare const checkVendorId: (vendorId: ID | undefined, message?: string) => void;
|
|
5
|
-
export declare const checkStoreId: (storeId: ID | undefined, message?: string) => void;
|
|
6
|
-
export declare const checkCatalogueId: (catalogueId: ID | undefined, message?: string) => void;
|
|
7
|
-
export declare const checkHTTPMinimumConfig: (config: ProductsHTTPConfig, data: RequestData, message?: string) => void;
|
|
1
|
+
import { ProductHints } from "../types/common.types";
|
|
2
|
+
import { ID, ProductsHTTPConfig, RequestData } from "../types/http.types";
|
|
3
|
+
export declare const checkAccountId: (accountId: ProductHints["accountId"] | undefined, message?: string) => void;
|
|
4
|
+
export declare const checkVendorId: (vendorId: ID | undefined, message?: string) => void;
|
|
5
|
+
export declare const checkStoreId: (storeId: ID | undefined, message?: string) => void;
|
|
6
|
+
export declare const checkCatalogueId: (catalogueId: ID | undefined, message?: string) => void;
|
|
7
|
+
export declare const checkHTTPMinimumConfig: (config: ProductsHTTPConfig, data: RequestData, message?: string) => void;
|
package/build/src/index.d.ts
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import * as transformers from "./utils/transformers/transformers.utils";
|
|
2
|
-
import * as assertions from "./utils/assertions/assertions.utils";
|
|
3
|
-
export { getCategories } from "./lib/getCategories/getCategories";
|
|
4
|
-
export { getProductDetails } from "./lib/getProductDetails/getProductDetails";
|
|
5
|
-
export { getProducts } from "./lib/getProducts/getProducts";
|
|
6
|
-
export { getRecommendedProducts } from "./lib/getRecommendedProducts/getRecommendedProducts";
|
|
7
|
-
export { getRelatedProducts } from "./lib/getRelatedProducts/getRelatedProducts";
|
|
8
|
-
export { getStoreDetails } from "./lib/getStoreDetails/getStoreDetails";
|
|
9
|
-
export { registerModifiersForm } from "./lib/registerModifiersForm/registerModifiersForm";
|
|
10
|
-
export { validateProduct } from "./lib/validateProduct/validateProduct";
|
|
11
|
-
export { initProducts } from "./lib/initProducts/initProducts";
|
|
12
|
-
export { getProductTotals } from "./utils/caculations/calculations.utils";
|
|
13
|
-
export { transformers, assertions };
|
|
14
|
-
export type { ModifierGroupRenderer } from "./types/modifiers.types";
|
|
15
|
-
export type { ModifierRenderer } from "./types/modifiers.types";
|
|
16
|
-
export type { ModifiersForm } from "./lib/registerModifiersForm/registerModifiersForm.types";
|
|
1
|
+
import * as transformers from "./utils/transformers/transformers.utils";
|
|
2
|
+
import * as assertions from "./utils/assertions/assertions.utils";
|
|
3
|
+
export { getCategories } from "./lib/getCategories/getCategories";
|
|
4
|
+
export { getProductDetails } from "./lib/getProductDetails/getProductDetails";
|
|
5
|
+
export { getProducts } from "./lib/getProducts/getProducts";
|
|
6
|
+
export { getRecommendedProducts } from "./lib/getRecommendedProducts/getRecommendedProducts";
|
|
7
|
+
export { getRelatedProducts } from "./lib/getRelatedProducts/getRelatedProducts";
|
|
8
|
+
export { getStoreDetails } from "./lib/getStoreDetails/getStoreDetails";
|
|
9
|
+
export { registerModifiersForm } from "./lib/registerModifiersForm/registerModifiersForm";
|
|
10
|
+
export { validateProduct } from "./lib/validateProduct/validateProduct";
|
|
11
|
+
export { initProducts } from "./lib/initProducts/initProducts";
|
|
12
|
+
export { getProductTotals } from "./utils/caculations/calculations.utils";
|
|
13
|
+
export { transformers, assertions };
|
|
14
|
+
export type { ModifierGroupRenderer } from "./types/modifiers.types";
|
|
15
|
+
export type { ModifierRenderer } from "./types/modifiers.types";
|
|
16
|
+
export type { ModifiersForm } from "./lib/registerModifiersForm/registerModifiersForm.types";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const sum: (a: number, b: number) => number;
|
|
1
|
+
export declare const sum: (a: number, b: number) => number;
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import { GlobalState } from "../types/common.types";
|
|
2
|
-
export declare const initialState: GlobalState;
|
|
3
|
-
export declare const setState: (overrides: Partial<GlobalState>) => void;
|
|
4
|
-
export declare const getState: () => {
|
|
5
|
-
artisanApp: import("../../../types/build").ArtisanApp | undefined;
|
|
6
|
-
apiCache: import("../types/common.types").ApiCache;
|
|
7
|
-
expiresAt: number;
|
|
8
|
-
forms: import("../types/common.types").ModifiersForms;
|
|
9
|
-
timeout?: number | undefined;
|
|
10
|
-
accountId?: string | number | undefined;
|
|
11
|
-
productId?: string | number | undefined;
|
|
12
|
-
vendorId?: string | number | undefined;
|
|
13
|
-
storeId?: number | undefined;
|
|
14
|
-
catalogueId?: string | number | undefined;
|
|
15
|
-
categoryId?: string | number | undefined;
|
|
16
|
-
};
|
|
1
|
+
import { GlobalState } from "../types/common.types";
|
|
2
|
+
export declare const initialState: GlobalState;
|
|
3
|
+
export declare const setState: (overrides: Partial<GlobalState>) => void;
|
|
4
|
+
export declare const getState: () => {
|
|
5
|
+
artisanApp: import("../../../types/build").ArtisanApp | undefined;
|
|
6
|
+
apiCache: import("../types/common.types").ApiCache;
|
|
7
|
+
expiresAt: number;
|
|
8
|
+
forms: import("../types/common.types").ModifiersForms;
|
|
9
|
+
timeout?: number | undefined;
|
|
10
|
+
accountId?: string | number | undefined;
|
|
11
|
+
productId?: string | number | undefined;
|
|
12
|
+
vendorId?: string | number | undefined;
|
|
13
|
+
storeId?: number | undefined;
|
|
14
|
+
catalogueId?: string | number | undefined;
|
|
15
|
+
categoryId?: string | number | undefined;
|
|
16
|
+
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const getCategories: () => void;
|
|
1
|
+
export declare const getCategories: () => void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export {};
|
|
1
|
+
export {};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { FetchProductDetailsConfig } from "./getProductDetails.types";
|
|
2
|
-
export declare const getProductDetails: (productId: number | string, config: FetchProductDetailsConfig) => Promise<import("../../../../types/build").BaseProduct | {
|
|
3
|
-
data: any;
|
|
4
|
-
hints: Partial<import("../../../../types/build").ArtisanHints>;
|
|
5
|
-
config: import("../../../../types/build").ArtisanRequest;
|
|
6
|
-
error: string | undefined;
|
|
7
|
-
} | import("../../../../types/build").Product[]>;
|
|
1
|
+
import { FetchProductDetailsConfig } from "./getProductDetails.types";
|
|
2
|
+
export declare const getProductDetails: (productId: number | string, config: FetchProductDetailsConfig) => Promise<import("../../../../types/build").BaseProduct | {
|
|
3
|
+
data: any;
|
|
4
|
+
hints: Partial<import("../../../../types/build").ArtisanHints>;
|
|
5
|
+
config: import("../../../../types/build").ArtisanRequest;
|
|
6
|
+
error: string | undefined;
|
|
7
|
+
} | import("../../../../types/build").Product[]>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export {};
|
|
1
|
+
export {};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { ProductsHTTPConfig } from "../../types/http.types";
|
|
2
|
-
export interface FetchProductDetailsConfig extends ProductsHTTPConfig {
|
|
3
|
-
groupBy?: undefined;
|
|
4
|
-
orderBy?: undefined;
|
|
5
|
-
pagination?: undefined;
|
|
6
|
-
additionalFilters?: undefined;
|
|
7
|
-
}
|
|
1
|
+
import { ProductsHTTPConfig } from "../../types/http.types";
|
|
2
|
+
export interface FetchProductDetailsConfig extends ProductsHTTPConfig {
|
|
3
|
+
groupBy?: undefined;
|
|
4
|
+
orderBy?: undefined;
|
|
5
|
+
pagination?: undefined;
|
|
6
|
+
additionalFilters?: undefined;
|
|
7
|
+
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { FetchProductsConfig } from "./getProducts.types";
|
|
2
|
-
export declare const getProducts: (config: FetchProductsConfig) => Promise<import("../../../../types/build").BaseProduct | {
|
|
3
|
-
data: any;
|
|
4
|
-
hints: Partial<import("../../../../types/build").ArtisanHints>;
|
|
5
|
-
config: import("../../../../types/build").ArtisanRequest;
|
|
6
|
-
error: string | undefined;
|
|
7
|
-
} | import("../../../../types/build").Product[]>;
|
|
1
|
+
import { FetchProductsConfig } from "./getProducts.types";
|
|
2
|
+
export declare const getProducts: (config: FetchProductsConfig) => Promise<import("../../../../types/build").BaseProduct | {
|
|
3
|
+
data: any;
|
|
4
|
+
hints: Partial<import("../../../../types/build").ArtisanHints>;
|
|
5
|
+
config: import("../../../../types/build").ArtisanRequest;
|
|
6
|
+
error: string | undefined;
|
|
7
|
+
} | import("../../../../types/build").Product[]>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export {};
|
|
1
|
+
export {};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { ProductsHTTPConfig } from "../../types/http.types";
|
|
2
|
-
export interface FetchProductsConfig extends ProductsHTTPConfig {
|
|
3
|
-
}
|
|
1
|
+
import { ProductsHTTPConfig } from "../../types/http.types";
|
|
2
|
+
export interface FetchProductsConfig extends ProductsHTTPConfig {
|
|
3
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const getRecommendedProducts: () => void;
|
|
1
|
+
export declare const getRecommendedProducts: () => void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export {};
|
|
1
|
+
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const getRelatedProducts: () => void;
|
|
1
|
+
export declare const getRelatedProducts: () => void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export {};
|
|
1
|
+
export {};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { FetchStoreDetailsConfig } from "./getStoreDetails.types";
|
|
2
|
-
export declare const getStoreDetails: (config: FetchStoreDetailsConfig) => Promise<import("../../../../types/build").BaseProduct | {
|
|
3
|
-
data: any;
|
|
4
|
-
hints: Partial<import("../../../../types/build").ArtisanHints>;
|
|
5
|
-
config: import("../../../../types/build").ArtisanRequest;
|
|
6
|
-
error: string | undefined;
|
|
7
|
-
} | import("../../../../types/build").Product[]>;
|
|
1
|
+
import { FetchStoreDetailsConfig } from "./getStoreDetails.types";
|
|
2
|
+
export declare const getStoreDetails: (config: FetchStoreDetailsConfig) => Promise<import("../../../../types/build").BaseProduct | {
|
|
3
|
+
data: any;
|
|
4
|
+
hints: Partial<import("../../../../types/build").ArtisanHints>;
|
|
5
|
+
config: import("../../../../types/build").ArtisanRequest;
|
|
6
|
+
error: string | undefined;
|
|
7
|
+
} | import("../../../../types/build").Product[]>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export {};
|
|
1
|
+
export {};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { ProductsHTTPConfig } from "../../types/http.types";
|
|
2
|
-
export interface FetchStoreDetailsConfig extends ProductsHTTPConfig {
|
|
3
|
-
groupBy?: undefined;
|
|
4
|
-
orderBy?: undefined;
|
|
5
|
-
pagination?: undefined;
|
|
6
|
-
additionalFilters?: undefined;
|
|
7
|
-
}
|
|
1
|
+
import { ProductsHTTPConfig } from "../../types/http.types";
|
|
2
|
+
export interface FetchStoreDetailsConfig extends ProductsHTTPConfig {
|
|
3
|
+
groupBy?: undefined;
|
|
4
|
+
orderBy?: undefined;
|
|
5
|
+
pagination?: undefined;
|
|
6
|
+
additionalFilters?: undefined;
|
|
7
|
+
}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { ArtisanApp } from "@artisan-commerce/types";
|
|
2
|
-
import { InitProductsConfig } from "../../types/common.types";
|
|
3
|
-
/**
|
|
4
|
-
* Initialize products metadata, stores initial global state for future needs.
|
|
5
|
-
* @author Luis Eduardo Andrade
|
|
6
|
-
* @since 1.0
|
|
7
|
-
* @param artisanApp: An artisan initialized app.
|
|
8
|
-
* @param config: Global products state that can be configure at the function call level
|
|
9
|
-
*/
|
|
10
|
-
export declare const initProducts: (artisanApp: ArtisanApp, config?: InitProductsConfig) => void;
|
|
1
|
+
import { ArtisanApp } from "@artisan-commerce/types";
|
|
2
|
+
import { InitProductsConfig } from "../../types/common.types";
|
|
3
|
+
/**
|
|
4
|
+
* Initialize products metadata, stores initial global state for future needs.
|
|
5
|
+
* @author Luis Eduardo Andrade
|
|
6
|
+
* @since 1.0
|
|
7
|
+
* @param artisanApp: An artisan initialized app.
|
|
8
|
+
* @param config: Global products state that can be configure at the function call level
|
|
9
|
+
*/
|
|
10
|
+
export declare const initProducts: (artisanApp: ArtisanApp, config?: InitProductsConfig) => void;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { RegisterModifiersForm } from "./registerModifiersForm.types";
|
|
2
|
-
export declare const registerModifiersForm: RegisterModifiersForm;
|
|
3
|
-
export declare const unsuscriber: (productId: string) => void;
|
|
1
|
+
import { RegisterModifiersForm } from "./registerModifiersForm.types";
|
|
2
|
+
export declare const registerModifiersForm: RegisterModifiersForm;
|
|
3
|
+
export declare const unsuscriber: (productId: string) => void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export {};
|
|
1
|
+
export {};
|
|
@@ -1,34 +1,34 @@
|
|
|
1
|
-
import { CartProduct, Product } from "@artisan-commerce/types";
|
|
2
|
-
import { ValidateProduct } from "../validateProduct/validateProduct.types";
|
|
3
|
-
import { ModifierTypes } from "../../types/modifiers.types";
|
|
4
|
-
import { ModifierGroupRenderer } from "../../types/modifiers.types";
|
|
5
|
-
export interface ModifiersForm {
|
|
6
|
-
renderer: ModifierGroupRenderer[];
|
|
7
|
-
product: CartProduct;
|
|
8
|
-
validate: ValidateProduct;
|
|
9
|
-
}
|
|
10
|
-
export interface ModifiersFormInternal extends ModifiersForm {
|
|
11
|
-
callback: ModifiersFormCallback;
|
|
12
|
-
}
|
|
13
|
-
export declare type ModifiersFormCallback = (form: ModifiersForm) => void;
|
|
14
|
-
export declare type ModifiersFormUnsuscriber = () => void;
|
|
15
|
-
export declare type HandleChangeFunction = (amount: number) => void;
|
|
16
|
-
export declare type RegisterModifiersForm = (product: Product, callback: ModifiersFormCallback) => ModifiersFormUnsuscriber;
|
|
17
|
-
export interface BuildModifierRendererConfig {
|
|
18
|
-
rootId: string;
|
|
19
|
-
min: number;
|
|
20
|
-
max: number;
|
|
21
|
-
type: ModifierTypes;
|
|
22
|
-
modifiersCount: number;
|
|
23
|
-
amount: number;
|
|
24
|
-
path: string[];
|
|
25
|
-
}
|
|
26
|
-
export interface BuildModifierGroupConfig {
|
|
27
|
-
amount: number;
|
|
28
|
-
rootId: string;
|
|
29
|
-
path: string[];
|
|
30
|
-
}
|
|
31
|
-
export interface BuildRendererConfig {
|
|
32
|
-
rootId: string;
|
|
33
|
-
path: string[];
|
|
34
|
-
}
|
|
1
|
+
import { CartProduct, Product } from "@artisan-commerce/types";
|
|
2
|
+
import { ValidateProduct } from "../validateProduct/validateProduct.types";
|
|
3
|
+
import { ModifierTypes } from "../../types/modifiers.types";
|
|
4
|
+
import { ModifierGroupRenderer } from "../../types/modifiers.types";
|
|
5
|
+
export interface ModifiersForm {
|
|
6
|
+
renderer: ModifierGroupRenderer[];
|
|
7
|
+
product: CartProduct;
|
|
8
|
+
validate: ValidateProduct;
|
|
9
|
+
}
|
|
10
|
+
export interface ModifiersFormInternal extends ModifiersForm {
|
|
11
|
+
callback: ModifiersFormCallback;
|
|
12
|
+
}
|
|
13
|
+
export declare type ModifiersFormCallback = (form: ModifiersForm) => void;
|
|
14
|
+
export declare type ModifiersFormUnsuscriber = () => void;
|
|
15
|
+
export declare type HandleChangeFunction = (amount: number) => void;
|
|
16
|
+
export declare type RegisterModifiersForm = (product: Product, callback: ModifiersFormCallback) => ModifiersFormUnsuscriber;
|
|
17
|
+
export interface BuildModifierRendererConfig {
|
|
18
|
+
rootId: string;
|
|
19
|
+
min: number;
|
|
20
|
+
max: number;
|
|
21
|
+
type: ModifierTypes;
|
|
22
|
+
modifiersCount: number;
|
|
23
|
+
amount: number;
|
|
24
|
+
path: string[];
|
|
25
|
+
}
|
|
26
|
+
export interface BuildModifierGroupConfig {
|
|
27
|
+
amount: number;
|
|
28
|
+
rootId: string;
|
|
29
|
+
path: string[];
|
|
30
|
+
}
|
|
31
|
+
export interface BuildRendererConfig {
|
|
32
|
+
rootId: string;
|
|
33
|
+
path: string[];
|
|
34
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const validateProduct: () => void;
|
|
1
|
+
export declare const validateProduct: () => void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export {};
|
|
1
|
+
export {};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { CartProduct } from "@artisan-commerce/types";
|
|
2
|
-
export declare type ValidateProduct = (product: CartProduct) => void;
|
|
1
|
+
import { CartProduct } from "@artisan-commerce/types";
|
|
2
|
+
export declare type ValidateProduct = (product: CartProduct) => void;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { ArtisanRequest, ProductDetails } from "@artisan-commerce/types";
|
|
2
|
-
export declare const fetchProductDetails: (request: ArtisanRequest) => Promise<ProductDetails>;
|
|
1
|
+
import { ArtisanRequest, ProductDetails } from "@artisan-commerce/types";
|
|
2
|
+
export declare const fetchProductDetails: (request: ArtisanRequest) => Promise<ProductDetails>;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { ProductDetails, ArtisanRequest } from "@artisan-commerce/types";
|
|
2
|
-
export declare const fetchProductDetails: (request: ArtisanRequest) => Promise<ProductDetails>;
|
|
1
|
+
import { ProductDetails, ArtisanRequest } from "@artisan-commerce/types";
|
|
2
|
+
export declare const fetchProductDetails: (request: ArtisanRequest) => Promise<ProductDetails>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export {};
|
|
1
|
+
export {};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { BaseProduct, ArtisanRequest } from "@artisan-commerce/types";
|
|
2
|
-
export declare const fetchProductDetails: (request: ArtisanRequest) => Promise<BaseProduct[]>;
|
|
1
|
+
import { BaseProduct, ArtisanRequest } from "@artisan-commerce/types";
|
|
2
|
+
export declare const fetchProductDetails: (request: ArtisanRequest) => Promise<BaseProduct[]>;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { ArtisanRequest, BaseProduct } from "@artisan-commerce/types";
|
|
2
|
-
export declare const fetchProducts: (request: ArtisanRequest) => Promise<BaseProduct[]>;
|
|
1
|
+
import { ArtisanRequest, BaseProduct } from "@artisan-commerce/types";
|
|
2
|
+
export declare const fetchProducts: (request: ArtisanRequest) => Promise<BaseProduct[]>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export {};
|
|
1
|
+
export {};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { ArtisanRequest, BaseProduct } from "@artisan-commerce/types";
|
|
2
|
-
export declare const fetchStoreDetails: (request: ArtisanRequest) => Promise<BaseProduct[]>;
|
|
1
|
+
import { ArtisanRequest, BaseProduct } from "@artisan-commerce/types";
|
|
2
|
+
export declare const fetchStoreDetails: (request: ArtisanRequest) => Promise<BaseProduct[]>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export {};
|
|
1
|
+
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export {};
|
|
1
|
+
export {};
|
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
import { ArtisanApp, ArtisanHints, Product } from "@artisan-commerce/types";
|
|
2
|
-
import { ModifiersFormInternal } from "../lib/registerModifiersForm/registerModifiersForm.types";
|
|
3
|
-
export interface ProductHints extends Omit<ArtisanHints, "accountId"> {
|
|
4
|
-
accountId?: ArtisanHints["accountId"];
|
|
5
|
-
}
|
|
6
|
-
export interface InitProductsConfig extends ProductHints {
|
|
7
|
-
timeout?: number;
|
|
8
|
-
}
|
|
9
|
-
export interface GlobalState extends InitProductsConfig {
|
|
10
|
-
artisanApp: ArtisanApp | undefined;
|
|
11
|
-
apiCache: ApiCache;
|
|
12
|
-
expiresAt: number;
|
|
13
|
-
forms: ModifiersForms;
|
|
14
|
-
}
|
|
15
|
-
export interface ApiCache {
|
|
16
|
-
[key: string]: Product | Product[];
|
|
17
|
-
}
|
|
18
|
-
export interface ModifiersForms {
|
|
19
|
-
[key: string]: ModifiersFormInternal;
|
|
20
|
-
}
|
|
1
|
+
import { ArtisanApp, ArtisanHints, Product } from "@artisan-commerce/types";
|
|
2
|
+
import { ModifiersFormInternal } from "../lib/registerModifiersForm/registerModifiersForm.types";
|
|
3
|
+
export interface ProductHints extends Omit<ArtisanHints, "accountId"> {
|
|
4
|
+
accountId?: ArtisanHints["accountId"];
|
|
5
|
+
}
|
|
6
|
+
export interface InitProductsConfig extends ProductHints {
|
|
7
|
+
timeout?: number;
|
|
8
|
+
}
|
|
9
|
+
export interface GlobalState extends InitProductsConfig {
|
|
10
|
+
artisanApp: ArtisanApp | undefined;
|
|
11
|
+
apiCache: ApiCache;
|
|
12
|
+
expiresAt: number;
|
|
13
|
+
forms: ModifiersForms;
|
|
14
|
+
}
|
|
15
|
+
export interface ApiCache {
|
|
16
|
+
[key: string]: Product | Product[];
|
|
17
|
+
}
|
|
18
|
+
export interface ModifiersForms {
|
|
19
|
+
[key: string]: ModifiersFormInternal;
|
|
20
|
+
}
|
|
@@ -1,66 +1,66 @@
|
|
|
1
|
-
import { ArtisanRequestHeaders } from "@artisan-commerce/types";
|
|
2
|
-
export interface ProductsHTTPConfig {
|
|
3
|
-
filterBy: Filters;
|
|
4
|
-
groupBy?: GROUPS;
|
|
5
|
-
orderBy?: Order;
|
|
6
|
-
pagination?: Pagination;
|
|
7
|
-
additionalFilters?: AdditionalFilters;
|
|
8
|
-
}
|
|
9
|
-
export declare type ID = string | number | (string | number)[];
|
|
10
|
-
export interface Filters {
|
|
11
|
-
vendorId: ID;
|
|
12
|
-
storeId: ID;
|
|
13
|
-
catalogueId: ID;
|
|
14
|
-
categoryId?: ID;
|
|
15
|
-
productId?: ID;
|
|
16
|
-
}
|
|
17
|
-
export declare type GROUPS = "CATEGORIES" | "TAGS";
|
|
18
|
-
export declare type ORDER_TYPES = "ALPHABETIC" | "PRICE" | "PREDEFINED";
|
|
19
|
-
export interface Order {
|
|
20
|
-
type?: ORDER_TYPES;
|
|
21
|
-
sort?: "ASC" | "DESC";
|
|
22
|
-
}
|
|
23
|
-
export interface Pagination {
|
|
24
|
-
page?: number;
|
|
25
|
-
vendor?: {
|
|
26
|
-
size: number;
|
|
27
|
-
};
|
|
28
|
-
store?: {
|
|
29
|
-
size: number;
|
|
30
|
-
};
|
|
31
|
-
catalogue?: {
|
|
32
|
-
size: number;
|
|
33
|
-
};
|
|
34
|
-
category?: {
|
|
35
|
-
size: number;
|
|
36
|
-
};
|
|
37
|
-
product?: {
|
|
38
|
-
size: number;
|
|
39
|
-
};
|
|
40
|
-
}
|
|
41
|
-
export interface AdditionalFilters {
|
|
42
|
-
price?: {
|
|
43
|
-
type?: "NORMAL" | "POINTS";
|
|
44
|
-
from?: number;
|
|
45
|
-
to?: number;
|
|
46
|
-
};
|
|
47
|
-
query?: string;
|
|
48
|
-
tags?: string[];
|
|
49
|
-
manufacturerId?: number | number[];
|
|
50
|
-
weigth?: {
|
|
51
|
-
unit: string;
|
|
52
|
-
value: number;
|
|
53
|
-
};
|
|
54
|
-
dimensions?: {
|
|
55
|
-
unit: string;
|
|
56
|
-
width: number;
|
|
57
|
-
height: number;
|
|
58
|
-
depth: number;
|
|
59
|
-
};
|
|
60
|
-
}
|
|
61
|
-
export interface RequestData {
|
|
62
|
-
headers: ArtisanRequestHeaders;
|
|
63
|
-
params: Record<string, string | number>;
|
|
64
|
-
query: Record<string, string | number | boolean>;
|
|
65
|
-
body: Record<string, any>;
|
|
66
|
-
}
|
|
1
|
+
import { ArtisanRequestHeaders } from "@artisan-commerce/types";
|
|
2
|
+
export interface ProductsHTTPConfig {
|
|
3
|
+
filterBy: Filters;
|
|
4
|
+
groupBy?: GROUPS;
|
|
5
|
+
orderBy?: Order;
|
|
6
|
+
pagination?: Pagination;
|
|
7
|
+
additionalFilters?: AdditionalFilters;
|
|
8
|
+
}
|
|
9
|
+
export declare type ID = string | number | (string | number)[];
|
|
10
|
+
export interface Filters {
|
|
11
|
+
vendorId: ID;
|
|
12
|
+
storeId: ID;
|
|
13
|
+
catalogueId: ID;
|
|
14
|
+
categoryId?: ID;
|
|
15
|
+
productId?: ID;
|
|
16
|
+
}
|
|
17
|
+
export declare type GROUPS = "CATEGORIES" | "TAGS";
|
|
18
|
+
export declare type ORDER_TYPES = "ALPHABETIC" | "PRICE" | "PREDEFINED";
|
|
19
|
+
export interface Order {
|
|
20
|
+
type?: ORDER_TYPES;
|
|
21
|
+
sort?: "ASC" | "DESC";
|
|
22
|
+
}
|
|
23
|
+
export interface Pagination {
|
|
24
|
+
page?: number;
|
|
25
|
+
vendor?: {
|
|
26
|
+
size: number;
|
|
27
|
+
};
|
|
28
|
+
store?: {
|
|
29
|
+
size: number;
|
|
30
|
+
};
|
|
31
|
+
catalogue?: {
|
|
32
|
+
size: number;
|
|
33
|
+
};
|
|
34
|
+
category?: {
|
|
35
|
+
size: number;
|
|
36
|
+
};
|
|
37
|
+
product?: {
|
|
38
|
+
size: number;
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
export interface AdditionalFilters {
|
|
42
|
+
price?: {
|
|
43
|
+
type?: "NORMAL" | "POINTS";
|
|
44
|
+
from?: number;
|
|
45
|
+
to?: number;
|
|
46
|
+
};
|
|
47
|
+
query?: string;
|
|
48
|
+
tags?: string[];
|
|
49
|
+
manufacturerId?: number | number[];
|
|
50
|
+
weigth?: {
|
|
51
|
+
unit: string;
|
|
52
|
+
value: number;
|
|
53
|
+
};
|
|
54
|
+
dimensions?: {
|
|
55
|
+
unit: string;
|
|
56
|
+
width: number;
|
|
57
|
+
height: number;
|
|
58
|
+
depth: number;
|
|
59
|
+
};
|
|
60
|
+
}
|
|
61
|
+
export interface RequestData {
|
|
62
|
+
headers: ArtisanRequestHeaders;
|
|
63
|
+
params: Record<string, string | number>;
|
|
64
|
+
query: Record<string, string | number | boolean>;
|
|
65
|
+
body: Record<string, any>;
|
|
66
|
+
}
|