@mamindom/contracts 1.0.69 → 1.0.70
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 +84 -0
- package/dist/gen/product.js +22 -1
- package/dist/proto/product.proto +90 -0
- package/gen/product.ts +118 -0
- package/package.json +1 -1
- package/proto/product.proto +90 -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,66 @@ 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
|
+
}
|
|
428
502
|
export declare const CATALOG_V1_PACKAGE_NAME = "catalog.v1";
|
|
429
503
|
export interface ProductServiceClient {
|
|
430
504
|
getProducts(request: GetProductsRequest): Observable<GetProductsResponse>;
|
|
@@ -446,6 +520,11 @@ export interface ProductServiceClient {
|
|
|
446
520
|
deleteProductVariant(request: DeleteProductVariantRequest): Observable<DeleteResponse>;
|
|
447
521
|
updateProductGlobalOrder(request: UpdateProductGlobalOrderRequest): Observable<SuccessResponse>;
|
|
448
522
|
updateProductCategoryOrder(request: UpdateProductCategoryOrderRequest): Observable<SuccessResponse>;
|
|
523
|
+
getRelatedProducts(request: GetRelatedProductsRequest): Observable<GetRelatedProductsResponse>;
|
|
524
|
+
setRelatedProducts(request: SetRelatedProductsRequest): Observable<SuccessResponse>;
|
|
525
|
+
removeRelatedProduct(request: RemoveRelatedProductRequest): Observable<SuccessResponse>;
|
|
526
|
+
exportProducts(request: ExportProductsRequest): Observable<ExportProductsResponse>;
|
|
527
|
+
bulkUpdateSortOrder(request: BulkUpdateSortOrderRequest): Observable<SuccessResponse>;
|
|
449
528
|
}
|
|
450
529
|
export interface ProductServiceController {
|
|
451
530
|
getProducts(request: GetProductsRequest): Promise<GetProductsResponse> | Observable<GetProductsResponse> | GetProductsResponse;
|
|
@@ -467,6 +546,11 @@ export interface ProductServiceController {
|
|
|
467
546
|
deleteProductVariant(request: DeleteProductVariantRequest): Promise<DeleteResponse> | Observable<DeleteResponse> | DeleteResponse;
|
|
468
547
|
updateProductGlobalOrder(request: UpdateProductGlobalOrderRequest): Promise<SuccessResponse> | Observable<SuccessResponse> | SuccessResponse;
|
|
469
548
|
updateProductCategoryOrder(request: UpdateProductCategoryOrderRequest): Promise<SuccessResponse> | Observable<SuccessResponse> | SuccessResponse;
|
|
549
|
+
getRelatedProducts(request: GetRelatedProductsRequest): Promise<GetRelatedProductsResponse> | Observable<GetRelatedProductsResponse> | GetRelatedProductsResponse;
|
|
550
|
+
setRelatedProducts(request: SetRelatedProductsRequest): Promise<SuccessResponse> | Observable<SuccessResponse> | SuccessResponse;
|
|
551
|
+
removeRelatedProduct(request: RemoveRelatedProductRequest): Promise<SuccessResponse> | Observable<SuccessResponse> | SuccessResponse;
|
|
552
|
+
exportProducts(request: ExportProductsRequest): Promise<ExportProductsResponse> | Observable<ExportProductsResponse> | ExportProductsResponse;
|
|
553
|
+
bulkUpdateSortOrder(request: BulkUpdateSortOrderRequest): Promise<SuccessResponse> | Observable<SuccessResponse> | SuccessResponse;
|
|
470
554
|
}
|
|
471
555
|
export declare function ProductServiceControllerMethods(): (constructor: Function) => void;
|
|
472
556
|
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,11 @@ function ProductServiceControllerMethods() {
|
|
|
42
58
|
"deleteProductVariant",
|
|
43
59
|
"updateProductGlobalOrder",
|
|
44
60
|
"updateProductCategoryOrder",
|
|
61
|
+
"getRelatedProducts",
|
|
62
|
+
"setRelatedProducts",
|
|
63
|
+
"removeRelatedProduct",
|
|
64
|
+
"exportProducts",
|
|
65
|
+
"bulkUpdateSortOrder",
|
|
45
66
|
];
|
|
46
67
|
for (const method of grpcMethods) {
|
|
47
68
|
const descriptor = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
|
package/dist/proto/product.proto
CHANGED
|
@@ -37,6 +37,16 @@ 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);
|
|
40
50
|
}
|
|
41
51
|
|
|
42
52
|
|
|
@@ -365,3 +375,83 @@ enum ProductStatus {
|
|
|
365
375
|
PRODUCT_STATUS_INACTIVE = 3;
|
|
366
376
|
PRODUCT_STATUS_ARCHIVED = 4;
|
|
367
377
|
}
|
|
378
|
+
|
|
379
|
+
enum RelatedProductType {
|
|
380
|
+
RELATED_TYPE_UNSPECIFIED = 0;
|
|
381
|
+
RELATED_TYPE_CROSS_SELL = 1;
|
|
382
|
+
RELATED_TYPE_UP_SELL = 2;
|
|
383
|
+
RELATED_TYPE_BOUGHT_TOGETHER = 3;
|
|
384
|
+
RELATED_TYPE_POPULAR = 4;
|
|
385
|
+
}
|
|
386
|
+
|
|
387
|
+
message GetRelatedProductsRequest {
|
|
388
|
+
string product_id = 1;
|
|
389
|
+
optional RelatedProductType type = 2;
|
|
390
|
+
}
|
|
391
|
+
|
|
392
|
+
message RelatedProductItem {
|
|
393
|
+
string product_id = 1;
|
|
394
|
+
string sku = 2;
|
|
395
|
+
string slug = 3;
|
|
396
|
+
map<string, string> name = 4;
|
|
397
|
+
string main_image = 5;
|
|
398
|
+
double price = 6;
|
|
399
|
+
optional double old_price = 7;
|
|
400
|
+
ProductStatus status = 8;
|
|
401
|
+
int32 total_stock = 9;
|
|
402
|
+
RelatedProductType type = 10;
|
|
403
|
+
}
|
|
404
|
+
|
|
405
|
+
message GetRelatedProductsResponse {
|
|
406
|
+
repeated RelatedProductItem cross_sell = 1;
|
|
407
|
+
repeated RelatedProductItem up_sell = 2;
|
|
408
|
+
repeated RelatedProductItem bought_together = 3;
|
|
409
|
+
repeated RelatedProductItem popular = 4;
|
|
410
|
+
}
|
|
411
|
+
|
|
412
|
+
message SetRelatedProductsRequest {
|
|
413
|
+
string product_id = 1;
|
|
414
|
+
RelatedProductType type = 2;
|
|
415
|
+
repeated string related_product_ids = 3;
|
|
416
|
+
}
|
|
417
|
+
|
|
418
|
+
message RemoveRelatedProductRequest {
|
|
419
|
+
string product_id = 1;
|
|
420
|
+
string related_product_id = 2;
|
|
421
|
+
RelatedProductType type = 3;
|
|
422
|
+
}
|
|
423
|
+
|
|
424
|
+
|
|
425
|
+
enum ExportFormat {
|
|
426
|
+
EXPORT_FORMAT_UNSPECIFIED = 0;
|
|
427
|
+
EXPORT_FORMAT_CSV = 1;
|
|
428
|
+
EXPORT_FORMAT_XLSX = 2;
|
|
429
|
+
}
|
|
430
|
+
|
|
431
|
+
message ExportProductsRequest {
|
|
432
|
+
|
|
433
|
+
optional string search = 1;
|
|
434
|
+
optional string category_id = 2;
|
|
435
|
+
optional string brand_id = 3;
|
|
436
|
+
optional ProductStatus status = 4;
|
|
437
|
+
optional bool in_stock = 5;
|
|
438
|
+
optional double price_min = 6;
|
|
439
|
+
optional double price_max = 7;
|
|
440
|
+
optional string sort_by = 8;
|
|
441
|
+
|
|
442
|
+
ExportFormat format = 9;
|
|
443
|
+
repeated string fields = 10;
|
|
444
|
+
string created_by_id = 11;
|
|
445
|
+
optional string locale = 12;
|
|
446
|
+
}
|
|
447
|
+
|
|
448
|
+
message ExportProductsResponse {
|
|
449
|
+
string download_url = 1;
|
|
450
|
+
string file_name = 2;
|
|
451
|
+
int32 total_rows = 3;
|
|
452
|
+
}
|
|
453
|
+
|
|
454
|
+
message BulkUpdateSortOrderRequest {
|
|
455
|
+
repeated ProductOrderItem items = 1;
|
|
456
|
+
}
|
|
457
|
+
|
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,73 @@ 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
|
+
|
|
442
525
|
export const CATALOG_V1_PACKAGE_NAME = "catalog.v1";
|
|
443
526
|
|
|
444
527
|
export interface ProductServiceClient {
|
|
@@ -479,6 +562,16 @@ export interface ProductServiceClient {
|
|
|
479
562
|
updateProductGlobalOrder(request: UpdateProductGlobalOrderRequest): Observable<SuccessResponse>;
|
|
480
563
|
|
|
481
564
|
updateProductCategoryOrder(request: UpdateProductCategoryOrderRequest): Observable<SuccessResponse>;
|
|
565
|
+
|
|
566
|
+
getRelatedProducts(request: GetRelatedProductsRequest): Observable<GetRelatedProductsResponse>;
|
|
567
|
+
|
|
568
|
+
setRelatedProducts(request: SetRelatedProductsRequest): Observable<SuccessResponse>;
|
|
569
|
+
|
|
570
|
+
removeRelatedProduct(request: RemoveRelatedProductRequest): Observable<SuccessResponse>;
|
|
571
|
+
|
|
572
|
+
exportProducts(request: ExportProductsRequest): Observable<ExportProductsResponse>;
|
|
573
|
+
|
|
574
|
+
bulkUpdateSortOrder(request: BulkUpdateSortOrderRequest): Observable<SuccessResponse>;
|
|
482
575
|
}
|
|
483
576
|
|
|
484
577
|
export interface ProductServiceController {
|
|
@@ -555,6 +648,26 @@ export interface ProductServiceController {
|
|
|
555
648
|
updateProductCategoryOrder(
|
|
556
649
|
request: UpdateProductCategoryOrderRequest,
|
|
557
650
|
): Promise<SuccessResponse> | Observable<SuccessResponse> | SuccessResponse;
|
|
651
|
+
|
|
652
|
+
getRelatedProducts(
|
|
653
|
+
request: GetRelatedProductsRequest,
|
|
654
|
+
): Promise<GetRelatedProductsResponse> | Observable<GetRelatedProductsResponse> | GetRelatedProductsResponse;
|
|
655
|
+
|
|
656
|
+
setRelatedProducts(
|
|
657
|
+
request: SetRelatedProductsRequest,
|
|
658
|
+
): Promise<SuccessResponse> | Observable<SuccessResponse> | SuccessResponse;
|
|
659
|
+
|
|
660
|
+
removeRelatedProduct(
|
|
661
|
+
request: RemoveRelatedProductRequest,
|
|
662
|
+
): Promise<SuccessResponse> | Observable<SuccessResponse> | SuccessResponse;
|
|
663
|
+
|
|
664
|
+
exportProducts(
|
|
665
|
+
request: ExportProductsRequest,
|
|
666
|
+
): Promise<ExportProductsResponse> | Observable<ExportProductsResponse> | ExportProductsResponse;
|
|
667
|
+
|
|
668
|
+
bulkUpdateSortOrder(
|
|
669
|
+
request: BulkUpdateSortOrderRequest,
|
|
670
|
+
): Promise<SuccessResponse> | Observable<SuccessResponse> | SuccessResponse;
|
|
558
671
|
}
|
|
559
672
|
|
|
560
673
|
export function ProductServiceControllerMethods() {
|
|
@@ -579,6 +692,11 @@ export function ProductServiceControllerMethods() {
|
|
|
579
692
|
"deleteProductVariant",
|
|
580
693
|
"updateProductGlobalOrder",
|
|
581
694
|
"updateProductCategoryOrder",
|
|
695
|
+
"getRelatedProducts",
|
|
696
|
+
"setRelatedProducts",
|
|
697
|
+
"removeRelatedProduct",
|
|
698
|
+
"exportProducts",
|
|
699
|
+
"bulkUpdateSortOrder",
|
|
582
700
|
];
|
|
583
701
|
for (const method of grpcMethods) {
|
|
584
702
|
const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
|
package/package.json
CHANGED
package/proto/product.proto
CHANGED
|
@@ -37,6 +37,16 @@ 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);
|
|
40
50
|
}
|
|
41
51
|
|
|
42
52
|
|
|
@@ -365,3 +375,83 @@ enum ProductStatus {
|
|
|
365
375
|
PRODUCT_STATUS_INACTIVE = 3;
|
|
366
376
|
PRODUCT_STATUS_ARCHIVED = 4;
|
|
367
377
|
}
|
|
378
|
+
|
|
379
|
+
enum RelatedProductType {
|
|
380
|
+
RELATED_TYPE_UNSPECIFIED = 0;
|
|
381
|
+
RELATED_TYPE_CROSS_SELL = 1;
|
|
382
|
+
RELATED_TYPE_UP_SELL = 2;
|
|
383
|
+
RELATED_TYPE_BOUGHT_TOGETHER = 3;
|
|
384
|
+
RELATED_TYPE_POPULAR = 4;
|
|
385
|
+
}
|
|
386
|
+
|
|
387
|
+
message GetRelatedProductsRequest {
|
|
388
|
+
string product_id = 1;
|
|
389
|
+
optional RelatedProductType type = 2;
|
|
390
|
+
}
|
|
391
|
+
|
|
392
|
+
message RelatedProductItem {
|
|
393
|
+
string product_id = 1;
|
|
394
|
+
string sku = 2;
|
|
395
|
+
string slug = 3;
|
|
396
|
+
map<string, string> name = 4;
|
|
397
|
+
string main_image = 5;
|
|
398
|
+
double price = 6;
|
|
399
|
+
optional double old_price = 7;
|
|
400
|
+
ProductStatus status = 8;
|
|
401
|
+
int32 total_stock = 9;
|
|
402
|
+
RelatedProductType type = 10;
|
|
403
|
+
}
|
|
404
|
+
|
|
405
|
+
message GetRelatedProductsResponse {
|
|
406
|
+
repeated RelatedProductItem cross_sell = 1;
|
|
407
|
+
repeated RelatedProductItem up_sell = 2;
|
|
408
|
+
repeated RelatedProductItem bought_together = 3;
|
|
409
|
+
repeated RelatedProductItem popular = 4;
|
|
410
|
+
}
|
|
411
|
+
|
|
412
|
+
message SetRelatedProductsRequest {
|
|
413
|
+
string product_id = 1;
|
|
414
|
+
RelatedProductType type = 2;
|
|
415
|
+
repeated string related_product_ids = 3;
|
|
416
|
+
}
|
|
417
|
+
|
|
418
|
+
message RemoveRelatedProductRequest {
|
|
419
|
+
string product_id = 1;
|
|
420
|
+
string related_product_id = 2;
|
|
421
|
+
RelatedProductType type = 3;
|
|
422
|
+
}
|
|
423
|
+
|
|
424
|
+
|
|
425
|
+
enum ExportFormat {
|
|
426
|
+
EXPORT_FORMAT_UNSPECIFIED = 0;
|
|
427
|
+
EXPORT_FORMAT_CSV = 1;
|
|
428
|
+
EXPORT_FORMAT_XLSX = 2;
|
|
429
|
+
}
|
|
430
|
+
|
|
431
|
+
message ExportProductsRequest {
|
|
432
|
+
|
|
433
|
+
optional string search = 1;
|
|
434
|
+
optional string category_id = 2;
|
|
435
|
+
optional string brand_id = 3;
|
|
436
|
+
optional ProductStatus status = 4;
|
|
437
|
+
optional bool in_stock = 5;
|
|
438
|
+
optional double price_min = 6;
|
|
439
|
+
optional double price_max = 7;
|
|
440
|
+
optional string sort_by = 8;
|
|
441
|
+
|
|
442
|
+
ExportFormat format = 9;
|
|
443
|
+
repeated string fields = 10;
|
|
444
|
+
string created_by_id = 11;
|
|
445
|
+
optional string locale = 12;
|
|
446
|
+
}
|
|
447
|
+
|
|
448
|
+
message ExportProductsResponse {
|
|
449
|
+
string download_url = 1;
|
|
450
|
+
string file_name = 2;
|
|
451
|
+
int32 total_rows = 3;
|
|
452
|
+
}
|
|
453
|
+
|
|
454
|
+
message BulkUpdateSortOrderRequest {
|
|
455
|
+
repeated ProductOrderItem items = 1;
|
|
456
|
+
}
|
|
457
|
+
|