@mamindom/contracts 1.0.103 → 1.0.104

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.
@@ -39,6 +39,14 @@ export declare enum RuleOperator {
39
39
  RULE_OPERATOR_ALL = 1,
40
40
  UNRECOGNIZED = -1
41
41
  }
42
+ export declare enum BundleRelatedType {
43
+ BUNDLE_RELATED_TYPE_UNSPECIFIED = 0,
44
+ BUNDLE_RELATED_TYPE_CROSS_SELL = 1,
45
+ BUNDLE_RELATED_TYPE_UP_SELL = 2,
46
+ BUNDLE_RELATED_TYPE_BOUGHT_TOGETHER = 3,
47
+ BUNDLE_RELATED_TYPE_POPULAR = 4,
48
+ UNRECOGNIZED = -1
49
+ }
42
50
  export interface GetBundlesRequest {
43
51
  pagination: PaginationRequest | undefined;
44
52
  search?: string | undefined;
@@ -398,6 +406,42 @@ export interface BundleLookupResult {
398
406
  export interface BulkLookupBundlesResponse {
399
407
  results: BundleLookupResult[];
400
408
  }
409
+ export interface BundleRelatedItem {
410
+ productId: string;
411
+ sku: string;
412
+ slug: string;
413
+ name: {
414
+ [key: string]: string;
415
+ };
416
+ mainImage: string;
417
+ price: number;
418
+ totalStock: number;
419
+ type: BundleRelatedType;
420
+ }
421
+ export interface BundleRelatedItem_NameEntry {
422
+ key: string;
423
+ value: string;
424
+ }
425
+ export interface GetBundleRelatedProductsRequest {
426
+ bundleId: string;
427
+ type?: BundleRelatedType | undefined;
428
+ }
429
+ export interface GetBundleRelatedProductsResponse {
430
+ crossSell: BundleRelatedItem[];
431
+ upSell: BundleRelatedItem[];
432
+ boughtTogether: BundleRelatedItem[];
433
+ popular: BundleRelatedItem[];
434
+ }
435
+ export interface SetBundleRelatedProductsRequest {
436
+ bundleId: string;
437
+ type: BundleRelatedType;
438
+ relatedProductIds: string[];
439
+ }
440
+ export interface RemoveBundleRelatedProductRequest {
441
+ bundleId: string;
442
+ relatedProductId: string;
443
+ type: BundleRelatedType;
444
+ }
401
445
  export declare const CATALOG_V1_PACKAGE_NAME = "catalog.v1";
402
446
  export interface BundleServiceClient {
403
447
  getBundles(request: GetBundlesRequest): Observable<GetBundlesResponse>;
@@ -421,6 +465,9 @@ export interface BundleServiceClient {
421
465
  addCrossSellLink(request: AddCrossSellLinkRequest): Observable<SuccessResponse>;
422
466
  generateBundleCollage(request: GenerateBundleCollageRequest): Observable<GenerateBundleCollageResponse>;
423
467
  bulkLookupBundles(request: BulkLookupBundlesRequest): Observable<BulkLookupBundlesResponse>;
468
+ getBundleRelatedProducts(request: GetBundleRelatedProductsRequest): Observable<GetBundleRelatedProductsResponse>;
469
+ setBundleRelatedProducts(request: SetBundleRelatedProductsRequest): Observable<SuccessResponse>;
470
+ removeBundleRelatedProduct(request: RemoveBundleRelatedProductRequest): Observable<SuccessResponse>;
424
471
  }
425
472
  export interface BundleServiceController {
426
473
  getBundles(request: GetBundlesRequest): Promise<GetBundlesResponse> | Observable<GetBundlesResponse> | GetBundlesResponse;
@@ -444,6 +491,9 @@ export interface BundleServiceController {
444
491
  addCrossSellLink(request: AddCrossSellLinkRequest): Promise<SuccessResponse> | Observable<SuccessResponse> | SuccessResponse;
445
492
  generateBundleCollage(request: GenerateBundleCollageRequest): Promise<GenerateBundleCollageResponse> | Observable<GenerateBundleCollageResponse> | GenerateBundleCollageResponse;
446
493
  bulkLookupBundles(request: BulkLookupBundlesRequest): Promise<BulkLookupBundlesResponse> | Observable<BulkLookupBundlesResponse> | BulkLookupBundlesResponse;
494
+ getBundleRelatedProducts(request: GetBundleRelatedProductsRequest): Promise<GetBundleRelatedProductsResponse> | Observable<GetBundleRelatedProductsResponse> | GetBundleRelatedProductsResponse;
495
+ setBundleRelatedProducts(request: SetBundleRelatedProductsRequest): Promise<SuccessResponse> | Observable<SuccessResponse> | SuccessResponse;
496
+ removeBundleRelatedProduct(request: RemoveBundleRelatedProductRequest): Promise<SuccessResponse> | Observable<SuccessResponse> | SuccessResponse;
447
497
  }
448
498
  export declare function BundleServiceControllerMethods(): (constructor: Function) => void;
449
499
  export declare const BUNDLE_SERVICE_NAME = "BundleService";
@@ -5,7 +5,7 @@
5
5
  // protoc v3.21.12
6
6
  // source: bundle.proto
7
7
  Object.defineProperty(exports, "__esModule", { value: true });
8
- exports.BUNDLE_SERVICE_NAME = exports.CATALOG_V1_PACKAGE_NAME = exports.RuleOperator = exports.BundleType = exports.PriceMode = exports.DisplayPlacement = exports.DiscountType = exports.BundleStatus = exports.protobufPackage = void 0;
8
+ exports.BUNDLE_SERVICE_NAME = exports.CATALOG_V1_PACKAGE_NAME = exports.BundleRelatedType = exports.RuleOperator = exports.BundleType = exports.PriceMode = exports.DisplayPlacement = exports.DiscountType = exports.BundleStatus = exports.protobufPackage = void 0;
9
9
  exports.BundleServiceControllerMethods = BundleServiceControllerMethods;
10
10
  /* eslint-disable */
11
11
  const microservices_1 = require("@nestjs/microservices");
@@ -54,6 +54,15 @@ var RuleOperator;
54
54
  RuleOperator[RuleOperator["RULE_OPERATOR_ALL"] = 1] = "RULE_OPERATOR_ALL";
55
55
  RuleOperator[RuleOperator["UNRECOGNIZED"] = -1] = "UNRECOGNIZED";
56
56
  })(RuleOperator || (exports.RuleOperator = RuleOperator = {}));
57
+ var BundleRelatedType;
58
+ (function (BundleRelatedType) {
59
+ BundleRelatedType[BundleRelatedType["BUNDLE_RELATED_TYPE_UNSPECIFIED"] = 0] = "BUNDLE_RELATED_TYPE_UNSPECIFIED";
60
+ BundleRelatedType[BundleRelatedType["BUNDLE_RELATED_TYPE_CROSS_SELL"] = 1] = "BUNDLE_RELATED_TYPE_CROSS_SELL";
61
+ BundleRelatedType[BundleRelatedType["BUNDLE_RELATED_TYPE_UP_SELL"] = 2] = "BUNDLE_RELATED_TYPE_UP_SELL";
62
+ BundleRelatedType[BundleRelatedType["BUNDLE_RELATED_TYPE_BOUGHT_TOGETHER"] = 3] = "BUNDLE_RELATED_TYPE_BOUGHT_TOGETHER";
63
+ BundleRelatedType[BundleRelatedType["BUNDLE_RELATED_TYPE_POPULAR"] = 4] = "BUNDLE_RELATED_TYPE_POPULAR";
64
+ BundleRelatedType[BundleRelatedType["UNRECOGNIZED"] = -1] = "UNRECOGNIZED";
65
+ })(BundleRelatedType || (exports.BundleRelatedType = BundleRelatedType = {}));
57
66
  exports.CATALOG_V1_PACKAGE_NAME = "catalog.v1";
58
67
  function BundleServiceControllerMethods() {
59
68
  return function (constructor) {
@@ -79,6 +88,9 @@ function BundleServiceControllerMethods() {
79
88
  "addCrossSellLink",
80
89
  "generateBundleCollage",
81
90
  "bulkLookupBundles",
91
+ "getBundleRelatedProducts",
92
+ "setBundleRelatedProducts",
93
+ "removeBundleRelatedProduct",
82
94
  ];
83
95
  for (const method of grpcMethods) {
84
96
  const descriptor = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
@@ -35,6 +35,10 @@ service BundleService {
35
35
  rpc GenerateBundleCollage (GenerateBundleCollageRequest) returns (GenerateBundleCollageResponse);
36
36
 
37
37
  rpc BulkLookupBundles (BulkLookupBundlesRequest) returns (BulkLookupBundlesResponse);
38
+
39
+ rpc GetBundleRelatedProducts (GetBundleRelatedProductsRequest) returns (GetBundleRelatedProductsResponse);
40
+ rpc SetBundleRelatedProducts (SetBundleRelatedProductsRequest) returns (SuccessResponse);
41
+ rpc RemoveBundleRelatedProduct (RemoveBundleRelatedProductRequest) returns (SuccessResponse);
38
42
  }
39
43
 
40
44
 
@@ -390,3 +394,48 @@ message BundleLookupResult {
390
394
  message BulkLookupBundlesResponse {
391
395
  repeated BundleLookupResult results = 1;
392
396
  }
397
+
398
+ // ── Bundle Related Products ──────────────────────────────────────────────────
399
+
400
+ enum BundleRelatedType {
401
+ BUNDLE_RELATED_TYPE_UNSPECIFIED = 0;
402
+ BUNDLE_RELATED_TYPE_CROSS_SELL = 1;
403
+ BUNDLE_RELATED_TYPE_UP_SELL = 2;
404
+ BUNDLE_RELATED_TYPE_BOUGHT_TOGETHER = 3;
405
+ BUNDLE_RELATED_TYPE_POPULAR = 4;
406
+ }
407
+
408
+ message BundleRelatedItem {
409
+ string product_id = 1;
410
+ string sku = 2;
411
+ string slug = 3;
412
+ map<string, string> name = 4;
413
+ string main_image = 5;
414
+ double price = 6;
415
+ int32 total_stock = 7;
416
+ BundleRelatedType type = 8;
417
+ }
418
+
419
+ message GetBundleRelatedProductsRequest {
420
+ string bundle_id = 1;
421
+ optional BundleRelatedType type = 2;
422
+ }
423
+
424
+ message GetBundleRelatedProductsResponse {
425
+ repeated BundleRelatedItem cross_sell = 1;
426
+ repeated BundleRelatedItem up_sell = 2;
427
+ repeated BundleRelatedItem bought_together = 3;
428
+ repeated BundleRelatedItem popular = 4;
429
+ }
430
+
431
+ message SetBundleRelatedProductsRequest {
432
+ string bundle_id = 1;
433
+ BundleRelatedType type = 2;
434
+ repeated string related_product_ids = 3;
435
+ }
436
+
437
+ message RemoveBundleRelatedProductRequest {
438
+ string bundle_id = 1;
439
+ string related_product_id = 2;
440
+ BundleRelatedType type = 3;
441
+ }
package/gen/bundle.ts CHANGED
@@ -55,6 +55,15 @@ export enum RuleOperator {
55
55
  UNRECOGNIZED = -1,
56
56
  }
57
57
 
58
+ export enum BundleRelatedType {
59
+ BUNDLE_RELATED_TYPE_UNSPECIFIED = 0,
60
+ BUNDLE_RELATED_TYPE_CROSS_SELL = 1,
61
+ BUNDLE_RELATED_TYPE_UP_SELL = 2,
62
+ BUNDLE_RELATED_TYPE_BOUGHT_TOGETHER = 3,
63
+ BUNDLE_RELATED_TYPE_POPULAR = 4,
64
+ UNRECOGNIZED = -1,
65
+ }
66
+
58
67
  export interface GetBundlesRequest {
59
68
  pagination: PaginationRequest | undefined;
60
69
  search?: string | undefined;
@@ -431,6 +440,46 @@ export interface BulkLookupBundlesResponse {
431
440
  results: BundleLookupResult[];
432
441
  }
433
442
 
443
+ export interface BundleRelatedItem {
444
+ productId: string;
445
+ sku: string;
446
+ slug: string;
447
+ name: { [key: string]: string };
448
+ mainImage: string;
449
+ price: number;
450
+ totalStock: number;
451
+ type: BundleRelatedType;
452
+ }
453
+
454
+ export interface BundleRelatedItem_NameEntry {
455
+ key: string;
456
+ value: string;
457
+ }
458
+
459
+ export interface GetBundleRelatedProductsRequest {
460
+ bundleId: string;
461
+ type?: BundleRelatedType | undefined;
462
+ }
463
+
464
+ export interface GetBundleRelatedProductsResponse {
465
+ crossSell: BundleRelatedItem[];
466
+ upSell: BundleRelatedItem[];
467
+ boughtTogether: BundleRelatedItem[];
468
+ popular: BundleRelatedItem[];
469
+ }
470
+
471
+ export interface SetBundleRelatedProductsRequest {
472
+ bundleId: string;
473
+ type: BundleRelatedType;
474
+ relatedProductIds: string[];
475
+ }
476
+
477
+ export interface RemoveBundleRelatedProductRequest {
478
+ bundleId: string;
479
+ relatedProductId: string;
480
+ type: BundleRelatedType;
481
+ }
482
+
434
483
  export const CATALOG_V1_PACKAGE_NAME = "catalog.v1";
435
484
 
436
485
  export interface BundleServiceClient {
@@ -475,6 +524,12 @@ export interface BundleServiceClient {
475
524
  generateBundleCollage(request: GenerateBundleCollageRequest): Observable<GenerateBundleCollageResponse>;
476
525
 
477
526
  bulkLookupBundles(request: BulkLookupBundlesRequest): Observable<BulkLookupBundlesResponse>;
527
+
528
+ getBundleRelatedProducts(request: GetBundleRelatedProductsRequest): Observable<GetBundleRelatedProductsResponse>;
529
+
530
+ setBundleRelatedProducts(request: SetBundleRelatedProductsRequest): Observable<SuccessResponse>;
531
+
532
+ removeBundleRelatedProduct(request: RemoveBundleRelatedProductRequest): Observable<SuccessResponse>;
478
533
  }
479
534
 
480
535
  export interface BundleServiceController {
@@ -559,6 +614,21 @@ export interface BundleServiceController {
559
614
  bulkLookupBundles(
560
615
  request: BulkLookupBundlesRequest,
561
616
  ): Promise<BulkLookupBundlesResponse> | Observable<BulkLookupBundlesResponse> | BulkLookupBundlesResponse;
617
+
618
+ getBundleRelatedProducts(
619
+ request: GetBundleRelatedProductsRequest,
620
+ ):
621
+ | Promise<GetBundleRelatedProductsResponse>
622
+ | Observable<GetBundleRelatedProductsResponse>
623
+ | GetBundleRelatedProductsResponse;
624
+
625
+ setBundleRelatedProducts(
626
+ request: SetBundleRelatedProductsRequest,
627
+ ): Promise<SuccessResponse> | Observable<SuccessResponse> | SuccessResponse;
628
+
629
+ removeBundleRelatedProduct(
630
+ request: RemoveBundleRelatedProductRequest,
631
+ ): Promise<SuccessResponse> | Observable<SuccessResponse> | SuccessResponse;
562
632
  }
563
633
 
564
634
  export function BundleServiceControllerMethods() {
@@ -585,6 +655,9 @@ export function BundleServiceControllerMethods() {
585
655
  "addCrossSellLink",
586
656
  "generateBundleCollage",
587
657
  "bulkLookupBundles",
658
+ "getBundleRelatedProducts",
659
+ "setBundleRelatedProducts",
660
+ "removeBundleRelatedProduct",
588
661
  ];
589
662
  for (const method of grpcMethods) {
590
663
  const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@mamindom/contracts",
3
3
  "description": "proto",
4
- "version": "1.0.103",
4
+ "version": "1.0.104",
5
5
  "main": "./dist/src/index.js",
6
6
  "types": "./dist/src/index.d.ts",
7
7
  "exports": {
@@ -35,6 +35,10 @@ service BundleService {
35
35
  rpc GenerateBundleCollage (GenerateBundleCollageRequest) returns (GenerateBundleCollageResponse);
36
36
 
37
37
  rpc BulkLookupBundles (BulkLookupBundlesRequest) returns (BulkLookupBundlesResponse);
38
+
39
+ rpc GetBundleRelatedProducts (GetBundleRelatedProductsRequest) returns (GetBundleRelatedProductsResponse);
40
+ rpc SetBundleRelatedProducts (SetBundleRelatedProductsRequest) returns (SuccessResponse);
41
+ rpc RemoveBundleRelatedProduct (RemoveBundleRelatedProductRequest) returns (SuccessResponse);
38
42
  }
39
43
 
40
44
 
@@ -390,3 +394,48 @@ message BundleLookupResult {
390
394
  message BulkLookupBundlesResponse {
391
395
  repeated BundleLookupResult results = 1;
392
396
  }
397
+
398
+ // ── Bundle Related Products ──────────────────────────────────────────────────
399
+
400
+ enum BundleRelatedType {
401
+ BUNDLE_RELATED_TYPE_UNSPECIFIED = 0;
402
+ BUNDLE_RELATED_TYPE_CROSS_SELL = 1;
403
+ BUNDLE_RELATED_TYPE_UP_SELL = 2;
404
+ BUNDLE_RELATED_TYPE_BOUGHT_TOGETHER = 3;
405
+ BUNDLE_RELATED_TYPE_POPULAR = 4;
406
+ }
407
+
408
+ message BundleRelatedItem {
409
+ string product_id = 1;
410
+ string sku = 2;
411
+ string slug = 3;
412
+ map<string, string> name = 4;
413
+ string main_image = 5;
414
+ double price = 6;
415
+ int32 total_stock = 7;
416
+ BundleRelatedType type = 8;
417
+ }
418
+
419
+ message GetBundleRelatedProductsRequest {
420
+ string bundle_id = 1;
421
+ optional BundleRelatedType type = 2;
422
+ }
423
+
424
+ message GetBundleRelatedProductsResponse {
425
+ repeated BundleRelatedItem cross_sell = 1;
426
+ repeated BundleRelatedItem up_sell = 2;
427
+ repeated BundleRelatedItem bought_together = 3;
428
+ repeated BundleRelatedItem popular = 4;
429
+ }
430
+
431
+ message SetBundleRelatedProductsRequest {
432
+ string bundle_id = 1;
433
+ BundleRelatedType type = 2;
434
+ repeated string related_product_ids = 3;
435
+ }
436
+
437
+ message RemoveBundleRelatedProductRequest {
438
+ string bundle_id = 1;
439
+ string related_product_id = 2;
440
+ BundleRelatedType type = 3;
441
+ }