Skip to content

Commit

Permalink
Fix remaining incompatibilities
Browse files Browse the repository at this point in the history
  • Loading branch information
emilymclean committed Jun 7, 2024
1 parent f64e99a commit b046fd5
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 4 deletions.
30 changes: 30 additions & 0 deletions src/main/java/cl/emilym/jlemmy/LemmyApi.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,15 @@
import java.util.List;

public interface LemmyApi {
@GET("/site")
Call<GetSiteResponse> getSite();

@POST("/site")
Call<SiteResponse> createSite(CreateSite request);

@PUT("/site")
Call<SiteResponse> editSite(EditSite request);

@POST("/user/leave_admin")
Call<GetSiteResponse> leaveAdmin();

Expand Down Expand Up @@ -40,6 +46,9 @@ public interface LemmyApi {
@GET("/modlog")
Call<GetModlogResponse> getModlog(GetModlog request);

@GET("/search")
Call<SearchResponse> search(Search request);

@GET("/resolve_object")
Call<ResolveObjectResponse> resolveObject(ResolveObject request);

Expand Down Expand Up @@ -82,6 +91,12 @@ public interface LemmyApi {
@POST("/post")
Call<PostResponse> createPost(CreatePost request);

@GET("/post")
Call<GetPostResponse> getPost(GetPost request);

@PUT("/post")
Call<PostResponse> editPost(EditPost request);

@POST("/post/delete")
Call<PostResponse> deletePost(DeletePost request);

Expand Down Expand Up @@ -181,6 +196,15 @@ public interface LemmyApi {
@POST("/private_message/mark_as_read")
Call<PrivateMessageResponse> markPrivateMessageAsRead(MarkPrivateMessageAsRead request);

@POST("/private_message/report")
Call<PrivateMessageReportResponse> createPrivateMessageReport(CreatePrivateMessageReport request);

@PUT("/private_message/report/resolve")
Call<PrivateMessageReportResponse> resolvePrivateMessageReport(ResolvePrivateMessageReport request);

@GET("/private_message/report/list")
Call<ListPrivateMessageReportsResponse> listPrivateMessageReports(ListPrivateMessageReports request);

@POST("/user/register")
Call<LoginResponse> register(Register request);

Expand Down Expand Up @@ -247,6 +271,12 @@ public interface LemmyApi {
@GET("/admin/registration_application/count")
Call<GetUnreadRegistrationApplicationCountResponse> getUnreadRegistrationApplicationCount();

@GET("/admin/registration_application/list")
Call<ListRegistrationApplicationsResponse> listRegistrationApplications(ListRegistrationApplications request);

@PUT("/admin/registration_application/approve")
Call<RegistrationApplicationResponse> approveRegistrationApplication(ApproveRegistrationApplication request);

@POST("/admin/purge/person")
Call<SuccessResponse> purgePerson(PurgePerson request);

Expand Down
1 change: 0 additions & 1 deletion type-generator/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ def generate_types():

def parse_model(model_contents: str) -> Optional[Tuple[str, str]]:
tree = parser.parse(bytes(model_contents, "utf-8"))
print(tree.root_node.sexp())
if "export type" in model_contents:
visitor = EnumVisitor(tree)
result = visitor.build()
Expand Down
1 change: 0 additions & 1 deletion type-generator/src/generator/retrofit_generator.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import textwrap
from datetime import datetime, timezone
from typing import List

from ..models import Property, ApiMethod, HttpMethod
Expand Down
3 changes: 1 addition & 2 deletions type-generator/src/visitor/http_visitor.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@ def visit_method_definition(self, node: Node):
name = node.child_by_field_name("name").text.decode(self._encoding)
if name in [
"constructor",
"getSite",
"#buildFullUrl",
"#wrapper",
"#fetchFunction",
Expand All @@ -79,7 +78,7 @@ def visit_type_arguments(self, node: Node):
self._current_output = normalize_type(node.children[3].text.decode(self._encoding))

def visit_arguments(self, node: Node):
if node.child_count != 8:
if self._current_name is None:
return

ts_http_method = node.children[1].text.decode(self._encoding)
Expand Down

0 comments on commit b046fd5

Please sign in to comment.