@barumetric/contracts 1.3.0 → 1.3.2

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.
@@ -80,6 +80,45 @@ export interface CategoryAttribute {
80
80
  enumValues: EnumValue[];
81
81
  }
82
82
 
83
+ export interface CreateCategoryRequest {
84
+ name: string;
85
+ slug: string;
86
+ description?: string | undefined;
87
+ parentId?: string | undefined;
88
+ sortOrder: number;
89
+ isActive: boolean;
90
+ iconUrl?: string | undefined;
91
+ bannerUrl?: string | undefined;
92
+ }
93
+
94
+ export interface CreateCategoryResponse {
95
+ ok: boolean;
96
+ }
97
+
98
+ export interface UpdateCategoryRequest {
99
+ id: string;
100
+ name: string;
101
+ slug: string;
102
+ description?: string | undefined;
103
+ parentId?: string | undefined;
104
+ sortOrder: number;
105
+ isActive: boolean;
106
+ iconUrl?: string | undefined;
107
+ bannerUrl?: string | undefined;
108
+ }
109
+
110
+ export interface UpdateCategoryResponse {
111
+ ok: boolean;
112
+ }
113
+
114
+ export interface DeleteCategoryRequest {
115
+ id: string;
116
+ }
117
+
118
+ export interface DeleteCategoryResponse {
119
+ ok: boolean;
120
+ }
121
+
83
122
  export interface EnumValue {
84
123
  id: string;
85
124
  value: string;
@@ -101,6 +140,12 @@ export interface CategoriesServiceClient {
101
140
  getCategory(request: GetCategoryRequest): Observable<GetCategoryResponse>;
102
141
 
103
142
  getCategoryAttributes(request: GetCategoryAttributesRequest): Observable<GetCategoryAttributesResponse>;
143
+
144
+ createCategory(request: CreateCategoryRequest): Observable<CreateCategoryResponse>;
145
+
146
+ updateCategory(request: UpdateCategoryRequest): Observable<UpdateCategoryResponse>;
147
+
148
+ deleteCategory(request: DeleteCategoryRequest): Observable<DeleteCategoryResponse>;
104
149
  }
105
150
 
106
151
  export interface CategoriesServiceController {
@@ -115,11 +160,30 @@ export interface CategoriesServiceController {
115
160
  getCategoryAttributes(
116
161
  request: GetCategoryAttributesRequest,
117
162
  ): Promise<GetCategoryAttributesResponse> | Observable<GetCategoryAttributesResponse> | GetCategoryAttributesResponse;
163
+
164
+ createCategory(
165
+ request: CreateCategoryRequest,
166
+ ): Promise<CreateCategoryResponse> | Observable<CreateCategoryResponse> | CreateCategoryResponse;
167
+
168
+ updateCategory(
169
+ request: UpdateCategoryRequest,
170
+ ): Promise<UpdateCategoryResponse> | Observable<UpdateCategoryResponse> | UpdateCategoryResponse;
171
+
172
+ deleteCategory(
173
+ request: DeleteCategoryRequest,
174
+ ): Promise<DeleteCategoryResponse> | Observable<DeleteCategoryResponse> | DeleteCategoryResponse;
118
175
  }
119
176
 
120
177
  export function CategoriesServiceControllerMethods() {
121
178
  return function (constructor: Function) {
122
- const grpcMethods: string[] = ["getAllCategories", "getCategory", "getCategoryAttributes"];
179
+ const grpcMethods: string[] = [
180
+ "getAllCategories",
181
+ "getCategory",
182
+ "getCategoryAttributes",
183
+ "createCategory",
184
+ "updateCategory",
185
+ "deleteCategory",
186
+ ];
123
187
  for (const method of grpcMethods) {
124
188
  const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
125
189
  GrpcMethod("CategoriesService", method)(constructor.prototype[method], method, descriptor);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@barumetric/contracts",
3
- "version": "1.3.0",
3
+ "version": "1.3.2",
4
4
  "description": "Protobuf definitions and generated TypeScript types",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",
@@ -8,6 +8,10 @@ service CategoriesService {
8
8
  rpc GetAllCategories (google.protobuf.Empty) returns (GetAllCategoriesResponse);
9
9
  rpc GetCategory (GetCategoryRequest) returns (GetCategoryResponse);
10
10
  rpc GetCategoryAttributes (GetCategoryAttributesRequest) returns (GetCategoryAttributesResponse);
11
+
12
+ rpc CreateCategory (CreateCategoryRequest) returns (CreateCategoryResponse);
13
+ rpc UpdateCategory (UpdateCategoryRequest) returns (UpdateCategoryResponse);
14
+ rpc DeleteCategory (DeleteCategoryRequest) returns (DeleteCategoryResponse);
11
15
  }
12
16
 
13
17
  message GetCategoryRequest {
@@ -65,6 +69,45 @@ message CategoryAttribute {
65
69
  repeated EnumValue enum_values = 13;
66
70
  }
67
71
 
72
+ message CreateCategoryRequest {
73
+ string name = 1;
74
+ string slug = 2;
75
+ optional string description = 3;
76
+ optional string parent_id = 4;
77
+ int32 sort_order = 5;
78
+ bool is_active = 6;
79
+ optional string icon_url = 7;
80
+ optional string banner_url = 8;
81
+ }
82
+
83
+ message CreateCategoryResponse {
84
+ bool ok = 1;
85
+ }
86
+
87
+ message UpdateCategoryRequest {
88
+ string id = 1;
89
+ string name = 2;
90
+ string slug = 3;
91
+ optional string description = 4;
92
+ optional string parent_id = 5;
93
+ int32 sort_order = 6;
94
+ bool is_active = 7;
95
+ optional string icon_url = 8;
96
+ optional string banner_url = 9;
97
+ }
98
+
99
+ message UpdateCategoryResponse {
100
+ bool ok = 1;
101
+ }
102
+
103
+ message DeleteCategoryRequest {
104
+ string id = 1;
105
+ }
106
+
107
+ message DeleteCategoryResponse {
108
+ bool ok = 1;
109
+ }
110
+
68
111
  message EnumValue {
69
112
  string id = 1;
70
113
  string value = 2;