From 49986ebdfc7df393fcd1c6dafb7c1af390693b53 Mon Sep 17 00:00:00 2001 From: Dessalines Date: Wed, 27 Nov 2024 12:37:41 -0500 Subject: [PATCH] Adding pkce settings. --- src/index.ts | 1 + src/types/AuthenticateWithOauth.ts | 1 + src/types/CommentAggregates.ts | 2 ++ src/types/CreateOAuthProvider.ts | 1 + src/types/EditOAuthProvider.ts | 1 + src/types/FederationError.ts | 3 ++- src/types/GetPosts.ts | 4 ++++ src/types/HidePost.ts | 2 +- src/types/LemmyErrorType.ts | 4 +++- src/types/LocalUser.ts | 8 ++++++++ src/types/MarkManyPostsAsRead.ts | 7 +++++++ src/types/MarkPostAsRead.ts | 2 +- src/types/OAuthProvider.ts | 4 ++++ src/types/PostAggregates.ts | 2 ++ src/types/SaveUserSettings.ts | 8 ++++++++ 15 files changed, 46 insertions(+), 4 deletions(-) create mode 100644 src/types/MarkManyPostsAsRead.ts diff --git a/src/index.ts b/src/index.ts index 6bec7c1..86a8449 100644 --- a/src/index.ts +++ b/src/index.ts @@ -179,6 +179,7 @@ export { Login } from "./types/Login"; export { LoginResponse } from "./types/LoginResponse"; export { LoginToken } from "./types/LoginToken"; export { MarkCommentReplyAsRead } from "./types/MarkCommentReplyAsRead"; +export { MarkManyPostsAsRead } from "./types/MarkManyPostsAsRead"; export { MarkPersonMentionAsRead } from "./types/MarkPersonMentionAsRead"; export { MarkPostAsRead } from "./types/MarkPostAsRead"; export { MarkPrivateMessageAsRead } from "./types/MarkPrivateMessageAsRead"; diff --git a/src/types/AuthenticateWithOauth.ts b/src/types/AuthenticateWithOauth.ts index 862017f..bc8585b 100644 --- a/src/types/AuthenticateWithOauth.ts +++ b/src/types/AuthenticateWithOauth.ts @@ -6,6 +6,7 @@ import type { OAuthProviderId } from "./OAuthProviderId"; */ export type AuthenticateWithOauth = { code: string; + pkce_code_verifier?: string; oauth_provider_id: OAuthProviderId; redirect_uri: string; show_nsfw?: boolean; diff --git a/src/types/CommentAggregates.ts b/src/types/CommentAggregates.ts index f25ba70..5938cf3 100644 --- a/src/types/CommentAggregates.ts +++ b/src/types/CommentAggregates.ts @@ -14,4 +14,6 @@ export type CommentAggregates = { * The total number of children in this comment branch. */ child_count: number; + report_count: number; + unresolved_report_count: number; }; diff --git a/src/types/CreateOAuthProvider.ts b/src/types/CreateOAuthProvider.ts index 9c9e17c..856bc4c 100644 --- a/src/types/CreateOAuthProvider.ts +++ b/src/types/CreateOAuthProvider.ts @@ -15,5 +15,6 @@ export type CreateOAuthProvider = { scopes: string; auto_verify_email?: boolean; account_linking_enabled?: boolean; + use_pkce?: boolean; enabled?: boolean; }; diff --git a/src/types/EditOAuthProvider.ts b/src/types/EditOAuthProvider.ts index 472e7f1..8642189 100644 --- a/src/types/EditOAuthProvider.ts +++ b/src/types/EditOAuthProvider.ts @@ -15,5 +15,6 @@ export type EditOAuthProvider = { scopes?: string; auto_verify_email?: boolean; account_linking_enabled?: boolean; + use_pkce?: boolean; enabled?: boolean; }; diff --git a/src/types/FederationError.ts b/src/types/FederationError.ts index 35a371e..9574192 100644 --- a/src/types/FederationError.ts +++ b/src/types/FederationError.ts @@ -25,4 +25,5 @@ export type FederationError = | "InboxTimeout" | "CantDeleteSite" | "ObjectIsNotPublic" - | "ObjectIsNotPrivate"; + | "ObjectIsNotPrivate" + | "Unreachable"; diff --git a/src/types/GetPosts.ts b/src/types/GetPosts.ts index 1857c3c..58b9429 100644 --- a/src/types/GetPosts.ts +++ b/src/types/GetPosts.ts @@ -29,6 +29,10 @@ export type GetPosts = { * If true, then show the nsfw posts (even if your user setting is to hide them) */ show_nsfw?: boolean; + /** + * Whether to automatically mark fetched posts as read. + */ + mark_as_read?: boolean; /** * If true, then only show posts with no comments */ diff --git a/src/types/HidePost.ts b/src/types/HidePost.ts index 763a4a3..2ab19ed 100644 --- a/src/types/HidePost.ts +++ b/src/types/HidePost.ts @@ -4,4 +4,4 @@ import type { PostId } from "./PostId"; /** * Hide a post from list views */ -export type HidePost = { post_ids: Array; hide: boolean }; +export type HidePost = { post_id: PostId; hide: boolean }; diff --git a/src/types/LemmyErrorType.ts b/src/types/LemmyErrorType.ts index dbedaaa..0143997 100644 --- a/src/types/LemmyErrorType.ts +++ b/src/types/LemmyErrorType.ts @@ -63,9 +63,10 @@ export type LemmyErrorType = | { error: "no_email_setup" } | { error: "local_site_not_setup" } | { error: "email_smtp_server_needs_a_port" } - | { error: "missing_an_email" } + | { error: "invalid_email_address"; message: string } | { error: "rate_limit_error" } | { error: "invalid_name" } + | { error: "invalid_code_verifier" } | { error: "invalid_display_name" } | { error: "invalid_matrix_id" } | { error: "invalid_post_title" } @@ -116,6 +117,7 @@ export type LemmyErrorType = | { error: "invalid_regex" } | { error: "captcha_incorrect" } | { error: "couldnt_create_audio_captcha" } + | { error: "couldnt_create_image_captcha" } | { error: "invalid_url_scheme" } | { error: "couldnt_send_webmention" } | { error: "contradicting_filters" } diff --git a/src/types/LocalUser.ts b/src/types/LocalUser.ts index d03da9e..dc9a4a3 100644 --- a/src/types/LocalUser.ts +++ b/src/types/LocalUser.ts @@ -73,9 +73,17 @@ export type LocalUser = { * should be paused */ enable_animated_images: boolean; + /** + * Whether a user can send / receive private messages + */ + enable_private_messages: boolean; /** * Whether to auto-collapse bot comments. */ collapse_bot_comments: boolean; default_comment_sort_type: CommentSortType; + /** + * Whether to automatically mark fetched posts as read. + */ + auto_mark_fetched_posts_as_read: boolean; }; diff --git a/src/types/MarkManyPostsAsRead.ts b/src/types/MarkManyPostsAsRead.ts new file mode 100644 index 0000000..a61b5b5 --- /dev/null +++ b/src/types/MarkManyPostsAsRead.ts @@ -0,0 +1,7 @@ +// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. +import type { PostId } from "./PostId"; + +/** + * Mark several posts as read. + */ +export type MarkManyPostsAsRead = { post_ids: Array }; diff --git a/src/types/MarkPostAsRead.ts b/src/types/MarkPostAsRead.ts index bfb8188..bb4ea46 100644 --- a/src/types/MarkPostAsRead.ts +++ b/src/types/MarkPostAsRead.ts @@ -4,4 +4,4 @@ import type { PostId } from "./PostId"; /** * Mark a post as read. */ -export type MarkPostAsRead = { post_ids: Array; read: boolean }; +export type MarkPostAsRead = { post_id: PostId; read: boolean }; diff --git a/src/types/OAuthProvider.ts b/src/types/OAuthProvider.ts index fb9cc3b..2716f82 100644 --- a/src/types/OAuthProvider.ts +++ b/src/types/OAuthProvider.ts @@ -58,4 +58,8 @@ export type OAuthProvider = { enabled: boolean; published: string; updated?: string; + /** + * switch to enable or disable PKCE + */ + use_pkce: boolean; }; diff --git a/src/types/PostAggregates.ts b/src/types/PostAggregates.ts index 850d694..ffb9dd5 100644 --- a/src/types/PostAggregates.ts +++ b/src/types/PostAggregates.ts @@ -15,4 +15,6 @@ export type PostAggregates = { * The time of the newest comment in the post. */ newest_comment_time: string; + report_count: number; + unresolved_report_count: number; }; diff --git a/src/types/SaveUserSettings.ts b/src/types/SaveUserSettings.ts index 6488384..431a8dd 100644 --- a/src/types/SaveUserSettings.ts +++ b/src/types/SaveUserSettings.ts @@ -107,6 +107,10 @@ export type SaveUserSettings = { * should be paused */ enable_animated_images?: boolean; + /** + * Whether a user can send / receive private messages + */ + enable_private_messages?: boolean; /** * Whether to auto-collapse bot comments. */ @@ -118,4 +122,8 @@ export type SaveUserSettings = { show_upvotes?: boolean; show_downvotes?: boolean; show_upvote_percentage?: boolean; + /** + * Whether to automatically mark fetched posts as read. + */ + auto_mark_fetched_posts_as_read?: boolean; };