/
githubmirror
/
novu
Обзор
Документация
Войти
/
githubmirror
/
novu
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
next
libs/internal-sdk/src/react-query/integrationsCreateMobileLink.ts
120 строк
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 { integrationsCreateMobileLink } from "../funcs/integrationsCreateMobileLink.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 IntegrationsCreateMobileLinkMutationVariables = { issueIntegrationMobileLinkRequestDto: components.IssueIntegrationMobileLinkRequestDto; integrationIdentifier: string; idempotencyKey?: string | undefined; options?: RequestOptions; }; export type IntegrationsCreateMobileLinkMutationData = operations.IntegrationsControllerCreateIntegrationMobileLinkResponse; export type IntegrationsCreateMobileLinkMutationError = | errors.ErrorDto | errors.ValidationErrorDto | NovuError | ResponseValidationError | ConnectionError | RequestAbortedError | RequestTimeoutError | InvalidRequestError | UnexpectedClientError | SDKValidationError; /** * Issue a short-lived mobile setup link for an existing integration * * @remarks * Returns an opaque, single-use setup token plus a mobile URL for configuring an existing chat integration. Telegram is the only supported provider initially. */ export function useIntegrationsCreateMobileLinkMutation( options?: MutationHookOptions< IntegrationsCreateMobileLinkMutationData, IntegrationsCreateMobileLinkMutationError, IntegrationsCreateMobileLinkMutationVariables >, ): UseMutationResult< IntegrationsCreateMobileLinkMutationData, IntegrationsCreateMobileLinkMutationError, IntegrationsCreateMobileLinkMutationVariables > { const client = useNovuContext(); return useMutation({ ...buildIntegrationsCreateMobileLinkMutation(client, options), ...options, }); } export function mutationKeyIntegrationsCreateMobileLink(): MutationKey { return ["@novu/api", "Integrations", "createMobileLink"]; } export function buildIntegrationsCreateMobileLinkMutation( client$: NovuCore, hookOptions?: RequestOptions, ): { mutationKey: MutationKey; mutationFn: ( variables: IntegrationsCreateMobileLinkMutationVariables, ) => Promise<IntegrationsCreateMobileLinkMutationData>; } { return { mutationKey: mutationKeyIntegrationsCreateMobileLink(), mutationFn: function integrationsCreateMobileLinkMutationFn({ issueIntegrationMobileLinkRequestDto, integrationIdentifier, idempotencyKey, options, }): Promise<IntegrationsCreateMobileLinkMutationData> { const mergedOptions = { ...hookOptions, ...options, fetchOptions: { ...hookOptions?.fetchOptions, ...options?.fetchOptions, signal: combineSignals( hookOptions?.fetchOptions?.signal, options?.fetchOptions?.signal, ), }, }; return unwrapAsync(integrationsCreateMobileLink( client$, issueIntegrationMobileLinkRequestDto, integrationIdentifier, idempotencyKey, mergedOptions, )); }, }; }