@kottvideo/contracts 1.1.0 → 1.1.1
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 +79 -1
- package/package.json +1 -1
- package/proto/account.proto +48 -0
package/gen/account.ts
CHANGED
|
@@ -29,21 +29,99 @@ export interface GetAccountResponse {
|
|
|
29
29
|
role: Role;
|
|
30
30
|
}
|
|
31
31
|
|
|
32
|
+
/** Email change */
|
|
33
|
+
export interface BeginEmailChangeRequest {
|
|
34
|
+
userId: string;
|
|
35
|
+
email: string;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
export interface BeginEmailChangeResponse {
|
|
39
|
+
ok: boolean;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
export interface ConfirmEmailChangeRequest {
|
|
43
|
+
userId: string;
|
|
44
|
+
email: string;
|
|
45
|
+
code: string;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
export interface ConfirmEmailChangeResponse {
|
|
49
|
+
ok: boolean;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
/** Phone change */
|
|
53
|
+
export interface BeginPhoneChangeRequest {
|
|
54
|
+
userId: string;
|
|
55
|
+
phone: string;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
export interface BeginPhoneChangeResponse {
|
|
59
|
+
ok: boolean;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
export interface ConfirmPhoneChangeRequest {
|
|
63
|
+
userId: string;
|
|
64
|
+
phone: string;
|
|
65
|
+
code: string;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
export interface ConfirmPhoneChangeResponse {
|
|
69
|
+
ok: boolean;
|
|
70
|
+
}
|
|
71
|
+
|
|
32
72
|
export const ACCOUNT_V1_PACKAGE_NAME = "account.v1";
|
|
33
73
|
|
|
34
74
|
export interface AccountServiceClient {
|
|
35
75
|
getAccount(request: GetAccountRequest): Observable<GetAccountResponse>;
|
|
76
|
+
|
|
77
|
+
/** Email change */
|
|
78
|
+
|
|
79
|
+
beginEmailChange(request: BeginEmailChangeRequest): Observable<BeginEmailChangeResponse>;
|
|
80
|
+
|
|
81
|
+
confirmEmailChange(request: ConfirmEmailChangeRequest): Observable<ConfirmEmailChangeResponse>;
|
|
82
|
+
|
|
83
|
+
/** Phone Change */
|
|
84
|
+
|
|
85
|
+
beginPhoneChange(request: BeginPhoneChangeRequest): Observable<BeginPhoneChangeResponse>;
|
|
86
|
+
|
|
87
|
+
confirmPhoneChange(request: ConfirmPhoneChangeRequest): Observable<ConfirmPhoneChangeResponse>;
|
|
36
88
|
}
|
|
37
89
|
|
|
38
90
|
export interface AccountServiceController {
|
|
39
91
|
getAccount(
|
|
40
92
|
request: GetAccountRequest,
|
|
41
93
|
): Promise<GetAccountResponse> | Observable<GetAccountResponse> | GetAccountResponse;
|
|
94
|
+
|
|
95
|
+
/** Email change */
|
|
96
|
+
|
|
97
|
+
beginEmailChange(
|
|
98
|
+
request: BeginEmailChangeRequest,
|
|
99
|
+
): Promise<BeginEmailChangeResponse> | Observable<BeginEmailChangeResponse> | BeginEmailChangeResponse;
|
|
100
|
+
|
|
101
|
+
confirmEmailChange(
|
|
102
|
+
request: ConfirmEmailChangeRequest,
|
|
103
|
+
): Promise<ConfirmEmailChangeResponse> | Observable<ConfirmEmailChangeResponse> | ConfirmEmailChangeResponse;
|
|
104
|
+
|
|
105
|
+
/** Phone Change */
|
|
106
|
+
|
|
107
|
+
beginPhoneChange(
|
|
108
|
+
request: BeginPhoneChangeRequest,
|
|
109
|
+
): Promise<BeginPhoneChangeResponse> | Observable<BeginPhoneChangeResponse> | BeginPhoneChangeResponse;
|
|
110
|
+
|
|
111
|
+
confirmPhoneChange(
|
|
112
|
+
request: ConfirmPhoneChangeRequest,
|
|
113
|
+
): Promise<ConfirmPhoneChangeResponse> | Observable<ConfirmPhoneChangeResponse> | ConfirmPhoneChangeResponse;
|
|
42
114
|
}
|
|
43
115
|
|
|
44
116
|
export function AccountServiceControllerMethods() {
|
|
45
117
|
return function (constructor: Function) {
|
|
46
|
-
const grpcMethods: string[] = [
|
|
118
|
+
const grpcMethods: string[] = [
|
|
119
|
+
"getAccount",
|
|
120
|
+
"beginEmailChange",
|
|
121
|
+
"confirmEmailChange",
|
|
122
|
+
"beginPhoneChange",
|
|
123
|
+
"confirmPhoneChange",
|
|
124
|
+
];
|
|
47
125
|
for (const method of grpcMethods) {
|
|
48
126
|
const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
|
|
49
127
|
GrpcMethod("AccountService", method)(constructor.prototype[method], method, descriptor);
|
package/package.json
CHANGED
package/proto/account.proto
CHANGED
|
@@ -4,6 +4,14 @@ package account.v1;
|
|
|
4
4
|
|
|
5
5
|
service AccountService {
|
|
6
6
|
rpc GetAccount (GetAccountRequest) returns (GetAccountResponse);
|
|
7
|
+
|
|
8
|
+
// Email change
|
|
9
|
+
rpc BeginEmailChange (BeginEmailChangeRequest) returns (BeginEmailChangeResponse);
|
|
10
|
+
rpc ConfirmEmailChange (ConfirmEmailChangeRequest) returns (ConfirmEmailChangeResponse);
|
|
11
|
+
|
|
12
|
+
// Phone Change
|
|
13
|
+
rpc BeginPhoneChange (BeginPhoneChangeRequest) returns (BeginPhoneChangeResponse);
|
|
14
|
+
rpc ConfirmPhoneChange (ConfirmPhoneChangeRequest) returns (ConfirmPhoneChangeResponse);
|
|
7
15
|
}
|
|
8
16
|
|
|
9
17
|
message GetAccountRequest {
|
|
@@ -19,6 +27,46 @@ message GetAccountResponse {
|
|
|
19
27
|
Role role = 6;
|
|
20
28
|
}
|
|
21
29
|
|
|
30
|
+
// Email change
|
|
31
|
+
message BeginEmailChangeRequest {
|
|
32
|
+
string user_id = 1;
|
|
33
|
+
string email = 2;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
message BeginEmailChangeResponse {
|
|
37
|
+
bool ok = 1;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
message ConfirmEmailChangeRequest {
|
|
41
|
+
string user_id = 1;
|
|
42
|
+
string email = 2;
|
|
43
|
+
string code = 3;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
message ConfirmEmailChangeResponse {
|
|
47
|
+
bool ok = 1;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
// Phone change
|
|
51
|
+
message BeginPhoneChangeRequest {
|
|
52
|
+
string user_id = 1;
|
|
53
|
+
string phone = 2;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
message BeginPhoneChangeResponse {
|
|
57
|
+
bool ok = 1;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
message ConfirmPhoneChangeRequest {
|
|
61
|
+
string user_id = 1;
|
|
62
|
+
string phone = 2;
|
|
63
|
+
string code = 3;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
message ConfirmPhoneChangeResponse {
|
|
67
|
+
bool ok = 1;
|
|
68
|
+
}
|
|
69
|
+
|
|
22
70
|
enum Role {
|
|
23
71
|
USER = 0;
|
|
24
72
|
ADMIN = 1;
|