jr-common-micro 1.1.58 → 1.1.59
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.
|
@@ -18,6 +18,7 @@ export interface ChatGroupDto {
|
|
|
18
18
|
sort_order: number;
|
|
19
19
|
is_active: boolean;
|
|
20
20
|
system_notices: boolean;
|
|
21
|
+
poll_policy: string;
|
|
21
22
|
}
|
|
22
23
|
export interface ChatGroupListResponse {
|
|
23
24
|
status: ResponseStatus | undefined;
|
|
@@ -51,6 +52,22 @@ export interface ChatMessageDto {
|
|
|
51
52
|
is_deleted: boolean;
|
|
52
53
|
reactions: ChatReactionCountDto[];
|
|
53
54
|
edited_at: string;
|
|
55
|
+
poll: ChatPollDto | undefined;
|
|
56
|
+
}
|
|
57
|
+
export interface ChatPollOptionDto {
|
|
58
|
+
id: string;
|
|
59
|
+
text: string;
|
|
60
|
+
votes: number;
|
|
61
|
+
}
|
|
62
|
+
export interface ChatPollDto {
|
|
63
|
+
id: string;
|
|
64
|
+
question: string;
|
|
65
|
+
options: ChatPollOptionDto[];
|
|
66
|
+
total_votes: number;
|
|
67
|
+
my_option_id: string;
|
|
68
|
+
ends_at: string;
|
|
69
|
+
closed: boolean;
|
|
70
|
+
voters_visibility: string;
|
|
54
71
|
}
|
|
55
72
|
export interface ChatReactionCountDto {
|
|
56
73
|
emoji: string;
|
|
@@ -19,6 +19,7 @@ export declare class ChatGroupDto extends Message<ChatGroupDto> {
|
|
|
19
19
|
sortOrder: number;
|
|
20
20
|
isActive: boolean;
|
|
21
21
|
systemNotices: boolean;
|
|
22
|
+
pollPolicy: string;
|
|
22
23
|
constructor(data?: PartialMessage<ChatGroupDto>);
|
|
23
24
|
static readonly runtime: typeof proto3;
|
|
24
25
|
static readonly typeName = "micro.v1.chat.ChatGroupDto";
|
|
@@ -92,6 +93,7 @@ export declare class ChatMessageDto extends Message<ChatMessageDto> {
|
|
|
92
93
|
isDeleted: boolean;
|
|
93
94
|
reactions: ChatReactionCountDto[];
|
|
94
95
|
editedAt: string;
|
|
96
|
+
poll?: ChatPollDto;
|
|
95
97
|
constructor(data?: PartialMessage<ChatMessageDto>);
|
|
96
98
|
static readonly runtime: typeof proto3;
|
|
97
99
|
static readonly typeName = "micro.v1.chat.ChatMessageDto";
|
|
@@ -101,6 +103,37 @@ export declare class ChatMessageDto extends Message<ChatMessageDto> {
|
|
|
101
103
|
static fromJsonString(jsonString: string, options?: Partial<JsonReadOptions>): ChatMessageDto;
|
|
102
104
|
static equals(a: ChatMessageDto | PlainMessage<ChatMessageDto> | undefined, b: ChatMessageDto | PlainMessage<ChatMessageDto> | undefined): boolean;
|
|
103
105
|
}
|
|
106
|
+
export declare class ChatPollOptionDto extends Message<ChatPollOptionDto> {
|
|
107
|
+
id: string;
|
|
108
|
+
text: string;
|
|
109
|
+
votes: number;
|
|
110
|
+
constructor(data?: PartialMessage<ChatPollOptionDto>);
|
|
111
|
+
static readonly runtime: typeof proto3;
|
|
112
|
+
static readonly typeName = "micro.v1.chat.ChatPollOptionDto";
|
|
113
|
+
static readonly fields: FieldList;
|
|
114
|
+
static fromBinary(bytes: Uint8Array, options?: Partial<BinaryReadOptions>): ChatPollOptionDto;
|
|
115
|
+
static fromJson(jsonValue: JsonValue, options?: Partial<JsonReadOptions>): ChatPollOptionDto;
|
|
116
|
+
static fromJsonString(jsonString: string, options?: Partial<JsonReadOptions>): ChatPollOptionDto;
|
|
117
|
+
static equals(a: ChatPollOptionDto | PlainMessage<ChatPollOptionDto> | undefined, b: ChatPollOptionDto | PlainMessage<ChatPollOptionDto> | undefined): boolean;
|
|
118
|
+
}
|
|
119
|
+
export declare class ChatPollDto extends Message<ChatPollDto> {
|
|
120
|
+
id: string;
|
|
121
|
+
question: string;
|
|
122
|
+
options: ChatPollOptionDto[];
|
|
123
|
+
totalVotes: number;
|
|
124
|
+
myOptionId: string;
|
|
125
|
+
endsAt: string;
|
|
126
|
+
closed: boolean;
|
|
127
|
+
votersVisibility: string;
|
|
128
|
+
constructor(data?: PartialMessage<ChatPollDto>);
|
|
129
|
+
static readonly runtime: typeof proto3;
|
|
130
|
+
static readonly typeName = "micro.v1.chat.ChatPollDto";
|
|
131
|
+
static readonly fields: FieldList;
|
|
132
|
+
static fromBinary(bytes: Uint8Array, options?: Partial<BinaryReadOptions>): ChatPollDto;
|
|
133
|
+
static fromJson(jsonValue: JsonValue, options?: Partial<JsonReadOptions>): ChatPollDto;
|
|
134
|
+
static fromJsonString(jsonString: string, options?: Partial<JsonReadOptions>): ChatPollDto;
|
|
135
|
+
static equals(a: ChatPollDto | PlainMessage<ChatPollDto> | undefined, b: ChatPollDto | PlainMessage<ChatPollDto> | undefined): boolean;
|
|
136
|
+
}
|
|
104
137
|
export declare class ChatReactionCountDto extends Message<ChatReactionCountDto> {
|
|
105
138
|
emoji: string;
|
|
106
139
|
count: number;
|
|
@@ -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.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.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.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.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 {
|
|
@@ -21,6 +21,7 @@ class ChatGroupDto extends protobuf_1.Message {
|
|
|
21
21
|
sortOrder = 0;
|
|
22
22
|
isActive = false;
|
|
23
23
|
systemNotices = false;
|
|
24
|
+
pollPolicy = "";
|
|
24
25
|
constructor(data) {
|
|
25
26
|
super();
|
|
26
27
|
protobuf_1.proto3.util.initPartial(data, this);
|
|
@@ -45,6 +46,7 @@ class ChatGroupDto extends protobuf_1.Message {
|
|
|
45
46
|
{ no: 15, name: "sort_order", kind: "scalar", T: 5 },
|
|
46
47
|
{ no: 16, name: "is_active", kind: "scalar", T: 8 },
|
|
47
48
|
{ no: 17, name: "system_notices", kind: "scalar", T: 8 },
|
|
49
|
+
{ no: 18, name: "poll_policy", kind: "scalar", T: 9 },
|
|
48
50
|
]);
|
|
49
51
|
static fromBinary(bytes, options) {
|
|
50
52
|
return new ChatGroupDto().fromBinary(bytes, options);
|
|
@@ -183,6 +185,7 @@ class ChatMessageDto extends protobuf_1.Message {
|
|
|
183
185
|
isDeleted = false;
|
|
184
186
|
reactions = [];
|
|
185
187
|
editedAt = "";
|
|
188
|
+
poll;
|
|
186
189
|
constructor(data) {
|
|
187
190
|
super();
|
|
188
191
|
protobuf_1.proto3.util.initPartial(data, this);
|
|
@@ -206,6 +209,7 @@ class ChatMessageDto extends protobuf_1.Message {
|
|
|
206
209
|
{ no: 14, name: "is_deleted", kind: "scalar", T: 8 },
|
|
207
210
|
{ no: 15, name: "reactions", kind: "message", T: ChatReactionCountDto, repeated: true },
|
|
208
211
|
{ no: 16, name: "edited_at", kind: "scalar", T: 9 },
|
|
212
|
+
{ no: 17, name: "poll", kind: "message", T: ChatPollDto },
|
|
209
213
|
]);
|
|
210
214
|
static fromBinary(bytes, options) {
|
|
211
215
|
return new ChatMessageDto().fromBinary(bytes, options);
|
|
@@ -221,6 +225,74 @@ class ChatMessageDto extends protobuf_1.Message {
|
|
|
221
225
|
}
|
|
222
226
|
}
|
|
223
227
|
exports.ChatMessageDto = ChatMessageDto;
|
|
228
|
+
class ChatPollOptionDto extends protobuf_1.Message {
|
|
229
|
+
id = "";
|
|
230
|
+
text = "";
|
|
231
|
+
votes = 0;
|
|
232
|
+
constructor(data) {
|
|
233
|
+
super();
|
|
234
|
+
protobuf_1.proto3.util.initPartial(data, this);
|
|
235
|
+
}
|
|
236
|
+
static runtime = protobuf_1.proto3;
|
|
237
|
+
static typeName = "micro.v1.chat.ChatPollOptionDto";
|
|
238
|
+
static fields = protobuf_1.proto3.util.newFieldList(() => [
|
|
239
|
+
{ no: 1, name: "id", kind: "scalar", T: 9 },
|
|
240
|
+
{ no: 2, name: "text", kind: "scalar", T: 9 },
|
|
241
|
+
{ no: 3, name: "votes", kind: "scalar", T: 13 },
|
|
242
|
+
]);
|
|
243
|
+
static fromBinary(bytes, options) {
|
|
244
|
+
return new ChatPollOptionDto().fromBinary(bytes, options);
|
|
245
|
+
}
|
|
246
|
+
static fromJson(jsonValue, options) {
|
|
247
|
+
return new ChatPollOptionDto().fromJson(jsonValue, options);
|
|
248
|
+
}
|
|
249
|
+
static fromJsonString(jsonString, options) {
|
|
250
|
+
return new ChatPollOptionDto().fromJsonString(jsonString, options);
|
|
251
|
+
}
|
|
252
|
+
static equals(a, b) {
|
|
253
|
+
return protobuf_1.proto3.util.equals(ChatPollOptionDto, a, b);
|
|
254
|
+
}
|
|
255
|
+
}
|
|
256
|
+
exports.ChatPollOptionDto = ChatPollOptionDto;
|
|
257
|
+
class ChatPollDto extends protobuf_1.Message {
|
|
258
|
+
id = "";
|
|
259
|
+
question = "";
|
|
260
|
+
options = [];
|
|
261
|
+
totalVotes = 0;
|
|
262
|
+
myOptionId = "";
|
|
263
|
+
endsAt = "";
|
|
264
|
+
closed = false;
|
|
265
|
+
votersVisibility = "";
|
|
266
|
+
constructor(data) {
|
|
267
|
+
super();
|
|
268
|
+
protobuf_1.proto3.util.initPartial(data, this);
|
|
269
|
+
}
|
|
270
|
+
static runtime = protobuf_1.proto3;
|
|
271
|
+
static typeName = "micro.v1.chat.ChatPollDto";
|
|
272
|
+
static fields = protobuf_1.proto3.util.newFieldList(() => [
|
|
273
|
+
{ no: 1, name: "id", kind: "scalar", T: 9 },
|
|
274
|
+
{ no: 2, name: "question", kind: "scalar", T: 9 },
|
|
275
|
+
{ no: 3, name: "options", kind: "message", T: ChatPollOptionDto, repeated: true },
|
|
276
|
+
{ no: 4, name: "total_votes", kind: "scalar", T: 13 },
|
|
277
|
+
{ no: 5, name: "my_option_id", kind: "scalar", T: 9 },
|
|
278
|
+
{ no: 6, name: "ends_at", kind: "scalar", T: 9 },
|
|
279
|
+
{ no: 7, name: "closed", kind: "scalar", T: 8 },
|
|
280
|
+
{ no: 8, name: "voters_visibility", kind: "scalar", T: 9 },
|
|
281
|
+
]);
|
|
282
|
+
static fromBinary(bytes, options) {
|
|
283
|
+
return new ChatPollDto().fromBinary(bytes, options);
|
|
284
|
+
}
|
|
285
|
+
static fromJson(jsonValue, options) {
|
|
286
|
+
return new ChatPollDto().fromJson(jsonValue, options);
|
|
287
|
+
}
|
|
288
|
+
static fromJsonString(jsonString, options) {
|
|
289
|
+
return new ChatPollDto().fromJsonString(jsonString, options);
|
|
290
|
+
}
|
|
291
|
+
static equals(a, b) {
|
|
292
|
+
return protobuf_1.proto3.util.equals(ChatPollDto, a, b);
|
|
293
|
+
}
|
|
294
|
+
}
|
|
295
|
+
exports.ChatPollDto = ChatPollDto;
|
|
224
296
|
class ChatReactionCountDto extends protobuf_1.Message {
|
|
225
297
|
emoji = "";
|
|
226
298
|
count = 0;
|
package/package.json
CHANGED
|
@@ -29,6 +29,8 @@ message ChatGroupDto {
|
|
|
29
29
|
bool is_active = 16;
|
|
30
30
|
// Per-group policy: generate sanction/join system bubbles (mods-only view).
|
|
31
31
|
bool system_notices = 17;
|
|
32
|
+
// Who may create polls: mods | everyone
|
|
33
|
+
string poll_policy = 18;
|
|
32
34
|
}
|
|
33
35
|
|
|
34
36
|
message ChatGroupListResponse {
|
|
@@ -70,6 +72,28 @@ message ChatMessageDto {
|
|
|
70
72
|
repeated ChatReactionCountDto reactions = 15;
|
|
71
73
|
// Set when the owner edited the message (15-minute window).
|
|
72
74
|
string edited_at = 16;
|
|
75
|
+
// Present only on type='poll' messages.
|
|
76
|
+
ChatPollDto poll = 17;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
// In-chat poll (rides a type='poll' message; dies with it via FK cascade).
|
|
80
|
+
message ChatPollOptionDto {
|
|
81
|
+
string id = 1;
|
|
82
|
+
string text = 2;
|
|
83
|
+
uint32 votes = 3;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
message ChatPollDto {
|
|
87
|
+
string id = 1;
|
|
88
|
+
string question = 2;
|
|
89
|
+
repeated ChatPollOptionDto options = 3;
|
|
90
|
+
uint32 total_votes = 4;
|
|
91
|
+
// Viewer's current vote (option id) or empty.
|
|
92
|
+
string my_option_id = 5;
|
|
93
|
+
string ends_at = 6;
|
|
94
|
+
bool closed = 7;
|
|
95
|
+
// everyone | mods | anonymous
|
|
96
|
+
string voters_visibility = 8;
|
|
73
97
|
}
|
|
74
98
|
|
|
75
99
|
// Aggregated reaction chip for one emoji on one message.
|