@mamindom/contracts 1.0.18 → 1.0.19

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,301 @@
1
+ import { Observable } from "rxjs";
2
+ import { DeleteResponse, PaginationMeta, PaginationRequest, SuccessResponse } from "./common";
3
+ export declare const protobufPackage = "catalog.v1";
4
+ export declare enum ProductStatus {
5
+ PRODUCT_STATUS_UNSPECIFIED = 0,
6
+ PRODUCT_STATUS_DRAFT = 1,
7
+ PRODUCT_STATUS_ACTIVE = 2,
8
+ PRODUCT_STATUS_INACTIVE = 3,
9
+ PRODUCT_STATUS_ARCHIVED = 4,
10
+ UNRECOGNIZED = -1
11
+ }
12
+ export interface ProductListItemResponse {
13
+ id: string;
14
+ sku: string;
15
+ slug: string;
16
+ status: ProductStatus;
17
+ name: {
18
+ [key: string]: string;
19
+ };
20
+ mainImage: string;
21
+ price: number;
22
+ oldPrice?: number | undefined;
23
+ totalStock: number;
24
+ brandId?: string | undefined;
25
+ categoryIds: string[];
26
+ }
27
+ export interface ProductListItemResponse_NameEntry {
28
+ key: string;
29
+ value: string;
30
+ }
31
+ export interface ProductDetailResponse {
32
+ id: string;
33
+ sku: string;
34
+ slug: string;
35
+ status: ProductStatus;
36
+ sortOrder: number;
37
+ brandId?: string | undefined;
38
+ price: number;
39
+ oldPrice?: number | undefined;
40
+ name: {
41
+ [key: string]: string;
42
+ };
43
+ shortDescription: {
44
+ [key: string]: string;
45
+ };
46
+ description: {
47
+ [key: string]: string;
48
+ };
49
+ composition: {
50
+ [key: string]: string;
51
+ };
52
+ instructions: {
53
+ [key: string]: string;
54
+ };
55
+ metaTitle: {
56
+ [key: string]: string;
57
+ };
58
+ metaDescription: {
59
+ [key: string]: string;
60
+ };
61
+ metaKeywords: {
62
+ [key: string]: string;
63
+ };
64
+ mainImage: string;
65
+ videoUrl?: string | undefined;
66
+ guid1c?: string | undefined;
67
+ categoryIds: string[];
68
+ images: ProductImageResponse[];
69
+ warehouses: ProductWarehouseResponse[];
70
+ variants: ProductVariantResponse[];
71
+ attributes: ProductAttributeResponse[];
72
+ files: ProductFileResponse[];
73
+ }
74
+ export interface ProductDetailResponse_NameEntry {
75
+ key: string;
76
+ value: string;
77
+ }
78
+ export interface ProductDetailResponse_ShortDescriptionEntry {
79
+ key: string;
80
+ value: string;
81
+ }
82
+ export interface ProductDetailResponse_DescriptionEntry {
83
+ key: string;
84
+ value: string;
85
+ }
86
+ export interface ProductDetailResponse_CompositionEntry {
87
+ key: string;
88
+ value: string;
89
+ }
90
+ export interface ProductDetailResponse_InstructionsEntry {
91
+ key: string;
92
+ value: string;
93
+ }
94
+ export interface ProductDetailResponse_MetaTitleEntry {
95
+ key: string;
96
+ value: string;
97
+ }
98
+ export interface ProductDetailResponse_MetaDescriptionEntry {
99
+ key: string;
100
+ value: string;
101
+ }
102
+ export interface ProductDetailResponse_MetaKeywordsEntry {
103
+ key: string;
104
+ value: string;
105
+ }
106
+ export interface ProductImageResponse {
107
+ id: string;
108
+ url: string;
109
+ alt: {
110
+ [key: string]: string;
111
+ };
112
+ sortOrder: number;
113
+ }
114
+ export interface ProductImageResponse_AltEntry {
115
+ key: string;
116
+ value: string;
117
+ }
118
+ export interface ProductWarehouseResponse {
119
+ warehouseId: string;
120
+ quantity: number;
121
+ }
122
+ export interface ProductVariantResponse {
123
+ id: string;
124
+ sku: string;
125
+ price?: number | undefined;
126
+ stock: number;
127
+ options: {
128
+ [key: string]: string;
129
+ };
130
+ }
131
+ export interface ProductVariantResponse_OptionsEntry {
132
+ key: string;
133
+ value: string;
134
+ }
135
+ export interface ProductAttributeResponse {
136
+ attributeId: string;
137
+ attributeValueId: string;
138
+ }
139
+ export interface ProductFileResponse {
140
+ id: string;
141
+ url: string;
142
+ name: {
143
+ [key: string]: string;
144
+ };
145
+ }
146
+ export interface ProductFileResponse_NameEntry {
147
+ key: string;
148
+ value: string;
149
+ }
150
+ export interface GetProductsRequest {
151
+ pagination: PaginationRequest | undefined;
152
+ search?: string | undefined;
153
+ categoryId?: string | undefined;
154
+ brandId?: string | undefined;
155
+ status?: ProductStatus | undefined;
156
+ inStock?: boolean | undefined;
157
+ priceMin?: number | undefined;
158
+ priceMax?: number | undefined;
159
+ sortBy?: string | undefined;
160
+ }
161
+ export interface GetProductsResponse {
162
+ items: ProductListItemResponse[];
163
+ meta: PaginationMeta | undefined;
164
+ }
165
+ export interface GetProductRequest {
166
+ id: string;
167
+ slug?: string | undefined;
168
+ sku?: string | undefined;
169
+ }
170
+ export interface CreateProductRequest {
171
+ sku: string;
172
+ slug: string;
173
+ status: ProductStatus;
174
+ brandId?: string | undefined;
175
+ price: number;
176
+ oldPrice?: number | undefined;
177
+ name: {
178
+ [key: string]: string;
179
+ };
180
+ shortDescription: {
181
+ [key: string]: string;
182
+ };
183
+ description: {
184
+ [key: string]: string;
185
+ };
186
+ metaTitle: {
187
+ [key: string]: string;
188
+ };
189
+ metaDescription: {
190
+ [key: string]: string;
191
+ };
192
+ mainImage?: string | undefined;
193
+ guid1c?: string | undefined;
194
+ categoryIds: string[];
195
+ createdById: string;
196
+ }
197
+ export interface CreateProductRequest_NameEntry {
198
+ key: string;
199
+ value: string;
200
+ }
201
+ export interface CreateProductRequest_ShortDescriptionEntry {
202
+ key: string;
203
+ value: string;
204
+ }
205
+ export interface CreateProductRequest_DescriptionEntry {
206
+ key: string;
207
+ value: string;
208
+ }
209
+ export interface CreateProductRequest_MetaTitleEntry {
210
+ key: string;
211
+ value: string;
212
+ }
213
+ export interface CreateProductRequest_MetaDescriptionEntry {
214
+ key: string;
215
+ value: string;
216
+ }
217
+ export interface UpdateProductRequest {
218
+ id: string;
219
+ sku?: string | undefined;
220
+ slug?: string | undefined;
221
+ status?: ProductStatus | undefined;
222
+ brandId?: string | undefined;
223
+ price?: number | undefined;
224
+ oldPrice?: number | undefined;
225
+ name: {
226
+ [key: string]: string;
227
+ };
228
+ description: {
229
+ [key: string]: string;
230
+ };
231
+ shortDescription: {
232
+ [key: string]: string;
233
+ };
234
+ metaTitle: {
235
+ [key: string]: string;
236
+ };
237
+ metaDescription: {
238
+ [key: string]: string;
239
+ };
240
+ mainImage?: string | undefined;
241
+ categoryIds: string[];
242
+ }
243
+ export interface UpdateProductRequest_NameEntry {
244
+ key: string;
245
+ value: string;
246
+ }
247
+ export interface UpdateProductRequest_DescriptionEntry {
248
+ key: string;
249
+ value: string;
250
+ }
251
+ export interface UpdateProductRequest_ShortDescriptionEntry {
252
+ key: string;
253
+ value: string;
254
+ }
255
+ export interface UpdateProductRequest_MetaTitleEntry {
256
+ key: string;
257
+ value: string;
258
+ }
259
+ export interface UpdateProductRequest_MetaDescriptionEntry {
260
+ key: string;
261
+ value: string;
262
+ }
263
+ export interface DeleteProductRequest {
264
+ id: string;
265
+ }
266
+ export interface BulkUpdateStatusRequest {
267
+ productIds: string[];
268
+ status: ProductStatus;
269
+ }
270
+ export interface BulkUpdateCategoryRequest {
271
+ productIds: string[];
272
+ categoryId: string;
273
+ append: boolean;
274
+ }
275
+ export interface BulkUpdateDiscountRequest {
276
+ productIds: string[];
277
+ discountPercentage: number;
278
+ }
279
+ export declare const CATALOG_V1_PACKAGE_NAME = "catalog.v1";
280
+ export interface ProductServiceClient {
281
+ getProducts(request: GetProductsRequest): Observable<GetProductsResponse>;
282
+ getProduct(request: GetProductRequest): Observable<ProductDetailResponse>;
283
+ createProduct(request: CreateProductRequest): Observable<ProductDetailResponse>;
284
+ updateProduct(request: UpdateProductRequest): Observable<ProductDetailResponse>;
285
+ deleteProduct(request: DeleteProductRequest): Observable<DeleteResponse>;
286
+ bulkUpdateStatus(request: BulkUpdateStatusRequest): Observable<SuccessResponse>;
287
+ bulkUpdateCategory(request: BulkUpdateCategoryRequest): Observable<SuccessResponse>;
288
+ bulkUpdateDiscount(request: BulkUpdateDiscountRequest): Observable<SuccessResponse>;
289
+ }
290
+ export interface ProductServiceController {
291
+ getProducts(request: GetProductsRequest): Promise<GetProductsResponse> | Observable<GetProductsResponse> | GetProductsResponse;
292
+ getProduct(request: GetProductRequest): Promise<ProductDetailResponse> | Observable<ProductDetailResponse> | ProductDetailResponse;
293
+ createProduct(request: CreateProductRequest): Promise<ProductDetailResponse> | Observable<ProductDetailResponse> | ProductDetailResponse;
294
+ updateProduct(request: UpdateProductRequest): Promise<ProductDetailResponse> | Observable<ProductDetailResponse> | ProductDetailResponse;
295
+ deleteProduct(request: DeleteProductRequest): Promise<DeleteResponse> | Observable<DeleteResponse> | DeleteResponse;
296
+ bulkUpdateStatus(request: BulkUpdateStatusRequest): Promise<SuccessResponse> | Observable<SuccessResponse> | SuccessResponse;
297
+ bulkUpdateCategory(request: BulkUpdateCategoryRequest): Promise<SuccessResponse> | Observable<SuccessResponse> | SuccessResponse;
298
+ bulkUpdateDiscount(request: BulkUpdateDiscountRequest): Promise<SuccessResponse> | Observable<SuccessResponse> | SuccessResponse;
299
+ }
300
+ export declare function ProductServiceControllerMethods(): (constructor: Function) => void;
301
+ export declare const PRODUCT_SERVICE_NAME = "ProductService";
@@ -0,0 +1,46 @@
1
+ "use strict";
2
+ // Code generated by protoc-gen-ts_proto. DO NOT EDIT.
3
+ // versions:
4
+ // protoc-gen-ts_proto v2.11.4
5
+ // protoc v7.34.0
6
+ // source: product.proto
7
+ Object.defineProperty(exports, "__esModule", { value: true });
8
+ exports.PRODUCT_SERVICE_NAME = exports.CATALOG_V1_PACKAGE_NAME = exports.ProductStatus = exports.protobufPackage = void 0;
9
+ exports.ProductServiceControllerMethods = ProductServiceControllerMethods;
10
+ /* eslint-disable */
11
+ const microservices_1 = require("@nestjs/microservices");
12
+ exports.protobufPackage = "catalog.v1";
13
+ var ProductStatus;
14
+ (function (ProductStatus) {
15
+ ProductStatus[ProductStatus["PRODUCT_STATUS_UNSPECIFIED"] = 0] = "PRODUCT_STATUS_UNSPECIFIED";
16
+ ProductStatus[ProductStatus["PRODUCT_STATUS_DRAFT"] = 1] = "PRODUCT_STATUS_DRAFT";
17
+ ProductStatus[ProductStatus["PRODUCT_STATUS_ACTIVE"] = 2] = "PRODUCT_STATUS_ACTIVE";
18
+ ProductStatus[ProductStatus["PRODUCT_STATUS_INACTIVE"] = 3] = "PRODUCT_STATUS_INACTIVE";
19
+ ProductStatus[ProductStatus["PRODUCT_STATUS_ARCHIVED"] = 4] = "PRODUCT_STATUS_ARCHIVED";
20
+ ProductStatus[ProductStatus["UNRECOGNIZED"] = -1] = "UNRECOGNIZED";
21
+ })(ProductStatus || (exports.ProductStatus = ProductStatus = {}));
22
+ exports.CATALOG_V1_PACKAGE_NAME = "catalog.v1";
23
+ function ProductServiceControllerMethods() {
24
+ return function (constructor) {
25
+ const grpcMethods = [
26
+ "getProducts",
27
+ "getProduct",
28
+ "createProduct",
29
+ "updateProduct",
30
+ "deleteProduct",
31
+ "bulkUpdateStatus",
32
+ "bulkUpdateCategory",
33
+ "bulkUpdateDiscount",
34
+ ];
35
+ for (const method of grpcMethods) {
36
+ const descriptor = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
37
+ (0, microservices_1.GrpcMethod)("ProductService", method)(constructor.prototype[method], method, descriptor);
38
+ }
39
+ const grpcStreamMethods = [];
40
+ for (const method of grpcStreamMethods) {
41
+ const descriptor = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
42
+ (0, microservices_1.GrpcStreamMethod)("ProductService", method)(constructor.prototype[method], method, descriptor);
43
+ }
44
+ };
45
+ }
46
+ exports.PRODUCT_SERVICE_NAME = "ProductService";
@@ -0,0 +1,47 @@
1
+ import { Observable } from "rxjs";
2
+ export declare const protobufPackage = "users.v1";
3
+ export interface GetMeRequest {
4
+ id: string;
5
+ }
6
+ export interface GetMeResponse {
7
+ user: User | undefined;
8
+ }
9
+ export interface CreateUserRequest {
10
+ id: string;
11
+ firstName?: string | undefined;
12
+ lastName?: string | undefined;
13
+ email?: string | undefined;
14
+ phone?: string | undefined;
15
+ }
16
+ export interface CreateUserResponse {
17
+ ok: boolean;
18
+ }
19
+ export interface UpdateUserRequest {
20
+ id: string;
21
+ firstName?: string | undefined;
22
+ lastName?: string | undefined;
23
+ }
24
+ export interface UpdateUserResponse {
25
+ user: User | undefined;
26
+ }
27
+ export interface User {
28
+ id: string;
29
+ firstName: string;
30
+ lastName: string;
31
+ bonuses: number;
32
+ email?: string | undefined;
33
+ phone?: string | undefined;
34
+ }
35
+ export declare const USERS_V1_PACKAGE_NAME = "users.v1";
36
+ export interface UsersServiceClient {
37
+ getMe(request: GetMeRequest): Observable<GetMeResponse>;
38
+ createUser(request: CreateUserRequest): Observable<CreateUserResponse>;
39
+ updateUser(request: UpdateUserRequest): Observable<UpdateUserResponse>;
40
+ }
41
+ export interface UsersServiceController {
42
+ getMe(request: GetMeRequest): Promise<GetMeResponse> | Observable<GetMeResponse> | GetMeResponse;
43
+ createUser(request: CreateUserRequest): Promise<CreateUserResponse> | Observable<CreateUserResponse> | CreateUserResponse;
44
+ updateUser(request: UpdateUserRequest): Promise<UpdateUserResponse> | Observable<UpdateUserResponse> | UpdateUserResponse;
45
+ }
46
+ export declare function UsersServiceControllerMethods(): (constructor: Function) => void;
47
+ export declare const USERS_SERVICE_NAME = "UsersService";
@@ -0,0 +1,28 @@
1
+ "use strict";
2
+ // Code generated by protoc-gen-ts_proto. DO NOT EDIT.
3
+ // versions:
4
+ // protoc-gen-ts_proto v2.11.4
5
+ // protoc v7.34.0
6
+ // source: users.proto
7
+ Object.defineProperty(exports, "__esModule", { value: true });
8
+ exports.USERS_SERVICE_NAME = exports.USERS_V1_PACKAGE_NAME = exports.protobufPackage = void 0;
9
+ exports.UsersServiceControllerMethods = UsersServiceControllerMethods;
10
+ /* eslint-disable */
11
+ const microservices_1 = require("@nestjs/microservices");
12
+ exports.protobufPackage = "users.v1";
13
+ exports.USERS_V1_PACKAGE_NAME = "users.v1";
14
+ function UsersServiceControllerMethods() {
15
+ return function (constructor) {
16
+ const grpcMethods = ["getMe", "createUser", "updateUser"];
17
+ for (const method of grpcMethods) {
18
+ const descriptor = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
19
+ (0, microservices_1.GrpcMethod)("UsersService", method)(constructor.prototype[method], method, descriptor);
20
+ }
21
+ const grpcStreamMethods = [];
22
+ for (const method of grpcStreamMethods) {
23
+ const descriptor = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
24
+ (0, microservices_1.GrpcStreamMethod)("UsersService", method)(constructor.prototype[method], method, descriptor);
25
+ }
26
+ };
27
+ }
28
+ exports.USERS_SERVICE_NAME = "UsersService";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mamindom/contracts",
3
- "version": "1.0.18",
3
+ "version": "1.0.19",
4
4
  "description": "proto",
5
5
  "main": "./dist/index.js",
6
6
  "type": "./dist/index.d.ts",
package/gen/index.ts DELETED
@@ -1 +0,0 @@
1
- export * from './product'
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes