/
githubmirror
/
novu
Обзор
Документация
Войти
/
githubmirror
/
novu
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
next
libs/internal-sdk/src/react-query/subscribersNotificationsArchiveAllRead.ts
121 строка
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 { MutationKey, useMutation, UseMutationResult, } from "@tanstack/react-query"; import { NovuCore } from "../core.js"; import { subscribersNotificationsArchiveAllRead } from "../funcs/subscribersNotificationsArchiveAllRead.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 SubscribersNotificationsArchiveAllReadMutationVariables = { updateAllSubscriberNotificationsDto: components.UpdateAllSubscriberNotificationsDto; subscriberId: string; idempotencyKey?: string | undefined; options?: RequestOptions; }; export type SubscribersNotificationsArchiveAllReadMutationData = | operations.SubscribersControllerArchiveAllReadNotificationsResponse | undefined; export type SubscribersNotificationsArchiveAllReadMutationError = | errors.ErrorDto | errors.ValidationErrorDto | NovuError | ResponseValidationError | ConnectionError | RequestAbortedError | RequestTimeoutError | InvalidRequestError | UnexpectedClientError | SDKValidationError; /** * Archive all read notifications * * @remarks * Archive all read in-app (inbox) notifications matching the specified filters. Supports context-based filtering. */ export function useSubscribersNotificationsArchiveAllReadMutation( options?: MutationHookOptions< SubscribersNotificationsArchiveAllReadMutationData, SubscribersNotificationsArchiveAllReadMutationError, SubscribersNotificationsArchiveAllReadMutationVariables >, ): UseMutationResult< SubscribersNotificationsArchiveAllReadMutationData, SubscribersNotificationsArchiveAllReadMutationError, SubscribersNotificationsArchiveAllReadMutationVariables > { const client = useNovuContext(); return useMutation({ ...buildSubscribersNotificationsArchiveAllReadMutation(client, options), ...options, }); } export function mutationKeySubscribersNotificationsArchiveAllRead(): MutationKey { return ["@novu/api", "Notifications", "archiveAllRead"]; } export function buildSubscribersNotificationsArchiveAllReadMutation( client$: NovuCore, hookOptions?: RequestOptions, ): { mutationKey: MutationKey; mutationFn: ( variables: SubscribersNotificationsArchiveAllReadMutationVariables, ) => Promise<SubscribersNotificationsArchiveAllReadMutationData>; } { return { mutationKey: mutationKeySubscribersNotificationsArchiveAllRead(), mutationFn: function subscribersNotificationsArchiveAllReadMutationFn({ updateAllSubscriberNotificationsDto, subscriberId, idempotencyKey, options, }): Promise<SubscribersNotificationsArchiveAllReadMutationData> { const mergedOptions = { ...hookOptions, ...options, fetchOptions: { ...hookOptions?.fetchOptions, ...options?.fetchOptions, signal: combineSignals( hookOptions?.fetchOptions?.signal, options?.fetchOptions?.signal, ), }, }; return unwrapAsync(subscribersNotificationsArchiveAllRead( client$, updateAllSubscriberNotificationsDto, subscriberId, idempotencyKey, mergedOptions, )); }, }; }