@myronsi/messenger-api 2.0.0-alpha.8 → 2.1.0-alpha.1

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,13 @@
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.1
6
+
7
+ - Registration returns a one-time recovery_key. GET /me adds recovery_setup_required.
8
+ - Adds GET/POST /me/recovery-key, POST /auth/recover/key and GET /me/security-events.
9
+ - Adds the security_notice WebSocket event for a recovery password reset.
10
+ - Recovery requires 2FA when enabled, rotates its key and sessions, and delays recovery-method changes for 24 hours. Legacy Shamir recovery remains unavailable.
11
+
5
12
  ## 2.0.0-alpha.8
6
13
 
7
14
  Found by validating every response of the backend's HTTP tests against this contract:
package/dist/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- /* Generated from api/openapi.yaml 2.0.0-alpha.8. Do not edit. */
2
- export declare const API_VERSION: "2.0.0-alpha.8";
1
+ /* Generated from api/openapi.yaml 2.1.0-alpha.1. Do not edit. */
2
+ export declare const API_VERSION: "2.1.0-alpha.1";
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.0.0-alpha.8";
1
+ export const API_VERSION = "2.1.0-alpha.1";
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.0.0-alpha.8
4
+ version: 2.1.0-alpha.1
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
@@ -202,6 +202,97 @@ paths:
202
202
  headers:
203
203
  Set-Cookie: { $ref: "#/components/headers/RefreshCookie" }
204
204
  "401": { $ref: "#/components/responses/Unauthorized" }
205
+ /auth/recover/key:
206
+ parameters:
207
+ - $ref: "#/components/parameters/ClientVersion"
208
+ - $ref: "#/components/parameters/ClientApiVersion"
209
+ post:
210
+ tags: [auth]
211
+ operationId: recoverWithKey
212
+ summary: Reset password with a single-use recovery key
213
+ security: []
214
+ requestBody:
215
+ required: true
216
+ content:
217
+ application/json:
218
+ schema: { $ref: "#/components/schemas/RecoverWithKeyRequest" }
219
+ responses:
220
+ "200":
221
+ description: Success
222
+ content:
223
+ application/json:
224
+ schema: { $ref: "#/components/schemas/RegisterResponse" }
225
+ "400": { $ref: "#/components/responses/BadRequest" }
226
+ "401": { $ref: "#/components/responses/Unauthorized" }
227
+ "403": { $ref: "#/components/responses/Forbidden" }
228
+ "409": { $ref: "#/components/responses/Conflict" }
229
+ "422": { $ref: "#/components/responses/ValidationFailed" }
230
+ "426": { $ref: "#/components/responses/ClientOutdated" }
231
+ "429": { $ref: "#/components/responses/TooManyRequests" }
232
+ /me/recovery-key:
233
+ parameters:
234
+ - $ref: "#/components/parameters/ClientVersion"
235
+ - $ref: "#/components/parameters/ClientApiVersion"
236
+ get:
237
+ tags: [auth]
238
+ operationId: getRecoveryKey
239
+ summary: Get recovery-key status without revealing its hash
240
+ responses:
241
+ "200":
242
+ description: Success
243
+ content:
244
+ application/json:
245
+ schema: { $ref: "#/components/schemas/RecoveryKeyStatus" }
246
+ "400": { $ref: "#/components/responses/BadRequest" }
247
+ "401": { $ref: "#/components/responses/Unauthorized" }
248
+ "403": { $ref: "#/components/responses/Forbidden" }
249
+ "409": { $ref: "#/components/responses/Conflict" }
250
+ "422": { $ref: "#/components/responses/ValidationFailed" }
251
+ "426": { $ref: "#/components/responses/ClientOutdated" }
252
+ "429": { $ref: "#/components/responses/TooManyRequests" }
253
+ post:
254
+ tags: [auth]
255
+ operationId: replaceRecoveryKey
256
+ summary: Create or regenerate a recovery key after password and second-factor confirmation
257
+ requestBody:
258
+ required: true
259
+ content:
260
+ application/json:
261
+ schema: { $ref: "#/components/schemas/ReplaceRecoveryKeyRequest" }
262
+ responses:
263
+ "200":
264
+ description: Success
265
+ content:
266
+ application/json:
267
+ schema: { $ref: "#/components/schemas/RecoveryKeyResult" }
268
+ "400": { $ref: "#/components/responses/BadRequest" }
269
+ "401": { $ref: "#/components/responses/Unauthorized" }
270
+ "403": { $ref: "#/components/responses/Forbidden" }
271
+ "409": { $ref: "#/components/responses/Conflict" }
272
+ "422": { $ref: "#/components/responses/ValidationFailed" }
273
+ "426": { $ref: "#/components/responses/ClientOutdated" }
274
+ "429": { $ref: "#/components/responses/TooManyRequests" }
275
+ /me/security-events:
276
+ parameters:
277
+ - $ref: "#/components/parameters/ClientVersion"
278
+ - $ref: "#/components/parameters/ClientApiVersion"
279
+ get:
280
+ tags: [auth]
281
+ operationId: listSecurityEvents
282
+ summary: List the last 50 security events of this account
283
+ responses:
284
+ "200":
285
+ description: Success
286
+ content:
287
+ application/json:
288
+ schema: { $ref: "#/components/schemas/SecurityEventPage" }
289
+ "400": { $ref: "#/components/responses/BadRequest" }
290
+ "401": { $ref: "#/components/responses/Unauthorized" }
291
+ "403": { $ref: "#/components/responses/Forbidden" }
292
+ "409": { $ref: "#/components/responses/Conflict" }
293
+ "422": { $ref: "#/components/responses/ValidationFailed" }
294
+ "426": { $ref: "#/components/responses/ClientOutdated" }
295
+ "429": { $ref: "#/components/responses/TooManyRequests" }
205
296
  /auth/recover:
206
297
  parameters:
207
298
  - $ref: "#/components/parameters/ClientVersion"
@@ -1880,12 +1971,52 @@ components:
1880
1971
  type: integer
1881
1972
  minimum: 1
1882
1973
  description: Seconds until the access token expires
1974
+ RecoverWithKeyRequest:
1975
+ type: object
1976
+ required: [username, recovery_key, new_password]
1977
+ properties:
1978
+ username: { type: string, maxLength: 64 }
1979
+ recovery_key: { type: string, maxLength: 128 }
1980
+ new_password: { type: string, minLength: 8, maxLength: 128 }
1981
+ code: { type: string, maxLength: 128 }
1982
+ ReplaceRecoveryKeyRequest:
1983
+ type: object
1984
+ required: [password]
1985
+ properties:
1986
+ password: { type: string, maxLength: 128 }
1987
+ code: { type: string, maxLength: 128 }
1988
+ RecoveryKeyResult:
1989
+ type: object
1990
+ required: [recovery_key]
1991
+ properties:
1992
+ recovery_key: { type: string }
1993
+ RecoveryKeyStatus:
1994
+ type: object
1995
+ required: [exists, created_at, locked_until]
1996
+ properties:
1997
+ exists: { type: boolean }
1998
+ created_at: { type: [string, 'null'], format: date-time }
1999
+ locked_until: { type: [string, 'null'], format: date-time }
2000
+ SecurityEventPage:
2001
+ type: object
2002
+ required: [items]
2003
+ properties:
2004
+ items:
2005
+ type: array
2006
+ items:
2007
+ type: object
2008
+ required: [id, type, created_at]
2009
+ properties:
2010
+ id: { $ref: "#/components/schemas/Id" }
2011
+ type: { type: string }
2012
+ created_at: { type: string, format: date-time }
1883
2013
  RegisterResponse:
1884
2014
  allOf:
1885
2015
  - $ref: "#/components/schemas/TokenResponse"
1886
2016
  - type: object
1887
2017
  description: Recovery parts of the temporary recovery flow (redesigned in release 1.1).
1888
2018
  properties:
2019
+ recovery_key: { type: string, description: Shown once; only a keyed hash is stored }
1889
2020
  device_part: { type: string }
1890
2021
  qr_part: { type: string }
1891
2022
  TwoFactorChallenge:
@@ -2095,6 +2226,7 @@ components:
2095
2226
  required: [created_at]
2096
2227
  properties:
2097
2228
  created_at: { $ref: "#/components/schemas/Timestamp" }
2229
+ recovery_setup_required: { type: boolean }
2098
2230
  UserPage:
2099
2231
  type: object
2100
2232
  required: [items, next_cursor]
package/dist/schema.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- /* Generated from api/openapi.yaml 2.0.0-alpha.8. Do not edit. */
1
+ /* Generated from api/openapi.yaml 2.1.0-alpha.1. Do not edit. */
2
2
  export interface paths {
3
3
  "/meta": {
4
4
  parameters: {
@@ -136,6 +136,73 @@ export interface paths {
136
136
  patch?: never;
137
137
  trace?: never;
138
138
  };
139
+ "/auth/recover/key": {
140
+ parameters: {
141
+ query?: never;
142
+ header?: {
143
+ /** @description Version of the client app, for logs and the per-client metric. */
144
+ "X-Client-Version"?: components["parameters"]["ClientVersion"];
145
+ /** @description Contract version the client was built with (`API_VERSION` of `@myronsi/messenger-api`). A different MAJOR or a version below `min_client_api_version` is answered with `426`; a malformed value with `400` (`invalid_client_version`). */
146
+ "X-Client-Api-Version"?: components["parameters"]["ClientApiVersion"];
147
+ };
148
+ path?: never;
149
+ cookie?: never;
150
+ };
151
+ get?: never;
152
+ put?: never;
153
+ /** Reset password with a single-use recovery key */
154
+ post: operations["recoverWithKey"];
155
+ delete?: never;
156
+ options?: never;
157
+ head?: never;
158
+ patch?: never;
159
+ trace?: never;
160
+ };
161
+ "/me/recovery-key": {
162
+ parameters: {
163
+ query?: never;
164
+ header?: {
165
+ /** @description Version of the client app, for logs and the per-client metric. */
166
+ "X-Client-Version"?: components["parameters"]["ClientVersion"];
167
+ /** @description Contract version the client was built with (`API_VERSION` of `@myronsi/messenger-api`). A different MAJOR or a version below `min_client_api_version` is answered with `426`; a malformed value with `400` (`invalid_client_version`). */
168
+ "X-Client-Api-Version"?: components["parameters"]["ClientApiVersion"];
169
+ };
170
+ path?: never;
171
+ cookie?: never;
172
+ };
173
+ /** Get recovery-key status without revealing its hash */
174
+ get: operations["getRecoveryKey"];
175
+ put?: never;
176
+ /** Create or regenerate a recovery key after password and second-factor confirmation */
177
+ post: operations["replaceRecoveryKey"];
178
+ delete?: never;
179
+ options?: never;
180
+ head?: never;
181
+ patch?: never;
182
+ trace?: never;
183
+ };
184
+ "/me/security-events": {
185
+ parameters: {
186
+ query?: never;
187
+ header?: {
188
+ /** @description Version of the client app, for logs and the per-client metric. */
189
+ "X-Client-Version"?: components["parameters"]["ClientVersion"];
190
+ /** @description Contract version the client was built with (`API_VERSION` of `@myronsi/messenger-api`). A different MAJOR or a version below `min_client_api_version` is answered with `426`; a malformed value with `400` (`invalid_client_version`). */
191
+ "X-Client-Api-Version"?: components["parameters"]["ClientApiVersion"];
192
+ };
193
+ path?: never;
194
+ cookie?: never;
195
+ };
196
+ /** List the last 50 security events of this account */
197
+ get: operations["listSecurityEvents"];
198
+ put?: never;
199
+ post?: never;
200
+ delete?: never;
201
+ options?: never;
202
+ head?: never;
203
+ patch?: never;
204
+ trace?: never;
205
+ };
139
206
  "/auth/recover": {
140
207
  parameters: {
141
208
  query?: never;
@@ -1358,7 +1425,37 @@ export interface components {
1358
1425
  /** @description Seconds until the access token expires */
1359
1426
  expires_in: number;
1360
1427
  };
1428
+ RecoverWithKeyRequest: {
1429
+ username: string;
1430
+ recovery_key: string;
1431
+ new_password: string;
1432
+ code?: string;
1433
+ };
1434
+ ReplaceRecoveryKeyRequest: {
1435
+ password: string;
1436
+ code?: string;
1437
+ };
1438
+ RecoveryKeyResult: {
1439
+ recovery_key: string;
1440
+ };
1441
+ RecoveryKeyStatus: {
1442
+ exists: boolean;
1443
+ /** Format: date-time */
1444
+ created_at: string | null;
1445
+ /** Format: date-time */
1446
+ locked_until: string | null;
1447
+ };
1448
+ SecurityEventPage: {
1449
+ items: {
1450
+ id: components["schemas"]["Id"];
1451
+ type: string;
1452
+ /** Format: date-time */
1453
+ created_at: string;
1454
+ }[];
1455
+ };
1361
1456
  RegisterResponse: components["schemas"]["TokenResponse"] & {
1457
+ /** @description Shown once; only a keyed hash is stored */
1458
+ recovery_key?: string;
1362
1459
  device_part?: string;
1363
1460
  qr_part?: string;
1364
1461
  };
@@ -1488,6 +1585,7 @@ export interface components {
1488
1585
  };
1489
1586
  Me: components["schemas"]["User"] & {
1490
1587
  created_at: components["schemas"]["Timestamp"];
1588
+ recovery_setup_required?: boolean;
1491
1589
  };
1492
1590
  UserPage: {
1493
1591
  items: components["schemas"]["User"][];
@@ -1989,6 +2087,142 @@ export interface operations {
1989
2087
  426: components["responses"]["ClientOutdated"];
1990
2088
  };
1991
2089
  };
2090
+ recoverWithKey: {
2091
+ parameters: {
2092
+ query?: never;
2093
+ header?: {
2094
+ /** @description Version of the client app, for logs and the per-client metric. */
2095
+ "X-Client-Version"?: components["parameters"]["ClientVersion"];
2096
+ /** @description Contract version the client was built with (`API_VERSION` of `@myronsi/messenger-api`). A different MAJOR or a version below `min_client_api_version` is answered with `426`; a malformed value with `400` (`invalid_client_version`). */
2097
+ "X-Client-Api-Version"?: components["parameters"]["ClientApiVersion"];
2098
+ };
2099
+ path?: never;
2100
+ cookie?: never;
2101
+ };
2102
+ requestBody: {
2103
+ content: {
2104
+ "application/json": components["schemas"]["RecoverWithKeyRequest"];
2105
+ };
2106
+ };
2107
+ responses: {
2108
+ /** @description Success */
2109
+ 200: {
2110
+ headers: {
2111
+ [name: string]: unknown;
2112
+ };
2113
+ content: {
2114
+ "application/json": components["schemas"]["RegisterResponse"];
2115
+ };
2116
+ };
2117
+ 400: components["responses"]["BadRequest"];
2118
+ 401: components["responses"]["Unauthorized"];
2119
+ 403: components["responses"]["Forbidden"];
2120
+ 409: components["responses"]["Conflict"];
2121
+ 422: components["responses"]["ValidationFailed"];
2122
+ 426: components["responses"]["ClientOutdated"];
2123
+ 429: components["responses"]["TooManyRequests"];
2124
+ };
2125
+ };
2126
+ getRecoveryKey: {
2127
+ parameters: {
2128
+ query?: never;
2129
+ header?: {
2130
+ /** @description Version of the client app, for logs and the per-client metric. */
2131
+ "X-Client-Version"?: components["parameters"]["ClientVersion"];
2132
+ /** @description Contract version the client was built with (`API_VERSION` of `@myronsi/messenger-api`). A different MAJOR or a version below `min_client_api_version` is answered with `426`; a malformed value with `400` (`invalid_client_version`). */
2133
+ "X-Client-Api-Version"?: components["parameters"]["ClientApiVersion"];
2134
+ };
2135
+ path?: never;
2136
+ cookie?: never;
2137
+ };
2138
+ requestBody?: never;
2139
+ responses: {
2140
+ /** @description Success */
2141
+ 200: {
2142
+ headers: {
2143
+ [name: string]: unknown;
2144
+ };
2145
+ content: {
2146
+ "application/json": components["schemas"]["RecoveryKeyStatus"];
2147
+ };
2148
+ };
2149
+ 400: components["responses"]["BadRequest"];
2150
+ 401: components["responses"]["Unauthorized"];
2151
+ 403: components["responses"]["Forbidden"];
2152
+ 409: components["responses"]["Conflict"];
2153
+ 422: components["responses"]["ValidationFailed"];
2154
+ 426: components["responses"]["ClientOutdated"];
2155
+ 429: components["responses"]["TooManyRequests"];
2156
+ };
2157
+ };
2158
+ replaceRecoveryKey: {
2159
+ parameters: {
2160
+ query?: never;
2161
+ header?: {
2162
+ /** @description Version of the client app, for logs and the per-client metric. */
2163
+ "X-Client-Version"?: components["parameters"]["ClientVersion"];
2164
+ /** @description Contract version the client was built with (`API_VERSION` of `@myronsi/messenger-api`). A different MAJOR or a version below `min_client_api_version` is answered with `426`; a malformed value with `400` (`invalid_client_version`). */
2165
+ "X-Client-Api-Version"?: components["parameters"]["ClientApiVersion"];
2166
+ };
2167
+ path?: never;
2168
+ cookie?: never;
2169
+ };
2170
+ requestBody: {
2171
+ content: {
2172
+ "application/json": components["schemas"]["ReplaceRecoveryKeyRequest"];
2173
+ };
2174
+ };
2175
+ responses: {
2176
+ /** @description Success */
2177
+ 200: {
2178
+ headers: {
2179
+ [name: string]: unknown;
2180
+ };
2181
+ content: {
2182
+ "application/json": components["schemas"]["RecoveryKeyResult"];
2183
+ };
2184
+ };
2185
+ 400: components["responses"]["BadRequest"];
2186
+ 401: components["responses"]["Unauthorized"];
2187
+ 403: components["responses"]["Forbidden"];
2188
+ 409: components["responses"]["Conflict"];
2189
+ 422: components["responses"]["ValidationFailed"];
2190
+ 426: components["responses"]["ClientOutdated"];
2191
+ 429: components["responses"]["TooManyRequests"];
2192
+ };
2193
+ };
2194
+ listSecurityEvents: {
2195
+ parameters: {
2196
+ query?: never;
2197
+ header?: {
2198
+ /** @description Version of the client app, for logs and the per-client metric. */
2199
+ "X-Client-Version"?: components["parameters"]["ClientVersion"];
2200
+ /** @description Contract version the client was built with (`API_VERSION` of `@myronsi/messenger-api`). A different MAJOR or a version below `min_client_api_version` is answered with `426`; a malformed value with `400` (`invalid_client_version`). */
2201
+ "X-Client-Api-Version"?: components["parameters"]["ClientApiVersion"];
2202
+ };
2203
+ path?: never;
2204
+ cookie?: never;
2205
+ };
2206
+ requestBody?: never;
2207
+ responses: {
2208
+ /** @description Success */
2209
+ 200: {
2210
+ headers: {
2211
+ [name: string]: unknown;
2212
+ };
2213
+ content: {
2214
+ "application/json": components["schemas"]["SecurityEventPage"];
2215
+ };
2216
+ };
2217
+ 400: components["responses"]["BadRequest"];
2218
+ 401: components["responses"]["Unauthorized"];
2219
+ 403: components["responses"]["Forbidden"];
2220
+ 409: components["responses"]["Conflict"];
2221
+ 422: components["responses"]["ValidationFailed"];
2222
+ 426: components["responses"]["ClientOutdated"];
2223
+ 429: components["responses"]["TooManyRequests"];
2224
+ };
2225
+ };
1992
2226
  startRecovery: {
1993
2227
  parameters: {
1994
2228
  query?: never;
package/dist/ws-docs.json CHANGED
@@ -415,6 +415,14 @@
415
415
  "read_at": "2026-10-04T12:00:00Z"
416
416
  }
417
417
  },
418
+ "server/security_notice.json": {
419
+ "type": "security_notice",
420
+ "event_id": "7217400317439950009",
421
+ "chat_id": null,
422
+ "data": {
423
+ "type": "password_reset"
424
+ }
425
+ },
418
426
  "server/typing.json": {
419
427
  "type": "typing",
420
428
  "event_id": "7217400317439950009",
@@ -1,4 +1,4 @@
1
- /* Generated from api/openapi.yaml 2.0.0-alpha.8. Do not edit. */
1
+ /* Generated from api/openapi.yaml 2.1.0-alpha.1. Do not edit. */
2
2
 
3
3
  /**
4
4
  * Any WebSocket event, in either direction.
@@ -48,6 +48,7 @@ export type ServerEvent =
48
48
  | ServerReactionAddEvent
49
49
  | ServerReactionRemoveEvent
50
50
  | ServerReadEvent
51
+ | ServerSecurityNoticeEvent
51
52
  | ServerTypingEvent;
52
53
  export type Timestamp = string;
53
54
  export type ApprovalRequestType = "direct_message" | "group_invite";
@@ -516,6 +517,14 @@ export interface ServerReadEvent {
516
517
  read_at: Timestamp;
517
518
  };
518
519
  }
520
+ export interface ServerSecurityNoticeEvent {
521
+ type: "security_notice";
522
+ event_id: Id;
523
+ chat_id: null;
524
+ data: {
525
+ type: "password_reset";
526
+ };
527
+ }
519
528
  /**
520
529
  * A user started or stopped typing.
521
530
  */
@@ -249,6 +249,118 @@
249
249
  }
250
250
  }
251
251
  },
252
+ "RecoverWithKeyRequest": {
253
+ "type": "object",
254
+ "required": [
255
+ "username",
256
+ "recovery_key",
257
+ "new_password"
258
+ ],
259
+ "properties": {
260
+ "username": {
261
+ "type": "string",
262
+ "maxLength": 64
263
+ },
264
+ "recovery_key": {
265
+ "type": "string",
266
+ "maxLength": 128
267
+ },
268
+ "new_password": {
269
+ "type": "string",
270
+ "minLength": 8,
271
+ "maxLength": 128
272
+ },
273
+ "code": {
274
+ "type": "string",
275
+ "maxLength": 128
276
+ }
277
+ }
278
+ },
279
+ "ReplaceRecoveryKeyRequest": {
280
+ "type": "object",
281
+ "required": [
282
+ "password"
283
+ ],
284
+ "properties": {
285
+ "password": {
286
+ "type": "string",
287
+ "maxLength": 128
288
+ },
289
+ "code": {
290
+ "type": "string",
291
+ "maxLength": 128
292
+ }
293
+ }
294
+ },
295
+ "RecoveryKeyResult": {
296
+ "type": "object",
297
+ "required": [
298
+ "recovery_key"
299
+ ],
300
+ "properties": {
301
+ "recovery_key": {
302
+ "type": "string"
303
+ }
304
+ }
305
+ },
306
+ "RecoveryKeyStatus": {
307
+ "type": "object",
308
+ "required": [
309
+ "exists",
310
+ "created_at",
311
+ "locked_until"
312
+ ],
313
+ "properties": {
314
+ "exists": {
315
+ "type": "boolean"
316
+ },
317
+ "created_at": {
318
+ "type": [
319
+ "string",
320
+ "null"
321
+ ],
322
+ "format": "date-time"
323
+ },
324
+ "locked_until": {
325
+ "type": [
326
+ "string",
327
+ "null"
328
+ ],
329
+ "format": "date-time"
330
+ }
331
+ }
332
+ },
333
+ "SecurityEventPage": {
334
+ "type": "object",
335
+ "required": [
336
+ "items"
337
+ ],
338
+ "properties": {
339
+ "items": {
340
+ "type": "array",
341
+ "items": {
342
+ "type": "object",
343
+ "required": [
344
+ "id",
345
+ "type",
346
+ "created_at"
347
+ ],
348
+ "properties": {
349
+ "id": {
350
+ "$ref": "#/$defs/Id"
351
+ },
352
+ "type": {
353
+ "type": "string"
354
+ },
355
+ "created_at": {
356
+ "type": "string",
357
+ "format": "date-time"
358
+ }
359
+ }
360
+ }
361
+ }
362
+ }
363
+ },
252
364
  "RegisterResponse": {
253
365
  "allOf": [
254
366
  {
@@ -258,6 +370,10 @@
258
370
  "type": "object",
259
371
  "description": "Recovery parts of the temporary recovery flow (redesigned in release 1.1).",
260
372
  "properties": {
373
+ "recovery_key": {
374
+ "type": "string",
375
+ "description": "Shown once; only a keyed hash is stored"
376
+ },
261
377
  "device_part": {
262
378
  "type": "string"
263
379
  },
@@ -761,6 +877,9 @@
761
877
  "properties": {
762
878
  "created_at": {
763
879
  "$ref": "#/$defs/Timestamp"
880
+ },
881
+ "recovery_setup_required": {
882
+ "type": "boolean"
764
883
  }
765
884
  }
766
885
  }
@@ -2637,6 +2756,38 @@
2637
2756
  "data"
2638
2757
  ]
2639
2758
  },
2759
+ "ServerSecurityNoticeEvent": {
2760
+ "title": "ServerSecurityNoticeEvent",
2761
+ "type": "object",
2762
+ "required": [
2763
+ "type",
2764
+ "event_id",
2765
+ "chat_id",
2766
+ "data"
2767
+ ],
2768
+ "properties": {
2769
+ "type": {
2770
+ "const": "security_notice"
2771
+ },
2772
+ "event_id": {
2773
+ "$ref": "#/$defs/Id"
2774
+ },
2775
+ "chat_id": {
2776
+ "type": "null"
2777
+ },
2778
+ "data": {
2779
+ "type": "object",
2780
+ "required": [
2781
+ "type"
2782
+ ],
2783
+ "properties": {
2784
+ "type": {
2785
+ "const": "password_reset"
2786
+ }
2787
+ }
2788
+ }
2789
+ }
2790
+ },
2640
2791
  "ServerTypingEvent": {
2641
2792
  "title": "ServerTypingEvent",
2642
2793
  "description": "A user started or stopped typing.",
@@ -2756,6 +2907,9 @@
2756
2907
  {
2757
2908
  "$ref": "#/$defs/ServerReadEvent"
2758
2909
  },
2910
+ {
2911
+ "$ref": "#/$defs/ServerSecurityNoticeEvent"
2912
+ },
2759
2913
  {
2760
2914
  "$ref": "#/$defs/ServerTypingEvent"
2761
2915
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@myronsi/messenger-api",
3
- "version": "2.0.0-alpha.8",
3
+ "version": "2.1.0-alpha.1",
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": {