jr-common-micro 1.1.135 → 1.1.136
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.
|
@@ -252,11 +252,17 @@ export interface MessageHistoryRequest {
|
|
|
252
252
|
group_slug: string;
|
|
253
253
|
cursor: string;
|
|
254
254
|
limit: number;
|
|
255
|
+
after: string;
|
|
256
|
+
from_last_read: boolean;
|
|
257
|
+
context: number;
|
|
255
258
|
}
|
|
256
259
|
export interface MessageHistoryResponse {
|
|
257
260
|
status: ResponseStatus | undefined;
|
|
258
261
|
data: ChatMessageDto[];
|
|
259
262
|
next_cursor: string;
|
|
263
|
+
newer_cursor: string;
|
|
264
|
+
anchored: boolean;
|
|
265
|
+
anchor_id: string;
|
|
260
266
|
}
|
|
261
267
|
export interface PinnedMessagesRequest {
|
|
262
268
|
group_slug: string;
|
|
@@ -493,6 +493,9 @@ export declare class MessageHistoryRequest extends Message<MessageHistoryRequest
|
|
|
493
493
|
groupSlug: string;
|
|
494
494
|
cursor: string;
|
|
495
495
|
limit: number;
|
|
496
|
+
after: string;
|
|
497
|
+
fromLastRead: boolean;
|
|
498
|
+
context: number;
|
|
496
499
|
constructor(data?: PartialMessage<MessageHistoryRequest>);
|
|
497
500
|
static readonly runtime: typeof proto3;
|
|
498
501
|
static readonly typeName = "micro.v1.chat.MessageHistoryRequest";
|
|
@@ -506,6 +509,9 @@ export declare class MessageHistoryResponse extends Message<MessageHistoryRespon
|
|
|
506
509
|
status?: ResponseStatus;
|
|
507
510
|
data: ChatMessageDto[];
|
|
508
511
|
nextCursor: string;
|
|
512
|
+
newerCursor: string;
|
|
513
|
+
anchored: boolean;
|
|
514
|
+
anchorId: string;
|
|
509
515
|
constructor(data?: PartialMessage<MessageHistoryResponse>);
|
|
510
516
|
static readonly runtime: typeof proto3;
|
|
511
517
|
static readonly typeName = "micro.v1.chat.MessageHistoryResponse";
|
|
@@ -1074,6 +1074,9 @@ class MessageHistoryRequest extends protobuf_1.Message {
|
|
|
1074
1074
|
groupSlug = "";
|
|
1075
1075
|
cursor = "";
|
|
1076
1076
|
limit = 0;
|
|
1077
|
+
after = "";
|
|
1078
|
+
fromLastRead = false;
|
|
1079
|
+
context = 0;
|
|
1077
1080
|
constructor(data) {
|
|
1078
1081
|
super();
|
|
1079
1082
|
protobuf_1.proto3.util.initPartial(data, this);
|
|
@@ -1084,6 +1087,9 @@ class MessageHistoryRequest extends protobuf_1.Message {
|
|
|
1084
1087
|
{ no: 1, name: "group_slug", kind: "scalar", T: 9 },
|
|
1085
1088
|
{ no: 2, name: "cursor", kind: "scalar", T: 9 },
|
|
1086
1089
|
{ no: 3, name: "limit", kind: "scalar", T: 5 },
|
|
1090
|
+
{ no: 4, name: "after", kind: "scalar", T: 9 },
|
|
1091
|
+
{ no: 5, name: "from_last_read", kind: "scalar", T: 8 },
|
|
1092
|
+
{ no: 6, name: "context", kind: "scalar", T: 5 },
|
|
1087
1093
|
]);
|
|
1088
1094
|
static fromBinary(bytes, options) {
|
|
1089
1095
|
return new MessageHistoryRequest().fromBinary(bytes, options);
|
|
@@ -1103,6 +1109,9 @@ class MessageHistoryResponse extends protobuf_1.Message {
|
|
|
1103
1109
|
status;
|
|
1104
1110
|
data = [];
|
|
1105
1111
|
nextCursor = "";
|
|
1112
|
+
newerCursor = "";
|
|
1113
|
+
anchored = false;
|
|
1114
|
+
anchorId = "";
|
|
1106
1115
|
constructor(data) {
|
|
1107
1116
|
super();
|
|
1108
1117
|
protobuf_1.proto3.util.initPartial(data, this);
|
|
@@ -1113,6 +1122,9 @@ class MessageHistoryResponse extends protobuf_1.Message {
|
|
|
1113
1122
|
{ no: 1, name: "status", kind: "message", T: general_pb_js_1.ResponseStatus },
|
|
1114
1123
|
{ no: 2, name: "data", kind: "message", T: ChatMessageDto, repeated: true },
|
|
1115
1124
|
{ no: 3, name: "next_cursor", kind: "scalar", T: 9 },
|
|
1125
|
+
{ no: 4, name: "newer_cursor", kind: "scalar", T: 9 },
|
|
1126
|
+
{ no: 5, name: "anchored", kind: "scalar", T: 8 },
|
|
1127
|
+
{ no: 6, name: "anchor_id", kind: "scalar", T: 9 },
|
|
1116
1128
|
]);
|
|
1117
1129
|
static fromBinary(bytes, options) {
|
|
1118
1130
|
return new MessageHistoryResponse().fromBinary(bytes, options);
|
package/package.json
CHANGED
|
@@ -395,6 +395,19 @@ message MessageHistoryRequest {
|
|
|
395
395
|
// Return messages with id < cursor (0 or empty = newest page).
|
|
396
396
|
string cursor = 2;
|
|
397
397
|
int32 limit = 3;
|
|
398
|
+
// Anchored read (a window in the middle of the history, Telegram style):
|
|
399
|
+
// up to `limit` messages with id > after, plus `context` messages at or
|
|
400
|
+
// before it. cursor is ignored. Pages are still returned newest first.
|
|
401
|
+
// Empty = the plain newest/older read above.
|
|
402
|
+
string after = 4;
|
|
403
|
+
// Anchor at the reader's own read cursor, resolved on the server, so a room
|
|
404
|
+
// opens at its first unread message in one request. Ignored when after is
|
|
405
|
+
// set. A reader with no read cursor gets the newest page.
|
|
406
|
+
bool from_last_read = 5;
|
|
407
|
+
// Messages at or before the anchor to include above the window (0-50), for
|
|
408
|
+
// the read that opens the room: the server tops it up to `limit` when there
|
|
409
|
+
// is little or nothing newer. 0 = the window only (reads further down).
|
|
410
|
+
int32 context = 6;
|
|
398
411
|
}
|
|
399
412
|
|
|
400
413
|
message MessageHistoryResponse {
|
|
@@ -402,6 +415,16 @@ message MessageHistoryResponse {
|
|
|
402
415
|
repeated ChatMessageDto data = 2;
|
|
403
416
|
// Cursor for the next (older) page; empty = no more.
|
|
404
417
|
string next_cursor = 3;
|
|
418
|
+
// Anchored reads only: the `after` for the next page further down; empty =
|
|
419
|
+
// this page reaches the newest message.
|
|
420
|
+
string newer_cursor = 4;
|
|
421
|
+
// True when the server honoured after/from_last_read. A server without
|
|
422
|
+
// anchored reads leaves it false and returns the plain newest page, so a
|
|
423
|
+
// client can tell the two apart.
|
|
424
|
+
bool anchored = 5;
|
|
425
|
+
// The anchor actually used (the reader's read cursor for from_last_read);
|
|
426
|
+
// empty = none (never read: the newest page was returned).
|
|
427
|
+
string anchor_id = 6;
|
|
405
428
|
}
|
|
406
429
|
|
|
407
430
|
message PinnedMessagesRequest { string group_slug = 1; }
|