@sokol111/ecommerce-catalog-service-api 1.0.1 → 1.0.4
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.js +1 -1
- package/dist/api.schemas.d.ts +18 -24
- package/dist/api.schemas.js +1 -9
- package/package.json +1 -1
package/dist/api.js
CHANGED
|
@@ -9,7 +9,7 @@ This service combines:
|
|
|
9
9
|
- **Categories** - Product categories with attribute assignments
|
|
10
10
|
- **Products** - Products with attribute values
|
|
11
11
|
|
|
12
|
-
* OpenAPI spec version: 1.0.
|
|
12
|
+
* OpenAPI spec version: 1.0.4
|
|
13
13
|
*/
|
|
14
14
|
import axios from 'axios';
|
|
15
15
|
export const getCatalogAPI = () => {
|
package/dist/api.schemas.d.ts
CHANGED
|
@@ -9,7 +9,7 @@ This service combines:
|
|
|
9
9
|
- **Categories** - Product categories with attribute assignments
|
|
10
10
|
- **Products** - Products with attribute values
|
|
11
11
|
|
|
12
|
-
* OpenAPI spec version: 1.0.
|
|
12
|
+
* OpenAPI spec version: 1.0.4
|
|
13
13
|
*/
|
|
14
14
|
export type GetAttributeListParams = {
|
|
15
15
|
/**
|
|
@@ -191,14 +191,6 @@ export interface CreateAttributeRequest {
|
|
|
191
191
|
/** Options for single/multiple types */
|
|
192
192
|
options?: AttributeOptionInput[];
|
|
193
193
|
}
|
|
194
|
-
export type UpdateAttributeRequestType = typeof UpdateAttributeRequestType[keyof typeof UpdateAttributeRequestType];
|
|
195
|
-
export declare const UpdateAttributeRequestType: {
|
|
196
|
-
readonly single: "single";
|
|
197
|
-
readonly multiple: "multiple";
|
|
198
|
-
readonly range: "range";
|
|
199
|
-
readonly boolean: "boolean";
|
|
200
|
-
readonly text: "text";
|
|
201
|
-
};
|
|
202
194
|
export interface UpdateAttributeRequest {
|
|
203
195
|
/** @pattern ^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-5][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$ */
|
|
204
196
|
id: string;
|
|
@@ -207,13 +199,6 @@ export interface UpdateAttributeRequest {
|
|
|
207
199
|
* @maxLength 100
|
|
208
200
|
*/
|
|
209
201
|
name: string;
|
|
210
|
-
/**
|
|
211
|
-
* @minLength 2
|
|
212
|
-
* @maxLength 50
|
|
213
|
-
* @pattern ^[a-z0-9]+(?:-[a-z0-9]+)*$
|
|
214
|
-
*/
|
|
215
|
-
slug: string;
|
|
216
|
-
type: UpdateAttributeRequestType;
|
|
217
202
|
/** @maxLength 20 */
|
|
218
203
|
unit?: string;
|
|
219
204
|
enabled: boolean;
|
|
@@ -222,6 +207,11 @@ export interface UpdateAttributeRequest {
|
|
|
222
207
|
* @minimum 1
|
|
223
208
|
*/
|
|
224
209
|
version: number;
|
|
210
|
+
/** Options for single/multiple types.
|
|
211
|
+
- To add option: include new option with slug
|
|
212
|
+
- To update option: include existing option with same slug
|
|
213
|
+
- To remove option: omit option from array (only if not used by products)
|
|
214
|
+
*/
|
|
225
215
|
options?: AttributeOptionInput[];
|
|
226
216
|
}
|
|
227
217
|
export type AttributeResponseType = typeof AttributeResponseType[keyof typeof AttributeResponseType];
|
|
@@ -254,7 +244,10 @@ export interface AttributeListResponse {
|
|
|
254
244
|
total: number;
|
|
255
245
|
}
|
|
256
246
|
/**
|
|
257
|
-
* Input for creating/updating an attribute option
|
|
247
|
+
* Input for creating/updating an attribute option.
|
|
248
|
+
- slug is immutable: set once during creation, used as identifier for updates
|
|
249
|
+
- To update an option, use the same slug with new name/colorCode/sortOrder
|
|
250
|
+
|
|
258
251
|
*/
|
|
259
252
|
export interface AttributeOptionInput {
|
|
260
253
|
/**
|
|
@@ -263,6 +256,9 @@ export interface AttributeOptionInput {
|
|
|
263
256
|
*/
|
|
264
257
|
name: string;
|
|
265
258
|
/**
|
|
259
|
+
* URL-friendly identifier. Immutable after creation.
|
|
260
|
+
Used as identifier for updates.
|
|
261
|
+
|
|
266
262
|
* @minLength 1
|
|
267
263
|
* @maxLength 50
|
|
268
264
|
* @pattern ^[a-z0-9]+(?:-[a-z0-9]+)*$
|
|
@@ -278,7 +274,6 @@ export interface AttributeOptionInput {
|
|
|
278
274
|
* @maximum 10000
|
|
279
275
|
*/
|
|
280
276
|
sortOrder?: number;
|
|
281
|
-
enabled: boolean;
|
|
282
277
|
}
|
|
283
278
|
/**
|
|
284
279
|
* Embedded attribute option
|
|
@@ -288,7 +283,6 @@ export interface AttributeOption {
|
|
|
288
283
|
slug: string;
|
|
289
284
|
colorCode?: string;
|
|
290
285
|
sortOrder: number;
|
|
291
|
-
enabled: boolean;
|
|
292
286
|
}
|
|
293
287
|
export interface CreateCategoryRequest {
|
|
294
288
|
/**
|
|
@@ -442,7 +436,7 @@ export interface CreateProductRequest {
|
|
|
442
436
|
categoryId?: string;
|
|
443
437
|
enabled: boolean;
|
|
444
438
|
/** List of attribute values for this product */
|
|
445
|
-
attributes?:
|
|
439
|
+
attributes?: AttributeValueInput[];
|
|
446
440
|
}
|
|
447
441
|
export interface UpdateProductRequest {
|
|
448
442
|
/** @pattern ^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-5][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$ */
|
|
@@ -475,7 +469,7 @@ export interface UpdateProductRequest {
|
|
|
475
469
|
*/
|
|
476
470
|
version: number;
|
|
477
471
|
/** List of attribute values for this product */
|
|
478
|
-
attributes?:
|
|
472
|
+
attributes?: AttributeValueInput[];
|
|
479
473
|
}
|
|
480
474
|
export interface ProductResponse {
|
|
481
475
|
id: string;
|
|
@@ -490,7 +484,7 @@ export interface ProductResponse {
|
|
|
490
484
|
createdAt: string;
|
|
491
485
|
modifiedAt: string;
|
|
492
486
|
/** List of attribute values for this product */
|
|
493
|
-
attributes?:
|
|
487
|
+
attributes?: AttributeValue[];
|
|
494
488
|
}
|
|
495
489
|
export interface ProductListResponse {
|
|
496
490
|
items: ProductResponse[];
|
|
@@ -504,7 +498,7 @@ export interface ProductListResponse {
|
|
|
504
498
|
/**
|
|
505
499
|
* Input for assigning an attribute value to a product
|
|
506
500
|
*/
|
|
507
|
-
export interface
|
|
501
|
+
export interface AttributeValueInput {
|
|
508
502
|
/**
|
|
509
503
|
* Reference to the attribute definition
|
|
510
504
|
* @pattern ^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-5][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$
|
|
@@ -530,7 +524,7 @@ export interface ProductAttributeInput {
|
|
|
530
524
|
/**
|
|
531
525
|
* Embedded product attribute with value
|
|
532
526
|
*/
|
|
533
|
-
export interface
|
|
527
|
+
export interface AttributeValue {
|
|
534
528
|
/** Reference to the attribute definition */
|
|
535
529
|
attributeId: string;
|
|
536
530
|
/** Slug of the selected option (for single type) */
|
package/dist/api.schemas.js
CHANGED
|
@@ -9,7 +9,7 @@ This service combines:
|
|
|
9
9
|
- **Categories** - Product categories with attribute assignments
|
|
10
10
|
- **Products** - Products with attribute values
|
|
11
11
|
|
|
12
|
-
* OpenAPI spec version: 1.0.
|
|
12
|
+
* OpenAPI spec version: 1.0.4
|
|
13
13
|
*/
|
|
14
14
|
// eslint-disable-next-line @typescript-eslint/no-redeclare
|
|
15
15
|
export const GetAttributeListType = {
|
|
@@ -65,14 +65,6 @@ export const CreateAttributeRequestType = {
|
|
|
65
65
|
text: 'text',
|
|
66
66
|
};
|
|
67
67
|
// eslint-disable-next-line @typescript-eslint/no-redeclare
|
|
68
|
-
export const UpdateAttributeRequestType = {
|
|
69
|
-
single: 'single',
|
|
70
|
-
multiple: 'multiple',
|
|
71
|
-
range: 'range',
|
|
72
|
-
boolean: 'boolean',
|
|
73
|
-
text: 'text',
|
|
74
|
-
};
|
|
75
|
-
// eslint-disable-next-line @typescript-eslint/no-redeclare
|
|
76
68
|
export const AttributeResponseType = {
|
|
77
69
|
single: 'single',
|
|
78
70
|
multiple: 'multiple',
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sokol111/ecommerce-catalog-service-api",
|
|
3
3
|
"description": "Generated TypeScript Axios client from OpenAPI for ecommerce-catalog-service-api",
|
|
4
|
-
"version": "1.0.
|
|
4
|
+
"version": "1.0.4",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
7
7
|
"module": "dist/index.js",
|