Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add original int type info for number #188

Merged
merged 5 commits into from
Sep 26, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Empty file modified .husky/pre-commit
100755 → 100644
Empty file.
2 changes: 1 addition & 1 deletion copy_generated_types_from_lemmy.sh
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ popd
rm src/types/Sensitive.ts

# Change all the bigints to numbers
find src/types -type f -name '*.ts' -exec sed -i 's/bigint/number/g' {} +
find src/types -type f -name '*.ts' -exec sed -i 's/bigint/\/* integer *\/ number/g' {} +

node putTypesInIndex.js

Expand Down
Empty file modified deploy.sh
100755 → 100644
Empty file.
5 changes: 4 additions & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ export { EditSite } from "./types/EditSite";
export { FeaturePost } from "./types/FeaturePost";
export { FederatedInstances } from "./types/FederatedInstances";
export { FollowCommunity } from "./types/FollowCommunity";
export { GenerateTotpSecretResponse } from "./types/GenerateTotpSecretResponse";
export { GetCaptchaResponse } from "./types/GetCaptchaResponse";
export { GetComment } from "./types/GetComment";
export { GetComments } from "./types/GetComments";
Expand Down Expand Up @@ -236,6 +237,8 @@ export { SortType } from "./types/SortType";
export { SubscribedType } from "./types/SubscribedType";
export { Tagline } from "./types/Tagline";
export { TransferCommunity } from "./types/TransferCommunity";
export { UpdateTotp } from "./types/UpdateTotp";
export { UpdateTotpResponse } from "./types/UpdateTotpResponse";
export { VerifyEmail } from "./types/VerifyEmail";
export { VerifyEmailResponse } from "./types/VerifyEmailResponse";
export { UploadImage, UploadImageResponse, ImageFile } from "./types/others";
export { ImageFile, UploadImage, UploadImageResponse } from "./types/others";
2 changes: 1 addition & 1 deletion src/types/BanFromCommunity.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@ export interface BanFromCommunity {
ban: boolean;
remove_data?: boolean;
reason?: string;
expires?: number;
expires?: /* integer */ number;
}
2 changes: 1 addition & 1 deletion src/types/BanPerson.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@ export interface BanPerson {
ban: boolean;
remove_data?: boolean;
reason?: string;
expires?: number;
expires?: /* integer */ number;
}
6 changes: 3 additions & 3 deletions src/types/CommentAggregates.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ import type { CommentId } from "./CommentId";
export interface CommentAggregates {
id: number;
comment_id: CommentId;
score: number;
upvotes: number;
downvotes: number;
score: /* integer */ number;
upvotes: /* integer */ number;
downvotes: /* integer */ number;
published: string;
child_count: number;
hot_rank: number;
Expand Down
14 changes: 7 additions & 7 deletions src/types/CommunityAggregates.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@ import type { CommunityId } from "./CommunityId";
export interface CommunityAggregates {
id: number;
community_id: CommunityId;
subscribers: number;
posts: number;
comments: number;
subscribers: /* integer */ number;
posts: /* integer */ number;
comments: /* integer */ number;
published: string;
users_active_day: number;
users_active_week: number;
users_active_month: number;
users_active_half_year: number;
users_active_day: /* integer */ number;
users_active_week: /* integer */ number;
users_active_month: /* integer */ number;
users_active_half_year: /* integer */ number;
hot_rank: number;
}
5 changes: 5 additions & 0 deletions src/types/GenerateTotpSecretResponse.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.

export interface GenerateTotpSecretResponse {
totp_secret_url: string;
}
4 changes: 2 additions & 2 deletions src/types/GetComments.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ export interface GetComments {
type_?: ListingType;
sort?: CommentSortType;
max_depth?: number;
page?: number;
limit?: number;
page?: /* integer */ number;
limit?: /* integer */ number;
community_id?: CommunityId;
community_name?: string;
post_id?: PostId;
Expand Down
4 changes: 2 additions & 2 deletions src/types/GetModlog.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ import type { PersonId } from "./PersonId";
export interface GetModlog {
mod_person_id?: PersonId;
community_id?: CommunityId;
page?: number;
limit?: number;
page?: /* integer */ number;
limit?: /* integer */ number;
type_?: ModlogActionType;
other_person_id?: PersonId;
}
4 changes: 2 additions & 2 deletions src/types/GetPersonDetails.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ export interface GetPersonDetails {
person_id?: PersonId;
username?: string;
sort?: SortType;
page?: number;
limit?: number;
page?: /* integer */ number;
limit?: /* integer */ number;
community_id?: CommunityId;
saved_only?: boolean;
}
4 changes: 2 additions & 2 deletions src/types/GetPersonMentions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import type { CommentSortType } from "./CommentSortType";

export interface GetPersonMentions {
sort?: CommentSortType;
page?: number;
limit?: number;
page?: /* integer */ number;
limit?: /* integer */ number;
unread_only?: boolean;
}
4 changes: 2 additions & 2 deletions src/types/GetPosts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ import type { SortType } from "./SortType";
export interface GetPosts {
type_?: ListingType;
sort?: SortType;
page?: number;
limit?: number;
page?: /* integer */ number;
limit?: /* integer */ number;
community_id?: CommunityId;
community_name?: string;
saved_only?: boolean;
Expand Down
4 changes: 2 additions & 2 deletions src/types/GetPrivateMessages.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import type { PersonId } from "./PersonId";

export interface GetPrivateMessages {
unread_only?: boolean;
page?: number;
limit?: number;
page?: /* integer */ number;
limit?: /* integer */ number;
creator_id?: PersonId;
}
4 changes: 2 additions & 2 deletions src/types/GetReplies.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import type { CommentSortType } from "./CommentSortType";

export interface GetReplies {
sort?: CommentSortType;
page?: number;
limit?: number;
page?: /* integer */ number;
limit?: /* integer */ number;
unread_only?: boolean;
}
6 changes: 3 additions & 3 deletions src/types/GetReportCountResponse.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import type { CommunityId } from "./CommunityId";

export interface GetReportCountResponse {
community_id?: CommunityId;
comment_reports: number;
post_reports: number;
private_message_reports?: number;
comment_reports: /* integer */ number;
post_reports: /* integer */ number;
private_message_reports?: /* integer */ number;
}
6 changes: 3 additions & 3 deletions src/types/GetUnreadCountResponse.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.

export interface GetUnreadCountResponse {
replies: number;
mentions: number;
private_messages: number;
replies: /* integer */ number;
mentions: /* integer */ number;
private_messages: /* integer */ number;
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.

export interface GetUnreadRegistrationApplicationCountResponse {
registration_applications: number;
registration_applications: /* integer */ number;
}
4 changes: 2 additions & 2 deletions src/types/ListCommentReports.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
import type { CommunityId } from "./CommunityId";

export interface ListCommentReports {
page?: number;
limit?: number;
page?: /* integer */ number;
limit?: /* integer */ number;
unresolved_only?: boolean;
community_id?: CommunityId;
}
4 changes: 2 additions & 2 deletions src/types/ListCommunities.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@ export interface ListCommunities {
type_?: ListingType;
sort?: SortType;
show_nsfw?: boolean;
page?: number;
limit?: number;
page?: /* integer */ number;
limit?: /* integer */ number;
}
4 changes: 2 additions & 2 deletions src/types/ListPostReports.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
import type { CommunityId } from "./CommunityId";

export interface ListPostReports {
page?: number;
limit?: number;
page?: /* integer */ number;
limit?: /* integer */ number;
unresolved_only?: boolean;
community_id?: CommunityId;
}
4 changes: 2 additions & 2 deletions src/types/ListPrivateMessageReports.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.

export interface ListPrivateMessageReports {
page?: number;
limit?: number;
page?: /* integer */ number;
limit?: /* integer */ number;
unresolved_only?: boolean;
}
4 changes: 2 additions & 2 deletions src/types/ListRegistrationApplications.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@

export interface ListRegistrationApplications {
unread_only?: boolean;
page?: number;
limit?: number;
page?: /* integer */ number;
limit?: /* integer */ number;
}
2 changes: 1 addition & 1 deletion src/types/LocalUser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,11 @@ export interface LocalUser {
show_new_post_notifs: boolean;
email_verified: boolean;
accepted_application: boolean;
totp_2fa_url?: string;
open_links_in_new_tab: boolean;
blur_nsfw: boolean;
auto_expand: boolean;
infinite_scroll_enabled: boolean;
admin: boolean;
post_listing_mode: PostListingMode;
totp_2fa_enabled: boolean;
}
4 changes: 2 additions & 2 deletions src/types/ModlogListParams.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ export interface ModlogListParams {
community_id?: CommunityId;
mod_person_id?: PersonId;
other_person_id?: PersonId;
page?: number;
limit?: number;
page?: /* integer */ number;
limit?: /* integer */ number;
hide_modlog_names: boolean;
}
8 changes: 4 additions & 4 deletions src/types/PersonAggregates.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import type { PersonId } from "./PersonId";
export interface PersonAggregates {
id: number;
person_id: PersonId;
post_count: number;
post_score: number;
comment_count: number;
comment_score: number;
post_count: /* integer */ number;
post_score: /* integer */ number;
comment_count: /* integer */ number;
comment_score: /* integer */ number;
}
8 changes: 4 additions & 4 deletions src/types/PostAggregates.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ import type { PostId } from "./PostId";
export interface PostAggregates {
id: number;
post_id: PostId;
comments: number;
score: number;
upvotes: number;
downvotes: number;
comments: /* integer */ number;
score: /* integer */ number;
upvotes: /* integer */ number;
downvotes: /* integer */ number;
published: string;
newest_comment_time_necro: string;
newest_comment_time: string;
Expand Down
2 changes: 1 addition & 1 deletion src/types/PostView.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,5 @@ export interface PostView {
read: boolean;
creator_blocked: boolean;
my_vote?: number;
unread_comments: number;
unread_comments: /* integer */ number;
}
2 changes: 1 addition & 1 deletion src/types/RemoveCommunity.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@ export interface RemoveCommunity {
community_id: CommunityId;
removed: boolean;
reason?: string;
expires?: number;
expires?: /* integer */ number;
}
4 changes: 2 additions & 2 deletions src/types/Search.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,6 @@ export interface Search {
type_?: SearchType;
sort?: SortType;
listing_type?: ListingType;
page?: number;
limit?: number;
page?: /* integer */ number;
limit?: /* integer */ number;
}
16 changes: 8 additions & 8 deletions src/types/SiteAggregates.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@ import type { SiteId } from "./SiteId";
export interface SiteAggregates {
id: number;
site_id: SiteId;
users: number;
posts: number;
comments: number;
communities: number;
users_active_day: number;
users_active_week: number;
users_active_month: number;
users_active_half_year: number;
users: /* integer */ number;
posts: /* integer */ number;
comments: /* integer */ number;
communities: /* integer */ number;
users_active_day: /* integer */ number;
users_active_week: /* integer */ number;
users_active_month: /* integer */ number;
users_active_half_year: /* integer */ number;
}
6 changes: 6 additions & 0 deletions src/types/UpdateTotp.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.

export interface UpdateTotp {
totp_token: string;
enabled: boolean;
}
5 changes: 5 additions & 0 deletions src/types/UpdateTotpResponse.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.

export interface UpdateTotpResponse {
enabled: boolean;
}