@barumetric/contracts 1.2.9 → 1.2.11
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/session.ts +29 -15
- package/package.json +1 -1
- package/proto/session.proto +20 -7
package/gen/ts/session.ts
CHANGED
|
@@ -7,32 +7,44 @@
|
|
|
7
7
|
/* eslint-disable */
|
|
8
8
|
import { GrpcMethod, GrpcStreamMethod } from "@nestjs/microservices";
|
|
9
9
|
import { Observable } from "rxjs";
|
|
10
|
-
import { Empty } from "./google/protobuf/empty";
|
|
11
10
|
import { Timestamp } from "./google/protobuf/timestamp";
|
|
12
11
|
|
|
13
12
|
export const protobufPackage = "session.v1";
|
|
14
13
|
|
|
14
|
+
export interface ListSessionsRequest {
|
|
15
|
+
userId: string;
|
|
16
|
+
sessionToken: string;
|
|
17
|
+
}
|
|
18
|
+
|
|
15
19
|
export interface ListSessionsResponse {
|
|
16
20
|
sessions: Session[];
|
|
17
21
|
}
|
|
18
22
|
|
|
19
23
|
export interface GetSessionRequest {
|
|
20
24
|
id?: string | undefined;
|
|
21
|
-
|
|
25
|
+
userId: string;
|
|
26
|
+
sessionToken?: string | undefined;
|
|
22
27
|
}
|
|
23
28
|
|
|
24
|
-
export interface
|
|
25
|
-
|
|
29
|
+
export interface GetSessionResponse {
|
|
30
|
+
session: Session | undefined;
|
|
26
31
|
}
|
|
27
32
|
|
|
28
33
|
export interface RevokeSessionRequest {
|
|
29
34
|
id: string;
|
|
35
|
+
userId: string;
|
|
36
|
+
sessionToken?: string | undefined;
|
|
30
37
|
}
|
|
31
38
|
|
|
32
39
|
export interface RevokeSessionResponse {
|
|
33
40
|
ok: boolean;
|
|
34
41
|
}
|
|
35
42
|
|
|
43
|
+
export interface RevokeAllOtherSessionsRequest {
|
|
44
|
+
userId: string;
|
|
45
|
+
sessionToken?: string | undefined;
|
|
46
|
+
}
|
|
47
|
+
|
|
36
48
|
export interface RevokeAllOtherSessionsResponse {
|
|
37
49
|
ok: boolean;
|
|
38
50
|
}
|
|
@@ -50,37 +62,39 @@ export interface Session {
|
|
|
50
62
|
export const SESSION_V1_PACKAGE_NAME = "session.v1";
|
|
51
63
|
|
|
52
64
|
export interface SessionServiceClient {
|
|
53
|
-
listSessions(request:
|
|
54
|
-
|
|
55
|
-
getSession(request: GetSessionRequest): Observable<GetSessionsResponse>;
|
|
65
|
+
listSessions(request: ListSessionsRequest): Observable<ListSessionsResponse>;
|
|
56
66
|
|
|
57
67
|
revokeSession(request: RevokeSessionRequest): Observable<RevokeSessionResponse>;
|
|
58
68
|
|
|
59
|
-
revokeAllOtherSessions(request:
|
|
69
|
+
revokeAllOtherSessions(request: RevokeAllOtherSessionsRequest): Observable<RevokeAllOtherSessionsResponse>;
|
|
70
|
+
|
|
71
|
+
getSession(request: GetSessionRequest): Observable<GetSessionResponse>;
|
|
60
72
|
}
|
|
61
73
|
|
|
62
74
|
export interface SessionServiceController {
|
|
63
|
-
listSessions(
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
request: GetSessionRequest,
|
|
67
|
-
): Promise<GetSessionsResponse> | Observable<GetSessionsResponse> | GetSessionsResponse;
|
|
75
|
+
listSessions(
|
|
76
|
+
request: ListSessionsRequest,
|
|
77
|
+
): Promise<ListSessionsResponse> | Observable<ListSessionsResponse> | ListSessionsResponse;
|
|
68
78
|
|
|
69
79
|
revokeSession(
|
|
70
80
|
request: RevokeSessionRequest,
|
|
71
81
|
): Promise<RevokeSessionResponse> | Observable<RevokeSessionResponse> | RevokeSessionResponse;
|
|
72
82
|
|
|
73
83
|
revokeAllOtherSessions(
|
|
74
|
-
request:
|
|
84
|
+
request: RevokeAllOtherSessionsRequest,
|
|
75
85
|
):
|
|
76
86
|
| Promise<RevokeAllOtherSessionsResponse>
|
|
77
87
|
| Observable<RevokeAllOtherSessionsResponse>
|
|
78
88
|
| RevokeAllOtherSessionsResponse;
|
|
89
|
+
|
|
90
|
+
getSession(
|
|
91
|
+
request: GetSessionRequest,
|
|
92
|
+
): Promise<GetSessionResponse> | Observable<GetSessionResponse> | GetSessionResponse;
|
|
79
93
|
}
|
|
80
94
|
|
|
81
95
|
export function SessionServiceControllerMethods() {
|
|
82
96
|
return function (constructor: Function) {
|
|
83
|
-
const grpcMethods: string[] = ["listSessions", "
|
|
97
|
+
const grpcMethods: string[] = ["listSessions", "revokeSession", "revokeAllOtherSessions", "getSession"];
|
|
84
98
|
for (const method of grpcMethods) {
|
|
85
99
|
const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
|
|
86
100
|
GrpcMethod("SessionService", method)(constructor.prototype[method], method, descriptor);
|
package/package.json
CHANGED
package/proto/session.proto
CHANGED
|
@@ -2,14 +2,19 @@ syntax = "proto3";
|
|
|
2
2
|
|
|
3
3
|
package session.v1;
|
|
4
4
|
|
|
5
|
-
import "google/protobuf/empty.proto";
|
|
6
5
|
import "google/protobuf/timestamp.proto";
|
|
7
6
|
|
|
8
7
|
service SessionService {
|
|
9
|
-
rpc ListSessions (
|
|
10
|
-
rpc GetSession (GetSessionRequest) returns (GetSessionsResponse);
|
|
8
|
+
rpc ListSessions (ListSessionsRequest) returns (ListSessionsResponse);
|
|
11
9
|
rpc RevokeSession (RevokeSessionRequest) returns (RevokeSessionResponse);
|
|
12
|
-
rpc RevokeAllOtherSessions (
|
|
10
|
+
rpc RevokeAllOtherSessions (RevokeAllOtherSessionsRequest) returns (RevokeAllOtherSessionsResponse);
|
|
11
|
+
|
|
12
|
+
rpc GetSession (GetSessionRequest) returns (GetSessionResponse);
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
message ListSessionsRequest {
|
|
16
|
+
string user_id = 1;
|
|
17
|
+
string session_token = 2;
|
|
13
18
|
}
|
|
14
19
|
|
|
15
20
|
message ListSessionsResponse {
|
|
@@ -18,21 +23,29 @@ message ListSessionsResponse {
|
|
|
18
23
|
|
|
19
24
|
message GetSessionRequest {
|
|
20
25
|
optional string id = 1;
|
|
21
|
-
|
|
26
|
+
string user_id = 2;
|
|
27
|
+
optional string session_token = 3;
|
|
22
28
|
}
|
|
23
29
|
|
|
24
|
-
message
|
|
25
|
-
Session
|
|
30
|
+
message GetSessionResponse {
|
|
31
|
+
Session session = 1;
|
|
26
32
|
}
|
|
27
33
|
|
|
28
34
|
message RevokeSessionRequest {
|
|
29
35
|
string id = 1;
|
|
36
|
+
string user_id = 2;
|
|
37
|
+
optional string session_token = 3;
|
|
30
38
|
}
|
|
31
39
|
|
|
32
40
|
message RevokeSessionResponse {
|
|
33
41
|
bool ok = 1;
|
|
34
42
|
}
|
|
35
43
|
|
|
44
|
+
message RevokeAllOtherSessionsRequest {
|
|
45
|
+
string user_id = 1;
|
|
46
|
+
optional string session_token = 2;
|
|
47
|
+
}
|
|
48
|
+
|
|
36
49
|
message RevokeAllOtherSessionsResponse {
|
|
37
50
|
bool ok = 1;
|
|
38
51
|
}
|