@myronsi/messenger-api 2.1.0-alpha.53.next.181 → 2.1.0-alpha.54

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,13 @@
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.54
6
+
7
+ - `UploadAttachmentRequest` gains `import_id`: uploads of the caller's own running import get their own rate limit
8
+ (300 per minute, burst 50), and their JPEG, PNG and still WebP images get the thumbnail, display copy and
9
+ placeholder in the background: `Attachment.processing` now also covers images (`queued` until
10
+ `attachment_updated`).
11
+
5
12
  ## 2.1.0-alpha.53
6
13
 
7
14
  - Documentation: `startChatImport` allows one running import per user (`409` otherwise), and a running import that
package/dist/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- /* Generated from api/openapi.yaml 2.1.0-alpha.53. Do not edit. */
2
- export declare const API_VERSION: "2.1.0-alpha.53";
1
+ /* Generated from api/openapi.yaml 2.1.0-alpha.54. Do not edit. */
2
+ export declare const API_VERSION: "2.1.0-alpha.54";
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.53";
1
+ export const API_VERSION = "2.1.0-alpha.54";
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.53
4
+ version: 2.1.0-alpha.54
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
@@ -1665,6 +1665,11 @@ paths:
1665
1665
  The server checks the content, not the file name or the client's content type. The
1666
1666
  returned `attachment_id` is used in messages (`type: file` or `voice`) or for
1667
1667
  avatars. Attachments that are not used within 24 hours are deleted.
1668
+
1669
+ At most 60 uploads per minute per user (`429` with `Retry-After`). Uploads with the `import_id` of the caller's
1670
+ own running import have their own limit of 300 per minute (burst 50). For them a JPEG, PNG or still WebP
1671
+ image is stored with its metadata removed and its size read from the header; the thumbnail, display copy and
1672
+ placeholder follow in the background (`processing`, then `attachment_updated`).
1668
1673
  requestBody:
1669
1674
  required: true
1670
1675
  content:
@@ -8231,6 +8236,11 @@ components:
8231
8236
  description: |
8232
8237
  `sticker` from a video or GIF: side of the square crop, as a fraction of the shorter side. Send all three
8233
8238
  crop fields or none; the square must lie inside the frame.
8239
+ import_id:
8240
+ description: |
8241
+ `message` uploads of a history import: the id of the caller's own running import. Other ids are ignored
8242
+ (the upload is handled like any other).
8243
+ allOf: [{ $ref: "#/components/schemas/Id" }]
8234
8244
  Attachment:
8235
8245
  type: object
8236
8246
  required: [id, kind, filename, content_type, size, url]
@@ -8267,8 +8277,10 @@ components:
8267
8277
  processing:
8268
8278
  readOnly: true
8269
8279
  description: |
8270
- Whether the server is still making an optimized copy of a video, GIF or audio file. Clients play `url`
8271
- meanwhile and swap to the new copy on `attachment_updated`. `null` when there is nothing to do.
8280
+ Whether the server is still making an optimized copy of a video, GIF or audio file, or the thumbnail,
8281
+ display copy and placeholder of an imported image. Clients play `url` meanwhile (for an image: a neutral
8282
+ placeholder or `url` itself) and swap to the new copy on `attachment_updated`. `null` when there is nothing
8283
+ to do.
8272
8284
  oneOf:
8273
8285
  - $ref: "#/components/schemas/MediaProcessing"
8274
8286
  - type: "null"
package/dist/schema.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- /* Generated from api/openapi.yaml 2.1.0-alpha.53. Do not edit. */
1
+ /* Generated from api/openapi.yaml 2.1.0-alpha.54. Do not edit. */
2
2
  export interface paths {
3
3
  "/meta": {
4
4
  parameters: {
@@ -1510,6 +1510,11 @@ export interface paths {
1510
1510
  * @description The server checks the content, not the file name or the client's content type. The
1511
1511
  * returned `attachment_id` is used in messages (`type: file` or `voice`) or for
1512
1512
  * avatars. Attachments that are not used within 24 hours are deleted.
1513
+ *
1514
+ * At most 60 uploads per minute per user (`429` with `Retry-After`). Uploads with the `import_id` of the caller's
1515
+ * own running import have their own limit of 300 per minute (burst 50). For them a JPEG, PNG or still WebP
1516
+ * image is stored with its metadata removed and its size read from the header; the thumbnail, display copy and
1517
+ * placeholder follow in the background (`processing`, then `attachment_updated`).
1513
1518
  */
1514
1519
  post: operations["uploadAttachment"];
1515
1520
  delete?: never;
@@ -6152,6 +6157,11 @@ export interface components {
6152
6157
  * crop fields or none; the square must lie inside the frame.
6153
6158
  */
6154
6159
  crop_size?: number;
6160
+ /**
6161
+ * @description `message` uploads of a history import: the id of the caller's own running import. Other ids are ignored
6162
+ * (the upload is handled like any other).
6163
+ */
6164
+ import_id?: components["schemas"]["Id"];
6155
6165
  };
6156
6166
  Attachment: {
6157
6167
  id: components["schemas"]["AttachmentRef"];
@@ -6172,8 +6182,10 @@ export interface components {
6172
6182
  /** @description A ThumbHash (base64) of the image or video poster, to draw a blurred preview before the thumbnail arrives. */
6173
6183
  readonly placeholder?: string | null;
6174
6184
  /**
6175
- * @description Whether the server is still making an optimized copy of a video, GIF or audio file. Clients play `url`
6176
- * meanwhile and swap to the new copy on `attachment_updated`. `null` when there is nothing to do.
6185
+ * @description Whether the server is still making an optimized copy of a video, GIF or audio file, or the thumbnail,
6186
+ * display copy and placeholder of an imported image. Clients play `url` meanwhile (for an image: a neutral
6187
+ * placeholder or `url` itself) and swap to the new copy on `attachment_updated`. `null` when there is nothing
6188
+ * to do.
6177
6189
  */
6178
6190
  readonly processing?: components["schemas"]["MediaProcessing"] | null;
6179
6191
  /** @description The file as uploaded, when `url` serves an optimized copy; `null` otherwise. */
@@ -1,4 +1,4 @@
1
- /* Generated from api/openapi.yaml 2.1.0-alpha.53. Do not edit. */
1
+ /* Generated from api/openapi.yaml 2.1.0-alpha.54. Do not edit. */
2
2
 
3
3
  /**
4
4
  * Any WebSocket event, in either direction.
@@ -565,8 +565,10 @@ export interface Attachment {
565
565
  */
566
566
  placeholder?: string | null;
567
567
  /**
568
- * Whether the server is still making an optimized copy of a video, GIF or audio file. Clients play `url`
569
- * meanwhile and swap to the new copy on `attachment_updated`. `null` when there is nothing to do.
568
+ * Whether the server is still making an optimized copy of a video, GIF or audio file, or the thumbnail,
569
+ * display copy and placeholder of an imported image. Clients play `url` meanwhile (for an image: a neutral
570
+ * placeholder or `url` itself) and swap to the new copy on `attachment_updated`. `null` when there is nothing
571
+ * to do.
570
572
  *
571
573
  */
572
574
  processing?: MediaProcessing | null;
@@ -2550,6 +2550,14 @@
2550
2550
  "exclusiveMinimum": 0,
2551
2551
  "maximum": 1,
2552
2552
  "description": "`sticker` from a video or GIF: side of the square crop, as a fraction of the shorter side. Send all three\ncrop fields or none; the square must lie inside the frame.\n"
2553
+ },
2554
+ "import_id": {
2555
+ "description": "`message` uploads of a history import: the id of the caller's own running import. Other ids are ignored\n(the upload is handled like any other).\n",
2556
+ "allOf": [
2557
+ {
2558
+ "$ref": "#/$defs/Id"
2559
+ }
2560
+ ]
2553
2561
  }
2554
2562
  }
2555
2563
  },
@@ -2628,7 +2636,7 @@
2628
2636
  },
2629
2637
  "processing": {
2630
2638
  "readOnly": true,
2631
- "description": "Whether the server is still making an optimized copy of a video, GIF or audio file. Clients play `url`\nmeanwhile and swap to the new copy on `attachment_updated`. `null` when there is nothing to do.\n",
2639
+ "description": "Whether the server is still making an optimized copy of a video, GIF or audio file, or the thumbnail,\ndisplay copy and placeholder of an imported image. Clients play `url` meanwhile (for an image: a neutral\nplaceholder or `url` itself) and swap to the new copy on `attachment_updated`. `null` when there is nothing\nto do.\n",
2632
2640
  "oneOf": [
2633
2641
  {
2634
2642
  "$ref": "#/$defs/MediaProcessing"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@myronsi/messenger-api",
3
- "version": "2.1.0-alpha.53.next.181",
3
+ "version": "2.1.0-alpha.54",
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": {