From 576e17c50b7a726055b81ee3467640b37eee8c94 Mon Sep 17 00:00:00 2001 From: Dessalines Date: Wed, 22 Jun 2022 16:13:13 -0400 Subject: [PATCH 1/2] Remove save and get SiteConfig. Fixes #68 --- src/http.ts | 31 ------------------------------- src/interfaces/api/site.ts | 21 --------------------- src/interfaces/others.ts | 2 -- src/websocket.ts | 16 ---------------- 4 files changed, 70 deletions(-) diff --git a/src/http.ts b/src/http.ts index 487d9312..dbcb7b00 100644 --- a/src/http.ts +++ b/src/http.ts @@ -109,8 +109,6 @@ import { GetModlog, GetModlogResponse, GetSite, - GetSiteConfig, - GetSiteConfigResponse, GetSiteResponse, GetUnreadRegistrationApplicationCount, GetUnreadRegistrationApplicationCountResponse, @@ -120,7 +118,6 @@ import { RegistrationApplicationResponse, ResolveObject, ResolveObjectResponse, - SaveSiteConfig, Search, SearchResponse, SiteResponse, @@ -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. * diff --git a/src/interfaces/api/site.ts b/src/interfaces/api/site.ts index fe2eae1b..b7089ecc 100644 --- a/src/interfaces/api/site.ts +++ b/src/interfaces/api/site.ts @@ -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 }) diff --git a/src/interfaces/others.ts b/src/interfaces/others.ts index ad58c342..b88f2bc0 100644 --- a/src/interfaces/others.ts +++ b/src/interfaces/others.ts @@ -67,8 +67,6 @@ export enum UserOperation { GetPrivateMessages, UserJoin, GetComments, - GetSiteConfig, - SaveSiteConfig, PostJoin, CommunityJoin, ChangePassword, diff --git a/src/websocket.ts b/src/websocket.ts index 4c7822b1..b3b97d75 100644 --- a/src/websocket.ts +++ b/src/websocket.ts @@ -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"; @@ -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. */ @@ -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. */ From 20fc5df35ca78caae4bd06f8aa2d9b96a57a3efc Mon Sep 17 00:00:00 2001 From: Dessalines Date: Thu, 23 Jun 2022 09:58:03 -0400 Subject: [PATCH 2/2] v0.17.0-rc.32 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 39a85106..99d20047 100644 --- a/package.json +++ b/package.json @@ -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 ", "license": "AGPL-3.0", "main": "./dist/index.js",