/
githubmirror
/
novu
Обзор
Документация
Войти
/
githubmirror
/
novu
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
next
libs/internal-sdk/src/react-query/channelEndpointsRetrieve.ts
147 строк
4 KB
Dima Grossman
chore(root): sdk gen version update for latest internal sdk changes (#10651)
10 апр 2026, 16:36
Не верифицирован
10 апр 2026, 16:36
b5e0674
Код
Авторство
О чём код?
/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import { InvalidateQueryFilters, QueryClient, useQuery, UseQueryResult, useSuspenseQuery, UseSuspenseQueryResult, } from "@tanstack/react-query"; 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 { useNovuContext } from "./_context.js"; import { QueryHookOptions, SuspenseQueryHookOptions, TupleToPrefixes, } from "./_types.js"; import { buildChannelEndpointsRetrieveQuery, ChannelEndpointsRetrieveQueryData, prefetchChannelEndpointsRetrieve, queryKeyChannelEndpointsRetrieve, } from "./channelEndpointsRetrieve.core.js"; export { buildChannelEndpointsRetrieveQuery, type ChannelEndpointsRetrieveQueryData, prefetchChannelEndpointsRetrieve, queryKeyChannelEndpointsRetrieve, }; export type ChannelEndpointsRetrieveQueryError = | errors.ErrorDto | errors.ValidationErrorDto | NovuError | ResponseValidationError | ConnectionError | RequestAbortedError | RequestTimeoutError | InvalidRequestError | UnexpectedClientError | SDKValidationError; /** * Retrieve a channel endpoint * * @remarks * Retrieve a specific channel endpoint by its unique identifier. */ export function useChannelEndpointsRetrieve( identifier: string, idempotencyKey?: string | undefined, options?: QueryHookOptions< ChannelEndpointsRetrieveQueryData, ChannelEndpointsRetrieveQueryError >, ): UseQueryResult< ChannelEndpointsRetrieveQueryData, ChannelEndpointsRetrieveQueryError > { const client = useNovuContext(); return useQuery({ ...buildChannelEndpointsRetrieveQuery( client, identifier, idempotencyKey, options, ), ...options, }); } /** * Retrieve a channel endpoint * * @remarks * Retrieve a specific channel endpoint by its unique identifier. */ export function useChannelEndpointsRetrieveSuspense( identifier: string, idempotencyKey?: string | undefined, options?: SuspenseQueryHookOptions< ChannelEndpointsRetrieveQueryData, ChannelEndpointsRetrieveQueryError >, ): UseSuspenseQueryResult< ChannelEndpointsRetrieveQueryData, ChannelEndpointsRetrieveQueryError > { const client = useNovuContext(); return useSuspenseQuery({ ...buildChannelEndpointsRetrieveQuery( client, identifier, idempotencyKey, options, ), ...options, }); } export function setChannelEndpointsRetrieveData( client: QueryClient, queryKeyBase: [ identifier: string, parameters: { idempotencyKey?: string | undefined }, ], data: ChannelEndpointsRetrieveQueryData, ): ChannelEndpointsRetrieveQueryData | undefined { const key = queryKeyChannelEndpointsRetrieve(...queryKeyBase); return client.setQueryData<ChannelEndpointsRetrieveQueryData>(key, data); } export function invalidateChannelEndpointsRetrieve( client: QueryClient, queryKeyBase: TupleToPrefixes< [identifier: string, parameters: { idempotencyKey?: string | undefined }] >, filters?: Omit<InvalidateQueryFilters, "queryKey" | "predicate" | "exact">, ): Promise<void> { return client.invalidateQueries({ ...filters, queryKey: ["@novu/api", "Channel Endpoints", "retrieve", ...queryKeyBase], }); } export function invalidateAllChannelEndpointsRetrieve( client: QueryClient, filters?: Omit<InvalidateQueryFilters, "queryKey" | "predicate" | "exact">, ): Promise<void> { return client.invalidateQueries({ ...filters, queryKey: ["@novu/api", "Channel Endpoints", "retrieve"], }); }