@mamindom/contracts 1.0.69 → 1.0.71
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/gen/product.d.ts +90 -0
- package/dist/gen/product.js +23 -1
- package/dist/proto/product.proto +96 -0
- package/gen/product.ts +130 -0
- package/package.json +1 -1
- package/proto/product.proto +96 -0
package/dist/gen/product.d.ts
CHANGED
|
@@ -9,6 +9,20 @@ export declare enum ProductStatus {
|
|
|
9
9
|
PRODUCT_STATUS_ARCHIVED = 4,
|
|
10
10
|
UNRECOGNIZED = -1
|
|
11
11
|
}
|
|
12
|
+
export declare enum RelatedProductType {
|
|
13
|
+
RELATED_TYPE_UNSPECIFIED = 0,
|
|
14
|
+
RELATED_TYPE_CROSS_SELL = 1,
|
|
15
|
+
RELATED_TYPE_UP_SELL = 2,
|
|
16
|
+
RELATED_TYPE_BOUGHT_TOGETHER = 3,
|
|
17
|
+
RELATED_TYPE_POPULAR = 4,
|
|
18
|
+
UNRECOGNIZED = -1
|
|
19
|
+
}
|
|
20
|
+
export declare enum ExportFormat {
|
|
21
|
+
EXPORT_FORMAT_UNSPECIFIED = 0,
|
|
22
|
+
EXPORT_FORMAT_CSV = 1,
|
|
23
|
+
EXPORT_FORMAT_XLSX = 2,
|
|
24
|
+
UNRECOGNIZED = -1
|
|
25
|
+
}
|
|
12
26
|
export interface BulkStickerRequest {
|
|
13
27
|
productIds: string[];
|
|
14
28
|
stickerId: string;
|
|
@@ -425,6 +439,70 @@ export interface UpdateProductVariantRequest_OptionsEntry {
|
|
|
425
439
|
export interface DeleteProductVariantRequest {
|
|
426
440
|
id: string;
|
|
427
441
|
}
|
|
442
|
+
export interface GetRelatedProductsRequest {
|
|
443
|
+
productId: string;
|
|
444
|
+
type?: RelatedProductType | undefined;
|
|
445
|
+
}
|
|
446
|
+
export interface RelatedProductItem {
|
|
447
|
+
productId: string;
|
|
448
|
+
sku: string;
|
|
449
|
+
slug: string;
|
|
450
|
+
name: {
|
|
451
|
+
[key: string]: string;
|
|
452
|
+
};
|
|
453
|
+
mainImage: string;
|
|
454
|
+
price: number;
|
|
455
|
+
oldPrice?: number | undefined;
|
|
456
|
+
status: ProductStatus;
|
|
457
|
+
totalStock: number;
|
|
458
|
+
type: RelatedProductType;
|
|
459
|
+
}
|
|
460
|
+
export interface RelatedProductItem_NameEntry {
|
|
461
|
+
key: string;
|
|
462
|
+
value: string;
|
|
463
|
+
}
|
|
464
|
+
export interface GetRelatedProductsResponse {
|
|
465
|
+
crossSell: RelatedProductItem[];
|
|
466
|
+
upSell: RelatedProductItem[];
|
|
467
|
+
boughtTogether: RelatedProductItem[];
|
|
468
|
+
popular: RelatedProductItem[];
|
|
469
|
+
}
|
|
470
|
+
export interface SetRelatedProductsRequest {
|
|
471
|
+
productId: string;
|
|
472
|
+
type: RelatedProductType;
|
|
473
|
+
relatedProductIds: string[];
|
|
474
|
+
}
|
|
475
|
+
export interface RemoveRelatedProductRequest {
|
|
476
|
+
productId: string;
|
|
477
|
+
relatedProductId: string;
|
|
478
|
+
type: RelatedProductType;
|
|
479
|
+
}
|
|
480
|
+
export interface ExportProductsRequest {
|
|
481
|
+
search?: string | undefined;
|
|
482
|
+
categoryId?: string | undefined;
|
|
483
|
+
brandId?: string | undefined;
|
|
484
|
+
status?: ProductStatus | undefined;
|
|
485
|
+
inStock?: boolean | undefined;
|
|
486
|
+
priceMin?: number | undefined;
|
|
487
|
+
priceMax?: number | undefined;
|
|
488
|
+
sortBy?: string | undefined;
|
|
489
|
+
format: ExportFormat;
|
|
490
|
+
fields: string[];
|
|
491
|
+
createdById: string;
|
|
492
|
+
locale?: string | undefined;
|
|
493
|
+
}
|
|
494
|
+
export interface ExportProductsResponse {
|
|
495
|
+
downloadUrl: string;
|
|
496
|
+
fileName: string;
|
|
497
|
+
totalRows: number;
|
|
498
|
+
}
|
|
499
|
+
export interface BulkUpdateSortOrderRequest {
|
|
500
|
+
items: ProductOrderItem[];
|
|
501
|
+
}
|
|
502
|
+
export interface BulkSetPopularRequest {
|
|
503
|
+
productIds: string[];
|
|
504
|
+
popular: boolean;
|
|
505
|
+
}
|
|
428
506
|
export declare const CATALOG_V1_PACKAGE_NAME = "catalog.v1";
|
|
429
507
|
export interface ProductServiceClient {
|
|
430
508
|
getProducts(request: GetProductsRequest): Observable<GetProductsResponse>;
|
|
@@ -446,6 +524,12 @@ export interface ProductServiceClient {
|
|
|
446
524
|
deleteProductVariant(request: DeleteProductVariantRequest): Observable<DeleteResponse>;
|
|
447
525
|
updateProductGlobalOrder(request: UpdateProductGlobalOrderRequest): Observable<SuccessResponse>;
|
|
448
526
|
updateProductCategoryOrder(request: UpdateProductCategoryOrderRequest): Observable<SuccessResponse>;
|
|
527
|
+
getRelatedProducts(request: GetRelatedProductsRequest): Observable<GetRelatedProductsResponse>;
|
|
528
|
+
setRelatedProducts(request: SetRelatedProductsRequest): Observable<SuccessResponse>;
|
|
529
|
+
removeRelatedProduct(request: RemoveRelatedProductRequest): Observable<SuccessResponse>;
|
|
530
|
+
exportProducts(request: ExportProductsRequest): Observable<ExportProductsResponse>;
|
|
531
|
+
bulkUpdateSortOrder(request: BulkUpdateSortOrderRequest): Observable<SuccessResponse>;
|
|
532
|
+
bulkSetPopular(request: BulkSetPopularRequest): Observable<SuccessResponse>;
|
|
449
533
|
}
|
|
450
534
|
export interface ProductServiceController {
|
|
451
535
|
getProducts(request: GetProductsRequest): Promise<GetProductsResponse> | Observable<GetProductsResponse> | GetProductsResponse;
|
|
@@ -467,6 +551,12 @@ export interface ProductServiceController {
|
|
|
467
551
|
deleteProductVariant(request: DeleteProductVariantRequest): Promise<DeleteResponse> | Observable<DeleteResponse> | DeleteResponse;
|
|
468
552
|
updateProductGlobalOrder(request: UpdateProductGlobalOrderRequest): Promise<SuccessResponse> | Observable<SuccessResponse> | SuccessResponse;
|
|
469
553
|
updateProductCategoryOrder(request: UpdateProductCategoryOrderRequest): Promise<SuccessResponse> | Observable<SuccessResponse> | SuccessResponse;
|
|
554
|
+
getRelatedProducts(request: GetRelatedProductsRequest): Promise<GetRelatedProductsResponse> | Observable<GetRelatedProductsResponse> | GetRelatedProductsResponse;
|
|
555
|
+
setRelatedProducts(request: SetRelatedProductsRequest): Promise<SuccessResponse> | Observable<SuccessResponse> | SuccessResponse;
|
|
556
|
+
removeRelatedProduct(request: RemoveRelatedProductRequest): Promise<SuccessResponse> | Observable<SuccessResponse> | SuccessResponse;
|
|
557
|
+
exportProducts(request: ExportProductsRequest): Promise<ExportProductsResponse> | Observable<ExportProductsResponse> | ExportProductsResponse;
|
|
558
|
+
bulkUpdateSortOrder(request: BulkUpdateSortOrderRequest): Promise<SuccessResponse> | Observable<SuccessResponse> | SuccessResponse;
|
|
559
|
+
bulkSetPopular(request: BulkSetPopularRequest): Promise<SuccessResponse> | Observable<SuccessResponse> | SuccessResponse;
|
|
470
560
|
}
|
|
471
561
|
export declare function ProductServiceControllerMethods(): (constructor: Function) => void;
|
|
472
562
|
export declare const PRODUCT_SERVICE_NAME = "ProductService";
|
package/dist/gen/product.js
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
// protoc v3.21.12
|
|
6
6
|
// source: product.proto
|
|
7
7
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
|
-
exports.PRODUCT_SERVICE_NAME = exports.CATALOG_V1_PACKAGE_NAME = exports.ProductStatus = exports.protobufPackage = void 0;
|
|
8
|
+
exports.PRODUCT_SERVICE_NAME = exports.CATALOG_V1_PACKAGE_NAME = exports.ExportFormat = exports.RelatedProductType = exports.ProductStatus = exports.protobufPackage = void 0;
|
|
9
9
|
exports.ProductServiceControllerMethods = ProductServiceControllerMethods;
|
|
10
10
|
/* eslint-disable */
|
|
11
11
|
const microservices_1 = require("@nestjs/microservices");
|
|
@@ -19,6 +19,22 @@ var ProductStatus;
|
|
|
19
19
|
ProductStatus[ProductStatus["PRODUCT_STATUS_ARCHIVED"] = 4] = "PRODUCT_STATUS_ARCHIVED";
|
|
20
20
|
ProductStatus[ProductStatus["UNRECOGNIZED"] = -1] = "UNRECOGNIZED";
|
|
21
21
|
})(ProductStatus || (exports.ProductStatus = ProductStatus = {}));
|
|
22
|
+
var RelatedProductType;
|
|
23
|
+
(function (RelatedProductType) {
|
|
24
|
+
RelatedProductType[RelatedProductType["RELATED_TYPE_UNSPECIFIED"] = 0] = "RELATED_TYPE_UNSPECIFIED";
|
|
25
|
+
RelatedProductType[RelatedProductType["RELATED_TYPE_CROSS_SELL"] = 1] = "RELATED_TYPE_CROSS_SELL";
|
|
26
|
+
RelatedProductType[RelatedProductType["RELATED_TYPE_UP_SELL"] = 2] = "RELATED_TYPE_UP_SELL";
|
|
27
|
+
RelatedProductType[RelatedProductType["RELATED_TYPE_BOUGHT_TOGETHER"] = 3] = "RELATED_TYPE_BOUGHT_TOGETHER";
|
|
28
|
+
RelatedProductType[RelatedProductType["RELATED_TYPE_POPULAR"] = 4] = "RELATED_TYPE_POPULAR";
|
|
29
|
+
RelatedProductType[RelatedProductType["UNRECOGNIZED"] = -1] = "UNRECOGNIZED";
|
|
30
|
+
})(RelatedProductType || (exports.RelatedProductType = RelatedProductType = {}));
|
|
31
|
+
var ExportFormat;
|
|
32
|
+
(function (ExportFormat) {
|
|
33
|
+
ExportFormat[ExportFormat["EXPORT_FORMAT_UNSPECIFIED"] = 0] = "EXPORT_FORMAT_UNSPECIFIED";
|
|
34
|
+
ExportFormat[ExportFormat["EXPORT_FORMAT_CSV"] = 1] = "EXPORT_FORMAT_CSV";
|
|
35
|
+
ExportFormat[ExportFormat["EXPORT_FORMAT_XLSX"] = 2] = "EXPORT_FORMAT_XLSX";
|
|
36
|
+
ExportFormat[ExportFormat["UNRECOGNIZED"] = -1] = "UNRECOGNIZED";
|
|
37
|
+
})(ExportFormat || (exports.ExportFormat = ExportFormat = {}));
|
|
22
38
|
exports.CATALOG_V1_PACKAGE_NAME = "catalog.v1";
|
|
23
39
|
function ProductServiceControllerMethods() {
|
|
24
40
|
return function (constructor) {
|
|
@@ -42,6 +58,12 @@ function ProductServiceControllerMethods() {
|
|
|
42
58
|
"deleteProductVariant",
|
|
43
59
|
"updateProductGlobalOrder",
|
|
44
60
|
"updateProductCategoryOrder",
|
|
61
|
+
"getRelatedProducts",
|
|
62
|
+
"setRelatedProducts",
|
|
63
|
+
"removeRelatedProduct",
|
|
64
|
+
"exportProducts",
|
|
65
|
+
"bulkUpdateSortOrder",
|
|
66
|
+
"bulkSetPopular",
|
|
45
67
|
];
|
|
46
68
|
for (const method of grpcMethods) {
|
|
47
69
|
const descriptor = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
|
package/dist/proto/product.proto
CHANGED
|
@@ -37,6 +37,18 @@ service ProductService {
|
|
|
37
37
|
|
|
38
38
|
rpc UpdateProductGlobalOrder (UpdateProductGlobalOrderRequest) returns (SuccessResponse);
|
|
39
39
|
rpc UpdateProductCategoryOrder (UpdateProductCategoryOrderRequest) returns (SuccessResponse);
|
|
40
|
+
|
|
41
|
+
rpc GetRelatedProducts (GetRelatedProductsRequest) returns (GetRelatedProductsResponse);
|
|
42
|
+
rpc SetRelatedProducts (SetRelatedProductsRequest) returns (SuccessResponse);
|
|
43
|
+
rpc RemoveRelatedProduct (RemoveRelatedProductRequest) returns (SuccessResponse);
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
rpc ExportProducts (ExportProductsRequest) returns (ExportProductsResponse);
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
rpc BulkUpdateSortOrder (BulkUpdateSortOrderRequest) returns (SuccessResponse);
|
|
50
|
+
|
|
51
|
+
rpc BulkSetPopular (BulkSetPopularRequest) returns (SuccessResponse);
|
|
40
52
|
}
|
|
41
53
|
|
|
42
54
|
|
|
@@ -365,3 +377,87 @@ enum ProductStatus {
|
|
|
365
377
|
PRODUCT_STATUS_INACTIVE = 3;
|
|
366
378
|
PRODUCT_STATUS_ARCHIVED = 4;
|
|
367
379
|
}
|
|
380
|
+
|
|
381
|
+
enum RelatedProductType {
|
|
382
|
+
RELATED_TYPE_UNSPECIFIED = 0;
|
|
383
|
+
RELATED_TYPE_CROSS_SELL = 1;
|
|
384
|
+
RELATED_TYPE_UP_SELL = 2;
|
|
385
|
+
RELATED_TYPE_BOUGHT_TOGETHER = 3;
|
|
386
|
+
RELATED_TYPE_POPULAR = 4;
|
|
387
|
+
}
|
|
388
|
+
|
|
389
|
+
message GetRelatedProductsRequest {
|
|
390
|
+
string product_id = 1;
|
|
391
|
+
optional RelatedProductType type = 2;
|
|
392
|
+
}
|
|
393
|
+
|
|
394
|
+
message RelatedProductItem {
|
|
395
|
+
string product_id = 1;
|
|
396
|
+
string sku = 2;
|
|
397
|
+
string slug = 3;
|
|
398
|
+
map<string, string> name = 4;
|
|
399
|
+
string main_image = 5;
|
|
400
|
+
double price = 6;
|
|
401
|
+
optional double old_price = 7;
|
|
402
|
+
ProductStatus status = 8;
|
|
403
|
+
int32 total_stock = 9;
|
|
404
|
+
RelatedProductType type = 10;
|
|
405
|
+
}
|
|
406
|
+
|
|
407
|
+
message GetRelatedProductsResponse {
|
|
408
|
+
repeated RelatedProductItem cross_sell = 1;
|
|
409
|
+
repeated RelatedProductItem up_sell = 2;
|
|
410
|
+
repeated RelatedProductItem bought_together = 3;
|
|
411
|
+
repeated RelatedProductItem popular = 4;
|
|
412
|
+
}
|
|
413
|
+
|
|
414
|
+
message SetRelatedProductsRequest {
|
|
415
|
+
string product_id = 1;
|
|
416
|
+
RelatedProductType type = 2;
|
|
417
|
+
repeated string related_product_ids = 3;
|
|
418
|
+
}
|
|
419
|
+
|
|
420
|
+
message RemoveRelatedProductRequest {
|
|
421
|
+
string product_id = 1;
|
|
422
|
+
string related_product_id = 2;
|
|
423
|
+
RelatedProductType type = 3;
|
|
424
|
+
}
|
|
425
|
+
|
|
426
|
+
|
|
427
|
+
enum ExportFormat {
|
|
428
|
+
EXPORT_FORMAT_UNSPECIFIED = 0;
|
|
429
|
+
EXPORT_FORMAT_CSV = 1;
|
|
430
|
+
EXPORT_FORMAT_XLSX = 2;
|
|
431
|
+
}
|
|
432
|
+
|
|
433
|
+
message ExportProductsRequest {
|
|
434
|
+
|
|
435
|
+
optional string search = 1;
|
|
436
|
+
optional string category_id = 2;
|
|
437
|
+
optional string brand_id = 3;
|
|
438
|
+
optional ProductStatus status = 4;
|
|
439
|
+
optional bool in_stock = 5;
|
|
440
|
+
optional double price_min = 6;
|
|
441
|
+
optional double price_max = 7;
|
|
442
|
+
optional string sort_by = 8;
|
|
443
|
+
|
|
444
|
+
ExportFormat format = 9;
|
|
445
|
+
repeated string fields = 10;
|
|
446
|
+
string created_by_id = 11;
|
|
447
|
+
optional string locale = 12;
|
|
448
|
+
}
|
|
449
|
+
|
|
450
|
+
message ExportProductsResponse {
|
|
451
|
+
string download_url = 1;
|
|
452
|
+
string file_name = 2;
|
|
453
|
+
int32 total_rows = 3;
|
|
454
|
+
}
|
|
455
|
+
|
|
456
|
+
message BulkUpdateSortOrderRequest {
|
|
457
|
+
repeated ProductOrderItem items = 1;
|
|
458
|
+
}
|
|
459
|
+
|
|
460
|
+
message BulkSetPopularRequest {
|
|
461
|
+
repeated string product_ids = 1;
|
|
462
|
+
bool popular = 2;
|
|
463
|
+
}
|
package/gen/product.ts
CHANGED
|
@@ -20,6 +20,22 @@ export enum ProductStatus {
|
|
|
20
20
|
UNRECOGNIZED = -1,
|
|
21
21
|
}
|
|
22
22
|
|
|
23
|
+
export enum RelatedProductType {
|
|
24
|
+
RELATED_TYPE_UNSPECIFIED = 0,
|
|
25
|
+
RELATED_TYPE_CROSS_SELL = 1,
|
|
26
|
+
RELATED_TYPE_UP_SELL = 2,
|
|
27
|
+
RELATED_TYPE_BOUGHT_TOGETHER = 3,
|
|
28
|
+
RELATED_TYPE_POPULAR = 4,
|
|
29
|
+
UNRECOGNIZED = -1,
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
export enum ExportFormat {
|
|
33
|
+
EXPORT_FORMAT_UNSPECIFIED = 0,
|
|
34
|
+
EXPORT_FORMAT_CSV = 1,
|
|
35
|
+
EXPORT_FORMAT_XLSX = 2,
|
|
36
|
+
UNRECOGNIZED = -1,
|
|
37
|
+
}
|
|
38
|
+
|
|
23
39
|
export interface BulkStickerRequest {
|
|
24
40
|
productIds: string[];
|
|
25
41
|
stickerId: string;
|
|
@@ -439,6 +455,78 @@ export interface DeleteProductVariantRequest {
|
|
|
439
455
|
id: string;
|
|
440
456
|
}
|
|
441
457
|
|
|
458
|
+
export interface GetRelatedProductsRequest {
|
|
459
|
+
productId: string;
|
|
460
|
+
type?: RelatedProductType | undefined;
|
|
461
|
+
}
|
|
462
|
+
|
|
463
|
+
export interface RelatedProductItem {
|
|
464
|
+
productId: string;
|
|
465
|
+
sku: string;
|
|
466
|
+
slug: string;
|
|
467
|
+
name: { [key: string]: string };
|
|
468
|
+
mainImage: string;
|
|
469
|
+
price: number;
|
|
470
|
+
oldPrice?: number | undefined;
|
|
471
|
+
status: ProductStatus;
|
|
472
|
+
totalStock: number;
|
|
473
|
+
type: RelatedProductType;
|
|
474
|
+
}
|
|
475
|
+
|
|
476
|
+
export interface RelatedProductItem_NameEntry {
|
|
477
|
+
key: string;
|
|
478
|
+
value: string;
|
|
479
|
+
}
|
|
480
|
+
|
|
481
|
+
export interface GetRelatedProductsResponse {
|
|
482
|
+
crossSell: RelatedProductItem[];
|
|
483
|
+
upSell: RelatedProductItem[];
|
|
484
|
+
boughtTogether: RelatedProductItem[];
|
|
485
|
+
popular: RelatedProductItem[];
|
|
486
|
+
}
|
|
487
|
+
|
|
488
|
+
export interface SetRelatedProductsRequest {
|
|
489
|
+
productId: string;
|
|
490
|
+
type: RelatedProductType;
|
|
491
|
+
relatedProductIds: string[];
|
|
492
|
+
}
|
|
493
|
+
|
|
494
|
+
export interface RemoveRelatedProductRequest {
|
|
495
|
+
productId: string;
|
|
496
|
+
relatedProductId: string;
|
|
497
|
+
type: RelatedProductType;
|
|
498
|
+
}
|
|
499
|
+
|
|
500
|
+
export interface ExportProductsRequest {
|
|
501
|
+
search?: string | undefined;
|
|
502
|
+
categoryId?: string | undefined;
|
|
503
|
+
brandId?: string | undefined;
|
|
504
|
+
status?: ProductStatus | undefined;
|
|
505
|
+
inStock?: boolean | undefined;
|
|
506
|
+
priceMin?: number | undefined;
|
|
507
|
+
priceMax?: number | undefined;
|
|
508
|
+
sortBy?: string | undefined;
|
|
509
|
+
format: ExportFormat;
|
|
510
|
+
fields: string[];
|
|
511
|
+
createdById: string;
|
|
512
|
+
locale?: string | undefined;
|
|
513
|
+
}
|
|
514
|
+
|
|
515
|
+
export interface ExportProductsResponse {
|
|
516
|
+
downloadUrl: string;
|
|
517
|
+
fileName: string;
|
|
518
|
+
totalRows: number;
|
|
519
|
+
}
|
|
520
|
+
|
|
521
|
+
export interface BulkUpdateSortOrderRequest {
|
|
522
|
+
items: ProductOrderItem[];
|
|
523
|
+
}
|
|
524
|
+
|
|
525
|
+
export interface BulkSetPopularRequest {
|
|
526
|
+
productIds: string[];
|
|
527
|
+
popular: boolean;
|
|
528
|
+
}
|
|
529
|
+
|
|
442
530
|
export const CATALOG_V1_PACKAGE_NAME = "catalog.v1";
|
|
443
531
|
|
|
444
532
|
export interface ProductServiceClient {
|
|
@@ -479,6 +567,18 @@ export interface ProductServiceClient {
|
|
|
479
567
|
updateProductGlobalOrder(request: UpdateProductGlobalOrderRequest): Observable<SuccessResponse>;
|
|
480
568
|
|
|
481
569
|
updateProductCategoryOrder(request: UpdateProductCategoryOrderRequest): Observable<SuccessResponse>;
|
|
570
|
+
|
|
571
|
+
getRelatedProducts(request: GetRelatedProductsRequest): Observable<GetRelatedProductsResponse>;
|
|
572
|
+
|
|
573
|
+
setRelatedProducts(request: SetRelatedProductsRequest): Observable<SuccessResponse>;
|
|
574
|
+
|
|
575
|
+
removeRelatedProduct(request: RemoveRelatedProductRequest): Observable<SuccessResponse>;
|
|
576
|
+
|
|
577
|
+
exportProducts(request: ExportProductsRequest): Observable<ExportProductsResponse>;
|
|
578
|
+
|
|
579
|
+
bulkUpdateSortOrder(request: BulkUpdateSortOrderRequest): Observable<SuccessResponse>;
|
|
580
|
+
|
|
581
|
+
bulkSetPopular(request: BulkSetPopularRequest): Observable<SuccessResponse>;
|
|
482
582
|
}
|
|
483
583
|
|
|
484
584
|
export interface ProductServiceController {
|
|
@@ -555,6 +655,30 @@ export interface ProductServiceController {
|
|
|
555
655
|
updateProductCategoryOrder(
|
|
556
656
|
request: UpdateProductCategoryOrderRequest,
|
|
557
657
|
): Promise<SuccessResponse> | Observable<SuccessResponse> | SuccessResponse;
|
|
658
|
+
|
|
659
|
+
getRelatedProducts(
|
|
660
|
+
request: GetRelatedProductsRequest,
|
|
661
|
+
): Promise<GetRelatedProductsResponse> | Observable<GetRelatedProductsResponse> | GetRelatedProductsResponse;
|
|
662
|
+
|
|
663
|
+
setRelatedProducts(
|
|
664
|
+
request: SetRelatedProductsRequest,
|
|
665
|
+
): Promise<SuccessResponse> | Observable<SuccessResponse> | SuccessResponse;
|
|
666
|
+
|
|
667
|
+
removeRelatedProduct(
|
|
668
|
+
request: RemoveRelatedProductRequest,
|
|
669
|
+
): Promise<SuccessResponse> | Observable<SuccessResponse> | SuccessResponse;
|
|
670
|
+
|
|
671
|
+
exportProducts(
|
|
672
|
+
request: ExportProductsRequest,
|
|
673
|
+
): Promise<ExportProductsResponse> | Observable<ExportProductsResponse> | ExportProductsResponse;
|
|
674
|
+
|
|
675
|
+
bulkUpdateSortOrder(
|
|
676
|
+
request: BulkUpdateSortOrderRequest,
|
|
677
|
+
): Promise<SuccessResponse> | Observable<SuccessResponse> | SuccessResponse;
|
|
678
|
+
|
|
679
|
+
bulkSetPopular(
|
|
680
|
+
request: BulkSetPopularRequest,
|
|
681
|
+
): Promise<SuccessResponse> | Observable<SuccessResponse> | SuccessResponse;
|
|
558
682
|
}
|
|
559
683
|
|
|
560
684
|
export function ProductServiceControllerMethods() {
|
|
@@ -579,6 +703,12 @@ export function ProductServiceControllerMethods() {
|
|
|
579
703
|
"deleteProductVariant",
|
|
580
704
|
"updateProductGlobalOrder",
|
|
581
705
|
"updateProductCategoryOrder",
|
|
706
|
+
"getRelatedProducts",
|
|
707
|
+
"setRelatedProducts",
|
|
708
|
+
"removeRelatedProduct",
|
|
709
|
+
"exportProducts",
|
|
710
|
+
"bulkUpdateSortOrder",
|
|
711
|
+
"bulkSetPopular",
|
|
582
712
|
];
|
|
583
713
|
for (const method of grpcMethods) {
|
|
584
714
|
const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
|
package/package.json
CHANGED
package/proto/product.proto
CHANGED
|
@@ -37,6 +37,18 @@ service ProductService {
|
|
|
37
37
|
|
|
38
38
|
rpc UpdateProductGlobalOrder (UpdateProductGlobalOrderRequest) returns (SuccessResponse);
|
|
39
39
|
rpc UpdateProductCategoryOrder (UpdateProductCategoryOrderRequest) returns (SuccessResponse);
|
|
40
|
+
|
|
41
|
+
rpc GetRelatedProducts (GetRelatedProductsRequest) returns (GetRelatedProductsResponse);
|
|
42
|
+
rpc SetRelatedProducts (SetRelatedProductsRequest) returns (SuccessResponse);
|
|
43
|
+
rpc RemoveRelatedProduct (RemoveRelatedProductRequest) returns (SuccessResponse);
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
rpc ExportProducts (ExportProductsRequest) returns (ExportProductsResponse);
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
rpc BulkUpdateSortOrder (BulkUpdateSortOrderRequest) returns (SuccessResponse);
|
|
50
|
+
|
|
51
|
+
rpc BulkSetPopular (BulkSetPopularRequest) returns (SuccessResponse);
|
|
40
52
|
}
|
|
41
53
|
|
|
42
54
|
|
|
@@ -365,3 +377,87 @@ enum ProductStatus {
|
|
|
365
377
|
PRODUCT_STATUS_INACTIVE = 3;
|
|
366
378
|
PRODUCT_STATUS_ARCHIVED = 4;
|
|
367
379
|
}
|
|
380
|
+
|
|
381
|
+
enum RelatedProductType {
|
|
382
|
+
RELATED_TYPE_UNSPECIFIED = 0;
|
|
383
|
+
RELATED_TYPE_CROSS_SELL = 1;
|
|
384
|
+
RELATED_TYPE_UP_SELL = 2;
|
|
385
|
+
RELATED_TYPE_BOUGHT_TOGETHER = 3;
|
|
386
|
+
RELATED_TYPE_POPULAR = 4;
|
|
387
|
+
}
|
|
388
|
+
|
|
389
|
+
message GetRelatedProductsRequest {
|
|
390
|
+
string product_id = 1;
|
|
391
|
+
optional RelatedProductType type = 2;
|
|
392
|
+
}
|
|
393
|
+
|
|
394
|
+
message RelatedProductItem {
|
|
395
|
+
string product_id = 1;
|
|
396
|
+
string sku = 2;
|
|
397
|
+
string slug = 3;
|
|
398
|
+
map<string, string> name = 4;
|
|
399
|
+
string main_image = 5;
|
|
400
|
+
double price = 6;
|
|
401
|
+
optional double old_price = 7;
|
|
402
|
+
ProductStatus status = 8;
|
|
403
|
+
int32 total_stock = 9;
|
|
404
|
+
RelatedProductType type = 10;
|
|
405
|
+
}
|
|
406
|
+
|
|
407
|
+
message GetRelatedProductsResponse {
|
|
408
|
+
repeated RelatedProductItem cross_sell = 1;
|
|
409
|
+
repeated RelatedProductItem up_sell = 2;
|
|
410
|
+
repeated RelatedProductItem bought_together = 3;
|
|
411
|
+
repeated RelatedProductItem popular = 4;
|
|
412
|
+
}
|
|
413
|
+
|
|
414
|
+
message SetRelatedProductsRequest {
|
|
415
|
+
string product_id = 1;
|
|
416
|
+
RelatedProductType type = 2;
|
|
417
|
+
repeated string related_product_ids = 3;
|
|
418
|
+
}
|
|
419
|
+
|
|
420
|
+
message RemoveRelatedProductRequest {
|
|
421
|
+
string product_id = 1;
|
|
422
|
+
string related_product_id = 2;
|
|
423
|
+
RelatedProductType type = 3;
|
|
424
|
+
}
|
|
425
|
+
|
|
426
|
+
|
|
427
|
+
enum ExportFormat {
|
|
428
|
+
EXPORT_FORMAT_UNSPECIFIED = 0;
|
|
429
|
+
EXPORT_FORMAT_CSV = 1;
|
|
430
|
+
EXPORT_FORMAT_XLSX = 2;
|
|
431
|
+
}
|
|
432
|
+
|
|
433
|
+
message ExportProductsRequest {
|
|
434
|
+
|
|
435
|
+
optional string search = 1;
|
|
436
|
+
optional string category_id = 2;
|
|
437
|
+
optional string brand_id = 3;
|
|
438
|
+
optional ProductStatus status = 4;
|
|
439
|
+
optional bool in_stock = 5;
|
|
440
|
+
optional double price_min = 6;
|
|
441
|
+
optional double price_max = 7;
|
|
442
|
+
optional string sort_by = 8;
|
|
443
|
+
|
|
444
|
+
ExportFormat format = 9;
|
|
445
|
+
repeated string fields = 10;
|
|
446
|
+
string created_by_id = 11;
|
|
447
|
+
optional string locale = 12;
|
|
448
|
+
}
|
|
449
|
+
|
|
450
|
+
message ExportProductsResponse {
|
|
451
|
+
string download_url = 1;
|
|
452
|
+
string file_name = 2;
|
|
453
|
+
int32 total_rows = 3;
|
|
454
|
+
}
|
|
455
|
+
|
|
456
|
+
message BulkUpdateSortOrderRequest {
|
|
457
|
+
repeated ProductOrderItem items = 1;
|
|
458
|
+
}
|
|
459
|
+
|
|
460
|
+
message BulkSetPopularRequest {
|
|
461
|
+
repeated string product_ids = 1;
|
|
462
|
+
bool popular = 2;
|
|
463
|
+
}
|