@nexiolab/contracts 1.0.12 → 1.0.13
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 +46 -0
package/gen/account.ts
CHANGED
|
@@ -29,6 +29,44 @@ export interface GetAccountResponse {
|
|
|
29
29
|
role: Role;
|
|
30
30
|
}
|
|
31
31
|
|
|
32
|
+
export interface InitEmailChangeRequest {
|
|
33
|
+
email: string;
|
|
34
|
+
userId: string;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
export interface InitEmailChangeResponse {
|
|
38
|
+
ok: boolean;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
export interface ConfirmEmailChangeRequest {
|
|
42
|
+
email: string;
|
|
43
|
+
code: string;
|
|
44
|
+
userId: string;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
export interface ConfirmEmailChangeResponse {
|
|
48
|
+
ok: boolean;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
export interface InitPhoneChangeRequest {
|
|
52
|
+
phone: string;
|
|
53
|
+
userId: string;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
export interface InitPhoneChangeResponse {
|
|
57
|
+
ok: boolean;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
export interface ConfirmPhoneChangeRequest {
|
|
61
|
+
phone: string;
|
|
62
|
+
code: string;
|
|
63
|
+
userId: string;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
export interface ConfirmPhoneChangeResponse {
|
|
67
|
+
ok: boolean;
|
|
68
|
+
}
|
|
69
|
+
|
|
32
70
|
export const ACCOUNT_V1_PACKAGE_NAME = "account.v1";
|
|
33
71
|
|
|
34
72
|
/** AccountService provides account related operations */
|
|
@@ -37,6 +75,22 @@ export interface AccountServiceClient {
|
|
|
37
75
|
/** GetAccount returns account */
|
|
38
76
|
|
|
39
77
|
getAccount(request: GetAccountRequest): Observable<GetAccountResponse>;
|
|
78
|
+
|
|
79
|
+
/** Initializes email changing */
|
|
80
|
+
|
|
81
|
+
initEmailChange(request: InitEmailChangeRequest): Observable<InitEmailChangeResponse>;
|
|
82
|
+
|
|
83
|
+
/** Confirms email changing */
|
|
84
|
+
|
|
85
|
+
confirmEmailChange(request: ConfirmEmailChangeRequest): Observable<ConfirmEmailChangeResponse>;
|
|
86
|
+
|
|
87
|
+
/** Initializes email changing */
|
|
88
|
+
|
|
89
|
+
initPhoneChange(request: InitPhoneChangeRequest): Observable<InitPhoneChangeResponse>;
|
|
90
|
+
|
|
91
|
+
/** Confirms email changing */
|
|
92
|
+
|
|
93
|
+
confirmPhoneChange(request: ConfirmPhoneChangeRequest): Observable<ConfirmPhoneChangeResponse>;
|
|
40
94
|
}
|
|
41
95
|
|
|
42
96
|
/** AccountService provides account related operations */
|
|
@@ -47,11 +101,41 @@ export interface AccountServiceController {
|
|
|
47
101
|
getAccount(
|
|
48
102
|
request: GetAccountRequest,
|
|
49
103
|
): Promise<GetAccountResponse> | Observable<GetAccountResponse> | GetAccountResponse;
|
|
104
|
+
|
|
105
|
+
/** Initializes email changing */
|
|
106
|
+
|
|
107
|
+
initEmailChange(
|
|
108
|
+
request: InitEmailChangeRequest,
|
|
109
|
+
): Promise<InitEmailChangeResponse> | Observable<InitEmailChangeResponse> | InitEmailChangeResponse;
|
|
110
|
+
|
|
111
|
+
/** Confirms email changing */
|
|
112
|
+
|
|
113
|
+
confirmEmailChange(
|
|
114
|
+
request: ConfirmEmailChangeRequest,
|
|
115
|
+
): Promise<ConfirmEmailChangeResponse> | Observable<ConfirmEmailChangeResponse> | ConfirmEmailChangeResponse;
|
|
116
|
+
|
|
117
|
+
/** Initializes email changing */
|
|
118
|
+
|
|
119
|
+
initPhoneChange(
|
|
120
|
+
request: InitPhoneChangeRequest,
|
|
121
|
+
): Promise<InitPhoneChangeResponse> | Observable<InitPhoneChangeResponse> | InitPhoneChangeResponse;
|
|
122
|
+
|
|
123
|
+
/** Confirms email changing */
|
|
124
|
+
|
|
125
|
+
confirmPhoneChange(
|
|
126
|
+
request: ConfirmPhoneChangeRequest,
|
|
127
|
+
): Promise<ConfirmPhoneChangeResponse> | Observable<ConfirmPhoneChangeResponse> | ConfirmPhoneChangeResponse;
|
|
50
128
|
}
|
|
51
129
|
|
|
52
130
|
export function AccountServiceControllerMethods() {
|
|
53
131
|
return function (constructor: Function) {
|
|
54
|
-
const grpcMethods: string[] = [
|
|
132
|
+
const grpcMethods: string[] = [
|
|
133
|
+
"getAccount",
|
|
134
|
+
"initEmailChange",
|
|
135
|
+
"confirmEmailChange",
|
|
136
|
+
"initPhoneChange",
|
|
137
|
+
"confirmPhoneChange",
|
|
138
|
+
];
|
|
55
139
|
for (const method of grpcMethods) {
|
|
56
140
|
const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
|
|
57
141
|
GrpcMethod("AccountService", method)(constructor.prototype[method], method, descriptor);
|
package/package.json
CHANGED
package/proto/account.proto
CHANGED
|
@@ -6,6 +6,14 @@ package account.v1;
|
|
|
6
6
|
service AccountService {
|
|
7
7
|
// GetAccount returns account
|
|
8
8
|
rpc GetAccount(GetAccountRequest) returns (GetAccountResponse);
|
|
9
|
+
// Initializes email changing
|
|
10
|
+
rpc InitEmailChange(InitEmailChangeRequest) returns (InitEmailChangeResponse);
|
|
11
|
+
// Confirms email changing
|
|
12
|
+
rpc ConfirmEmailChange(ConfirmEmailChangeRequest) returns (ConfirmEmailChangeResponse);
|
|
13
|
+
// Initializes email changing
|
|
14
|
+
rpc InitPhoneChange(InitPhoneChangeRequest) returns (InitPhoneChangeResponse);
|
|
15
|
+
// Confirms email changing
|
|
16
|
+
rpc ConfirmPhoneChange(ConfirmPhoneChangeRequest) returns (ConfirmPhoneChangeResponse);
|
|
9
17
|
}
|
|
10
18
|
|
|
11
19
|
message GetAccountRequest {
|
|
@@ -21,6 +29,44 @@ message GetAccountResponse {
|
|
|
21
29
|
Role role = 6;
|
|
22
30
|
}
|
|
23
31
|
|
|
32
|
+
message InitEmailChangeRequest {
|
|
33
|
+
string email = 1;
|
|
34
|
+
string user_id = 2;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
message InitEmailChangeResponse {
|
|
38
|
+
bool ok = 1;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
message ConfirmEmailChangeRequest {
|
|
42
|
+
string email = 1;
|
|
43
|
+
string code = 2;
|
|
44
|
+
string user_id = 3;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
message ConfirmEmailChangeResponse {
|
|
48
|
+
bool ok = 1;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
message InitPhoneChangeRequest {
|
|
52
|
+
string phone = 1;
|
|
53
|
+
string user_id = 2;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
message InitPhoneChangeResponse {
|
|
57
|
+
bool ok = 1;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
message ConfirmPhoneChangeRequest {
|
|
61
|
+
string phone = 1;
|
|
62
|
+
string code = 2;
|
|
63
|
+
string user_id = 3;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
message ConfirmPhoneChangeResponse {
|
|
67
|
+
bool ok = 1;
|
|
68
|
+
}
|
|
69
|
+
|
|
24
70
|
enum Role {
|
|
25
71
|
USER = 0;
|
|
26
72
|
ADMIN = 1;
|