UserReportsDataSource
Defined in: js-api/src/dapi.ts:2588
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)
The fluent methods (filter, order, page, by, include, ...) are immutable: each returns a new source and leaves this one as it was, so a source can be kept in a variable and reused as a starting point.
Example
const projects = grok.dapi.projects.order('createdOn', true);
const recent = await projects.filter('createdOn > -1w').list({pageSize: 20});
const all = await projects.list(); // still unfiltered
Extends
Constructors
Constructor
new UserReportsDataSource(
s):UserReportsDataSource
Defined in: js-api/src/dapi.ts:2589
Parameters
| Parameter | Type |
|---|---|
s | any |
Returns
UserReportsDataSource
Overrides
Properties
| Property | Type | Inherited from | Defined in |
|---|---|---|---|
clsName | string | HttpDataSource.clsName | js-api/src/dapi.ts:349 |
dart | any | HttpDataSource.dart | js-api/src/dapi.ts:348 |
Methods
_prepare()
_prepare(
q?):any
Defined in: js-api/src/dapi.ts:365
Parameters
| Parameter | Type |
|---|---|
q | DataSourceQuery |
Returns
any
Inherited from
allPackageVersions()
allPackageVersions():
this
Defined in: js-api/src/dapi.ts:430
A source without package version isolation: entities of all package versions, not only the current one.
Returns
this
Inherited from
HttpDataSource.allPackageVersions
by()
by(
i):this
Defined in: js-api/src/dapi.ts:435
A source that returns at most [i] entities per page. See also page.
Parameters
| Parameter | Type |
|---|---|
i | number |
Returns
this
Inherited from
count()
count():
Promise<number>
Defined in: js-api/src/dapi.ts:401
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>
Inherited from
delete()
delete(
e):Promise<void>
Defined in: js-api/src/dapi.ts:425
Deletes an entity.
Parameters
| Parameter | Type |
|---|---|
e | DartObject |
Returns
Promise<void>
Inherited from
filter()
filter(
w):this
Defined in: js-api/src/dapi.ts:455
A source filtered by [w]; replaces the filter of this source, if any. 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/concepts/objects#entity-search
Parameters
| Parameter | Type |
|---|---|
w | string |
Returns
this