@slack-clone-org/contracts 1.0.0 → 1.0.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/generated/auth.ts +20 -1
- package/package.json +1 -1
- package/proto/auth.proto +13 -0
package/generated/auth.ts
CHANGED
|
@@ -19,6 +19,17 @@ export interface SendOtpResponse {
|
|
|
19
19
|
message: boolean;
|
|
20
20
|
}
|
|
21
21
|
|
|
22
|
+
export interface VerifyOtpRequest {
|
|
23
|
+
identifier: string;
|
|
24
|
+
type: string;
|
|
25
|
+
code: string;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export interface VerifyOtpResponse {
|
|
29
|
+
accessToken: string;
|
|
30
|
+
refreshToken: string;
|
|
31
|
+
}
|
|
32
|
+
|
|
22
33
|
export const AUTH_V1_PACKAGE_NAME = "auth.v1";
|
|
23
34
|
|
|
24
35
|
/** AuthService provides authentication-related operations. */
|
|
@@ -27,6 +38,10 @@ export interface AuthServiceClient {
|
|
|
27
38
|
/** SendOtp sends a one-time password to the provided identifier. */
|
|
28
39
|
|
|
29
40
|
sendOtp(request: SendOtpRequest): Observable<SendOtpResponse>;
|
|
41
|
+
|
|
42
|
+
/** VerifyOtp verifies the provided one-time password. */
|
|
43
|
+
|
|
44
|
+
verifyOtp(request: VerifyOtpRequest): Observable<VerifyOtpResponse>;
|
|
30
45
|
}
|
|
31
46
|
|
|
32
47
|
/** AuthService provides authentication-related operations. */
|
|
@@ -35,11 +50,15 @@ export interface AuthServiceController {
|
|
|
35
50
|
/** SendOtp sends a one-time password to the provided identifier. */
|
|
36
51
|
|
|
37
52
|
sendOtp(request: SendOtpRequest): Promise<SendOtpResponse> | Observable<SendOtpResponse> | SendOtpResponse;
|
|
53
|
+
|
|
54
|
+
/** VerifyOtp verifies the provided one-time password. */
|
|
55
|
+
|
|
56
|
+
verifyOtp(request: VerifyOtpRequest): Promise<VerifyOtpResponse> | Observable<VerifyOtpResponse> | VerifyOtpResponse;
|
|
38
57
|
}
|
|
39
58
|
|
|
40
59
|
export function AuthServiceControllerMethods() {
|
|
41
60
|
return function (constructor: Function) {
|
|
42
|
-
const grpcMethods: string[] = ["sendOtp"];
|
|
61
|
+
const grpcMethods: string[] = ["sendOtp", "verifyOtp"];
|
|
43
62
|
for (const method of grpcMethods) {
|
|
44
63
|
const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
|
|
45
64
|
GrpcMethod("AuthService", method)(constructor.prototype[method], method, descriptor);
|
package/package.json
CHANGED
package/proto/auth.proto
CHANGED
|
@@ -6,6 +6,8 @@ package auth.v1;
|
|
|
6
6
|
service AuthService {
|
|
7
7
|
// SendOtp sends a one-time password to the provided identifier.
|
|
8
8
|
rpc SendOtp (SendOtpRequest) returns (SendOtpResponse);
|
|
9
|
+
// VerifyOtp verifies the provided one-time password.
|
|
10
|
+
rpc VerifyOtp (VerifyOtpRequest) returns (VerifyOtpResponse);
|
|
9
11
|
}
|
|
10
12
|
|
|
11
13
|
message SendOtpRequest {
|
|
@@ -15,4 +17,15 @@ message SendOtpRequest {
|
|
|
15
17
|
|
|
16
18
|
message SendOtpResponse {
|
|
17
19
|
bool message = 1;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
message VerifyOtpRequest {
|
|
23
|
+
string identifier = 1;
|
|
24
|
+
string type = 2;
|
|
25
|
+
string code = 3;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
message VerifyOtpResponse {
|
|
29
|
+
string access_token = 1;
|
|
30
|
+
string refresh_token = 2;
|
|
18
31
|
}
|