@barumetric/contracts 1.4.21 → 1.4.22

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.
@@ -60,6 +60,19 @@ export interface IsUserOnlineResponse {
60
60
  isOnline: boolean;
61
61
  }
62
62
 
63
+ export interface GetUsersOnlineStatusRequest {
64
+ userIds: string[];
65
+ }
66
+
67
+ export interface GetUsersOnlineStatusResponse {
68
+ statuses: UserOnlineStatus[];
69
+ }
70
+
71
+ export interface UserOnlineStatus {
72
+ userId: string;
73
+ isOnline: boolean;
74
+ }
75
+
63
76
  export const PRESENCE_V1_PACKAGE_NAME = "presence.v1";
64
77
 
65
78
  export interface PresenceServiceClient {
@@ -74,6 +87,8 @@ export interface PresenceServiceClient {
74
87
  getUserBySocket(request: GetUserBySocketRequest): Observable<GetUserBySocketResponse>;
75
88
 
76
89
  isUserOnline(request: IsUserOnlineRequest): Observable<IsUserOnlineResponse>;
90
+
91
+ getUsersOnlineStatus(request: GetUsersOnlineStatusRequest): Observable<GetUsersOnlineStatusResponse>;
77
92
  }
78
93
 
79
94
  export interface PresenceServiceController {
@@ -100,6 +115,10 @@ export interface PresenceServiceController {
100
115
  isUserOnline(
101
116
  request: IsUserOnlineRequest,
102
117
  ): Promise<IsUserOnlineResponse> | Observable<IsUserOnlineResponse> | IsUserOnlineResponse;
118
+
119
+ getUsersOnlineStatus(
120
+ request: GetUsersOnlineStatusRequest,
121
+ ): Promise<GetUsersOnlineStatusResponse> | Observable<GetUsersOnlineStatusResponse> | GetUsersOnlineStatusResponse;
103
122
  }
104
123
 
105
124
  export function PresenceServiceControllerMethods() {
@@ -111,6 +130,7 @@ export function PresenceServiceControllerMethods() {
111
130
  "removeUserSocket",
112
131
  "getUserBySocket",
113
132
  "isUserOnline",
133
+ "getUsersOnlineStatus",
114
134
  ];
115
135
  for (const method of grpcMethods) {
116
136
  const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@barumetric/contracts",
3
- "version": "1.4.21",
3
+ "version": "1.4.22",
4
4
  "description": "Protobuf definitions and generated TypeScript types",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",
@@ -11,6 +11,7 @@ service PresenceService {
11
11
  rpc RemoveUserSocket (RemoveUserSocketRequest) returns (RemoveUserSocketResponse);
12
12
  rpc GetUserBySocket (GetUserBySocketRequest) returns (GetUserBySocketResponse);
13
13
  rpc IsUserOnline (IsUserOnlineRequest) returns (IsUserOnlineResponse);
14
+ rpc GetUsersOnlineStatus (GetUsersOnlineStatusRequest) returns (GetUsersOnlineStatusResponse);
14
15
 
15
16
  }
16
17
 
@@ -62,4 +63,17 @@ message IsUserOnlineRequest {
62
63
 
63
64
  message IsUserOnlineResponse {
64
65
  bool is_online = 1;
65
- }
66
+ }
67
+
68
+ message GetUsersOnlineStatusRequest {
69
+ repeated string user_ids = 1;
70
+ }
71
+
72
+ message GetUsersOnlineStatusResponse {
73
+ repeated UserOnlineStatus statuses = 1;
74
+ }
75
+
76
+ message UserOnlineStatus {
77
+ string user_id = 1;
78
+ bool is_online = 2;
79
+ }