admin.ts•4.12 kB
/**
* Generated by orval v7.2.0 🍺
* Do not edit manually.
* storyden
* Storyden social API for building community driven platforms.
The Storyden API does not adhere to semantic versioning but instead applies a rolling strategy with deprecations and minimal breaking changes. This has been done mainly for a simpler development process and it may be changed to a more fixed versioning strategy in the future. Ultimately, the primary way Storyden tracks versions is dates, there are no set release tags currently.
* OpenAPI spec version: v1.25.8-canary
*/
import type {
AccountGetOKResponse,
AdminAccessKeyListOKResponse,
AdminSettingsUpdateBody,
AdminSettingsUpdateOKResponse,
NoContentResponse,
} from "../openapi-schema";
import { fetcher } from "../server";
/**
* Update non-env configuration settings for installation.
*/
export type adminSettingsUpdateResponse = {
data: AdminSettingsUpdateOKResponse;
status: number;
};
export const getAdminSettingsUpdateUrl = () => {
return `/admin`;
};
export const adminSettingsUpdate = async (
adminSettingsUpdateBody: AdminSettingsUpdateBody,
options?: RequestInit,
): Promise<adminSettingsUpdateResponse> => {
return fetcher<Promise<adminSettingsUpdateResponse>>(
getAdminSettingsUpdateUrl(),
{
...options,
method: "PATCH",
headers: { "Content-Type": "application/json", ...options?.headers },
body: JSON.stringify(adminSettingsUpdateBody),
},
);
};
/**
* Suspend an account - soft delete. This disables the ability for the
account owner to log in and use the platform. It keeps the account on
record for linkage to content so UI doesn't break. It does not change
anything else about the account such as the avatar, name, etc.
*/
export type adminAccountBanCreateResponse = {
data: AccountGetOKResponse;
status: number;
};
export const getAdminAccountBanCreateUrl = (accountHandle: string) => {
return `/admin/bans/${accountHandle}`;
};
export const adminAccountBanCreate = async (
accountHandle: string,
options?: RequestInit,
): Promise<adminAccountBanCreateResponse> => {
return fetcher<Promise<adminAccountBanCreateResponse>>(
getAdminAccountBanCreateUrl(accountHandle),
{
...options,
method: "POST",
},
);
};
/**
* Given the account is suspended, remove the suspended state.
*/
export type adminAccountBanRemoveResponse = {
data: AccountGetOKResponse;
status: number;
};
export const getAdminAccountBanRemoveUrl = (accountHandle: string) => {
return `/admin/bans/${accountHandle}`;
};
export const adminAccountBanRemove = async (
accountHandle: string,
options?: RequestInit,
): Promise<adminAccountBanRemoveResponse> => {
return fetcher<Promise<adminAccountBanRemoveResponse>>(
getAdminAccountBanRemoveUrl(accountHandle),
{
...options,
method: "DELETE",
},
);
};
/**
* List all access keys for the entire instance. This is only available to
admin accounts and is used to manage access keys from other accounts.
*/
export type adminAccessKeyListResponse = {
data: AdminAccessKeyListOKResponse;
status: number;
};
export const getAdminAccessKeyListUrl = () => {
return `/admin/access-keys`;
};
export const adminAccessKeyList = async (
options?: RequestInit,
): Promise<adminAccessKeyListResponse> => {
return fetcher<Promise<adminAccessKeyListResponse>>(
getAdminAccessKeyListUrl(),
{
...options,
method: "GET",
},
);
};
/**
* Revoke an access key. This will immediately invalidate the key and it
will no longer be usable for authentication.
*/
export type adminAccessKeyDeleteResponse = {
data: NoContentResponse;
status: number;
};
export const getAdminAccessKeyDeleteUrl = (accessKeyId: string) => {
return `/admin/access-keys/${accessKeyId}`;
};
export const adminAccessKeyDelete = async (
accessKeyId: string,
options?: RequestInit,
): Promise<adminAccessKeyDeleteResponse> => {
return fetcher<Promise<adminAccessKeyDeleteResponse>>(
getAdminAccessKeyDeleteUrl(accessKeyId),
{
...options,
method: "DELETE",
},
);
};