@myronsi/messenger-api 2.0.0-alpha.4.next.44 → 2.0.0-alpha.5.next.46
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 +10 -0
- package/dist/index.d.ts +2 -2
- package/dist/index.js +1 -1
- package/dist/openapi.yaml +16 -4
- package/dist/schema.d.ts +17 -5
- package/dist/ws-events.d.ts +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,16 @@
|
|
|
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.5
|
|
6
|
+
|
|
7
|
+
Chats, found while implementing the chat list:
|
|
8
|
+
|
|
9
|
+
- `DELETE /chats/{chat_id}` deletes a direct chat for both users (as v1 did), not "for yourself"; a group is `422`.
|
|
10
|
+
- `POST /chats` can answer `422` (a chat with yourself, a too long `initial_message`).
|
|
11
|
+
- `PUT /chats/{chat_id}/pin`: at most 10 pinned chats (`409`).
|
|
12
|
+
- `GET /chats` documents its order, what `last_message` and its `read_by` hold, and that `unread_count` stops at 999.
|
|
13
|
+
- `DELETE /me` can answer `429` (repeated wrong passwords).
|
|
14
|
+
|
|
5
15
|
## 2.0.0-alpha.4
|
|
6
16
|
|
|
7
17
|
Media, found while implementing uploads:
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* Generated from api/openapi.yaml 2.0.0-alpha.
|
|
2
|
-
export declare const API_VERSION: "2.0.0-alpha.
|
|
1
|
+
/* Generated from api/openapi.yaml 2.0.0-alpha.5. Do not edit. */
|
|
2
|
+
export declare const API_VERSION: "2.0.0-alpha.5";
|
|
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.
|
|
1
|
+
export const API_VERSION = "2.0.0-alpha.5";
|
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.
|
|
4
|
+
version: 2.0.0-alpha.5
|
|
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
|
|
@@ -324,6 +324,7 @@ paths:
|
|
|
324
324
|
description: Account deleted
|
|
325
325
|
"401": { $ref: "#/components/responses/Unauthorized" }
|
|
326
326
|
"403": { $ref: "#/components/responses/Forbidden" }
|
|
327
|
+
"429": { $ref: "#/components/responses/TooManyRequests" }
|
|
327
328
|
/me/avatar:
|
|
328
329
|
parameters:
|
|
329
330
|
- $ref: "#/components/parameters/ClientVersion"
|
|
@@ -884,7 +885,12 @@ paths:
|
|
|
884
885
|
tags: [chats]
|
|
885
886
|
operationId: listChats
|
|
886
887
|
summary: My chats with last message and unread count
|
|
887
|
-
description:
|
|
888
|
+
description: |
|
|
889
|
+
One request replaces `GET /chats/list/{username}` and `GET /groups/list/{username}`.
|
|
890
|
+
Pinned chats come first (most recently pinned first), then the others by their last
|
|
891
|
+
message (newest first). `last_message` is the newest message the caller can see; in
|
|
892
|
+
direct chats its `read_by` holds the other user once they read it (with read receipts
|
|
893
|
+
on), in groups it is empty. `unread_count` stops at 999.
|
|
888
894
|
parameters:
|
|
889
895
|
- $ref: "#/components/parameters/Limit"
|
|
890
896
|
- $ref: "#/components/parameters/After"
|
|
@@ -931,6 +937,7 @@ paths:
|
|
|
931
937
|
"401": { $ref: "#/components/responses/Unauthorized" }
|
|
932
938
|
"403": { $ref: "#/components/responses/Forbidden" }
|
|
933
939
|
"404": { $ref: "#/components/responses/NotFound" }
|
|
940
|
+
"422": { $ref: "#/components/responses/ValidationFailed" }
|
|
934
941
|
"429": { $ref: "#/components/responses/TooManyRequests" }
|
|
935
942
|
/chats/{chat_id}:
|
|
936
943
|
parameters:
|
|
@@ -954,8 +961,11 @@ paths:
|
|
|
954
961
|
delete:
|
|
955
962
|
tags: [chats]
|
|
956
963
|
operationId: deleteChat
|
|
957
|
-
summary: Delete a direct chat
|
|
958
|
-
description:
|
|
964
|
+
summary: Delete a direct chat
|
|
965
|
+
description: |
|
|
966
|
+
Deletes the chat and its messages for both users (as v1 did); both get `chat_deleted`.
|
|
967
|
+
For groups use `DELETE /groups/{chat_id}` (owner) or `POST /groups/{chat_id}/leave`;
|
|
968
|
+
a group here is `422`.
|
|
959
969
|
responses:
|
|
960
970
|
"426": { $ref: "#/components/responses/ClientOutdated" }
|
|
961
971
|
"400": { $ref: "#/components/responses/BadRequest" }
|
|
@@ -963,6 +973,7 @@ paths:
|
|
|
963
973
|
description: Deleted
|
|
964
974
|
"401": { $ref: "#/components/responses/Unauthorized" }
|
|
965
975
|
"404": { $ref: "#/components/responses/NotFound" }
|
|
976
|
+
"422": { $ref: "#/components/responses/ValidationFailed" }
|
|
966
977
|
/chats/{chat_id}/pin:
|
|
967
978
|
parameters:
|
|
968
979
|
- $ref: "#/components/parameters/ClientVersion"
|
|
@@ -972,6 +983,7 @@ paths:
|
|
|
972
983
|
tags: [chats]
|
|
973
984
|
operationId: pinChat
|
|
974
985
|
summary: Pin a chat
|
|
986
|
+
description: At most 10 chats can be pinned (`409` beyond that). Pinning a pinned chat changes nothing.
|
|
975
987
|
responses:
|
|
976
988
|
"426": { $ref: "#/components/responses/ClientOutdated" }
|
|
977
989
|
"400": { $ref: "#/components/responses/BadRequest" }
|
package/dist/schema.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* Generated from api/openapi.yaml 2.0.0-alpha.
|
|
1
|
+
/* Generated from api/openapi.yaml 2.0.0-alpha.5. Do not edit. */
|
|
2
2
|
export interface paths {
|
|
3
3
|
"/meta": {
|
|
4
4
|
parameters: {
|
|
@@ -746,7 +746,11 @@ export interface paths {
|
|
|
746
746
|
};
|
|
747
747
|
/**
|
|
748
748
|
* My chats with last message and unread count
|
|
749
|
-
* @description One request replaces `GET /chats/list/{username}` and `GET /groups/list/{username}
|
|
749
|
+
* @description One request replaces `GET /chats/list/{username}` and `GET /groups/list/{username}`.
|
|
750
|
+
* Pinned chats come first (most recently pinned first), then the others by their last
|
|
751
|
+
* message (newest first). `last_message` is the newest message the caller can see; in
|
|
752
|
+
* direct chats its `read_by` holds the other user once they read it (with read receipts
|
|
753
|
+
* on), in groups it is empty. `unread_count` stops at 999.
|
|
750
754
|
*/
|
|
751
755
|
get: operations["listChats"];
|
|
752
756
|
put?: never;
|
|
@@ -782,8 +786,10 @@ export interface paths {
|
|
|
782
786
|
put?: never;
|
|
783
787
|
post?: never;
|
|
784
788
|
/**
|
|
785
|
-
* Delete a direct chat
|
|
786
|
-
* @description
|
|
789
|
+
* Delete a direct chat
|
|
790
|
+
* @description Deletes the chat and its messages for both users (as v1 did); both get `chat_deleted`.
|
|
791
|
+
* For groups use `DELETE /groups/{chat_id}` (owner) or `POST /groups/{chat_id}/leave`;
|
|
792
|
+
* a group here is `422`.
|
|
787
793
|
*/
|
|
788
794
|
delete: operations["deleteChat"];
|
|
789
795
|
options?: never;
|
|
@@ -806,7 +812,10 @@ export interface paths {
|
|
|
806
812
|
cookie?: never;
|
|
807
813
|
};
|
|
808
814
|
get?: never;
|
|
809
|
-
/**
|
|
815
|
+
/**
|
|
816
|
+
* Pin a chat
|
|
817
|
+
* @description At most 10 chats can be pinned (`409` beyond that). Pinning a pinned chat changes nothing.
|
|
818
|
+
*/
|
|
810
819
|
put: operations["pinChat"];
|
|
811
820
|
post?: never;
|
|
812
821
|
/** Unpin a chat */
|
|
@@ -2090,6 +2099,7 @@ export interface operations {
|
|
|
2090
2099
|
401: components["responses"]["Unauthorized"];
|
|
2091
2100
|
403: components["responses"]["Forbidden"];
|
|
2092
2101
|
426: components["responses"]["ClientOutdated"];
|
|
2102
|
+
429: components["responses"]["TooManyRequests"];
|
|
2093
2103
|
};
|
|
2094
2104
|
};
|
|
2095
2105
|
updateMe: {
|
|
@@ -3014,6 +3024,7 @@ export interface operations {
|
|
|
3014
3024
|
401: components["responses"]["Unauthorized"];
|
|
3015
3025
|
403: components["responses"]["Forbidden"];
|
|
3016
3026
|
404: components["responses"]["NotFound"];
|
|
3027
|
+
422: components["responses"]["ValidationFailed"];
|
|
3017
3028
|
426: components["responses"]["ClientOutdated"];
|
|
3018
3029
|
429: components["responses"]["TooManyRequests"];
|
|
3019
3030
|
};
|
|
@@ -3075,6 +3086,7 @@ export interface operations {
|
|
|
3075
3086
|
400: components["responses"]["BadRequest"];
|
|
3076
3087
|
401: components["responses"]["Unauthorized"];
|
|
3077
3088
|
404: components["responses"]["NotFound"];
|
|
3089
|
+
422: components["responses"]["ValidationFailed"];
|
|
3078
3090
|
426: components["responses"]["ClientOutdated"];
|
|
3079
3091
|
};
|
|
3080
3092
|
};
|
package/dist/ws-events.d.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@myronsi/messenger-api",
|
|
3
|
-
"version": "2.0.0-alpha.
|
|
3
|
+
"version": "2.0.0-alpha.5.next.46",
|
|
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": {
|