@platfformx/proto-contracts 1.2.17 → 1.2.19

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.
@@ -0,0 +1,109 @@
1
+ export declare const protobufPackage = "google.protobuf";
2
+ /**
3
+ * A Timestamp represents a point in time independent of any time zone or local
4
+ * calendar, encoded as a count of seconds and fractions of seconds at
5
+ * nanosecond resolution. The count is relative to an epoch at UTC midnight on
6
+ * January 1, 1970, in the proleptic Gregorian calendar which extends the
7
+ * Gregorian calendar backwards to year one.
8
+ *
9
+ * All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap
10
+ * second table is needed for interpretation, using a [24-hour linear
11
+ * smear](https://developers.google.com/time/smear).
12
+ *
13
+ * The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By
14
+ * restricting to that range, we ensure that we can convert to and from [RFC
15
+ * 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings.
16
+ *
17
+ * # Examples
18
+ *
19
+ * Example 1: Compute Timestamp from POSIX `time()`.
20
+ *
21
+ * Timestamp timestamp;
22
+ * timestamp.set_seconds(time(NULL));
23
+ * timestamp.set_nanos(0);
24
+ *
25
+ * Example 2: Compute Timestamp from POSIX `gettimeofday()`.
26
+ *
27
+ * struct timeval tv;
28
+ * gettimeofday(&tv, NULL);
29
+ *
30
+ * Timestamp timestamp;
31
+ * timestamp.set_seconds(tv.tv_sec);
32
+ * timestamp.set_nanos(tv.tv_usec * 1000);
33
+ *
34
+ * Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`.
35
+ *
36
+ * FILETIME ft;
37
+ * GetSystemTimeAsFileTime(&ft);
38
+ * UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime;
39
+ *
40
+ * // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z
41
+ * // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z.
42
+ * Timestamp timestamp;
43
+ * timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL));
44
+ * timestamp.set_nanos((INT32) ((ticks % 10000000) * 100));
45
+ *
46
+ * Example 4: Compute Timestamp from Java `System.currentTimeMillis()`.
47
+ *
48
+ * long millis = System.currentTimeMillis();
49
+ *
50
+ * Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000)
51
+ * .setNanos((int) ((millis % 1000) * 1000000)).build();
52
+ *
53
+ * Example 5: Compute Timestamp from Java `Instant.now()`.
54
+ *
55
+ * Instant now = Instant.now();
56
+ *
57
+ * Timestamp timestamp =
58
+ * Timestamp.newBuilder().setSeconds(now.getEpochSecond())
59
+ * .setNanos(now.getNano()).build();
60
+ *
61
+ * Example 6: Compute Timestamp from current time in Python.
62
+ *
63
+ * timestamp = Timestamp()
64
+ * timestamp.GetCurrentTime()
65
+ *
66
+ * # JSON Mapping
67
+ *
68
+ * In JSON format, the Timestamp type is encoded as a string in the
69
+ * [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the
70
+ * format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z"
71
+ * where {year} is always expressed using four digits while {month}, {day},
72
+ * {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional
73
+ * seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution),
74
+ * are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone
75
+ * is required. A ProtoJSON serializer should always use UTC (as indicated by
76
+ * "Z") when printing the Timestamp type and a ProtoJSON parser should be
77
+ * able to accept both UTC and other timezones (as indicated by an offset).
78
+ *
79
+ * For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past
80
+ * 01:30 UTC on January 15, 2017.
81
+ *
82
+ * In JavaScript, one can convert a Date object to this format using the
83
+ * standard
84
+ * [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString)
85
+ * method. In Python, a standard `datetime.datetime` object can be converted
86
+ * to this format using
87
+ * [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with
88
+ * the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use
89
+ * the Joda Time's [`ISODateTimeFormat.dateTime()`](
90
+ * http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime()
91
+ * ) to obtain a formatter capable of generating timestamps in this format.
92
+ */
93
+ export interface Timestamp {
94
+ /**
95
+ * Represents seconds of UTC time since Unix epoch 1970-01-01T00:00:00Z. Must
96
+ * be between -62135596800 and 253402300799 inclusive (which corresponds to
97
+ * 0001-01-01T00:00:00Z to 9999-12-31T23:59:59Z).
98
+ */
99
+ seconds: number;
100
+ /**
101
+ * Non-negative fractions of a second at nanosecond resolution. This field is
102
+ * the nanosecond portion of the duration, not an alternative to seconds.
103
+ * Negative second values with fractions must still have non-negative nanos
104
+ * values that count forward in time. Must be between 0 and 999,999,999
105
+ * inclusive.
106
+ */
107
+ nanos: number;
108
+ }
109
+ export declare const GOOGLE_PROTOBUF_PACKAGE_NAME = "google.protobuf";
@@ -0,0 +1,11 @@
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: google/protobuf/timestamp.proto
7
+ Object.defineProperty(exports, "__esModule", { value: true });
8
+ exports.GOOGLE_PROTOBUF_PACKAGE_NAME = exports.protobufPackage = void 0;
9
+ /* eslint-disable */
10
+ exports.protobufPackage = "google.protobuf";
11
+ exports.GOOGLE_PROTOBUF_PACKAGE_NAME = "google.protobuf";
@@ -0,0 +1,27 @@
1
+ import { Observable } from "rxjs";
2
+ export declare const protobufPackage = "bulk.v1";
3
+ export declare enum BulkStatus {
4
+ UNSPECIFIED = 0,
5
+ PENDING = 1,
6
+ PROCESSING = 2,
7
+ COMPLETED = 3,
8
+ FAILED = 4,
9
+ UNRECOGNIZED = -1
10
+ }
11
+ export interface StartImportRequest {
12
+ fileUrl: string;
13
+ syncCatalog: boolean;
14
+ }
15
+ export interface StartImportResponse {
16
+ importId: string;
17
+ status: BulkStatus;
18
+ }
19
+ export declare const BULK_V1_PACKAGE_NAME = "bulk.v1";
20
+ export interface BulkServiceClient {
21
+ startImport(request: StartImportRequest): Observable<StartImportResponse>;
22
+ }
23
+ export interface BulkServiceController {
24
+ startImport(request: StartImportRequest): Promise<StartImportResponse> | Observable<StartImportResponse> | StartImportResponse;
25
+ }
26
+ export declare function BulkServiceControllerMethods(): (constructor: Function) => void;
27
+ export declare const BULK_SERVICE_NAME = "BulkService";
@@ -0,0 +1,37 @@
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: products-service/bulk.proto
7
+ Object.defineProperty(exports, "__esModule", { value: true });
8
+ exports.BULK_SERVICE_NAME = exports.BULK_V1_PACKAGE_NAME = exports.BulkStatus = exports.protobufPackage = void 0;
9
+ exports.BulkServiceControllerMethods = BulkServiceControllerMethods;
10
+ /* eslint-disable */
11
+ const microservices_1 = require("@nestjs/microservices");
12
+ exports.protobufPackage = "bulk.v1";
13
+ var BulkStatus;
14
+ (function (BulkStatus) {
15
+ BulkStatus[BulkStatus["UNSPECIFIED"] = 0] = "UNSPECIFIED";
16
+ BulkStatus[BulkStatus["PENDING"] = 1] = "PENDING";
17
+ BulkStatus[BulkStatus["PROCESSING"] = 2] = "PROCESSING";
18
+ BulkStatus[BulkStatus["COMPLETED"] = 3] = "COMPLETED";
19
+ BulkStatus[BulkStatus["FAILED"] = 4] = "FAILED";
20
+ BulkStatus[BulkStatus["UNRECOGNIZED"] = -1] = "UNRECOGNIZED";
21
+ })(BulkStatus || (exports.BulkStatus = BulkStatus = {}));
22
+ exports.BULK_V1_PACKAGE_NAME = "bulk.v1";
23
+ function BulkServiceControllerMethods() {
24
+ return function (constructor) {
25
+ const grpcMethods = ["startImport"];
26
+ for (const method of grpcMethods) {
27
+ const descriptor = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
28
+ (0, microservices_1.GrpcMethod)("BulkService", method)(constructor.prototype[method], method, descriptor);
29
+ }
30
+ const grpcStreamMethods = [];
31
+ for (const method of grpcStreamMethods) {
32
+ const descriptor = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
33
+ (0, microservices_1.GrpcStreamMethod)("BulkService", method)(constructor.prototype[method], method, descriptor);
34
+ }
35
+ };
36
+ }
37
+ exports.BULK_SERVICE_NAME = "BulkService";
@@ -0,0 +1,64 @@
1
+ import { Observable } from "rxjs";
2
+ export declare const protobufPackage = "categories.v1";
3
+ export interface CategoryResponse {
4
+ id: string;
5
+ title: string;
6
+ slug: string;
7
+ }
8
+ export interface CreateCategoryRequest {
9
+ title: string;
10
+ slug: string;
11
+ }
12
+ export interface CreateCategoryResponse {
13
+ category: CategoryResponse | undefined;
14
+ }
15
+ export interface UpdateCategoryRequest {
16
+ categoryId: string;
17
+ title?: string | undefined;
18
+ slug?: string | undefined;
19
+ }
20
+ export interface UpdateCategoryResponse {
21
+ category: CategoryResponse | undefined;
22
+ }
23
+ export interface DeleteCategoryRequest {
24
+ categoryId: string;
25
+ }
26
+ export interface DeleteCategoryResponse {
27
+ ok: boolean;
28
+ }
29
+ export interface GetCategoryRequest {
30
+ productId?: string | undefined;
31
+ slug?: string | undefined;
32
+ }
33
+ export interface GetCategoryResponse {
34
+ category: CategoryResponse | undefined;
35
+ }
36
+ export interface CreateCategoriesRequest {
37
+ categories: CreateCategoryRequest[];
38
+ }
39
+ export interface CreateCategoriesResponse {
40
+ }
41
+ export interface GetCategoriesRequest {
42
+ }
43
+ export interface GetCategoriesResponse {
44
+ categories: CategoryResponse[];
45
+ }
46
+ export declare const CATEGORIES_V1_PACKAGE_NAME = "categories.v1";
47
+ export interface CategoriesServiceClient {
48
+ createCategory(request: CreateCategoryRequest): Observable<CreateCategoryResponse>;
49
+ updateCategory(request: UpdateCategoryRequest): Observable<UpdateCategoryResponse>;
50
+ deleteCategory(request: DeleteCategoryRequest): Observable<DeleteCategoryResponse>;
51
+ getCategory(request: GetCategoryRequest): Observable<GetCategoryResponse>;
52
+ createCategories(request: CreateCategoriesRequest): Observable<CreateCategoriesResponse>;
53
+ getCategories(request: GetCategoriesRequest): Observable<GetCategoriesResponse>;
54
+ }
55
+ export interface CategoriesServiceController {
56
+ createCategory(request: CreateCategoryRequest): Promise<CreateCategoryResponse> | Observable<CreateCategoryResponse> | CreateCategoryResponse;
57
+ updateCategory(request: UpdateCategoryRequest): Promise<UpdateCategoryResponse> | Observable<UpdateCategoryResponse> | UpdateCategoryResponse;
58
+ deleteCategory(request: DeleteCategoryRequest): Promise<DeleteCategoryResponse> | Observable<DeleteCategoryResponse> | DeleteCategoryResponse;
59
+ getCategory(request: GetCategoryRequest): Promise<GetCategoryResponse> | Observable<GetCategoryResponse> | GetCategoryResponse;
60
+ createCategories(request: CreateCategoriesRequest): Promise<CreateCategoriesResponse> | Observable<CreateCategoriesResponse> | CreateCategoriesResponse;
61
+ getCategories(request: GetCategoriesRequest): Promise<GetCategoriesResponse> | Observable<GetCategoriesResponse> | GetCategoriesResponse;
62
+ }
63
+ export declare function CategoriesServiceControllerMethods(): (constructor: Function) => void;
64
+ export declare const CATEGORIES_SERVICE_NAME = "CategoriesService";
@@ -0,0 +1,35 @@
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: products-service/categories.proto
7
+ Object.defineProperty(exports, "__esModule", { value: true });
8
+ exports.CATEGORIES_SERVICE_NAME = exports.CATEGORIES_V1_PACKAGE_NAME = exports.protobufPackage = void 0;
9
+ exports.CategoriesServiceControllerMethods = CategoriesServiceControllerMethods;
10
+ /* eslint-disable */
11
+ const microservices_1 = require("@nestjs/microservices");
12
+ exports.protobufPackage = "categories.v1";
13
+ exports.CATEGORIES_V1_PACKAGE_NAME = "categories.v1";
14
+ function CategoriesServiceControllerMethods() {
15
+ return function (constructor) {
16
+ const grpcMethods = [
17
+ "createCategory",
18
+ "updateCategory",
19
+ "deleteCategory",
20
+ "getCategory",
21
+ "createCategories",
22
+ "getCategories",
23
+ ];
24
+ for (const method of grpcMethods) {
25
+ const descriptor = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
26
+ (0, microservices_1.GrpcMethod)("CategoriesService", method)(constructor.prototype[method], method, descriptor);
27
+ }
28
+ const grpcStreamMethods = [];
29
+ for (const method of grpcStreamMethods) {
30
+ const descriptor = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
31
+ (0, microservices_1.GrpcStreamMethod)("CategoriesService", method)(constructor.prototype[method], method, descriptor);
32
+ }
33
+ };
34
+ }
35
+ exports.CATEGORIES_SERVICE_NAME = "CategoriesService";
@@ -34,6 +34,14 @@ export interface DeleteProductRequest {
34
34
  export interface DeleteProductResponse {
35
35
  success: boolean;
36
36
  }
37
+ export interface GetProductsByCategoryRequest {
38
+ categoryId: string;
39
+ page: number;
40
+ limit: number;
41
+ }
42
+ export interface GetProductsByCategoryResponse {
43
+ products: ProductResponse[];
44
+ }
37
45
  export interface ProductResponse {
38
46
  id: string;
39
47
  slug: string;
@@ -55,6 +63,7 @@ export interface ProductServiceClient {
55
63
  deleteProduct(request: DeleteProductRequest): Observable<DeleteProductResponse>;
56
64
  getProduct(request: GetProductRequest): Observable<ProductResponse>;
57
65
  getProducts(request: GetProductsRequest): Observable<GetProductsResponse>;
66
+ getProductsByCategory(request: GetProductsByCategoryRequest): Observable<GetProductsByCategoryResponse>;
58
67
  }
59
68
  export interface ProductServiceController {
60
69
  createProduct(request: CreateProductRequest): Promise<ProductResponse> | Observable<ProductResponse> | ProductResponse;
@@ -62,6 +71,7 @@ export interface ProductServiceController {
62
71
  deleteProduct(request: DeleteProductRequest): Promise<DeleteProductResponse> | Observable<DeleteProductResponse> | DeleteProductResponse;
63
72
  getProduct(request: GetProductRequest): Promise<ProductResponse> | Observable<ProductResponse> | ProductResponse;
64
73
  getProducts(request: GetProductsRequest): Promise<GetProductsResponse> | Observable<GetProductsResponse> | GetProductsResponse;
74
+ getProductsByCategory(request: GetProductsByCategoryRequest): Promise<GetProductsByCategoryResponse> | Observable<GetProductsByCategoryResponse> | GetProductsByCategoryResponse;
65
75
  }
66
76
  export declare function ProductServiceControllerMethods(): (constructor: Function) => void;
67
77
  export declare const PRODUCT_SERVICE_NAME = "ProductService";
@@ -13,7 +13,14 @@ exports.protobufPackage = "product.v1";
13
13
  exports.PRODUCT_V1_PACKAGE_NAME = "product.v1";
14
14
  function ProductServiceControllerMethods() {
15
15
  return function (constructor) {
16
- const grpcMethods = ["createProduct", "updateProduct", "deleteProduct", "getProduct", "getProducts"];
16
+ const grpcMethods = [
17
+ "createProduct",
18
+ "updateProduct",
19
+ "deleteProduct",
20
+ "getProduct",
21
+ "getProducts",
22
+ "getProductsByCategory",
23
+ ];
17
24
  for (const method of grpcMethods) {
18
25
  const descriptor = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
19
26
  (0, microservices_1.GrpcMethod)("ProductService", method)(constructor.prototype[method], method, descriptor);
package/dist/index.d.ts CHANGED
@@ -5,3 +5,6 @@ export * as Auth from './gen/ts/auth-service/auth';
5
5
  export * as S3 from './gen/ts/s3-service/s3';
6
6
  export * as Account from './gen/ts/users-service/account';
7
7
  export * as Product from './gen/ts/products-service/product';
8
+ export * as Bulk from './gen/ts/products-service/bulk';
9
+ export * as Category from './gen/ts/products-service/categories';
10
+ 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.Product = exports.Account = exports.S3 = exports.Auth = exports.OAuthProvider = void 0;
39
+ exports.BulkStatus = 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");
@@ -45,3 +45,7 @@ exports.Auth = __importStar(require("./gen/ts/auth-service/auth"));
45
45
  exports.S3 = __importStar(require("./gen/ts/s3-service/s3"));
46
46
  exports.Account = __importStar(require("./gen/ts/users-service/account"));
47
47
  exports.Product = __importStar(require("./gen/ts/products-service/product"));
48
+ exports.Bulk = __importStar(require("./gen/ts/products-service/bulk"));
49
+ exports.Category = __importStar(require("./gen/ts/products-service/categories"));
50
+ var bulk_1 = require("./gen/ts/products-service/bulk");
51
+ Object.defineProperty(exports, "BulkStatus", { enumerable: true, get: function () { return bulk_1.BulkStatus; } });
@@ -2,5 +2,7 @@ export declare const PROTO_PATHS: {
2
2
  readonly ACCOUNT: string;
3
3
  readonly AUTH: string;
4
4
  readonly PRODUCT: string;
5
+ readonly CATEGORY: string;
6
+ readonly BULK: string;
5
7
  readonly S3: string;
6
8
  };
@@ -6,5 +6,7 @@ exports.PROTO_PATHS = {
6
6
  ACCOUNT: (0, path_1.join)(__dirname, '../../proto/users-service/account.proto'),
7
7
  AUTH: (0, path_1.join)(__dirname, '../../proto/auth-service/auth.proto'),
8
8
  PRODUCT: (0, path_1.join)(__dirname, '../../proto/products-service/product.proto'),
9
+ CATEGORY: (0, path_1.join)(__dirname, '../../proto/products-service/categories.proto'),
10
+ BULK: (0, path_1.join)(__dirname, '../../proto/products-service/bulk.proto'),
9
11
  S3: (0, path_1.join)(__dirname, '../../proto/s3-service/s3.proto'),
10
12
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@platfformx/proto-contracts",
3
- "version": "1.2.17",
3
+ "version": "1.2.19",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -0,0 +1,25 @@
1
+ syntax = "proto3";
2
+
3
+ package bulk.v1;
4
+
5
+ service BulkService {
6
+ rpc StartImport (StartImportRequest) returns (StartImportResponse);
7
+ }
8
+
9
+
10
+ message StartImportRequest {
11
+ string file_url = 1;
12
+ bool sync_catalog = 2;
13
+ }
14
+ message StartImportResponse {
15
+ string import_id = 1;
16
+ BulkStatus status = 2;
17
+ }
18
+
19
+ enum BulkStatus {
20
+ UNSPECIFIED = 0;
21
+ PENDING = 1;
22
+ PROCESSING = 2;
23
+ COMPLETED = 3;
24
+ FAILED = 4;
25
+ }
@@ -0,0 +1,69 @@
1
+ syntax = "proto3";
2
+
3
+ package categories.v1;
4
+
5
+ service CategoriesService {
6
+ rpc CreateCategory (CreateCategoryRequest) returns (CreateCategoryResponse);
7
+ rpc UpdateCategory(UpdateCategoryRequest) returns (UpdateCategoryResponse);
8
+ rpc DeleteCategory (DeleteCategoryRequest) returns (DeleteCategoryResponse);
9
+ rpc GetCategory(GetCategoryRequest) returns (GetCategoryResponse);
10
+
11
+ rpc CreateCategories (CreateCategoriesRequest) returns (CreateCategoriesResponse);
12
+ rpc GetCategories(GetCategoriesRequest) returns (GetCategoriesResponse);
13
+ }
14
+
15
+
16
+ message CategoryResponse {
17
+ string id = 1;
18
+ string title = 2;
19
+ string slug = 3;
20
+ }
21
+ message CreateCategoryRequest {
22
+ string title = 2;
23
+ string slug = 3;
24
+ }
25
+
26
+ message CreateCategoryResponse {
27
+ CategoryResponse category = 1;
28
+ }
29
+ message UpdateCategoryRequest {
30
+ string category_id = 1;
31
+ optional string title = 2;
32
+ optional string slug = 3;
33
+ }
34
+
35
+ message UpdateCategoryResponse {
36
+ CategoryResponse category = 1;
37
+ }
38
+
39
+ message DeleteCategoryRequest {
40
+ string category_id = 1;
41
+ }
42
+
43
+ message DeleteCategoryResponse {
44
+ bool ok = 1;
45
+ }
46
+
47
+
48
+ message GetCategoryRequest {
49
+ oneof identifier {
50
+ string product_id = 1;
51
+ string slug = 2;
52
+ }
53
+ }
54
+ message GetCategoryResponse {
55
+ CategoryResponse category = 1;
56
+ }
57
+
58
+ message CreateCategoriesRequest {
59
+ repeated CreateCategoryRequest categories = 1;
60
+ }
61
+ message CreateCategoriesResponse {
62
+
63
+ }
64
+ message GetCategoriesRequest {
65
+
66
+ }
67
+ message GetCategoriesResponse {
68
+ repeated CategoryResponse categories = 1;
69
+ }
@@ -8,6 +8,8 @@ service ProductService {
8
8
  rpc DeleteProduct (DeleteProductRequest) returns (DeleteProductResponse);
9
9
  rpc GetProduct(GetProductRequest) returns (ProductResponse);
10
10
  rpc GetProducts(GetProductsRequest) returns (GetProductsResponse);
11
+
12
+ rpc GetProductsByCategory (GetProductsByCategoryRequest) returns (GetProductsByCategoryResponse);
11
13
  }
12
14
 
13
15
  message CreateProductRequest {
@@ -40,8 +42,8 @@ message UpdateProductRequest {
40
42
  optional string title = 2;
41
43
  optional string price = 3;
42
44
  optional string description = 4;
43
- optional string category_id = 6;
44
- repeated string images = 7;
45
+ optional string category_id = 5;
46
+ repeated string images = 6;
45
47
  }
46
48
 
47
49
  message DeleteProductRequest {
@@ -52,6 +54,17 @@ message DeleteProductRequest {
52
54
  message DeleteProductResponse {
53
55
  bool success = 1;
54
56
  }
57
+
58
+
59
+ message GetProductsByCategoryRequest {
60
+ string category_id = 1;
61
+ int32 page = 2;
62
+ int32 limit = 3;
63
+ }
64
+ message GetProductsByCategoryResponse {
65
+ repeated ProductResponse products = 1;
66
+ }
67
+
55
68
  message ProductResponse{
56
69
  string id = 1;
57
70
  string slug = 2;
@@ -59,11 +72,11 @@ message ProductResponse{
59
72
  optional string description = 4;
60
73
  string category_id = 5;
61
74
  string price = 6;
62
- repeated string images = 8;
63
- string status = 9;
64
- float rating = 10;
65
- int32 review_count = 11;
66
- string created_at = 12;
67
- string updated_at = 13;
75
+ repeated string images = 7;
76
+ string status = 8;
77
+ float rating = 9;
78
+ int32 review_count = 10;
79
+ string created_at = 11;
80
+ string updated_at = 12;
68
81
  }
69
82