@contractspec/example.analytics-dashboard 1.44.0

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.
Files changed (62) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +281 -0
  3. package/dist/dashboard/dashboard.enum.d.ts +18 -0
  4. package/dist/dashboard/dashboard.enum.d.ts.map +1 -0
  5. package/dist/dashboard/dashboard.enum.js +43 -0
  6. package/dist/dashboard/dashboard.enum.js.map +1 -0
  7. package/dist/dashboard/dashboard.operation.d.ts +537 -0
  8. package/dist/dashboard/dashboard.operation.d.ts.map +1 -0
  9. package/dist/dashboard/dashboard.operation.js +213 -0
  10. package/dist/dashboard/dashboard.operation.js.map +1 -0
  11. package/dist/dashboard/dashboard.presentation.d.ts +9 -0
  12. package/dist/dashboard/dashboard.presentation.d.ts.map +1 -0
  13. package/dist/dashboard/dashboard.presentation.js +90 -0
  14. package/dist/dashboard/dashboard.presentation.js.map +1 -0
  15. package/dist/dashboard/dashboard.schema.d.ts +333 -0
  16. package/dist/dashboard/dashboard.schema.d.ts.map +1 -0
  17. package/dist/dashboard/dashboard.schema.js +236 -0
  18. package/dist/dashboard/dashboard.schema.js.map +1 -0
  19. package/dist/dashboard/index.d.ts +4 -0
  20. package/dist/dashboard/index.js +5 -0
  21. package/dist/dashboard.feature.d.ts +8 -0
  22. package/dist/dashboard.feature.d.ts.map +1 -0
  23. package/dist/dashboard.feature.js +166 -0
  24. package/dist/dashboard.feature.js.map +1 -0
  25. package/dist/docs/analytics-dashboard.docblock.d.ts +1 -0
  26. package/dist/docs/analytics-dashboard.docblock.js +114 -0
  27. package/dist/docs/analytics-dashboard.docblock.js.map +1 -0
  28. package/dist/docs/index.d.ts +1 -0
  29. package/dist/docs/index.js +1 -0
  30. package/dist/events.d.ts +149 -0
  31. package/dist/events.d.ts.map +1 -0
  32. package/dist/events.js +128 -0
  33. package/dist/events.js.map +1 -0
  34. package/dist/example.d.ts +40 -0
  35. package/dist/example.d.ts.map +1 -0
  36. package/dist/example.js +51 -0
  37. package/dist/example.js.map +1 -0
  38. package/dist/index.d.ts +7 -0
  39. package/dist/index.js +8 -0
  40. package/dist/query/index.d.ts +4 -0
  41. package/dist/query/index.js +5 -0
  42. package/dist/query/query.enum.d.ts +10 -0
  43. package/dist/query/query.enum.d.ts.map +1 -0
  44. package/dist/query/query.enum.js +16 -0
  45. package/dist/query/query.enum.js.map +1 -0
  46. package/dist/query/query.operation.d.ts +181 -0
  47. package/dist/query/query.operation.d.ts.map +1 -0
  48. package/dist/query/query.operation.js +113 -0
  49. package/dist/query/query.operation.js.map +1 -0
  50. package/dist/query/query.presentation.d.ts +8 -0
  51. package/dist/query/query.presentation.d.ts.map +1 -0
  52. package/dist/query/query.presentation.js +60 -0
  53. package/dist/query/query.presentation.js.map +1 -0
  54. package/dist/query/query.schema.d.ts +143 -0
  55. package/dist/query/query.schema.d.ts.map +1 -0
  56. package/dist/query/query.schema.js +157 -0
  57. package/dist/query/query.schema.js.map +1 -0
  58. package/dist/query-engine/index.d.ts +106 -0
  59. package/dist/query-engine/index.d.ts.map +1 -0
  60. package/dist/query-engine/index.js +189 -0
  61. package/dist/query-engine/index.js.map +1 -0
  62. package/package.json +91 -0
@@ -0,0 +1,149 @@
1
+ import * as _contractspec_lib_schema283 from "@contractspec/lib.schema";
2
+ import * as _contractspec_lib_contracts5 from "@contractspec/lib.contracts";
3
+
4
+ //#region src/events.d.ts
5
+ declare const DashboardCreatedEvent: _contractspec_lib_contracts5.EventSpec<_contractspec_lib_schema283.SchemaModel<{
6
+ dashboardId: {
7
+ type: _contractspec_lib_schema283.FieldType<string, string>;
8
+ isOptional: false;
9
+ };
10
+ title: {
11
+ type: _contractspec_lib_schema283.FieldType<string, string>;
12
+ isOptional: false;
13
+ };
14
+ orgId: {
15
+ type: _contractspec_lib_schema283.FieldType<string, string>;
16
+ isOptional: false;
17
+ };
18
+ createdBy: {
19
+ type: _contractspec_lib_schema283.FieldType<string, string>;
20
+ isOptional: false;
21
+ };
22
+ timestamp: {
23
+ type: _contractspec_lib_schema283.FieldType<Date, string>;
24
+ isOptional: false;
25
+ };
26
+ }>>;
27
+ declare const WidgetAddedEvent: _contractspec_lib_contracts5.EventSpec<_contractspec_lib_schema283.SchemaModel<{
28
+ widgetId: {
29
+ type: _contractspec_lib_schema283.FieldType<string, string>;
30
+ isOptional: false;
31
+ };
32
+ dashboardId: {
33
+ type: _contractspec_lib_schema283.FieldType<string, string>;
34
+ isOptional: false;
35
+ };
36
+ widgetType: {
37
+ type: _contractspec_lib_schema283.FieldType<string, string>;
38
+ isOptional: false;
39
+ };
40
+ orgId: {
41
+ type: _contractspec_lib_schema283.FieldType<string, string>;
42
+ isOptional: false;
43
+ };
44
+ timestamp: {
45
+ type: _contractspec_lib_schema283.FieldType<Date, string>;
46
+ isOptional: false;
47
+ };
48
+ }>>;
49
+ declare const QueryCreatedEvent: _contractspec_lib_contracts5.EventSpec<_contractspec_lib_schema283.SchemaModel<{
50
+ queryId: {
51
+ type: _contractspec_lib_schema283.FieldType<string, string>;
52
+ isOptional: false;
53
+ };
54
+ name: {
55
+ type: _contractspec_lib_schema283.FieldType<string, string>;
56
+ isOptional: false;
57
+ };
58
+ queryType: {
59
+ type: _contractspec_lib_schema283.FieldType<string, string>;
60
+ isOptional: false;
61
+ };
62
+ orgId: {
63
+ type: _contractspec_lib_schema283.FieldType<string, string>;
64
+ isOptional: false;
65
+ };
66
+ createdBy: {
67
+ type: _contractspec_lib_schema283.FieldType<string, string>;
68
+ isOptional: false;
69
+ };
70
+ timestamp: {
71
+ type: _contractspec_lib_schema283.FieldType<Date, string>;
72
+ isOptional: false;
73
+ };
74
+ }>>;
75
+ declare const AnalyticsDashboardEvents: {
76
+ DashboardCreatedEvent: _contractspec_lib_contracts5.EventSpec<_contractspec_lib_schema283.SchemaModel<{
77
+ dashboardId: {
78
+ type: _contractspec_lib_schema283.FieldType<string, string>;
79
+ isOptional: false;
80
+ };
81
+ title: {
82
+ type: _contractspec_lib_schema283.FieldType<string, string>;
83
+ isOptional: false;
84
+ };
85
+ orgId: {
86
+ type: _contractspec_lib_schema283.FieldType<string, string>;
87
+ isOptional: false;
88
+ };
89
+ createdBy: {
90
+ type: _contractspec_lib_schema283.FieldType<string, string>;
91
+ isOptional: false;
92
+ };
93
+ timestamp: {
94
+ type: _contractspec_lib_schema283.FieldType<Date, string>;
95
+ isOptional: false;
96
+ };
97
+ }>>;
98
+ WidgetAddedEvent: _contractspec_lib_contracts5.EventSpec<_contractspec_lib_schema283.SchemaModel<{
99
+ widgetId: {
100
+ type: _contractspec_lib_schema283.FieldType<string, string>;
101
+ isOptional: false;
102
+ };
103
+ dashboardId: {
104
+ type: _contractspec_lib_schema283.FieldType<string, string>;
105
+ isOptional: false;
106
+ };
107
+ widgetType: {
108
+ type: _contractspec_lib_schema283.FieldType<string, string>;
109
+ isOptional: false;
110
+ };
111
+ orgId: {
112
+ type: _contractspec_lib_schema283.FieldType<string, string>;
113
+ isOptional: false;
114
+ };
115
+ timestamp: {
116
+ type: _contractspec_lib_schema283.FieldType<Date, string>;
117
+ isOptional: false;
118
+ };
119
+ }>>;
120
+ QueryCreatedEvent: _contractspec_lib_contracts5.EventSpec<_contractspec_lib_schema283.SchemaModel<{
121
+ queryId: {
122
+ type: _contractspec_lib_schema283.FieldType<string, string>;
123
+ isOptional: false;
124
+ };
125
+ name: {
126
+ type: _contractspec_lib_schema283.FieldType<string, string>;
127
+ isOptional: false;
128
+ };
129
+ queryType: {
130
+ type: _contractspec_lib_schema283.FieldType<string, string>;
131
+ isOptional: false;
132
+ };
133
+ orgId: {
134
+ type: _contractspec_lib_schema283.FieldType<string, string>;
135
+ isOptional: false;
136
+ };
137
+ createdBy: {
138
+ type: _contractspec_lib_schema283.FieldType<string, string>;
139
+ isOptional: false;
140
+ };
141
+ timestamp: {
142
+ type: _contractspec_lib_schema283.FieldType<Date, string>;
143
+ isOptional: false;
144
+ };
145
+ }>>;
146
+ };
147
+ //#endregion
148
+ export { AnalyticsDashboardEvents, DashboardCreatedEvent, QueryCreatedEvent, WidgetAddedEvent };
149
+ //# sourceMappingURL=events.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"events.d.ts","names":[],"sources":["../src/events.ts"],"sourcesContent":[],"mappings":";;;;cAwCa,uBAAqB,4BAAA,CAAA,sCAAA;;UAUhC,2BAAA,CAAA;;EAVW,CAAA;EAUX,KAAA,EAAA;;;;;;;EAVgC,CAAA;EAAA,SAAA,EAAA;IAYrB,IAAA,uCAUX,CAAA,MAAA,EAAA,MAAA,CAAA;IAAA,UAAA,EAAA,KAAA;;;;;;;AAV2B,cAAhB,gBAAgB,EAAA,4BAAA,CAAA,SAAA,6BAAA,WAAA,CAAA;EAAA,QAAA,EAAA;IAYhB,IAAA,EAFX,2BAAA,CAAA,SAYA,CAAA,MAAA,EAAA,MAAA,CAAA;IAAA,UAAA,EAAA,KAAA;;;;;;;+CAV4B,CAAA,MAAA,EAAA,MAAA,CAAA;IAAA,UAAA,EAAA,KAAA;EAAA,CAAA;EAYjB,KAAA,EAAA;IAIZ,IAAA,uCAAA,CAAA,MAAA,EAAA,MAAA,CAAA;;;;;;;;cAhBY,mBAAiB,4BAAA,CAAA,sCAAA;;UAU5B,2BAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;;;cAEW;;;YAIZ,2BAAA,CAAA"}
package/dist/events.js ADDED
@@ -0,0 +1,128 @@
1
+ import { ScalarTypeEnum, defineSchemaModel } from "@contractspec/lib.schema";
2
+ import { defineEvent } from "@contractspec/lib.contracts";
3
+
4
+ //#region src/events.ts
5
+ const DashboardEventPayload = defineSchemaModel({
6
+ name: "DashboardEventPayload",
7
+ description: "Payload for dashboard events",
8
+ fields: {
9
+ dashboardId: {
10
+ type: ScalarTypeEnum.String_unsecure(),
11
+ isOptional: false
12
+ },
13
+ title: {
14
+ type: ScalarTypeEnum.String_unsecure(),
15
+ isOptional: false
16
+ },
17
+ orgId: {
18
+ type: ScalarTypeEnum.String_unsecure(),
19
+ isOptional: false
20
+ },
21
+ createdBy: {
22
+ type: ScalarTypeEnum.String_unsecure(),
23
+ isOptional: false
24
+ },
25
+ timestamp: {
26
+ type: ScalarTypeEnum.DateTime(),
27
+ isOptional: false
28
+ }
29
+ }
30
+ });
31
+ const WidgetEventPayload = defineSchemaModel({
32
+ name: "WidgetEventPayload",
33
+ description: "Payload for widget events",
34
+ fields: {
35
+ widgetId: {
36
+ type: ScalarTypeEnum.String_unsecure(),
37
+ isOptional: false
38
+ },
39
+ dashboardId: {
40
+ type: ScalarTypeEnum.String_unsecure(),
41
+ isOptional: false
42
+ },
43
+ widgetType: {
44
+ type: ScalarTypeEnum.String_unsecure(),
45
+ isOptional: false
46
+ },
47
+ orgId: {
48
+ type: ScalarTypeEnum.String_unsecure(),
49
+ isOptional: false
50
+ },
51
+ timestamp: {
52
+ type: ScalarTypeEnum.DateTime(),
53
+ isOptional: false
54
+ }
55
+ }
56
+ });
57
+ const QueryEventPayload = defineSchemaModel({
58
+ name: "QueryEventPayload",
59
+ description: "Payload for query events",
60
+ fields: {
61
+ queryId: {
62
+ type: ScalarTypeEnum.String_unsecure(),
63
+ isOptional: false
64
+ },
65
+ name: {
66
+ type: ScalarTypeEnum.String_unsecure(),
67
+ isOptional: false
68
+ },
69
+ queryType: {
70
+ type: ScalarTypeEnum.String_unsecure(),
71
+ isOptional: false
72
+ },
73
+ orgId: {
74
+ type: ScalarTypeEnum.String_unsecure(),
75
+ isOptional: false
76
+ },
77
+ createdBy: {
78
+ type: ScalarTypeEnum.String_unsecure(),
79
+ isOptional: false
80
+ },
81
+ timestamp: {
82
+ type: ScalarTypeEnum.DateTime(),
83
+ isOptional: false
84
+ }
85
+ }
86
+ });
87
+ const DashboardCreatedEvent = defineEvent({
88
+ meta: {
89
+ key: "analytics.dashboard.created",
90
+ version: 1,
91
+ description: "A dashboard was created.",
92
+ stability: "stable",
93
+ owners: ["@analytics-team"],
94
+ tags: ["dashboard"]
95
+ },
96
+ payload: DashboardEventPayload
97
+ });
98
+ const WidgetAddedEvent = defineEvent({
99
+ meta: {
100
+ key: "analytics.widget.added",
101
+ version: 1,
102
+ description: "A widget was added to a dashboard.",
103
+ stability: "stable",
104
+ owners: ["@analytics-team"],
105
+ tags: ["dashboard"]
106
+ },
107
+ payload: WidgetEventPayload
108
+ });
109
+ const QueryCreatedEvent = defineEvent({
110
+ meta: {
111
+ key: "analytics.query.created",
112
+ version: 1,
113
+ description: "A query was created.",
114
+ stability: "stable",
115
+ owners: ["@analytics-team"],
116
+ tags: ["dashboard"]
117
+ },
118
+ payload: QueryEventPayload
119
+ });
120
+ const AnalyticsDashboardEvents = {
121
+ DashboardCreatedEvent,
122
+ WidgetAddedEvent,
123
+ QueryCreatedEvent
124
+ };
125
+
126
+ //#endregion
127
+ export { AnalyticsDashboardEvents, DashboardCreatedEvent, QueryCreatedEvent, WidgetAddedEvent };
128
+ //# sourceMappingURL=events.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"events.js","names":[],"sources":["../src/events.ts"],"sourcesContent":["import { defineSchemaModel, ScalarTypeEnum } from '@contractspec/lib.schema';\nimport { defineEvent } from '@contractspec/lib.contracts';\n\nconst DashboardEventPayload = defineSchemaModel({\n name: 'DashboardEventPayload',\n description: 'Payload for dashboard events',\n fields: {\n dashboardId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n title: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n orgId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n createdBy: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n timestamp: { type: ScalarTypeEnum.DateTime(), isOptional: false },\n },\n});\n\nconst WidgetEventPayload = defineSchemaModel({\n name: 'WidgetEventPayload',\n description: 'Payload for widget events',\n fields: {\n widgetId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n dashboardId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n widgetType: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n orgId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n timestamp: { type: ScalarTypeEnum.DateTime(), isOptional: false },\n },\n});\n\nconst QueryEventPayload = defineSchemaModel({\n name: 'QueryEventPayload',\n description: 'Payload for query events',\n fields: {\n queryId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n name: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n queryType: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n orgId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n createdBy: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n timestamp: { type: ScalarTypeEnum.DateTime(), isOptional: false },\n },\n});\n\nexport const DashboardCreatedEvent = defineEvent({\n meta: {\n key: 'analytics.dashboard.created',\n version: 1,\n description: 'A dashboard was created.',\n stability: 'stable',\n owners: ['@analytics-team'],\n tags: ['dashboard'],\n },\n payload: DashboardEventPayload,\n});\n\nexport const WidgetAddedEvent = defineEvent({\n meta: {\n key: 'analytics.widget.added',\n version: 1,\n description: 'A widget was added to a dashboard.',\n stability: 'stable',\n owners: ['@analytics-team'],\n tags: ['dashboard'],\n },\n payload: WidgetEventPayload,\n});\n\nexport const QueryCreatedEvent = defineEvent({\n meta: {\n key: 'analytics.query.created',\n version: 1,\n description: 'A query was created.',\n stability: 'stable',\n owners: ['@analytics-team'],\n tags: ['dashboard'],\n },\n payload: QueryEventPayload,\n});\n\nexport const AnalyticsDashboardEvents = {\n DashboardCreatedEvent,\n WidgetAddedEvent,\n QueryCreatedEvent,\n};\n"],"mappings":";;;;AAGA,MAAM,wBAAwB,kBAAkB;CAC9C,MAAM;CACN,aAAa;CACb,QAAQ;EACN,aAAa;GAAE,MAAM,eAAe,iBAAiB;GAAE,YAAY;GAAO;EAC1E,OAAO;GAAE,MAAM,eAAe,iBAAiB;GAAE,YAAY;GAAO;EACpE,OAAO;GAAE,MAAM,eAAe,iBAAiB;GAAE,YAAY;GAAO;EACpE,WAAW;GAAE,MAAM,eAAe,iBAAiB;GAAE,YAAY;GAAO;EACxE,WAAW;GAAE,MAAM,eAAe,UAAU;GAAE,YAAY;GAAO;EAClE;CACF,CAAC;AAEF,MAAM,qBAAqB,kBAAkB;CAC3C,MAAM;CACN,aAAa;CACb,QAAQ;EACN,UAAU;GAAE,MAAM,eAAe,iBAAiB;GAAE,YAAY;GAAO;EACvE,aAAa;GAAE,MAAM,eAAe,iBAAiB;GAAE,YAAY;GAAO;EAC1E,YAAY;GAAE,MAAM,eAAe,iBAAiB;GAAE,YAAY;GAAO;EACzE,OAAO;GAAE,MAAM,eAAe,iBAAiB;GAAE,YAAY;GAAO;EACpE,WAAW;GAAE,MAAM,eAAe,UAAU;GAAE,YAAY;GAAO;EAClE;CACF,CAAC;AAEF,MAAM,oBAAoB,kBAAkB;CAC1C,MAAM;CACN,aAAa;CACb,QAAQ;EACN,SAAS;GAAE,MAAM,eAAe,iBAAiB;GAAE,YAAY;GAAO;EACtE,MAAM;GAAE,MAAM,eAAe,iBAAiB;GAAE,YAAY;GAAO;EACnE,WAAW;GAAE,MAAM,eAAe,iBAAiB;GAAE,YAAY;GAAO;EACxE,OAAO;GAAE,MAAM,eAAe,iBAAiB;GAAE,YAAY;GAAO;EACpE,WAAW;GAAE,MAAM,eAAe,iBAAiB;GAAE,YAAY;GAAO;EACxE,WAAW;GAAE,MAAM,eAAe,UAAU;GAAE,YAAY;GAAO;EAClE;CACF,CAAC;AAEF,MAAa,wBAAwB,YAAY;CAC/C,MAAM;EACJ,KAAK;EACL,SAAS;EACT,aAAa;EACb,WAAW;EACX,QAAQ,CAAC,kBAAkB;EAC3B,MAAM,CAAC,YAAY;EACpB;CACD,SAAS;CACV,CAAC;AAEF,MAAa,mBAAmB,YAAY;CAC1C,MAAM;EACJ,KAAK;EACL,SAAS;EACT,aAAa;EACb,WAAW;EACX,QAAQ,CAAC,kBAAkB;EAC3B,MAAM,CAAC,YAAY;EACpB;CACD,SAAS;CACV,CAAC;AAEF,MAAa,oBAAoB,YAAY;CAC3C,MAAM;EACJ,KAAK;EACL,SAAS;EACT,aAAa;EACb,WAAW;EACX,QAAQ,CAAC,kBAAkB;EAC3B,MAAM,CAAC,YAAY;EACpB;CACD,SAAS;CACV,CAAC;AAEF,MAAa,2BAA2B;CACtC;CACA;CACA;CACD"}
@@ -0,0 +1,40 @@
1
+ //#region src/example.d.ts
2
+ declare const example: {
3
+ readonly id: "analytics-dashboard";
4
+ readonly title: "Analytics Dashboard";
5
+ readonly summary: "Tenant-scoped dashboards, widgets, query builder, and scheduled reports (spec-first widgets/queries).";
6
+ readonly tags: readonly ["analytics", "dashboards", "bi", "queries"];
7
+ readonly kind: "template";
8
+ readonly visibility: "public";
9
+ readonly docs: {
10
+ readonly rootDocId: "docs.examples.analytics-dashboard";
11
+ readonly goalDocId: "docs.examples.analytics-dashboard.goal";
12
+ readonly usageDocId: "docs.examples.analytics-dashboard.usage";
13
+ readonly constraintsDocId: "docs.examples.analytics-dashboard.constraints";
14
+ };
15
+ readonly entrypoints: {
16
+ readonly packageName: "@contractspec/example.analytics-dashboard";
17
+ readonly feature: "./feature";
18
+ readonly contracts: "./contracts";
19
+ readonly presentations: "./presentations";
20
+ readonly handlers: "./handlers";
21
+ readonly docs: "./docs";
22
+ };
23
+ readonly surfaces: {
24
+ readonly templates: true;
25
+ readonly sandbox: {
26
+ readonly enabled: true;
27
+ readonly modes: readonly ["playground", "specs", "builder", "markdown", "evolution"];
28
+ };
29
+ readonly studio: {
30
+ readonly enabled: true;
31
+ readonly installable: true;
32
+ };
33
+ readonly mcp: {
34
+ readonly enabled: true;
35
+ };
36
+ };
37
+ };
38
+ //#endregion
39
+ export { example as default };
40
+ //# sourceMappingURL=example.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"example.d.ts","names":[],"sources":["../src/example.ts"],"sourcesContent":[],"mappings":";cAAM;EAAA,SAAA,EA+BI,EAAA,qBAAA"}
@@ -0,0 +1,51 @@
1
+ //#region src/example.ts
2
+ const example = {
3
+ id: "analytics-dashboard",
4
+ title: "Analytics Dashboard",
5
+ summary: "Tenant-scoped dashboards, widgets, query builder, and scheduled reports (spec-first widgets/queries).",
6
+ tags: [
7
+ "analytics",
8
+ "dashboards",
9
+ "bi",
10
+ "queries"
11
+ ],
12
+ kind: "template",
13
+ visibility: "public",
14
+ docs: {
15
+ rootDocId: "docs.examples.analytics-dashboard",
16
+ goalDocId: "docs.examples.analytics-dashboard.goal",
17
+ usageDocId: "docs.examples.analytics-dashboard.usage",
18
+ constraintsDocId: "docs.examples.analytics-dashboard.constraints"
19
+ },
20
+ entrypoints: {
21
+ packageName: "@contractspec/example.analytics-dashboard",
22
+ feature: "./feature",
23
+ contracts: "./contracts",
24
+ presentations: "./presentations",
25
+ handlers: "./handlers",
26
+ docs: "./docs"
27
+ },
28
+ surfaces: {
29
+ templates: true,
30
+ sandbox: {
31
+ enabled: true,
32
+ modes: [
33
+ "playground",
34
+ "specs",
35
+ "builder",
36
+ "markdown",
37
+ "evolution"
38
+ ]
39
+ },
40
+ studio: {
41
+ enabled: true,
42
+ installable: true
43
+ },
44
+ mcp: { enabled: true }
45
+ }
46
+ };
47
+ var example_default = example;
48
+
49
+ //#endregion
50
+ export { example_default as default };
51
+ //# sourceMappingURL=example.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"example.js","names":[],"sources":["../src/example.ts"],"sourcesContent":["const example = {\n id: 'analytics-dashboard',\n title: 'Analytics Dashboard',\n summary:\n 'Tenant-scoped dashboards, widgets, query builder, and scheduled reports (spec-first widgets/queries).',\n tags: ['analytics', 'dashboards', 'bi', 'queries'],\n kind: 'template',\n visibility: 'public',\n docs: {\n rootDocId: 'docs.examples.analytics-dashboard',\n goalDocId: 'docs.examples.analytics-dashboard.goal',\n usageDocId: 'docs.examples.analytics-dashboard.usage',\n constraintsDocId: 'docs.examples.analytics-dashboard.constraints',\n },\n entrypoints: {\n packageName: '@contractspec/example.analytics-dashboard',\n feature: './feature',\n contracts: './contracts',\n presentations: './presentations',\n handlers: './handlers',\n docs: './docs',\n },\n surfaces: {\n templates: true,\n sandbox: {\n enabled: true,\n modes: ['playground', 'specs', 'builder', 'markdown', 'evolution'],\n },\n studio: { enabled: true, installable: true },\n mcp: { enabled: true },\n },\n} as const;\n\nexport default example;\n"],"mappings":";AAAA,MAAM,UAAU;CACd,IAAI;CACJ,OAAO;CACP,SACE;CACF,MAAM;EAAC;EAAa;EAAc;EAAM;EAAU;CAClD,MAAM;CACN,YAAY;CACZ,MAAM;EACJ,WAAW;EACX,WAAW;EACX,YAAY;EACZ,kBAAkB;EACnB;CACD,aAAa;EACX,aAAa;EACb,SAAS;EACT,WAAW;EACX,eAAe;EACf,UAAU;EACV,MAAM;EACP;CACD,UAAU;EACR,WAAW;EACX,SAAS;GACP,SAAS;GACT,OAAO;IAAC;IAAc;IAAS;IAAW;IAAY;IAAY;GACnE;EACD,QAAQ;GAAE,SAAS;GAAM,aAAa;GAAM;EAC5C,KAAK,EAAE,SAAS,MAAM;EACvB;CACF;AAED,sBAAe"}
@@ -0,0 +1,7 @@
1
+ import { AnalyticsDashboardFeature } from "./dashboard.feature.js";
2
+ import { QueryTypeEnum } from "./query/query.enum.js";
3
+ import { CreateQueryInputModel, ExecuteQueryInputModel, QueryModel, QueryResultModel } from "./query/query.schema.js";
4
+ import { CreateQueryContract, ExecuteQueryContract } from "./query/query.operation.js";
5
+ import "./query/index.js";
6
+ import { AggregationDefinition, BasicQueryEngine, ColumnDefinition, CustomQueryDefinition, DimensionDefinition, FilterDefinition, IQueryCache, IQueryEngine, InMemoryQueryCache, MeasureDefinition, OrderByDefinition, QueryDefinition, QueryParameters, QueryResult, createQueryEngine } from "./query-engine/index.js";
7
+ export { AggregationDefinition, AnalyticsDashboardFeature, BasicQueryEngine, ColumnDefinition, CreateQueryContract, CreateQueryInputModel, CustomQueryDefinition, DimensionDefinition, ExecuteQueryContract, ExecuteQueryInputModel, FilterDefinition, IQueryCache, IQueryEngine, InMemoryQueryCache, MeasureDefinition, OrderByDefinition, QueryDefinition, QueryModel, QueryParameters, QueryResult, QueryResultModel, QueryTypeEnum, createQueryEngine };
package/dist/index.js ADDED
@@ -0,0 +1,8 @@
1
+ import { AnalyticsDashboardFeature } from "./dashboard.feature.js";
2
+ import { QueryTypeEnum } from "./query/query.enum.js";
3
+ import { CreateQueryInputModel, ExecuteQueryInputModel, QueryModel, QueryResultModel } from "./query/query.schema.js";
4
+ import { CreateQueryContract, ExecuteQueryContract } from "./query/query.operation.js";
5
+ import "./query/index.js";
6
+ import { BasicQueryEngine, InMemoryQueryCache, createQueryEngine } from "./query-engine/index.js";
7
+
8
+ export { AnalyticsDashboardFeature, BasicQueryEngine, CreateQueryContract, CreateQueryInputModel, ExecuteQueryContract, ExecuteQueryInputModel, InMemoryQueryCache, QueryModel, QueryResultModel, QueryTypeEnum, createQueryEngine };
@@ -0,0 +1,4 @@
1
+ import { QueryTypeEnum } from "./query.enum.js";
2
+ import { CreateQueryInputModel, ExecuteQueryInputModel, QueryModel, QueryResultModel } from "./query.schema.js";
3
+ import { CreateQueryContract, ExecuteQueryContract } from "./query.operation.js";
4
+ export { CreateQueryContract, CreateQueryInputModel, ExecuteQueryContract, ExecuteQueryInputModel, QueryModel, QueryResultModel, QueryTypeEnum };
@@ -0,0 +1,5 @@
1
+ import { QueryTypeEnum } from "./query.enum.js";
2
+ import { CreateQueryInputModel, ExecuteQueryInputModel, QueryModel, QueryResultModel } from "./query.schema.js";
3
+ import { CreateQueryContract, ExecuteQueryContract } from "./query.operation.js";
4
+
5
+ export { CreateQueryContract, CreateQueryInputModel, ExecuteQueryContract, ExecuteQueryInputModel, QueryModel, QueryResultModel, QueryTypeEnum };
@@ -0,0 +1,10 @@
1
+ import * as _contractspec_lib_schema206 from "@contractspec/lib.schema";
2
+
3
+ //#region src/query/query.enum.d.ts
4
+ /**
5
+ * Query type enum.
6
+ */
7
+ declare const QueryTypeEnum: _contractspec_lib_schema206.EnumType<[string, string, string, string]>;
8
+ //#endregion
9
+ export { QueryTypeEnum };
10
+ //# sourceMappingURL=query.enum.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"query.enum.d.ts","names":[],"sources":["../../src/query/query.enum.ts"],"sourcesContent":[],"mappings":";;;;;;AAKa,cAAA,aAKX,EAAA,2BAAA,CALwB,QAAA,CAAA,CAAA,MAAA,EAAA,MAAA,EAAA,MAAA,EAAA,MAAA,CAAA,CAAA"}
@@ -0,0 +1,16 @@
1
+ import { defineEnum } from "@contractspec/lib.schema";
2
+
3
+ //#region src/query/query.enum.ts
4
+ /**
5
+ * Query type enum.
6
+ */
7
+ const QueryTypeEnum = defineEnum("QueryType", [
8
+ "SQL",
9
+ "METRIC",
10
+ "AGGREGATION",
11
+ "CUSTOM"
12
+ ]);
13
+
14
+ //#endregion
15
+ export { QueryTypeEnum };
16
+ //# sourceMappingURL=query.enum.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"query.enum.js","names":[],"sources":["../../src/query/query.enum.ts"],"sourcesContent":["import { defineEnum } from '@contractspec/lib.schema';\n\n/**\n * Query type enum.\n */\nexport const QueryTypeEnum = defineEnum('QueryType', [\n 'SQL',\n 'METRIC',\n 'AGGREGATION',\n 'CUSTOM',\n]);\n"],"mappings":";;;;;;AAKA,MAAa,gBAAgB,WAAW,aAAa;CACnD;CACA;CACA;CACA;CACD,CAAC"}
@@ -0,0 +1,181 @@
1
+ import * as _contractspec_lib_schema207 from "@contractspec/lib.schema";
2
+ import * as _contractspec_lib_contracts3 from "@contractspec/lib.contracts";
3
+
4
+ //#region src/query/query.operation.d.ts
5
+ /**
6
+ * Create a data query.
7
+ */
8
+ declare const CreateQueryContract: _contractspec_lib_contracts3.OperationSpec<_contractspec_lib_schema207.SchemaModel<{
9
+ name: {
10
+ type: _contractspec_lib_schema207.FieldType<string, string>;
11
+ isOptional: false;
12
+ };
13
+ description: {
14
+ type: _contractspec_lib_schema207.FieldType<string, string>;
15
+ isOptional: true;
16
+ };
17
+ type: {
18
+ type: _contractspec_lib_schema207.EnumType<[string, string, string, string]>;
19
+ isOptional: false;
20
+ };
21
+ definition: {
22
+ type: _contractspec_lib_schema207.FieldType<unknown, unknown>;
23
+ isOptional: false;
24
+ };
25
+ sql: {
26
+ type: _contractspec_lib_schema207.FieldType<string, string>;
27
+ isOptional: true;
28
+ };
29
+ metricIds: {
30
+ type: _contractspec_lib_schema207.FieldType<string, string>;
31
+ isArray: true;
32
+ isOptional: true;
33
+ };
34
+ cacheTtlSeconds: {
35
+ type: _contractspec_lib_schema207.FieldType<number, number>;
36
+ isOptional: true;
37
+ };
38
+ isShared: {
39
+ type: _contractspec_lib_schema207.FieldType<boolean, boolean>;
40
+ isOptional: true;
41
+ };
42
+ }>, _contractspec_lib_schema207.SchemaModel<{
43
+ id: {
44
+ type: _contractspec_lib_schema207.FieldType<string, string>;
45
+ isOptional: false;
46
+ };
47
+ name: {
48
+ type: _contractspec_lib_schema207.FieldType<string, string>;
49
+ isOptional: false;
50
+ };
51
+ description: {
52
+ type: _contractspec_lib_schema207.FieldType<string, string>;
53
+ isOptional: true;
54
+ };
55
+ type: {
56
+ type: _contractspec_lib_schema207.EnumType<[string, string, string, string]>;
57
+ isOptional: false;
58
+ };
59
+ definition: {
60
+ type: _contractspec_lib_schema207.FieldType<unknown, unknown>;
61
+ isOptional: false;
62
+ };
63
+ sql: {
64
+ type: _contractspec_lib_schema207.FieldType<string, string>;
65
+ isOptional: true;
66
+ };
67
+ cacheTtlSeconds: {
68
+ type: _contractspec_lib_schema207.FieldType<number, number>;
69
+ isOptional: false;
70
+ };
71
+ isShared: {
72
+ type: _contractspec_lib_schema207.FieldType<boolean, boolean>;
73
+ isOptional: false;
74
+ };
75
+ createdAt: {
76
+ type: _contractspec_lib_schema207.FieldType<Date, string>;
77
+ isOptional: false;
78
+ };
79
+ }>, {
80
+ key: string;
81
+ version: number;
82
+ stability: string;
83
+ owners: "@example.analytics-dashboard"[];
84
+ tags: string[];
85
+ when: string;
86
+ payload: _contractspec_lib_schema207.SchemaModel<{
87
+ id: {
88
+ type: _contractspec_lib_schema207.FieldType<string, string>;
89
+ isOptional: false;
90
+ };
91
+ name: {
92
+ type: _contractspec_lib_schema207.FieldType<string, string>;
93
+ isOptional: false;
94
+ };
95
+ description: {
96
+ type: _contractspec_lib_schema207.FieldType<string, string>;
97
+ isOptional: true;
98
+ };
99
+ type: {
100
+ type: _contractspec_lib_schema207.EnumType<[string, string, string, string]>;
101
+ isOptional: false;
102
+ };
103
+ definition: {
104
+ type: _contractspec_lib_schema207.FieldType<unknown, unknown>;
105
+ isOptional: false;
106
+ };
107
+ sql: {
108
+ type: _contractspec_lib_schema207.FieldType<string, string>;
109
+ isOptional: true;
110
+ };
111
+ cacheTtlSeconds: {
112
+ type: _contractspec_lib_schema207.FieldType<number, number>;
113
+ isOptional: false;
114
+ };
115
+ isShared: {
116
+ type: _contractspec_lib_schema207.FieldType<boolean, boolean>;
117
+ isOptional: false;
118
+ };
119
+ createdAt: {
120
+ type: _contractspec_lib_schema207.FieldType<Date, string>;
121
+ isOptional: false;
122
+ };
123
+ }>;
124
+ }[]>;
125
+ /**
126
+ * Execute a data query.
127
+ */
128
+ declare const ExecuteQueryContract: _contractspec_lib_contracts3.OperationSpec<_contractspec_lib_schema207.SchemaModel<{
129
+ queryId: {
130
+ type: _contractspec_lib_schema207.FieldType<string, string>;
131
+ isOptional: false;
132
+ };
133
+ parameters: {
134
+ type: _contractspec_lib_schema207.FieldType<unknown, unknown>;
135
+ isOptional: true;
136
+ };
137
+ dateRange: {
138
+ type: _contractspec_lib_schema207.FieldType<unknown, unknown>;
139
+ isOptional: true;
140
+ };
141
+ filters: {
142
+ type: _contractspec_lib_schema207.FieldType<unknown, unknown>;
143
+ isOptional: true;
144
+ };
145
+ forceRefresh: {
146
+ type: _contractspec_lib_schema207.FieldType<boolean, boolean>;
147
+ isOptional: true;
148
+ };
149
+ }>, _contractspec_lib_schema207.SchemaModel<{
150
+ queryId: {
151
+ type: _contractspec_lib_schema207.FieldType<string, string>;
152
+ isOptional: false;
153
+ };
154
+ data: {
155
+ type: _contractspec_lib_schema207.FieldType<unknown, unknown>;
156
+ isOptional: false;
157
+ };
158
+ columns: {
159
+ type: _contractspec_lib_schema207.FieldType<unknown, unknown>;
160
+ isOptional: false;
161
+ };
162
+ rowCount: {
163
+ type: _contractspec_lib_schema207.FieldType<number, number>;
164
+ isOptional: false;
165
+ };
166
+ executionTimeMs: {
167
+ type: _contractspec_lib_schema207.FieldType<number, number>;
168
+ isOptional: false;
169
+ };
170
+ cachedAt: {
171
+ type: _contractspec_lib_schema207.FieldType<Date, string>;
172
+ isOptional: true;
173
+ };
174
+ error: {
175
+ type: _contractspec_lib_schema207.FieldType<string, string>;
176
+ isOptional: true;
177
+ };
178
+ }>, undefined>;
179
+ //#endregion
180
+ export { CreateQueryContract, ExecuteQueryContract };
181
+ //# sourceMappingURL=query.operation.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"query.operation.d.ts","names":[],"sources":["../../src/query/query.operation.ts"],"sourcesContent":[],"mappings":";;;;;;;cAgBa,kDAAmB,0CAAA;EAAnB,IAAA,EAAA;IA+CX,IAAA,EAAA,2BAAA,CAAA,SAAA,CAAA,MAAA,EAAA,MAAA,CAAA;;;;;;;;8CA/C8B,CAAA,CAAA,MAAA,EAAA,MAAA,EAAA,MAAA,EAAA,MAAA,CAAA,CAAA;IAAA,UAAA,EAAA,KAAA;;;;;;;;;;;;;;;;;;;;;;;CAAA,CAAA,yCAAA,CAAA;EAoDnB,EAAA,EAAA;IA8BX,IAAA,EAlF8B,2BAAA,CAAA,SAkF9B,CAAA,MAAA,EAAA,MAAA,CAAA;;;;;;EA9B+B,CAAA;;;;;;;;;;IAAA,IAAA,uCAAA,CAAA,OAAA,EAAA,OAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cAApB,mDAAoB,0CAAA;;UA8B/B,2BAAA,CAAA;;;;;;;;;;;;;;;;;;;;;UA9B+B,2BAAA,CAAA"}