@platfformx/proto-contracts 1.3.2 → 1.3.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.
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
import { Observable } from "rxjs";
|
|
2
2
|
export declare const protobufPackage = "search.v1";
|
|
3
|
+
export interface IndexCategoryRequest {
|
|
4
|
+
category: Category | undefined;
|
|
5
|
+
}
|
|
6
|
+
export interface IndexCategoryResponse {
|
|
7
|
+
ok: boolean;
|
|
8
|
+
}
|
|
9
|
+
export interface GetCategoriesRequest {
|
|
10
|
+
limit?: string | undefined;
|
|
11
|
+
}
|
|
12
|
+
export interface GetCategoriesResponse {
|
|
13
|
+
categories: Category[];
|
|
14
|
+
}
|
|
3
15
|
export interface SearchProductsRequest {
|
|
4
16
|
query: string;
|
|
5
17
|
limit: number;
|
|
@@ -46,18 +58,27 @@ export interface Product {
|
|
|
46
58
|
rating: number;
|
|
47
59
|
status: string;
|
|
48
60
|
}
|
|
61
|
+
export interface Category {
|
|
62
|
+
id: string;
|
|
63
|
+
categoryName: string;
|
|
64
|
+
slug: string;
|
|
65
|
+
}
|
|
49
66
|
export declare const SEARCH_V1_PACKAGE_NAME = "search.v1";
|
|
50
67
|
export interface SearchServiceClient {
|
|
51
68
|
searchProducts(request: SearchProductsRequest): Observable<SearchProductsResponse>;
|
|
52
69
|
indexProduct(request: IndexProductRequest): Observable<IndexProductResponse>;
|
|
53
70
|
indexProducts(request: IndexProductsRequest): Observable<IndexProductsResponse>;
|
|
54
71
|
deleteProduct(request: DeleteProductRequest): Observable<DeleteProductResponse>;
|
|
72
|
+
getCategories(request: GetCategoriesRequest): Observable<GetCategoriesResponse>;
|
|
73
|
+
indexCategory(request: IndexCategoryRequest): Observable<IndexCategoryResponse>;
|
|
55
74
|
}
|
|
56
75
|
export interface SearchServiceController {
|
|
57
76
|
searchProducts(request: SearchProductsRequest): Promise<SearchProductsResponse> | Observable<SearchProductsResponse> | SearchProductsResponse;
|
|
58
77
|
indexProduct(request: IndexProductRequest): Promise<IndexProductResponse> | Observable<IndexProductResponse> | IndexProductResponse;
|
|
59
78
|
indexProducts(request: IndexProductsRequest): Promise<IndexProductsResponse> | Observable<IndexProductsResponse> | IndexProductsResponse;
|
|
60
79
|
deleteProduct(request: DeleteProductRequest): Promise<DeleteProductResponse> | Observable<DeleteProductResponse> | DeleteProductResponse;
|
|
80
|
+
getCategories(request: GetCategoriesRequest): Promise<GetCategoriesResponse> | Observable<GetCategoriesResponse> | GetCategoriesResponse;
|
|
81
|
+
indexCategory(request: IndexCategoryRequest): Promise<IndexCategoryResponse> | Observable<IndexCategoryResponse> | IndexCategoryResponse;
|
|
61
82
|
}
|
|
62
83
|
export declare function SearchServiceControllerMethods(): (constructor: Function) => void;
|
|
63
84
|
export declare const SEARCH_SERVICE_NAME = "SearchService";
|
|
@@ -13,7 +13,14 @@ exports.protobufPackage = "search.v1";
|
|
|
13
13
|
exports.SEARCH_V1_PACKAGE_NAME = "search.v1";
|
|
14
14
|
function SearchServiceControllerMethods() {
|
|
15
15
|
return function (constructor) {
|
|
16
|
-
const grpcMethods = [
|
|
16
|
+
const grpcMethods = [
|
|
17
|
+
"searchProducts",
|
|
18
|
+
"indexProduct",
|
|
19
|
+
"indexProducts",
|
|
20
|
+
"deleteProduct",
|
|
21
|
+
"getCategories",
|
|
22
|
+
"indexCategory",
|
|
23
|
+
];
|
|
17
24
|
for (const method of grpcMethods) {
|
|
18
25
|
const descriptor = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
|
|
19
26
|
(0, microservices_1.GrpcMethod)("SearchService", method)(constructor.prototype[method], method, descriptor);
|
package/package.json
CHANGED
|
@@ -7,8 +7,25 @@ service SearchService {
|
|
|
7
7
|
rpc IndexProduct (IndexProductRequest) returns (IndexProductResponse);
|
|
8
8
|
rpc IndexProducts (IndexProductsRequest) returns (IndexProductsResponse);
|
|
9
9
|
rpc DeleteProduct (DeleteProductRequest) returns (DeleteProductResponse);
|
|
10
|
+
|
|
11
|
+
rpc GetCategories (GetCategoriesRequest) returns (GetCategoriesResponse);
|
|
12
|
+
rpc IndexCategory (IndexCategoryRequest) returns (IndexCategoryResponse);
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
message IndexCategoryRequest {
|
|
16
|
+
Category category = 1;
|
|
10
17
|
}
|
|
11
18
|
|
|
19
|
+
message IndexCategoryResponse {
|
|
20
|
+
bool ok = 1;
|
|
21
|
+
}
|
|
22
|
+
message GetCategoriesRequest {
|
|
23
|
+
optional string limit = 1;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
message GetCategoriesResponse {
|
|
27
|
+
repeated Category categories = 1;
|
|
28
|
+
}
|
|
12
29
|
|
|
13
30
|
message SearchProductsRequest {
|
|
14
31
|
string query = 1;
|
|
@@ -63,4 +80,10 @@ message Product {
|
|
|
63
80
|
int32 review_count = 8;
|
|
64
81
|
float rating = 9;
|
|
65
82
|
string status = 10;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
message Category {
|
|
86
|
+
string id = 1;
|
|
87
|
+
string categoryName = 2;
|
|
88
|
+
string slug = 3;
|
|
66
89
|
}
|