@myronsi/messenger-api 2.1.0-alpha.56 → 2.1.0-alpha.57
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 +9 -0
- package/dist/index.d.ts +2 -2
- package/dist/index.js +1 -1
- package/dist/openapi.yaml +37 -8
- package/dist/schema.d.ts +31 -7
- package/dist/ws-docs.json +6 -2
- package/dist/ws-events.d.ts +21 -1
- package/dist/ws-events.schema.json +40 -2
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,15 @@
|
|
|
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.57
|
|
6
|
+
|
|
7
|
+
- Channels: `GroupMode` (`group`, `channel`). `CreateGroupRequest` gains `mode`; `Chat` gains `group_mode` (`null` for
|
|
8
|
+
direct chats); `Group` gains `group_mode` and `member_count`; `PublicGroup` gains `group_mode`. In a channel only the
|
|
9
|
+
owner and admins post, forward, pin for everyone and start calls; subscribers get `403` for these, `members` of
|
|
10
|
+
`Group` is always empty, and `listGroupMembers`, `getGroupRoleLog` and `listPollVoters` answer `403` to subscribers.
|
|
11
|
+
- A group has at most 10,000 members: adding, accepting an invitation, joining by link or by public name answers `409`
|
|
12
|
+
`limit_reached` when it is full.
|
|
13
|
+
|
|
5
14
|
## 2.1.0-alpha.56
|
|
6
15
|
|
|
7
16
|
- Description only: the `import_upload` rate of `POST /attachments?import_id=…` is 1,200 per minute (burst 100), and
|
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.57. Do not edit. */
|
|
2
|
+
export declare const API_VERSION: "2.1.0-alpha.57";
|
|
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.57";
|
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.57
|
|
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
|
|
@@ -3365,6 +3365,7 @@ paths:
|
|
|
3365
3365
|
description: |
|
|
3366
3366
|
Owner first, then admins, moderators and members, each by display name. `q` keeps members whose username starts
|
|
3367
3367
|
with it or whose display name contains it (case-insensitive). `total` counts every member that matches.
|
|
3368
|
+
In a channel only the owner and admins may list the subscribers (`403` for everyone else).
|
|
3368
3369
|
parameters:
|
|
3369
3370
|
- name: q
|
|
3370
3371
|
in: query
|
|
@@ -3381,11 +3382,13 @@ paths:
|
|
|
3381
3382
|
application/json:
|
|
3382
3383
|
schema: { $ref: "#/components/schemas/GroupMemberPage" }
|
|
3383
3384
|
"401": { $ref: "#/components/responses/Unauthorized" }
|
|
3385
|
+
"403": { $ref: "#/components/responses/Forbidden" }
|
|
3384
3386
|
"404": { $ref: "#/components/responses/NotFound" }
|
|
3385
3387
|
post:
|
|
3386
3388
|
tags: [groups]
|
|
3387
3389
|
operationId: addGroupParticipant
|
|
3388
3390
|
summary: Add a participant
|
|
3391
|
+
description: "`409` `limit_reached` when the group already has 10,000 members; `409` `conflict` when the user is a member already."
|
|
3389
3392
|
requestBody:
|
|
3390
3393
|
required: true
|
|
3391
3394
|
content:
|
|
@@ -3541,7 +3544,7 @@ paths:
|
|
|
3541
3544
|
tags: [groups]
|
|
3542
3545
|
operationId: getGroupRoleLog
|
|
3543
3546
|
summary: Role changes of the group's members
|
|
3544
|
-
description: Who made whom an admin or a member, or transferred ownership, and when. Members only.
|
|
3547
|
+
description: Who made whom an admin or a member, or transferred ownership, and when. Members only; in a channel only the owner and admins (`403`).
|
|
3545
3548
|
responses:
|
|
3546
3549
|
"426": { $ref: "#/components/responses/ClientOutdated" }
|
|
3547
3550
|
"400": { $ref: "#/components/responses/BadRequest" }
|
|
@@ -3551,6 +3554,7 @@ paths:
|
|
|
3551
3554
|
application/json:
|
|
3552
3555
|
schema: { $ref: "#/components/schemas/GroupRoleLog" }
|
|
3553
3556
|
"401": { $ref: "#/components/responses/Unauthorized" }
|
|
3557
|
+
"403": { $ref: "#/components/responses/Forbidden" }
|
|
3554
3558
|
"404": { $ref: "#/components/responses/NotFound" }
|
|
3555
3559
|
/groups/{chat_id}/invite-links:
|
|
3556
3560
|
parameters:
|
|
@@ -3770,10 +3774,10 @@ paths:
|
|
|
3770
3774
|
operationId: joinByInvite
|
|
3771
3775
|
summary: Join a group through an invite link
|
|
3772
3776
|
description: |
|
|
3773
|
-
Joins directly and posts a `member_joined` system message. A member gets the chat back
|
|
3774
|
-
`404` for an unknown, revoked, expired or used-up link; `403` `forbidden` when banned from
|
|
3775
|
-
`account_restricted` (`join_by_link`) at `restricted` or above
|
|
3776
|
-
hour (`429`).
|
|
3777
|
+
Joins directly and posts a `member_joined` system message (not in a channel). A member gets the chat back
|
|
3778
|
+
without a change. `404` for an unknown, revoked, expired or used-up link; `403` `forbidden` when banned from
|
|
3779
|
+
the group; `403` `account_restricted` (`join_by_link`) at `restricted` or above; `409` `limit_reached` when
|
|
3780
|
+
the group already has 10,000 members. At most 20 joins by link or public name per hour (`429`).
|
|
3777
3781
|
responses:
|
|
3778
3782
|
"426": { $ref: "#/components/responses/ClientOutdated" }
|
|
3779
3783
|
"400": { $ref: "#/components/responses/BadRequest" }
|
|
@@ -3785,6 +3789,7 @@ paths:
|
|
|
3785
3789
|
"401": { $ref: "#/components/responses/Unauthorized" }
|
|
3786
3790
|
"403": { $ref: "#/components/responses/Forbidden" }
|
|
3787
3791
|
"404": { $ref: "#/components/responses/NotFound" }
|
|
3792
|
+
"409": { $ref: "#/components/responses/Conflict" }
|
|
3788
3793
|
"429": { $ref: "#/components/responses/TooManyRequests" }
|
|
3789
3794
|
/public-groups:
|
|
3790
3795
|
parameters:
|
|
@@ -3853,6 +3858,7 @@ paths:
|
|
|
3853
3858
|
"401": { $ref: "#/components/responses/Unauthorized" }
|
|
3854
3859
|
"403": { $ref: "#/components/responses/Forbidden" }
|
|
3855
3860
|
"404": { $ref: "#/components/responses/NotFound" }
|
|
3861
|
+
"409": { $ref: "#/components/responses/Conflict" }
|
|
3856
3862
|
"429": { $ref: "#/components/responses/TooManyRequests" }
|
|
3857
3863
|
/public-names/{public_name}/availability:
|
|
3858
3864
|
parameters:
|
|
@@ -9327,6 +9333,13 @@ components:
|
|
|
9327
9333
|
ChatType:
|
|
9328
9334
|
type: string
|
|
9329
9335
|
enum: [direct, group]
|
|
9336
|
+
GroupMode:
|
|
9337
|
+
type: string
|
|
9338
|
+
description: |
|
|
9339
|
+
`channel`: only the owner and admins post; members (subscribers) read, react and vote. Subscribers do not see
|
|
9340
|
+
each other: no member list, no read receipts, no typing, no calls, and joining or leaving writes no system
|
|
9341
|
+
line. A channel is not end-to-end encrypted. Unknown values must be treated like `group`.
|
|
9342
|
+
enum: [group, channel]
|
|
9330
9343
|
GroupRole:
|
|
9331
9344
|
type: string
|
|
9332
9345
|
description: A moderator may delete other members' messages; owners and admins also manage the group.
|
|
@@ -9425,6 +9438,11 @@ components:
|
|
|
9425
9438
|
oneOf:
|
|
9426
9439
|
- $ref: "#/components/schemas/GroupRole"
|
|
9427
9440
|
- type: "null"
|
|
9441
|
+
group_mode:
|
|
9442
|
+
description: Only for groups; `null` for direct chats.
|
|
9443
|
+
oneOf:
|
|
9444
|
+
- $ref: "#/components/schemas/GroupMode"
|
|
9445
|
+
- type: "null"
|
|
9428
9446
|
pinned_message_count:
|
|
9429
9447
|
type: integer
|
|
9430
9448
|
minimum: 0
|
|
@@ -9720,9 +9738,14 @@ components:
|
|
|
9720
9738
|
joined_at: { $ref: "#/components/schemas/Timestamp" }
|
|
9721
9739
|
Group:
|
|
9722
9740
|
type: object
|
|
9723
|
-
required: [id, name, description, avatar_url, background, owner_id, my_role, members, created_at, public_name]
|
|
9741
|
+
required: [id, name, description, avatar_url, background, owner_id, my_role, members, created_at, public_name, group_mode, member_count]
|
|
9724
9742
|
properties:
|
|
9725
9743
|
id: { $ref: "#/components/schemas/Id" }
|
|
9744
|
+
group_mode: { $ref: "#/components/schemas/GroupMode" }
|
|
9745
|
+
member_count:
|
|
9746
|
+
type: integer
|
|
9747
|
+
minimum: 0
|
|
9748
|
+
description: Everyone in the group, the owner included (the subscribers of a channel).
|
|
9726
9749
|
name: { type: string, minLength: 1, maxLength: 64 }
|
|
9727
9750
|
description: { type: [string, "null"], maxLength: 500 }
|
|
9728
9751
|
avatar_url: { type: [string, "null"] }
|
|
@@ -9735,6 +9758,8 @@ components:
|
|
|
9735
9758
|
my_role: { $ref: "#/components/schemas/GroupRole" }
|
|
9736
9759
|
members:
|
|
9737
9760
|
type: array
|
|
9761
|
+
description: |
|
|
9762
|
+
Always empty for a channel; its owner and admins page through the subscribers with `listGroupMembers`.
|
|
9738
9763
|
items: { $ref: "#/components/schemas/GroupMember" }
|
|
9739
9764
|
created_at: { $ref: "#/components/schemas/Timestamp" }
|
|
9740
9765
|
public_name:
|
|
@@ -9748,6 +9773,9 @@ components:
|
|
|
9748
9773
|
properties:
|
|
9749
9774
|
name: { type: string, minLength: 1, maxLength: 64 }
|
|
9750
9775
|
description: { type: [string, "null"], maxLength: 500 }
|
|
9776
|
+
mode:
|
|
9777
|
+
description: "`channel` creates a channel. Defaults to `group`; it cannot be changed later."
|
|
9778
|
+
$ref: "#/components/schemas/GroupMode"
|
|
9751
9779
|
member_ids:
|
|
9752
9780
|
type: array
|
|
9753
9781
|
maxItems: 200
|
|
@@ -9811,9 +9839,10 @@ components:
|
|
|
9811
9839
|
PublicGroup:
|
|
9812
9840
|
type: object
|
|
9813
9841
|
description: The card of a group for someone without an account. No members and no messages.
|
|
9814
|
-
required: [name, public_name, description, avatar_url, member_count]
|
|
9842
|
+
required: [name, public_name, description, avatar_url, member_count, group_mode]
|
|
9815
9843
|
properties:
|
|
9816
9844
|
name: { type: string }
|
|
9845
|
+
group_mode: { $ref: "#/components/schemas/GroupMode" }
|
|
9817
9846
|
public_name:
|
|
9818
9847
|
description: Set for a public group.
|
|
9819
9848
|
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.57. Do not edit. */
|
|
2
2
|
export interface paths {
|
|
3
3
|
"/meta": {
|
|
4
4
|
parameters: {
|
|
@@ -2910,10 +2910,14 @@ export interface paths {
|
|
|
2910
2910
|
* Members of a group, page by page
|
|
2911
2911
|
* @description Owner first, then admins, moderators and members, each by display name. `q` keeps members whose username starts
|
|
2912
2912
|
* with it or whose display name contains it (case-insensitive). `total` counts every member that matches.
|
|
2913
|
+
* In a channel only the owner and admins may list the subscribers (`403` for everyone else).
|
|
2913
2914
|
*/
|
|
2914
2915
|
get: operations["listGroupMembers"];
|
|
2915
2916
|
put?: never;
|
|
2916
|
-
/**
|
|
2917
|
+
/**
|
|
2918
|
+
* Add a participant
|
|
2919
|
+
* @description `409` `limit_reached` when the group already has 10,000 members; `409` `conflict` when the user is a member already.
|
|
2920
|
+
*/
|
|
2917
2921
|
post: operations["addGroupParticipant"];
|
|
2918
2922
|
delete?: never;
|
|
2919
2923
|
options?: never;
|
|
@@ -3057,7 +3061,7 @@ export interface paths {
|
|
|
3057
3061
|
};
|
|
3058
3062
|
/**
|
|
3059
3063
|
* Role changes of the group's members
|
|
3060
|
-
* @description Who made whom an admin or a member, or transferred ownership, and when. Members only.
|
|
3064
|
+
* @description Who made whom an admin or a member, or transferred ownership, and when. Members only; in a channel only the owner and admins (`403`).
|
|
3061
3065
|
*/
|
|
3062
3066
|
get: operations["getGroupRoleLog"];
|
|
3063
3067
|
put?: never;
|
|
@@ -3270,10 +3274,10 @@ export interface paths {
|
|
|
3270
3274
|
put?: never;
|
|
3271
3275
|
/**
|
|
3272
3276
|
* Join a group through an invite link
|
|
3273
|
-
* @description Joins directly and posts a `member_joined` system message. A member gets the chat back
|
|
3274
|
-
* `404` for an unknown, revoked, expired or used-up link; `403` `forbidden` when banned from
|
|
3275
|
-
* `account_restricted` (`join_by_link`) at `restricted` or above
|
|
3276
|
-
* hour (`429`).
|
|
3277
|
+
* @description Joins directly and posts a `member_joined` system message (not in a channel). A member gets the chat back
|
|
3278
|
+
* without a change. `404` for an unknown, revoked, expired or used-up link; `403` `forbidden` when banned from
|
|
3279
|
+
* the group; `403` `account_restricted` (`join_by_link`) at `restricted` or above; `409` `limit_reached` when
|
|
3280
|
+
* the group already has 10,000 members. At most 20 joins by link or public name per hour (`429`).
|
|
3277
3281
|
*/
|
|
3278
3282
|
post: operations["joinByInvite"];
|
|
3279
3283
|
delete?: never;
|
|
@@ -6776,6 +6780,13 @@ export interface components {
|
|
|
6776
6780
|
};
|
|
6777
6781
|
/** @enum {string} */
|
|
6778
6782
|
ChatType: "direct" | "group";
|
|
6783
|
+
/**
|
|
6784
|
+
* @description `channel`: only the owner and admins post; members (subscribers) read, react and vote. Subscribers do not see
|
|
6785
|
+
* each other: no member list, no read receipts, no typing, no calls, and joining or leaving writes no system
|
|
6786
|
+
* line. A channel is not end-to-end encrypted. Unknown values must be treated like `group`.
|
|
6787
|
+
* @enum {string}
|
|
6788
|
+
*/
|
|
6789
|
+
GroupMode: "group" | "channel";
|
|
6779
6790
|
/**
|
|
6780
6791
|
* @description A moderator may delete other members' messages; owners and admins also manage the group.
|
|
6781
6792
|
* @enum {string}
|
|
@@ -6829,6 +6840,8 @@ export interface components {
|
|
|
6829
6840
|
last_message: components["schemas"]["Message"] | null;
|
|
6830
6841
|
/** @description Only for groups. */
|
|
6831
6842
|
my_role?: components["schemas"]["GroupRole"] | null;
|
|
6843
|
+
/** @description Only for groups; `null` for direct chats. */
|
|
6844
|
+
group_mode?: components["schemas"]["GroupMode"] | null;
|
|
6832
6845
|
/** @description Pinned messages the caller sees (`GET /chats/{chat_id}/pins`); clients show the pinned bar above 0. */
|
|
6833
6846
|
pinned_message_count: number;
|
|
6834
6847
|
created_at: components["schemas"]["Timestamp"];
|
|
@@ -7013,6 +7026,9 @@ export interface components {
|
|
|
7013
7026
|
};
|
|
7014
7027
|
Group: {
|
|
7015
7028
|
id: components["schemas"]["Id"];
|
|
7029
|
+
group_mode: components["schemas"]["GroupMode"];
|
|
7030
|
+
/** @description Everyone in the group, the owner included (the subscribers of a channel). */
|
|
7031
|
+
member_count: number;
|
|
7016
7032
|
name: string;
|
|
7017
7033
|
description: string | null;
|
|
7018
7034
|
avatar_url: string | null;
|
|
@@ -7020,6 +7036,7 @@ export interface components {
|
|
|
7020
7036
|
background: components["schemas"]["ProfileBackground"] | null;
|
|
7021
7037
|
owner_id: components["schemas"]["Id"];
|
|
7022
7038
|
my_role: components["schemas"]["GroupRole"];
|
|
7039
|
+
/** @description Always empty for a channel; its owner and admins page through the subscribers with `listGroupMembers`. */
|
|
7023
7040
|
members: components["schemas"]["GroupMember"][];
|
|
7024
7041
|
created_at: components["schemas"]["Timestamp"];
|
|
7025
7042
|
/** @description The group's public name (`/@name`); `null` for a private group. */
|
|
@@ -7028,6 +7045,8 @@ export interface components {
|
|
|
7028
7045
|
CreateGroupRequest: {
|
|
7029
7046
|
name: string;
|
|
7030
7047
|
description?: string | null;
|
|
7048
|
+
/** @description `channel` creates a channel. Defaults to `group`; it cannot be changed later. */
|
|
7049
|
+
mode?: components["schemas"]["GroupMode"];
|
|
7031
7050
|
member_ids: components["schemas"]["Id"][];
|
|
7032
7051
|
};
|
|
7033
7052
|
UpdateGroupRequest: {
|
|
@@ -7070,6 +7089,7 @@ export interface components {
|
|
|
7070
7089
|
/** @description The card of a group for someone without an account. No members and no messages. */
|
|
7071
7090
|
PublicGroup: {
|
|
7072
7091
|
name: string;
|
|
7092
|
+
group_mode: components["schemas"]["GroupMode"];
|
|
7073
7093
|
/** @description Set for a public group. */
|
|
7074
7094
|
public_name: components["schemas"]["PublicName"] | null;
|
|
7075
7095
|
description: string | null;
|
|
@@ -12265,6 +12285,7 @@ export interface operations {
|
|
|
12265
12285
|
};
|
|
12266
12286
|
400: components["responses"]["BadRequest"];
|
|
12267
12287
|
401: components["responses"]["Unauthorized"];
|
|
12288
|
+
403: components["responses"]["Forbidden"];
|
|
12268
12289
|
404: components["responses"]["NotFound"];
|
|
12269
12290
|
426: components["responses"]["ClientOutdated"];
|
|
12270
12291
|
};
|
|
@@ -12532,6 +12553,7 @@ export interface operations {
|
|
|
12532
12553
|
};
|
|
12533
12554
|
400: components["responses"]["BadRequest"];
|
|
12534
12555
|
401: components["responses"]["Unauthorized"];
|
|
12556
|
+
403: components["responses"]["Forbidden"];
|
|
12535
12557
|
404: components["responses"]["NotFound"];
|
|
12536
12558
|
426: components["responses"]["ClientOutdated"];
|
|
12537
12559
|
};
|
|
@@ -12877,6 +12899,7 @@ export interface operations {
|
|
|
12877
12899
|
401: components["responses"]["Unauthorized"];
|
|
12878
12900
|
403: components["responses"]["Forbidden"];
|
|
12879
12901
|
404: components["responses"]["NotFound"];
|
|
12902
|
+
409: components["responses"]["Conflict"];
|
|
12880
12903
|
426: components["responses"]["ClientOutdated"];
|
|
12881
12904
|
429: components["responses"]["TooManyRequests"];
|
|
12882
12905
|
};
|
|
@@ -12977,6 +13000,7 @@ export interface operations {
|
|
|
12977
13000
|
401: components["responses"]["Unauthorized"];
|
|
12978
13001
|
403: components["responses"]["Forbidden"];
|
|
12979
13002
|
404: components["responses"]["NotFound"];
|
|
13003
|
+
409: components["responses"]["Conflict"];
|
|
12980
13004
|
426: components["responses"]["ClientOutdated"];
|
|
12981
13005
|
429: components["responses"]["TooManyRequests"];
|
|
12982
13006
|
};
|
package/dist/ws-docs.json
CHANGED
|
@@ -479,7 +479,9 @@
|
|
|
479
479
|
}
|
|
480
480
|
],
|
|
481
481
|
"created_at": "2026-10-04T12:00:00Z",
|
|
482
|
-
"public_name": null
|
|
482
|
+
"public_name": null,
|
|
483
|
+
"group_mode": "group",
|
|
484
|
+
"member_count": 1
|
|
483
485
|
}
|
|
484
486
|
}
|
|
485
487
|
},
|
|
@@ -518,7 +520,9 @@
|
|
|
518
520
|
}
|
|
519
521
|
],
|
|
520
522
|
"created_at": "2026-10-04T12:00:00Z",
|
|
521
|
-
"public_name": null
|
|
523
|
+
"public_name": null,
|
|
524
|
+
"group_mode": "group",
|
|
525
|
+
"member_count": 1
|
|
522
526
|
}
|
|
523
527
|
}
|
|
524
528
|
},
|
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.57. Do not edit. */
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* Any WebSocket event, in either direction.
|
|
@@ -170,6 +170,13 @@ export type SystemEventKind =
|
|
|
170
170
|
* A moderator may delete other members' messages; owners and admins also manage the group.
|
|
171
171
|
*/
|
|
172
172
|
export type GroupRole = "owner" | "admin" | "moderator" | "member";
|
|
173
|
+
/**
|
|
174
|
+
* `channel`: only the owner and admins post; members (subscribers) read, react and vote. Subscribers do not see
|
|
175
|
+
* each other: no member list, no read receipts, no typing, no calls, and joining or leaving writes no system
|
|
176
|
+
* line. A channel is not end-to-end encrypted. Unknown values must be treated like `group`.
|
|
177
|
+
*
|
|
178
|
+
*/
|
|
179
|
+
export type GroupMode = "group" | "channel";
|
|
173
180
|
/**
|
|
174
181
|
* A Unicode emoji or a custom emoji token, exactly as the client inserts it.
|
|
175
182
|
*/
|
|
@@ -822,6 +829,10 @@ export interface Chat {
|
|
|
822
829
|
* Only for groups.
|
|
823
830
|
*/
|
|
824
831
|
my_role?: GroupRole | null;
|
|
832
|
+
/**
|
|
833
|
+
* Only for groups; `null` for direct chats.
|
|
834
|
+
*/
|
|
835
|
+
group_mode?: GroupMode | null;
|
|
825
836
|
/**
|
|
826
837
|
* Pinned messages the caller sees (`GET /chats/{chat_id}/pins`); clients show the pinned bar above 0.
|
|
827
838
|
*/
|
|
@@ -1318,6 +1329,11 @@ export interface ServerGroupCreatedEvent {
|
|
|
1318
1329
|
}
|
|
1319
1330
|
export interface Group {
|
|
1320
1331
|
id: Id;
|
|
1332
|
+
group_mode: GroupMode;
|
|
1333
|
+
/**
|
|
1334
|
+
* Everyone in the group, the owner included (the subscribers of a channel).
|
|
1335
|
+
*/
|
|
1336
|
+
member_count: number;
|
|
1321
1337
|
name: string;
|
|
1322
1338
|
description: string | null;
|
|
1323
1339
|
avatar_url: string | null;
|
|
@@ -1327,6 +1343,10 @@ export interface Group {
|
|
|
1327
1343
|
background: ProfileBackground | null;
|
|
1328
1344
|
owner_id: Id;
|
|
1329
1345
|
my_role: GroupRole;
|
|
1346
|
+
/**
|
|
1347
|
+
* Always empty for a channel; its owner and admins page through the subscribers with `listGroupMembers`.
|
|
1348
|
+
*
|
|
1349
|
+
*/
|
|
1330
1350
|
members: GroupMember[];
|
|
1331
1351
|
created_at: Timestamp;
|
|
1332
1352
|
/**
|
|
@@ -4836,6 +4836,14 @@
|
|
|
4836
4836
|
"group"
|
|
4837
4837
|
]
|
|
4838
4838
|
},
|
|
4839
|
+
"GroupMode": {
|
|
4840
|
+
"type": "string",
|
|
4841
|
+
"description": "`channel`: only the owner and admins post; members (subscribers) read, react and vote. Subscribers do not see\neach other: no member list, no read receipts, no typing, no calls, and joining or leaving writes no system\nline. A channel is not end-to-end encrypted. Unknown values must be treated like `group`.\n",
|
|
4842
|
+
"enum": [
|
|
4843
|
+
"group",
|
|
4844
|
+
"channel"
|
|
4845
|
+
]
|
|
4846
|
+
},
|
|
4839
4847
|
"GroupRole": {
|
|
4840
4848
|
"type": "string",
|
|
4841
4849
|
"description": "A moderator may delete other members' messages; owners and admins also manage the group.",
|
|
@@ -5015,6 +5023,17 @@
|
|
|
5015
5023
|
}
|
|
5016
5024
|
]
|
|
5017
5025
|
},
|
|
5026
|
+
"group_mode": {
|
|
5027
|
+
"description": "Only for groups; `null` for direct chats.",
|
|
5028
|
+
"oneOf": [
|
|
5029
|
+
{
|
|
5030
|
+
"$ref": "#/$defs/GroupMode"
|
|
5031
|
+
},
|
|
5032
|
+
{
|
|
5033
|
+
"type": "null"
|
|
5034
|
+
}
|
|
5035
|
+
]
|
|
5036
|
+
},
|
|
5018
5037
|
"pinned_message_count": {
|
|
5019
5038
|
"type": "integer",
|
|
5020
5039
|
"minimum": 0,
|
|
@@ -5712,12 +5731,22 @@
|
|
|
5712
5731
|
"my_role",
|
|
5713
5732
|
"members",
|
|
5714
5733
|
"created_at",
|
|
5715
|
-
"public_name"
|
|
5734
|
+
"public_name",
|
|
5735
|
+
"group_mode",
|
|
5736
|
+
"member_count"
|
|
5716
5737
|
],
|
|
5717
5738
|
"properties": {
|
|
5718
5739
|
"id": {
|
|
5719
5740
|
"$ref": "#/$defs/Id"
|
|
5720
5741
|
},
|
|
5742
|
+
"group_mode": {
|
|
5743
|
+
"$ref": "#/$defs/GroupMode"
|
|
5744
|
+
},
|
|
5745
|
+
"member_count": {
|
|
5746
|
+
"type": "integer",
|
|
5747
|
+
"minimum": 0,
|
|
5748
|
+
"description": "Everyone in the group, the owner included (the subscribers of a channel)."
|
|
5749
|
+
},
|
|
5721
5750
|
"name": {
|
|
5722
5751
|
"type": "string",
|
|
5723
5752
|
"minLength": 1,
|
|
@@ -5755,6 +5784,7 @@
|
|
|
5755
5784
|
},
|
|
5756
5785
|
"members": {
|
|
5757
5786
|
"type": "array",
|
|
5787
|
+
"description": "Always empty for a channel; its owner and admins page through the subscribers with `listGroupMembers`.\n",
|
|
5758
5788
|
"items": {
|
|
5759
5789
|
"$ref": "#/$defs/GroupMember"
|
|
5760
5790
|
}
|
|
@@ -5794,6 +5824,10 @@
|
|
|
5794
5824
|
],
|
|
5795
5825
|
"maxLength": 500
|
|
5796
5826
|
},
|
|
5827
|
+
"mode": {
|
|
5828
|
+
"description": "`channel` creates a channel. Defaults to `group`; it cannot be changed later.",
|
|
5829
|
+
"$ref": "#/$defs/GroupMode"
|
|
5830
|
+
},
|
|
5797
5831
|
"member_ids": {
|
|
5798
5832
|
"type": "array",
|
|
5799
5833
|
"maxItems": 200,
|
|
@@ -5918,12 +5952,16 @@
|
|
|
5918
5952
|
"public_name",
|
|
5919
5953
|
"description",
|
|
5920
5954
|
"avatar_url",
|
|
5921
|
-
"member_count"
|
|
5955
|
+
"member_count",
|
|
5956
|
+
"group_mode"
|
|
5922
5957
|
],
|
|
5923
5958
|
"properties": {
|
|
5924
5959
|
"name": {
|
|
5925
5960
|
"type": "string"
|
|
5926
5961
|
},
|
|
5962
|
+
"group_mode": {
|
|
5963
|
+
"$ref": "#/$defs/GroupMode"
|
|
5964
|
+
},
|
|
5927
5965
|
"public_name": {
|
|
5928
5966
|
"description": "Set for a public group.",
|
|
5929
5967
|
"oneOf": [
|
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.57",
|
|
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": {
|