@myronsi/messenger-api 2.1.0-alpha.16 → 2.1.0-alpha.17.next.91

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,14 @@
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.17
6
+
7
+ - Media albums: `SendMessageRequest.attachment_ids` sends two to ten image or video uploads as one `file` message
8
+ with one caption. `attachment_id` and `attachment_ids` are mutually exclusive; albums are `file` only.
9
+ - `Message.attachments` lists the album items in order. `Message.attachment` still carries the first item, so
10
+ older clients show the first photo or video.
11
+ - `MediaKind` gains `visual` for `GET /chats/{chat_id}/media`: images and videos together.
12
+
5
13
  ## 2.1.0-alpha.16
6
14
 
7
15
  - Trusted-device recovery no longer needs the current password. `DeviceRecoveryApproval.password` is no longer
package/dist/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- /* Generated from api/openapi.yaml 2.1.0-alpha.16. Do not edit. */
2
- export declare const API_VERSION: "2.1.0-alpha.16";
1
+ /* Generated from api/openapi.yaml 2.1.0-alpha.17. Do not edit. */
2
+ export declare const API_VERSION: "2.1.0-alpha.17";
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.16";
1
+ export const API_VERSION = "2.1.0-alpha.17";
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.16
4
+ version: 2.1.0-alpha.17
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
@@ -1253,7 +1253,7 @@ paths:
1253
1253
  get:
1254
1254
  tags: [chats]
1255
1255
  operationId: listChatMedia
1256
- summary: Photos or audio of a chat
1256
+ summary: Photos, videos or audio of a chat
1257
1257
  description: Replaces `GET /messages/photos/{chat_id}` and `GET /messages/audios/{chat_id}`.
1258
1258
  parameters:
1259
1259
  - name: kind
@@ -4501,7 +4501,7 @@ components:
4501
4501
  items: { type: integer, minimum: 0, maximum: 255 }
4502
4502
  MediaKind:
4503
4503
  type: string
4504
- enum: [image, audio]
4504
+ enum: [image, audio, visual]
4505
4505
 
4506
4506
  # -------------------------------------------------------- messages
4507
4507
  MessageType:
@@ -4595,6 +4595,12 @@ components:
4595
4595
  oneOf:
4596
4596
  - $ref: "#/components/schemas/ForwardedFrom"
4597
4597
  - type: "null"
4598
+ attachments:
4599
+ type: array
4600
+ description: Ordered images and videos of an album. The first item is also returned as attachment for older clients.
4601
+ minItems: 2
4602
+ maxItems: 10
4603
+ items: { $ref: "#/components/schemas/Attachment" }
4598
4604
  reactions:
4599
4605
  type: array
4600
4606
  items: { $ref: "#/components/schemas/Reaction" }
@@ -4706,10 +4712,17 @@ components:
4706
4712
  type: [string, "null"]
4707
4713
  maxLength: 4096
4708
4714
  attachment_id:
4709
- description: Required and not null for `file` and `voice`; never a URL.
4715
+ description: Single upload ID for a file or voice message. Omit for albums.
4710
4716
  oneOf:
4711
4717
  - $ref: "#/components/schemas/AttachmentRef"
4712
4718
  - type: "null"
4719
+ attachment_ids:
4720
+ type: array
4721
+ description: Ordered IDs of two to ten image or video uploads for one file message.
4722
+ minItems: 2
4723
+ maxItems: 10
4724
+ uniqueItems: true
4725
+ items: { $ref: "#/components/schemas/AttachmentRef" }
4713
4726
  reply_to:
4714
4727
  oneOf:
4715
4728
  - $ref: "#/components/schemas/Id"
@@ -4718,14 +4731,22 @@ components:
4718
4731
  properties:
4719
4732
  type: { enum: [file, voice] }
4720
4733
  then:
4721
- required: [attachment_id]
4722
- properties:
4723
- attachment_id: { $ref: "#/components/schemas/AttachmentRef" }
4734
+ oneOf:
4735
+ - required: [attachment_id]
4736
+ properties:
4737
+ attachment_id: { $ref: "#/components/schemas/AttachmentRef" }
4738
+ attachment_ids: { not: {} }
4739
+ - required: [attachment_ids]
4740
+ properties:
4741
+ type: { const: file }
4742
+ attachment_id: { not: {} }
4743
+ attachment_ids: { type: array }
4724
4744
  else:
4725
4745
  required: [content]
4726
4746
  properties:
4727
4747
  content: { type: string, minLength: 1, maxLength: 4096 }
4728
4748
  attachment_id: { not: {} }
4749
+ attachment_ids: { not: {} }
4729
4750
  EditMessageRequest:
4730
4751
  type: object
4731
4752
  required: [content]
package/dist/schema.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- /* Generated from api/openapi.yaml 2.1.0-alpha.16. Do not edit. */
1
+ /* Generated from api/openapi.yaml 2.1.0-alpha.17. Do not edit. */
2
2
  export interface paths {
3
3
  "/meta": {
4
4
  parameters: {
@@ -991,7 +991,7 @@ export interface paths {
991
991
  cookie?: never;
992
992
  };
993
993
  /**
994
- * Photos or audio of a chat
994
+ * Photos, videos or audio of a chat
995
995
  * @description Replaces `GET /messages/photos/{chat_id}` and `GET /messages/audios/{chat_id}`.
996
996
  */
997
997
  get: operations["listChatMedia"];
@@ -2871,7 +2871,7 @@ export interface components {
2871
2871
  waveform?: number[] | null;
2872
2872
  };
2873
2873
  /** @enum {string} */
2874
- MediaKind: "image" | "audio";
2874
+ MediaKind: "image" | "audio" | "visual";
2875
2875
  /** @enum {string} */
2876
2876
  MessageType: "text" | "file" | "voice" | "system";
2877
2877
  Reaction: {
@@ -2913,6 +2913,8 @@ export interface components {
2913
2913
  reply_to: components["schemas"]["Id"] | null;
2914
2914
  reply_preview?: components["schemas"]["ReplyPreview"];
2915
2915
  forwarded_from: components["schemas"]["ForwardedFrom"] | null;
2916
+ /** @description Ordered images and videos of an album. The first item is also returned as attachment for older clients. */
2917
+ attachments?: components["schemas"]["Attachment"][];
2916
2918
  reactions: components["schemas"]["Reaction"][];
2917
2919
  read_by: components["schemas"]["ReadReceipt"][];
2918
2920
  created_at: components["schemas"]["Timestamp"];
@@ -2981,8 +2983,10 @@ export interface components {
2981
2983
  /** @enum {string} */
2982
2984
  type: "text" | "file" | "voice";
2983
2985
  content?: string | null;
2984
- /** @description Required and not null for `file` and `voice`; never a URL. */
2986
+ /** @description Single upload ID for a file or voice message. Omit for albums. */
2985
2987
  attachment_id?: components["schemas"]["AttachmentRef"] | null;
2988
+ /** @description Ordered IDs of two to ten image or video uploads for one file message. */
2989
+ attachment_ids?: components["schemas"]["AttachmentRef"][];
2986
2990
  reply_to?: components["schemas"]["Id"] | null;
2987
2991
  };
2988
2992
  EditMessageRequest: {
@@ -1,4 +1,4 @@
1
- /* Generated from api/openapi.yaml 2.1.0-alpha.16. Do not edit. */
1
+ /* Generated from api/openapi.yaml 2.1.0-alpha.17. Do not edit. */
2
2
 
3
3
  /**
4
4
  * Any WebSocket event, in either direction.
@@ -436,6 +436,33 @@ export interface Message {
436
436
  reply_to: Id | null;
437
437
  reply_preview?: ReplyPreview;
438
438
  forwarded_from: ForwardedFrom | null;
439
+ /**
440
+ * Ordered images and videos of an album. The first item is also returned as attachment for older clients.
441
+ *
442
+ * @minItems 2
443
+ * @maxItems 10
444
+ */
445
+ attachments?:
446
+ | [Attachment, Attachment]
447
+ | [Attachment, Attachment, Attachment]
448
+ | [Attachment, Attachment, Attachment, Attachment]
449
+ | [Attachment, Attachment, Attachment, Attachment, Attachment]
450
+ | [Attachment, Attachment, Attachment, Attachment, Attachment, Attachment]
451
+ | [Attachment, Attachment, Attachment, Attachment, Attachment, Attachment, Attachment]
452
+ | [Attachment, Attachment, Attachment, Attachment, Attachment, Attachment, Attachment, Attachment]
453
+ | [Attachment, Attachment, Attachment, Attachment, Attachment, Attachment, Attachment, Attachment, Attachment]
454
+ | [
455
+ Attachment,
456
+ Attachment,
457
+ Attachment,
458
+ Attachment,
459
+ Attachment,
460
+ Attachment,
461
+ Attachment,
462
+ Attachment,
463
+ Attachment,
464
+ Attachment
465
+ ];
439
466
  reactions: Reaction[];
440
467
  read_by: ReadReceipt[];
441
468
  created_at: Timestamp;
@@ -1245,7 +1245,8 @@
1245
1245
  "type": "string",
1246
1246
  "enum": [
1247
1247
  "image",
1248
- "audio"
1248
+ "audio",
1249
+ "visual"
1249
1250
  ]
1250
1251
  },
1251
1252
  "MessageType": {
@@ -1445,6 +1446,15 @@
1445
1446
  }
1446
1447
  ]
1447
1448
  },
1449
+ "attachments": {
1450
+ "type": "array",
1451
+ "description": "Ordered images and videos of an album. The first item is also returned as attachment for older clients.",
1452
+ "minItems": 2,
1453
+ "maxItems": 10,
1454
+ "items": {
1455
+ "$ref": "#/$defs/Attachment"
1456
+ }
1457
+ },
1448
1458
  "reactions": {
1449
1459
  "type": "array",
1450
1460
  "items": {
@@ -1704,7 +1714,7 @@
1704
1714
  "maxLength": 4096
1705
1715
  },
1706
1716
  "attachment_id": {
1707
- "description": "Required and not null for `file` and `voice`; never a URL.",
1717
+ "description": "Single upload ID for a file or voice message. Omit for albums.",
1708
1718
  "oneOf": [
1709
1719
  {
1710
1720
  "$ref": "#/$defs/AttachmentRef"
@@ -1714,6 +1724,16 @@
1714
1724
  }
1715
1725
  ]
1716
1726
  },
1727
+ "attachment_ids": {
1728
+ "type": "array",
1729
+ "description": "Ordered IDs of two to ten image or video uploads for one file message.",
1730
+ "minItems": 2,
1731
+ "maxItems": 10,
1732
+ "uniqueItems": true,
1733
+ "items": {
1734
+ "$ref": "#/$defs/AttachmentRef"
1735
+ }
1736
+ },
1717
1737
  "reply_to": {
1718
1738
  "oneOf": [
1719
1739
  {
@@ -1736,14 +1756,37 @@
1736
1756
  }
1737
1757
  },
1738
1758
  "then": {
1739
- "required": [
1740
- "attachment_id"
1741
- ],
1742
- "properties": {
1743
- "attachment_id": {
1744
- "$ref": "#/$defs/AttachmentRef"
1759
+ "oneOf": [
1760
+ {
1761
+ "required": [
1762
+ "attachment_id"
1763
+ ],
1764
+ "properties": {
1765
+ "attachment_id": {
1766
+ "$ref": "#/$defs/AttachmentRef"
1767
+ },
1768
+ "attachment_ids": {
1769
+ "not": {}
1770
+ }
1771
+ }
1772
+ },
1773
+ {
1774
+ "required": [
1775
+ "attachment_ids"
1776
+ ],
1777
+ "properties": {
1778
+ "type": {
1779
+ "const": "file"
1780
+ },
1781
+ "attachment_id": {
1782
+ "not": {}
1783
+ },
1784
+ "attachment_ids": {
1785
+ "type": "array"
1786
+ }
1787
+ }
1745
1788
  }
1746
- }
1789
+ ]
1747
1790
  },
1748
1791
  "else": {
1749
1792
  "required": [
@@ -1757,6 +1800,9 @@
1757
1800
  },
1758
1801
  "attachment_id": {
1759
1802
  "not": {}
1803
+ },
1804
+ "attachment_ids": {
1805
+ "not": {}
1760
1806
  }
1761
1807
  }
1762
1808
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@myronsi/messenger-api",
3
- "version": "2.1.0-alpha.16",
3
+ "version": "2.1.0-alpha.17.next.91",
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": {