Remove bigints (#121)

* Alter script to change bigints to numbers

* Run script to convert bigints to numbers
This commit is contained in:
Dessalines 2023-05-15 15:41:44 -04:00 committed by GitHub
parent b027035bfa
commit 402aba2d38
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
27 changed files with 69 additions and 66 deletions

View file

@ -13,4 +13,7 @@ cp db_views/bindings/* ../../lemmy-js-client/src/types/
cp db_views_actor/bindings/* ../../lemmy-js-client/src/types/ cp db_views_actor/bindings/* ../../lemmy-js-client/src/types/
cp db_views_moderator/bindings/* ../../lemmy-js-client/src/types/ cp db_views_moderator/bindings/* ../../lemmy-js-client/src/types/
# Change all the bigints to numbers
find ../../lemmy-js-client/src/types -type f -name '*.ts' -exec sed -i 's/bigint/number/g' {} +
node ../../lemmy-js-client/putTypesInIndex.js node ../../lemmy-js-client/putTypesInIndex.js

View file

@ -8,6 +8,6 @@ export interface BanFromCommunity {
ban: boolean; ban: boolean;
remove_data?: boolean; remove_data?: boolean;
reason?: string; reason?: string;
expires?: bigint; expires?: number;
auth: string; auth: string;
} }

View file

@ -6,6 +6,6 @@ export interface BanPerson {
ban: boolean; ban: boolean;
remove_data?: boolean; remove_data?: boolean;
reason?: string; reason?: string;
expires?: bigint; expires?: number;
auth: string; auth: string;
} }

View file

@ -4,9 +4,9 @@ import type { CommentId } from "./CommentId";
export interface CommentAggregates { export interface CommentAggregates {
id: number; id: number;
comment_id: CommentId; comment_id: CommentId;
score: bigint; score: number;
upvotes: bigint; upvotes: number;
downvotes: bigint; downvotes: number;
published: string; published: string;
child_count: number; child_count: number;
} }

View file

@ -4,12 +4,12 @@ import type { CommunityId } from "./CommunityId";
export interface CommunityAggregates { export interface CommunityAggregates {
id: number; id: number;
community_id: CommunityId; community_id: CommunityId;
subscribers: bigint; subscribers: number;
posts: bigint; posts: number;
comments: bigint; comments: number;
published: string; published: string;
users_active_day: bigint; users_active_day: number;
users_active_week: bigint; users_active_week: number;
users_active_month: bigint; users_active_month: number;
users_active_half_year: bigint; users_active_half_year: number;
} }

View file

@ -9,8 +9,8 @@ export interface GetComments {
type_?: ListingType; type_?: ListingType;
sort?: CommentSortType; sort?: CommentSortType;
max_depth?: number; max_depth?: number;
page?: bigint; page?: number;
limit?: bigint; limit?: number;
community_id?: CommunityId; community_id?: CommunityId;
community_name?: string; community_name?: string;
post_id?: PostId; post_id?: PostId;

View file

@ -6,8 +6,8 @@ import type { PersonId } from "./PersonId";
export interface GetModlog { export interface GetModlog {
mod_person_id?: PersonId; mod_person_id?: PersonId;
community_id?: CommunityId; community_id?: CommunityId;
page?: bigint; page?: number;
limit?: bigint; limit?: number;
type_?: ModlogActionType; type_?: ModlogActionType;
other_person_id?: PersonId; other_person_id?: PersonId;
auth?: string; auth?: string;

View file

@ -7,8 +7,8 @@ export interface GetPersonDetails {
person_id?: PersonId; person_id?: PersonId;
username?: string; username?: string;
sort?: SortType; sort?: SortType;
page?: bigint; page?: number;
limit?: bigint; limit?: number;
community_id?: CommunityId; community_id?: CommunityId;
saved_only?: boolean; saved_only?: boolean;
auth?: string; auth?: string;

View file

@ -3,8 +3,8 @@ import type { CommentSortType } from "./CommentSortType";
export interface GetPersonMentions { export interface GetPersonMentions {
sort?: CommentSortType; sort?: CommentSortType;
page?: bigint; page?: number;
limit?: bigint; limit?: number;
unread_only?: boolean; unread_only?: boolean;
auth: string; auth: string;
} }

View file

@ -6,8 +6,8 @@ import type { SortType } from "./SortType";
export interface GetPosts { export interface GetPosts {
type_?: ListingType; type_?: ListingType;
sort?: SortType; sort?: SortType;
page?: bigint; page?: number;
limit?: bigint; limit?: number;
community_id?: CommunityId; community_id?: CommunityId;
community_name?: string; community_name?: string;
saved_only?: boolean; saved_only?: boolean;

View file

@ -2,7 +2,7 @@
export interface GetPrivateMessages { export interface GetPrivateMessages {
unread_only?: boolean; unread_only?: boolean;
page?: bigint; page?: number;
limit?: bigint; limit?: number;
auth: string; auth: string;
} }

View file

@ -3,8 +3,8 @@ import type { CommentSortType } from "./CommentSortType";
export interface GetReplies { export interface GetReplies {
sort?: CommentSortType; sort?: CommentSortType;
page?: bigint; page?: number;
limit?: bigint; limit?: number;
unread_only?: boolean; unread_only?: boolean;
auth: string; auth: string;
} }

View file

@ -3,7 +3,7 @@ import type { CommunityId } from "./CommunityId";
export interface GetReportCountResponse { export interface GetReportCountResponse {
community_id?: CommunityId; community_id?: CommunityId;
comment_reports: bigint; comment_reports: number;
post_reports: bigint; post_reports: number;
private_message_reports?: bigint; private_message_reports?: number;
} }

View file

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

View file

@ -1,5 +1,5 @@
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
export interface GetUnreadRegistrationApplicationCountResponse { export interface GetUnreadRegistrationApplicationCountResponse {
registration_applications: bigint; registration_applications: number;
} }

View file

@ -2,8 +2,8 @@
import type { CommunityId } from "./CommunityId"; import type { CommunityId } from "./CommunityId";
export interface ListCommentReports { export interface ListCommentReports {
page?: bigint; page?: number;
limit?: bigint; limit?: number;
unresolved_only?: boolean; unresolved_only?: boolean;
community_id?: CommunityId; community_id?: CommunityId;
auth: string; auth: string;

View file

@ -5,7 +5,7 @@ import type { SortType } from "./SortType";
export interface ListCommunities { export interface ListCommunities {
type_?: ListingType; type_?: ListingType;
sort?: SortType; sort?: SortType;
page?: bigint; page?: number;
limit?: bigint; limit?: number;
auth?: string; auth?: string;
} }

View file

@ -2,8 +2,8 @@
import type { CommunityId } from "./CommunityId"; import type { CommunityId } from "./CommunityId";
export interface ListPostReports { export interface ListPostReports {
page?: bigint; page?: number;
limit?: bigint; limit?: number;
unresolved_only?: boolean; unresolved_only?: boolean;
community_id?: CommunityId; community_id?: CommunityId;
auth: string; auth: string;

View file

@ -1,8 +1,8 @@
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
export interface ListPrivateMessageReports { export interface ListPrivateMessageReports {
page?: bigint; page?: number;
limit?: bigint; limit?: number;
unresolved_only?: boolean; unresolved_only?: boolean;
auth: string; auth: string;
} }

View file

@ -2,7 +2,7 @@
export interface ListRegistrationApplications { export interface ListRegistrationApplications {
unread_only?: boolean; unread_only?: boolean;
page?: bigint; page?: number;
limit?: bigint; limit?: number;
auth: string; auth: string;
} }

View file

@ -6,7 +6,7 @@ export interface ModlogListParams {
community_id?: CommunityId; community_id?: CommunityId;
mod_person_id?: PersonId; mod_person_id?: PersonId;
other_person_id?: PersonId; other_person_id?: PersonId;
page?: bigint; page?: number;
limit?: bigint; limit?: number;
hide_modlog_names: boolean; hide_modlog_names: boolean;
} }

View file

@ -4,8 +4,8 @@ import type { PersonId } from "./PersonId";
export interface PersonAggregates { export interface PersonAggregates {
id: number; id: number;
person_id: PersonId; person_id: PersonId;
post_count: bigint; post_count: number;
post_score: bigint; post_score: number;
comment_count: bigint; comment_count: number;
comment_score: bigint; comment_score: number;
} }

View file

@ -4,10 +4,10 @@ import type { PostId } from "./PostId";
export interface PostAggregates { export interface PostAggregates {
id: number; id: number;
post_id: PostId; post_id: PostId;
comments: bigint; comments: number;
score: bigint; score: number;
upvotes: bigint; upvotes: number;
downvotes: bigint; downvotes: number;
published: string; published: string;
newest_comment_time_necro: string; newest_comment_time_necro: string;
newest_comment_time: string; newest_comment_time: string;

View file

@ -16,5 +16,5 @@ export interface PostView {
read: boolean; read: boolean;
creator_blocked: boolean; creator_blocked: boolean;
my_vote?: number; my_vote?: number;
unread_comments: bigint; unread_comments: number;
} }

View file

@ -5,6 +5,6 @@ export interface RemoveCommunity {
community_id: CommunityId; community_id: CommunityId;
removed: boolean; removed: boolean;
reason?: string; reason?: string;
expires?: bigint; expires?: number;
auth: string; auth: string;
} }

View file

@ -13,7 +13,7 @@ export interface Search {
type_?: SearchType; type_?: SearchType;
sort?: SortType; sort?: SortType;
listing_type?: ListingType; listing_type?: ListingType;
page?: bigint; page?: number;
limit?: bigint; limit?: number;
auth?: string; auth?: string;
} }

View file

@ -4,12 +4,12 @@ import type { SiteId } from "./SiteId";
export interface SiteAggregates { export interface SiteAggregates {
id: number; id: number;
site_id: SiteId; site_id: SiteId;
users: bigint; users: number;
posts: bigint; posts: number;
comments: bigint; comments: number;
communities: bigint; communities: number;
users_active_day: bigint; users_active_day: number;
users_active_week: bigint; users_active_week: number;
users_active_month: bigint; users_active_month: number;
users_active_half_year: bigint; users_active_half_year: number;
} }