Skip to content

hailer.insight

Read insights (reports) and their data.

MethodHost opReturns
list()insight.listPromise<InsightDoc[]>
data(insightId, options)insight.dataPromise<InsightData>
update(insightId, update)insight.updatePromise<InsightDoc[]>

list()

Insights the app can see, projected to { _id, name, publicKey, presets }.

ts
const insights = await hailer.insight.list();
  • Workspace app — insights in the app's workspace.
  • Private app — insights in the user's current workspace.

data(insightId, options)

Run an insight and read its result.

ts
const data = await hailer.insight.data(insightId, {});
const fresh = await hailer.insight.data(insightId, { update: true });

The options argument is required. Pass { update: true } to force a recompute. Returns { headers, rows, time } — see InsightData.

update(insightId, update)

ts
const insights = await hailer.insight.update(insightId, { name: 'Renamed' });

Takes a partial InsightDoc and returns the updated list.

Insight editor dialogs (create/edit/delete/permission) are opened through hailer.ui.insight. Public (logged-out) insight reads are in hailer.public.insight.

Hailer Developer Documentation