/
githubmirror
/
novu
Обзор
Документация
Войти
/
githubmirror
/
novu
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
next
libs/internal-sdk/src/react-query/integrationsLinkChannelEndpoint.ts
116 строк
4 KB
Pawan Jain
feat(api-service): add SdkMethodName decorator for mobile link creation in integrations controller fixes NV-8203 (#11801)
06 июл 2026, 21:07
Не верифицирован
06 июл 2026, 21:07
a315536
Код
Авторство
О чём код?
/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import { MutationKey, useMutation, UseMutationResult, } from "@tanstack/react-query"; import { NovuCore } from "../core.js"; import { integrationsLinkChannelEndpoint } from "../funcs/integrationsLinkChannelEndpoint.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 IntegrationsLinkChannelEndpointMutationVariables = { linkChannelEndpointRequestDto: components.LinkChannelEndpointRequestDto; idempotencyKey?: string | undefined; options?: RequestOptions; }; export type IntegrationsLinkChannelEndpointMutationData = operations.IntegrationsControllerLinkChannelEndpointResponse; export type IntegrationsLinkChannelEndpointMutationError = | errors.ErrorDto | errors.ValidationErrorDto | NovuError | ResponseValidationError | ConnectionError | RequestAbortedError | RequestTimeoutError | InvalidRequestError | UnexpectedClientError | SDKValidationError; /** * Issue a URL to link a subscriber chat identity * * @remarks * Returns a provider-specific URL the subscriber opens to link their chat identity. The integration provider is resolved from integrationIdentifier; Telegram returns a deep link. */ export function useIntegrationsLinkChannelEndpointMutation( options?: MutationHookOptions< IntegrationsLinkChannelEndpointMutationData, IntegrationsLinkChannelEndpointMutationError, IntegrationsLinkChannelEndpointMutationVariables >, ): UseMutationResult< IntegrationsLinkChannelEndpointMutationData, IntegrationsLinkChannelEndpointMutationError, IntegrationsLinkChannelEndpointMutationVariables > { const client = useNovuContext(); return useMutation({ ...buildIntegrationsLinkChannelEndpointMutation(client, options), ...options, }); } export function mutationKeyIntegrationsLinkChannelEndpoint(): MutationKey { return ["@novu/api", "Integrations", "linkChannelEndpoint"]; } export function buildIntegrationsLinkChannelEndpointMutation( client$: NovuCore, hookOptions?: RequestOptions, ): { mutationKey: MutationKey; mutationFn: ( variables: IntegrationsLinkChannelEndpointMutationVariables, ) => Promise<IntegrationsLinkChannelEndpointMutationData>; } { return { mutationKey: mutationKeyIntegrationsLinkChannelEndpoint(), mutationFn: function integrationsLinkChannelEndpointMutationFn({ linkChannelEndpointRequestDto, idempotencyKey, options, }): Promise<IntegrationsLinkChannelEndpointMutationData> { const mergedOptions = { ...hookOptions, ...options, fetchOptions: { ...hookOptions?.fetchOptions, ...options?.fetchOptions, signal: combineSignals( hookOptions?.fetchOptions?.signal, options?.fetchOptions?.signal, ), }, }; return unwrapAsync(integrationsLinkChannelEndpoint( client$, linkChannelEndpointRequestDto, idempotencyKey, mergedOptions, )); }, }; }