export type AttributeValueDto = {string?: (string | null) | undefined, guid?: (string | null) | undefined, bool?: (boolean | null) | undefined, int64?: (number | null) | undefined, float64?: (number | null) | undefined, dateTime?: (string | null) | undefined}; export type AttributeDto = {key?: string | undefined, value?: AttributeValueDto | undefined}; export type DenseVectorDto = {isSparse?: boolean | undefined, coordinates?: Array | undefined}; export type SparseVectorDto = {isSparse?: boolean | undefined, coordinates?: Array | undefined}; export type InputDataPointDto = {attributes?: Array | undefined, vector?: (DenseVectorDto | SparseVectorDto | null) | undefined, isDeleted?: boolean | undefined}; export type CreateApiApiV1UploadDataSourceNameDataSourceVersionArgs = {dataSourceName: string, dataSourceVersion: string, body: Array}; export type CreateApiApiV1UploadDataSourceNameDataSourceVersionOptions = {baseUrl: string, fetch?: typeof fetch | undefined}; /** * POST /api/v1/upload/{dataSourceName}/{dataSourceVersion} */ export const createApiApiV1UploadDataSourceNameDataSourceVersion = async (args: CreateApiApiV1UploadDataSourceNameDataSourceVersionArgs, options: CreateApiApiV1UploadDataSourceNameDataSourceVersionOptions) => { const {baseUrl, fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") const url = `${baseUrl.replace(/\/+$/, '')}/api/v1/upload/${encodeURIComponent(String(args.dataSourceName))}/${encodeURIComponent(String(args.dataSourceVersion))}${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "POST", headers, body: JSON.stringify(args.body)}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return undefined };