@platfformx/proto-contracts 1.4.5 → 1.4.7
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/order-service/order.d.ts +25 -0
- package/dist/gen/ts/order-service/order.js +28 -0
- package/dist/gen/ts/payment-service/refund.d.ts +9 -0
- package/dist/gen/ts/payment-service/refund.js +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.js +2 -1
- package/dist/paths/proto-paths.d.ts +1 -0
- package/dist/paths/proto-paths.js +1 -0
- package/package.json +1 -1
- package/proto/order-service/order.proto +25 -0
- package/proto/payment-service/refund.proto +9 -0
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { Observable } from "rxjs";
|
|
2
|
+
export declare const protobufPackage = "order.v1";
|
|
3
|
+
export interface CreateOrderRequest {
|
|
4
|
+
userId: string;
|
|
5
|
+
items: OrderItem[];
|
|
6
|
+
}
|
|
7
|
+
export interface CreateOrderResponse {
|
|
8
|
+
orderId: string;
|
|
9
|
+
price: number;
|
|
10
|
+
status: string;
|
|
11
|
+
clientSecret: string;
|
|
12
|
+
}
|
|
13
|
+
export interface OrderItem {
|
|
14
|
+
productId: string;
|
|
15
|
+
quantity: number;
|
|
16
|
+
}
|
|
17
|
+
export declare const ORDER_V1_PACKAGE_NAME = "order.v1";
|
|
18
|
+
export interface OrderSeriveClient {
|
|
19
|
+
createOrder(request: CreateOrderRequest): Observable<CreateOrderResponse>;
|
|
20
|
+
}
|
|
21
|
+
export interface OrderSeriveController {
|
|
22
|
+
createOrder(request: CreateOrderRequest): Promise<CreateOrderResponse> | Observable<CreateOrderResponse> | CreateOrderResponse;
|
|
23
|
+
}
|
|
24
|
+
export declare function OrderSeriveControllerMethods(): (constructor: Function) => void;
|
|
25
|
+
export declare const ORDER_SERIVE_SERVICE_NAME = "OrderSerive";
|
|
@@ -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: order-service/order.proto
|
|
7
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
|
+
exports.ORDER_SERIVE_SERVICE_NAME = exports.ORDER_V1_PACKAGE_NAME = exports.protobufPackage = void 0;
|
|
9
|
+
exports.OrderSeriveControllerMethods = OrderSeriveControllerMethods;
|
|
10
|
+
/* eslint-disable */
|
|
11
|
+
const microservices_1 = require("@nestjs/microservices");
|
|
12
|
+
exports.protobufPackage = "order.v1";
|
|
13
|
+
exports.ORDER_V1_PACKAGE_NAME = "order.v1";
|
|
14
|
+
function OrderSeriveControllerMethods() {
|
|
15
|
+
return function (constructor) {
|
|
16
|
+
const grpcMethods = ["createOrder"];
|
|
17
|
+
for (const method of grpcMethods) {
|
|
18
|
+
const descriptor = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
|
|
19
|
+
(0, microservices_1.GrpcMethod)("OrderSerive", 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)("OrderSerive", method)(constructor.prototype[method], method, descriptor);
|
|
25
|
+
}
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
exports.ORDER_SERIVE_SERVICE_NAME = "OrderSerive";
|
|
@@ -8,12 +8,21 @@ export interface CreateRefundRequest {
|
|
|
8
8
|
export interface CreateRefundResponse {
|
|
9
9
|
ok: boolean;
|
|
10
10
|
}
|
|
11
|
+
export interface ConfirmRefundRequest {
|
|
12
|
+
providerId: string;
|
|
13
|
+
status: string;
|
|
14
|
+
}
|
|
15
|
+
export interface ConfirmRefundResponse {
|
|
16
|
+
success: boolean;
|
|
17
|
+
}
|
|
11
18
|
export declare const REFUND_V1_PACKAGE_NAME = "refund.v1";
|
|
12
19
|
export interface RefundServiceClient {
|
|
13
20
|
createRefund(request: CreateRefundRequest): Observable<CreateRefundResponse>;
|
|
21
|
+
confirmRefund(request: ConfirmRefundRequest): Observable<ConfirmRefundResponse>;
|
|
14
22
|
}
|
|
15
23
|
export interface RefundServiceController {
|
|
16
24
|
createRefund(request: CreateRefundRequest): Promise<CreateRefundResponse> | Observable<CreateRefundResponse> | CreateRefundResponse;
|
|
25
|
+
confirmRefund(request: ConfirmRefundRequest): Promise<ConfirmRefundResponse> | Observable<ConfirmRefundResponse> | ConfirmRefundResponse;
|
|
17
26
|
}
|
|
18
27
|
export declare function RefundServiceControllerMethods(): (constructor: Function) => void;
|
|
19
28
|
export declare const REFUND_SERVICE_NAME = "RefundService";
|
|
@@ -13,7 +13,7 @@ exports.protobufPackage = "refund.v1";
|
|
|
13
13
|
exports.REFUND_V1_PACKAGE_NAME = "refund.v1";
|
|
14
14
|
function RefundServiceControllerMethods() {
|
|
15
15
|
return function (constructor) {
|
|
16
|
-
const grpcMethods = ["createRefund"];
|
|
16
|
+
const grpcMethods = ["createRefund", "confirmRefund"];
|
|
17
17
|
for (const method of grpcMethods) {
|
|
18
18
|
const descriptor = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
|
|
19
19
|
(0, microservices_1.GrpcMethod)("RefundService", method)(constructor.prototype[method], method, descriptor);
|
package/dist/index.d.ts
CHANGED
|
@@ -10,4 +10,5 @@ export * as Category from './gen/ts/products-service/category';
|
|
|
10
10
|
export * as Search from './gen/ts/search-service/search';
|
|
11
11
|
export * as Payment from './gen/ts/payment-service/payment';
|
|
12
12
|
export * as Refund from './gen/ts/payment-service/refund';
|
|
13
|
+
export * as Order from './gen/ts/order-service/order';
|
|
13
14
|
export { BulkStatus } from './gen/ts/products-service/bulk';
|
package/dist/index.js
CHANGED
|
@@ -36,7 +36,7 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
36
36
|
};
|
|
37
37
|
})();
|
|
38
38
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
-
exports.BulkStatus = exports.Refund = exports.Payment = exports.Search = exports.Category = exports.Bulk = exports.Product = exports.Account = exports.S3 = exports.Auth = exports.OAuthProvider = void 0;
|
|
39
|
+
exports.BulkStatus = exports.Order = exports.Refund = exports.Payment = exports.Search = exports.Category = exports.Bulk = exports.Product = exports.Account = exports.S3 = exports.Auth = exports.OAuthProvider = void 0;
|
|
40
40
|
__exportStar(require("./paths/index"), exports);
|
|
41
41
|
__exportStar(require("./paths/proto-paths"), exports);
|
|
42
42
|
var auth_1 = require("./gen/ts/auth-service/auth");
|
|
@@ -50,5 +50,6 @@ exports.Category = __importStar(require("./gen/ts/products-service/category"));
|
|
|
50
50
|
exports.Search = __importStar(require("./gen/ts/search-service/search"));
|
|
51
51
|
exports.Payment = __importStar(require("./gen/ts/payment-service/payment"));
|
|
52
52
|
exports.Refund = __importStar(require("./gen/ts/payment-service/refund"));
|
|
53
|
+
exports.Order = __importStar(require("./gen/ts/order-service/order"));
|
|
53
54
|
var bulk_1 = require("./gen/ts/products-service/bulk");
|
|
54
55
|
Object.defineProperty(exports, "BulkStatus", { enumerable: true, get: function () { return bulk_1.BulkStatus; } });
|
|
@@ -12,4 +12,5 @@ exports.PROTO_PATHS = {
|
|
|
12
12
|
SEARCH: (0, path_1.join)(__dirname, '../../proto/search-service/search.proto'),
|
|
13
13
|
PAYMENT: (0, path_1.join)(__dirname, '../../proto/payment-service/payment.proto'),
|
|
14
14
|
REFUND: (0, path_1.join)(__dirname, '../../proto/payment-service/refund.proto'),
|
|
15
|
+
ORDER: (0, path_1.join)(__dirname, '../../proto/order-service/order.proto'),
|
|
15
16
|
};
|
package/package.json
CHANGED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
syntax = "proto3";
|
|
2
|
+
|
|
3
|
+
package order.v1;
|
|
4
|
+
|
|
5
|
+
service OrderSerive {
|
|
6
|
+
rpc CreateOrder (CreateOrderRequest) returns (CreateOrderResponse);
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
message CreateOrderRequest {
|
|
10
|
+
string user_id = 1;
|
|
11
|
+
repeated OrderItem items = 2;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
message CreateOrderResponse {
|
|
15
|
+
string order_id = 1;
|
|
16
|
+
int32 price = 2;
|
|
17
|
+
string status = 3;
|
|
18
|
+
string client_secret = 4;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
message OrderItem {
|
|
22
|
+
string product_id = 1;
|
|
23
|
+
int32 quantity = 2;
|
|
24
|
+
|
|
25
|
+
}
|
|
@@ -4,6 +4,7 @@ package refund.v1;
|
|
|
4
4
|
|
|
5
5
|
service RefundService {
|
|
6
6
|
rpc CreateRefund (CreateRefundRequest) returns (CreateRefundResponse);
|
|
7
|
+
rpc ConfirmRefund (ConfirmRefundRequest) returns (ConfirmRefundResponse);
|
|
7
8
|
}
|
|
8
9
|
|
|
9
10
|
message CreateRefundRequest {
|
|
@@ -14,4 +15,12 @@ message CreateRefundRequest {
|
|
|
14
15
|
|
|
15
16
|
message CreateRefundResponse {
|
|
16
17
|
bool ok = 1;
|
|
18
|
+
}
|
|
19
|
+
message ConfirmRefundRequest {
|
|
20
|
+
string providerId = 1;
|
|
21
|
+
string status = 2;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
message ConfirmRefundResponse {
|
|
25
|
+
bool success = 1;
|
|
17
26
|
}
|