@myronsi/messenger-api 2.1.0-alpha.62.next.211 → 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 +6 -0
- package/dist/index.d.ts +2 -2
- package/dist/index.js +1 -1
- package/dist/openapi.yaml +33 -2
- package/dist/schema.d.ts +71 -2
- package/dist/ws-events.d.ts +1 -1
- 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.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
|
+
|
|
5
11
|
## 2.1.0-alpha.62
|
|
6
12
|
|
|
7
13
|
- 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.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"
|
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;
|
|
@@ -13481,6 +13515,41 @@ export interface operations {
|
|
|
13481
13515
|
429: components["responses"]["TooManyRequests"];
|
|
13482
13516
|
};
|
|
13483
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
|
+
};
|
|
13484
13553
|
getPublicNameAvailability: {
|
|
13485
13554
|
parameters: {
|
|
13486
13555
|
query?: never;
|
package/dist/ws-events.d.ts
CHANGED
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": {
|