@platfformx/proto-contracts 1.2.23 → 1.2.25
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/ts/products-service/category.d.ts +0 -1
- package/dist/gen/ts/search-service/search.d.ts +50 -0
- package/dist/gen/ts/search-service/search.js +28 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +2 -1
- package/dist/paths/proto-paths.d.ts +1 -0
- package/dist/paths/proto-paths.js +1 -0
- package/package.json +1 -1
- package/proto/products-service/category.proto +1 -2
- package/proto/products-service/product.proto +1 -0
- package/proto/search-service/search.proto +51 -0
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { Observable } from "rxjs";
|
|
2
|
+
export declare const protobufPackage = "search.v1";
|
|
3
|
+
export interface SearchProductsRequest {
|
|
4
|
+
query: string;
|
|
5
|
+
limit: number;
|
|
6
|
+
page: number;
|
|
7
|
+
}
|
|
8
|
+
export interface SearchProductsResponse {
|
|
9
|
+
hits: Product[];
|
|
10
|
+
totalHits: string;
|
|
11
|
+
totalPages: string;
|
|
12
|
+
currentPage: string;
|
|
13
|
+
}
|
|
14
|
+
export interface IndexProductRequest {
|
|
15
|
+
products: Product[];
|
|
16
|
+
}
|
|
17
|
+
export interface IndexProductResponse {
|
|
18
|
+
ok: boolean;
|
|
19
|
+
}
|
|
20
|
+
export interface DeleteProductRequest {
|
|
21
|
+
productId: string;
|
|
22
|
+
}
|
|
23
|
+
export interface DeleteProductResponse {
|
|
24
|
+
ok: boolean;
|
|
25
|
+
}
|
|
26
|
+
export interface Product {
|
|
27
|
+
id: string;
|
|
28
|
+
slug: string;
|
|
29
|
+
title: string;
|
|
30
|
+
description?: string | undefined;
|
|
31
|
+
categoryId: string;
|
|
32
|
+
price: string;
|
|
33
|
+
images: string[];
|
|
34
|
+
reviewCount: number;
|
|
35
|
+
rating: number;
|
|
36
|
+
status: string;
|
|
37
|
+
}
|
|
38
|
+
export declare const SEARCH_V1_PACKAGE_NAME = "search.v1";
|
|
39
|
+
export interface SearchServiceClient {
|
|
40
|
+
searchProducts(request: SearchProductsRequest): Observable<SearchProductsResponse>;
|
|
41
|
+
indexProduct(request: IndexProductRequest): Observable<IndexProductResponse>;
|
|
42
|
+
deleteProduct(request: DeleteProductRequest): Observable<DeleteProductResponse>;
|
|
43
|
+
}
|
|
44
|
+
export interface SearchServiceController {
|
|
45
|
+
searchProducts(request: SearchProductsRequest): Promise<SearchProductsResponse> | Observable<SearchProductsResponse> | SearchProductsResponse;
|
|
46
|
+
indexProduct(request: IndexProductRequest): Promise<IndexProductResponse> | Observable<IndexProductResponse> | IndexProductResponse;
|
|
47
|
+
deleteProduct(request: DeleteProductRequest): Promise<DeleteProductResponse> | Observable<DeleteProductResponse> | DeleteProductResponse;
|
|
48
|
+
}
|
|
49
|
+
export declare function SearchServiceControllerMethods(): (constructor: Function) => void;
|
|
50
|
+
export declare const SEARCH_SERVICE_NAME = "SearchService";
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
|
|
3
|
+
// versions:
|
|
4
|
+
// protoc-gen-ts_proto v2.11.8
|
|
5
|
+
// protoc v7.34.0
|
|
6
|
+
// source: search-service/search.proto
|
|
7
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
|
+
exports.SEARCH_SERVICE_NAME = exports.SEARCH_V1_PACKAGE_NAME = exports.protobufPackage = void 0;
|
|
9
|
+
exports.SearchServiceControllerMethods = SearchServiceControllerMethods;
|
|
10
|
+
/* eslint-disable */
|
|
11
|
+
const microservices_1 = require("@nestjs/microservices");
|
|
12
|
+
exports.protobufPackage = "search.v1";
|
|
13
|
+
exports.SEARCH_V1_PACKAGE_NAME = "search.v1";
|
|
14
|
+
function SearchServiceControllerMethods() {
|
|
15
|
+
return function (constructor) {
|
|
16
|
+
const grpcMethods = ["searchProducts", "indexProduct", "deleteProduct"];
|
|
17
|
+
for (const method of grpcMethods) {
|
|
18
|
+
const descriptor = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
|
|
19
|
+
(0, microservices_1.GrpcMethod)("SearchService", method)(constructor.prototype[method], method, descriptor);
|
|
20
|
+
}
|
|
21
|
+
const grpcStreamMethods = [];
|
|
22
|
+
for (const method of grpcStreamMethods) {
|
|
23
|
+
const descriptor = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
|
|
24
|
+
(0, microservices_1.GrpcStreamMethod)("SearchService", method)(constructor.prototype[method], method, descriptor);
|
|
25
|
+
}
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
exports.SEARCH_SERVICE_NAME = "SearchService";
|
package/dist/index.d.ts
CHANGED
|
@@ -7,4 +7,5 @@ export * as Account from './gen/ts/users-service/account';
|
|
|
7
7
|
export * as Product from './gen/ts/products-service/product';
|
|
8
8
|
export * as Bulk from './gen/ts/products-service/bulk';
|
|
9
9
|
export * as Category from './gen/ts/products-service/category';
|
|
10
|
+
export * as Search from './gen/ts/search-service/search';
|
|
10
11
|
export { BulkStatus } from './gen/ts/products-service/bulk';
|
package/dist/index.js
CHANGED
|
@@ -36,7 +36,7 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
36
36
|
};
|
|
37
37
|
})();
|
|
38
38
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
-
exports.BulkStatus = exports.Category = exports.Bulk = exports.Product = exports.Account = exports.S3 = exports.Auth = exports.OAuthProvider = void 0;
|
|
39
|
+
exports.BulkStatus = exports.Search = exports.Category = exports.Bulk = exports.Product = exports.Account = exports.S3 = exports.Auth = exports.OAuthProvider = void 0;
|
|
40
40
|
__exportStar(require("./paths/index"), exports);
|
|
41
41
|
__exportStar(require("./paths/proto-paths"), exports);
|
|
42
42
|
var auth_1 = require("./gen/ts/auth-service/auth");
|
|
@@ -47,5 +47,6 @@ exports.Account = __importStar(require("./gen/ts/users-service/account"));
|
|
|
47
47
|
exports.Product = __importStar(require("./gen/ts/products-service/product"));
|
|
48
48
|
exports.Bulk = __importStar(require("./gen/ts/products-service/bulk"));
|
|
49
49
|
exports.Category = __importStar(require("./gen/ts/products-service/category"));
|
|
50
|
+
exports.Search = __importStar(require("./gen/ts/search-service/search"));
|
|
50
51
|
var bulk_1 = require("./gen/ts/products-service/bulk");
|
|
51
52
|
Object.defineProperty(exports, "BulkStatus", { enumerable: true, get: function () { return bulk_1.BulkStatus; } });
|
|
@@ -9,4 +9,5 @@ exports.PROTO_PATHS = {
|
|
|
9
9
|
CATEGORY: (0, path_1.join)(__dirname, '../../proto/products-service/category.proto'),
|
|
10
10
|
BULK: (0, path_1.join)(__dirname, '../../proto/products-service/bulk.proto'),
|
|
11
11
|
S3: (0, path_1.join)(__dirname, '../../proto/s3-service/s3.proto'),
|
|
12
|
+
SEARCH: (0, path_1.join)(__dirname, '../../proto/search-service/search.proto'),
|
|
12
13
|
};
|
package/package.json
CHANGED
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
syntax = "proto3";
|
|
2
|
+
|
|
3
|
+
package search.v1;
|
|
4
|
+
|
|
5
|
+
service SearchService {
|
|
6
|
+
rpc SearchProducts (SearchProductsRequest) returns (SearchProductsResponse);
|
|
7
|
+
rpc IndexProduct (IndexProductRequest) returns (IndexProductResponse);
|
|
8
|
+
rpc DeleteProduct (DeleteProductRequest) returns (DeleteProductResponse);
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
message SearchProductsRequest {
|
|
13
|
+
string query = 1;
|
|
14
|
+
int32 limit = 2;
|
|
15
|
+
int32 page = 3;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
message SearchProductsResponse {
|
|
19
|
+
repeated Product hits = 1;
|
|
20
|
+
string total_hits = 2;
|
|
21
|
+
string total_pages = 3;
|
|
22
|
+
string current_page = 4;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
message IndexProductRequest {
|
|
26
|
+
repeated Product products = 1;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
message IndexProductResponse {
|
|
30
|
+
bool ok = 1;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
message DeleteProductRequest {
|
|
34
|
+
string product_id = 1;
|
|
35
|
+
}
|
|
36
|
+
message DeleteProductResponse {
|
|
37
|
+
bool ok = 1;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
message Product {
|
|
41
|
+
string id = 1;
|
|
42
|
+
string slug = 2;
|
|
43
|
+
string title = 3;
|
|
44
|
+
optional string description = 4;
|
|
45
|
+
string category_id = 5;
|
|
46
|
+
string price = 6;
|
|
47
|
+
repeated string images = 7;
|
|
48
|
+
int32 review_count = 8;
|
|
49
|
+
float rating = 9;
|
|
50
|
+
string status = 10;
|
|
51
|
+
}
|