@myronsi/messenger-api 2.1.0-alpha.1 → 2.1.0-alpha.10
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 +65 -0
- package/dist/index.d.ts +2 -2
- package/dist/index.js +1 -1
- package/dist/openapi.yaml +485 -8
- package/dist/schema.d.ts +684 -28
- package/dist/ws-docs.json +1 -1
- package/dist/ws-events.d.ts +21 -3
- package/dist/ws-events.schema.json +253 -7
- package/package.json +1 -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.1.0-alpha.
|
|
4
|
+
version: 2.1.0-alpha.10
|
|
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
|
|
@@ -444,6 +444,33 @@ paths:
|
|
|
444
444
|
"400": { $ref: "#/components/responses/BadRequest" }
|
|
445
445
|
"401": { $ref: "#/components/responses/Unauthorized" }
|
|
446
446
|
"404": { $ref: "#/components/responses/NotFound" }
|
|
447
|
+
/me/avatars/{avatar_id}:
|
|
448
|
+
parameters:
|
|
449
|
+
- $ref: "#/components/parameters/ClientVersion"
|
|
450
|
+
- $ref: "#/components/parameters/ClientApiVersion"
|
|
451
|
+
- name: avatar_id
|
|
452
|
+
in: path
|
|
453
|
+
required: true
|
|
454
|
+
description: "`id` of an `AvatarVersion` of the caller."
|
|
455
|
+
schema: { $ref: "#/components/schemas/Id" }
|
|
456
|
+
delete:
|
|
457
|
+
tags: [me]
|
|
458
|
+
operationId: deleteMyAvatar
|
|
459
|
+
summary: Delete one of your avatars
|
|
460
|
+
description: |
|
|
461
|
+
Removes the avatar from your history. When it is the current one, the newest remaining avatar becomes
|
|
462
|
+
current again; without one you get the default avatar. The image is deleted from storage once nothing
|
|
463
|
+
uses it any more.
|
|
464
|
+
responses:
|
|
465
|
+
"426": { $ref: "#/components/responses/ClientOutdated" }
|
|
466
|
+
"200":
|
|
467
|
+
description: Updated user
|
|
468
|
+
content:
|
|
469
|
+
application/json:
|
|
470
|
+
schema: { $ref: "#/components/schemas/Me" }
|
|
471
|
+
"400": { $ref: "#/components/responses/BadRequest" }
|
|
472
|
+
"401": { $ref: "#/components/responses/Unauthorized" }
|
|
473
|
+
"404": { $ref: "#/components/responses/NotFound" }
|
|
447
474
|
/me/password:
|
|
448
475
|
parameters:
|
|
449
476
|
- $ref: "#/components/parameters/ClientVersion"
|
|
@@ -670,7 +697,7 @@ paths:
|
|
|
670
697
|
required: true
|
|
671
698
|
schema:
|
|
672
699
|
type: string
|
|
673
|
-
enum: [avatar_visibility, profile_visibility, presence_visibility, group_invites]
|
|
700
|
+
enum: [avatar_visibility, profile_visibility, presence_visibility, group_invites, direct_messages, search_visibility]
|
|
674
701
|
- name: effect
|
|
675
702
|
in: path
|
|
676
703
|
required: true
|
|
@@ -780,6 +807,10 @@ paths:
|
|
|
780
807
|
tags: [users]
|
|
781
808
|
operationId: getUserByUsername
|
|
782
809
|
summary: Profile by username
|
|
810
|
+
description: |
|
|
811
|
+
Like `GET /users/{user_id}`: a user whose `search_visibility` hides them from the current user (`nobody`
|
|
812
|
+
without an `allow` exception, or a `deny` exception) is `404` unless the two share a chat. Lookups are
|
|
813
|
+
rate limited per user.
|
|
783
814
|
parameters:
|
|
784
815
|
- name: username
|
|
785
816
|
in: path
|
|
@@ -795,6 +826,7 @@ paths:
|
|
|
795
826
|
schema: { $ref: "#/components/schemas/User" }
|
|
796
827
|
"401": { $ref: "#/components/responses/Unauthorized" }
|
|
797
828
|
"404": { $ref: "#/components/responses/NotFound" }
|
|
829
|
+
"429": { $ref: "#/components/responses/TooManyRequests" }
|
|
798
830
|
/users/{user_id}:
|
|
799
831
|
parameters:
|
|
800
832
|
- $ref: "#/components/parameters/ClientVersion"
|
|
@@ -804,6 +836,10 @@ paths:
|
|
|
804
836
|
tags: [users]
|
|
805
837
|
operationId: getUser
|
|
806
838
|
summary: Profile by ID
|
|
839
|
+
description: |
|
|
840
|
+
A user whose `search_visibility` hides them from the current user (`nobody` without an `allow` exception,
|
|
841
|
+
or a `deny` exception) is `404` unless the two share a chat. Your own profile is always found. Lookups are
|
|
842
|
+
rate limited per user.
|
|
807
843
|
responses:
|
|
808
844
|
"426": { $ref: "#/components/responses/ClientOutdated" }
|
|
809
845
|
"400": { $ref: "#/components/responses/BadRequest" }
|
|
@@ -814,6 +850,7 @@ paths:
|
|
|
814
850
|
schema: { $ref: "#/components/schemas/User" }
|
|
815
851
|
"401": { $ref: "#/components/responses/Unauthorized" }
|
|
816
852
|
"404": { $ref: "#/components/responses/NotFound" }
|
|
853
|
+
"429": { $ref: "#/components/responses/TooManyRequests" }
|
|
817
854
|
/users/{user_id}/avatar:
|
|
818
855
|
parameters:
|
|
819
856
|
- $ref: "#/components/parameters/ClientVersion"
|
|
@@ -825,12 +862,18 @@ paths:
|
|
|
825
862
|
summary: Current avatar image
|
|
826
863
|
description: |
|
|
827
864
|
Respects the avatar visibility of the user; falls back to the default avatar. With `version`, an
|
|
828
|
-
earlier avatar of the history (`AvatarVersion.url`).
|
|
865
|
+
earlier avatar of the history (`AvatarVersion.url`). `avatar_url` carries `rev`, the revision of the
|
|
866
|
+
current avatar: while it matches, the answer may be cached for a year (`immutable`), because a new
|
|
867
|
+
avatar gets a new `rev` and so a new URL.
|
|
829
868
|
parameters:
|
|
830
869
|
- name: version
|
|
831
870
|
in: query
|
|
832
871
|
description: "`id` of an `AvatarVersion` of this user."
|
|
833
872
|
schema: { $ref: "#/components/schemas/Id" }
|
|
873
|
+
- name: rev
|
|
874
|
+
in: query
|
|
875
|
+
description: Revision of the current avatar, as given in `avatar_url`.
|
|
876
|
+
schema: { type: string, maxLength: 64 }
|
|
834
877
|
responses:
|
|
835
878
|
"426": { $ref: "#/components/responses/ClientOutdated" }
|
|
836
879
|
"400": { $ref: "#/components/responses/BadRequest" }
|
|
@@ -888,6 +931,9 @@ paths:
|
|
|
888
931
|
tags: [users]
|
|
889
932
|
operationId: setContactName
|
|
890
933
|
summary: Set your own display name for a user
|
|
934
|
+
description: |
|
|
935
|
+
Follows the rules of `GET /users/{user_id}`: a user whose `search_visibility` hides them from you is `404`
|
|
936
|
+
unless the two of you share a chat, and the calls count against the same per-user limit.
|
|
891
937
|
requestBody:
|
|
892
938
|
required: true
|
|
893
939
|
content:
|
|
@@ -904,6 +950,7 @@ paths:
|
|
|
904
950
|
"401": { $ref: "#/components/responses/Unauthorized" }
|
|
905
951
|
"404": { $ref: "#/components/responses/NotFound" }
|
|
906
952
|
"422": { $ref: "#/components/responses/ValidationFailed" }
|
|
953
|
+
"429": { $ref: "#/components/responses/TooManyRequests" }
|
|
907
954
|
delete:
|
|
908
955
|
tags: [users]
|
|
909
956
|
operationId: removeContactName
|
|
@@ -1281,7 +1328,8 @@ paths:
|
|
|
1281
1328
|
patch:
|
|
1282
1329
|
tags: [messages]
|
|
1283
1330
|
operationId: editMessage
|
|
1284
|
-
summary: Edit your text message
|
|
1331
|
+
summary: Edit your text message or the caption of your file
|
|
1332
|
+
description: An empty `content` removes the caption of a file message; a text message needs at least one character.
|
|
1285
1333
|
requestBody:
|
|
1286
1334
|
required: true
|
|
1287
1335
|
content:
|
|
@@ -1355,6 +1403,70 @@ paths:
|
|
|
1355
1403
|
"404": { $ref: "#/components/responses/NotFound" }
|
|
1356
1404
|
"422": { $ref: "#/components/responses/ValidationFailed" }
|
|
1357
1405
|
"429": { $ref: "#/components/responses/TooManyRequests" }
|
|
1406
|
+
/chats/{chat_id}/messages/forward:
|
|
1407
|
+
parameters:
|
|
1408
|
+
- $ref: "#/components/parameters/ClientVersion"
|
|
1409
|
+
- $ref: "#/components/parameters/ClientApiVersion"
|
|
1410
|
+
- $ref: "#/components/parameters/ChatId"
|
|
1411
|
+
post:
|
|
1412
|
+
tags: [messages]
|
|
1413
|
+
operationId: forwardMessages
|
|
1414
|
+
summary: Forward several messages of a chat to other chats
|
|
1415
|
+
description: |
|
|
1416
|
+
Copies up to 20 messages of the chat, oldest first, into every target chat, at most 20 copies in all. Every
|
|
1417
|
+
copy counts against the sender's message rate. Every message and target is checked before anything is
|
|
1418
|
+
written, so a refused one forwards nothing.
|
|
1419
|
+
requestBody:
|
|
1420
|
+
required: true
|
|
1421
|
+
content:
|
|
1422
|
+
application/json:
|
|
1423
|
+
schema: { $ref: "#/components/schemas/ForwardMessagesRequest" }
|
|
1424
|
+
responses:
|
|
1425
|
+
"426": { $ref: "#/components/responses/ClientOutdated" }
|
|
1426
|
+
"400": { $ref: "#/components/responses/BadRequest" }
|
|
1427
|
+
"201":
|
|
1428
|
+
description: The new messages, per target chat oldest first
|
|
1429
|
+
content:
|
|
1430
|
+
application/json:
|
|
1431
|
+
schema:
|
|
1432
|
+
type: object
|
|
1433
|
+
required: [items]
|
|
1434
|
+
properties:
|
|
1435
|
+
items:
|
|
1436
|
+
type: array
|
|
1437
|
+
items: { $ref: "#/components/schemas/Message" }
|
|
1438
|
+
"401": { $ref: "#/components/responses/Unauthorized" }
|
|
1439
|
+
"403": { $ref: "#/components/responses/Forbidden" }
|
|
1440
|
+
"404": { $ref: "#/components/responses/NotFound" }
|
|
1441
|
+
"422": { $ref: "#/components/responses/ValidationFailed" }
|
|
1442
|
+
"429": { $ref: "#/components/responses/TooManyRequests" }
|
|
1443
|
+
/chats/{chat_id}/messages/delete:
|
|
1444
|
+
parameters:
|
|
1445
|
+
- $ref: "#/components/parameters/ClientVersion"
|
|
1446
|
+
- $ref: "#/components/parameters/ClientApiVersion"
|
|
1447
|
+
- $ref: "#/components/parameters/ChatId"
|
|
1448
|
+
post:
|
|
1449
|
+
tags: [messages]
|
|
1450
|
+
operationId: deleteMessages
|
|
1451
|
+
summary: Delete several messages of a chat
|
|
1452
|
+
description: |
|
|
1453
|
+
Deletes up to 100 messages of the chat with the rules of `DELETE /messages/{message_id}`. Every message
|
|
1454
|
+
is checked first: when one may not be deleted, none is. With `scope` everyone, messages that are already
|
|
1455
|
+
deleted for everyone count as done, so a retry after a partial failure finishes the rest.
|
|
1456
|
+
requestBody:
|
|
1457
|
+
required: true
|
|
1458
|
+
content:
|
|
1459
|
+
application/json:
|
|
1460
|
+
schema: { $ref: "#/components/schemas/DeleteMessagesRequest" }
|
|
1461
|
+
responses:
|
|
1462
|
+
"426": { $ref: "#/components/responses/ClientOutdated" }
|
|
1463
|
+
"400": { $ref: "#/components/responses/BadRequest" }
|
|
1464
|
+
"204":
|
|
1465
|
+
description: Deleted
|
|
1466
|
+
"401": { $ref: "#/components/responses/Unauthorized" }
|
|
1467
|
+
"403": { $ref: "#/components/responses/Forbidden" }
|
|
1468
|
+
"404": { $ref: "#/components/responses/NotFound" }
|
|
1469
|
+
"422": { $ref: "#/components/responses/ValidationFailed" }
|
|
1358
1470
|
|
|
1359
1471
|
# -------------------------------------------------------------- search
|
|
1360
1472
|
/search/messages:
|
|
@@ -1715,6 +1827,212 @@ paths:
|
|
|
1715
1827
|
"404": { $ref: "#/components/responses/NotFound" }
|
|
1716
1828
|
"409": { $ref: "#/components/responses/Conflict" }
|
|
1717
1829
|
|
|
1830
|
+
/me/notifications:
|
|
1831
|
+
get:
|
|
1832
|
+
tags:
|
|
1833
|
+
- me
|
|
1834
|
+
operationId: getNotificationSettings
|
|
1835
|
+
summary: Notification preferences and supported push platforms
|
|
1836
|
+
responses:
|
|
1837
|
+
"200":
|
|
1838
|
+
description: Notification settings or registered device
|
|
1839
|
+
content:
|
|
1840
|
+
application/json:
|
|
1841
|
+
schema:
|
|
1842
|
+
$ref: "#/components/schemas/NotificationSettings"
|
|
1843
|
+
"400":
|
|
1844
|
+
$ref: "#/components/responses/BadRequest"
|
|
1845
|
+
"401":
|
|
1846
|
+
$ref: "#/components/responses/Unauthorized"
|
|
1847
|
+
"404":
|
|
1848
|
+
$ref: "#/components/responses/NotFound"
|
|
1849
|
+
"409":
|
|
1850
|
+
$ref: "#/components/responses/Conflict"
|
|
1851
|
+
put:
|
|
1852
|
+
tags:
|
|
1853
|
+
- me
|
|
1854
|
+
operationId: updateNotificationSettings
|
|
1855
|
+
summary: Replace notification preferences
|
|
1856
|
+
requestBody:
|
|
1857
|
+
required: true
|
|
1858
|
+
content:
|
|
1859
|
+
application/json:
|
|
1860
|
+
schema:
|
|
1861
|
+
$ref: "#/components/schemas/NotificationPreferences"
|
|
1862
|
+
responses:
|
|
1863
|
+
"204":
|
|
1864
|
+
description: Saved
|
|
1865
|
+
"400":
|
|
1866
|
+
$ref: "#/components/responses/BadRequest"
|
|
1867
|
+
"401":
|
|
1868
|
+
$ref: "#/components/responses/Unauthorized"
|
|
1869
|
+
"404":
|
|
1870
|
+
$ref: "#/components/responses/NotFound"
|
|
1871
|
+
"409":
|
|
1872
|
+
$ref: "#/components/responses/Conflict"
|
|
1873
|
+
/notifications/avatar/{token}:
|
|
1874
|
+
parameters:
|
|
1875
|
+
- name: token
|
|
1876
|
+
in: path
|
|
1877
|
+
required: true
|
|
1878
|
+
description: "`avatar_token` of a push notification."
|
|
1879
|
+
schema: { type: string, maxLength: 256 }
|
|
1880
|
+
get:
|
|
1881
|
+
tags: [me]
|
|
1882
|
+
operationId: getNotificationAvatar
|
|
1883
|
+
summary: Sender avatar for a push notification
|
|
1884
|
+
description: |
|
|
1885
|
+
For the service worker, which has no session: the token in the push payload names the recipient
|
|
1886
|
+
and the sender and expires after an hour. Follows the sender's avatar visibility for the recipient.
|
|
1887
|
+
security: []
|
|
1888
|
+
responses:
|
|
1889
|
+
"200":
|
|
1890
|
+
description: Image
|
|
1891
|
+
content:
|
|
1892
|
+
image/*:
|
|
1893
|
+
schema: { type: string, format: binary }
|
|
1894
|
+
"206":
|
|
1895
|
+
description: The requested byte range (`Range` header)
|
|
1896
|
+
content:
|
|
1897
|
+
image/*:
|
|
1898
|
+
schema: { type: string, format: binary }
|
|
1899
|
+
"302":
|
|
1900
|
+
description: Redirect to a short-lived signed storage URL (with `MEDIA_SIGNED_URLS`)
|
|
1901
|
+
"304":
|
|
1902
|
+
description: Not modified (`If-None-Match` with the `ETag` of an earlier answer)
|
|
1903
|
+
"416":
|
|
1904
|
+
description: The requested range is outside the file
|
|
1905
|
+
"404": { $ref: "#/components/responses/NotFound" }
|
|
1906
|
+
/notifications/read/{token}:
|
|
1907
|
+
parameters:
|
|
1908
|
+
- name: token
|
|
1909
|
+
in: path
|
|
1910
|
+
required: true
|
|
1911
|
+
description: "`read_token` of a push notification."
|
|
1912
|
+
schema: { type: string, maxLength: 256 }
|
|
1913
|
+
post:
|
|
1914
|
+
tags: [me]
|
|
1915
|
+
operationId: markNotificationRead
|
|
1916
|
+
summary: Mark a chat read from a push notification
|
|
1917
|
+
description: |
|
|
1918
|
+
For the notification's "Mark as read" action: marks the chat read up to the notified message for
|
|
1919
|
+
the recipient the token names. The token expires after seven days.
|
|
1920
|
+
security: []
|
|
1921
|
+
responses:
|
|
1922
|
+
"204":
|
|
1923
|
+
description: Marked as read
|
|
1924
|
+
"404": { $ref: "#/components/responses/NotFound" }
|
|
1925
|
+
/me/notification-devices:
|
|
1926
|
+
post:
|
|
1927
|
+
tags:
|
|
1928
|
+
- me
|
|
1929
|
+
operationId: registerNotificationDevice
|
|
1930
|
+
summary: Register a push destination for the current session
|
|
1931
|
+
requestBody:
|
|
1932
|
+
required: true
|
|
1933
|
+
content:
|
|
1934
|
+
application/json:
|
|
1935
|
+
schema:
|
|
1936
|
+
$ref: "#/components/schemas/NotificationDeviceRequest"
|
|
1937
|
+
responses:
|
|
1938
|
+
"200":
|
|
1939
|
+
description: Notification settings or registered device
|
|
1940
|
+
content:
|
|
1941
|
+
application/json:
|
|
1942
|
+
schema:
|
|
1943
|
+
$ref: "#/components/schemas/NotificationDeviceRegistered"
|
|
1944
|
+
"400":
|
|
1945
|
+
$ref: "#/components/responses/BadRequest"
|
|
1946
|
+
"401":
|
|
1947
|
+
$ref: "#/components/responses/Unauthorized"
|
|
1948
|
+
"404":
|
|
1949
|
+
$ref: "#/components/responses/NotFound"
|
|
1950
|
+
"409":
|
|
1951
|
+
$ref: "#/components/responses/Conflict"
|
|
1952
|
+
/me/notification-devices/{id}:
|
|
1953
|
+
parameters:
|
|
1954
|
+
- name: id
|
|
1955
|
+
in: path
|
|
1956
|
+
required: true
|
|
1957
|
+
schema:
|
|
1958
|
+
type: string
|
|
1959
|
+
format: uuid
|
|
1960
|
+
delete:
|
|
1961
|
+
tags:
|
|
1962
|
+
- me
|
|
1963
|
+
operationId: deleteNotificationDevice
|
|
1964
|
+
summary: Unregister a push destination for the current session
|
|
1965
|
+
responses:
|
|
1966
|
+
"204":
|
|
1967
|
+
description: Saved
|
|
1968
|
+
"400":
|
|
1969
|
+
$ref: "#/components/responses/BadRequest"
|
|
1970
|
+
"401":
|
|
1971
|
+
$ref: "#/components/responses/Unauthorized"
|
|
1972
|
+
"404":
|
|
1973
|
+
$ref: "#/components/responses/NotFound"
|
|
1974
|
+
"409":
|
|
1975
|
+
$ref: "#/components/responses/Conflict"
|
|
1976
|
+
/chats/{chatId}/notification-mute:
|
|
1977
|
+
parameters:
|
|
1978
|
+
- name: chatId
|
|
1979
|
+
in: path
|
|
1980
|
+
required: true
|
|
1981
|
+
schema:
|
|
1982
|
+
$ref: "#/components/schemas/Id"
|
|
1983
|
+
put:
|
|
1984
|
+
tags:
|
|
1985
|
+
- me
|
|
1986
|
+
operationId: setNotificationMute
|
|
1987
|
+
summary: Mute or unmute a chat
|
|
1988
|
+
requestBody:
|
|
1989
|
+
required: true
|
|
1990
|
+
content:
|
|
1991
|
+
application/json:
|
|
1992
|
+
schema:
|
|
1993
|
+
$ref: "#/components/schemas/NotificationMuteRequest"
|
|
1994
|
+
responses:
|
|
1995
|
+
"204":
|
|
1996
|
+
description: Saved
|
|
1997
|
+
"400":
|
|
1998
|
+
$ref: "#/components/responses/BadRequest"
|
|
1999
|
+
"401":
|
|
2000
|
+
$ref: "#/components/responses/Unauthorized"
|
|
2001
|
+
"404":
|
|
2002
|
+
$ref: "#/components/responses/NotFound"
|
|
2003
|
+
"409":
|
|
2004
|
+
$ref: "#/components/responses/Conflict"
|
|
2005
|
+
/me/notification-devices/{id}/activity:
|
|
2006
|
+
parameters:
|
|
2007
|
+
- name: id
|
|
2008
|
+
in: path
|
|
2009
|
+
required: true
|
|
2010
|
+
schema:
|
|
2011
|
+
type: string
|
|
2012
|
+
format: uuid
|
|
2013
|
+
put:
|
|
2014
|
+
tags:
|
|
2015
|
+
- me
|
|
2016
|
+
operationId: updateNotificationActivity
|
|
2017
|
+
summary: Report a visible client with a healthy live connection
|
|
2018
|
+
requestBody:
|
|
2019
|
+
required: true
|
|
2020
|
+
content:
|
|
2021
|
+
application/json:
|
|
2022
|
+
schema:
|
|
2023
|
+
$ref: "#/components/schemas/NotificationActivity"
|
|
2024
|
+
responses:
|
|
2025
|
+
"204":
|
|
2026
|
+
description: Saved
|
|
2027
|
+
"400":
|
|
2028
|
+
$ref: "#/components/responses/BadRequest"
|
|
2029
|
+
"401":
|
|
2030
|
+
$ref: "#/components/responses/Unauthorized"
|
|
2031
|
+
"404":
|
|
2032
|
+
$ref: "#/components/responses/NotFound"
|
|
2033
|
+
"409":
|
|
2034
|
+
$ref: "#/components/responses/Conflict"
|
|
2035
|
+
|
|
1718
2036
|
components:
|
|
1719
2037
|
securitySchemes:
|
|
1720
2038
|
bearerAuth:
|
|
@@ -1845,6 +2163,106 @@ components:
|
|
|
1845
2163
|
schema: { $ref: "#/components/schemas/Problem" }
|
|
1846
2164
|
|
|
1847
2165
|
schemas:
|
|
2166
|
+
NotificationPreferences:
|
|
2167
|
+
type: object
|
|
2168
|
+
required:
|
|
2169
|
+
- enabled
|
|
2170
|
+
- sound
|
|
2171
|
+
- previews
|
|
2172
|
+
properties:
|
|
2173
|
+
enabled:
|
|
2174
|
+
type: boolean
|
|
2175
|
+
sound:
|
|
2176
|
+
type: boolean
|
|
2177
|
+
previews:
|
|
2178
|
+
type: boolean
|
|
2179
|
+
NotificationSettings:
|
|
2180
|
+
type: object
|
|
2181
|
+
required:
|
|
2182
|
+
- preferences
|
|
2183
|
+
- mutes
|
|
2184
|
+
- web_push
|
|
2185
|
+
- android_push
|
|
2186
|
+
- ios_push
|
|
2187
|
+
- vapid_public_key
|
|
2188
|
+
properties:
|
|
2189
|
+
preferences:
|
|
2190
|
+
$ref: "#/components/schemas/NotificationPreferences"
|
|
2191
|
+
mutes:
|
|
2192
|
+
type: array
|
|
2193
|
+
items:
|
|
2194
|
+
type: object
|
|
2195
|
+
required:
|
|
2196
|
+
- chat_id
|
|
2197
|
+
- until
|
|
2198
|
+
properties:
|
|
2199
|
+
chat_id:
|
|
2200
|
+
$ref: "#/components/schemas/Id"
|
|
2201
|
+
until:
|
|
2202
|
+
type: string
|
|
2203
|
+
format: date-time
|
|
2204
|
+
web_push:
|
|
2205
|
+
type: boolean
|
|
2206
|
+
android_push:
|
|
2207
|
+
type: boolean
|
|
2208
|
+
ios_push:
|
|
2209
|
+
type: boolean
|
|
2210
|
+
vapid_public_key:
|
|
2211
|
+
type: string
|
|
2212
|
+
NotificationDeviceRequest:
|
|
2213
|
+
type: object
|
|
2214
|
+
required:
|
|
2215
|
+
- platform
|
|
2216
|
+
- destination
|
|
2217
|
+
properties:
|
|
2218
|
+
platform:
|
|
2219
|
+
type: string
|
|
2220
|
+
enum:
|
|
2221
|
+
- web
|
|
2222
|
+
- android
|
|
2223
|
+
- ios
|
|
2224
|
+
destination:
|
|
2225
|
+
type: string
|
|
2226
|
+
minLength: 1
|
|
2227
|
+
maxLength: 4096
|
|
2228
|
+
p256dh:
|
|
2229
|
+
type: string
|
|
2230
|
+
maxLength: 128
|
|
2231
|
+
auth:
|
|
2232
|
+
type: string
|
|
2233
|
+
maxLength: 64
|
|
2234
|
+
NotificationDeviceRegistered:
|
|
2235
|
+
type: object
|
|
2236
|
+
required:
|
|
2237
|
+
- id
|
|
2238
|
+
properties:
|
|
2239
|
+
id:
|
|
2240
|
+
type: string
|
|
2241
|
+
format: uuid
|
|
2242
|
+
NotificationMuteRequest:
|
|
2243
|
+
type: object
|
|
2244
|
+
required:
|
|
2245
|
+
- duration
|
|
2246
|
+
properties:
|
|
2247
|
+
duration:
|
|
2248
|
+
type: string
|
|
2249
|
+
enum:
|
|
2250
|
+
- off
|
|
2251
|
+
- 1h
|
|
2252
|
+
- 8h
|
|
2253
|
+
- forever
|
|
2254
|
+
NotificationActivity:
|
|
2255
|
+
type: object
|
|
2256
|
+
required:
|
|
2257
|
+
- active
|
|
2258
|
+
- client_id
|
|
2259
|
+
properties:
|
|
2260
|
+
active:
|
|
2261
|
+
type: boolean
|
|
2262
|
+
client_id:
|
|
2263
|
+
type: string
|
|
2264
|
+
format: uuid
|
|
2265
|
+
|
|
1848
2266
|
# ---------------------------------------------------------- basics
|
|
1849
2267
|
Id:
|
|
1850
2268
|
type: string
|
|
@@ -2133,7 +2551,9 @@ components:
|
|
|
2133
2551
|
description: A code of the authenticator app, or an unused recovery code.
|
|
2134
2552
|
Visibility:
|
|
2135
2553
|
type: string
|
|
2136
|
-
description:
|
|
2554
|
+
description: |
|
|
2555
|
+
Who may see the item. The exception lists apply to every value; `*_except` behave like `everyone` and `nobody`.
|
|
2556
|
+
`contacts` are the users you share a group with, or a direct chat that you opened or read in.
|
|
2137
2557
|
enum: [everyone, contacts, everyone_except, nobody_except, nobody]
|
|
2138
2558
|
DirectMessagePolicy:
|
|
2139
2559
|
type: string
|
|
@@ -2146,7 +2566,7 @@ components:
|
|
|
2146
2566
|
enum: [everyone, nobody]
|
|
2147
2567
|
PrivacyExceptions:
|
|
2148
2568
|
type: object
|
|
2149
|
-
description: User IDs per setting; `allow`
|
|
2569
|
+
description: User IDs per setting. An exception wins over the setting whatever its value; `allow` always lets the user in, `deny` always keeps them out.
|
|
2150
2570
|
additionalProperties:
|
|
2151
2571
|
type: object
|
|
2152
2572
|
required: [allow, deny]
|
|
@@ -2211,7 +2631,7 @@ components:
|
|
|
2211
2631
|
description: The requesting user's own name for this user, if set.
|
|
2212
2632
|
avatar_url:
|
|
2213
2633
|
type: [string, "null"]
|
|
2214
|
-
description: Path of the avatar, always same-origin (`/api/v2/users/{id}/avatar`).
|
|
2634
|
+
description: Path of the avatar, always same-origin (`/api/v2/users/{id}/avatar?rev={revision}`).
|
|
2215
2635
|
bio: { type: [string, "null"] }
|
|
2216
2636
|
is_online: { type: boolean }
|
|
2217
2637
|
last_seen:
|
|
@@ -2328,6 +2748,29 @@ components:
|
|
|
2328
2748
|
- $ref: "#/components/schemas/Id"
|
|
2329
2749
|
- type: "null"
|
|
2330
2750
|
sender_name: { type: string }
|
|
2751
|
+
ReplyPreview:
|
|
2752
|
+
type: object
|
|
2753
|
+
description: |
|
|
2754
|
+
What a reply shows of the message it answers, so a client can draw the quote without loading that
|
|
2755
|
+
message. Set on messages of history pages and `message` events when the recipient can see the answered
|
|
2756
|
+
message; absent when it is gone or hidden for them, and on chat-list previews and search results.
|
|
2757
|
+
required: [id, type, sender, content, attachment, is_deleted]
|
|
2758
|
+
properties:
|
|
2759
|
+
id: { $ref: "#/components/schemas/Id" }
|
|
2760
|
+
type: { $ref: "#/components/schemas/MessageType" }
|
|
2761
|
+
sender:
|
|
2762
|
+
oneOf:
|
|
2763
|
+
- $ref: "#/components/schemas/User"
|
|
2764
|
+
- type: "null"
|
|
2765
|
+
content:
|
|
2766
|
+
type: [string, "null"]
|
|
2767
|
+
maxLength: 100
|
|
2768
|
+
description: The first 100 characters of the text or caption; `null` when deleted or empty.
|
|
2769
|
+
attachment:
|
|
2770
|
+
oneOf:
|
|
2771
|
+
- $ref: "#/components/schemas/Attachment"
|
|
2772
|
+
- type: "null"
|
|
2773
|
+
is_deleted: { type: boolean }
|
|
2331
2774
|
Message:
|
|
2332
2775
|
type: object
|
|
2333
2776
|
required:
|
|
@@ -2365,6 +2808,8 @@ components:
|
|
|
2365
2808
|
oneOf:
|
|
2366
2809
|
- $ref: "#/components/schemas/Id"
|
|
2367
2810
|
- type: "null"
|
|
2811
|
+
reply_preview:
|
|
2812
|
+
$ref: "#/components/schemas/ReplyPreview"
|
|
2368
2813
|
forwarded_from:
|
|
2369
2814
|
oneOf:
|
|
2370
2815
|
- $ref: "#/components/schemas/ForwardedFrom"
|
|
@@ -2458,7 +2903,10 @@ components:
|
|
|
2458
2903
|
type: object
|
|
2459
2904
|
required: [content]
|
|
2460
2905
|
properties:
|
|
2461
|
-
content:
|
|
2906
|
+
content:
|
|
2907
|
+
type: string
|
|
2908
|
+
maxLength: 4096
|
|
2909
|
+
description: New text, or the new caption of a file. Empty removes a file's caption; a text message rejects it.
|
|
2462
2910
|
ForwardMessageRequest:
|
|
2463
2911
|
type: object
|
|
2464
2912
|
required: [chat_ids]
|
|
@@ -2469,6 +2917,35 @@ components:
|
|
|
2469
2917
|
maxItems: 20
|
|
2470
2918
|
uniqueItems: true
|
|
2471
2919
|
items: { $ref: "#/components/schemas/Id" }
|
|
2920
|
+
ForwardMessagesRequest:
|
|
2921
|
+
type: object
|
|
2922
|
+
required: [message_ids, chat_ids]
|
|
2923
|
+
properties:
|
|
2924
|
+
message_ids:
|
|
2925
|
+
type: array
|
|
2926
|
+
minItems: 1
|
|
2927
|
+
maxItems: 20
|
|
2928
|
+
uniqueItems: true
|
|
2929
|
+
items: { $ref: "#/components/schemas/Id" }
|
|
2930
|
+
chat_ids:
|
|
2931
|
+
type: array
|
|
2932
|
+
minItems: 1
|
|
2933
|
+
maxItems: 20
|
|
2934
|
+
uniqueItems: true
|
|
2935
|
+
items: { $ref: "#/components/schemas/Id" }
|
|
2936
|
+
DeleteMessagesRequest:
|
|
2937
|
+
type: object
|
|
2938
|
+
required: [message_ids, scope]
|
|
2939
|
+
properties:
|
|
2940
|
+
message_ids:
|
|
2941
|
+
type: array
|
|
2942
|
+
minItems: 1
|
|
2943
|
+
maxItems: 100
|
|
2944
|
+
uniqueItems: true
|
|
2945
|
+
items: { $ref: "#/components/schemas/Id" }
|
|
2946
|
+
scope:
|
|
2947
|
+
type: string
|
|
2948
|
+
enum: [me, everyone]
|
|
2472
2949
|
MarkReadRequest:
|
|
2473
2950
|
type: object
|
|
2474
2951
|
required: [message_id]
|