@yrysmatby/contracts 1.0.0 → 1.0.2
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/auth.ts +17 -2
- package/package.json +8 -2
- package/proto/auth.proto +13 -0
package/gen/auth.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
|
|
2
2
|
// versions:
|
|
3
|
-
// protoc-gen-ts_proto v2.11.
|
|
3
|
+
// protoc-gen-ts_proto v2.11.1
|
|
4
4
|
// protoc v3.21.12
|
|
5
5
|
// source: auth.proto
|
|
6
6
|
|
|
@@ -35,19 +35,34 @@ export interface UserProfile {
|
|
|
35
35
|
status: Status;
|
|
36
36
|
}
|
|
37
37
|
|
|
38
|
+
export interface VerifyOtpRequest {
|
|
39
|
+
identifier: string;
|
|
40
|
+
type: string;
|
|
41
|
+
code: string;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
export interface VerifyOtpResponse {
|
|
45
|
+
accessToken: string;
|
|
46
|
+
refreshToken: string;
|
|
47
|
+
}
|
|
48
|
+
|
|
38
49
|
export const AUTH_V1_PACKAGE_NAME = "auth.v1";
|
|
39
50
|
|
|
40
51
|
export interface AuthServiceClient {
|
|
41
52
|
sendOtp(request: SendOtpRequest): Observable<SendOtpResponse>;
|
|
53
|
+
|
|
54
|
+
verifyOtp(request: VerifyOtpRequest): Observable<VerifyOtpResponse>;
|
|
42
55
|
}
|
|
43
56
|
|
|
44
57
|
export interface AuthServiceController {
|
|
45
58
|
sendOtp(request: SendOtpRequest): Promise<SendOtpResponse> | Observable<SendOtpResponse> | SendOtpResponse;
|
|
59
|
+
|
|
60
|
+
verifyOtp(request: VerifyOtpRequest): Promise<VerifyOtpResponse> | Observable<VerifyOtpResponse> | VerifyOtpResponse;
|
|
46
61
|
}
|
|
47
62
|
|
|
48
63
|
export function AuthServiceControllerMethods() {
|
|
49
64
|
return function (constructor: Function) {
|
|
50
|
-
const grpcMethods: string[] = ["sendOtp"];
|
|
65
|
+
const grpcMethods: string[] = ["sendOtp", "verifyOtp"];
|
|
51
66
|
for (const method of grpcMethods) {
|
|
52
67
|
const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
|
|
53
68
|
GrpcMethod("AuthService", method)(constructor.prototype[method], method, descriptor);
|
package/package.json
CHANGED
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@yrysmatby/contracts",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.2",
|
|
4
4
|
"description": "Protobuf with ts types",
|
|
5
|
+
"main":"./dist/index.js",
|
|
6
|
+
"types":"./dist/index.d.ts",
|
|
5
7
|
"scripts": {
|
|
8
|
+
"build":"tsc -p tsconfig.build.json",
|
|
6
9
|
"generate": "protoc -I ./proto ./proto/*.proto --ts_proto_out=./gen --ts_proto_opt=nestJs=true,package=omit"
|
|
7
10
|
},
|
|
8
11
|
"files": [
|
|
@@ -12,9 +15,12 @@
|
|
|
12
15
|
"publishConfig": {
|
|
13
16
|
"access": "public"
|
|
14
17
|
},
|
|
18
|
+
|
|
15
19
|
"dependencies": {
|
|
16
20
|
"@nestjs/microservices": "^11.1.12",
|
|
21
|
+
"@types/node": "^25.0.10",
|
|
17
22
|
"rxjs": "^7.8.2",
|
|
18
|
-
"ts-proto": "^2.11.0"
|
|
23
|
+
"ts-proto": "^2.11.0",
|
|
24
|
+
"typescript": "^5.9.3"
|
|
19
25
|
}
|
|
20
26
|
}
|
package/proto/auth.proto
CHANGED
|
@@ -5,6 +5,8 @@ package auth.v1;
|
|
|
5
5
|
|
|
6
6
|
service AuthService{
|
|
7
7
|
rpc SendOtp (SendOtpRequest) returns (SendOtpResponse);
|
|
8
|
+
rpc VerifyOtp (VerifyOtpRequest) returns (VerifyOtpResponse);
|
|
9
|
+
|
|
8
10
|
}
|
|
9
11
|
|
|
10
12
|
|
|
@@ -28,4 +30,15 @@ enum Status {
|
|
|
28
30
|
STATUS_UNKNOWN = 0;
|
|
29
31
|
STATUS_ACTIVE = 1;
|
|
30
32
|
STATUS_BANNED = 2;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
message VerifyOtpRequest {
|
|
36
|
+
string identifier = 1;
|
|
37
|
+
string type = 2;
|
|
38
|
+
string code = 3;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
message VerifyOtpResponse {
|
|
42
|
+
string access_token = 1;
|
|
43
|
+
string refresh_token = 2;
|
|
31
44
|
}
|