@dkcinema/contracts 1.0.5 → 1.0.7
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 +28 -1
- package/package.json +3 -1
- package/protos/auth.proto +16 -0
package/output/auth.ts
CHANGED
|
@@ -10,6 +10,21 @@ import { Observable } from "rxjs";
|
|
|
10
10
|
|
|
11
11
|
export const protobufPackage = "auth.v1";
|
|
12
12
|
|
|
13
|
+
export interface VerifyEmailOtpRequest {
|
|
14
|
+
code: string;
|
|
15
|
+
email: string;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export interface VerifyPhoneOtpRequest {
|
|
19
|
+
code: string;
|
|
20
|
+
phone: string;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export interface VerifyOtpResponse {
|
|
24
|
+
accessToken: string;
|
|
25
|
+
refreshToken: string;
|
|
26
|
+
}
|
|
27
|
+
|
|
13
28
|
export interface SendEmailOtpRequest {
|
|
14
29
|
email: string;
|
|
15
30
|
}
|
|
@@ -28,17 +43,29 @@ export interface AuthServiceClient {
|
|
|
28
43
|
sandEmailOtp(request: SendEmailOtpRequest): Observable<SendOtpResponse>;
|
|
29
44
|
|
|
30
45
|
sandPhoneOtp(request: SendPhoneOtpRequest): Observable<SendOtpResponse>;
|
|
46
|
+
|
|
47
|
+
verifyEmailOtp(request: VerifyEmailOtpRequest): Observable<VerifyOtpResponse>;
|
|
48
|
+
|
|
49
|
+
verifyPhoneOtp(request: VerifyPhoneOtpRequest): Observable<VerifyOtpResponse>;
|
|
31
50
|
}
|
|
32
51
|
|
|
33
52
|
export interface AuthServiceController {
|
|
34
53
|
sandEmailOtp(request: SendEmailOtpRequest): Promise<SendOtpResponse> | Observable<SendOtpResponse> | SendOtpResponse;
|
|
35
54
|
|
|
36
55
|
sandPhoneOtp(request: SendPhoneOtpRequest): Promise<SendOtpResponse> | Observable<SendOtpResponse> | SendOtpResponse;
|
|
56
|
+
|
|
57
|
+
verifyEmailOtp(
|
|
58
|
+
request: VerifyEmailOtpRequest,
|
|
59
|
+
): Promise<VerifyOtpResponse> | Observable<VerifyOtpResponse> | VerifyOtpResponse;
|
|
60
|
+
|
|
61
|
+
verifyPhoneOtp(
|
|
62
|
+
request: VerifyPhoneOtpRequest,
|
|
63
|
+
): Promise<VerifyOtpResponse> | Observable<VerifyOtpResponse> | VerifyOtpResponse;
|
|
37
64
|
}
|
|
38
65
|
|
|
39
66
|
export function AuthServiceControllerMethods() {
|
|
40
67
|
return function (constructor: Function) {
|
|
41
|
-
const grpcMethods: string[] = ["sandEmailOtp", "sandPhoneOtp"];
|
|
68
|
+
const grpcMethods: string[] = ["sandEmailOtp", "sandPhoneOtp", "verifyEmailOtp", "verifyPhoneOtp"];
|
|
42
69
|
for (const method of grpcMethods) {
|
|
43
70
|
const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
|
|
44
71
|
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.7",
|
|
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,25 @@ service AuthService {
|
|
|
6
6
|
rpc SandEmailOtp (SendEmailOtpRequest) returns (SendOtpResponse);
|
|
7
7
|
rpc SandPhoneOtp (SendPhoneOtpRequest) returns (SendOtpResponse);
|
|
8
8
|
|
|
9
|
+
rpc VerifyEmailOtp(VerifyEmailOtpRequest) returns (VerifyOtpResponse);
|
|
10
|
+
rpc VerifyPhoneOtp(VerifyPhoneOtpRequest) returns (VerifyOtpResponse);
|
|
11
|
+
|
|
9
12
|
}
|
|
10
13
|
|
|
14
|
+
message VerifyEmailOtpRequest {
|
|
15
|
+
string code = 1;
|
|
16
|
+
string email = 2;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
message VerifyPhoneOtpRequest {
|
|
20
|
+
string code = 1;
|
|
21
|
+
string phone = 2;
|
|
22
|
+
}
|
|
11
23
|
|
|
24
|
+
message VerifyOtpResponse {
|
|
25
|
+
string access_token = 1;
|
|
26
|
+
string refresh_token = 2;
|
|
27
|
+
}
|
|
12
28
|
|
|
13
29
|
message SendEmailOtpRequest {
|
|
14
30
|
string email = 1;
|