@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/dist/schema.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- /* Generated from api/openapi.yaml 2.1.0-alpha.1. Do not edit. */
1
+ /* Generated from api/openapi.yaml 2.1.0-alpha.10. Do not edit. */
2
2
  export interface paths {
3
3
  "/meta": {
4
4
  parameters: {
@@ -328,6 +328,36 @@ export interface paths {
328
328
  patch?: never;
329
329
  trace?: never;
330
330
  };
331
+ "/me/avatars/{avatar_id}": {
332
+ parameters: {
333
+ query?: never;
334
+ header?: {
335
+ /** @description Version of the client app, for logs and the per-client metric. */
336
+ "X-Client-Version"?: components["parameters"]["ClientVersion"];
337
+ /** @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`). */
338
+ "X-Client-Api-Version"?: components["parameters"]["ClientApiVersion"];
339
+ };
340
+ path: {
341
+ /** @description `id` of an `AvatarVersion` of the caller. */
342
+ avatar_id: components["schemas"]["Id"];
343
+ };
344
+ cookie?: never;
345
+ };
346
+ get?: never;
347
+ put?: never;
348
+ post?: never;
349
+ /**
350
+ * Delete one of your avatars
351
+ * @description Removes the avatar from your history. When it is the current one, the newest remaining avatar becomes
352
+ * current again; without one you get the default avatar. The image is deleted from storage once nothing
353
+ * uses it any more.
354
+ */
355
+ delete: operations["deleteMyAvatar"];
356
+ options?: never;
357
+ head?: never;
358
+ patch?: never;
359
+ trace?: never;
360
+ };
331
361
  "/me/password": {
332
362
  parameters: {
333
363
  query?: never;
@@ -531,7 +561,7 @@ export interface paths {
531
561
  "X-Client-Api-Version"?: components["parameters"]["ClientApiVersion"];
532
562
  };
533
563
  path: {
534
- setting_key: "avatar_visibility" | "profile_visibility" | "presence_visibility" | "group_invites";
564
+ setting_key: "avatar_visibility" | "profile_visibility" | "presence_visibility" | "group_invites" | "direct_messages" | "search_visibility";
535
565
  effect: "allow" | "deny";
536
566
  };
537
567
  cookie?: never;
@@ -630,7 +660,12 @@ export interface paths {
630
660
  path?: never;
631
661
  cookie?: never;
632
662
  };
633
- /** Profile by username */
663
+ /**
664
+ * Profile by username
665
+ * @description Like `GET /users/{user_id}`: a user whose `search_visibility` hides them from the current user (`nobody`
666
+ * without an `allow` exception, or a `deny` exception) is `404` unless the two share a chat. Lookups are
667
+ * rate limited per user.
668
+ */
634
669
  get: operations["getUserByUsername"];
635
670
  put?: never;
636
671
  post?: never;
@@ -654,7 +689,12 @@ export interface paths {
654
689
  };
655
690
  cookie?: never;
656
691
  };
657
- /** Profile by ID */
692
+ /**
693
+ * Profile by ID
694
+ * @description A user whose `search_visibility` hides them from the current user (`nobody` without an `allow` exception,
695
+ * or a `deny` exception) is `404` unless the two share a chat. Your own profile is always found. Lookups are
696
+ * rate limited per user.
697
+ */
658
698
  get: operations["getUser"];
659
699
  put?: never;
660
700
  post?: never;
@@ -681,7 +721,9 @@ export interface paths {
681
721
  /**
682
722
  * Current avatar image
683
723
  * @description Respects the avatar visibility of the user; falls back to the default avatar. With `version`, an
684
- * earlier avatar of the history (`AvatarVersion.url`).
724
+ * earlier avatar of the history (`AvatarVersion.url`). `avatar_url` carries `rev`, the revision of the
725
+ * current avatar: while it matches, the answer may be cached for a year (`immutable`), because a new
726
+ * avatar gets a new `rev` and so a new URL.
685
727
  */
686
728
  get: operations["getUserAvatar"];
687
729
  put?: never;
@@ -731,7 +773,11 @@ export interface paths {
731
773
  cookie?: never;
732
774
  };
733
775
  get?: never;
734
- /** Set your own display name for a user */
776
+ /**
777
+ * Set your own display name for a user
778
+ * @description Follows the rules of `GET /users/{user_id}`: a user whose `search_visibility` hides them from you is `404`
779
+ * unless the two of you share a chat, and the calls count against the same per-user limit.
780
+ */
735
781
  put: operations["setContactName"];
736
782
  post?: never;
737
783
  /** Remove your display name for a user */
@@ -1029,7 +1075,10 @@ export interface paths {
1029
1075
  delete: operations["deleteMessage"];
1030
1076
  options?: never;
1031
1077
  head?: never;
1032
- /** Edit your text message */
1078
+ /**
1079
+ * Edit your text message or the caption of your file
1080
+ * @description An empty `content` removes the caption of a file message; a text message needs at least one character.
1081
+ */
1033
1082
  patch: operations["editMessage"];
1034
1083
  trace?: never;
1035
1084
  };
@@ -1057,6 +1106,64 @@ export interface paths {
1057
1106
  patch?: never;
1058
1107
  trace?: never;
1059
1108
  };
1109
+ "/chats/{chat_id}/messages/forward": {
1110
+ parameters: {
1111
+ query?: never;
1112
+ header?: {
1113
+ /** @description Version of the client app, for logs and the per-client metric. */
1114
+ "X-Client-Version"?: components["parameters"]["ClientVersion"];
1115
+ /** @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`). */
1116
+ "X-Client-Api-Version"?: components["parameters"]["ClientApiVersion"];
1117
+ };
1118
+ path: {
1119
+ chat_id: components["parameters"]["ChatId"];
1120
+ };
1121
+ cookie?: never;
1122
+ };
1123
+ get?: never;
1124
+ put?: never;
1125
+ /**
1126
+ * Forward several messages of a chat to other chats
1127
+ * @description Copies up to 20 messages of the chat, oldest first, into every target chat, at most 20 copies in all. Every
1128
+ * copy counts against the sender's message rate. Every message and target is checked before anything is
1129
+ * written, so a refused one forwards nothing.
1130
+ */
1131
+ post: operations["forwardMessages"];
1132
+ delete?: never;
1133
+ options?: never;
1134
+ head?: never;
1135
+ patch?: never;
1136
+ trace?: never;
1137
+ };
1138
+ "/chats/{chat_id}/messages/delete": {
1139
+ parameters: {
1140
+ query?: never;
1141
+ header?: {
1142
+ /** @description Version of the client app, for logs and the per-client metric. */
1143
+ "X-Client-Version"?: components["parameters"]["ClientVersion"];
1144
+ /** @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`). */
1145
+ "X-Client-Api-Version"?: components["parameters"]["ClientApiVersion"];
1146
+ };
1147
+ path: {
1148
+ chat_id: components["parameters"]["ChatId"];
1149
+ };
1150
+ cookie?: never;
1151
+ };
1152
+ get?: never;
1153
+ put?: never;
1154
+ /**
1155
+ * Delete several messages of a chat
1156
+ * @description Deletes up to 100 messages of the chat with the rules of `DELETE /messages/{message_id}`. Every message
1157
+ * is checked first: when one may not be deleted, none is. With `scope` everyone, messages that are already
1158
+ * deleted for everyone count as done, so a retry after a partial failure finishes the rest.
1159
+ */
1160
+ post: operations["deleteMessages"];
1161
+ delete?: never;
1162
+ options?: never;
1163
+ head?: never;
1164
+ patch?: never;
1165
+ trace?: never;
1166
+ };
1060
1167
  "/search/messages": {
1061
1168
  parameters: {
1062
1169
  query?: never;
@@ -1340,10 +1447,187 @@ export interface paths {
1340
1447
  patch?: never;
1341
1448
  trace?: never;
1342
1449
  };
1450
+ "/me/notifications": {
1451
+ parameters: {
1452
+ query?: never;
1453
+ header?: never;
1454
+ path?: never;
1455
+ cookie?: never;
1456
+ };
1457
+ /** Notification preferences and supported push platforms */
1458
+ get: operations["getNotificationSettings"];
1459
+ /** Replace notification preferences */
1460
+ put: operations["updateNotificationSettings"];
1461
+ post?: never;
1462
+ delete?: never;
1463
+ options?: never;
1464
+ head?: never;
1465
+ patch?: never;
1466
+ trace?: never;
1467
+ };
1468
+ "/notifications/avatar/{token}": {
1469
+ parameters: {
1470
+ query?: never;
1471
+ header?: never;
1472
+ path: {
1473
+ /** @description `avatar_token` of a push notification. */
1474
+ token: string;
1475
+ };
1476
+ cookie?: never;
1477
+ };
1478
+ /**
1479
+ * Sender avatar for a push notification
1480
+ * @description For the service worker, which has no session: the token in the push payload names the recipient
1481
+ * and the sender and expires after an hour. Follows the sender's avatar visibility for the recipient.
1482
+ */
1483
+ get: operations["getNotificationAvatar"];
1484
+ put?: never;
1485
+ post?: never;
1486
+ delete?: never;
1487
+ options?: never;
1488
+ head?: never;
1489
+ patch?: never;
1490
+ trace?: never;
1491
+ };
1492
+ "/notifications/read/{token}": {
1493
+ parameters: {
1494
+ query?: never;
1495
+ header?: never;
1496
+ path: {
1497
+ /** @description `read_token` of a push notification. */
1498
+ token: string;
1499
+ };
1500
+ cookie?: never;
1501
+ };
1502
+ get?: never;
1503
+ put?: never;
1504
+ /**
1505
+ * Mark a chat read from a push notification
1506
+ * @description For the notification's "Mark as read" action: marks the chat read up to the notified message for
1507
+ * the recipient the token names. The token expires after seven days.
1508
+ */
1509
+ post: operations["markNotificationRead"];
1510
+ delete?: never;
1511
+ options?: never;
1512
+ head?: never;
1513
+ patch?: never;
1514
+ trace?: never;
1515
+ };
1516
+ "/me/notification-devices": {
1517
+ parameters: {
1518
+ query?: never;
1519
+ header?: never;
1520
+ path?: never;
1521
+ cookie?: never;
1522
+ };
1523
+ get?: never;
1524
+ put?: never;
1525
+ /** Register a push destination for the current session */
1526
+ post: operations["registerNotificationDevice"];
1527
+ delete?: never;
1528
+ options?: never;
1529
+ head?: never;
1530
+ patch?: never;
1531
+ trace?: never;
1532
+ };
1533
+ "/me/notification-devices/{id}": {
1534
+ parameters: {
1535
+ query?: never;
1536
+ header?: never;
1537
+ path: {
1538
+ id: string;
1539
+ };
1540
+ cookie?: never;
1541
+ };
1542
+ get?: never;
1543
+ put?: never;
1544
+ post?: never;
1545
+ /** Unregister a push destination for the current session */
1546
+ delete: operations["deleteNotificationDevice"];
1547
+ options?: never;
1548
+ head?: never;
1549
+ patch?: never;
1550
+ trace?: never;
1551
+ };
1552
+ "/chats/{chatId}/notification-mute": {
1553
+ parameters: {
1554
+ query?: never;
1555
+ header?: never;
1556
+ path: {
1557
+ chatId: components["schemas"]["Id"];
1558
+ };
1559
+ cookie?: never;
1560
+ };
1561
+ get?: never;
1562
+ /** Mute or unmute a chat */
1563
+ put: operations["setNotificationMute"];
1564
+ post?: never;
1565
+ delete?: never;
1566
+ options?: never;
1567
+ head?: never;
1568
+ patch?: never;
1569
+ trace?: never;
1570
+ };
1571
+ "/me/notification-devices/{id}/activity": {
1572
+ parameters: {
1573
+ query?: never;
1574
+ header?: never;
1575
+ path: {
1576
+ id: string;
1577
+ };
1578
+ cookie?: never;
1579
+ };
1580
+ get?: never;
1581
+ /** Report a visible client with a healthy live connection */
1582
+ put: operations["updateNotificationActivity"];
1583
+ post?: never;
1584
+ delete?: never;
1585
+ options?: never;
1586
+ head?: never;
1587
+ patch?: never;
1588
+ trace?: never;
1589
+ };
1343
1590
  }
1344
1591
  export type webhooks = Record<string, never>;
1345
1592
  export interface components {
1346
1593
  schemas: {
1594
+ NotificationPreferences: {
1595
+ enabled: boolean;
1596
+ sound: boolean;
1597
+ previews: boolean;
1598
+ };
1599
+ NotificationSettings: {
1600
+ preferences: components["schemas"]["NotificationPreferences"];
1601
+ mutes: {
1602
+ chat_id: components["schemas"]["Id"];
1603
+ /** Format: date-time */
1604
+ until: string;
1605
+ }[];
1606
+ web_push: boolean;
1607
+ android_push: boolean;
1608
+ ios_push: boolean;
1609
+ vapid_public_key: string;
1610
+ };
1611
+ NotificationDeviceRequest: {
1612
+ /** @enum {string} */
1613
+ platform: "web" | "android" | "ios";
1614
+ destination: string;
1615
+ p256dh?: string;
1616
+ auth?: string;
1617
+ };
1618
+ NotificationDeviceRegistered: {
1619
+ /** Format: uuid */
1620
+ id: string;
1621
+ };
1622
+ NotificationMuteRequest: {
1623
+ /** @enum {string} */
1624
+ duration: "off" | "1h" | "8h" | "forever";
1625
+ };
1626
+ NotificationActivity: {
1627
+ active: boolean;
1628
+ /** Format: uuid */
1629
+ client_id: string;
1630
+ };
1347
1631
  /**
1348
1632
  * @description Decimal ID as a string (Snowflake IDs exceed 2^53).
1349
1633
  * @example 7217400317439950848
@@ -1530,7 +1814,8 @@ export interface components {
1530
1814
  code: string;
1531
1815
  };
1532
1816
  /**
1533
- * @description Who may see the item. `*_except` scopes use the exception lists.
1817
+ * @description Who may see the item. The exception lists apply to every value; `*_except` behave like `everyone` and `nobody`.
1818
+ * `contacts` are the users you share a group with, or a direct chat that you opened or read in.
1534
1819
  * @enum {string}
1535
1820
  */
1536
1821
  Visibility: "everyone" | "contacts" | "everyone_except" | "nobody_except" | "nobody";
@@ -1540,7 +1825,7 @@ export interface components {
1540
1825
  GroupInvitePolicy: "everyone" | "contacts" | "everyone_except" | "nobody_except" | "nobody" | "wait_approval";
1541
1826
  /** @enum {string} */
1542
1827
  SearchVisibility: "everyone" | "nobody";
1543
- /** @description User IDs per setting; `allow` applies to `nobody_except`, `deny` to `everyone_except`. */
1828
+ /** @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. */
1544
1829
  PrivacyExceptions: {
1545
1830
  [key: string]: {
1546
1831
  allow: components["schemas"]["Id"][];
@@ -1576,7 +1861,7 @@ export interface components {
1576
1861
  display_name: string;
1577
1862
  /** @description The requesting user's own name for this user, if set. */
1578
1863
  contact_name?: string | null;
1579
- /** @description Path of the avatar, always same-origin (`/api/v2/users/{id}/avatar`). */
1864
+ /** @description Path of the avatar, always same-origin (`/api/v2/users/{id}/avatar?rev={revision}`). */
1580
1865
  avatar_url: string | null;
1581
1866
  bio: string | null;
1582
1867
  is_online: boolean;
@@ -1646,6 +1931,20 @@ export interface components {
1646
1931
  sender_id: components["schemas"]["Id"] | null;
1647
1932
  sender_name: string;
1648
1933
  };
1934
+ /**
1935
+ * @description What a reply shows of the message it answers, so a client can draw the quote without loading that
1936
+ * message. Set on messages of history pages and `message` events when the recipient can see the answered
1937
+ * message; absent when it is gone or hidden for them, and on chat-list previews and search results.
1938
+ */
1939
+ ReplyPreview: {
1940
+ id: components["schemas"]["Id"];
1941
+ type: components["schemas"]["MessageType"];
1942
+ sender: components["schemas"]["User"] | null;
1943
+ /** @description The first 100 characters of the text or caption; `null` when deleted or empty. */
1944
+ content: string | null;
1945
+ attachment: components["schemas"]["Attachment"] | null;
1946
+ is_deleted: boolean;
1947
+ };
1649
1948
  Message: {
1650
1949
  id: components["schemas"]["Id"];
1651
1950
  chat_id: components["schemas"]["Id"];
@@ -1656,6 +1955,7 @@ export interface components {
1656
1955
  content: string | null;
1657
1956
  attachment: components["schemas"]["Attachment"] | null;
1658
1957
  reply_to: components["schemas"]["Id"] | null;
1958
+ reply_preview?: components["schemas"]["ReplyPreview"];
1659
1959
  forwarded_from: components["schemas"]["ForwardedFrom"] | null;
1660
1960
  reactions: components["schemas"]["Reaction"][];
1661
1961
  read_by: components["schemas"]["ReadReceipt"][];
@@ -1699,11 +1999,21 @@ export interface components {
1699
1999
  reply_to?: components["schemas"]["Id"] | null;
1700
2000
  };
1701
2001
  EditMessageRequest: {
2002
+ /** @description New text, or the new caption of a file. Empty removes a file's caption; a text message rejects it. */
1702
2003
  content: string;
1703
2004
  };
1704
2005
  ForwardMessageRequest: {
1705
2006
  chat_ids: components["schemas"]["Id"][];
1706
2007
  };
2008
+ ForwardMessagesRequest: {
2009
+ message_ids: components["schemas"]["Id"][];
2010
+ chat_ids: components["schemas"]["Id"][];
2011
+ };
2012
+ DeleteMessagesRequest: {
2013
+ message_ids: components["schemas"]["Id"][];
2014
+ /** @enum {string} */
2015
+ scope: "me" | "everyone";
2016
+ };
1707
2017
  MarkReadRequest: {
1708
2018
  /** @description Everything up to and including this message is read. */
1709
2019
  message_id: components["schemas"]["Id"];
@@ -2443,6 +2753,38 @@ export interface operations {
2443
2753
  426: components["responses"]["ClientOutdated"];
2444
2754
  };
2445
2755
  };
2756
+ deleteMyAvatar: {
2757
+ parameters: {
2758
+ query?: never;
2759
+ header?: {
2760
+ /** @description Version of the client app, for logs and the per-client metric. */
2761
+ "X-Client-Version"?: components["parameters"]["ClientVersion"];
2762
+ /** @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`). */
2763
+ "X-Client-Api-Version"?: components["parameters"]["ClientApiVersion"];
2764
+ };
2765
+ path: {
2766
+ /** @description `id` of an `AvatarVersion` of the caller. */
2767
+ avatar_id: components["schemas"]["Id"];
2768
+ };
2769
+ cookie?: never;
2770
+ };
2771
+ requestBody?: never;
2772
+ responses: {
2773
+ /** @description Updated user */
2774
+ 200: {
2775
+ headers: {
2776
+ [name: string]: unknown;
2777
+ };
2778
+ content: {
2779
+ "application/json": components["schemas"]["Me"];
2780
+ };
2781
+ };
2782
+ 400: components["responses"]["BadRequest"];
2783
+ 401: components["responses"]["Unauthorized"];
2784
+ 404: components["responses"]["NotFound"];
2785
+ 426: components["responses"]["ClientOutdated"];
2786
+ };
2787
+ };
2446
2788
  changePassword: {
2447
2789
  parameters: {
2448
2790
  query?: never;
@@ -2794,7 +3136,7 @@ export interface operations {
2794
3136
  "X-Client-Api-Version"?: components["parameters"]["ClientApiVersion"];
2795
3137
  };
2796
3138
  path: {
2797
- setting_key: "avatar_visibility" | "profile_visibility" | "presence_visibility" | "group_invites";
3139
+ setting_key: "avatar_visibility" | "profile_visibility" | "presence_visibility" | "group_invites" | "direct_messages" | "search_visibility";
2798
3140
  effect: "allow" | "deny";
2799
3141
  };
2800
3142
  cookie?: never;
@@ -2976,6 +3318,7 @@ export interface operations {
2976
3318
  401: components["responses"]["Unauthorized"];
2977
3319
  404: components["responses"]["NotFound"];
2978
3320
  426: components["responses"]["ClientOutdated"];
3321
+ 429: components["responses"]["TooManyRequests"];
2979
3322
  };
2980
3323
  };
2981
3324
  getUser: {
@@ -3007,6 +3350,7 @@ export interface operations {
3007
3350
  401: components["responses"]["Unauthorized"];
3008
3351
  404: components["responses"]["NotFound"];
3009
3352
  426: components["responses"]["ClientOutdated"];
3353
+ 429: components["responses"]["TooManyRequests"];
3010
3354
  };
3011
3355
  };
3012
3356
  getUserAvatar: {
@@ -3014,6 +3358,8 @@ export interface operations {
3014
3358
  query?: {
3015
3359
  /** @description `id` of an `AvatarVersion` of this user. */
3016
3360
  version?: components["schemas"]["Id"];
3361
+ /** @description Revision of the current avatar, as given in `avatar_url`. */
3362
+ rev?: string;
3017
3363
  };
3018
3364
  header?: {
3019
3365
  /** @description Version of the client app, for logs and the per-client metric. */
@@ -3139,6 +3485,7 @@ export interface operations {
3139
3485
  404: components["responses"]["NotFound"];
3140
3486
  422: components["responses"]["ValidationFailed"];
3141
3487
  426: components["responses"]["ClientOutdated"];
3488
+ 429: components["responses"]["TooManyRequests"];
3142
3489
  };
3143
3490
  };
3144
3491
  removeContactName: {
@@ -3789,24 +4136,99 @@ export interface operations {
3789
4136
  429: components["responses"]["TooManyRequests"];
3790
4137
  };
3791
4138
  };
3792
- searchAllMessages: {
4139
+ forwardMessages: {
3793
4140
  parameters: {
3794
- query: {
3795
- q: string;
3796
- /** @description Only this chat */
3797
- chat_id?: components["schemas"]["Id"];
3798
- /** @description Only messages of this user */
3799
- sender_id?: components["schemas"]["Id"];
3800
- type?: "text" | "file" | "voice";
3801
- /** @description Messages created at or after this time */
3802
- from?: components["schemas"]["Timestamp"];
3803
- /** @description Messages created before this time */
3804
- to?: components["schemas"]["Timestamp"];
3805
- /** @description Page size */
3806
- limit?: components["parameters"]["Limit"];
3807
- /** @description Opaque `next_cursor` of the previous page */
3808
- after?: components["parameters"]["After"];
3809
- };
4141
+ query?: never;
4142
+ header?: {
4143
+ /** @description Version of the client app, for logs and the per-client metric. */
4144
+ "X-Client-Version"?: components["parameters"]["ClientVersion"];
4145
+ /** @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`). */
4146
+ "X-Client-Api-Version"?: components["parameters"]["ClientApiVersion"];
4147
+ };
4148
+ path: {
4149
+ chat_id: components["parameters"]["ChatId"];
4150
+ };
4151
+ cookie?: never;
4152
+ };
4153
+ requestBody: {
4154
+ content: {
4155
+ "application/json": components["schemas"]["ForwardMessagesRequest"];
4156
+ };
4157
+ };
4158
+ responses: {
4159
+ /** @description The new messages, per target chat oldest first */
4160
+ 201: {
4161
+ headers: {
4162
+ [name: string]: unknown;
4163
+ };
4164
+ content: {
4165
+ "application/json": {
4166
+ items: components["schemas"]["Message"][];
4167
+ };
4168
+ };
4169
+ };
4170
+ 400: components["responses"]["BadRequest"];
4171
+ 401: components["responses"]["Unauthorized"];
4172
+ 403: components["responses"]["Forbidden"];
4173
+ 404: components["responses"]["NotFound"];
4174
+ 422: components["responses"]["ValidationFailed"];
4175
+ 426: components["responses"]["ClientOutdated"];
4176
+ 429: components["responses"]["TooManyRequests"];
4177
+ };
4178
+ };
4179
+ deleteMessages: {
4180
+ parameters: {
4181
+ query?: never;
4182
+ header?: {
4183
+ /** @description Version of the client app, for logs and the per-client metric. */
4184
+ "X-Client-Version"?: components["parameters"]["ClientVersion"];
4185
+ /** @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`). */
4186
+ "X-Client-Api-Version"?: components["parameters"]["ClientApiVersion"];
4187
+ };
4188
+ path: {
4189
+ chat_id: components["parameters"]["ChatId"];
4190
+ };
4191
+ cookie?: never;
4192
+ };
4193
+ requestBody: {
4194
+ content: {
4195
+ "application/json": components["schemas"]["DeleteMessagesRequest"];
4196
+ };
4197
+ };
4198
+ responses: {
4199
+ /** @description Deleted */
4200
+ 204: {
4201
+ headers: {
4202
+ [name: string]: unknown;
4203
+ };
4204
+ content?: never;
4205
+ };
4206
+ 400: components["responses"]["BadRequest"];
4207
+ 401: components["responses"]["Unauthorized"];
4208
+ 403: components["responses"]["Forbidden"];
4209
+ 404: components["responses"]["NotFound"];
4210
+ 422: components["responses"]["ValidationFailed"];
4211
+ 426: components["responses"]["ClientOutdated"];
4212
+ };
4213
+ };
4214
+ searchAllMessages: {
4215
+ parameters: {
4216
+ query: {
4217
+ q: string;
4218
+ /** @description Only this chat */
4219
+ chat_id?: components["schemas"]["Id"];
4220
+ /** @description Only messages of this user */
4221
+ sender_id?: components["schemas"]["Id"];
4222
+ type?: "text" | "file" | "voice";
4223
+ /** @description Messages created at or after this time */
4224
+ from?: components["schemas"]["Timestamp"];
4225
+ /** @description Messages created before this time */
4226
+ to?: components["schemas"]["Timestamp"];
4227
+ /** @description Page size */
4228
+ limit?: components["parameters"]["Limit"];
4229
+ /** @description Opaque `next_cursor` of the previous page */
4230
+ after?: components["parameters"]["After"];
4231
+ };
3810
4232
  header?: {
3811
4233
  /** @description Version of the client app, for logs and the per-client metric. */
3812
4234
  "X-Client-Version"?: components["parameters"]["ClientVersion"];
@@ -4311,4 +4733,238 @@ export interface operations {
4311
4733
  426: components["responses"]["ClientOutdated"];
4312
4734
  };
4313
4735
  };
4736
+ getNotificationSettings: {
4737
+ parameters: {
4738
+ query?: never;
4739
+ header?: never;
4740
+ path?: never;
4741
+ cookie?: never;
4742
+ };
4743
+ requestBody?: never;
4744
+ responses: {
4745
+ /** @description Notification settings or registered device */
4746
+ 200: {
4747
+ headers: {
4748
+ [name: string]: unknown;
4749
+ };
4750
+ content: {
4751
+ "application/json": components["schemas"]["NotificationSettings"];
4752
+ };
4753
+ };
4754
+ 400: components["responses"]["BadRequest"];
4755
+ 401: components["responses"]["Unauthorized"];
4756
+ 404: components["responses"]["NotFound"];
4757
+ 409: components["responses"]["Conflict"];
4758
+ };
4759
+ };
4760
+ updateNotificationSettings: {
4761
+ parameters: {
4762
+ query?: never;
4763
+ header?: never;
4764
+ path?: never;
4765
+ cookie?: never;
4766
+ };
4767
+ requestBody: {
4768
+ content: {
4769
+ "application/json": components["schemas"]["NotificationPreferences"];
4770
+ };
4771
+ };
4772
+ responses: {
4773
+ /** @description Saved */
4774
+ 204: {
4775
+ headers: {
4776
+ [name: string]: unknown;
4777
+ };
4778
+ content?: never;
4779
+ };
4780
+ 400: components["responses"]["BadRequest"];
4781
+ 401: components["responses"]["Unauthorized"];
4782
+ 404: components["responses"]["NotFound"];
4783
+ 409: components["responses"]["Conflict"];
4784
+ };
4785
+ };
4786
+ getNotificationAvatar: {
4787
+ parameters: {
4788
+ query?: never;
4789
+ header?: never;
4790
+ path: {
4791
+ /** @description `avatar_token` of a push notification. */
4792
+ token: string;
4793
+ };
4794
+ cookie?: never;
4795
+ };
4796
+ requestBody?: never;
4797
+ responses: {
4798
+ /** @description Image */
4799
+ 200: {
4800
+ headers: {
4801
+ [name: string]: unknown;
4802
+ };
4803
+ content: {
4804
+ "image/*": string;
4805
+ };
4806
+ };
4807
+ /** @description The requested byte range (`Range` header) */
4808
+ 206: {
4809
+ headers: {
4810
+ [name: string]: unknown;
4811
+ };
4812
+ content: {
4813
+ "image/*": string;
4814
+ };
4815
+ };
4816
+ /** @description Redirect to a short-lived signed storage URL (with `MEDIA_SIGNED_URLS`) */
4817
+ 302: {
4818
+ headers: {
4819
+ [name: string]: unknown;
4820
+ };
4821
+ content?: never;
4822
+ };
4823
+ /** @description Not modified (`If-None-Match` with the `ETag` of an earlier answer) */
4824
+ 304: {
4825
+ headers: {
4826
+ [name: string]: unknown;
4827
+ };
4828
+ content?: never;
4829
+ };
4830
+ 404: components["responses"]["NotFound"];
4831
+ /** @description The requested range is outside the file */
4832
+ 416: {
4833
+ headers: {
4834
+ [name: string]: unknown;
4835
+ };
4836
+ content?: never;
4837
+ };
4838
+ };
4839
+ };
4840
+ markNotificationRead: {
4841
+ parameters: {
4842
+ query?: never;
4843
+ header?: never;
4844
+ path: {
4845
+ /** @description `read_token` of a push notification. */
4846
+ token: string;
4847
+ };
4848
+ cookie?: never;
4849
+ };
4850
+ requestBody?: never;
4851
+ responses: {
4852
+ /** @description Marked as read */
4853
+ 204: {
4854
+ headers: {
4855
+ [name: string]: unknown;
4856
+ };
4857
+ content?: never;
4858
+ };
4859
+ 404: components["responses"]["NotFound"];
4860
+ };
4861
+ };
4862
+ registerNotificationDevice: {
4863
+ parameters: {
4864
+ query?: never;
4865
+ header?: never;
4866
+ path?: never;
4867
+ cookie?: never;
4868
+ };
4869
+ requestBody: {
4870
+ content: {
4871
+ "application/json": components["schemas"]["NotificationDeviceRequest"];
4872
+ };
4873
+ };
4874
+ responses: {
4875
+ /** @description Notification settings or registered device */
4876
+ 200: {
4877
+ headers: {
4878
+ [name: string]: unknown;
4879
+ };
4880
+ content: {
4881
+ "application/json": components["schemas"]["NotificationDeviceRegistered"];
4882
+ };
4883
+ };
4884
+ 400: components["responses"]["BadRequest"];
4885
+ 401: components["responses"]["Unauthorized"];
4886
+ 404: components["responses"]["NotFound"];
4887
+ 409: components["responses"]["Conflict"];
4888
+ };
4889
+ };
4890
+ deleteNotificationDevice: {
4891
+ parameters: {
4892
+ query?: never;
4893
+ header?: never;
4894
+ path: {
4895
+ id: string;
4896
+ };
4897
+ cookie?: never;
4898
+ };
4899
+ requestBody?: never;
4900
+ responses: {
4901
+ /** @description Saved */
4902
+ 204: {
4903
+ headers: {
4904
+ [name: string]: unknown;
4905
+ };
4906
+ content?: never;
4907
+ };
4908
+ 400: components["responses"]["BadRequest"];
4909
+ 401: components["responses"]["Unauthorized"];
4910
+ 404: components["responses"]["NotFound"];
4911
+ 409: components["responses"]["Conflict"];
4912
+ };
4913
+ };
4914
+ setNotificationMute: {
4915
+ parameters: {
4916
+ query?: never;
4917
+ header?: never;
4918
+ path: {
4919
+ chatId: components["schemas"]["Id"];
4920
+ };
4921
+ cookie?: never;
4922
+ };
4923
+ requestBody: {
4924
+ content: {
4925
+ "application/json": components["schemas"]["NotificationMuteRequest"];
4926
+ };
4927
+ };
4928
+ responses: {
4929
+ /** @description Saved */
4930
+ 204: {
4931
+ headers: {
4932
+ [name: string]: unknown;
4933
+ };
4934
+ content?: never;
4935
+ };
4936
+ 400: components["responses"]["BadRequest"];
4937
+ 401: components["responses"]["Unauthorized"];
4938
+ 404: components["responses"]["NotFound"];
4939
+ 409: components["responses"]["Conflict"];
4940
+ };
4941
+ };
4942
+ updateNotificationActivity: {
4943
+ parameters: {
4944
+ query?: never;
4945
+ header?: never;
4946
+ path: {
4947
+ id: string;
4948
+ };
4949
+ cookie?: never;
4950
+ };
4951
+ requestBody: {
4952
+ content: {
4953
+ "application/json": components["schemas"]["NotificationActivity"];
4954
+ };
4955
+ };
4956
+ responses: {
4957
+ /** @description Saved */
4958
+ 204: {
4959
+ headers: {
4960
+ [name: string]: unknown;
4961
+ };
4962
+ content?: never;
4963
+ };
4964
+ 400: components["responses"]["BadRequest"];
4965
+ 401: components["responses"]["Unauthorized"];
4966
+ 404: components["responses"]["NotFound"];
4967
+ 409: components["responses"]["Conflict"];
4968
+ };
4969
+ };
4314
4970
  }