@platfformx/proto-contracts 1.4.15 → 1.4.17

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.
@@ -19,6 +19,7 @@ export interface GetProductsRequest {
19
19
  }
20
20
  export interface GetProductsResponse {
21
21
  products: ProductResponse[];
22
+ totalCount: number;
22
23
  }
23
24
  export interface GetProductsByIdsRequest {
24
25
  productsIds: string[];
@@ -48,6 +49,7 @@ export interface GetProductsByCategoryRequest {
48
49
  }
49
50
  export interface GetProductsByCategoryResponse {
50
51
  products: ProductResponse[];
52
+ totalCount: number;
51
53
  }
52
54
  export interface ProductResponse {
53
55
  id: string;
@@ -0,0 +1,56 @@
1
+ import { Observable } from "rxjs";
2
+ export declare const protobufPackage = "review.v1";
3
+ export interface CreateReviewRequest {
4
+ userId: string;
5
+ productId: string;
6
+ rating: number;
7
+ comment?: string | undefined;
8
+ }
9
+ export interface CreateReviewResponse {
10
+ ok: boolean;
11
+ }
12
+ export interface DeleteReviewRequest {
13
+ reviewId: string;
14
+ userId: string;
15
+ }
16
+ export interface DeleteReviewResponse {
17
+ ok: boolean;
18
+ }
19
+ export interface GetUserReviewsRequest {
20
+ userId: string;
21
+ }
22
+ export interface GetUserReviewsResponse {
23
+ reviews: Review[];
24
+ }
25
+ export interface GetProductReviewRequest {
26
+ productId: string;
27
+ page: number;
28
+ limit: number;
29
+ }
30
+ export interface GetProductReviewResponse {
31
+ reviews: Review[];
32
+ totalCount: number;
33
+ }
34
+ export interface Review {
35
+ userId: string;
36
+ reviewId: string;
37
+ productId: string;
38
+ comment?: string | undefined;
39
+ rating: number;
40
+ createdAt: string;
41
+ }
42
+ export declare const REVIEW_V1_PACKAGE_NAME = "review.v1";
43
+ export interface ReviewServiceClient {
44
+ createReview(request: CreateReviewRequest): Observable<CreateReviewResponse>;
45
+ deleteReview(request: DeleteReviewRequest): Observable<DeleteReviewResponse>;
46
+ getUserReviews(request: GetUserReviewsRequest): Observable<GetUserReviewsResponse>;
47
+ getProductReview(request: GetProductReviewRequest): Observable<GetProductReviewResponse>;
48
+ }
49
+ export interface ReviewServiceController {
50
+ createReview(request: CreateReviewRequest): Promise<CreateReviewResponse> | Observable<CreateReviewResponse> | CreateReviewResponse;
51
+ deleteReview(request: DeleteReviewRequest): Promise<DeleteReviewResponse> | Observable<DeleteReviewResponse> | DeleteReviewResponse;
52
+ getUserReviews(request: GetUserReviewsRequest): Promise<GetUserReviewsResponse> | Observable<GetUserReviewsResponse> | GetUserReviewsResponse;
53
+ getProductReview(request: GetProductReviewRequest): Promise<GetProductReviewResponse> | Observable<GetProductReviewResponse> | GetProductReviewResponse;
54
+ }
55
+ export declare function ReviewServiceControllerMethods(): (constructor: Function) => void;
56
+ export declare const REVIEW_SERVICE_NAME = "ReviewService";
@@ -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: review-service/review.proto
7
+ Object.defineProperty(exports, "__esModule", { value: true });
8
+ exports.REVIEW_SERVICE_NAME = exports.REVIEW_V1_PACKAGE_NAME = exports.protobufPackage = void 0;
9
+ exports.ReviewServiceControllerMethods = ReviewServiceControllerMethods;
10
+ /* eslint-disable */
11
+ const microservices_1 = require("@nestjs/microservices");
12
+ exports.protobufPackage = "review.v1";
13
+ exports.REVIEW_V1_PACKAGE_NAME = "review.v1";
14
+ function ReviewServiceControllerMethods() {
15
+ return function (constructor) {
16
+ const grpcMethods = ["createReview", "deleteReview", "getUserReviews", "getProductReview"];
17
+ for (const method of grpcMethods) {
18
+ const descriptor = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
19
+ (0, microservices_1.GrpcMethod)("ReviewService", 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)("ReviewService", method)(constructor.prototype[method], method, descriptor);
25
+ }
26
+ };
27
+ }
28
+ exports.REVIEW_SERVICE_NAME = "ReviewService";
package/dist/index.d.ts CHANGED
@@ -12,4 +12,5 @@ export * as Payment from './gen/ts/payment-service/payment';
12
12
  export * as Refund from './gen/ts/payment-service/refund';
13
13
  export * as Order from './gen/ts/order-service/order';
14
14
  export * as AI from './gen/ts/ai-service/ai';
15
+ export * as Review from './gen/ts/review-service/review';
15
16
  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.AI = exports.Order = exports.Refund = exports.Payment = exports.Search = exports.Category = exports.Bulk = exports.Product = exports.Account = exports.S3 = exports.Auth = exports.OAuthProvider = void 0;
39
+ exports.BulkStatus = exports.Review = exports.AI = exports.Order = exports.Refund = exports.Payment = 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");
@@ -52,5 +52,6 @@ exports.Payment = __importStar(require("./gen/ts/payment-service/payment"));
52
52
  exports.Refund = __importStar(require("./gen/ts/payment-service/refund"));
53
53
  exports.Order = __importStar(require("./gen/ts/order-service/order"));
54
54
  exports.AI = __importStar(require("./gen/ts/ai-service/ai"));
55
+ exports.Review = __importStar(require("./gen/ts/review-service/review"));
55
56
  var bulk_1 = require("./gen/ts/products-service/bulk");
56
57
  Object.defineProperty(exports, "BulkStatus", { enumerable: true, get: function () { return bulk_1.BulkStatus; } });
@@ -10,4 +10,5 @@ export declare const PROTO_PATHS: {
10
10
  readonly REFUND: string;
11
11
  readonly ORDER: string;
12
12
  readonly AI: string;
13
+ readonly REVIEW: string;
13
14
  };
@@ -14,4 +14,5 @@ exports.PROTO_PATHS = {
14
14
  REFUND: (0, path_1.join)(__dirname, '../../proto/payment-service/refund.proto'),
15
15
  ORDER: (0, path_1.join)(__dirname, '../../proto/order-service/order.proto'),
16
16
  AI: (0, path_1.join)(__dirname, '../../proto/ai-service/ai.proto'),
17
+ REVIEW: (0, path_1.join)(__dirname, '../../proto/review-service/review.proto'),
17
18
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@platfformx/proto-contracts",
3
- "version": "1.4.15",
3
+ "version": "1.4.17",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -38,6 +38,7 @@ message GetProductsRequest {
38
38
 
39
39
  message GetProductsResponse {
40
40
  repeated ProductResponse products = 1;
41
+ int64 total_count = 2;
41
42
  }
42
43
 
43
44
  message GetProductsByIdsRequest {
@@ -73,6 +74,7 @@ message GetProductsByCategoryRequest {
73
74
  }
74
75
  message GetProductsByCategoryResponse {
75
76
  repeated ProductResponse products = 1;
77
+ int64 total_count = 2;
76
78
  }
77
79
 
78
80
  message ProductResponse{
@@ -0,0 +1,55 @@
1
+ syntax = "proto3";
2
+
3
+ package review.v1;
4
+
5
+ service ReviewService {
6
+ rpc CreateReview (CreateReviewRequest) returns (CreateReviewResponse);
7
+ rpc DeleteReview (DeleteReviewRequest) returns (DeleteReviewResponse);
8
+
9
+ rpc GetUserReviews (GetUserReviewsRequest) returns (GetUserReviewsResponse);
10
+ rpc GetProductReview (GetProductReviewRequest) returns (GetProductReviewResponse);
11
+
12
+ }
13
+
14
+ message CreateReviewRequest {
15
+ string user_id = 1;
16
+ string product_id = 2;
17
+ int32 rating = 3;
18
+ optional string comment = 4;
19
+
20
+ }
21
+ message CreateReviewResponse {
22
+ bool ok = 1;
23
+ }
24
+ message DeleteReviewRequest {
25
+ string review_id = 1;
26
+ string user_id = 2;
27
+ }
28
+ message DeleteReviewResponse {
29
+ bool ok = 1;
30
+ }
31
+
32
+ message GetUserReviewsRequest {
33
+ string user_id = 1;
34
+ }
35
+ message GetUserReviewsResponse {
36
+ repeated Review reviews = 1;
37
+ }
38
+ message GetProductReviewRequest {
39
+ string product_id = 1;
40
+ int32 page = 2;
41
+ int32 limit = 3;
42
+ }
43
+ message GetProductReviewResponse {
44
+ repeated Review reviews = 1;
45
+ int64 total_count = 2;
46
+ }
47
+
48
+ message Review {
49
+ string user_id = 1;
50
+ string review_id = 2;
51
+ string product_id = 3;
52
+ optional string comment = 4;
53
+ int32 rating = 5;
54
+ string created_at = 6;
55
+ }