/
githubmirror
/
novu
Обзор
Документация
Войти
/
githubmirror
/
novu
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
next
libs/internal-sdk/src/react-query/workflowsGet.core.ts
86 строк
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 { workflowsGet } from "../funcs/workflowsGet.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 WorkflowsGetQueryData = operations.WorkflowControllerGetWorkflowResponse; export function prefetchWorkflowsGet( queryClient: QueryClient, client$: NovuCore, workflowId: string, environmentId?: string | undefined, idempotencyKey?: string | undefined, options?: RequestOptions, ): Promise<void> { return queryClient.prefetchQuery({ ...buildWorkflowsGetQuery( client$, workflowId, environmentId, idempotencyKey, options, ), }); } export function buildWorkflowsGetQuery( client$: NovuCore, workflowId: string, environmentId?: string | undefined, idempotencyKey?: string | undefined, options?: RequestOptions, ): { queryKey: QueryKey; queryFn: (context: QueryFunctionContext) => Promise<WorkflowsGetQueryData>; } { return { queryKey: queryKeyWorkflowsGet(workflowId, { environmentId, idempotencyKey, }), queryFn: async function workflowsGetQueryFn( ctx, ): Promise<WorkflowsGetQueryData> { const sig = combineSignals( ctx.signal, options?.signal, options?.fetchOptions?.signal, ); const mergedOptions = { ...options?.fetchOptions, ...options, signal: sig, }; return unwrapAsync(workflowsGet( client$, workflowId, environmentId, idempotencyKey, mergedOptions, )); }, }; } export function queryKeyWorkflowsGet( workflowId: string, parameters: { environmentId?: string | undefined; idempotencyKey?: string | undefined; }, ): QueryKey { return ["@novu/api", "Workflows", "get", workflowId, parameters]; }