@mamindom/contracts 1.0.15 → 1.0.16

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,246 @@
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: category.proto
6
+
7
+ /* eslint-disable */
8
+ import { GrpcMethod, GrpcStreamMethod } from "@nestjs/microservices";
9
+ import { Observable } from "rxjs";
10
+ import { DeleteResponse, SuccessResponse } from "./common";
11
+
12
+ export const protobufPackage = "catalog.v1";
13
+
14
+ export interface GetCategoryTreeRequest {
15
+ lang: string;
16
+ }
17
+
18
+ export interface CategoryTreeNode {
19
+ id: string;
20
+ parentId: string;
21
+ slug: string;
22
+ name: string;
23
+ image: string;
24
+ children: CategoryTreeNode[];
25
+ }
26
+
27
+ export interface GetCategoryTreeResponse {
28
+ items: CategoryTreeNode[];
29
+ }
30
+
31
+ export interface CategoryResponse {
32
+ id: string;
33
+ parentId?: string | undefined;
34
+ slug: string;
35
+ image?: string | undefined;
36
+ status: boolean;
37
+ sortOrder: number;
38
+ name: { [key: string]: string };
39
+ description: { [key: string]: string };
40
+ metaTitle: { [key: string]: string };
41
+ metaDescription: { [key: string]: string };
42
+ metaKeywords: { [key: string]: string };
43
+ metaH1: { [key: string]: string };
44
+ guid1c?: string | undefined;
45
+ }
46
+
47
+ export interface CategoryResponse_NameEntry {
48
+ key: string;
49
+ value: string;
50
+ }
51
+
52
+ export interface CategoryResponse_DescriptionEntry {
53
+ key: string;
54
+ value: string;
55
+ }
56
+
57
+ export interface CategoryResponse_MetaTitleEntry {
58
+ key: string;
59
+ value: string;
60
+ }
61
+
62
+ export interface CategoryResponse_MetaDescriptionEntry {
63
+ key: string;
64
+ value: string;
65
+ }
66
+
67
+ export interface CategoryResponse_MetaKeywordsEntry {
68
+ key: string;
69
+ value: string;
70
+ }
71
+
72
+ export interface CategoryResponse_MetaH1Entry {
73
+ key: string;
74
+ value: string;
75
+ }
76
+
77
+ export interface GetCategoryRequest {
78
+ id: string;
79
+ slug?: string | undefined;
80
+ }
81
+
82
+ export interface CreateCategoryRequest {
83
+ parentId?: string | undefined;
84
+ slug: string;
85
+ image?: string | undefined;
86
+ status: boolean;
87
+ sortOrder: number;
88
+ name: { [key: string]: string };
89
+ description: { [key: string]: string };
90
+ metaTitle: { [key: string]: string };
91
+ metaDescription: { [key: string]: string };
92
+ metaKeywords: { [key: string]: string };
93
+ metaH1: { [key: string]: string };
94
+ guid1c?: string | undefined;
95
+ }
96
+
97
+ export interface CreateCategoryRequest_NameEntry {
98
+ key: string;
99
+ value: string;
100
+ }
101
+
102
+ export interface CreateCategoryRequest_DescriptionEntry {
103
+ key: string;
104
+ value: string;
105
+ }
106
+
107
+ export interface CreateCategoryRequest_MetaTitleEntry {
108
+ key: string;
109
+ value: string;
110
+ }
111
+
112
+ export interface CreateCategoryRequest_MetaDescriptionEntry {
113
+ key: string;
114
+ value: string;
115
+ }
116
+
117
+ export interface CreateCategoryRequest_MetaKeywordsEntry {
118
+ key: string;
119
+ value: string;
120
+ }
121
+
122
+ export interface CreateCategoryRequest_MetaH1Entry {
123
+ key: string;
124
+ value: string;
125
+ }
126
+
127
+ export interface UpdateCategoryRequest {
128
+ id: string;
129
+ parentId?: string | undefined;
130
+ slug?: string | undefined;
131
+ image?: string | undefined;
132
+ status?: boolean | undefined;
133
+ sortOrder?: number | undefined;
134
+ name: { [key: string]: string };
135
+ description: { [key: string]: string };
136
+ metaTitle: { [key: string]: string };
137
+ metaDescription: { [key: string]: string };
138
+ metaKeywords: { [key: string]: string };
139
+ metaH1: { [key: string]: string };
140
+ }
141
+
142
+ export interface UpdateCategoryRequest_NameEntry {
143
+ key: string;
144
+ value: string;
145
+ }
146
+
147
+ export interface UpdateCategoryRequest_DescriptionEntry {
148
+ key: string;
149
+ value: string;
150
+ }
151
+
152
+ export interface UpdateCategoryRequest_MetaTitleEntry {
153
+ key: string;
154
+ value: string;
155
+ }
156
+
157
+ export interface UpdateCategoryRequest_MetaDescriptionEntry {
158
+ key: string;
159
+ value: string;
160
+ }
161
+
162
+ export interface UpdateCategoryRequest_MetaKeywordsEntry {
163
+ key: string;
164
+ value: string;
165
+ }
166
+
167
+ export interface UpdateCategoryRequest_MetaH1Entry {
168
+ key: string;
169
+ value: string;
170
+ }
171
+
172
+ export interface DeleteCategoryRequest {
173
+ id: string;
174
+ }
175
+
176
+ export interface CategoryOrderItem {
177
+ id: string;
178
+ sortOrder: number;
179
+ parentId?: string | undefined;
180
+ }
181
+
182
+ export interface UpdateCategoryOrderRequest {
183
+ items: CategoryOrderItem[];
184
+ }
185
+
186
+ export const CATALOG_V1_PACKAGE_NAME = "catalog.v1";
187
+
188
+ export interface CategoryServiceClient {
189
+ getCategoryTree(request: GetCategoryTreeRequest): Observable<GetCategoryTreeResponse>;
190
+
191
+ getCategory(request: GetCategoryRequest): Observable<CategoryResponse>;
192
+
193
+ createCategory(request: CreateCategoryRequest): Observable<CategoryResponse>;
194
+
195
+ updateCategory(request: UpdateCategoryRequest): Observable<CategoryResponse>;
196
+
197
+ deleteCategory(request: DeleteCategoryRequest): Observable<DeleteResponse>;
198
+
199
+ updateCategoryOrder(request: UpdateCategoryOrderRequest): Observable<SuccessResponse>;
200
+ }
201
+
202
+ export interface CategoryServiceController {
203
+ getCategoryTree(
204
+ request: GetCategoryTreeRequest,
205
+ ): Promise<GetCategoryTreeResponse> | Observable<GetCategoryTreeResponse> | GetCategoryTreeResponse;
206
+
207
+ getCategory(request: GetCategoryRequest): Promise<CategoryResponse> | Observable<CategoryResponse> | CategoryResponse;
208
+
209
+ createCategory(
210
+ request: CreateCategoryRequest,
211
+ ): Promise<CategoryResponse> | Observable<CategoryResponse> | CategoryResponse;
212
+
213
+ updateCategory(
214
+ request: UpdateCategoryRequest,
215
+ ): Promise<CategoryResponse> | Observable<CategoryResponse> | CategoryResponse;
216
+
217
+ deleteCategory(request: DeleteCategoryRequest): Promise<DeleteResponse> | Observable<DeleteResponse> | DeleteResponse;
218
+
219
+ updateCategoryOrder(
220
+ request: UpdateCategoryOrderRequest,
221
+ ): Promise<SuccessResponse> | Observable<SuccessResponse> | SuccessResponse;
222
+ }
223
+
224
+ export function CategoryServiceControllerMethods() {
225
+ return function (constructor: Function) {
226
+ const grpcMethods: string[] = [
227
+ "getCategoryTree",
228
+ "getCategory",
229
+ "createCategory",
230
+ "updateCategory",
231
+ "deleteCategory",
232
+ "updateCategoryOrder",
233
+ ];
234
+ for (const method of grpcMethods) {
235
+ const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
236
+ GrpcMethod("CategoryService", method)(constructor.prototype[method], method, descriptor);
237
+ }
238
+ const grpcStreamMethods: string[] = [];
239
+ for (const method of grpcStreamMethods) {
240
+ const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
241
+ GrpcStreamMethod("CategoryService", method)(constructor.prototype[method], method, descriptor);
242
+ }
243
+ };
244
+ }
245
+
246
+ export const CATEGORY_SERVICE_NAME = "CategoryService";
package/gen/common.ts ADDED
@@ -0,0 +1,31 @@
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: common.proto
6
+
7
+ /* eslint-disable */
8
+
9
+ export const protobufPackage = "catalog.v1";
10
+
11
+ export interface SuccessResponse {
12
+ success: boolean;
13
+ }
14
+
15
+ export interface DeleteResponse {
16
+ success: boolean;
17
+ }
18
+
19
+ export interface PaginationRequest {
20
+ page: number;
21
+ limit: number;
22
+ }
23
+
24
+ export interface PaginationMeta {
25
+ totalItems: number;
26
+ totalPages: number;
27
+ currentPage: number;
28
+ perPage: number;
29
+ }
30
+
31
+ export const CATALOG_V1_PACKAGE_NAME = "catalog.v1";
package/gen/product.ts ADDED
@@ -0,0 +1,363 @@
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: product.proto
6
+
7
+ /* eslint-disable */
8
+ import { GrpcMethod, GrpcStreamMethod } from "@nestjs/microservices";
9
+ import { Observable } from "rxjs";
10
+ import { DeleteResponse, PaginationMeta, PaginationRequest, SuccessResponse } from "./common";
11
+
12
+ export const protobufPackage = "catalog.v1";
13
+
14
+ export enum ProductStatus {
15
+ PRODUCT_STATUS_UNSPECIFIED = 0,
16
+ PRODUCT_STATUS_DRAFT = 1,
17
+ PRODUCT_STATUS_ACTIVE = 2,
18
+ PRODUCT_STATUS_INACTIVE = 3,
19
+ PRODUCT_STATUS_ARCHIVED = 4,
20
+ UNRECOGNIZED = -1,
21
+ }
22
+
23
+ export interface ProductListItemResponse {
24
+ id: string;
25
+ sku: string;
26
+ slug: string;
27
+ status: ProductStatus;
28
+ name: { [key: string]: string };
29
+ mainImage: string;
30
+ price: number;
31
+ oldPrice?: number | undefined;
32
+ totalStock: number;
33
+ brandId?: string | undefined;
34
+ categoryIds: string[];
35
+ }
36
+
37
+ export interface ProductListItemResponse_NameEntry {
38
+ key: string;
39
+ value: string;
40
+ }
41
+
42
+ export interface ProductDetailResponse {
43
+ id: string;
44
+ sku: string;
45
+ slug: string;
46
+ status: ProductStatus;
47
+ sortOrder: number;
48
+ brandId?: string | undefined;
49
+ price: number;
50
+ oldPrice?: number | undefined;
51
+ name: { [key: string]: string };
52
+ shortDescription: { [key: string]: string };
53
+ description: { [key: string]: string };
54
+ composition: { [key: string]: string };
55
+ instructions: { [key: string]: string };
56
+ metaTitle: { [key: string]: string };
57
+ metaDescription: { [key: string]: string };
58
+ metaKeywords: { [key: string]: string };
59
+ mainImage: string;
60
+ videoUrl?: string | undefined;
61
+ guid1c?: string | undefined;
62
+ categoryIds: string[];
63
+ images: ProductImageResponse[];
64
+ warehouses: ProductWarehouseResponse[];
65
+ variants: ProductVariantResponse[];
66
+ attributes: ProductAttributeResponse[];
67
+ files: ProductFileResponse[];
68
+ }
69
+
70
+ export interface ProductDetailResponse_NameEntry {
71
+ key: string;
72
+ value: string;
73
+ }
74
+
75
+ export interface ProductDetailResponse_ShortDescriptionEntry {
76
+ key: string;
77
+ value: string;
78
+ }
79
+
80
+ export interface ProductDetailResponse_DescriptionEntry {
81
+ key: string;
82
+ value: string;
83
+ }
84
+
85
+ export interface ProductDetailResponse_CompositionEntry {
86
+ key: string;
87
+ value: string;
88
+ }
89
+
90
+ export interface ProductDetailResponse_InstructionsEntry {
91
+ key: string;
92
+ value: string;
93
+ }
94
+
95
+ export interface ProductDetailResponse_MetaTitleEntry {
96
+ key: string;
97
+ value: string;
98
+ }
99
+
100
+ export interface ProductDetailResponse_MetaDescriptionEntry {
101
+ key: string;
102
+ value: string;
103
+ }
104
+
105
+ export interface ProductDetailResponse_MetaKeywordsEntry {
106
+ key: string;
107
+ value: string;
108
+ }
109
+
110
+ export interface ProductImageResponse {
111
+ id: string;
112
+ url: string;
113
+ alt: { [key: string]: string };
114
+ sortOrder: number;
115
+ }
116
+
117
+ export interface ProductImageResponse_AltEntry {
118
+ key: string;
119
+ value: string;
120
+ }
121
+
122
+ export interface ProductWarehouseResponse {
123
+ warehouseId: string;
124
+ quantity: number;
125
+ }
126
+
127
+ export interface ProductVariantResponse {
128
+ id: string;
129
+ sku: string;
130
+ price?: number | undefined;
131
+ stock: number;
132
+ options: { [key: string]: string };
133
+ }
134
+
135
+ export interface ProductVariantResponse_OptionsEntry {
136
+ key: string;
137
+ value: string;
138
+ }
139
+
140
+ export interface ProductAttributeResponse {
141
+ attributeId: string;
142
+ attributeValueId: string;
143
+ }
144
+
145
+ export interface ProductFileResponse {
146
+ id: string;
147
+ url: string;
148
+ name: { [key: string]: string };
149
+ }
150
+
151
+ export interface ProductFileResponse_NameEntry {
152
+ key: string;
153
+ value: string;
154
+ }
155
+
156
+ export interface GetProductsRequest {
157
+ pagination: PaginationRequest | undefined;
158
+ search?: string | undefined;
159
+ categoryId?: string | undefined;
160
+ brandId?: string | undefined;
161
+ status?: ProductStatus | undefined;
162
+ inStock?: boolean | undefined;
163
+ priceMin?: number | undefined;
164
+ priceMax?: number | undefined;
165
+ sortBy?: string | undefined;
166
+ }
167
+
168
+ export interface GetProductsResponse {
169
+ items: ProductListItemResponse[];
170
+ meta: PaginationMeta | undefined;
171
+ }
172
+
173
+ export interface GetProductRequest {
174
+ id: string;
175
+ slug?: string | undefined;
176
+ sku?: string | undefined;
177
+ }
178
+
179
+ export interface CreateProductRequest {
180
+ sku: string;
181
+ slug: string;
182
+ status: ProductStatus;
183
+ brandId?: string | undefined;
184
+ price: number;
185
+ oldPrice?: number | undefined;
186
+ name: { [key: string]: string };
187
+ shortDescription: { [key: string]: string };
188
+ description: { [key: string]: string };
189
+ metaTitle: { [key: string]: string };
190
+ metaDescription: { [key: string]: string };
191
+ mainImage?: string | undefined;
192
+ guid1c?: string | undefined;
193
+ categoryIds: string[];
194
+ }
195
+
196
+ export interface CreateProductRequest_NameEntry {
197
+ key: string;
198
+ value: string;
199
+ }
200
+
201
+ export interface CreateProductRequest_ShortDescriptionEntry {
202
+ key: string;
203
+ value: string;
204
+ }
205
+
206
+ export interface CreateProductRequest_DescriptionEntry {
207
+ key: string;
208
+ value: string;
209
+ }
210
+
211
+ export interface CreateProductRequest_MetaTitleEntry {
212
+ key: string;
213
+ value: string;
214
+ }
215
+
216
+ export interface CreateProductRequest_MetaDescriptionEntry {
217
+ key: string;
218
+ value: string;
219
+ }
220
+
221
+ export interface UpdateProductRequest {
222
+ id: string;
223
+ sku?: string | undefined;
224
+ slug?: string | undefined;
225
+ status?: ProductStatus | undefined;
226
+ brandId?: string | undefined;
227
+ price?: number | undefined;
228
+ oldPrice?: number | undefined;
229
+ name: { [key: string]: string };
230
+ description: { [key: string]: string };
231
+ shortDescription: { [key: string]: string };
232
+ metaTitle: { [key: string]: string };
233
+ metaDescription: { [key: string]: string };
234
+ mainImage?: string | undefined;
235
+ categoryIds: string[];
236
+ }
237
+
238
+ export interface UpdateProductRequest_NameEntry {
239
+ key: string;
240
+ value: string;
241
+ }
242
+
243
+ export interface UpdateProductRequest_DescriptionEntry {
244
+ key: string;
245
+ value: string;
246
+ }
247
+
248
+ export interface UpdateProductRequest_ShortDescriptionEntry {
249
+ key: string;
250
+ value: string;
251
+ }
252
+
253
+ export interface UpdateProductRequest_MetaTitleEntry {
254
+ key: string;
255
+ value: string;
256
+ }
257
+
258
+ export interface UpdateProductRequest_MetaDescriptionEntry {
259
+ key: string;
260
+ value: string;
261
+ }
262
+
263
+ export interface DeleteProductRequest {
264
+ id: string;
265
+ }
266
+
267
+ export interface BulkUpdateStatusRequest {
268
+ productIds: string[];
269
+ status: ProductStatus;
270
+ }
271
+
272
+ export interface BulkUpdateCategoryRequest {
273
+ productIds: string[];
274
+ categoryId: string;
275
+ append: boolean;
276
+ }
277
+
278
+ export interface BulkUpdateDiscountRequest {
279
+ productIds: string[];
280
+ discountPercentage: number;
281
+ }
282
+
283
+ export const CATALOG_V1_PACKAGE_NAME = "catalog.v1";
284
+
285
+ export interface ProductServiceClient {
286
+ /** Базовий CRUD */
287
+
288
+ getProducts(request: GetProductsRequest): Observable<GetProductsResponse>;
289
+
290
+ getProduct(request: GetProductRequest): Observable<ProductDetailResponse>;
291
+
292
+ createProduct(request: CreateProductRequest): Observable<ProductDetailResponse>;
293
+
294
+ updateProduct(request: UpdateProductRequest): Observable<ProductDetailResponse>;
295
+
296
+ deleteProduct(request: DeleteProductRequest): Observable<DeleteResponse>;
297
+
298
+ bulkUpdateStatus(request: BulkUpdateStatusRequest): Observable<SuccessResponse>;
299
+
300
+ bulkUpdateCategory(request: BulkUpdateCategoryRequest): Observable<SuccessResponse>;
301
+
302
+ bulkUpdateDiscount(request: BulkUpdateDiscountRequest): Observable<SuccessResponse>;
303
+ }
304
+
305
+ export interface ProductServiceController {
306
+ /** Базовий CRUD */
307
+
308
+ getProducts(
309
+ request: GetProductsRequest,
310
+ ): Promise<GetProductsResponse> | Observable<GetProductsResponse> | GetProductsResponse;
311
+
312
+ getProduct(
313
+ request: GetProductRequest,
314
+ ): Promise<ProductDetailResponse> | Observable<ProductDetailResponse> | ProductDetailResponse;
315
+
316
+ createProduct(
317
+ request: CreateProductRequest,
318
+ ): Promise<ProductDetailResponse> | Observable<ProductDetailResponse> | ProductDetailResponse;
319
+
320
+ updateProduct(
321
+ request: UpdateProductRequest,
322
+ ): Promise<ProductDetailResponse> | Observable<ProductDetailResponse> | ProductDetailResponse;
323
+
324
+ deleteProduct(request: DeleteProductRequest): Promise<DeleteResponse> | Observable<DeleteResponse> | DeleteResponse;
325
+
326
+ bulkUpdateStatus(
327
+ request: BulkUpdateStatusRequest,
328
+ ): Promise<SuccessResponse> | Observable<SuccessResponse> | SuccessResponse;
329
+
330
+ bulkUpdateCategory(
331
+ request: BulkUpdateCategoryRequest,
332
+ ): Promise<SuccessResponse> | Observable<SuccessResponse> | SuccessResponse;
333
+
334
+ bulkUpdateDiscount(
335
+ request: BulkUpdateDiscountRequest,
336
+ ): Promise<SuccessResponse> | Observable<SuccessResponse> | SuccessResponse;
337
+ }
338
+
339
+ export function ProductServiceControllerMethods() {
340
+ return function (constructor: Function) {
341
+ const grpcMethods: string[] = [
342
+ "getProducts",
343
+ "getProduct",
344
+ "createProduct",
345
+ "updateProduct",
346
+ "deleteProduct",
347
+ "bulkUpdateStatus",
348
+ "bulkUpdateCategory",
349
+ "bulkUpdateDiscount",
350
+ ];
351
+ for (const method of grpcMethods) {
352
+ const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
353
+ GrpcMethod("ProductService", method)(constructor.prototype[method], method, descriptor);
354
+ }
355
+ const grpcStreamMethods: string[] = [];
356
+ for (const method of grpcStreamMethods) {
357
+ const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
358
+ GrpcStreamMethod("ProductService", method)(constructor.prototype[method], method, descriptor);
359
+ }
360
+ };
361
+ }
362
+
363
+ export const PRODUCT_SERVICE_NAME = "ProductService";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mamindom/contracts",
3
- "version": "1.0.15",
3
+ "version": "1.0.16",
4
4
  "description": "proto",
5
5
  "main": "./dist/index.js",
6
6
  "type": "./dist/index.d.ts",