@readytomog/contracts 1.4.2 → 1.5.0
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/proto/paths.d.ts +1 -0
- package/dist/proto/paths.js +1 -0
- package/gen/payment.ts +110 -0
- package/package.json +1 -1
- package/proto/payment.proto +46 -0
package/dist/proto/paths.d.ts
CHANGED
package/dist/proto/paths.js
CHANGED
|
@@ -6,4 +6,5 @@ exports.PROTO_PATHS = {
|
|
|
6
6
|
AUTH: (0, path_1.join)(__dirname, "../../proto/auth.proto"),
|
|
7
7
|
USER: (0, path_1.join)(__dirname, "../../proto/user.proto"),
|
|
8
8
|
CHAT: (0, path_1.join)(__dirname, "../../proto/chat.proto"),
|
|
9
|
+
PAYMENT: (0, path_1.join)(__dirname, "../../proto/payment.proto"),
|
|
9
10
|
};
|
package/gen/payment.ts
ADDED
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
|
|
2
|
+
// versions:
|
|
3
|
+
// protoc-gen-ts_proto v2.11.8
|
|
4
|
+
// protoc v3.21.12
|
|
5
|
+
// source: payment.proto
|
|
6
|
+
|
|
7
|
+
/* eslint-disable */
|
|
8
|
+
import { GrpcMethod, GrpcStreamMethod } from "@nestjs/microservices";
|
|
9
|
+
import { Observable } from "rxjs";
|
|
10
|
+
import { Empty } from "./google/protobuf/empty";
|
|
11
|
+
|
|
12
|
+
export const protobufPackage = "payment.v3";
|
|
13
|
+
|
|
14
|
+
export interface GetHistoryRequest {
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export interface GetHistoryResponse {
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export interface InitTransactionRequest {
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export interface InitTransactionResponse {
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export interface UpdateAutoRenewalStatusRequest {
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export interface UpdateAutoRenewalStatusResponse {
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
export interface GetPlansResponse {
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
export interface GetPlanByIdRequest {
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
export interface GetPlanByIdResponse {
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
export interface RefundRequest {
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
export interface RefundResponse {
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
export const PAYMENT_V3_PACKAGE_NAME = "payment.v3";
|
|
48
|
+
|
|
49
|
+
export interface PaymentServiceClient {
|
|
50
|
+
getHistory(request: GetHistoryRequest): Observable<GetHistoryResponse>;
|
|
51
|
+
|
|
52
|
+
initTransaction(request: InitTransactionRequest): Observable<InitTransactionResponse>;
|
|
53
|
+
|
|
54
|
+
updateAutoRenewalStatus(request: UpdateAutoRenewalStatusRequest): Observable<UpdateAutoRenewalStatusResponse>;
|
|
55
|
+
|
|
56
|
+
getPlans(request: Empty): Observable<GetPlansResponse>;
|
|
57
|
+
|
|
58
|
+
getPlanById(request: GetPlanByIdRequest): Observable<GetPlanByIdResponse>;
|
|
59
|
+
|
|
60
|
+
refund(request: RefundRequest): Observable<RefundResponse>;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
export interface PaymentServiceController {
|
|
64
|
+
getHistory(
|
|
65
|
+
request: GetHistoryRequest,
|
|
66
|
+
): Promise<GetHistoryResponse> | Observable<GetHistoryResponse> | GetHistoryResponse;
|
|
67
|
+
|
|
68
|
+
initTransaction(
|
|
69
|
+
request: InitTransactionRequest,
|
|
70
|
+
): Promise<InitTransactionResponse> | Observable<InitTransactionResponse> | InitTransactionResponse;
|
|
71
|
+
|
|
72
|
+
updateAutoRenewalStatus(
|
|
73
|
+
request: UpdateAutoRenewalStatusRequest,
|
|
74
|
+
):
|
|
75
|
+
| Promise<UpdateAutoRenewalStatusResponse>
|
|
76
|
+
| Observable<UpdateAutoRenewalStatusResponse>
|
|
77
|
+
| UpdateAutoRenewalStatusResponse;
|
|
78
|
+
|
|
79
|
+
getPlans(request: Empty): Promise<GetPlansResponse> | Observable<GetPlansResponse> | GetPlansResponse;
|
|
80
|
+
|
|
81
|
+
getPlanById(
|
|
82
|
+
request: GetPlanByIdRequest,
|
|
83
|
+
): Promise<GetPlanByIdResponse> | Observable<GetPlanByIdResponse> | GetPlanByIdResponse;
|
|
84
|
+
|
|
85
|
+
refund(request: RefundRequest): Promise<RefundResponse> | Observable<RefundResponse> | RefundResponse;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
export function PaymentServiceControllerMethods() {
|
|
89
|
+
return function (constructor: Function) {
|
|
90
|
+
const grpcMethods: string[] = [
|
|
91
|
+
"getHistory",
|
|
92
|
+
"initTransaction",
|
|
93
|
+
"updateAutoRenewalStatus",
|
|
94
|
+
"getPlans",
|
|
95
|
+
"getPlanById",
|
|
96
|
+
"refund",
|
|
97
|
+
];
|
|
98
|
+
for (const method of grpcMethods) {
|
|
99
|
+
const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
|
|
100
|
+
GrpcMethod("PaymentService", method)(constructor.prototype[method], method, descriptor);
|
|
101
|
+
}
|
|
102
|
+
const grpcStreamMethods: string[] = [];
|
|
103
|
+
for (const method of grpcStreamMethods) {
|
|
104
|
+
const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
|
|
105
|
+
GrpcStreamMethod("PaymentService", method)(constructor.prototype[method], method, descriptor);
|
|
106
|
+
}
|
|
107
|
+
};
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
export const PAYMENT_SERVICE_NAME = "PaymentService";
|
package/package.json
CHANGED
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
syntax = "proto3";
|
|
2
|
+
|
|
3
|
+
package payment.v3;
|
|
4
|
+
|
|
5
|
+
import "google/protobuf/empty.proto";
|
|
6
|
+
|
|
7
|
+
service PaymentService {
|
|
8
|
+
rpc GetHistory(GetHistoryRequest) returns (GetHistoryResponse);
|
|
9
|
+
rpc InitTransaction(InitTransactionRequest) returns (InitTransactionResponse);
|
|
10
|
+
rpc UpdateAutoRenewalStatus(UpdateAutoRenewalStatusRequest) returns (UpdateAutoRenewalStatusResponse);
|
|
11
|
+
rpc GetPlans(google.protobuf.Empty) returns (GetPlansResponse);
|
|
12
|
+
rpc GetPlanById(GetPlanByIdRequest) returns (GetPlanByIdResponse);
|
|
13
|
+
rpc Refund(RefundRequest) returns (RefundResponse);
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
message GetHistoryRequest{}
|
|
17
|
+
|
|
18
|
+
message GetHistoryResponse {
|
|
19
|
+
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
message InitTransactionRequest {
|
|
23
|
+
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
message InitTransactionResponse {
|
|
27
|
+
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
message UpdateAutoRenewalStatusRequest {
|
|
31
|
+
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
message UpdateAutoRenewalStatusResponse {
|
|
35
|
+
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
message GetPlansResponse {}
|
|
40
|
+
|
|
41
|
+
message GetPlanByIdRequest {}
|
|
42
|
+
message GetPlanByIdResponse{}
|
|
43
|
+
|
|
44
|
+
message RefundRequest {}
|
|
45
|
+
|
|
46
|
+
message RefundResponse {}
|