jr-common-micro 1.1.76 → 1.1.78

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.
@@ -65,6 +65,7 @@ export interface ChatMessageDto {
65
65
  ticker_cards: ChatTickerCardDto[];
66
66
  is_anonymous: boolean;
67
67
  is_own: boolean;
68
+ badges: string[];
68
69
  }
69
70
  export interface ChatTickerCardDto {
70
71
  symbol: string;
@@ -126,10 +127,16 @@ export interface ChatPollDto {
126
127
  closed: boolean;
127
128
  voters_visibility: string;
128
129
  }
130
+ export interface ChatReactorDto {
131
+ user_id: string;
132
+ avatar_id: string;
133
+ is_anonymous: boolean;
134
+ }
129
135
  export interface ChatReactionCountDto {
130
136
  emoji: string;
131
137
  count: number;
132
138
  reacted_by_me: boolean;
139
+ reactors: ChatReactorDto[];
133
140
  }
134
141
  export interface ChatReplyPreviewDto {
135
142
  id: string;
@@ -221,6 +228,7 @@ export interface ChatMemberDto {
221
228
  is_online: boolean;
222
229
  reapplied: boolean;
223
230
  is_anonymous: boolean;
231
+ badges: string[];
224
232
  }
225
233
  export interface GroupPhotoSetRequest {
226
234
  id: string;
@@ -241,6 +249,7 @@ export interface ChatUserAdminDto {
241
249
  moderator_of: string[];
242
250
  has_active_ban: boolean;
243
251
  has_active_mute: boolean;
252
+ badges: string[];
244
253
  }
245
254
  export interface ChatUserAdminListResponse {
246
255
  status: ResponseStatus | undefined;
@@ -106,6 +106,7 @@ export declare class ChatMessageDto extends Message<ChatMessageDto> {
106
106
  tickerCards: ChatTickerCardDto[];
107
107
  isAnonymous: boolean;
108
108
  isOwn: boolean;
109
+ badges: string[];
109
110
  constructor(data?: PartialMessage<ChatMessageDto>);
110
111
  static readonly runtime: typeof proto3;
111
112
  static readonly typeName = "micro.v1.chat.ChatMessageDto";
@@ -247,10 +248,24 @@ export declare class ChatPollDto extends Message<ChatPollDto> {
247
248
  static fromJsonString(jsonString: string, options?: Partial<JsonReadOptions>): ChatPollDto;
248
249
  static equals(a: ChatPollDto | PlainMessage<ChatPollDto> | undefined, b: ChatPollDto | PlainMessage<ChatPollDto> | undefined): boolean;
249
250
  }
251
+ export declare class ChatReactorDto extends Message<ChatReactorDto> {
252
+ userId: string;
253
+ avatarId: string;
254
+ isAnonymous: boolean;
255
+ constructor(data?: PartialMessage<ChatReactorDto>);
256
+ static readonly runtime: typeof proto3;
257
+ static readonly typeName = "micro.v1.chat.ChatReactorDto";
258
+ static readonly fields: FieldList;
259
+ static fromBinary(bytes: Uint8Array, options?: Partial<BinaryReadOptions>): ChatReactorDto;
260
+ static fromJson(jsonValue: JsonValue, options?: Partial<JsonReadOptions>): ChatReactorDto;
261
+ static fromJsonString(jsonString: string, options?: Partial<JsonReadOptions>): ChatReactorDto;
262
+ static equals(a: ChatReactorDto | PlainMessage<ChatReactorDto> | undefined, b: ChatReactorDto | PlainMessage<ChatReactorDto> | undefined): boolean;
263
+ }
250
264
  export declare class ChatReactionCountDto extends Message<ChatReactionCountDto> {
251
265
  emoji: string;
252
266
  count: number;
253
267
  reactedByMe: boolean;
268
+ reactors: ChatReactorDto[];
254
269
  constructor(data?: PartialMessage<ChatReactionCountDto>);
255
270
  static readonly runtime: typeof proto3;
256
271
  static readonly typeName = "micro.v1.chat.ChatReactionCountDto";
@@ -478,6 +493,7 @@ export declare class ChatMemberDto extends Message<ChatMemberDto> {
478
493
  isOnline: boolean;
479
494
  reapplied: boolean;
480
495
  isAnonymous: boolean;
496
+ badges: string[];
481
497
  constructor(data?: PartialMessage<ChatMemberDto>);
482
498
  static readonly runtime: typeof proto3;
483
499
  static readonly typeName = "micro.v1.chat.ChatMemberDto";
@@ -522,6 +538,7 @@ export declare class ChatUserAdminDto extends Message<ChatUserAdminDto> {
522
538
  moderatorOf: string[];
523
539
  hasActiveBan: boolean;
524
540
  hasActiveMute: boolean;
541
+ badges: string[];
525
542
  constructor(data?: PartialMessage<ChatUserAdminDto>);
526
543
  static readonly runtime: typeof proto3;
527
544
  static readonly typeName = "micro.v1.chat.ChatUserAdminDto";
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ReviewReportRequest = exports.ReportListResponse = exports.ReportDto = exports.SanctionListResponse = exports.SanctionDto = exports.ChatMemberListResponse = exports.ChatUserAdminListResponse = exports.ChatUserAdminDto = exports.GroupPhotoResponse = exports.GroupPhotoSetRequest = exports.ChatMemberDto = exports.ChatMemberListRequest = exports.PendingMembersRequest = exports.MemberActionRequest = exports.PinMessageRequest = exports.DeleteMessageRequest = exports.RevokeSanctionRequest = exports.SanctionRequest = exports.GroupUpsertRequest = exports.BlockedUsersResponse = exports.BlockUserRequest = exports.ReportMessageRequest = exports.PinnedMessagesResponse = exports.PinnedMessagesRequest = exports.MessageHistoryResponse = exports.MessageHistoryRequest = exports.ChatReplyPreviewDto = exports.ChatReactionCountDto = exports.ChatPollDto = exports.ChatPollOptionDto = exports.ChatMediaGetResponse = exports.ChatMediaGetRequest = exports.ChatMediaUploadResponse = exports.ChatMediaUploadRequest = exports.ChatMediaDto = exports.ChatLinkPreviewDto = exports.ChatTickerCardDto = exports.ChatMessageDto = exports.ChatGroupSingleResponse = exports.JoinGroupResponse = exports.GroupBySlugRequest = exports.ChatGroupListResponse = exports.ChatGroupDto = void 0;
3
+ exports.ReviewReportRequest = exports.ReportListResponse = exports.ReportDto = exports.SanctionListResponse = exports.SanctionDto = exports.ChatMemberListResponse = exports.ChatUserAdminListResponse = exports.ChatUserAdminDto = exports.GroupPhotoResponse = exports.GroupPhotoSetRequest = exports.ChatMemberDto = exports.ChatMemberListRequest = exports.PendingMembersRequest = exports.MemberActionRequest = exports.PinMessageRequest = exports.DeleteMessageRequest = exports.RevokeSanctionRequest = exports.SanctionRequest = exports.GroupUpsertRequest = exports.BlockedUsersResponse = exports.BlockUserRequest = exports.ReportMessageRequest = exports.PinnedMessagesResponse = exports.PinnedMessagesRequest = exports.MessageHistoryResponse = exports.MessageHistoryRequest = exports.ChatReplyPreviewDto = exports.ChatReactionCountDto = exports.ChatReactorDto = exports.ChatPollDto = exports.ChatPollOptionDto = exports.ChatMediaGetResponse = exports.ChatMediaGetRequest = exports.ChatMediaUploadResponse = exports.ChatMediaUploadRequest = exports.ChatMediaDto = exports.ChatLinkPreviewDto = exports.ChatTickerCardDto = exports.ChatMessageDto = exports.ChatGroupSingleResponse = exports.JoinGroupResponse = exports.GroupBySlugRequest = exports.ChatGroupListResponse = exports.ChatGroupDto = void 0;
4
4
  const protobuf_1 = require("@bufbuild/protobuf");
5
5
  const general_pb_js_1 = require("../general_pb.js");
6
6
  class ChatGroupDto extends protobuf_1.Message {
@@ -203,6 +203,7 @@ class ChatMessageDto extends protobuf_1.Message {
203
203
  tickerCards = [];
204
204
  isAnonymous = false;
205
205
  isOwn = false;
206
+ badges = [];
206
207
  constructor(data) {
207
208
  super();
208
209
  protobuf_1.proto3.util.initPartial(data, this);
@@ -234,6 +235,7 @@ class ChatMessageDto extends protobuf_1.Message {
234
235
  { no: 22, name: "ticker_cards", kind: "message", T: ChatTickerCardDto, repeated: true },
235
236
  { no: 23, name: "is_anonymous", kind: "scalar", T: 8 },
236
237
  { no: 24, name: "is_own", kind: "scalar", T: 8 },
238
+ { no: 25, name: "badges", kind: "scalar", T: 9, repeated: true },
237
239
  ]);
238
240
  static fromBinary(bytes, options) {
239
241
  return new ChatMessageDto().fromBinary(bytes, options);
@@ -540,10 +542,40 @@ class ChatPollDto extends protobuf_1.Message {
540
542
  }
541
543
  }
542
544
  exports.ChatPollDto = ChatPollDto;
545
+ class ChatReactorDto extends protobuf_1.Message {
546
+ userId = "";
547
+ avatarId = "";
548
+ isAnonymous = false;
549
+ constructor(data) {
550
+ super();
551
+ protobuf_1.proto3.util.initPartial(data, this);
552
+ }
553
+ static runtime = protobuf_1.proto3;
554
+ static typeName = "micro.v1.chat.ChatReactorDto";
555
+ static fields = protobuf_1.proto3.util.newFieldList(() => [
556
+ { no: 1, name: "user_id", kind: "scalar", T: 9 },
557
+ { no: 2, name: "avatar_id", kind: "scalar", T: 9 },
558
+ { no: 3, name: "is_anonymous", kind: "scalar", T: 8 },
559
+ ]);
560
+ static fromBinary(bytes, options) {
561
+ return new ChatReactorDto().fromBinary(bytes, options);
562
+ }
563
+ static fromJson(jsonValue, options) {
564
+ return new ChatReactorDto().fromJson(jsonValue, options);
565
+ }
566
+ static fromJsonString(jsonString, options) {
567
+ return new ChatReactorDto().fromJsonString(jsonString, options);
568
+ }
569
+ static equals(a, b) {
570
+ return protobuf_1.proto3.util.equals(ChatReactorDto, a, b);
571
+ }
572
+ }
573
+ exports.ChatReactorDto = ChatReactorDto;
543
574
  class ChatReactionCountDto extends protobuf_1.Message {
544
575
  emoji = "";
545
576
  count = 0;
546
577
  reactedByMe = false;
578
+ reactors = [];
547
579
  constructor(data) {
548
580
  super();
549
581
  protobuf_1.proto3.util.initPartial(data, this);
@@ -554,6 +586,7 @@ class ChatReactionCountDto extends protobuf_1.Message {
554
586
  { no: 1, name: "emoji", kind: "scalar", T: 9 },
555
587
  { no: 2, name: "count", kind: "scalar", T: 13 },
556
588
  { no: 3, name: "reacted_by_me", kind: "scalar", T: 8 },
589
+ { no: 4, name: "reactors", kind: "message", T: ChatReactorDto, repeated: true },
557
590
  ]);
558
591
  static fromBinary(bytes, options) {
559
592
  return new ChatReactionCountDto().fromBinary(bytes, options);
@@ -1043,6 +1076,7 @@ class ChatMemberDto extends protobuf_1.Message {
1043
1076
  isOnline = false;
1044
1077
  reapplied = false;
1045
1078
  isAnonymous = false;
1079
+ badges = [];
1046
1080
  constructor(data) {
1047
1081
  super();
1048
1082
  protobuf_1.proto3.util.initPartial(data, this);
@@ -1059,6 +1093,7 @@ class ChatMemberDto extends protobuf_1.Message {
1059
1093
  { no: 7, name: "is_online", kind: "scalar", T: 8 },
1060
1094
  { no: 8, name: "reapplied", kind: "scalar", T: 8 },
1061
1095
  { no: 9, name: "is_anonymous", kind: "scalar", T: 8 },
1096
+ { no: 10, name: "badges", kind: "scalar", T: 9, repeated: true },
1062
1097
  ]);
1063
1098
  static fromBinary(bytes, options) {
1064
1099
  return new ChatMemberDto().fromBinary(bytes, options);
@@ -1141,6 +1176,7 @@ class ChatUserAdminDto extends protobuf_1.Message {
1141
1176
  moderatorOf = [];
1142
1177
  hasActiveBan = false;
1143
1178
  hasActiveMute = false;
1179
+ badges = [];
1144
1180
  constructor(data) {
1145
1181
  super();
1146
1182
  protobuf_1.proto3.util.initPartial(data, this);
@@ -1156,6 +1192,7 @@ class ChatUserAdminDto extends protobuf_1.Message {
1156
1192
  { no: 6, name: "moderator_of", kind: "scalar", T: 9, repeated: true },
1157
1193
  { no: 7, name: "has_active_ban", kind: "scalar", T: 8 },
1158
1194
  { no: 8, name: "has_active_mute", kind: "scalar", T: 8 },
1195
+ { no: 9, name: "badges", kind: "scalar", T: 9, repeated: true },
1159
1196
  ]);
1160
1197
  static fromBinary(bytes, options) {
1161
1198
  return new ChatUserAdminDto().fromBinary(bytes, options);
@@ -17,6 +17,7 @@ export interface ProfileDto {
17
17
  is_liked: boolean;
18
18
  is_me: boolean;
19
19
  member_since: string;
20
+ badges: string[];
20
21
  }
21
22
  export interface UsernameAvailableRequest {
22
23
  username: string;
@@ -56,6 +57,7 @@ export interface ProfileListItemDto {
56
57
  avatar_id: string;
57
58
  role: string;
58
59
  status: string;
60
+ badges: string[];
59
61
  }
60
62
  export interface ProfilesByIdsRequest {
61
63
  user_ids: string[];
@@ -18,6 +18,7 @@ export declare class ProfileDto extends Message<ProfileDto> {
18
18
  isLiked: boolean;
19
19
  isMe: boolean;
20
20
  memberSince: string;
21
+ badges: string[];
21
22
  constructor(data?: PartialMessage<ProfileDto>);
22
23
  static readonly runtime: typeof proto3;
23
24
  static readonly typeName = "micro.v1.user.ProfileDto";
@@ -129,6 +130,7 @@ export declare class ProfileListItemDto extends Message<ProfileListItemDto> {
129
130
  avatarId: string;
130
131
  role: string;
131
132
  status: string;
133
+ badges: string[];
132
134
  constructor(data?: PartialMessage<ProfileListItemDto>);
133
135
  static readonly runtime: typeof proto3;
134
136
  static readonly typeName = "micro.v1.user.ProfileListItemDto";
@@ -20,6 +20,7 @@ class ProfileDto extends protobuf_1.Message {
20
20
  isLiked = false;
21
21
  isMe = false;
22
22
  memberSince = "";
23
+ badges = [];
23
24
  constructor(data) {
24
25
  super();
25
26
  protobuf_1.proto3.util.initPartial(data, this);
@@ -43,6 +44,7 @@ class ProfileDto extends protobuf_1.Message {
43
44
  { no: 14, name: "is_liked", kind: "scalar", T: 8 },
44
45
  { no: 15, name: "is_me", kind: "scalar", T: 8 },
45
46
  { no: 16, name: "member_since", kind: "scalar", T: 9 },
47
+ { no: 17, name: "badges", kind: "scalar", T: 9, repeated: true },
46
48
  ]);
47
49
  static fromBinary(bytes, options) {
48
50
  return new ProfileDto().fromBinary(bytes, options);
@@ -280,6 +282,7 @@ class ProfileListItemDto extends protobuf_1.Message {
280
282
  avatarId = "";
281
283
  role = "";
282
284
  status = "";
285
+ badges = [];
283
286
  constructor(data) {
284
287
  super();
285
288
  protobuf_1.proto3.util.initPartial(data, this);
@@ -292,6 +295,7 @@ class ProfileListItemDto extends protobuf_1.Message {
292
295
  { no: 3, name: "avatar_id", kind: "scalar", T: 9 },
293
296
  { no: 4, name: "role", kind: "scalar", T: 9 },
294
297
  { no: 5, name: "status", kind: "scalar", T: 9 },
298
+ { no: 6, name: "badges", kind: "scalar", T: 9, repeated: true },
295
299
  ]);
296
300
  static fromBinary(bytes, options) {
297
301
  return new ProfileListItemDto().fromBinary(bytes, options);
@@ -0,0 +1,4 @@
1
+ export declare const BADGE_KEYS: readonly ["gold", "premium"];
2
+ export type BadgeKey = (typeof BADGE_KEYS)[number];
3
+ export declare function isBadgeKey(value: string): value is BadgeKey;
4
+ export declare function normalizeBadges(values: readonly string[] | undefined): BadgeKey[];
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.BADGE_KEYS = void 0;
4
+ exports.isBadgeKey = isBadgeKey;
5
+ exports.normalizeBadges = normalizeBadges;
6
+ exports.BADGE_KEYS = ['gold', 'premium'];
7
+ function isBadgeKey(value) {
8
+ return exports.BADGE_KEYS.includes(value);
9
+ }
10
+ function normalizeBadges(values) {
11
+ const set = new Set(values ?? []);
12
+ return exports.BADGE_KEYS.filter((key) => set.has(key));
13
+ }
@@ -1,3 +1,4 @@
1
+ export * as badges from './badges';
1
2
  export * as constants from './constants';
2
3
  export * as functions from './functions';
3
4
  export * as logger_names from './logger_names';
@@ -1,7 +1,8 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.walk_sync = exports.types = exports.puppeteer_constants = exports.logger_names = exports.functions = exports.constants = void 0;
3
+ exports.walk_sync = exports.types = exports.puppeteer_constants = exports.logger_names = exports.functions = exports.constants = exports.badges = void 0;
4
4
  const tslib_1 = require("tslib");
5
+ exports.badges = tslib_1.__importStar(require("./badges"));
5
6
  exports.constants = tslib_1.__importStar(require("./constants"));
6
7
  exports.functions = tslib_1.__importStar(require("./functions"));
7
8
  exports.logger_names = tslib_1.__importStar(require("./logger_names"));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "jr-common-micro",
3
- "version": "1.1.76",
3
+ "version": "1.1.78",
4
4
  "description": "",
5
5
  "author": "",
6
6
  "private": false,
@@ -106,6 +106,9 @@ message ChatMessageDto {
106
106
  // room broadcast — so they keep edit/delete/readers on it without anyone
107
107
  // else learning who sent it.
108
108
  bool is_own = 24;
109
+ // Display badges of the user (gold | premium); empty for anonymous.
110
+ repeated string badges = 25;
111
+
109
112
  }
110
113
 
111
114
  message ChatTickerCardDto {
@@ -188,12 +191,23 @@ message ChatPollDto {
188
191
  string voters_visibility = 8;
189
192
  }
190
193
 
194
+ // One of the first few people behind a reaction chip (avatar preview).
195
+ message ChatReactorDto {
196
+ // '' for an anonymous staff member (shown as the group).
197
+ string user_id = 1;
198
+ string avatar_id = 2;
199
+ bool is_anonymous = 3;
200
+ }
201
+
191
202
  // Aggregated reaction chip for one emoji on one message.
192
203
  message ChatReactionCountDto {
193
204
  string emoji = 1;
194
205
  uint32 count = 2;
195
206
  // True when the requesting user set this reaction (per-viewer field).
196
207
  bool reacted_by_me = 3;
208
+ // Latest reactors, at most 3: lets the chip show faces instead of a
209
+ // number while the count is small (Telegram style).
210
+ repeated ChatReactorDto reactors = 4;
197
211
  }
198
212
 
199
213
  message ChatReplyPreviewDto {
@@ -316,6 +330,9 @@ message ChatMemberDto {
316
330
  bool reapplied = 8;
317
331
  // Staff member posting as the group in this room (admin-managed).
318
332
  bool is_anonymous = 9;
333
+ // Display badges of the user (gold | premium); empty for anonymous.
334
+ repeated string badges = 10;
335
+
319
336
  }
320
337
 
321
338
  // Admin user directory row: chat-wide view of one user.
@@ -343,6 +360,9 @@ message ChatUserAdminDto {
343
360
  repeated string moderator_of = 6;
344
361
  bool has_active_ban = 7;
345
362
  bool has_active_mute = 8;
363
+ // Display badges of the user (gold | premium); empty for anonymous.
364
+ repeated string badges = 9;
365
+
346
366
  }
347
367
 
348
368
  message ChatUserAdminListResponse {
@@ -34,6 +34,11 @@ message ProfileDto {
34
34
  bool is_me = 15;
35
35
 
36
36
  string member_since = 16;
37
+
38
+ // Display badges (see utils/badges: gold | premium). Presentation only;
39
+ // never a permission. Unknown keys must be ignored by clients.
40
+ repeated string badges = 17;
41
+
37
42
  }
38
43
 
39
44
  message UsernameAvailableRequest { string username = 1; }
@@ -73,6 +78,7 @@ message ProfileListItemDto {
73
78
  string role = 4;
74
79
  // active | passive (e-mail verification state)
75
80
  string status = 5;
81
+ repeated string badges = 6;
76
82
  }
77
83
 
78
84
  // Internal service-to-service lookup (not exposed over HTTP).