jr-common-micro 1.1.77 → 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;
@@ -227,6 +228,7 @@ export interface ChatMemberDto {
227
228
  is_online: boolean;
228
229
  reapplied: boolean;
229
230
  is_anonymous: boolean;
231
+ badges: string[];
230
232
  }
231
233
  export interface GroupPhotoSetRequest {
232
234
  id: string;
@@ -247,6 +249,7 @@ export interface ChatUserAdminDto {
247
249
  moderator_of: string[];
248
250
  has_active_ban: boolean;
249
251
  has_active_mute: boolean;
252
+ badges: string[];
250
253
  }
251
254
  export interface ChatUserAdminListResponse {
252
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";
@@ -492,6 +493,7 @@ export declare class ChatMemberDto extends Message<ChatMemberDto> {
492
493
  isOnline: boolean;
493
494
  reapplied: boolean;
494
495
  isAnonymous: boolean;
496
+ badges: string[];
495
497
  constructor(data?: PartialMessage<ChatMemberDto>);
496
498
  static readonly runtime: typeof proto3;
497
499
  static readonly typeName = "micro.v1.chat.ChatMemberDto";
@@ -536,6 +538,7 @@ export declare class ChatUserAdminDto extends Message<ChatUserAdminDto> {
536
538
  moderatorOf: string[];
537
539
  hasActiveBan: boolean;
538
540
  hasActiveMute: boolean;
541
+ badges: string[];
539
542
  constructor(data?: PartialMessage<ChatUserAdminDto>);
540
543
  static readonly runtime: typeof proto3;
541
544
  static readonly typeName = "micro.v1.chat.ChatUserAdminDto";
@@ -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);
@@ -1074,6 +1076,7 @@ class ChatMemberDto extends protobuf_1.Message {
1074
1076
  isOnline = false;
1075
1077
  reapplied = false;
1076
1078
  isAnonymous = false;
1079
+ badges = [];
1077
1080
  constructor(data) {
1078
1081
  super();
1079
1082
  protobuf_1.proto3.util.initPartial(data, this);
@@ -1090,6 +1093,7 @@ class ChatMemberDto extends protobuf_1.Message {
1090
1093
  { no: 7, name: "is_online", kind: "scalar", T: 8 },
1091
1094
  { no: 8, name: "reapplied", kind: "scalar", T: 8 },
1092
1095
  { no: 9, name: "is_anonymous", kind: "scalar", T: 8 },
1096
+ { no: 10, name: "badges", kind: "scalar", T: 9, repeated: true },
1093
1097
  ]);
1094
1098
  static fromBinary(bytes, options) {
1095
1099
  return new ChatMemberDto().fromBinary(bytes, options);
@@ -1172,6 +1176,7 @@ class ChatUserAdminDto extends protobuf_1.Message {
1172
1176
  moderatorOf = [];
1173
1177
  hasActiveBan = false;
1174
1178
  hasActiveMute = false;
1179
+ badges = [];
1175
1180
  constructor(data) {
1176
1181
  super();
1177
1182
  protobuf_1.proto3.util.initPartial(data, this);
@@ -1187,6 +1192,7 @@ class ChatUserAdminDto extends protobuf_1.Message {
1187
1192
  { no: 6, name: "moderator_of", kind: "scalar", T: 9, repeated: true },
1188
1193
  { no: 7, name: "has_active_ban", kind: "scalar", T: 8 },
1189
1194
  { no: 8, name: "has_active_mute", kind: "scalar", T: 8 },
1195
+ { no: 9, name: "badges", kind: "scalar", T: 9, repeated: true },
1190
1196
  ]);
1191
1197
  static fromBinary(bytes, options) {
1192
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.77",
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 {
@@ -327,6 +330,9 @@ message ChatMemberDto {
327
330
  bool reapplied = 8;
328
331
  // Staff member posting as the group in this room (admin-managed).
329
332
  bool is_anonymous = 9;
333
+ // Display badges of the user (gold | premium); empty for anonymous.
334
+ repeated string badges = 10;
335
+
330
336
  }
331
337
 
332
338
  // Admin user directory row: chat-wide view of one user.
@@ -354,6 +360,9 @@ message ChatUserAdminDto {
354
360
  repeated string moderator_of = 6;
355
361
  bool has_active_ban = 7;
356
362
  bool has_active_mute = 8;
363
+ // Display badges of the user (gold | premium); empty for anonymous.
364
+ repeated string badges = 9;
365
+
357
366
  }
358
367
 
359
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).