HttpDataSource<T>
Defined in: js-api/src/dapi.ts:305
Common functionality for handling collections of entities stored on the server. Works with Datagrok REST API, allows to get filtered and paginated lists of entities, Can be extended with specific methods. (i.e. UsersDataSource)
Extended by
UsersDataSourceGroupsDataSourceEntitiesDataSourceDataConnectionsDataSourceFuncsDataSourceCredentialsDataSourceLayoutsDataSourceViewsDataSourceProjectsDataSourceSpacesDataSourceSpaceChildrenClientTablesDataSourceDockerImagesDataSourceDockerContainersDataSourceUserReportsDataSourceUserReportsRulesDataSourceNotificationsDataSourceLogDataSourceActivityDataSource
Type Parameters
| Type Parameter |
|---|
T |
Constructors
Constructor
new HttpDataSource<
T>(s,clsName?):HttpDataSource<T>
Defined in: js-api/src/dapi.ts:310
Parameters
| Parameter | Type |
|---|---|
s | any |
clsName? | string | null |
Returns
HttpDataSource<T>
Constructs
HttpDataSource
Properties
| Property | Type | Defined in |
|---|---|---|
clsName | string | js-api/src/dapi.ts:307 |
dart | any | js-api/src/dapi.ts:306 |
Methods
allPackageVersions()
allPackageVersions():
HttpDataSource<T>
Defined in: js-api/src/dapi.ts:362
Turns off package versions isolation. This DataSource will return all entities in all versions, not only the current one *
Returns
HttpDataSource<T>
by()
by(
i):HttpDataSource<T>
Defined in: js-api/src/dapi.ts:367
Parameters
| Parameter | Type |
|---|---|
i | number |
Returns
HttpDataSource<T>
count()
count():
Promise<number>
Defined in: js-api/src/dapi.ts:333
Counts entities that satisfy the filtering criteria (see filter). See examples: https://public.datagrok.ai/js/samples/dapi/projects-list Smart filter: https://datagrok.ai/help/datagrok/smart-search
Returns
Promise<number>
delete()
delete(
e):Promise<void>
Defined in: js-api/src/dapi.ts:357
Deletes an entity.
Parameters
| Parameter | Type |
|---|---|
e | Entity |
Returns
Promise<void>
filter()
filter(
w):HttpDataSource<T>
Defined in: js-api/src/dapi.ts:390
Applies filter to current request. Also can be set with list method "options" parameter See example: https://public.datagrok.ai/js/samples/dapi/projects-list Smart filter: https://datagrok.ai/help/datagrok/navigation/views/browse#entity-search
Parameters
| Parameter | Type |
|---|---|
w | string |
Returns
HttpDataSource<T>
find()
find(
id):Promise<T>
Defined in: js-api/src/dapi.ts:347
Returns an entity with the specified id. Throws an exception if an entity does not exist, or is not accessible in the current context. Sample: https://public.datagrok.ai/js/samples/data-access/save-and-load-df
Parameters
| Parameter | Type | Description |
|---|---|---|
id | string | GUID of the corresponding object |
Returns
Promise<T>
{Promise<object>} - entity.
first()
first():
Promise<T>
Defined in: js-api/src/dapi.ts:338
Returns fist entity that satisfies the filtering criteria (see filter).
Returns
Promise<T>
include()
include(
include):HttpDataSource<T>
Defined in: js-api/src/dapi.ts:402
Includes entity in the result
Parameters
| Parameter | Type |
|---|---|
include | string |
Returns
HttpDataSource<T>
list()
list(
options?):Promise<T[]>
Defined in: js-api/src/dapi.ts:318
Returns all entities that satisfy the filtering criteria (see filter). See examples: https://public.datagrok.ai/js/samples/dapi/projects-list Smart filter: https://datagrok.ai/help/datagrok/smart-search
Parameters
| Parameter | Type |
|---|---|
options | { filter?: string; order?: string; pageNumber?: number; pageSize?: number; } |
options.filter? | string |
options.order? | string |
options.pageNumber? | number |
options.pageSize? | number |
Returns
Promise<T[]>
nextPage()
nextPage():
HttpDataSource<T>
Defined in: js-api/src/dapi.ts:381
Returns next page of all entities that satisfy the filtering criteria (see filter). Works only if pageSize was set during previous list() call See examples: https://public.datagrok.ai/js/samples/dapi/projects-list
Returns
HttpDataSource<T>
order()
order(
fieldName,desc?):HttpDataSource<T>
Defined in: js-api/src/dapi.ts:396
Instructs data source to return results in the specified order.
Parameters
| Parameter | Type | Default value |
|---|---|---|
fieldName | string | undefined |
desc | boolean | false |
Returns
HttpDataSource<T>
page()
page(
i):HttpDataSource<T>
Defined in: js-api/src/dapi.ts:373
Restricts results to the specified page number. See also nextPage.
Parameters
| Parameter | Type |
|---|---|
i | number |
Returns
HttpDataSource<T>
save()
save(
e):Promise<T>
Defined in: js-api/src/dapi.ts:352
Saves an entity.
Parameters
| Parameter | Type |
|---|---|
e | Entity |
Returns
Promise<T>