@platfformx/proto-contracts 1.2.0 → 1.2.1
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.
|
@@ -0,0 +1,67 @@
|
|
|
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
|
+
stock: number;
|
|
9
|
+
categoryId: string;
|
|
10
|
+
}
|
|
11
|
+
export interface GetProductRequest {
|
|
12
|
+
productId: string;
|
|
13
|
+
}
|
|
14
|
+
export interface GetProductsRequest {
|
|
15
|
+
categoryId?: string | undefined;
|
|
16
|
+
page: number;
|
|
17
|
+
limit: number;
|
|
18
|
+
}
|
|
19
|
+
export interface GetProductsResponse {
|
|
20
|
+
products: ProductResponse[];
|
|
21
|
+
}
|
|
22
|
+
export interface UpdateProductRequest {
|
|
23
|
+
productId: string;
|
|
24
|
+
title?: string | undefined;
|
|
25
|
+
price?: number | undefined;
|
|
26
|
+
images: string[];
|
|
27
|
+
description?: string | undefined;
|
|
28
|
+
stock?: number | undefined;
|
|
29
|
+
categoryId?: string | undefined;
|
|
30
|
+
}
|
|
31
|
+
export interface DeleteProductRequest {
|
|
32
|
+
productId: string;
|
|
33
|
+
}
|
|
34
|
+
export interface DeleteProductResponse {
|
|
35
|
+
success: boolean;
|
|
36
|
+
}
|
|
37
|
+
export interface ProductResponse {
|
|
38
|
+
id: string;
|
|
39
|
+
slug: string;
|
|
40
|
+
title: string;
|
|
41
|
+
description?: string | undefined;
|
|
42
|
+
categoryId: string;
|
|
43
|
+
price: number;
|
|
44
|
+
images: string[];
|
|
45
|
+
status: string;
|
|
46
|
+
rating: number;
|
|
47
|
+
reviewCount: number;
|
|
48
|
+
createdAt: string;
|
|
49
|
+
updatedAt: string;
|
|
50
|
+
}
|
|
51
|
+
export declare const PRODUCT_PACKAGE_NAME = "product";
|
|
52
|
+
export interface ProductServiceClient {
|
|
53
|
+
createProduct(request: CreateProductRequest): Observable<ProductResponse>;
|
|
54
|
+
updateProduct(request: UpdateProductRequest): Observable<ProductResponse>;
|
|
55
|
+
deleteProduct(request: DeleteProductRequest): Observable<DeleteProductResponse>;
|
|
56
|
+
getProduct(request: GetProductRequest): Observable<ProductResponse>;
|
|
57
|
+
getProducts(request: GetProductsRequest): Observable<GetProductsResponse>;
|
|
58
|
+
}
|
|
59
|
+
export interface ProductServiceController {
|
|
60
|
+
createProduct(request: CreateProductRequest): Promise<ProductResponse> | Observable<ProductResponse> | ProductResponse;
|
|
61
|
+
updateProduct(request: UpdateProductRequest): Promise<ProductResponse> | Observable<ProductResponse> | ProductResponse;
|
|
62
|
+
deleteProduct(request: DeleteProductRequest): Promise<DeleteProductResponse> | Observable<DeleteProductResponse> | DeleteProductResponse;
|
|
63
|
+
getProduct(request: GetProductRequest): Promise<ProductResponse> | Observable<ProductResponse> | ProductResponse;
|
|
64
|
+
getProducts(request: GetProductsRequest): Promise<GetProductsResponse> | Observable<GetProductsResponse> | GetProductsResponse;
|
|
65
|
+
}
|
|
66
|
+
export declare function ProductServiceControllerMethods(): (constructor: Function) => void;
|
|
67
|
+
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
|
};
|