IInsightsQuery
Service to query insights.
export interface IInsightsQuery
Methods
Method | Description |
|---|---|
Starts the query. | |
Sets filter for the query. | |
Sets include for the query. | |
Sets meta include for the query. | |
(BETA) Selects which backend endpoint flavor to use when listing insights. Default method: “GET” | |
Sets origin for the query. | |
Sets starting page for the query. Backend WILL return no data if the page is greater than total number of pages. Default page: 0 | |
Sets number of insights to return per page. Default size: 50 | |
Sets sorting for the query. |
Method details
IInsightsQuery.query()method
Starts the query.
query(): Promise<IInsightsQueryResult>;
Returns
Promise<IInsightsQueryResult>
promise of first page of the results
IInsightsQuery.withFilter()method
Sets filter for the query.
withFilter(filter: IFilterBaseOptions): IInsightsQuery;
Parameters
Parameter | Type | Description |
|---|---|---|
filter | filter to apply |
Returns
insights query
IInsightsQuery.withInclude()method
Sets include for the query.
withInclude(include: string[]): IInsightsQuery;
Parameters
Parameter | Type | Description |
|---|---|---|
include | string[] | include to apply |
Returns
insights query
IInsightsQuery.withMetaInclude()method
Sets meta include for the query.
withMetaInclude(metaInclude: string[]): IInsightsQuery;
Parameters
Parameter | Type | Description |
|---|---|---|
metaInclude | string[] | meta include to apply |
Returns
insights query
IInsightsQuery.withMethod()methodBeta
Beta API. Mostly stable, but details may change in a minor release, outside SemVer. See API maturity.
Selects which backend endpoint flavor to use when listing insights. Default method: “GET”
withMethod(method: QueryMethod): IInsightsQuery;
Parameters
Parameter | Type | Description |
|---|---|---|
method | endpoint flavor to use (“GET” or “POST”) |
Returns
insights query
IInsightsQuery.withOrigin()method
Sets origin for the query.
withOrigin(origin: ObjectOrigin | (string & {})): IInsightsQuery;
Parameters
Parameter | Type | Description |
|---|---|---|
origin | ObjectOrigin | (string & {}) | origin to apply. This is an open string union to allow platform-specific origin values in addition to the built-in literals. |
Returns
insights query
IInsightsQuery.withPage()method
Sets starting page for the query. Backend WILL return no data if the page is greater than total number of pages. Default page: 0
withPage(page: number): IInsightsQuery;
Parameters
Parameter | Type | Description |
|---|---|---|
page | number | zero indexed, must be non-negative |
Returns
insights query
IInsightsQuery.withSize()method
Sets number of insights to return per page. Default size: 50
withSize(size: number): IInsightsQuery;
Parameters
Parameter | Type | Description |
|---|---|---|
size | number | desired max number of insights per page must be a positive number |
Returns
insights query
IInsightsQuery.withSorting()method
Sets sorting for the query.
withSorting(sort: string[]): IInsightsQuery;
Parameters
Parameter | Type | Description |
|---|---|---|
sort | string[] | Sorting criteria in the format: property,(asc|desc). Default sort order is ascending. Multiple sort criteria are supported. |
Returns
insights query