/
githubmirror
/
novu
Обзор
Документация
Войти
/
githubmirror
/
novu
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
next
libs/internal-sdk/src/react-query/channelEndpointsRetrieve.core.ts
78 строк
2 KB
George Djabarov
refactor(api-service): standardize subscription identifier usage across endpoints fixes NV-6982 (#9694)
26 дек 2025, 00:03
Не верифицирован
26 дек 2025, 00:03
3dca011
Код
Авторство
О чём код?
/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import { QueryClient, QueryFunctionContext, QueryKey, } from "@tanstack/react-query"; import { NovuCore } from "../core.js"; import { channelEndpointsRetrieve } from "../funcs/channelEndpointsRetrieve.js"; import { combineSignals } from "../lib/primitives.js"; import { RequestOptions } from "../lib/sdks.js"; import * as operations from "../models/operations/index.js"; import { unwrapAsync } from "../types/fp.js"; export type ChannelEndpointsRetrieveQueryData = operations.ChannelEndpointsControllerGetChannelEndpointResponse; export function prefetchChannelEndpointsRetrieve( queryClient: QueryClient, client$: NovuCore, identifier: string, idempotencyKey?: string | undefined, options?: RequestOptions, ): Promise<void> { return queryClient.prefetchQuery({ ...buildChannelEndpointsRetrieveQuery( client$, identifier, idempotencyKey, options, ), }); } export function buildChannelEndpointsRetrieveQuery( client$: NovuCore, identifier: string, idempotencyKey?: string | undefined, options?: RequestOptions, ): { queryKey: QueryKey; queryFn: ( context: QueryFunctionContext, ) => Promise<ChannelEndpointsRetrieveQueryData>; } { return { queryKey: queryKeyChannelEndpointsRetrieve(identifier, { idempotencyKey }), queryFn: async function channelEndpointsRetrieveQueryFn( ctx, ): Promise<ChannelEndpointsRetrieveQueryData> { const sig = combineSignals( ctx.signal, options?.signal, options?.fetchOptions?.signal, ); const mergedOptions = { ...options?.fetchOptions, ...options, signal: sig, }; return unwrapAsync(channelEndpointsRetrieve( client$, identifier, idempotencyKey, mergedOptions, )); }, }; } export function queryKeyChannelEndpointsRetrieve( identifier: string, parameters: { idempotencyKey?: string | undefined }, ): QueryKey { return ["@novu/api", "Channel Endpoints", "retrieve", identifier, parameters]; }