@myronsi/messenger-api 2.1.0-alpha.5.next.70 → 2.1.0-alpha.6.next.71
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 +6 -0
- package/dist/index.d.ts +2 -2
- package/dist/index.js +1 -1
- package/dist/openapi.yaml +26 -1
- package/dist/schema.d.ts +16 -1
- package/dist/ws-events.d.ts +19 -1
- package/dist/ws-events.schema.json +54 -0
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,12 @@
|
|
|
2
2
|
|
|
3
3
|
Contract changes only. The backend changelog is `CHANGELOG.md` in the repository root. Rules: `docs/api-compatibility.md`.
|
|
4
4
|
|
|
5
|
+
## 2.1.0-alpha.6
|
|
6
|
+
|
|
7
|
+
- `Message` adds optional `reply_preview` (`ReplyPreview`: id, type, sender, the first 100 characters of the
|
|
8
|
+
text, attachment, is_deleted) on history pages and `message` events, so a reply shows what it answers even
|
|
9
|
+
when that message is not loaded. It is absent when the answered message is gone or hidden for the recipient.
|
|
10
|
+
|
|
5
11
|
## 2.1.0-alpha.5
|
|
6
12
|
|
|
7
13
|
- A user's `avatar_url` adds `?rev={revision}`, which changes with every new avatar. `GET /users/{user_id}/avatar`
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* Generated from api/openapi.yaml 2.1.0-alpha.
|
|
2
|
-
export declare const API_VERSION: "2.1.0-alpha.
|
|
1
|
+
/* Generated from api/openapi.yaml 2.1.0-alpha.6. Do not edit. */
|
|
2
|
+
export declare const API_VERSION: "2.1.0-alpha.6";
|
|
3
3
|
export type { paths, components, operations } from "./schema.js";
|
|
4
4
|
export * from "./ws-events.js";
|
package/dist/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const API_VERSION = "2.1.0-alpha.
|
|
1
|
+
export const API_VERSION = "2.1.0-alpha.6";
|
package/dist/openapi.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
openapi: 3.1.0
|
|
2
2
|
info:
|
|
3
3
|
title: Messenger API
|
|
4
|
-
version: 2.1.0-alpha.
|
|
4
|
+
version: 2.1.0-alpha.6
|
|
5
5
|
summary: REST contract of the Messenger backend (v2).
|
|
6
6
|
description: |
|
|
7
7
|
Contract for the Go backend. The WebSocket protocol is described in `websocket/` and
|
|
@@ -2641,6 +2641,29 @@ components:
|
|
|
2641
2641
|
- $ref: "#/components/schemas/Id"
|
|
2642
2642
|
- type: "null"
|
|
2643
2643
|
sender_name: { type: string }
|
|
2644
|
+
ReplyPreview:
|
|
2645
|
+
type: object
|
|
2646
|
+
description: |
|
|
2647
|
+
What a reply shows of the message it answers, so a client can draw the quote without loading that
|
|
2648
|
+
message. Set on messages of history pages and `message` events when the recipient can see the answered
|
|
2649
|
+
message; absent when it is gone or hidden for them, and on chat-list previews and search results.
|
|
2650
|
+
required: [id, type, sender, content, attachment, is_deleted]
|
|
2651
|
+
properties:
|
|
2652
|
+
id: { $ref: "#/components/schemas/Id" }
|
|
2653
|
+
type: { $ref: "#/components/schemas/MessageType" }
|
|
2654
|
+
sender:
|
|
2655
|
+
oneOf:
|
|
2656
|
+
- $ref: "#/components/schemas/User"
|
|
2657
|
+
- type: "null"
|
|
2658
|
+
content:
|
|
2659
|
+
type: [string, "null"]
|
|
2660
|
+
maxLength: 100
|
|
2661
|
+
description: The first 100 characters of the text or caption; `null` when deleted or empty.
|
|
2662
|
+
attachment:
|
|
2663
|
+
oneOf:
|
|
2664
|
+
- $ref: "#/components/schemas/Attachment"
|
|
2665
|
+
- type: "null"
|
|
2666
|
+
is_deleted: { type: boolean }
|
|
2644
2667
|
Message:
|
|
2645
2668
|
type: object
|
|
2646
2669
|
required:
|
|
@@ -2678,6 +2701,8 @@ components:
|
|
|
2678
2701
|
oneOf:
|
|
2679
2702
|
- $ref: "#/components/schemas/Id"
|
|
2680
2703
|
- type: "null"
|
|
2704
|
+
reply_preview:
|
|
2705
|
+
$ref: "#/components/schemas/ReplyPreview"
|
|
2681
2706
|
forwarded_from:
|
|
2682
2707
|
oneOf:
|
|
2683
2708
|
- $ref: "#/components/schemas/ForwardedFrom"
|
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.6. Do not edit. */
|
|
2
2
|
export interface paths {
|
|
3
3
|
"/meta": {
|
|
4
4
|
parameters: {
|
|
@@ -1828,6 +1828,20 @@ export interface components {
|
|
|
1828
1828
|
sender_id: components["schemas"]["Id"] | null;
|
|
1829
1829
|
sender_name: string;
|
|
1830
1830
|
};
|
|
1831
|
+
/**
|
|
1832
|
+
* @description What a reply shows of the message it answers, so a client can draw the quote without loading that
|
|
1833
|
+
* message. Set on messages of history pages and `message` events when the recipient can see the answered
|
|
1834
|
+
* message; absent when it is gone or hidden for them, and on chat-list previews and search results.
|
|
1835
|
+
*/
|
|
1836
|
+
ReplyPreview: {
|
|
1837
|
+
id: components["schemas"]["Id"];
|
|
1838
|
+
type: components["schemas"]["MessageType"];
|
|
1839
|
+
sender: components["schemas"]["User"] | null;
|
|
1840
|
+
/** @description The first 100 characters of the text or caption; `null` when deleted or empty. */
|
|
1841
|
+
content: string | null;
|
|
1842
|
+
attachment: components["schemas"]["Attachment"] | null;
|
|
1843
|
+
is_deleted: boolean;
|
|
1844
|
+
};
|
|
1831
1845
|
Message: {
|
|
1832
1846
|
id: components["schemas"]["Id"];
|
|
1833
1847
|
chat_id: components["schemas"]["Id"];
|
|
@@ -1838,6 +1852,7 @@ export interface components {
|
|
|
1838
1852
|
content: string | null;
|
|
1839
1853
|
attachment: components["schemas"]["Attachment"] | null;
|
|
1840
1854
|
reply_to: components["schemas"]["Id"] | null;
|
|
1855
|
+
reply_preview?: components["schemas"]["ReplyPreview"];
|
|
1841
1856
|
forwarded_from: components["schemas"]["ForwardedFrom"] | null;
|
|
1842
1857
|
reactions: components["schemas"]["Reaction"][];
|
|
1843
1858
|
read_by: components["schemas"]["ReadReceipt"][];
|
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.6. Do not edit. */
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* Any WebSocket event, in either direction.
|
|
@@ -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;
|
|
@@ -1276,6 +1276,57 @@
|
|
|
1276
1276
|
}
|
|
1277
1277
|
}
|
|
1278
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
|
+
},
|
|
1279
1330
|
"Message": {
|
|
1280
1331
|
"type": "object",
|
|
1281
1332
|
"required": [
|
|
@@ -1342,6 +1393,9 @@
|
|
|
1342
1393
|
}
|
|
1343
1394
|
]
|
|
1344
1395
|
},
|
|
1396
|
+
"reply_preview": {
|
|
1397
|
+
"$ref": "#/$defs/ReplyPreview"
|
|
1398
|
+
},
|
|
1345
1399
|
"forwarded_from": {
|
|
1346
1400
|
"oneOf": [
|
|
1347
1401
|
{
|
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.6.next.71",
|
|
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": {
|