Update for Lemmy v0.17.3

This commit is contained in:
Elara 2023-06-05 13:30:13 -07:00
parent 86c9270820
commit ab903e62cd
11 changed files with 194 additions and 104 deletions

View File

@ -44,7 +44,7 @@ func main() {
baseStructDir := filepath.Join(*outDir, "types")
sp := parser.NewStruct(nil)
sp.Skip = []string{"LemmyContext"}
sp.Skip = []string{"LemmyContext", "Recipient", "WsMessage", "Connect", "SessionInfo"}
for _, structDir := range structDirs {
dir := filepath.Join(*lemmyDir, structDir)
err := filepath.WalkDir(dir, func(path string, d fs.DirEntry, err error) error {

12
types/captcha.gen.go Normal file
View File

@ -0,0 +1,12 @@
// Source: lemmy/crates/api_common/src/websocket/handlers/captcha.rs
// Code generated by go.elara.ws/go-lemmy/cmd/gen (struct generator). DO NOT EDIT.
package types
type AddCaptcha struct {
Captcha CaptchaItem `json:"captcha" url:"captcha,omitempty"`
}
type CheckCaptcha struct {
Uuid string `json:"uuid" url:"uuid,omitempty"`
Answer string `json:"answer" url:"answer,omitempty"`
}

8
types/connect.gen.go Normal file
View File

@ -0,0 +1,8 @@
// Source: lemmy/crates/api_common/src/websocket/handlers/connect.rs
// Code generated by go.elara.ws/go-lemmy/cmd/gen (struct generator). DO NOT EDIT.
package types
type Disconnect struct {
ID int `json:"id" url:"id,omitempty"`
}

21
types/join_rooms.gen.go Normal file
View File

@ -0,0 +1,21 @@
// Source: lemmy/crates/api_common/src/websocket/handlers/join_rooms.rs
// Code generated by go.elara.ws/go-lemmy/cmd/gen (struct generator). DO NOT EDIT.
package types
type JoinPostRoom struct {
PostID int `json:"post_id" url:"post_id,omitempty"`
ID int `json:"id" url:"id,omitempty"`
}
type JoinCommunityRoom struct {
CommunityID int `json:"community_id" url:"community_id,omitempty"`
ID int `json:"id" url:"id,omitempty"`
}
type JoinModRoom struct {
CommunityID int `json:"community_id" url:"community_id,omitempty"`
ID int `json:"id" url:"id,omitempty"`
}
type JoinUserRoom struct {
UserID int `json:"user_id" url:"user_id,omitempty"`
ID int `json:"id" url:"id,omitempty"`
}

29
types/messages.gen.go Normal file
View File

@ -0,0 +1,29 @@
// Source: lemmy/crates/api_common/src/websocket/handlers/messages.rs
// Code generated by go.elara.ws/go-lemmy/cmd/gen (struct generator). DO NOT EDIT.
package types
type SendPostRoomMessage struct {
PostID int `json:"post_id" url:"post_id,omitempty"`
Message string `json:"message" url:"message,omitempty"`
WebsocketID Optional[int] `json:"websocket_id" url:"websocket_id,omitempty"`
}
type SendCommunityRoomMessage struct {
CommunityID int `json:"community_id" url:"community_id,omitempty"`
Message string `json:"message" url:"message,omitempty"`
WebsocketID Optional[int] `json:"websocket_id" url:"websocket_id,omitempty"`
}
type SendModRoomMessage struct {
CommunityID int `json:"community_id" url:"community_id,omitempty"`
Message string `json:"message" url:"message,omitempty"`
WebsocketID Optional[int] `json:"websocket_id" url:"websocket_id,omitempty"`
}
type SendUserRoomMessage struct {
RecipientID int `json:"recipient_id" url:"recipient_id,omitempty"`
Message string `json:"message" url:"message,omitempty"`
WebsocketID Optional[int] `json:"websocket_id" url:"websocket_id,omitempty"`
}
type SendAllMessage struct {
Message string `json:"message" url:"message,omitempty"`
WebsocketID Optional[int] `json:"websocket_id" url:"websocket_id,omitempty"`
}

View File

@ -1,4 +1,103 @@
// Source: lemmy/crates/db_schema/src/source/mod.rs
// Source: lemmy/crates/api_common/src/websocket/mod.rs
// Code generated by go.elara.ws/go-lemmy/cmd/gen (struct generator). DO NOT EDIT.
package types
type UserOperation string
const (
UserOperationLogin UserOperation = "Login"
UserOperationGetCaptcha UserOperation = "GetCaptcha"
UserOperationSaveComment UserOperation = "SaveComment"
UserOperationCreateCommentLike UserOperation = "CreateCommentLike"
UserOperationCreateCommentReport UserOperation = "CreateCommentReport"
UserOperationResolveCommentReport UserOperation = "ResolveCommentReport"
UserOperationListCommentReports UserOperation = "ListCommentReports"
UserOperationCreatePostLike UserOperation = "CreatePostLike"
UserOperationLockPost UserOperation = "LockPost"
UserOperationFeaturePost UserOperation = "FeaturePost"
UserOperationMarkPostAsRead UserOperation = "MarkPostAsRead"
UserOperationSavePost UserOperation = "SavePost"
UserOperationCreatePostReport UserOperation = "CreatePostReport"
UserOperationResolvePostReport UserOperation = "ResolvePostReport"
UserOperationListPostReports UserOperation = "ListPostReports"
UserOperationGetReportCount UserOperation = "GetReportCount"
UserOperationGetUnreadCount UserOperation = "GetUnreadCount"
UserOperationVerifyEmail UserOperation = "VerifyEmail"
UserOperationFollowCommunity UserOperation = "FollowCommunity"
UserOperationGetReplies UserOperation = "GetReplies"
UserOperationGetPersonMentions UserOperation = "GetPersonMentions"
UserOperationMarkPersonMentionAsRead UserOperation = "MarkPersonMentionAsRead"
UserOperationMarkCommentReplyAsRead UserOperation = "MarkCommentReplyAsRead"
UserOperationGetModlog UserOperation = "GetModlog"
UserOperationBanFromCommunity UserOperation = "BanFromCommunity"
UserOperationAddModToCommunity UserOperation = "AddModToCommunity"
UserOperationAddAdmin UserOperation = "AddAdmin"
UserOperationGetUnreadRegistrationApplicationCount UserOperation = "GetUnreadRegistrationApplicationCount"
UserOperationListRegistrationApplications UserOperation = "ListRegistrationApplications"
UserOperationApproveRegistrationApplication UserOperation = "ApproveRegistrationApplication"
UserOperationBanPerson UserOperation = "BanPerson"
UserOperationGetBannedPersons UserOperation = "GetBannedPersons"
UserOperationMarkAllAsRead UserOperation = "MarkAllAsRead"
UserOperationSaveUserSettings UserOperation = "SaveUserSettings"
UserOperationTransferCommunity UserOperation = "TransferCommunity"
UserOperationLeaveAdmin UserOperation = "LeaveAdmin"
UserOperationPasswordReset UserOperation = "PasswordReset"
UserOperationPasswordChange UserOperation = "PasswordChange"
UserOperationMarkPrivateMessageAsRead UserOperation = "MarkPrivateMessageAsRead"
UserOperationCreatePrivateMessageReport UserOperation = "CreatePrivateMessageReport"
UserOperationResolvePrivateMessageReport UserOperation = "ResolvePrivateMessageReport"
UserOperationListPrivateMessageReports UserOperation = "ListPrivateMessageReports"
UserOperationUserJoin UserOperation = "UserJoin"
UserOperationPostJoin UserOperation = "PostJoin"
UserOperationCommunityJoin UserOperation = "CommunityJoin"
UserOperationModJoin UserOperation = "ModJoin"
UserOperationChangePassword UserOperation = "ChangePassword"
UserOperationGetSiteMetadata UserOperation = "GetSiteMetadata"
UserOperationBlockCommunity UserOperation = "BlockCommunity"
UserOperationBlockPerson UserOperation = "BlockPerson"
UserOperationPurgePerson UserOperation = "PurgePerson"
UserOperationPurgeCommunity UserOperation = "PurgeCommunity"
UserOperationPurgePost UserOperation = "PurgePost"
UserOperationPurgeComment UserOperation = "PurgeComment"
)
type UserOperationCRUD string
const (
UserOperationCRUDCreateSite UserOperationCRUD = "CreateSite"
UserOperationCRUDGetSite UserOperationCRUD = "GetSite"
UserOperationCRUDEditSite UserOperationCRUD = "EditSite"
UserOperationCRUDCreateCommunity UserOperationCRUD = "CreateCommunity"
UserOperationCRUDListCommunities UserOperationCRUD = "ListCommunities"
UserOperationCRUDEditCommunity UserOperationCRUD = "EditCommunity"
UserOperationCRUDDeleteCommunity UserOperationCRUD = "DeleteCommunity"
UserOperationCRUDRemoveCommunity UserOperationCRUD = "RemoveCommunity"
UserOperationCRUDCreatePost UserOperationCRUD = "CreatePost"
UserOperationCRUDGetPost UserOperationCRUD = "GetPost"
UserOperationCRUDEditPost UserOperationCRUD = "EditPost"
UserOperationCRUDDeletePost UserOperationCRUD = "DeletePost"
UserOperationCRUDRemovePost UserOperationCRUD = "RemovePost"
UserOperationCRUDCreateComment UserOperationCRUD = "CreateComment"
UserOperationCRUDGetComment UserOperationCRUD = "GetComment"
UserOperationCRUDEditComment UserOperationCRUD = "EditComment"
UserOperationCRUDDeleteComment UserOperationCRUD = "DeleteComment"
UserOperationCRUDRemoveComment UserOperationCRUD = "RemoveComment"
UserOperationCRUDRegister UserOperationCRUD = "Register"
UserOperationCRUDDeleteAccount UserOperationCRUD = "DeleteAccount"
UserOperationCRUDCreatePrivateMessage UserOperationCRUD = "CreatePrivateMessage"
UserOperationCRUDGetPrivateMessages UserOperationCRUD = "GetPrivateMessages"
UserOperationCRUDEditPrivateMessage UserOperationCRUD = "EditPrivateMessage"
UserOperationCRUDDeletePrivateMessage UserOperationCRUD = "DeletePrivateMessage"
)
type UserOperationApub string
const (
UserOperationApubGetPosts UserOperationApub = "GetPosts"
UserOperationApubGetCommunity UserOperationApub = "GetCommunity"
UserOperationApubGetComments UserOperationApub = "GetComments"
UserOperationApubGetPersonDetails UserOperationApub = "GetPersonDetails"
UserOperationApubSearch UserOperationApub = "Search"
UserOperationApubResolveObject UserOperationApub = "ResolveObject"
)

View File

@ -1,4 +1,4 @@
// Source: lemmy/crates/api_common/src/websocket/handlers.rs
// Source: lemmy/crates/db_schema/src/source/mod.rs
// Code generated by go.elara.ws/go-lemmy/cmd/gen (struct generator). DO NOT EDIT.
package types

View File

@ -1,103 +1,4 @@
// Source: lemmy/crates/api_common/src/websocket/mod.rs
// Source: lemmy/crates/api_common/src/websocket/handlers/mod.rs
// Code generated by go.elara.ws/go-lemmy/cmd/gen (struct generator). DO NOT EDIT.
package types
type UserOperation string
const (
UserOperationLogin UserOperation = "Login"
UserOperationGetCaptcha UserOperation = "GetCaptcha"
UserOperationSaveComment UserOperation = "SaveComment"
UserOperationCreateCommentLike UserOperation = "CreateCommentLike"
UserOperationCreateCommentReport UserOperation = "CreateCommentReport"
UserOperationResolveCommentReport UserOperation = "ResolveCommentReport"
UserOperationListCommentReports UserOperation = "ListCommentReports"
UserOperationCreatePostLike UserOperation = "CreatePostLike"
UserOperationLockPost UserOperation = "LockPost"
UserOperationFeaturePost UserOperation = "FeaturePost"
UserOperationMarkPostAsRead UserOperation = "MarkPostAsRead"
UserOperationSavePost UserOperation = "SavePost"
UserOperationCreatePostReport UserOperation = "CreatePostReport"
UserOperationResolvePostReport UserOperation = "ResolvePostReport"
UserOperationListPostReports UserOperation = "ListPostReports"
UserOperationGetReportCount UserOperation = "GetReportCount"
UserOperationGetUnreadCount UserOperation = "GetUnreadCount"
UserOperationVerifyEmail UserOperation = "VerifyEmail"
UserOperationFollowCommunity UserOperation = "FollowCommunity"
UserOperationGetReplies UserOperation = "GetReplies"
UserOperationGetPersonMentions UserOperation = "GetPersonMentions"
UserOperationMarkPersonMentionAsRead UserOperation = "MarkPersonMentionAsRead"
UserOperationMarkCommentReplyAsRead UserOperation = "MarkCommentReplyAsRead"
UserOperationGetModlog UserOperation = "GetModlog"
UserOperationBanFromCommunity UserOperation = "BanFromCommunity"
UserOperationAddModToCommunity UserOperation = "AddModToCommunity"
UserOperationAddAdmin UserOperation = "AddAdmin"
UserOperationGetUnreadRegistrationApplicationCount UserOperation = "GetUnreadRegistrationApplicationCount"
UserOperationListRegistrationApplications UserOperation = "ListRegistrationApplications"
UserOperationApproveRegistrationApplication UserOperation = "ApproveRegistrationApplication"
UserOperationBanPerson UserOperation = "BanPerson"
UserOperationGetBannedPersons UserOperation = "GetBannedPersons"
UserOperationMarkAllAsRead UserOperation = "MarkAllAsRead"
UserOperationSaveUserSettings UserOperation = "SaveUserSettings"
UserOperationTransferCommunity UserOperation = "TransferCommunity"
UserOperationLeaveAdmin UserOperation = "LeaveAdmin"
UserOperationPasswordReset UserOperation = "PasswordReset"
UserOperationPasswordChange UserOperation = "PasswordChange"
UserOperationMarkPrivateMessageAsRead UserOperation = "MarkPrivateMessageAsRead"
UserOperationCreatePrivateMessageReport UserOperation = "CreatePrivateMessageReport"
UserOperationResolvePrivateMessageReport UserOperation = "ResolvePrivateMessageReport"
UserOperationListPrivateMessageReports UserOperation = "ListPrivateMessageReports"
UserOperationUserJoin UserOperation = "UserJoin"
UserOperationPostJoin UserOperation = "PostJoin"
UserOperationCommunityJoin UserOperation = "CommunityJoin"
UserOperationModJoin UserOperation = "ModJoin"
UserOperationChangePassword UserOperation = "ChangePassword"
UserOperationGetSiteMetadata UserOperation = "GetSiteMetadata"
UserOperationBlockCommunity UserOperation = "BlockCommunity"
UserOperationBlockPerson UserOperation = "BlockPerson"
UserOperationPurgePerson UserOperation = "PurgePerson"
UserOperationPurgeCommunity UserOperation = "PurgeCommunity"
UserOperationPurgePost UserOperation = "PurgePost"
UserOperationPurgeComment UserOperation = "PurgeComment"
)
type UserOperationCRUD string
const (
UserOperationCRUDCreateSite UserOperationCRUD = "CreateSite"
UserOperationCRUDGetSite UserOperationCRUD = "GetSite"
UserOperationCRUDEditSite UserOperationCRUD = "EditSite"
UserOperationCRUDCreateCommunity UserOperationCRUD = "CreateCommunity"
UserOperationCRUDListCommunities UserOperationCRUD = "ListCommunities"
UserOperationCRUDEditCommunity UserOperationCRUD = "EditCommunity"
UserOperationCRUDDeleteCommunity UserOperationCRUD = "DeleteCommunity"
UserOperationCRUDRemoveCommunity UserOperationCRUD = "RemoveCommunity"
UserOperationCRUDCreatePost UserOperationCRUD = "CreatePost"
UserOperationCRUDGetPost UserOperationCRUD = "GetPost"
UserOperationCRUDEditPost UserOperationCRUD = "EditPost"
UserOperationCRUDDeletePost UserOperationCRUD = "DeletePost"
UserOperationCRUDRemovePost UserOperationCRUD = "RemovePost"
UserOperationCRUDCreateComment UserOperationCRUD = "CreateComment"
UserOperationCRUDGetComment UserOperationCRUD = "GetComment"
UserOperationCRUDEditComment UserOperationCRUD = "EditComment"
UserOperationCRUDDeleteComment UserOperationCRUD = "DeleteComment"
UserOperationCRUDRemoveComment UserOperationCRUD = "RemoveComment"
UserOperationCRUDRegister UserOperationCRUD = "Register"
UserOperationCRUDDeleteAccount UserOperationCRUD = "DeleteAccount"
UserOperationCRUDCreatePrivateMessage UserOperationCRUD = "CreatePrivateMessage"
UserOperationCRUDGetPrivateMessages UserOperationCRUD = "GetPrivateMessages"
UserOperationCRUDEditPrivateMessage UserOperationCRUD = "EditPrivateMessage"
UserOperationCRUDDeletePrivateMessage UserOperationCRUD = "DeletePrivateMessage"
)
type UserOperationApub string
const (
UserOperationApubGetPosts UserOperationApub = "GetPosts"
UserOperationApubGetCommunity UserOperationApub = "GetCommunity"
UserOperationApubGetComments UserOperationApub = "GetComments"
UserOperationApubGetPersonDetails UserOperationApub = "GetPersonDetails"
UserOperationApubSearch UserOperationApub = "Search"
UserOperationApubResolveObject UserOperationApub = "ResolveObject"
)

11
types/online_users.gen.go Normal file
View File

@ -0,0 +1,11 @@
// Source: lemmy/crates/api_common/src/websocket/handlers/online_users.rs
// Code generated by go.elara.ws/go-lemmy/cmd/gen (struct generator). DO NOT EDIT.
package types
type GetPostUsersOnline struct {
PostID int `json:"post_id" url:"post_id,omitempty"`
}
type GetCommunityUsersOnline struct {
CommunityID int `json:"community_id" url:"community_id,omitempty"`
}

View File

@ -18,7 +18,9 @@ type Register struct {
Honeypot Optional[string] `json:"honeypot" url:"honeypot,omitempty"`
Answer Optional[string] `json:"answer" url:"answer,omitempty"`
}
type GetCaptcha struct{}
type GetCaptcha struct {
Auth Optional[string] `json:"auth" url:"auth,omitempty"`
}
type GetCaptchaResponse struct {
Ok Optional[CaptchaResponse] `json:"ok" url:"ok,omitempty"`
LemmyResponse

View File

@ -167,6 +167,13 @@ type GetSiteResponse struct {
Taglines Optional[[]Tagline] `json:"taglines" url:"taglines,omitempty"`
LemmyResponse
}
type GetFederatedInstances struct {
Auth Optional[string] `json:"auth" url:"auth,omitempty"`
}
type GetFederatedInstancesResponse struct {
FederatedInstances Optional[FederatedInstances] `json:"federated_instances" url:"federated_instances,omitempty"`
LemmyResponse
}
type MyUserInfo struct {
LocalUserView LocalUserSettingsView `json:"local_user_view" url:"local_user_view,omitempty"`
Follows []CommunityFollowerView `json:"follows" url:"follows,omitempty"`