@myronsi/messenger-api 2.1.0-alpha.46.next.165 → 2.1.0-alpha.47
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 +16 -0
- package/dist/index.d.ts +2 -2
- package/dist/index.js +1 -1
- package/dist/openapi.yaml +472 -19
- package/dist/schema.d.ts +557 -21
- package/dist/ws-docs.json +34 -1
- package/dist/ws-events.d.ts +152 -9
- package/dist/ws-events.schema.json +574 -18
- package/package.json +1 -1
package/dist/schema.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* Generated from api/openapi.yaml 2.1.0-alpha.
|
|
1
|
+
/* Generated from api/openapi.yaml 2.1.0-alpha.47. Do not edit. */
|
|
2
2
|
export interface paths {
|
|
3
3
|
"/meta": {
|
|
4
4
|
parameters: {
|
|
@@ -2074,6 +2074,96 @@ export interface paths {
|
|
|
2074
2074
|
patch?: never;
|
|
2075
2075
|
trace?: never;
|
|
2076
2076
|
};
|
|
2077
|
+
"/chats/{chat_id}/messages/{message_id}/poll/votes": {
|
|
2078
|
+
parameters: {
|
|
2079
|
+
query?: never;
|
|
2080
|
+
header?: {
|
|
2081
|
+
/** @description Version of the client app, for logs and the per-client metric. */
|
|
2082
|
+
"X-Client-Version"?: components["parameters"]["ClientVersion"];
|
|
2083
|
+
/** @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`). */
|
|
2084
|
+
"X-Client-Api-Version"?: components["parameters"]["ClientApiVersion"];
|
|
2085
|
+
};
|
|
2086
|
+
path: {
|
|
2087
|
+
chat_id: components["parameters"]["ChatId"];
|
|
2088
|
+
message_id: components["parameters"]["MessageId"];
|
|
2089
|
+
};
|
|
2090
|
+
cookie?: never;
|
|
2091
|
+
};
|
|
2092
|
+
get?: never;
|
|
2093
|
+
/**
|
|
2094
|
+
* Vote in a poll, change the vote or take it back
|
|
2095
|
+
* @description Replaces the caller's vote with `options` (indexes into `Poll.options`). An empty list takes the vote back.
|
|
2096
|
+
* More than one option needs `multiple_answers` (`422`). A quiz takes one option, and its first answer is
|
|
2097
|
+
* final (`409` `quiz_answered`). A closed poll answers `409` `poll_closed`. Members only; in a direct chat
|
|
2098
|
+
* with a block `403`. Every change sends `poll_updated` to the members of the chat.
|
|
2099
|
+
*/
|
|
2100
|
+
put: operations["votePoll"];
|
|
2101
|
+
post?: never;
|
|
2102
|
+
delete?: never;
|
|
2103
|
+
options?: never;
|
|
2104
|
+
head?: never;
|
|
2105
|
+
patch?: never;
|
|
2106
|
+
trace?: never;
|
|
2107
|
+
};
|
|
2108
|
+
"/chats/{chat_id}/messages/{message_id}/poll/close": {
|
|
2109
|
+
parameters: {
|
|
2110
|
+
query?: never;
|
|
2111
|
+
header?: {
|
|
2112
|
+
/** @description Version of the client app, for logs and the per-client metric. */
|
|
2113
|
+
"X-Client-Version"?: components["parameters"]["ClientVersion"];
|
|
2114
|
+
/** @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`). */
|
|
2115
|
+
"X-Client-Api-Version"?: components["parameters"]["ClientApiVersion"];
|
|
2116
|
+
};
|
|
2117
|
+
path: {
|
|
2118
|
+
chat_id: components["parameters"]["ChatId"];
|
|
2119
|
+
message_id: components["parameters"]["MessageId"];
|
|
2120
|
+
};
|
|
2121
|
+
cookie?: never;
|
|
2122
|
+
};
|
|
2123
|
+
get?: never;
|
|
2124
|
+
put?: never;
|
|
2125
|
+
/**
|
|
2126
|
+
* Close a poll
|
|
2127
|
+
* @description The creator may close the poll; in a group also the owner and admins (`Poll.can_close`, `403` otherwise).
|
|
2128
|
+
* Closing a closed poll changes nothing. A closed poll shows its results and the quiz answer to everyone and
|
|
2129
|
+
* takes no more votes. Sends `poll_updated`; no system message and no push.
|
|
2130
|
+
*/
|
|
2131
|
+
post: operations["closePoll"];
|
|
2132
|
+
delete?: never;
|
|
2133
|
+
options?: never;
|
|
2134
|
+
head?: never;
|
|
2135
|
+
patch?: never;
|
|
2136
|
+
trace?: never;
|
|
2137
|
+
};
|
|
2138
|
+
"/chats/{chat_id}/messages/{message_id}/poll/voters": {
|
|
2139
|
+
parameters: {
|
|
2140
|
+
query?: never;
|
|
2141
|
+
header?: {
|
|
2142
|
+
/** @description Version of the client app, for logs and the per-client metric. */
|
|
2143
|
+
"X-Client-Version"?: components["parameters"]["ClientVersion"];
|
|
2144
|
+
/** @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`). */
|
|
2145
|
+
"X-Client-Api-Version"?: components["parameters"]["ClientApiVersion"];
|
|
2146
|
+
};
|
|
2147
|
+
path: {
|
|
2148
|
+
chat_id: components["parameters"]["ChatId"];
|
|
2149
|
+
message_id: components["parameters"]["MessageId"];
|
|
2150
|
+
};
|
|
2151
|
+
cookie?: never;
|
|
2152
|
+
};
|
|
2153
|
+
/**
|
|
2154
|
+
* Who voted for an option of a public poll
|
|
2155
|
+
* @description Only for polls with `anonymous: false`, and only when the caller sees the results (`PollOption.voter_count` is
|
|
2156
|
+
* not `null`); `403` otherwise. Newest vote first. Users appear as the caller may see them.
|
|
2157
|
+
*/
|
|
2158
|
+
get: operations["listPollVoters"];
|
|
2159
|
+
put?: never;
|
|
2160
|
+
post?: never;
|
|
2161
|
+
delete?: never;
|
|
2162
|
+
options?: never;
|
|
2163
|
+
head?: never;
|
|
2164
|
+
patch?: never;
|
|
2165
|
+
trace?: never;
|
|
2166
|
+
};
|
|
2077
2167
|
"/chats/{chat_id}/imports": {
|
|
2078
2168
|
parameters: {
|
|
2079
2169
|
query?: never;
|
|
@@ -2509,7 +2599,10 @@ export interface paths {
|
|
|
2509
2599
|
delete: operations["deleteGroup"];
|
|
2510
2600
|
options?: never;
|
|
2511
2601
|
head?: never;
|
|
2512
|
-
/**
|
|
2602
|
+
/**
|
|
2603
|
+
* Change name or description
|
|
2604
|
+
* @description A new name posts a `group_renamed` system message; the same name posts nothing.
|
|
2605
|
+
*/
|
|
2513
2606
|
patch: operations["updateGroup"];
|
|
2514
2607
|
trace?: never;
|
|
2515
2608
|
};
|
|
@@ -2530,11 +2623,17 @@ export interface paths {
|
|
|
2530
2623
|
get?: never;
|
|
2531
2624
|
/**
|
|
2532
2625
|
* Set the group avatar from an uploaded attachment
|
|
2533
|
-
* @description The attachment must be an image the caller uploaded with purpose `avatar` (`422` otherwise).
|
|
2626
|
+
* @description The attachment must be an image the caller uploaded with purpose `avatar` (`422` otherwise). Posts a
|
|
2627
|
+
* `group_avatar_changed` system message.
|
|
2534
2628
|
*/
|
|
2535
2629
|
put: operations["setGroupAvatar"];
|
|
2536
2630
|
post?: never;
|
|
2537
|
-
|
|
2631
|
+
/**
|
|
2632
|
+
* Remove the group avatar
|
|
2633
|
+
* @description Same permission as setting it. Posts a `group_avatar_changed` system message with `avatar_removed: true`;
|
|
2634
|
+
* removing an avatar the group does not have changes nothing.
|
|
2635
|
+
*/
|
|
2636
|
+
delete: operations["deleteGroupAvatar"];
|
|
2538
2637
|
options?: never;
|
|
2539
2638
|
head?: never;
|
|
2540
2639
|
patch?: never;
|
|
@@ -2648,7 +2747,8 @@ export interface paths {
|
|
|
2648
2747
|
put?: never;
|
|
2649
2748
|
/**
|
|
2650
2749
|
* Make another member the owner
|
|
2651
|
-
* @description The previous owner becomes an admin. Transferring to yourself is `422`.
|
|
2750
|
+
* @description The previous owner becomes an admin. Transferring to yourself is `422`. Posts an `owner_transferred` system
|
|
2751
|
+
* message.
|
|
2652
2752
|
*/
|
|
2653
2753
|
post: operations["transferGroupOwnership"];
|
|
2654
2754
|
delete?: never;
|
|
@@ -3849,6 +3949,67 @@ export interface paths {
|
|
|
3849
3949
|
patch?: never;
|
|
3850
3950
|
trace?: never;
|
|
3851
3951
|
};
|
|
3952
|
+
"/maps/tiles/{z}/{x}/{y}": {
|
|
3953
|
+
parameters: {
|
|
3954
|
+
query?: never;
|
|
3955
|
+
header?: {
|
|
3956
|
+
/** @description Version of the client app, for logs and the per-client metric. */
|
|
3957
|
+
"X-Client-Version"?: components["parameters"]["ClientVersion"];
|
|
3958
|
+
/** @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`). */
|
|
3959
|
+
"X-Client-Api-Version"?: components["parameters"]["ClientApiVersion"];
|
|
3960
|
+
};
|
|
3961
|
+
path: {
|
|
3962
|
+
z: number;
|
|
3963
|
+
/** @description Tile column, `0` to `2^z - 1` */
|
|
3964
|
+
x: number;
|
|
3965
|
+
/** @description Tile row, `0` to `2^z - 1` */
|
|
3966
|
+
y: number;
|
|
3967
|
+
};
|
|
3968
|
+
cookie?: never;
|
|
3969
|
+
};
|
|
3970
|
+
/**
|
|
3971
|
+
* A 256 px map tile, through the server
|
|
3972
|
+
* @description For the map a client shows while picking a place. The server fetches OpenStreetMap tiles and caches them, so
|
|
3973
|
+
* the viewer never contacts the tile provider. Clients must show "© OpenStreetMap contributors" on the map,
|
|
3974
|
+
* request only the tiles of the visible area and never download tiles ahead (no offline maps). At most 600
|
|
3975
|
+
* tiles per minute per user (`429`). `503` when the provider cannot be reached and no copy is cached.
|
|
3976
|
+
*/
|
|
3977
|
+
get: operations["getMapTile"];
|
|
3978
|
+
put?: never;
|
|
3979
|
+
post?: never;
|
|
3980
|
+
delete?: never;
|
|
3981
|
+
options?: never;
|
|
3982
|
+
head?: never;
|
|
3983
|
+
patch?: never;
|
|
3984
|
+
trace?: never;
|
|
3985
|
+
};
|
|
3986
|
+
"/maps/static": {
|
|
3987
|
+
parameters: {
|
|
3988
|
+
query?: never;
|
|
3989
|
+
header?: {
|
|
3990
|
+
/** @description Version of the client app, for logs and the per-client metric. */
|
|
3991
|
+
"X-Client-Version"?: components["parameters"]["ClientVersion"];
|
|
3992
|
+
/** @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`). */
|
|
3993
|
+
"X-Client-Api-Version"?: components["parameters"]["ClientApiVersion"];
|
|
3994
|
+
};
|
|
3995
|
+
path?: never;
|
|
3996
|
+
cookie?: never;
|
|
3997
|
+
};
|
|
3998
|
+
/**
|
|
3999
|
+
* The map image of a location message
|
|
4000
|
+
* @description Use `MessageLocation.map.url` as it is; `sig` proves the server made it. A 640 x 320 JPEG at zoom 16 with a
|
|
4001
|
+
* pin in the middle, made from OpenStreetMap tiles. Clients show "© OpenStreetMap contributors" on it. `503`
|
|
4002
|
+
* when the image is not made yet and the tile provider cannot be reached.
|
|
4003
|
+
*/
|
|
4004
|
+
get: operations["getStaticMap"];
|
|
4005
|
+
put?: never;
|
|
4006
|
+
post?: never;
|
|
4007
|
+
delete?: never;
|
|
4008
|
+
options?: never;
|
|
4009
|
+
head?: never;
|
|
4010
|
+
patch?: never;
|
|
4011
|
+
trace?: never;
|
|
4012
|
+
};
|
|
3852
4013
|
"/me/notifications": {
|
|
3853
4014
|
parameters: {
|
|
3854
4015
|
query?: never;
|
|
@@ -5006,7 +5167,7 @@ export interface components {
|
|
|
5006
5167
|
* codes must be treated like `internal_error`.
|
|
5007
5168
|
* @enum {string}
|
|
5008
5169
|
*/
|
|
5009
|
-
ErrorCode: "invalid_request" | "validation_failed" | "unauthenticated" | "invalid_credentials" | "two_factor_required" | "invalid_two_factor_code" | "token_expired" | "forbidden" | "not_found" | "conflict" | "already_exists" | "payload_too_large" | "unsupported_media_type" | "rate_limited" | "client_outdated" | "device_proof_stale" | "invalid_client_version" | "blocked_by_user" | "approval_required" | "user_verification_required" | "session_too_new" | "calls_unavailable" | "calls_not_allowed" | "call_identity_required" | "call_full" | "call_ended" | "already_in_call" | "stale_epoch" | "limit_reached" | "account_restricted" | "internal_error";
|
|
5170
|
+
ErrorCode: "invalid_request" | "validation_failed" | "unauthenticated" | "invalid_credentials" | "two_factor_required" | "invalid_two_factor_code" | "token_expired" | "forbidden" | "not_found" | "conflict" | "already_exists" | "payload_too_large" | "unsupported_media_type" | "rate_limited" | "client_outdated" | "device_proof_stale" | "invalid_client_version" | "blocked_by_user" | "approval_required" | "user_verification_required" | "session_too_new" | "calls_unavailable" | "calls_not_allowed" | "call_identity_required" | "call_full" | "call_ended" | "already_in_call" | "stale_epoch" | "limit_reached" | "account_restricted" | "poll_closed" | "quiz_answered" | "internal_error";
|
|
5010
5171
|
/** @description RFC 9457 problem details. `426 Upgrade Required` (`client_outdated`) uses the same format. */
|
|
5011
5172
|
Problem: {
|
|
5012
5173
|
/**
|
|
@@ -5584,6 +5745,12 @@ export interface components {
|
|
|
5584
5745
|
* border and stores a WebP (`413` when that is still over 512 KB). Only its uploader can load it until it is
|
|
5585
5746
|
* added to a pack.
|
|
5586
5747
|
*
|
|
5748
|
+
* A sticker can also be made from a video (`kind: video`: MP4, WebM or MOV) or an animated GIF of at most 15 MB.
|
|
5749
|
+
* The server keeps at most 3 s of it (from `start_ms` to `end_ms`, or the first 3 s), crops it to the square
|
|
5750
|
+
* `crop_x`, `crop_y`, `crop_size` when given (otherwise it fits the clip into the square with a transparent
|
|
5751
|
+
* border), drops the sound and stores a looping animated WebP of at most 512 x 512 px (`413` when it is still
|
|
5752
|
+
* over 1 MB at the lowest quality). The sticker then has `is_animated: true`.
|
|
5753
|
+
*
|
|
5587
5754
|
* `profile_music`: an audio file of at most 20 MB. The server keeps at most 30 s of it (from `start_ms` to
|
|
5588
5755
|
* `end_ms`, or the first 30 s), stored as AAC, reads the title and artist into `tags` and the embedded cover
|
|
5589
5756
|
* into `thumbnail_url`. Use it with `PUT /me/music`.
|
|
@@ -5606,10 +5773,22 @@ export interface components {
|
|
|
5606
5773
|
duration_ms?: number;
|
|
5607
5774
|
/** @description Amplitude samples (0-255) of a voice message */
|
|
5608
5775
|
waveform?: number[];
|
|
5609
|
-
/** @description `profile_music`
|
|
5776
|
+
/** @description `profile_music`, and `sticker` from a video or GIF: where the kept part starts. */
|
|
5610
5777
|
start_ms?: number;
|
|
5611
|
-
/**
|
|
5778
|
+
/**
|
|
5779
|
+
* @description `profile_music`: where the kept part ends, at most 30 s after `start_ms`. `sticker` from a video or GIF: at
|
|
5780
|
+
* most 3 s after `start_ms`.
|
|
5781
|
+
*/
|
|
5612
5782
|
end_ms?: number;
|
|
5783
|
+
/** @description `sticker` from a video or GIF: left edge of the square crop, as a fraction of the width. */
|
|
5784
|
+
crop_x?: number;
|
|
5785
|
+
/** @description `sticker` from a video or GIF: top edge of the square crop, as a fraction of the height. */
|
|
5786
|
+
crop_y?: number;
|
|
5787
|
+
/**
|
|
5788
|
+
* @description `sticker` from a video or GIF: side of the square crop, as a fraction of the shorter side. Send all three
|
|
5789
|
+
* crop fields or none; the square must lie inside the frame.
|
|
5790
|
+
*/
|
|
5791
|
+
crop_size?: number;
|
|
5613
5792
|
};
|
|
5614
5793
|
Attachment: {
|
|
5615
5794
|
id: components["schemas"]["AttachmentRef"];
|
|
@@ -5743,11 +5922,17 @@ export interface components {
|
|
|
5743
5922
|
* @enum {string}
|
|
5744
5923
|
*/
|
|
5745
5924
|
MediaKind: "image" | "audio" | "visual" | "file" | "voice" | "link";
|
|
5746
|
-
/**
|
|
5747
|
-
|
|
5925
|
+
/**
|
|
5926
|
+
* @description `poll`, `contact` and `location` carry their data in `Message.poll`, `Message.contact` and
|
|
5927
|
+
* `Message.location`. For older clients their `content` holds a short plain-text summary: `📊 <question>`,
|
|
5928
|
+
* `👤 @<username>`, or `📍 <place name> <OpenStreetMap link>`.
|
|
5929
|
+
* @enum {string}
|
|
5930
|
+
*/
|
|
5931
|
+
MessageType: "text" | "file" | "voice" | "system" | "sticker" | "poll" | "contact" | "location";
|
|
5748
5932
|
/**
|
|
5749
5933
|
* @description One sticker of a pack. `image` is a WebP or PNG of at most 512 x 512 px with transparency, animated when
|
|
5750
|
-
* `is_animated` is true; any signed-in user can load it.
|
|
5934
|
+
* `is_animated` is true (also stickers made from a video or GIF); any signed-in user can load it. The `panel`
|
|
5935
|
+
* variant of an animated sticker is a still first frame. Clients show it without a bubble.
|
|
5751
5936
|
*/
|
|
5752
5937
|
Sticker: {
|
|
5753
5938
|
id: components["schemas"]["Id"];
|
|
@@ -5926,7 +6111,10 @@ export interface components {
|
|
|
5926
6111
|
type: components["schemas"]["MessageType"];
|
|
5927
6112
|
/** @description `null` for system messages. */
|
|
5928
6113
|
sender: components["schemas"]["User"] | null;
|
|
5929
|
-
/**
|
|
6114
|
+
/**
|
|
6115
|
+
* @description Text, the caption of a file, the emoji of a sticker, or the plain-text summary of a poll, contact or
|
|
6116
|
+
* location (see `MessageType`); `null` when deleted.
|
|
6117
|
+
*/
|
|
5930
6118
|
content: string | null;
|
|
5931
6119
|
attachment: components["schemas"]["Attachment"] | null;
|
|
5932
6120
|
reply_to: components["schemas"]["Id"] | null;
|
|
@@ -5963,6 +6151,107 @@ export interface components {
|
|
|
5963
6151
|
mentions?: components["schemas"]["Id"][];
|
|
5964
6152
|
/** @description `true` when an owner or admin wrote `@all`; it mentions every member. Absent otherwise. */
|
|
5965
6153
|
mentions_all?: boolean;
|
|
6154
|
+
/** @description The poll of a `poll` message as the requesting user sees it; absent for other types, when deleted and in chat-list previews. */
|
|
6155
|
+
poll?: components["schemas"]["Poll"];
|
|
6156
|
+
/** @description The shared user of a `contact` message; absent for other types, when deleted and in chat-list previews. */
|
|
6157
|
+
contact?: components["schemas"]["ContactCard"];
|
|
6158
|
+
/** @description The place of a `location` message; absent for other types and when deleted. */
|
|
6159
|
+
location?: components["schemas"]["MessageLocation"];
|
|
6160
|
+
};
|
|
6161
|
+
/**
|
|
6162
|
+
* @description A new poll. Option texts are trimmed and must differ (ignoring case). `quiz` makes it a quiz: one correct
|
|
6163
|
+
* option, one answer per voter that cannot be changed; it cannot be combined with `multiple_answers`.
|
|
6164
|
+
* `close_at` closes the poll automatically, 5 minutes to 30 days from now.
|
|
6165
|
+
*/
|
|
6166
|
+
PollCreate: {
|
|
6167
|
+
question: string;
|
|
6168
|
+
options: string[];
|
|
6169
|
+
/** @default false */
|
|
6170
|
+
multiple_answers: boolean;
|
|
6171
|
+
/**
|
|
6172
|
+
* @description `false` lets everyone who sees the results list who voted for what. Anonymous votes are still stored
|
|
6173
|
+
* with the voter, so each member votes once and can change the vote, but no one else sees them.
|
|
6174
|
+
* @default true
|
|
6175
|
+
*/
|
|
6176
|
+
anonymous: boolean;
|
|
6177
|
+
quiz?: components["schemas"]["PollQuizCreate"];
|
|
6178
|
+
close_at?: components["schemas"]["Timestamp"];
|
|
6179
|
+
};
|
|
6180
|
+
PollQuizCreate: {
|
|
6181
|
+
/** @description Index into `options` */
|
|
6182
|
+
correct_option: number;
|
|
6183
|
+
explanation?: string;
|
|
6184
|
+
};
|
|
6185
|
+
/**
|
|
6186
|
+
* @description A poll as the requesting user sees it. Results (`voter_count`, `total_voters`, `is_correct`, `explanation`)
|
|
6187
|
+
* are `null` or absent until that user voted, unless they created the poll or it is closed. A poll is closed
|
|
6188
|
+
* when `closed_at` is set; clients also treat it as closed once `close_at` has passed.
|
|
6189
|
+
*/
|
|
6190
|
+
Poll: {
|
|
6191
|
+
question: string;
|
|
6192
|
+
options: components["schemas"]["PollOption"][];
|
|
6193
|
+
multiple_answers: boolean;
|
|
6194
|
+
anonymous: boolean;
|
|
6195
|
+
quiz: boolean;
|
|
6196
|
+
/** @description The explanation of a quiz once the user sees the results. */
|
|
6197
|
+
explanation: string | null;
|
|
6198
|
+
close_at: components["schemas"]["Timestamp"] | null;
|
|
6199
|
+
closed_at: components["schemas"]["Timestamp"] | null;
|
|
6200
|
+
/** @description People who voted, each counted once even with several answers. */
|
|
6201
|
+
total_voters: number | null;
|
|
6202
|
+
/** @description Indexes of the options the user voted for; empty when they have not voted. */
|
|
6203
|
+
my_votes: number[];
|
|
6204
|
+
/** @description The user may close the poll now. */
|
|
6205
|
+
can_close: boolean;
|
|
6206
|
+
/** @description Grows with every vote and when the poll closes; keep the poll with the highest version. */
|
|
6207
|
+
version: number;
|
|
6208
|
+
};
|
|
6209
|
+
PollOption: {
|
|
6210
|
+
text: string;
|
|
6211
|
+
voter_count: number | null;
|
|
6212
|
+
/** @description Set on every option of a quiz once the user sees the results; absent otherwise. */
|
|
6213
|
+
is_correct?: boolean;
|
|
6214
|
+
};
|
|
6215
|
+
PollVoteRequest: {
|
|
6216
|
+
options: number[];
|
|
6217
|
+
};
|
|
6218
|
+
ContactCreate: {
|
|
6219
|
+
/** @description A user whose profile the sender may open (`403` otherwise), the sender included; not a deleted account. */
|
|
6220
|
+
user_id: components["schemas"]["Id"];
|
|
6221
|
+
};
|
|
6222
|
+
ContactCard: {
|
|
6223
|
+
user_id: components["schemas"]["Id"];
|
|
6224
|
+
/**
|
|
6225
|
+
* @description The shared user as the requesting user may see them now, not as they were when the card was sent; `null`
|
|
6226
|
+
* when the account is gone.
|
|
6227
|
+
*/
|
|
6228
|
+
user: components["schemas"]["User"] | null;
|
|
6229
|
+
};
|
|
6230
|
+
LocationCreate: {
|
|
6231
|
+
/** Format: double */
|
|
6232
|
+
latitude: number;
|
|
6233
|
+
/** Format: double */
|
|
6234
|
+
longitude: number;
|
|
6235
|
+
/** @description Accuracy of a measured position in metres; omit for a point picked on the map. */
|
|
6236
|
+
accuracy_m?: number;
|
|
6237
|
+
/** @description A name for the place, typed by the sender. */
|
|
6238
|
+
title?: string;
|
|
6239
|
+
};
|
|
6240
|
+
/** @description Coordinates are rounded to 6 decimals (about 10 cm). */
|
|
6241
|
+
MessageLocation: {
|
|
6242
|
+
/** Format: double */
|
|
6243
|
+
latitude: number;
|
|
6244
|
+
/** Format: double */
|
|
6245
|
+
longitude: number;
|
|
6246
|
+
accuracy_m: number | null;
|
|
6247
|
+
title: string | null;
|
|
6248
|
+
map: components["schemas"]["MapImage"];
|
|
6249
|
+
};
|
|
6250
|
+
MapImage: {
|
|
6251
|
+
/** @description `GET /maps/static` with the signed point; load it like other API images */
|
|
6252
|
+
url: string;
|
|
6253
|
+
width: number;
|
|
6254
|
+
height: number;
|
|
5966
6255
|
};
|
|
5967
6256
|
LinkPreview: {
|
|
5968
6257
|
/** @description The page after redirects */
|
|
@@ -5979,12 +6268,14 @@ export interface components {
|
|
|
5979
6268
|
height: number | null;
|
|
5980
6269
|
};
|
|
5981
6270
|
/** @enum {string} */
|
|
5982
|
-
SystemEventKind: "group_created" | "member_added" | "member_joined" | "member_removed" | "member_left" | "call" | "message_pinned" | "message_unpinned" | "history_imported" | "history_import_ended" | "imported_note";
|
|
6271
|
+
SystemEventKind: "group_created" | "member_added" | "member_joined" | "member_removed" | "member_left" | "call" | "message_pinned" | "message_unpinned" | "history_imported" | "history_import_ended" | "imported_note" | "group_renamed" | "group_avatar_changed" | "owner_transferred";
|
|
5983
6272
|
/**
|
|
5984
6273
|
* @description What a `system` message records; set on system messages only, whose `content` is then `null`. The names
|
|
5985
|
-
* are the display names at the time of the event. `target` fields are set for `member_added
|
|
5986
|
-
* `member_removed
|
|
5987
|
-
*
|
|
6274
|
+
* are the display names at the time of the event. `target` fields are set for `member_added`,
|
|
6275
|
+
* `member_removed` and `owner_transferred` (the new owner; `actor` is the previous one). `call` is set for
|
|
6276
|
+
* `call` messages: one per call, posted when the call ends, `actor` is the initiator. `message_id` and
|
|
6277
|
+
* `snippet` are set for `message_pinned` and `message_unpinned`. `old_name` and `new_name` are set for
|
|
6278
|
+
* `group_renamed`, `avatar_removed` for `group_avatar_changed`.
|
|
5988
6279
|
* `history_imported` opens and `history_import_ended` closes an imported history; both carry `import`, and
|
|
5989
6280
|
* `actor` is the importer. `imported_note` is a line of the export that is not a message; its text is `text`.
|
|
5990
6281
|
*/
|
|
@@ -5998,11 +6289,16 @@ export interface components {
|
|
|
5998
6289
|
/** @description The pinned or unpinned message. */
|
|
5999
6290
|
message_id?: components["schemas"]["Id"];
|
|
6000
6291
|
/**
|
|
6001
|
-
* @description Start of the pinned message's text at the time of the event (at most 60 characters plus `…`)
|
|
6002
|
-
* message without text
|
|
6292
|
+
* @description Start of the pinned message's text at the time of the event (at most 60 characters plus `…`): the question
|
|
6293
|
+
* of a poll, the place name of a location. Empty for a message without text and for a contact, which clients
|
|
6294
|
+
* name by its `message_type`.
|
|
6003
6295
|
*/
|
|
6004
6296
|
snippet?: string;
|
|
6005
6297
|
message_type?: components["schemas"]["MessageType"];
|
|
6298
|
+
old_name?: string;
|
|
6299
|
+
new_name?: string;
|
|
6300
|
+
/** @description `true` when the group photo was removed, `false` when a new one was set. */
|
|
6301
|
+
avatar_removed?: boolean;
|
|
6006
6302
|
import?: components["schemas"]["ImportSummary"];
|
|
6007
6303
|
/** @description The line of the export, for `imported_note`. */
|
|
6008
6304
|
text?: string;
|
|
@@ -6033,12 +6329,18 @@ export interface components {
|
|
|
6033
6329
|
chat_id: components["schemas"]["Id"];
|
|
6034
6330
|
client_temp_id: components["schemas"]["ClientTempId"];
|
|
6035
6331
|
/** @enum {string} */
|
|
6036
|
-
type: "text" | "file" | "voice" | "sticker";
|
|
6332
|
+
type: "text" | "file" | "voice" | "sticker" | "poll" | "contact" | "location";
|
|
6037
6333
|
content: string | null;
|
|
6038
6334
|
reply_to: components["schemas"]["Id"] | null;
|
|
6039
6335
|
/** @description Uploaded files of the send that still exist, in the order they were sent. */
|
|
6040
6336
|
attachments: components["schemas"]["Attachment"][];
|
|
6041
6337
|
sticker?: components["schemas"]["Sticker"];
|
|
6338
|
+
/** @description The poll of an unsent `poll` message, as it was sent. */
|
|
6339
|
+
poll?: components["schemas"]["PollCreate"];
|
|
6340
|
+
/** @description The contact of an unsent `contact` message, as it was sent. */
|
|
6341
|
+
contact?: components["schemas"]["ContactCreate"];
|
|
6342
|
+
/** @description The place of an unsent `location` message, as it was sent. */
|
|
6343
|
+
location?: components["schemas"]["LocationCreate"];
|
|
6042
6344
|
error_code: components["schemas"]["ErrorCode"];
|
|
6043
6345
|
created_at: components["schemas"]["Timestamp"];
|
|
6044
6346
|
};
|
|
@@ -6049,8 +6351,18 @@ export interface components {
|
|
|
6049
6351
|
SendMessageRequest: {
|
|
6050
6352
|
client_temp_id: components["schemas"]["ClientTempId"];
|
|
6051
6353
|
/** @enum {string} */
|
|
6052
|
-
type: "text" | "file" | "voice" | "sticker";
|
|
6354
|
+
type: "text" | "file" | "voice" | "sticker" | "poll" | "contact" | "location";
|
|
6053
6355
|
content?: string | null;
|
|
6356
|
+
/**
|
|
6357
|
+
* @description The poll of a `poll` message. Poll, contact and location messages have no content, attachment, sticker or
|
|
6358
|
+
* drawings; the server writes a plain-text summary into `content` for older clients. Send them with this
|
|
6359
|
+
* operation; the WebSocket `message` event does not take them.
|
|
6360
|
+
*/
|
|
6361
|
+
poll?: components["schemas"]["PollCreate"];
|
|
6362
|
+
/** @description The shared user of a `contact` message. */
|
|
6363
|
+
contact?: components["schemas"]["ContactCreate"];
|
|
6364
|
+
/** @description The place of a `location` message. */
|
|
6365
|
+
location?: components["schemas"]["LocationCreate"];
|
|
6054
6366
|
/**
|
|
6055
6367
|
* @description The sticker of a `sticker` message, from any pack that is not deleted. Sticker messages have no content,
|
|
6056
6368
|
* attachment or drawings; the server sets `content` to the sticker's emoji. Send stickers with this
|
|
@@ -6068,7 +6380,7 @@ export interface components {
|
|
|
6068
6380
|
* instead of the sender's own upload: that is how a member draws on an image someone sent.
|
|
6069
6381
|
*/
|
|
6070
6382
|
drawings?: components["schemas"]["AttachmentDrawing"][];
|
|
6071
|
-
};
|
|
6383
|
+
} & (unknown & unknown & unknown);
|
|
6072
6384
|
EditMessageRequest: {
|
|
6073
6385
|
/** @description New text, or the new caption of a file. Empty removes a file's caption; a text message rejects it. */
|
|
6074
6386
|
content: string;
|
|
@@ -10172,6 +10484,117 @@ export interface operations {
|
|
|
10172
10484
|
426: components["responses"]["ClientOutdated"];
|
|
10173
10485
|
};
|
|
10174
10486
|
};
|
|
10487
|
+
votePoll: {
|
|
10488
|
+
parameters: {
|
|
10489
|
+
query?: never;
|
|
10490
|
+
header?: {
|
|
10491
|
+
/** @description Version of the client app, for logs and the per-client metric. */
|
|
10492
|
+
"X-Client-Version"?: components["parameters"]["ClientVersion"];
|
|
10493
|
+
/** @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`). */
|
|
10494
|
+
"X-Client-Api-Version"?: components["parameters"]["ClientApiVersion"];
|
|
10495
|
+
};
|
|
10496
|
+
path: {
|
|
10497
|
+
chat_id: components["parameters"]["ChatId"];
|
|
10498
|
+
message_id: components["parameters"]["MessageId"];
|
|
10499
|
+
};
|
|
10500
|
+
cookie?: never;
|
|
10501
|
+
};
|
|
10502
|
+
requestBody: {
|
|
10503
|
+
content: {
|
|
10504
|
+
"application/json": components["schemas"]["PollVoteRequest"];
|
|
10505
|
+
};
|
|
10506
|
+
};
|
|
10507
|
+
responses: {
|
|
10508
|
+
/** @description The poll as the caller sees it after the vote */
|
|
10509
|
+
200: {
|
|
10510
|
+
headers: {
|
|
10511
|
+
[name: string]: unknown;
|
|
10512
|
+
};
|
|
10513
|
+
content: {
|
|
10514
|
+
"application/json": components["schemas"]["Poll"];
|
|
10515
|
+
};
|
|
10516
|
+
};
|
|
10517
|
+
400: components["responses"]["BadRequest"];
|
|
10518
|
+
401: components["responses"]["Unauthorized"];
|
|
10519
|
+
403: components["responses"]["Forbidden"];
|
|
10520
|
+
404: components["responses"]["NotFound"];
|
|
10521
|
+
409: components["responses"]["Conflict"];
|
|
10522
|
+
422: components["responses"]["ValidationFailed"];
|
|
10523
|
+
426: components["responses"]["ClientOutdated"];
|
|
10524
|
+
429: components["responses"]["TooManyRequests"];
|
|
10525
|
+
};
|
|
10526
|
+
};
|
|
10527
|
+
closePoll: {
|
|
10528
|
+
parameters: {
|
|
10529
|
+
query?: never;
|
|
10530
|
+
header?: {
|
|
10531
|
+
/** @description Version of the client app, for logs and the per-client metric. */
|
|
10532
|
+
"X-Client-Version"?: components["parameters"]["ClientVersion"];
|
|
10533
|
+
/** @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`). */
|
|
10534
|
+
"X-Client-Api-Version"?: components["parameters"]["ClientApiVersion"];
|
|
10535
|
+
};
|
|
10536
|
+
path: {
|
|
10537
|
+
chat_id: components["parameters"]["ChatId"];
|
|
10538
|
+
message_id: components["parameters"]["MessageId"];
|
|
10539
|
+
};
|
|
10540
|
+
cookie?: never;
|
|
10541
|
+
};
|
|
10542
|
+
requestBody?: never;
|
|
10543
|
+
responses: {
|
|
10544
|
+
/** @description The closed poll as the caller sees it */
|
|
10545
|
+
200: {
|
|
10546
|
+
headers: {
|
|
10547
|
+
[name: string]: unknown;
|
|
10548
|
+
};
|
|
10549
|
+
content: {
|
|
10550
|
+
"application/json": components["schemas"]["Poll"];
|
|
10551
|
+
};
|
|
10552
|
+
};
|
|
10553
|
+
401: components["responses"]["Unauthorized"];
|
|
10554
|
+
403: components["responses"]["Forbidden"];
|
|
10555
|
+
404: components["responses"]["NotFound"];
|
|
10556
|
+
426: components["responses"]["ClientOutdated"];
|
|
10557
|
+
};
|
|
10558
|
+
};
|
|
10559
|
+
listPollVoters: {
|
|
10560
|
+
parameters: {
|
|
10561
|
+
query: {
|
|
10562
|
+
option: number;
|
|
10563
|
+
/** @description Page size */
|
|
10564
|
+
limit?: components["parameters"]["Limit"];
|
|
10565
|
+
/** @description Opaque `next_cursor` of the previous page */
|
|
10566
|
+
after?: components["parameters"]["After"];
|
|
10567
|
+
};
|
|
10568
|
+
header?: {
|
|
10569
|
+
/** @description Version of the client app, for logs and the per-client metric. */
|
|
10570
|
+
"X-Client-Version"?: components["parameters"]["ClientVersion"];
|
|
10571
|
+
/** @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`). */
|
|
10572
|
+
"X-Client-Api-Version"?: components["parameters"]["ClientApiVersion"];
|
|
10573
|
+
};
|
|
10574
|
+
path: {
|
|
10575
|
+
chat_id: components["parameters"]["ChatId"];
|
|
10576
|
+
message_id: components["parameters"]["MessageId"];
|
|
10577
|
+
};
|
|
10578
|
+
cookie?: never;
|
|
10579
|
+
};
|
|
10580
|
+
requestBody?: never;
|
|
10581
|
+
responses: {
|
|
10582
|
+
/** @description Voters of the option */
|
|
10583
|
+
200: {
|
|
10584
|
+
headers: {
|
|
10585
|
+
[name: string]: unknown;
|
|
10586
|
+
};
|
|
10587
|
+
content: {
|
|
10588
|
+
"application/json": components["schemas"]["UserPage"];
|
|
10589
|
+
};
|
|
10590
|
+
};
|
|
10591
|
+
400: components["responses"]["BadRequest"];
|
|
10592
|
+
401: components["responses"]["Unauthorized"];
|
|
10593
|
+
403: components["responses"]["Forbidden"];
|
|
10594
|
+
404: components["responses"]["NotFound"];
|
|
10595
|
+
426: components["responses"]["ClientOutdated"];
|
|
10596
|
+
};
|
|
10597
|
+
};
|
|
10175
10598
|
listChatImports: {
|
|
10176
10599
|
parameters: {
|
|
10177
10600
|
query?: never;
|
|
@@ -10913,6 +11336,37 @@ export interface operations {
|
|
|
10913
11336
|
426: components["responses"]["ClientOutdated"];
|
|
10914
11337
|
};
|
|
10915
11338
|
};
|
|
11339
|
+
deleteGroupAvatar: {
|
|
11340
|
+
parameters: {
|
|
11341
|
+
query?: never;
|
|
11342
|
+
header?: {
|
|
11343
|
+
/** @description Version of the client app, for logs and the per-client metric. */
|
|
11344
|
+
"X-Client-Version"?: components["parameters"]["ClientVersion"];
|
|
11345
|
+
/** @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`). */
|
|
11346
|
+
"X-Client-Api-Version"?: components["parameters"]["ClientApiVersion"];
|
|
11347
|
+
};
|
|
11348
|
+
path: {
|
|
11349
|
+
chat_id: components["parameters"]["ChatId"];
|
|
11350
|
+
};
|
|
11351
|
+
cookie?: never;
|
|
11352
|
+
};
|
|
11353
|
+
requestBody?: never;
|
|
11354
|
+
responses: {
|
|
11355
|
+
/** @description Updated group */
|
|
11356
|
+
200: {
|
|
11357
|
+
headers: {
|
|
11358
|
+
[name: string]: unknown;
|
|
11359
|
+
};
|
|
11360
|
+
content: {
|
|
11361
|
+
"application/json": components["schemas"]["Group"];
|
|
11362
|
+
};
|
|
11363
|
+
};
|
|
11364
|
+
401: components["responses"]["Unauthorized"];
|
|
11365
|
+
403: components["responses"]["Forbidden"];
|
|
11366
|
+
404: components["responses"]["NotFound"];
|
|
11367
|
+
426: components["responses"]["ClientOutdated"];
|
|
11368
|
+
};
|
|
11369
|
+
};
|
|
10916
11370
|
setGroupBackground: {
|
|
10917
11371
|
parameters: {
|
|
10918
11372
|
query?: never;
|
|
@@ -12994,6 +13448,88 @@ export interface operations {
|
|
|
12994
13448
|
429: components["responses"]["TooManyRequests"];
|
|
12995
13449
|
};
|
|
12996
13450
|
};
|
|
13451
|
+
getMapTile: {
|
|
13452
|
+
parameters: {
|
|
13453
|
+
query?: never;
|
|
13454
|
+
header?: {
|
|
13455
|
+
/** @description Version of the client app, for logs and the per-client metric. */
|
|
13456
|
+
"X-Client-Version"?: components["parameters"]["ClientVersion"];
|
|
13457
|
+
/** @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`). */
|
|
13458
|
+
"X-Client-Api-Version"?: components["parameters"]["ClientApiVersion"];
|
|
13459
|
+
};
|
|
13460
|
+
path: {
|
|
13461
|
+
z: number;
|
|
13462
|
+
/** @description Tile column, `0` to `2^z - 1` */
|
|
13463
|
+
x: number;
|
|
13464
|
+
/** @description Tile row, `0` to `2^z - 1` */
|
|
13465
|
+
y: number;
|
|
13466
|
+
};
|
|
13467
|
+
cookie?: never;
|
|
13468
|
+
};
|
|
13469
|
+
requestBody?: never;
|
|
13470
|
+
responses: {
|
|
13471
|
+
/** @description PNG tile */
|
|
13472
|
+
200: {
|
|
13473
|
+
headers: {
|
|
13474
|
+
[name: string]: unknown;
|
|
13475
|
+
};
|
|
13476
|
+
content: {
|
|
13477
|
+
"image/png": string;
|
|
13478
|
+
};
|
|
13479
|
+
};
|
|
13480
|
+
400: components["responses"]["BadRequest"];
|
|
13481
|
+
401: components["responses"]["Unauthorized"];
|
|
13482
|
+
426: components["responses"]["ClientOutdated"];
|
|
13483
|
+
429: components["responses"]["TooManyRequests"];
|
|
13484
|
+
/** @description The tile provider is unavailable */
|
|
13485
|
+
503: {
|
|
13486
|
+
headers: {
|
|
13487
|
+
[name: string]: unknown;
|
|
13488
|
+
};
|
|
13489
|
+
content?: never;
|
|
13490
|
+
};
|
|
13491
|
+
};
|
|
13492
|
+
};
|
|
13493
|
+
getStaticMap: {
|
|
13494
|
+
parameters: {
|
|
13495
|
+
query: {
|
|
13496
|
+
lat: number;
|
|
13497
|
+
lon: number;
|
|
13498
|
+
sig: string;
|
|
13499
|
+
};
|
|
13500
|
+
header?: {
|
|
13501
|
+
/** @description Version of the client app, for logs and the per-client metric. */
|
|
13502
|
+
"X-Client-Version"?: components["parameters"]["ClientVersion"];
|
|
13503
|
+
/** @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`). */
|
|
13504
|
+
"X-Client-Api-Version"?: components["parameters"]["ClientApiVersion"];
|
|
13505
|
+
};
|
|
13506
|
+
path?: never;
|
|
13507
|
+
cookie?: never;
|
|
13508
|
+
};
|
|
13509
|
+
requestBody?: never;
|
|
13510
|
+
responses: {
|
|
13511
|
+
/** @description JPEG image */
|
|
13512
|
+
200: {
|
|
13513
|
+
headers: {
|
|
13514
|
+
[name: string]: unknown;
|
|
13515
|
+
};
|
|
13516
|
+
content: {
|
|
13517
|
+
"image/jpeg": string;
|
|
13518
|
+
};
|
|
13519
|
+
};
|
|
13520
|
+
400: components["responses"]["BadRequest"];
|
|
13521
|
+
401: components["responses"]["Unauthorized"];
|
|
13522
|
+
403: components["responses"]["Forbidden"];
|
|
13523
|
+
426: components["responses"]["ClientOutdated"];
|
|
13524
|
+
/** @description The tile provider is unavailable */
|
|
13525
|
+
503: {
|
|
13526
|
+
headers: {
|
|
13527
|
+
[name: string]: unknown;
|
|
13528
|
+
};
|
|
13529
|
+
content?: never;
|
|
13530
|
+
};
|
|
13531
|
+
};
|
|
13532
|
+
};
|
|
12997
13533
|
getNotificationSettings: {
|
|
12998
13534
|
parameters: {
|
|
12999
13535
|
query?: never;
|