@seatwave/contracts 1.0.4 → 1.0.5
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 +69 -21
- package/package.json +1 -1
- package/proto/account.proto +45 -23
package/gen/account.ts
CHANGED
|
@@ -10,60 +10,108 @@ import { Observable } from "rxjs";
|
|
|
10
10
|
|
|
11
11
|
export const protobufPackage = "account.v1";
|
|
12
12
|
|
|
13
|
-
/** Role represents the authorization level of the account. */
|
|
14
13
|
export enum Role {
|
|
15
|
-
/** USER - Default user role with standard permissions. */
|
|
16
14
|
USER = 0,
|
|
17
|
-
/** ADMIN - Administrator role with elevated permissions. */
|
|
18
15
|
ADMIN = 1,
|
|
19
16
|
UNRECOGNIZED = -1,
|
|
20
17
|
}
|
|
21
18
|
|
|
22
|
-
/** Request message for retrieving an account. */
|
|
23
19
|
export interface GetAccountRequest {
|
|
24
|
-
/** Unique account identifier (UUID). */
|
|
25
20
|
id: string;
|
|
26
21
|
}
|
|
27
22
|
|
|
28
|
-
/** Response message containing account details. */
|
|
29
23
|
export interface GetAccountResponse {
|
|
30
|
-
/** Unique account identifier. */
|
|
31
24
|
id: string;
|
|
32
|
-
/** Phone number associated with the account (E.164 format). */
|
|
33
25
|
phone: string;
|
|
34
|
-
/** Email address associated with the account. */
|
|
35
26
|
email: string;
|
|
36
|
-
/** Indicates whether the phone number has been verified. */
|
|
37
27
|
isPhoneVerified: boolean;
|
|
38
|
-
/** Indicates whether the email address has been verified. */
|
|
39
28
|
isEmailVerified: boolean;
|
|
40
|
-
/** Role assigned to the account. */
|
|
41
29
|
role: Role;
|
|
42
30
|
}
|
|
43
31
|
|
|
44
|
-
export
|
|
32
|
+
export interface InitEmailChangeRequest {
|
|
33
|
+
email: string;
|
|
34
|
+
userId: string;
|
|
35
|
+
}
|
|
45
36
|
|
|
46
|
-
|
|
37
|
+
export interface InitEmailChangeResponse {
|
|
38
|
+
ok: boolean;
|
|
39
|
+
}
|
|
47
40
|
|
|
48
|
-
export interface
|
|
49
|
-
|
|
41
|
+
export interface ConfirmEmailChangeRequest {
|
|
42
|
+
email: string;
|
|
43
|
+
code: string;
|
|
44
|
+
userId: string;
|
|
45
|
+
}
|
|
50
46
|
|
|
51
|
-
|
|
47
|
+
export interface ConfirmEmailChangeResponse {
|
|
48
|
+
ok: boolean;
|
|
52
49
|
}
|
|
53
50
|
|
|
54
|
-
|
|
51
|
+
export interface InitPhoneChangeRequest {
|
|
52
|
+
phone: string;
|
|
53
|
+
userId: string;
|
|
54
|
+
}
|
|
55
55
|
|
|
56
|
-
export interface
|
|
57
|
-
|
|
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
|
+
|
|
70
|
+
export const ACCOUNT_V1_PACKAGE_NAME = "account.v1";
|
|
71
|
+
|
|
72
|
+
export interface AccountServiceClient {
|
|
73
|
+
getAccount(request: GetAccountRequest): Observable<GetAccountResponse>;
|
|
74
|
+
|
|
75
|
+
initEmailChange(request: InitEmailChangeRequest): Observable<InitEmailChangeResponse>;
|
|
76
|
+
|
|
77
|
+
confirmEmailChange(request: ConfirmEmailChangeRequest): Observable<ConfirmEmailChangeResponse>;
|
|
58
78
|
|
|
79
|
+
initPhoneChange(request: InitPhoneChangeRequest): Observable<InitPhoneChangeResponse>;
|
|
80
|
+
|
|
81
|
+
confirmPhoneChange(request: ConfirmPhoneChangeRequest): Observable<ConfirmPhoneChangeResponse>;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
export interface AccountServiceController {
|
|
59
85
|
getAccount(
|
|
60
86
|
request: GetAccountRequest,
|
|
61
87
|
): Promise<GetAccountResponse> | Observable<GetAccountResponse> | GetAccountResponse;
|
|
88
|
+
|
|
89
|
+
initEmailChange(
|
|
90
|
+
request: InitEmailChangeRequest,
|
|
91
|
+
): Promise<InitEmailChangeResponse> | Observable<InitEmailChangeResponse> | InitEmailChangeResponse;
|
|
92
|
+
|
|
93
|
+
confirmEmailChange(
|
|
94
|
+
request: ConfirmEmailChangeRequest,
|
|
95
|
+
): Promise<ConfirmEmailChangeResponse> | Observable<ConfirmEmailChangeResponse> | ConfirmEmailChangeResponse;
|
|
96
|
+
|
|
97
|
+
initPhoneChange(
|
|
98
|
+
request: InitPhoneChangeRequest,
|
|
99
|
+
): Promise<InitPhoneChangeResponse> | Observable<InitPhoneChangeResponse> | InitPhoneChangeResponse;
|
|
100
|
+
|
|
101
|
+
confirmPhoneChange(
|
|
102
|
+
request: ConfirmPhoneChangeRequest,
|
|
103
|
+
): Promise<ConfirmPhoneChangeResponse> | Observable<ConfirmPhoneChangeResponse> | ConfirmPhoneChangeResponse;
|
|
62
104
|
}
|
|
63
105
|
|
|
64
106
|
export function AccountServiceControllerMethods() {
|
|
65
107
|
return function (constructor: Function) {
|
|
66
|
-
const grpcMethods: string[] = [
|
|
108
|
+
const grpcMethods: string[] = [
|
|
109
|
+
"getAccount",
|
|
110
|
+
"initEmailChange",
|
|
111
|
+
"confirmEmailChange",
|
|
112
|
+
"initPhoneChange",
|
|
113
|
+
"confirmPhoneChange",
|
|
114
|
+
];
|
|
67
115
|
for (const method of grpcMethods) {
|
|
68
116
|
const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
|
|
69
117
|
GrpcMethod("AccountService", method)(constructor.prototype[method], method, descriptor);
|
package/package.json
CHANGED
package/proto/account.proto
CHANGED
|
@@ -2,44 +2,66 @@ syntax = "proto3";
|
|
|
2
2
|
|
|
3
3
|
package account.v1;
|
|
4
4
|
|
|
5
|
-
// AccountService handles account retrieval operations.
|
|
6
5
|
service AccountService {
|
|
7
|
-
// GetAccount returns account information by unique identifier.
|
|
8
6
|
rpc GetAccount (GetAccountRequest) returns (GetAccountResponse);
|
|
7
|
+
rpc InitEmailChange (InitEmailChangeRequest) returns (InitEmailChangeResponse);
|
|
8
|
+
rpc ConfirmEmailChange (ConfirmEmailChangeRequest) returns (ConfirmEmailChangeResponse);
|
|
9
|
+
rpc InitPhoneChange (InitPhoneChangeRequest) returns (InitPhoneChangeResponse);
|
|
10
|
+
rpc ConfirmPhoneChange (ConfirmPhoneChangeRequest) returns (ConfirmPhoneChangeResponse);
|
|
9
11
|
}
|
|
10
12
|
|
|
11
|
-
// Request message for retrieving an account.
|
|
12
13
|
message GetAccountRequest {
|
|
13
|
-
// Unique account identifier (UUID).
|
|
14
14
|
string id = 1;
|
|
15
15
|
}
|
|
16
16
|
|
|
17
|
-
// Response message containing account details.
|
|
18
17
|
message GetAccountResponse {
|
|
19
|
-
|
|
20
|
-
string
|
|
18
|
+
string id = 1;
|
|
19
|
+
string phone = 2;
|
|
20
|
+
string email = 3;
|
|
21
|
+
bool is_phone_verified = 4;
|
|
22
|
+
bool is_email_verified = 5;
|
|
23
|
+
Role role = 6;
|
|
24
|
+
}
|
|
21
25
|
|
|
22
|
-
|
|
23
|
-
|
|
26
|
+
enum Role {
|
|
27
|
+
USER = 0;
|
|
28
|
+
ADMIN = 1;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
message InitEmailChangeRequest {
|
|
32
|
+
string email = 1;
|
|
33
|
+
string user_id = 2;
|
|
34
|
+
}
|
|
24
35
|
|
|
25
|
-
|
|
26
|
-
|
|
36
|
+
message InitEmailChangeResponse {
|
|
37
|
+
bool ok = 1;
|
|
38
|
+
}
|
|
27
39
|
|
|
28
|
-
|
|
29
|
-
|
|
40
|
+
message ConfirmEmailChangeRequest {
|
|
41
|
+
string email = 1;
|
|
42
|
+
string code = 2;
|
|
43
|
+
string user_id = 3;
|
|
44
|
+
}
|
|
30
45
|
|
|
31
|
-
|
|
32
|
-
bool
|
|
46
|
+
message ConfirmEmailChangeResponse {
|
|
47
|
+
bool ok = 1;
|
|
48
|
+
}
|
|
33
49
|
|
|
34
|
-
|
|
35
|
-
|
|
50
|
+
message InitPhoneChangeRequest {
|
|
51
|
+
string phone = 1;
|
|
52
|
+
string user_id = 2;
|
|
36
53
|
}
|
|
37
54
|
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
USER = 0;
|
|
55
|
+
message InitPhoneChangeResponse {
|
|
56
|
+
bool ok = 1;
|
|
57
|
+
}
|
|
42
58
|
|
|
43
|
-
|
|
44
|
-
|
|
59
|
+
message ConfirmPhoneChangeRequest {
|
|
60
|
+
string phone = 1;
|
|
61
|
+
string code = 2;
|
|
62
|
+
string user_id = 3;
|
|
45
63
|
}
|
|
64
|
+
|
|
65
|
+
message ConfirmPhoneChangeResponse {
|
|
66
|
+
bool ok = 1;
|
|
67
|
+
}
|