@myronsi/messenger-api 2.1.0-alpha.61.next.210 → 2.1.0-alpha.63.next.212
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 +12 -0
- package/dist/index.d.ts +2 -2
- package/dist/index.js +1 -1
- package/dist/openapi.yaml +45 -3
- package/dist/schema.d.ts +81 -3
- package/dist/ws-events.d.ts +12 -2
- package/dist/ws-events.schema.json +16 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,18 @@
|
|
|
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.63
|
|
6
|
+
|
|
7
|
+
- Read a public channel before subscribing (C6): `GET /public-groups/{public_name}/posts` returns its newest 50 posts
|
|
8
|
+
to any signed-in user who is not banned from it. Readers can open the files of these posts and report them with
|
|
9
|
+
the existing `POST /chats/{chat_id}/messages/{message_id}/report`.
|
|
10
|
+
|
|
11
|
+
## 2.1.0-alpha.62
|
|
12
|
+
|
|
13
|
+
- Signed channel posts (C4): `Group` and `UpdateGroupRequest` gain `sign_posts` (owner and admins). `Message` gains
|
|
14
|
+
`signature` (the author's display name on posts of a signing channel). Without signing, a channel post has
|
|
15
|
+
`sender: null` for everyone but its author (shown as the channel). Forwarded channel posts name the channel.
|
|
16
|
+
|
|
5
17
|
## 2.1.0-alpha.61
|
|
6
18
|
|
|
7
19
|
- Channel settings `sensitive` (18+) and `recommendable` (on by default) on `Group` and `UpdateGroupRequest`; only the
|
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.63. Do not edit. */
|
|
2
|
+
export declare const API_VERSION: "2.1.0-alpha.63";
|
|
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.63";
|
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.63
|
|
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
|
|
@@ -2579,7 +2579,8 @@ paths:
|
|
|
2579
2579
|
is deleted after 6 months. One active report per reporter and message; reporting again changes the reason
|
|
2580
2580
|
and the note but keeps the first copy. `illegal` is a notice of illegal content and needs a `note` that
|
|
2581
2581
|
explains why (`422` without it). A message the caller cannot see, a deleted message or a chat they are not in
|
|
2582
|
-
is `404
|
|
2582
|
+
is `404`, except a post of a public channel, which anyone who can read it with
|
|
2583
|
+
`GET /public-groups/{public_name}/posts` can report; their own messages and system messages are `422`. Reports of users, messages and groups share the
|
|
2583
2584
|
limit of 20 a day (`429`). Reporting a message does not block anyone and does not change the sender's
|
|
2584
2585
|
account status.
|
|
2585
2586
|
requestBody:
|
|
@@ -4035,6 +4036,36 @@ paths:
|
|
|
4035
4036
|
"404": { $ref: "#/components/responses/NotFound" }
|
|
4036
4037
|
"409": { $ref: "#/components/responses/Conflict" }
|
|
4037
4038
|
"429": { $ref: "#/components/responses/TooManyRequests" }
|
|
4039
|
+
/public-groups/{public_name}/posts:
|
|
4040
|
+
parameters:
|
|
4041
|
+
- $ref: "#/components/parameters/ClientVersion"
|
|
4042
|
+
- $ref: "#/components/parameters/ClientApiVersion"
|
|
4043
|
+
- $ref: "#/components/parameters/PublicNameParam"
|
|
4044
|
+
get:
|
|
4045
|
+
tags: [groups]
|
|
4046
|
+
operationId: listPublicChannelPosts
|
|
4047
|
+
summary: Read a public channel before subscribing
|
|
4048
|
+
description: |
|
|
4049
|
+
The newest posts of a channel with a public name (at most 50, oldest to newest, no comments), for any
|
|
4050
|
+
signed-in user who is not banned from it. Both cursors are always `null`: older posts need a subscription.
|
|
4051
|
+
Members get the same page. Reading here counts no views and marks nothing read. The files of these posts
|
|
4052
|
+
open with `GET /attachments/{attachment_id}/content`, and a reader can report a post with
|
|
4053
|
+
`POST /chats/{chat_id}/messages/{message_id}/report` (`chat_id` from the post). A group that is not a
|
|
4054
|
+
channel, a channel without a public name, or a ban is `404`. Rate limited per user, together with
|
|
4055
|
+
`GET /public-groups/{public_name}`.
|
|
4056
|
+
parameters:
|
|
4057
|
+
- $ref: "#/components/parameters/Limit"
|
|
4058
|
+
responses:
|
|
4059
|
+
"426": { $ref: "#/components/responses/ClientOutdated" }
|
|
4060
|
+
"400": { $ref: "#/components/responses/BadRequest" }
|
|
4061
|
+
"200":
|
|
4062
|
+
description: The newest posts
|
|
4063
|
+
content:
|
|
4064
|
+
application/json:
|
|
4065
|
+
schema: { $ref: "#/components/schemas/MessagePage" }
|
|
4066
|
+
"401": { $ref: "#/components/responses/Unauthorized" }
|
|
4067
|
+
"404": { $ref: "#/components/responses/NotFound" }
|
|
4068
|
+
"429": { $ref: "#/components/responses/TooManyRequests" }
|
|
4038
4069
|
/public-names/{public_name}/availability:
|
|
4039
4070
|
parameters:
|
|
4040
4071
|
- $ref: "#/components/parameters/ClientVersion"
|
|
@@ -8955,7 +8986,9 @@ components:
|
|
|
8955
8986
|
chat_id: { $ref: "#/components/schemas/Id" }
|
|
8956
8987
|
type: { $ref: "#/components/schemas/MessageType" }
|
|
8957
8988
|
sender:
|
|
8958
|
-
description:
|
|
8989
|
+
description: |
|
|
8990
|
+
`null` for system messages, and for channel posts when the channel does not sign posts (shown as the
|
|
8991
|
+
channel), except for the post's own author. Comments always carry their sender.
|
|
8959
8992
|
oneOf:
|
|
8960
8993
|
- $ref: "#/components/schemas/User"
|
|
8961
8994
|
- type: "null"
|
|
@@ -9010,6 +9043,9 @@ components:
|
|
|
9010
9043
|
author's own reads do not count. `post_stats` events update it.
|
|
9011
9044
|
type: [integer, "null"]
|
|
9012
9045
|
minimum: 0
|
|
9046
|
+
signature:
|
|
9047
|
+
description: Channel posts of a channel that signs posts - the author's display name; `null` otherwise.
|
|
9048
|
+
type: [string, "null"]
|
|
9013
9049
|
thread_root_id:
|
|
9014
9050
|
description: Set on a comment of a channel post (the post it belongs to); `null` for posts and other messages.
|
|
9015
9051
|
oneOf:
|
|
@@ -9983,6 +10019,9 @@ components:
|
|
|
9983
10019
|
maxItems: 5
|
|
9984
10020
|
description: Public channels only - up to 5 tags (lowercase letters and digits, at most 24 characters).
|
|
9985
10021
|
items: { type: string, minLength: 1, maxLength: 24 }
|
|
10022
|
+
sign_posts:
|
|
10023
|
+
type: boolean
|
|
10024
|
+
description: Channels only - posts carry the author's name (`Message.signature`); off shows posts as the channel. Owner and admins change it.
|
|
9986
10025
|
sensitive:
|
|
9987
10026
|
type: boolean
|
|
9988
10027
|
description: Channels only - 18+ content. Set by the owner (staff can set it too); apps label the channel 18+.
|
|
@@ -10056,6 +10095,9 @@ components:
|
|
|
10056
10095
|
dropped and letters are lowercased, so `#Game Dev` becomes `gamedev`. After cleaning a tag has 1 to 24
|
|
10057
10096
|
letters or digits; duplicates collapse. A tag on the staff blocklist is `422`.
|
|
10058
10097
|
items: { type: string, minLength: 1, maxLength: 64 }
|
|
10098
|
+
sign_posts:
|
|
10099
|
+
type: boolean
|
|
10100
|
+
description: Channels only - posts carry the author's name (`Message.signature`); off shows posts as the channel. Owner and admins change it.
|
|
10059
10101
|
sensitive:
|
|
10060
10102
|
type: boolean
|
|
10061
10103
|
description: Channels only - 18+ content. Owner only (`403` for admins); apps label the channel 18+.
|
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.63. Do not edit. */
|
|
2
2
|
export interface paths {
|
|
3
3
|
"/meta": {
|
|
4
4
|
parameters: {
|
|
@@ -2263,7 +2263,8 @@ export interface paths {
|
|
|
2263
2263
|
* is deleted after 6 months. One active report per reporter and message; reporting again changes the reason
|
|
2264
2264
|
* and the note but keeps the first copy. `illegal` is a notice of illegal content and needs a `note` that
|
|
2265
2265
|
* explains why (`422` without it). A message the caller cannot see, a deleted message or a chat they are not in
|
|
2266
|
-
* is `404
|
|
2266
|
+
* is `404`, except a post of a public channel, which anyone who can read it with
|
|
2267
|
+
* `GET /public-groups/{public_name}/posts` can report; their own messages and system messages are `422`. Reports of users, messages and groups share the
|
|
2267
2268
|
* limit of 20 a day (`429`). Reporting a message does not block anyone and does not change the sender's
|
|
2268
2269
|
* account status.
|
|
2269
2270
|
*/
|
|
@@ -3514,6 +3515,39 @@ export interface paths {
|
|
|
3514
3515
|
patch?: never;
|
|
3515
3516
|
trace?: never;
|
|
3516
3517
|
};
|
|
3518
|
+
"/public-groups/{public_name}/posts": {
|
|
3519
|
+
parameters: {
|
|
3520
|
+
query?: never;
|
|
3521
|
+
header?: {
|
|
3522
|
+
/** @description Version of the client app, for logs and the per-client metric. */
|
|
3523
|
+
"X-Client-Version"?: components["parameters"]["ClientVersion"];
|
|
3524
|
+
/** @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`). */
|
|
3525
|
+
"X-Client-Api-Version"?: components["parameters"]["ClientApiVersion"];
|
|
3526
|
+
};
|
|
3527
|
+
path: {
|
|
3528
|
+
public_name: components["parameters"]["PublicNameParam"];
|
|
3529
|
+
};
|
|
3530
|
+
cookie?: never;
|
|
3531
|
+
};
|
|
3532
|
+
/**
|
|
3533
|
+
* Read a public channel before subscribing
|
|
3534
|
+
* @description The newest posts of a channel with a public name (at most 50, oldest to newest, no comments), for any
|
|
3535
|
+
* signed-in user who is not banned from it. Both cursors are always `null`: older posts need a subscription.
|
|
3536
|
+
* Members get the same page. Reading here counts no views and marks nothing read. The files of these posts
|
|
3537
|
+
* open with `GET /attachments/{attachment_id}/content`, and a reader can report a post with
|
|
3538
|
+
* `POST /chats/{chat_id}/messages/{message_id}/report` (`chat_id` from the post). A group that is not a
|
|
3539
|
+
* channel, a channel without a public name, or a ban is `404`. Rate limited per user, together with
|
|
3540
|
+
* `GET /public-groups/{public_name}`.
|
|
3541
|
+
*/
|
|
3542
|
+
get: operations["listPublicChannelPosts"];
|
|
3543
|
+
put?: never;
|
|
3544
|
+
post?: never;
|
|
3545
|
+
delete?: never;
|
|
3546
|
+
options?: never;
|
|
3547
|
+
head?: never;
|
|
3548
|
+
patch?: never;
|
|
3549
|
+
trace?: never;
|
|
3550
|
+
};
|
|
3517
3551
|
"/public-names/{public_name}/availability": {
|
|
3518
3552
|
parameters: {
|
|
3519
3553
|
query?: never;
|
|
@@ -6641,7 +6675,10 @@ export interface components {
|
|
|
6641
6675
|
id: components["schemas"]["Id"];
|
|
6642
6676
|
chat_id: components["schemas"]["Id"];
|
|
6643
6677
|
type: components["schemas"]["MessageType"];
|
|
6644
|
-
/**
|
|
6678
|
+
/**
|
|
6679
|
+
* @description `null` for system messages, and for channel posts when the channel does not sign posts (shown as the
|
|
6680
|
+
* channel), except for the post's own author. Comments always carry their sender.
|
|
6681
|
+
*/
|
|
6645
6682
|
sender: components["schemas"]["User"] | null;
|
|
6646
6683
|
/**
|
|
6647
6684
|
* @description Text, the caption of a file, the emoji of a sticker, or the plain-text summary of a poll, contact or
|
|
@@ -6674,6 +6711,8 @@ export interface components {
|
|
|
6674
6711
|
* author's own reads do not count. `post_stats` events update it.
|
|
6675
6712
|
*/
|
|
6676
6713
|
view_count?: number | null;
|
|
6714
|
+
/** @description Channel posts of a channel that signs posts - the author's display name; `null` otherwise. */
|
|
6715
|
+
signature?: string | null;
|
|
6677
6716
|
/** @description Set on a comment of a channel post (the post it belongs to); `null` for posts and other messages. */
|
|
6678
6717
|
thread_root_id?: components["schemas"]["Id"] | null;
|
|
6679
6718
|
/** @description Set on a reply inside a comment thread (the top-level comment it hangs under); `null` otherwise. */
|
|
@@ -7222,6 +7261,8 @@ export interface components {
|
|
|
7222
7261
|
category?: components["schemas"]["ChannelCategory"] | null;
|
|
7223
7262
|
/** @description Public channels only - up to 5 tags (lowercase letters and digits, at most 24 characters). */
|
|
7224
7263
|
tags?: string[];
|
|
7264
|
+
/** @description Channels only - posts carry the author's name (`Message.signature`); off shows posts as the channel. Owner and admins change it. */
|
|
7265
|
+
sign_posts?: boolean;
|
|
7225
7266
|
/** @description Channels only - 18+ content. Set by the owner (staff can set it too); apps label the channel 18+. */
|
|
7226
7267
|
sensitive?: boolean;
|
|
7227
7268
|
/** @description Channels only - whether the channel may be recommended to people who do not follow it. On by default; only the owner changes it. */
|
|
@@ -7267,6 +7308,8 @@ export interface components {
|
|
|
7267
7308
|
* letters or digits; duplicates collapse. A tag on the staff blocklist is `422`.
|
|
7268
7309
|
*/
|
|
7269
7310
|
tags?: string[];
|
|
7311
|
+
/** @description Channels only - posts carry the author's name (`Message.signature`); off shows posts as the channel. Owner and admins change it. */
|
|
7312
|
+
sign_posts?: boolean;
|
|
7270
7313
|
/** @description Channels only - 18+ content. Owner only (`403` for admins); apps label the channel 18+. */
|
|
7271
7314
|
sensitive?: boolean;
|
|
7272
7315
|
/** @description Channels only - whether the channel may be recommended to people who do not follow it. On by default; only the owner changes it. */
|
|
@@ -13472,6 +13515,41 @@ export interface operations {
|
|
|
13472
13515
|
429: components["responses"]["TooManyRequests"];
|
|
13473
13516
|
};
|
|
13474
13517
|
};
|
|
13518
|
+
listPublicChannelPosts: {
|
|
13519
|
+
parameters: {
|
|
13520
|
+
query?: {
|
|
13521
|
+
/** @description Page size */
|
|
13522
|
+
limit?: components["parameters"]["Limit"];
|
|
13523
|
+
};
|
|
13524
|
+
header?: {
|
|
13525
|
+
/** @description Version of the client app, for logs and the per-client metric. */
|
|
13526
|
+
"X-Client-Version"?: components["parameters"]["ClientVersion"];
|
|
13527
|
+
/** @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`). */
|
|
13528
|
+
"X-Client-Api-Version"?: components["parameters"]["ClientApiVersion"];
|
|
13529
|
+
};
|
|
13530
|
+
path: {
|
|
13531
|
+
public_name: components["parameters"]["PublicNameParam"];
|
|
13532
|
+
};
|
|
13533
|
+
cookie?: never;
|
|
13534
|
+
};
|
|
13535
|
+
requestBody?: never;
|
|
13536
|
+
responses: {
|
|
13537
|
+
/** @description The newest posts */
|
|
13538
|
+
200: {
|
|
13539
|
+
headers: {
|
|
13540
|
+
[name: string]: unknown;
|
|
13541
|
+
};
|
|
13542
|
+
content: {
|
|
13543
|
+
"application/json": components["schemas"]["MessagePage"];
|
|
13544
|
+
};
|
|
13545
|
+
};
|
|
13546
|
+
400: components["responses"]["BadRequest"];
|
|
13547
|
+
401: components["responses"]["Unauthorized"];
|
|
13548
|
+
404: components["responses"]["NotFound"];
|
|
13549
|
+
426: components["responses"]["ClientOutdated"];
|
|
13550
|
+
429: components["responses"]["TooManyRequests"];
|
|
13551
|
+
};
|
|
13552
|
+
};
|
|
13475
13553
|
getPublicNameAvailability: {
|
|
13476
13554
|
parameters: {
|
|
13477
13555
|
query?: never;
|
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.63. Do not edit. */
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* Any WebSocket event, in either direction.
|
|
@@ -901,7 +901,9 @@ export interface Message {
|
|
|
901
901
|
chat_id: Id;
|
|
902
902
|
type: MessageType;
|
|
903
903
|
/**
|
|
904
|
-
* `null` for system messages
|
|
904
|
+
* `null` for system messages, and for channel posts when the channel does not sign posts (shown as the
|
|
905
|
+
* channel), except for the post's own author. Comments always carry their sender.
|
|
906
|
+
*
|
|
905
907
|
*/
|
|
906
908
|
sender: User | null;
|
|
907
909
|
/**
|
|
@@ -960,6 +962,10 @@ export interface Message {
|
|
|
960
962
|
*
|
|
961
963
|
*/
|
|
962
964
|
view_count?: number | null;
|
|
965
|
+
/**
|
|
966
|
+
* Channel posts of a channel that signs posts - the author's display name; `null` otherwise.
|
|
967
|
+
*/
|
|
968
|
+
signature?: string | null;
|
|
963
969
|
/**
|
|
964
970
|
* Set on a comment of a channel post (the post it belongs to); `null` for posts and other messages.
|
|
965
971
|
*/
|
|
@@ -1447,6 +1453,10 @@ export interface Group {
|
|
|
1447
1453
|
| [string, string, string]
|
|
1448
1454
|
| [string, string, string, string]
|
|
1449
1455
|
| [string, string, string, string, string];
|
|
1456
|
+
/**
|
|
1457
|
+
* Channels only - posts carry the author's name (`Message.signature`); off shows posts as the channel. Owner and admins change it.
|
|
1458
|
+
*/
|
|
1459
|
+
sign_posts?: boolean;
|
|
1450
1460
|
/**
|
|
1451
1461
|
* Channels only - 18+ content. Set by the owner (staff can set it too); apps label the channel 18+.
|
|
1452
1462
|
*/
|
|
@@ -3665,7 +3665,7 @@
|
|
|
3665
3665
|
"$ref": "#/$defs/MessageType"
|
|
3666
3666
|
},
|
|
3667
3667
|
"sender": {
|
|
3668
|
-
"description": "`null` for system messages.",
|
|
3668
|
+
"description": "`null` for system messages, and for channel posts when the channel does not sign posts (shown as the\nchannel), except for the post's own author. Comments always carry their sender.\n",
|
|
3669
3669
|
"oneOf": [
|
|
3670
3670
|
{
|
|
3671
3671
|
"$ref": "#/$defs/User"
|
|
@@ -3758,6 +3758,13 @@
|
|
|
3758
3758
|
],
|
|
3759
3759
|
"minimum": 0
|
|
3760
3760
|
},
|
|
3761
|
+
"signature": {
|
|
3762
|
+
"description": "Channel posts of a channel that signs posts - the author's display name; `null` otherwise.",
|
|
3763
|
+
"type": [
|
|
3764
|
+
"string",
|
|
3765
|
+
"null"
|
|
3766
|
+
]
|
|
3767
|
+
},
|
|
3761
3768
|
"thread_root_id": {
|
|
3762
3769
|
"description": "Set on a comment of a channel post (the post it belongs to); `null` for posts and other messages.",
|
|
3763
3770
|
"oneOf": [
|
|
@@ -5852,6 +5859,10 @@
|
|
|
5852
5859
|
"maxLength": 24
|
|
5853
5860
|
}
|
|
5854
5861
|
},
|
|
5862
|
+
"sign_posts": {
|
|
5863
|
+
"type": "boolean",
|
|
5864
|
+
"description": "Channels only - posts carry the author's name (`Message.signature`); off shows posts as the channel. Owner and admins change it."
|
|
5865
|
+
},
|
|
5855
5866
|
"sensitive": {
|
|
5856
5867
|
"type": "boolean",
|
|
5857
5868
|
"description": "Channels only - 18+ content. Set by the owner (staff can set it too); apps label the channel 18+."
|
|
@@ -6004,6 +6015,10 @@
|
|
|
6004
6015
|
"maxLength": 64
|
|
6005
6016
|
}
|
|
6006
6017
|
},
|
|
6018
|
+
"sign_posts": {
|
|
6019
|
+
"type": "boolean",
|
|
6020
|
+
"description": "Channels only - posts carry the author's name (`Message.signature`); off shows posts as the channel. Owner and admins change it."
|
|
6021
|
+
},
|
|
6007
6022
|
"sensitive": {
|
|
6008
6023
|
"type": "boolean",
|
|
6009
6024
|
"description": "Channels only - 18+ content. Owner only (`403` for admins); apps label the channel 18+."
|
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.63.next.212",
|
|
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": {
|