/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import { QueryClient, QueryFunctionContext, QueryKey, } from "@tanstack/react-query"; import { SDKCore } from "../core.js"; import { llmVectorStoresListFilesInBatch } from "../funcs/llmVectorStoresListFilesInBatch.js"; import { combineSignals } from "../lib/primitives.js"; import { RequestOptions } from "../lib/sdks.js"; import * as components from "../models/components/index.js"; import * as operations from "../models/operations/index.js"; import { unwrapAsync } from "../types/fp.js"; export type LlmVectorStoresListFilesInBatchQueryData = components.VectorStoreFileList; export function prefetchLlmVectorStoresListFilesInBatch( queryClient: QueryClient, client$: SDKCore, request: operations.ListVectorStoreFilesInBatchRequest, options?: RequestOptions, ): Promise { return queryClient.prefetchQuery({ ...buildLlmVectorStoresListFilesInBatchQuery( client$, request, options, ), }); } export function buildLlmVectorStoresListFilesInBatchQuery( client$: SDKCore, request: operations.ListVectorStoreFilesInBatchRequest, options?: RequestOptions, ): { queryKey: QueryKey; queryFn: ( context: QueryFunctionContext, ) => Promise; } { return { queryKey: queryKeyLlmVectorStoresListFilesInBatch( request.vectorStoreId, request.batchId, { limit: request.limit, order: request.order, after: request.after, before: request.before, filter: request.filter, xOnBehalfOf: request.xOnBehalfOf, }, ), queryFn: async function llmVectorStoresListFilesInBatchQueryFn( ctx, ): Promise { const sig = combineSignals( ctx.signal, options?.signal, options?.fetchOptions?.signal, ); const mergedOptions = { ...options?.fetchOptions, ...options, signal: sig, }; return unwrapAsync(llmVectorStoresListFilesInBatch( client$, request, mergedOptions, )); }, }; } export function queryKeyLlmVectorStoresListFilesInBatch( vectorStoreId: string, batchId: string, parameters: { limit?: number | undefined; order?: operations.ListVectorStoreFilesInBatchQueryParamOrder | undefined; after?: string | undefined; before?: string | undefined; filter?: operations.QueryParamFilter | undefined; xOnBehalfOf?: string | undefined; }, ): QueryKey { return [ "@meetkai/mka1", "vectorStores", "listFilesInBatch", vectorStoreId, batchId, parameters, ]; }