@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.
- package/LICENSE +21 -0
- package/README.md +281 -0
- package/dist/dashboard/dashboard.enum.d.ts +18 -0
- package/dist/dashboard/dashboard.enum.d.ts.map +1 -0
- package/dist/dashboard/dashboard.enum.js +43 -0
- package/dist/dashboard/dashboard.enum.js.map +1 -0
- package/dist/dashboard/dashboard.operation.d.ts +537 -0
- package/dist/dashboard/dashboard.operation.d.ts.map +1 -0
- package/dist/dashboard/dashboard.operation.js +213 -0
- package/dist/dashboard/dashboard.operation.js.map +1 -0
- package/dist/dashboard/dashboard.presentation.d.ts +9 -0
- package/dist/dashboard/dashboard.presentation.d.ts.map +1 -0
- package/dist/dashboard/dashboard.presentation.js +90 -0
- package/dist/dashboard/dashboard.presentation.js.map +1 -0
- package/dist/dashboard/dashboard.schema.d.ts +333 -0
- package/dist/dashboard/dashboard.schema.d.ts.map +1 -0
- package/dist/dashboard/dashboard.schema.js +236 -0
- package/dist/dashboard/dashboard.schema.js.map +1 -0
- package/dist/dashboard/index.d.ts +4 -0
- package/dist/dashboard/index.js +5 -0
- package/dist/dashboard.feature.d.ts +8 -0
- package/dist/dashboard.feature.d.ts.map +1 -0
- package/dist/dashboard.feature.js +166 -0
- package/dist/dashboard.feature.js.map +1 -0
- package/dist/docs/analytics-dashboard.docblock.d.ts +1 -0
- package/dist/docs/analytics-dashboard.docblock.js +114 -0
- package/dist/docs/analytics-dashboard.docblock.js.map +1 -0
- package/dist/docs/index.d.ts +1 -0
- package/dist/docs/index.js +1 -0
- package/dist/events.d.ts +149 -0
- package/dist/events.d.ts.map +1 -0
- package/dist/events.js +128 -0
- package/dist/events.js.map +1 -0
- package/dist/example.d.ts +40 -0
- package/dist/example.d.ts.map +1 -0
- package/dist/example.js +51 -0
- package/dist/example.js.map +1 -0
- package/dist/index.d.ts +7 -0
- package/dist/index.js +8 -0
- package/dist/query/index.d.ts +4 -0
- package/dist/query/index.js +5 -0
- package/dist/query/query.enum.d.ts +10 -0
- package/dist/query/query.enum.d.ts.map +1 -0
- package/dist/query/query.enum.js +16 -0
- package/dist/query/query.enum.js.map +1 -0
- package/dist/query/query.operation.d.ts +181 -0
- package/dist/query/query.operation.d.ts.map +1 -0
- package/dist/query/query.operation.js +113 -0
- package/dist/query/query.operation.js.map +1 -0
- package/dist/query/query.presentation.d.ts +8 -0
- package/dist/query/query.presentation.d.ts.map +1 -0
- package/dist/query/query.presentation.js +60 -0
- package/dist/query/query.presentation.js.map +1 -0
- package/dist/query/query.schema.d.ts +143 -0
- package/dist/query/query.schema.d.ts.map +1 -0
- package/dist/query/query.schema.js +157 -0
- package/dist/query/query.schema.js.map +1 -0
- package/dist/query-engine/index.d.ts +106 -0
- package/dist/query-engine/index.d.ts.map +1 -0
- package/dist/query-engine/index.js +189 -0
- package/dist/query-engine/index.js.map +1 -0
- package/package.json +91 -0
|
@@ -0,0 +1,236 @@
|
|
|
1
|
+
import { DashboardStatusEnum, RefreshIntervalEnum, WidgetTypeEnum } from "./dashboard.enum.js";
|
|
2
|
+
import { ScalarTypeEnum, defineSchemaModel } from "@contractspec/lib.schema";
|
|
3
|
+
|
|
4
|
+
//#region src/dashboard/dashboard.schema.ts
|
|
5
|
+
/**
|
|
6
|
+
* A dashboard widget.
|
|
7
|
+
*/
|
|
8
|
+
const WidgetModel = defineSchemaModel({
|
|
9
|
+
name: "WidgetModel",
|
|
10
|
+
fields: {
|
|
11
|
+
id: {
|
|
12
|
+
type: ScalarTypeEnum.String_unsecure(),
|
|
13
|
+
isOptional: false
|
|
14
|
+
},
|
|
15
|
+
dashboardId: {
|
|
16
|
+
type: ScalarTypeEnum.String_unsecure(),
|
|
17
|
+
isOptional: false
|
|
18
|
+
},
|
|
19
|
+
name: {
|
|
20
|
+
type: ScalarTypeEnum.String_unsecure(),
|
|
21
|
+
isOptional: false
|
|
22
|
+
},
|
|
23
|
+
type: {
|
|
24
|
+
type: WidgetTypeEnum,
|
|
25
|
+
isOptional: false
|
|
26
|
+
},
|
|
27
|
+
gridX: {
|
|
28
|
+
type: ScalarTypeEnum.Int_unsecure(),
|
|
29
|
+
isOptional: false
|
|
30
|
+
},
|
|
31
|
+
gridY: {
|
|
32
|
+
type: ScalarTypeEnum.Int_unsecure(),
|
|
33
|
+
isOptional: false
|
|
34
|
+
},
|
|
35
|
+
gridWidth: {
|
|
36
|
+
type: ScalarTypeEnum.Int_unsecure(),
|
|
37
|
+
isOptional: false
|
|
38
|
+
},
|
|
39
|
+
gridHeight: {
|
|
40
|
+
type: ScalarTypeEnum.Int_unsecure(),
|
|
41
|
+
isOptional: false
|
|
42
|
+
},
|
|
43
|
+
queryId: {
|
|
44
|
+
type: ScalarTypeEnum.String_unsecure(),
|
|
45
|
+
isOptional: true
|
|
46
|
+
},
|
|
47
|
+
config: {
|
|
48
|
+
type: ScalarTypeEnum.JSON(),
|
|
49
|
+
isOptional: true
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
});
|
|
53
|
+
/**
|
|
54
|
+
* An analytics dashboard.
|
|
55
|
+
*/
|
|
56
|
+
const DashboardModel = defineSchemaModel({
|
|
57
|
+
name: "DashboardModel",
|
|
58
|
+
fields: {
|
|
59
|
+
id: {
|
|
60
|
+
type: ScalarTypeEnum.String_unsecure(),
|
|
61
|
+
isOptional: false
|
|
62
|
+
},
|
|
63
|
+
name: {
|
|
64
|
+
type: ScalarTypeEnum.String_unsecure(),
|
|
65
|
+
isOptional: false
|
|
66
|
+
},
|
|
67
|
+
slug: {
|
|
68
|
+
type: ScalarTypeEnum.String_unsecure(),
|
|
69
|
+
isOptional: false
|
|
70
|
+
},
|
|
71
|
+
description: {
|
|
72
|
+
type: ScalarTypeEnum.String_unsecure(),
|
|
73
|
+
isOptional: true
|
|
74
|
+
},
|
|
75
|
+
status: {
|
|
76
|
+
type: DashboardStatusEnum,
|
|
77
|
+
isOptional: false
|
|
78
|
+
},
|
|
79
|
+
refreshInterval: {
|
|
80
|
+
type: RefreshIntervalEnum,
|
|
81
|
+
isOptional: false
|
|
82
|
+
},
|
|
83
|
+
isPublic: {
|
|
84
|
+
type: ScalarTypeEnum.Boolean(),
|
|
85
|
+
isOptional: false
|
|
86
|
+
},
|
|
87
|
+
widgets: {
|
|
88
|
+
type: WidgetModel,
|
|
89
|
+
isArray: true,
|
|
90
|
+
isOptional: true
|
|
91
|
+
},
|
|
92
|
+
createdAt: {
|
|
93
|
+
type: ScalarTypeEnum.DateTime(),
|
|
94
|
+
isOptional: false
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
});
|
|
98
|
+
/**
|
|
99
|
+
* Input for creating a dashboard.
|
|
100
|
+
*/
|
|
101
|
+
const CreateDashboardInputModel = defineSchemaModel({
|
|
102
|
+
name: "CreateDashboardInput",
|
|
103
|
+
fields: {
|
|
104
|
+
name: {
|
|
105
|
+
type: ScalarTypeEnum.NonEmptyString(),
|
|
106
|
+
isOptional: false
|
|
107
|
+
},
|
|
108
|
+
slug: {
|
|
109
|
+
type: ScalarTypeEnum.NonEmptyString(),
|
|
110
|
+
isOptional: false
|
|
111
|
+
},
|
|
112
|
+
description: {
|
|
113
|
+
type: ScalarTypeEnum.String_unsecure(),
|
|
114
|
+
isOptional: true
|
|
115
|
+
},
|
|
116
|
+
refreshInterval: {
|
|
117
|
+
type: RefreshIntervalEnum,
|
|
118
|
+
isOptional: true
|
|
119
|
+
},
|
|
120
|
+
dateRange: {
|
|
121
|
+
type: ScalarTypeEnum.JSON(),
|
|
122
|
+
isOptional: true
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
});
|
|
126
|
+
/**
|
|
127
|
+
* Input for adding a widget.
|
|
128
|
+
*/
|
|
129
|
+
const AddWidgetInputModel = defineSchemaModel({
|
|
130
|
+
name: "AddWidgetInput",
|
|
131
|
+
fields: {
|
|
132
|
+
dashboardId: {
|
|
133
|
+
type: ScalarTypeEnum.String_unsecure(),
|
|
134
|
+
isOptional: false
|
|
135
|
+
},
|
|
136
|
+
name: {
|
|
137
|
+
type: ScalarTypeEnum.NonEmptyString(),
|
|
138
|
+
isOptional: false
|
|
139
|
+
},
|
|
140
|
+
type: {
|
|
141
|
+
type: WidgetTypeEnum,
|
|
142
|
+
isOptional: false
|
|
143
|
+
},
|
|
144
|
+
gridX: {
|
|
145
|
+
type: ScalarTypeEnum.Int_unsecure(),
|
|
146
|
+
isOptional: true
|
|
147
|
+
},
|
|
148
|
+
gridY: {
|
|
149
|
+
type: ScalarTypeEnum.Int_unsecure(),
|
|
150
|
+
isOptional: true
|
|
151
|
+
},
|
|
152
|
+
gridWidth: {
|
|
153
|
+
type: ScalarTypeEnum.Int_unsecure(),
|
|
154
|
+
isOptional: true
|
|
155
|
+
},
|
|
156
|
+
gridHeight: {
|
|
157
|
+
type: ScalarTypeEnum.Int_unsecure(),
|
|
158
|
+
isOptional: true
|
|
159
|
+
},
|
|
160
|
+
queryId: {
|
|
161
|
+
type: ScalarTypeEnum.String_unsecure(),
|
|
162
|
+
isOptional: true
|
|
163
|
+
},
|
|
164
|
+
config: {
|
|
165
|
+
type: ScalarTypeEnum.JSON(),
|
|
166
|
+
isOptional: true
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
});
|
|
170
|
+
/**
|
|
171
|
+
* Input for listing dashboards.
|
|
172
|
+
*/
|
|
173
|
+
const ListDashboardsInputModel = defineSchemaModel({
|
|
174
|
+
name: "ListDashboardsInput",
|
|
175
|
+
fields: {
|
|
176
|
+
status: {
|
|
177
|
+
type: DashboardStatusEnum,
|
|
178
|
+
isOptional: true
|
|
179
|
+
},
|
|
180
|
+
search: {
|
|
181
|
+
type: ScalarTypeEnum.String_unsecure(),
|
|
182
|
+
isOptional: true
|
|
183
|
+
},
|
|
184
|
+
limit: {
|
|
185
|
+
type: ScalarTypeEnum.Int_unsecure(),
|
|
186
|
+
isOptional: true,
|
|
187
|
+
defaultValue: 20
|
|
188
|
+
},
|
|
189
|
+
offset: {
|
|
190
|
+
type: ScalarTypeEnum.Int_unsecure(),
|
|
191
|
+
isOptional: true,
|
|
192
|
+
defaultValue: 0
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
});
|
|
196
|
+
/**
|
|
197
|
+
* Output for listing dashboards.
|
|
198
|
+
*/
|
|
199
|
+
const ListDashboardsOutputModel = defineSchemaModel({
|
|
200
|
+
name: "ListDashboardsOutput",
|
|
201
|
+
fields: {
|
|
202
|
+
dashboards: {
|
|
203
|
+
type: DashboardModel,
|
|
204
|
+
isArray: true,
|
|
205
|
+
isOptional: false
|
|
206
|
+
},
|
|
207
|
+
total: {
|
|
208
|
+
type: ScalarTypeEnum.Int_unsecure(),
|
|
209
|
+
isOptional: false
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
});
|
|
213
|
+
/**
|
|
214
|
+
* Input for getting a dashboard.
|
|
215
|
+
*/
|
|
216
|
+
const GetDashboardInputModel = defineSchemaModel({
|
|
217
|
+
name: "GetDashboardInput",
|
|
218
|
+
fields: {
|
|
219
|
+
dashboardId: {
|
|
220
|
+
type: ScalarTypeEnum.String_unsecure(),
|
|
221
|
+
isOptional: true
|
|
222
|
+
},
|
|
223
|
+
slug: {
|
|
224
|
+
type: ScalarTypeEnum.String_unsecure(),
|
|
225
|
+
isOptional: true
|
|
226
|
+
},
|
|
227
|
+
shareToken: {
|
|
228
|
+
type: ScalarTypeEnum.String_unsecure(),
|
|
229
|
+
isOptional: true
|
|
230
|
+
}
|
|
231
|
+
}
|
|
232
|
+
});
|
|
233
|
+
|
|
234
|
+
//#endregion
|
|
235
|
+
export { AddWidgetInputModel, CreateDashboardInputModel, DashboardModel, GetDashboardInputModel, ListDashboardsInputModel, ListDashboardsOutputModel, WidgetModel };
|
|
236
|
+
//# sourceMappingURL=dashboard.schema.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dashboard.schema.js","names":[],"sources":["../../src/dashboard/dashboard.schema.ts"],"sourcesContent":["import { defineSchemaModel, ScalarTypeEnum } from '@contractspec/lib.schema';\nimport {\n DashboardStatusEnum,\n WidgetTypeEnum,\n RefreshIntervalEnum,\n} from './dashboard.enum';\n\n/**\n * A dashboard widget.\n */\nexport const WidgetModel = defineSchemaModel({\n name: 'WidgetModel',\n fields: {\n id: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n dashboardId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n name: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n type: { type: WidgetTypeEnum, isOptional: false },\n gridX: { type: ScalarTypeEnum.Int_unsecure(), isOptional: false },\n gridY: { type: ScalarTypeEnum.Int_unsecure(), isOptional: false },\n gridWidth: { type: ScalarTypeEnum.Int_unsecure(), isOptional: false },\n gridHeight: { type: ScalarTypeEnum.Int_unsecure(), isOptional: false },\n queryId: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },\n config: { type: ScalarTypeEnum.JSON(), isOptional: true },\n },\n});\n\n/**\n * An analytics dashboard.\n */\nexport const DashboardModel = defineSchemaModel({\n name: 'DashboardModel',\n fields: {\n id: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n name: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n slug: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n description: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },\n status: { type: DashboardStatusEnum, isOptional: false },\n refreshInterval: { type: RefreshIntervalEnum, isOptional: false },\n isPublic: { type: ScalarTypeEnum.Boolean(), isOptional: false },\n widgets: { type: WidgetModel, isArray: true, isOptional: true },\n createdAt: { type: ScalarTypeEnum.DateTime(), isOptional: false },\n },\n});\n\n/**\n * Input for creating a dashboard.\n */\nexport const CreateDashboardInputModel = defineSchemaModel({\n name: 'CreateDashboardInput',\n fields: {\n name: { type: ScalarTypeEnum.NonEmptyString(), isOptional: false },\n slug: { type: ScalarTypeEnum.NonEmptyString(), isOptional: false },\n description: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },\n refreshInterval: { type: RefreshIntervalEnum, isOptional: true },\n dateRange: { type: ScalarTypeEnum.JSON(), isOptional: true },\n },\n});\n\n/**\n * Input for adding a widget.\n */\nexport const AddWidgetInputModel = defineSchemaModel({\n name: 'AddWidgetInput',\n fields: {\n dashboardId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n name: { type: ScalarTypeEnum.NonEmptyString(), isOptional: false },\n type: { type: WidgetTypeEnum, isOptional: false },\n gridX: { type: ScalarTypeEnum.Int_unsecure(), isOptional: true },\n gridY: { type: ScalarTypeEnum.Int_unsecure(), isOptional: true },\n gridWidth: { type: ScalarTypeEnum.Int_unsecure(), isOptional: true },\n gridHeight: { type: ScalarTypeEnum.Int_unsecure(), isOptional: true },\n queryId: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },\n config: { type: ScalarTypeEnum.JSON(), isOptional: true },\n },\n});\n\n/**\n * Input for listing dashboards.\n */\nexport const ListDashboardsInputModel = defineSchemaModel({\n name: 'ListDashboardsInput',\n fields: {\n status: { type: DashboardStatusEnum, isOptional: true },\n search: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },\n limit: {\n type: ScalarTypeEnum.Int_unsecure(),\n isOptional: true,\n defaultValue: 20,\n },\n offset: {\n type: ScalarTypeEnum.Int_unsecure(),\n isOptional: true,\n defaultValue: 0,\n },\n },\n});\n\n/**\n * Output for listing dashboards.\n */\nexport const ListDashboardsOutputModel = defineSchemaModel({\n name: 'ListDashboardsOutput',\n fields: {\n dashboards: { type: DashboardModel, isArray: true, isOptional: false },\n total: { type: ScalarTypeEnum.Int_unsecure(), isOptional: false },\n },\n});\n\n/**\n * Input for getting a dashboard.\n */\nexport const GetDashboardInputModel = defineSchemaModel({\n name: 'GetDashboardInput',\n fields: {\n dashboardId: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },\n slug: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },\n shareToken: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },\n },\n});\n"],"mappings":"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"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { DashboardStatusEnum, RefreshIntervalEnum, WidgetTypeEnum } from "./dashboard.enum.js";
|
|
2
|
+
import { AddWidgetContract, CreateDashboardContract, GetDashboardContract, ListDashboardsContract } from "./dashboard.operation.js";
|
|
3
|
+
import { AddWidgetInputModel, CreateDashboardInputModel, DashboardModel, GetDashboardInputModel, ListDashboardsInputModel, ListDashboardsOutputModel, WidgetModel } from "./dashboard.schema.js";
|
|
4
|
+
export { AddWidgetContract, AddWidgetInputModel, CreateDashboardContract, CreateDashboardInputModel, DashboardModel, DashboardStatusEnum, GetDashboardContract, GetDashboardInputModel, ListDashboardsContract, ListDashboardsInputModel, ListDashboardsOutputModel, RefreshIntervalEnum, WidgetModel, WidgetTypeEnum };
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { DashboardStatusEnum, RefreshIntervalEnum, WidgetTypeEnum } from "./dashboard.enum.js";
|
|
2
|
+
import { AddWidgetInputModel, CreateDashboardInputModel, DashboardModel, GetDashboardInputModel, ListDashboardsInputModel, ListDashboardsOutputModel, WidgetModel } from "./dashboard.schema.js";
|
|
3
|
+
import { AddWidgetContract, CreateDashboardContract, GetDashboardContract, ListDashboardsContract } from "./dashboard.operation.js";
|
|
4
|
+
|
|
5
|
+
export { AddWidgetContract, AddWidgetInputModel, CreateDashboardContract, CreateDashboardInputModel, DashboardModel, DashboardStatusEnum, GetDashboardContract, GetDashboardInputModel, ListDashboardsContract, ListDashboardsInputModel, ListDashboardsOutputModel, RefreshIntervalEnum, WidgetModel, WidgetTypeEnum };
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { FeatureModuleSpec } from "@contractspec/lib.contracts";
|
|
2
|
+
|
|
3
|
+
//#region src/dashboard.feature.d.ts
|
|
4
|
+
|
|
5
|
+
declare const AnalyticsDashboardFeature: FeatureModuleSpec;
|
|
6
|
+
//#endregion
|
|
7
|
+
export { AnalyticsDashboardFeature };
|
|
8
|
+
//# sourceMappingURL=dashboard.feature.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dashboard.feature.d.ts","names":[],"sources":["../src/dashboard.feature.ts"],"sourcesContent":[],"mappings":";;;;cAca,2BAA2B"}
|
|
@@ -0,0 +1,166 @@
|
|
|
1
|
+
//#region src/dashboard.feature.ts
|
|
2
|
+
const AnalyticsDashboardFeature = {
|
|
3
|
+
meta: {
|
|
4
|
+
key: "analytics-dashboard",
|
|
5
|
+
version: 1,
|
|
6
|
+
title: "Analytics Dashboard",
|
|
7
|
+
description: "Analytics dashboards with customizable widgets and queries",
|
|
8
|
+
domain: "analytics",
|
|
9
|
+
owners: ["@analytics-dashboard"],
|
|
10
|
+
tags: [
|
|
11
|
+
"analytics",
|
|
12
|
+
"dashboards",
|
|
13
|
+
"widgets",
|
|
14
|
+
"queries"
|
|
15
|
+
],
|
|
16
|
+
stability: "experimental"
|
|
17
|
+
},
|
|
18
|
+
operations: [
|
|
19
|
+
{
|
|
20
|
+
key: "analytics.dashboard.create",
|
|
21
|
+
version: 1
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
key: "analytics.dashboard.list",
|
|
25
|
+
version: 1
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
key: "analytics.dashboard.get",
|
|
29
|
+
version: 1
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
key: "analytics.widget.add",
|
|
33
|
+
version: 1
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
key: "analytics.query.create",
|
|
37
|
+
version: 1
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
key: "analytics.query.execute",
|
|
41
|
+
version: 1
|
|
42
|
+
}
|
|
43
|
+
],
|
|
44
|
+
events: [
|
|
45
|
+
{
|
|
46
|
+
key: "analytics.dashboard.created",
|
|
47
|
+
version: 1
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
key: "analytics.widget.added",
|
|
51
|
+
version: 1
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
key: "analytics.query.created",
|
|
55
|
+
version: 1
|
|
56
|
+
}
|
|
57
|
+
],
|
|
58
|
+
presentations: [
|
|
59
|
+
{
|
|
60
|
+
key: "analytics.dashboard.list",
|
|
61
|
+
version: 1
|
|
62
|
+
},
|
|
63
|
+
{
|
|
64
|
+
key: "analytics.dashboard.view",
|
|
65
|
+
version: 1
|
|
66
|
+
},
|
|
67
|
+
{
|
|
68
|
+
key: "analytics.dashboard.editor",
|
|
69
|
+
version: 1
|
|
70
|
+
},
|
|
71
|
+
{
|
|
72
|
+
key: "analytics.query.list",
|
|
73
|
+
version: 1
|
|
74
|
+
},
|
|
75
|
+
{
|
|
76
|
+
key: "analytics.query.builder",
|
|
77
|
+
version: 1
|
|
78
|
+
}
|
|
79
|
+
],
|
|
80
|
+
opToPresentation: [
|
|
81
|
+
{
|
|
82
|
+
op: {
|
|
83
|
+
key: "analytics.dashboard.list",
|
|
84
|
+
version: 1
|
|
85
|
+
},
|
|
86
|
+
pres: {
|
|
87
|
+
key: "analytics.dashboard.list",
|
|
88
|
+
version: 1
|
|
89
|
+
}
|
|
90
|
+
},
|
|
91
|
+
{
|
|
92
|
+
op: {
|
|
93
|
+
key: "analytics.dashboard.get",
|
|
94
|
+
version: 1
|
|
95
|
+
},
|
|
96
|
+
pres: {
|
|
97
|
+
key: "analytics.dashboard.view",
|
|
98
|
+
version: 1
|
|
99
|
+
}
|
|
100
|
+
},
|
|
101
|
+
{
|
|
102
|
+
op: {
|
|
103
|
+
key: "analytics.dashboard.create",
|
|
104
|
+
version: 1
|
|
105
|
+
},
|
|
106
|
+
pres: {
|
|
107
|
+
key: "analytics.dashboard.editor",
|
|
108
|
+
version: 1
|
|
109
|
+
}
|
|
110
|
+
},
|
|
111
|
+
{
|
|
112
|
+
op: {
|
|
113
|
+
key: "analytics.query.create",
|
|
114
|
+
version: 1
|
|
115
|
+
},
|
|
116
|
+
pres: {
|
|
117
|
+
key: "analytics.query.builder",
|
|
118
|
+
version: 1
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
],
|
|
122
|
+
presentationsTargets: [
|
|
123
|
+
{
|
|
124
|
+
key: "analytics.dashboard.list",
|
|
125
|
+
version: 1,
|
|
126
|
+
targets: [
|
|
127
|
+
"react",
|
|
128
|
+
"markdown",
|
|
129
|
+
"application/json"
|
|
130
|
+
]
|
|
131
|
+
},
|
|
132
|
+
{
|
|
133
|
+
key: "analytics.dashboard.view",
|
|
134
|
+
version: 1,
|
|
135
|
+
targets: ["react", "markdown"]
|
|
136
|
+
},
|
|
137
|
+
{
|
|
138
|
+
key: "analytics.dashboard.editor",
|
|
139
|
+
version: 1,
|
|
140
|
+
targets: ["react"]
|
|
141
|
+
},
|
|
142
|
+
{
|
|
143
|
+
key: "analytics.query.builder",
|
|
144
|
+
version: 1,
|
|
145
|
+
targets: ["react"]
|
|
146
|
+
}
|
|
147
|
+
],
|
|
148
|
+
capabilities: { requires: [
|
|
149
|
+
{
|
|
150
|
+
key: "identity",
|
|
151
|
+
version: 1
|
|
152
|
+
},
|
|
153
|
+
{
|
|
154
|
+
key: "metering",
|
|
155
|
+
version: 1
|
|
156
|
+
},
|
|
157
|
+
{
|
|
158
|
+
key: "audit-trail",
|
|
159
|
+
version: 1
|
|
160
|
+
}
|
|
161
|
+
] }
|
|
162
|
+
};
|
|
163
|
+
|
|
164
|
+
//#endregion
|
|
165
|
+
export { AnalyticsDashboardFeature };
|
|
166
|
+
//# sourceMappingURL=dashboard.feature.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dashboard.feature.js","names":["AnalyticsDashboardFeature: FeatureModuleSpec"],"sources":["../src/dashboard.feature.ts"],"sourcesContent":["/**\n * Analytics Dashboard Feature Module\n *\n * Comprehensive analytics and dashboarding solution for data visualization\n * and reporting across the platform.\n *\n * This feature module bundles all dashboard and query operations, events,\n * and presentations into an installable feature following FeatureModuleSpec.\n */\n\nimport type { FeatureModuleSpec } from '@contractspec/lib.contracts';\n\n// ============ Feature Definition ============\n\nexport const AnalyticsDashboardFeature: FeatureModuleSpec = {\n meta: {\n key: 'analytics-dashboard',\n version: 1,\n title: 'Analytics Dashboard',\n description: 'Analytics dashboards with customizable widgets and queries',\n domain: 'analytics',\n owners: ['@analytics-dashboard'],\n tags: ['analytics', 'dashboards', 'widgets', 'queries'],\n stability: 'experimental',\n },\n\n // ============ Contract Operations ============\n // All contract operations included in this feature (OpRef[])\n operations: [\n // Dashboard operations\n { key: 'analytics.dashboard.create', version: 1 },\n { key: 'analytics.dashboard.list', version: 1 },\n { key: 'analytics.dashboard.get', version: 1 },\n\n // Widget operations\n { key: 'analytics.widget.add', version: 1 },\n\n // Query operations\n { key: 'analytics.query.create', version: 1 },\n { key: 'analytics.query.execute', version: 1 },\n ],\n\n // ============ Events ============\n // Events emitted by this feature (EventRef[])\n events: [\n // Dashboard events\n { key: 'analytics.dashboard.created', version: 1 },\n\n // Widget events\n { key: 'analytics.widget.added', version: 1 },\n\n // Query events\n { key: 'analytics.query.created', version: 1 },\n ],\n\n // ============ Presentations ============\n // Presentations associated with this feature (PresentationRef[])\n presentations: [\n // Dashboard presentations\n { key: 'analytics.dashboard.list', version: 1 },\n { key: 'analytics.dashboard.view', version: 1 },\n { key: 'analytics.dashboard.editor', version: 1 },\n\n // Query presentations\n { key: 'analytics.query.list', version: 1 },\n { key: 'analytics.query.builder', version: 1 },\n ],\n\n // ============ Op-to-Presentation Links ============\n // Links operations to their primary presentations\n opToPresentation: [\n {\n op: { key: 'analytics.dashboard.list', version: 1 },\n pres: { key: 'analytics.dashboard.list', version: 1 },\n },\n {\n op: { key: 'analytics.dashboard.get', version: 1 },\n pres: { key: 'analytics.dashboard.view', version: 1 },\n },\n {\n op: { key: 'analytics.dashboard.create', version: 1 },\n pres: { key: 'analytics.dashboard.editor', version: 1 },\n },\n {\n op: { key: 'analytics.query.create', version: 1 },\n pres: { key: 'analytics.query.builder', version: 1 },\n },\n ],\n\n // ============ Presentation Targets ============\n // Target requirements for multi-surface rendering\n presentationsTargets: [\n {\n key: 'analytics.dashboard.list',\n version: 1,\n targets: ['react', 'markdown', 'application/json'],\n },\n {\n key: 'analytics.dashboard.view',\n version: 1,\n targets: ['react', 'markdown'],\n },\n {\n key: 'analytics.dashboard.editor',\n version: 1,\n targets: ['react'],\n },\n {\n key: 'analytics.query.builder',\n version: 1,\n targets: ['react'],\n },\n ],\n\n // ============ Capabilities ============\n // Capability requirements for this feature\n capabilities: {\n requires: [\n { key: 'identity', version: 1 },\n { key: 'metering', version: 1 },\n { key: 'audit-trail', version: 1 },\n ],\n },\n};\n"],"mappings":";AAcA,MAAaA,4BAA+C;CAC1D,MAAM;EACJ,KAAK;EACL,SAAS;EACT,OAAO;EACP,aAAa;EACb,QAAQ;EACR,QAAQ,CAAC,uBAAuB;EAChC,MAAM;GAAC;GAAa;GAAc;GAAW;GAAU;EACvD,WAAW;EACZ;CAID,YAAY;EAEV;GAAE,KAAK;GAA8B,SAAS;GAAG;EACjD;GAAE,KAAK;GAA4B,SAAS;GAAG;EAC/C;GAAE,KAAK;GAA2B,SAAS;GAAG;EAG9C;GAAE,KAAK;GAAwB,SAAS;GAAG;EAG3C;GAAE,KAAK;GAA0B,SAAS;GAAG;EAC7C;GAAE,KAAK;GAA2B,SAAS;GAAG;EAC/C;CAID,QAAQ;EAEN;GAAE,KAAK;GAA+B,SAAS;GAAG;EAGlD;GAAE,KAAK;GAA0B,SAAS;GAAG;EAG7C;GAAE,KAAK;GAA2B,SAAS;GAAG;EAC/C;CAID,eAAe;EAEb;GAAE,KAAK;GAA4B,SAAS;GAAG;EAC/C;GAAE,KAAK;GAA4B,SAAS;GAAG;EAC/C;GAAE,KAAK;GAA8B,SAAS;GAAG;EAGjD;GAAE,KAAK;GAAwB,SAAS;GAAG;EAC3C;GAAE,KAAK;GAA2B,SAAS;GAAG;EAC/C;CAID,kBAAkB;EAChB;GACE,IAAI;IAAE,KAAK;IAA4B,SAAS;IAAG;GACnD,MAAM;IAAE,KAAK;IAA4B,SAAS;IAAG;GACtD;EACD;GACE,IAAI;IAAE,KAAK;IAA2B,SAAS;IAAG;GAClD,MAAM;IAAE,KAAK;IAA4B,SAAS;IAAG;GACtD;EACD;GACE,IAAI;IAAE,KAAK;IAA8B,SAAS;IAAG;GACrD,MAAM;IAAE,KAAK;IAA8B,SAAS;IAAG;GACxD;EACD;GACE,IAAI;IAAE,KAAK;IAA0B,SAAS;IAAG;GACjD,MAAM;IAAE,KAAK;IAA2B,SAAS;IAAG;GACrD;EACF;CAID,sBAAsB;EACpB;GACE,KAAK;GACL,SAAS;GACT,SAAS;IAAC;IAAS;IAAY;IAAmB;GACnD;EACD;GACE,KAAK;GACL,SAAS;GACT,SAAS,CAAC,SAAS,WAAW;GAC/B;EACD;GACE,KAAK;GACL,SAAS;GACT,SAAS,CAAC,QAAQ;GACnB;EACD;GACE,KAAK;GACL,SAAS;GACT,SAAS,CAAC,QAAQ;GACnB;EACF;CAID,cAAc,EACZ,UAAU;EACR;GAAE,KAAK;GAAY,SAAS;GAAG;EAC/B;GAAE,KAAK;GAAY,SAAS;GAAG;EAC/B;GAAE,KAAK;GAAe,SAAS;GAAG;EACnC,EACF;CACF"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { };
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
import { registerDocBlocks } from "@contractspec/lib.contracts/docs";
|
|
2
|
+
|
|
3
|
+
//#region src/docs/analytics-dashboard.docblock.ts
|
|
4
|
+
registerDocBlocks([
|
|
5
|
+
{
|
|
6
|
+
id: "docs.examples.analytics-dashboard",
|
|
7
|
+
title: "Analytics Dashboard",
|
|
8
|
+
summary: "Multi-tenant analytics with dashboards, widgets, query builder, and scheduled reports built on the Event Bus.",
|
|
9
|
+
kind: "reference",
|
|
10
|
+
visibility: "public",
|
|
11
|
+
route: "/docs/examples/analytics-dashboard",
|
|
12
|
+
tags: [
|
|
13
|
+
"analytics",
|
|
14
|
+
"dashboards",
|
|
15
|
+
"bi",
|
|
16
|
+
"queries"
|
|
17
|
+
],
|
|
18
|
+
body: `## Entities
|
|
19
|
+
|
|
20
|
+
- Dashboard, Widget, Query, Report.
|
|
21
|
+
- Widget/query configs stay declarative for regeneration.
|
|
22
|
+
|
|
23
|
+
## Contracts
|
|
24
|
+
|
|
25
|
+
- \`analytics.dashboard.create\`, \`analytics.widget.add\`, \`analytics.query.execute\`, \`analytics.dashboard.get\`.
|
|
26
|
+
- Metrics can source from Event Bus schemas and Usage/Metering module.
|
|
27
|
+
|
|
28
|
+
## Events
|
|
29
|
+
|
|
30
|
+
- dashboard.created/updated, widget.added, report.scheduled/sent.
|
|
31
|
+
- Emitted for audit + notification hooks.
|
|
32
|
+
|
|
33
|
+
## UI / Presentations
|
|
34
|
+
|
|
35
|
+
- Dashboard list, dashboard view, query builder, widget gallery.
|
|
36
|
+
- Registered under \`analytics-dashboard\` template in Template Registry.
|
|
37
|
+
|
|
38
|
+
## Notes
|
|
39
|
+
|
|
40
|
+
- Enforce org scoping for multi-tenant isolation.
|
|
41
|
+
- Use Feature Flags for beta widgets; Metering to track query volume.
|
|
42
|
+
`
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
id: "docs.examples.analytics-dashboard.goal",
|
|
46
|
+
title: "Analytics Dashboard — Goal",
|
|
47
|
+
summary: "Why this template matters and what success looks like.",
|
|
48
|
+
kind: "goal",
|
|
49
|
+
visibility: "public",
|
|
50
|
+
route: "/docs/examples/analytics-dashboard/goal",
|
|
51
|
+
tags: ["analytics", "goal"],
|
|
52
|
+
body: `## Why it matters
|
|
53
|
+
- Give teams a regenerable analytics workspace that stays in sync with Event Bus, Usage/Metering, and presentations.
|
|
54
|
+
- Avoid dashboard drift by keeping schema-first widgets/queries.
|
|
55
|
+
|
|
56
|
+
## Business/Product goal
|
|
57
|
+
- Deliver tenant-scoped dashboards, governed queries, and scheduled reports with clear ownership and auditability.
|
|
58
|
+
- Enable feature-flagged rollout of new widgets and sampling for cost control.
|
|
59
|
+
|
|
60
|
+
## Success criteria
|
|
61
|
+
- Dashboards can be regenerated safely from spec changes.
|
|
62
|
+
- Queries/widgets have enforced validation; PII is redacted per policy.`
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
id: "docs.examples.analytics-dashboard.usage",
|
|
66
|
+
title: "Analytics Dashboard — Usage",
|
|
67
|
+
summary: "How to seed, extend, and safely regenerate dashboards.",
|
|
68
|
+
kind: "usage",
|
|
69
|
+
visibility: "public",
|
|
70
|
+
route: "/docs/examples/analytics-dashboard/usage",
|
|
71
|
+
tags: ["analytics", "usage"],
|
|
72
|
+
body: `## Setup
|
|
73
|
+
1) Seed dashboards/widgets (via template registry) to preload sample queries.
|
|
74
|
+
2) Configure org/tenant scope and attach Usage/Metering for cost/sampling controls.
|
|
75
|
+
|
|
76
|
+
## Extend & regenerate
|
|
77
|
+
1) Add or modify widget/query schemas in the spec (inputs, validation, PII paths).
|
|
78
|
+
2) Regenerate to update UI + API + events; review presentations for redaction.
|
|
79
|
+
3) Use Feature Flags to roll out new widgets or sampling knobs gradually.
|
|
80
|
+
|
|
81
|
+
## Guardrails
|
|
82
|
+
- Keep all query inputs validated; mark PII paths in policy.
|
|
83
|
+
- Use Audit Trail for report deliveries; Notifications for scheduled sends.`
|
|
84
|
+
},
|
|
85
|
+
{
|
|
86
|
+
id: "docs.examples.analytics-dashboard.constraints",
|
|
87
|
+
title: "Analytics Dashboard — Constraints & Safety",
|
|
88
|
+
summary: "Internal guardrails for queries, widgets, and regeneration.",
|
|
89
|
+
kind: "reference",
|
|
90
|
+
visibility: "internal",
|
|
91
|
+
route: "/docs/examples/analytics-dashboard/constraints",
|
|
92
|
+
tags: [
|
|
93
|
+
"analytics",
|
|
94
|
+
"constraints",
|
|
95
|
+
"internal"
|
|
96
|
+
],
|
|
97
|
+
body: `## Constraints
|
|
98
|
+
- Queries and widgets must declare inputs/validation in spec; no ad-hoc query strings.
|
|
99
|
+
- Regeneration must preserve sampling/windowing semantics; document changes explicitly.
|
|
100
|
+
- Events/usage metrics should remain consistent with Metering/Audit wiring.
|
|
101
|
+
|
|
102
|
+
## PII & Data
|
|
103
|
+
- Mark PII paths (user ids, emails) in presentations for redaction.
|
|
104
|
+
- Avoid exposing raw query payloads in MCP/web without policy checks.
|
|
105
|
+
|
|
106
|
+
## Verification
|
|
107
|
+
- Add fixtures for widget/query schema changes and scheduled reports.
|
|
108
|
+
- Run regeneration diff when adjusting query builders; ensure UI/markdown targets updated.
|
|
109
|
+
- Confirm feature-flagged widgets default to safe/off for new tenants.`
|
|
110
|
+
}
|
|
111
|
+
]);
|
|
112
|
+
|
|
113
|
+
//#endregion
|
|
114
|
+
//# sourceMappingURL=analytics-dashboard.docblock.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"analytics-dashboard.docblock.js","names":[],"sources":["../../src/docs/analytics-dashboard.docblock.ts"],"sourcesContent":["import type { DocBlock } from '@contractspec/lib.contracts/docs';\nimport { registerDocBlocks } from '@contractspec/lib.contracts/docs';\n\nconst analyticsDashboardDocBlocks: DocBlock[] = [\n {\n id: 'docs.examples.analytics-dashboard',\n title: 'Analytics Dashboard',\n summary:\n 'Multi-tenant analytics with dashboards, widgets, query builder, and scheduled reports built on the Event Bus.',\n kind: 'reference',\n visibility: 'public',\n route: '/docs/examples/analytics-dashboard',\n tags: ['analytics', 'dashboards', 'bi', 'queries'],\n body: `## Entities\n\n- Dashboard, Widget, Query, Report.\n- Widget/query configs stay declarative for regeneration.\n\n## Contracts\n\n- \\`analytics.dashboard.create\\`, \\`analytics.widget.add\\`, \\`analytics.query.execute\\`, \\`analytics.dashboard.get\\`.\n- Metrics can source from Event Bus schemas and Usage/Metering module.\n\n## Events\n\n- dashboard.created/updated, widget.added, report.scheduled/sent.\n- Emitted for audit + notification hooks.\n\n## UI / Presentations\n\n- Dashboard list, dashboard view, query builder, widget gallery.\n- Registered under \\`analytics-dashboard\\` template in Template Registry.\n\n## Notes\n\n- Enforce org scoping for multi-tenant isolation.\n- Use Feature Flags for beta widgets; Metering to track query volume.\n`,\n },\n {\n id: 'docs.examples.analytics-dashboard.goal',\n title: 'Analytics Dashboard — Goal',\n summary: 'Why this template matters and what success looks like.',\n kind: 'goal',\n visibility: 'public',\n route: '/docs/examples/analytics-dashboard/goal',\n tags: ['analytics', 'goal'],\n body: `## Why it matters\n- Give teams a regenerable analytics workspace that stays in sync with Event Bus, Usage/Metering, and presentations.\n- Avoid dashboard drift by keeping schema-first widgets/queries.\n\n## Business/Product goal\n- Deliver tenant-scoped dashboards, governed queries, and scheduled reports with clear ownership and auditability.\n- Enable feature-flagged rollout of new widgets and sampling for cost control.\n\n## Success criteria\n- Dashboards can be regenerated safely from spec changes.\n- Queries/widgets have enforced validation; PII is redacted per policy.`,\n },\n {\n id: 'docs.examples.analytics-dashboard.usage',\n title: 'Analytics Dashboard — Usage',\n summary: 'How to seed, extend, and safely regenerate dashboards.',\n kind: 'usage',\n visibility: 'public',\n route: '/docs/examples/analytics-dashboard/usage',\n tags: ['analytics', 'usage'],\n body: `## Setup\n1) Seed dashboards/widgets (via template registry) to preload sample queries.\n2) Configure org/tenant scope and attach Usage/Metering for cost/sampling controls.\n\n## Extend & regenerate\n1) Add or modify widget/query schemas in the spec (inputs, validation, PII paths).\n2) Regenerate to update UI + API + events; review presentations for redaction.\n3) Use Feature Flags to roll out new widgets or sampling knobs gradually.\n\n## Guardrails\n- Keep all query inputs validated; mark PII paths in policy.\n- Use Audit Trail for report deliveries; Notifications for scheduled sends.`,\n },\n {\n id: 'docs.examples.analytics-dashboard.constraints',\n title: 'Analytics Dashboard — Constraints & Safety',\n summary: 'Internal guardrails for queries, widgets, and regeneration.',\n kind: 'reference',\n visibility: 'internal',\n route: '/docs/examples/analytics-dashboard/constraints',\n tags: ['analytics', 'constraints', 'internal'],\n body: `## Constraints\n- Queries and widgets must declare inputs/validation in spec; no ad-hoc query strings.\n- Regeneration must preserve sampling/windowing semantics; document changes explicitly.\n- Events/usage metrics should remain consistent with Metering/Audit wiring.\n\n## PII & Data\n- Mark PII paths (user ids, emails) in presentations for redaction.\n- Avoid exposing raw query payloads in MCP/web without policy checks.\n\n## Verification\n- Add fixtures for widget/query schema changes and scheduled reports.\n- Run regeneration diff when adjusting query builders; ensure UI/markdown targets updated.\n- Confirm feature-flagged widgets default to safe/off for new tenants.`,\n },\n];\n\nregisterDocBlocks(analyticsDashboardDocBlocks);\n"],"mappings":";;;AAwGA,kBArGgD;CAC9C;EACE,IAAI;EACJ,OAAO;EACP,SACE;EACF,MAAM;EACN,YAAY;EACZ,OAAO;EACP,MAAM;GAAC;GAAa;GAAc;GAAM;GAAU;EAClD,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;EAyBP;CACD;EACE,IAAI;EACJ,OAAO;EACP,SAAS;EACT,MAAM;EACN,YAAY;EACZ,OAAO;EACP,MAAM,CAAC,aAAa,OAAO;EAC3B,MAAM;;;;;;;;;;;EAWP;CACD;EACE,IAAI;EACJ,OAAO;EACP,SAAS;EACT,MAAM;EACN,YAAY;EACZ,OAAO;EACP,MAAM,CAAC,aAAa,QAAQ;EAC5B,MAAM;;;;;;;;;;;;EAYP;CACD;EACE,IAAI;EACJ,OAAO;EACP,SAAS;EACT,MAAM;EACN,YAAY;EACZ,OAAO;EACP,MAAM;GAAC;GAAa;GAAe;GAAW;EAC9C,MAAM;;;;;;;;;;;;;EAaP;CACF,CAE6C"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import "./analytics-dashboard.docblock.js";
|