@barumetric/contracts 1.3.6 → 1.3.8
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/ts/balance.ts +67 -0
- package/package.json +1 -1
- package/proto/balance.proto +29 -0
package/dist/proto/paths.d.ts
CHANGED
package/dist/proto/paths.js
CHANGED
|
@@ -12,4 +12,5 @@ exports.PROTO_PATHS = {
|
|
|
12
12
|
PRESENCE: (0, path_1.join)(__dirname, "../../proto/presence.proto"),
|
|
13
13
|
AD: (0, path_1.join)(__dirname, "../../proto/ad.proto"),
|
|
14
14
|
PAYMENT: (0, path_1.join)(__dirname, "../../proto/payment.proto"),
|
|
15
|
+
BALANCE: (0, path_1.join)(__dirname, "../../proto/balance.proto"),
|
|
15
16
|
};
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
|
|
2
|
+
// versions:
|
|
3
|
+
// protoc-gen-ts_proto v2.11.0
|
|
4
|
+
// protoc v3.21.12
|
|
5
|
+
// source: balance.proto
|
|
6
|
+
|
|
7
|
+
/* eslint-disable */
|
|
8
|
+
import { GrpcMethod, GrpcStreamMethod } from "@nestjs/microservices";
|
|
9
|
+
import { Observable } from "rxjs";
|
|
10
|
+
|
|
11
|
+
export const protobufPackage = "balance.v1";
|
|
12
|
+
|
|
13
|
+
export interface CreateUserBalanceRequest {
|
|
14
|
+
userId: string;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export interface CreateUserBalanceResponse {
|
|
18
|
+
ok: boolean;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export interface GetUserBalanceRequest {
|
|
22
|
+
userId: string;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export interface GetUserBalanceResponse {
|
|
26
|
+
balance: UserBalance | undefined;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export interface UserBalance {
|
|
30
|
+
balance: number;
|
|
31
|
+
version: number;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
export const BALANCE_V1_PACKAGE_NAME = "balance.v1";
|
|
35
|
+
|
|
36
|
+
export interface BalanceServiceClient {
|
|
37
|
+
createUserBalance(request: CreateUserBalanceRequest): Observable<CreateUserBalanceResponse>;
|
|
38
|
+
|
|
39
|
+
getUserBalance(request: GetUserBalanceRequest): Observable<GetUserBalanceResponse>;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
export interface BalanceServiceController {
|
|
43
|
+
createUserBalance(
|
|
44
|
+
request: CreateUserBalanceRequest,
|
|
45
|
+
): Promise<CreateUserBalanceResponse> | Observable<CreateUserBalanceResponse> | CreateUserBalanceResponse;
|
|
46
|
+
|
|
47
|
+
getUserBalance(
|
|
48
|
+
request: GetUserBalanceRequest,
|
|
49
|
+
): Promise<GetUserBalanceResponse> | Observable<GetUserBalanceResponse> | GetUserBalanceResponse;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
export function BalanceServiceControllerMethods() {
|
|
53
|
+
return function (constructor: Function) {
|
|
54
|
+
const grpcMethods: string[] = ["createUserBalance", "getUserBalance"];
|
|
55
|
+
for (const method of grpcMethods) {
|
|
56
|
+
const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
|
|
57
|
+
GrpcMethod("BalanceService", method)(constructor.prototype[method], method, descriptor);
|
|
58
|
+
}
|
|
59
|
+
const grpcStreamMethods: string[] = [];
|
|
60
|
+
for (const method of grpcStreamMethods) {
|
|
61
|
+
const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
|
|
62
|
+
GrpcStreamMethod("BalanceService", method)(constructor.prototype[method], method, descriptor);
|
|
63
|
+
}
|
|
64
|
+
};
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
export const BALANCE_SERVICE_NAME = "BalanceService";
|
package/package.json
CHANGED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
syntax = "proto3";
|
|
2
|
+
|
|
3
|
+
package balance.v1;
|
|
4
|
+
|
|
5
|
+
service BalanceService {
|
|
6
|
+
rpc CreateUserBalance (CreateUserBalanceRequest) returns (CreateUserBalanceResponse);
|
|
7
|
+
rpc GetUserBalance (GetUserBalanceRequest) returns (GetUserBalanceResponse);
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
message CreateUserBalanceRequest {
|
|
11
|
+
string user_id = 1;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
message CreateUserBalanceResponse {
|
|
15
|
+
bool ok = 1;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
message GetUserBalanceRequest {
|
|
19
|
+
string user_id = 1;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
message GetUserBalanceResponse {
|
|
23
|
+
UserBalance balance = 1;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
message UserBalance {
|
|
27
|
+
int32 balance = 1;
|
|
28
|
+
int32 version = 2;
|
|
29
|
+
}
|