@usteam/contracts 1.0.5 → 1.0.6
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.ts +85 -1
- package/package.json +1 -1
- package/proto/account.proto +49 -0
package/gen/account.ts
CHANGED
|
@@ -31,6 +31,44 @@ export interface GetAccountResponse {
|
|
|
31
31
|
role: Role;
|
|
32
32
|
}
|
|
33
33
|
|
|
34
|
+
export interface InitEmailChangeRequest {
|
|
35
|
+
email: string;
|
|
36
|
+
userId: string;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
export interface InitEmailChangeResponce {
|
|
40
|
+
ok: boolean;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
export interface ConfirmEmailChangeRequest {
|
|
44
|
+
email: string;
|
|
45
|
+
code: string;
|
|
46
|
+
userId: string;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
export interface ConfirmEmailChangeResponce {
|
|
50
|
+
ok: boolean;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
export interface InitPhoneChangeRequest {
|
|
54
|
+
phone: string;
|
|
55
|
+
userId: string;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
export interface InitPhoneChangeResponce {
|
|
59
|
+
ok: boolean;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
export interface ConfirmPhoneChangeRequest {
|
|
63
|
+
phone: string;
|
|
64
|
+
code: string;
|
|
65
|
+
userId: string;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
export interface ConfirmPhoneChangeResponce {
|
|
69
|
+
ok: boolean;
|
|
70
|
+
}
|
|
71
|
+
|
|
34
72
|
export const ACCOUNT_V1_PACKAGE_NAME = "account.v1";
|
|
35
73
|
|
|
36
74
|
/** AccountService отвечает за операции с аккаунтом. */
|
|
@@ -42,6 +80,22 @@ export interface AccountServiceClient {
|
|
|
42
80
|
*/
|
|
43
81
|
|
|
44
82
|
getAccount(request: GetAccountRequest): Observable<GetAccountResponse>;
|
|
83
|
+
|
|
84
|
+
/** InitEmailChange запрашивает новую почту */
|
|
85
|
+
|
|
86
|
+
initEmailChange(request: InitEmailChangeRequest): Observable<InitEmailChangeResponce>;
|
|
87
|
+
|
|
88
|
+
/** ConfirmEmailChange подтверждает новую почту */
|
|
89
|
+
|
|
90
|
+
confirmEmailChange(request: ConfirmEmailChangeRequest): Observable<ConfirmEmailChangeResponce>;
|
|
91
|
+
|
|
92
|
+
/** InitPhoneChange запрашивает новый телефон */
|
|
93
|
+
|
|
94
|
+
initPhoneChange(request: InitPhoneChangeRequest): Observable<InitPhoneChangeResponce>;
|
|
95
|
+
|
|
96
|
+
/** ConfirmPhoneChange подтверждает новый телефон */
|
|
97
|
+
|
|
98
|
+
confirmPhoneChange(request: ConfirmPhoneChangeRequest): Observable<ConfirmPhoneChangeResponce>;
|
|
45
99
|
}
|
|
46
100
|
|
|
47
101
|
/** AccountService отвечает за операции с аккаунтом. */
|
|
@@ -55,11 +109,41 @@ export interface AccountServiceController {
|
|
|
55
109
|
getAccount(
|
|
56
110
|
request: GetAccountRequest,
|
|
57
111
|
): Promise<GetAccountResponse> | Observable<GetAccountResponse> | GetAccountResponse;
|
|
112
|
+
|
|
113
|
+
/** InitEmailChange запрашивает новую почту */
|
|
114
|
+
|
|
115
|
+
initEmailChange(
|
|
116
|
+
request: InitEmailChangeRequest,
|
|
117
|
+
): Promise<InitEmailChangeResponce> | Observable<InitEmailChangeResponce> | InitEmailChangeResponce;
|
|
118
|
+
|
|
119
|
+
/** ConfirmEmailChange подтверждает новую почту */
|
|
120
|
+
|
|
121
|
+
confirmEmailChange(
|
|
122
|
+
request: ConfirmEmailChangeRequest,
|
|
123
|
+
): Promise<ConfirmEmailChangeResponce> | Observable<ConfirmEmailChangeResponce> | ConfirmEmailChangeResponce;
|
|
124
|
+
|
|
125
|
+
/** InitPhoneChange запрашивает новый телефон */
|
|
126
|
+
|
|
127
|
+
initPhoneChange(
|
|
128
|
+
request: InitPhoneChangeRequest,
|
|
129
|
+
): Promise<InitPhoneChangeResponce> | Observable<InitPhoneChangeResponce> | InitPhoneChangeResponce;
|
|
130
|
+
|
|
131
|
+
/** ConfirmPhoneChange подтверждает новый телефон */
|
|
132
|
+
|
|
133
|
+
confirmPhoneChange(
|
|
134
|
+
request: ConfirmPhoneChangeRequest,
|
|
135
|
+
): Promise<ConfirmPhoneChangeResponce> | Observable<ConfirmPhoneChangeResponce> | ConfirmPhoneChangeResponce;
|
|
58
136
|
}
|
|
59
137
|
|
|
60
138
|
export function AccountServiceControllerMethods() {
|
|
61
139
|
return function (constructor: Function) {
|
|
62
|
-
const grpcMethods: string[] = [
|
|
140
|
+
const grpcMethods: string[] = [
|
|
141
|
+
"getAccount",
|
|
142
|
+
"initEmailChange",
|
|
143
|
+
"confirmEmailChange",
|
|
144
|
+
"initPhoneChange",
|
|
145
|
+
"confirmPhoneChange",
|
|
146
|
+
];
|
|
63
147
|
for (const method of grpcMethods) {
|
|
64
148
|
const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
|
|
65
149
|
GrpcMethod("AccountService", method)(constructor.prototype[method], method, descriptor);
|
package/package.json
CHANGED
package/proto/account.proto
CHANGED
|
@@ -7,6 +7,17 @@ service AccountService {
|
|
|
7
7
|
// GetAccount отправляет id аккаунта
|
|
8
8
|
// получает данные об аккаунте
|
|
9
9
|
rpc GetAccount (GetAccountRequest) returns (GetAccountResponse);
|
|
10
|
+
|
|
11
|
+
// InitEmailChange запрашивает новую почту
|
|
12
|
+
rpc InitEmailChange(InitEmailChangeRequest) returns (InitEmailChangeResponce);
|
|
13
|
+
// ConfirmEmailChange подтверждает новую почту
|
|
14
|
+
rpc ConfirmEmailChange(ConfirmEmailChangeRequest) returns (ConfirmEmailChangeResponce);
|
|
15
|
+
|
|
16
|
+
// InitPhoneChange запрашивает новый телефон
|
|
17
|
+
rpc InitPhoneChange(InitPhoneChangeRequest) returns (InitPhoneChangeResponce);
|
|
18
|
+
// ConfirmPhoneChange подтверждает новый телефон
|
|
19
|
+
rpc ConfirmPhoneChange(ConfirmPhoneChangeRequest) returns (ConfirmPhoneChangeResponce);
|
|
20
|
+
|
|
10
21
|
}
|
|
11
22
|
|
|
12
23
|
message GetAccountRequest {
|
|
@@ -23,6 +34,44 @@ message GetAccountResponse {
|
|
|
23
34
|
|
|
24
35
|
}
|
|
25
36
|
|
|
37
|
+
message InitEmailChangeRequest {
|
|
38
|
+
string email = 1;
|
|
39
|
+
string user_id = 2;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
message InitEmailChangeResponce {
|
|
43
|
+
bool ok = 1;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
message ConfirmEmailChangeRequest {
|
|
47
|
+
string email = 1;
|
|
48
|
+
string code = 2;
|
|
49
|
+
string user_id = 3;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
message ConfirmEmailChangeResponce {
|
|
53
|
+
bool ok = 1;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
message InitPhoneChangeRequest {
|
|
57
|
+
string phone = 1;
|
|
58
|
+
string user_id = 2;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
message InitPhoneChangeResponce {
|
|
62
|
+
bool ok = 1;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
message ConfirmPhoneChangeRequest {
|
|
66
|
+
string phone = 1;
|
|
67
|
+
string code = 2;
|
|
68
|
+
string user_id = 3;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
message ConfirmPhoneChangeResponce {
|
|
72
|
+
bool ok = 1;
|
|
73
|
+
}
|
|
74
|
+
|
|
26
75
|
enum Role {
|
|
27
76
|
USER = 0;
|
|
28
77
|
ADMIN = 1;
|