1 /* tslint:disable:no-unused-expression */
3 import { makeDeleteRequest, makePostBodyRequest } from '../requests/requests'
4 import { makeGetRequest } from '../requests/requests'
6 function getAccountBlocklistByAccount (
12 statusCodeExpected = 200
14 const path = '/api/v1/users/me/blocklist/accounts'
16 return makeGetRequest({
19 query: { start, count, sort },
25 function addAccountToAccountBlocklist (url: string, token: string, accountToBlock: string, statusCodeExpected = 204) {
26 const path = '/api/v1/users/me/blocklist/accounts'
28 return makePostBodyRequest({
33 accountName: accountToBlock
39 function removeAccountFromAccountBlocklist (url: string, token: string, accountToUnblock: string, statusCodeExpected = 204) {
40 const path = '/api/v1/users/me/blocklist/accounts/' + accountToUnblock
42 return makeDeleteRequest({
50 function getServerBlocklistByAccount (
56 statusCodeExpected = 200
58 const path = '/api/v1/users/me/blocklist/servers'
60 return makeGetRequest({
63 query: { start, count, sort },
69 function addServerToAccountBlocklist (url: string, token: string, serverToBlock: string, statusCodeExpected = 204) {
70 const path = '/api/v1/users/me/blocklist/servers'
72 return makePostBodyRequest({
83 function removeServerFromAccountBlocklist (url: string, token: string, serverToBlock: string, statusCodeExpected = 204) {
84 const path = '/api/v1/users/me/blocklist/servers/' + serverToBlock
86 return makeDeleteRequest({
94 function getAccountBlocklistByServer (
100 statusCodeExpected = 200
102 const path = '/api/v1/server/blocklist/accounts'
104 return makeGetRequest({
107 query: { start, count, sort },
113 function addAccountToServerBlocklist (url: string, token: string, accountToBlock: string, statusCodeExpected = 204) {
114 const path = '/api/v1/server/blocklist/accounts'
116 return makePostBodyRequest({
121 accountName: accountToBlock
127 function removeAccountFromServerBlocklist (url: string, token: string, accountToUnblock: string, statusCodeExpected = 204) {
128 const path = '/api/v1/server/blocklist/accounts/' + accountToUnblock
130 return makeDeleteRequest({
138 function getServerBlocklistByServer (
144 statusCodeExpected = 200
146 const path = '/api/v1/server/blocklist/servers'
148 return makeGetRequest({
151 query: { start, count, sort },
157 function addServerToServerBlocklist (url: string, token: string, serverToBlock: string, statusCodeExpected = 204) {
158 const path = '/api/v1/server/blocklist/servers'
160 return makePostBodyRequest({
171 function removeServerFromServerBlocklist (url: string, token: string, serverToBlock: string, statusCodeExpected = 204) {
172 const path = '/api/v1/server/blocklist/servers/' + serverToBlock
174 return makeDeleteRequest({
182 // ---------------------------------------------------------------------------
185 getAccountBlocklistByAccount,
186 addAccountToAccountBlocklist,
187 removeAccountFromAccountBlocklist,
188 getServerBlocklistByAccount,
189 addServerToAccountBlocklist,
190 removeServerFromAccountBlocklist,
192 getAccountBlocklistByServer,
193 addAccountToServerBlocklist,
194 removeAccountFromServerBlocklist,
195 getServerBlocklistByServer,
196 addServerToServerBlocklist,
197 removeServerFromServerBlocklist