Global

Methods

# aggregate(params) → {Promise.<ServiceResponse>}

Runs an aggregation query against the source's data.

Supports filtering, sorting, field selection, pagination via cursor (pageKey), and Elasticsearch-style aggregations. Pass raw: true to query the raw index (unprocessed field values as ingested).

Parameters:
Name Type Attributes Description
params Object

Aggregation parameters.

size number <optional>

Number of rows to return.

fields Array.<string> <optional>

Fields to include in each row.

sort Object <optional>

Sort descriptor.

filter Object <optional>

Filter conditions.

aggs Object <optional>

Elasticsearch aggregation definitions.

pageKey string <optional>

Cursor for the next page (from a previous response's nextPageKey).

raw boolean <optional>

When true, queries the raw index.

View Source services/InsightsService.class.js, line 99

Promise.<ServiceResponse>
Example
const { result } = await insights.Source('Orders').aggregate({
  size: 100,
  filter: { status: 'active' },
  sort: { createdAt: 'desc' }
})

# get(withSchemaopt) → {Promise.<ServiceResponse>}

Fetches metadata for the source, optionally including its formulator validation schema.

Parameters:
Name Type Attributes Default Description
withSchema boolean <optional>
false

When true, the response includes a schema object ({ validation, render, translations }) that can be passed directly to FormulatorForm.

View Source services/InsightsService.class.js, line 69

Promise.<ServiceResponse>
Example
const { result } = await insights.Source('Orders').get(true)
// result.schema.validation, result.schema.render, result.schema.translations

Type Definitions

Object

# FieldMappingObject

Properties:
Name Type Attributes Description
include Array.<string> <optional>
exclude Array.<string> <optional>

View Source services/CustomersService.class.js, line 10

Object

# ServiceResponse

Properties:
Name Type Description
status number

HTTP status code returned by the service.

result *

Parsed JSON body of the response, or undefined when the body is empty.

View Source services/ScenidCloudService.class.js, line 1