Compare commits

...

2 commits

Author SHA1 Message Date
Dessalines
b0bed1f7de v0.15.1-rc.1 2022-03-01 11:53:49 -05:00
Dessalines
7f759c4f4b Removing site_creator, adding LeaveAdmin. 2022-03-01 11:53:22 -05:00
6 changed files with 11 additions and 13 deletions

View file

@ -1,7 +1,7 @@
{
"name": "lemmy-js-client",
"description": "A javascript / typescript client for Lemmy",
"version": "0.15.4-rc.2",
"version": "0.15.1-rc.1",
"author": "Dessalines <tyhou13@gmx.com>",
"license": "AGPL-3.0",
"main": "./dist/index.js",

View file

@ -112,6 +112,7 @@ import {
GetSiteResponse,
GetUnreadRegistrationApplicationCount,
GetUnreadRegistrationApplicationCountResponse,
LeaveAdmin,
ListRegistrationApplications,
ListRegistrationApplicationsResponse,
RegistrationApplicationResponse,
@ -121,7 +122,6 @@ import {
Search,
SearchResponse,
SiteResponse,
TransferSite,
} from "./interfaces/api/site";
import { VERSION } from "./interfaces/others";
@ -173,10 +173,10 @@ export class LemmyHttp {
}
/**
* Transfer your site to another user.
* Leave the Site admins.
*/
async transferSite(form: TransferSite): Promise<GetSiteResponse> {
return this.wrapper(HttpType.Post, "/site/transfer", form);
async leaveAdmin(form: LeaveAdmin): Promise<GetSiteResponse> {
return this.wrapper(HttpType.Post, "/user/leave_admin", form);
}
/**

View file

@ -153,8 +153,7 @@ export interface MyUserInfo {
person_blocks: PersonBlockView[];
}
export interface TransferSite {
person_id: number;
export interface LeaveAdmin {
auth: string;
}

View file

@ -52,7 +52,7 @@ export enum UserOperation {
MarkAllAsRead,
SaveUserSettings,
TransferCommunity,
TransferSite,
LeaveAdmin,
DeleteAccount,
PasswordReset,
PasswordChange,

View file

@ -42,7 +42,6 @@ export interface Site {
id: number;
name: string;
sidebar?: string;
creator_id: number;
published: string;
updated?: string;
enable_downvotes: boolean;

View file

@ -74,11 +74,11 @@ import {
GetSite,
GetSiteConfig,
GetUnreadRegistrationApplicationCount,
LeaveAdmin,
ListRegistrationApplications,
ResolveObject,
SaveSiteConfig,
Search,
TransferSite,
} from "./interfaces/api/site";
import { CommunityJoin, PostJoin, UserJoin } from "./interfaces/api/websocket";
import { UserOperation } from "./interfaces/others";
@ -389,10 +389,10 @@ export class LemmyWebsocket {
}
/**
* Transfer your site to another user.
* Leave the Site admins.
*/
transferSite(form: TransferSite) {
return wrapper(UserOperation.TransferSite, form);
leaveAdmin(form: LeaveAdmin) {
return wrapper(UserOperation.LeaveAdmin, form);
}
/**