@barumetric/contracts 1.3.1 → 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.
@@ -96,6 +96,7 @@ export interface CreateCategoryResponse {
96
96
  }
97
97
 
98
98
  export interface UpdateCategoryRequest {
99
+ id: string;
99
100
  name: string;
100
101
  slug: string;
101
102
  description?: string | undefined;
@@ -111,14 +112,7 @@ export interface UpdateCategoryResponse {
111
112
  }
112
113
 
113
114
  export interface DeleteCategoryRequest {
114
- name: string;
115
- slug: string;
116
- description?: string | undefined;
117
- parentId?: string | undefined;
118
- sortOrder: number;
119
- isActive: boolean;
120
- iconUrl?: string | undefined;
121
- bannerUrl?: string | undefined;
115
+ id: string;
122
116
  }
123
117
 
124
118
  export interface DeleteCategoryResponse {
@@ -138,6 +132,92 @@ export interface EnumValueInput {
138
132
  sortOrder: number;
139
133
  }
140
134
 
135
+ /** Attribute management messages */
136
+ export interface GetAttributeRequest {
137
+ id: string;
138
+ }
139
+
140
+ export interface GetAttributeResponse {
141
+ attribute: Attribute | undefined;
142
+ }
143
+
144
+ export interface Attribute {
145
+ id: string;
146
+ name: string;
147
+ key: string;
148
+ type: AttributeType;
149
+ defaultIsRequired: boolean;
150
+ defaultIsFilterable: boolean;
151
+ unit?: string | undefined;
152
+ minValue?: number | undefined;
153
+ maxValue?: number | undefined;
154
+ enumValues: EnumValue[];
155
+ }
156
+
157
+ export interface CreateAttributeRequest {
158
+ name: string;
159
+ key: string;
160
+ type: AttributeType;
161
+ defaultIsRequired: boolean;
162
+ defaultIsFilterable: boolean;
163
+ unit?: string | undefined;
164
+ minValue?: number | undefined;
165
+ maxValue?: number | undefined;
166
+ enumValues: EnumValueInput[];
167
+ }
168
+
169
+ export interface CreateAttributeResponse {
170
+ ok: boolean;
171
+ id: string;
172
+ }
173
+
174
+ export interface UpdateAttributeRequest {
175
+ id: string;
176
+ name?: string | undefined;
177
+ key?: string | undefined;
178
+ type?: AttributeType | undefined;
179
+ defaultIsRequired?: boolean | undefined;
180
+ defaultIsFilterable?: boolean | undefined;
181
+ unit?: string | undefined;
182
+ minValue?: number | undefined;
183
+ maxValue?: number | undefined;
184
+ enumValues: EnumValueInput[];
185
+ }
186
+
187
+ export interface UpdateAttributeResponse {
188
+ ok: boolean;
189
+ }
190
+
191
+ export interface DeleteAttributeRequest {
192
+ id: string;
193
+ }
194
+
195
+ export interface DeleteAttributeResponse {
196
+ ok: boolean;
197
+ }
198
+
199
+ /** Category-Attribute relationship messages */
200
+ export interface AssignAttributeToCategoryRequest {
201
+ categoryId: string;
202
+ attributeId: string;
203
+ isRequired?: boolean | undefined;
204
+ isFilterable?: boolean | undefined;
205
+ sortOrder?: number | undefined;
206
+ }
207
+
208
+ export interface AssignAttributeToCategoryResponse {
209
+ ok: boolean;
210
+ }
211
+
212
+ export interface UnassignAttributeFromCategoryRequest {
213
+ categoryId: string;
214
+ attributeId: string;
215
+ }
216
+
217
+ export interface UnassignAttributeFromCategoryResponse {
218
+ ok: boolean;
219
+ }
220
+
141
221
  export const CATEGORIES_V1_PACKAGE_NAME = "categories.v1";
142
222
 
143
223
  export interface CategoriesServiceClient {
@@ -152,6 +232,24 @@ export interface CategoriesServiceClient {
152
232
  updateCategory(request: UpdateCategoryRequest): Observable<UpdateCategoryResponse>;
153
233
 
154
234
  deleteCategory(request: DeleteCategoryRequest): Observable<DeleteCategoryResponse>;
235
+
236
+ /** Attribute management */
237
+
238
+ getAttribute(request: GetAttributeRequest): Observable<GetAttributeResponse>;
239
+
240
+ createAttribute(request: CreateAttributeRequest): Observable<CreateAttributeResponse>;
241
+
242
+ updateAttribute(request: UpdateAttributeRequest): Observable<UpdateAttributeResponse>;
243
+
244
+ deleteAttribute(request: DeleteAttributeRequest): Observable<DeleteAttributeResponse>;
245
+
246
+ /** Category-Attribute relationship management */
247
+
248
+ assignAttributeToCategory(request: AssignAttributeToCategoryRequest): Observable<AssignAttributeToCategoryResponse>;
249
+
250
+ unassignAttributeFromCategory(
251
+ request: UnassignAttributeFromCategoryRequest,
252
+ ): Observable<UnassignAttributeFromCategoryResponse>;
155
253
  }
156
254
 
157
255
  export interface CategoriesServiceController {
@@ -178,6 +276,40 @@ export interface CategoriesServiceController {
178
276
  deleteCategory(
179
277
  request: DeleteCategoryRequest,
180
278
  ): Promise<DeleteCategoryResponse> | Observable<DeleteCategoryResponse> | DeleteCategoryResponse;
279
+
280
+ /** Attribute management */
281
+
282
+ getAttribute(
283
+ request: GetAttributeRequest,
284
+ ): Promise<GetAttributeResponse> | Observable<GetAttributeResponse> | GetAttributeResponse;
285
+
286
+ createAttribute(
287
+ request: CreateAttributeRequest,
288
+ ): Promise<CreateAttributeResponse> | Observable<CreateAttributeResponse> | CreateAttributeResponse;
289
+
290
+ updateAttribute(
291
+ request: UpdateAttributeRequest,
292
+ ): Promise<UpdateAttributeResponse> | Observable<UpdateAttributeResponse> | UpdateAttributeResponse;
293
+
294
+ deleteAttribute(
295
+ request: DeleteAttributeRequest,
296
+ ): Promise<DeleteAttributeResponse> | Observable<DeleteAttributeResponse> | DeleteAttributeResponse;
297
+
298
+ /** Category-Attribute relationship management */
299
+
300
+ assignAttributeToCategory(
301
+ request: AssignAttributeToCategoryRequest,
302
+ ):
303
+ | Promise<AssignAttributeToCategoryResponse>
304
+ | Observable<AssignAttributeToCategoryResponse>
305
+ | AssignAttributeToCategoryResponse;
306
+
307
+ unassignAttributeFromCategory(
308
+ request: UnassignAttributeFromCategoryRequest,
309
+ ):
310
+ | Promise<UnassignAttributeFromCategoryResponse>
311
+ | Observable<UnassignAttributeFromCategoryResponse>
312
+ | UnassignAttributeFromCategoryResponse;
181
313
  }
182
314
 
183
315
  export function CategoriesServiceControllerMethods() {
@@ -189,6 +321,12 @@ export function CategoriesServiceControllerMethods() {
189
321
  "createCategory",
190
322
  "updateCategory",
191
323
  "deleteCategory",
324
+ "getAttribute",
325
+ "createAttribute",
326
+ "updateAttribute",
327
+ "deleteAttribute",
328
+ "assignAttributeToCategory",
329
+ "unassignAttributeFromCategory",
192
330
  ];
193
331
  for (const method of grpcMethods) {
194
332
  const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@barumetric/contracts",
3
- "version": "1.3.1",
3
+ "version": "1.3.3",
4
4
  "description": "Protobuf definitions and generated TypeScript types",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",
@@ -12,6 +12,16 @@ service CategoriesService {
12
12
  rpc CreateCategory (CreateCategoryRequest) returns (CreateCategoryResponse);
13
13
  rpc UpdateCategory (UpdateCategoryRequest) returns (UpdateCategoryResponse);
14
14
  rpc DeleteCategory (DeleteCategoryRequest) returns (DeleteCategoryResponse);
15
+
16
+ // Attribute management
17
+ rpc GetAttribute (GetAttributeRequest) returns (GetAttributeResponse);
18
+ rpc CreateAttribute (CreateAttributeRequest) returns (CreateAttributeResponse);
19
+ rpc UpdateAttribute (UpdateAttributeRequest) returns (UpdateAttributeResponse);
20
+ rpc DeleteAttribute (DeleteAttributeRequest) returns (DeleteAttributeResponse);
21
+
22
+ // Category-Attribute relationship management
23
+ rpc AssignAttributeToCategory (AssignAttributeToCategoryRequest) returns (AssignAttributeToCategoryResponse);
24
+ rpc UnassignAttributeFromCategory (UnassignAttributeFromCategoryRequest) returns (UnassignAttributeFromCategoryResponse);
15
25
  }
16
26
 
17
27
  message GetCategoryRequest {
@@ -85,14 +95,15 @@ message CreateCategoryResponse {
85
95
  }
86
96
 
87
97
  message UpdateCategoryRequest {
88
- string name = 1;
89
- string slug = 2;
90
- optional string description = 3;
91
- optional string parent_id = 4;
92
- int32 sort_order = 5;
93
- bool is_active = 6;
94
- optional string icon_url = 7;
95
- optional string banner_url = 8;
98
+ string id = 1;
99
+ string name = 2;
100
+ string slug = 3;
101
+ optional string description = 4;
102
+ optional string parent_id = 5;
103
+ int32 sort_order = 6;
104
+ bool is_active = 7;
105
+ optional string icon_url = 8;
106
+ optional string banner_url = 9;
96
107
  }
97
108
 
98
109
  message UpdateCategoryResponse {
@@ -100,14 +111,7 @@ message UpdateCategoryResponse {
100
111
  }
101
112
 
102
113
  message DeleteCategoryRequest {
103
- string name = 1;
104
- string slug = 2;
105
- optional string description = 3;
106
- optional string parent_id = 4;
107
- int32 sort_order = 5;
108
- bool is_active = 6;
109
- optional string icon_url = 7;
110
- optional string banner_url = 8;
114
+ string id = 1;
111
115
  }
112
116
 
113
117
  message DeleteCategoryResponse {
@@ -139,3 +143,89 @@ enum AttributeType {
139
143
  ATTRIBUTE_TYPE_RANGE = 8;
140
144
  ATTRIBUTE_TYPE_DATE = 9;
141
145
  }
146
+
147
+ // Attribute management messages
148
+ message GetAttributeRequest {
149
+ string id = 1;
150
+ }
151
+
152
+ message GetAttributeResponse {
153
+ Attribute attribute = 1;
154
+ }
155
+
156
+ message Attribute {
157
+ string id = 1;
158
+ string name = 2;
159
+ string key = 3;
160
+ AttributeType type = 4;
161
+ bool default_is_required = 5;
162
+ bool default_is_filterable = 6;
163
+ optional string unit = 7;
164
+ optional float min_value = 8;
165
+ optional float max_value = 9;
166
+ repeated EnumValue enum_values = 10;
167
+ }
168
+
169
+ message CreateAttributeRequest {
170
+ string name = 1;
171
+ string key = 2;
172
+ AttributeType type = 3;
173
+ bool default_is_required = 4;
174
+ bool default_is_filterable = 5;
175
+ optional string unit = 6;
176
+ optional float min_value = 7;
177
+ optional float max_value = 8;
178
+ repeated EnumValueInput enum_values = 9;
179
+ }
180
+
181
+ message CreateAttributeResponse {
182
+ bool ok = 1;
183
+ string id = 2;
184
+ }
185
+
186
+ message UpdateAttributeRequest {
187
+ string id = 1;
188
+ optional string name = 2;
189
+ optional string key = 3;
190
+ optional AttributeType type = 4;
191
+ optional bool default_is_required = 5;
192
+ optional bool default_is_filterable = 6;
193
+ optional string unit = 7;
194
+ optional float min_value = 8;
195
+ optional float max_value = 9;
196
+ repeated EnumValueInput enum_values = 10;
197
+ }
198
+
199
+ message UpdateAttributeResponse {
200
+ bool ok = 1;
201
+ }
202
+
203
+ message DeleteAttributeRequest {
204
+ string id = 1;
205
+ }
206
+
207
+ message DeleteAttributeResponse {
208
+ bool ok = 1;
209
+ }
210
+
211
+ // Category-Attribute relationship messages
212
+ message AssignAttributeToCategoryRequest {
213
+ string category_id = 1;
214
+ string attribute_id = 2;
215
+ optional bool is_required = 3;
216
+ optional bool is_filterable = 4;
217
+ optional int32 sort_order = 5;
218
+ }
219
+
220
+ message AssignAttributeToCategoryResponse {
221
+ bool ok = 1;
222
+ }
223
+
224
+ message UnassignAttributeFromCategoryRequest {
225
+ string category_id = 1;
226
+ string attribute_id = 2;
227
+ }
228
+
229
+ message UnassignAttributeFromCategoryResponse {
230
+ bool ok = 1;
231
+ }