Skip to main content
Glama

Storyden

by Southclaws
Mozilla Public License 2.0
229
accounts.ts21.4 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 useSwr from "swr"; import type { Arguments, Key, SWRConfiguration } from "swr"; import useSWRMutation from "swr/mutation"; import type { SWRMutationConfiguration } from "swr/mutation"; import { fetcher } from "../client"; import type { AccountAuthProviderListOKResponse, AccountEmailAddBody, AccountEmailUpdateOKResponse, AccountGetAvatarResponse, AccountGetOKResponse, AccountSetAvatarBody, AccountUpdateBody, AccountUpdateOKResponse, BadRequestResponse, ForbiddenResponse, InternalServerErrorResponse, NotFoundResponse, NotModifiedResponse, UnauthorisedResponse, } from "../openapi-schema"; /** * Get the information for the currently authenticated account. */ export const accountGet = () => { return fetcher<AccountGetOKResponse>({ url: `/accounts`, method: "GET" }); }; export const getAccountGetKey = () => [`/accounts`] as const; export type AccountGetQueryResult = NonNullable< Awaited<ReturnType<typeof accountGet>> >; export type AccountGetQueryError = | NotModifiedResponse | UnauthorisedResponse | NotFoundResponse | InternalServerErrorResponse; export const useAccountGet = < TError = | NotModifiedResponse | UnauthorisedResponse | NotFoundResponse | InternalServerErrorResponse, >(options?: { swr?: SWRConfiguration<Awaited<ReturnType<typeof accountGet>>, TError> & { swrKey?: Key; enabled?: boolean; }; }) => { const { swr: swrOptions } = options ?? {}; const isEnabled = swrOptions?.enabled !== false; const swrKey = swrOptions?.swrKey ?? (() => (isEnabled ? getAccountGetKey() : null)); const swrFn = () => accountGet(); const query = useSwr<Awaited<ReturnType<typeof swrFn>>, TError>( swrKey, swrFn, swrOptions, ); return { swrKey, ...query, }; }; /** * Update the information for the currently authenticated account. */ export const accountUpdate = (accountUpdateBody: AccountUpdateBody) => { return fetcher<AccountUpdateOKResponse>({ url: `/accounts`, method: "PATCH", headers: { "Content-Type": "application/json" }, data: accountUpdateBody, }); }; export const getAccountUpdateMutationFetcher = () => { return ( _: Key, { arg }: { arg: AccountUpdateBody }, ): Promise<AccountUpdateOKResponse> => { return accountUpdate(arg); }; }; export const getAccountUpdateMutationKey = () => [`/accounts`] as const; export type AccountUpdateMutationResult = NonNullable< Awaited<ReturnType<typeof accountUpdate>> >; export type AccountUpdateMutationError = | UnauthorisedResponse | NotFoundResponse | InternalServerErrorResponse; export const useAccountUpdate = < TError = | UnauthorisedResponse | NotFoundResponse | InternalServerErrorResponse, >(options?: { swr?: SWRMutationConfiguration< Awaited<ReturnType<typeof accountUpdate>>, TError, Key, AccountUpdateBody, Awaited<ReturnType<typeof accountUpdate>> > & { swrKey?: string }; }) => { const { swr: swrOptions } = options ?? {}; const swrKey = swrOptions?.swrKey ?? getAccountUpdateMutationKey(); const swrFn = getAccountUpdateMutationFetcher(); const query = useSWRMutation(swrKey, swrFn, swrOptions); return { swrKey, ...query, }; }; /** * Get detailed account information by ID. Requires either the permissions VIEW_ACCOUNTS or ADMINISTRATOR. Users with VIEW_ACCOUNTS can view any account that is not ADMINISTRATOR including those with VIEW_ACCOUNTS. Only members with ADMINISTRATOR can view other ADMINISTRATOR accounts. */ export const accountView = (accountId: string) => { return fetcher<AccountGetOKResponse>({ url: `/accounts/${accountId}`, method: "GET", }); }; export const getAccountViewKey = (accountId: string) => [`/accounts/${accountId}`] as const; export type AccountViewQueryResult = NonNullable< Awaited<ReturnType<typeof accountView>> >; export type AccountViewQueryError = | UnauthorisedResponse | ForbiddenResponse | NotFoundResponse | InternalServerErrorResponse; export const useAccountView = < TError = | UnauthorisedResponse | ForbiddenResponse | NotFoundResponse | InternalServerErrorResponse, >( accountId: string, options?: { swr?: SWRConfiguration<Awaited<ReturnType<typeof accountView>>, TError> & { swrKey?: Key; enabled?: boolean; }; }, ) => { const { swr: swrOptions } = options ?? {}; const isEnabled = swrOptions?.enabled !== false && !!accountId; const swrKey = swrOptions?.swrKey ?? (() => (isEnabled ? getAccountViewKey(accountId) : null)); const swrFn = () => accountView(accountId); const query = useSwr<Awaited<ReturnType<typeof swrFn>>, TError>( swrKey, swrFn, swrOptions, ); return { swrKey, ...query, }; }; /** * Retrieve a list of authentication providers with a flag indicating which ones are active for the currently authenticated account. */ export const accountAuthProviderList = () => { return fetcher<AccountAuthProviderListOKResponse>({ url: `/accounts/self/auth-methods`, method: "GET", }); }; export const getAccountAuthProviderListKey = () => [`/accounts/self/auth-methods`] as const; export type AccountAuthProviderListQueryResult = NonNullable< Awaited<ReturnType<typeof accountAuthProviderList>> >; export type AccountAuthProviderListQueryError = | BadRequestResponse | InternalServerErrorResponse; export const useAccountAuthProviderList = < TError = BadRequestResponse | InternalServerErrorResponse, >(options?: { swr?: SWRConfiguration< Awaited<ReturnType<typeof accountAuthProviderList>>, TError > & { swrKey?: Key; enabled?: boolean }; }) => { const { swr: swrOptions } = options ?? {}; const isEnabled = swrOptions?.enabled !== false; const swrKey = swrOptions?.swrKey ?? (() => (isEnabled ? getAccountAuthProviderListKey() : null)); const swrFn = () => accountAuthProviderList(); const query = useSwr<Awaited<ReturnType<typeof swrFn>>, TError>( swrKey, swrFn, swrOptions, ); return { swrKey, ...query, }; }; /** * Deletes the specified authentication method from the account. This is irreversible however if this authentication method is the only remaining method for the account, this operation will fail with a 400 bad request. */ export const accountAuthMethodDelete = (authMethodId: string) => { return fetcher<AccountAuthProviderListOKResponse>({ url: `/accounts/self/auth-methods/${authMethodId}`, method: "DELETE", }); }; export const getAccountAuthMethodDeleteMutationFetcher = ( authMethodId: string, ) => { return ( _: Key, __: { arg: Arguments }, ): Promise<AccountAuthProviderListOKResponse> => { return accountAuthMethodDelete(authMethodId); }; }; export const getAccountAuthMethodDeleteMutationKey = (authMethodId: string) => [`/accounts/self/auth-methods/${authMethodId}`] as const; export type AccountAuthMethodDeleteMutationResult = NonNullable< Awaited<ReturnType<typeof accountAuthMethodDelete>> >; export type AccountAuthMethodDeleteMutationError = | BadRequestResponse | InternalServerErrorResponse; export const useAccountAuthMethodDelete = < TError = BadRequestResponse | InternalServerErrorResponse, >( authMethodId: string, options?: { swr?: SWRMutationConfiguration< Awaited<ReturnType<typeof accountAuthMethodDelete>>, TError, Key, Arguments, Awaited<ReturnType<typeof accountAuthMethodDelete>> > & { swrKey?: string }; }, ) => { const { swr: swrOptions } = options ?? {}; const swrKey = swrOptions?.swrKey ?? getAccountAuthMethodDeleteMutationKey(authMethodId); const swrFn = getAccountAuthMethodDeleteMutationFetcher(authMethodId); const query = useSWRMutation(swrKey, swrFn, swrOptions); return { swrKey, ...query, }; }; /** * Add an email address to the authenticated account. */ export const accountEmailAdd = (accountEmailAddBody: AccountEmailAddBody) => { return fetcher<AccountEmailUpdateOKResponse>({ url: `/accounts/self/emails`, method: "POST", headers: { "Content-Type": "application/json" }, data: accountEmailAddBody, }); }; export const getAccountEmailAddMutationFetcher = () => { return ( _: Key, { arg }: { arg: AccountEmailAddBody }, ): Promise<AccountEmailUpdateOKResponse> => { return accountEmailAdd(arg); }; }; export const getAccountEmailAddMutationKey = () => [`/accounts/self/emails`] as const; export type AccountEmailAddMutationResult = NonNullable< Awaited<ReturnType<typeof accountEmailAdd>> >; export type AccountEmailAddMutationError = | BadRequestResponse | UnauthorisedResponse | InternalServerErrorResponse; export const useAccountEmailAdd = < TError = | BadRequestResponse | UnauthorisedResponse | InternalServerErrorResponse, >(options?: { swr?: SWRMutationConfiguration< Awaited<ReturnType<typeof accountEmailAdd>>, TError, Key, AccountEmailAddBody, Awaited<ReturnType<typeof accountEmailAdd>> > & { swrKey?: string }; }) => { const { swr: swrOptions } = options ?? {}; const swrKey = swrOptions?.swrKey ?? getAccountEmailAddMutationKey(); const swrFn = getAccountEmailAddMutationFetcher(); const query = useSWRMutation(swrKey, swrFn, swrOptions); return { swrKey, ...query, }; }; /** * Remove an email address from the authenticated account. */ export const accountEmailRemove = (emailAddressId: string) => { return fetcher<void>({ url: `/accounts/self/emails/${emailAddressId}`, method: "DELETE", }); }; export const getAccountEmailRemoveMutationFetcher = ( emailAddressId: string, ) => { return (_: Key, __: { arg: Arguments }): Promise<void> => { return accountEmailRemove(emailAddressId); }; }; export const getAccountEmailRemoveMutationKey = (emailAddressId: string) => [`/accounts/self/emails/${emailAddressId}`] as const; export type AccountEmailRemoveMutationResult = NonNullable< Awaited<ReturnType<typeof accountEmailRemove>> >; export type AccountEmailRemoveMutationError = | BadRequestResponse | UnauthorisedResponse | InternalServerErrorResponse; export const useAccountEmailRemove = < TError = | BadRequestResponse | UnauthorisedResponse | InternalServerErrorResponse, >( emailAddressId: string, options?: { swr?: SWRMutationConfiguration< Awaited<ReturnType<typeof accountEmailRemove>>, TError, Key, Arguments, Awaited<ReturnType<typeof accountEmailRemove>> > & { swrKey?: string }; }, ) => { const { swr: swrOptions } = options ?? {}; const swrKey = swrOptions?.swrKey ?? getAccountEmailRemoveMutationKey(emailAddressId); const swrFn = getAccountEmailRemoveMutationFetcher(emailAddressId); const query = useSWRMutation(swrKey, swrFn, swrOptions); return { swrKey, ...query, }; }; /** * Upload an avatar for the authenticated account. */ export const accountSetAvatar = ( accountSetAvatarBody: AccountSetAvatarBody, ) => { return fetcher<void>({ url: `/accounts/self/avatar`, method: "POST", headers: { "Content-Type": "application/octet-stream" }, data: accountSetAvatarBody, }); }; export const getAccountSetAvatarMutationFetcher = () => { return (_: Key, { arg }: { arg: AccountSetAvatarBody }): Promise<void> => { return accountSetAvatar(arg); }; }; export const getAccountSetAvatarMutationKey = () => [`/accounts/self/avatar`] as const; export type AccountSetAvatarMutationResult = NonNullable< Awaited<ReturnType<typeof accountSetAvatar>> >; export type AccountSetAvatarMutationError = | UnauthorisedResponse | NotFoundResponse | InternalServerErrorResponse; export const useAccountSetAvatar = < TError = | UnauthorisedResponse | NotFoundResponse | InternalServerErrorResponse, >(options?: { swr?: SWRMutationConfiguration< Awaited<ReturnType<typeof accountSetAvatar>>, TError, Key, AccountSetAvatarBody, Awaited<ReturnType<typeof accountSetAvatar>> > & { swrKey?: string }; }) => { const { swr: swrOptions } = options ?? {}; const swrKey = swrOptions?.swrKey ?? getAccountSetAvatarMutationKey(); const swrFn = getAccountSetAvatarMutationFetcher(); const query = useSWRMutation(swrKey, swrFn, swrOptions); return { swrKey, ...query, }; }; /** * Get an avatar for the specified account. */ export const accountGetAvatar = (accountHandle: string) => { return fetcher<AccountGetAvatarResponse>({ url: `/accounts/${accountHandle}/avatar`, method: "GET", }); }; export const getAccountGetAvatarKey = (accountHandle: string) => [`/accounts/${accountHandle}/avatar`] as const; export type AccountGetAvatarQueryResult = NonNullable< Awaited<ReturnType<typeof accountGetAvatar>> >; export type AccountGetAvatarQueryError = | UnauthorisedResponse | NotFoundResponse | InternalServerErrorResponse; export const useAccountGetAvatar = < TError = | UnauthorisedResponse | NotFoundResponse | InternalServerErrorResponse, >( accountHandle: string, options?: { swr?: SWRConfiguration< Awaited<ReturnType<typeof accountGetAvatar>>, TError > & { swrKey?: Key; enabled?: boolean }; }, ) => { const { swr: swrOptions } = options ?? {}; const isEnabled = swrOptions?.enabled !== false && !!accountHandle; const swrKey = swrOptions?.swrKey ?? (() => (isEnabled ? getAccountGetAvatarKey(accountHandle) : null)); const swrFn = () => accountGetAvatar(accountHandle); const query = useSwr<Awaited<ReturnType<typeof swrFn>>, TError>( swrKey, swrFn, swrOptions, ); return { swrKey, ...query, }; }; /** * Adds a role to an account. Members without the MANAGE_ROLES permission cannot use this operation. */ export const accountAddRole = (accountHandle: string, roleId: string) => { return fetcher<AccountUpdateOKResponse>({ url: `/accounts/${accountHandle}/roles/${roleId}`, method: "PUT", }); }; export const getAccountAddRoleMutationFetcher = ( accountHandle: string, roleId: string, ) => { return (_: Key, __: { arg: Arguments }): Promise<AccountUpdateOKResponse> => { return accountAddRole(accountHandle, roleId); }; }; export const getAccountAddRoleMutationKey = ( accountHandle: string, roleId: string, ) => [`/accounts/${accountHandle}/roles/${roleId}`] as const; export type AccountAddRoleMutationResult = NonNullable< Awaited<ReturnType<typeof accountAddRole>> >; export type AccountAddRoleMutationError = | UnauthorisedResponse | NotFoundResponse | InternalServerErrorResponse; export const useAccountAddRole = < TError = | UnauthorisedResponse | NotFoundResponse | InternalServerErrorResponse, >( accountHandle: string, roleId: string, options?: { swr?: SWRMutationConfiguration< Awaited<ReturnType<typeof accountAddRole>>, TError, Key, Arguments, Awaited<ReturnType<typeof accountAddRole>> > & { swrKey?: string }; }, ) => { const { swr: swrOptions } = options ?? {}; const swrKey = swrOptions?.swrKey ?? getAccountAddRoleMutationKey(accountHandle, roleId); const swrFn = getAccountAddRoleMutationFetcher(accountHandle, roleId); const query = useSWRMutation(swrKey, swrFn, swrOptions); return { swrKey, ...query, }; }; /** * Removes a role from an account. Members without the MANAGE_ROLES cannot use this operation. Admins cannot remove the admin role from themselves. */ export const accountRemoveRole = (accountHandle: string, roleId: string) => { return fetcher<AccountUpdateOKResponse>({ url: `/accounts/${accountHandle}/roles/${roleId}`, method: "DELETE", }); }; export const getAccountRemoveRoleMutationFetcher = ( accountHandle: string, roleId: string, ) => { return (_: Key, __: { arg: Arguments }): Promise<AccountUpdateOKResponse> => { return accountRemoveRole(accountHandle, roleId); }; }; export const getAccountRemoveRoleMutationKey = ( accountHandle: string, roleId: string, ) => [`/accounts/${accountHandle}/roles/${roleId}`] as const; export type AccountRemoveRoleMutationResult = NonNullable< Awaited<ReturnType<typeof accountRemoveRole>> >; export type AccountRemoveRoleMutationError = | UnauthorisedResponse | NotFoundResponse | InternalServerErrorResponse; export const useAccountRemoveRole = < TError = | UnauthorisedResponse | NotFoundResponse | InternalServerErrorResponse, >( accountHandle: string, roleId: string, options?: { swr?: SWRMutationConfiguration< Awaited<ReturnType<typeof accountRemoveRole>>, TError, Key, Arguments, Awaited<ReturnType<typeof accountRemoveRole>> > & { swrKey?: string }; }, ) => { const { swr: swrOptions } = options ?? {}; const swrKey = swrOptions?.swrKey ?? getAccountRemoveRoleMutationKey(accountHandle, roleId); const swrFn = getAccountRemoveRoleMutationFetcher(accountHandle, roleId); const query = useSWRMutation(swrKey, swrFn, swrOptions); return { swrKey, ...query, }; }; /** * Desgiantes the specified role as a badge for the profile. Only one role may be set as a badge for the profile. Setting a role as a badge is entirely aesthetic and does not grant any additional permissions. Roles may be created without any permissions in order to be used as badges. */ export const accountRoleSetBadge = (accountHandle: string, roleId: string) => { return fetcher<AccountUpdateOKResponse>({ url: `/accounts/${accountHandle}/roles/${roleId}/badge`, method: "PUT", }); }; export const getAccountRoleSetBadgeMutationFetcher = ( accountHandle: string, roleId: string, ) => { return (_: Key, __: { arg: Arguments }): Promise<AccountUpdateOKResponse> => { return accountRoleSetBadge(accountHandle, roleId); }; }; export const getAccountRoleSetBadgeMutationKey = ( accountHandle: string, roleId: string, ) => [`/accounts/${accountHandle}/roles/${roleId}/badge`] as const; export type AccountRoleSetBadgeMutationResult = NonNullable< Awaited<ReturnType<typeof accountRoleSetBadge>> >; export type AccountRoleSetBadgeMutationError = | UnauthorisedResponse | NotFoundResponse | InternalServerErrorResponse; export const useAccountRoleSetBadge = < TError = | UnauthorisedResponse | NotFoundResponse | InternalServerErrorResponse, >( accountHandle: string, roleId: string, options?: { swr?: SWRMutationConfiguration< Awaited<ReturnType<typeof accountRoleSetBadge>>, TError, Key, Arguments, Awaited<ReturnType<typeof accountRoleSetBadge>> > & { swrKey?: string }; }, ) => { const { swr: swrOptions } = options ?? {}; const swrKey = swrOptions?.swrKey ?? getAccountRoleSetBadgeMutationKey(accountHandle, roleId); const swrFn = getAccountRoleSetBadgeMutationFetcher(accountHandle, roleId); const query = useSWRMutation(swrKey, swrFn, swrOptions); return { swrKey, ...query, }; }; /** * Removes the badge from the profile. This does not remove the role from the account, only the visual badge-status representation of the role. */ export const accountRoleRemoveBadge = ( accountHandle: string, roleId: string, ) => { return fetcher<AccountUpdateOKResponse>({ url: `/accounts/${accountHandle}/roles/${roleId}/badge`, method: "DELETE", }); }; export const getAccountRoleRemoveBadgeMutationFetcher = ( accountHandle: string, roleId: string, ) => { return (_: Key, __: { arg: Arguments }): Promise<AccountUpdateOKResponse> => { return accountRoleRemoveBadge(accountHandle, roleId); }; }; export const getAccountRoleRemoveBadgeMutationKey = ( accountHandle: string, roleId: string, ) => [`/accounts/${accountHandle}/roles/${roleId}/badge`] as const; export type AccountRoleRemoveBadgeMutationResult = NonNullable< Awaited<ReturnType<typeof accountRoleRemoveBadge>> >; export type AccountRoleRemoveBadgeMutationError = | UnauthorisedResponse | NotFoundResponse | InternalServerErrorResponse; export const useAccountRoleRemoveBadge = < TError = | UnauthorisedResponse | NotFoundResponse | InternalServerErrorResponse, >( accountHandle: string, roleId: string, options?: { swr?: SWRMutationConfiguration< Awaited<ReturnType<typeof accountRoleRemoveBadge>>, TError, Key, Arguments, Awaited<ReturnType<typeof accountRoleRemoveBadge>> > & { swrKey?: string }; }, ) => { const { swr: swrOptions } = options ?? {}; const swrKey = swrOptions?.swrKey ?? getAccountRoleRemoveBadgeMutationKey(accountHandle, roleId); const swrFn = getAccountRoleRemoveBadgeMutationFetcher(accountHandle, roleId); const query = useSWRMutation(swrKey, swrFn, swrOptions); return { swrKey, ...query, }; };

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/Southclaws/storyden'

If you have feedback or need assistance with the MCP directory API, please join our Discord server