/
githubmirror
/
novu
Обзор
Документация
Войти
/
githubmirror
/
novu
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
next
libs/internal-sdk/src/react-query/agentsDelete.ts
119 строк
3 KB
AdemDev
feat(providers): add LINE Messaging API chat provider fixes NV-7614 (#11148)
13 июл 2026, 11:20
Не верифицирован
13 июл 2026, 11:20
51e40a8
Код
Авторство
О чём код?
/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import { MutationKey, useMutation, UseMutationResult, } from "@tanstack/react-query"; import { NovuCore } from "../core.js"; import { agentsDelete } from "../funcs/agentsDelete.js"; import { combineSignals } from "../lib/primitives.js"; import { RequestOptions } from "../lib/sdks.js"; import { ConnectionError, InvalidRequestError, RequestAbortedError, RequestTimeoutError, UnexpectedClientError, } from "../models/errors/httpclienterrors.js"; import * as errors from "../models/errors/index.js"; import { NovuError } from "../models/errors/novuerror.js"; import { ResponseValidationError } from "../models/errors/responsevalidationerror.js"; import { SDKValidationError } from "../models/errors/sdkvalidationerror.js"; import * as operations from "../models/operations/index.js"; import { unwrapAsync } from "../types/fp.js"; import { useNovuContext } from "./_context.js"; import { MutationHookOptions } from "./_types.js"; export type AgentsDeleteMutationVariables = { identifier: string; deleteFromProvider: string; idempotencyKey?: string | undefined; options?: RequestOptions; }; export type AgentsDeleteMutationData = | operations.AgentsControllerDeleteAgentResponse | undefined; export type AgentsDeleteMutationError = | errors.ErrorDto | errors.ValidationErrorDto | NovuError | ResponseValidationError | ConnectionError | RequestAbortedError | RequestTimeoutError | InvalidRequestError | UnexpectedClientError | SDKValidationError; /** * Delete an agent * * @remarks * Delete an agent by identifier and remove all agent-integration links. For managed-runtime agents, pass `deleteFromProvider=true` to also archive the agent on the provider side (e.g. Anthropic). By default only the Novu record is deleted and the provider agent is left intact. */ export function useAgentsDeleteMutation( options?: MutationHookOptions< AgentsDeleteMutationData, AgentsDeleteMutationError, AgentsDeleteMutationVariables >, ): UseMutationResult< AgentsDeleteMutationData, AgentsDeleteMutationError, AgentsDeleteMutationVariables > { const client = useNovuContext(); return useMutation({ ...buildAgentsDeleteMutation(client, options), ...options, }); } export function mutationKeyAgentsDelete(): MutationKey { return ["@novu/api", "Agents", "delete"]; } export function buildAgentsDeleteMutation( client$: NovuCore, hookOptions?: RequestOptions, ): { mutationKey: MutationKey; mutationFn: ( variables: AgentsDeleteMutationVariables, ) => Promise<AgentsDeleteMutationData>; } { return { mutationKey: mutationKeyAgentsDelete(), mutationFn: function agentsDeleteMutationFn({ identifier, deleteFromProvider, idempotencyKey, options, }): Promise<AgentsDeleteMutationData> { const mergedOptions = { ...hookOptions, ...options, fetchOptions: { ...hookOptions?.fetchOptions, ...options?.fetchOptions, signal: combineSignals( hookOptions?.fetchOptions?.signal, options?.fetchOptions?.signal, ), }, }; return unwrapAsync(agentsDelete( client$, identifier, deleteFromProvider, idempotencyKey, mergedOptions, )); }, }; }