import type { DatasetFormat, DatasetRow, SyntheticDatasetExtensionRequest, DatasetVersionHistory, DatasetContent, DatasetProject, DatasetDBType, DatasetRecord } from '../types/dataset.types'; import type { UserInfo } from '../types/openapi.types'; /** * Dataset entity for working with dataset metadata and content. */ export declare class Dataset { private client; private _content; readonly id: string; readonly name: string; readonly columnNames: string[]; readonly numRows: number; readonly createdAt: string; readonly updatedAt: string; readonly draft: boolean; readonly projectCount: number; readonly currentVersionIndex: number; readonly createdByUser: UserInfo; constructor(datasetDb: DatasetDBType); private ensureClient; private processDatasetRow; private serializeDatasetRowValue; /** * Gets the content of the dataset and caches it locally. * @returns A promise that resolves to the rows of the dataset. */ getContent(): Promise; /** * Gets the cached content without making an API call. * @returns The cached dataset rows or null if not loaded. */ get content(): DatasetRow[] | null; /** * Adds rows to the dataset and refreshes the cached content. * @param rows - The rows to append to the dataset. * @returns A promise that resolves to the updated dataset. */ addRows(rows: Record | null>[]): Promise; /** * Gets the version history of this dataset. * @returns A promise that resolves to the version history for this dataset. */ getVersionHistory(): Promise; /** * Loads the content for a specific version of this dataset. * @param versionIndex - The index of the version to load. * @returns A promise that resolves to the content of the specified version. */ loadVersion(versionIndex: number): Promise; /** * Lists all projects that use this dataset. * @param limit - (Optional) The maximum number of projects to return. * @returns A promise that resolves to the list of projects that use this dataset. */ listProjects(limit?: number): Promise; /** * Returns the underlying dataset database representation. * @returns The dataset database object. */ toDatasetDB(): DatasetDBType; } /** * Service class for dataset operations used by dataset utilities. */ export declare class Datasets { private client; private ensureClient; /** * Gets dataset records for a dataset identified by ID or name. * @param options - The options used to locate the dataset. * @param options.datasetId - (Optional) The ID of the dataset. * @param options.datasetName - (Optional) The name of the dataset. * @returns A promise that resolves to the list of dataset records. */ static getRecordsForDataset(options: { datasetId?: string; datasetName?: string; }): Promise; static recoverDatasetRecords(dataset: Dataset): Promise; /** * Loads dataset and records based on provided parameters. * * Priority order: * 1. datasetId (explicit ID) * 2. datasetName (explicit name) * 3. dataset as string (interpreted as name) * 4. dataset as Dataset object * 5. dataset as array of records * * @param options - Dataset loading options * @param options.dataset - Dataset object, array of records, or dataset name (string) * @param options.datasetId - Optional explicit dataset ID * @param options.datasetName - Optional explicit dataset name * @param options.projectName - Optional project name for dataset lookup * @returns Promise resolving to tuple of [Dataset | null, DatasetRecord[]] * @throws Error if no valid dataset information is provided */ static loadDatasetAndRecords(options: { dataset?: DatasetDBType | Record[] | string; datasetId?: string; datasetName?: string; projectName?: string; }): Promise<[Dataset | null, DatasetRecord[]]>; /** * Lists datasets with optional filtering and pagination. * Utility function getDatasets() delegates to this method. * @param options - (Optional) Options for listing datasets. * @param options.limit - (Optional) The maximum number of datasets to return. * @param options.projectId - (Optional) The ID of the project that uses the datasets. * @param options.projectName - (Optional) The name of the project that uses the datasets. * @returns A promise that resolves to the list of datasets. */ list(options?: { projectId?: string; projectName?: string; limit?: number; }): Promise; /** * Gets a dataset by ID or name with optional content loading and project validation. * Utility function getDataset() delegates to this method. * @param options - The options used to locate the dataset. * @param options.id - (Optional) The ID of the dataset. * @param options.name - (Optional) The name of the dataset. * @param options.withContent - (Optional) Whether to load the dataset content. * @param options.projectId - (Optional) The ID of the project to validate against. * @param options.projectName - (Optional) The name of the project to validate against. * @returns A promise that resolves to the dataset, or null if it is not found. */ get(options: { id?: string; name?: string; withContent?: boolean; projectId?: string; projectName?: string; }): Promise; /** * Creates a new dataset with optional project association. * Utility function createDataset() delegates to this method. * @param options - The options used to create the dataset. * @param options.name - The name of the dataset. * @param options.filePath - The path to the dataset file. * @param options.format - The format of the dataset file. * @param options.projectId - (Optional) The ID of the project that will use the dataset. * @param options.projectName - (Optional) The name of the project that will use the dataset. * @returns A promise that resolves to the created dataset. */ create(options: { name: string; filePath: string; format: DatasetFormat; projectId?: string; projectName?: string; }): Promise; /** * Deletes a dataset with optional project validation. * Utility function deleteDataset() delegates to this method. * @param options - The options used to locate the dataset. * @param options.id - (Optional) The ID of the dataset. * @param options.name - (Optional) The name of the dataset. * @param options.projectId - (Optional) The ID of the project to validate against. * @param options.projectName - (Optional) The name of the project to validate against. * @returns A promise that resolves when the dataset has been deleted. */ delete(options: { id?: string; name?: string; projectId?: string; projectName?: string; }): Promise; /** * Extends a dataset with synthetically generated data. * Utility function extendDataset() delegates to this method. * @param params - Configuration for synthetic data generation. * @returns A promise that resolves to the generated dataset rows. */ extend(params: SyntheticDatasetExtensionRequest): Promise; /** * Gets the version history of a dataset. * Utility function getDatasetVersionHistory() delegates to this method. * @param options - The options used to locate the dataset. * @param options.datasetId - (Optional) The ID of the dataset. * @param options.datasetName - (Optional) The name of the dataset. * @returns A promise that resolves to the version history for the dataset. */ getVersionHistory(options: { datasetId?: string; datasetName?: string; }): Promise; /** * Gets a specific version of a dataset. * Utility function getDatasetVersion() delegates to this method. * @param options - The options used to locate the dataset version. * @param options.versionIndex - The version index to retrieve. * @param options.datasetId - (Optional) The ID of the dataset. * @param options.datasetName - (Optional) The name of the dataset. * @returns A promise that resolves to the dataset content at the specified version. */ getVersion(options: { versionIndex: number; datasetId?: string; datasetName?: string; }): Promise; /** * Lists all projects that use a dataset. * Utility function listDatasetProjects() delegates to this method. * @param options - The options used to locate the dataset. * @param options.datasetId - (Optional) The ID of the dataset. * @param options.datasetName - (Optional) The name of the dataset. * @param options.limit - (Optional) The maximum number of projects to return. * @returns A promise that resolves to the list of projects that use the dataset. */ listProjects(options: { datasetId?: string; datasetName?: string; limit?: number; }): Promise; private resolveProjectId; private validateDatasetInProject; }