@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/ws-docs.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"markdown": "# WebSocket protocol (API contract v2)\r\n\r\nThe JSON Schemas in `websocket/client/` (client → server) and `websocket/server/` (server → client) are the source of truth. Every event has an example in `websocket/examples/`, validated against its schema by `npm run check`. TypeScript types are generated into `dist/ws-events.d.ts` (`ClientEvent`, `ServerEvent`).\r\n\r\n## Connecting\r\n\r\n1. `POST /api/v2/ws/ticket` (authenticated) returns `{ \"ticket\": \"…\", \"expires_in\": 30 }`. The ticket is single-use and short-lived, so no access token ends up in a URL or a log.\r\n2. Open **one connection per browser tab**: `wss://<host>/api/v2/ws?ticket=<ticket>&api_version=<contract version>`. The connection carries the events of all chats of the user. `api_version` is optional and takes the place of the `X-Client-Api-Version` header, which browsers cannot send on a WebSocket.\r\n3. The first server event is `hello` with `api_version` and `min_client_api_version`. A client that reconnects after a deploy compares them with the contract version it was built for and shows an upgrade notice instead of failing at random.\r\n4. When the ticket is invalid or expired the server closes the connection with code `4401`. A client whose `api_version` is no longer served is closed with `4426` after `hello`.\r\n\r\n## Close codes\r\n\r\n| Code | Meaning | Client |\r\n| --- | --- | --- |\r\n| `1012` | `reconnect`: the server is restarting, or it lost its pub/sub connection and events may be missing | reconnect with backoff, then load what was missed (`after` cursor) |\r\n| `1013` | the client did not keep up with its events | reconnect, then catch up |\r\n| `4401` | invalid ticket, or the session ended (logout, revoked, password changed) | get a new ticket; if that fails, sign in again |\r\n| `4426` | the client's contract version is no longer served | show the upgrade notice |\r\n\r\n## Envelope\r\n\r\nServer → client:\r\n\r\n```json\r\n{ \"type\": \"message\", \"event_id\": \"7217400317439950849\", \"chat_id\": \"42\", \"data\": { \"message\": { \"…\": \"…\" } } }\r\n```\r\n\r\nClient → server:\r\n\r\n```json\r\n{ \"type\": \"message\", \"client_temp_id\": \"c-1\", \"chat_id\": \"42\", \"data\": { \"type\": \"text\", \"content\": \"Hello!\" } }\r\n```\r\n\r\n- All IDs are strings (Snowflake IDs do not fit into a JavaScript number).\r\n- `event_id` is unique and increases per server; it is only for deduplication and logs.\r\n- `chat_id` is always `null` in `hello`, `presence` and `approval_request_created`, which do not belong to a chat. `ack` and `error` repeat the `chat_id` of the client event they answer, and it is `null` for connection-level errors.\r\n- Unknown event `type`s must be ignored by clients, so new event types are not a breaking change.\r\n- A user who is removed from a chat (or whose chat is deleted) receives `chat_deleted` and no further events of that chat.\r\n\r\n## Acknowledgements\r\n\r\nEvery client event except `typing` (which is not acknowledged and carries no `client_temp_id`) has a `client_temp_id` (1–64 characters, unique per client). The server answers with exactly one of:\r\n\r\n- `ack` — `client_temp_id`, and for `message` the stored `message_id` and `created_at`. Sending the same `client_temp_id` again returns the same `ack` (idempotent), which makes retries after a reconnect safe.\r\n- `error` — `client_temp_id` and `data.code`/`data.message`. `code` is one of the stable codes of `ErrorCode` in `openapi.yaml` (the same codes as the REST `application/problem+json` errors).\r\n\r\nThe sender also receives the broadcast `message` event with the stored message (its `client_temp_id` is included, so the client can replace its pending copy).\r\n\r\n## Client → server events\r\n\r\n| Type | Purpose |\r\n| --- | --- |\r\n| `message` | Send a message (`type` `text`, `file` or `voice`; files are referenced by `attachment_id`, never by URL) |\r\n| `resend` | Deliver a stored but undelivered message again |\r\n| `edit` | Edit your own text message |\r\n| `delete` | Delete a message for yourself (`scope: me`) or everyone |\r\n| `read` | Mark messages as read up to `message_id` |\r\n| `reaction_add`, `reaction_remove` | Add or remove a reaction |\r\n| `typing` | Typing indicator (not acknowledged) |\r\n\r\n## Server → client events\r\n\r\n| Type | Meaning |\r\n| --- | --- |\r\n| `hello` | First event: `api_version`, `min_client_api_version`, `user_id` |\r\n| `ack`, `error` | Result of a client event, references `client_temp_id` |\r\n| `message`, `edit`, `delete` | Message created, edited or deleted |\r\n| `reaction_add`, `reaction_remove` | Reactions changed |\r\n| `read` | A user read up to `message_id` |\r\n| `typing` | A user is typing |\r\n| `chat_created`, `chat_deleted`, `chat_list_update` | Chat list changes |\r\n| `group_created`, `group_updated` | Group changes (members, roles, name, avatar) |\r\n| `approval_request_created` | New request in the inbox |\r\n| `presence` | A user came online or went offline |\r\n\r\n## Compatibility\r\n\r\nAdding an event type or an optional field is a MINOR change; removing or renaming an event or field, or making a field required, is MAJOR (see `docs/api-compatibility.md`). Clients must ignore unknown events and unknown fields.\r\n",
|
|
2
|
+
"markdown": "# WebSocket protocol (API contract v2)\r\n\r\nThe JSON Schemas in `websocket/client/` (client → server) and `websocket/server/` (server → client) are the source of truth. Every event has an example in `websocket/examples/`, validated against its schema by `npm run check`. TypeScript types are generated into `dist/ws-events.d.ts` (`ClientEvent`, `ServerEvent`).\r\n\r\n## Connecting\r\n\r\n1. `POST /api/v2/ws/ticket` (authenticated) returns `{ \"ticket\": \"…\", \"expires_in\": 30 }`. The ticket is single-use and short-lived, so no access token ends up in a URL or a log.\r\n2. Open **one connection per browser tab**: `wss://<host>/api/v2/ws?ticket=<ticket>&api_version=<contract version>`. The connection carries the events of all chats of the user. `api_version` is optional and takes the place of the `X-Client-Api-Version` header, which browsers cannot send on a WebSocket.\r\n3. The first server event is `hello` with `api_version` and `min_client_api_version`. A client that reconnects after a deploy compares them with the contract version it was built for and shows an upgrade notice instead of failing at random.\r\n4. When the ticket is invalid or expired the server closes the connection with code `4401`. A client whose `api_version` is no longer served is closed with `4426` after `hello`.\r\n\r\n## Close codes\r\n\r\n| Code | Meaning | Client |\r\n| --- | --- | --- |\r\n| `1012` | `reconnect`: the server is restarting, or it lost its pub/sub connection and events may be missing | reconnect with backoff, then load what was missed (`after` cursor) |\r\n| `1013` | the client did not keep up with its events, or sent more than 64 events that are not handled yet | reconnect, then catch up |\r\n| `4401` | invalid ticket, or the session ended (logout, revoked, password changed) | get a new ticket; if that fails, sign in again |\r\n| `4426` | the client's contract version is no longer served | show the upgrade notice |\r\n| `4429` | the user opened more than 10 connections on this server; the oldest one is closed | do not reconnect this tab automatically |\r\n\r\n## Envelope\r\n\r\nServer → client:\r\n\r\n```json\r\n{ \"type\": \"message\", \"event_id\": \"7217400317439950849\", \"chat_id\": \"42\", \"data\": { \"message\": { \"…\": \"…\" } } }\r\n```\r\n\r\nClient → server:\r\n\r\n```json\r\n{ \"type\": \"message\", \"client_temp_id\": \"c-1\", \"chat_id\": \"42\", \"data\": { \"type\": \"text\", \"content\": \"Hello!\" } }\r\n```\r\n\r\n- All IDs are strings (Snowflake IDs do not fit into a JavaScript number).\r\n- `event_id` is unique and increases per server; it is only for deduplication and logs.\r\n- `chat_id` is always `null` in `hello`, `presence` and `approval_request_created`, which do not belong to a chat. `ack` and `error` repeat the `chat_id` of the client event they answer, and it is `null` for connection-level errors.\r\n- Unknown event `type`s must be ignored by clients, so new event types are not a breaking change.\r\n- A user who is removed from a chat (or whose chat is deleted) receives `chat_deleted` and no further events of that chat.\r\n\r\n## Acknowledgements\r\n\r\nEvery client event except `typing` (which is not acknowledged and carries no `client_temp_id`) has a `client_temp_id` (1–64 characters, unique per client). The server answers with exactly one of:\r\n\r\n- `ack` — `client_temp_id`, and for `message` the stored `message_id` and `created_at`. Sending the same `client_temp_id` again returns the same `ack` (idempotent), which makes retries after a reconnect safe.\r\n- `error` — `client_temp_id` and `data.code`/`data.message`. `code` is one of the stable codes of `ErrorCode` in `openapi.yaml` (the same codes as the REST `application/problem+json` errors).\r\n\r\nThe sender also receives the broadcast `message` event with the stored message (its `client_temp_id` is included, so the client can replace its pending copy).\r\n\r\n## Client → server events\r\n\r\n| Type | Purpose |\r\n| --- | --- |\r\n| `message` | Send a message (`type` `text`, `file` or `voice`; files are referenced by `attachment_id`, never by URL) |\r\n| `resend` | Deliver a stored but undelivered message again |\r\n| `edit` | Edit your own text message |\r\n| `delete` | Delete a message for yourself (`scope: me`) or everyone |\r\n| `read` | Mark messages as read up to `message_id` |\r\n| `reaction_add`, `reaction_remove` | Add or remove a reaction |\r\n| `typing` | Typing indicator (not acknowledged) |\r\n\r\n## Server → client events\r\n\r\n| Type | Meaning |\r\n| --- | --- |\r\n| `hello` | First event: `api_version`, `min_client_api_version`, `user_id` |\r\n| `ack`, `error` | Result of a client event, references `client_temp_id` |\r\n| `message`, `edit`, `delete` | Message created, edited or deleted |\r\n| `reaction_add`, `reaction_remove` | Reactions changed |\r\n| `read` | A user read up to `message_id` |\r\n| `typing` | A user is typing |\r\n| `chat_created`, `chat_deleted`, `chat_list_update` | Chat list changes |\r\n| `group_created`, `group_updated` | Group changes (members, roles, name, avatar) |\r\n| `approval_request_created` | New request in the inbox |\r\n| `presence` | A user came online or went offline |\r\n\r\n## Compatibility\r\n\r\nAdding an event type or an optional field is a MINOR change; removing or renaming an event or field, or making a field required, is MAJOR (see `docs/api-compatibility.md`). Clients must ignore unknown events and unknown fields.\r\n",
|
|
3
3
|
"examples": {
|
|
4
4
|
"client/delete.json": {
|
|
5
5
|
"type": "delete",
|
package/dist/ws-events.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.10. Do not edit. */
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* Any WebSocket event, in either direction.
|
|
@@ -97,7 +97,7 @@ export interface ClientDeleteEvent {
|
|
|
97
97
|
};
|
|
98
98
|
}
|
|
99
99
|
/**
|
|
100
|
-
* Edit your own text message.
|
|
100
|
+
* Edit your own text message or the caption of your file. An empty content removes a file's caption.
|
|
101
101
|
*/
|
|
102
102
|
export interface ClientEditEvent {
|
|
103
103
|
type: "edit";
|
|
@@ -253,7 +253,7 @@ export interface User {
|
|
|
253
253
|
*/
|
|
254
254
|
contact_name?: string | null;
|
|
255
255
|
/**
|
|
256
|
-
* Path of the avatar, always same-origin (`/api/v2/users/{id}/avatar`).
|
|
256
|
+
* Path of the avatar, always same-origin (`/api/v2/users/{id}/avatar?rev={revision}`).
|
|
257
257
|
*/
|
|
258
258
|
avatar_url: string | null;
|
|
259
259
|
bio: string | null;
|
|
@@ -307,6 +307,7 @@ export interface Message {
|
|
|
307
307
|
content: string | null;
|
|
308
308
|
attachment: Attachment | null;
|
|
309
309
|
reply_to: Id | null;
|
|
310
|
+
reply_preview?: ReplyPreview;
|
|
310
311
|
forwarded_from: ForwardedFrom | null;
|
|
311
312
|
reactions: Reaction[];
|
|
312
313
|
read_by: ReadReceipt[];
|
|
@@ -337,6 +338,23 @@ export interface Attachment {
|
|
|
337
338
|
duration_ms?: number | null;
|
|
338
339
|
waveform?: number[] | null;
|
|
339
340
|
}
|
|
341
|
+
/**
|
|
342
|
+
* What a reply shows of the message it answers, so a client can draw the quote without loading that
|
|
343
|
+
* message. Set on messages of history pages and `message` events when the recipient can see the answered
|
|
344
|
+
* message; absent when it is gone or hidden for them, and on chat-list previews and search results.
|
|
345
|
+
*
|
|
346
|
+
*/
|
|
347
|
+
export interface ReplyPreview {
|
|
348
|
+
id: Id;
|
|
349
|
+
type: MessageType;
|
|
350
|
+
sender: User | null;
|
|
351
|
+
/**
|
|
352
|
+
* The first 100 characters of the text or caption; `null` when deleted or empty.
|
|
353
|
+
*/
|
|
354
|
+
content: string | null;
|
|
355
|
+
attachment: Attachment | null;
|
|
356
|
+
is_deleted: boolean;
|
|
357
|
+
}
|
|
340
358
|
export interface ForwardedFrom {
|
|
341
359
|
message_id: Id;
|
|
342
360
|
sender_id: Id | null;
|
|
@@ -1,6 +1,147 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
3
|
"$defs": {
|
|
4
|
+
"NotificationPreferences": {
|
|
5
|
+
"type": "object",
|
|
6
|
+
"required": [
|
|
7
|
+
"enabled",
|
|
8
|
+
"sound",
|
|
9
|
+
"previews"
|
|
10
|
+
],
|
|
11
|
+
"properties": {
|
|
12
|
+
"enabled": {
|
|
13
|
+
"type": "boolean"
|
|
14
|
+
},
|
|
15
|
+
"sound": {
|
|
16
|
+
"type": "boolean"
|
|
17
|
+
},
|
|
18
|
+
"previews": {
|
|
19
|
+
"type": "boolean"
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
},
|
|
23
|
+
"NotificationSettings": {
|
|
24
|
+
"type": "object",
|
|
25
|
+
"required": [
|
|
26
|
+
"preferences",
|
|
27
|
+
"mutes",
|
|
28
|
+
"web_push",
|
|
29
|
+
"android_push",
|
|
30
|
+
"ios_push",
|
|
31
|
+
"vapid_public_key"
|
|
32
|
+
],
|
|
33
|
+
"properties": {
|
|
34
|
+
"preferences": {
|
|
35
|
+
"$ref": "#/$defs/NotificationPreferences"
|
|
36
|
+
},
|
|
37
|
+
"mutes": {
|
|
38
|
+
"type": "array",
|
|
39
|
+
"items": {
|
|
40
|
+
"type": "object",
|
|
41
|
+
"required": [
|
|
42
|
+
"chat_id",
|
|
43
|
+
"until"
|
|
44
|
+
],
|
|
45
|
+
"properties": {
|
|
46
|
+
"chat_id": {
|
|
47
|
+
"$ref": "#/$defs/Id"
|
|
48
|
+
},
|
|
49
|
+
"until": {
|
|
50
|
+
"type": "string",
|
|
51
|
+
"format": "date-time"
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
},
|
|
56
|
+
"web_push": {
|
|
57
|
+
"type": "boolean"
|
|
58
|
+
},
|
|
59
|
+
"android_push": {
|
|
60
|
+
"type": "boolean"
|
|
61
|
+
},
|
|
62
|
+
"ios_push": {
|
|
63
|
+
"type": "boolean"
|
|
64
|
+
},
|
|
65
|
+
"vapid_public_key": {
|
|
66
|
+
"type": "string"
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
},
|
|
70
|
+
"NotificationDeviceRequest": {
|
|
71
|
+
"type": "object",
|
|
72
|
+
"required": [
|
|
73
|
+
"platform",
|
|
74
|
+
"destination"
|
|
75
|
+
],
|
|
76
|
+
"properties": {
|
|
77
|
+
"platform": {
|
|
78
|
+
"type": "string",
|
|
79
|
+
"enum": [
|
|
80
|
+
"web",
|
|
81
|
+
"android",
|
|
82
|
+
"ios"
|
|
83
|
+
]
|
|
84
|
+
},
|
|
85
|
+
"destination": {
|
|
86
|
+
"type": "string",
|
|
87
|
+
"minLength": 1,
|
|
88
|
+
"maxLength": 4096
|
|
89
|
+
},
|
|
90
|
+
"p256dh": {
|
|
91
|
+
"type": "string",
|
|
92
|
+
"maxLength": 128
|
|
93
|
+
},
|
|
94
|
+
"auth": {
|
|
95
|
+
"type": "string",
|
|
96
|
+
"maxLength": 64
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
},
|
|
100
|
+
"NotificationDeviceRegistered": {
|
|
101
|
+
"type": "object",
|
|
102
|
+
"required": [
|
|
103
|
+
"id"
|
|
104
|
+
],
|
|
105
|
+
"properties": {
|
|
106
|
+
"id": {
|
|
107
|
+
"type": "string",
|
|
108
|
+
"format": "uuid"
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
},
|
|
112
|
+
"NotificationMuteRequest": {
|
|
113
|
+
"type": "object",
|
|
114
|
+
"required": [
|
|
115
|
+
"duration"
|
|
116
|
+
],
|
|
117
|
+
"properties": {
|
|
118
|
+
"duration": {
|
|
119
|
+
"type": "string",
|
|
120
|
+
"enum": [
|
|
121
|
+
"off",
|
|
122
|
+
"1h",
|
|
123
|
+
"8h",
|
|
124
|
+
"forever"
|
|
125
|
+
]
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
},
|
|
129
|
+
"NotificationActivity": {
|
|
130
|
+
"type": "object",
|
|
131
|
+
"required": [
|
|
132
|
+
"active",
|
|
133
|
+
"client_id"
|
|
134
|
+
],
|
|
135
|
+
"properties": {
|
|
136
|
+
"active": {
|
|
137
|
+
"type": "boolean"
|
|
138
|
+
},
|
|
139
|
+
"client_id": {
|
|
140
|
+
"type": "string",
|
|
141
|
+
"format": "uuid"
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
},
|
|
4
145
|
"Id": {
|
|
5
146
|
"type": "string",
|
|
6
147
|
"pattern": "^[0-9]{1,19}$",
|
|
@@ -662,7 +803,7 @@
|
|
|
662
803
|
},
|
|
663
804
|
"Visibility": {
|
|
664
805
|
"type": "string",
|
|
665
|
-
"description": "Who may see the item. `*_except`
|
|
806
|
+
"description": "Who may see the item. The exception lists apply to every value; `*_except` behave like `everyone` and `nobody`.\n`contacts` are the users you share a group with, or a direct chat that you opened or read in.\n",
|
|
666
807
|
"enum": [
|
|
667
808
|
"everyone",
|
|
668
809
|
"contacts",
|
|
@@ -699,7 +840,7 @@
|
|
|
699
840
|
},
|
|
700
841
|
"PrivacyExceptions": {
|
|
701
842
|
"type": "object",
|
|
702
|
-
"description": "User IDs per setting; `allow`
|
|
843
|
+
"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.",
|
|
703
844
|
"additionalProperties": {
|
|
704
845
|
"type": "object",
|
|
705
846
|
"required": [
|
|
@@ -838,7 +979,7 @@
|
|
|
838
979
|
"string",
|
|
839
980
|
"null"
|
|
840
981
|
],
|
|
841
|
-
"description": "Path of the avatar, always same-origin (`/api/v2/users/{id}/avatar`)."
|
|
982
|
+
"description": "Path of the avatar, always same-origin (`/api/v2/users/{id}/avatar?rev={revision}`)."
|
|
842
983
|
},
|
|
843
984
|
"bio": {
|
|
844
985
|
"type": [
|
|
@@ -1135,6 +1276,57 @@
|
|
|
1135
1276
|
}
|
|
1136
1277
|
}
|
|
1137
1278
|
},
|
|
1279
|
+
"ReplyPreview": {
|
|
1280
|
+
"type": "object",
|
|
1281
|
+
"description": "What a reply shows of the message it answers, so a client can draw the quote without loading that\nmessage. Set on messages of history pages and `message` events when the recipient can see the answered\nmessage; absent when it is gone or hidden for them, and on chat-list previews and search results.\n",
|
|
1282
|
+
"required": [
|
|
1283
|
+
"id",
|
|
1284
|
+
"type",
|
|
1285
|
+
"sender",
|
|
1286
|
+
"content",
|
|
1287
|
+
"attachment",
|
|
1288
|
+
"is_deleted"
|
|
1289
|
+
],
|
|
1290
|
+
"properties": {
|
|
1291
|
+
"id": {
|
|
1292
|
+
"$ref": "#/$defs/Id"
|
|
1293
|
+
},
|
|
1294
|
+
"type": {
|
|
1295
|
+
"$ref": "#/$defs/MessageType"
|
|
1296
|
+
},
|
|
1297
|
+
"sender": {
|
|
1298
|
+
"oneOf": [
|
|
1299
|
+
{
|
|
1300
|
+
"$ref": "#/$defs/User"
|
|
1301
|
+
},
|
|
1302
|
+
{
|
|
1303
|
+
"type": "null"
|
|
1304
|
+
}
|
|
1305
|
+
]
|
|
1306
|
+
},
|
|
1307
|
+
"content": {
|
|
1308
|
+
"type": [
|
|
1309
|
+
"string",
|
|
1310
|
+
"null"
|
|
1311
|
+
],
|
|
1312
|
+
"maxLength": 100,
|
|
1313
|
+
"description": "The first 100 characters of the text or caption; `null` when deleted or empty."
|
|
1314
|
+
},
|
|
1315
|
+
"attachment": {
|
|
1316
|
+
"oneOf": [
|
|
1317
|
+
{
|
|
1318
|
+
"$ref": "#/$defs/Attachment"
|
|
1319
|
+
},
|
|
1320
|
+
{
|
|
1321
|
+
"type": "null"
|
|
1322
|
+
}
|
|
1323
|
+
]
|
|
1324
|
+
},
|
|
1325
|
+
"is_deleted": {
|
|
1326
|
+
"type": "boolean"
|
|
1327
|
+
}
|
|
1328
|
+
}
|
|
1329
|
+
},
|
|
1138
1330
|
"Message": {
|
|
1139
1331
|
"type": "object",
|
|
1140
1332
|
"required": [
|
|
@@ -1201,6 +1393,9 @@
|
|
|
1201
1393
|
}
|
|
1202
1394
|
]
|
|
1203
1395
|
},
|
|
1396
|
+
"reply_preview": {
|
|
1397
|
+
"$ref": "#/$defs/ReplyPreview"
|
|
1398
|
+
},
|
|
1204
1399
|
"forwarded_from": {
|
|
1205
1400
|
"oneOf": [
|
|
1206
1401
|
{
|
|
@@ -1410,8 +1605,8 @@
|
|
|
1410
1605
|
"properties": {
|
|
1411
1606
|
"content": {
|
|
1412
1607
|
"type": "string",
|
|
1413
|
-
"
|
|
1414
|
-
"
|
|
1608
|
+
"maxLength": 4096,
|
|
1609
|
+
"description": "New text, or the new caption of a file. Empty removes a file's caption; a text message rejects it."
|
|
1415
1610
|
}
|
|
1416
1611
|
}
|
|
1417
1612
|
},
|
|
@@ -1432,6 +1627,58 @@
|
|
|
1432
1627
|
}
|
|
1433
1628
|
}
|
|
1434
1629
|
},
|
|
1630
|
+
"ForwardMessagesRequest": {
|
|
1631
|
+
"type": "object",
|
|
1632
|
+
"required": [
|
|
1633
|
+
"message_ids",
|
|
1634
|
+
"chat_ids"
|
|
1635
|
+
],
|
|
1636
|
+
"properties": {
|
|
1637
|
+
"message_ids": {
|
|
1638
|
+
"type": "array",
|
|
1639
|
+
"minItems": 1,
|
|
1640
|
+
"maxItems": 20,
|
|
1641
|
+
"uniqueItems": true,
|
|
1642
|
+
"items": {
|
|
1643
|
+
"$ref": "#/$defs/Id"
|
|
1644
|
+
}
|
|
1645
|
+
},
|
|
1646
|
+
"chat_ids": {
|
|
1647
|
+
"type": "array",
|
|
1648
|
+
"minItems": 1,
|
|
1649
|
+
"maxItems": 20,
|
|
1650
|
+
"uniqueItems": true,
|
|
1651
|
+
"items": {
|
|
1652
|
+
"$ref": "#/$defs/Id"
|
|
1653
|
+
}
|
|
1654
|
+
}
|
|
1655
|
+
}
|
|
1656
|
+
},
|
|
1657
|
+
"DeleteMessagesRequest": {
|
|
1658
|
+
"type": "object",
|
|
1659
|
+
"required": [
|
|
1660
|
+
"message_ids",
|
|
1661
|
+
"scope"
|
|
1662
|
+
],
|
|
1663
|
+
"properties": {
|
|
1664
|
+
"message_ids": {
|
|
1665
|
+
"type": "array",
|
|
1666
|
+
"minItems": 1,
|
|
1667
|
+
"maxItems": 100,
|
|
1668
|
+
"uniqueItems": true,
|
|
1669
|
+
"items": {
|
|
1670
|
+
"$ref": "#/$defs/Id"
|
|
1671
|
+
}
|
|
1672
|
+
},
|
|
1673
|
+
"scope": {
|
|
1674
|
+
"type": "string",
|
|
1675
|
+
"enum": [
|
|
1676
|
+
"me",
|
|
1677
|
+
"everyone"
|
|
1678
|
+
]
|
|
1679
|
+
}
|
|
1680
|
+
}
|
|
1681
|
+
},
|
|
1435
1682
|
"MarkReadRequest": {
|
|
1436
1683
|
"type": "object",
|
|
1437
1684
|
"required": [
|
|
@@ -1824,7 +2071,7 @@
|
|
|
1824
2071
|
},
|
|
1825
2072
|
"ClientEditEvent": {
|
|
1826
2073
|
"title": "ClientEditEvent",
|
|
1827
|
-
"description": "Edit your own text message.",
|
|
2074
|
+
"description": "Edit your own text message or the caption of your file. An empty content removes a file's caption.",
|
|
1828
2075
|
"type": "object",
|
|
1829
2076
|
"properties": {
|
|
1830
2077
|
"type": {
|
|
@@ -1844,7 +2091,6 @@
|
|
|
1844
2091
|
},
|
|
1845
2092
|
"content": {
|
|
1846
2093
|
"type": "string",
|
|
1847
|
-
"minLength": 1,
|
|
1848
2094
|
"maxLength": 4096
|
|
1849
2095
|
}
|
|
1850
2096
|
},
|
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.10",
|
|
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": {
|