@myronsi/messenger-api 2.1.0-alpha.12 → 2.1.0-alpha.14

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,54 @@
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.14
6
+
7
+ - New schema `Location` (`city`, `country_code` (ISO 3166-1 alpha-2), `country` (English name), each nullable): the
8
+ approximate location of a client address from an offline GeoIP database (IP geolocation by DB-IP). Clients
9
+ localise the country name from `country_code`.
10
+ - `Session` (`GET /me/sessions`) and the items of `SecurityEventPage` (`GET /me/security-events`) have a required,
11
+ nullable `location`, captured when the session signed in or refreshed and when the event happened.
12
+ - The `recovery_request` WebSocket event replaces `ip_hint` with a required, nullable `location`. No response or
13
+ event exposes a client IP address or network.
14
+ - Operations that take an optional second-factor `code` answer `401` with `code: two_factor_required` when every
15
+ other credential in the request was valid, the account has two-factor on and no `code` was sent; nothing
16
+ single-use is consumed, so clients ask for the code and repeat the request. Invalid other credentials and a wrong
17
+ `code` keep their errors. Affected: `POST /auth/recover/key`, `POST /auth/password-reset/confirm`,
18
+ `POST /auth/recovery-requests/{requestId}/approve`, `POST /me/recovery-key`, `POST /me/2fa/disable`,
19
+ `POST /auth/passkeys/register/options`, `PUT /me/email` and `DELETE /me/email`. `code` of
20
+ `DisableTwoFactorRequest` is now optional.
21
+ - Sign in with a QR code. A device that is not signed in calls `POST /auth/qr-login` (public, `201`
22
+ `QrLoginStart`: `request_id`, `poll_token`, `url` = `<RECOVERY_WEB_URL>/qr/<request_id>`, `expires_at` after 2
23
+ minutes) and polls `POST /auth/qr-login/{requestId}/poll` with `{ poll_token }` (public, `QrLoginPollResult`:
24
+ `status` `pending`, `scanned`, `denied` or `expired`). A signed-in device opens the link: `GET
25
+ /auth/qr-login/{requestId}` (`QrLoginRequest` with `device`, `location`, `created_at`, `expires_at`) moves the
26
+ request to `scanned` and binds it to that account, then `POST /auth/qr-login/{requestId}/approve` (optional
27
+ `code`, `401 two_factor_required` with two-factor on and no code, `403 forbidden` for an idle or old session) or
28
+ `POST /auth/qr-login/{requestId}/deny` answer `204`. The first poll after approval answers `status: approved`
29
+ plus the `TokenResponse` fields and sets the refresh cookie, exactly once; later polls, a wrong `poll_token` and
30
+ unknown requests answer `expired`. Unknown, expired or used requests answer `404` to the signed-in operations,
31
+ already decided ones `409`.
32
+ - New security event types `qr_login_approved`, `qr_login_denied` (both with the new device's user agent and
33
+ location) and `qr_login` (the new device signed in). The new `security_alert` WebSocket event
34
+ carries informational notices (sign-ins, password, 2FA, passkey and recovery changes, `qr_login_approved`);
35
+ `security_notice` stays limited to `password_reset`, so released clients that sign out on it keep working.
36
+ - `request_id` of the `recovery_request` WebSocket event is now an approval handle that differs from the
37
+ requester's capability. `POST /auth/recovery-requests/{requestId}/approve` and `/deny` take this handle; status
38
+ polling and `/complete` keep taking the requester's capability, so a signed-in device that receives the event can
39
+ no longer poll or complete the request. `DeviceRecoveryApproval` has a new required `password`. Approve and deny
40
+ answer `404` for an unknown, expired or already decided request and `403 forbidden` for an idle or old session.
41
+ - `POST /auth/passkeys/register/verify` answers `400 invalid_request` instead of `401 unauthenticated` for an
42
+ expired or used registration challenge, so clients do not treat it as a lost session.
43
+ - A completed password recovery (key, device approval or email) removes every passkey and, except for an email
44
+ recovery, the recovery email. The `password_reset` security event details gain `passkeys_removed` and
45
+ `recovery_email_removed`.
46
+ - New `POST /auth/recovery-requests/{requestId}/cancel` (public, requester capability, `204` for every
47
+ capability): withdraws a pending device recovery request so it stops counting towards the limit of three.
48
+ - `security_alert` adds `login_2fa` to its types and an optional `session_id`: the session that made the change,
49
+ so clients can skip alerts about their own actions.
50
+ - `POST /auth/password-reset/confirm` answers `404 not_found` for an unknown, expired or used link instead of
51
+ `400 invalid_credentials`, so clients can tell a dead link from a wrong code.
52
+
5
53
  ## 2.1.0-alpha.12
6
54
 
7
55
  - `GET /link-preview?url=` returns the Open Graph preview of a public web page (`title`, `description`,
package/dist/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- /* Generated from api/openapi.yaml 2.1.0-alpha.12. Do not edit. */
2
- export declare const API_VERSION: "2.1.0-alpha.12";
1
+ /* Generated from api/openapi.yaml 2.1.0-alpha.14. Do not edit. */
2
+ export declare const API_VERSION: "2.1.0-alpha.14";
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.12";
1
+ export const API_VERSION = "2.1.0-alpha.14";