@sokol111/ecommerce-category-query-service-api 1.0.10 → 1.0.11
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/dist/api.d.ts +2 -0
- package/dist/api.js +8 -2
- package/dist/api.schemas.d.ts +56 -1
- package/dist/api.schemas.js +13 -1
- package/package.json +1 -1
package/dist/api.d.ts
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import type { AxiosRequestConfig, AxiosResponse } from 'axios';
|
|
2
2
|
import type { CategoryResponse } from './api.schemas';
|
|
3
3
|
export declare const getCategoryAPI: () => {
|
|
4
|
+
getCategoryById: <TData = AxiosResponse<CategoryResponse, any, {}>>(id: string, options?: AxiosRequestConfig) => Promise<TData>;
|
|
4
5
|
getAllActiveCategories: <TData = AxiosResponse<CategoryResponse[], any, {}>>(options?: AxiosRequestConfig) => Promise<TData>;
|
|
5
6
|
};
|
|
7
|
+
export type GetCategoryByIdResult = AxiosResponse<CategoryResponse>;
|
|
6
8
|
export type GetAllActiveCategoriesResult = AxiosResponse<CategoryResponse[]>;
|
package/dist/api.js
CHANGED
|
@@ -3,15 +3,21 @@
|
|
|
3
3
|
* Do not edit manually.
|
|
4
4
|
* Category API
|
|
5
5
|
* API for querying categories
|
|
6
|
-
* OpenAPI spec version: 1.0.
|
|
6
|
+
* OpenAPI spec version: 1.0.11
|
|
7
7
|
*/
|
|
8
8
|
import axios from 'axios';
|
|
9
9
|
export const getCategoryAPI = () => {
|
|
10
|
+
/**
|
|
11
|
+
* @summary Get a category by ID
|
|
12
|
+
*/
|
|
13
|
+
const getCategoryById = (id, options) => {
|
|
14
|
+
return axios.get(`/v1/category/get/${id}`, options);
|
|
15
|
+
};
|
|
10
16
|
/**
|
|
11
17
|
* @summary Get a list of all active categories
|
|
12
18
|
*/
|
|
13
19
|
const getAllActiveCategories = (options) => {
|
|
14
20
|
return axios.get(`/v1/category/list-active-categories`, options);
|
|
15
21
|
};
|
|
16
|
-
return { getAllActiveCategories };
|
|
22
|
+
return { getCategoryById, getAllActiveCategories };
|
|
17
23
|
};
|
package/dist/api.schemas.d.ts
CHANGED
|
@@ -3,11 +3,66 @@
|
|
|
3
3
|
* Do not edit manually.
|
|
4
4
|
* Category API
|
|
5
5
|
* API for querying categories
|
|
6
|
-
* OpenAPI spec version: 1.0.
|
|
6
|
+
* OpenAPI spec version: 1.0.11
|
|
7
7
|
*/
|
|
8
|
+
/**
|
|
9
|
+
* How an attribute is used in a category
|
|
10
|
+
*/
|
|
11
|
+
export type AttributeRole = typeof AttributeRole[keyof typeof AttributeRole];
|
|
12
|
+
export declare const AttributeRole: {
|
|
13
|
+
readonly variant: "variant";
|
|
14
|
+
readonly specification: "specification";
|
|
15
|
+
};
|
|
16
|
+
/**
|
|
17
|
+
* Type of the attribute
|
|
18
|
+
*/
|
|
19
|
+
export type AttributeType = typeof AttributeType[keyof typeof AttributeType];
|
|
20
|
+
export declare const AttributeType: {
|
|
21
|
+
readonly single: "single";
|
|
22
|
+
readonly multiple: "multiple";
|
|
23
|
+
readonly range: "range";
|
|
24
|
+
readonly boolean: "boolean";
|
|
25
|
+
readonly text: "text";
|
|
26
|
+
};
|
|
27
|
+
/**
|
|
28
|
+
* Attribute option for single/multiple type attributes
|
|
29
|
+
*/
|
|
30
|
+
export interface AttributeOption {
|
|
31
|
+
/** Display name of the option */
|
|
32
|
+
name: string;
|
|
33
|
+
/** URL-friendly identifier */
|
|
34
|
+
slug: string;
|
|
35
|
+
/** Color hex code (for color attributes) */
|
|
36
|
+
colorCode?: string;
|
|
37
|
+
/** Sort order for display */
|
|
38
|
+
sortOrder: number;
|
|
39
|
+
}
|
|
40
|
+
export interface CategoryAttribute {
|
|
41
|
+
/** Unique attribute identifier (UUID) */
|
|
42
|
+
attributeId: string;
|
|
43
|
+
/** Display name of the attribute (denormalized from catalog-service) */
|
|
44
|
+
name: string;
|
|
45
|
+
/** URL-friendly identifier (denormalized from catalog-service) */
|
|
46
|
+
slug: string;
|
|
47
|
+
type: AttributeType;
|
|
48
|
+
/** Unit of measurement for range attributes (denormalized from catalog-service) */
|
|
49
|
+
unit?: string;
|
|
50
|
+
/** Available options for single/multiple type attributes (denormalized from catalog-service) */
|
|
51
|
+
options?: AttributeOption[];
|
|
52
|
+
role: AttributeRole;
|
|
53
|
+
/** Whether the attribute is required for products in this category */
|
|
54
|
+
required: boolean;
|
|
55
|
+
/** Sort order for display */
|
|
56
|
+
sortOrder: number;
|
|
57
|
+
/** Whether the attribute is filterable for this category */
|
|
58
|
+
filterable: boolean;
|
|
59
|
+
/** Whether the attribute is searchable for this category */
|
|
60
|
+
searchable: boolean;
|
|
61
|
+
}
|
|
8
62
|
export interface CategoryResponse {
|
|
9
63
|
id: string;
|
|
10
64
|
name: string;
|
|
65
|
+
attributes: CategoryAttribute[];
|
|
11
66
|
}
|
|
12
67
|
export type ProblemErrorsItem = {
|
|
13
68
|
field?: string;
|
package/dist/api.schemas.js
CHANGED
|
@@ -1 +1,13 @@
|
|
|
1
|
-
|
|
1
|
+
// eslint-disable-next-line @typescript-eslint/no-redeclare
|
|
2
|
+
export const AttributeRole = {
|
|
3
|
+
variant: 'variant',
|
|
4
|
+
specification: 'specification',
|
|
5
|
+
};
|
|
6
|
+
// eslint-disable-next-line @typescript-eslint/no-redeclare
|
|
7
|
+
export const AttributeType = {
|
|
8
|
+
single: 'single',
|
|
9
|
+
multiple: 'multiple',
|
|
10
|
+
range: 'range',
|
|
11
|
+
boolean: 'boolean',
|
|
12
|
+
text: 'text',
|
|
13
|
+
};
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sokol111/ecommerce-category-query-service-api",
|
|
3
3
|
"description": "Generated TypeScript Axios client from OpenAPI for ecommerce-category-query-service-api",
|
|
4
|
-
"version": "1.0.
|
|
4
|
+
"version": "1.0.11",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
7
7
|
"module": "dist/index.js",
|