/
githubmirror
/
novu
Обзор
Документация
Войти
/
githubmirror
/
novu
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
next
libs/internal-sdk/src/react-query/workflowsPatch.ts
119 строк
3 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 { MutationKey, useMutation, UseMutationResult, } from "@tanstack/react-query"; import { NovuCore } from "../core.js"; import { workflowsPatch } from "../funcs/workflowsPatch.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 WorkflowsPatchMutationVariables = { patchWorkflowDto: components.PatchWorkflowDto; workflowId: string; idempotencyKey?: string | undefined; options?: RequestOptions; }; export type WorkflowsPatchMutationData = operations.WorkflowControllerPatchWorkflowResponse; export type WorkflowsPatchMutationError = | errors.ErrorDto | errors.ValidationErrorDto | NovuError | ResponseValidationError | ConnectionError | RequestAbortedError | RequestTimeoutError | InvalidRequestError | UnexpectedClientError | SDKValidationError; /** * Update a workflow * * @remarks * Partially updates a workflow by its unique identifier **workflowId** */ export function useWorkflowsPatchMutation( options?: MutationHookOptions< WorkflowsPatchMutationData, WorkflowsPatchMutationError, WorkflowsPatchMutationVariables >, ): UseMutationResult< WorkflowsPatchMutationData, WorkflowsPatchMutationError, WorkflowsPatchMutationVariables > { const client = useNovuContext(); return useMutation({ ...buildWorkflowsPatchMutation(client, options), ...options, }); } export function mutationKeyWorkflowsPatch(): MutationKey { return ["@novu/api", "Workflows", "patch"]; } export function buildWorkflowsPatchMutation( client$: NovuCore, hookOptions?: RequestOptions, ): { mutationKey: MutationKey; mutationFn: ( variables: WorkflowsPatchMutationVariables, ) => Promise<WorkflowsPatchMutationData>; } { return { mutationKey: mutationKeyWorkflowsPatch(), mutationFn: function workflowsPatchMutationFn({ patchWorkflowDto, workflowId, idempotencyKey, options, }): Promise<WorkflowsPatchMutationData> { const mergedOptions = { ...hookOptions, ...options, fetchOptions: { ...hookOptions?.fetchOptions, ...options?.fetchOptions, signal: combineSignals( hookOptions?.fetchOptions?.signal, options?.fetchOptions?.signal, ), }, }; return unwrapAsync(workflowsPatch( client$, patchWorkflowDto, workflowId, idempotencyKey, mergedOptions, )); }, }; }