/
githubmirror
/
novu
Обзор
Документация
Войти
/
githubmirror
/
novu
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
next
libs/internal-sdk/src/react-query/integrationsIntegrationsControllerAutoConfigureIntegration.ts
135 строк
4 KB
Pawan Jain
refactor(api-service): validate flattened provider IDs fixes NV-8087 (#11611)
23 июн 2026, 07:40
Не верифицирован
23 июн 2026, 07:40
043e6db
Код
Авторство
О чём код?
/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import { MutationKey, useMutation, UseMutationResult, } from "@tanstack/react-query"; import { NovuCore } from "../core.js"; import { integrationsIntegrationsControllerAutoConfigureIntegration } from "../funcs/integrationsIntegrationsControllerAutoConfigureIntegration.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 IntegrationsIntegrationsControllerAutoConfigureIntegrationMutationVariables = { integrationId: string; idempotencyKey?: string | undefined; options?: RequestOptions; }; export type IntegrationsIntegrationsControllerAutoConfigureIntegrationMutationData = operations.IntegrationsControllerAutoConfigureIntegrationResponse; export type IntegrationsIntegrationsControllerAutoConfigureIntegrationMutationError = | errors.ErrorDto | errors.ValidationErrorDto | NovuError | ResponseValidationError | ConnectionError | RequestAbortedError | RequestTimeoutError | InvalidRequestError | UnexpectedClientError | SDKValidationError; /** * Auto-configure an integration for inbound webhooks * * @remarks * Auto-configure an integration by its unique key identifier **integrationId** for inbound webhook support. * This will automatically generate required webhook signing keys and configure webhook endpoints. Only integration metadata is returned, credentials field is returned as an empty object. */ export function useIntegrationsIntegrationsControllerAutoConfigureIntegrationMutation( options?: MutationHookOptions< IntegrationsIntegrationsControllerAutoConfigureIntegrationMutationData, IntegrationsIntegrationsControllerAutoConfigureIntegrationMutationError, IntegrationsIntegrationsControllerAutoConfigureIntegrationMutationVariables >, ): UseMutationResult< IntegrationsIntegrationsControllerAutoConfigureIntegrationMutationData, IntegrationsIntegrationsControllerAutoConfigureIntegrationMutationError, IntegrationsIntegrationsControllerAutoConfigureIntegrationMutationVariables > { const client = useNovuContext(); return useMutation({ ...buildIntegrationsIntegrationsControllerAutoConfigureIntegrationMutation( client, options, ), ...options, }); } export function mutationKeyIntegrationsIntegrationsControllerAutoConfigureIntegration(): MutationKey { return [ "@novu/api", "Integrations", "integrationsControllerAutoConfigureIntegration", ]; } export function buildIntegrationsIntegrationsControllerAutoConfigureIntegrationMutation( client$: NovuCore, hookOptions?: RequestOptions, ): { mutationKey: MutationKey; mutationFn: ( variables: IntegrationsIntegrationsControllerAutoConfigureIntegrationMutationVariables, ) => Promise< IntegrationsIntegrationsControllerAutoConfigureIntegrationMutationData >; } { return { mutationKey: mutationKeyIntegrationsIntegrationsControllerAutoConfigureIntegration(), mutationFn: function integrationsIntegrationsControllerAutoConfigureIntegrationMutationFn( { integrationId, idempotencyKey, options, }, ): Promise< IntegrationsIntegrationsControllerAutoConfigureIntegrationMutationData > { const mergedOptions = { ...hookOptions, ...options, fetchOptions: { ...hookOptions?.fetchOptions, ...options?.fetchOptions, signal: combineSignals( hookOptions?.fetchOptions?.signal, options?.fetchOptions?.signal, ), }, }; return unwrapAsync( integrationsIntegrationsControllerAutoConfigureIntegration( client$, integrationId, idempotencyKey, mergedOptions, ), ); }, }; }