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