@booking-guvanch/contracts 1.0.12 → 1.0.15
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/gen/account.d.ts +38 -0
- package/gen/account.js +7 -1
- package/gen/account.ts +69 -1
- package/package.json +4 -2
- package/proto/account.proto +40 -0
package/gen/account.d.ts
CHANGED
|
@@ -5,6 +5,36 @@ export declare enum Role {
|
|
|
5
5
|
ADMIN = 1,
|
|
6
6
|
UNRECOGNIZED = -1
|
|
7
7
|
}
|
|
8
|
+
export interface InitPhoneCodeRequest {
|
|
9
|
+
phone: string;
|
|
10
|
+
userId: string;
|
|
11
|
+
}
|
|
12
|
+
export interface InitPhoneCodeResponse {
|
|
13
|
+
ok: boolean;
|
|
14
|
+
}
|
|
15
|
+
export interface ConfirmPhoneCodeRequest {
|
|
16
|
+
phone: string;
|
|
17
|
+
code: string;
|
|
18
|
+
userId: string;
|
|
19
|
+
}
|
|
20
|
+
export interface ConfirmPhoneCodeResponse {
|
|
21
|
+
ok: boolean;
|
|
22
|
+
}
|
|
23
|
+
export interface InitEmailCodeRequest {
|
|
24
|
+
email: string;
|
|
25
|
+
userId: string;
|
|
26
|
+
}
|
|
27
|
+
export interface InitEmailCodeResponse {
|
|
28
|
+
ok: boolean;
|
|
29
|
+
}
|
|
30
|
+
export interface ConfirmEmailCodeRequest {
|
|
31
|
+
email: string;
|
|
32
|
+
code: string;
|
|
33
|
+
userId: string;
|
|
34
|
+
}
|
|
35
|
+
export interface ConfirmEmailCodeResponse {
|
|
36
|
+
ok: boolean;
|
|
37
|
+
}
|
|
8
38
|
export interface GetAccountRequest {
|
|
9
39
|
id: string;
|
|
10
40
|
}
|
|
@@ -19,9 +49,17 @@ export interface GetAccountResponse {
|
|
|
19
49
|
export declare const ACCOUNT_V1_PACKAGE_NAME = "account.v1";
|
|
20
50
|
export interface AccountServiceClient {
|
|
21
51
|
getAccount(request: GetAccountRequest): Observable<GetAccountResponse>;
|
|
52
|
+
initEmailCode(request: InitEmailCodeRequest): Observable<InitEmailCodeResponse>;
|
|
53
|
+
confirmEmailCode(request: ConfirmEmailCodeRequest): Observable<ConfirmEmailCodeResponse>;
|
|
54
|
+
initPhoneCode(request: InitPhoneCodeRequest): Observable<InitPhoneCodeResponse>;
|
|
55
|
+
confirmPhoneCode(request: ConfirmPhoneCodeRequest): Observable<ConfirmPhoneCodeResponse>;
|
|
22
56
|
}
|
|
23
57
|
export interface AccountServiceController {
|
|
24
58
|
getAccount(request: GetAccountRequest): Promise<GetAccountResponse> | Observable<GetAccountResponse> | GetAccountResponse;
|
|
59
|
+
initEmailCode(request: InitEmailCodeRequest): Promise<InitEmailCodeResponse> | Observable<InitEmailCodeResponse> | InitEmailCodeResponse;
|
|
60
|
+
confirmEmailCode(request: ConfirmEmailCodeRequest): Promise<ConfirmEmailCodeResponse> | Observable<ConfirmEmailCodeResponse> | ConfirmEmailCodeResponse;
|
|
61
|
+
initPhoneCode(request: InitPhoneCodeRequest): Promise<InitPhoneCodeResponse> | Observable<InitPhoneCodeResponse> | InitPhoneCodeResponse;
|
|
62
|
+
confirmPhoneCode(request: ConfirmPhoneCodeRequest): Promise<ConfirmPhoneCodeResponse> | Observable<ConfirmPhoneCodeResponse> | ConfirmPhoneCodeResponse;
|
|
25
63
|
}
|
|
26
64
|
export declare function AccountServiceControllerMethods(): (constructor: Function) => void;
|
|
27
65
|
export declare const ACCOUNT_SERVICE_NAME = "AccountService";
|
package/gen/account.js
CHANGED
|
@@ -19,7 +19,13 @@ var Role;
|
|
|
19
19
|
exports.ACCOUNT_V1_PACKAGE_NAME = "account.v1";
|
|
20
20
|
function AccountServiceControllerMethods() {
|
|
21
21
|
return function (constructor) {
|
|
22
|
-
const grpcMethods = [
|
|
22
|
+
const grpcMethods = [
|
|
23
|
+
"getAccount",
|
|
24
|
+
"initEmailCode",
|
|
25
|
+
"confirmEmailCode",
|
|
26
|
+
"initPhoneCode",
|
|
27
|
+
"confirmPhoneCode",
|
|
28
|
+
];
|
|
23
29
|
for (const method of grpcMethods) {
|
|
24
30
|
const descriptor = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
|
|
25
31
|
(0, microservices_1.GrpcMethod)("AccountService", method)(constructor.prototype[method], method, descriptor);
|
package/gen/account.ts
CHANGED
|
@@ -16,6 +16,44 @@ export enum Role {
|
|
|
16
16
|
UNRECOGNIZED = -1,
|
|
17
17
|
}
|
|
18
18
|
|
|
19
|
+
export interface InitPhoneCodeRequest {
|
|
20
|
+
phone: string;
|
|
21
|
+
userId: string;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export interface InitPhoneCodeResponse {
|
|
25
|
+
ok: boolean;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export interface ConfirmPhoneCodeRequest {
|
|
29
|
+
phone: string;
|
|
30
|
+
code: string;
|
|
31
|
+
userId: string;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
export interface ConfirmPhoneCodeResponse {
|
|
35
|
+
ok: boolean;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
export interface InitEmailCodeRequest {
|
|
39
|
+
email: string;
|
|
40
|
+
userId: string;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
export interface InitEmailCodeResponse {
|
|
44
|
+
ok: boolean;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
export interface ConfirmEmailCodeRequest {
|
|
48
|
+
email: string;
|
|
49
|
+
code: string;
|
|
50
|
+
userId: string;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
export interface ConfirmEmailCodeResponse {
|
|
54
|
+
ok: boolean;
|
|
55
|
+
}
|
|
56
|
+
|
|
19
57
|
export interface GetAccountRequest {
|
|
20
58
|
id: string;
|
|
21
59
|
}
|
|
@@ -33,17 +71,47 @@ export const ACCOUNT_V1_PACKAGE_NAME = "account.v1";
|
|
|
33
71
|
|
|
34
72
|
export interface AccountServiceClient {
|
|
35
73
|
getAccount(request: GetAccountRequest): Observable<GetAccountResponse>;
|
|
74
|
+
|
|
75
|
+
initEmailCode(request: InitEmailCodeRequest): Observable<InitEmailCodeResponse>;
|
|
76
|
+
|
|
77
|
+
confirmEmailCode(request: ConfirmEmailCodeRequest): Observable<ConfirmEmailCodeResponse>;
|
|
78
|
+
|
|
79
|
+
initPhoneCode(request: InitPhoneCodeRequest): Observable<InitPhoneCodeResponse>;
|
|
80
|
+
|
|
81
|
+
confirmPhoneCode(request: ConfirmPhoneCodeRequest): Observable<ConfirmPhoneCodeResponse>;
|
|
36
82
|
}
|
|
37
83
|
|
|
38
84
|
export interface AccountServiceController {
|
|
39
85
|
getAccount(
|
|
40
86
|
request: GetAccountRequest,
|
|
41
87
|
): Promise<GetAccountResponse> | Observable<GetAccountResponse> | GetAccountResponse;
|
|
88
|
+
|
|
89
|
+
initEmailCode(
|
|
90
|
+
request: InitEmailCodeRequest,
|
|
91
|
+
): Promise<InitEmailCodeResponse> | Observable<InitEmailCodeResponse> | InitEmailCodeResponse;
|
|
92
|
+
|
|
93
|
+
confirmEmailCode(
|
|
94
|
+
request: ConfirmEmailCodeRequest,
|
|
95
|
+
): Promise<ConfirmEmailCodeResponse> | Observable<ConfirmEmailCodeResponse> | ConfirmEmailCodeResponse;
|
|
96
|
+
|
|
97
|
+
initPhoneCode(
|
|
98
|
+
request: InitPhoneCodeRequest,
|
|
99
|
+
): Promise<InitPhoneCodeResponse> | Observable<InitPhoneCodeResponse> | InitPhoneCodeResponse;
|
|
100
|
+
|
|
101
|
+
confirmPhoneCode(
|
|
102
|
+
request: ConfirmPhoneCodeRequest,
|
|
103
|
+
): Promise<ConfirmPhoneCodeResponse> | Observable<ConfirmPhoneCodeResponse> | ConfirmPhoneCodeResponse;
|
|
42
104
|
}
|
|
43
105
|
|
|
44
106
|
export function AccountServiceControllerMethods() {
|
|
45
107
|
return function (constructor: Function) {
|
|
46
|
-
const grpcMethods: string[] = [
|
|
108
|
+
const grpcMethods: string[] = [
|
|
109
|
+
"getAccount",
|
|
110
|
+
"initEmailCode",
|
|
111
|
+
"confirmEmailCode",
|
|
112
|
+
"initPhoneCode",
|
|
113
|
+
"confirmPhoneCode",
|
|
114
|
+
];
|
|
47
115
|
for (const method of grpcMethods) {
|
|
48
116
|
const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
|
|
49
117
|
GrpcMethod("AccountService", method)(constructor.prototype[method], method, descriptor);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@booking-guvanch/contracts",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.15",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -13,8 +13,10 @@
|
|
|
13
13
|
"access": "public"
|
|
14
14
|
},
|
|
15
15
|
"scripts": {
|
|
16
|
+
"generate": "mkdir -p ./gen && protoc -I ./proto --plugin=./node_modules/.bin/protoc-gen-ts_proto --ts_proto_out=./gen --ts_proto_opt=nestJs=true,package=omit ./proto/*.proto",
|
|
17
|
+
"prebuild": "yarn generate",
|
|
16
18
|
"build": "tsc -p tsconfig.build.json && tsc -p tsconfig.gen.json",
|
|
17
|
-
"
|
|
19
|
+
"prepack": "yarn build"
|
|
18
20
|
},
|
|
19
21
|
"license": "ISC",
|
|
20
22
|
"devDependencies": {
|
package/proto/account.proto
CHANGED
|
@@ -4,8 +4,48 @@ package account.v1;
|
|
|
4
4
|
|
|
5
5
|
service AccountService {
|
|
6
6
|
rpc GetAccount(GetAccountRequest) returns (GetAccountResponse);
|
|
7
|
+
rpc InitEmailCode(InitEmailCodeRequest) returns (InitEmailCodeResponse);
|
|
8
|
+
rpc ConfirmEmailCode(ConfirmEmailCodeRequest) returns (ConfirmEmailCodeResponse);
|
|
9
|
+
rpc InitPhoneCode(InitPhoneCodeRequest) returns (InitPhoneCodeResponse);
|
|
10
|
+
rpc ConfirmPhoneCode(ConfirmPhoneCodeRequest) returns (ConfirmPhoneCodeResponse);
|
|
7
11
|
}
|
|
8
12
|
|
|
13
|
+
message InitPhoneCodeRequest {
|
|
14
|
+
string phone = 1;
|
|
15
|
+
string user_id = 2;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
message InitPhoneCodeResponse {
|
|
19
|
+
bool ok = 1;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
message ConfirmPhoneCodeRequest {
|
|
23
|
+
string phone = 1;
|
|
24
|
+
string code = 2;
|
|
25
|
+
string user_id = 3;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
message ConfirmPhoneCodeResponse {
|
|
29
|
+
bool ok = 1;
|
|
30
|
+
}
|
|
31
|
+
message InitEmailCodeRequest {
|
|
32
|
+
string email = 1;
|
|
33
|
+
string user_id = 2;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
message InitEmailCodeResponse {
|
|
37
|
+
bool ok = 1;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
message ConfirmEmailCodeRequest {
|
|
41
|
+
string email = 1;
|
|
42
|
+
string code = 2;
|
|
43
|
+
string user_id = 3;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
message ConfirmEmailCodeResponse {
|
|
47
|
+
bool ok = 1;
|
|
48
|
+
}
|
|
9
49
|
message GetAccountRequest {
|
|
10
50
|
string id = 1;
|
|
11
51
|
}
|