@myronsi/messenger-api 2.0.0-alpha.7.next.49 → 2.0.0-alpha.8.next.50

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.0.0-alpha.8
6
+
7
+ Found by validating every response of the backend's HTTP tests against this contract:
8
+
9
+ - `GET /attachments/{attachment_id}/content` and `GET /users/{user_id}/avatar` list `206` (byte ranges), `304`
10
+ (`ETag`) and `416`; the attachment download also its `302` to a signed URL.
11
+ - `POST /ws/ticket` answers `201`, as listed (the server sent `200`).
12
+ - The conventions name the statuses any operation may answer: `413`, `415`, `500`, `503`.
13
+
5
14
  ## 2.0.0-alpha.7
6
15
 
7
16
  Search:
package/dist/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- /* Generated from api/openapi.yaml 2.0.0-alpha.7. Do not edit. */
2
- export declare const API_VERSION: "2.0.0-alpha.7";
1
+ /* Generated from api/openapi.yaml 2.0.0-alpha.8. Do not edit. */
2
+ export declare const API_VERSION: "2.0.0-alpha.8";
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.0.0-alpha.7";
1
+ export const API_VERSION = "2.0.0-alpha.8";
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.0.0-alpha.7
4
+ version: 2.0.0-alpha.8
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
@@ -25,6 +25,10 @@ info:
25
25
  `min_client_api_version` gets `426` with `code: client_outdated`.
26
26
  - Files are never referenced by a client-supplied URL: upload with `POST /attachments`,
27
27
  then refer to the returned `attachment_id`.
28
+ - Statuses any operation may answer, not repeated per operation: `413` (body over the size
29
+ limit, `payload_too_large`) and `415` (a body that is not `application/json`,
30
+ `unsupported_media_type`) for operations with a body; `500` (a bug) and `503` (a store is
31
+ away; retry after `Retry-After`) for all.
28
32
  license:
29
33
  name: MIT
30
34
  identifier: MIT
@@ -744,6 +748,15 @@ paths:
744
748
  content:
745
749
  image/*:
746
750
  schema: { type: string, format: binary }
751
+ "206":
752
+ description: The requested byte range (`Range` header)
753
+ content:
754
+ image/*:
755
+ schema: { type: string, format: binary }
756
+ "304":
757
+ description: Not modified (`If-None-Match` with the `ETag` of an earlier answer)
758
+ "416":
759
+ description: The requested range is outside the file
747
760
  "401": { $ref: "#/components/responses/Unauthorized" }
748
761
  "404": { $ref: "#/components/responses/NotFound" }
749
762
  /users/{user_id}/avatars:
@@ -872,6 +885,17 @@ paths:
872
885
  content:
873
886
  application/octet-stream:
874
887
  schema: { type: string, format: binary }
888
+ "206":
889
+ description: The requested byte range (`Range` header); players use it to seek
890
+ content:
891
+ application/octet-stream:
892
+ schema: { type: string, format: binary }
893
+ "304":
894
+ description: Not modified (`If-None-Match` with the `ETag` of an earlier answer)
895
+ "416":
896
+ description: The requested range is outside the file
897
+ "302":
898
+ description: Redirect to a short-lived signed URL of object storage (`MEDIA_SIGNED_URLS`); not cached
875
899
  "401": { $ref: "#/components/responses/Unauthorized" }
876
900
  "403": { $ref: "#/components/responses/Forbidden" }
877
901
  "404": { $ref: "#/components/responses/NotFound" }
package/dist/schema.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- /* Generated from api/openapi.yaml 2.0.0-alpha.7. Do not edit. */
1
+ /* Generated from api/openapi.yaml 2.0.0-alpha.8. Do not edit. */
2
2
  export interface paths {
3
3
  "/meta": {
4
4
  parameters: {
@@ -2803,9 +2803,32 @@ export interface operations {
2803
2803
  "image/*": string;
2804
2804
  };
2805
2805
  };
2806
+ /** @description The requested byte range (`Range` header) */
2807
+ 206: {
2808
+ headers: {
2809
+ [name: string]: unknown;
2810
+ };
2811
+ content: {
2812
+ "image/*": string;
2813
+ };
2814
+ };
2815
+ /** @description Not modified (`If-None-Match` with the `ETag` of an earlier answer) */
2816
+ 304: {
2817
+ headers: {
2818
+ [name: string]: unknown;
2819
+ };
2820
+ content?: never;
2821
+ };
2806
2822
  400: components["responses"]["BadRequest"];
2807
2823
  401: components["responses"]["Unauthorized"];
2808
2824
  404: components["responses"]["NotFound"];
2825
+ /** @description The requested range is outside the file */
2826
+ 416: {
2827
+ headers: {
2828
+ [name: string]: unknown;
2829
+ };
2830
+ content?: never;
2831
+ };
2809
2832
  426: components["responses"]["ClientOutdated"];
2810
2833
  };
2811
2834
  };
@@ -2976,10 +2999,40 @@ export interface operations {
2976
2999
  "application/octet-stream": string;
2977
3000
  };
2978
3001
  };
3002
+ /** @description The requested byte range (`Range` header); players use it to seek */
3003
+ 206: {
3004
+ headers: {
3005
+ [name: string]: unknown;
3006
+ };
3007
+ content: {
3008
+ "application/octet-stream": string;
3009
+ };
3010
+ };
3011
+ /** @description Redirect to a short-lived signed URL of object storage (`MEDIA_SIGNED_URLS`); not cached */
3012
+ 302: {
3013
+ headers: {
3014
+ [name: string]: unknown;
3015
+ };
3016
+ content?: never;
3017
+ };
3018
+ /** @description Not modified (`If-None-Match` with the `ETag` of an earlier answer) */
3019
+ 304: {
3020
+ headers: {
3021
+ [name: string]: unknown;
3022
+ };
3023
+ content?: never;
3024
+ };
2979
3025
  400: components["responses"]["BadRequest"];
2980
3026
  401: components["responses"]["Unauthorized"];
2981
3027
  403: components["responses"]["Forbidden"];
2982
3028
  404: components["responses"]["NotFound"];
3029
+ /** @description The requested range is outside the file */
3030
+ 416: {
3031
+ headers: {
3032
+ [name: string]: unknown;
3033
+ };
3034
+ content?: never;
3035
+ };
2983
3036
  426: components["responses"]["ClientOutdated"];
2984
3037
  };
2985
3038
  };
@@ -1,4 +1,4 @@
1
- /* Generated from api/openapi.yaml 2.0.0-alpha.7. Do not edit. */
1
+ /* Generated from api/openapi.yaml 2.0.0-alpha.8. Do not edit. */
2
2
 
3
3
  /**
4
4
  * Any WebSocket event, in either direction.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@myronsi/messenger-api",
3
- "version": "2.0.0-alpha.7.next.49",
3
+ "version": "2.0.0-alpha.8.next.50",
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": {