@myronsi/messenger-api 2.1.0-alpha.29.next.113 → 2.1.0-alpha.30

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,18 @@
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.30
6
+
7
+ - Connected accounts (`Connection`, `ConnectionList`, `ConnectionProvider`): `GET /me/connections`,
8
+ `PUT /me/connections/order`, `DELETE /me/connections/{connection_id}` and `GET /users/{user_id}/connections`
9
+ (visible like the bio). At most 15 per user.
10
+ - Providers that sign the user in: `POST /me/connections/{provider}/start` returns a `redirect_url`; the provider
11
+ sends the browser back to `GET /connections/callback/{provider}`, which redirects to the web app with `provider` and
12
+ `result`.
13
+ - Bluesky, Mastodon and websites: `POST /me/connections/{provider}/claim` returns a code to publish,
14
+ `POST /me/connections/{provider}/verify` checks it.
15
+ - `Meta` gains the required `connection_providers`: the providers this server offers.
16
+
5
17
  ## 2.1.0-alpha.29
6
18
 
7
19
  - `User` gains the required `pronouns`, `birthday` (`Birthday`: day, month, optional year), `music`
package/dist/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- /* Generated from api/openapi.yaml 2.1.0-alpha.29. Do not edit. */
2
- export declare const API_VERSION: "2.1.0-alpha.29";
1
+ /* Generated from api/openapi.yaml 2.1.0-alpha.30. Do not edit. */
2
+ export declare const API_VERSION: "2.1.0-alpha.30";
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.29";
1
+ export const API_VERSION = "2.1.0-alpha.30";
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.29
4
+ version: 2.1.0-alpha.30
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
@@ -854,6 +854,190 @@ paths:
854
854
  "401": { $ref: "#/components/responses/Unauthorized" }
855
855
  "404": { $ref: "#/components/responses/NotFound" }
856
856
  "429": { $ref: "#/components/responses/TooManyRequests" }
857
+ /me/connections:
858
+ parameters:
859
+ - $ref: "#/components/parameters/ClientVersion"
860
+ - $ref: "#/components/parameters/ClientApiVersion"
861
+ get:
862
+ tags: [me]
863
+ operationId: listMyConnections
864
+ summary: Your connected accounts
865
+ description: In your order. At most 15.
866
+ responses:
867
+ "426": { $ref: "#/components/responses/ClientOutdated" }
868
+ "200":
869
+ description: Connected accounts
870
+ content:
871
+ application/json:
872
+ schema: { $ref: "#/components/schemas/ConnectionList" }
873
+ "401": { $ref: "#/components/responses/Unauthorized" }
874
+ /me/connections/order:
875
+ parameters:
876
+ - $ref: "#/components/parameters/ClientVersion"
877
+ - $ref: "#/components/parameters/ClientApiVersion"
878
+ put:
879
+ tags: [me]
880
+ operationId: reorderMyConnections
881
+ summary: Order your connected accounts
882
+ description: "`ids` must name every connected account once (`422` otherwise)."
883
+ requestBody:
884
+ required: true
885
+ content:
886
+ application/json:
887
+ schema: { $ref: "#/components/schemas/ConnectionOrderRequest" }
888
+ responses:
889
+ "426": { $ref: "#/components/responses/ClientOutdated" }
890
+ "200":
891
+ description: Connected accounts in the new order
892
+ content:
893
+ application/json:
894
+ schema: { $ref: "#/components/schemas/ConnectionList" }
895
+ "400": { $ref: "#/components/responses/BadRequest" }
896
+ "401": { $ref: "#/components/responses/Unauthorized" }
897
+ "422": { $ref: "#/components/responses/ValidationFailed" }
898
+ /me/connections/{connection_id}:
899
+ parameters:
900
+ - $ref: "#/components/parameters/ClientVersion"
901
+ - $ref: "#/components/parameters/ClientApiVersion"
902
+ - name: connection_id
903
+ in: path
904
+ required: true
905
+ schema: { $ref: "#/components/schemas/Id" }
906
+ delete:
907
+ tags: [me]
908
+ operationId: deleteMyConnection
909
+ summary: Remove a connected account
910
+ responses:
911
+ "426": { $ref: "#/components/responses/ClientOutdated" }
912
+ "204":
913
+ description: Removed
914
+ "400": { $ref: "#/components/responses/BadRequest" }
915
+ "401": { $ref: "#/components/responses/Unauthorized" }
916
+ "404": { $ref: "#/components/responses/NotFound" }
917
+ /me/connections/{provider}/start:
918
+ parameters:
919
+ - $ref: "#/components/parameters/ClientVersion"
920
+ - $ref: "#/components/parameters/ClientApiVersion"
921
+ - $ref: "#/components/parameters/ConnectionProviderPath"
922
+ post:
923
+ tags: [me]
924
+ operationId: startConnection
925
+ summary: Start connecting an account at a provider that signs you in
926
+ description: |
927
+ For the providers that sign the user in (GitHub, Spotify, Steam, Xbox, Discord, Twitch, YouTube, Reddit,
928
+ Roblox, TikTok). Send the browser to `redirect_url`; it comes back through `GET /connections/callback/{provider}`,
929
+ which ends on the web app with `?provider=` and `result=` (`connected`, `denied`, `failed`, `limit`). The link
930
+ is valid for 10 minutes. `404` when the provider is not enabled on this server, `422` for a provider that is
931
+ verified with `claim` and `verify` instead.
932
+ responses:
933
+ "426": { $ref: "#/components/responses/ClientOutdated" }
934
+ "200":
935
+ description: Where to send the browser
936
+ content:
937
+ application/json:
938
+ schema: { $ref: "#/components/schemas/ConnectionStart" }
939
+ "401": { $ref: "#/components/responses/Unauthorized" }
940
+ "404": { $ref: "#/components/responses/NotFound" }
941
+ "409": { $ref: "#/components/responses/Conflict" }
942
+ "422": { $ref: "#/components/responses/ValidationFailed" }
943
+ "429": { $ref: "#/components/responses/TooManyRequests" }
944
+ /me/connections/{provider}/claim:
945
+ parameters:
946
+ - $ref: "#/components/parameters/ClientVersion"
947
+ - $ref: "#/components/parameters/ClientApiVersion"
948
+ - $ref: "#/components/parameters/ConnectionProviderPath"
949
+ post:
950
+ tags: [me]
951
+ operationId: claimConnection
952
+ summary: Start verifying a Bluesky handle, a Mastodon account or a website
953
+ description: |
954
+ Returns a code the user puts where only the owner can: the Bluesky profile description, the Mastodon bio
955
+ or a profile field, or for a website a DNS TXT record on the domain or a
956
+ `<meta name="messenger-verification" content="...">` tag on its home page. Then call `verify` within an
957
+ hour. A new claim replaces the previous one for the same provider.
958
+ requestBody:
959
+ required: true
960
+ content:
961
+ application/json:
962
+ schema: { $ref: "#/components/schemas/ConnectionClaimRequest" }
963
+ responses:
964
+ "426": { $ref: "#/components/responses/ClientOutdated" }
965
+ "200":
966
+ description: The code to publish
967
+ content:
968
+ application/json:
969
+ schema: { $ref: "#/components/schemas/ConnectionChallenge" }
970
+ "400": { $ref: "#/components/responses/BadRequest" }
971
+ "401": { $ref: "#/components/responses/Unauthorized" }
972
+ "404": { $ref: "#/components/responses/NotFound" }
973
+ "409": { $ref: "#/components/responses/Conflict" }
974
+ "422": { $ref: "#/components/responses/ValidationFailed" }
975
+ "429": { $ref: "#/components/responses/TooManyRequests" }
976
+ /me/connections/{provider}/verify:
977
+ parameters:
978
+ - $ref: "#/components/parameters/ClientVersion"
979
+ - $ref: "#/components/parameters/ClientApiVersion"
980
+ - $ref: "#/components/parameters/ConnectionProviderPath"
981
+ post:
982
+ tags: [me]
983
+ operationId: verifyConnection
984
+ summary: Check the published code and connect the account
985
+ description: "`422` when there is no open claim or the code was not found; the claim stays open until it expires."
986
+ responses:
987
+ "426": { $ref: "#/components/responses/ClientOutdated" }
988
+ "201":
989
+ description: Connected
990
+ content:
991
+ application/json:
992
+ schema: { $ref: "#/components/schemas/Connection" }
993
+ "401": { $ref: "#/components/responses/Unauthorized" }
994
+ "404": { $ref: "#/components/responses/NotFound" }
995
+ "409": { $ref: "#/components/responses/Conflict" }
996
+ "422": { $ref: "#/components/responses/ValidationFailed" }
997
+ "429": { $ref: "#/components/responses/TooManyRequests" }
998
+ /connections/callback/{provider}:
999
+ parameters:
1000
+ - $ref: "#/components/parameters/ConnectionProviderPath"
1001
+ get:
1002
+ tags: [me]
1003
+ operationId: connectionCallback
1004
+ summary: Where a provider sends the browser back
1005
+ description: |
1006
+ No authentication: the one-time `state` from `start` names the user. Always answers with a redirect to the
1007
+ web app (`?provider=` and `result=`).
1008
+ security: []
1009
+ responses:
1010
+ "302":
1011
+ description: Back to the web app
1012
+ headers:
1013
+ Location:
1014
+ schema: { type: string }
1015
+ "400": { $ref: "#/components/responses/BadRequest" }
1016
+ /users/{user_id}/connections:
1017
+ parameters:
1018
+ - $ref: "#/components/parameters/ClientVersion"
1019
+ - $ref: "#/components/parameters/ClientApiVersion"
1020
+ - name: user_id
1021
+ in: path
1022
+ required: true
1023
+ schema: { $ref: "#/components/schemas/Id" }
1024
+ get:
1025
+ tags: [users]
1026
+ operationId: listUserConnections
1027
+ summary: A user's connected accounts
1028
+ description: Visible like the bio (`profile_visibility`); empty when hidden.
1029
+ responses:
1030
+ "426": { $ref: "#/components/responses/ClientOutdated" }
1031
+ "304":
1032
+ description: Not modified; the response's `ETag` matches `If-None-Match`.
1033
+ "200":
1034
+ description: Connected accounts
1035
+ content:
1036
+ application/json:
1037
+ schema: { $ref: "#/components/schemas/ConnectionList" }
1038
+ "400": { $ref: "#/components/responses/BadRequest" }
1039
+ "401": { $ref: "#/components/responses/Unauthorized" }
1040
+ "404": { $ref: "#/components/responses/NotFound" }
857
1041
  /users/{user_id}/common-groups:
858
1042
  parameters:
859
1043
  - $ref: "#/components/parameters/ClientVersion"
@@ -4414,6 +4598,11 @@ components:
4414
4598
  schema: { type: string }
4415
4599
 
4416
4600
  parameters:
4601
+ ConnectionProviderPath:
4602
+ name: provider
4603
+ in: path
4604
+ required: true
4605
+ schema: { $ref: "#/components/schemas/ConnectionProvider" }
4417
4606
  QrLoginRequestId:
4418
4607
  name: requestId
4419
4608
  in: path
@@ -4774,12 +4963,76 @@ components:
4774
4963
  additionalProperties: true
4775
4964
  Meta:
4776
4965
  type: object
4777
- required: [backend_version, commit, api_version, min_client_api_version]
4966
+ required: [backend_version, commit, api_version, min_client_api_version, connection_providers]
4778
4967
  properties:
4779
4968
  backend_version: { type: string, examples: ["1.0.3"] }
4780
4969
  commit: { type: string, examples: ["abc1234"] }
4781
4970
  api_version: { type: string, examples: ["2.0.0"] }
4782
4971
  min_client_api_version: { type: string, examples: ["2.0.0"] }
4972
+ connection_providers:
4973
+ type: array
4974
+ description: The connected-account providers this server offers.
4975
+ items: { $ref: "#/components/schemas/ConnectionProvider" }
4976
+ ConnectionProvider:
4977
+ type: string
4978
+ description: |
4979
+ Providers that sign the user in: `github`, `spotify`, `steam`, `xbox`, `discord`, `twitch`, `youtube`,
4980
+ `reddit`, `roblox`, `tiktok`. Verified with a published code: `bluesky`, `mastodon`, `website`. Clients show a generic
4981
+ icon for a provider they do not know.
4982
+ enum: [github, spotify, steam, xbox, discord, twitch, youtube, reddit, roblox, tiktok, bluesky, mastodon, website]
4983
+ Connection:
4984
+ type: object
4985
+ required: [id, provider, display_name, profile_url, verified_at]
4986
+ properties:
4987
+ id: { $ref: "#/components/schemas/Id" }
4988
+ provider: { $ref: "#/components/schemas/ConnectionProvider" }
4989
+ display_name: { type: string, minLength: 1, maxLength: 100 }
4990
+ profile_url:
4991
+ type: [string, "null"]
4992
+ description: The public https page of the account; `null` when the provider has none.
4993
+ verified_at: { $ref: "#/components/schemas/Timestamp" }
4994
+ ConnectionList:
4995
+ type: object
4996
+ required: [items]
4997
+ properties:
4998
+ items:
4999
+ type: array
5000
+ maxItems: 15
5001
+ items: { $ref: "#/components/schemas/Connection" }
5002
+ ConnectionOrderRequest:
5003
+ type: object
5004
+ required: [ids]
5005
+ properties:
5006
+ ids:
5007
+ type: array
5008
+ maxItems: 15
5009
+ uniqueItems: true
5010
+ items: { $ref: "#/components/schemas/Id" }
5011
+ ConnectionStart:
5012
+ type: object
5013
+ required: [redirect_url]
5014
+ properties:
5015
+ redirect_url: { type: string }
5016
+ ConnectionClaimRequest:
5017
+ type: object
5018
+ required: [identifier]
5019
+ properties:
5020
+ identifier:
5021
+ type: string
5022
+ minLength: 1
5023
+ maxLength: 300
5024
+ description: "A Bluesky handle (`alice.bsky.social`), a Mastodon account (`@alice@mastodon.social` or its URL), or a domain or URL."
5025
+ ConnectionChallenge:
5026
+ type: object
5027
+ required: [identifier, code, expires_at]
5028
+ properties:
5029
+ identifier:
5030
+ type: string
5031
+ description: The account or domain as the server understood it.
5032
+ code:
5033
+ type: string
5034
+ description: The text to publish, such as `messenger-verify=ab12cd34ef56gh78`.
5035
+ expires_at: { $ref: "#/components/schemas/Timestamp" }
4783
5036
 
4784
5037
  # ------------------------------------------------------------ auth
4785
5038
  RegisterRequest:
package/dist/schema.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- /* Generated from api/openapi.yaml 2.1.0-alpha.29. Do not edit. */
1
+ /* Generated from api/openapi.yaml 2.1.0-alpha.30. Do not edit. */
2
2
  export interface paths {
3
3
  "/meta": {
4
4
  parameters: {
@@ -677,6 +677,218 @@ export interface paths {
677
677
  patch?: never;
678
678
  trace?: never;
679
679
  };
680
+ "/me/connections": {
681
+ parameters: {
682
+ query?: never;
683
+ header?: {
684
+ /** @description Version of the client app, for logs and the per-client metric. */
685
+ "X-Client-Version"?: components["parameters"]["ClientVersion"];
686
+ /** @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`). */
687
+ "X-Client-Api-Version"?: components["parameters"]["ClientApiVersion"];
688
+ };
689
+ path?: never;
690
+ cookie?: never;
691
+ };
692
+ /**
693
+ * Your connected accounts
694
+ * @description In your order. At most 15.
695
+ */
696
+ get: operations["listMyConnections"];
697
+ put?: never;
698
+ post?: never;
699
+ delete?: never;
700
+ options?: never;
701
+ head?: never;
702
+ patch?: never;
703
+ trace?: never;
704
+ };
705
+ "/me/connections/order": {
706
+ parameters: {
707
+ query?: never;
708
+ header?: {
709
+ /** @description Version of the client app, for logs and the per-client metric. */
710
+ "X-Client-Version"?: components["parameters"]["ClientVersion"];
711
+ /** @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`). */
712
+ "X-Client-Api-Version"?: components["parameters"]["ClientApiVersion"];
713
+ };
714
+ path?: never;
715
+ cookie?: never;
716
+ };
717
+ get?: never;
718
+ /**
719
+ * Order your connected accounts
720
+ * @description `ids` must name every connected account once (`422` otherwise).
721
+ */
722
+ put: operations["reorderMyConnections"];
723
+ post?: never;
724
+ delete?: never;
725
+ options?: never;
726
+ head?: never;
727
+ patch?: never;
728
+ trace?: never;
729
+ };
730
+ "/me/connections/{connection_id}": {
731
+ parameters: {
732
+ query?: never;
733
+ header?: {
734
+ /** @description Version of the client app, for logs and the per-client metric. */
735
+ "X-Client-Version"?: components["parameters"]["ClientVersion"];
736
+ /** @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`). */
737
+ "X-Client-Api-Version"?: components["parameters"]["ClientApiVersion"];
738
+ };
739
+ path: {
740
+ connection_id: components["schemas"]["Id"];
741
+ };
742
+ cookie?: never;
743
+ };
744
+ get?: never;
745
+ put?: never;
746
+ post?: never;
747
+ /** Remove a connected account */
748
+ delete: operations["deleteMyConnection"];
749
+ options?: never;
750
+ head?: never;
751
+ patch?: never;
752
+ trace?: never;
753
+ };
754
+ "/me/connections/{provider}/start": {
755
+ parameters: {
756
+ query?: never;
757
+ header?: {
758
+ /** @description Version of the client app, for logs and the per-client metric. */
759
+ "X-Client-Version"?: components["parameters"]["ClientVersion"];
760
+ /** @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`). */
761
+ "X-Client-Api-Version"?: components["parameters"]["ClientApiVersion"];
762
+ };
763
+ path: {
764
+ provider: components["parameters"]["ConnectionProviderPath"];
765
+ };
766
+ cookie?: never;
767
+ };
768
+ get?: never;
769
+ put?: never;
770
+ /**
771
+ * Start connecting an account at a provider that signs you in
772
+ * @description For the providers that sign the user in (GitHub, Spotify, Steam, Xbox, Discord, Twitch, YouTube, Reddit,
773
+ * Roblox, TikTok). Send the browser to `redirect_url`; it comes back through `GET /connections/callback/{provider}`,
774
+ * which ends on the web app with `?provider=` and `result=` (`connected`, `denied`, `failed`, `limit`). The link
775
+ * is valid for 10 minutes. `404` when the provider is not enabled on this server, `422` for a provider that is
776
+ * verified with `claim` and `verify` instead.
777
+ */
778
+ post: operations["startConnection"];
779
+ delete?: never;
780
+ options?: never;
781
+ head?: never;
782
+ patch?: never;
783
+ trace?: never;
784
+ };
785
+ "/me/connections/{provider}/claim": {
786
+ parameters: {
787
+ query?: never;
788
+ header?: {
789
+ /** @description Version of the client app, for logs and the per-client metric. */
790
+ "X-Client-Version"?: components["parameters"]["ClientVersion"];
791
+ /** @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`). */
792
+ "X-Client-Api-Version"?: components["parameters"]["ClientApiVersion"];
793
+ };
794
+ path: {
795
+ provider: components["parameters"]["ConnectionProviderPath"];
796
+ };
797
+ cookie?: never;
798
+ };
799
+ get?: never;
800
+ put?: never;
801
+ /**
802
+ * Start verifying a Bluesky handle, a Mastodon account or a website
803
+ * @description Returns a code the user puts where only the owner can: the Bluesky profile description, the Mastodon bio
804
+ * or a profile field, or for a website a DNS TXT record on the domain or a
805
+ * `<meta name="messenger-verification" content="...">` tag on its home page. Then call `verify` within an
806
+ * hour. A new claim replaces the previous one for the same provider.
807
+ */
808
+ post: operations["claimConnection"];
809
+ delete?: never;
810
+ options?: never;
811
+ head?: never;
812
+ patch?: never;
813
+ trace?: never;
814
+ };
815
+ "/me/connections/{provider}/verify": {
816
+ parameters: {
817
+ query?: never;
818
+ header?: {
819
+ /** @description Version of the client app, for logs and the per-client metric. */
820
+ "X-Client-Version"?: components["parameters"]["ClientVersion"];
821
+ /** @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`). */
822
+ "X-Client-Api-Version"?: components["parameters"]["ClientApiVersion"];
823
+ };
824
+ path: {
825
+ provider: components["parameters"]["ConnectionProviderPath"];
826
+ };
827
+ cookie?: never;
828
+ };
829
+ get?: never;
830
+ put?: never;
831
+ /**
832
+ * Check the published code and connect the account
833
+ * @description `422` when there is no open claim or the code was not found; the claim stays open until it expires.
834
+ */
835
+ post: operations["verifyConnection"];
836
+ delete?: never;
837
+ options?: never;
838
+ head?: never;
839
+ patch?: never;
840
+ trace?: never;
841
+ };
842
+ "/connections/callback/{provider}": {
843
+ parameters: {
844
+ query?: never;
845
+ header?: never;
846
+ path: {
847
+ provider: components["parameters"]["ConnectionProviderPath"];
848
+ };
849
+ cookie?: never;
850
+ };
851
+ /**
852
+ * Where a provider sends the browser back
853
+ * @description No authentication: the one-time `state` from `start` names the user. Always answers with a redirect to the
854
+ * web app (`?provider=` and `result=`).
855
+ */
856
+ get: operations["connectionCallback"];
857
+ put?: never;
858
+ post?: never;
859
+ delete?: never;
860
+ options?: never;
861
+ head?: never;
862
+ patch?: never;
863
+ trace?: never;
864
+ };
865
+ "/users/{user_id}/connections": {
866
+ parameters: {
867
+ query?: never;
868
+ header?: {
869
+ /** @description Version of the client app, for logs and the per-client metric. */
870
+ "X-Client-Version"?: components["parameters"]["ClientVersion"];
871
+ /** @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`). */
872
+ "X-Client-Api-Version"?: components["parameters"]["ClientApiVersion"];
873
+ };
874
+ path: {
875
+ user_id: components["schemas"]["Id"];
876
+ };
877
+ cookie?: never;
878
+ };
879
+ /**
880
+ * A user's connected accounts
881
+ * @description Visible like the bio (`profile_visibility`); empty when hidden.
882
+ */
883
+ get: operations["listUserConnections"];
884
+ put?: never;
885
+ post?: never;
886
+ delete?: never;
887
+ options?: never;
888
+ head?: never;
889
+ patch?: never;
890
+ trace?: never;
891
+ };
680
892
  "/users/{user_id}/common-groups": {
681
893
  parameters: {
682
894
  query?: never;
@@ -3173,6 +3385,43 @@ export interface components {
3173
3385
  api_version: string;
3174
3386
  /** @example 2.0.0 */
3175
3387
  min_client_api_version: string;
3388
+ /** @description The connected-account providers this server offers. */
3389
+ connection_providers: components["schemas"]["ConnectionProvider"][];
3390
+ };
3391
+ /**
3392
+ * @description Providers that sign the user in: `github`, `spotify`, `steam`, `xbox`, `discord`, `twitch`, `youtube`,
3393
+ * `reddit`, `roblox`, `tiktok`. Verified with a published code: `bluesky`, `mastodon`, `website`. Clients show a generic
3394
+ * icon for a provider they do not know.
3395
+ * @enum {string}
3396
+ */
3397
+ ConnectionProvider: "github" | "spotify" | "steam" | "xbox" | "discord" | "twitch" | "youtube" | "reddit" | "roblox" | "tiktok" | "bluesky" | "mastodon" | "website";
3398
+ Connection: {
3399
+ id: components["schemas"]["Id"];
3400
+ provider: components["schemas"]["ConnectionProvider"];
3401
+ display_name: string;
3402
+ /** @description The public https page of the account; `null` when the provider has none. */
3403
+ profile_url: string | null;
3404
+ verified_at: components["schemas"]["Timestamp"];
3405
+ };
3406
+ ConnectionList: {
3407
+ items: components["schemas"]["Connection"][];
3408
+ };
3409
+ ConnectionOrderRequest: {
3410
+ ids: components["schemas"]["Id"][];
3411
+ };
3412
+ ConnectionStart: {
3413
+ redirect_url: string;
3414
+ };
3415
+ ConnectionClaimRequest: {
3416
+ /** @description A Bluesky handle (`alice.bsky.social`), a Mastodon account (`@alice@mastodon.social` or its URL), or a domain or URL. */
3417
+ identifier: string;
3418
+ };
3419
+ ConnectionChallenge: {
3420
+ /** @description The account or domain as the server understood it. */
3421
+ identifier: string;
3422
+ /** @description The text to publish, such as `messenger-verify=ab12cd34ef56gh78`. */
3423
+ code: string;
3424
+ expires_at: components["schemas"]["Timestamp"];
3176
3425
  };
3177
3426
  RegisterRequest: {
3178
3427
  username: components["schemas"]["Username"];
@@ -4343,6 +4592,7 @@ export interface components {
4343
4592
  };
4344
4593
  };
4345
4594
  parameters: {
4595
+ ConnectionProviderPath: components["schemas"]["ConnectionProvider"];
4346
4596
  /** @description ID of a QR sign-in request, from the QR code link `/qr/<request_id>`. */
4347
4597
  QrLoginRequestId: string;
4348
4598
  /** @description Page size */
@@ -5542,6 +5792,259 @@ export interface operations {
5542
5792
  429: components["responses"]["TooManyRequests"];
5543
5793
  };
5544
5794
  };
5795
+ listMyConnections: {
5796
+ parameters: {
5797
+ query?: never;
5798
+ header?: {
5799
+ /** @description Version of the client app, for logs and the per-client metric. */
5800
+ "X-Client-Version"?: components["parameters"]["ClientVersion"];
5801
+ /** @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`). */
5802
+ "X-Client-Api-Version"?: components["parameters"]["ClientApiVersion"];
5803
+ };
5804
+ path?: never;
5805
+ cookie?: never;
5806
+ };
5807
+ requestBody?: never;
5808
+ responses: {
5809
+ /** @description Connected accounts */
5810
+ 200: {
5811
+ headers: {
5812
+ [name: string]: unknown;
5813
+ };
5814
+ content: {
5815
+ "application/json": components["schemas"]["ConnectionList"];
5816
+ };
5817
+ };
5818
+ 401: components["responses"]["Unauthorized"];
5819
+ 426: components["responses"]["ClientOutdated"];
5820
+ };
5821
+ };
5822
+ reorderMyConnections: {
5823
+ parameters: {
5824
+ query?: never;
5825
+ header?: {
5826
+ /** @description Version of the client app, for logs and the per-client metric. */
5827
+ "X-Client-Version"?: components["parameters"]["ClientVersion"];
5828
+ /** @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`). */
5829
+ "X-Client-Api-Version"?: components["parameters"]["ClientApiVersion"];
5830
+ };
5831
+ path?: never;
5832
+ cookie?: never;
5833
+ };
5834
+ requestBody: {
5835
+ content: {
5836
+ "application/json": components["schemas"]["ConnectionOrderRequest"];
5837
+ };
5838
+ };
5839
+ responses: {
5840
+ /** @description Connected accounts in the new order */
5841
+ 200: {
5842
+ headers: {
5843
+ [name: string]: unknown;
5844
+ };
5845
+ content: {
5846
+ "application/json": components["schemas"]["ConnectionList"];
5847
+ };
5848
+ };
5849
+ 400: components["responses"]["BadRequest"];
5850
+ 401: components["responses"]["Unauthorized"];
5851
+ 422: components["responses"]["ValidationFailed"];
5852
+ 426: components["responses"]["ClientOutdated"];
5853
+ };
5854
+ };
5855
+ deleteMyConnection: {
5856
+ parameters: {
5857
+ query?: never;
5858
+ header?: {
5859
+ /** @description Version of the client app, for logs and the per-client metric. */
5860
+ "X-Client-Version"?: components["parameters"]["ClientVersion"];
5861
+ /** @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`). */
5862
+ "X-Client-Api-Version"?: components["parameters"]["ClientApiVersion"];
5863
+ };
5864
+ path: {
5865
+ connection_id: components["schemas"]["Id"];
5866
+ };
5867
+ cookie?: never;
5868
+ };
5869
+ requestBody?: never;
5870
+ responses: {
5871
+ /** @description Removed */
5872
+ 204: {
5873
+ headers: {
5874
+ [name: string]: unknown;
5875
+ };
5876
+ content?: never;
5877
+ };
5878
+ 400: components["responses"]["BadRequest"];
5879
+ 401: components["responses"]["Unauthorized"];
5880
+ 404: components["responses"]["NotFound"];
5881
+ 426: components["responses"]["ClientOutdated"];
5882
+ };
5883
+ };
5884
+ startConnection: {
5885
+ parameters: {
5886
+ query?: never;
5887
+ header?: {
5888
+ /** @description Version of the client app, for logs and the per-client metric. */
5889
+ "X-Client-Version"?: components["parameters"]["ClientVersion"];
5890
+ /** @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`). */
5891
+ "X-Client-Api-Version"?: components["parameters"]["ClientApiVersion"];
5892
+ };
5893
+ path: {
5894
+ provider: components["parameters"]["ConnectionProviderPath"];
5895
+ };
5896
+ cookie?: never;
5897
+ };
5898
+ requestBody?: never;
5899
+ responses: {
5900
+ /** @description Where to send the browser */
5901
+ 200: {
5902
+ headers: {
5903
+ [name: string]: unknown;
5904
+ };
5905
+ content: {
5906
+ "application/json": components["schemas"]["ConnectionStart"];
5907
+ };
5908
+ };
5909
+ 401: components["responses"]["Unauthorized"];
5910
+ 404: components["responses"]["NotFound"];
5911
+ 409: components["responses"]["Conflict"];
5912
+ 422: components["responses"]["ValidationFailed"];
5913
+ 426: components["responses"]["ClientOutdated"];
5914
+ 429: components["responses"]["TooManyRequests"];
5915
+ };
5916
+ };
5917
+ claimConnection: {
5918
+ parameters: {
5919
+ query?: never;
5920
+ header?: {
5921
+ /** @description Version of the client app, for logs and the per-client metric. */
5922
+ "X-Client-Version"?: components["parameters"]["ClientVersion"];
5923
+ /** @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`). */
5924
+ "X-Client-Api-Version"?: components["parameters"]["ClientApiVersion"];
5925
+ };
5926
+ path: {
5927
+ provider: components["parameters"]["ConnectionProviderPath"];
5928
+ };
5929
+ cookie?: never;
5930
+ };
5931
+ requestBody: {
5932
+ content: {
5933
+ "application/json": components["schemas"]["ConnectionClaimRequest"];
5934
+ };
5935
+ };
5936
+ responses: {
5937
+ /** @description The code to publish */
5938
+ 200: {
5939
+ headers: {
5940
+ [name: string]: unknown;
5941
+ };
5942
+ content: {
5943
+ "application/json": components["schemas"]["ConnectionChallenge"];
5944
+ };
5945
+ };
5946
+ 400: components["responses"]["BadRequest"];
5947
+ 401: components["responses"]["Unauthorized"];
5948
+ 404: components["responses"]["NotFound"];
5949
+ 409: components["responses"]["Conflict"];
5950
+ 422: components["responses"]["ValidationFailed"];
5951
+ 426: components["responses"]["ClientOutdated"];
5952
+ 429: components["responses"]["TooManyRequests"];
5953
+ };
5954
+ };
5955
+ verifyConnection: {
5956
+ parameters: {
5957
+ query?: never;
5958
+ header?: {
5959
+ /** @description Version of the client app, for logs and the per-client metric. */
5960
+ "X-Client-Version"?: components["parameters"]["ClientVersion"];
5961
+ /** @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`). */
5962
+ "X-Client-Api-Version"?: components["parameters"]["ClientApiVersion"];
5963
+ };
5964
+ path: {
5965
+ provider: components["parameters"]["ConnectionProviderPath"];
5966
+ };
5967
+ cookie?: never;
5968
+ };
5969
+ requestBody?: never;
5970
+ responses: {
5971
+ /** @description Connected */
5972
+ 201: {
5973
+ headers: {
5974
+ [name: string]: unknown;
5975
+ };
5976
+ content: {
5977
+ "application/json": components["schemas"]["Connection"];
5978
+ };
5979
+ };
5980
+ 401: components["responses"]["Unauthorized"];
5981
+ 404: components["responses"]["NotFound"];
5982
+ 409: components["responses"]["Conflict"];
5983
+ 422: components["responses"]["ValidationFailed"];
5984
+ 426: components["responses"]["ClientOutdated"];
5985
+ 429: components["responses"]["TooManyRequests"];
5986
+ };
5987
+ };
5988
+ connectionCallback: {
5989
+ parameters: {
5990
+ query?: never;
5991
+ header?: never;
5992
+ path: {
5993
+ provider: components["parameters"]["ConnectionProviderPath"];
5994
+ };
5995
+ cookie?: never;
5996
+ };
5997
+ requestBody?: never;
5998
+ responses: {
5999
+ /** @description Back to the web app */
6000
+ 302: {
6001
+ headers: {
6002
+ Location?: string;
6003
+ [name: string]: unknown;
6004
+ };
6005
+ content?: never;
6006
+ };
6007
+ 400: components["responses"]["BadRequest"];
6008
+ };
6009
+ };
6010
+ listUserConnections: {
6011
+ parameters: {
6012
+ query?: never;
6013
+ header?: {
6014
+ /** @description Version of the client app, for logs and the per-client metric. */
6015
+ "X-Client-Version"?: components["parameters"]["ClientVersion"];
6016
+ /** @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`). */
6017
+ "X-Client-Api-Version"?: components["parameters"]["ClientApiVersion"];
6018
+ };
6019
+ path: {
6020
+ user_id: components["schemas"]["Id"];
6021
+ };
6022
+ cookie?: never;
6023
+ };
6024
+ requestBody?: never;
6025
+ responses: {
6026
+ /** @description Connected accounts */
6027
+ 200: {
6028
+ headers: {
6029
+ [name: string]: unknown;
6030
+ };
6031
+ content: {
6032
+ "application/json": components["schemas"]["ConnectionList"];
6033
+ };
6034
+ };
6035
+ /** @description Not modified; the response's `ETag` matches `If-None-Match`. */
6036
+ 304: {
6037
+ headers: {
6038
+ [name: string]: unknown;
6039
+ };
6040
+ content?: never;
6041
+ };
6042
+ 400: components["responses"]["BadRequest"];
6043
+ 401: components["responses"]["Unauthorized"];
6044
+ 404: components["responses"]["NotFound"];
6045
+ 426: components["responses"]["ClientOutdated"];
6046
+ };
6047
+ };
5545
6048
  listCommonGroups: {
5546
6049
  parameters: {
5547
6050
  query?: {
@@ -1,4 +1,4 @@
1
- /* Generated from api/openapi.yaml 2.1.0-alpha.29. Do not edit. */
1
+ /* Generated from api/openapi.yaml 2.1.0-alpha.30. Do not edit. */
2
2
 
3
3
  /**
4
4
  * Any WebSocket event, in either direction.
@@ -288,7 +288,8 @@
288
288
  "backend_version",
289
289
  "commit",
290
290
  "api_version",
291
- "min_client_api_version"
291
+ "min_client_api_version",
292
+ "connection_providers"
292
293
  ],
293
294
  "properties": {
294
295
  "backend_version": {
@@ -314,6 +315,142 @@
314
315
  "examples": [
315
316
  "2.0.0"
316
317
  ]
318
+ },
319
+ "connection_providers": {
320
+ "type": "array",
321
+ "description": "The connected-account providers this server offers.",
322
+ "items": {
323
+ "$ref": "#/$defs/ConnectionProvider"
324
+ }
325
+ }
326
+ }
327
+ },
328
+ "ConnectionProvider": {
329
+ "type": "string",
330
+ "description": "Providers that sign the user in: `github`, `spotify`, `steam`, `xbox`, `discord`, `twitch`, `youtube`,\n`reddit`, `roblox`, `tiktok`. Verified with a published code: `bluesky`, `mastodon`, `website`. Clients show a generic\nicon for a provider they do not know.\n",
331
+ "enum": [
332
+ "github",
333
+ "spotify",
334
+ "steam",
335
+ "xbox",
336
+ "discord",
337
+ "twitch",
338
+ "youtube",
339
+ "reddit",
340
+ "roblox",
341
+ "tiktok",
342
+ "bluesky",
343
+ "mastodon",
344
+ "website"
345
+ ]
346
+ },
347
+ "Connection": {
348
+ "type": "object",
349
+ "required": [
350
+ "id",
351
+ "provider",
352
+ "display_name",
353
+ "profile_url",
354
+ "verified_at"
355
+ ],
356
+ "properties": {
357
+ "id": {
358
+ "$ref": "#/$defs/Id"
359
+ },
360
+ "provider": {
361
+ "$ref": "#/$defs/ConnectionProvider"
362
+ },
363
+ "display_name": {
364
+ "type": "string",
365
+ "minLength": 1,
366
+ "maxLength": 100
367
+ },
368
+ "profile_url": {
369
+ "type": [
370
+ "string",
371
+ "null"
372
+ ],
373
+ "description": "The public https page of the account; `null` when the provider has none."
374
+ },
375
+ "verified_at": {
376
+ "$ref": "#/$defs/Timestamp"
377
+ }
378
+ }
379
+ },
380
+ "ConnectionList": {
381
+ "type": "object",
382
+ "required": [
383
+ "items"
384
+ ],
385
+ "properties": {
386
+ "items": {
387
+ "type": "array",
388
+ "maxItems": 15,
389
+ "items": {
390
+ "$ref": "#/$defs/Connection"
391
+ }
392
+ }
393
+ }
394
+ },
395
+ "ConnectionOrderRequest": {
396
+ "type": "object",
397
+ "required": [
398
+ "ids"
399
+ ],
400
+ "properties": {
401
+ "ids": {
402
+ "type": "array",
403
+ "maxItems": 15,
404
+ "uniqueItems": true,
405
+ "items": {
406
+ "$ref": "#/$defs/Id"
407
+ }
408
+ }
409
+ }
410
+ },
411
+ "ConnectionStart": {
412
+ "type": "object",
413
+ "required": [
414
+ "redirect_url"
415
+ ],
416
+ "properties": {
417
+ "redirect_url": {
418
+ "type": "string"
419
+ }
420
+ }
421
+ },
422
+ "ConnectionClaimRequest": {
423
+ "type": "object",
424
+ "required": [
425
+ "identifier"
426
+ ],
427
+ "properties": {
428
+ "identifier": {
429
+ "type": "string",
430
+ "minLength": 1,
431
+ "maxLength": 300,
432
+ "description": "A Bluesky handle (`alice.bsky.social`), a Mastodon account (`@alice@mastodon.social` or its URL), or a domain or URL."
433
+ }
434
+ }
435
+ },
436
+ "ConnectionChallenge": {
437
+ "type": "object",
438
+ "required": [
439
+ "identifier",
440
+ "code",
441
+ "expires_at"
442
+ ],
443
+ "properties": {
444
+ "identifier": {
445
+ "type": "string",
446
+ "description": "The account or domain as the server understood it."
447
+ },
448
+ "code": {
449
+ "type": "string",
450
+ "description": "The text to publish, such as `messenger-verify=ab12cd34ef56gh78`."
451
+ },
452
+ "expires_at": {
453
+ "$ref": "#/$defs/Timestamp"
317
454
  }
318
455
  }
319
456
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@myronsi/messenger-api",
3
- "version": "2.1.0-alpha.29.next.113",
3
+ "version": "2.1.0-alpha.30",
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": {