@myronsi/messenger-api 2.1.0-alpha.27.next.109 → 2.1.0-alpha.28

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 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.28
6
+
7
+ - `MediaKind` gains `voice` (voice messages only) and `link` (messages whose text or caption contains a web link) for
8
+ `GET /chats/{chat_id}/media`.
9
+ - `GET /groups/{chat_id}/participants` (`GroupMemberPage`): members page by page, owner first, then admins, moderators
10
+ and members by display name, with an optional `q` filter and the matching `total`.
11
+ - `GET /users/{user_id}/common-groups` (`CommonGroupPage` of `CommonGroup`): the groups the caller shares with the
12
+ user.
13
+
5
14
  ## 2.1.0-alpha.27
6
15
 
7
16
  - `User` gains the required `profile_version` (grows with username, display name, bio or avatar changes, not with
package/dist/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- /* Generated from api/openapi.yaml 2.1.0-alpha.27. Do not edit. */
2
- export declare const API_VERSION: "2.1.0-alpha.27";
1
+ /* Generated from api/openapi.yaml 2.1.0-alpha.28. Do not edit. */
2
+ export declare const API_VERSION: "2.1.0-alpha.28";
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.27";
1
+ export const API_VERSION = "2.1.0-alpha.28";
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.27
4
+ version: 2.1.0-alpha.28
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
@@ -783,6 +783,32 @@ paths:
783
783
  "401": { $ref: "#/components/responses/Unauthorized" }
784
784
  "404": { $ref: "#/components/responses/NotFound" }
785
785
  "429": { $ref: "#/components/responses/TooManyRequests" }
786
+ /users/{user_id}/common-groups:
787
+ parameters:
788
+ - $ref: "#/components/parameters/ClientVersion"
789
+ - $ref: "#/components/parameters/ClientApiVersion"
790
+ - name: user_id
791
+ in: path
792
+ required: true
793
+ schema: { $ref: "#/components/schemas/Id" }
794
+ get:
795
+ tags: [users]
796
+ operationId: listCommonGroups
797
+ summary: Groups the caller and the user are both in
798
+ description: Newest activity first. Empty for the caller's own id.
799
+ parameters:
800
+ - $ref: "#/components/parameters/Limit"
801
+ - $ref: "#/components/parameters/After"
802
+ responses:
803
+ "426": { $ref: "#/components/responses/ClientOutdated" }
804
+ "400": { $ref: "#/components/responses/BadRequest" }
805
+ "200":
806
+ description: A page of groups
807
+ content:
808
+ application/json:
809
+ schema: { $ref: "#/components/schemas/CommonGroupPage" }
810
+ "401": { $ref: "#/components/responses/Unauthorized" }
811
+ "404": { $ref: "#/components/responses/NotFound" }
786
812
  /users/{user_id}:
787
813
  parameters:
788
814
  - $ref: "#/components/parameters/ClientVersion"
@@ -1411,7 +1437,7 @@ paths:
1411
1437
  get:
1412
1438
  tags: [chats]
1413
1439
  operationId: listChatMedia
1414
- summary: Photos, videos, audio or files of a chat
1440
+ summary: Photos, videos, audio, voice messages, files or links of a chat
1415
1441
  description: Replaces `GET /messages/photos/{chat_id}` and `GET /messages/audios/{chat_id}`.
1416
1442
  parameters:
1417
1443
  - name: kind
@@ -1837,6 +1863,30 @@ paths:
1837
1863
  - $ref: "#/components/parameters/ClientVersion"
1838
1864
  - $ref: "#/components/parameters/ClientApiVersion"
1839
1865
  - $ref: "#/components/parameters/ChatId"
1866
+ get:
1867
+ tags: [groups]
1868
+ operationId: listGroupMembers
1869
+ summary: Members of a group, page by page
1870
+ description: |
1871
+ Owner first, then admins, moderators and members, each by display name. `q` keeps members whose username starts
1872
+ with it or whose display name contains it (case-insensitive). `total` counts every member that matches.
1873
+ parameters:
1874
+ - name: q
1875
+ in: query
1876
+ required: false
1877
+ schema: { type: string, maxLength: 64 }
1878
+ - $ref: "#/components/parameters/Limit"
1879
+ - $ref: "#/components/parameters/After"
1880
+ responses:
1881
+ "426": { $ref: "#/components/responses/ClientOutdated" }
1882
+ "400": { $ref: "#/components/responses/BadRequest" }
1883
+ "200":
1884
+ description: A page of members
1885
+ content:
1886
+ application/json:
1887
+ schema: { $ref: "#/components/schemas/GroupMemberPage" }
1888
+ "401": { $ref: "#/components/responses/Unauthorized" }
1889
+ "404": { $ref: "#/components/responses/NotFound" }
1840
1890
  post:
1841
1891
  tags: [groups]
1842
1892
  operationId: addGroupParticipant
@@ -5096,8 +5146,10 @@ components:
5096
5146
  drawing: { $ref: "#/components/schemas/Drawing" }
5097
5147
  MediaKind:
5098
5148
  type: string
5099
- description: "`image` photos, `visual` photos and videos, `audio` audio files and voice messages, `file` other files (documents, archives)."
5100
- enum: [image, audio, visual, file]
5149
+ description: |
5150
+ `image` photos, `visual` photos and videos, `audio` audio files and voice messages, `voice` voice messages only,
5151
+ `file` other files (documents, archives), `link` messages whose text or caption contains a web link.
5152
+ enum: [image, audio, visual, file, voice, link]
5101
5153
 
5102
5154
  # -------------------------------------------------------- messages
5103
5155
  MessageType:
@@ -5689,6 +5741,31 @@ components:
5689
5741
  initial_message:
5690
5742
  type: [string, "null"]
5691
5743
  maxLength: 4096
5744
+ GroupMemberPage:
5745
+ type: object
5746
+ required: [items, next_cursor, total]
5747
+ properties:
5748
+ items:
5749
+ type: array
5750
+ items: { $ref: "#/components/schemas/GroupMember" }
5751
+ next_cursor: { $ref: "#/components/schemas/Cursor" }
5752
+ total: { type: integer, minimum: 0 }
5753
+ CommonGroup:
5754
+ type: object
5755
+ required: [id, name, avatar_url, member_count]
5756
+ properties:
5757
+ id: { $ref: "#/components/schemas/Id" }
5758
+ name: { type: string }
5759
+ avatar_url: { type: [string, "null"] }
5760
+ member_count: { type: integer, minimum: 1 }
5761
+ CommonGroupPage:
5762
+ type: object
5763
+ required: [items, next_cursor]
5764
+ properties:
5765
+ items:
5766
+ type: array
5767
+ items: { $ref: "#/components/schemas/CommonGroup" }
5768
+ next_cursor: { $ref: "#/components/schemas/Cursor" }
5692
5769
  GroupMember:
5693
5770
  type: object
5694
5771
  required: [user, role, joined_at]
package/dist/schema.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- /* Generated from api/openapi.yaml 2.1.0-alpha.27. Do not edit. */
1
+ /* Generated from api/openapi.yaml 2.1.0-alpha.28. Do not edit. */
2
2
  export interface paths {
3
3
  "/meta": {
4
4
  parameters: {
@@ -628,6 +628,33 @@ export interface paths {
628
628
  patch?: never;
629
629
  trace?: never;
630
630
  };
631
+ "/users/{user_id}/common-groups": {
632
+ parameters: {
633
+ query?: never;
634
+ header?: {
635
+ /** @description Version of the client app, for logs and the per-client metric. */
636
+ "X-Client-Version"?: components["parameters"]["ClientVersion"];
637
+ /** @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`). */
638
+ "X-Client-Api-Version"?: components["parameters"]["ClientApiVersion"];
639
+ };
640
+ path: {
641
+ user_id: components["schemas"]["Id"];
642
+ };
643
+ cookie?: never;
644
+ };
645
+ /**
646
+ * Groups the caller and the user are both in
647
+ * @description Newest activity first. Empty for the caller's own id.
648
+ */
649
+ get: operations["listCommonGroups"];
650
+ put?: never;
651
+ post?: never;
652
+ delete?: never;
653
+ options?: never;
654
+ head?: never;
655
+ patch?: never;
656
+ trace?: never;
657
+ };
631
658
  "/users/{user_id}": {
632
659
  parameters: {
633
660
  query?: never;
@@ -1138,7 +1165,7 @@ export interface paths {
1138
1165
  cookie?: never;
1139
1166
  };
1140
1167
  /**
1141
- * Photos, videos, audio or files of a chat
1168
+ * Photos, videos, audio, voice messages, files or links of a chat
1142
1169
  * @description Replaces `GET /messages/photos/{chat_id}` and `GET /messages/audios/{chat_id}`.
1143
1170
  */
1144
1171
  get: operations["listChatMedia"];
@@ -1458,7 +1485,12 @@ export interface paths {
1458
1485
  };
1459
1486
  cookie?: never;
1460
1487
  };
1461
- get?: never;
1488
+ /**
1489
+ * Members of a group, page by page
1490
+ * @description Owner first, then admins, moderators and members, each by display name. `q` keeps members whose username starts
1491
+ * with it or whose display name contains it (case-insensitive). `total` counts every member that matches.
1492
+ */
1493
+ get: operations["listGroupMembers"];
1462
1494
  put?: never;
1463
1495
  /** Add a participant */
1464
1496
  post: operations["addGroupParticipant"];
@@ -3358,10 +3390,11 @@ export interface components {
3358
3390
  drawing: components["schemas"]["Drawing"];
3359
3391
  };
3360
3392
  /**
3361
- * @description `image` photos, `visual` photos and videos, `audio` audio files and voice messages, `file` other files (documents, archives).
3393
+ * @description `image` photos, `visual` photos and videos, `audio` audio files and voice messages, `voice` voice messages only,
3394
+ * `file` other files (documents, archives), `link` messages whose text or caption contains a web link.
3362
3395
  * @enum {string}
3363
3396
  */
3364
- MediaKind: "image" | "audio" | "visual" | "file";
3397
+ MediaKind: "image" | "audio" | "visual" | "file" | "voice" | "link";
3365
3398
  /** @enum {string} */
3366
3399
  MessageType: "text" | "file" | "voice" | "system" | "sticker";
3367
3400
  /**
@@ -3655,6 +3688,21 @@ export interface components {
3655
3688
  user_id: components["schemas"]["Id"];
3656
3689
  initial_message?: string | null;
3657
3690
  };
3691
+ GroupMemberPage: {
3692
+ items: components["schemas"]["GroupMember"][];
3693
+ next_cursor: components["schemas"]["Cursor"];
3694
+ total: number;
3695
+ };
3696
+ CommonGroup: {
3697
+ id: components["schemas"]["Id"];
3698
+ name: string;
3699
+ avatar_url: string | null;
3700
+ member_count: number;
3701
+ };
3702
+ CommonGroupPage: {
3703
+ items: components["schemas"]["CommonGroup"][];
3704
+ next_cursor: components["schemas"]["Cursor"];
3705
+ };
3658
3706
  GroupMember: {
3659
3707
  user: components["schemas"]["User"];
3660
3708
  role: components["schemas"]["GroupRole"];
@@ -5191,6 +5239,42 @@ export interface operations {
5191
5239
  429: components["responses"]["TooManyRequests"];
5192
5240
  };
5193
5241
  };
5242
+ listCommonGroups: {
5243
+ parameters: {
5244
+ query?: {
5245
+ /** @description Page size */
5246
+ limit?: components["parameters"]["Limit"];
5247
+ /** @description Opaque `next_cursor` of the previous page */
5248
+ after?: components["parameters"]["After"];
5249
+ };
5250
+ header?: {
5251
+ /** @description Version of the client app, for logs and the per-client metric. */
5252
+ "X-Client-Version"?: components["parameters"]["ClientVersion"];
5253
+ /** @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`). */
5254
+ "X-Client-Api-Version"?: components["parameters"]["ClientApiVersion"];
5255
+ };
5256
+ path: {
5257
+ user_id: components["schemas"]["Id"];
5258
+ };
5259
+ cookie?: never;
5260
+ };
5261
+ requestBody?: never;
5262
+ responses: {
5263
+ /** @description A page of groups */
5264
+ 200: {
5265
+ headers: {
5266
+ [name: string]: unknown;
5267
+ };
5268
+ content: {
5269
+ "application/json": components["schemas"]["CommonGroupPage"];
5270
+ };
5271
+ };
5272
+ 400: components["responses"]["BadRequest"];
5273
+ 401: components["responses"]["Unauthorized"];
5274
+ 404: components["responses"]["NotFound"];
5275
+ 426: components["responses"]["ClientOutdated"];
5276
+ };
5277
+ };
5194
5278
  getUser: {
5195
5279
  parameters: {
5196
5280
  query?: never;
@@ -6639,6 +6723,43 @@ export interface operations {
6639
6723
  426: components["responses"]["ClientOutdated"];
6640
6724
  };
6641
6725
  };
6726
+ listGroupMembers: {
6727
+ parameters: {
6728
+ query?: {
6729
+ q?: string;
6730
+ /** @description Page size */
6731
+ limit?: components["parameters"]["Limit"];
6732
+ /** @description Opaque `next_cursor` of the previous page */
6733
+ after?: components["parameters"]["After"];
6734
+ };
6735
+ header?: {
6736
+ /** @description Version of the client app, for logs and the per-client metric. */
6737
+ "X-Client-Version"?: components["parameters"]["ClientVersion"];
6738
+ /** @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`). */
6739
+ "X-Client-Api-Version"?: components["parameters"]["ClientApiVersion"];
6740
+ };
6741
+ path: {
6742
+ chat_id: components["parameters"]["ChatId"];
6743
+ };
6744
+ cookie?: never;
6745
+ };
6746
+ requestBody?: never;
6747
+ responses: {
6748
+ /** @description A page of members */
6749
+ 200: {
6750
+ headers: {
6751
+ [name: string]: unknown;
6752
+ };
6753
+ content: {
6754
+ "application/json": components["schemas"]["GroupMemberPage"];
6755
+ };
6756
+ };
6757
+ 400: components["responses"]["BadRequest"];
6758
+ 401: components["responses"]["Unauthorized"];
6759
+ 404: components["responses"]["NotFound"];
6760
+ 426: components["responses"]["ClientOutdated"];
6761
+ };
6762
+ };
6642
6763
  addGroupParticipant: {
6643
6764
  parameters: {
6644
6765
  query?: never;
@@ -1,4 +1,4 @@
1
- /* Generated from api/openapi.yaml 2.1.0-alpha.27. Do not edit. */
1
+ /* Generated from api/openapi.yaml 2.1.0-alpha.28. Do not edit. */
2
2
 
3
3
  /**
4
4
  * Any WebSocket event, in either direction.
@@ -1448,12 +1448,14 @@
1448
1448
  },
1449
1449
  "MediaKind": {
1450
1450
  "type": "string",
1451
- "description": "`image` photos, `visual` photos and videos, `audio` audio files and voice messages, `file` other files (documents, archives).",
1451
+ "description": "`image` photos, `visual` photos and videos, `audio` audio files and voice messages, `voice` voice messages only,\n`file` other files (documents, archives), `link` messages whose text or caption contains a web link.\n",
1452
1452
  "enum": [
1453
1453
  "image",
1454
1454
  "audio",
1455
1455
  "visual",
1456
- "file"
1456
+ "file",
1457
+ "voice",
1458
+ "link"
1457
1459
  ]
1458
1460
  },
1459
1461
  "MessageType": {
@@ -2711,6 +2713,74 @@
2711
2713
  }
2712
2714
  }
2713
2715
  },
2716
+ "GroupMemberPage": {
2717
+ "type": "object",
2718
+ "required": [
2719
+ "items",
2720
+ "next_cursor",
2721
+ "total"
2722
+ ],
2723
+ "properties": {
2724
+ "items": {
2725
+ "type": "array",
2726
+ "items": {
2727
+ "$ref": "#/$defs/GroupMember"
2728
+ }
2729
+ },
2730
+ "next_cursor": {
2731
+ "$ref": "#/$defs/Cursor"
2732
+ },
2733
+ "total": {
2734
+ "type": "integer",
2735
+ "minimum": 0
2736
+ }
2737
+ }
2738
+ },
2739
+ "CommonGroup": {
2740
+ "type": "object",
2741
+ "required": [
2742
+ "id",
2743
+ "name",
2744
+ "avatar_url",
2745
+ "member_count"
2746
+ ],
2747
+ "properties": {
2748
+ "id": {
2749
+ "$ref": "#/$defs/Id"
2750
+ },
2751
+ "name": {
2752
+ "type": "string"
2753
+ },
2754
+ "avatar_url": {
2755
+ "type": [
2756
+ "string",
2757
+ "null"
2758
+ ]
2759
+ },
2760
+ "member_count": {
2761
+ "type": "integer",
2762
+ "minimum": 1
2763
+ }
2764
+ }
2765
+ },
2766
+ "CommonGroupPage": {
2767
+ "type": "object",
2768
+ "required": [
2769
+ "items",
2770
+ "next_cursor"
2771
+ ],
2772
+ "properties": {
2773
+ "items": {
2774
+ "type": "array",
2775
+ "items": {
2776
+ "$ref": "#/$defs/CommonGroup"
2777
+ }
2778
+ },
2779
+ "next_cursor": {
2780
+ "$ref": "#/$defs/Cursor"
2781
+ }
2782
+ }
2783
+ },
2714
2784
  "GroupMember": {
2715
2785
  "type": "object",
2716
2786
  "required": [
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@myronsi/messenger-api",
3
- "version": "2.1.0-alpha.27.next.109",
3
+ "version": "2.1.0-alpha.28",
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": {