@myronsi/messenger-api 2.1.0-alpha.63.next.212 → 2.1.0-alpha.65

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 CHANGED
@@ -2,6 +2,20 @@
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.65
6
+
7
+ - Channel poll votes as counts (O8): a vote in a channel sends `poll_updated` only to the voter's own sessions. The
8
+ other subscribers get the new WebSocket event `poll_counts` (`message_id`, `version`, `total_voters`,
9
+ `option_counts`), merged every 10 s and sent to online subscribers who see the results. Closing a poll still sends
10
+ `poll_updated` to everyone.
11
+
12
+ ## 2.1.0-alpha.64
13
+
14
+ - Staff actions on channels: `Group` gains `sensitive_by_staff`, `suspended` and `public_name_locked`. A suspended
15
+ channel refuses posts, edits and comments with `403` and is not found by name, link, search or preview; a channel
16
+ whose public name moderation removed gets `403` when it sets a new one. `PublicGroup.sensitive` also covers the
17
+ staff mark.
18
+
5
19
  ## 2.1.0-alpha.63
6
20
 
7
21
  - Read a public channel before subscribing (C6): `GET /public-groups/{public_name}/posts` returns its newest 50 posts
package/dist/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- /* Generated from api/openapi.yaml 2.1.0-alpha.63. Do not edit. */
2
- export declare const API_VERSION: "2.1.0-alpha.63";
1
+ /* Generated from api/openapi.yaml 2.1.0-alpha.65. Do not edit. */
2
+ export declare const API_VERSION: "2.1.0-alpha.65";
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.63";
1
+ export const API_VERSION = "2.1.0-alpha.65";
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.63
4
+ version: 2.1.0-alpha.65
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
@@ -3737,7 +3737,8 @@ paths:
3737
3737
  Owner and admins only. A public group can be found in `GET /public-groups` and joined by anyone through
3738
3738
  `/@name`, unless banned. The name shares one name space with usernames, ignoring case: a name in use is
3739
3739
  `409` `already_exists`, a reserved name `422`. The old name is free at once. Accounts at `limited` or above
3740
- get `403` `account_restricted` (`share_group`).
3740
+ get `403` `account_restricted` (`share_group`). A channel whose public name moderation removed
3741
+ (`public_name_locked`) gets `403`.
3741
3742
  requestBody:
3742
3743
  required: true
3743
3744
  content:
@@ -10024,10 +10025,21 @@ components:
10024
10025
  description: Channels only - posts carry the author's name (`Message.signature`); off shows posts as the channel. Owner and admins change it.
10025
10026
  sensitive:
10026
10027
  type: boolean
10027
- description: Channels only - 18+ content. Set by the owner (staff can set it too); apps label the channel 18+.
10028
+ description: Channels only - the owner's 18+ setting. Apps label the channel 18+ when this or `sensitive_by_staff` is true.
10028
10029
  recommendable:
10029
10030
  type: boolean
10030
10031
  description: Channels only - whether the channel may be recommended to people who do not follow it. On by default; only the owner changes it.
10032
+ sensitive_by_staff:
10033
+ type: boolean
10034
+ description: Channels only - moderation marked the channel 18+. The owner cannot turn it off.
10035
+ suspended:
10036
+ type: boolean
10037
+ description: |
10038
+ Channels only - moderation suspended the channel. Members still read it, but nobody posts, edits or
10039
+ comments (`403`), nobody joins, and it is not found by public name, invite link, search or preview.
10040
+ public_name_locked:
10041
+ type: boolean
10042
+ description: Channels only - moderation removed the public name; setting a new one is `403` until moderation allows it again.
10031
10043
  notify_comments:
10032
10044
  type: boolean
10033
10045
  description: Channels only - whether the caller gets a push for every new comment on their own posts.
@@ -10193,7 +10205,7 @@ components:
10193
10205
  group_mode: { $ref: "#/components/schemas/GroupMode" }
10194
10206
  sensitive:
10195
10207
  type: boolean
10196
- description: Channels only - 18+ content; apps show an 18+ label.
10208
+ description: Channels only - 18+ content, set by the owner or by moderation; apps show an 18+ label.
10197
10209
  public_name:
10198
10210
  description: Set for a public group.
10199
10211
  oneOf:
package/dist/schema.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- /* Generated from api/openapi.yaml 2.1.0-alpha.63. Do not edit. */
1
+ /* Generated from api/openapi.yaml 2.1.0-alpha.65. Do not edit. */
2
2
  export interface paths {
3
3
  "/meta": {
4
4
  parameters: {
@@ -3219,7 +3219,8 @@ export interface paths {
3219
3219
  * @description Owner and admins only. A public group can be found in `GET /public-groups` and joined by anyone through
3220
3220
  * `/@name`, unless banned. The name shares one name space with usernames, ignoring case: a name in use is
3221
3221
  * `409` `already_exists`, a reserved name `422`. The old name is free at once. Accounts at `limited` or above
3222
- * get `403` `account_restricted` (`share_group`).
3222
+ * get `403` `account_restricted` (`share_group`). A channel whose public name moderation removed
3223
+ * (`public_name_locked`) gets `403`.
3223
3224
  */
3224
3225
  put: operations["setGroupPublicName"];
3225
3226
  post?: never;
@@ -7263,10 +7264,19 @@ export interface components {
7263
7264
  tags?: string[];
7264
7265
  /** @description Channels only - posts carry the author's name (`Message.signature`); off shows posts as the channel. Owner and admins change it. */
7265
7266
  sign_posts?: boolean;
7266
- /** @description Channels only - 18+ content. Set by the owner (staff can set it too); apps label the channel 18+. */
7267
+ /** @description Channels only - the owner's 18+ setting. Apps label the channel 18+ when this or `sensitive_by_staff` is true. */
7267
7268
  sensitive?: boolean;
7268
7269
  /** @description Channels only - whether the channel may be recommended to people who do not follow it. On by default; only the owner changes it. */
7269
7270
  recommendable?: boolean;
7271
+ /** @description Channels only - moderation marked the channel 18+. The owner cannot turn it off. */
7272
+ sensitive_by_staff?: boolean;
7273
+ /**
7274
+ * @description Channels only - moderation suspended the channel. Members still read it, but nobody posts, edits or
7275
+ * comments (`403`), nobody joins, and it is not found by public name, invite link, search or preview.
7276
+ */
7277
+ suspended?: boolean;
7278
+ /** @description Channels only - moderation removed the public name; setting a new one is `403` until moderation allows it again. */
7279
+ public_name_locked?: boolean;
7270
7280
  /** @description Channels only - whether the caller gets a push for every new comment on their own posts. */
7271
7281
  notify_comments?: boolean;
7272
7282
  /** @description Everyone in the group, the owner included (the subscribers of a channel). */
@@ -7379,7 +7389,7 @@ export interface components {
7379
7389
  /** @description Public channels only - up to 5 tags (lowercase letters and digits, at most 24 characters). */
7380
7390
  tags?: string[];
7381
7391
  group_mode: components["schemas"]["GroupMode"];
7382
- /** @description Channels only - 18+ content; apps show an 18+ label. */
7392
+ /** @description Channels only - 18+ content, set by the owner or by moderation; apps show an 18+ label. */
7383
7393
  sensitive?: boolean;
7384
7394
  /** @description Set for a public group. */
7385
7395
  public_name: components["schemas"]["PublicName"] | null;
package/dist/ws-docs.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
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| `thread_open`, `thread_close` | You opened or closed the comments of a channel post (`message_id`); comment events reach you only while it is open. Re-send `thread_open` at least every 2 minutes |\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`, `reaction_counts` and `comment_count` of posts (to online subscribers) and of comments (to users with the thread open), at most one per item every 10 s |\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",
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| `thread_open`, `thread_close` | You opened or closed the comments of a channel post (`message_id`); comment events reach you only while it is open. Re-send `thread_open` at least every 2 minutes |\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`, `reaction_counts` and `comment_count` of posts (to online subscribers) and of comments (to users with the thread open), at most one per item every 10 s |\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`. In channels a vote sends it only to the voter's own sessions |\n| `poll_counts` | Channels: merged vote counts of a poll (`total_voters`, `option_counts`), at most one per poll every 10 s, to online subscribers who see the results. Apply when `version` is higher; keep `my_votes` |\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",
@@ -652,6 +652,20 @@
652
652
  }
653
653
  }
654
654
  },
655
+ "server/poll_counts.json": {
656
+ "type": "poll_counts",
657
+ "event_id": "7217400317439950031",
658
+ "chat_id": "42",
659
+ "data": {
660
+ "message_id": "7217400317439950002",
661
+ "version": 812,
662
+ "total_voters": 811,
663
+ "option_counts": [
664
+ 520,
665
+ 291
666
+ ]
667
+ }
668
+ },
655
669
  "server/poll_updated.json": {
656
670
  "type": "poll_updated",
657
671
  "event_id": "7217400317439950013",
@@ -1,4 +1,4 @@
1
- /* Generated from api/openapi.yaml 2.1.0-alpha.63. Do not edit. */
1
+ /* Generated from api/openapi.yaml 2.1.0-alpha.65. Do not edit. */
2
2
 
3
3
  /**
4
4
  * Any WebSocket event, in either direction.
@@ -56,6 +56,7 @@ export type ServerEvent =
56
56
  | ServerMessageEvent
57
57
  | ServerPinUpdateEvent
58
58
  | ServerPlaylistsUpdatedEvent
59
+ | ServerPollCountsEvent
59
60
  | ServerPollUpdatedEvent
60
61
  | ServerPostStatsEvent
61
62
  | ServerPresenceEvent
@@ -1458,13 +1459,27 @@ export interface Group {
1458
1459
  */
1459
1460
  sign_posts?: boolean;
1460
1461
  /**
1461
- * Channels only - 18+ content. Set by the owner (staff can set it too); apps label the channel 18+.
1462
+ * Channels only - the owner's 18+ setting. Apps label the channel 18+ when this or `sensitive_by_staff` is true.
1462
1463
  */
1463
1464
  sensitive?: boolean;
1464
1465
  /**
1465
1466
  * Channels only - whether the channel may be recommended to people who do not follow it. On by default; only the owner changes it.
1466
1467
  */
1467
1468
  recommendable?: boolean;
1469
+ /**
1470
+ * Channels only - moderation marked the channel 18+. The owner cannot turn it off.
1471
+ */
1472
+ sensitive_by_staff?: boolean;
1473
+ /**
1474
+ * Channels only - moderation suspended the channel. Members still read it, but nobody posts, edits or
1475
+ * comments (`403`), nobody joins, and it is not found by public name, invite link, search or preview.
1476
+ *
1477
+ */
1478
+ suspended?: boolean;
1479
+ /**
1480
+ * Channels only - moderation removed the public name; setting a new one is `403` until moderation allows it again.
1481
+ */
1482
+ public_name_locked?: boolean;
1468
1483
  /**
1469
1484
  * Channels only - whether the caller gets a push for every new comment on their own posts.
1470
1485
  */
@@ -1623,7 +1638,24 @@ export interface PlaylistSummary {
1623
1638
  updated_at: Timestamp;
1624
1639
  }
1625
1640
  /**
1626
- * Someone voted, changed or took back a vote, or the poll closed. Goes to every member of the chat, each with the poll as they see it (results only after they voted, for the creator, or once closed). Replace Message.poll when version is higher than the one you have.
1641
+ * Channels: the vote counts of a poll changed. Merged: at most one per poll every 10 s, the same for everyone who gets it: online subscribers who voted, the poll's creator, and every online subscriber once the poll is closed. When version is higher than the one you have, set Poll.total_voters, each option's voter_count and Poll.version; keep my_votes and can_close.
1642
+ */
1643
+ export interface ServerPollCountsEvent {
1644
+ type: "poll_counts";
1645
+ event_id: Id;
1646
+ chat_id: Id;
1647
+ data: {
1648
+ message_id: Id;
1649
+ version: number;
1650
+ total_voters: number;
1651
+ /**
1652
+ * Voters per option, in the order of Poll.options.
1653
+ */
1654
+ option_counts: number[];
1655
+ };
1656
+ }
1657
+ /**
1658
+ * Someone voted, changed or took back a vote, or the poll closed. Goes to every member of the chat, each with the poll as they see it (results only after they voted, for the creator, or once closed). In channels a vote sends it only to the voter's own sessions; the others get poll_counts. Replace Message.poll when version is higher than the one you have.
1627
1659
  */
1628
1660
  export interface ServerPollUpdatedEvent {
1629
1661
  type: "poll_updated";
@@ -5865,12 +5865,24 @@
5865
5865
  },
5866
5866
  "sensitive": {
5867
5867
  "type": "boolean",
5868
- "description": "Channels only - 18+ content. Set by the owner (staff can set it too); apps label the channel 18+."
5868
+ "description": "Channels only - the owner's 18+ setting. Apps label the channel 18+ when this or `sensitive_by_staff` is true."
5869
5869
  },
5870
5870
  "recommendable": {
5871
5871
  "type": "boolean",
5872
5872
  "description": "Channels only - whether the channel may be recommended to people who do not follow it. On by default; only the owner changes it."
5873
5873
  },
5874
+ "sensitive_by_staff": {
5875
+ "type": "boolean",
5876
+ "description": "Channels only - moderation marked the channel 18+. The owner cannot turn it off."
5877
+ },
5878
+ "suspended": {
5879
+ "type": "boolean",
5880
+ "description": "Channels only - moderation suspended the channel. Members still read it, but nobody posts, edits or\ncomments (`403`), nobody joins, and it is not found by public name, invite link, search or preview.\n"
5881
+ },
5882
+ "public_name_locked": {
5883
+ "type": "boolean",
5884
+ "description": "Channels only - moderation removed the public name; setting a new one is `403` until moderation allows it again."
5885
+ },
5874
5886
  "notify_comments": {
5875
5887
  "type": "boolean",
5876
5888
  "description": "Channels only - whether the caller gets a push for every new comment on their own posts."
@@ -6220,7 +6232,7 @@
6220
6232
  },
6221
6233
  "sensitive": {
6222
6234
  "type": "boolean",
6223
- "description": "Channels only - 18+ content; apps show an 18+ label."
6235
+ "description": "Channels only - 18+ content, set by the owner or by moderation; apps show an 18+ label."
6224
6236
  },
6225
6237
  "public_name": {
6226
6238
  "description": "Set for a public group.",
@@ -8964,9 +8976,61 @@
8964
8976
  }
8965
8977
  }
8966
8978
  },
8979
+ "ServerPollCountsEvent": {
8980
+ "title": "ServerPollCountsEvent",
8981
+ "description": "Channels: the vote counts of a poll changed. Merged: at most one per poll every 10 s, the same for everyone who gets it: online subscribers who voted, the poll's creator, and every online subscriber once the poll is closed. When version is higher than the one you have, set Poll.total_voters, each option's voter_count and Poll.version; keep my_votes and can_close.",
8982
+ "type": "object",
8983
+ "properties": {
8984
+ "type": {
8985
+ "const": "poll_counts"
8986
+ },
8987
+ "event_id": {
8988
+ "$ref": "#/$defs/Id"
8989
+ },
8990
+ "chat_id": {
8991
+ "$ref": "#/$defs/Id"
8992
+ },
8993
+ "data": {
8994
+ "type": "object",
8995
+ "properties": {
8996
+ "message_id": {
8997
+ "$ref": "#/$defs/Id"
8998
+ },
8999
+ "version": {
9000
+ "type": "integer",
9001
+ "minimum": 0
9002
+ },
9003
+ "total_voters": {
9004
+ "type": "integer",
9005
+ "minimum": 0
9006
+ },
9007
+ "option_counts": {
9008
+ "type": "array",
9009
+ "description": "Voters per option, in the order of Poll.options.",
9010
+ "items": {
9011
+ "type": "integer",
9012
+ "minimum": 0
9013
+ }
9014
+ }
9015
+ },
9016
+ "required": [
9017
+ "message_id",
9018
+ "version",
9019
+ "total_voters",
9020
+ "option_counts"
9021
+ ]
9022
+ }
9023
+ },
9024
+ "required": [
9025
+ "type",
9026
+ "event_id",
9027
+ "chat_id",
9028
+ "data"
9029
+ ]
9030
+ },
8967
9031
  "ServerPollUpdatedEvent": {
8968
9032
  "title": "ServerPollUpdatedEvent",
8969
- "description": "Someone voted, changed or took back a vote, or the poll closed. Goes to every member of the chat, each with the poll as they see it (results only after they voted, for the creator, or once closed). Replace Message.poll when version is higher than the one you have.",
9033
+ "description": "Someone voted, changed or took back a vote, or the poll closed. Goes to every member of the chat, each with the poll as they see it (results only after they voted, for the creator, or once closed). In channels a vote sends it only to the voter's own sessions; the others get poll_counts. Replace Message.poll when version is higher than the one you have.",
8970
9034
  "type": "object",
8971
9035
  "properties": {
8972
9036
  "type": {
@@ -9664,6 +9728,9 @@
9664
9728
  {
9665
9729
  "$ref": "#/$defs/ServerPlaylistsUpdatedEvent"
9666
9730
  },
9731
+ {
9732
+ "$ref": "#/$defs/ServerPollCountsEvent"
9733
+ },
9667
9734
  {
9668
9735
  "$ref": "#/$defs/ServerPollUpdatedEvent"
9669
9736
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@myronsi/messenger-api",
3
- "version": "2.1.0-alpha.63.next.212",
3
+ "version": "2.1.0-alpha.65",
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": {