Adding diesel SortType and ListingType enums. (#112)

* Adding diesel SortType and ListingType enums.

* v0.17.2-rc.6

* Remove comment.
This commit is contained in:
Dessalines 2023-04-17 19:12:56 -04:00 committed by GitHub
parent 533e222a0c
commit cfc1dcf0f4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 117 additions and 111 deletions

View file

@ -1,6 +1,6 @@
{ {
"name": "lemmy-js-client", "name": "lemmy-js-client",
"version": "0.17.2-rc.5", "version": "0.17.2-rc.6",
"description": "A javascript / typescript client for Lemmy", "description": "A javascript / typescript client for Lemmy",
"repository": "https://github.com/LemmyNet/lemmy-js-client", "repository": "https://github.com/LemmyNet/lemmy-js-client",
"license": "AGPL-3.0", "license": "AGPL-3.0",

View file

@ -1,10 +1,6 @@
import { ListingType, SortType } from "../others"; import { ListingType, SortType } from "../others";
import { Site } from "../source"; import { Site } from "../source";
import { import { CommunityModeratorView, CommunityView, PersonView } from "../views";
CommunityModeratorView,
CommunityView,
PersonViewSafe,
} from "../views";
/** /**
* You can use either `id` or `name` as an id. * You can use either `id` or `name` as an id.
@ -73,7 +69,7 @@ export interface BanFromCommunity {
} }
export interface BanFromCommunityResponse { export interface BanFromCommunityResponse {
person_view: PersonViewSafe; person_view: PersonView;
banned: boolean; banned: boolean;
} }

View file

@ -1,10 +1,10 @@
import { CommentSortType, SortType } from "../others"; import { CommentSortType, ListingType, SortType } from "../others";
import { import {
CommentReplyView, CommentReplyView,
CommentView, CommentView,
CommunityModeratorView, CommunityModeratorView,
PersonMentionView, PersonMentionView,
PersonViewSafe, PersonView,
PostView, PostView,
PrivateMessageReportView, PrivateMessageReportView,
PrivateMessageView, PrivateMessageView,
@ -84,14 +84,14 @@ export interface SaveUserSettings {
* *
* The Sort types from above, zero indexed as a number * The Sort types from above, zero indexed as a number
*/ */
default_sort_type?: number; default_sort_type?: SortType;
/** /**
* The [[ListingType]]. * The [[ListingType]].
* *
* Post listing types are `All, Subscribed, Community` * Post listing types are `All, Subscribed, Community`
*/ */
default_listing_type?: number; default_listing_type?: ListingType;
interface_language?: string; interface_language?: string;
avatar?: string; avatar?: string;
banner?: string; banner?: string;
@ -153,7 +153,7 @@ export interface GetPersonDetails {
} }
export interface GetPersonDetailsResponse { export interface GetPersonDetailsResponse {
person_view: PersonViewSafe; person_view: PersonView;
comments: CommentView[]; comments: CommentView[];
posts: PostView[]; posts: PostView[];
moderates: CommunityModeratorView[]; moderates: CommunityModeratorView[];
@ -178,7 +178,7 @@ export interface AddAdmin {
} }
export interface AddAdminResponse { export interface AddAdminResponse {
admins: PersonViewSafe[]; admins: PersonView[];
} }
export interface BanPerson { export interface BanPerson {
@ -198,7 +198,7 @@ export interface BanPerson {
} }
export interface BanPersonResponse { export interface BanPersonResponse {
person_view: PersonViewSafe; person_view: PersonView;
banned: boolean; banned: boolean;
} }
@ -365,7 +365,7 @@ export interface BlockPerson {
} }
export interface BlockPersonResponse { export interface BlockPersonResponse {
person_view: PersonViewSafe; person_view: PersonView;
blocked: boolean; blocked: boolean;
} }
@ -374,5 +374,5 @@ export interface GetBannedPersons {
} }
export interface BannedPersonsResponse { export interface BannedPersonsResponse {
banned: PersonViewSafe[]; banned: PersonView[];
} }

View file

@ -1,5 +1,11 @@
import { ListingType, ModlogActionType, SearchType, SortType } from "../others"; import {
import { Language, RegistrationMode, Tagline } from "../source"; ListingType,
ModlogActionType,
RegistrationMode,
SearchType,
SortType,
} from "../others";
import { Language, Tagline } from "../source";
import { import {
AdminPurgeCommentView, AdminPurgeCommentView,
AdminPurgeCommunityView, AdminPurgeCommunityView,
@ -23,7 +29,7 @@ import {
ModRemovePostView, ModRemovePostView,
ModTransferCommunityView, ModTransferCommunityView,
PersonBlockView, PersonBlockView,
PersonViewSafe, PersonView,
PostView, PostView,
RegistrationApplicationView, RegistrationApplicationView,
SiteView, SiteView,
@ -56,7 +62,7 @@ export interface SearchResponse {
comments: CommentView[]; comments: CommentView[];
posts: PostView[]; posts: PostView[];
communities: CommunityView[]; communities: CommunityView[];
users: PersonViewSafe[]; users: PersonView[];
} }
export interface GetModlog { export interface GetModlog {
@ -100,7 +106,7 @@ export interface CreateSite {
application_question?: string; application_question?: string;
private_instance?: boolean; private_instance?: boolean;
default_theme?: string; default_theme?: string;
default_post_listing_type?: string; default_post_listing_type?: ListingType;
application_email_admins?: boolean; application_email_admins?: boolean;
reports_email_admins?: boolean; reports_email_admins?: boolean;
hide_modlog_mod_names?: boolean; hide_modlog_mod_names?: boolean;
@ -145,7 +151,7 @@ export interface EditSite {
application_question?: string; application_question?: string;
private_instance?: boolean; private_instance?: boolean;
default_theme?: string; default_theme?: string;
default_post_listing_type?: string; default_post_listing_type?: ListingType;
legal_information?: string; legal_information?: string;
application_email_admins?: boolean; application_email_admins?: boolean;
reports_email_admins?: boolean; reports_email_admins?: boolean;
@ -186,7 +192,7 @@ export interface SiteResponse {
export interface GetSiteResponse { export interface GetSiteResponse {
site_view: SiteView; site_view: SiteView;
admins: PersonViewSafe[]; admins: PersonView[];
online: number; online: number;
version: string; version: string;
/** /**
@ -231,7 +237,7 @@ export interface ResolveObjectResponse {
comment?: CommentView; comment?: CommentView;
post?: PostView; post?: PostView;
community?: CommunityView; community?: CommunityView;
person?: PersonViewSafe; person?: PersonView;
} }
export interface PurgePerson { export interface PurgePerson {

View file

@ -174,6 +174,15 @@ export enum ListingType {
Community = "Community", Community = "Community",
} }
/**
* The different types of registration modes
*/
export enum RegistrationMode {
Closed = "Closed",
RequireApplication = "RequireApplication",
Open = "Open",
}
/** /**
* Search types for lemmy's search. * Search types for lemmy's search.
*/ */

View file

@ -1,11 +1,13 @@
import { ListingType, RegistrationMode, SortType } from "./others";
export interface LocalUserSettings { export interface LocalUserSettings {
id: number; id: number;
person_id: number; person_id: number;
email?: string; email?: string;
show_nsfw: boolean; show_nsfw: boolean;
theme: string; theme: string;
default_sort_type: number; default_sort_type: SortType;
default_listing_type: number; default_listing_type: ListingType;
interface_language: string; interface_language: string;
show_avatars: boolean; show_avatars: boolean;
send_notifications_to_email: boolean; send_notifications_to_email: boolean;
@ -22,7 +24,7 @@ export interface LocalUserSettings {
totp_2fa_url?: string; totp_2fa_url?: string;
} }
export interface PersonSafe { export interface Person {
id: number; id: number;
name: string; name: string;
display_name?: string; display_name?: string;
@ -61,12 +63,6 @@ export interface Site {
instance_id: number; instance_id: number;
} }
export enum RegistrationMode {
Closed = "closed",
RequireApplication = "requireapplication",
Open = "open",
}
export interface LocalSite { export interface LocalSite {
id: number; id: number;
site_id: number; site_id: number;
@ -79,7 +75,7 @@ export interface LocalSite {
application_question?: string; application_question?: string;
private_instance: boolean; private_instance: boolean;
default_theme: string; default_theme: string;
default_post_listing_type: string; default_post_listing_type: ListingType;
legal_information?: string; legal_information?: string;
hide_modlog_mod_names: boolean; hide_modlog_mod_names: boolean;
application_email_admins: boolean; application_email_admins: boolean;
@ -177,7 +173,7 @@ export interface ModRemovePost {
mod_person_id: number; mod_person_id: number;
post_id: number; post_id: number;
reason?: string; reason?: string;
removed?: boolean; removed: boolean;
when_: string; when_: string;
} }
@ -203,7 +199,7 @@ export interface ModRemoveComment {
mod_person_id: number; mod_person_id: number;
comment_id: number; comment_id: number;
reason?: string; reason?: string;
removed?: boolean; removed: boolean;
when_: string; when_: string;
} }
@ -212,7 +208,7 @@ export interface ModRemoveCommunity {
mod_person_id: number; mod_person_id: number;
community_id: number; community_id: number;
reason?: string; reason?: string;
removed?: boolean; removed: boolean;
expires?: string; expires?: string;
when_: string; when_: string;
} }
@ -243,7 +239,7 @@ export interface ModAddCommunity {
mod_person_id: number; mod_person_id: number;
other_person_id: number; other_person_id: number;
community_id: number; community_id: number;
removed?: boolean; removed: boolean;
when_: string; when_: string;
} }
@ -252,7 +248,6 @@ export interface ModTransferCommunity {
mod_person_id: number; mod_person_id: number;
other_person_id: number; other_person_id: number;
community_id: number; community_id: number;
removed?: boolean;
when_: string; when_: string;
} }
@ -260,7 +255,7 @@ export interface ModAdd {
id: number; id: number;
mod_person_id: number; mod_person_id: number;
other_person_id: number; other_person_id: number;
removed?: boolean; removed: boolean;
when_: string; when_: string;
} }
@ -294,7 +289,7 @@ export interface AdminPurgeComment {
when_: string; when_: string;
} }
export interface CommunitySafe { export interface Community {
id: number; id: number;
name: string; name: string;
title: string; title: string;

View file

@ -14,7 +14,7 @@ import {
Comment, Comment,
CommentReply, CommentReply,
CommentReport, CommentReport,
CommunitySafe, Community,
CustomEmoji, CustomEmoji,
CustomEmojiKeyword, CustomEmojiKeyword,
LocalSite, LocalSite,
@ -30,8 +30,8 @@ import {
ModRemoveCommunity, ModRemoveCommunity,
ModRemovePost, ModRemovePost,
ModTransferCommunity, ModTransferCommunity,
Person,
PersonMention, PersonMention,
PersonSafe,
Post, Post,
PostReport, PostReport,
PrivateMessage, PrivateMessage,
@ -41,18 +41,18 @@ import {
Tagline, Tagline,
} from "./source"; } from "./source";
export interface PersonViewSafe { export interface PersonView {
person: PersonSafe; person: Person;
counts: PersonAggregates; counts: PersonAggregates;
} }
export interface PersonMentionView { export interface PersonMentionView {
person_mention: PersonMention; person_mention: PersonMention;
comment: Comment; comment: Comment;
creator: PersonSafe; creator: Person;
post: Post; post: Post;
community: CommunitySafe; community: Community;
recipient: PersonSafe; recipient: Person;
counts: CommentAggregates; counts: CommentAggregates;
creator_banned_from_community: boolean; creator_banned_from_community: boolean;
subscribed: SubscribedType; subscribed: SubscribedType;
@ -63,7 +63,7 @@ export interface PersonMentionView {
export interface LocalUserSettingsView { export interface LocalUserSettingsView {
local_user: LocalUserSettings; local_user: LocalUserSettings;
person: PersonSafe; person: Person;
counts: PersonAggregates; counts: PersonAggregates;
} }
@ -77,14 +77,14 @@ export interface SiteView {
export interface PrivateMessageView { export interface PrivateMessageView {
private_message: PrivateMessage; private_message: PrivateMessage;
creator: PersonSafe; creator: Person;
recipient: PersonSafe; recipient: Person;
} }
export interface PostView { export interface PostView {
post: Post; post: Post;
creator: PersonSafe; creator: Person;
community: CommunitySafe; community: Community;
creator_banned_from_community: boolean; creator_banned_from_community: boolean;
counts: PostAggregates; counts: PostAggregates;
subscribed: SubscribedType; subscribed: SubscribedType;
@ -98,20 +98,20 @@ export interface PostView {
export interface PostReportView { export interface PostReportView {
post_report: PostReport; post_report: PostReport;
post: Post; post: Post;
community: CommunitySafe; community: Community;
creator: PersonSafe; creator: Person;
post_creator: PersonSafe; post_creator: Person;
creator_banned_from_community: boolean; creator_banned_from_community: boolean;
my_vote?: number; my_vote?: number;
counts: PostAggregates; counts: PostAggregates;
resolver?: PersonSafe; resolver?: Person;
} }
export interface CommentView { export interface CommentView {
comment: Comment; comment: Comment;
creator: PersonSafe; creator: Person;
post: Post; post: Post;
community: CommunitySafe; community: Community;
counts: CommentAggregates; counts: CommentAggregates;
creator_banned_from_community: boolean; creator_banned_from_community: boolean;
subscribed: SubscribedType; subscribed: SubscribedType;
@ -123,10 +123,10 @@ export interface CommentView {
export interface CommentReplyView { export interface CommentReplyView {
comment_reply: CommentReply; comment_reply: CommentReply;
comment: Comment; comment: Comment;
creator: PersonSafe; creator: Person;
post: Post; post: Post;
community: CommunitySafe; community: Community;
recipient: PersonSafe; recipient: Person;
counts: CommentAggregates; counts: CommentAggregates;
creator_banned_from_community: boolean; creator_banned_from_community: boolean;
subscribed: SubscribedType; subscribed: SubscribedType;
@ -139,133 +139,133 @@ export interface CommentReportView {
comment_report: CommentReport; comment_report: CommentReport;
comment: Comment; comment: Comment;
post: Post; post: Post;
community: CommunitySafe; community: Community;
creator: PersonSafe; creator: Person;
comment_creator: PersonSafe; comment_creator: Person;
counts: CommentAggregates; counts: CommentAggregates;
creator_banned_from_community: boolean; creator_banned_from_community: boolean;
my_vote?: number; my_vote?: number;
resolver?: PersonSafe; resolver?: Person;
} }
export interface ModAddCommunityView { export interface ModAddCommunityView {
mod_add_community: ModAddCommunity; mod_add_community: ModAddCommunity;
moderator?: PersonSafe; moderator?: Person;
community: CommunitySafe; community: Community;
modded_person: PersonSafe; modded_person: Person;
} }
export interface ModTransferCommunityView { export interface ModTransferCommunityView {
mod_transfer_community: ModTransferCommunity; mod_transfer_community: ModTransferCommunity;
moderator?: PersonSafe; moderator?: Person;
community: CommunitySafe; community: Community;
modded_person: PersonSafe; modded_person: Person;
} }
export interface ModAddView { export interface ModAddView {
mod_add: ModAdd; mod_add: ModAdd;
moderator?: PersonSafe; moderator?: Person;
modded_person: PersonSafe; modded_person: Person;
} }
export interface ModBanFromCommunityView { export interface ModBanFromCommunityView {
mod_ban_from_community: ModBanFromCommunity; mod_ban_from_community: ModBanFromCommunity;
moderator?: PersonSafe; moderator?: Person;
community: CommunitySafe; community: Community;
banned_person: PersonSafe; banned_person: Person;
} }
export interface ModBanView { export interface ModBanView {
mod_ban: ModBan; mod_ban: ModBan;
moderator?: PersonSafe; moderator?: Person;
banned_person: PersonSafe; banned_person: Person;
} }
export interface ModLockPostView { export interface ModLockPostView {
mod_lock_post: ModLockPost; mod_lock_post: ModLockPost;
moderator?: PersonSafe; moderator?: Person;
post: Post; post: Post;
community: CommunitySafe; community: Community;
} }
export interface ModRemoveCommentView { export interface ModRemoveCommentView {
mod_remove_comment: ModRemoveComment; mod_remove_comment: ModRemoveComment;
moderator?: PersonSafe; moderator?: Person;
comment: Comment; comment: Comment;
commenter: PersonSafe; commenter: Person;
post: Post; post: Post;
community: CommunitySafe; community: Community;
} }
export interface ModRemoveCommunityView { export interface ModRemoveCommunityView {
mod_remove_community: ModRemoveCommunity; mod_remove_community: ModRemoveCommunity;
moderator?: PersonSafe; moderator?: Person;
community: CommunitySafe; community: Community;
} }
export interface ModRemovePostView { export interface ModRemovePostView {
mod_remove_post: ModRemovePost; mod_remove_post: ModRemovePost;
moderator?: PersonSafe; moderator?: Person;
post: Post; post: Post;
community: CommunitySafe; community: Community;
} }
export interface ModFeaturePostView { export interface ModFeaturePostView {
mod_feature_post: ModFeaturePost; mod_feature_post: ModFeaturePost;
moderator?: PersonSafe; moderator?: Person;
post: Post; post: Post;
community: CommunitySafe; community: Community;
} }
export interface AdminPurgeCommunityView { export interface AdminPurgeCommunityView {
admin_purge_community: AdminPurgeCommunity; admin_purge_community: AdminPurgeCommunity;
admin?: PersonSafe; admin?: Person;
} }
export interface AdminPurgePersonView { export interface AdminPurgePersonView {
admin_purge_person: AdminPurgePerson; admin_purge_person: AdminPurgePerson;
admin?: PersonSafe; admin?: Person;
} }
export interface AdminPurgePostView { export interface AdminPurgePostView {
admin_purge_post: AdminPurgePost; admin_purge_post: AdminPurgePost;
admin?: PersonSafe; admin?: Person;
community: CommunitySafe; community: Community;
} }
export interface AdminPurgeCommentView { export interface AdminPurgeCommentView {
admin_purge_comment: AdminPurgeComment; admin_purge_comment: AdminPurgeComment;
admin?: PersonSafe; admin?: Person;
post: Post; post: Post;
} }
export interface CommunityFollowerView { export interface CommunityFollowerView {
community: CommunitySafe; community: Community;
follower: PersonSafe; follower: Person;
} }
export interface CommunityBlockView { export interface CommunityBlockView {
person: PersonSafe; person: Person;
community: CommunitySafe; community: Community;
} }
export interface CommunityModeratorView { export interface CommunityModeratorView {
community: CommunitySafe; community: Community;
moderator: PersonSafe; moderator: Person;
} }
export interface CommunityPersonBanView { export interface CommunityPersonBanView {
community: CommunitySafe; community: Community;
person: PersonSafe; person: Person;
} }
export interface PersonBlockView { export interface PersonBlockView {
person: PersonSafe; person: Person;
target: PersonSafe; target: Person;
} }
export interface CommunityView { export interface CommunityView {
community: CommunitySafe; community: Community;
subscribed: SubscribedType; subscribed: SubscribedType;
blocked: boolean; blocked: boolean;
counts: CommunityAggregates; counts: CommunityAggregates;
@ -274,8 +274,8 @@ export interface CommunityView {
export interface RegistrationApplicationView { export interface RegistrationApplicationView {
registration_application: RegistrationApplication; registration_application: RegistrationApplication;
creator_local_user: LocalUserSettings; creator_local_user: LocalUserSettings;
creator: PersonSafe; creator: Person;
admin?: PersonSafe; admin?: Person;
} }
export interface CommentNode { export interface CommentNode {
@ -287,9 +287,9 @@ export interface CommentNode {
export interface PrivateMessageReportView { export interface PrivateMessageReportView {
private_message_report: PrivateMessageReport; private_message_report: PrivateMessageReport;
private_message: PrivateMessage; private_message: PrivateMessage;
private_message_creator: PersonSafe; private_message_creator: Person;
creator: PersonSafe; creator: Person;
resolver?: PersonSafe; resolver?: Person;
} }
export class CustomEmojiView { export class CustomEmojiView {