Class: Datasets
Defined in: src/entities/datasets.ts Service class for dataset operations used by dataset utilities.Constructors
Constructor
Returns
Datasets
Methods
create()
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()
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()
Parameters
params
SyntheticDatasetExtensionRequest
Configuration for synthetic data generation.
Returns
Promise<DatasetRow[]>
A promise that resolves to the generated dataset rows.
get()
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()
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()
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()
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()
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.