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

Remove save and get SiteConfig. Fixes #68 #69

Merged
merged 2 commits into from
Jun 23, 2022
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
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "lemmy-js-client",
"description": "A javascript / typescript client for Lemmy",
"version": "0.17.0-rc.31",
"version": "0.17.0-rc.32",
"author": "Dessalines <tyhou13@gmx.com>",
"license": "AGPL-3.0",
"main": "./dist/index.js",
Expand Down
31 changes: 0 additions & 31 deletions src/http.ts
Original file line number Diff line number Diff line change
Expand Up @@ -109,8 +109,6 @@ import {
GetModlog,
GetModlogResponse,
GetSite,
GetSiteConfig,
GetSiteConfigResponse,
GetSiteResponse,
GetUnreadRegistrationApplicationCount,
GetUnreadRegistrationApplicationCountResponse,
Expand All @@ -120,7 +118,6 @@ import {
RegistrationApplicationResponse,
ResolveObject,
ResolveObjectResponse,
SaveSiteConfig,
Search,
SearchResponse,
SiteResponse,
Expand Down Expand Up @@ -194,34 +191,6 @@ export class LemmyHttp {
);
}

/**
* Get your site configuration.
*
* `HTTP.GET /site/config`
*/
async getSiteConfig(form: GetSiteConfig) {
return this.wrapper(
HttpType.Get,
"/site/config",
form,
GetSiteConfigResponse
);
}

/**
* Save your site config.
*
* `HTTP.PUT /site/config`
*/
async saveSiteConfig(form: SaveSiteConfig) {
return this.wrapper(
HttpType.Put,
"/site/config",
form,
GetSiteConfigResponse
);
}

/**
* Get the modlog.
*
Expand Down
21 changes: 0 additions & 21 deletions src/interfaces/api/site.ts
Original file line number Diff line number Diff line change
Expand Up @@ -347,27 +347,6 @@ export class LeaveAdmin {
}
}

export class GetSiteConfig {
auth: string;

constructor(init: GetSiteConfig) {
Object.assign(this, init);
}
}

export class GetSiteConfigResponse {
config_hjson: string;
}

export class SaveSiteConfig {
config_hjson: string;
auth: string;

constructor(init: SaveSiteConfig) {
Object.assign(this, init);
}
}

export class FederatedInstances {
linked: string[];
@Transform(({ value }) => toOption(value), { toClassOnly: true })
Expand Down
2 changes: 0 additions & 2 deletions src/interfaces/others.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,6 @@ export enum UserOperation {
GetPrivateMessages,
UserJoin,
GetComments,
GetSiteConfig,
SaveSiteConfig,
PostJoin,
CommunityJoin,
ChangePassword,
Expand Down
16 changes: 0 additions & 16 deletions src/websocket.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,12 +74,10 @@ import {
EditSite,
GetModlog,
GetSite,
GetSiteConfig,
GetUnreadRegistrationApplicationCount,
LeaveAdmin,
ListRegistrationApplications,
ResolveObject,
SaveSiteConfig,
Search,
} from "./interfaces/api/site";
import { CommunityJoin, PostJoin, UserJoin } from "./interfaces/api/websocket";
Expand Down Expand Up @@ -504,13 +502,6 @@ export class LemmyWebsocket {
return wrapper(UserOperation.GetSite, form);
}

/**
* Get your site configuration.
*/
getSiteConfig(form: GetSiteConfig) {
return wrapper(UserOperation.GetSiteConfig, form);
}

/**
* Search lemmy.
*/
Expand Down Expand Up @@ -623,13 +614,6 @@ export class LemmyWebsocket {
return wrapper(UserOperation.GetPrivateMessages, form);
}

/**
* Save your site config.
*/
saveSiteConfig(form: SaveSiteConfig) {
return wrapper(UserOperation.SaveSiteConfig, form);
}

/**
* Block a person.
*/
Expand Down