Class: Datasets

appLib/SDKDrivers/xFrameDriver/datasets.Datasets

Datasets repository.

The Datasets class allows the user to manage datasets.

Hierarchy

Implements

Table of contents

Constructors

Methods

Constructors

constructor

new Datasets(agent)

Creates an instance of Repository.

Parameters

Name Type
agent PeerAgent

Inherited from

Repository.constructor

Methods

create

create(payload): Promise<SDKDataset>

Creates a new dataset.

Example

Copy
Copied
const dataset = await dl.datasets.create({
 name: 'My Dataset'
 })

Parameters

Name Type Description
payload Object An object containing the dataset's name.
payload.name string The name of the dataset to be created.

Returns

Promise<SDKDataset>

  • A promise that resolves to the created dataset.

Implementation of

IBundle.create


crudReq

crudReq(data): void

Sends a CRUD request to the xFrame.

Parameters

Name Type
data any

Returns

void

Inherited from

Repository.crudReq


crudReqSync

crudReqSync(data, options?): Promise<any>

Sends a CRUD request to the xFrame.

Parameters

Name Type Description
data any The data to send.
options Object
options.timeout? number an option to set the timeout for the request.

Returns

Promise<any>

Inherited from

Repository.crudReqSync


delete

delete(datasetId): Promise<void>

Deletes a dataset by id.

Example

Copy
Copied
await dl.datasets.delete('datasetId-123')

Parameters

Name Type Description
datasetId string The id of the dataset to be deleted.

Returns

Promise<void>

  • A promise that resolves when the dataset is deleted.

Implementation of

IBundle.delete


get

get(datasetId?): Promise<SDKDataset>

Retrieves a dataset by id.

If the dataset id is not provided, the active dataset is returned.

Example

Copy
Copied
const activeDataset = await dl.datasets.get()

Example

Copy
Copied
const dataset = await dl.datasets.get('datasetId-123')

Parameters

Name Type Description
datasetId? string The id of the dataset to be retrieved.

Returns

Promise<SDKDataset>

  • A promise that resolves to the retrieved dataset.

Implementation of

IBundle.get


query

query(): Promise<IPagedResponse<SDKDataset>>

Retrieves a list of datasets.

Example

Copy
Copied
const pagedResponse = await dl.datasets.query()
const datasets = pagedResponse.items

Returns

Promise<IPagedResponse<SDKDataset>>

  • Returns a Promise that resolves to a paged response object of datasets.

Implementation of

IBundle.query


update

update(payload): Promise<SDKDataset>

Updates a dataset --- currently not supported.

Parameters

Name Type Description
payload Partial<SDKDataset> The fields to update on the dataset.

Returns

Promise<SDKDataset>

  • A promise that resolves to the updated dataset.

Implementation of

IBundle.update