@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 +48 -0
- package/dist/index.d.ts +2 -2
- package/dist/index.js +1 -1
- package/dist/openapi.yaml +1718 -105
- package/dist/schema.d.ts +4239 -1814
- package/dist/ws-docs.json +30 -0
- package/dist/ws-events.d.ts +69 -1
- package/dist/ws-events.schema.json +833 -153
- package/package.json +1 -1
|
@@ -484,7 +484,8 @@
|
|
|
484
484
|
"required": [
|
|
485
485
|
"id",
|
|
486
486
|
"type",
|
|
487
|
-
"created_at"
|
|
487
|
+
"created_at",
|
|
488
|
+
"location"
|
|
488
489
|
],
|
|
489
490
|
"properties": {
|
|
490
491
|
"id": {
|
|
@@ -496,6 +497,24 @@
|
|
|
496
497
|
"created_at": {
|
|
497
498
|
"type": "string",
|
|
498
499
|
"format": "date-time"
|
|
500
|
+
},
|
|
501
|
+
"user_agent": {
|
|
502
|
+
"type": [
|
|
503
|
+
"string",
|
|
504
|
+
"null"
|
|
505
|
+
],
|
|
506
|
+
"maxLength": 512
|
|
507
|
+
},
|
|
508
|
+
"location": {
|
|
509
|
+
"description": "Approximate location of the client when the event happened; `null` when unknown.",
|
|
510
|
+
"oneOf": [
|
|
511
|
+
{
|
|
512
|
+
"$ref": "#/$defs/Location"
|
|
513
|
+
},
|
|
514
|
+
{
|
|
515
|
+
"type": "null"
|
|
516
|
+
}
|
|
517
|
+
]
|
|
499
518
|
}
|
|
500
519
|
}
|
|
501
520
|
}
|
|
@@ -509,17 +528,14 @@
|
|
|
509
528
|
},
|
|
510
529
|
{
|
|
511
530
|
"type": "object",
|
|
512
|
-
"description": "
|
|
531
|
+
"description": "The one-time recovery key shown after registration.",
|
|
513
532
|
"properties": {
|
|
514
533
|
"recovery_key": {
|
|
515
534
|
"type": "string",
|
|
516
535
|
"description": "Shown once; only a keyed hash is stored"
|
|
517
536
|
},
|
|
518
|
-
"
|
|
519
|
-
"
|
|
520
|
-
},
|
|
521
|
-
"qr_part": {
|
|
522
|
-
"type": "string"
|
|
537
|
+
"username": {
|
|
538
|
+
"$ref": "#/$defs/Username"
|
|
523
539
|
}
|
|
524
540
|
}
|
|
525
541
|
}
|
|
@@ -551,52 +567,6 @@
|
|
|
551
567
|
}
|
|
552
568
|
]
|
|
553
569
|
},
|
|
554
|
-
"RecoveryRequest": {
|
|
555
|
-
"type": "object",
|
|
556
|
-
"required": [
|
|
557
|
-
"username"
|
|
558
|
-
],
|
|
559
|
-
"properties": {
|
|
560
|
-
"username": {
|
|
561
|
-
"$ref": "#/$defs/Username"
|
|
562
|
-
},
|
|
563
|
-
"device_part": {
|
|
564
|
-
"type": "string"
|
|
565
|
-
},
|
|
566
|
-
"qr_part": {
|
|
567
|
-
"type": "string"
|
|
568
|
-
}
|
|
569
|
-
}
|
|
570
|
-
},
|
|
571
|
-
"RecoveryResponse": {
|
|
572
|
-
"type": "object",
|
|
573
|
-
"required": [
|
|
574
|
-
"recovery_token"
|
|
575
|
-
],
|
|
576
|
-
"properties": {
|
|
577
|
-
"recovery_token": {
|
|
578
|
-
"type": "string"
|
|
579
|
-
}
|
|
580
|
-
}
|
|
581
|
-
},
|
|
582
|
-
"ResetPasswordRequest": {
|
|
583
|
-
"type": "object",
|
|
584
|
-
"required": [
|
|
585
|
-
"recovery_token",
|
|
586
|
-
"new_password"
|
|
587
|
-
],
|
|
588
|
-
"properties": {
|
|
589
|
-
"recovery_token": {
|
|
590
|
-
"type": "string"
|
|
591
|
-
},
|
|
592
|
-
"new_password": {
|
|
593
|
-
"type": "string",
|
|
594
|
-
"minLength": 8,
|
|
595
|
-
"maxLength": 128,
|
|
596
|
-
"writeOnly": true
|
|
597
|
-
}
|
|
598
|
-
}
|
|
599
|
-
},
|
|
600
570
|
"WebSocketTicket": {
|
|
601
571
|
"type": "object",
|
|
602
572
|
"required": [
|
|
@@ -712,7 +682,8 @@
|
|
|
712
682
|
"id",
|
|
713
683
|
"created_at",
|
|
714
684
|
"last_used_at",
|
|
715
|
-
"is_current"
|
|
685
|
+
"is_current",
|
|
686
|
+
"location"
|
|
716
687
|
],
|
|
717
688
|
"properties": {
|
|
718
689
|
"id": {
|
|
@@ -737,6 +708,50 @@
|
|
|
737
708
|
},
|
|
738
709
|
"is_current": {
|
|
739
710
|
"type": "boolean"
|
|
711
|
+
},
|
|
712
|
+
"location": {
|
|
713
|
+
"description": "Approximate location of the device when it signed in or last refreshed its token; `null` when unknown.",
|
|
714
|
+
"oneOf": [
|
|
715
|
+
{
|
|
716
|
+
"$ref": "#/$defs/Location"
|
|
717
|
+
},
|
|
718
|
+
{
|
|
719
|
+
"type": "null"
|
|
720
|
+
}
|
|
721
|
+
]
|
|
722
|
+
}
|
|
723
|
+
}
|
|
724
|
+
},
|
|
725
|
+
"Location": {
|
|
726
|
+
"type": "object",
|
|
727
|
+
"description": "Approximate location of a client address, looked up in an offline GeoIP database (IP geolocation by\nDB-IP, https://db-ip.com, CC BY 4.0). The address itself is never exposed. Each field is `null` when the\ndatabase does not know it; clients localise the country name from `country_code`.\n",
|
|
728
|
+
"required": [
|
|
729
|
+
"city",
|
|
730
|
+
"country_code",
|
|
731
|
+
"country"
|
|
732
|
+
],
|
|
733
|
+
"properties": {
|
|
734
|
+
"city": {
|
|
735
|
+
"type": [
|
|
736
|
+
"string",
|
|
737
|
+
"null"
|
|
738
|
+
],
|
|
739
|
+
"description": "City name in English"
|
|
740
|
+
},
|
|
741
|
+
"country_code": {
|
|
742
|
+
"type": [
|
|
743
|
+
"string",
|
|
744
|
+
"null"
|
|
745
|
+
],
|
|
746
|
+
"pattern": "^[A-Z]{2}$",
|
|
747
|
+
"description": "ISO 3166-1 alpha-2 country code"
|
|
748
|
+
},
|
|
749
|
+
"country": {
|
|
750
|
+
"type": [
|
|
751
|
+
"string",
|
|
752
|
+
"null"
|
|
753
|
+
],
|
|
754
|
+
"description": "Country name in English"
|
|
740
755
|
}
|
|
741
756
|
}
|
|
742
757
|
},
|
|
@@ -785,8 +800,7 @@
|
|
|
785
800
|
"DisableTwoFactorRequest": {
|
|
786
801
|
"type": "object",
|
|
787
802
|
"required": [
|
|
788
|
-
"password"
|
|
789
|
-
"code"
|
|
803
|
+
"password"
|
|
790
804
|
],
|
|
791
805
|
"properties": {
|
|
792
806
|
"password": {
|
|
@@ -2209,126 +2223,656 @@
|
|
|
2209
2223
|
}
|
|
2210
2224
|
}
|
|
2211
2225
|
},
|
|
2212
|
-
"
|
|
2213
|
-
"
|
|
2214
|
-
"
|
|
2226
|
+
"DeviceRecoveryStart": {
|
|
2227
|
+
"type": "object",
|
|
2228
|
+
"required": [
|
|
2229
|
+
"username"
|
|
2230
|
+
],
|
|
2231
|
+
"properties": {
|
|
2232
|
+
"username": {
|
|
2233
|
+
"$ref": "#/$defs/Username"
|
|
2234
|
+
}
|
|
2235
|
+
}
|
|
2236
|
+
},
|
|
2237
|
+
"DeviceRecoveryResult": {
|
|
2215
2238
|
"type": "object",
|
|
2239
|
+
"required": [
|
|
2240
|
+
"request_id",
|
|
2241
|
+
"match_number",
|
|
2242
|
+
"expires_at"
|
|
2243
|
+
],
|
|
2216
2244
|
"properties": {
|
|
2217
|
-
"
|
|
2218
|
-
"
|
|
2219
|
-
|
|
2220
|
-
|
|
2221
|
-
"
|
|
2245
|
+
"request_id": {
|
|
2246
|
+
"type": "string",
|
|
2247
|
+
"minLength": 32,
|
|
2248
|
+
"maxLength": 128,
|
|
2249
|
+
"pattern": "^[A-Za-z0-9_-]+$"
|
|
2222
2250
|
},
|
|
2223
|
-
"
|
|
2224
|
-
"
|
|
2251
|
+
"match_number": {
|
|
2252
|
+
"type": "integer",
|
|
2253
|
+
"minimum": 10,
|
|
2254
|
+
"maximum": 99
|
|
2225
2255
|
},
|
|
2226
|
-
"
|
|
2227
|
-
"type": "
|
|
2228
|
-
"
|
|
2229
|
-
"message_id": {
|
|
2230
|
-
"$ref": "#/$defs/Id"
|
|
2231
|
-
},
|
|
2232
|
-
"scope": {
|
|
2233
|
-
"type": "string",
|
|
2234
|
-
"enum": [
|
|
2235
|
-
"me",
|
|
2236
|
-
"everyone"
|
|
2237
|
-
]
|
|
2238
|
-
}
|
|
2239
|
-
},
|
|
2240
|
-
"required": [
|
|
2241
|
-
"message_id",
|
|
2242
|
-
"scope"
|
|
2243
|
-
],
|
|
2244
|
-
"additionalProperties": false
|
|
2256
|
+
"expires_at": {
|
|
2257
|
+
"type": "string",
|
|
2258
|
+
"format": "date-time"
|
|
2245
2259
|
}
|
|
2246
|
-
}
|
|
2260
|
+
}
|
|
2261
|
+
},
|
|
2262
|
+
"DeviceRecoveryStatus": {
|
|
2263
|
+
"type": "object",
|
|
2247
2264
|
"required": [
|
|
2248
|
-
"
|
|
2249
|
-
"client_temp_id",
|
|
2250
|
-
"chat_id",
|
|
2251
|
-
"data"
|
|
2265
|
+
"status"
|
|
2252
2266
|
],
|
|
2253
|
-
"
|
|
2267
|
+
"properties": {
|
|
2268
|
+
"status": {
|
|
2269
|
+
"type": "string",
|
|
2270
|
+
"enum": [
|
|
2271
|
+
"pending",
|
|
2272
|
+
"approved",
|
|
2273
|
+
"denied",
|
|
2274
|
+
"used",
|
|
2275
|
+
"expired"
|
|
2276
|
+
]
|
|
2277
|
+
}
|
|
2278
|
+
}
|
|
2254
2279
|
},
|
|
2255
|
-
"
|
|
2256
|
-
"title": "ClientEditEvent",
|
|
2257
|
-
"description": "Edit your own text message or the caption of your file. An empty content removes a file's caption.",
|
|
2280
|
+
"DeviceRecoveryApproval": {
|
|
2258
2281
|
"type": "object",
|
|
2282
|
+
"required": [
|
|
2283
|
+
"match_number",
|
|
2284
|
+
"password"
|
|
2285
|
+
],
|
|
2259
2286
|
"properties": {
|
|
2260
|
-
"
|
|
2261
|
-
"
|
|
2262
|
-
|
|
2263
|
-
|
|
2264
|
-
"$ref": "#/$defs/ClientTempId"
|
|
2287
|
+
"match_number": {
|
|
2288
|
+
"type": "integer",
|
|
2289
|
+
"minimum": 10,
|
|
2290
|
+
"maximum": 99
|
|
2265
2291
|
},
|
|
2266
|
-
"
|
|
2267
|
-
"
|
|
2292
|
+
"password": {
|
|
2293
|
+
"type": "string",
|
|
2294
|
+
"maxLength": 1024
|
|
2268
2295
|
},
|
|
2269
|
-
"
|
|
2270
|
-
"type": "
|
|
2271
|
-
"
|
|
2272
|
-
"message_id": {
|
|
2273
|
-
"$ref": "#/$defs/Id"
|
|
2274
|
-
},
|
|
2275
|
-
"content": {
|
|
2276
|
-
"type": "string",
|
|
2277
|
-
"maxLength": 4096
|
|
2278
|
-
}
|
|
2279
|
-
},
|
|
2280
|
-
"required": [
|
|
2281
|
-
"message_id",
|
|
2282
|
-
"content"
|
|
2283
|
-
],
|
|
2284
|
-
"additionalProperties": false
|
|
2296
|
+
"code": {
|
|
2297
|
+
"type": "string",
|
|
2298
|
+
"maxLength": 128
|
|
2285
2299
|
}
|
|
2286
|
-
}
|
|
2300
|
+
}
|
|
2301
|
+
},
|
|
2302
|
+
"DeviceRecoveryComplete": {
|
|
2303
|
+
"type": "object",
|
|
2287
2304
|
"required": [
|
|
2288
|
-
"
|
|
2289
|
-
"client_temp_id",
|
|
2290
|
-
"chat_id",
|
|
2291
|
-
"data"
|
|
2305
|
+
"new_password"
|
|
2292
2306
|
],
|
|
2293
|
-
"
|
|
2307
|
+
"properties": {
|
|
2308
|
+
"new_password": {
|
|
2309
|
+
"type": "string",
|
|
2310
|
+
"minLength": 8,
|
|
2311
|
+
"maxLength": 128,
|
|
2312
|
+
"writeOnly": true
|
|
2313
|
+
}
|
|
2314
|
+
}
|
|
2294
2315
|
},
|
|
2295
|
-
"
|
|
2296
|
-
"
|
|
2297
|
-
"description": "
|
|
2316
|
+
"QrLoginStatus": {
|
|
2317
|
+
"type": "string",
|
|
2318
|
+
"description": "`pending` until a signed-in device opens the request, `scanned` once it did, then `approved` or `denied`.\n`expired` when the request timed out or was used (only in poll answers).\n",
|
|
2319
|
+
"enum": [
|
|
2320
|
+
"pending",
|
|
2321
|
+
"scanned",
|
|
2322
|
+
"approved",
|
|
2323
|
+
"denied",
|
|
2324
|
+
"expired"
|
|
2325
|
+
]
|
|
2326
|
+
},
|
|
2327
|
+
"QrLoginStart": {
|
|
2298
2328
|
"type": "object",
|
|
2329
|
+
"required": [
|
|
2330
|
+
"request_id",
|
|
2331
|
+
"poll_token",
|
|
2332
|
+
"url",
|
|
2333
|
+
"expires_at"
|
|
2334
|
+
],
|
|
2299
2335
|
"properties": {
|
|
2300
|
-
"
|
|
2301
|
-
"
|
|
2336
|
+
"request_id": {
|
|
2337
|
+
"type": "string",
|
|
2338
|
+
"minLength": 32,
|
|
2339
|
+
"maxLength": 128,
|
|
2340
|
+
"pattern": "^[A-Za-z0-9_-]+$"
|
|
2302
2341
|
},
|
|
2303
|
-
"
|
|
2304
|
-
"
|
|
2342
|
+
"poll_token": {
|
|
2343
|
+
"type": "string",
|
|
2344
|
+
"minLength": 32,
|
|
2345
|
+
"maxLength": 128,
|
|
2346
|
+
"pattern": "^[A-Za-z0-9_-]+$",
|
|
2347
|
+
"description": "Secret of the requesting device; only a keyed hash is stored."
|
|
2305
2348
|
},
|
|
2306
|
-
"
|
|
2307
|
-
"
|
|
2349
|
+
"url": {
|
|
2350
|
+
"type": "string",
|
|
2351
|
+
"description": "`<RECOVERY_WEB_URL>/qr/<request_id>`, the content of the QR code."
|
|
2308
2352
|
},
|
|
2309
|
-
"
|
|
2353
|
+
"expires_at": {
|
|
2354
|
+
"$ref": "#/$defs/Timestamp"
|
|
2355
|
+
}
|
|
2356
|
+
}
|
|
2357
|
+
},
|
|
2358
|
+
"QrLoginRequest": {
|
|
2359
|
+
"type": "object",
|
|
2360
|
+
"required": [
|
|
2361
|
+
"request_id",
|
|
2362
|
+
"status",
|
|
2363
|
+
"device",
|
|
2364
|
+
"location",
|
|
2365
|
+
"created_at",
|
|
2366
|
+
"expires_at"
|
|
2367
|
+
],
|
|
2368
|
+
"properties": {
|
|
2369
|
+
"request_id": {
|
|
2370
|
+
"type": "string"
|
|
2371
|
+
},
|
|
2372
|
+
"status": {
|
|
2373
|
+
"$ref": "#/$defs/QrLoginStatus"
|
|
2374
|
+
},
|
|
2375
|
+
"device": {
|
|
2376
|
+
"type": [
|
|
2377
|
+
"string",
|
|
2378
|
+
"null"
|
|
2379
|
+
],
|
|
2380
|
+
"maxLength": 512,
|
|
2381
|
+
"description": "User agent of the device that asks to sign in; `null` when it sent none."
|
|
2382
|
+
},
|
|
2383
|
+
"location": {
|
|
2384
|
+
"description": "Approximate location of the device that asks to sign in; `null` when unknown.",
|
|
2310
2385
|
"oneOf": [
|
|
2311
2386
|
{
|
|
2312
|
-
"
|
|
2313
|
-
|
|
2314
|
-
|
|
2315
|
-
|
|
2316
|
-
|
|
2317
|
-
|
|
2318
|
-
|
|
2319
|
-
|
|
2320
|
-
|
|
2321
|
-
|
|
2322
|
-
|
|
2323
|
-
|
|
2324
|
-
|
|
2325
|
-
|
|
2326
|
-
|
|
2327
|
-
|
|
2328
|
-
|
|
2329
|
-
|
|
2330
|
-
|
|
2331
|
-
|
|
2387
|
+
"$ref": "#/$defs/Location"
|
|
2388
|
+
},
|
|
2389
|
+
{
|
|
2390
|
+
"type": "null"
|
|
2391
|
+
}
|
|
2392
|
+
]
|
|
2393
|
+
},
|
|
2394
|
+
"created_at": {
|
|
2395
|
+
"$ref": "#/$defs/Timestamp"
|
|
2396
|
+
},
|
|
2397
|
+
"expires_at": {
|
|
2398
|
+
"$ref": "#/$defs/Timestamp"
|
|
2399
|
+
}
|
|
2400
|
+
}
|
|
2401
|
+
},
|
|
2402
|
+
"QrLoginPollRequest": {
|
|
2403
|
+
"type": "object",
|
|
2404
|
+
"required": [
|
|
2405
|
+
"poll_token"
|
|
2406
|
+
],
|
|
2407
|
+
"properties": {
|
|
2408
|
+
"poll_token": {
|
|
2409
|
+
"type": "string",
|
|
2410
|
+
"maxLength": 128,
|
|
2411
|
+
"writeOnly": true
|
|
2412
|
+
}
|
|
2413
|
+
}
|
|
2414
|
+
},
|
|
2415
|
+
"QrLoginPollResult": {
|
|
2416
|
+
"oneOf": [
|
|
2417
|
+
{
|
|
2418
|
+
"type": "object",
|
|
2419
|
+
"required": [
|
|
2420
|
+
"status"
|
|
2421
|
+
],
|
|
2422
|
+
"properties": {
|
|
2423
|
+
"status": {
|
|
2424
|
+
"type": "string",
|
|
2425
|
+
"enum": [
|
|
2426
|
+
"pending",
|
|
2427
|
+
"scanned",
|
|
2428
|
+
"denied",
|
|
2429
|
+
"expired"
|
|
2430
|
+
]
|
|
2431
|
+
}
|
|
2432
|
+
}
|
|
2433
|
+
},
|
|
2434
|
+
{
|
|
2435
|
+
"allOf": [
|
|
2436
|
+
{
|
|
2437
|
+
"$ref": "#/$defs/TokenResponse"
|
|
2438
|
+
},
|
|
2439
|
+
{
|
|
2440
|
+
"type": "object",
|
|
2441
|
+
"required": [
|
|
2442
|
+
"status"
|
|
2443
|
+
],
|
|
2444
|
+
"properties": {
|
|
2445
|
+
"status": {
|
|
2446
|
+
"type": "string",
|
|
2447
|
+
"const": "approved"
|
|
2448
|
+
}
|
|
2449
|
+
}
|
|
2450
|
+
}
|
|
2451
|
+
]
|
|
2452
|
+
}
|
|
2453
|
+
]
|
|
2454
|
+
},
|
|
2455
|
+
"QrLoginApproval": {
|
|
2456
|
+
"type": "object",
|
|
2457
|
+
"properties": {
|
|
2458
|
+
"code": {
|
|
2459
|
+
"type": "string",
|
|
2460
|
+
"maxLength": 128,
|
|
2461
|
+
"description": "An authenticator code or an unused recovery code; required when two-factor is on."
|
|
2462
|
+
}
|
|
2463
|
+
}
|
|
2464
|
+
},
|
|
2465
|
+
"PasskeyOptions": {
|
|
2466
|
+
"type": "object",
|
|
2467
|
+
"required": [
|
|
2468
|
+
"challenge_id",
|
|
2469
|
+
"public_key"
|
|
2470
|
+
],
|
|
2471
|
+
"properties": {
|
|
2472
|
+
"challenge_id": {
|
|
2473
|
+
"type": "string",
|
|
2474
|
+
"minLength": 32,
|
|
2475
|
+
"maxLength": 128
|
|
2476
|
+
},
|
|
2477
|
+
"public_key": {
|
|
2478
|
+
"type": "object",
|
|
2479
|
+
"additionalProperties": true
|
|
2480
|
+
}
|
|
2481
|
+
}
|
|
2482
|
+
},
|
|
2483
|
+
"PasskeyRegistration": {
|
|
2484
|
+
"type": "object",
|
|
2485
|
+
"required": [
|
|
2486
|
+
"password",
|
|
2487
|
+
"name"
|
|
2488
|
+
],
|
|
2489
|
+
"properties": {
|
|
2490
|
+
"password": {
|
|
2491
|
+
"type": "string",
|
|
2492
|
+
"maxLength": 128,
|
|
2493
|
+
"writeOnly": true
|
|
2494
|
+
},
|
|
2495
|
+
"code": {
|
|
2496
|
+
"type": "string",
|
|
2497
|
+
"maxLength": 128
|
|
2498
|
+
},
|
|
2499
|
+
"name": {
|
|
2500
|
+
"type": "string",
|
|
2501
|
+
"minLength": 1,
|
|
2502
|
+
"maxLength": 64
|
|
2503
|
+
}
|
|
2504
|
+
}
|
|
2505
|
+
},
|
|
2506
|
+
"PasskeyVerification": {
|
|
2507
|
+
"type": "object",
|
|
2508
|
+
"required": [
|
|
2509
|
+
"challenge_id",
|
|
2510
|
+
"credential"
|
|
2511
|
+
],
|
|
2512
|
+
"properties": {
|
|
2513
|
+
"challenge_id": {
|
|
2514
|
+
"type": "string",
|
|
2515
|
+
"minLength": 32,
|
|
2516
|
+
"maxLength": 128
|
|
2517
|
+
},
|
|
2518
|
+
"credential": {
|
|
2519
|
+
"type": "object",
|
|
2520
|
+
"additionalProperties": true
|
|
2521
|
+
}
|
|
2522
|
+
}
|
|
2523
|
+
},
|
|
2524
|
+
"PasskeyLoginOptions": {
|
|
2525
|
+
"type": "object",
|
|
2526
|
+
"required": [],
|
|
2527
|
+
"properties": {
|
|
2528
|
+
"username": {
|
|
2529
|
+
"$ref": "#/$defs/Username"
|
|
2530
|
+
}
|
|
2531
|
+
}
|
|
2532
|
+
},
|
|
2533
|
+
"PasskeyRename": {
|
|
2534
|
+
"type": "object",
|
|
2535
|
+
"required": [
|
|
2536
|
+
"name"
|
|
2537
|
+
],
|
|
2538
|
+
"properties": {
|
|
2539
|
+
"name": {
|
|
2540
|
+
"type": "string",
|
|
2541
|
+
"minLength": 1,
|
|
2542
|
+
"maxLength": 64
|
|
2543
|
+
}
|
|
2544
|
+
}
|
|
2545
|
+
},
|
|
2546
|
+
"PasskeyRemoval": {
|
|
2547
|
+
"type": "object",
|
|
2548
|
+
"required": [],
|
|
2549
|
+
"properties": {
|
|
2550
|
+
"password": {
|
|
2551
|
+
"type": "string",
|
|
2552
|
+
"maxLength": 128,
|
|
2553
|
+
"writeOnly": true
|
|
2554
|
+
}
|
|
2555
|
+
}
|
|
2556
|
+
},
|
|
2557
|
+
"Passkey": {
|
|
2558
|
+
"type": "object",
|
|
2559
|
+
"required": [
|
|
2560
|
+
"id",
|
|
2561
|
+
"name",
|
|
2562
|
+
"created_at",
|
|
2563
|
+
"last_used_at"
|
|
2564
|
+
],
|
|
2565
|
+
"properties": {
|
|
2566
|
+
"id": {
|
|
2567
|
+
"type": "string"
|
|
2568
|
+
},
|
|
2569
|
+
"name": {
|
|
2570
|
+
"type": "string",
|
|
2571
|
+
"minLength": 1,
|
|
2572
|
+
"maxLength": 64
|
|
2573
|
+
},
|
|
2574
|
+
"created_at": {
|
|
2575
|
+
"type": "string",
|
|
2576
|
+
"format": "date-time"
|
|
2577
|
+
},
|
|
2578
|
+
"last_used_at": {
|
|
2579
|
+
"type": [
|
|
2580
|
+
"string",
|
|
2581
|
+
"null"
|
|
2582
|
+
],
|
|
2583
|
+
"format": "date-time"
|
|
2584
|
+
}
|
|
2585
|
+
}
|
|
2586
|
+
},
|
|
2587
|
+
"PasskeyPage": {
|
|
2588
|
+
"type": "object",
|
|
2589
|
+
"required": [
|
|
2590
|
+
"items"
|
|
2591
|
+
],
|
|
2592
|
+
"properties": {
|
|
2593
|
+
"items": {
|
|
2594
|
+
"type": "array",
|
|
2595
|
+
"items": {
|
|
2596
|
+
"$ref": "#/$defs/Passkey"
|
|
2597
|
+
}
|
|
2598
|
+
}
|
|
2599
|
+
}
|
|
2600
|
+
},
|
|
2601
|
+
"RecoveryEmailStatus": {
|
|
2602
|
+
"type": "object",
|
|
2603
|
+
"required": [
|
|
2604
|
+
"address",
|
|
2605
|
+
"state",
|
|
2606
|
+
"enabled"
|
|
2607
|
+
],
|
|
2608
|
+
"properties": {
|
|
2609
|
+
"address": {
|
|
2610
|
+
"type": "string"
|
|
2611
|
+
},
|
|
2612
|
+
"state": {
|
|
2613
|
+
"type": "string",
|
|
2614
|
+
"enum": [
|
|
2615
|
+
"not_added",
|
|
2616
|
+
"pending",
|
|
2617
|
+
"verified"
|
|
2618
|
+
]
|
|
2619
|
+
},
|
|
2620
|
+
"enabled": {
|
|
2621
|
+
"type": "boolean"
|
|
2622
|
+
}
|
|
2623
|
+
}
|
|
2624
|
+
},
|
|
2625
|
+
"RecoveryOverview": {
|
|
2626
|
+
"type": "object",
|
|
2627
|
+
"required": [
|
|
2628
|
+
"recovery_key",
|
|
2629
|
+
"other_devices",
|
|
2630
|
+
"passkeys",
|
|
2631
|
+
"passkeys_enabled",
|
|
2632
|
+
"email"
|
|
2633
|
+
],
|
|
2634
|
+
"properties": {
|
|
2635
|
+
"recovery_key": {
|
|
2636
|
+
"$ref": "#/$defs/RecoveryKeyStatus"
|
|
2637
|
+
},
|
|
2638
|
+
"other_devices": {
|
|
2639
|
+
"type": "integer",
|
|
2640
|
+
"minimum": 0
|
|
2641
|
+
},
|
|
2642
|
+
"passkeys": {
|
|
2643
|
+
"type": "integer",
|
|
2644
|
+
"minimum": 0
|
|
2645
|
+
},
|
|
2646
|
+
"passkeys_enabled": {
|
|
2647
|
+
"type": "boolean"
|
|
2648
|
+
},
|
|
2649
|
+
"email": {
|
|
2650
|
+
"$ref": "#/$defs/RecoveryEmailStatus"
|
|
2651
|
+
}
|
|
2652
|
+
}
|
|
2653
|
+
},
|
|
2654
|
+
"SetRecoveryEmail": {
|
|
2655
|
+
"type": "object",
|
|
2656
|
+
"required": [
|
|
2657
|
+
"email",
|
|
2658
|
+
"password"
|
|
2659
|
+
],
|
|
2660
|
+
"properties": {
|
|
2661
|
+
"email": {
|
|
2662
|
+
"type": "string",
|
|
2663
|
+
"format": "email",
|
|
2664
|
+
"maxLength": 254
|
|
2665
|
+
},
|
|
2666
|
+
"password": {
|
|
2667
|
+
"type": "string",
|
|
2668
|
+
"minLength": 8,
|
|
2669
|
+
"maxLength": 128,
|
|
2670
|
+
"writeOnly": true
|
|
2671
|
+
},
|
|
2672
|
+
"code": {
|
|
2673
|
+
"type": "string",
|
|
2674
|
+
"maxLength": 128
|
|
2675
|
+
}
|
|
2676
|
+
}
|
|
2677
|
+
},
|
|
2678
|
+
"RemoveRecoveryEmail": {
|
|
2679
|
+
"type": "object",
|
|
2680
|
+
"required": [
|
|
2681
|
+
"password"
|
|
2682
|
+
],
|
|
2683
|
+
"properties": {
|
|
2684
|
+
"password": {
|
|
2685
|
+
"type": "string",
|
|
2686
|
+
"minLength": 8,
|
|
2687
|
+
"maxLength": 128,
|
|
2688
|
+
"writeOnly": true
|
|
2689
|
+
},
|
|
2690
|
+
"code": {
|
|
2691
|
+
"type": "string",
|
|
2692
|
+
"maxLength": 128
|
|
2693
|
+
}
|
|
2694
|
+
}
|
|
2695
|
+
},
|
|
2696
|
+
"VerifyRecoveryEmail": {
|
|
2697
|
+
"type": "object",
|
|
2698
|
+
"required": [
|
|
2699
|
+
"token"
|
|
2700
|
+
],
|
|
2701
|
+
"properties": {
|
|
2702
|
+
"token": {
|
|
2703
|
+
"type": "string",
|
|
2704
|
+
"minLength": 32,
|
|
2705
|
+
"maxLength": 128
|
|
2706
|
+
}
|
|
2707
|
+
}
|
|
2708
|
+
},
|
|
2709
|
+
"EmailResetRequest": {
|
|
2710
|
+
"type": "object",
|
|
2711
|
+
"required": [
|
|
2712
|
+
"username_or_email"
|
|
2713
|
+
],
|
|
2714
|
+
"properties": {
|
|
2715
|
+
"username_or_email": {
|
|
2716
|
+
"type": "string",
|
|
2717
|
+
"maxLength": 254
|
|
2718
|
+
}
|
|
2719
|
+
}
|
|
2720
|
+
},
|
|
2721
|
+
"EmailResetConfirmation": {
|
|
2722
|
+
"type": "object",
|
|
2723
|
+
"required": [
|
|
2724
|
+
"token",
|
|
2725
|
+
"new_password"
|
|
2726
|
+
],
|
|
2727
|
+
"properties": {
|
|
2728
|
+
"token": {
|
|
2729
|
+
"type": "string",
|
|
2730
|
+
"minLength": 32,
|
|
2731
|
+
"maxLength": 128
|
|
2732
|
+
},
|
|
2733
|
+
"new_password": {
|
|
2734
|
+
"type": "string",
|
|
2735
|
+
"minLength": 8,
|
|
2736
|
+
"maxLength": 128,
|
|
2737
|
+
"writeOnly": true
|
|
2738
|
+
},
|
|
2739
|
+
"code": {
|
|
2740
|
+
"type": "string",
|
|
2741
|
+
"maxLength": 128
|
|
2742
|
+
}
|
|
2743
|
+
}
|
|
2744
|
+
},
|
|
2745
|
+
"EmailResetAccepted": {
|
|
2746
|
+
"type": "object",
|
|
2747
|
+
"required": [
|
|
2748
|
+
"message"
|
|
2749
|
+
],
|
|
2750
|
+
"properties": {
|
|
2751
|
+
"message": {
|
|
2752
|
+
"type": "string"
|
|
2753
|
+
}
|
|
2754
|
+
}
|
|
2755
|
+
},
|
|
2756
|
+
"ClientDeleteEvent": {
|
|
2757
|
+
"title": "ClientDeleteEvent",
|
|
2758
|
+
"description": "Delete a message for yourself or for everyone.",
|
|
2759
|
+
"type": "object",
|
|
2760
|
+
"properties": {
|
|
2761
|
+
"type": {
|
|
2762
|
+
"const": "delete"
|
|
2763
|
+
},
|
|
2764
|
+
"client_temp_id": {
|
|
2765
|
+
"$ref": "#/$defs/ClientTempId"
|
|
2766
|
+
},
|
|
2767
|
+
"chat_id": {
|
|
2768
|
+
"$ref": "#/$defs/Id"
|
|
2769
|
+
},
|
|
2770
|
+
"data": {
|
|
2771
|
+
"type": "object",
|
|
2772
|
+
"properties": {
|
|
2773
|
+
"message_id": {
|
|
2774
|
+
"$ref": "#/$defs/Id"
|
|
2775
|
+
},
|
|
2776
|
+
"scope": {
|
|
2777
|
+
"type": "string",
|
|
2778
|
+
"enum": [
|
|
2779
|
+
"me",
|
|
2780
|
+
"everyone"
|
|
2781
|
+
]
|
|
2782
|
+
}
|
|
2783
|
+
},
|
|
2784
|
+
"required": [
|
|
2785
|
+
"message_id",
|
|
2786
|
+
"scope"
|
|
2787
|
+
],
|
|
2788
|
+
"additionalProperties": false
|
|
2789
|
+
}
|
|
2790
|
+
},
|
|
2791
|
+
"required": [
|
|
2792
|
+
"type",
|
|
2793
|
+
"client_temp_id",
|
|
2794
|
+
"chat_id",
|
|
2795
|
+
"data"
|
|
2796
|
+
],
|
|
2797
|
+
"additionalProperties": false
|
|
2798
|
+
},
|
|
2799
|
+
"ClientEditEvent": {
|
|
2800
|
+
"title": "ClientEditEvent",
|
|
2801
|
+
"description": "Edit your own text message or the caption of your file. An empty content removes a file's caption.",
|
|
2802
|
+
"type": "object",
|
|
2803
|
+
"properties": {
|
|
2804
|
+
"type": {
|
|
2805
|
+
"const": "edit"
|
|
2806
|
+
},
|
|
2807
|
+
"client_temp_id": {
|
|
2808
|
+
"$ref": "#/$defs/ClientTempId"
|
|
2809
|
+
},
|
|
2810
|
+
"chat_id": {
|
|
2811
|
+
"$ref": "#/$defs/Id"
|
|
2812
|
+
},
|
|
2813
|
+
"data": {
|
|
2814
|
+
"type": "object",
|
|
2815
|
+
"properties": {
|
|
2816
|
+
"message_id": {
|
|
2817
|
+
"$ref": "#/$defs/Id"
|
|
2818
|
+
},
|
|
2819
|
+
"content": {
|
|
2820
|
+
"type": "string",
|
|
2821
|
+
"maxLength": 4096
|
|
2822
|
+
}
|
|
2823
|
+
},
|
|
2824
|
+
"required": [
|
|
2825
|
+
"message_id",
|
|
2826
|
+
"content"
|
|
2827
|
+
],
|
|
2828
|
+
"additionalProperties": false
|
|
2829
|
+
}
|
|
2830
|
+
},
|
|
2831
|
+
"required": [
|
|
2832
|
+
"type",
|
|
2833
|
+
"client_temp_id",
|
|
2834
|
+
"chat_id",
|
|
2835
|
+
"data"
|
|
2836
|
+
],
|
|
2837
|
+
"additionalProperties": false
|
|
2838
|
+
},
|
|
2839
|
+
"ClientMessageEvent": {
|
|
2840
|
+
"title": "ClientMessageEvent",
|
|
2841
|
+
"description": "Send a message. Idempotent per `client_temp_id`; answered with `ack` or `error`.",
|
|
2842
|
+
"type": "object",
|
|
2843
|
+
"properties": {
|
|
2844
|
+
"type": {
|
|
2845
|
+
"const": "message"
|
|
2846
|
+
},
|
|
2847
|
+
"client_temp_id": {
|
|
2848
|
+
"$ref": "#/$defs/ClientTempId"
|
|
2849
|
+
},
|
|
2850
|
+
"chat_id": {
|
|
2851
|
+
"$ref": "#/$defs/Id"
|
|
2852
|
+
},
|
|
2853
|
+
"data": {
|
|
2854
|
+
"oneOf": [
|
|
2855
|
+
{
|
|
2856
|
+
"type": "object",
|
|
2857
|
+
"title": "TextMessageData",
|
|
2858
|
+
"properties": {
|
|
2859
|
+
"type": {
|
|
2860
|
+
"const": "text"
|
|
2861
|
+
},
|
|
2862
|
+
"content": {
|
|
2863
|
+
"type": "string",
|
|
2864
|
+
"minLength": 1,
|
|
2865
|
+
"maxLength": 4096
|
|
2866
|
+
},
|
|
2867
|
+
"reply_to": {
|
|
2868
|
+
"oneOf": [
|
|
2869
|
+
{
|
|
2870
|
+
"$ref": "#/$defs/Id"
|
|
2871
|
+
},
|
|
2872
|
+
{
|
|
2873
|
+
"type": "null"
|
|
2874
|
+
}
|
|
2875
|
+
]
|
|
2332
2876
|
}
|
|
2333
2877
|
},
|
|
2334
2878
|
"required": [
|
|
@@ -3185,6 +3729,136 @@
|
|
|
3185
3729
|
"data"
|
|
3186
3730
|
]
|
|
3187
3731
|
},
|
|
3732
|
+
"ServerRecoveryRequestEvent": {
|
|
3733
|
+
"title": "ServerRecoveryRequestEvent",
|
|
3734
|
+
"type": "object",
|
|
3735
|
+
"required": [
|
|
3736
|
+
"type",
|
|
3737
|
+
"event_id",
|
|
3738
|
+
"chat_id",
|
|
3739
|
+
"data"
|
|
3740
|
+
],
|
|
3741
|
+
"additionalProperties": false,
|
|
3742
|
+
"properties": {
|
|
3743
|
+
"type": {
|
|
3744
|
+
"const": "recovery_request"
|
|
3745
|
+
},
|
|
3746
|
+
"event_id": {
|
|
3747
|
+
"type": "string",
|
|
3748
|
+
"pattern": "^[0-9]+$"
|
|
3749
|
+
},
|
|
3750
|
+
"chat_id": {
|
|
3751
|
+
"type": "null"
|
|
3752
|
+
},
|
|
3753
|
+
"data": {
|
|
3754
|
+
"type": "object",
|
|
3755
|
+
"required": [
|
|
3756
|
+
"request_id",
|
|
3757
|
+
"user_agent",
|
|
3758
|
+
"location",
|
|
3759
|
+
"choices",
|
|
3760
|
+
"expires_at"
|
|
3761
|
+
],
|
|
3762
|
+
"properties": {
|
|
3763
|
+
"request_id": {
|
|
3764
|
+
"description": "Approval handle for POST /auth/recovery-requests/{requestId}/approve and /deny. It is not the requester's capability.",
|
|
3765
|
+
"type": "string",
|
|
3766
|
+
"minLength": 32,
|
|
3767
|
+
"maxLength": 128,
|
|
3768
|
+
"pattern": "^[A-Za-z0-9_-]+$"
|
|
3769
|
+
},
|
|
3770
|
+
"user_agent": {
|
|
3771
|
+
"type": "string"
|
|
3772
|
+
},
|
|
3773
|
+
"location": {
|
|
3774
|
+
"oneOf": [
|
|
3775
|
+
{
|
|
3776
|
+
"$ref": "#/$defs/Location"
|
|
3777
|
+
},
|
|
3778
|
+
{
|
|
3779
|
+
"type": "null"
|
|
3780
|
+
}
|
|
3781
|
+
]
|
|
3782
|
+
},
|
|
3783
|
+
"choices": {
|
|
3784
|
+
"type": "array",
|
|
3785
|
+
"minItems": 3,
|
|
3786
|
+
"maxItems": 3,
|
|
3787
|
+
"uniqueItems": true,
|
|
3788
|
+
"items": {
|
|
3789
|
+
"type": "integer",
|
|
3790
|
+
"minimum": 10,
|
|
3791
|
+
"maximum": 99
|
|
3792
|
+
}
|
|
3793
|
+
},
|
|
3794
|
+
"expires_at": {
|
|
3795
|
+
"type": "string",
|
|
3796
|
+
"format": "date-time"
|
|
3797
|
+
}
|
|
3798
|
+
}
|
|
3799
|
+
}
|
|
3800
|
+
}
|
|
3801
|
+
},
|
|
3802
|
+
"ServerSecurityAlertEvent": {
|
|
3803
|
+
"title": "ServerSecurityAlertEvent",
|
|
3804
|
+
"type": "object",
|
|
3805
|
+
"required": [
|
|
3806
|
+
"type",
|
|
3807
|
+
"event_id",
|
|
3808
|
+
"chat_id",
|
|
3809
|
+
"data"
|
|
3810
|
+
],
|
|
3811
|
+
"properties": {
|
|
3812
|
+
"type": {
|
|
3813
|
+
"const": "security_alert"
|
|
3814
|
+
},
|
|
3815
|
+
"event_id": {
|
|
3816
|
+
"$ref": "#/$defs/Id"
|
|
3817
|
+
},
|
|
3818
|
+
"chat_id": {
|
|
3819
|
+
"type": "null"
|
|
3820
|
+
},
|
|
3821
|
+
"data": {
|
|
3822
|
+
"type": "object",
|
|
3823
|
+
"required": [
|
|
3824
|
+
"type"
|
|
3825
|
+
],
|
|
3826
|
+
"properties": {
|
|
3827
|
+
"type": {
|
|
3828
|
+
"type": "string",
|
|
3829
|
+
"enum": [
|
|
3830
|
+
"password_changed",
|
|
3831
|
+
"recovery_key_changed",
|
|
3832
|
+
"2fa_enabled",
|
|
3833
|
+
"2fa_disabled",
|
|
3834
|
+
"passkey_added",
|
|
3835
|
+
"passkey_removed",
|
|
3836
|
+
"recovery_email_changed",
|
|
3837
|
+
"recovery_email_removed",
|
|
3838
|
+
"passkey_counter_warning",
|
|
3839
|
+
"login",
|
|
3840
|
+
"login_2fa",
|
|
3841
|
+
"passkey_login",
|
|
3842
|
+
"qr_login_approved"
|
|
3843
|
+
]
|
|
3844
|
+
},
|
|
3845
|
+
"user_agent": {
|
|
3846
|
+
"type": "string",
|
|
3847
|
+
"maxLength": 512
|
|
3848
|
+
},
|
|
3849
|
+
"created_at": {
|
|
3850
|
+
"type": "string",
|
|
3851
|
+
"format": "date-time"
|
|
3852
|
+
},
|
|
3853
|
+
"session_id": {
|
|
3854
|
+
"description": "The session that made the change, when a signed-in session made it. Clients skip alerts for their own session.",
|
|
3855
|
+
"type": "string",
|
|
3856
|
+
"format": "uuid"
|
|
3857
|
+
}
|
|
3858
|
+
}
|
|
3859
|
+
}
|
|
3860
|
+
}
|
|
3861
|
+
},
|
|
3188
3862
|
"ServerSecurityNoticeEvent": {
|
|
3189
3863
|
"title": "ServerSecurityNoticeEvent",
|
|
3190
3864
|
"type": "object",
|
|
@@ -3336,6 +4010,12 @@
|
|
|
3336
4010
|
{
|
|
3337
4011
|
"$ref": "#/$defs/ServerReadEvent"
|
|
3338
4012
|
},
|
|
4013
|
+
{
|
|
4014
|
+
"$ref": "#/$defs/ServerRecoveryRequestEvent"
|
|
4015
|
+
},
|
|
4016
|
+
{
|
|
4017
|
+
"$ref": "#/$defs/ServerSecurityAlertEvent"
|
|
4018
|
+
},
|
|
3339
4019
|
{
|
|
3340
4020
|
"$ref": "#/$defs/ServerSecurityNoticeEvent"
|
|
3341
4021
|
},
|