@myronsi/messenger-api 2.1.0-alpha.62.next.211 → 2.1.0-alpha.64.next.213
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 +13 -0
- package/dist/index.d.ts +2 -2
- package/dist/index.js +1 -1
- package/dist/openapi.yaml +48 -5
- package/dist/schema.d.ts +84 -5
- package/dist/ws-events.d.ts +16 -2
- package/dist/ws-events.schema.json +14 -2
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,19 @@
|
|
|
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.64
|
|
6
|
+
|
|
7
|
+
- Staff actions on channels: `Group` gains `sensitive_by_staff`, `suspended` and `public_name_locked`. A suspended
|
|
8
|
+
channel refuses posts, edits and comments with `403` and is not found by name, link, search or preview; a channel
|
|
9
|
+
whose public name moderation removed gets `403` when it sets a new one. `PublicGroup.sensitive` also covers the
|
|
10
|
+
staff mark.
|
|
11
|
+
|
|
12
|
+
## 2.1.0-alpha.63
|
|
13
|
+
|
|
14
|
+
- Read a public channel before subscribing (C6): `GET /public-groups/{public_name}/posts` returns its newest 50 posts
|
|
15
|
+
to any signed-in user who is not banned from it. Readers can open the files of these posts and report them with
|
|
16
|
+
the existing `POST /chats/{chat_id}/messages/{message_id}/report`.
|
|
17
|
+
|
|
5
18
|
## 2.1.0-alpha.62
|
|
6
19
|
|
|
7
20
|
- Signed channel posts (C4): `Group` and `UpdateGroupRequest` gain `sign_posts` (owner and admins). `Message` gains
|
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.64. Do not edit. */
|
|
2
|
+
export declare const API_VERSION: "2.1.0-alpha.64";
|
|
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.64";
|
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.64
|
|
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:
|
|
@@ -3736,7 +3737,8 @@ paths:
|
|
|
3736
3737
|
Owner and admins only. A public group can be found in `GET /public-groups` and joined by anyone through
|
|
3737
3738
|
`/@name`, unless banned. The name shares one name space with usernames, ignoring case: a name in use is
|
|
3738
3739
|
`409` `already_exists`, a reserved name `422`. The old name is free at once. Accounts at `limited` or above
|
|
3739
|
-
get `403` `account_restricted` (`share_group`).
|
|
3740
|
+
get `403` `account_restricted` (`share_group`). A channel whose public name moderation removed
|
|
3741
|
+
(`public_name_locked`) gets `403`.
|
|
3740
3742
|
requestBody:
|
|
3741
3743
|
required: true
|
|
3742
3744
|
content:
|
|
@@ -4035,6 +4037,36 @@ paths:
|
|
|
4035
4037
|
"404": { $ref: "#/components/responses/NotFound" }
|
|
4036
4038
|
"409": { $ref: "#/components/responses/Conflict" }
|
|
4037
4039
|
"429": { $ref: "#/components/responses/TooManyRequests" }
|
|
4040
|
+
/public-groups/{public_name}/posts:
|
|
4041
|
+
parameters:
|
|
4042
|
+
- $ref: "#/components/parameters/ClientVersion"
|
|
4043
|
+
- $ref: "#/components/parameters/ClientApiVersion"
|
|
4044
|
+
- $ref: "#/components/parameters/PublicNameParam"
|
|
4045
|
+
get:
|
|
4046
|
+
tags: [groups]
|
|
4047
|
+
operationId: listPublicChannelPosts
|
|
4048
|
+
summary: Read a public channel before subscribing
|
|
4049
|
+
description: |
|
|
4050
|
+
The newest posts of a channel with a public name (at most 50, oldest to newest, no comments), for any
|
|
4051
|
+
signed-in user who is not banned from it. Both cursors are always `null`: older posts need a subscription.
|
|
4052
|
+
Members get the same page. Reading here counts no views and marks nothing read. The files of these posts
|
|
4053
|
+
open with `GET /attachments/{attachment_id}/content`, and a reader can report a post with
|
|
4054
|
+
`POST /chats/{chat_id}/messages/{message_id}/report` (`chat_id` from the post). A group that is not a
|
|
4055
|
+
channel, a channel without a public name, or a ban is `404`. Rate limited per user, together with
|
|
4056
|
+
`GET /public-groups/{public_name}`.
|
|
4057
|
+
parameters:
|
|
4058
|
+
- $ref: "#/components/parameters/Limit"
|
|
4059
|
+
responses:
|
|
4060
|
+
"426": { $ref: "#/components/responses/ClientOutdated" }
|
|
4061
|
+
"400": { $ref: "#/components/responses/BadRequest" }
|
|
4062
|
+
"200":
|
|
4063
|
+
description: The newest posts
|
|
4064
|
+
content:
|
|
4065
|
+
application/json:
|
|
4066
|
+
schema: { $ref: "#/components/schemas/MessagePage" }
|
|
4067
|
+
"401": { $ref: "#/components/responses/Unauthorized" }
|
|
4068
|
+
"404": { $ref: "#/components/responses/NotFound" }
|
|
4069
|
+
"429": { $ref: "#/components/responses/TooManyRequests" }
|
|
4038
4070
|
/public-names/{public_name}/availability:
|
|
4039
4071
|
parameters:
|
|
4040
4072
|
- $ref: "#/components/parameters/ClientVersion"
|
|
@@ -9993,10 +10025,21 @@ components:
|
|
|
9993
10025
|
description: Channels only - posts carry the author's name (`Message.signature`); off shows posts as the channel. Owner and admins change it.
|
|
9994
10026
|
sensitive:
|
|
9995
10027
|
type: boolean
|
|
9996
|
-
description: Channels only - 18+
|
|
10028
|
+
description: Channels only - the owner's 18+ setting. Apps label the channel 18+ when this or `sensitive_by_staff` is true.
|
|
9997
10029
|
recommendable:
|
|
9998
10030
|
type: boolean
|
|
9999
10031
|
description: Channels only - whether the channel may be recommended to people who do not follow it. On by default; only the owner changes it.
|
|
10032
|
+
sensitive_by_staff:
|
|
10033
|
+
type: boolean
|
|
10034
|
+
description: Channels only - moderation marked the channel 18+. The owner cannot turn it off.
|
|
10035
|
+
suspended:
|
|
10036
|
+
type: boolean
|
|
10037
|
+
description: |
|
|
10038
|
+
Channels only - moderation suspended the channel. Members still read it, but nobody posts, edits or
|
|
10039
|
+
comments (`403`), nobody joins, and it is not found by public name, invite link, search or preview.
|
|
10040
|
+
public_name_locked:
|
|
10041
|
+
type: boolean
|
|
10042
|
+
description: Channels only - moderation removed the public name; setting a new one is `403` until moderation allows it again.
|
|
10000
10043
|
notify_comments:
|
|
10001
10044
|
type: boolean
|
|
10002
10045
|
description: Channels only - whether the caller gets a push for every new comment on their own posts.
|
|
@@ -10162,7 +10205,7 @@ components:
|
|
|
10162
10205
|
group_mode: { $ref: "#/components/schemas/GroupMode" }
|
|
10163
10206
|
sensitive:
|
|
10164
10207
|
type: boolean
|
|
10165
|
-
description: Channels only - 18+ content; apps show an 18+ label.
|
|
10208
|
+
description: Channels only - 18+ content, set by the owner or by moderation; apps show an 18+ label.
|
|
10166
10209
|
public_name:
|
|
10167
10210
|
description: Set for a public group.
|
|
10168
10211
|
oneOf:
|
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.64. 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
|
*/
|
|
@@ -3218,7 +3219,8 @@ export interface paths {
|
|
|
3218
3219
|
* @description Owner and admins only. A public group can be found in `GET /public-groups` and joined by anyone through
|
|
3219
3220
|
* `/@name`, unless banned. The name shares one name space with usernames, ignoring case: a name in use is
|
|
3220
3221
|
* `409` `already_exists`, a reserved name `422`. The old name is free at once. Accounts at `limited` or above
|
|
3221
|
-
* get `403` `account_restricted` (`share_group`).
|
|
3222
|
+
* get `403` `account_restricted` (`share_group`). A channel whose public name moderation removed
|
|
3223
|
+
* (`public_name_locked`) gets `403`.
|
|
3222
3224
|
*/
|
|
3223
3225
|
put: operations["setGroupPublicName"];
|
|
3224
3226
|
post?: never;
|
|
@@ -3514,6 +3516,39 @@ export interface paths {
|
|
|
3514
3516
|
patch?: never;
|
|
3515
3517
|
trace?: never;
|
|
3516
3518
|
};
|
|
3519
|
+
"/public-groups/{public_name}/posts": {
|
|
3520
|
+
parameters: {
|
|
3521
|
+
query?: never;
|
|
3522
|
+
header?: {
|
|
3523
|
+
/** @description Version of the client app, for logs and the per-client metric. */
|
|
3524
|
+
"X-Client-Version"?: components["parameters"]["ClientVersion"];
|
|
3525
|
+
/** @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`). */
|
|
3526
|
+
"X-Client-Api-Version"?: components["parameters"]["ClientApiVersion"];
|
|
3527
|
+
};
|
|
3528
|
+
path: {
|
|
3529
|
+
public_name: components["parameters"]["PublicNameParam"];
|
|
3530
|
+
};
|
|
3531
|
+
cookie?: never;
|
|
3532
|
+
};
|
|
3533
|
+
/**
|
|
3534
|
+
* Read a public channel before subscribing
|
|
3535
|
+
* @description The newest posts of a channel with a public name (at most 50, oldest to newest, no comments), for any
|
|
3536
|
+
* signed-in user who is not banned from it. Both cursors are always `null`: older posts need a subscription.
|
|
3537
|
+
* Members get the same page. Reading here counts no views and marks nothing read. The files of these posts
|
|
3538
|
+
* open with `GET /attachments/{attachment_id}/content`, and a reader can report a post with
|
|
3539
|
+
* `POST /chats/{chat_id}/messages/{message_id}/report` (`chat_id` from the post). A group that is not a
|
|
3540
|
+
* channel, a channel without a public name, or a ban is `404`. Rate limited per user, together with
|
|
3541
|
+
* `GET /public-groups/{public_name}`.
|
|
3542
|
+
*/
|
|
3543
|
+
get: operations["listPublicChannelPosts"];
|
|
3544
|
+
put?: never;
|
|
3545
|
+
post?: never;
|
|
3546
|
+
delete?: never;
|
|
3547
|
+
options?: never;
|
|
3548
|
+
head?: never;
|
|
3549
|
+
patch?: never;
|
|
3550
|
+
trace?: never;
|
|
3551
|
+
};
|
|
3517
3552
|
"/public-names/{public_name}/availability": {
|
|
3518
3553
|
parameters: {
|
|
3519
3554
|
query?: never;
|
|
@@ -7229,10 +7264,19 @@ export interface components {
|
|
|
7229
7264
|
tags?: string[];
|
|
7230
7265
|
/** @description Channels only - posts carry the author's name (`Message.signature`); off shows posts as the channel. Owner and admins change it. */
|
|
7231
7266
|
sign_posts?: boolean;
|
|
7232
|
-
/** @description Channels only - 18+
|
|
7267
|
+
/** @description Channels only - the owner's 18+ setting. Apps label the channel 18+ when this or `sensitive_by_staff` is true. */
|
|
7233
7268
|
sensitive?: boolean;
|
|
7234
7269
|
/** @description Channels only - whether the channel may be recommended to people who do not follow it. On by default; only the owner changes it. */
|
|
7235
7270
|
recommendable?: boolean;
|
|
7271
|
+
/** @description Channels only - moderation marked the channel 18+. The owner cannot turn it off. */
|
|
7272
|
+
sensitive_by_staff?: boolean;
|
|
7273
|
+
/**
|
|
7274
|
+
* @description Channels only - moderation suspended the channel. Members still read it, but nobody posts, edits or
|
|
7275
|
+
* comments (`403`), nobody joins, and it is not found by public name, invite link, search or preview.
|
|
7276
|
+
*/
|
|
7277
|
+
suspended?: boolean;
|
|
7278
|
+
/** @description Channels only - moderation removed the public name; setting a new one is `403` until moderation allows it again. */
|
|
7279
|
+
public_name_locked?: boolean;
|
|
7236
7280
|
/** @description Channels only - whether the caller gets a push for every new comment on their own posts. */
|
|
7237
7281
|
notify_comments?: boolean;
|
|
7238
7282
|
/** @description Everyone in the group, the owner included (the subscribers of a channel). */
|
|
@@ -7345,7 +7389,7 @@ export interface components {
|
|
|
7345
7389
|
/** @description Public channels only - up to 5 tags (lowercase letters and digits, at most 24 characters). */
|
|
7346
7390
|
tags?: string[];
|
|
7347
7391
|
group_mode: components["schemas"]["GroupMode"];
|
|
7348
|
-
/** @description Channels only - 18+ content; apps show an 18+ label. */
|
|
7392
|
+
/** @description Channels only - 18+ content, set by the owner or by moderation; apps show an 18+ label. */
|
|
7349
7393
|
sensitive?: boolean;
|
|
7350
7394
|
/** @description Set for a public group. */
|
|
7351
7395
|
public_name: components["schemas"]["PublicName"] | null;
|
|
@@ -13481,6 +13525,41 @@ export interface operations {
|
|
|
13481
13525
|
429: components["responses"]["TooManyRequests"];
|
|
13482
13526
|
};
|
|
13483
13527
|
};
|
|
13528
|
+
listPublicChannelPosts: {
|
|
13529
|
+
parameters: {
|
|
13530
|
+
query?: {
|
|
13531
|
+
/** @description Page size */
|
|
13532
|
+
limit?: components["parameters"]["Limit"];
|
|
13533
|
+
};
|
|
13534
|
+
header?: {
|
|
13535
|
+
/** @description Version of the client app, for logs and the per-client metric. */
|
|
13536
|
+
"X-Client-Version"?: components["parameters"]["ClientVersion"];
|
|
13537
|
+
/** @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`). */
|
|
13538
|
+
"X-Client-Api-Version"?: components["parameters"]["ClientApiVersion"];
|
|
13539
|
+
};
|
|
13540
|
+
path: {
|
|
13541
|
+
public_name: components["parameters"]["PublicNameParam"];
|
|
13542
|
+
};
|
|
13543
|
+
cookie?: never;
|
|
13544
|
+
};
|
|
13545
|
+
requestBody?: never;
|
|
13546
|
+
responses: {
|
|
13547
|
+
/** @description The newest posts */
|
|
13548
|
+
200: {
|
|
13549
|
+
headers: {
|
|
13550
|
+
[name: string]: unknown;
|
|
13551
|
+
};
|
|
13552
|
+
content: {
|
|
13553
|
+
"application/json": components["schemas"]["MessagePage"];
|
|
13554
|
+
};
|
|
13555
|
+
};
|
|
13556
|
+
400: components["responses"]["BadRequest"];
|
|
13557
|
+
401: components["responses"]["Unauthorized"];
|
|
13558
|
+
404: components["responses"]["NotFound"];
|
|
13559
|
+
426: components["responses"]["ClientOutdated"];
|
|
13560
|
+
429: components["responses"]["TooManyRequests"];
|
|
13561
|
+
};
|
|
13562
|
+
};
|
|
13484
13563
|
getPublicNameAvailability: {
|
|
13485
13564
|
parameters: {
|
|
13486
13565
|
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.64. Do not edit. */
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* Any WebSocket event, in either direction.
|
|
@@ -1458,13 +1458,27 @@ export interface Group {
|
|
|
1458
1458
|
*/
|
|
1459
1459
|
sign_posts?: boolean;
|
|
1460
1460
|
/**
|
|
1461
|
-
* Channels only - 18+
|
|
1461
|
+
* Channels only - the owner's 18+ setting. Apps label the channel 18+ when this or `sensitive_by_staff` is true.
|
|
1462
1462
|
*/
|
|
1463
1463
|
sensitive?: boolean;
|
|
1464
1464
|
/**
|
|
1465
1465
|
* Channels only - whether the channel may be recommended to people who do not follow it. On by default; only the owner changes it.
|
|
1466
1466
|
*/
|
|
1467
1467
|
recommendable?: boolean;
|
|
1468
|
+
/**
|
|
1469
|
+
* Channels only - moderation marked the channel 18+. The owner cannot turn it off.
|
|
1470
|
+
*/
|
|
1471
|
+
sensitive_by_staff?: boolean;
|
|
1472
|
+
/**
|
|
1473
|
+
* Channels only - moderation suspended the channel. Members still read it, but nobody posts, edits or
|
|
1474
|
+
* comments (`403`), nobody joins, and it is not found by public name, invite link, search or preview.
|
|
1475
|
+
*
|
|
1476
|
+
*/
|
|
1477
|
+
suspended?: boolean;
|
|
1478
|
+
/**
|
|
1479
|
+
* Channels only - moderation removed the public name; setting a new one is `403` until moderation allows it again.
|
|
1480
|
+
*/
|
|
1481
|
+
public_name_locked?: boolean;
|
|
1468
1482
|
/**
|
|
1469
1483
|
* Channels only - whether the caller gets a push for every new comment on their own posts.
|
|
1470
1484
|
*/
|
|
@@ -5865,12 +5865,24 @@
|
|
|
5865
5865
|
},
|
|
5866
5866
|
"sensitive": {
|
|
5867
5867
|
"type": "boolean",
|
|
5868
|
-
"description": "Channels only - 18+
|
|
5868
|
+
"description": "Channels only - the owner's 18+ setting. Apps label the channel 18+ when this or `sensitive_by_staff` is true."
|
|
5869
5869
|
},
|
|
5870
5870
|
"recommendable": {
|
|
5871
5871
|
"type": "boolean",
|
|
5872
5872
|
"description": "Channels only - whether the channel may be recommended to people who do not follow it. On by default; only the owner changes it."
|
|
5873
5873
|
},
|
|
5874
|
+
"sensitive_by_staff": {
|
|
5875
|
+
"type": "boolean",
|
|
5876
|
+
"description": "Channels only - moderation marked the channel 18+. The owner cannot turn it off."
|
|
5877
|
+
},
|
|
5878
|
+
"suspended": {
|
|
5879
|
+
"type": "boolean",
|
|
5880
|
+
"description": "Channels only - moderation suspended the channel. Members still read it, but nobody posts, edits or\ncomments (`403`), nobody joins, and it is not found by public name, invite link, search or preview.\n"
|
|
5881
|
+
},
|
|
5882
|
+
"public_name_locked": {
|
|
5883
|
+
"type": "boolean",
|
|
5884
|
+
"description": "Channels only - moderation removed the public name; setting a new one is `403` until moderation allows it again."
|
|
5885
|
+
},
|
|
5874
5886
|
"notify_comments": {
|
|
5875
5887
|
"type": "boolean",
|
|
5876
5888
|
"description": "Channels only - whether the caller gets a push for every new comment on their own posts."
|
|
@@ -6220,7 +6232,7 @@
|
|
|
6220
6232
|
},
|
|
6221
6233
|
"sensitive": {
|
|
6222
6234
|
"type": "boolean",
|
|
6223
|
-
"description": "Channels only - 18+ content; apps show an 18+ label."
|
|
6235
|
+
"description": "Channels only - 18+ content, set by the owner or by moderation; apps show an 18+ label."
|
|
6224
6236
|
},
|
|
6225
6237
|
"public_name": {
|
|
6226
6238
|
"description": "Set for a public group.",
|
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.64.next.213",
|
|
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": {
|