@platfformx/proto-contracts 1.2.10 → 1.2.12
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.
|
@@ -4,12 +4,11 @@ export interface CreateProductRequest {
|
|
|
4
4
|
title: string;
|
|
5
5
|
categoryId: string;
|
|
6
6
|
description?: string | undefined;
|
|
7
|
-
price:
|
|
7
|
+
price: string;
|
|
8
8
|
quantity: number;
|
|
9
|
-
|
|
10
|
-
variants: ProductVariant[];
|
|
9
|
+
stock: ProductStock[];
|
|
11
10
|
}
|
|
12
|
-
export interface
|
|
11
|
+
export interface ProductStock {
|
|
13
12
|
color?: string | undefined;
|
|
14
13
|
size?: string | undefined;
|
|
15
14
|
sku: string;
|
|
@@ -29,8 +28,7 @@ export interface GetProductsResponse {
|
|
|
29
28
|
export interface UpdateProductRequest {
|
|
30
29
|
productId: string;
|
|
31
30
|
title?: string | undefined;
|
|
32
|
-
price?:
|
|
33
|
-
images: string[];
|
|
31
|
+
price?: string | undefined;
|
|
34
32
|
description?: string | undefined;
|
|
35
33
|
stock?: number | undefined;
|
|
36
34
|
categoryId?: string | undefined;
|
|
@@ -47,7 +45,8 @@ export interface ProductResponse {
|
|
|
47
45
|
title: string;
|
|
48
46
|
description?: string | undefined;
|
|
49
47
|
categoryId: string;
|
|
50
|
-
price:
|
|
48
|
+
price: string;
|
|
49
|
+
quantity: number;
|
|
51
50
|
images: string[];
|
|
52
51
|
status: string;
|
|
53
52
|
rating: number;
|
|
@@ -55,6 +54,41 @@ export interface ProductResponse {
|
|
|
55
54
|
createdAt: string;
|
|
56
55
|
updatedAt: string;
|
|
57
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
|
+
}
|
|
58
92
|
export declare const PRODUCT_V1_PACKAGE_NAME = "product.v1";
|
|
59
93
|
export interface ProductServiceClient {
|
|
60
94
|
createProduct(request: CreateProductRequest): Observable<ProductResponse>;
|
|
@@ -62,6 +96,12 @@ export interface ProductServiceClient {
|
|
|
62
96
|
deleteProduct(request: DeleteProductRequest): Observable<DeleteProductResponse>;
|
|
63
97
|
getProduct(request: GetProductRequest): Observable<ProductResponse>;
|
|
64
98
|
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>;
|
|
65
105
|
}
|
|
66
106
|
export interface ProductServiceController {
|
|
67
107
|
createProduct(request: CreateProductRequest): Promise<ProductResponse> | Observable<ProductResponse> | ProductResponse;
|
|
@@ -69,6 +109,12 @@ export interface ProductServiceController {
|
|
|
69
109
|
deleteProduct(request: DeleteProductRequest): Promise<DeleteProductResponse> | Observable<DeleteProductResponse> | DeleteProductResponse;
|
|
70
110
|
getProduct(request: GetProductRequest): Promise<ProductResponse> | Observable<ProductResponse> | ProductResponse;
|
|
71
111
|
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;
|
|
72
118
|
}
|
|
73
119
|
export declare function ProductServiceControllerMethods(): (constructor: Function) => void;
|
|
74
120
|
export declare const PRODUCT_SERVICE_NAME = "ProductService";
|
|
@@ -13,7 +13,18 @@ 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 = [
|
|
16
|
+
const grpcMethods = [
|
|
17
|
+
"createProduct",
|
|
18
|
+
"updateProduct",
|
|
19
|
+
"deleteProduct",
|
|
20
|
+
"getProduct",
|
|
21
|
+
"getProducts",
|
|
22
|
+
"addProductImages",
|
|
23
|
+
"replaceProductImages",
|
|
24
|
+
"reorderProductImages",
|
|
25
|
+
"removeProductImages",
|
|
26
|
+
"deleteProductImages",
|
|
27
|
+
];
|
|
17
28
|
for (const method of grpcMethods) {
|
|
18
29
|
const descriptor = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
|
|
19
30
|
(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.
|
|
3
|
+
"version": "1.2.12",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
},
|
|
22
22
|
"scripts": {
|
|
23
23
|
"build": "tsc",
|
|
24
|
-
"generate": "mkdirp src/gen/ts && globstar -- protoc -I=proto proto/**/*.proto --ts_proto_out=./src/gen/ts --ts_proto_opt=nestJs=true,esModuleInterop=true,useOptionalProperties=all"
|
|
24
|
+
"generate": "mkdirp src/gen/ts && globstar -- protoc -I=proto proto/**/*.proto --ts_proto_out=./src/gen/ts --ts_proto_opt=nestJs=true,esModuleInterop=true,oneof=properties,useOptionalProperties=all"
|
|
25
25
|
},
|
|
26
26
|
"keywords": [],
|
|
27
27
|
"author": "",
|
|
@@ -8,26 +8,36 @@ 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
|
+
|
|
11
20
|
}
|
|
12
21
|
|
|
13
22
|
message CreateProductRequest{
|
|
14
23
|
string title = 1;
|
|
15
24
|
string category_id = 2;
|
|
16
25
|
optional string description = 3;
|
|
17
|
-
|
|
26
|
+
string price = 4;
|
|
18
27
|
int32 quantity = 5;
|
|
19
|
-
repeated
|
|
20
|
-
repeated ProductVariant variants = 7;
|
|
28
|
+
repeated ProductStock stock = 6;
|
|
21
29
|
}
|
|
22
30
|
|
|
23
|
-
message
|
|
31
|
+
message ProductStock {
|
|
24
32
|
optional string color = 1;
|
|
25
33
|
optional string size = 2;
|
|
26
34
|
string sku = 3;
|
|
27
35
|
}
|
|
28
36
|
message GetProductRequest {
|
|
29
|
-
|
|
30
|
-
|
|
37
|
+
oneof identifier {
|
|
38
|
+
string product_id = 1;
|
|
39
|
+
string slug = 2;
|
|
40
|
+
}
|
|
31
41
|
}
|
|
32
42
|
|
|
33
43
|
message GetProductsRequest {
|
|
@@ -42,12 +52,10 @@ message GetProductsResponse {
|
|
|
42
52
|
message UpdateProductRequest {
|
|
43
53
|
string product_id = 1;
|
|
44
54
|
optional string title = 2;
|
|
45
|
-
optional
|
|
46
|
-
|
|
47
|
-
optional
|
|
48
|
-
optional
|
|
49
|
-
optional string category_id = 7;
|
|
50
|
-
|
|
55
|
+
optional string price = 3;
|
|
56
|
+
optional string description = 4;
|
|
57
|
+
optional int32 stock = 5;
|
|
58
|
+
optional string category_id = 6;
|
|
51
59
|
}
|
|
52
60
|
|
|
53
61
|
message DeleteProductRequest {
|
|
@@ -63,11 +71,54 @@ message ProductResponse{
|
|
|
63
71
|
string title = 3;
|
|
64
72
|
optional string description = 4;
|
|
65
73
|
string category_id = 5;
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
string
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
string
|
|
74
|
+
string price = 6;
|
|
75
|
+
int32 quantity = 7;
|
|
76
|
+
repeated string images = 8;
|
|
77
|
+
string status = 9;
|
|
78
|
+
float rating = 10;
|
|
79
|
+
int32 review_count = 11;
|
|
80
|
+
string created_at = 12;
|
|
81
|
+
string updated_at = 13;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
|
|
85
|
+
// IMAGES
|
|
86
|
+
message AddProductImagesRequest {
|
|
87
|
+
string product_id = 1;
|
|
88
|
+
repeated string images_urls = 2;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
message AddProductImagesResponse {
|
|
92
|
+
repeated string current_images = 1;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
message ReplaceProductImagesRequest {
|
|
96
|
+
string product_id = 1;
|
|
97
|
+
repeated string new_images_urls = 2;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
message ReplaceProductImagesResponse {
|
|
101
|
+
repeated string current_images = 1;
|
|
102
|
+
}
|
|
103
|
+
message ReorderProductImagesRequest {
|
|
104
|
+
string product_id = 1;
|
|
105
|
+
repeated string current_images = 2;
|
|
106
|
+
}
|
|
107
|
+
message ReorderProductImagesResponse {
|
|
108
|
+
repeated string ordered_image_urls = 1;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
message RemoveProductImagesRequest {
|
|
112
|
+
string product_id = 1;
|
|
113
|
+
repeated string image_urls = 2;
|
|
114
|
+
}
|
|
115
|
+
message RemoveProductImagesResponse {
|
|
116
|
+
repeated string current_images = 1;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
message DeleteProductImagesRequest {
|
|
120
|
+
repeated string image_urls = 1;
|
|
121
|
+
}
|
|
122
|
+
message DeleteProductImagesResponse {
|
|
123
|
+
bool success = 1;
|
|
73
124
|
}
|