@barumetric/contracts 1.2.10 → 1.2.12
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/ts/auth.ts +23 -19
- package/gen/ts/session.ts +13 -10
- package/package.json +1 -1
- package/proto/auth.proto +25 -20
- package/proto/session.proto +8 -4
package/gen/ts/auth.ts
CHANGED
|
@@ -27,25 +27,6 @@ export interface VerifyOtpRequest {
|
|
|
27
27
|
sessionMetadata: SessionMetadata | undefined;
|
|
28
28
|
}
|
|
29
29
|
|
|
30
|
-
export interface SessionMetadata {
|
|
31
|
-
location: LocationInfo | undefined;
|
|
32
|
-
device: DeviceInfo | undefined;
|
|
33
|
-
ip: string;
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
export interface LocationInfo {
|
|
37
|
-
country: string;
|
|
38
|
-
city: string;
|
|
39
|
-
latidute: number;
|
|
40
|
-
longitude: number;
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
export interface DeviceInfo {
|
|
44
|
-
browser: string;
|
|
45
|
-
os: string;
|
|
46
|
-
type: string;
|
|
47
|
-
}
|
|
48
|
-
|
|
49
30
|
export interface VerifyOtpResponse {
|
|
50
31
|
accessToken: string;
|
|
51
32
|
refreshToken: string;
|
|
@@ -76,6 +57,7 @@ export interface TelegramInitResponse {
|
|
|
76
57
|
|
|
77
58
|
export interface TelegramVerifyRequest {
|
|
78
59
|
query: { [key: string]: string };
|
|
60
|
+
metadata: SessionMetadata | undefined;
|
|
79
61
|
}
|
|
80
62
|
|
|
81
63
|
export interface TelegramVerifyRequest_QueryEntry {
|
|
@@ -87,6 +69,7 @@ export interface TelegramVerifyResponse {
|
|
|
87
69
|
url?: string | undefined;
|
|
88
70
|
accessToken?: string | undefined;
|
|
89
71
|
refreshToken?: string | undefined;
|
|
72
|
+
sessionToken?: string | undefined;
|
|
90
73
|
}
|
|
91
74
|
|
|
92
75
|
export interface TelegramCompleteRequest {
|
|
@@ -100,11 +83,32 @@ export interface TelegramCompleteResponse {
|
|
|
100
83
|
|
|
101
84
|
export interface TelegramConsumeRequest {
|
|
102
85
|
sessionId: string;
|
|
86
|
+
metadata: SessionMetadata | undefined;
|
|
103
87
|
}
|
|
104
88
|
|
|
105
89
|
export interface TelegramConsumeResponse {
|
|
106
90
|
accessToken: string;
|
|
107
91
|
refreshToken: string;
|
|
92
|
+
sessionToken: string;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
export interface SessionMetadata {
|
|
96
|
+
location: LocationInfo | undefined;
|
|
97
|
+
device: DeviceInfo | undefined;
|
|
98
|
+
ip: string;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
export interface LocationInfo {
|
|
102
|
+
country: string;
|
|
103
|
+
city: string;
|
|
104
|
+
latidute: number;
|
|
105
|
+
longitude: number;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
export interface DeviceInfo {
|
|
109
|
+
browser: string;
|
|
110
|
+
os: string;
|
|
111
|
+
type: string;
|
|
108
112
|
}
|
|
109
113
|
|
|
110
114
|
export const AUTH_V1_PACKAGE_NAME = "auth.v1";
|
package/gen/ts/session.ts
CHANGED
|
@@ -13,6 +13,7 @@ export const protobufPackage = "session.v1";
|
|
|
13
13
|
|
|
14
14
|
export interface ListSessionsRequest {
|
|
15
15
|
userId: string;
|
|
16
|
+
sessionToken: string;
|
|
16
17
|
}
|
|
17
18
|
|
|
18
19
|
export interface ListSessionsResponse {
|
|
@@ -22,16 +23,17 @@ export interface ListSessionsResponse {
|
|
|
22
23
|
export interface GetSessionRequest {
|
|
23
24
|
id?: string | undefined;
|
|
24
25
|
userId: string;
|
|
25
|
-
|
|
26
|
+
sessionToken?: string | undefined;
|
|
26
27
|
}
|
|
27
28
|
|
|
28
|
-
export interface
|
|
29
|
-
|
|
29
|
+
export interface GetSessionResponse {
|
|
30
|
+
session: Session | undefined;
|
|
30
31
|
}
|
|
31
32
|
|
|
32
33
|
export interface RevokeSessionRequest {
|
|
33
34
|
id: string;
|
|
34
35
|
userId: string;
|
|
36
|
+
sessionToken?: string | undefined;
|
|
35
37
|
}
|
|
36
38
|
|
|
37
39
|
export interface RevokeSessionResponse {
|
|
@@ -40,6 +42,7 @@ export interface RevokeSessionResponse {
|
|
|
40
42
|
|
|
41
43
|
export interface RevokeAllOtherSessionsRequest {
|
|
42
44
|
userId: string;
|
|
45
|
+
sessionToken?: string | undefined;
|
|
43
46
|
}
|
|
44
47
|
|
|
45
48
|
export interface RevokeAllOtherSessionsResponse {
|
|
@@ -61,11 +64,11 @@ export const SESSION_V1_PACKAGE_NAME = "session.v1";
|
|
|
61
64
|
export interface SessionServiceClient {
|
|
62
65
|
listSessions(request: ListSessionsRequest): Observable<ListSessionsResponse>;
|
|
63
66
|
|
|
64
|
-
getSession(request: GetSessionRequest): Observable<GetSessionsResponse>;
|
|
65
|
-
|
|
66
67
|
revokeSession(request: RevokeSessionRequest): Observable<RevokeSessionResponse>;
|
|
67
68
|
|
|
68
69
|
revokeAllOtherSessions(request: RevokeAllOtherSessionsRequest): Observable<RevokeAllOtherSessionsResponse>;
|
|
70
|
+
|
|
71
|
+
getSession(request: GetSessionRequest): Observable<GetSessionResponse>;
|
|
69
72
|
}
|
|
70
73
|
|
|
71
74
|
export interface SessionServiceController {
|
|
@@ -73,10 +76,6 @@ export interface SessionServiceController {
|
|
|
73
76
|
request: ListSessionsRequest,
|
|
74
77
|
): Promise<ListSessionsResponse> | Observable<ListSessionsResponse> | ListSessionsResponse;
|
|
75
78
|
|
|
76
|
-
getSession(
|
|
77
|
-
request: GetSessionRequest,
|
|
78
|
-
): Promise<GetSessionsResponse> | Observable<GetSessionsResponse> | GetSessionsResponse;
|
|
79
|
-
|
|
80
79
|
revokeSession(
|
|
81
80
|
request: RevokeSessionRequest,
|
|
82
81
|
): Promise<RevokeSessionResponse> | Observable<RevokeSessionResponse> | RevokeSessionResponse;
|
|
@@ -87,11 +86,15 @@ export interface SessionServiceController {
|
|
|
87
86
|
| Promise<RevokeAllOtherSessionsResponse>
|
|
88
87
|
| Observable<RevokeAllOtherSessionsResponse>
|
|
89
88
|
| RevokeAllOtherSessionsResponse;
|
|
89
|
+
|
|
90
|
+
getSession(
|
|
91
|
+
request: GetSessionRequest,
|
|
92
|
+
): Promise<GetSessionResponse> | Observable<GetSessionResponse> | GetSessionResponse;
|
|
90
93
|
}
|
|
91
94
|
|
|
92
95
|
export function SessionServiceControllerMethods() {
|
|
93
96
|
return function (constructor: Function) {
|
|
94
|
-
const grpcMethods: string[] = ["listSessions", "
|
|
97
|
+
const grpcMethods: string[] = ["listSessions", "revokeSession", "revokeAllOtherSessions", "getSession"];
|
|
95
98
|
for (const method of grpcMethods) {
|
|
96
99
|
const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
|
|
97
100
|
GrpcMethod("SessionService", method)(constructor.prototype[method], method, descriptor);
|
package/package.json
CHANGED
package/proto/auth.proto
CHANGED
|
@@ -32,25 +32,6 @@ message VerifyOtpRequest {
|
|
|
32
32
|
SessionMetadata session_metadata = 4;
|
|
33
33
|
}
|
|
34
34
|
|
|
35
|
-
message SessionMetadata {
|
|
36
|
-
LocationInfo location = 1;
|
|
37
|
-
DeviceInfo device = 2;
|
|
38
|
-
string ip = 3;
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
message LocationInfo {
|
|
42
|
-
string country = 1;
|
|
43
|
-
string city = 2;
|
|
44
|
-
int32 latidute = 3;
|
|
45
|
-
int32 longitude = 4;
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
message DeviceInfo {
|
|
49
|
-
string browser = 1;
|
|
50
|
-
string os = 2;
|
|
51
|
-
string type = 3;
|
|
52
|
-
}
|
|
53
|
-
|
|
54
35
|
message VerifyOtpResponse {
|
|
55
36
|
string access_token = 1;
|
|
56
37
|
string refresh_token = 2;
|
|
@@ -81,6 +62,7 @@ message TelegramInitResponse {
|
|
|
81
62
|
|
|
82
63
|
message TelegramVerifyRequest {
|
|
83
64
|
map<string, string> query = 1;
|
|
65
|
+
SessionMetadata metadata = 2;
|
|
84
66
|
}
|
|
85
67
|
|
|
86
68
|
message TelegramVerifyResponse {
|
|
@@ -88,7 +70,9 @@ message TelegramVerifyResponse {
|
|
|
88
70
|
string url = 1;
|
|
89
71
|
string access_token = 2;
|
|
90
72
|
string refresh_token = 3;
|
|
73
|
+
string session_token = 4;
|
|
91
74
|
}
|
|
75
|
+
|
|
92
76
|
}
|
|
93
77
|
|
|
94
78
|
message TelegramCompleteRequest {
|
|
@@ -102,9 +86,30 @@ message TelegramCompleteResponse {
|
|
|
102
86
|
|
|
103
87
|
message TelegramConsumeRequest {
|
|
104
88
|
string session_id = 1;
|
|
89
|
+
SessionMetadata metadata = 2;
|
|
105
90
|
}
|
|
106
91
|
|
|
107
92
|
message TelegramConsumeResponse {
|
|
108
93
|
string access_token = 1;
|
|
109
94
|
string refresh_token = 2;
|
|
110
|
-
|
|
95
|
+
string session_token = 3;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
message SessionMetadata {
|
|
99
|
+
LocationInfo location = 1;
|
|
100
|
+
DeviceInfo device = 2;
|
|
101
|
+
string ip = 3;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
message LocationInfo {
|
|
105
|
+
string country = 1;
|
|
106
|
+
string city = 2;
|
|
107
|
+
int32 latidute = 3;
|
|
108
|
+
int32 longitude = 4;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
message DeviceInfo {
|
|
112
|
+
string browser = 1;
|
|
113
|
+
string os = 2;
|
|
114
|
+
string type = 3;
|
|
115
|
+
}
|
package/proto/session.proto
CHANGED
|
@@ -6,13 +6,15 @@ import "google/protobuf/timestamp.proto";
|
|
|
6
6
|
|
|
7
7
|
service SessionService {
|
|
8
8
|
rpc ListSessions (ListSessionsRequest) returns (ListSessionsResponse);
|
|
9
|
-
rpc GetSession (GetSessionRequest) returns (GetSessionsResponse);
|
|
10
9
|
rpc RevokeSession (RevokeSessionRequest) returns (RevokeSessionResponse);
|
|
11
10
|
rpc RevokeAllOtherSessions (RevokeAllOtherSessionsRequest) returns (RevokeAllOtherSessionsResponse);
|
|
11
|
+
|
|
12
|
+
rpc GetSession (GetSessionRequest) returns (GetSessionResponse);
|
|
12
13
|
}
|
|
13
14
|
|
|
14
15
|
message ListSessionsRequest {
|
|
15
16
|
string user_id = 1;
|
|
17
|
+
string session_token = 2;
|
|
16
18
|
}
|
|
17
19
|
|
|
18
20
|
message ListSessionsResponse {
|
|
@@ -22,16 +24,17 @@ message ListSessionsResponse {
|
|
|
22
24
|
message GetSessionRequest {
|
|
23
25
|
optional string id = 1;
|
|
24
26
|
string user_id = 2;
|
|
25
|
-
|
|
27
|
+
optional string session_token = 3;
|
|
26
28
|
}
|
|
27
29
|
|
|
28
|
-
message
|
|
29
|
-
Session
|
|
30
|
+
message GetSessionResponse {
|
|
31
|
+
Session session = 1;
|
|
30
32
|
}
|
|
31
33
|
|
|
32
34
|
message RevokeSessionRequest {
|
|
33
35
|
string id = 1;
|
|
34
36
|
string user_id = 2;
|
|
37
|
+
optional string session_token = 3;
|
|
35
38
|
}
|
|
36
39
|
|
|
37
40
|
message RevokeSessionResponse {
|
|
@@ -40,6 +43,7 @@ message RevokeSessionResponse {
|
|
|
40
43
|
|
|
41
44
|
message RevokeAllOtherSessionsRequest {
|
|
42
45
|
string user_id = 1;
|
|
46
|
+
optional string session_token = 2;
|
|
43
47
|
}
|
|
44
48
|
|
|
45
49
|
message RevokeAllOtherSessionsResponse {
|