@myronsi/messenger-api 2.1.0-alpha.28 → 2.1.0-alpha.29.next.113
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 +13 -0
- package/dist/index.d.ts +2 -2
- package/dist/index.js +1 -1
- package/dist/openapi.yaml +282 -7
- package/dist/schema.d.ts +376 -5
- package/dist/ws-docs.json +38 -0
- package/dist/ws-events.d.ts +148 -76
- package/dist/ws-events.schema.json +327 -5
- package/package.json +1 -1
|
@@ -17,6 +17,10 @@
|
|
|
17
17
|
},
|
|
18
18
|
"previews": {
|
|
19
19
|
"type": "boolean"
|
|
20
|
+
},
|
|
21
|
+
"birthday_reminders": {
|
|
22
|
+
"type": "boolean",
|
|
23
|
+
"description": "A push at 09:00 (in `Me.time_zone`) when someone you have a direct chat with has a birthday. Always sent\nby the server; when a `PUT` leaves it out, it stays as it is. Defaults to `true`.\n"
|
|
20
24
|
}
|
|
21
25
|
}
|
|
22
26
|
},
|
|
@@ -641,6 +645,28 @@
|
|
|
641
645
|
"null"
|
|
642
646
|
],
|
|
643
647
|
"maxLength": 500
|
|
648
|
+
},
|
|
649
|
+
"pronouns": {
|
|
650
|
+
"type": [
|
|
651
|
+
"string",
|
|
652
|
+
"null"
|
|
653
|
+
],
|
|
654
|
+
"maxLength": 40,
|
|
655
|
+
"description": "Free text; `null` or an empty string removes it."
|
|
656
|
+
},
|
|
657
|
+
"birthday": {
|
|
658
|
+
"description": "`null` removes it. With a `year` the date must exist (no 29 February in other years); without one,\n29 February is allowed.\n",
|
|
659
|
+
"oneOf": [
|
|
660
|
+
{
|
|
661
|
+
"$ref": "#/$defs/Birthday"
|
|
662
|
+
},
|
|
663
|
+
{
|
|
664
|
+
"type": "null"
|
|
665
|
+
}
|
|
666
|
+
]
|
|
667
|
+
},
|
|
668
|
+
"time_zone": {
|
|
669
|
+
"$ref": "#/$defs/TimeZone"
|
|
644
670
|
}
|
|
645
671
|
}
|
|
646
672
|
},
|
|
@@ -893,6 +919,7 @@
|
|
|
893
919
|
"profile_visibility",
|
|
894
920
|
"presence_visibility",
|
|
895
921
|
"last_seen_visibility",
|
|
922
|
+
"birthday_visibility",
|
|
896
923
|
"read_receipts_enabled",
|
|
897
924
|
"direct_messages",
|
|
898
925
|
"group_invites",
|
|
@@ -924,6 +951,14 @@
|
|
|
924
951
|
}
|
|
925
952
|
]
|
|
926
953
|
},
|
|
954
|
+
"birthday_visibility": {
|
|
955
|
+
"description": "Who sees the birthday (`User.birthday`) and gets a reminder on the day. Defaults to `contacts`.",
|
|
956
|
+
"allOf": [
|
|
957
|
+
{
|
|
958
|
+
"$ref": "#/$defs/Visibility"
|
|
959
|
+
}
|
|
960
|
+
]
|
|
961
|
+
},
|
|
927
962
|
"read_receipts_enabled": {
|
|
928
963
|
"type": "boolean"
|
|
929
964
|
},
|
|
@@ -965,6 +1000,9 @@
|
|
|
965
1000
|
"last_seen_visibility": {
|
|
966
1001
|
"$ref": "#/$defs/Visibility"
|
|
967
1002
|
},
|
|
1003
|
+
"birthday_visibility": {
|
|
1004
|
+
"$ref": "#/$defs/Visibility"
|
|
1005
|
+
},
|
|
968
1006
|
"read_receipts_enabled": {
|
|
969
1007
|
"type": "boolean"
|
|
970
1008
|
},
|
|
@@ -1009,6 +1047,10 @@
|
|
|
1009
1047
|
"display_name",
|
|
1010
1048
|
"avatar_url",
|
|
1011
1049
|
"bio",
|
|
1050
|
+
"pronouns",
|
|
1051
|
+
"birthday",
|
|
1052
|
+
"music",
|
|
1053
|
+
"background",
|
|
1012
1054
|
"is_online",
|
|
1013
1055
|
"last_seen",
|
|
1014
1056
|
"is_deleted",
|
|
@@ -1021,7 +1063,48 @@
|
|
|
1021
1063
|
"profile_version": {
|
|
1022
1064
|
"type": "integer",
|
|
1023
1065
|
"minimum": 0,
|
|
1024
|
-
"description": "Grows whenever the username, display name, bio or
|
|
1066
|
+
"description": "Grows whenever the username, display name, bio, avatar, pronouns, birthday, profile music or profile\nbackground changes (not with presence). Clients keep a stored profile until a higher version arrives.\n"
|
|
1067
|
+
},
|
|
1068
|
+
"pronouns": {
|
|
1069
|
+
"type": [
|
|
1070
|
+
"string",
|
|
1071
|
+
"null"
|
|
1072
|
+
],
|
|
1073
|
+
"maxLength": 40,
|
|
1074
|
+
"description": "Free text such as \"she/her\". Visible like the bio (`profile_visibility`)."
|
|
1075
|
+
},
|
|
1076
|
+
"birthday": {
|
|
1077
|
+
"description": "Visible by `birthday_visibility`; `null` when not set or hidden.",
|
|
1078
|
+
"oneOf": [
|
|
1079
|
+
{
|
|
1080
|
+
"$ref": "#/$defs/Birthday"
|
|
1081
|
+
},
|
|
1082
|
+
{
|
|
1083
|
+
"type": "null"
|
|
1084
|
+
}
|
|
1085
|
+
]
|
|
1086
|
+
},
|
|
1087
|
+
"music": {
|
|
1088
|
+
"description": "A short song on the profile, visible like the bio. Clients never play it on their own.",
|
|
1089
|
+
"oneOf": [
|
|
1090
|
+
{
|
|
1091
|
+
"$ref": "#/$defs/ProfileMusic"
|
|
1092
|
+
},
|
|
1093
|
+
{
|
|
1094
|
+
"type": "null"
|
|
1095
|
+
}
|
|
1096
|
+
]
|
|
1097
|
+
},
|
|
1098
|
+
"background": {
|
|
1099
|
+
"description": "The banner and page background of the profile, visible like the bio.",
|
|
1100
|
+
"oneOf": [
|
|
1101
|
+
{
|
|
1102
|
+
"$ref": "#/$defs/ProfileBackground"
|
|
1103
|
+
},
|
|
1104
|
+
{
|
|
1105
|
+
"type": "null"
|
|
1106
|
+
}
|
|
1107
|
+
]
|
|
1025
1108
|
},
|
|
1026
1109
|
"username": {
|
|
1027
1110
|
"$ref": "#/$defs/Username"
|
|
@@ -1075,7 +1158,8 @@
|
|
|
1075
1158
|
{
|
|
1076
1159
|
"type": "object",
|
|
1077
1160
|
"required": [
|
|
1078
|
-
"created_at"
|
|
1161
|
+
"created_at",
|
|
1162
|
+
"time_zone"
|
|
1079
1163
|
],
|
|
1080
1164
|
"properties": {
|
|
1081
1165
|
"created_at": {
|
|
@@ -1083,11 +1167,198 @@
|
|
|
1083
1167
|
},
|
|
1084
1168
|
"recovery_setup_required": {
|
|
1085
1169
|
"type": "boolean"
|
|
1170
|
+
},
|
|
1171
|
+
"time_zone": {
|
|
1172
|
+
"allOf": [
|
|
1173
|
+
{
|
|
1174
|
+
"$ref": "#/$defs/TimeZone"
|
|
1175
|
+
}
|
|
1176
|
+
],
|
|
1177
|
+
"description": "The user's time zone; birthday reminders arrive at 09:00 in it. `UTC` until a client sets it."
|
|
1086
1178
|
}
|
|
1087
1179
|
}
|
|
1088
1180
|
}
|
|
1089
1181
|
]
|
|
1090
1182
|
},
|
|
1183
|
+
"TimeZone": {
|
|
1184
|
+
"type": "string",
|
|
1185
|
+
"minLength": 1,
|
|
1186
|
+
"maxLength": 64,
|
|
1187
|
+
"description": "An IANA time zone name such as `Europe/Berlin`.",
|
|
1188
|
+
"examples": [
|
|
1189
|
+
"Europe/Berlin"
|
|
1190
|
+
]
|
|
1191
|
+
},
|
|
1192
|
+
"Birthday": {
|
|
1193
|
+
"type": "object",
|
|
1194
|
+
"required": [
|
|
1195
|
+
"day",
|
|
1196
|
+
"month",
|
|
1197
|
+
"year"
|
|
1198
|
+
],
|
|
1199
|
+
"properties": {
|
|
1200
|
+
"day": {
|
|
1201
|
+
"type": "integer",
|
|
1202
|
+
"minimum": 1,
|
|
1203
|
+
"maximum": 31
|
|
1204
|
+
},
|
|
1205
|
+
"month": {
|
|
1206
|
+
"type": "integer",
|
|
1207
|
+
"minimum": 1,
|
|
1208
|
+
"maximum": 12
|
|
1209
|
+
},
|
|
1210
|
+
"year": {
|
|
1211
|
+
"type": [
|
|
1212
|
+
"integer",
|
|
1213
|
+
"null"
|
|
1214
|
+
],
|
|
1215
|
+
"minimum": 1900,
|
|
1216
|
+
"maximum": 2100,
|
|
1217
|
+
"description": "Optional; `null` when the user keeps the year to themselves."
|
|
1218
|
+
}
|
|
1219
|
+
}
|
|
1220
|
+
},
|
|
1221
|
+
"ProfileMusic": {
|
|
1222
|
+
"type": "object",
|
|
1223
|
+
"required": [
|
|
1224
|
+
"attachment",
|
|
1225
|
+
"title",
|
|
1226
|
+
"artist"
|
|
1227
|
+
],
|
|
1228
|
+
"properties": {
|
|
1229
|
+
"attachment": {
|
|
1230
|
+
"allOf": [
|
|
1231
|
+
{
|
|
1232
|
+
"$ref": "#/$defs/Attachment"
|
|
1233
|
+
}
|
|
1234
|
+
],
|
|
1235
|
+
"description": "The clip (at most 30 s). `thumbnail_url` is the cover when the file had one."
|
|
1236
|
+
},
|
|
1237
|
+
"title": {
|
|
1238
|
+
"type": [
|
|
1239
|
+
"string",
|
|
1240
|
+
"null"
|
|
1241
|
+
],
|
|
1242
|
+
"maxLength": 100
|
|
1243
|
+
},
|
|
1244
|
+
"artist": {
|
|
1245
|
+
"type": [
|
|
1246
|
+
"string",
|
|
1247
|
+
"null"
|
|
1248
|
+
],
|
|
1249
|
+
"maxLength": 100
|
|
1250
|
+
}
|
|
1251
|
+
}
|
|
1252
|
+
},
|
|
1253
|
+
"ProfileBackgroundKind": {
|
|
1254
|
+
"type": "string",
|
|
1255
|
+
"description": "`media` an uploaded image, GIF or short video (`attachment`), `preset` one of the clients' built-in\ngradients (`preset`), `color` one color or a gradient of two (`colors`).\n",
|
|
1256
|
+
"enum": [
|
|
1257
|
+
"media",
|
|
1258
|
+
"preset",
|
|
1259
|
+
"color"
|
|
1260
|
+
]
|
|
1261
|
+
},
|
|
1262
|
+
"BackgroundPreset": {
|
|
1263
|
+
"type": "string",
|
|
1264
|
+
"pattern": "^[a-z0-9_-]{1,32}$",
|
|
1265
|
+
"description": "Name of a built-in gradient. Clients show their default background for a name they do not know."
|
|
1266
|
+
},
|
|
1267
|
+
"BackgroundColor": {
|
|
1268
|
+
"type": "string",
|
|
1269
|
+
"pattern": "^#[0-9a-f]{6}$",
|
|
1270
|
+
"examples": [
|
|
1271
|
+
"#3366ff"
|
|
1272
|
+
]
|
|
1273
|
+
},
|
|
1274
|
+
"ProfileBackground": {
|
|
1275
|
+
"type": "object",
|
|
1276
|
+
"required": [
|
|
1277
|
+
"kind"
|
|
1278
|
+
],
|
|
1279
|
+
"properties": {
|
|
1280
|
+
"kind": {
|
|
1281
|
+
"$ref": "#/$defs/ProfileBackgroundKind"
|
|
1282
|
+
},
|
|
1283
|
+
"attachment": {
|
|
1284
|
+
"allOf": [
|
|
1285
|
+
{
|
|
1286
|
+
"$ref": "#/$defs/Attachment"
|
|
1287
|
+
}
|
|
1288
|
+
],
|
|
1289
|
+
"description": "Set for `media`. An image, an animated GIF or a muted video of at most 15 s; `thumbnail_url` is a still\nframe to show while it loads and when the viewer prefers reduced motion.\n"
|
|
1290
|
+
},
|
|
1291
|
+
"preset": {
|
|
1292
|
+
"$ref": "#/$defs/BackgroundPreset"
|
|
1293
|
+
},
|
|
1294
|
+
"colors": {
|
|
1295
|
+
"type": "array",
|
|
1296
|
+
"minItems": 1,
|
|
1297
|
+
"maxItems": 2,
|
|
1298
|
+
"items": {
|
|
1299
|
+
"$ref": "#/$defs/BackgroundColor"
|
|
1300
|
+
}
|
|
1301
|
+
}
|
|
1302
|
+
}
|
|
1303
|
+
},
|
|
1304
|
+
"SetBackgroundRequest": {
|
|
1305
|
+
"type": "object",
|
|
1306
|
+
"required": [
|
|
1307
|
+
"kind"
|
|
1308
|
+
],
|
|
1309
|
+
"description": "`media` needs `attachment_id` (uploaded with purpose `profile_background`), `preset` needs `preset`, `color`\nneeds `colors`; other fields must be absent (`422` otherwise).\n",
|
|
1310
|
+
"properties": {
|
|
1311
|
+
"kind": {
|
|
1312
|
+
"$ref": "#/$defs/ProfileBackgroundKind"
|
|
1313
|
+
},
|
|
1314
|
+
"attachment_id": {
|
|
1315
|
+
"$ref": "#/$defs/AttachmentRef"
|
|
1316
|
+
},
|
|
1317
|
+
"preset": {
|
|
1318
|
+
"$ref": "#/$defs/BackgroundPreset"
|
|
1319
|
+
},
|
|
1320
|
+
"colors": {
|
|
1321
|
+
"type": "array",
|
|
1322
|
+
"minItems": 1,
|
|
1323
|
+
"maxItems": 2,
|
|
1324
|
+
"items": {
|
|
1325
|
+
"$ref": "#/$defs/BackgroundColor"
|
|
1326
|
+
}
|
|
1327
|
+
}
|
|
1328
|
+
}
|
|
1329
|
+
},
|
|
1330
|
+
"SetMusicRequest": {
|
|
1331
|
+
"type": "object",
|
|
1332
|
+
"required": [
|
|
1333
|
+
"attachment_id"
|
|
1334
|
+
],
|
|
1335
|
+
"properties": {
|
|
1336
|
+
"attachment_id": {
|
|
1337
|
+
"allOf": [
|
|
1338
|
+
{
|
|
1339
|
+
"$ref": "#/$defs/AttachmentRef"
|
|
1340
|
+
}
|
|
1341
|
+
],
|
|
1342
|
+
"description": "An upload of the caller with purpose `profile_music`."
|
|
1343
|
+
},
|
|
1344
|
+
"title": {
|
|
1345
|
+
"type": [
|
|
1346
|
+
"string",
|
|
1347
|
+
"null"
|
|
1348
|
+
],
|
|
1349
|
+
"maxLength": 100,
|
|
1350
|
+
"description": "Shown title. Clients fill it in from `Attachment.tags` of the upload and let the user edit it."
|
|
1351
|
+
},
|
|
1352
|
+
"artist": {
|
|
1353
|
+
"type": [
|
|
1354
|
+
"string",
|
|
1355
|
+
"null"
|
|
1356
|
+
],
|
|
1357
|
+
"maxLength": 100,
|
|
1358
|
+
"description": "Shown artist, filled in the same way."
|
|
1359
|
+
}
|
|
1360
|
+
}
|
|
1361
|
+
},
|
|
1091
1362
|
"UserPage": {
|
|
1092
1363
|
"type": "object",
|
|
1093
1364
|
"required": [
|
|
@@ -1150,11 +1421,13 @@
|
|
|
1150
1421
|
},
|
|
1151
1422
|
"UploadPurpose": {
|
|
1152
1423
|
"type": "string",
|
|
1153
|
-
"description": "`sticker`: a PNG, JPEG or still WebP of at most 5 MB. The server fits it into 512 x 512 px with a transparent\nborder and stores a WebP (`413` when that is still over 512 KB). Only its uploader can load it until it is\nadded to a pack.\n",
|
|
1424
|
+
"description": "`sticker`: a PNG, JPEG or still WebP of at most 5 MB. The server fits it into 512 x 512 px with a transparent\nborder and stores a WebP (`413` when that is still over 512 KB). Only its uploader can load it until it is\nadded to a pack.\n\n`profile_music`: an audio file of at most 20 MB. The server keeps at most 30 s of it (from `start_ms` to\n`end_ms`, or the first 30 s), stored as AAC, reads the title and artist into `tags` and the embedded cover\ninto `thumbnail_url`. Use it with `PUT /me/music`.\n\n`profile_background`: an image (10 MB), an animated GIF (15 MB) or a video of at most 15 s (15 MB). Use it\nwith `PUT /me/background` or `PUT /groups/{chat_id}/background`.\n",
|
|
1154
1425
|
"enum": [
|
|
1155
1426
|
"message",
|
|
1156
1427
|
"avatar",
|
|
1157
|
-
"sticker"
|
|
1428
|
+
"sticker",
|
|
1429
|
+
"profile_music",
|
|
1430
|
+
"profile_background"
|
|
1158
1431
|
]
|
|
1159
1432
|
},
|
|
1160
1433
|
"UploadAttachmentRequest": {
|
|
@@ -1188,6 +1461,16 @@
|
|
|
1188
1461
|
"minimum": 0,
|
|
1189
1462
|
"maximum": 255
|
|
1190
1463
|
}
|
|
1464
|
+
},
|
|
1465
|
+
"start_ms": {
|
|
1466
|
+
"type": "integer",
|
|
1467
|
+
"minimum": 0,
|
|
1468
|
+
"description": "`profile_music` only: where the kept part starts."
|
|
1469
|
+
},
|
|
1470
|
+
"end_ms": {
|
|
1471
|
+
"type": "integer",
|
|
1472
|
+
"minimum": 1,
|
|
1473
|
+
"description": "`profile_music` only: where the kept part ends, at most 30 s after `start_ms`."
|
|
1191
1474
|
}
|
|
1192
1475
|
}
|
|
1193
1476
|
},
|
|
@@ -1272,12 +1555,39 @@
|
|
|
1272
1555
|
"maximum": 255
|
|
1273
1556
|
}
|
|
1274
1557
|
},
|
|
1558
|
+
"tags": {
|
|
1559
|
+
"description": "Only in the answer to a `profile_music` upload; what the file says about itself.",
|
|
1560
|
+
"$ref": "#/$defs/AudioTags"
|
|
1561
|
+
},
|
|
1275
1562
|
"drawing": {
|
|
1276
1563
|
"description": "What the sender drew on this image of this message. Clients show the image with the drawing on top\nand never without it. Absent when the image has no drawing. The same image can carry another drawing\nin another message.\n",
|
|
1277
1564
|
"$ref": "#/$defs/Drawing"
|
|
1278
1565
|
}
|
|
1279
1566
|
}
|
|
1280
1567
|
},
|
|
1568
|
+
"AudioTags": {
|
|
1569
|
+
"type": "object",
|
|
1570
|
+
"required": [
|
|
1571
|
+
"title",
|
|
1572
|
+
"artist"
|
|
1573
|
+
],
|
|
1574
|
+
"properties": {
|
|
1575
|
+
"title": {
|
|
1576
|
+
"type": [
|
|
1577
|
+
"string",
|
|
1578
|
+
"null"
|
|
1579
|
+
],
|
|
1580
|
+
"maxLength": 100
|
|
1581
|
+
},
|
|
1582
|
+
"artist": {
|
|
1583
|
+
"type": [
|
|
1584
|
+
"string",
|
|
1585
|
+
"null"
|
|
1586
|
+
],
|
|
1587
|
+
"maxLength": 100
|
|
1588
|
+
}
|
|
1589
|
+
}
|
|
1590
|
+
},
|
|
1281
1591
|
"Drawing": {
|
|
1282
1592
|
"type": "object",
|
|
1283
1593
|
"description": "Strokes and text labels on an image. Coordinates, widths and sizes are fractions of the image as it is\nshown (0 is the left or top edge, 1 the right or bottom edge), so the drawing fits any display size.\nItems are drawn in order. The server rounds numbers to four decimals.\n",
|
|
@@ -2807,6 +3117,7 @@
|
|
|
2807
3117
|
"name",
|
|
2808
3118
|
"description",
|
|
2809
3119
|
"avatar_url",
|
|
3120
|
+
"background",
|
|
2810
3121
|
"owner_id",
|
|
2811
3122
|
"my_role",
|
|
2812
3123
|
"members",
|
|
@@ -2834,6 +3145,17 @@
|
|
|
2834
3145
|
"null"
|
|
2835
3146
|
]
|
|
2836
3147
|
},
|
|
3148
|
+
"background": {
|
|
3149
|
+
"description": "The banner and page background of the group profile; set by the owner and admins.",
|
|
3150
|
+
"oneOf": [
|
|
3151
|
+
{
|
|
3152
|
+
"$ref": "#/$defs/ProfileBackground"
|
|
3153
|
+
},
|
|
3154
|
+
{
|
|
3155
|
+
"type": "null"
|
|
3156
|
+
}
|
|
3157
|
+
]
|
|
3158
|
+
},
|
|
2837
3159
|
"owner_id": {
|
|
2838
3160
|
"$ref": "#/$defs/Id"
|
|
2839
3161
|
},
|
|
@@ -5310,7 +5632,7 @@
|
|
|
5310
5632
|
},
|
|
5311
5633
|
"ServerUserUpdatedEvent": {
|
|
5312
5634
|
"title": "ServerUserUpdatedEvent",
|
|
5313
|
-
"description": "A user you share a chat with changed their username, display name, bio or
|
|
5635
|
+
"description": "A user you share a chat with changed their username, display name, bio, avatar, pronouns, birthday, profile music or profile background. Fetch GET /users/{user_id} again when profile_version is higher than the one you keep.",
|
|
5314
5636
|
"type": "object",
|
|
5315
5637
|
"properties": {
|
|
5316
5638
|
"type": {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@myronsi/messenger-api",
|
|
3
|
-
"version": "2.1.0-alpha.
|
|
3
|
+
"version": "2.1.0-alpha.29.next.113",
|
|
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": {
|