@myronsi/messenger-api 2.1.0-alpha.2.next.63 → 2.1.0-alpha.21
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 +226 -0
- package/dist/index.d.ts +2 -2
- package/dist/index.js +1 -1
- package/dist/openapi.yaml +3443 -220
- package/dist/schema.d.ts +6653 -1749
- package/dist/ws-docs.json +99 -3
- package/dist/ws-events.d.ts +356 -8
- package/dist/ws-events.schema.json +2438 -368
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,232 @@
|
|
|
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.21
|
|
6
|
+
|
|
7
|
+
- User sticker packs: `POST /attachments` takes `purpose: sticker` (PNG, JPEG or still WebP up to 5 MB, stored as a
|
|
8
|
+
512 x 512 WebP of at most 512 KB). `POST /stickers/packs` creates a pack; `PATCH` and `DELETE
|
|
9
|
+
/stickers/packs/{pack_id}` rename and delete it; `POST /stickers/packs/{pack_id}/stickers`, `PATCH` and `DELETE
|
|
10
|
+
/stickers/packs/{pack_id}/stickers/{sticker_id}` and `PUT /stickers/packs/{pack_id}/order` manage its stickers.
|
|
11
|
+
Only the owner may change a pack (`403`). Limits: 50 packs per user and 120 stickers per pack
|
|
12
|
+
(`409 limit_reached`).
|
|
13
|
+
- `GET /stickers/packs?owned=true` lists the packs the user made. `GET /stickers/links/{slug}` opens a pack by its
|
|
14
|
+
share link. A user pack is reachable by its ID (`GET`, add, report, sending its stickers) only for its owner and
|
|
15
|
+
for users who opened its link; `Sticker.pack_slug` carries the link, so receivers of a sticker can open its pack.
|
|
16
|
+
- `StickerPack` gains the required `is_mine` and `is_hidden` and the optional `owner_id` and `slug`.
|
|
17
|
+
- `POST /stickers/packs/{pack_id}/report` reports a pack; after 5 reports it is hidden for everybody but its owner
|
|
18
|
+
and stickers cannot be sent from it.
|
|
19
|
+
- `ErrorCode` gains `limit_reached`.
|
|
20
|
+
- A sticker upload not yet in a pack can be loaded only by its uploader.
|
|
21
|
+
|
|
22
|
+
## 2.1.0-alpha.20
|
|
23
|
+
|
|
24
|
+
- Stickers: `MessageType` and `SendMessageRequest.type` gain `sticker`. A sticker message is sent with `sticker_id`
|
|
25
|
+
only (no content, attachment or drawings) through `POST /chats/{chat_id}/messages`; the WebSocket `message` event
|
|
26
|
+
does not take stickers. The server sets `content` to the sticker's emoji.
|
|
27
|
+
- `Message.sticker` returns the `Sticker` (id, pack, emoji, `is_animated`, `image`). `Message.attachment` carries
|
|
28
|
+
the same image, so older clients show a sticker as a picture with its emoji as caption.
|
|
29
|
+
- New `stickers` operations: `GET /stickers/packs` (the user's panel), `GET /stickers/packs/{pack_id}` (any pack),
|
|
30
|
+
`PUT` and `DELETE /stickers/packs/{pack_id}/installation` (add or remove a pack) and `GET /stickers/recent` (the
|
|
31
|
+
last 20 stickers the user sent). Built-in default packs are in every panel until the user removes them.
|
|
32
|
+
- Sticker images are attachments any signed-in user can download.
|
|
33
|
+
- The search `type` filter accepts `sticker`.
|
|
34
|
+
|
|
35
|
+
## 2.1.0-alpha.19
|
|
36
|
+
|
|
37
|
+
- Typing status for voice messages: the WebSocket `typing` event gains `data.action` (`typing` or
|
|
38
|
+
`recording_voice`). It is optional in the client event (default `typing`) and always set in the server event.
|
|
39
|
+
Clients show an unknown value like `typing`.
|
|
40
|
+
- `PrivacySettings` has a required `typing_indicators_enabled` (default `true`) and `UpdatePrivacySettingsRequest`
|
|
41
|
+
an optional one: with `false` the server drops the user's `typing` events, so nobody sees them typing.
|
|
42
|
+
|
|
43
|
+
## 2.1.0-alpha.18
|
|
44
|
+
|
|
45
|
+
- Drawings on images: `SendMessageRequest.drawings` adds strokes and text labels to images of a `file` message.
|
|
46
|
+
The image file stays unchanged; the drawing is stored with the message.
|
|
47
|
+
- To draw on an image someone else sent, reply to that message with `reply_to`, reuse its image ID in
|
|
48
|
+
`attachment_id` and send a drawing for it.
|
|
49
|
+
- `Attachment.drawing` returns the drawing. Clients show the image with it. Older clients ignore it and show the
|
|
50
|
+
plain image.
|
|
51
|
+
|
|
52
|
+
## 2.1.0-alpha.17
|
|
53
|
+
|
|
54
|
+
- Media albums: `SendMessageRequest.attachment_ids` sends two to ten image or video uploads as one `file` message
|
|
55
|
+
with one caption. `attachment_id` and `attachment_ids` are mutually exclusive; albums are `file` only.
|
|
56
|
+
- `Message.attachments` lists the album items in order. `Message.attachment` still carries the first item, so
|
|
57
|
+
older clients show the first photo or video.
|
|
58
|
+
- `MediaKind` gains `visual` for `GET /chats/{chat_id}/media`: images and videos together.
|
|
59
|
+
|
|
60
|
+
## 2.1.0-alpha.16
|
|
61
|
+
|
|
62
|
+
- Trusted-device recovery no longer needs the current password. `DeviceRecoveryApproval.password` is no longer
|
|
63
|
+
required, is deprecated and ignored. New optional `passkey` (`PasskeyVerification`).
|
|
64
|
+
- `POST /auth/recovery-requests/{requestId}/approve/options` (`DeviceRecoveryApprovalOptions`: `method` `passkey`
|
|
65
|
+
with `challenge_id` and `public_key`, or `session` with `approvable_from` while the session is too new).
|
|
66
|
+
- New error codes `user_verification_required` (account has passkeys, no assertion sent) and `session_too_new`
|
|
67
|
+
(no passkeys and the session is younger than the minimum session age), both `403` on the approval.
|
|
68
|
+
|
|
69
|
+
## 2.1.0-alpha.15
|
|
70
|
+
|
|
71
|
+
- End-to-end encrypted audio calls in direct chats and groups (tag `calls`, see `docs/calls.md` and
|
|
72
|
+
`docs/calls-e2ee.md`). `GET /calls/config` (`CallConfig`: `enabled`, `max_participants`,
|
|
73
|
+
`ring_timeout_seconds`) tells clients whether to show call controls; with `enabled: false` they hide them.
|
|
74
|
+
- `PUT /me/call-identity` (`CallIdentityRequest`, `204`) registers the session's P-256 call identity key
|
|
75
|
+
(`CallIdentityKey`, 87 characters of base64url); a new key raises the epoch of a call the session is in.
|
|
76
|
+
- `GET /calls` (`CallList`) lists the user's calls that are not over; clients load it after every (re)connect.
|
|
77
|
+
`GET /chats/{chat_id}/call` returns the chat's current call, `POST /chats/{chat_id}/call` (`StartCallRequest`
|
|
78
|
+
with a required `client_request_id`, idempotent for 24 hours) starts one (`201`) or returns the running one
|
|
79
|
+
(`200`). `GET /calls/{call_id}` reads a call, ended calls for 90 days.
|
|
80
|
+
- `POST /calls/{call_id}/join` (optional `JoinCallRequest` with `takeover`) answers or joins and returns
|
|
81
|
+
`CallJoin` (`call` and a short-lived `CallGrant`: `url`, `token`, `identity`, `expires_at`);
|
|
82
|
+
`POST /calls/{call_id}/grant` renews the grant for the session that joined. `POST /calls/{call_id}/decline`,
|
|
83
|
+
`/leave` and `/end` answer `204`.
|
|
84
|
+
- `GET /calls/{call_id}/keys` (`CallKeyEnvelopeList`) and `POST /calls/{call_id}/keys` (`SendCallKeysRequest` with
|
|
85
|
+
1 to 64 `OutgoingCallKeyEnvelope`) relay opaque HPKE envelopes (`CallKeyEnvelope`) for the current epoch.
|
|
86
|
+
- New schemas `Call` (`kind`, `state`, `end_reason`, `epoch`, `version`, `participants`, timestamps),
|
|
87
|
+
`CallState` (`ringing`, `active`, `ended`), `CallEndReason` (`completed`, `missed`, `declined`, `cancelled`,
|
|
88
|
+
`failed`), `CallParticipant` and `CallParticipantState` (`ringing`, `joined`, `declined`, `missed`, `left`).
|
|
89
|
+
- New error codes `calls_unavailable`, `calls_not_allowed`, `call_identity_required`, `call_full`, `call_ended`,
|
|
90
|
+
`already_in_call` and `stale_epoch`. Every call operation except `GET /calls/config` can answer `503`
|
|
91
|
+
(`CallsUnavailable`, with `Retry-After` when calls are only away for a moment). `403 calls_not_allowed` when the
|
|
92
|
+
peer of a direct chat has calls off or one user blocked the other; `409` for `already_in_call`, `call_ended`,
|
|
93
|
+
`call_full` and `stale_epoch`; `422 call_identity_required` when joining without a call identity.
|
|
94
|
+
- New WebSocket events `call_updated` (the whole `Call` to every chat member; keep the highest `version`) and
|
|
95
|
+
`call_keys` (a `CallKeyEnvelopeList` for the recipient session only).
|
|
96
|
+
- `PrivacySettings` has a required `calls_enabled` (default `true`) and `UpdatePrivacySettingsRequest` an optional
|
|
97
|
+
one: with `false` nobody can ring the user.
|
|
98
|
+
- `SystemEventKind` adds `call`: one `system` message per call, posted when it ends, with `actor` the initiator and
|
|
99
|
+
`SystemEvent.call` a `CallSummary` (`call_id`, `kind`, `outcome`, `duration_seconds`).
|
|
100
|
+
|
|
101
|
+
## 2.1.0-alpha.14
|
|
102
|
+
|
|
103
|
+
- New schema `Location` (`city`, `country_code` (ISO 3166-1 alpha-2), `country` (English name), each nullable): the
|
|
104
|
+
approximate location of a client address from an offline GeoIP database (IP geolocation by DB-IP). Clients
|
|
105
|
+
localise the country name from `country_code`.
|
|
106
|
+
- `Session` (`GET /me/sessions`) and the items of `SecurityEventPage` (`GET /me/security-events`) have a required,
|
|
107
|
+
nullable `location`, captured when the session signed in or refreshed and when the event happened.
|
|
108
|
+
- The `recovery_request` WebSocket event replaces `ip_hint` with a required, nullable `location`. No response or
|
|
109
|
+
event exposes a client IP address or network.
|
|
110
|
+
- Operations that take an optional second-factor `code` answer `401` with `code: two_factor_required` when every
|
|
111
|
+
other credential in the request was valid, the account has two-factor on and no `code` was sent; nothing
|
|
112
|
+
single-use is consumed, so clients ask for the code and repeat the request. Invalid other credentials and a wrong
|
|
113
|
+
`code` keep their errors. Affected: `POST /auth/recover/key`, `POST /auth/password-reset/confirm`,
|
|
114
|
+
`POST /auth/recovery-requests/{requestId}/approve`, `POST /me/recovery-key`, `POST /me/2fa/disable`,
|
|
115
|
+
`POST /auth/passkeys/register/options`, `PUT /me/email` and `DELETE /me/email`. `code` of
|
|
116
|
+
`DisableTwoFactorRequest` is now optional.
|
|
117
|
+
- Sign in with a QR code. A device that is not signed in calls `POST /auth/qr-login` (public, `201`
|
|
118
|
+
`QrLoginStart`: `request_id`, `poll_token`, `url` = `<RECOVERY_WEB_URL>/qr/<request_id>`, `expires_at` after 2
|
|
119
|
+
minutes) and polls `POST /auth/qr-login/{requestId}/poll` with `{ poll_token }` (public, `QrLoginPollResult`:
|
|
120
|
+
`status` `pending`, `scanned`, `denied` or `expired`). A signed-in device opens the link: `GET
|
|
121
|
+
/auth/qr-login/{requestId}` (`QrLoginRequest` with `device`, `location`, `created_at`, `expires_at`) moves the
|
|
122
|
+
request to `scanned` and binds it to that account, then `POST /auth/qr-login/{requestId}/approve` (optional
|
|
123
|
+
`code`, `401 two_factor_required` with two-factor on and no code, `403 forbidden` for an idle or old session) or
|
|
124
|
+
`POST /auth/qr-login/{requestId}/deny` answer `204`. The first poll after approval answers `status: approved`
|
|
125
|
+
plus the `TokenResponse` fields and sets the refresh cookie, exactly once; later polls, a wrong `poll_token` and
|
|
126
|
+
unknown requests answer `expired`. Unknown, expired or used requests answer `404` to the signed-in operations,
|
|
127
|
+
already decided ones `409`.
|
|
128
|
+
- New security event types `qr_login_approved`, `qr_login_denied` (both with the new device's user agent and
|
|
129
|
+
location) and `qr_login` (the new device signed in). The new `security_alert` WebSocket event
|
|
130
|
+
carries informational notices (sign-ins, password, 2FA, passkey and recovery changes, `qr_login_approved`);
|
|
131
|
+
`security_notice` stays limited to `password_reset`, so released clients that sign out on it keep working.
|
|
132
|
+
- `request_id` of the `recovery_request` WebSocket event is now an approval handle that differs from the
|
|
133
|
+
requester's capability. `POST /auth/recovery-requests/{requestId}/approve` and `/deny` take this handle; status
|
|
134
|
+
polling and `/complete` keep taking the requester's capability, so a signed-in device that receives the event can
|
|
135
|
+
no longer poll or complete the request. `DeviceRecoveryApproval` has a new required `password`. Approve and deny
|
|
136
|
+
answer `404` for an unknown, expired or already decided request and `403 forbidden` for an idle or old session.
|
|
137
|
+
- `POST /auth/passkeys/register/verify` answers `400 invalid_request` instead of `401 unauthenticated` for an
|
|
138
|
+
expired or used registration challenge, so clients do not treat it as a lost session.
|
|
139
|
+
- A completed password recovery (key, device approval or email) removes every passkey and, except for an email
|
|
140
|
+
recovery, the recovery email. The `password_reset` security event details gain `passkeys_removed` and
|
|
141
|
+
`recovery_email_removed`.
|
|
142
|
+
- New `POST /auth/recovery-requests/{requestId}/cancel` (public, requester capability, `204` for every
|
|
143
|
+
capability): withdraws a pending device recovery request so it stops counting towards the limit of three.
|
|
144
|
+
- `security_alert` adds `login_2fa` to its types and an optional `session_id`: the session that made the change,
|
|
145
|
+
so clients can skip alerts about their own actions.
|
|
146
|
+
- `POST /auth/password-reset/confirm` answers `404 not_found` for an unknown, expired or used link instead of
|
|
147
|
+
`400 invalid_credentials`, so clients can tell a dead link from a wrong code.
|
|
148
|
+
|
|
149
|
+
## 2.1.0-alpha.12
|
|
150
|
+
|
|
151
|
+
- `GET /link-preview?url=` returns the Open Graph preview of a public web page (`title`, `description`,
|
|
152
|
+
`site_name`, `image`), cached for a day. `image.url` points to `GET /link-preview/image`, which streams the
|
|
153
|
+
picture through the server (PNG, JPEG, GIF or WebP up to 5 MB) with a signature, so clients never load
|
|
154
|
+
third-party images directly. Only public `http`/`https` addresses on ports 80 and 443 are fetched.
|
|
155
|
+
- Messages have an optional `system_event` (`kind`, `actor_id`, `actor_name`, `target_id`, `target_name`) on
|
|
156
|
+
`system` messages, whose `content` is then `null`. Groups write them when a group is created and when members
|
|
157
|
+
are added, join, are removed or leave. System messages do not count as unread.
|
|
158
|
+
- `GET /groups/{chat_id}/role-log` lists who changed whose role and when, newest first (members only).
|
|
159
|
+
- `GroupRole` and `UpdateRoleRequest` have `moderator` again: moderators may delete other members' messages.
|
|
160
|
+
- In a direct chat either side may delete any message for everyone (`DELETE /messages/{message_id}?scope=everyone`
|
|
161
|
+
and `POST /chats/{chat_id}/messages/delete`).
|
|
162
|
+
- The last message of a chat (`GET /chats`, `GET /chats/{chat_id}`) skips messages deleted for everyone and is the
|
|
163
|
+
newest message that still has content.
|
|
164
|
+
|
|
165
|
+
## 2.1.0-alpha.11
|
|
166
|
+
|
|
167
|
+
- Attachments have `display_url`: a JPEG of at most 1600 px (`GET /attachments/{attachment_id}/content?variant=display`)
|
|
168
|
+
for showing a large still image in a viewer, much smaller than the original. It is `null` for small images and
|
|
169
|
+
GIFs. Older images get their display copy on the first request.
|
|
170
|
+
|
|
171
|
+
## 2.1.0-alpha.10
|
|
172
|
+
|
|
173
|
+
- `GET /attachments/{attachment_id}/content` is cached for an hour again (`private, max-age=3600`) instead of a
|
|
174
|
+
year, so a file is not kept in caches long after its message is deleted. Versioned avatar URLs keep the
|
|
175
|
+
year-long cache.
|
|
176
|
+
- `POST /chats/{chat_id}/messages/delete` with `scope` everyone treats messages that are already deleted for
|
|
177
|
+
everyone as done (`204` instead of `404`), so a retry after a partial failure deletes the rest.
|
|
178
|
+
- WebSocket: a connection with more than 64 client events waiting to be handled is closed with `1013`.
|
|
179
|
+
- WebSocket: a user has at most 10 connections per server; opening another closes the oldest with the new close
|
|
180
|
+
code `4429`.
|
|
181
|
+
- `GET /users/{user_id}` and `GET /usernames/{username}` answer `404` for a user whose `search_visibility` hides
|
|
182
|
+
them from the current user, unless the two share a chat, and are rate limited per user (`429`).
|
|
183
|
+
`PUT /users/{user_id}/contact-name` follows the same rules and limit.
|
|
184
|
+
- `contacts` (and `shared_chats`) count a direct chat only once the user opened it or read a message in it, so
|
|
185
|
+
opening an empty chat with someone does not make you their contact. Groups count as before.
|
|
186
|
+
|
|
187
|
+
## 2.1.0-alpha.9
|
|
188
|
+
|
|
189
|
+
- Privacy exceptions apply to every value of avatar, profile and presence visibility, not only to `*_except`:
|
|
190
|
+
an `allow` exception always shows the item to that user and a `deny` exception always hides it. Group invites
|
|
191
|
+
already worked this way.
|
|
192
|
+
- `direct_messages` and `search_visibility` take exception lists too (`PUT /me/privacy/exceptions/{setting_key}/{effect}`
|
|
193
|
+
and `exceptions` of `PrivacySettings`): `allow` lets the user start a direct chat without approval or find you in
|
|
194
|
+
search, `deny` never does.
|
|
195
|
+
|
|
196
|
+
## 2.1.0-alpha.8
|
|
197
|
+
|
|
198
|
+
- Adds `POST /chats/{chat_id}/messages/forward` (up to 20 messages to up to 20 chats, at most 20 copies, oldest
|
|
199
|
+
first) and `POST /chats/{chat_id}/messages/delete` (up to 100 messages, `scope` me or everyone). Both check
|
|
200
|
+
every message first and change nothing when one is refused.
|
|
201
|
+
|
|
202
|
+
## 2.1.0-alpha.7
|
|
203
|
+
|
|
204
|
+
- Adds `DELETE /me/avatars/{avatar_id}`: removes one of your avatars from the history and answers the updated
|
|
205
|
+
`Me`. Deleting the current avatar makes the newest remaining one current again, or the default when none is left.
|
|
206
|
+
|
|
207
|
+
## 2.1.0-alpha.6
|
|
208
|
+
|
|
209
|
+
- `Message` adds optional `reply_preview` (`ReplyPreview`: id, type, sender, the first 100 characters of the
|
|
210
|
+
text, attachment, is_deleted) on history pages and `message` events, so a reply shows what it answers even
|
|
211
|
+
when that message is not loaded. It is absent when the answered message is gone or hidden for the recipient.
|
|
212
|
+
|
|
213
|
+
## 2.1.0-alpha.5
|
|
214
|
+
|
|
215
|
+
- A user's `avatar_url` adds `?rev={revision}`, which changes with every new avatar. `GET /users/{user_id}/avatar`
|
|
216
|
+
accepts `rev`; while it matches the current avatar, the answer is `Cache-Control: private, max-age=31536000, immutable`.
|
|
217
|
+
- `GET /attachments/{attachment_id}/content` is cached for a year (`immutable`): an attachment's bytes never change.
|
|
218
|
+
|
|
219
|
+
## 2.1.0-alpha.4
|
|
220
|
+
|
|
221
|
+
- Editing a file message accepts an empty `content` (HTTP `PATCH /messages/{message_id}` and the WebSocket `edit`
|
|
222
|
+
event): it removes the caption. A text message still needs at least one character.
|
|
223
|
+
|
|
224
|
+
## 2.1.0-alpha.3
|
|
225
|
+
|
|
226
|
+
- Adds `GET /notifications/avatar/{token}` and `POST /notifications/read/{token}` without a session, for the
|
|
227
|
+
sender photo and the "Mark as read" action of a web push. Both answer `404` for a forged, expired or ended token.
|
|
228
|
+
- Web push payloads add `preview`, `read_token` and, with previews on, `sender_id` and `avatar_token`. Tokens are bound to the push
|
|
229
|
+
device and its session.
|
|
230
|
+
|
|
5
231
|
## 2.1.0-alpha.2
|
|
6
232
|
|
|
7
233
|
- Adds notification preferences, session-bound push device registration and per-tab activity leases.
|
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.21. Do not edit. */
|
|
2
|
+
export declare const API_VERSION: "2.1.0-alpha.21";
|
|
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.21";
|