Skip to content

Commit

Permalink
update based on the latest changes in the lemmy repo PR
Browse files Browse the repository at this point in the history
  • Loading branch information
privacyguard committed Jul 6, 2024
1 parent 533eef0 commit 736b1ad
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 14 deletions.
12 changes: 6 additions & 6 deletions src/http.ts
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ import { ListCommentLikesResponse } from "./types/ListCommentLikesResponse";
import { HidePost } from "./types/HidePost";
import { ListMedia } from "./types/ListMedia";
import { ListMediaResponse } from "./types/ListMediaResponse";
import { OAuth } from "./types/OAuth";
import { AuthenticateWithOauth } from "./types/AuthenticateWithOauth";

enum HttpType {
Get = "GET",
Expand Down Expand Up @@ -1466,14 +1466,14 @@ export class LemmyHttp {
}

/**
* Register user with OAuth
* Authenticate with OAuth
*
* `HTTP.Post /oauth/register`
* `HTTP.Post /oauth/authenticate`
*/
registerWithOAuth(form: OAuth) {
return this.#wrapper<OAuth, LoginResponse>(
authenticateWithOAuth(form: AuthenticateWithOauth) {
return this.#wrapper<AuthenticateWithOauth, LoginResponse>(
HttpType.Post,
"/oauth/register",
"/oauth/authenticate",
form,
);
}
Expand Down
3 changes: 1 addition & 2 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ export { AdminPurgePersonView } from "./types/AdminPurgePersonView";
export { AdminPurgePost } from "./types/AdminPurgePost";
export { AdminPurgePostView } from "./types/AdminPurgePostView";
export { ApproveRegistrationApplication } from "./types/ApproveRegistrationApplication";
export { AuthenticateWithOauth } from "./types/AuthenticateWithOauth";
export { BanFromCommunity } from "./types/BanFromCommunity";
export { BanFromCommunityResponse } from "./types/BanFromCommunityResponse";
export { BanPerson } from "./types/BanPerson";
Expand Down Expand Up @@ -183,7 +184,6 @@ export { ModTransferCommunityView } from "./types/ModTransferCommunityView";
export { ModlogActionType } from "./types/ModlogActionType";
export { ModlogListParams } from "./types/ModlogListParams";
export { MyUserInfo } from "./types/MyUserInfo";
export { OAuth } from "./types/OAuth";
export { OAuthAccount } from "./types/OAuthAccount";
export { OAuthAccountId } from "./types/OAuthAccountId";
export { OAuthProvider } from "./types/OAuthProvider";
Expand All @@ -196,7 +196,6 @@ export { PasswordChangeAfterReset } from "./types/PasswordChangeAfterReset";
export { PasswordReset } from "./types/PasswordReset";
export { Person } from "./types/Person";
export { PersonAggregates } from "./types/PersonAggregates";
export { PersonBlockId } from "./types/PersonBlockId";
export { PersonBlockView } from "./types/PersonBlockView";
export { PersonId } from "./types/PersonId";
export { PersonMention } from "./types/PersonMention";
Expand Down
4 changes: 2 additions & 2 deletions src/types/OAuth.ts → src/types/AuthenticateWithOauth.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 OAuth {
export interface AuthenticateWithOauth {
code: string;
oauth_provider_id: string;
redirect_uri?: string;
redirect_uri: string;
}
2 changes: 1 addition & 1 deletion src/types/GetSiteResponse.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,6 @@ export interface GetSiteResponse {
discussion_languages: Array<LanguageId>;
taglines: Array<Tagline>;
custom_emojis: Array<CustomEmojiView>;
oauth_providers: Array<OAuthProvider | null>;
oauth_providers: Array<OAuthProvider>;
blocked_urls: Array<LocalSiteUrlBlocklist>;
}
1 change: 1 addition & 0 deletions src/types/LemmyErrorType.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ export type LemmyErrorType =
| { error: "couldnt_find_comment_reply" }
| { error: "couldnt_find_private_message" }
| { error: "couldnt_find_activity" }
| { error: "couldnt_find_oauth_provider" }
| { error: "person_is_blocked" }
| { error: "community_is_blocked" }
| { error: "instance_is_blocked" }
Expand Down
3 changes: 0 additions & 3 deletions src/types/PersonBlockId.ts

This file was deleted.

0 comments on commit 736b1ad

Please sign in to comment.