@barumetric/contracts 1.2.9 → 1.2.10

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 CHANGED
@@ -7,17 +7,21 @@
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
+ }
17
+
15
18
  export interface ListSessionsResponse {
16
19
  sessions: Session[];
17
20
  }
18
21
 
19
22
  export interface GetSessionRequest {
20
23
  id?: string | undefined;
24
+ userId: string;
21
25
  current: boolean;
22
26
  }
23
27
 
@@ -27,12 +31,17 @@ export interface GetSessionsResponse {
27
31
 
28
32
  export interface RevokeSessionRequest {
29
33
  id: string;
34
+ userId: string;
30
35
  }
31
36
 
32
37
  export interface RevokeSessionResponse {
33
38
  ok: boolean;
34
39
  }
35
40
 
41
+ export interface RevokeAllOtherSessionsRequest {
42
+ userId: string;
43
+ }
44
+
36
45
  export interface RevokeAllOtherSessionsResponse {
37
46
  ok: boolean;
38
47
  }
@@ -50,17 +59,19 @@ export interface Session {
50
59
  export const SESSION_V1_PACKAGE_NAME = "session.v1";
51
60
 
52
61
  export interface SessionServiceClient {
53
- listSessions(request: Empty): Observable<ListSessionsResponse>;
62
+ listSessions(request: ListSessionsRequest): Observable<ListSessionsResponse>;
54
63
 
55
64
  getSession(request: GetSessionRequest): Observable<GetSessionsResponse>;
56
65
 
57
66
  revokeSession(request: RevokeSessionRequest): Observable<RevokeSessionResponse>;
58
67
 
59
- revokeAllOtherSessions(request: Empty): Observable<RevokeAllOtherSessionsResponse>;
68
+ revokeAllOtherSessions(request: RevokeAllOtherSessionsRequest): Observable<RevokeAllOtherSessionsResponse>;
60
69
  }
61
70
 
62
71
  export interface SessionServiceController {
63
- listSessions(request: Empty): Promise<ListSessionsResponse> | Observable<ListSessionsResponse> | ListSessionsResponse;
72
+ listSessions(
73
+ request: ListSessionsRequest,
74
+ ): Promise<ListSessionsResponse> | Observable<ListSessionsResponse> | ListSessionsResponse;
64
75
 
65
76
  getSession(
66
77
  request: GetSessionRequest,
@@ -71,7 +82,7 @@ export interface SessionServiceController {
71
82
  ): Promise<RevokeSessionResponse> | Observable<RevokeSessionResponse> | RevokeSessionResponse;
72
83
 
73
84
  revokeAllOtherSessions(
74
- request: Empty,
85
+ request: RevokeAllOtherSessionsRequest,
75
86
  ):
76
87
  | Promise<RevokeAllOtherSessionsResponse>
77
88
  | Observable<RevokeAllOtherSessionsResponse>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@barumetric/contracts",
3
- "version": "1.2.9",
3
+ "version": "1.2.10",
4
4
  "description": "Protobuf definitions and generated TypeScript types",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",
@@ -2,14 +2,17 @@ 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 (google.protobuf.Empty) returns (ListSessionsResponse);
8
+ rpc ListSessions (ListSessionsRequest) returns (ListSessionsResponse);
10
9
  rpc GetSession (GetSessionRequest) returns (GetSessionsResponse);
11
10
  rpc RevokeSession (RevokeSessionRequest) returns (RevokeSessionResponse);
12
- rpc RevokeAllOtherSessions (google.protobuf.Empty) returns (RevokeAllOtherSessionsResponse);
11
+ rpc RevokeAllOtherSessions (RevokeAllOtherSessionsRequest) returns (RevokeAllOtherSessionsResponse);
12
+ }
13
+
14
+ message ListSessionsRequest {
15
+ string user_id = 1;
13
16
  }
14
17
 
15
18
  message ListSessionsResponse {
@@ -18,7 +21,8 @@ message ListSessionsResponse {
18
21
 
19
22
  message GetSessionRequest {
20
23
  optional string id = 1;
21
- bool current = 2;
24
+ string user_id = 2;
25
+ bool current = 3;
22
26
  }
23
27
 
24
28
  message GetSessionsResponse {
@@ -27,12 +31,17 @@ message GetSessionsResponse {
27
31
 
28
32
  message RevokeSessionRequest {
29
33
  string id = 1;
34
+ string user_id = 2;
30
35
  }
31
36
 
32
37
  message RevokeSessionResponse {
33
38
  bool ok = 1;
34
39
  }
35
40
 
41
+ message RevokeAllOtherSessionsRequest {
42
+ string user_id = 1;
43
+ }
44
+
36
45
  message RevokeAllOtherSessionsResponse {
37
46
  bool ok = 1;
38
47
  }