Skip to main content

Class: Datasets

Defined in: src/entities/datasets.ts Service class for dataset operations used by dataset utilities.

Constructors

Constructor

new Datasets(): Datasets;

Returns

Datasets

Methods

create()

create(options: object): Promise<Dataset>;
Defined in: src/entities/datasets.ts Creates a new dataset with optional project association. Utility function createDataset() delegates to this method.

Parameters

options
The options used to create the dataset.
filePath
string The path to the dataset file.
format
DatasetFormat The format of the dataset file.
name
string The name of the dataset.
projectId?
string (Optional) The ID of the project that will use the dataset.
projectName?
string (Optional) The name of the project that will use the dataset.

Returns

Promise<Dataset> A promise that resolves to the created dataset.

delete()

delete(options: object): Promise<void>;
Defined in: src/entities/datasets.ts Deletes a dataset with optional project validation. Utility function deleteDataset() delegates to this method.

Parameters

options
The options used to locate the dataset.
id?
string (Optional) The ID of the dataset.
name?
string (Optional) The name of the dataset.
projectId?
string (Optional) The ID of the project to validate against.
projectName?
string (Optional) The name of the project to validate against.

Returns

Promise<void> A promise that resolves when the dataset has been deleted.

extend()

extend(params: SyntheticDatasetExtensionRequest): Promise<DatasetRow[]>;
Defined in: src/entities/datasets.ts Extends a dataset with synthetically generated data. Utility function extendDataset() delegates to this method.

Parameters

params
SyntheticDatasetExtensionRequest Configuration for synthetic data generation.

Returns

Promise<DatasetRow[]> A promise that resolves to the generated dataset rows.

get()

get(options: object): Promise<null | Dataset>;
Defined in: src/entities/datasets.ts Gets a dataset by ID or name with optional content loading and project validation. Utility function getDataset() delegates to this method.

Parameters

options
The options used to locate the dataset.
id?
string (Optional) The ID of the dataset.
name?
string (Optional) The name of the dataset.
projectId?
string (Optional) The ID of the project to validate against.
projectName?
string (Optional) The name of the project to validate against.
withContent?
boolean (Optional) Whether to load the dataset content.

Returns

Promise<null | Dataset> A promise that resolves to the dataset, or null if it is not found.

getVersion()

getVersion(options: object): Promise<DatasetContent>;
Defined in: src/entities/datasets.ts Gets a specific version of a dataset. Utility function getDatasetVersion() delegates to this method.

Parameters

options
The options used to locate the dataset version.
datasetId?
string (Optional) The ID of the dataset.
datasetName?
string (Optional) The name of the dataset.
versionIndex
number The version index to retrieve.

Returns

Promise<DatasetContent> A promise that resolves to the dataset content at the specified version.

getVersionHistory()

getVersionHistory(options: object): Promise<DatasetVersionHistory>;
Defined in: src/entities/datasets.ts Gets the version history of a dataset. Utility function getDatasetVersionHistory() delegates to this method.

Parameters

options
The options used to locate the dataset.
datasetId?
string (Optional) The ID of the dataset.
datasetName?
string (Optional) The name of the dataset.

Returns

Promise<DatasetVersionHistory> A promise that resolves to the version history for the dataset.

list()

list(options?: object): Promise<Dataset[]>;
Defined in: src/entities/datasets.ts Lists datasets with optional filtering and pagination. Utility function getDatasets() delegates to this method.

Parameters

options?
(Optional) Options for listing datasets.
limit?
number (Optional) The maximum number of datasets to return.
projectId?
string (Optional) The ID of the project that uses the datasets.
projectName?
string (Optional) The name of the project that uses the datasets.

Returns

Promise<Dataset[]> A promise that resolves to the list of datasets.

listProjects()

listProjects(options: object): Promise<DatasetProject[]>;
Defined in: src/entities/datasets.ts Lists all projects that use a dataset. Utility function listDatasetProjects() delegates to this method.

Parameters

options
The options used to locate the dataset.
datasetId?
string (Optional) The ID of the dataset.
datasetName?
string (Optional) The name of the dataset.
limit?
number (Optional) The maximum number of projects to return.

Returns

Promise<DatasetProject[]> A promise that resolves to the list of projects that use the dataset.