@myronsi/messenger-api 2.1.0-alpha.57.next.200 → 2.1.0-alpha.58
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.
- package/CHANGELOG.md +8 -0
- package/dist/index.d.ts +2 -2
- package/dist/index.js +1 -1
- package/dist/openapi.yaml +27 -1
- package/dist/schema.d.ts +19 -1
- package/dist/ws-docs.json +24 -1
- package/dist/ws-events.d.ts +48 -1
- package/dist/ws-events.schema.json +101 -0
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,14 @@
|
|
|
2
2
|
|
|
3
3
|
Contract changes only. The backend changelog is `CHANGELOG.md` in the repository root. Rules: `docs/api-compatibility.md`.
|
|
4
4
|
|
|
5
|
+
## 2.1.0-alpha.58
|
|
6
|
+
|
|
7
|
+
- Channel post stats: `Message` gains `view_count` and `reaction_counts` (`ReactionCount`: `emoji`, `count`), both
|
|
8
|
+
`null` outside channels. In a channel `reactions` lists only the caller's own reactions, and `reaction_add` /
|
|
9
|
+
`reaction_remove` go only to the reacting user's own sessions.
|
|
10
|
+
- New server event `post_stats`: merged view and reaction counts of channel posts, at most one per post every 10 s,
|
|
11
|
+
to the subscribers who are online.
|
|
12
|
+
|
|
5
13
|
## 2.1.0-alpha.57
|
|
6
14
|
|
|
7
15
|
- Channels: `GroupMode` (`group`, `channel`). `CreateGroupRequest` gains `mode`; `Chat` gains `group_mode` (`null` for
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* Generated from api/openapi.yaml 2.1.0-alpha.
|
|
2
|
-
export declare const API_VERSION: "2.1.0-alpha.
|
|
1
|
+
/* Generated from api/openapi.yaml 2.1.0-alpha.58. Do not edit. */
|
|
2
|
+
export declare const API_VERSION: "2.1.0-alpha.58";
|
|
3
3
|
export type { paths, components, operations } from "./schema.js";
|
|
4
4
|
export * from "./ws-events.js";
|
package/dist/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const API_VERSION = "2.1.0-alpha.
|
|
1
|
+
export const API_VERSION = "2.1.0-alpha.58";
|
package/dist/openapi.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
openapi: 3.1.0
|
|
2
2
|
info:
|
|
3
3
|
title: Messenger API
|
|
4
|
-
version: 2.1.0-alpha.
|
|
4
|
+
version: 2.1.0-alpha.58
|
|
5
5
|
summary: REST contract of the Messenger backend (v2).
|
|
6
6
|
description: |
|
|
7
7
|
Contract for the Go backend. The WebSocket protocol is described in `websocket/` and
|
|
@@ -8658,6 +8658,15 @@ components:
|
|
|
8658
8658
|
maxLength: 32
|
|
8659
8659
|
description: A Unicode emoji, or `c:<id>` for a custom emoji (`GET /emoji/items/{id}/image`).
|
|
8660
8660
|
user_id: { $ref: "#/components/schemas/Id" }
|
|
8661
|
+
ReactionCount:
|
|
8662
|
+
type: object
|
|
8663
|
+
required: [emoji, count]
|
|
8664
|
+
properties:
|
|
8665
|
+
emoji:
|
|
8666
|
+
type: string
|
|
8667
|
+
minLength: 1
|
|
8668
|
+
maxLength: 32
|
|
8669
|
+
count: { type: integer, minimum: 1 }
|
|
8661
8670
|
ReadReceipt:
|
|
8662
8671
|
type: object
|
|
8663
8672
|
required: [user_id, read_at]
|
|
@@ -8808,7 +8817,24 @@ components:
|
|
|
8808
8817
|
items: { $ref: "#/components/schemas/Attachment" }
|
|
8809
8818
|
reactions:
|
|
8810
8819
|
type: array
|
|
8820
|
+
description: |
|
|
8821
|
+
One item per user and emoji. In a channel only the caller's own reactions; `reaction_counts` has the
|
|
8822
|
+
totals.
|
|
8811
8823
|
items: { $ref: "#/components/schemas/Reaction" }
|
|
8824
|
+
reaction_counts:
|
|
8825
|
+
description: |
|
|
8826
|
+
Channels only (`null` elsewhere): how many subscribers reacted with each emoji, most first. Nobody sees
|
|
8827
|
+
who reacted. `post_stats` events update it.
|
|
8828
|
+
oneOf:
|
|
8829
|
+
- type: array
|
|
8830
|
+
items: { $ref: "#/components/schemas/ReactionCount" }
|
|
8831
|
+
- type: "null"
|
|
8832
|
+
view_count:
|
|
8833
|
+
description: |
|
|
8834
|
+
Channels only (`null` elsewhere): how many subscribers have read up to this post at least once; the
|
|
8835
|
+
author's own reads do not count. `post_stats` events update it.
|
|
8836
|
+
type: [integer, "null"]
|
|
8837
|
+
minimum: 0
|
|
8812
8838
|
read_by:
|
|
8813
8839
|
type: array
|
|
8814
8840
|
items: { $ref: "#/components/schemas/ReadReceipt" }
|
package/dist/schema.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* Generated from api/openapi.yaml 2.1.0-alpha.
|
|
1
|
+
/* Generated from api/openapi.yaml 2.1.0-alpha.58. Do not edit. */
|
|
2
2
|
export interface paths {
|
|
3
3
|
"/meta": {
|
|
4
4
|
parameters: {
|
|
@@ -6420,6 +6420,10 @@ export interface components {
|
|
|
6420
6420
|
emoji: string;
|
|
6421
6421
|
user_id: components["schemas"]["Id"];
|
|
6422
6422
|
};
|
|
6423
|
+
ReactionCount: {
|
|
6424
|
+
emoji: string;
|
|
6425
|
+
count: number;
|
|
6426
|
+
};
|
|
6423
6427
|
ReadReceipt: {
|
|
6424
6428
|
user_id: components["schemas"]["Id"];
|
|
6425
6429
|
read_at: components["schemas"]["Timestamp"];
|
|
@@ -6503,7 +6507,21 @@ export interface components {
|
|
|
6503
6507
|
sticker?: components["schemas"]["Sticker"];
|
|
6504
6508
|
/** @description Ordered images and videos of an album. The first item is also returned as attachment for older clients. */
|
|
6505
6509
|
attachments?: components["schemas"]["Attachment"][];
|
|
6510
|
+
/**
|
|
6511
|
+
* @description One item per user and emoji. In a channel only the caller's own reactions; `reaction_counts` has the
|
|
6512
|
+
* totals.
|
|
6513
|
+
*/
|
|
6506
6514
|
reactions: components["schemas"]["Reaction"][];
|
|
6515
|
+
/**
|
|
6516
|
+
* @description Channels only (`null` elsewhere): how many subscribers reacted with each emoji, most first. Nobody sees
|
|
6517
|
+
* who reacted. `post_stats` events update it.
|
|
6518
|
+
*/
|
|
6519
|
+
reaction_counts?: components["schemas"]["ReactionCount"][] | null;
|
|
6520
|
+
/**
|
|
6521
|
+
* @description Channels only (`null` elsewhere): how many subscribers have read up to this post at least once; the
|
|
6522
|
+
* author's own reads do not count. `post_stats` events update it.
|
|
6523
|
+
*/
|
|
6524
|
+
view_count?: number | null;
|
|
6507
6525
|
read_by: components["schemas"]["ReadReceipt"][];
|
|
6508
6526
|
/** @description When the message was sent; for an imported message, when it was sent in the other messenger. */
|
|
6509
6527
|
created_at: components["schemas"]["Timestamp"];
|
package/dist/ws-docs.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"markdown": "# WebSocket protocol (API contract v2)\
|
|
2
|
+
"markdown": "# WebSocket protocol (API contract v2)\n\n\n\nThe JSON Schemas in `websocket/client/` (client → server) and `websocket/server/` (server → client) are the source of truth. Every event has an example in `websocket/examples/`, validated against its schema by `npm run check`. TypeScript types are generated into `dist/ws-events.d.ts` (`ClientEvent`, `ServerEvent`).\n\n\n\n## Connecting\n\n\n\n1. `POST /api/v2/ws/ticket` (authenticated) returns `{ \"ticket\": \"…\", \"expires_in\": 30 }`. The ticket is single-use and short-lived, so no access token ends up in a URL or a log.\n\n2. Open **one connection per browser tab**: `wss://<host>/api/v2/ws?ticket=<ticket>&api_version=<contract version>`. The connection carries the events of all chats of the user. `api_version` is optional and takes the place of the `X-Client-Api-Version` header, which browsers cannot send on a WebSocket.\n\n3. The first server event is `hello` with `api_version` and `min_client_api_version`. A client that reconnects after a deploy compares them with the contract version it was built for and shows an upgrade notice instead of failing at random.\n\n4. When the ticket is invalid or expired the server closes the connection with code `4401`. A client whose `api_version` is no longer served is closed with `4426` after `hello`.\n\n\n\n## Close codes\n\n\n\n| Code | Meaning | Client |\n\n| --- | --- | --- |\n\n| `1012` | `reconnect`: the server is restarting, or it lost its pub/sub connection and events may be missing | reconnect with backoff, then load what was missed (`after` cursor) |\n\n| `1013` | the client did not keep up with its events, or sent more than 64 events that are not handled yet | reconnect, then catch up |\n\n| `4401` | invalid ticket, or the session ended (logout, revoked, password changed) | get a new ticket; if that fails, sign in again |\n\n| `4426` | the client's contract version is no longer served | show the upgrade notice |\n\n| `4429` | the user opened more than 10 connections on this server; the oldest one is closed | do not reconnect this tab automatically |\n\n\n\n## Envelope\n\n\n\nServer → client:\n\n\n\n```json\n\n{ \"type\": \"message\", \"event_id\": \"7217400317439950849\", \"chat_id\": \"42\", \"data\": { \"message\": { \"…\": \"…\" } } }\n\n```\n\n\n\nClient → server:\n\n\n\n```json\n\n{ \"type\": \"message\", \"client_temp_id\": \"c-1\", \"chat_id\": \"42\", \"data\": { \"type\": \"text\", \"content\": \"Hello!\" } }\n\n```\n\n\n\n- All IDs are strings (Snowflake IDs do not fit into a JavaScript number).\n\n- `event_id` is unique and increases per server; it is only for deduplication and logs.\n\n- `chat_id` is always `null` in `hello`, `presence` and `approval_request_created`, which do not belong to a chat. `ack` and `error` repeat the `chat_id` of the client event they answer, and it is `null` for connection-level errors.\n\n- Unknown event `type`s must be ignored by clients, so new event types are not a breaking change.\n\n- A user who is removed from a chat (or whose chat is deleted) receives `chat_deleted` and no further events of that chat.\n\n\n\n## Acknowledgements\n\n\n\nEvery client event except `typing` (which is not acknowledged and carries no `client_temp_id`) has a `client_temp_id` (1–64 characters, unique per client). The server answers with exactly one of:\n\n\n\n- `ack` — `client_temp_id`, and for `message` the stored `message_id` and `created_at`. Sending the same `client_temp_id` again returns the same `ack` (idempotent), which makes retries after a reconnect safe.\n\n- `error` — `client_temp_id` and `data.code`/`data.message`, and `data.field` when one setting or field caused it (for example `voice_video_messages`). `code` is one of the stable codes of `ErrorCode` in `openapi.yaml` (the same codes as the REST `application/problem+json` errors).\n\n\n\nThe sender also receives the broadcast `message` event with the stored message (its `client_temp_id` is included, so the client can replace its pending copy).\n\n\n\n## Client → server events\n\n\n\n| Type | Purpose |\n\n| --- | --- |\n\n| `message` | Send a message (`type` `text`, `file` or `voice`; files are referenced by `attachment_id`, never by URL) |\n\n| `resend` | Deliver a stored but undelivered message again |\n\n| `edit` | Edit your own text message |\n\n| `delete` | Delete a message for yourself (`scope: me`) or everyone |\n\n| `read` | Mark messages as read up to `message_id` |\n\n| `reaction_add`, `reaction_remove` | Add or remove a reaction |\n\n| `typing` | Typing, recording a voice message, choosing a sticker or sending a photo, video or file (`action`, not acknowledged). Repeat `is_typing: true` every 3 s while it lasts, send `false` when it ends |\n\n\n\n## Server → client events\n\n\n\n| Type | Meaning |\n\n| --- | --- |\n\n| `hello` | First event: `api_version`, `min_client_api_version`, `user_id` |\n\n| `ack`, `error` | Result of a client event, references `client_temp_id` |\n\n| `message`, `edit`, `delete` | Message created, edited or deleted; `delete` with `removed_by_moderation` when moderation removed it (the sender's copy also carries `moderation_reason`) |\n\n| `reaction_add`, `reaction_remove` | Reactions changed (in a channel only to the reacting user's own sessions) |\n| `post_stats` | Channels: merged `view_count` and `reaction_counts` of posts, at most one per post every 10 s, to online subscribers |\n\n| `read` | A user read up to `message_id` |\n\n| `typing` | A user is typing, recording a voice message, choosing a sticker or sending a photo, video or file (`action`); hide it after 6 s without a repeat |\n\n| `chat_created`, `chat_deleted`, `chat_list_update` | Chat list changes |\n| `history_cleared` | Messages up to `before_message_id` were cleared for you (`scope: me`) or everyone |\n\n| `pin_update` | A message was pinned or unpinned for everyone (to all members) or only for you (`scope: me`, to your own sessions); carries `pinned_message_count` for you |\n\n| `poll_updated` | A vote changed or a poll closed; carries the whole `Poll` as you see it (results only once you voted, for the creator, or after closing). Keep the highest `version` |\n\n| `import_update` | An imported history of the chat started, finished or is being removed (to all members); reload the chat on `done` and `removing` |\n| `import_sender_update` | A name of an imported history was suggested for a member, declined, confirmed or withdrawn; suggestions and declines go only to the importer and that member |\n| `group_created`, `group_updated` | Group changes (members, roles, name, avatar) |\n\n| `approval_request_created` | New request in the inbox |\n\n| `presence` | A user came online or went offline |\n| `account_status` | Your account status changed (`AccountStatus`); only your own sessions get it |\n\n| `report_outcome` | The moderation team reviewed something you reported (`ReportOutcome`); only your own sessions get it |\n| `client_settings_updated` | Your synced appearance or recent emoji changed (`ClientSettings`); only your own sessions get it |\n| `wallpaper_updated` | One of your chat backgrounds changed or was removed (`WallpaperUpdatedEvent`); only your own sessions get it |\n| `playlists_updated` | One of your playlists was created, changed or deleted (`PlaylistsUpdatedEvent`); only your own sessions get it |\n\n| `user_updated` | A user you share a chat with changed their profile (`profile_version`) |\n| `attachment_updated` | An optimized copy of an attachment you can see is ready (or failed): replace it in your messages |\n| `call_updated` | A call of the chat changed (state, participants, epoch); carries the whole call, keep the highest `version` |\n| `call_keys` | Sealed call sender keys for this session only (`docs/calls-e2ee.md`) |\n\n\n\n## Compatibility\n\n\n\nAdding an event type or an optional field is a MINOR change; removing or renaming an event or field, or making a field required, is MAJOR (see `docs/api-compatibility.md`). Clients must ignore unknown events and unknown fields.\n\n",
|
|
3
3
|
"examples": {
|
|
4
4
|
"client/delete.json": {
|
|
5
5
|
"type": "delete",
|
|
@@ -669,6 +669,29 @@
|
|
|
669
669
|
}
|
|
670
670
|
}
|
|
671
671
|
},
|
|
672
|
+
"server/post_stats.json": {
|
|
673
|
+
"type": "post_stats",
|
|
674
|
+
"event_id": "7217400317439950021",
|
|
675
|
+
"chat_id": "42",
|
|
676
|
+
"data": {
|
|
677
|
+
"items": [
|
|
678
|
+
{
|
|
679
|
+
"message_id": "7217400317439950002",
|
|
680
|
+
"view_count": 1284,
|
|
681
|
+
"reaction_counts": [
|
|
682
|
+
{
|
|
683
|
+
"emoji": "👍",
|
|
684
|
+
"count": 57
|
|
685
|
+
},
|
|
686
|
+
{
|
|
687
|
+
"emoji": "🔥",
|
|
688
|
+
"count": 12
|
|
689
|
+
}
|
|
690
|
+
]
|
|
691
|
+
}
|
|
692
|
+
]
|
|
693
|
+
}
|
|
694
|
+
},
|
|
672
695
|
"server/presence.json": {
|
|
673
696
|
"type": "presence",
|
|
674
697
|
"event_id": "7217400317439950009",
|
package/dist/ws-events.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* Generated from api/openapi.yaml 2.1.0-alpha.
|
|
1
|
+
/* Generated from api/openapi.yaml 2.1.0-alpha.58. Do not edit. */
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* Any WebSocket event, in either direction.
|
|
@@ -55,6 +55,7 @@ export type ServerEvent =
|
|
|
55
55
|
| ServerPinUpdateEvent
|
|
56
56
|
| ServerPlaylistsUpdatedEvent
|
|
57
57
|
| ServerPollUpdatedEvent
|
|
58
|
+
| ServerPostStatsEvent
|
|
58
59
|
| ServerPresenceEvent
|
|
59
60
|
| ServerReactionAddEvent
|
|
60
61
|
| ServerReactionRemoveEvent
|
|
@@ -885,7 +886,24 @@ export interface Message {
|
|
|
885
886
|
Attachment,
|
|
886
887
|
Attachment
|
|
887
888
|
];
|
|
889
|
+
/**
|
|
890
|
+
* One item per user and emoji. In a channel only the caller's own reactions; `reaction_counts` has the
|
|
891
|
+
* totals.
|
|
892
|
+
*
|
|
893
|
+
*/
|
|
888
894
|
reactions: Reaction[];
|
|
895
|
+
/**
|
|
896
|
+
* Channels only (`null` elsewhere): how many subscribers reacted with each emoji, most first. Nobody sees
|
|
897
|
+
* who reacted. `post_stats` events update it.
|
|
898
|
+
*
|
|
899
|
+
*/
|
|
900
|
+
reaction_counts?: ReactionCount[] | null;
|
|
901
|
+
/**
|
|
902
|
+
* Channels only (`null` elsewhere): how many subscribers have read up to this post at least once; the
|
|
903
|
+
* author's own reads do not count. `post_stats` events update it.
|
|
904
|
+
*
|
|
905
|
+
*/
|
|
906
|
+
view_count?: number | null;
|
|
889
907
|
read_by: ReadReceipt[];
|
|
890
908
|
/**
|
|
891
909
|
* When the message was sent; for an imported message, when it was sent in the other messenger.
|
|
@@ -1003,6 +1021,10 @@ export interface Reaction {
|
|
|
1003
1021
|
emoji: string;
|
|
1004
1022
|
user_id: Id;
|
|
1005
1023
|
}
|
|
1024
|
+
export interface ReactionCount {
|
|
1025
|
+
emoji: string;
|
|
1026
|
+
count: number;
|
|
1027
|
+
}
|
|
1006
1028
|
export interface ReadReceipt {
|
|
1007
1029
|
user_id: Id;
|
|
1008
1030
|
read_at: Timestamp;
|
|
@@ -1530,6 +1552,31 @@ export interface Poll1 {
|
|
|
1530
1552
|
*/
|
|
1531
1553
|
version: number;
|
|
1532
1554
|
}
|
|
1555
|
+
/**
|
|
1556
|
+
* View and reaction counts of channel posts changed. Merged: at most one update per post every 10 s, sent to the subscribers who are online. Replace Message.view_count and Message.reaction_counts of the posts listed.
|
|
1557
|
+
*/
|
|
1558
|
+
export interface ServerPostStatsEvent {
|
|
1559
|
+
type: "post_stats";
|
|
1560
|
+
event_id: Id;
|
|
1561
|
+
chat_id: Id;
|
|
1562
|
+
data: {
|
|
1563
|
+
/**
|
|
1564
|
+
* @minItems 1
|
|
1565
|
+
*/
|
|
1566
|
+
items: [
|
|
1567
|
+
{
|
|
1568
|
+
message_id: Id;
|
|
1569
|
+
view_count: number;
|
|
1570
|
+
reaction_counts: ReactionCount[];
|
|
1571
|
+
},
|
|
1572
|
+
...{
|
|
1573
|
+
message_id: Id;
|
|
1574
|
+
view_count: number;
|
|
1575
|
+
reaction_counts: ReactionCount[];
|
|
1576
|
+
}[]
|
|
1577
|
+
];
|
|
1578
|
+
};
|
|
1579
|
+
}
|
|
1533
1580
|
/**
|
|
1534
1581
|
* A user came online or went offline, as far as their privacy settings allow.
|
|
1535
1582
|
*/
|
|
@@ -3433,6 +3433,24 @@
|
|
|
3433
3433
|
}
|
|
3434
3434
|
}
|
|
3435
3435
|
},
|
|
3436
|
+
"ReactionCount": {
|
|
3437
|
+
"type": "object",
|
|
3438
|
+
"required": [
|
|
3439
|
+
"emoji",
|
|
3440
|
+
"count"
|
|
3441
|
+
],
|
|
3442
|
+
"properties": {
|
|
3443
|
+
"emoji": {
|
|
3444
|
+
"type": "string",
|
|
3445
|
+
"minLength": 1,
|
|
3446
|
+
"maxLength": 32
|
|
3447
|
+
},
|
|
3448
|
+
"count": {
|
|
3449
|
+
"type": "integer",
|
|
3450
|
+
"minimum": 1
|
|
3451
|
+
}
|
|
3452
|
+
}
|
|
3453
|
+
},
|
|
3436
3454
|
"ReadReceipt": {
|
|
3437
3455
|
"type": "object",
|
|
3438
3456
|
"required": [
|
|
@@ -3713,10 +3731,33 @@
|
|
|
3713
3731
|
},
|
|
3714
3732
|
"reactions": {
|
|
3715
3733
|
"type": "array",
|
|
3734
|
+
"description": "One item per user and emoji. In a channel only the caller's own reactions; `reaction_counts` has the\ntotals.\n",
|
|
3716
3735
|
"items": {
|
|
3717
3736
|
"$ref": "#/$defs/Reaction"
|
|
3718
3737
|
}
|
|
3719
3738
|
},
|
|
3739
|
+
"reaction_counts": {
|
|
3740
|
+
"description": "Channels only (`null` elsewhere): how many subscribers reacted with each emoji, most first. Nobody sees\nwho reacted. `post_stats` events update it.\n",
|
|
3741
|
+
"oneOf": [
|
|
3742
|
+
{
|
|
3743
|
+
"type": "array",
|
|
3744
|
+
"items": {
|
|
3745
|
+
"$ref": "#/$defs/ReactionCount"
|
|
3746
|
+
}
|
|
3747
|
+
},
|
|
3748
|
+
{
|
|
3749
|
+
"type": "null"
|
|
3750
|
+
}
|
|
3751
|
+
]
|
|
3752
|
+
},
|
|
3753
|
+
"view_count": {
|
|
3754
|
+
"description": "Channels only (`null` elsewhere): how many subscribers have read up to this post at least once; the\nauthor's own reads do not count. `post_stats` events update it.\n",
|
|
3755
|
+
"type": [
|
|
3756
|
+
"integer",
|
|
3757
|
+
"null"
|
|
3758
|
+
],
|
|
3759
|
+
"minimum": 0
|
|
3760
|
+
},
|
|
3720
3761
|
"read_by": {
|
|
3721
3762
|
"type": "array",
|
|
3722
3763
|
"items": {
|
|
@@ -8663,6 +8704,63 @@
|
|
|
8663
8704
|
"data"
|
|
8664
8705
|
]
|
|
8665
8706
|
},
|
|
8707
|
+
"ServerPostStatsEvent": {
|
|
8708
|
+
"title": "ServerPostStatsEvent",
|
|
8709
|
+
"description": "View and reaction counts of channel posts changed. Merged: at most one update per post every 10 s, sent to the subscribers who are online. Replace Message.view_count and Message.reaction_counts of the posts listed.",
|
|
8710
|
+
"type": "object",
|
|
8711
|
+
"properties": {
|
|
8712
|
+
"type": {
|
|
8713
|
+
"const": "post_stats"
|
|
8714
|
+
},
|
|
8715
|
+
"event_id": {
|
|
8716
|
+
"$ref": "#/$defs/Id"
|
|
8717
|
+
},
|
|
8718
|
+
"chat_id": {
|
|
8719
|
+
"$ref": "#/$defs/Id"
|
|
8720
|
+
},
|
|
8721
|
+
"data": {
|
|
8722
|
+
"type": "object",
|
|
8723
|
+
"properties": {
|
|
8724
|
+
"items": {
|
|
8725
|
+
"type": "array",
|
|
8726
|
+
"minItems": 1,
|
|
8727
|
+
"items": {
|
|
8728
|
+
"type": "object",
|
|
8729
|
+
"properties": {
|
|
8730
|
+
"message_id": {
|
|
8731
|
+
"$ref": "#/$defs/Id"
|
|
8732
|
+
},
|
|
8733
|
+
"view_count": {
|
|
8734
|
+
"type": "integer",
|
|
8735
|
+
"minimum": 0
|
|
8736
|
+
},
|
|
8737
|
+
"reaction_counts": {
|
|
8738
|
+
"type": "array",
|
|
8739
|
+
"items": {
|
|
8740
|
+
"$ref": "#/$defs/ReactionCount"
|
|
8741
|
+
}
|
|
8742
|
+
}
|
|
8743
|
+
},
|
|
8744
|
+
"required": [
|
|
8745
|
+
"message_id",
|
|
8746
|
+
"view_count",
|
|
8747
|
+
"reaction_counts"
|
|
8748
|
+
]
|
|
8749
|
+
}
|
|
8750
|
+
}
|
|
8751
|
+
},
|
|
8752
|
+
"required": [
|
|
8753
|
+
"items"
|
|
8754
|
+
]
|
|
8755
|
+
}
|
|
8756
|
+
},
|
|
8757
|
+
"required": [
|
|
8758
|
+
"type",
|
|
8759
|
+
"event_id",
|
|
8760
|
+
"chat_id",
|
|
8761
|
+
"data"
|
|
8762
|
+
]
|
|
8763
|
+
},
|
|
8666
8764
|
"ServerPresenceEvent": {
|
|
8667
8765
|
"title": "ServerPresenceEvent",
|
|
8668
8766
|
"description": "A user came online or went offline, as far as their privacy settings allow.",
|
|
@@ -9258,6 +9356,9 @@
|
|
|
9258
9356
|
{
|
|
9259
9357
|
"$ref": "#/$defs/ServerPollUpdatedEvent"
|
|
9260
9358
|
},
|
|
9359
|
+
{
|
|
9360
|
+
"$ref": "#/$defs/ServerPostStatsEvent"
|
|
9361
|
+
},
|
|
9261
9362
|
{
|
|
9262
9363
|
"$ref": "#/$defs/ServerPresenceEvent"
|
|
9263
9364
|
},
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@myronsi/messenger-api",
|
|
3
|
-
"version": "2.1.0-alpha.
|
|
3
|
+
"version": "2.1.0-alpha.58",
|
|
4
4
|
"description": "API contract of the Messenger backend: OpenAPI document, WebSocket event schemas and generated TypeScript types",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|