@lssm/example.analytics-dashboard 0.0.0-canary-20251210082611 → 0.0.0-canary-20251212004227
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -2
- package/dist/docs/analytics-dashboard.docblock.js +58 -0
- package/dist/docs/index.js +1 -0
- package/dist/feature.js +1 -1
- package/dist/index.js +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +5 -1
package/README.md
CHANGED
|
@@ -235,8 +235,8 @@ const result = await queryEngine.execute(
|
|
|
235
235
|
- `@lssm/lib.contracts` - Contract definitions
|
|
236
236
|
- `@lssm/lib.identity-rbac` - Access control
|
|
237
237
|
- `@lssm/lib.metering` - Usage metrics integration
|
|
238
|
-
- `@lssm/
|
|
239
|
-
- `@lssm/
|
|
238
|
+
- `@lssm/module.audit-trail` - Change tracking
|
|
239
|
+
- `@lssm/module.notifications` - Report delivery
|
|
240
240
|
|
|
241
241
|
## Feature Flags
|
|
242
242
|
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import{registerDocBlocks as e}from"@lssm/lib.contracts/docs";e([{id:`docs.examples.analytics-dashboard`,title:`Analytics Dashboard`,summary:`Multi-tenant analytics with dashboards, widgets, query builder, and scheduled reports built on the Event Bus.`,kind:`reference`,visibility:`public`,route:`/docs/examples/analytics-dashboard`,tags:[`analytics`,`dashboards`,`bi`,`queries`],body:`## Entities
|
|
2
|
+
|
|
3
|
+
- Dashboard, Widget, Query, Report.
|
|
4
|
+
- Widget/query configs stay declarative for regeneration.
|
|
5
|
+
|
|
6
|
+
## Contracts
|
|
7
|
+
|
|
8
|
+
- \`analytics.dashboard.create\`, \`analytics.widget.add\`, \`analytics.query.execute\`, \`analytics.dashboard.get\`.
|
|
9
|
+
- Metrics can source from Event Bus schemas and Usage/Metering module.
|
|
10
|
+
|
|
11
|
+
## Events
|
|
12
|
+
|
|
13
|
+
- dashboard.created/updated, widget.added, report.scheduled/sent.
|
|
14
|
+
- Emitted for audit + notification hooks.
|
|
15
|
+
|
|
16
|
+
## UI / Presentations
|
|
17
|
+
|
|
18
|
+
- Dashboard list, dashboard view, query builder, widget gallery.
|
|
19
|
+
- Registered under \`analytics-dashboard\` template in Template Registry.
|
|
20
|
+
|
|
21
|
+
## Notes
|
|
22
|
+
|
|
23
|
+
- Enforce org scoping for multi-tenant isolation.
|
|
24
|
+
- Use Feature Flags for beta widgets; Metering to track query volume.
|
|
25
|
+
`},{id:`docs.examples.analytics-dashboard.goal`,title:`Analytics Dashboard — Goal`,summary:`Why this template matters and what success looks like.`,kind:`goal`,visibility:`public`,route:`/docs/examples/analytics-dashboard/goal`,tags:[`analytics`,`goal`],body:`## Why it matters
|
|
26
|
+
- Give teams a regenerable analytics workspace that stays in sync with Event Bus, Usage/Metering, and presentations.
|
|
27
|
+
- Avoid dashboard drift by keeping schema-first widgets/queries.
|
|
28
|
+
|
|
29
|
+
## Business/Product goal
|
|
30
|
+
- Deliver tenant-scoped dashboards, governed queries, and scheduled reports with clear ownership and auditability.
|
|
31
|
+
- Enable feature-flagged rollout of new widgets and sampling for cost control.
|
|
32
|
+
|
|
33
|
+
## Success criteria
|
|
34
|
+
- Dashboards can be regenerated safely from spec changes.
|
|
35
|
+
- Queries/widgets have enforced validation; PII is redacted per policy.`},{id:`docs.examples.analytics-dashboard.usage`,title:`Analytics Dashboard — Usage`,summary:`How to seed, extend, and safely regenerate dashboards.`,kind:`usage`,visibility:`public`,route:`/docs/examples/analytics-dashboard/usage`,tags:[`analytics`,`usage`],body:`## Setup
|
|
36
|
+
1) Seed dashboards/widgets (via template registry) to preload sample queries.
|
|
37
|
+
2) Configure org/tenant scope and attach Usage/Metering for cost/sampling controls.
|
|
38
|
+
|
|
39
|
+
## Extend & regenerate
|
|
40
|
+
1) Add or modify widget/query schemas in the spec (inputs, validation, PII paths).
|
|
41
|
+
2) Regenerate to update UI + API + events; review presentations for redaction.
|
|
42
|
+
3) Use Feature Flags to roll out new widgets or sampling knobs gradually.
|
|
43
|
+
|
|
44
|
+
## Guardrails
|
|
45
|
+
- Keep all query inputs validated; mark PII paths in policy.
|
|
46
|
+
- Use Audit Trail for report deliveries; Notifications for scheduled sends.`},{id:`docs.examples.analytics-dashboard.constraints`,title:`Analytics Dashboard — Constraints & Safety`,summary:`Internal guardrails for queries, widgets, and regeneration.`,kind:`reference`,visibility:`internal`,route:`/docs/examples/analytics-dashboard/constraints`,tags:[`analytics`,`constraints`,`internal`],body:`## Constraints
|
|
47
|
+
- Queries and widgets must declare inputs/validation in spec; no ad-hoc query strings.
|
|
48
|
+
- Regeneration must preserve sampling/windowing semantics; document changes explicitly.
|
|
49
|
+
- Events/usage metrics should remain consistent with Metering/Audit wiring.
|
|
50
|
+
|
|
51
|
+
## PII & Data
|
|
52
|
+
- Mark PII paths (user ids, emails) in presentations for redaction.
|
|
53
|
+
- Avoid exposing raw query payloads in MCP/web without policy checks.
|
|
54
|
+
|
|
55
|
+
## Verification
|
|
56
|
+
- Add fixtures for widget/query schema changes and scheduled reports.
|
|
57
|
+
- Run regeneration diff when adjusting query builders; ensure UI/markdown targets updated.
|
|
58
|
+
- Confirm feature-flagged widgets default to safe/off for new tenants.`}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import"./analytics-dashboard.docblock.js";
|
package/dist/feature.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{DashboardCreatedEvent as e,DashboardPublishedEvent as t,DashboardViewedEvent as n,QueryCreatedEvent as r,QueryExecutedEvent as i,ReportGeneratedEvent as a,WidgetAddedEvent as o}from"./events.js";import{analyticsDashboardSchemaContribution as s}from"./entities/index.js";import{AddWidgetContract as c,CreateDashboardContract as l,CreateQueryContract as u,ExecuteQueryContract as d,GetDashboardContract as f,ListDashboardsContract as p}from"./contracts/index.js";import{AnalyticsDashboardPresentations as m}from"./presentations/index.js";const h={name:`@lssm/example.analytics-dashboard`,version:`1.0.0`,description:`Analytics dashboards with customizable widgets and queries`,dependencies:[`@lssm/lib.schema`,`@lssm/lib.contracts`,`@lssm/lib.identity-rbac`,`@lssm/lib.metering`,`@lssm/
|
|
1
|
+
import{DashboardCreatedEvent as e,DashboardPublishedEvent as t,DashboardViewedEvent as n,QueryCreatedEvent as r,QueryExecutedEvent as i,ReportGeneratedEvent as a,WidgetAddedEvent as o}from"./events.js";import{analyticsDashboardSchemaContribution as s}from"./entities/index.js";import{AddWidgetContract as c,CreateDashboardContract as l,CreateQueryContract as u,ExecuteQueryContract as d,GetDashboardContract as f,ListDashboardsContract as p}from"./contracts/index.js";import{AnalyticsDashboardPresentations as m}from"./presentations/index.js";const h={name:`@lssm/example.analytics-dashboard`,version:`1.0.0`,description:`Analytics dashboards with customizable widgets and queries`,dependencies:[`@lssm/lib.schema`,`@lssm/lib.contracts`,`@lssm/lib.identity-rbac`,`@lssm/lib.metering`,`@lssm/module.audit-trail`,`@lssm/module.notifications`],schema:s,contracts:{createDashboard:l,addWidget:c,getDashboard:f,listDashboards:p,createQuery:u,executeQuery:d},events:{dashboardCreated:e,dashboardPublished:t,widgetAdded:o,queryCreated:r,queryExecuted:i,dashboardViewed:n,reportGenerated:a},presentations:m,permissions:{"dashboard:view":{description:`View dashboards`,defaultRoles:[`viewer`,`analyst`,`admin`]},"dashboard:create":{description:`Create dashboards`,defaultRoles:[`analyst`,`admin`]},"dashboard:edit":{description:`Edit dashboards`,defaultRoles:[`analyst`,`admin`]},"dashboard:delete":{description:`Delete dashboards`,defaultRoles:[`admin`]},"dashboard:share":{description:`Share dashboards externally`,defaultRoles:[`analyst`,`admin`]},"query:create":{description:`Create queries`,defaultRoles:[`analyst`,`admin`]},"query:execute":{description:`Execute queries`,defaultRoles:[`viewer`,`analyst`,`admin`]},"report:schedule":{description:`Schedule automated reports`,defaultRoles:[`analyst`,`admin`]}},featureFlags:{ANALYTICS_SQL_QUERIES:{description:`Enable SQL query support`,defaultValue:!1},ANALYTICS_SCHEDULED_REPORTS:{description:`Enable scheduled report generation`,defaultValue:!0},ANALYTICS_PUBLIC_DASHBOARDS:{description:`Allow public dashboard sharing`,defaultValue:!1},ANALYTICS_ADVANCED_WIDGETS:{description:`Enable advanced widget types (maps, funnels)`,defaultValue:!0},ANALYTICS_QUERY_CACHING:{description:`Enable query result caching`,defaultValue:!0}},metrics:{dashboards_created:{name:`Dashboards Created`,unit:`count`,aggregation:`count`},widgets_added:{name:`Widgets Added`,unit:`count`,aggregation:`count`},queries_executed:{name:`Queries Executed`,unit:`count`,aggregation:`count`},query_execution_time:{name:`Query Execution Time`,unit:`milliseconds`,aggregation:`avg`},dashboard_views:{name:`Dashboard Views`,unit:`count`,aggregation:`count`},reports_generated:{name:`Reports Generated`,unit:`count`,aggregation:`count`}},routes:{"/dashboards":{presentation:`analytics.dashboards.list`,permission:`dashboard:view`},"/dashboards/new":{presentation:`analytics.dashboard.editor`,permission:`dashboard:create`},"/dashboards/:slug":{presentation:`analytics.dashboard.view`,permission:`dashboard:view`},"/dashboards/:slug/edit":{presentation:`analytics.dashboard.editor`,permission:`dashboard:edit`},"/queries":{presentation:`analytics.queries.list`,permission:`query:create`},"/queries/builder":{presentation:`analytics.query.builder`,permission:`query:create`}}};export{h as AnalyticsDashboardFeature};
|
package/dist/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{AnalyticsDashboardEvents as e,DashboardCreatedEvent as t,DashboardPublishedEvent as n,DashboardViewedEvent as r,QueryCreatedEvent as i,QueryExecutedEvent as a,ReportGeneratedEvent as o,WidgetAddedEvent as s}from"./events.js";import{ChartTypeEnum as c,DashboardEntity as l,DashboardStatusEnum as u,QueryEntity as d,QueryTypeEnum as f,ReportEntity as p,ReportFormatEnum as m,ReportRunEntity as h,SavedFilterEntity as g,TimeRangeEnum as _,WidgetEntity as v,WidgetTypeEnum as y,analyticsDashboardSchemaContribution as b}from"./entities/index.js";import{AddWidgetContract as x,CreateDashboardContract as S,CreateQueryContract as C,ExecuteQueryContract as w,GetDashboardContract as T,ListDashboardsContract as E}from"./contracts/index.js";import{AnalyticsDashboardPresentations as D}from"./presentations/index.js";import{AnalyticsDashboardFeature as O}from"./feature.js";import{BasicQueryEngine as k,InMemoryQueryCache as A,createQueryEngine as j}from"./query-engine/index.js";import{handleAddWidget as M,handleCreateDashboard as N,handleCreateQuery as P,handleGetDashboard as F,handleListDashboards as I}from"./handlers/index.js";export{x as AddWidgetContract,e as AnalyticsDashboardEvents,O as AnalyticsDashboardFeature,D as AnalyticsDashboardPresentations,k as BasicQueryEngine,c as ChartTypeEnum,S as CreateDashboardContract,C as CreateQueryContract,t as DashboardCreatedEvent,l as DashboardEntity,n as DashboardPublishedEvent,u as DashboardStatusEnum,r as DashboardViewedEvent,w as ExecuteQueryContract,T as GetDashboardContract,A as InMemoryQueryCache,E as ListDashboardsContract,i as QueryCreatedEvent,d as QueryEntity,a as QueryExecutedEvent,f as QueryTypeEnum,p as ReportEntity,m as ReportFormatEnum,o as ReportGeneratedEvent,h as ReportRunEntity,g as SavedFilterEntity,_ as TimeRangeEnum,s as WidgetAddedEvent,v as WidgetEntity,y as WidgetTypeEnum,b as analyticsDashboardSchemaContribution,j as createQueryEngine,M as handleAddWidget,N as handleCreateDashboard,P as handleCreateQuery,F as handleGetDashboard,I as handleListDashboards};
|
|
1
|
+
import{AnalyticsDashboardEvents as e,DashboardCreatedEvent as t,DashboardPublishedEvent as n,DashboardViewedEvent as r,QueryCreatedEvent as i,QueryExecutedEvent as a,ReportGeneratedEvent as o,WidgetAddedEvent as s}from"./events.js";import{ChartTypeEnum as c,DashboardEntity as l,DashboardStatusEnum as u,QueryEntity as d,QueryTypeEnum as f,ReportEntity as p,ReportFormatEnum as m,ReportRunEntity as h,SavedFilterEntity as g,TimeRangeEnum as _,WidgetEntity as v,WidgetTypeEnum as y,analyticsDashboardSchemaContribution as b}from"./entities/index.js";import{AddWidgetContract as x,CreateDashboardContract as S,CreateQueryContract as C,ExecuteQueryContract as w,GetDashboardContract as T,ListDashboardsContract as E}from"./contracts/index.js";import{AnalyticsDashboardPresentations as D}from"./presentations/index.js";import{AnalyticsDashboardFeature as O}from"./feature.js";import{BasicQueryEngine as k,InMemoryQueryCache as A,createQueryEngine as j}from"./query-engine/index.js";import{handleAddWidget as M,handleCreateDashboard as N,handleCreateQuery as P,handleGetDashboard as F,handleListDashboards as I}from"./handlers/index.js";import"./docs/index.js";export{x as AddWidgetContract,e as AnalyticsDashboardEvents,O as AnalyticsDashboardFeature,D as AnalyticsDashboardPresentations,k as BasicQueryEngine,c as ChartTypeEnum,S as CreateDashboardContract,C as CreateQueryContract,t as DashboardCreatedEvent,l as DashboardEntity,n as DashboardPublishedEvent,u as DashboardStatusEnum,r as DashboardViewedEvent,w as ExecuteQueryContract,T as GetDashboardContract,A as InMemoryQueryCache,E as ListDashboardsContract,i as QueryCreatedEvent,d as QueryEntity,a as QueryExecutedEvent,f as QueryTypeEnum,p as ReportEntity,m as ReportFormatEnum,o as ReportGeneratedEvent,h as ReportRunEntity,g as SavedFilterEntity,_ as TimeRangeEnum,s as WidgetAddedEvent,v as WidgetEntity,y as WidgetTypeEnum,b as analyticsDashboardSchemaContribution,j as createQueryEngine,M as handleAddWidget,N as handleCreateDashboard,P as handleCreateQuery,F as handleGetDashboard,I as handleListDashboards};
|