@myronsi/messenger-api 2.1.0-alpha.2 → 2.1.0-alpha.20.next.97

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