@mamindom/contracts 1.0.14 → 1.0.15

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.
@@ -2,5 +2,5 @@ export declare const PROTO_PATHS: {
2
2
  readonly AUTH: string;
3
3
  readonly ACCOUNT: string;
4
4
  readonly USERS: string;
5
- readonly CATEGORIES: string;
5
+ readonly CATALOG: string;
6
6
  };
@@ -6,5 +6,5 @@ exports.PROTO_PATHS = {
6
6
  AUTH: (0, node_path_1.join)(__dirname, '../../proto/auth.proto'),
7
7
  ACCOUNT: (0, node_path_1.join)(__dirname, '../../proto/account.proto'),
8
8
  USERS: (0, node_path_1.join)(__dirname, '../../proto/users.proto'),
9
- CATEGORIES: (0, node_path_1.join)(__dirname, '../../proto/categories.proto')
9
+ CATALOG: (0, node_path_1.join)(__dirname, '../../proto/catalog.proto')
10
10
  };
package/gen/catalog.ts ADDED
@@ -0,0 +1,345 @@
1
+ // Code generated by protoc-gen-ts_proto. DO NOT EDIT.
2
+ // versions:
3
+ // protoc-gen-ts_proto v2.11.4
4
+ // protoc v3.21.12
5
+ // source: catalog.proto
6
+
7
+ /* eslint-disable */
8
+ import { GrpcMethod, GrpcStreamMethod } from "@nestjs/microservices";
9
+ import { Observable } from "rxjs";
10
+
11
+ export const protobufPackage = "catalog.v1";
12
+
13
+ export interface SuccessResponse {
14
+ success: boolean;
15
+ }
16
+
17
+ export interface DeleteResponse {
18
+ success: boolean;
19
+ }
20
+
21
+ export interface GetCategoryTreeRequest {
22
+ lang: string;
23
+ }
24
+
25
+ export interface CategoryTreeNode {
26
+ id: string;
27
+ parentId: string;
28
+ slug: string;
29
+ name: string;
30
+ image: string;
31
+ children: CategoryTreeNode[];
32
+ }
33
+
34
+ export interface GetCategoryTreeResponse {
35
+ items: CategoryTreeNode[];
36
+ }
37
+
38
+ export interface CategoryResponse {
39
+ id: string;
40
+ parentId?: string | undefined;
41
+ slug: string;
42
+ image?: string | undefined;
43
+ status: boolean;
44
+ sortOrder: number;
45
+ name: { [key: string]: string };
46
+ description: { [key: string]: string };
47
+ metaTitle: { [key: string]: string };
48
+ metaDescription: { [key: string]: string };
49
+ metaKeywords: { [key: string]: string };
50
+ metaH1: { [key: string]: string };
51
+ guid1c?: string | undefined;
52
+ }
53
+
54
+ export interface CategoryResponse_NameEntry {
55
+ key: string;
56
+ value: string;
57
+ }
58
+
59
+ export interface CategoryResponse_DescriptionEntry {
60
+ key: string;
61
+ value: string;
62
+ }
63
+
64
+ export interface CategoryResponse_MetaTitleEntry {
65
+ key: string;
66
+ value: string;
67
+ }
68
+
69
+ export interface CategoryResponse_MetaDescriptionEntry {
70
+ key: string;
71
+ value: string;
72
+ }
73
+
74
+ export interface CategoryResponse_MetaKeywordsEntry {
75
+ key: string;
76
+ value: string;
77
+ }
78
+
79
+ export interface CategoryResponse_MetaH1Entry {
80
+ key: string;
81
+ value: string;
82
+ }
83
+
84
+ export interface GetCategoryRequest {
85
+ id: string;
86
+ slug?: string | undefined;
87
+ }
88
+
89
+ export interface CreateCategoryRequest {
90
+ parentId?: string | undefined;
91
+ slug: string;
92
+ image?: string | undefined;
93
+ status: boolean;
94
+ sortOrder: number;
95
+ name: { [key: string]: string };
96
+ description: { [key: string]: string };
97
+ metaTitle: { [key: string]: string };
98
+ metaDescription: { [key: string]: string };
99
+ metaKeywords: { [key: string]: string };
100
+ metaH1: { [key: string]: string };
101
+ guid1c?: string | undefined;
102
+ }
103
+
104
+ export interface CreateCategoryRequest_NameEntry {
105
+ key: string;
106
+ value: string;
107
+ }
108
+
109
+ export interface CreateCategoryRequest_DescriptionEntry {
110
+ key: string;
111
+ value: string;
112
+ }
113
+
114
+ export interface CreateCategoryRequest_MetaTitleEntry {
115
+ key: string;
116
+ value: string;
117
+ }
118
+
119
+ export interface CreateCategoryRequest_MetaDescriptionEntry {
120
+ key: string;
121
+ value: string;
122
+ }
123
+
124
+ export interface CreateCategoryRequest_MetaKeywordsEntry {
125
+ key: string;
126
+ value: string;
127
+ }
128
+
129
+ export interface CreateCategoryRequest_MetaH1Entry {
130
+ key: string;
131
+ value: string;
132
+ }
133
+
134
+ export interface UpdateCategoryRequest {
135
+ id: string;
136
+ parentId?: string | undefined;
137
+ slug?: string | undefined;
138
+ image?: string | undefined;
139
+ status?: boolean | undefined;
140
+ sortOrder?: number | undefined;
141
+ name: { [key: string]: string };
142
+ description: { [key: string]: string };
143
+ metaTitle: { [key: string]: string };
144
+ metaDescription: { [key: string]: string };
145
+ metaKeywords: { [key: string]: string };
146
+ metaH1: { [key: string]: string };
147
+ }
148
+
149
+ export interface UpdateCategoryRequest_NameEntry {
150
+ key: string;
151
+ value: string;
152
+ }
153
+
154
+ export interface UpdateCategoryRequest_DescriptionEntry {
155
+ key: string;
156
+ value: string;
157
+ }
158
+
159
+ export interface UpdateCategoryRequest_MetaTitleEntry {
160
+ key: string;
161
+ value: string;
162
+ }
163
+
164
+ export interface UpdateCategoryRequest_MetaDescriptionEntry {
165
+ key: string;
166
+ value: string;
167
+ }
168
+
169
+ export interface UpdateCategoryRequest_MetaKeywordsEntry {
170
+ key: string;
171
+ value: string;
172
+ }
173
+
174
+ export interface UpdateCategoryRequest_MetaH1Entry {
175
+ key: string;
176
+ value: string;
177
+ }
178
+
179
+ export interface DeleteCategoryRequest {
180
+ id: string;
181
+ }
182
+
183
+ export interface CategoryOrderItem {
184
+ id: string;
185
+ sortOrder: number;
186
+ parentId?: string | undefined;
187
+ }
188
+
189
+ export interface UpdateCategoryOrderRequest {
190
+ items: CategoryOrderItem[];
191
+ }
192
+
193
+ export interface AttributeResponse {
194
+ id: string;
195
+ slug: string;
196
+ name: { [key: string]: string };
197
+ displayType: string;
198
+ guid1c?: string | undefined;
199
+ }
200
+
201
+ export interface AttributeResponse_NameEntry {
202
+ key: string;
203
+ value: string;
204
+ }
205
+
206
+ export interface GetAttributeRequest {
207
+ id: string;
208
+ }
209
+
210
+ export interface CreateAttributeRequest {
211
+ slug: string;
212
+ name: { [key: string]: string };
213
+ displayType: string;
214
+ guid1c?: string | undefined;
215
+ }
216
+
217
+ export interface CreateAttributeRequest_NameEntry {
218
+ key: string;
219
+ value: string;
220
+ }
221
+
222
+ export interface UpdateAttributeRequest {
223
+ id: string;
224
+ slug?: string | undefined;
225
+ name: { [key: string]: string };
226
+ displayType?: string | undefined;
227
+ }
228
+
229
+ export interface UpdateAttributeRequest_NameEntry {
230
+ key: string;
231
+ value: string;
232
+ }
233
+
234
+ export interface DeleteAttributeRequest {
235
+ id: string;
236
+ }
237
+
238
+ export interface BindAttributeRequest {
239
+ categoryId: string;
240
+ attributeId: string;
241
+ }
242
+
243
+ export const CATALOG_V1_PACKAGE_NAME = "catalog.v1";
244
+
245
+ export interface CatalogServiceClient {
246
+ getCategoryTree(request: GetCategoryTreeRequest): Observable<GetCategoryTreeResponse>;
247
+
248
+ getCategory(request: GetCategoryRequest): Observable<CategoryResponse>;
249
+
250
+ createCategory(request: CreateCategoryRequest): Observable<CategoryResponse>;
251
+
252
+ updateCategory(request: UpdateCategoryRequest): Observable<CategoryResponse>;
253
+
254
+ deleteCategory(request: DeleteCategoryRequest): Observable<DeleteResponse>;
255
+
256
+ updateCategoryOrder(request: UpdateCategoryOrderRequest): Observable<SuccessResponse>;
257
+
258
+ getAttribute(request: GetAttributeRequest): Observable<AttributeResponse>;
259
+
260
+ createAttribute(request: CreateAttributeRequest): Observable<AttributeResponse>;
261
+
262
+ updateAttribute(request: UpdateAttributeRequest): Observable<AttributeResponse>;
263
+
264
+ deleteAttribute(request: DeleteAttributeRequest): Observable<DeleteResponse>;
265
+
266
+ bindAttributeToCategory(request: BindAttributeRequest): Observable<SuccessResponse>;
267
+
268
+ unbindAttributeFromCategory(request: BindAttributeRequest): Observable<SuccessResponse>;
269
+ }
270
+
271
+ export interface CatalogServiceController {
272
+ getCategoryTree(
273
+ request: GetCategoryTreeRequest,
274
+ ): Promise<GetCategoryTreeResponse> | Observable<GetCategoryTreeResponse> | GetCategoryTreeResponse;
275
+
276
+ getCategory(request: GetCategoryRequest): Promise<CategoryResponse> | Observable<CategoryResponse> | CategoryResponse;
277
+
278
+ createCategory(
279
+ request: CreateCategoryRequest,
280
+ ): Promise<CategoryResponse> | Observable<CategoryResponse> | CategoryResponse;
281
+
282
+ updateCategory(
283
+ request: UpdateCategoryRequest,
284
+ ): Promise<CategoryResponse> | Observable<CategoryResponse> | CategoryResponse;
285
+
286
+ deleteCategory(request: DeleteCategoryRequest): Promise<DeleteResponse> | Observable<DeleteResponse> | DeleteResponse;
287
+
288
+ updateCategoryOrder(
289
+ request: UpdateCategoryOrderRequest,
290
+ ): Promise<SuccessResponse> | Observable<SuccessResponse> | SuccessResponse;
291
+
292
+ getAttribute(
293
+ request: GetAttributeRequest,
294
+ ): Promise<AttributeResponse> | Observable<AttributeResponse> | AttributeResponse;
295
+
296
+ createAttribute(
297
+ request: CreateAttributeRequest,
298
+ ): Promise<AttributeResponse> | Observable<AttributeResponse> | AttributeResponse;
299
+
300
+ updateAttribute(
301
+ request: UpdateAttributeRequest,
302
+ ): Promise<AttributeResponse> | Observable<AttributeResponse> | AttributeResponse;
303
+
304
+ deleteAttribute(
305
+ request: DeleteAttributeRequest,
306
+ ): Promise<DeleteResponse> | Observable<DeleteResponse> | DeleteResponse;
307
+
308
+ bindAttributeToCategory(
309
+ request: BindAttributeRequest,
310
+ ): Promise<SuccessResponse> | Observable<SuccessResponse> | SuccessResponse;
311
+
312
+ unbindAttributeFromCategory(
313
+ request: BindAttributeRequest,
314
+ ): Promise<SuccessResponse> | Observable<SuccessResponse> | SuccessResponse;
315
+ }
316
+
317
+ export function CatalogServiceControllerMethods() {
318
+ return function (constructor: Function) {
319
+ const grpcMethods: string[] = [
320
+ "getCategoryTree",
321
+ "getCategory",
322
+ "createCategory",
323
+ "updateCategory",
324
+ "deleteCategory",
325
+ "updateCategoryOrder",
326
+ "getAttribute",
327
+ "createAttribute",
328
+ "updateAttribute",
329
+ "deleteAttribute",
330
+ "bindAttributeToCategory",
331
+ "unbindAttributeFromCategory",
332
+ ];
333
+ for (const method of grpcMethods) {
334
+ const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
335
+ GrpcMethod("CatalogService", method)(constructor.prototype[method], method, descriptor);
336
+ }
337
+ const grpcStreamMethods: string[] = [];
338
+ for (const method of grpcStreamMethods) {
339
+ const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
340
+ GrpcStreamMethod("CatalogService", method)(constructor.prototype[method], method, descriptor);
341
+ }
342
+ };
343
+ }
344
+
345
+ export const CATALOG_SERVICE_NAME = "CatalogService";
package/gen/categorie.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  // Code generated by protoc-gen-ts_proto. DO NOT EDIT.
2
2
  // versions:
3
3
  // protoc-gen-ts_proto v2.11.4
4
- // protoc v3.21.12
4
+ // protoc v7.34.0
5
5
  // source: categorie.proto
6
6
 
7
7
  /* eslint-disable */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mamindom/contracts",
3
- "version": "1.0.14",
3
+ "version": "1.0.15",
4
4
  "description": "proto",
5
5
  "main": "./dist/index.js",
6
6
  "type": "./dist/index.d.ts",
@@ -0,0 +1,160 @@
1
+ syntax = "proto3";
2
+
3
+ package catalog.v1;
4
+
5
+ service CatalogService {
6
+
7
+ rpc GetCategoryTree (GetCategoryTreeRequest) returns (GetCategoryTreeResponse);
8
+
9
+ rpc GetCategory (GetCategoryRequest) returns (CategoryResponse);
10
+ rpc CreateCategory (CreateCategoryRequest) returns (CategoryResponse);
11
+ rpc UpdateCategory (UpdateCategoryRequest) returns (CategoryResponse);
12
+ rpc DeleteCategory (DeleteCategoryRequest) returns (DeleteResponse);
13
+
14
+ rpc UpdateCategoryOrder (UpdateCategoryOrderRequest) returns (SuccessResponse);
15
+
16
+ rpc GetAttribute (GetAttributeRequest) returns (AttributeResponse);
17
+ rpc CreateAttribute (CreateAttributeRequest) returns (AttributeResponse);
18
+ rpc UpdateAttribute (UpdateAttributeRequest) returns (AttributeResponse);
19
+ rpc DeleteAttribute (DeleteAttributeRequest) returns (DeleteResponse);
20
+
21
+ rpc BindAttributeToCategory (BindAttributeRequest) returns (SuccessResponse);
22
+ rpc UnbindAttributeFromCategory (BindAttributeRequest) returns (SuccessResponse);
23
+ }
24
+
25
+
26
+ message SuccessResponse {
27
+ bool success = 1;
28
+ }
29
+
30
+ message DeleteResponse {
31
+ bool success = 1;
32
+ }
33
+
34
+ message GetCategoryTreeRequest {
35
+ string lang = 1;
36
+ }
37
+
38
+
39
+ message CategoryTreeNode {
40
+ string id = 1;
41
+ string parent_id = 2;
42
+ string slug = 3;
43
+ string name = 4;
44
+ string image = 5;
45
+ repeated CategoryTreeNode children = 6;
46
+ }
47
+
48
+ message GetCategoryTreeResponse {
49
+ repeated CategoryTreeNode items = 1;
50
+ }
51
+
52
+
53
+ message CategoryResponse {
54
+ string id = 1;
55
+ optional string parent_id = 2;
56
+ string slug = 3;
57
+ optional string image = 4;
58
+ bool status = 5;
59
+ int32 sort_order = 6;
60
+
61
+
62
+ map<string, string> name = 7;
63
+ map<string, string> description = 8;
64
+
65
+ map<string, string> meta_title = 9;
66
+ map<string, string> meta_description = 10;
67
+ map<string, string> meta_keywords = 11;
68
+ map<string, string> meta_h1 = 12;
69
+
70
+ optional string guid_1c = 13;
71
+ }
72
+
73
+ message GetCategoryRequest {
74
+ string id = 1;
75
+ optional string slug = 2;
76
+ }
77
+
78
+ message CreateCategoryRequest {
79
+ optional string parent_id = 1;
80
+ string slug = 2;
81
+ optional string image = 3;
82
+ bool status = 4;
83
+ int32 sort_order = 5;
84
+
85
+ map<string, string> name = 6;
86
+ map<string, string> description = 7;
87
+
88
+ map<string, string> meta_title = 8;
89
+ map<string, string> meta_description = 9;
90
+ map<string, string> meta_keywords = 10;
91
+ map<string, string> meta_h1 = 11;
92
+
93
+ optional string guid_1c = 12;
94
+ }
95
+
96
+ message UpdateCategoryRequest {
97
+ string id = 1;
98
+ optional string parent_id = 2;
99
+ optional string slug = 3;
100
+ optional string image = 4;
101
+ optional bool status = 5;
102
+ optional int32 sort_order = 6;
103
+
104
+ map<string, string> name = 7;
105
+ map<string, string> description = 8;
106
+
107
+ map<string, string> meta_title = 9;
108
+ map<string, string> meta_description = 10;
109
+ map<string, string> meta_keywords = 11;
110
+ map<string, string> meta_h1 = 12;
111
+ }
112
+
113
+ message DeleteCategoryRequest {
114
+ string id = 1;
115
+ }
116
+
117
+ message CategoryOrderItem {
118
+ string id = 1;
119
+ int32 sort_order = 2;
120
+ optional string parent_id = 3;
121
+ }
122
+
123
+ message UpdateCategoryOrderRequest {
124
+ repeated CategoryOrderItem items = 1;
125
+ }
126
+
127
+ message AttributeResponse {
128
+ string id = 1;
129
+ string slug = 2;
130
+ map<string, string> name = 3;
131
+ string display_type = 4;
132
+ optional string guid_1c = 5;
133
+ }
134
+
135
+ message GetAttributeRequest {
136
+ string id = 1;
137
+ }
138
+
139
+ message CreateAttributeRequest {
140
+ string slug = 1;
141
+ map<string, string> name = 2;
142
+ string display_type = 3;
143
+ optional string guid_1c = 4;
144
+ }
145
+
146
+ message UpdateAttributeRequest {
147
+ string id = 1;
148
+ optional string slug = 2;
149
+ map<string, string> name = 3;
150
+ optional string display_type = 4;
151
+ }
152
+
153
+ message DeleteAttributeRequest {
154
+ string id = 1;
155
+ }
156
+
157
+ message BindAttributeRequest {
158
+ string category_id = 1;
159
+ string attribute_id = 2;
160
+ }
@@ -1,7 +0,0 @@
1
- syntax = "proto3";
2
-
3
- package categories.v1;
4
-
5
- service CategoriesService {
6
-
7
- }