@myronsi/messenger-api 2.1.0-alpha.59.next.206 → 2.1.0-alpha.60.next.209
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 +53 -2
- package/dist/schema.d.ts +31 -2
- package/dist/ws-events.d.ts +37 -1
- package/dist/ws-events.schema.json +85 -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.60
|
|
6
|
+
|
|
7
|
+
- Channel category and tags (C11): `ChannelCategory` (16 values); `Group`, `UpdateGroupRequest` and `PublicGroup` gain
|
|
8
|
+
`category` and `tags` (public channels only, up to 5 cleaned tags, a staff blocklist refuses some with `422`).
|
|
9
|
+
- `searchPublicGroups` gains `category` and `tag`, and `q` also matches the start of a tag.
|
|
10
|
+
|
|
5
11
|
## 2.1.0-alpha.59
|
|
6
12
|
|
|
7
13
|
- Built-in comments on channel posts, two levels deep. `SendMessageRequest.thread_root_id` (and the WebSocket
|
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.60. Do not edit. */
|
|
2
|
+
export declare const API_VERSION: "2.1.0-alpha.60";
|
|
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.60";
|
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.60
|
|
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
|
|
@@ -3957,7 +3957,9 @@ paths:
|
|
|
3957
3957
|
tags: [groups]
|
|
3958
3958
|
operationId: searchPublicGroups
|
|
3959
3959
|
summary: Search public groups by public name or group name
|
|
3960
|
-
description:
|
|
3960
|
+
description: |
|
|
3961
|
+
Send `q`, `mode`, `category`, `tag` or any of them together. `q` matches the public name, the name and the
|
|
3962
|
+
start of a tag. `mode=channel` without `q` lists every public channel, for "Discover".
|
|
3961
3963
|
parameters:
|
|
3962
3964
|
- name: q
|
|
3963
3965
|
in: query
|
|
@@ -3967,6 +3969,16 @@ paths:
|
|
|
3967
3969
|
in: query
|
|
3968
3970
|
required: false
|
|
3969
3971
|
schema: { $ref: "#/components/schemas/GroupMode" }
|
|
3972
|
+
- name: category
|
|
3973
|
+
in: query
|
|
3974
|
+
required: false
|
|
3975
|
+
description: Only channels in this category.
|
|
3976
|
+
schema: { $ref: "#/components/schemas/ChannelCategory" }
|
|
3977
|
+
- name: tag
|
|
3978
|
+
in: query
|
|
3979
|
+
required: false
|
|
3980
|
+
description: Only channels with this tag (cleaned like a tag that is set). Tapping a tag on a channel card uses it.
|
|
3981
|
+
schema: { type: string, minLength: 1, maxLength: 64 }
|
|
3970
3982
|
- $ref: "#/components/parameters/Limit"
|
|
3971
3983
|
- $ref: "#/components/parameters/After"
|
|
3972
3984
|
responses:
|
|
@@ -9961,6 +9973,16 @@ components:
|
|
|
9961
9973
|
type: boolean
|
|
9962
9974
|
description: Channels only - whether subscribers may comment on posts.
|
|
9963
9975
|
comment_slow_mode: { $ref: "#/components/schemas/CommentSlowMode" }
|
|
9976
|
+
category:
|
|
9977
|
+
description: Public channels only - the one category of the channel; `null` when none is set.
|
|
9978
|
+
oneOf:
|
|
9979
|
+
- $ref: "#/components/schemas/ChannelCategory"
|
|
9980
|
+
- type: "null"
|
|
9981
|
+
tags:
|
|
9982
|
+
type: array
|
|
9983
|
+
maxItems: 5
|
|
9984
|
+
description: Public channels only - up to 5 tags (lowercase letters and digits, at most 24 characters).
|
|
9985
|
+
items: { type: string, minLength: 1, maxLength: 24 }
|
|
9964
9986
|
notify_comments:
|
|
9965
9987
|
type: boolean
|
|
9966
9988
|
description: Channels only - whether the caller gets a push for every new comment on their own posts.
|
|
@@ -10013,6 +10035,25 @@ components:
|
|
|
10013
10035
|
type: boolean
|
|
10014
10036
|
description: Channels only - whether subscribers may comment on posts.
|
|
10015
10037
|
comment_slow_mode: { $ref: "#/components/schemas/CommentSlowMode" }
|
|
10038
|
+
category:
|
|
10039
|
+
description: |
|
|
10040
|
+
Public channels only. `null` removes it. A channel without a public name gets `422` for a category or
|
|
10041
|
+
tags; clearing them always works.
|
|
10042
|
+
oneOf:
|
|
10043
|
+
- $ref: "#/components/schemas/ChannelCategory"
|
|
10044
|
+
- type: "null"
|
|
10045
|
+
tags:
|
|
10046
|
+
type: array
|
|
10047
|
+
maxItems: 5
|
|
10048
|
+
description: |
|
|
10049
|
+
Public channels only; replaces all tags. Each tag is cleaned: a leading `#`, spaces and punctuation are
|
|
10050
|
+
dropped and letters are lowercased, so `#Game Dev` becomes `gamedev`. After cleaning a tag has 1 to 24
|
|
10051
|
+
letters or digits; duplicates collapse. A tag on the staff blocklist is `422`.
|
|
10052
|
+
items: { type: string, minLength: 1, maxLength: 64 }
|
|
10053
|
+
ChannelCategory:
|
|
10054
|
+
type: string
|
|
10055
|
+
description: The fixed list of channel categories. Unknown values must be treated like `other`.
|
|
10056
|
+
enum: [news, tech, science, education, business, finance, gaming, music, movies_tv, art_design, books, sports, health_fitness, food, travel, other]
|
|
10016
10057
|
CommentSlowMode:
|
|
10017
10058
|
type: integer
|
|
10018
10059
|
description: Channels only - seconds a subscriber waits between two comments; 0 is off. Owner, admins and moderators are exempt.
|
|
@@ -10085,6 +10126,16 @@ components:
|
|
|
10085
10126
|
required: [name, public_name, description, avatar_url, member_count, group_mode]
|
|
10086
10127
|
properties:
|
|
10087
10128
|
name: { type: string }
|
|
10129
|
+
category:
|
|
10130
|
+
description: Public channels only - the one category of the channel; `null` when none is set.
|
|
10131
|
+
oneOf:
|
|
10132
|
+
- $ref: "#/components/schemas/ChannelCategory"
|
|
10133
|
+
- type: "null"
|
|
10134
|
+
tags:
|
|
10135
|
+
type: array
|
|
10136
|
+
maxItems: 5
|
|
10137
|
+
description: Public channels only - up to 5 tags (lowercase letters and digits, at most 24 characters).
|
|
10138
|
+
items: { type: string, minLength: 1, maxLength: 24 }
|
|
10088
10139
|
group_mode: { $ref: "#/components/schemas/GroupMode" }
|
|
10089
10140
|
public_name:
|
|
10090
10141
|
description: Set for a public group.
|
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.60. Do not edit. */
|
|
2
2
|
export interface paths {
|
|
3
3
|
"/meta": {
|
|
4
4
|
parameters: {
|
|
@@ -3448,7 +3448,8 @@ export interface paths {
|
|
|
3448
3448
|
};
|
|
3449
3449
|
/**
|
|
3450
3450
|
* Search public groups by public name or group name
|
|
3451
|
-
* @description Send `q`, `mode` or
|
|
3451
|
+
* @description Send `q`, `mode`, `category`, `tag` or any of them together. `q` matches the public name, the name and the
|
|
3452
|
+
* start of a tag. `mode=channel` without `q` lists every public channel, for "Discover".
|
|
3452
3453
|
*/
|
|
3453
3454
|
get: operations["searchPublicGroups"];
|
|
3454
3455
|
put?: never;
|
|
@@ -7217,6 +7218,10 @@ export interface components {
|
|
|
7217
7218
|
/** @description Channels only - whether subscribers may comment on posts. */
|
|
7218
7219
|
comments_enabled?: boolean;
|
|
7219
7220
|
comment_slow_mode?: components["schemas"]["CommentSlowMode"];
|
|
7221
|
+
/** @description Public channels only - the one category of the channel; `null` when none is set. */
|
|
7222
|
+
category?: components["schemas"]["ChannelCategory"] | null;
|
|
7223
|
+
/** @description Public channels only - up to 5 tags (lowercase letters and digits, at most 24 characters). */
|
|
7224
|
+
tags?: string[];
|
|
7220
7225
|
/** @description Channels only - whether the caller gets a push for every new comment on their own posts. */
|
|
7221
7226
|
notify_comments?: boolean;
|
|
7222
7227
|
/** @description Everyone in the group, the owner included (the subscribers of a channel). */
|
|
@@ -7247,7 +7252,23 @@ export interface components {
|
|
|
7247
7252
|
/** @description Channels only - whether subscribers may comment on posts. */
|
|
7248
7253
|
comments_enabled?: boolean;
|
|
7249
7254
|
comment_slow_mode?: components["schemas"]["CommentSlowMode"];
|
|
7255
|
+
/**
|
|
7256
|
+
* @description Public channels only. `null` removes it. A channel without a public name gets `422` for a category or
|
|
7257
|
+
* tags; clearing them always works.
|
|
7258
|
+
*/
|
|
7259
|
+
category?: components["schemas"]["ChannelCategory"] | null;
|
|
7260
|
+
/**
|
|
7261
|
+
* @description Public channels only; replaces all tags. Each tag is cleaned: a leading `#`, spaces and punctuation are
|
|
7262
|
+
* dropped and letters are lowercased, so `#Game Dev` becomes `gamedev`. After cleaning a tag has 1 to 24
|
|
7263
|
+
* letters or digits; duplicates collapse. A tag on the staff blocklist is `422`.
|
|
7264
|
+
*/
|
|
7265
|
+
tags?: string[];
|
|
7250
7266
|
};
|
|
7267
|
+
/**
|
|
7268
|
+
* @description The fixed list of channel categories. Unknown values must be treated like `other`.
|
|
7269
|
+
* @enum {string}
|
|
7270
|
+
*/
|
|
7271
|
+
ChannelCategory: "news" | "tech" | "science" | "education" | "business" | "finance" | "gaming" | "music" | "movies_tv" | "art_design" | "books" | "sports" | "health_fitness" | "food" | "travel" | "other";
|
|
7251
7272
|
/**
|
|
7252
7273
|
* @description Channels only - seconds a subscriber waits between two comments; 0 is off. Owner, admins and moderators are exempt.
|
|
7253
7274
|
* @enum {integer}
|
|
@@ -7302,6 +7323,10 @@ export interface components {
|
|
|
7302
7323
|
/** @description The card of a group for someone without an account. No members and no messages. */
|
|
7303
7324
|
PublicGroup: {
|
|
7304
7325
|
name: string;
|
|
7326
|
+
/** @description Public channels only - the one category of the channel; `null` when none is set. */
|
|
7327
|
+
category?: components["schemas"]["ChannelCategory"] | null;
|
|
7328
|
+
/** @description Public channels only - up to 5 tags (lowercase letters and digits, at most 24 characters). */
|
|
7329
|
+
tags?: string[];
|
|
7305
7330
|
group_mode: components["schemas"]["GroupMode"];
|
|
7306
7331
|
/** @description Set for a public group. */
|
|
7307
7332
|
public_name: components["schemas"]["PublicName"] | null;
|
|
@@ -13336,6 +13361,10 @@ export interface operations {
|
|
|
13336
13361
|
query?: {
|
|
13337
13362
|
q?: string;
|
|
13338
13363
|
mode?: components["schemas"]["GroupMode"];
|
|
13364
|
+
/** @description Only channels in this category. */
|
|
13365
|
+
category?: components["schemas"]["ChannelCategory"];
|
|
13366
|
+
/** @description Only channels with this tag (cleaned like a tag that is set). Tapping a tag on a channel card uses it. */
|
|
13367
|
+
tag?: string;
|
|
13339
13368
|
/** @description Page size */
|
|
13340
13369
|
limit?: components["parameters"]["Limit"];
|
|
13341
13370
|
/** @description Opaque `next_cursor` of the previous page */
|
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.60. Do not edit. */
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* Any WebSocket event, in either direction.
|
|
@@ -227,6 +227,26 @@ export type ErrorCode =
|
|
|
227
227
|
* Channels only - seconds a subscriber waits between two comments; 0 is off. Owner, admins and moderators are exempt.
|
|
228
228
|
*/
|
|
229
229
|
export type CommentSlowMode = 0 | 10 | 30 | 60 | 300 | 900 | 3600;
|
|
230
|
+
/**
|
|
231
|
+
* The fixed list of channel categories. Unknown values must be treated like `other`.
|
|
232
|
+
*/
|
|
233
|
+
export type ChannelCategory =
|
|
234
|
+
| "news"
|
|
235
|
+
| "tech"
|
|
236
|
+
| "science"
|
|
237
|
+
| "education"
|
|
238
|
+
| "business"
|
|
239
|
+
| "finance"
|
|
240
|
+
| "gaming"
|
|
241
|
+
| "music"
|
|
242
|
+
| "movies_tv"
|
|
243
|
+
| "art_design"
|
|
244
|
+
| "books"
|
|
245
|
+
| "sports"
|
|
246
|
+
| "health_fitness"
|
|
247
|
+
| "food"
|
|
248
|
+
| "travel"
|
|
249
|
+
| "other";
|
|
230
250
|
/**
|
|
231
251
|
* A username or a group's public name. One name space for both, unique ignoring case; links are `/@name` on the
|
|
232
252
|
* web app's origin.
|
|
@@ -1411,6 +1431,22 @@ export interface Group {
|
|
|
1411
1431
|
*/
|
|
1412
1432
|
comments_enabled?: boolean;
|
|
1413
1433
|
comment_slow_mode?: CommentSlowMode;
|
|
1434
|
+
/**
|
|
1435
|
+
* Public channels only - the one category of the channel; `null` when none is set.
|
|
1436
|
+
*/
|
|
1437
|
+
category?: ChannelCategory | null;
|
|
1438
|
+
/**
|
|
1439
|
+
* Public channels only - up to 5 tags (lowercase letters and digits, at most 24 characters).
|
|
1440
|
+
*
|
|
1441
|
+
* @maxItems 5
|
|
1442
|
+
*/
|
|
1443
|
+
tags?:
|
|
1444
|
+
| []
|
|
1445
|
+
| [string]
|
|
1446
|
+
| [string, string]
|
|
1447
|
+
| [string, string, string]
|
|
1448
|
+
| [string, string, string, string]
|
|
1449
|
+
| [string, string, string, string, string];
|
|
1414
1450
|
/**
|
|
1415
1451
|
* Channels only - whether the caller gets a push for every new comment on their own posts.
|
|
1416
1452
|
*/
|
|
@@ -5831,6 +5831,27 @@
|
|
|
5831
5831
|
"comment_slow_mode": {
|
|
5832
5832
|
"$ref": "#/$defs/CommentSlowMode"
|
|
5833
5833
|
},
|
|
5834
|
+
"category": {
|
|
5835
|
+
"description": "Public channels only - the one category of the channel; `null` when none is set.",
|
|
5836
|
+
"oneOf": [
|
|
5837
|
+
{
|
|
5838
|
+
"$ref": "#/$defs/ChannelCategory"
|
|
5839
|
+
},
|
|
5840
|
+
{
|
|
5841
|
+
"type": "null"
|
|
5842
|
+
}
|
|
5843
|
+
]
|
|
5844
|
+
},
|
|
5845
|
+
"tags": {
|
|
5846
|
+
"type": "array",
|
|
5847
|
+
"maxItems": 5,
|
|
5848
|
+
"description": "Public channels only - up to 5 tags (lowercase letters and digits, at most 24 characters).",
|
|
5849
|
+
"items": {
|
|
5850
|
+
"type": "string",
|
|
5851
|
+
"minLength": 1,
|
|
5852
|
+
"maxLength": 24
|
|
5853
|
+
}
|
|
5854
|
+
},
|
|
5834
5855
|
"notify_comments": {
|
|
5835
5856
|
"type": "boolean",
|
|
5836
5857
|
"description": "Channels only - whether the caller gets a push for every new comment on their own posts."
|
|
@@ -5953,9 +5974,52 @@
|
|
|
5953
5974
|
},
|
|
5954
5975
|
"comment_slow_mode": {
|
|
5955
5976
|
"$ref": "#/$defs/CommentSlowMode"
|
|
5977
|
+
},
|
|
5978
|
+
"category": {
|
|
5979
|
+
"description": "Public channels only. `null` removes it. A channel without a public name gets `422` for a category or\ntags; clearing them always works.\n",
|
|
5980
|
+
"oneOf": [
|
|
5981
|
+
{
|
|
5982
|
+
"$ref": "#/$defs/ChannelCategory"
|
|
5983
|
+
},
|
|
5984
|
+
{
|
|
5985
|
+
"type": "null"
|
|
5986
|
+
}
|
|
5987
|
+
]
|
|
5988
|
+
},
|
|
5989
|
+
"tags": {
|
|
5990
|
+
"type": "array",
|
|
5991
|
+
"maxItems": 5,
|
|
5992
|
+
"description": "Public channels only; replaces all tags. Each tag is cleaned: a leading `#`, spaces and punctuation are\ndropped and letters are lowercased, so `#Game Dev` becomes `gamedev`. After cleaning a tag has 1 to 24\nletters or digits; duplicates collapse. A tag on the staff blocklist is `422`.\n",
|
|
5993
|
+
"items": {
|
|
5994
|
+
"type": "string",
|
|
5995
|
+
"minLength": 1,
|
|
5996
|
+
"maxLength": 64
|
|
5997
|
+
}
|
|
5956
5998
|
}
|
|
5957
5999
|
}
|
|
5958
6000
|
},
|
|
6001
|
+
"ChannelCategory": {
|
|
6002
|
+
"type": "string",
|
|
6003
|
+
"description": "The fixed list of channel categories. Unknown values must be treated like `other`.",
|
|
6004
|
+
"enum": [
|
|
6005
|
+
"news",
|
|
6006
|
+
"tech",
|
|
6007
|
+
"science",
|
|
6008
|
+
"education",
|
|
6009
|
+
"business",
|
|
6010
|
+
"finance",
|
|
6011
|
+
"gaming",
|
|
6012
|
+
"music",
|
|
6013
|
+
"movies_tv",
|
|
6014
|
+
"art_design",
|
|
6015
|
+
"books",
|
|
6016
|
+
"sports",
|
|
6017
|
+
"health_fitness",
|
|
6018
|
+
"food",
|
|
6019
|
+
"travel",
|
|
6020
|
+
"other"
|
|
6021
|
+
]
|
|
6022
|
+
},
|
|
5959
6023
|
"CommentSlowMode": {
|
|
5960
6024
|
"type": "integer",
|
|
5961
6025
|
"description": "Channels only - seconds a subscriber waits between two comments; 0 is off. Owner, admins and moderators are exempt.",
|
|
@@ -6099,6 +6163,27 @@
|
|
|
6099
6163
|
"name": {
|
|
6100
6164
|
"type": "string"
|
|
6101
6165
|
},
|
|
6166
|
+
"category": {
|
|
6167
|
+
"description": "Public channels only - the one category of the channel; `null` when none is set.",
|
|
6168
|
+
"oneOf": [
|
|
6169
|
+
{
|
|
6170
|
+
"$ref": "#/$defs/ChannelCategory"
|
|
6171
|
+
},
|
|
6172
|
+
{
|
|
6173
|
+
"type": "null"
|
|
6174
|
+
}
|
|
6175
|
+
]
|
|
6176
|
+
},
|
|
6177
|
+
"tags": {
|
|
6178
|
+
"type": "array",
|
|
6179
|
+
"maxItems": 5,
|
|
6180
|
+
"description": "Public channels only - up to 5 tags (lowercase letters and digits, at most 24 characters).",
|
|
6181
|
+
"items": {
|
|
6182
|
+
"type": "string",
|
|
6183
|
+
"minLength": 1,
|
|
6184
|
+
"maxLength": 24
|
|
6185
|
+
}
|
|
6186
|
+
},
|
|
6102
6187
|
"group_mode": {
|
|
6103
6188
|
"$ref": "#/$defs/GroupMode"
|
|
6104
6189
|
},
|
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.60.next.209",
|
|
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": {
|