@platfformx/proto-contracts 1.2.0 → 1.2.2
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.
- package/dist/gen/ts/products-service/product.d.ts +74 -0
- package/dist/gen/ts/products-service/product.js +28 -0
- package/dist/index.d.ts +2 -1
- package/dist/index.js +4 -3
- package/dist/paths/proto-paths.d.ts +1 -0
- package/dist/paths/proto-paths.js +1 -0
- package/package.json +1 -1
- package/proto/products-service/product.proto +11 -2
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import { Observable } from "rxjs";
|
|
2
|
+
export declare const protobufPackage = "product";
|
|
3
|
+
export interface CreateProductRequest {
|
|
4
|
+
title: string;
|
|
5
|
+
description?: string | undefined;
|
|
6
|
+
price: number;
|
|
7
|
+
images: string[];
|
|
8
|
+
categoryId: string;
|
|
9
|
+
quantity?: number | undefined;
|
|
10
|
+
variants?: ProductVariant | undefined;
|
|
11
|
+
}
|
|
12
|
+
export interface ProductVariant {
|
|
13
|
+
quantity: number;
|
|
14
|
+
color?: string | undefined;
|
|
15
|
+
size?: string | undefined;
|
|
16
|
+
sku: string;
|
|
17
|
+
}
|
|
18
|
+
export interface GetProductRequest {
|
|
19
|
+
productId: string;
|
|
20
|
+
}
|
|
21
|
+
export interface GetProductsRequest {
|
|
22
|
+
categoryId?: string | undefined;
|
|
23
|
+
page: number;
|
|
24
|
+
limit: number;
|
|
25
|
+
}
|
|
26
|
+
export interface GetProductsResponse {
|
|
27
|
+
products: ProductResponse[];
|
|
28
|
+
}
|
|
29
|
+
export interface UpdateProductRequest {
|
|
30
|
+
productId: string;
|
|
31
|
+
title?: string | undefined;
|
|
32
|
+
price?: number | undefined;
|
|
33
|
+
images: string[];
|
|
34
|
+
description?: string | undefined;
|
|
35
|
+
stock?: number | undefined;
|
|
36
|
+
categoryId?: string | undefined;
|
|
37
|
+
}
|
|
38
|
+
export interface DeleteProductRequest {
|
|
39
|
+
productId: string;
|
|
40
|
+
}
|
|
41
|
+
export interface DeleteProductResponse {
|
|
42
|
+
success: boolean;
|
|
43
|
+
}
|
|
44
|
+
export interface ProductResponse {
|
|
45
|
+
id: string;
|
|
46
|
+
slug: string;
|
|
47
|
+
title: string;
|
|
48
|
+
description?: string | undefined;
|
|
49
|
+
categoryId: string;
|
|
50
|
+
price: number;
|
|
51
|
+
images: string[];
|
|
52
|
+
status: string;
|
|
53
|
+
rating: number;
|
|
54
|
+
reviewCount: number;
|
|
55
|
+
createdAt: string;
|
|
56
|
+
updatedAt: string;
|
|
57
|
+
}
|
|
58
|
+
export declare const PRODUCT_PACKAGE_NAME = "product";
|
|
59
|
+
export interface ProductServiceClient {
|
|
60
|
+
createProduct(request: CreateProductRequest): Observable<ProductResponse>;
|
|
61
|
+
updateProduct(request: UpdateProductRequest): Observable<ProductResponse>;
|
|
62
|
+
deleteProduct(request: DeleteProductRequest): Observable<DeleteProductResponse>;
|
|
63
|
+
getProduct(request: GetProductRequest): Observable<ProductResponse>;
|
|
64
|
+
getProducts(request: GetProductsRequest): Observable<GetProductsResponse>;
|
|
65
|
+
}
|
|
66
|
+
export interface ProductServiceController {
|
|
67
|
+
createProduct(request: CreateProductRequest): Promise<ProductResponse> | Observable<ProductResponse> | ProductResponse;
|
|
68
|
+
updateProduct(request: UpdateProductRequest): Promise<ProductResponse> | Observable<ProductResponse> | ProductResponse;
|
|
69
|
+
deleteProduct(request: DeleteProductRequest): Promise<DeleteProductResponse> | Observable<DeleteProductResponse> | DeleteProductResponse;
|
|
70
|
+
getProduct(request: GetProductRequest): Promise<ProductResponse> | Observable<ProductResponse> | ProductResponse;
|
|
71
|
+
getProducts(request: GetProductsRequest): Promise<GetProductsResponse> | Observable<GetProductsResponse> | GetProductsResponse;
|
|
72
|
+
}
|
|
73
|
+
export declare function ProductServiceControllerMethods(): (constructor: Function) => void;
|
|
74
|
+
export declare const PRODUCT_SERVICE_NAME = "ProductService";
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
|
|
3
|
+
// versions:
|
|
4
|
+
// protoc-gen-ts_proto v2.11.8
|
|
5
|
+
// protoc v7.34.0
|
|
6
|
+
// source: products-service/product.proto
|
|
7
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
|
+
exports.PRODUCT_SERVICE_NAME = exports.PRODUCT_PACKAGE_NAME = exports.protobufPackage = void 0;
|
|
9
|
+
exports.ProductServiceControllerMethods = ProductServiceControllerMethods;
|
|
10
|
+
/* eslint-disable */
|
|
11
|
+
const microservices_1 = require("@nestjs/microservices");
|
|
12
|
+
exports.protobufPackage = "product";
|
|
13
|
+
exports.PRODUCT_PACKAGE_NAME = "product";
|
|
14
|
+
function ProductServiceControllerMethods() {
|
|
15
|
+
return function (constructor) {
|
|
16
|
+
const grpcMethods = ["createProduct", "updateProduct", "deleteProduct", "getProduct", "getProducts"];
|
|
17
|
+
for (const method of grpcMethods) {
|
|
18
|
+
const descriptor = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
|
|
19
|
+
(0, microservices_1.GrpcMethod)("ProductService", method)(constructor.prototype[method], method, descriptor);
|
|
20
|
+
}
|
|
21
|
+
const grpcStreamMethods = [];
|
|
22
|
+
for (const method of grpcStreamMethods) {
|
|
23
|
+
const descriptor = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
|
|
24
|
+
(0, microservices_1.GrpcStreamMethod)("ProductService", method)(constructor.prototype[method], method, descriptor);
|
|
25
|
+
}
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
exports.PRODUCT_SERVICE_NAME = "ProductService";
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
export * from './paths/index';
|
|
2
2
|
export * from './paths/proto-paths';
|
|
3
|
+
export { OAuthProvider } from './gen/ts/auth-service/auth';
|
|
3
4
|
export * as Auth from './gen/ts/auth-service/auth';
|
|
4
5
|
export * as Account from './gen/ts/users-service/account';
|
|
5
|
-
export
|
|
6
|
+
export * as Product from './gen/ts/products-service/product';
|
package/dist/index.js
CHANGED
|
@@ -36,10 +36,11 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
36
36
|
};
|
|
37
37
|
})();
|
|
38
38
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
-
exports.
|
|
39
|
+
exports.Product = exports.Account = exports.Auth = exports.OAuthProvider = void 0;
|
|
40
40
|
__exportStar(require("./paths/index"), exports);
|
|
41
41
|
__exportStar(require("./paths/proto-paths"), exports);
|
|
42
|
-
exports.Auth = __importStar(require("./gen/ts/auth-service/auth"));
|
|
43
|
-
exports.Account = __importStar(require("./gen/ts/users-service/account"));
|
|
44
42
|
var auth_1 = require("./gen/ts/auth-service/auth");
|
|
45
43
|
Object.defineProperty(exports, "OAuthProvider", { enumerable: true, get: function () { return auth_1.OAuthProvider; } });
|
|
44
|
+
exports.Auth = __importStar(require("./gen/ts/auth-service/auth"));
|
|
45
|
+
exports.Account = __importStar(require("./gen/ts/users-service/account"));
|
|
46
|
+
exports.Product = __importStar(require("./gen/ts/products-service/product"));
|
|
@@ -5,4 +5,5 @@ const path_1 = require("path");
|
|
|
5
5
|
exports.PROTO_PATHS = {
|
|
6
6
|
ACCOUNT: (0, path_1.join)(__dirname, '../../proto/users-service/account.proto'),
|
|
7
7
|
AUTH: (0, path_1.join)(__dirname, '../../proto/auth-service/auth.proto'),
|
|
8
|
+
PRODUCT: (0, path_1.join)(__dirname, '../../proto/products-service/product.proto'),
|
|
8
9
|
};
|
package/package.json
CHANGED
|
@@ -15,11 +15,20 @@ message CreateProductRequest{
|
|
|
15
15
|
optional string description = 2;
|
|
16
16
|
double price = 3;
|
|
17
17
|
repeated string images = 4;
|
|
18
|
-
|
|
19
|
-
string category_id = 7;
|
|
18
|
+
string category_id = 5;
|
|
20
19
|
|
|
20
|
+
oneof stock {
|
|
21
|
+
int32 quantity = 6;
|
|
22
|
+
ProductVariant variants = 7;
|
|
23
|
+
}
|
|
21
24
|
}
|
|
22
25
|
|
|
26
|
+
message ProductVariant {
|
|
27
|
+
int32 quantity = 1;
|
|
28
|
+
optional string color = 2;
|
|
29
|
+
optional string size = 3;
|
|
30
|
+
string sku = 4;
|
|
31
|
+
}
|
|
23
32
|
message GetProductRequest {
|
|
24
33
|
string product_id = 1;
|
|
25
34
|
}
|