mirror of
https://github.com/memohai/Memoh.git
synced 2026-04-27 07:16:19 +09:00
1799 lines
65 KiB
TypeScript
1799 lines
65 KiB
TypeScript
// This file is auto-generated by @hey-api/openapi-ts
|
|
|
|
import { type _JSONValue, defineQueryOptions, type UseMutationOptions } from '@pinia/colada';
|
|
|
|
import { serializeQueryKeyValue } from '../client';
|
|
import { client } from '../client.gen';
|
|
import { deleteBotsByBotIdContainer, deleteBotsByBotIdContainerSkills, deleteBotsByBotIdMcpById, deleteBotsByBotIdMemory, deleteBotsByBotIdMemoryById, deleteBotsByBotIdScheduleById, deleteBotsByBotIdSettings, deleteBotsByBotIdSubagentsById, deleteBotsById, deleteBotsByIdChannelByPlatform, deleteBotsByIdMembersByUserId, deleteModelsById, deleteModelsModelByModelId, deleteProvidersById, deleteSearchProvidersById, getBots, getBotsByBotIdContainer, getBotsByBotIdContainerSkills, getBotsByBotIdContainerSnapshots, getBotsByBotIdMcp, getBotsByBotIdMcpById, getBotsByBotIdMcpExport, getBotsByBotIdMemory, getBotsByBotIdMemoryUsage, getBotsByBotIdMessages, getBotsByBotIdSchedule, getBotsByBotIdScheduleById, getBotsByBotIdSettings, getBotsByBotIdSubagents, getBotsByBotIdSubagentsById, getBotsByBotIdSubagentsByIdContext, getBotsByBotIdSubagentsByIdSkills, getBotsById, getBotsByIdChannelByPlatform, getBotsByIdChecks, getBotsByIdMembers, getChannels, getChannelsByPlatform, getModels, getModelsById, getModelsCount, getModelsModelByModelId, getProviders, getProvidersById, getProvidersByIdModels, getProvidersCount, getProvidersNameByName, getSearchProviders, getSearchProvidersById, getSearchProvidersMeta, getUsers, getUsersById, getUsersMe, getUsersMeChannelsByPlatform, getUsersMeIdentities, type Options, patchBotsByIdChannelByPlatformStatus, postAuthLogin, postBots, postBotsByBotIdContainer, postBotsByBotIdContainerSkills, postBotsByBotIdContainerSnapshots, postBotsByBotIdContainerStart, postBotsByBotIdContainerStop, postBotsByBotIdMcp, postBotsByBotIdMcpOpsBatchDelete, postBotsByBotIdMcpStdio, postBotsByBotIdMcpStdioByConnectionId, postBotsByBotIdMemory, postBotsByBotIdMemoryCompact, postBotsByBotIdMemoryRebuild, postBotsByBotIdMemorySearch, postBotsByBotIdSchedule, postBotsByBotIdSettings, postBotsByBotIdSubagents, postBotsByBotIdSubagentsByIdSkills, postBotsByBotIdTools, postBotsByIdChannelByPlatformSend, postBotsByIdChannelByPlatformSendChat, postEmbeddings, postModels, postProviders, postSearchProviders, postUsers, putBotsByBotIdMcpById, putBotsByBotIdMcpImport, putBotsByBotIdScheduleById, putBotsByBotIdSettings, putBotsByBotIdSubagentsById, putBotsByBotIdSubagentsByIdContext, putBotsByBotIdSubagentsByIdSkills, putBotsById, putBotsByIdChannelByPlatform, putBotsByIdMembers, putBotsByIdOwner, putModelsById, putModelsModelByModelId, putProvidersById, putSearchProvidersById, putUsersById, putUsersByIdPassword, putUsersMe, putUsersMeChannelsByPlatform, putUsersMePassword } from '../sdk.gen';
|
|
import type { DeleteBotsByBotIdContainerData, DeleteBotsByBotIdContainerError, DeleteBotsByBotIdContainerSkillsData, DeleteBotsByBotIdContainerSkillsError, DeleteBotsByBotIdContainerSkillsResponse, DeleteBotsByBotIdMcpByIdData, DeleteBotsByBotIdMcpByIdError, DeleteBotsByBotIdMemoryByIdData, DeleteBotsByBotIdMemoryByIdError, DeleteBotsByBotIdMemoryByIdResponse, DeleteBotsByBotIdMemoryData, DeleteBotsByBotIdMemoryError, DeleteBotsByBotIdMemoryResponse, DeleteBotsByBotIdScheduleByIdData, DeleteBotsByBotIdScheduleByIdError, DeleteBotsByBotIdSettingsData, DeleteBotsByBotIdSettingsError, DeleteBotsByBotIdSubagentsByIdData, DeleteBotsByBotIdSubagentsByIdError, DeleteBotsByIdChannelByPlatformData, DeleteBotsByIdChannelByPlatformError, DeleteBotsByIdData, DeleteBotsByIdError, DeleteBotsByIdMembersByUserIdData, DeleteBotsByIdMembersByUserIdError, DeleteBotsByIdResponse, DeleteModelsByIdData, DeleteModelsByIdError, DeleteModelsModelByModelIdData, DeleteModelsModelByModelIdError, DeleteProvidersByIdData, DeleteProvidersByIdError, DeleteSearchProvidersByIdData, DeleteSearchProvidersByIdError, GetBotsByBotIdContainerData, GetBotsByBotIdContainerSkillsData, GetBotsByBotIdContainerSnapshotsData, GetBotsByBotIdMcpByIdData, GetBotsByBotIdMcpData, GetBotsByBotIdMcpExportData, GetBotsByBotIdMemoryData, GetBotsByBotIdMemoryUsageData, GetBotsByBotIdMessagesData, GetBotsByBotIdScheduleByIdData, GetBotsByBotIdScheduleData, GetBotsByBotIdSettingsData, GetBotsByBotIdSubagentsByIdContextData, GetBotsByBotIdSubagentsByIdData, GetBotsByBotIdSubagentsByIdSkillsData, GetBotsByBotIdSubagentsData, GetBotsByIdChannelByPlatformData, GetBotsByIdChecksData, GetBotsByIdData, GetBotsByIdMembersData, GetBotsData, GetChannelsByPlatformData, GetChannelsData, GetModelsByIdData, GetModelsCountData, GetModelsData, GetModelsModelByModelIdData, GetProvidersByIdData, GetProvidersByIdModelsData, GetProvidersCountData, GetProvidersData, GetProvidersNameByNameData, GetSearchProvidersByIdData, GetSearchProvidersData, GetSearchProvidersMetaData, GetUsersByIdData, GetUsersData, GetUsersMeChannelsByPlatformData, GetUsersMeData, GetUsersMeIdentitiesData, PatchBotsByIdChannelByPlatformStatusData, PatchBotsByIdChannelByPlatformStatusError, PatchBotsByIdChannelByPlatformStatusResponse, PostAuthLoginData, PostAuthLoginError, PostAuthLoginResponse, PostBotsByBotIdContainerData, PostBotsByBotIdContainerError, PostBotsByBotIdContainerResponse, PostBotsByBotIdContainerSkillsData, PostBotsByBotIdContainerSkillsError, PostBotsByBotIdContainerSkillsResponse, PostBotsByBotIdContainerSnapshotsData, PostBotsByBotIdContainerSnapshotsError, PostBotsByBotIdContainerSnapshotsResponse, PostBotsByBotIdContainerStartData, PostBotsByBotIdContainerStartError, PostBotsByBotIdContainerStartResponse, PostBotsByBotIdContainerStopData, PostBotsByBotIdContainerStopError, PostBotsByBotIdContainerStopResponse, PostBotsByBotIdMcpData, PostBotsByBotIdMcpError, PostBotsByBotIdMcpOpsBatchDeleteData, PostBotsByBotIdMcpOpsBatchDeleteError, PostBotsByBotIdMcpResponse, PostBotsByBotIdMcpStdioByConnectionIdData, PostBotsByBotIdMcpStdioByConnectionIdError, PostBotsByBotIdMcpStdioByConnectionIdResponse, PostBotsByBotIdMcpStdioData, PostBotsByBotIdMcpStdioError, PostBotsByBotIdMcpStdioResponse, PostBotsByBotIdMemoryCompactData, PostBotsByBotIdMemoryCompactError, PostBotsByBotIdMemoryCompactResponse, PostBotsByBotIdMemoryData, PostBotsByBotIdMemoryError, PostBotsByBotIdMemoryRebuildData, PostBotsByBotIdMemoryRebuildError, PostBotsByBotIdMemoryRebuildResponse, PostBotsByBotIdMemoryResponse, PostBotsByBotIdMemorySearchData, PostBotsByBotIdMemorySearchError, PostBotsByBotIdMemorySearchResponse, PostBotsByBotIdScheduleData, PostBotsByBotIdScheduleError, PostBotsByBotIdScheduleResponse, PostBotsByBotIdSettingsData, PostBotsByBotIdSettingsError, PostBotsByBotIdSettingsResponse, PostBotsByBotIdSubagentsByIdSkillsData, PostBotsByBotIdSubagentsByIdSkillsError, PostBotsByBotIdSubagentsByIdSkillsResponse, PostBotsByBotIdSubagentsData, PostBotsByBotIdSubagentsError, PostBotsByBotIdSubagentsResponse, PostBotsByBotIdToolsData, PostBotsByBotIdToolsError, PostBotsByBotIdToolsResponse, PostBotsByIdChannelByPlatformSendChatData, PostBotsByIdChannelByPlatformSendChatError, PostBotsByIdChannelByPlatformSendChatResponse, PostBotsByIdChannelByPlatformSendData, PostBotsByIdChannelByPlatformSendError, PostBotsByIdChannelByPlatformSendResponse, PostBotsData, PostBotsError, PostBotsResponse, PostEmbeddingsData, PostEmbeddingsError, PostEmbeddingsResponse, PostModelsData, PostModelsError, PostModelsResponse, PostProvidersData, PostProvidersError, PostProvidersResponse, PostSearchProvidersData, PostSearchProvidersError, PostSearchProvidersResponse, PostUsersData, PostUsersError, PostUsersResponse, PutBotsByBotIdMcpByIdData, PutBotsByBotIdMcpByIdError, PutBotsByBotIdMcpByIdResponse, PutBotsByBotIdMcpImportData, PutBotsByBotIdMcpImportError, PutBotsByBotIdMcpImportResponse, PutBotsByBotIdScheduleByIdData, PutBotsByBotIdScheduleByIdError, PutBotsByBotIdScheduleByIdResponse, PutBotsByBotIdSettingsData, PutBotsByBotIdSettingsError, PutBotsByBotIdSettingsResponse, PutBotsByBotIdSubagentsByIdContextData, PutBotsByBotIdSubagentsByIdContextError, PutBotsByBotIdSubagentsByIdContextResponse, PutBotsByBotIdSubagentsByIdData, PutBotsByBotIdSubagentsByIdError, PutBotsByBotIdSubagentsByIdResponse, PutBotsByBotIdSubagentsByIdSkillsData, PutBotsByBotIdSubagentsByIdSkillsError, PutBotsByBotIdSubagentsByIdSkillsResponse, PutBotsByIdChannelByPlatformData, PutBotsByIdChannelByPlatformError, PutBotsByIdChannelByPlatformResponse, PutBotsByIdData, PutBotsByIdError, PutBotsByIdMembersData, PutBotsByIdMembersError, PutBotsByIdMembersResponse, PutBotsByIdOwnerData, PutBotsByIdOwnerError, PutBotsByIdOwnerResponse, PutBotsByIdResponse, PutModelsByIdData, PutModelsByIdError, PutModelsByIdResponse, PutModelsModelByModelIdData, PutModelsModelByModelIdError, PutModelsModelByModelIdResponse, PutProvidersByIdData, PutProvidersByIdError, PutProvidersByIdResponse, PutSearchProvidersByIdData, PutSearchProvidersByIdError, PutSearchProvidersByIdResponse, PutUsersByIdData, PutUsersByIdError, PutUsersByIdPasswordData, PutUsersByIdPasswordError, PutUsersByIdResponse, PutUsersMeChannelsByPlatformData, PutUsersMeChannelsByPlatformError, PutUsersMeChannelsByPlatformResponse, PutUsersMeData, PutUsersMeError, PutUsersMePasswordData, PutUsersMePasswordError, PutUsersMeResponse } from '../types.gen';
|
|
|
|
/**
|
|
* Login
|
|
*
|
|
* Validate user credentials and issue a JWT
|
|
*/
|
|
export const postAuthLoginMutation = (options?: Partial<Options<PostAuthLoginData>>): UseMutationOptions<PostAuthLoginResponse, Options<PostAuthLoginData>, PostAuthLoginError> => ({
|
|
mutation: async (vars) => {
|
|
const { data } = await postAuthLogin({
|
|
...options,
|
|
...vars,
|
|
throwOnError: true
|
|
});
|
|
return data;
|
|
}
|
|
});
|
|
|
|
export type QueryKey<TOptions extends Options> = [
|
|
Pick<TOptions, 'path'> & {
|
|
_id: string;
|
|
baseUrl?: _JSONValue;
|
|
body?: _JSONValue;
|
|
query?: _JSONValue;
|
|
tags?: _JSONValue;
|
|
}
|
|
];
|
|
|
|
const createQueryKey = <TOptions extends Options>(id: string, options?: TOptions, tags?: ReadonlyArray<string>): [
|
|
QueryKey<TOptions>[0]
|
|
] => {
|
|
const params: QueryKey<TOptions>[0] = { _id: id, baseUrl: options?.baseUrl || (options?.client ?? client).getConfig().baseUrl } as QueryKey<TOptions>[0];
|
|
if (tags) {
|
|
params.tags = tags as unknown as _JSONValue;
|
|
}
|
|
if (options?.body !== undefined) {
|
|
const normalizedBody = serializeQueryKeyValue(options.body);
|
|
if (normalizedBody !== undefined) {
|
|
params.body = normalizedBody;
|
|
}
|
|
}
|
|
if (options?.path) {
|
|
params.path = options.path;
|
|
}
|
|
if (options?.query !== undefined) {
|
|
const normalizedQuery = serializeQueryKeyValue(options.query);
|
|
if (normalizedQuery !== undefined) {
|
|
params.query = normalizedQuery;
|
|
}
|
|
}
|
|
return [params];
|
|
};
|
|
|
|
export const getBotsQueryKey = (options?: Options<GetBotsData>) => createQueryKey('getBots', options);
|
|
|
|
/**
|
|
* List bots
|
|
*
|
|
* List bots accessible to current user (admin can specify owner_id)
|
|
*/
|
|
export const getBotsQuery = defineQueryOptions((options?: Options<GetBotsData>) => ({
|
|
key: getBotsQueryKey(options),
|
|
query: async (context) => {
|
|
const { data } = await getBots({
|
|
...options,
|
|
...context,
|
|
throwOnError: true
|
|
});
|
|
return data;
|
|
}
|
|
}));
|
|
|
|
/**
|
|
* Create bot user
|
|
*
|
|
* Create a bot user owned by current user (or admin-specified owner)
|
|
*/
|
|
export const postBotsMutation = (options?: Partial<Options<PostBotsData>>): UseMutationOptions<PostBotsResponse, Options<PostBotsData>, PostBotsError> => ({
|
|
mutation: async (vars) => {
|
|
const { data } = await postBots({
|
|
...options,
|
|
...vars,
|
|
throwOnError: true
|
|
});
|
|
return data;
|
|
}
|
|
});
|
|
|
|
/**
|
|
* Delete MCP container for bot
|
|
*/
|
|
export const deleteBotsByBotIdContainerMutation = (options?: Partial<Options<DeleteBotsByBotIdContainerData>>): UseMutationOptions<unknown, Options<DeleteBotsByBotIdContainerData>, DeleteBotsByBotIdContainerError> => ({
|
|
mutation: async (vars) => {
|
|
const { data } = await deleteBotsByBotIdContainer({
|
|
...options,
|
|
...vars,
|
|
throwOnError: true
|
|
});
|
|
return data;
|
|
}
|
|
});
|
|
|
|
export const getBotsByBotIdContainerQueryKey = (options: Options<GetBotsByBotIdContainerData>) => createQueryKey('getBotsByBotIdContainer', options);
|
|
|
|
/**
|
|
* Get container info for bot
|
|
*/
|
|
export const getBotsByBotIdContainerQuery = defineQueryOptions((options: Options<GetBotsByBotIdContainerData>) => ({
|
|
key: getBotsByBotIdContainerQueryKey(options),
|
|
query: async (context) => {
|
|
const { data } = await getBotsByBotIdContainer({
|
|
...options,
|
|
...context,
|
|
throwOnError: true
|
|
});
|
|
return data;
|
|
}
|
|
}));
|
|
|
|
/**
|
|
* Create and start MCP container for bot
|
|
*/
|
|
export const postBotsByBotIdContainerMutation = (options?: Partial<Options<PostBotsByBotIdContainerData>>): UseMutationOptions<PostBotsByBotIdContainerResponse, Options<PostBotsByBotIdContainerData>, PostBotsByBotIdContainerError> => ({
|
|
mutation: async (vars) => {
|
|
const { data } = await postBotsByBotIdContainer({
|
|
...options,
|
|
...vars,
|
|
throwOnError: true
|
|
});
|
|
return data;
|
|
}
|
|
});
|
|
|
|
/**
|
|
* Delete skills from data directory
|
|
*/
|
|
export const deleteBotsByBotIdContainerSkillsMutation = (options?: Partial<Options<DeleteBotsByBotIdContainerSkillsData>>): UseMutationOptions<DeleteBotsByBotIdContainerSkillsResponse, Options<DeleteBotsByBotIdContainerSkillsData>, DeleteBotsByBotIdContainerSkillsError> => ({
|
|
mutation: async (vars) => {
|
|
const { data } = await deleteBotsByBotIdContainerSkills({
|
|
...options,
|
|
...vars,
|
|
throwOnError: true
|
|
});
|
|
return data;
|
|
}
|
|
});
|
|
|
|
export const getBotsByBotIdContainerSkillsQueryKey = (options: Options<GetBotsByBotIdContainerSkillsData>) => createQueryKey('getBotsByBotIdContainerSkills', options);
|
|
|
|
/**
|
|
* List skills from data directory
|
|
*/
|
|
export const getBotsByBotIdContainerSkillsQuery = defineQueryOptions((options: Options<GetBotsByBotIdContainerSkillsData>) => ({
|
|
key: getBotsByBotIdContainerSkillsQueryKey(options),
|
|
query: async (context) => {
|
|
const { data } = await getBotsByBotIdContainerSkills({
|
|
...options,
|
|
...context,
|
|
throwOnError: true
|
|
});
|
|
return data;
|
|
}
|
|
}));
|
|
|
|
/**
|
|
* Upload skills into data directory
|
|
*/
|
|
export const postBotsByBotIdContainerSkillsMutation = (options?: Partial<Options<PostBotsByBotIdContainerSkillsData>>): UseMutationOptions<PostBotsByBotIdContainerSkillsResponse, Options<PostBotsByBotIdContainerSkillsData>, PostBotsByBotIdContainerSkillsError> => ({
|
|
mutation: async (vars) => {
|
|
const { data } = await postBotsByBotIdContainerSkills({
|
|
...options,
|
|
...vars,
|
|
throwOnError: true
|
|
});
|
|
return data;
|
|
}
|
|
});
|
|
|
|
export const getBotsByBotIdContainerSnapshotsQueryKey = (options: Options<GetBotsByBotIdContainerSnapshotsData>) => createQueryKey('getBotsByBotIdContainerSnapshots', options);
|
|
|
|
/**
|
|
* List snapshots
|
|
*/
|
|
export const getBotsByBotIdContainerSnapshotsQuery = defineQueryOptions((options: Options<GetBotsByBotIdContainerSnapshotsData>) => ({
|
|
key: getBotsByBotIdContainerSnapshotsQueryKey(options),
|
|
query: async (context) => {
|
|
const { data } = await getBotsByBotIdContainerSnapshots({
|
|
...options,
|
|
...context,
|
|
throwOnError: true
|
|
});
|
|
return data;
|
|
}
|
|
}));
|
|
|
|
/**
|
|
* Create container snapshot for bot
|
|
*/
|
|
export const postBotsByBotIdContainerSnapshotsMutation = (options?: Partial<Options<PostBotsByBotIdContainerSnapshotsData>>): UseMutationOptions<PostBotsByBotIdContainerSnapshotsResponse, Options<PostBotsByBotIdContainerSnapshotsData>, PostBotsByBotIdContainerSnapshotsError> => ({
|
|
mutation: async (vars) => {
|
|
const { data } = await postBotsByBotIdContainerSnapshots({
|
|
...options,
|
|
...vars,
|
|
throwOnError: true
|
|
});
|
|
return data;
|
|
}
|
|
});
|
|
|
|
/**
|
|
* Start container task for bot
|
|
*/
|
|
export const postBotsByBotIdContainerStartMutation = (options?: Partial<Options<PostBotsByBotIdContainerStartData>>): UseMutationOptions<PostBotsByBotIdContainerStartResponse, Options<PostBotsByBotIdContainerStartData>, PostBotsByBotIdContainerStartError> => ({
|
|
mutation: async (vars) => {
|
|
const { data } = await postBotsByBotIdContainerStart({
|
|
...options,
|
|
...vars,
|
|
throwOnError: true
|
|
});
|
|
return data;
|
|
}
|
|
});
|
|
|
|
/**
|
|
* Stop container task for bot
|
|
*/
|
|
export const postBotsByBotIdContainerStopMutation = (options?: Partial<Options<PostBotsByBotIdContainerStopData>>): UseMutationOptions<PostBotsByBotIdContainerStopResponse, Options<PostBotsByBotIdContainerStopData>, PostBotsByBotIdContainerStopError> => ({
|
|
mutation: async (vars) => {
|
|
const { data } = await postBotsByBotIdContainerStop({
|
|
...options,
|
|
...vars,
|
|
throwOnError: true
|
|
});
|
|
return data;
|
|
}
|
|
});
|
|
|
|
export const getBotsByBotIdMcpQueryKey = (options?: Options<GetBotsByBotIdMcpData>) => createQueryKey('getBotsByBotIdMcp', options);
|
|
|
|
/**
|
|
* List MCP connections
|
|
*
|
|
* List MCP connections for a bot
|
|
*/
|
|
export const getBotsByBotIdMcpQuery = defineQueryOptions((options?: Options<GetBotsByBotIdMcpData>) => ({
|
|
key: getBotsByBotIdMcpQueryKey(options),
|
|
query: async (context) => {
|
|
const { data } = await getBotsByBotIdMcp({
|
|
...options,
|
|
...context,
|
|
throwOnError: true
|
|
});
|
|
return data;
|
|
}
|
|
}));
|
|
|
|
/**
|
|
* Create MCP connection
|
|
*
|
|
* Create a MCP connection for a bot
|
|
*/
|
|
export const postBotsByBotIdMcpMutation = (options?: Partial<Options<PostBotsByBotIdMcpData>>): UseMutationOptions<PostBotsByBotIdMcpResponse, Options<PostBotsByBotIdMcpData>, PostBotsByBotIdMcpError> => ({
|
|
mutation: async (vars) => {
|
|
const { data } = await postBotsByBotIdMcp({
|
|
...options,
|
|
...vars,
|
|
throwOnError: true
|
|
});
|
|
return data;
|
|
}
|
|
});
|
|
|
|
/**
|
|
* Batch delete MCP connections
|
|
*
|
|
* Delete multiple MCP connections by IDs.
|
|
*/
|
|
export const postBotsByBotIdMcpOpsBatchDeleteMutation = (options?: Partial<Options<PostBotsByBotIdMcpOpsBatchDeleteData>>): UseMutationOptions<unknown, Options<PostBotsByBotIdMcpOpsBatchDeleteData>, PostBotsByBotIdMcpOpsBatchDeleteError> => ({
|
|
mutation: async (vars) => {
|
|
const { data } = await postBotsByBotIdMcpOpsBatchDelete({
|
|
...options,
|
|
...vars,
|
|
throwOnError: true
|
|
});
|
|
return data;
|
|
}
|
|
});
|
|
|
|
/**
|
|
* Create MCP stdio proxy
|
|
*
|
|
* Start a stdio MCP process in the bot container and expose it as MCP HTTP endpoint.
|
|
*/
|
|
export const postBotsByBotIdMcpStdioMutation = (options?: Partial<Options<PostBotsByBotIdMcpStdioData>>): UseMutationOptions<PostBotsByBotIdMcpStdioResponse, Options<PostBotsByBotIdMcpStdioData>, PostBotsByBotIdMcpStdioError> => ({
|
|
mutation: async (vars) => {
|
|
const { data } = await postBotsByBotIdMcpStdio({
|
|
...options,
|
|
...vars,
|
|
throwOnError: true
|
|
});
|
|
return data;
|
|
}
|
|
});
|
|
|
|
/**
|
|
* MCP stdio proxy (JSON-RPC)
|
|
*
|
|
* Proxies MCP JSON-RPC requests to a stdio MCP process in the container.
|
|
*/
|
|
export const postBotsByBotIdMcpStdioByConnectionIdMutation = (options?: Partial<Options<PostBotsByBotIdMcpStdioByConnectionIdData>>): UseMutationOptions<PostBotsByBotIdMcpStdioByConnectionIdResponse, Options<PostBotsByBotIdMcpStdioByConnectionIdData>, PostBotsByBotIdMcpStdioByConnectionIdError> => ({
|
|
mutation: async (vars) => {
|
|
const { data } = await postBotsByBotIdMcpStdioByConnectionId({
|
|
...options,
|
|
...vars,
|
|
throwOnError: true
|
|
});
|
|
return data;
|
|
}
|
|
});
|
|
|
|
export const getBotsByBotIdMcpExportQueryKey = (options?: Options<GetBotsByBotIdMcpExportData>) => createQueryKey('getBotsByBotIdMcpExport', options);
|
|
|
|
/**
|
|
* Export MCP connections
|
|
*
|
|
* Export all MCP connections for a bot in standard mcpServers format.
|
|
*/
|
|
export const getBotsByBotIdMcpExportQuery = defineQueryOptions((options?: Options<GetBotsByBotIdMcpExportData>) => ({
|
|
key: getBotsByBotIdMcpExportQueryKey(options),
|
|
query: async (context) => {
|
|
const { data } = await getBotsByBotIdMcpExport({
|
|
...options,
|
|
...context,
|
|
throwOnError: true
|
|
});
|
|
return data;
|
|
}
|
|
}));
|
|
|
|
/**
|
|
* Import MCP connections
|
|
*
|
|
* Batch import MCP connections from standard mcpServers format. Existing connections (matched by name) get config updated with is_active preserved. New connections are created as active.
|
|
*/
|
|
export const putBotsByBotIdMcpImportMutation = (options?: Partial<Options<PutBotsByBotIdMcpImportData>>): UseMutationOptions<PutBotsByBotIdMcpImportResponse, Options<PutBotsByBotIdMcpImportData>, PutBotsByBotIdMcpImportError> => ({
|
|
mutation: async (vars) => {
|
|
const { data } = await putBotsByBotIdMcpImport({
|
|
...options,
|
|
...vars,
|
|
throwOnError: true
|
|
});
|
|
return data;
|
|
}
|
|
});
|
|
|
|
/**
|
|
* Delete MCP connection
|
|
*
|
|
* Delete a MCP connection by ID
|
|
*/
|
|
export const deleteBotsByBotIdMcpByIdMutation = (options?: Partial<Options<DeleteBotsByBotIdMcpByIdData>>): UseMutationOptions<unknown, Options<DeleteBotsByBotIdMcpByIdData>, DeleteBotsByBotIdMcpByIdError> => ({
|
|
mutation: async (vars) => {
|
|
const { data } = await deleteBotsByBotIdMcpById({
|
|
...options,
|
|
...vars,
|
|
throwOnError: true
|
|
});
|
|
return data;
|
|
}
|
|
});
|
|
|
|
export const getBotsByBotIdMcpByIdQueryKey = (options: Options<GetBotsByBotIdMcpByIdData>) => createQueryKey('getBotsByBotIdMcpById', options);
|
|
|
|
/**
|
|
* Get MCP connection
|
|
*
|
|
* Get a MCP connection by ID
|
|
*/
|
|
export const getBotsByBotIdMcpByIdQuery = defineQueryOptions((options: Options<GetBotsByBotIdMcpByIdData>) => ({
|
|
key: getBotsByBotIdMcpByIdQueryKey(options),
|
|
query: async (context) => {
|
|
const { data } = await getBotsByBotIdMcpById({
|
|
...options,
|
|
...context,
|
|
throwOnError: true
|
|
});
|
|
return data;
|
|
}
|
|
}));
|
|
|
|
/**
|
|
* Update MCP connection
|
|
*
|
|
* Update a MCP connection by ID
|
|
*/
|
|
export const putBotsByBotIdMcpByIdMutation = (options?: Partial<Options<PutBotsByBotIdMcpByIdData>>): UseMutationOptions<PutBotsByBotIdMcpByIdResponse, Options<PutBotsByBotIdMcpByIdData>, PutBotsByBotIdMcpByIdError> => ({
|
|
mutation: async (vars) => {
|
|
const { data } = await putBotsByBotIdMcpById({
|
|
...options,
|
|
...vars,
|
|
throwOnError: true
|
|
});
|
|
return data;
|
|
}
|
|
});
|
|
|
|
/**
|
|
* Delete memories
|
|
*
|
|
* Delete specific memories by IDs, or delete all memories if no IDs are provided
|
|
*/
|
|
export const deleteBotsByBotIdMemoryMutation = (options?: Partial<Options<DeleteBotsByBotIdMemoryData>>): UseMutationOptions<DeleteBotsByBotIdMemoryResponse, Options<DeleteBotsByBotIdMemoryData>, DeleteBotsByBotIdMemoryError> => ({
|
|
mutation: async (vars) => {
|
|
const { data } = await deleteBotsByBotIdMemory({
|
|
...options,
|
|
...vars,
|
|
throwOnError: true
|
|
});
|
|
return data;
|
|
}
|
|
});
|
|
|
|
export const getBotsByBotIdMemoryQueryKey = (options: Options<GetBotsByBotIdMemoryData>) => createQueryKey('getBotsByBotIdMemory', options);
|
|
|
|
/**
|
|
* Get all memories
|
|
*
|
|
* List all memories in the bot-shared namespace
|
|
*/
|
|
export const getBotsByBotIdMemoryQuery = defineQueryOptions((options: Options<GetBotsByBotIdMemoryData>) => ({
|
|
key: getBotsByBotIdMemoryQueryKey(options),
|
|
query: async (context) => {
|
|
const { data } = await getBotsByBotIdMemory({
|
|
...options,
|
|
...context,
|
|
throwOnError: true
|
|
});
|
|
return data;
|
|
}
|
|
}));
|
|
|
|
/**
|
|
* Add memory
|
|
*
|
|
* Add memory into the bot-shared namespace
|
|
*/
|
|
export const postBotsByBotIdMemoryMutation = (options?: Partial<Options<PostBotsByBotIdMemoryData>>): UseMutationOptions<PostBotsByBotIdMemoryResponse, Options<PostBotsByBotIdMemoryData>, PostBotsByBotIdMemoryError> => ({
|
|
mutation: async (vars) => {
|
|
const { data } = await postBotsByBotIdMemory({
|
|
...options,
|
|
...vars,
|
|
throwOnError: true
|
|
});
|
|
return data;
|
|
}
|
|
});
|
|
|
|
/**
|
|
* Compact memories
|
|
*
|
|
* Consolidate memories by merging similar/redundant entries using LLM.
|
|
*
|
|
* **ratio** (required, range (0,1]):
|
|
* - 0.8 = light compression, mostly dedup, keep ~80% of entries
|
|
* - 0.5 = moderate compression, merge similar facts, keep ~50%
|
|
* - 0.3 = aggressive compression, heavily consolidate, keep ~30%
|
|
*
|
|
* **decay_days** (optional): enable time decay — memories older than N days are treated as low priority and more likely to be merged/dropped.
|
|
*/
|
|
export const postBotsByBotIdMemoryCompactMutation = (options?: Partial<Options<PostBotsByBotIdMemoryCompactData>>): UseMutationOptions<PostBotsByBotIdMemoryCompactResponse, Options<PostBotsByBotIdMemoryCompactData>, PostBotsByBotIdMemoryCompactError> => ({
|
|
mutation: async (vars) => {
|
|
const { data } = await postBotsByBotIdMemoryCompact({
|
|
...options,
|
|
...vars,
|
|
throwOnError: true
|
|
});
|
|
return data;
|
|
}
|
|
});
|
|
|
|
/**
|
|
* Rebuild memories from filesystem
|
|
*
|
|
* Read memory files from the container filesystem (source of truth) and restore missing entries to Qdrant
|
|
*/
|
|
export const postBotsByBotIdMemoryRebuildMutation = (options?: Partial<Options<PostBotsByBotIdMemoryRebuildData>>): UseMutationOptions<PostBotsByBotIdMemoryRebuildResponse, Options<PostBotsByBotIdMemoryRebuildData>, PostBotsByBotIdMemoryRebuildError> => ({
|
|
mutation: async (vars) => {
|
|
const { data } = await postBotsByBotIdMemoryRebuild({
|
|
...options,
|
|
...vars,
|
|
throwOnError: true
|
|
});
|
|
return data;
|
|
}
|
|
});
|
|
|
|
/**
|
|
* Search memory
|
|
*
|
|
* Search memory in the bot-shared namespace
|
|
*/
|
|
export const postBotsByBotIdMemorySearchMutation = (options?: Partial<Options<PostBotsByBotIdMemorySearchData>>): UseMutationOptions<PostBotsByBotIdMemorySearchResponse, Options<PostBotsByBotIdMemorySearchData>, PostBotsByBotIdMemorySearchError> => ({
|
|
mutation: async (vars) => {
|
|
const { data } = await postBotsByBotIdMemorySearch({
|
|
...options,
|
|
...vars,
|
|
throwOnError: true
|
|
});
|
|
return data;
|
|
}
|
|
});
|
|
|
|
export const getBotsByBotIdMemoryUsageQueryKey = (options: Options<GetBotsByBotIdMemoryUsageData>) => createQueryKey('getBotsByBotIdMemoryUsage', options);
|
|
|
|
/**
|
|
* Get memory usage
|
|
*
|
|
* Query the estimated storage usage of current memories
|
|
*/
|
|
export const getBotsByBotIdMemoryUsageQuery = defineQueryOptions((options: Options<GetBotsByBotIdMemoryUsageData>) => ({
|
|
key: getBotsByBotIdMemoryUsageQueryKey(options),
|
|
query: async (context) => {
|
|
const { data } = await getBotsByBotIdMemoryUsage({
|
|
...options,
|
|
...context,
|
|
throwOnError: true
|
|
});
|
|
return data;
|
|
}
|
|
}));
|
|
|
|
/**
|
|
* Delete a single memory
|
|
*
|
|
* Delete a single memory by its ID
|
|
*/
|
|
export const deleteBotsByBotIdMemoryByIdMutation = (options?: Partial<Options<DeleteBotsByBotIdMemoryByIdData>>): UseMutationOptions<DeleteBotsByBotIdMemoryByIdResponse, Options<DeleteBotsByBotIdMemoryByIdData>, DeleteBotsByBotIdMemoryByIdError> => ({
|
|
mutation: async (vars) => {
|
|
const { data } = await deleteBotsByBotIdMemoryById({
|
|
...options,
|
|
...vars,
|
|
throwOnError: true
|
|
});
|
|
return data;
|
|
}
|
|
});
|
|
|
|
export const getBotsByBotIdMessagesQueryKey = (options: Options<GetBotsByBotIdMessagesData>) => createQueryKey('getBotsByBotIdMessages', options);
|
|
|
|
/**
|
|
* List bot history messages
|
|
*
|
|
* List messages for a bot history with optional pagination
|
|
*/
|
|
export const getBotsByBotIdMessagesQuery = defineQueryOptions((options: Options<GetBotsByBotIdMessagesData>) => ({
|
|
key: getBotsByBotIdMessagesQueryKey(options),
|
|
query: async (context) => {
|
|
const { data } = await getBotsByBotIdMessages({
|
|
...options,
|
|
...context,
|
|
throwOnError: true
|
|
});
|
|
return data;
|
|
}
|
|
}));
|
|
|
|
export const getBotsByBotIdScheduleQueryKey = (options?: Options<GetBotsByBotIdScheduleData>) => createQueryKey('getBotsByBotIdSchedule', options);
|
|
|
|
/**
|
|
* List schedules
|
|
*
|
|
* List schedules for current user
|
|
*/
|
|
export const getBotsByBotIdScheduleQuery = defineQueryOptions((options?: Options<GetBotsByBotIdScheduleData>) => ({
|
|
key: getBotsByBotIdScheduleQueryKey(options),
|
|
query: async (context) => {
|
|
const { data } = await getBotsByBotIdSchedule({
|
|
...options,
|
|
...context,
|
|
throwOnError: true
|
|
});
|
|
return data;
|
|
}
|
|
}));
|
|
|
|
/**
|
|
* Create schedule
|
|
*
|
|
* Create a schedule for current user
|
|
*/
|
|
export const postBotsByBotIdScheduleMutation = (options?: Partial<Options<PostBotsByBotIdScheduleData>>): UseMutationOptions<PostBotsByBotIdScheduleResponse, Options<PostBotsByBotIdScheduleData>, PostBotsByBotIdScheduleError> => ({
|
|
mutation: async (vars) => {
|
|
const { data } = await postBotsByBotIdSchedule({
|
|
...options,
|
|
...vars,
|
|
throwOnError: true
|
|
});
|
|
return data;
|
|
}
|
|
});
|
|
|
|
/**
|
|
* Delete schedule
|
|
*
|
|
* Delete a schedule by ID
|
|
*/
|
|
export const deleteBotsByBotIdScheduleByIdMutation = (options?: Partial<Options<DeleteBotsByBotIdScheduleByIdData>>): UseMutationOptions<unknown, Options<DeleteBotsByBotIdScheduleByIdData>, DeleteBotsByBotIdScheduleByIdError> => ({
|
|
mutation: async (vars) => {
|
|
const { data } = await deleteBotsByBotIdScheduleById({
|
|
...options,
|
|
...vars,
|
|
throwOnError: true
|
|
});
|
|
return data;
|
|
}
|
|
});
|
|
|
|
export const getBotsByBotIdScheduleByIdQueryKey = (options: Options<GetBotsByBotIdScheduleByIdData>) => createQueryKey('getBotsByBotIdScheduleById', options);
|
|
|
|
/**
|
|
* Get schedule
|
|
*
|
|
* Get a schedule by ID
|
|
*/
|
|
export const getBotsByBotIdScheduleByIdQuery = defineQueryOptions((options: Options<GetBotsByBotIdScheduleByIdData>) => ({
|
|
key: getBotsByBotIdScheduleByIdQueryKey(options),
|
|
query: async (context) => {
|
|
const { data } = await getBotsByBotIdScheduleById({
|
|
...options,
|
|
...context,
|
|
throwOnError: true
|
|
});
|
|
return data;
|
|
}
|
|
}));
|
|
|
|
/**
|
|
* Update schedule
|
|
*
|
|
* Update a schedule by ID
|
|
*/
|
|
export const putBotsByBotIdScheduleByIdMutation = (options?: Partial<Options<PutBotsByBotIdScheduleByIdData>>): UseMutationOptions<PutBotsByBotIdScheduleByIdResponse, Options<PutBotsByBotIdScheduleByIdData>, PutBotsByBotIdScheduleByIdError> => ({
|
|
mutation: async (vars) => {
|
|
const { data } = await putBotsByBotIdScheduleById({
|
|
...options,
|
|
...vars,
|
|
throwOnError: true
|
|
});
|
|
return data;
|
|
}
|
|
});
|
|
|
|
/**
|
|
* Delete user settings
|
|
*
|
|
* Remove agent settings for current user
|
|
*/
|
|
export const deleteBotsByBotIdSettingsMutation = (options?: Partial<Options<DeleteBotsByBotIdSettingsData>>): UseMutationOptions<unknown, Options<DeleteBotsByBotIdSettingsData>, DeleteBotsByBotIdSettingsError> => ({
|
|
mutation: async (vars) => {
|
|
const { data } = await deleteBotsByBotIdSettings({
|
|
...options,
|
|
...vars,
|
|
throwOnError: true
|
|
});
|
|
return data;
|
|
}
|
|
});
|
|
|
|
export const getBotsByBotIdSettingsQueryKey = (options?: Options<GetBotsByBotIdSettingsData>) => createQueryKey('getBotsByBotIdSettings', options);
|
|
|
|
/**
|
|
* Get user settings
|
|
*
|
|
* Get agent settings for current user
|
|
*/
|
|
export const getBotsByBotIdSettingsQuery = defineQueryOptions((options?: Options<GetBotsByBotIdSettingsData>) => ({
|
|
key: getBotsByBotIdSettingsQueryKey(options),
|
|
query: async (context) => {
|
|
const { data } = await getBotsByBotIdSettings({
|
|
...options,
|
|
...context,
|
|
throwOnError: true
|
|
});
|
|
return data;
|
|
}
|
|
}));
|
|
|
|
/**
|
|
* Update user settings
|
|
*
|
|
* Update or create agent settings for current user
|
|
*/
|
|
export const postBotsByBotIdSettingsMutation = (options?: Partial<Options<PostBotsByBotIdSettingsData>>): UseMutationOptions<PostBotsByBotIdSettingsResponse, Options<PostBotsByBotIdSettingsData>, PostBotsByBotIdSettingsError> => ({
|
|
mutation: async (vars) => {
|
|
const { data } = await postBotsByBotIdSettings({
|
|
...options,
|
|
...vars,
|
|
throwOnError: true
|
|
});
|
|
return data;
|
|
}
|
|
});
|
|
|
|
/**
|
|
* Update user settings
|
|
*
|
|
* Update or create agent settings for current user
|
|
*/
|
|
export const putBotsByBotIdSettingsMutation = (options?: Partial<Options<PutBotsByBotIdSettingsData>>): UseMutationOptions<PutBotsByBotIdSettingsResponse, Options<PutBotsByBotIdSettingsData>, PutBotsByBotIdSettingsError> => ({
|
|
mutation: async (vars) => {
|
|
const { data } = await putBotsByBotIdSettings({
|
|
...options,
|
|
...vars,
|
|
throwOnError: true
|
|
});
|
|
return data;
|
|
}
|
|
});
|
|
|
|
export const getBotsByBotIdSubagentsQueryKey = (options?: Options<GetBotsByBotIdSubagentsData>) => createQueryKey('getBotsByBotIdSubagents', options);
|
|
|
|
/**
|
|
* List subagents
|
|
*
|
|
* List subagents for current user
|
|
*/
|
|
export const getBotsByBotIdSubagentsQuery = defineQueryOptions((options?: Options<GetBotsByBotIdSubagentsData>) => ({
|
|
key: getBotsByBotIdSubagentsQueryKey(options),
|
|
query: async (context) => {
|
|
const { data } = await getBotsByBotIdSubagents({
|
|
...options,
|
|
...context,
|
|
throwOnError: true
|
|
});
|
|
return data;
|
|
}
|
|
}));
|
|
|
|
/**
|
|
* Create subagent
|
|
*
|
|
* Create a subagent for current user
|
|
*/
|
|
export const postBotsByBotIdSubagentsMutation = (options?: Partial<Options<PostBotsByBotIdSubagentsData>>): UseMutationOptions<PostBotsByBotIdSubagentsResponse, Options<PostBotsByBotIdSubagentsData>, PostBotsByBotIdSubagentsError> => ({
|
|
mutation: async (vars) => {
|
|
const { data } = await postBotsByBotIdSubagents({
|
|
...options,
|
|
...vars,
|
|
throwOnError: true
|
|
});
|
|
return data;
|
|
}
|
|
});
|
|
|
|
/**
|
|
* Delete subagent
|
|
*
|
|
* Delete a subagent by ID
|
|
*/
|
|
export const deleteBotsByBotIdSubagentsByIdMutation = (options?: Partial<Options<DeleteBotsByBotIdSubagentsByIdData>>): UseMutationOptions<unknown, Options<DeleteBotsByBotIdSubagentsByIdData>, DeleteBotsByBotIdSubagentsByIdError> => ({
|
|
mutation: async (vars) => {
|
|
const { data } = await deleteBotsByBotIdSubagentsById({
|
|
...options,
|
|
...vars,
|
|
throwOnError: true
|
|
});
|
|
return data;
|
|
}
|
|
});
|
|
|
|
export const getBotsByBotIdSubagentsByIdQueryKey = (options: Options<GetBotsByBotIdSubagentsByIdData>) => createQueryKey('getBotsByBotIdSubagentsById', options);
|
|
|
|
/**
|
|
* Get subagent
|
|
*
|
|
* Get a subagent by ID
|
|
*/
|
|
export const getBotsByBotIdSubagentsByIdQuery = defineQueryOptions((options: Options<GetBotsByBotIdSubagentsByIdData>) => ({
|
|
key: getBotsByBotIdSubagentsByIdQueryKey(options),
|
|
query: async (context) => {
|
|
const { data } = await getBotsByBotIdSubagentsById({
|
|
...options,
|
|
...context,
|
|
throwOnError: true
|
|
});
|
|
return data;
|
|
}
|
|
}));
|
|
|
|
/**
|
|
* Update subagent
|
|
*
|
|
* Update a subagent by ID
|
|
*/
|
|
export const putBotsByBotIdSubagentsByIdMutation = (options?: Partial<Options<PutBotsByBotIdSubagentsByIdData>>): UseMutationOptions<PutBotsByBotIdSubagentsByIdResponse, Options<PutBotsByBotIdSubagentsByIdData>, PutBotsByBotIdSubagentsByIdError> => ({
|
|
mutation: async (vars) => {
|
|
const { data } = await putBotsByBotIdSubagentsById({
|
|
...options,
|
|
...vars,
|
|
throwOnError: true
|
|
});
|
|
return data;
|
|
}
|
|
});
|
|
|
|
export const getBotsByBotIdSubagentsByIdContextQueryKey = (options: Options<GetBotsByBotIdSubagentsByIdContextData>) => createQueryKey('getBotsByBotIdSubagentsByIdContext', options);
|
|
|
|
/**
|
|
* Get subagent context
|
|
*
|
|
* Get a subagent's message context
|
|
*/
|
|
export const getBotsByBotIdSubagentsByIdContextQuery = defineQueryOptions((options: Options<GetBotsByBotIdSubagentsByIdContextData>) => ({
|
|
key: getBotsByBotIdSubagentsByIdContextQueryKey(options),
|
|
query: async (context) => {
|
|
const { data } = await getBotsByBotIdSubagentsByIdContext({
|
|
...options,
|
|
...context,
|
|
throwOnError: true
|
|
});
|
|
return data;
|
|
}
|
|
}));
|
|
|
|
/**
|
|
* Update subagent context
|
|
*
|
|
* Update a subagent's message context
|
|
*/
|
|
export const putBotsByBotIdSubagentsByIdContextMutation = (options?: Partial<Options<PutBotsByBotIdSubagentsByIdContextData>>): UseMutationOptions<PutBotsByBotIdSubagentsByIdContextResponse, Options<PutBotsByBotIdSubagentsByIdContextData>, PutBotsByBotIdSubagentsByIdContextError> => ({
|
|
mutation: async (vars) => {
|
|
const { data } = await putBotsByBotIdSubagentsByIdContext({
|
|
...options,
|
|
...vars,
|
|
throwOnError: true
|
|
});
|
|
return data;
|
|
}
|
|
});
|
|
|
|
export const getBotsByBotIdSubagentsByIdSkillsQueryKey = (options: Options<GetBotsByBotIdSubagentsByIdSkillsData>) => createQueryKey('getBotsByBotIdSubagentsByIdSkills', options);
|
|
|
|
/**
|
|
* Get subagent skills
|
|
*
|
|
* Get a subagent's skills
|
|
*/
|
|
export const getBotsByBotIdSubagentsByIdSkillsQuery = defineQueryOptions((options: Options<GetBotsByBotIdSubagentsByIdSkillsData>) => ({
|
|
key: getBotsByBotIdSubagentsByIdSkillsQueryKey(options),
|
|
query: async (context) => {
|
|
const { data } = await getBotsByBotIdSubagentsByIdSkills({
|
|
...options,
|
|
...context,
|
|
throwOnError: true
|
|
});
|
|
return data;
|
|
}
|
|
}));
|
|
|
|
/**
|
|
* Add subagent skills
|
|
*
|
|
* Add skills to a subagent
|
|
*/
|
|
export const postBotsByBotIdSubagentsByIdSkillsMutation = (options?: Partial<Options<PostBotsByBotIdSubagentsByIdSkillsData>>): UseMutationOptions<PostBotsByBotIdSubagentsByIdSkillsResponse, Options<PostBotsByBotIdSubagentsByIdSkillsData>, PostBotsByBotIdSubagentsByIdSkillsError> => ({
|
|
mutation: async (vars) => {
|
|
const { data } = await postBotsByBotIdSubagentsByIdSkills({
|
|
...options,
|
|
...vars,
|
|
throwOnError: true
|
|
});
|
|
return data;
|
|
}
|
|
});
|
|
|
|
/**
|
|
* Update subagent skills
|
|
*
|
|
* Replace a subagent's skills
|
|
*/
|
|
export const putBotsByBotIdSubagentsByIdSkillsMutation = (options?: Partial<Options<PutBotsByBotIdSubagentsByIdSkillsData>>): UseMutationOptions<PutBotsByBotIdSubagentsByIdSkillsResponse, Options<PutBotsByBotIdSubagentsByIdSkillsData>, PutBotsByBotIdSubagentsByIdSkillsError> => ({
|
|
mutation: async (vars) => {
|
|
const { data } = await putBotsByBotIdSubagentsByIdSkills({
|
|
...options,
|
|
...vars,
|
|
throwOnError: true
|
|
});
|
|
return data;
|
|
}
|
|
});
|
|
|
|
/**
|
|
* Unified MCP tools gateway
|
|
*
|
|
* MCP endpoint for tool discovery and invocation.
|
|
*/
|
|
export const postBotsByBotIdToolsMutation = (options?: Partial<Options<PostBotsByBotIdToolsData>>): UseMutationOptions<PostBotsByBotIdToolsResponse, Options<PostBotsByBotIdToolsData>, PostBotsByBotIdToolsError> => ({
|
|
mutation: async (vars) => {
|
|
const { data } = await postBotsByBotIdTools({
|
|
...options,
|
|
...vars,
|
|
throwOnError: true
|
|
});
|
|
return data;
|
|
}
|
|
});
|
|
|
|
/**
|
|
* Delete bot
|
|
*
|
|
* Delete a bot user (owner/admin only)
|
|
*/
|
|
export const deleteBotsByIdMutation = (options?: Partial<Options<DeleteBotsByIdData>>): UseMutationOptions<DeleteBotsByIdResponse, Options<DeleteBotsByIdData>, DeleteBotsByIdError> => ({
|
|
mutation: async (vars) => {
|
|
const { data } = await deleteBotsById({
|
|
...options,
|
|
...vars,
|
|
throwOnError: true
|
|
});
|
|
return data;
|
|
}
|
|
});
|
|
|
|
export const getBotsByIdQueryKey = (options: Options<GetBotsByIdData>) => createQueryKey('getBotsById', options);
|
|
|
|
/**
|
|
* Get bot details
|
|
*
|
|
* Get a bot by ID (owner/admin only)
|
|
*/
|
|
export const getBotsByIdQuery = defineQueryOptions((options: Options<GetBotsByIdData>) => ({
|
|
key: getBotsByIdQueryKey(options),
|
|
query: async (context) => {
|
|
const { data } = await getBotsById({
|
|
...options,
|
|
...context,
|
|
throwOnError: true
|
|
});
|
|
return data;
|
|
}
|
|
}));
|
|
|
|
/**
|
|
* Update bot details
|
|
*
|
|
* Update bot profile (owner/admin only)
|
|
*/
|
|
export const putBotsByIdMutation = (options?: Partial<Options<PutBotsByIdData>>): UseMutationOptions<PutBotsByIdResponse, Options<PutBotsByIdData>, PutBotsByIdError> => ({
|
|
mutation: async (vars) => {
|
|
const { data } = await putBotsById({
|
|
...options,
|
|
...vars,
|
|
throwOnError: true
|
|
});
|
|
return data;
|
|
}
|
|
});
|
|
|
|
/**
|
|
* Delete bot channel config
|
|
*
|
|
* Remove bot channel configuration
|
|
*/
|
|
export const deleteBotsByIdChannelByPlatformMutation = (options?: Partial<Options<DeleteBotsByIdChannelByPlatformData>>): UseMutationOptions<unknown, Options<DeleteBotsByIdChannelByPlatformData>, DeleteBotsByIdChannelByPlatformError> => ({
|
|
mutation: async (vars) => {
|
|
const { data } = await deleteBotsByIdChannelByPlatform({
|
|
...options,
|
|
...vars,
|
|
throwOnError: true
|
|
});
|
|
return data;
|
|
}
|
|
});
|
|
|
|
export const getBotsByIdChannelByPlatformQueryKey = (options: Options<GetBotsByIdChannelByPlatformData>) => createQueryKey('getBotsByIdChannelByPlatform', options);
|
|
|
|
/**
|
|
* Get bot channel config
|
|
*
|
|
* Get bot channel configuration
|
|
*/
|
|
export const getBotsByIdChannelByPlatformQuery = defineQueryOptions((options: Options<GetBotsByIdChannelByPlatformData>) => ({
|
|
key: getBotsByIdChannelByPlatformQueryKey(options),
|
|
query: async (context) => {
|
|
const { data } = await getBotsByIdChannelByPlatform({
|
|
...options,
|
|
...context,
|
|
throwOnError: true
|
|
});
|
|
return data;
|
|
}
|
|
}));
|
|
|
|
/**
|
|
* Update bot channel config
|
|
*
|
|
* Update bot channel configuration
|
|
*/
|
|
export const putBotsByIdChannelByPlatformMutation = (options?: Partial<Options<PutBotsByIdChannelByPlatformData>>): UseMutationOptions<PutBotsByIdChannelByPlatformResponse, Options<PutBotsByIdChannelByPlatformData>, PutBotsByIdChannelByPlatformError> => ({
|
|
mutation: async (vars) => {
|
|
const { data } = await putBotsByIdChannelByPlatform({
|
|
...options,
|
|
...vars,
|
|
throwOnError: true
|
|
});
|
|
return data;
|
|
}
|
|
});
|
|
|
|
/**
|
|
* Send message via bot channel
|
|
*
|
|
* Send a message using bot channel configuration
|
|
*/
|
|
export const postBotsByIdChannelByPlatformSendMutation = (options?: Partial<Options<PostBotsByIdChannelByPlatformSendData>>): UseMutationOptions<PostBotsByIdChannelByPlatformSendResponse, Options<PostBotsByIdChannelByPlatformSendData>, PostBotsByIdChannelByPlatformSendError> => ({
|
|
mutation: async (vars) => {
|
|
const { data } = await postBotsByIdChannelByPlatformSend({
|
|
...options,
|
|
...vars,
|
|
throwOnError: true
|
|
});
|
|
return data;
|
|
}
|
|
});
|
|
|
|
/**
|
|
* Send message via bot channel session token
|
|
*
|
|
* Send a message using a session-scoped token (reply only)
|
|
*/
|
|
export const postBotsByIdChannelByPlatformSendChatMutation = (options?: Partial<Options<PostBotsByIdChannelByPlatformSendChatData>>): UseMutationOptions<PostBotsByIdChannelByPlatformSendChatResponse, Options<PostBotsByIdChannelByPlatformSendChatData>, PostBotsByIdChannelByPlatformSendChatError> => ({
|
|
mutation: async (vars) => {
|
|
const { data } = await postBotsByIdChannelByPlatformSendChat({
|
|
...options,
|
|
...vars,
|
|
throwOnError: true
|
|
});
|
|
return data;
|
|
}
|
|
});
|
|
|
|
/**
|
|
* Update bot channel status
|
|
*
|
|
* Update bot channel enabled/disabled status
|
|
*/
|
|
export const patchBotsByIdChannelByPlatformStatusMutation = (options?: Partial<Options<PatchBotsByIdChannelByPlatformStatusData>>): UseMutationOptions<PatchBotsByIdChannelByPlatformStatusResponse, Options<PatchBotsByIdChannelByPlatformStatusData>, PatchBotsByIdChannelByPlatformStatusError> => ({
|
|
mutation: async (vars) => {
|
|
const { data } = await patchBotsByIdChannelByPlatformStatus({
|
|
...options,
|
|
...vars,
|
|
throwOnError: true
|
|
});
|
|
return data;
|
|
}
|
|
});
|
|
|
|
export const getBotsByIdChecksQueryKey = (options: Options<GetBotsByIdChecksData>) => createQueryKey('getBotsByIdChecks', options);
|
|
|
|
/**
|
|
* List bot runtime checks
|
|
*
|
|
* Evaluate bot attached resource checks in runtime
|
|
*/
|
|
export const getBotsByIdChecksQuery = defineQueryOptions((options: Options<GetBotsByIdChecksData>) => ({
|
|
key: getBotsByIdChecksQueryKey(options),
|
|
query: async (context) => {
|
|
const { data } = await getBotsByIdChecks({
|
|
...options,
|
|
...context,
|
|
throwOnError: true
|
|
});
|
|
return data;
|
|
}
|
|
}));
|
|
|
|
export const getBotsByIdMembersQueryKey = (options: Options<GetBotsByIdMembersData>) => createQueryKey('getBotsByIdMembers', options);
|
|
|
|
/**
|
|
* List bot members
|
|
*
|
|
* List members for a bot
|
|
*/
|
|
export const getBotsByIdMembersQuery = defineQueryOptions((options: Options<GetBotsByIdMembersData>) => ({
|
|
key: getBotsByIdMembersQueryKey(options),
|
|
query: async (context) => {
|
|
const { data } = await getBotsByIdMembers({
|
|
...options,
|
|
...context,
|
|
throwOnError: true
|
|
});
|
|
return data;
|
|
}
|
|
}));
|
|
|
|
/**
|
|
* Upsert bot member
|
|
*
|
|
* Add or update bot member role
|
|
*/
|
|
export const putBotsByIdMembersMutation = (options?: Partial<Options<PutBotsByIdMembersData>>): UseMutationOptions<PutBotsByIdMembersResponse, Options<PutBotsByIdMembersData>, PutBotsByIdMembersError> => ({
|
|
mutation: async (vars) => {
|
|
const { data } = await putBotsByIdMembers({
|
|
...options,
|
|
...vars,
|
|
throwOnError: true
|
|
});
|
|
return data;
|
|
}
|
|
});
|
|
|
|
/**
|
|
* Delete bot member
|
|
*
|
|
* Remove a member from a bot
|
|
*/
|
|
export const deleteBotsByIdMembersByUserIdMutation = (options?: Partial<Options<DeleteBotsByIdMembersByUserIdData>>): UseMutationOptions<unknown, Options<DeleteBotsByIdMembersByUserIdData>, DeleteBotsByIdMembersByUserIdError> => ({
|
|
mutation: async (vars) => {
|
|
const { data } = await deleteBotsByIdMembersByUserId({
|
|
...options,
|
|
...vars,
|
|
throwOnError: true
|
|
});
|
|
return data;
|
|
}
|
|
});
|
|
|
|
/**
|
|
* Transfer bot owner (admin only)
|
|
*
|
|
* Transfer bot ownership to another human user
|
|
*/
|
|
export const putBotsByIdOwnerMutation = (options?: Partial<Options<PutBotsByIdOwnerData>>): UseMutationOptions<PutBotsByIdOwnerResponse, Options<PutBotsByIdOwnerData>, PutBotsByIdOwnerError> => ({
|
|
mutation: async (vars) => {
|
|
const { data } = await putBotsByIdOwner({
|
|
...options,
|
|
...vars,
|
|
throwOnError: true
|
|
});
|
|
return data;
|
|
}
|
|
});
|
|
|
|
export const getChannelsQueryKey = (options?: Options<GetChannelsData>) => createQueryKey('getChannels', options);
|
|
|
|
/**
|
|
* List channel capabilities and schemas
|
|
*
|
|
* List channel meta information including capabilities and schemas
|
|
*/
|
|
export const getChannelsQuery = defineQueryOptions((options?: Options<GetChannelsData>) => ({
|
|
key: getChannelsQueryKey(options),
|
|
query: async (context) => {
|
|
const { data } = await getChannels({
|
|
...options,
|
|
...context,
|
|
throwOnError: true
|
|
});
|
|
return data;
|
|
}
|
|
}));
|
|
|
|
export const getChannelsByPlatformQueryKey = (options: Options<GetChannelsByPlatformData>) => createQueryKey('getChannelsByPlatform', options);
|
|
|
|
/**
|
|
* Get channel capabilities and schemas
|
|
*
|
|
* Get channel meta information including capabilities and schemas
|
|
*/
|
|
export const getChannelsByPlatformQuery = defineQueryOptions((options: Options<GetChannelsByPlatformData>) => ({
|
|
key: getChannelsByPlatformQueryKey(options),
|
|
query: async (context) => {
|
|
const { data } = await getChannelsByPlatform({
|
|
...options,
|
|
...context,
|
|
throwOnError: true
|
|
});
|
|
return data;
|
|
}
|
|
}));
|
|
|
|
/**
|
|
* Create embeddings
|
|
*
|
|
* Create text or multimodal embeddings
|
|
*/
|
|
export const postEmbeddingsMutation = (options?: Partial<Options<PostEmbeddingsData>>): UseMutationOptions<PostEmbeddingsResponse, Options<PostEmbeddingsData>, PostEmbeddingsError> => ({
|
|
mutation: async (vars) => {
|
|
const { data } = await postEmbeddings({
|
|
...options,
|
|
...vars,
|
|
throwOnError: true
|
|
});
|
|
return data;
|
|
}
|
|
});
|
|
|
|
export const getModelsQueryKey = (options?: Options<GetModelsData>) => createQueryKey('getModels', options);
|
|
|
|
/**
|
|
* List all models
|
|
*
|
|
* Get a list of all configured models, optionally filtered by type or client type
|
|
*/
|
|
export const getModelsQuery = defineQueryOptions((options?: Options<GetModelsData>) => ({
|
|
key: getModelsQueryKey(options),
|
|
query: async (context) => {
|
|
const { data } = await getModels({
|
|
...options,
|
|
...context,
|
|
throwOnError: true
|
|
});
|
|
return data;
|
|
}
|
|
}));
|
|
|
|
/**
|
|
* Create a new model
|
|
*
|
|
* Create a new model configuration
|
|
*/
|
|
export const postModelsMutation = (options?: Partial<Options<PostModelsData>>): UseMutationOptions<PostModelsResponse, Options<PostModelsData>, PostModelsError> => ({
|
|
mutation: async (vars) => {
|
|
const { data } = await postModels({
|
|
...options,
|
|
...vars,
|
|
throwOnError: true
|
|
});
|
|
return data;
|
|
}
|
|
});
|
|
|
|
export const getModelsCountQueryKey = (options?: Options<GetModelsCountData>) => createQueryKey('getModelsCount', options);
|
|
|
|
/**
|
|
* Get model count
|
|
*
|
|
* Get the total count of models, optionally filtered by type
|
|
*/
|
|
export const getModelsCountQuery = defineQueryOptions((options?: Options<GetModelsCountData>) => ({
|
|
key: getModelsCountQueryKey(options),
|
|
query: async (context) => {
|
|
const { data } = await getModelsCount({
|
|
...options,
|
|
...context,
|
|
throwOnError: true
|
|
});
|
|
return data;
|
|
}
|
|
}));
|
|
|
|
/**
|
|
* Delete model by model ID
|
|
*
|
|
* Delete a model configuration by its model_id field (e.g., gpt-4)
|
|
*/
|
|
export const deleteModelsModelByModelIdMutation = (options?: Partial<Options<DeleteModelsModelByModelIdData>>): UseMutationOptions<unknown, Options<DeleteModelsModelByModelIdData>, DeleteModelsModelByModelIdError> => ({
|
|
mutation: async (vars) => {
|
|
const { data } = await deleteModelsModelByModelId({
|
|
...options,
|
|
...vars,
|
|
throwOnError: true
|
|
});
|
|
return data;
|
|
}
|
|
});
|
|
|
|
export const getModelsModelByModelIdQueryKey = (options: Options<GetModelsModelByModelIdData>) => createQueryKey('getModelsModelByModelId', options);
|
|
|
|
/**
|
|
* Get model by model ID
|
|
*
|
|
* Get a model configuration by its model_id field (e.g., gpt-4)
|
|
*/
|
|
export const getModelsModelByModelIdQuery = defineQueryOptions((options: Options<GetModelsModelByModelIdData>) => ({
|
|
key: getModelsModelByModelIdQueryKey(options),
|
|
query: async (context) => {
|
|
const { data } = await getModelsModelByModelId({
|
|
...options,
|
|
...context,
|
|
throwOnError: true
|
|
});
|
|
return data;
|
|
}
|
|
}));
|
|
|
|
/**
|
|
* Update model by model ID
|
|
*
|
|
* Update a model configuration by its model_id field (e.g., gpt-4)
|
|
*/
|
|
export const putModelsModelByModelIdMutation = (options?: Partial<Options<PutModelsModelByModelIdData>>): UseMutationOptions<PutModelsModelByModelIdResponse, Options<PutModelsModelByModelIdData>, PutModelsModelByModelIdError> => ({
|
|
mutation: async (vars) => {
|
|
const { data } = await putModelsModelByModelId({
|
|
...options,
|
|
...vars,
|
|
throwOnError: true
|
|
});
|
|
return data;
|
|
}
|
|
});
|
|
|
|
/**
|
|
* Delete model by internal ID
|
|
*
|
|
* Delete a model configuration by its internal UUID
|
|
*/
|
|
export const deleteModelsByIdMutation = (options?: Partial<Options<DeleteModelsByIdData>>): UseMutationOptions<unknown, Options<DeleteModelsByIdData>, DeleteModelsByIdError> => ({
|
|
mutation: async (vars) => {
|
|
const { data } = await deleteModelsById({
|
|
...options,
|
|
...vars,
|
|
throwOnError: true
|
|
});
|
|
return data;
|
|
}
|
|
});
|
|
|
|
export const getModelsByIdQueryKey = (options: Options<GetModelsByIdData>) => createQueryKey('getModelsById', options);
|
|
|
|
/**
|
|
* Get model by internal ID
|
|
*
|
|
* Get a model configuration by its internal UUID
|
|
*/
|
|
export const getModelsByIdQuery = defineQueryOptions((options: Options<GetModelsByIdData>) => ({
|
|
key: getModelsByIdQueryKey(options),
|
|
query: async (context) => {
|
|
const { data } = await getModelsById({
|
|
...options,
|
|
...context,
|
|
throwOnError: true
|
|
});
|
|
return data;
|
|
}
|
|
}));
|
|
|
|
/**
|
|
* Update model by internal ID
|
|
*
|
|
* Update a model configuration by its internal UUID
|
|
*/
|
|
export const putModelsByIdMutation = (options?: Partial<Options<PutModelsByIdData>>): UseMutationOptions<PutModelsByIdResponse, Options<PutModelsByIdData>, PutModelsByIdError> => ({
|
|
mutation: async (vars) => {
|
|
const { data } = await putModelsById({
|
|
...options,
|
|
...vars,
|
|
throwOnError: true
|
|
});
|
|
return data;
|
|
}
|
|
});
|
|
|
|
export const getProvidersQueryKey = (options?: Options<GetProvidersData>) => createQueryKey('getProviders', options);
|
|
|
|
/**
|
|
* List all LLM providers
|
|
*
|
|
* Get a list of all configured LLM providers, optionally filtered by client type
|
|
*/
|
|
export const getProvidersQuery = defineQueryOptions((options?: Options<GetProvidersData>) => ({
|
|
key: getProvidersQueryKey(options),
|
|
query: async (context) => {
|
|
const { data } = await getProviders({
|
|
...options,
|
|
...context,
|
|
throwOnError: true
|
|
});
|
|
return data;
|
|
}
|
|
}));
|
|
|
|
/**
|
|
* Create a new LLM provider
|
|
*
|
|
* Create a new LLM provider configuration
|
|
*/
|
|
export const postProvidersMutation = (options?: Partial<Options<PostProvidersData>>): UseMutationOptions<PostProvidersResponse, Options<PostProvidersData>, PostProvidersError> => ({
|
|
mutation: async (vars) => {
|
|
const { data } = await postProviders({
|
|
...options,
|
|
...vars,
|
|
throwOnError: true
|
|
});
|
|
return data;
|
|
}
|
|
});
|
|
|
|
export const getProvidersCountQueryKey = (options?: Options<GetProvidersCountData>) => createQueryKey('getProvidersCount', options);
|
|
|
|
/**
|
|
* Count providers
|
|
*
|
|
* Get the total count of providers, optionally filtered by client type
|
|
*/
|
|
export const getProvidersCountQuery = defineQueryOptions((options?: Options<GetProvidersCountData>) => ({
|
|
key: getProvidersCountQueryKey(options),
|
|
query: async (context) => {
|
|
const { data } = await getProvidersCount({
|
|
...options,
|
|
...context,
|
|
throwOnError: true
|
|
});
|
|
return data;
|
|
}
|
|
}));
|
|
|
|
export const getProvidersNameByNameQueryKey = (options: Options<GetProvidersNameByNameData>) => createQueryKey('getProvidersNameByName', options);
|
|
|
|
/**
|
|
* Get provider by name
|
|
*
|
|
* Get a provider configuration by its name
|
|
*/
|
|
export const getProvidersNameByNameQuery = defineQueryOptions((options: Options<GetProvidersNameByNameData>) => ({
|
|
key: getProvidersNameByNameQueryKey(options),
|
|
query: async (context) => {
|
|
const { data } = await getProvidersNameByName({
|
|
...options,
|
|
...context,
|
|
throwOnError: true
|
|
});
|
|
return data;
|
|
}
|
|
}));
|
|
|
|
/**
|
|
* Delete provider
|
|
*
|
|
* Delete a provider configuration
|
|
*/
|
|
export const deleteProvidersByIdMutation = (options?: Partial<Options<DeleteProvidersByIdData>>): UseMutationOptions<unknown, Options<DeleteProvidersByIdData>, DeleteProvidersByIdError> => ({
|
|
mutation: async (vars) => {
|
|
const { data } = await deleteProvidersById({
|
|
...options,
|
|
...vars,
|
|
throwOnError: true
|
|
});
|
|
return data;
|
|
}
|
|
});
|
|
|
|
export const getProvidersByIdQueryKey = (options: Options<GetProvidersByIdData>) => createQueryKey('getProvidersById', options);
|
|
|
|
/**
|
|
* Get provider by ID
|
|
*
|
|
* Get a provider configuration by its ID
|
|
*/
|
|
export const getProvidersByIdQuery = defineQueryOptions((options: Options<GetProvidersByIdData>) => ({
|
|
key: getProvidersByIdQueryKey(options),
|
|
query: async (context) => {
|
|
const { data } = await getProvidersById({
|
|
...options,
|
|
...context,
|
|
throwOnError: true
|
|
});
|
|
return data;
|
|
}
|
|
}));
|
|
|
|
/**
|
|
* Update provider
|
|
*
|
|
* Update an existing provider configuration
|
|
*/
|
|
export const putProvidersByIdMutation = (options?: Partial<Options<PutProvidersByIdData>>): UseMutationOptions<PutProvidersByIdResponse, Options<PutProvidersByIdData>, PutProvidersByIdError> => ({
|
|
mutation: async (vars) => {
|
|
const { data } = await putProvidersById({
|
|
...options,
|
|
...vars,
|
|
throwOnError: true
|
|
});
|
|
return data;
|
|
}
|
|
});
|
|
|
|
export const getProvidersByIdModelsQueryKey = (options: Options<GetProvidersByIdModelsData>) => createQueryKey('getProvidersByIdModels', options);
|
|
|
|
/**
|
|
* List provider models
|
|
*
|
|
* Get models for a provider by id, optionally filtered by type
|
|
*/
|
|
export const getProvidersByIdModelsQuery = defineQueryOptions((options: Options<GetProvidersByIdModelsData>) => ({
|
|
key: getProvidersByIdModelsQueryKey(options),
|
|
query: async (context) => {
|
|
const { data } = await getProvidersByIdModels({
|
|
...options,
|
|
...context,
|
|
throwOnError: true
|
|
});
|
|
return data;
|
|
}
|
|
}));
|
|
|
|
export const getSearchProvidersQueryKey = (options?: Options<GetSearchProvidersData>) => createQueryKey('getSearchProviders', options);
|
|
|
|
/**
|
|
* List search providers
|
|
*
|
|
* List configured search providers
|
|
*/
|
|
export const getSearchProvidersQuery = defineQueryOptions((options?: Options<GetSearchProvidersData>) => ({
|
|
key: getSearchProvidersQueryKey(options),
|
|
query: async (context) => {
|
|
const { data } = await getSearchProviders({
|
|
...options,
|
|
...context,
|
|
throwOnError: true
|
|
});
|
|
return data;
|
|
}
|
|
}));
|
|
|
|
/**
|
|
* Create a search provider
|
|
*
|
|
* Create a search provider configuration
|
|
*/
|
|
export const postSearchProvidersMutation = (options?: Partial<Options<PostSearchProvidersData>>): UseMutationOptions<PostSearchProvidersResponse, Options<PostSearchProvidersData>, PostSearchProvidersError> => ({
|
|
mutation: async (vars) => {
|
|
const { data } = await postSearchProviders({
|
|
...options,
|
|
...vars,
|
|
throwOnError: true
|
|
});
|
|
return data;
|
|
}
|
|
});
|
|
|
|
export const getSearchProvidersMetaQueryKey = (options?: Options<GetSearchProvidersMetaData>) => createQueryKey('getSearchProvidersMeta', options);
|
|
|
|
/**
|
|
* List search provider metadata
|
|
*
|
|
* List available search provider types and config schemas
|
|
*/
|
|
export const getSearchProvidersMetaQuery = defineQueryOptions((options?: Options<GetSearchProvidersMetaData>) => ({
|
|
key: getSearchProvidersMetaQueryKey(options),
|
|
query: async (context) => {
|
|
const { data } = await getSearchProvidersMeta({
|
|
...options,
|
|
...context,
|
|
throwOnError: true
|
|
});
|
|
return data;
|
|
}
|
|
}));
|
|
|
|
/**
|
|
* Delete a search provider
|
|
*
|
|
* Delete search provider by ID
|
|
*/
|
|
export const deleteSearchProvidersByIdMutation = (options?: Partial<Options<DeleteSearchProvidersByIdData>>): UseMutationOptions<unknown, Options<DeleteSearchProvidersByIdData>, DeleteSearchProvidersByIdError> => ({
|
|
mutation: async (vars) => {
|
|
const { data } = await deleteSearchProvidersById({
|
|
...options,
|
|
...vars,
|
|
throwOnError: true
|
|
});
|
|
return data;
|
|
}
|
|
});
|
|
|
|
export const getSearchProvidersByIdQueryKey = (options: Options<GetSearchProvidersByIdData>) => createQueryKey('getSearchProvidersById', options);
|
|
|
|
/**
|
|
* Get a search provider
|
|
*
|
|
* Get search provider by ID
|
|
*/
|
|
export const getSearchProvidersByIdQuery = defineQueryOptions((options: Options<GetSearchProvidersByIdData>) => ({
|
|
key: getSearchProvidersByIdQueryKey(options),
|
|
query: async (context) => {
|
|
const { data } = await getSearchProvidersById({
|
|
...options,
|
|
...context,
|
|
throwOnError: true
|
|
});
|
|
return data;
|
|
}
|
|
}));
|
|
|
|
/**
|
|
* Update a search provider
|
|
*
|
|
* Update search provider by ID
|
|
*/
|
|
export const putSearchProvidersByIdMutation = (options?: Partial<Options<PutSearchProvidersByIdData>>): UseMutationOptions<PutSearchProvidersByIdResponse, Options<PutSearchProvidersByIdData>, PutSearchProvidersByIdError> => ({
|
|
mutation: async (vars) => {
|
|
const { data } = await putSearchProvidersById({
|
|
...options,
|
|
...vars,
|
|
throwOnError: true
|
|
});
|
|
return data;
|
|
}
|
|
});
|
|
|
|
export const getUsersQueryKey = (options?: Options<GetUsersData>) => createQueryKey('getUsers', options);
|
|
|
|
/**
|
|
* List users (admin only)
|
|
*
|
|
* List users
|
|
*/
|
|
export const getUsersQuery = defineQueryOptions((options?: Options<GetUsersData>) => ({
|
|
key: getUsersQueryKey(options),
|
|
query: async (context) => {
|
|
const { data } = await getUsers({
|
|
...options,
|
|
...context,
|
|
throwOnError: true
|
|
});
|
|
return data;
|
|
}
|
|
}));
|
|
|
|
/**
|
|
* Create human user (admin only)
|
|
*
|
|
* Create a new human user account
|
|
*/
|
|
export const postUsersMutation = (options?: Partial<Options<PostUsersData>>): UseMutationOptions<PostUsersResponse, Options<PostUsersData>, PostUsersError> => ({
|
|
mutation: async (vars) => {
|
|
const { data } = await postUsers({
|
|
...options,
|
|
...vars,
|
|
throwOnError: true
|
|
});
|
|
return data;
|
|
}
|
|
});
|
|
|
|
export const getUsersMeQueryKey = (options?: Options<GetUsersMeData>) => createQueryKey('getUsersMe', options);
|
|
|
|
/**
|
|
* Get current user
|
|
*
|
|
* Get current user profile
|
|
*/
|
|
export const getUsersMeQuery = defineQueryOptions((options?: Options<GetUsersMeData>) => ({
|
|
key: getUsersMeQueryKey(options),
|
|
query: async (context) => {
|
|
const { data } = await getUsersMe({
|
|
...options,
|
|
...context,
|
|
throwOnError: true
|
|
});
|
|
return data;
|
|
}
|
|
}));
|
|
|
|
/**
|
|
* Update current user profile
|
|
*
|
|
* Update current user display name or avatar
|
|
*/
|
|
export const putUsersMeMutation = (options?: Partial<Options<PutUsersMeData>>): UseMutationOptions<PutUsersMeResponse, Options<PutUsersMeData>, PutUsersMeError> => ({
|
|
mutation: async (vars) => {
|
|
const { data } = await putUsersMe({
|
|
...options,
|
|
...vars,
|
|
throwOnError: true
|
|
});
|
|
return data;
|
|
}
|
|
});
|
|
|
|
export const getUsersMeChannelsByPlatformQueryKey = (options: Options<GetUsersMeChannelsByPlatformData>) => createQueryKey('getUsersMeChannelsByPlatform', options);
|
|
|
|
/**
|
|
* Get channel user config
|
|
*
|
|
* Get channel binding configuration for current user
|
|
*/
|
|
export const getUsersMeChannelsByPlatformQuery = defineQueryOptions((options: Options<GetUsersMeChannelsByPlatformData>) => ({
|
|
key: getUsersMeChannelsByPlatformQueryKey(options),
|
|
query: async (context) => {
|
|
const { data } = await getUsersMeChannelsByPlatform({
|
|
...options,
|
|
...context,
|
|
throwOnError: true
|
|
});
|
|
return data;
|
|
}
|
|
}));
|
|
|
|
/**
|
|
* Update channel user config
|
|
*
|
|
* Update channel binding configuration for current user
|
|
*/
|
|
export const putUsersMeChannelsByPlatformMutation = (options?: Partial<Options<PutUsersMeChannelsByPlatformData>>): UseMutationOptions<PutUsersMeChannelsByPlatformResponse, Options<PutUsersMeChannelsByPlatformData>, PutUsersMeChannelsByPlatformError> => ({
|
|
mutation: async (vars) => {
|
|
const { data } = await putUsersMeChannelsByPlatform({
|
|
...options,
|
|
...vars,
|
|
throwOnError: true
|
|
});
|
|
return data;
|
|
}
|
|
});
|
|
|
|
export const getUsersMeIdentitiesQueryKey = (options?: Options<GetUsersMeIdentitiesData>) => createQueryKey('getUsersMeIdentities', options);
|
|
|
|
/**
|
|
* List current user's channel identities
|
|
*
|
|
* List all channel identities linked to current user
|
|
*/
|
|
export const getUsersMeIdentitiesQuery = defineQueryOptions((options?: Options<GetUsersMeIdentitiesData>) => ({
|
|
key: getUsersMeIdentitiesQueryKey(options),
|
|
query: async (context) => {
|
|
const { data } = await getUsersMeIdentities({
|
|
...options,
|
|
...context,
|
|
throwOnError: true
|
|
});
|
|
return data;
|
|
}
|
|
}));
|
|
|
|
/**
|
|
* Update current user password
|
|
*
|
|
* Update current user password with current password check
|
|
*/
|
|
export const putUsersMePasswordMutation = (options?: Partial<Options<PutUsersMePasswordData>>): UseMutationOptions<unknown, Options<PutUsersMePasswordData>, PutUsersMePasswordError> => ({
|
|
mutation: async (vars) => {
|
|
const { data } = await putUsersMePassword({
|
|
...options,
|
|
...vars,
|
|
throwOnError: true
|
|
});
|
|
return data;
|
|
}
|
|
});
|
|
|
|
export const getUsersByIdQueryKey = (options: Options<GetUsersByIdData>) => createQueryKey('getUsersById', options);
|
|
|
|
/**
|
|
* Get user by ID
|
|
*
|
|
* Get user details (self or admin only)
|
|
*/
|
|
export const getUsersByIdQuery = defineQueryOptions((options: Options<GetUsersByIdData>) => ({
|
|
key: getUsersByIdQueryKey(options),
|
|
query: async (context) => {
|
|
const { data } = await getUsersById({
|
|
...options,
|
|
...context,
|
|
throwOnError: true
|
|
});
|
|
return data;
|
|
}
|
|
}));
|
|
|
|
/**
|
|
* Update user (admin only)
|
|
*
|
|
* Update user profile and status
|
|
*/
|
|
export const putUsersByIdMutation = (options?: Partial<Options<PutUsersByIdData>>): UseMutationOptions<PutUsersByIdResponse, Options<PutUsersByIdData>, PutUsersByIdError> => ({
|
|
mutation: async (vars) => {
|
|
const { data } = await putUsersById({
|
|
...options,
|
|
...vars,
|
|
throwOnError: true
|
|
});
|
|
return data;
|
|
}
|
|
});
|
|
|
|
/**
|
|
* Reset user password (admin only)
|
|
*
|
|
* Reset a user password
|
|
*/
|
|
export const putUsersByIdPasswordMutation = (options?: Partial<Options<PutUsersByIdPasswordData>>): UseMutationOptions<unknown, Options<PutUsersByIdPasswordData>, PutUsersByIdPasswordError> => ({
|
|
mutation: async (vars) => {
|
|
const { data } = await putUsersByIdPassword({
|
|
...options,
|
|
...vars,
|
|
throwOnError: true
|
|
});
|
|
return data;
|
|
}
|
|
});
|