/
githubmirror
/
novu
Обзор
Документация
Войти
/
githubmirror
/
novu
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
next
libs/internal-sdk/src/react-query/agentsIntegrationsCreate.ts
119 строк
4 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 { agentsIntegrationsCreate } from "../funcs/agentsIntegrationsCreate.js"; import { combineSignals } from "../lib/primitives.js"; import { RequestOptions } from "../lib/sdks.js"; import * as components from "../models/components/index.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 AgentsIntegrationsCreateMutationVariables = { addAgentIntegrationRequestDto: components.AddAgentIntegrationRequestDto; identifier: string; idempotencyKey?: string | undefined; options?: RequestOptions; }; export type AgentsIntegrationsCreateMutationData = operations.AgentIntegrationsControllerAddAgentIntegrationResponse; export type AgentsIntegrationsCreateMutationError = | errors.ErrorDto | errors.ValidationErrorDto | NovuError | ResponseValidationError | ConnectionError | RequestAbortedError | RequestTimeoutError | InvalidRequestError | UnexpectedClientError | SDKValidationError; /** * Create an agent integration * * @remarks * Create a link between an agent (by identifier) and an integration (by integration **identifier**, not the internal _id). */ export function useAgentsIntegrationsCreateMutation( options?: MutationHookOptions< AgentsIntegrationsCreateMutationData, AgentsIntegrationsCreateMutationError, AgentsIntegrationsCreateMutationVariables >, ): UseMutationResult< AgentsIntegrationsCreateMutationData, AgentsIntegrationsCreateMutationError, AgentsIntegrationsCreateMutationVariables > { const client = useNovuContext(); return useMutation({ ...buildAgentsIntegrationsCreateMutation(client, options), ...options, }); } export function mutationKeyAgentsIntegrationsCreate(): MutationKey { return ["@novu/api", "Integrations", "create"]; } export function buildAgentsIntegrationsCreateMutation( client$: NovuCore, hookOptions?: RequestOptions, ): { mutationKey: MutationKey; mutationFn: ( variables: AgentsIntegrationsCreateMutationVariables, ) => Promise<AgentsIntegrationsCreateMutationData>; } { return { mutationKey: mutationKeyAgentsIntegrationsCreate(), mutationFn: function agentsIntegrationsCreateMutationFn({ addAgentIntegrationRequestDto, identifier, idempotencyKey, options, }): Promise<AgentsIntegrationsCreateMutationData> { const mergedOptions = { ...hookOptions, ...options, fetchOptions: { ...hookOptions?.fetchOptions, ...options?.fetchOptions, signal: combineSignals( hookOptions?.fetchOptions?.signal, options?.fetchOptions?.signal, ), }, }; return unwrapAsync(agentsIntegrationsCreate( client$, addAgentIntegrationRequestDto, identifier, idempotencyKey, mergedOptions, )); }, }; }