@barumetric/contracts 1.3.0 → 1.3.1
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/gen/ts/categories.ts +71 -1
- package/package.json +1 -1
- package/proto/categories.proto +49 -0
package/gen/ts/categories.ts
CHANGED
|
@@ -80,6 +80,51 @@ 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
|
+
name: string;
|
|
100
|
+
slug: string;
|
|
101
|
+
description?: string | undefined;
|
|
102
|
+
parentId?: string | undefined;
|
|
103
|
+
sortOrder: number;
|
|
104
|
+
isActive: boolean;
|
|
105
|
+
iconUrl?: string | undefined;
|
|
106
|
+
bannerUrl?: string | undefined;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
export interface UpdateCategoryResponse {
|
|
110
|
+
ok: boolean;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
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;
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
export interface DeleteCategoryResponse {
|
|
125
|
+
ok: boolean;
|
|
126
|
+
}
|
|
127
|
+
|
|
83
128
|
export interface EnumValue {
|
|
84
129
|
id: string;
|
|
85
130
|
value: string;
|
|
@@ -101,6 +146,12 @@ export interface CategoriesServiceClient {
|
|
|
101
146
|
getCategory(request: GetCategoryRequest): Observable<GetCategoryResponse>;
|
|
102
147
|
|
|
103
148
|
getCategoryAttributes(request: GetCategoryAttributesRequest): Observable<GetCategoryAttributesResponse>;
|
|
149
|
+
|
|
150
|
+
createCategory(request: CreateCategoryRequest): Observable<CreateCategoryResponse>;
|
|
151
|
+
|
|
152
|
+
updateCategory(request: UpdateCategoryRequest): Observable<UpdateCategoryResponse>;
|
|
153
|
+
|
|
154
|
+
deleteCategory(request: DeleteCategoryRequest): Observable<DeleteCategoryResponse>;
|
|
104
155
|
}
|
|
105
156
|
|
|
106
157
|
export interface CategoriesServiceController {
|
|
@@ -115,11 +166,30 @@ export interface CategoriesServiceController {
|
|
|
115
166
|
getCategoryAttributes(
|
|
116
167
|
request: GetCategoryAttributesRequest,
|
|
117
168
|
): Promise<GetCategoryAttributesResponse> | Observable<GetCategoryAttributesResponse> | GetCategoryAttributesResponse;
|
|
169
|
+
|
|
170
|
+
createCategory(
|
|
171
|
+
request: CreateCategoryRequest,
|
|
172
|
+
): Promise<CreateCategoryResponse> | Observable<CreateCategoryResponse> | CreateCategoryResponse;
|
|
173
|
+
|
|
174
|
+
updateCategory(
|
|
175
|
+
request: UpdateCategoryRequest,
|
|
176
|
+
): Promise<UpdateCategoryResponse> | Observable<UpdateCategoryResponse> | UpdateCategoryResponse;
|
|
177
|
+
|
|
178
|
+
deleteCategory(
|
|
179
|
+
request: DeleteCategoryRequest,
|
|
180
|
+
): Promise<DeleteCategoryResponse> | Observable<DeleteCategoryResponse> | DeleteCategoryResponse;
|
|
118
181
|
}
|
|
119
182
|
|
|
120
183
|
export function CategoriesServiceControllerMethods() {
|
|
121
184
|
return function (constructor: Function) {
|
|
122
|
-
const grpcMethods: string[] = [
|
|
185
|
+
const grpcMethods: string[] = [
|
|
186
|
+
"getAllCategories",
|
|
187
|
+
"getCategory",
|
|
188
|
+
"getCategoryAttributes",
|
|
189
|
+
"createCategory",
|
|
190
|
+
"updateCategory",
|
|
191
|
+
"deleteCategory",
|
|
192
|
+
];
|
|
123
193
|
for (const method of grpcMethods) {
|
|
124
194
|
const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
|
|
125
195
|
GrpcMethod("CategoriesService", method)(constructor.prototype[method], method, descriptor);
|
package/package.json
CHANGED
package/proto/categories.proto
CHANGED
|
@@ -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,51 @@ 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 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;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
message UpdateCategoryResponse {
|
|
99
|
+
bool ok = 1;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
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;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
message DeleteCategoryResponse {
|
|
114
|
+
bool ok = 1;
|
|
115
|
+
}
|
|
116
|
+
|
|
68
117
|
message EnumValue {
|
|
69
118
|
string id = 1;
|
|
70
119
|
string value = 2;
|