@platfformx/proto-contracts 1.2.15 → 1.2.17

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.
@@ -5,6 +5,7 @@ export interface CreateProductRequest {
5
5
  categoryId: string;
6
6
  description?: string | undefined;
7
7
  price: string;
8
+ images: string[];
8
9
  }
9
10
  export interface GetProductRequest {
10
11
  productId?: string | undefined;
@@ -24,6 +25,7 @@ export interface UpdateProductRequest {
24
25
  price?: string | undefined;
25
26
  description?: string | undefined;
26
27
  categoryId?: string | undefined;
28
+ images: string[];
27
29
  }
28
30
  export interface DeleteProductRequest {
29
31
  productId: string;
@@ -46,47 +48,6 @@ export interface ProductResponse {
46
48
  createdAt: string;
47
49
  updatedAt: string;
48
50
  }
49
- /** Shared */
50
- export interface ProductStock {
51
- color?: string | undefined;
52
- size?: string | undefined;
53
- sku: string;
54
- }
55
- /** IMAGES */
56
- export interface AddProductImagesRequest {
57
- productId: string;
58
- imagesUrls: string[];
59
- }
60
- export interface AddProductImagesResponse {
61
- currentImages: string[];
62
- }
63
- export interface ReplaceProductImagesRequest {
64
- productId: string;
65
- newImagesUrls: string[];
66
- }
67
- export interface ReplaceProductImagesResponse {
68
- currentImages: string[];
69
- }
70
- export interface ReorderProductImagesRequest {
71
- productId: string;
72
- currentImages: string[];
73
- }
74
- export interface ReorderProductImagesResponse {
75
- orderedImageUrls: string[];
76
- }
77
- export interface RemoveProductImagesRequest {
78
- productId: string;
79
- imageUrls: string[];
80
- }
81
- export interface RemoveProductImagesResponse {
82
- currentImages: string[];
83
- }
84
- export interface DeleteProductImagesRequest {
85
- imageUrls: string[];
86
- }
87
- export interface DeleteProductImagesResponse {
88
- success: boolean;
89
- }
90
51
  export declare const PRODUCT_V1_PACKAGE_NAME = "product.v1";
91
52
  export interface ProductServiceClient {
92
53
  createProduct(request: CreateProductRequest): Observable<ProductResponse>;
@@ -94,12 +55,6 @@ export interface ProductServiceClient {
94
55
  deleteProduct(request: DeleteProductRequest): Observable<DeleteProductResponse>;
95
56
  getProduct(request: GetProductRequest): Observable<ProductResponse>;
96
57
  getProducts(request: GetProductsRequest): Observable<GetProductsResponse>;
97
- /** IMAGES */
98
- addProductImages(request: AddProductImagesRequest): Observable<AddProductImagesResponse>;
99
- replaceProductImages(request: ReplaceProductImagesRequest): Observable<ReplaceProductImagesResponse>;
100
- reorderProductImages(request: ReorderProductImagesRequest): Observable<ReorderProductImagesResponse>;
101
- removeProductImages(request: RemoveProductImagesRequest): Observable<RemoveProductImagesResponse>;
102
- deleteProductImages(request: DeleteProductImagesRequest): Observable<DeleteProductImagesResponse>;
103
58
  }
104
59
  export interface ProductServiceController {
105
60
  createProduct(request: CreateProductRequest): Promise<ProductResponse> | Observable<ProductResponse> | ProductResponse;
@@ -107,12 +62,6 @@ export interface ProductServiceController {
107
62
  deleteProduct(request: DeleteProductRequest): Promise<DeleteProductResponse> | Observable<DeleteProductResponse> | DeleteProductResponse;
108
63
  getProduct(request: GetProductRequest): Promise<ProductResponse> | Observable<ProductResponse> | ProductResponse;
109
64
  getProducts(request: GetProductsRequest): Promise<GetProductsResponse> | Observable<GetProductsResponse> | GetProductsResponse;
110
- /** IMAGES */
111
- addProductImages(request: AddProductImagesRequest): Promise<AddProductImagesResponse> | Observable<AddProductImagesResponse> | AddProductImagesResponse;
112
- replaceProductImages(request: ReplaceProductImagesRequest): Promise<ReplaceProductImagesResponse> | Observable<ReplaceProductImagesResponse> | ReplaceProductImagesResponse;
113
- reorderProductImages(request: ReorderProductImagesRequest): Promise<ReorderProductImagesResponse> | Observable<ReorderProductImagesResponse> | ReorderProductImagesResponse;
114
- removeProductImages(request: RemoveProductImagesRequest): Promise<RemoveProductImagesResponse> | Observable<RemoveProductImagesResponse> | RemoveProductImagesResponse;
115
- deleteProductImages(request: DeleteProductImagesRequest): Promise<DeleteProductImagesResponse> | Observable<DeleteProductImagesResponse> | DeleteProductImagesResponse;
116
65
  }
117
66
  export declare function ProductServiceControllerMethods(): (constructor: Function) => void;
118
67
  export declare const PRODUCT_SERVICE_NAME = "ProductService";
@@ -13,18 +13,7 @@ exports.protobufPackage = "product.v1";
13
13
  exports.PRODUCT_V1_PACKAGE_NAME = "product.v1";
14
14
  function ProductServiceControllerMethods() {
15
15
  return function (constructor) {
16
- const grpcMethods = [
17
- "createProduct",
18
- "updateProduct",
19
- "deleteProduct",
20
- "getProduct",
21
- "getProducts",
22
- "addProductImages",
23
- "replaceProductImages",
24
- "reorderProductImages",
25
- "removeProductImages",
26
- "deleteProductImages",
27
- ];
16
+ const grpcMethods = ["createProduct", "updateProduct", "deleteProduct", "getProduct", "getProducts"];
28
17
  for (const method of grpcMethods) {
29
18
  const descriptor = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
30
19
  (0, microservices_1.GrpcMethod)("ProductService", method)(constructor.prototype[method], method, descriptor);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@platfformx/proto-contracts",
3
- "version": "1.2.15",
3
+ "version": "1.2.17",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -8,24 +8,17 @@ service ProductService {
8
8
  rpc DeleteProduct (DeleteProductRequest) returns (DeleteProductResponse);
9
9
  rpc GetProduct(GetProductRequest) returns (ProductResponse);
10
10
  rpc GetProducts(GetProductsRequest) returns (GetProductsResponse);
11
-
12
-
13
- // IMAGES
14
- rpc AddProductImages (AddProductImagesRequest) returns (AddProductImagesResponse);
15
- rpc ReplaceProductImages (ReplaceProductImagesRequest) returns (ReplaceProductImagesResponse);
16
- rpc ReorderProductImages (ReorderProductImagesRequest) returns (ReorderProductImagesResponse);
17
- rpc RemoveProductImages (RemoveProductImagesRequest) returns (RemoveProductImagesResponse);
18
- rpc DeleteProductImages (DeleteProductImagesRequest) returns (DeleteProductImagesResponse);
19
-
20
11
  }
21
12
 
22
- message CreateProductRequest{
23
- string title = 1;
24
- string category_id = 2;
25
- optional string description = 3;
26
- string price = 4;
13
+ message CreateProductRequest {
14
+ string title = 1;
15
+ string category_id = 2;
16
+ optional string description = 3;
17
+ string price = 4;
18
+ repeated string images = 5;
27
19
  }
28
20
 
21
+
29
22
  message GetProductRequest {
30
23
  oneof identifier {
31
24
  string product_id = 1;
@@ -48,6 +41,7 @@ message UpdateProductRequest {
48
41
  optional string price = 3;
49
42
  optional string description = 4;
50
43
  optional string category_id = 6;
44
+ repeated string images = 7;
51
45
  }
52
46
 
53
47
  message DeleteProductRequest {
@@ -72,50 +66,4 @@ message ProductResponse{
72
66
  string created_at = 12;
73
67
  string updated_at = 13;
74
68
  }
75
- // Shared
76
- message ProductStock {
77
- optional string color = 1;
78
- optional string size = 2;
79
- string sku = 3;
80
- }
81
-
82
- // IMAGES
83
- message AddProductImagesRequest {
84
- string product_id = 1;
85
- repeated string images_urls = 2;
86
- }
87
-
88
- message AddProductImagesResponse {
89
- repeated string current_images = 1;
90
- }
91
-
92
- message ReplaceProductImagesRequest {
93
- string product_id = 1;
94
- repeated string new_images_urls = 2;
95
- }
96
69
 
97
- message ReplaceProductImagesResponse {
98
- repeated string current_images = 1;
99
- }
100
- message ReorderProductImagesRequest {
101
- string product_id = 1;
102
- repeated string current_images = 2;
103
- }
104
- message ReorderProductImagesResponse {
105
- repeated string ordered_image_urls = 1;
106
- }
107
-
108
- message RemoveProductImagesRequest {
109
- string product_id = 1;
110
- repeated string image_urls = 2;
111
- }
112
- message RemoveProductImagesResponse {
113
- repeated string current_images = 1;
114
- }
115
-
116
- message DeleteProductImagesRequest {
117
- repeated string image_urls = 1;
118
- }
119
- message DeleteProductImagesResponse {
120
- bool success = 1;
121
- }