@slack-clone-org/contracts 1.0.15 → 1.0.17
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/generated/account.ts +46 -1
- package/generated/auth.ts +8 -2
- package/package.json +1 -1
- package/proto/account.proto +23 -0
- package/proto/auth.proto +7 -2
package/generated/account.ts
CHANGED
|
@@ -48,6 +48,25 @@ export interface ConfirmEmailChangeResponse {
|
|
|
48
48
|
success: boolean;
|
|
49
49
|
}
|
|
50
50
|
|
|
51
|
+
export interface InitPhoneChangeRequest {
|
|
52
|
+
accountId: string;
|
|
53
|
+
newPhoneNumber: string;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
export interface InitPhoneChangeResponse {
|
|
57
|
+
success: boolean;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
export interface ConfirmPhoneChangeRequest {
|
|
61
|
+
phoneNumber: string;
|
|
62
|
+
confirmationCode: string;
|
|
63
|
+
accountId: string;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
export interface ConfirmPhoneChangeResponse {
|
|
67
|
+
success: boolean;
|
|
68
|
+
}
|
|
69
|
+
|
|
51
70
|
export const ACCOUNT_V1_PACKAGE_NAME = "account.v1";
|
|
52
71
|
|
|
53
72
|
/** AccountService provides account-related operations. */
|
|
@@ -64,6 +83,14 @@ export interface AccountServiceClient {
|
|
|
64
83
|
/** Methods for confirming email changes. */
|
|
65
84
|
|
|
66
85
|
confirmEmailChange(request: ConfirmEmailChangeRequest): Observable<ConfirmEmailChangeResponse>;
|
|
86
|
+
|
|
87
|
+
/** Methods for initiating phone changes. */
|
|
88
|
+
|
|
89
|
+
initPhoneChange(request: InitPhoneChangeRequest): Observable<InitPhoneChangeResponse>;
|
|
90
|
+
|
|
91
|
+
/** Methods for confirming phone changes. */
|
|
92
|
+
|
|
93
|
+
confirmPhoneChange(request: ConfirmPhoneChangeRequest): Observable<ConfirmPhoneChangeResponse>;
|
|
67
94
|
}
|
|
68
95
|
|
|
69
96
|
/** AccountService provides account-related operations. */
|
|
@@ -86,11 +113,29 @@ export interface AccountServiceController {
|
|
|
86
113
|
confirmEmailChange(
|
|
87
114
|
request: ConfirmEmailChangeRequest,
|
|
88
115
|
): Promise<ConfirmEmailChangeResponse> | Observable<ConfirmEmailChangeResponse> | ConfirmEmailChangeResponse;
|
|
116
|
+
|
|
117
|
+
/** Methods for initiating phone changes. */
|
|
118
|
+
|
|
119
|
+
initPhoneChange(
|
|
120
|
+
request: InitPhoneChangeRequest,
|
|
121
|
+
): Promise<InitPhoneChangeResponse> | Observable<InitPhoneChangeResponse> | InitPhoneChangeResponse;
|
|
122
|
+
|
|
123
|
+
/** Methods for confirming phone changes. */
|
|
124
|
+
|
|
125
|
+
confirmPhoneChange(
|
|
126
|
+
request: ConfirmPhoneChangeRequest,
|
|
127
|
+
): Promise<ConfirmPhoneChangeResponse> | Observable<ConfirmPhoneChangeResponse> | ConfirmPhoneChangeResponse;
|
|
89
128
|
}
|
|
90
129
|
|
|
91
130
|
export function AccountServiceControllerMethods() {
|
|
92
131
|
return function (constructor: Function) {
|
|
93
|
-
const grpcMethods: string[] = [
|
|
132
|
+
const grpcMethods: string[] = [
|
|
133
|
+
"getAccount",
|
|
134
|
+
"initEmailChange",
|
|
135
|
+
"confirmEmailChange",
|
|
136
|
+
"initPhoneChange",
|
|
137
|
+
"confirmPhoneChange",
|
|
138
|
+
];
|
|
94
139
|
for (const method of grpcMethods) {
|
|
95
140
|
const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
|
|
96
141
|
GrpcMethod("AccountService", method)(constructor.prototype[method], method, descriptor);
|
package/generated/auth.ts
CHANGED
|
@@ -10,8 +10,14 @@ import { Observable } from "rxjs";
|
|
|
10
10
|
|
|
11
11
|
export const protobufPackage = "auth.v1";
|
|
12
12
|
|
|
13
|
+
export enum IdentifierType {
|
|
14
|
+
EMAIL = 0,
|
|
15
|
+
PHONE = 1,
|
|
16
|
+
UNRECOGNIZED = -1,
|
|
17
|
+
}
|
|
18
|
+
|
|
13
19
|
export interface SendOtpRequest {
|
|
14
|
-
identifier:
|
|
20
|
+
identifier: IdentifierType;
|
|
15
21
|
type: string;
|
|
16
22
|
}
|
|
17
23
|
|
|
@@ -20,7 +26,7 @@ export interface SendOtpResponse {
|
|
|
20
26
|
}
|
|
21
27
|
|
|
22
28
|
export interface VerifyOtpRequest {
|
|
23
|
-
identifier:
|
|
29
|
+
identifier: IdentifierType;
|
|
24
30
|
type: string;
|
|
25
31
|
code: string;
|
|
26
32
|
}
|
package/package.json
CHANGED
package/proto/account.proto
CHANGED
|
@@ -11,6 +11,10 @@ service AccountService {
|
|
|
11
11
|
rpc InitEmailChange (InitEmailChangeRequest) returns (InitEmailChangeResponse);
|
|
12
12
|
// Methods for confirming email changes.
|
|
13
13
|
rpc ConfirmEmailChange (ConfirmEmailChangeRequest) returns (ConfirmEmailChangeResponse);
|
|
14
|
+
// Methods for initiating phone changes.
|
|
15
|
+
rpc InitPhoneChange (InitPhoneChangeRequest) returns (InitPhoneChangeResponse);
|
|
16
|
+
// Methods for confirming phone changes.
|
|
17
|
+
rpc ConfirmPhoneChange (ConfirmPhoneChangeRequest) returns (ConfirmPhoneChangeResponse);
|
|
14
18
|
}
|
|
15
19
|
|
|
16
20
|
message GetAccountRequest {
|
|
@@ -45,6 +49,25 @@ message ConfirmEmailChangeResponse {
|
|
|
45
49
|
bool success = 1;
|
|
46
50
|
}
|
|
47
51
|
|
|
52
|
+
message InitPhoneChangeRequest {
|
|
53
|
+
string account_id = 1;
|
|
54
|
+
string new_phone_number = 2;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
message InitPhoneChangeResponse {
|
|
58
|
+
bool success = 1;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
message ConfirmPhoneChangeRequest {
|
|
62
|
+
string phone_number = 1;
|
|
63
|
+
string confirmation_code = 2;
|
|
64
|
+
string account_id = 3;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
message ConfirmPhoneChangeResponse {
|
|
68
|
+
bool success = 1;
|
|
69
|
+
}
|
|
70
|
+
|
|
48
71
|
enum GlobalRole {
|
|
49
72
|
USER = 0;
|
|
50
73
|
ADMIN = 1;
|
package/proto/auth.proto
CHANGED
|
@@ -13,7 +13,7 @@ service AuthService {
|
|
|
13
13
|
}
|
|
14
14
|
|
|
15
15
|
message SendOtpRequest {
|
|
16
|
-
|
|
16
|
+
IdentifierType identifier = 1;
|
|
17
17
|
string type = 2;
|
|
18
18
|
}
|
|
19
19
|
|
|
@@ -22,7 +22,7 @@ message SendOtpResponse {
|
|
|
22
22
|
}
|
|
23
23
|
|
|
24
24
|
message VerifyOtpRequest {
|
|
25
|
-
|
|
25
|
+
IdentifierType identifier = 1;
|
|
26
26
|
string type = 2;
|
|
27
27
|
string code = 3;
|
|
28
28
|
}
|
|
@@ -40,3 +40,8 @@ message RefreshResponse {
|
|
|
40
40
|
string access_token = 1;
|
|
41
41
|
string refresh_token = 2;
|
|
42
42
|
}
|
|
43
|
+
|
|
44
|
+
enum IdentifierType {
|
|
45
|
+
EMAIL = 0;
|
|
46
|
+
PHONE = 1;
|
|
47
|
+
}
|