@mamindom/contracts 1.0.65 → 1.0.67

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.
@@ -15,6 +15,7 @@ exports.PROTO_PATHS = {
15
15
  SIZE_CHART: (0, node_path_1.join)(__dirname, '../../proto/size_chart.proto'),
16
16
  STICKER: (0, node_path_1.join)(__dirname, '../../proto/sticker.proto'),
17
17
  STOCK: (0, node_path_1.join)(__dirname, '../../proto/stock.proto'),
18
+ BUNDLE: (0, node_path_1.join)(__dirname, '../../proto/bundle.proto'),
18
19
  COMMON_PROMO: (0, node_path_1.join)(__dirname, '../../proto/common_promo.proto'),
19
20
  CALCULATION: (0, node_path_1.join)(__dirname, '../../proto/calculation.proto'),
20
21
  COUPON: (0, node_path_1.join)(__dirname, '../../proto/coupon.proto'),
package/gen/bundle.ts ADDED
@@ -0,0 +1,431 @@
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: bundle.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 BundleStatus {
15
+ BUNDLE_STATUS_UNSPECIFIED = 0,
16
+ BUNDLE_STATUS_DRAFT = 1,
17
+ BUNDLE_STATUS_ACTIVE = 2,
18
+ BUNDLE_STATUS_INACTIVE = 3,
19
+ UNRECOGNIZED = -1,
20
+ }
21
+
22
+ export enum DiscountType {
23
+ DISCOUNT_TYPE_UNSPECIFIED = 0,
24
+ DISCOUNT_TYPE_PERCENTAGE = 1,
25
+ DISCOUNT_TYPE_FIXED_AMOUNT = 2,
26
+ UNRECOGNIZED = -1,
27
+ }
28
+
29
+ export interface GetBundlesRequest {
30
+ pagination: PaginationRequest | undefined;
31
+ search?: string | undefined;
32
+ status?: BundleStatus | undefined;
33
+ productId?: string | undefined;
34
+ }
35
+
36
+ export interface GetBundleRequest {
37
+ id: string;
38
+ slug?: string | undefined;
39
+ }
40
+
41
+ export interface CreateBundleRequest {
42
+ slug?: string | undefined;
43
+ status: BundleStatus;
44
+ name: { [key: string]: string };
45
+ shortDescription: { [key: string]: string };
46
+ description: { [key: string]: string };
47
+ mainImage?: string | undefined;
48
+ mainImageId?: string | undefined;
49
+ discountType: DiscountType;
50
+ discountValue: number;
51
+ fixedPrice?: number | undefined;
52
+ isExclusive: boolean;
53
+ sortOrder?: number | undefined;
54
+ metaTitle: { [key: string]: string };
55
+ metaDescription: { [key: string]: string };
56
+ items: BundleItemPayload[];
57
+ createdById: string;
58
+ }
59
+
60
+ export interface CreateBundleRequest_NameEntry {
61
+ key: string;
62
+ value: string;
63
+ }
64
+
65
+ export interface CreateBundleRequest_ShortDescriptionEntry {
66
+ key: string;
67
+ value: string;
68
+ }
69
+
70
+ export interface CreateBundleRequest_DescriptionEntry {
71
+ key: string;
72
+ value: string;
73
+ }
74
+
75
+ export interface CreateBundleRequest_MetaTitleEntry {
76
+ key: string;
77
+ value: string;
78
+ }
79
+
80
+ export interface CreateBundleRequest_MetaDescriptionEntry {
81
+ key: string;
82
+ value: string;
83
+ }
84
+
85
+ export interface UpdateBundleRequest {
86
+ id: string;
87
+ slug?: string | undefined;
88
+ status?: BundleStatus | undefined;
89
+ name: { [key: string]: string };
90
+ shortDescription: { [key: string]: string };
91
+ description: { [key: string]: string };
92
+ mainImage?: string | undefined;
93
+ mainImageId?: string | undefined;
94
+ discountType?: DiscountType | undefined;
95
+ discountValue?: number | undefined;
96
+ fixedPrice?: number | undefined;
97
+ isExclusive?: boolean | undefined;
98
+ sortOrder?: number | undefined;
99
+ metaTitle: { [key: string]: string };
100
+ metaDescription: { [key: string]: string };
101
+ items: BundleItemPayload[];
102
+ }
103
+
104
+ export interface UpdateBundleRequest_NameEntry {
105
+ key: string;
106
+ value: string;
107
+ }
108
+
109
+ export interface UpdateBundleRequest_ShortDescriptionEntry {
110
+ key: string;
111
+ value: string;
112
+ }
113
+
114
+ export interface UpdateBundleRequest_DescriptionEntry {
115
+ key: string;
116
+ value: string;
117
+ }
118
+
119
+ export interface UpdateBundleRequest_MetaTitleEntry {
120
+ key: string;
121
+ value: string;
122
+ }
123
+
124
+ export interface UpdateBundleRequest_MetaDescriptionEntry {
125
+ key: string;
126
+ value: string;
127
+ }
128
+
129
+ export interface DeleteBundleRequest {
130
+ id: string;
131
+ }
132
+
133
+ export interface BundleItemPayload {
134
+ productId: string;
135
+ variantId?: string | undefined;
136
+ quantity: number;
137
+ itemDiscountType?: DiscountType | undefined;
138
+ itemDiscountValue?: number | undefined;
139
+ sortOrder: number;
140
+ }
141
+
142
+ export interface AddBundleItemRequest {
143
+ bundleId: string;
144
+ item: BundleItemPayload | undefined;
145
+ }
146
+
147
+ export interface RemoveBundleItemRequest {
148
+ bundleId: string;
149
+ itemId: string;
150
+ }
151
+
152
+ export interface UpdateBundleItemRequest {
153
+ bundleId: string;
154
+ itemId: string;
155
+ quantity?: number | undefined;
156
+ itemDiscountType?: DiscountType | undefined;
157
+ itemDiscountValue?: number | undefined;
158
+ sortOrder?: number | undefined;
159
+ }
160
+
161
+ export interface AddBundleRuleRequest {
162
+ bundleId: string;
163
+ ruleType: string;
164
+ targetId: string;
165
+ excludedProductIds: string[];
166
+ }
167
+
168
+ export interface RemoveBundleRuleRequest {
169
+ bundleId: string;
170
+ ruleId: string;
171
+ }
172
+
173
+ export interface GetBundlesByProductRequest {
174
+ productId: string;
175
+ status?: BundleStatus | undefined;
176
+ }
177
+
178
+ export interface BulkUpdateBundleStatusRequest {
179
+ bundleIds: string[];
180
+ status: BundleStatus;
181
+ }
182
+
183
+ export interface BulkDeleteBundlesRequest {
184
+ bundleIds: string[];
185
+ }
186
+
187
+ export interface CheckBundleAvailabilityRequest {
188
+ bundleId: string;
189
+ }
190
+
191
+ export interface GetBundlesResponse {
192
+ items: BundleListItemResponse[];
193
+ meta: PaginationMeta | undefined;
194
+ }
195
+
196
+ export interface BundleListItemResponse {
197
+ id: string;
198
+ slug: string;
199
+ status: BundleStatus;
200
+ name: { [key: string]: string };
201
+ mainImage: string;
202
+ discountType: DiscountType;
203
+ discountValue: number;
204
+ fixedPrice?: number | undefined;
205
+ isExclusive: boolean;
206
+ sortOrder: number;
207
+ itemCount: number;
208
+ originalPrice: number;
209
+ finalPrice: number;
210
+ inStock: boolean;
211
+ }
212
+
213
+ export interface BundleListItemResponse_NameEntry {
214
+ key: string;
215
+ value: string;
216
+ }
217
+
218
+ export interface BundleDetailResponse {
219
+ id: string;
220
+ slug: string;
221
+ status: BundleStatus;
222
+ sortOrder: number;
223
+ name: { [key: string]: string };
224
+ shortDescription: { [key: string]: string };
225
+ description: { [key: string]: string };
226
+ mainImage: string;
227
+ mainImageId?: string | undefined;
228
+ discountType: DiscountType;
229
+ discountValue: number;
230
+ fixedPrice?: number | undefined;
231
+ isExclusive: boolean;
232
+ metaTitle: { [key: string]: string };
233
+ metaDescription: { [key: string]: string };
234
+ items: BundleItemResponse[];
235
+ rules: BundleRuleResponse[];
236
+ originalPrice: number;
237
+ finalPrice: number;
238
+ inStock: boolean;
239
+ }
240
+
241
+ export interface BundleDetailResponse_NameEntry {
242
+ key: string;
243
+ value: string;
244
+ }
245
+
246
+ export interface BundleDetailResponse_ShortDescriptionEntry {
247
+ key: string;
248
+ value: string;
249
+ }
250
+
251
+ export interface BundleDetailResponse_DescriptionEntry {
252
+ key: string;
253
+ value: string;
254
+ }
255
+
256
+ export interface BundleDetailResponse_MetaTitleEntry {
257
+ key: string;
258
+ value: string;
259
+ }
260
+
261
+ export interface BundleDetailResponse_MetaDescriptionEntry {
262
+ key: string;
263
+ value: string;
264
+ }
265
+
266
+ export interface BundleItemResponse {
267
+ id: string;
268
+ productId: string;
269
+ variantId?: string | undefined;
270
+ quantity: number;
271
+ itemDiscountType?: DiscountType | undefined;
272
+ itemDiscountValue?: number | undefined;
273
+ sortOrder: number;
274
+ productName: { [key: string]: string };
275
+ productImage: string;
276
+ productSku: string;
277
+ productPrice: number;
278
+ productStock: number;
279
+ itemFinalPrice: number;
280
+ }
281
+
282
+ export interface BundleItemResponse_ProductNameEntry {
283
+ key: string;
284
+ value: string;
285
+ }
286
+
287
+ export interface BundleRuleResponse {
288
+ id: string;
289
+ ruleType: string;
290
+ targetId: string;
291
+ excludedProductIds: string[];
292
+ targetName: { [key: string]: string };
293
+ }
294
+
295
+ export interface BundleRuleResponse_TargetNameEntry {
296
+ key: string;
297
+ value: string;
298
+ }
299
+
300
+ export interface BundleAvailabilityResponse {
301
+ available: boolean;
302
+ items: BundleItemAvailability[];
303
+ }
304
+
305
+ export interface BundleItemAvailability {
306
+ productId: string;
307
+ variantId?: string | undefined;
308
+ requiredQuantity: number;
309
+ availableQuantity: number;
310
+ inStock: boolean;
311
+ }
312
+
313
+ export const CATALOG_V1_PACKAGE_NAME = "catalog.v1";
314
+
315
+ export interface BundleServiceClient {
316
+ getBundles(request: GetBundlesRequest): Observable<GetBundlesResponse>;
317
+
318
+ getBundle(request: GetBundleRequest): Observable<BundleDetailResponse>;
319
+
320
+ createBundle(request: CreateBundleRequest): Observable<BundleDetailResponse>;
321
+
322
+ updateBundle(request: UpdateBundleRequest): Observable<BundleDetailResponse>;
323
+
324
+ deleteBundle(request: DeleteBundleRequest): Observable<DeleteResponse>;
325
+
326
+ addBundleItem(request: AddBundleItemRequest): Observable<BundleDetailResponse>;
327
+
328
+ removeBundleItem(request: RemoveBundleItemRequest): Observable<BundleDetailResponse>;
329
+
330
+ updateBundleItem(request: UpdateBundleItemRequest): Observable<BundleDetailResponse>;
331
+
332
+ addBundleRule(request: AddBundleRuleRequest): Observable<SuccessResponse>;
333
+
334
+ removeBundleRule(request: RemoveBundleRuleRequest): Observable<SuccessResponse>;
335
+
336
+ getBundlesByProduct(request: GetBundlesByProductRequest): Observable<GetBundlesResponse>;
337
+
338
+ bulkUpdateBundleStatus(request: BulkUpdateBundleStatusRequest): Observable<SuccessResponse>;
339
+
340
+ bulkDeleteBundles(request: BulkDeleteBundlesRequest): Observable<SuccessResponse>;
341
+
342
+ checkBundleAvailability(request: CheckBundleAvailabilityRequest): Observable<BundleAvailabilityResponse>;
343
+ }
344
+
345
+ export interface BundleServiceController {
346
+ getBundles(
347
+ request: GetBundlesRequest,
348
+ ): Promise<GetBundlesResponse> | Observable<GetBundlesResponse> | GetBundlesResponse;
349
+
350
+ getBundle(
351
+ request: GetBundleRequest,
352
+ ): Promise<BundleDetailResponse> | Observable<BundleDetailResponse> | BundleDetailResponse;
353
+
354
+ createBundle(
355
+ request: CreateBundleRequest,
356
+ ): Promise<BundleDetailResponse> | Observable<BundleDetailResponse> | BundleDetailResponse;
357
+
358
+ updateBundle(
359
+ request: UpdateBundleRequest,
360
+ ): Promise<BundleDetailResponse> | Observable<BundleDetailResponse> | BundleDetailResponse;
361
+
362
+ deleteBundle(request: DeleteBundleRequest): Promise<DeleteResponse> | Observable<DeleteResponse> | DeleteResponse;
363
+
364
+ addBundleItem(
365
+ request: AddBundleItemRequest,
366
+ ): Promise<BundleDetailResponse> | Observable<BundleDetailResponse> | BundleDetailResponse;
367
+
368
+ removeBundleItem(
369
+ request: RemoveBundleItemRequest,
370
+ ): Promise<BundleDetailResponse> | Observable<BundleDetailResponse> | BundleDetailResponse;
371
+
372
+ updateBundleItem(
373
+ request: UpdateBundleItemRequest,
374
+ ): Promise<BundleDetailResponse> | Observable<BundleDetailResponse> | BundleDetailResponse;
375
+
376
+ addBundleRule(
377
+ request: AddBundleRuleRequest,
378
+ ): Promise<SuccessResponse> | Observable<SuccessResponse> | SuccessResponse;
379
+
380
+ removeBundleRule(
381
+ request: RemoveBundleRuleRequest,
382
+ ): Promise<SuccessResponse> | Observable<SuccessResponse> | SuccessResponse;
383
+
384
+ getBundlesByProduct(
385
+ request: GetBundlesByProductRequest,
386
+ ): Promise<GetBundlesResponse> | Observable<GetBundlesResponse> | GetBundlesResponse;
387
+
388
+ bulkUpdateBundleStatus(
389
+ request: BulkUpdateBundleStatusRequest,
390
+ ): Promise<SuccessResponse> | Observable<SuccessResponse> | SuccessResponse;
391
+
392
+ bulkDeleteBundles(
393
+ request: BulkDeleteBundlesRequest,
394
+ ): Promise<SuccessResponse> | Observable<SuccessResponse> | SuccessResponse;
395
+
396
+ checkBundleAvailability(
397
+ request: CheckBundleAvailabilityRequest,
398
+ ): Promise<BundleAvailabilityResponse> | Observable<BundleAvailabilityResponse> | BundleAvailabilityResponse;
399
+ }
400
+
401
+ export function BundleServiceControllerMethods() {
402
+ return function (constructor: Function) {
403
+ const grpcMethods: string[] = [
404
+ "getBundles",
405
+ "getBundle",
406
+ "createBundle",
407
+ "updateBundle",
408
+ "deleteBundle",
409
+ "addBundleItem",
410
+ "removeBundleItem",
411
+ "updateBundleItem",
412
+ "addBundleRule",
413
+ "removeBundleRule",
414
+ "getBundlesByProduct",
415
+ "bulkUpdateBundleStatus",
416
+ "bulkDeleteBundles",
417
+ "checkBundleAvailability",
418
+ ];
419
+ for (const method of grpcMethods) {
420
+ const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
421
+ GrpcMethod("BundleService", method)(constructor.prototype[method], method, descriptor);
422
+ }
423
+ const grpcStreamMethods: string[] = [];
424
+ for (const method of grpcStreamMethods) {
425
+ const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
426
+ GrpcStreamMethod("BundleService", method)(constructor.prototype[method], method, descriptor);
427
+ }
428
+ };
429
+ }
430
+
431
+ export const BUNDLE_SERVICE_NAME = "BundleService";
package/gen/size_chart.ts CHANGED
@@ -15,6 +15,8 @@ export interface SizeChartResponse {
15
15
  id: string;
16
16
  name: { [key: string]: string };
17
17
  content: string;
18
+ imageUrl: string;
19
+ imageId: string;
18
20
  }
19
21
 
20
22
  export interface SizeChartResponse_NameEntry {
@@ -34,6 +36,8 @@ export interface GetSizeChartRequest {
34
36
  export interface CreateSizeChartRequest {
35
37
  name: { [key: string]: string };
36
38
  content: string;
39
+ imageUrl: string;
40
+ imageId: string;
37
41
  }
38
42
 
39
43
  export interface CreateSizeChartRequest_NameEntry {
@@ -45,6 +49,8 @@ export interface UpdateSizeChartRequest {
45
49
  id: string;
46
50
  name: { [key: string]: string };
47
51
  content: string;
52
+ imageUrl: string;
53
+ imageId: string;
48
54
  }
49
55
 
50
56
  export interface UpdateSizeChartRequest_NameEntry {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@mamindom/contracts",
3
3
  "description": "proto",
4
- "version": "1.0.65",
4
+ "version": "1.0.67",
5
5
  "main": "./dist/src/index.js",
6
6
  "types": "./dist/src/index.d.ts",
7
7
  "exports": {