@dkcinema/contracts 1.0.5 → 1.0.6
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/output/auth.ts +22 -1
- package/package.json +3 -1
- package/protos/auth.proto +10 -0
package/output/auth.ts
CHANGED
|
@@ -10,6 +10,15 @@ import { Observable } from "rxjs";
|
|
|
10
10
|
|
|
11
11
|
export const protobufPackage = "auth.v1";
|
|
12
12
|
|
|
13
|
+
export interface VerifyOtpRequest {
|
|
14
|
+
code: string;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export interface VerifyOtpResponse {
|
|
18
|
+
accessToken: string;
|
|
19
|
+
refreshToken: string;
|
|
20
|
+
}
|
|
21
|
+
|
|
13
22
|
export interface SendEmailOtpRequest {
|
|
14
23
|
email: string;
|
|
15
24
|
}
|
|
@@ -28,17 +37,29 @@ export interface AuthServiceClient {
|
|
|
28
37
|
sandEmailOtp(request: SendEmailOtpRequest): Observable<SendOtpResponse>;
|
|
29
38
|
|
|
30
39
|
sandPhoneOtp(request: SendPhoneOtpRequest): Observable<SendOtpResponse>;
|
|
40
|
+
|
|
41
|
+
verifyEmailOtp(request: VerifyOtpRequest): Observable<VerifyOtpResponse>;
|
|
42
|
+
|
|
43
|
+
verifyPhoneOtp(request: VerifyOtpRequest): Observable<VerifyOtpResponse>;
|
|
31
44
|
}
|
|
32
45
|
|
|
33
46
|
export interface AuthServiceController {
|
|
34
47
|
sandEmailOtp(request: SendEmailOtpRequest): Promise<SendOtpResponse> | Observable<SendOtpResponse> | SendOtpResponse;
|
|
35
48
|
|
|
36
49
|
sandPhoneOtp(request: SendPhoneOtpRequest): Promise<SendOtpResponse> | Observable<SendOtpResponse> | SendOtpResponse;
|
|
50
|
+
|
|
51
|
+
verifyEmailOtp(
|
|
52
|
+
request: VerifyOtpRequest,
|
|
53
|
+
): Promise<VerifyOtpResponse> | Observable<VerifyOtpResponse> | VerifyOtpResponse;
|
|
54
|
+
|
|
55
|
+
verifyPhoneOtp(
|
|
56
|
+
request: VerifyOtpRequest,
|
|
57
|
+
): Promise<VerifyOtpResponse> | Observable<VerifyOtpResponse> | VerifyOtpResponse;
|
|
37
58
|
}
|
|
38
59
|
|
|
39
60
|
export function AuthServiceControllerMethods() {
|
|
40
61
|
return function (constructor: Function) {
|
|
41
|
-
const grpcMethods: string[] = ["sandEmailOtp", "sandPhoneOtp"];
|
|
62
|
+
const grpcMethods: string[] = ["sandEmailOtp", "sandPhoneOtp", "verifyEmailOtp", "verifyPhoneOtp"];
|
|
42
63
|
for (const method of grpcMethods) {
|
|
43
64
|
const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
|
|
44
65
|
GrpcMethod("AuthService", method)(constructor.prototype[method], method, descriptor);
|
package/package.json
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dkcinema/contracts",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.6",
|
|
4
|
+
"type": "module",
|
|
4
5
|
"scripts": {
|
|
6
|
+
"build": "tsc --build",
|
|
5
7
|
"proto:generate": "mkdir -p ./output && protoc -I ./protos ./protos/*.proto --ts_proto_opt=nestJs=true --ts_proto_out=./output"
|
|
6
8
|
},
|
|
7
9
|
"files": [
|
package/protos/auth.proto
CHANGED
|
@@ -6,9 +6,19 @@ service AuthService {
|
|
|
6
6
|
rpc SandEmailOtp (SendEmailOtpRequest) returns (SendOtpResponse);
|
|
7
7
|
rpc SandPhoneOtp (SendPhoneOtpRequest) returns (SendOtpResponse);
|
|
8
8
|
|
|
9
|
+
rpc VerifyEmailOtp(VerifyOtpRequest) returns (VerifyOtpResponse);
|
|
10
|
+
rpc VerifyPhoneOtp(VerifyOtpRequest) returns (VerifyOtpResponse);
|
|
11
|
+
|
|
9
12
|
}
|
|
10
13
|
|
|
14
|
+
message VerifyOtpRequest {
|
|
15
|
+
string code = 1;
|
|
16
|
+
}
|
|
11
17
|
|
|
18
|
+
message VerifyOtpResponse {
|
|
19
|
+
string access_token = 1;
|
|
20
|
+
string refresh_token = 2;
|
|
21
|
+
}
|
|
12
22
|
|
|
13
23
|
message SendEmailOtpRequest {
|
|
14
24
|
string email = 1;
|