@gastroly.io/contracts 1.0.3 → 1.0.5
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 +23 -3
- package/package.json +1 -1
- package/proto/auth.proto +18 -2
package/generated/auth.ts
CHANGED
|
@@ -10,9 +10,16 @@ import { Observable } from "rxjs";
|
|
|
10
10
|
|
|
11
11
|
export const protobufPackage = "auth.v1";
|
|
12
12
|
|
|
13
|
+
export enum AuthType {
|
|
14
|
+
AUTH_TYPE_UNSPECIFIED = 0,
|
|
15
|
+
AUTH_TYPE_PHONE = 1,
|
|
16
|
+
AUTH_TYPE_EMAIL = 2,
|
|
17
|
+
UNRECOGNIZED = -1,
|
|
18
|
+
}
|
|
19
|
+
|
|
13
20
|
export interface SendOtpRequest {
|
|
14
21
|
identifier: string;
|
|
15
|
-
type:
|
|
22
|
+
type: AuthType;
|
|
16
23
|
}
|
|
17
24
|
|
|
18
25
|
export interface SendOtpResponse {
|
|
@@ -21,7 +28,7 @@ export interface SendOtpResponse {
|
|
|
21
28
|
|
|
22
29
|
export interface VerifyOtpRequest {
|
|
23
30
|
identifier: string;
|
|
24
|
-
type:
|
|
31
|
+
type: AuthType;
|
|
25
32
|
code: string;
|
|
26
33
|
}
|
|
27
34
|
|
|
@@ -30,23 +37,36 @@ export interface VerifyOtpResponse {
|
|
|
30
37
|
refreshToken: string;
|
|
31
38
|
}
|
|
32
39
|
|
|
40
|
+
export interface RefreshRequest {
|
|
41
|
+
refreshToken: string;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
export interface RefreshResponse {
|
|
45
|
+
accessToken: string;
|
|
46
|
+
refreshToken: string;
|
|
47
|
+
}
|
|
48
|
+
|
|
33
49
|
export const AUTH_V1_PACKAGE_NAME = "auth.v1";
|
|
34
50
|
|
|
35
51
|
export interface AuthServiceClient {
|
|
36
52
|
sendOtp(request: SendOtpRequest): Observable<SendOtpResponse>;
|
|
37
53
|
|
|
38
54
|
verifyOtp(request: VerifyOtpRequest): Observable<VerifyOtpResponse>;
|
|
55
|
+
|
|
56
|
+
refresh(request: RefreshRequest): Observable<RefreshResponse>;
|
|
39
57
|
}
|
|
40
58
|
|
|
41
59
|
export interface AuthServiceController {
|
|
42
60
|
sendOtp(request: SendOtpRequest): Promise<SendOtpResponse> | Observable<SendOtpResponse> | SendOtpResponse;
|
|
43
61
|
|
|
44
62
|
verifyOtp(request: VerifyOtpRequest): Promise<VerifyOtpResponse> | Observable<VerifyOtpResponse> | VerifyOtpResponse;
|
|
63
|
+
|
|
64
|
+
refresh(request: RefreshRequest): Promise<RefreshResponse> | Observable<RefreshResponse> | RefreshResponse;
|
|
45
65
|
}
|
|
46
66
|
|
|
47
67
|
export function AuthServiceControllerMethods() {
|
|
48
68
|
return function (constructor: Function) {
|
|
49
|
-
const grpcMethods: string[] = ["sendOtp", "verifyOtp"];
|
|
69
|
+
const grpcMethods: string[] = ["sendOtp", "verifyOtp", "refresh"];
|
|
50
70
|
for (const method of grpcMethods) {
|
|
51
71
|
const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
|
|
52
72
|
GrpcMethod("AuthService", method)(constructor.prototype[method], method, descriptor);
|
package/package.json
CHANGED
package/proto/auth.proto
CHANGED
|
@@ -2,14 +2,21 @@ syntax = "proto3";
|
|
|
2
2
|
|
|
3
3
|
package auth.v1;
|
|
4
4
|
|
|
5
|
+
enum AuthType {
|
|
6
|
+
AUTH_TYPE_UNSPECIFIED = 0;
|
|
7
|
+
AUTH_TYPE_PHONE = 1;
|
|
8
|
+
AUTH_TYPE_EMAIL = 2;
|
|
9
|
+
}
|
|
10
|
+
|
|
5
11
|
service AuthService {
|
|
6
12
|
rpc SendOtp(SendOtpRequest) returns (SendOtpResponse);
|
|
7
13
|
rpc VerifyOtp (VerifyOtpRequest) returns (VerifyOtpResponse);
|
|
14
|
+
rpc Refresh (RefreshRequest) returns (RefreshResponse);
|
|
8
15
|
}
|
|
9
16
|
|
|
10
17
|
message SendOtpRequest {
|
|
11
18
|
string identifier = 1;
|
|
12
|
-
|
|
19
|
+
AuthType type = 2;
|
|
13
20
|
}
|
|
14
21
|
|
|
15
22
|
message SendOtpResponse {
|
|
@@ -18,11 +25,20 @@ message SendOtpResponse {
|
|
|
18
25
|
|
|
19
26
|
message VerifyOtpRequest {
|
|
20
27
|
string identifier = 1;
|
|
21
|
-
|
|
28
|
+
AuthType type = 2;
|
|
22
29
|
string code = 3;
|
|
23
30
|
}
|
|
24
31
|
|
|
25
32
|
message VerifyOtpResponse {
|
|
26
33
|
string access_token = 1;
|
|
27
34
|
string refresh_token = 2;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
message RefreshRequest {
|
|
38
|
+
string refresh_token = 1;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
message RefreshResponse {
|
|
42
|
+
string access_token = 1;
|
|
43
|
+
string refresh_token = 2;
|
|
28
44
|
}
|