/
githubmirror
/
novu
Обзор
Документация
Войти
/
githubmirror
/
novu
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
next
libs/internal-sdk/src/react-query/contextsList.ts
162 строки
5 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 * as operations from "../models/operations/index.js"; import { useNovuContext } from "./_context.js"; import { QueryHookOptions, SuspenseQueryHookOptions, TupleToPrefixes, } from "./_types.js"; import { buildContextsListQuery, ContextsListQueryData, prefetchContextsList, queryKeyContextsList, } from "./contextsList.core.js"; export { buildContextsListQuery, type ContextsListQueryData, prefetchContextsList, queryKeyContextsList, }; export type ContextsListQueryError = | errors.ErrorDto | errors.ValidationErrorDto | NovuError | ResponseValidationError | ConnectionError | RequestAbortedError | RequestTimeoutError | InvalidRequestError | UnexpectedClientError | SDKValidationError; /** * List all contexts * * @remarks * Retrieve a paginated list of all contexts, optionally filtered by type and key pattern. * **type** and **id** are optional fields, if provided, only contexts with the matching type and id will be returned. * **search** is an optional field, if provided, only contexts with the matching key pattern will be returned. * Checkout all possible parameters in the query section below for more details */ export function useContextsList( request: operations.ContextsControllerListContextsRequest, options?: QueryHookOptions<ContextsListQueryData, ContextsListQueryError>, ): UseQueryResult<ContextsListQueryData, ContextsListQueryError> { const client = useNovuContext(); return useQuery({ ...buildContextsListQuery( client, request, options, ), ...options, }); } /** * List all contexts * * @remarks * Retrieve a paginated list of all contexts, optionally filtered by type and key pattern. * **type** and **id** are optional fields, if provided, only contexts with the matching type and id will be returned. * **search** is an optional field, if provided, only contexts with the matching key pattern will be returned. * Checkout all possible parameters in the query section below for more details */ export function useContextsListSuspense( request: operations.ContextsControllerListContextsRequest, options?: SuspenseQueryHookOptions< ContextsListQueryData, ContextsListQueryError >, ): UseSuspenseQueryResult<ContextsListQueryData, ContextsListQueryError> { const client = useNovuContext(); return useSuspenseQuery({ ...buildContextsListQuery( client, request, options, ), ...options, }); } export function setContextsListData( client: QueryClient, queryKeyBase: [ parameters: { after?: string | undefined; before?: string | undefined; limit?: number | undefined; orderDirection?: operations.OrderDirection | undefined; orderBy?: string | undefined; includeCursor?: boolean | undefined; type?: string | undefined; id?: string | undefined; search?: string | undefined; idempotencyKey?: string | undefined; }, ], data: ContextsListQueryData, ): ContextsListQueryData | undefined { const key = queryKeyContextsList(...queryKeyBase); return client.setQueryData<ContextsListQueryData>(key, data); } export function invalidateContextsList( client: QueryClient, queryKeyBase: TupleToPrefixes< [parameters: { after?: string | undefined; before?: string | undefined; limit?: number | undefined; orderDirection?: operations.OrderDirection | undefined; orderBy?: string | undefined; includeCursor?: boolean | undefined; type?: string | undefined; id?: string | undefined; search?: string | undefined; idempotencyKey?: string | undefined; }] >, filters?: Omit<InvalidateQueryFilters, "queryKey" | "predicate" | "exact">, ): Promise<void> { return client.invalidateQueries({ ...filters, queryKey: ["@novu/api", "Contexts", "list", ...queryKeyBase], }); } export function invalidateAllContextsList( client: QueryClient, filters?: Omit<InvalidateQueryFilters, "queryKey" | "predicate" | "exact">, ): Promise<void> { return client.invalidateQueries({ ...filters, queryKey: ["@novu/api", "Contexts", "list"], }); }