Skip to content
This repository was archived by the owner on Jan 2, 2026. It is now read-only.

Commit c4698c6

Browse files
committed
feat: add abuse and contact endpoints
1 parent f0d11c0 commit c4698c6

File tree

1 file changed

+55
-0
lines changed

1 file changed

+55
-0
lines changed

polyproto/core/routes/main.tsp

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ namespace polyproto.core;
2727
enum Version {
2828
`v1.0-beta.3`,
2929
`v1.0-beta.4`,
30+
`v1.0-beta.5`,
3031
}
3132

3233
/**
@@ -39,3 +40,57 @@ op gatewayUrl(): {
3940
@body _: url;
4041
@statusCode statusCode: 200;
4142
};
43+
44+
@doc("""
45+
This actor either does not exist on this home server (anymore), or the actor is not from this home server.
46+
""")
47+
model BadReport {
48+
...BadRequestResponse;
49+
}
50+
51+
/**
52+
* File an abuse report for an actor that is misbehaving either on this home server or on other
53+
* home servers/service servers.
54+
*/
55+
@route("/abuse")
56+
@added(Version.`v1.0-beta.5`)
57+
@summary("File an abuse report - Report an Actor")
58+
@post
59+
op reportAbuseFid(
60+
@body _b: {
61+
@doc("Federation ID of the reported actor")
62+
fid: string;
63+
64+
@doc("Information about why this actor was reported.")
65+
reportText: string;
66+
67+
@doc("This endpoint requires you to identify by completing a key trial.")
68+
keyTrial: polyproto.core.models.KeyTrialCompleted;
69+
},
70+
): {
71+
@statusCode _: 200;
72+
73+
@example(#{
74+
message: "Thank you for filing a report. Instance moderators will be in touch shortly.",
75+
})
76+
@body
77+
_b: {
78+
@doc("An optional message from the home server")
79+
message?: string;
80+
};
81+
} | BadReport;
82+
83+
/**
84+
* Retrieve contact information for this home server. May include an `adminAccount` federation ID,
85+
* if this instance supports some form of text message exchange and such an account exists.
86+
*/
87+
@get
88+
@summary("Retrieve contact information")
89+
@route("/contact")
90+
op getContactInfo(): {
91+
@statusCode _s: 200;
92+
@body _b: {
93+
adminAccount?: string;
94+
mail: string;
95+
};
96+
};

0 commit comments

Comments
 (0)