@dlh.io/bideux 0.1.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 +202 -0
- package/README.md +90 -0
- package/dist/all.d.ts +14 -0
- package/dist/all.js +15 -0
- package/dist/all.js.map +1 -0
- package/dist/chunk-62IQGXLW.js +11470 -0
- package/dist/chunk-62IQGXLW.js.map +1 -0
- package/dist/chunk-75CRTQK7.js +315 -0
- package/dist/chunk-75CRTQK7.js.map +1 -0
- package/dist/chunk-FVO6E22Z.js +225 -0
- package/dist/chunk-FVO6E22Z.js.map +1 -0
- package/dist/chunk-GRITOB4M.js +337 -0
- package/dist/chunk-GRITOB4M.js.map +1 -0
- package/dist/chunk-HPFHIZWO.js +40 -0
- package/dist/chunk-HPFHIZWO.js.map +1 -0
- package/dist/chunk-IMNUQGHE.js +2864 -0
- package/dist/chunk-IMNUQGHE.js.map +1 -0
- package/dist/chunk-LHD445PJ.js +571 -0
- package/dist/chunk-LHD445PJ.js.map +1 -0
- package/dist/chunk-LPLBBHOW.js +386 -0
- package/dist/chunk-LPLBBHOW.js.map +1 -0
- package/dist/chunk-NGM5R3LW.js +881 -0
- package/dist/chunk-NGM5R3LW.js.map +1 -0
- package/dist/chunk-OMPR32AR.js +1320 -0
- package/dist/chunk-OMPR32AR.js.map +1 -0
- package/dist/chunk-QDQ5VVTC.js +255 -0
- package/dist/chunk-QDQ5VVTC.js.map +1 -0
- package/dist/chunk-RRWZKNDZ.js +1004 -0
- package/dist/chunk-RRWZKNDZ.js.map +1 -0
- package/dist/chunk-SRWIBMEB.js +178 -0
- package/dist/chunk-SRWIBMEB.js.map +1 -0
- package/dist/element/chunk-AOKCBPMV.js +1646 -0
- package/dist/element/chunk-AOKCBPMV.js.map +1 -0
- package/dist/element/chunk-B67SYRQP.js +281 -0
- package/dist/element/chunk-B67SYRQP.js.map +1 -0
- package/dist/element/chunk-FNRVFA2C.js +55 -0
- package/dist/element/chunk-FNRVFA2C.js.map +1 -0
- package/dist/element/chunk-G3C722QP.js +4707 -0
- package/dist/element/chunk-G3C722QP.js.map +1 -0
- package/dist/element/chunk-H5IFOSQP.js +346 -0
- package/dist/element/chunk-H5IFOSQP.js.map +1 -0
- package/dist/element/chunk-LXR3CLCN.js +30 -0
- package/dist/element/chunk-LXR3CLCN.js.map +1 -0
- package/dist/element/chunk-TFV4CJR4.js +183 -0
- package/dist/element/chunk-TFV4CJR4.js.map +1 -0
- package/dist/element/chunk-TXSK3CIN.js +859 -0
- package/dist/element/chunk-TXSK3CIN.js.map +1 -0
- package/dist/element/chunk-WDTTBY3S.js +45 -0
- package/dist/element/chunk-WDTTBY3S.js.map +1 -0
- package/dist/element/chunk-ZI3RYCAR.js +233 -0
- package/dist/element/chunk-ZI3RYCAR.js.map +1 -0
- package/dist/element/element.d.ts +3044 -0
- package/dist/element/element.js +146554 -0
- package/dist/element/element.js.map +1 -0
- package/dist/element/revo-grid.entry-7FHEBN3O.js +4817 -0
- package/dist/element/revo-grid.entry-7FHEBN3O.js.map +1 -0
- package/dist/element/revogr-attribution_7.entry-LSOFVZRA.js +1328 -0
- package/dist/element/revogr-attribution_7.entry-LSOFVZRA.js.map +1 -0
- package/dist/element/revogr-clipboard_3.entry-V74UIBPJ.js +494 -0
- package/dist/element/revogr-clipboard_3.entry-V74UIBPJ.js.map +1 -0
- package/dist/element/revogr-data_4.entry-2UBOKTFN.js +1041 -0
- package/dist/element/revogr-data_4.entry-2UBOKTFN.js.map +1 -0
- package/dist/element/revogr-filter-panel.entry-B24PLQU4.js +552 -0
- package/dist/element/revogr-filter-panel.entry-B24PLQU4.js.map +1 -0
- package/dist/index.d.ts +1041 -0
- package/dist/index.js +10 -0
- package/dist/index.js.map +1 -0
- package/dist/react.d.ts +1915 -0
- package/dist/react.js +14 -0
- package/dist/react.js.map +1 -0
- package/dist/renderers/echarts.d.ts +44 -0
- package/dist/renderers/echarts.js +6 -0
- package/dist/renderers/echarts.js.map +1 -0
- package/dist/renderers/index.d.ts +48 -0
- package/dist/renderers/index.js +12 -0
- package/dist/renderers/index.js.map +1 -0
- package/dist/renderers/revogrid.d.ts +76 -0
- package/dist/renderers/revogrid.js +6 -0
- package/dist/renderers/revogrid.js.map +1 -0
- package/dist/renderers/tabulator.d.ts +37 -0
- package/dist/renderers/tabulator.js +6 -0
- package/dist/renderers/tabulator.js.map +1 -0
- package/dist/result-table-CPls-277.d.ts +1885 -0
- package/dist/schema/dashboard.schema.json +4374 -0
- package/dist/schema/semantic-model.schema.json +1200 -0
- package/dist/schema/widget.schema.json +1793 -0
- package/dist/styles.css +156 -0
- package/dist/theme.css +1789 -0
- package/dist/types-CHFSsU_X.d.ts +1007 -0
- package/package.json +119 -0
|
@@ -0,0 +1,3044 @@
|
|
|
1
|
+
import { ComponentType, ReactNode, CSSProperties } from 'react';
|
|
2
|
+
|
|
3
|
+
type Kind$1 = "dashboard";
|
|
4
|
+
type Author$1 = string | null;
|
|
5
|
+
type Description$1 = string;
|
|
6
|
+
type Backgroundcolor$1 = string | null;
|
|
7
|
+
type Border$1 = string | boolean | null;
|
|
8
|
+
type Borderradius$1 = string | number | null;
|
|
9
|
+
type Color$1 = string | null;
|
|
10
|
+
type Fontsize$1 = string | number | null;
|
|
11
|
+
type Fontweight$1 = string | number | null;
|
|
12
|
+
type Padding$1 = string | number | null;
|
|
13
|
+
type Textalign$1 = ("left" | "center" | "right" | "justify") | null;
|
|
14
|
+
type Title$1 = string | LabelBlock$1 | null;
|
|
15
|
+
type Icon$1 = string | null;
|
|
16
|
+
type Position$1 = ("top" | "bottom" | "left" | "right") | null;
|
|
17
|
+
type Text$1 = string | null;
|
|
18
|
+
type Tooltip$1 = string | null;
|
|
19
|
+
type Verticalalign$1 = ("top" | "middle" | "bottom") | null;
|
|
20
|
+
type Visible$1 = boolean | null;
|
|
21
|
+
type Id$1 = string;
|
|
22
|
+
type Name$1 = string;
|
|
23
|
+
type AllowEmbed$1 = boolean;
|
|
24
|
+
type Owner$1 = string | null;
|
|
25
|
+
type Public$1 = boolean;
|
|
26
|
+
type Roles$1 = string[];
|
|
27
|
+
type Scope$1 = "org" | "project" | "dashboard" | "widget";
|
|
28
|
+
type Status$1 = "draft" | "published" | "archived";
|
|
29
|
+
type Tags$1 = string[];
|
|
30
|
+
type Version$1 = string;
|
|
31
|
+
type Tags1$1 = string[];
|
|
32
|
+
type Version1$1 = string;
|
|
33
|
+
type Enabled = boolean;
|
|
34
|
+
type Icon1 = string;
|
|
35
|
+
type Showinembed = boolean;
|
|
36
|
+
type Showinlayout = boolean;
|
|
37
|
+
type Showinpreview = boolean;
|
|
38
|
+
type Ttlseconds = number | null;
|
|
39
|
+
type Datamodelid = string | null;
|
|
40
|
+
type Background$1 = string | null;
|
|
41
|
+
type Collapsible = boolean | null;
|
|
42
|
+
type Defaultcollapsed = boolean | null;
|
|
43
|
+
type Disablecollapse = boolean | null;
|
|
44
|
+
type Gap = string | number | null;
|
|
45
|
+
type Buttonspan = number | null;
|
|
46
|
+
type Columns$1 = number | null;
|
|
47
|
+
type Datespan = number | null;
|
|
48
|
+
type Gap1 = string | number | null;
|
|
49
|
+
type Maxcolumnwidth = number | null;
|
|
50
|
+
type Mincolumnwidth = number | null;
|
|
51
|
+
type Mode = "auto" | "grid" | "flex";
|
|
52
|
+
type Padding1$1 = string | number | null;
|
|
53
|
+
type Radiospan = number | null;
|
|
54
|
+
type Selectspan = number | null;
|
|
55
|
+
type Padding2 = string | number | null;
|
|
56
|
+
type Position1 = "top" | "left";
|
|
57
|
+
type Width = string | number | null;
|
|
58
|
+
type Background1 = string | null;
|
|
59
|
+
type Height = string | number | null;
|
|
60
|
+
type Padding3 = string | number | null;
|
|
61
|
+
type Textalign1 = ("left" | "center" | "right" | "justify") | null;
|
|
62
|
+
type Verticalalign1 = ("top" | "middle" | "bottom") | null;
|
|
63
|
+
type Visible1 = boolean | null;
|
|
64
|
+
type Widgets = WidgetSpec$1[] | null;
|
|
65
|
+
type Kind1$1 = "widget";
|
|
66
|
+
type Field$1 = string;
|
|
67
|
+
type Operator$1 = "eq" | "in" | "gt" | "lt" | "gte" | "lte" | "contains" | "date" | "between";
|
|
68
|
+
type Param$1 = string | null;
|
|
69
|
+
type Target$1 = string;
|
|
70
|
+
type Bindings$1 = FilterBinding$1[];
|
|
71
|
+
type Component$1 = "echarts" | "kpi" | "filter" | "select" | "table" | "tabulator" | "pivot_table" | "text" | "image" | "markdown";
|
|
72
|
+
type Data$1 = KpiDataSource$1 | StaticDataSource$1 | DemoDataSource$1 | SqlDataSource$1 | DatasetDataSource$1 | QueryDataSource$1;
|
|
73
|
+
type DataModelId$1 = string | null;
|
|
74
|
+
type Kind2$1 = "kpi";
|
|
75
|
+
type Kpi$1 = string;
|
|
76
|
+
type Labelcolumn$1 = string | null;
|
|
77
|
+
type JsonValue$1 = unknown;
|
|
78
|
+
type Valuecolumn$1 = string | null;
|
|
79
|
+
type Columns1$1 = string[] | null;
|
|
80
|
+
type Kind3$1 = "static";
|
|
81
|
+
type Label$1 = string;
|
|
82
|
+
type Options$1 = StaticOption$1[];
|
|
83
|
+
type Rows$1 = {
|
|
84
|
+
[k: string]: JsonValue$1;
|
|
85
|
+
}[];
|
|
86
|
+
type Columns2$1 = string[] | null;
|
|
87
|
+
type Dataset$1 = string | null;
|
|
88
|
+
type Kind4$1 = "demo";
|
|
89
|
+
type Rows1$1 = number;
|
|
90
|
+
type Seed$1 = number;
|
|
91
|
+
type DataModelId1$1 = string | null;
|
|
92
|
+
type FilterField$1 = string | null;
|
|
93
|
+
type Kind5$1 = "sql";
|
|
94
|
+
type Query$1 = string;
|
|
95
|
+
type Columns3 = string[] | null;
|
|
96
|
+
type DataModelId2$1 = string | null;
|
|
97
|
+
type Dataset1$1 = string;
|
|
98
|
+
type Dimensions$1 = string[] | null;
|
|
99
|
+
type Field1$1 = string;
|
|
100
|
+
type FilterId$1 = string;
|
|
101
|
+
type Operator1$1 = "eq" | "in" | "gt" | "lt" | "gte" | "lte" | "contains" | "date" | "between";
|
|
102
|
+
type Param1$1 = string | null;
|
|
103
|
+
type Filters$2 = IncomingFilter$1[];
|
|
104
|
+
type Kind6$1 = "dataset";
|
|
105
|
+
type Metrics$1 = string[] | null;
|
|
106
|
+
type DataModelId3$1 = string | null;
|
|
107
|
+
type Kind7$1 = "query";
|
|
108
|
+
type Query1$1 = string;
|
|
109
|
+
type Background2 = string | null;
|
|
110
|
+
type Border1$1 = string | boolean | null;
|
|
111
|
+
type Borderradius1$1 = string | number | null;
|
|
112
|
+
type Echarts$1 = {
|
|
113
|
+
[k: string]: JsonValue$1;
|
|
114
|
+
} | null;
|
|
115
|
+
type Filter$1 = {
|
|
116
|
+
[k: string]: JsonValue$1;
|
|
117
|
+
} | null;
|
|
118
|
+
type Image$1 = {
|
|
119
|
+
[k: string]: JsonValue$1;
|
|
120
|
+
} | null;
|
|
121
|
+
type Kpi1$1 = {
|
|
122
|
+
[k: string]: JsonValue$1;
|
|
123
|
+
} | null;
|
|
124
|
+
type Margin$1 = string | number | null;
|
|
125
|
+
type Markdown$1 = {
|
|
126
|
+
[k: string]: JsonValue$1;
|
|
127
|
+
} | null;
|
|
128
|
+
type Padding4 = string | number | null;
|
|
129
|
+
type PivotTable$1 = {
|
|
130
|
+
[k: string]: JsonValue$1;
|
|
131
|
+
} | null;
|
|
132
|
+
type Select$1 = {
|
|
133
|
+
[k: string]: JsonValue$1;
|
|
134
|
+
} | null;
|
|
135
|
+
type Shadow$1 = string | boolean | null;
|
|
136
|
+
type Table$1 = {
|
|
137
|
+
[k: string]: JsonValue$1;
|
|
138
|
+
} | null;
|
|
139
|
+
type Tabulator$1 = {
|
|
140
|
+
[k: string]: JsonValue$1;
|
|
141
|
+
} | null;
|
|
142
|
+
type Text1$1 = {
|
|
143
|
+
[k: string]: JsonValue$1;
|
|
144
|
+
} | null;
|
|
145
|
+
type Filters1$1 = IncomingFilter$1[];
|
|
146
|
+
type Id1$1 = string;
|
|
147
|
+
type Label1$1 = string | null;
|
|
148
|
+
type OpenIn$1 = "modal" | "same" | "new" | "detail";
|
|
149
|
+
type PassFilters$1 = boolean;
|
|
150
|
+
type PassSelection$1 = boolean;
|
|
151
|
+
type Target1$1 = string;
|
|
152
|
+
type TargetType$1 = "dashboard" | "url" | "filter" | "dimension";
|
|
153
|
+
type Type$1 = "drilldown" | "set_filter" | "navigate";
|
|
154
|
+
type Field2$1 = string | null;
|
|
155
|
+
type Kind8 = "event" | "filter" | "literal";
|
|
156
|
+
type Target2$1 = string;
|
|
157
|
+
type TargetType1$1 = "filter" | "dimension";
|
|
158
|
+
type VariableMappings$1 = InteractionVariableMapping$1[];
|
|
159
|
+
type Interactions$1 = WidgetInteraction$1[];
|
|
160
|
+
type H$1 = number;
|
|
161
|
+
type Isbounded$1 = boolean | null;
|
|
162
|
+
type Isdraggable$1 = boolean | null;
|
|
163
|
+
type Isresizable$1 = boolean | null;
|
|
164
|
+
type Maxh$1 = number | null;
|
|
165
|
+
type Maxw$1 = number | null;
|
|
166
|
+
type Minh$1 = number | null;
|
|
167
|
+
type Minw$1 = number | null;
|
|
168
|
+
type Resizehandles$1 = string[] | null;
|
|
169
|
+
type H1$1 = number;
|
|
170
|
+
type Isbounded1$1 = boolean | null;
|
|
171
|
+
type Isdraggable1$1 = boolean | null;
|
|
172
|
+
type Isresizable1$1 = boolean | null;
|
|
173
|
+
type Maxh1$1 = number | null;
|
|
174
|
+
type Maxw1$1 = number | null;
|
|
175
|
+
type Minh1$1 = number | null;
|
|
176
|
+
type Minw1$1 = number | null;
|
|
177
|
+
type Resizehandles1$1 = string[] | null;
|
|
178
|
+
type W$1 = number;
|
|
179
|
+
type X$1 = number;
|
|
180
|
+
type Y$1 = number;
|
|
181
|
+
type Unplaced$1 = boolean | null;
|
|
182
|
+
type W1$1 = number;
|
|
183
|
+
type X1$1 = number;
|
|
184
|
+
type Y1$1 = number;
|
|
185
|
+
type Category$1 = string | null;
|
|
186
|
+
type Date$1 = string | null;
|
|
187
|
+
type Delta$1 = string | null;
|
|
188
|
+
type Label2$1 = string | null;
|
|
189
|
+
type Series$1 = string | null;
|
|
190
|
+
type SeriesName$1 = string | null;
|
|
191
|
+
type Value$1 = string | null;
|
|
192
|
+
type X2$1 = string | null;
|
|
193
|
+
type Y2$1 = string | null;
|
|
194
|
+
type Version2$1 = string;
|
|
195
|
+
type Allowoverlap = boolean | null;
|
|
196
|
+
type Compacttype = ("vertical" | "horizontal") | null;
|
|
197
|
+
type Containerpadding = number[] | null;
|
|
198
|
+
type Draggablecancel = string | null;
|
|
199
|
+
type Draggablehandle = string | null;
|
|
200
|
+
type Isbounded2 = boolean | null;
|
|
201
|
+
type Maxlayoutwidth = ("mobile" | "tablet" | "desktop" | "wide") | null;
|
|
202
|
+
type Maxrows = number | null;
|
|
203
|
+
type Preventcollision = boolean | null;
|
|
204
|
+
type Resizehandles2 = string[] | null;
|
|
205
|
+
type Snap = boolean | null;
|
|
206
|
+
type Squarecells = boolean | null;
|
|
207
|
+
type Backgroundcolor1 = string | null;
|
|
208
|
+
type Fitmode = "fit_to_width" | "fit_to_page";
|
|
209
|
+
type Orientation = "auto" | "portrait" | "landscape";
|
|
210
|
+
type Pagesize = "a4" | "letter";
|
|
211
|
+
type Scale = "contain" | "cover";
|
|
212
|
+
type Background3 = string | null;
|
|
213
|
+
type Border2 = string | boolean | null;
|
|
214
|
+
type Borderradius2 = string | number | null;
|
|
215
|
+
type Margin1 = string | number | null;
|
|
216
|
+
type Padding5 = string | number | null;
|
|
217
|
+
type Shadow1 = string | boolean | null;
|
|
218
|
+
type AiContext = {
|
|
219
|
+
[k: string]: JsonValue$1;
|
|
220
|
+
} | string | null;
|
|
221
|
+
type CustomExtensions = {
|
|
222
|
+
[k: string]: JsonValue$1;
|
|
223
|
+
}[] | null;
|
|
224
|
+
/**
|
|
225
|
+
* Host data-store identifier holding credentials, database, and schema. Omit to use the host's default active store.
|
|
226
|
+
*/
|
|
227
|
+
type DataModelId4 = string | null;
|
|
228
|
+
/**
|
|
229
|
+
* Store used by datasets that do not name one.
|
|
230
|
+
*/
|
|
231
|
+
type Default = boolean;
|
|
232
|
+
type Description1 = string | null;
|
|
233
|
+
/**
|
|
234
|
+
* Id datasets use to point at this store, for example ops_dw.
|
|
235
|
+
*/
|
|
236
|
+
type Id2 = string;
|
|
237
|
+
type Name1 = string | null;
|
|
238
|
+
/**
|
|
239
|
+
* Warehouse vendor, for example snowflake, databricks or postgres.
|
|
240
|
+
*/
|
|
241
|
+
type Vendor = string | null;
|
|
242
|
+
type DataStores = DataStore[];
|
|
243
|
+
type AiContext1 = {
|
|
244
|
+
[k: string]: JsonValue$1;
|
|
245
|
+
} | string | null;
|
|
246
|
+
type Enabled1 = boolean;
|
|
247
|
+
type TtlSeconds = number | null;
|
|
248
|
+
type TtlSeconds1 = number | null;
|
|
249
|
+
type CustomExtensions1 = {
|
|
250
|
+
[k: string]: JsonValue$1;
|
|
251
|
+
}[] | null;
|
|
252
|
+
/**
|
|
253
|
+
* Id of the data store in this model's data_stores list. Omit to use the model's default store.
|
|
254
|
+
*/
|
|
255
|
+
type DataStoreId = string | null;
|
|
256
|
+
type DataStoreIds = string[] | null;
|
|
257
|
+
type DataModelId5 = string | null;
|
|
258
|
+
/**
|
|
259
|
+
* Id of the data store in this model's data_stores list. Omit to use the model's default store.
|
|
260
|
+
*/
|
|
261
|
+
type DataStoreId1 = string | null;
|
|
262
|
+
type DataStoreIds1 = string[] | null;
|
|
263
|
+
type Description2 = string | null;
|
|
264
|
+
type AiContext2 = {
|
|
265
|
+
[k: string]: JsonValue$1;
|
|
266
|
+
} | string | null;
|
|
267
|
+
/**
|
|
268
|
+
* Warehouse column this dimension reads. Defaults to the id.
|
|
269
|
+
*/
|
|
270
|
+
type Column = string | null;
|
|
271
|
+
type CustomExtensions2 = {
|
|
272
|
+
[k: string]: JsonValue$1;
|
|
273
|
+
}[] | null;
|
|
274
|
+
type Description3 = string | null;
|
|
275
|
+
/**
|
|
276
|
+
* SQL expression to use instead of a plain column.
|
|
277
|
+
*/
|
|
278
|
+
type Expression = string | Expression1 | null;
|
|
279
|
+
type Default1 = string | null;
|
|
280
|
+
type Dialect = string;
|
|
281
|
+
type Expression2 = string;
|
|
282
|
+
type Dialects = ExpressionDialect[];
|
|
283
|
+
type Format = string | null;
|
|
284
|
+
type Group = string | null;
|
|
285
|
+
type Hidden = boolean | null;
|
|
286
|
+
/**
|
|
287
|
+
* Id widgets use to group or filter by, for example business_date.
|
|
288
|
+
*/
|
|
289
|
+
type Id3 = string;
|
|
290
|
+
type IsTime = boolean | null;
|
|
291
|
+
type Label3 = string | null;
|
|
292
|
+
type Name2 = string | null;
|
|
293
|
+
type Type1 = "string" | "number" | "date" | "time" | "boolean";
|
|
294
|
+
/**
|
|
295
|
+
* Columns widgets can group or filter by.
|
|
296
|
+
*/
|
|
297
|
+
type Dimensions1 = Dimension[];
|
|
298
|
+
/**
|
|
299
|
+
* Columns widgets can group or filter by.
|
|
300
|
+
*/
|
|
301
|
+
type Dimensions2 = Dimension[];
|
|
302
|
+
/**
|
|
303
|
+
* Column carrying the location key. Without it a location-scoped user cannot query this dataset.
|
|
304
|
+
*/
|
|
305
|
+
type FilterField1 = string | null;
|
|
306
|
+
type FilterParam = string;
|
|
307
|
+
/**
|
|
308
|
+
* Table or view the rows come from, for example {mart_schema}.RPT_DAILY_SALES_SUMMARY.
|
|
309
|
+
*/
|
|
310
|
+
type From = string | null;
|
|
311
|
+
type GroupBy = string[] | null;
|
|
312
|
+
/**
|
|
313
|
+
* Id widgets use to ask for this dataset, for example daily_sales.
|
|
314
|
+
*/
|
|
315
|
+
type Id4 = string;
|
|
316
|
+
type Kpi2 = string | null;
|
|
317
|
+
type Enabled2 = boolean;
|
|
318
|
+
type Grain = string[];
|
|
319
|
+
type Metrics1 = string[];
|
|
320
|
+
type Source = string | null;
|
|
321
|
+
type Join = "left" | "inner";
|
|
322
|
+
type JoinColumns = string[];
|
|
323
|
+
type MaxRows = number;
|
|
324
|
+
/**
|
|
325
|
+
* @maxItems 3
|
|
326
|
+
*/
|
|
327
|
+
type Parts = [] | [MeshPart] | [MeshPart, MeshPart] | [MeshPart, MeshPart, MeshPart];
|
|
328
|
+
type Dataset3 = string;
|
|
329
|
+
type AiContext3 = {
|
|
330
|
+
[k: string]: JsonValue$1;
|
|
331
|
+
} | string | null;
|
|
332
|
+
type CustomExtensions3 = {
|
|
333
|
+
[k: string]: JsonValue$1;
|
|
334
|
+
}[] | null;
|
|
335
|
+
type Dependencies = string[] | null;
|
|
336
|
+
type Description4 = string | null;
|
|
337
|
+
/**
|
|
338
|
+
* SQL aggregate such as SUM(NET_SALES), or an expression over other metrics such as labor_cost / net_sales.
|
|
339
|
+
*/
|
|
340
|
+
type Expression3 = string | Expression1;
|
|
341
|
+
type Filter1 = string | null;
|
|
342
|
+
type Format1 = string | null;
|
|
343
|
+
type Group1 = string | null;
|
|
344
|
+
type Hidden1 = boolean | null;
|
|
345
|
+
/**
|
|
346
|
+
* Id widgets use to ask for this metric, for example net_sales.
|
|
347
|
+
*/
|
|
348
|
+
type Id5 = string;
|
|
349
|
+
type Label4 = string | null;
|
|
350
|
+
type Name3 = string | null;
|
|
351
|
+
/**
|
|
352
|
+
* sql sends the expression to the warehouse; formula computes it from other metrics after the query.
|
|
353
|
+
*/
|
|
354
|
+
type Type2 = "sql" | "formula";
|
|
355
|
+
/**
|
|
356
|
+
* Aggregations valid on this dataset's source.
|
|
357
|
+
*/
|
|
358
|
+
type Metrics2 = Metric[];
|
|
359
|
+
/**
|
|
360
|
+
* Label shown to users. Defaults to the id.
|
|
361
|
+
*/
|
|
362
|
+
type Name4 = string | null;
|
|
363
|
+
type PrimaryKey = string[] | null;
|
|
364
|
+
/**
|
|
365
|
+
* SQL to run when source_type is query.
|
|
366
|
+
*/
|
|
367
|
+
type Query2 = string | null;
|
|
368
|
+
type AiContext4 = {
|
|
369
|
+
[k: string]: JsonValue$1;
|
|
370
|
+
} | string | null;
|
|
371
|
+
type CustomExtensions4 = {
|
|
372
|
+
[k: string]: JsonValue$1;
|
|
373
|
+
}[] | null;
|
|
374
|
+
/**
|
|
375
|
+
* Id of the dataset on the left of the join.
|
|
376
|
+
*/
|
|
377
|
+
type From1 = string;
|
|
378
|
+
/**
|
|
379
|
+
* Join columns on the from dataset.
|
|
380
|
+
*/
|
|
381
|
+
type FromColumns = string[];
|
|
382
|
+
/**
|
|
383
|
+
* Name of the join, for example sales_to_labor.
|
|
384
|
+
*/
|
|
385
|
+
type Name5 = string;
|
|
386
|
+
/**
|
|
387
|
+
* Cardinality. one_to_many and many_to_many can fan out and double-count.
|
|
388
|
+
*/
|
|
389
|
+
type Relationship1 = ("one_to_one" | "many_to_one" | "one_to_many" | "many_to_many") | null;
|
|
390
|
+
/**
|
|
391
|
+
* Id of the dataset on the right of the join.
|
|
392
|
+
*/
|
|
393
|
+
type To = string;
|
|
394
|
+
/**
|
|
395
|
+
* Join columns on the to dataset, positionally matched to from_columns.
|
|
396
|
+
*/
|
|
397
|
+
type ToColumns = string[];
|
|
398
|
+
type Relationships = Relationship[];
|
|
399
|
+
/**
|
|
400
|
+
* Table or view the rows come from, for example {mart_schema}.RPT_DAILY_SALES_SUMMARY.
|
|
401
|
+
*/
|
|
402
|
+
type From2 = string | null;
|
|
403
|
+
/**
|
|
404
|
+
* table or view reads source; query runs the query field; mesh combines datasets from different data stores.
|
|
405
|
+
*/
|
|
406
|
+
type SourceType = ("table" | "view" | "query" | "mesh") | null;
|
|
407
|
+
type UniqueKeys = string[][] | null;
|
|
408
|
+
type Datasets = Dataset2[];
|
|
409
|
+
type Metrics3 = Metric[];
|
|
410
|
+
type ModelRefs = string[];
|
|
411
|
+
type Queries = {
|
|
412
|
+
[k: string]: NamedQuery;
|
|
413
|
+
} | null;
|
|
414
|
+
type DataModelId6 = string | null;
|
|
415
|
+
type Dimensions3 = string[] | null;
|
|
416
|
+
type File = string | null;
|
|
417
|
+
type FilterField2 = string | null;
|
|
418
|
+
type Filters2 = {
|
|
419
|
+
[k: string]: JsonValue$1;
|
|
420
|
+
}[] | null;
|
|
421
|
+
type Limit = number | null;
|
|
422
|
+
type Metrics4 = string[] | null;
|
|
423
|
+
type Model = string | null;
|
|
424
|
+
type Segments = string[] | null;
|
|
425
|
+
type Sort = {
|
|
426
|
+
[k: string]: JsonValue$1;
|
|
427
|
+
}[] | null;
|
|
428
|
+
type Sql = string | null;
|
|
429
|
+
type Relationships1 = Relationship[];
|
|
430
|
+
type Cols = number;
|
|
431
|
+
type Containerpadding1 = number[] | null;
|
|
432
|
+
type Margin2 = number[];
|
|
433
|
+
type RowHeight = number;
|
|
434
|
+
type SemanticModelRef = string | null;
|
|
435
|
+
type SemanticModel = SemanticModel1[] | null;
|
|
436
|
+
/**
|
|
437
|
+
* Business context available to host authoring tools, including synonyms.
|
|
438
|
+
*/
|
|
439
|
+
type AiContext5 = {
|
|
440
|
+
[k: string]: JsonValue$1;
|
|
441
|
+
} | string | null;
|
|
442
|
+
type CustomExtensions5 = {
|
|
443
|
+
[k: string]: JsonValue$1;
|
|
444
|
+
}[] | null;
|
|
445
|
+
/**
|
|
446
|
+
* Warehouse connections datasets may read from.
|
|
447
|
+
*
|
|
448
|
+
* @maxItems 3
|
|
449
|
+
*/
|
|
450
|
+
type DataStores1 = [] | [DataStore] | [DataStore, DataStore] | [DataStore, DataStore, DataStore];
|
|
451
|
+
/**
|
|
452
|
+
* Reusable sources of rows widgets can ask for.
|
|
453
|
+
*/
|
|
454
|
+
type Datasets1 = Dataset2[];
|
|
455
|
+
type Description5 = string | null;
|
|
456
|
+
type Kind9 = "semantic_model";
|
|
457
|
+
/**
|
|
458
|
+
* Metrics usable across datasets, including formulas spanning a join.
|
|
459
|
+
*/
|
|
460
|
+
type Metrics5 = Metric[];
|
|
461
|
+
/**
|
|
462
|
+
* Model name. Dashboards reference the tenant model as default.
|
|
463
|
+
*/
|
|
464
|
+
type Name6 = string;
|
|
465
|
+
/**
|
|
466
|
+
* Joins between datasets, so one widget can mix their fields.
|
|
467
|
+
*/
|
|
468
|
+
type Relationships2 = Relationship[];
|
|
469
|
+
type SemanticModelRef1 = string | null;
|
|
470
|
+
type SemanticModel2 = SemanticModel1[] | null;
|
|
471
|
+
type Default2 = boolean;
|
|
472
|
+
type Id6 = string;
|
|
473
|
+
type Label5 = string;
|
|
474
|
+
type Ref = string;
|
|
475
|
+
type Widgets1 = (WidgetRef | WidgetSpec$1 | string)[];
|
|
476
|
+
type Tabs = DashboardTab[];
|
|
477
|
+
type Version3 = string;
|
|
478
|
+
/**
|
|
479
|
+
* Top-level dashboard manifest.
|
|
480
|
+
*/
|
|
481
|
+
interface DashboardSpec {
|
|
482
|
+
kind?: Kind$1;
|
|
483
|
+
metadata: Metadata$1;
|
|
484
|
+
spec: DashboardSpecInner;
|
|
485
|
+
version?: Version3;
|
|
486
|
+
[k: string]: unknown;
|
|
487
|
+
}
|
|
488
|
+
/**
|
|
489
|
+
* Common metadata for dashboards and widgets.
|
|
490
|
+
*/
|
|
491
|
+
interface Metadata$1 {
|
|
492
|
+
author?: Author$1;
|
|
493
|
+
description?: Description$1;
|
|
494
|
+
header?: WidgetHeader$1 | null;
|
|
495
|
+
id: Id$1;
|
|
496
|
+
name: Name$1;
|
|
497
|
+
platform?: PlatformAttributes$1;
|
|
498
|
+
tags?: Tags1$1;
|
|
499
|
+
version?: Version1$1;
|
|
500
|
+
[k: string]: unknown;
|
|
501
|
+
}
|
|
502
|
+
/**
|
|
503
|
+
* Object-level header/title configuration for any widget.
|
|
504
|
+
*/
|
|
505
|
+
interface WidgetHeader$1 {
|
|
506
|
+
backgroundColor?: Backgroundcolor$1;
|
|
507
|
+
border?: Border$1;
|
|
508
|
+
borderRadius?: Borderradius$1;
|
|
509
|
+
color?: Color$1;
|
|
510
|
+
fontSize?: Fontsize$1;
|
|
511
|
+
fontWeight?: Fontweight$1;
|
|
512
|
+
padding?: Padding$1;
|
|
513
|
+
textAlign?: Textalign$1;
|
|
514
|
+
title?: Title$1;
|
|
515
|
+
verticalAlign?: Verticalalign$1;
|
|
516
|
+
visible?: Visible$1;
|
|
517
|
+
[k: string]: unknown;
|
|
518
|
+
}
|
|
519
|
+
/**
|
|
520
|
+
* A rich label with optional tooltip and icon.
|
|
521
|
+
*/
|
|
522
|
+
interface LabelBlock$1 {
|
|
523
|
+
icon?: Icon$1;
|
|
524
|
+
position?: Position$1;
|
|
525
|
+
text?: Text$1;
|
|
526
|
+
tooltip?: Tooltip$1;
|
|
527
|
+
[k: string]: unknown;
|
|
528
|
+
}
|
|
529
|
+
/**
|
|
530
|
+
* Cross-cutting platform attributes attached to every dashboard object.
|
|
531
|
+
*
|
|
532
|
+
* These attributes control the relationship of the object to the platform,
|
|
533
|
+
* the dashboard, the user, and security. They are intentionally generic so
|
|
534
|
+
* the spec can grow into the larger enterprise BI project.
|
|
535
|
+
*/
|
|
536
|
+
interface PlatformAttributes$1 {
|
|
537
|
+
allow_embed?: AllowEmbed$1;
|
|
538
|
+
owner?: Owner$1;
|
|
539
|
+
public?: Public$1;
|
|
540
|
+
roles?: Roles$1;
|
|
541
|
+
scope?: Scope$1;
|
|
542
|
+
status?: Status$1;
|
|
543
|
+
tags?: Tags$1;
|
|
544
|
+
version?: Version$1;
|
|
545
|
+
[k: string]: unknown;
|
|
546
|
+
}
|
|
547
|
+
/**
|
|
548
|
+
* Inner spec body of a dashboard.
|
|
549
|
+
*/
|
|
550
|
+
interface DashboardSpecInner {
|
|
551
|
+
config?: DashboardConfig | null;
|
|
552
|
+
data_stores?: DataStores;
|
|
553
|
+
datasets?: Datasets;
|
|
554
|
+
metrics?: Metrics3;
|
|
555
|
+
model_refs?: ModelRefs;
|
|
556
|
+
queries?: Queries;
|
|
557
|
+
relationships?: Relationships1;
|
|
558
|
+
responsive?: DashboardResponsiveConfig;
|
|
559
|
+
semanticModelRef?: SemanticModelRef;
|
|
560
|
+
semantic_model?: SemanticModel;
|
|
561
|
+
semantic_model_ref?: SemanticModelRef1;
|
|
562
|
+
semantic_models?: SemanticModel2;
|
|
563
|
+
tabs?: Tabs;
|
|
564
|
+
[k: string]: unknown;
|
|
565
|
+
}
|
|
566
|
+
/**
|
|
567
|
+
* Dashboard-level configuration overrides.
|
|
568
|
+
*/
|
|
569
|
+
interface DashboardConfig {
|
|
570
|
+
cache?: DashboardCacheConfig | null;
|
|
571
|
+
dataModelId?: Datamodelid;
|
|
572
|
+
filterPanel?: DashboardFilterPanelConfig | null;
|
|
573
|
+
footer?: DashboardSectionConfig | null;
|
|
574
|
+
grid?: DashboardGridConfig | null;
|
|
575
|
+
header?: DashboardSectionConfig | null;
|
|
576
|
+
print?: DashboardPrintConfig | null;
|
|
577
|
+
widgetDefaults?: WidgetDefaults$1 | null;
|
|
578
|
+
[k: string]: unknown;
|
|
579
|
+
}
|
|
580
|
+
/**
|
|
581
|
+
* Dashboard-level cache configuration.
|
|
582
|
+
*/
|
|
583
|
+
interface DashboardCacheConfig {
|
|
584
|
+
enabled?: Enabled;
|
|
585
|
+
icon?: Icon1;
|
|
586
|
+
showInEmbed?: Showinembed;
|
|
587
|
+
showInLayout?: Showinlayout;
|
|
588
|
+
showInPreview?: Showinpreview;
|
|
589
|
+
ttlSeconds?: Ttlseconds;
|
|
590
|
+
[k: string]: unknown;
|
|
591
|
+
}
|
|
592
|
+
/**
|
|
593
|
+
* Configuration for the dashboard filter panel.
|
|
594
|
+
*/
|
|
595
|
+
interface DashboardFilterPanelConfig {
|
|
596
|
+
background?: Background$1;
|
|
597
|
+
collapsible?: Collapsible;
|
|
598
|
+
defaultCollapsed?: Defaultcollapsed;
|
|
599
|
+
disableCollapse?: Disablecollapse;
|
|
600
|
+
gap?: Gap;
|
|
601
|
+
layout?: FilterLayout | null;
|
|
602
|
+
padding?: Padding2;
|
|
603
|
+
position?: Position1;
|
|
604
|
+
width?: Width;
|
|
605
|
+
[k: string]: unknown;
|
|
606
|
+
}
|
|
607
|
+
/**
|
|
608
|
+
* Algorithmic or manual layout for the filter panel.
|
|
609
|
+
*/
|
|
610
|
+
interface FilterLayout {
|
|
611
|
+
buttonSpan?: Buttonspan;
|
|
612
|
+
columns?: Columns$1;
|
|
613
|
+
dateSpan?: Datespan;
|
|
614
|
+
gap?: Gap1;
|
|
615
|
+
maxColumnWidth?: Maxcolumnwidth;
|
|
616
|
+
minColumnWidth?: Mincolumnwidth;
|
|
617
|
+
mode?: Mode;
|
|
618
|
+
padding?: Padding1$1;
|
|
619
|
+
radioSpan?: Radiospan;
|
|
620
|
+
selectSpan?: Selectspan;
|
|
621
|
+
[k: string]: unknown;
|
|
622
|
+
}
|
|
623
|
+
/**
|
|
624
|
+
* Configuration for header/footer sections.
|
|
625
|
+
*/
|
|
626
|
+
interface DashboardSectionConfig {
|
|
627
|
+
background?: Background1;
|
|
628
|
+
height?: Height;
|
|
629
|
+
padding?: Padding3;
|
|
630
|
+
textAlign?: Textalign1;
|
|
631
|
+
verticalAlign?: Verticalalign1;
|
|
632
|
+
visible?: Visible1;
|
|
633
|
+
widgets?: Widgets;
|
|
634
|
+
[k: string]: unknown;
|
|
635
|
+
}
|
|
636
|
+
/**
|
|
637
|
+
* Specification for a single widget/object.
|
|
638
|
+
*/
|
|
639
|
+
interface WidgetSpec$1 {
|
|
640
|
+
kind?: Kind1$1;
|
|
641
|
+
metadata: Metadata$1;
|
|
642
|
+
spec: WidgetSpecInner$1;
|
|
643
|
+
version?: Version2$1;
|
|
644
|
+
[k: string]: unknown;
|
|
645
|
+
}
|
|
646
|
+
/**
|
|
647
|
+
* Inner spec body of a widget.
|
|
648
|
+
*/
|
|
649
|
+
interface WidgetSpecInner$1 {
|
|
650
|
+
bindings?: Bindings$1;
|
|
651
|
+
component?: Component$1;
|
|
652
|
+
data?: Data$1;
|
|
653
|
+
display?: WidgetDisplay$1;
|
|
654
|
+
filters?: Filters1$1;
|
|
655
|
+
interactions?: Interactions$1;
|
|
656
|
+
layout?: WidgetLayout$1;
|
|
657
|
+
mappings?: FieldMapping$1;
|
|
658
|
+
[k: string]: unknown;
|
|
659
|
+
}
|
|
660
|
+
/**
|
|
661
|
+
* How a filter widget is wired to a target widget.
|
|
662
|
+
*/
|
|
663
|
+
interface FilterBinding$1 {
|
|
664
|
+
field: Field$1;
|
|
665
|
+
operator?: Operator$1;
|
|
666
|
+
param?: Param$1;
|
|
667
|
+
target?: Target$1;
|
|
668
|
+
[k: string]: unknown;
|
|
669
|
+
}
|
|
670
|
+
/**
|
|
671
|
+
* Run a KPI from the catalog.
|
|
672
|
+
*/
|
|
673
|
+
interface KpiDataSource$1 {
|
|
674
|
+
data_model_id?: DataModelId$1;
|
|
675
|
+
kind?: Kind2$1;
|
|
676
|
+
kpi: Kpi$1;
|
|
677
|
+
labelColumn?: Labelcolumn$1;
|
|
678
|
+
params?: Params$1;
|
|
679
|
+
valueColumn?: Valuecolumn$1;
|
|
680
|
+
[k: string]: unknown;
|
|
681
|
+
}
|
|
682
|
+
interface Params$1 {
|
|
683
|
+
[k: string]: JsonValue$1;
|
|
684
|
+
}
|
|
685
|
+
/**
|
|
686
|
+
* Static data supplied inline in the spec.
|
|
687
|
+
*/
|
|
688
|
+
interface StaticDataSource$1 {
|
|
689
|
+
columns?: Columns1$1;
|
|
690
|
+
default_value?: {
|
|
691
|
+
[k: string]: unknown;
|
|
692
|
+
};
|
|
693
|
+
kind?: Kind3$1;
|
|
694
|
+
options?: Options$1;
|
|
695
|
+
rows?: Rows$1;
|
|
696
|
+
[k: string]: unknown;
|
|
697
|
+
}
|
|
698
|
+
/**
|
|
699
|
+
* A single option for a static select or filter.
|
|
700
|
+
*/
|
|
701
|
+
interface StaticOption$1 {
|
|
702
|
+
label: Label$1;
|
|
703
|
+
value: JsonValue$1;
|
|
704
|
+
[k: string]: unknown;
|
|
705
|
+
}
|
|
706
|
+
/**
|
|
707
|
+
* Deterministic generated data for testing and previews.
|
|
708
|
+
*/
|
|
709
|
+
interface DemoDataSource$1 {
|
|
710
|
+
columns?: Columns2$1;
|
|
711
|
+
dataset?: Dataset$1;
|
|
712
|
+
kind?: Kind4$1;
|
|
713
|
+
rows?: Rows1$1;
|
|
714
|
+
seed?: Seed$1;
|
|
715
|
+
[k: string]: unknown;
|
|
716
|
+
}
|
|
717
|
+
/**
|
|
718
|
+
* Run an arbitrary SQL query against the configured data store.
|
|
719
|
+
*/
|
|
720
|
+
interface SqlDataSource$1 {
|
|
721
|
+
data_model_id?: DataModelId1$1;
|
|
722
|
+
filter_field?: FilterField$1;
|
|
723
|
+
kind?: Kind5$1;
|
|
724
|
+
params?: Params1$1;
|
|
725
|
+
query: Query$1;
|
|
726
|
+
[k: string]: unknown;
|
|
727
|
+
}
|
|
728
|
+
interface Params1$1 {
|
|
729
|
+
[k: string]: JsonValue$1;
|
|
730
|
+
}
|
|
731
|
+
/**
|
|
732
|
+
* Reference a reusable Dataset defined in the dashboard manifest.
|
|
733
|
+
*/
|
|
734
|
+
interface DatasetDataSource$1 {
|
|
735
|
+
columns?: Columns3;
|
|
736
|
+
data_model_id?: DataModelId2$1;
|
|
737
|
+
dataset: Dataset1$1;
|
|
738
|
+
dimensions?: Dimensions$1;
|
|
739
|
+
filters?: Filters$2;
|
|
740
|
+
kind?: Kind6$1;
|
|
741
|
+
metrics?: Metrics$1;
|
|
742
|
+
params?: Params2$1;
|
|
743
|
+
[k: string]: unknown;
|
|
744
|
+
}
|
|
745
|
+
/**
|
|
746
|
+
* How a target widget or dataset applies a filter broadcast from the dashboard.
|
|
747
|
+
*/
|
|
748
|
+
interface IncomingFilter$1 {
|
|
749
|
+
field: Field1$1;
|
|
750
|
+
filter_id: FilterId$1;
|
|
751
|
+
operator?: Operator1$1;
|
|
752
|
+
param?: Param1$1;
|
|
753
|
+
[k: string]: unknown;
|
|
754
|
+
}
|
|
755
|
+
interface Params2$1 {
|
|
756
|
+
[k: string]: JsonValue$1;
|
|
757
|
+
}
|
|
758
|
+
/**
|
|
759
|
+
* Reference a named query defined in the dashboard manifest.
|
|
760
|
+
*/
|
|
761
|
+
interface QueryDataSource$1 {
|
|
762
|
+
data_model_id?: DataModelId3$1;
|
|
763
|
+
kind?: Kind7$1;
|
|
764
|
+
params?: Params3$1;
|
|
765
|
+
query: Query1$1;
|
|
766
|
+
[k: string]: unknown;
|
|
767
|
+
}
|
|
768
|
+
interface Params3$1 {
|
|
769
|
+
[k: string]: JsonValue$1;
|
|
770
|
+
}
|
|
771
|
+
/**
|
|
772
|
+
* Display-specific configuration.
|
|
773
|
+
*/
|
|
774
|
+
interface WidgetDisplay$1 {
|
|
775
|
+
background?: Background2;
|
|
776
|
+
border?: Border1$1;
|
|
777
|
+
borderRadius?: Borderradius1$1;
|
|
778
|
+
echarts?: Echarts$1;
|
|
779
|
+
filter?: Filter$1;
|
|
780
|
+
image?: Image$1;
|
|
781
|
+
kpi?: Kpi1$1;
|
|
782
|
+
margin?: Margin$1;
|
|
783
|
+
markdown?: Markdown$1;
|
|
784
|
+
padding?: Padding4;
|
|
785
|
+
pivot_table?: PivotTable$1;
|
|
786
|
+
select?: Select$1;
|
|
787
|
+
shadow?: Shadow$1;
|
|
788
|
+
table?: Table$1;
|
|
789
|
+
tabulator?: Tabulator$1;
|
|
790
|
+
text?: Text1$1;
|
|
791
|
+
[k: string]: unknown;
|
|
792
|
+
}
|
|
793
|
+
/**
|
|
794
|
+
* A user-driven interaction on a widget.
|
|
795
|
+
*/
|
|
796
|
+
interface WidgetInteraction$1 {
|
|
797
|
+
id: Id1$1;
|
|
798
|
+
label?: Label1$1;
|
|
799
|
+
open_in?: OpenIn$1;
|
|
800
|
+
pass_filters?: PassFilters$1;
|
|
801
|
+
pass_selection?: PassSelection$1;
|
|
802
|
+
target: Target1$1;
|
|
803
|
+
target_type?: TargetType$1;
|
|
804
|
+
type: Type$1;
|
|
805
|
+
variable_mappings?: VariableMappings$1;
|
|
806
|
+
[k: string]: unknown;
|
|
807
|
+
}
|
|
808
|
+
/**
|
|
809
|
+
* Map a source value (event, filter, or literal) to a target filter/variable.
|
|
810
|
+
*/
|
|
811
|
+
interface InteractionVariableMapping$1 {
|
|
812
|
+
source?: InteractionVariableSource$1;
|
|
813
|
+
target: Target2$1;
|
|
814
|
+
target_type?: TargetType1$1;
|
|
815
|
+
[k: string]: unknown;
|
|
816
|
+
}
|
|
817
|
+
/**
|
|
818
|
+
* Source of a value for an interaction variable mapping.
|
|
819
|
+
*/
|
|
820
|
+
interface InteractionVariableSource$1 {
|
|
821
|
+
field?: Field2$1;
|
|
822
|
+
kind?: Kind8;
|
|
823
|
+
value?: unknown;
|
|
824
|
+
[k: string]: unknown;
|
|
825
|
+
}
|
|
826
|
+
/**
|
|
827
|
+
* Layout configuration for a widget.
|
|
828
|
+
*/
|
|
829
|
+
interface WidgetLayout$1 {
|
|
830
|
+
h?: H$1;
|
|
831
|
+
isBounded?: Isbounded$1;
|
|
832
|
+
isDraggable?: Isdraggable$1;
|
|
833
|
+
isResizable?: Isresizable$1;
|
|
834
|
+
maxH?: Maxh$1;
|
|
835
|
+
maxW?: Maxw$1;
|
|
836
|
+
minH?: Minh$1;
|
|
837
|
+
minW?: Minw$1;
|
|
838
|
+
resizeHandles?: Resizehandles$1;
|
|
839
|
+
responsive?: ResponsiveLayout$1;
|
|
840
|
+
unplaced?: Unplaced$1;
|
|
841
|
+
w?: W1$1;
|
|
842
|
+
x?: X1$1;
|
|
843
|
+
y?: Y1$1;
|
|
844
|
+
[k: string]: unknown;
|
|
845
|
+
}
|
|
846
|
+
/**
|
|
847
|
+
* Responsive overrides for a layout item.
|
|
848
|
+
*/
|
|
849
|
+
interface ResponsiveLayout$1 {
|
|
850
|
+
desktop?: LayoutItem$2 | null;
|
|
851
|
+
mobile?: LayoutItem$2 | null;
|
|
852
|
+
tablet?: LayoutItem$2 | null;
|
|
853
|
+
wide?: LayoutItem$2 | null;
|
|
854
|
+
[k: string]: unknown;
|
|
855
|
+
}
|
|
856
|
+
/**
|
|
857
|
+
* A single position/size entry in a responsive grid.
|
|
858
|
+
*/
|
|
859
|
+
interface LayoutItem$2 {
|
|
860
|
+
h?: H1$1;
|
|
861
|
+
isBounded?: Isbounded1$1;
|
|
862
|
+
isDraggable?: Isdraggable1$1;
|
|
863
|
+
isResizable?: Isresizable1$1;
|
|
864
|
+
maxH?: Maxh1$1;
|
|
865
|
+
maxW?: Maxw1$1;
|
|
866
|
+
minH?: Minh1$1;
|
|
867
|
+
minW?: Minw1$1;
|
|
868
|
+
resizeHandles?: Resizehandles1$1;
|
|
869
|
+
w?: W$1;
|
|
870
|
+
x?: X$1;
|
|
871
|
+
y?: Y$1;
|
|
872
|
+
[k: string]: unknown;
|
|
873
|
+
}
|
|
874
|
+
/**
|
|
875
|
+
* Map widget fields to columns in the data source.
|
|
876
|
+
*/
|
|
877
|
+
interface FieldMapping$1 {
|
|
878
|
+
category?: Category$1;
|
|
879
|
+
date?: Date$1;
|
|
880
|
+
delta?: Delta$1;
|
|
881
|
+
label?: Label2$1;
|
|
882
|
+
series?: Series$1;
|
|
883
|
+
series_name?: SeriesName$1;
|
|
884
|
+
value?: Value$1;
|
|
885
|
+
x?: X2$1;
|
|
886
|
+
y?: Y2$1;
|
|
887
|
+
[k: string]: unknown;
|
|
888
|
+
}
|
|
889
|
+
/**
|
|
890
|
+
* Core react-grid-layout behavior for the dashboard.
|
|
891
|
+
*/
|
|
892
|
+
interface DashboardGridConfig {
|
|
893
|
+
allowOverlap?: Allowoverlap;
|
|
894
|
+
compactType?: Compacttype;
|
|
895
|
+
containerPadding?: Containerpadding;
|
|
896
|
+
draggableCancel?: Draggablecancel;
|
|
897
|
+
draggableHandle?: Draggablehandle;
|
|
898
|
+
isBounded?: Isbounded2;
|
|
899
|
+
maxLayoutWidth?: Maxlayoutwidth;
|
|
900
|
+
maxRows?: Maxrows;
|
|
901
|
+
preventCollision?: Preventcollision;
|
|
902
|
+
resizeHandles?: Resizehandles2;
|
|
903
|
+
snap?: Snap;
|
|
904
|
+
squareCells?: Squarecells;
|
|
905
|
+
[k: string]: unknown;
|
|
906
|
+
}
|
|
907
|
+
/**
|
|
908
|
+
* Print/export settings for the dashboard.
|
|
909
|
+
*/
|
|
910
|
+
interface DashboardPrintConfig {
|
|
911
|
+
backgroundColor?: Backgroundcolor1;
|
|
912
|
+
fitMode?: Fitmode;
|
|
913
|
+
orientation?: Orientation;
|
|
914
|
+
pageSize?: Pagesize;
|
|
915
|
+
scale?: Scale;
|
|
916
|
+
[k: string]: unknown;
|
|
917
|
+
}
|
|
918
|
+
/**
|
|
919
|
+
* Dashboard-level defaults for widget appearance.
|
|
920
|
+
*/
|
|
921
|
+
interface WidgetDefaults$1 {
|
|
922
|
+
echarts?: WidgetTheme$1 | null;
|
|
923
|
+
filter?: WidgetTheme$1 | null;
|
|
924
|
+
global?: WidgetTheme$1 | null;
|
|
925
|
+
image?: WidgetTheme$1 | null;
|
|
926
|
+
kpi?: WidgetTheme$1 | null;
|
|
927
|
+
markdown?: WidgetTheme$1 | null;
|
|
928
|
+
pivot_table?: WidgetTheme$1 | null;
|
|
929
|
+
select?: WidgetTheme$1 | null;
|
|
930
|
+
table?: WidgetTheme$1 | null;
|
|
931
|
+
tabulator?: WidgetTheme$1 | null;
|
|
932
|
+
text?: WidgetTheme$1 | null;
|
|
933
|
+
[k: string]: unknown;
|
|
934
|
+
}
|
|
935
|
+
/**
|
|
936
|
+
* Reusable theme settings for a widget or a default widget group.
|
|
937
|
+
*/
|
|
938
|
+
interface WidgetTheme$1 {
|
|
939
|
+
background?: Background3;
|
|
940
|
+
border?: Border2;
|
|
941
|
+
borderRadius?: Borderradius2;
|
|
942
|
+
margin?: Margin1;
|
|
943
|
+
padding?: Padding5;
|
|
944
|
+
shadow?: Shadow1;
|
|
945
|
+
[k: string]: unknown;
|
|
946
|
+
}
|
|
947
|
+
/**
|
|
948
|
+
* A data-store (warehouse) connection referenced by datasets.
|
|
949
|
+
*/
|
|
950
|
+
interface DataStore {
|
|
951
|
+
ai_context?: AiContext;
|
|
952
|
+
custom_extensions?: CustomExtensions;
|
|
953
|
+
data_model_id?: DataModelId4;
|
|
954
|
+
default?: Default;
|
|
955
|
+
description?: Description1;
|
|
956
|
+
id: Id2;
|
|
957
|
+
name?: Name1;
|
|
958
|
+
vendor?: Vendor;
|
|
959
|
+
[k: string]: unknown;
|
|
960
|
+
}
|
|
961
|
+
/**
|
|
962
|
+
* A reusable semantic dataset: schema/table, dimensions, and metrics.
|
|
963
|
+
*/
|
|
964
|
+
interface Dataset2 {
|
|
965
|
+
ai_context?: AiContext1;
|
|
966
|
+
cache?: DatasetCacheConfig | null;
|
|
967
|
+
custom_extensions?: CustomExtensions1;
|
|
968
|
+
dataStoreId?: DataStoreId;
|
|
969
|
+
dataStoreIds?: DataStoreIds;
|
|
970
|
+
data_model_id?: DataModelId5;
|
|
971
|
+
data_store_id?: DataStoreId1;
|
|
972
|
+
data_store_ids?: DataStoreIds1;
|
|
973
|
+
description?: Description2;
|
|
974
|
+
dimensions?: Dimensions1;
|
|
975
|
+
fields?: Dimensions2;
|
|
976
|
+
filter_field?: FilterField1;
|
|
977
|
+
filter_param?: FilterParam;
|
|
978
|
+
from?: From;
|
|
979
|
+
group_by?: GroupBy;
|
|
980
|
+
id: Id4;
|
|
981
|
+
kpi?: Kpi2;
|
|
982
|
+
materialization?: DatasetMaterialization | null;
|
|
983
|
+
mesh?: MeshPlan | null;
|
|
984
|
+
metrics?: Metrics2;
|
|
985
|
+
name?: Name4;
|
|
986
|
+
params?: Params4;
|
|
987
|
+
primary_key?: PrimaryKey;
|
|
988
|
+
query?: Query2;
|
|
989
|
+
relationships?: Relationships;
|
|
990
|
+
source?: From2;
|
|
991
|
+
source_type?: SourceType;
|
|
992
|
+
unique_keys?: UniqueKeys;
|
|
993
|
+
[k: string]: unknown;
|
|
994
|
+
}
|
|
995
|
+
/**
|
|
996
|
+
* How long a dataset's warehouse results may be reused.
|
|
997
|
+
*/
|
|
998
|
+
interface DatasetCacheConfig {
|
|
999
|
+
enabled?: Enabled1;
|
|
1000
|
+
ttlSeconds?: TtlSeconds;
|
|
1001
|
+
ttl_seconds?: TtlSeconds1;
|
|
1002
|
+
[k: string]: unknown;
|
|
1003
|
+
}
|
|
1004
|
+
/**
|
|
1005
|
+
* A dimension (attribute) inside a Dataset.
|
|
1006
|
+
*/
|
|
1007
|
+
interface Dimension {
|
|
1008
|
+
ai_context?: AiContext2;
|
|
1009
|
+
column?: Column;
|
|
1010
|
+
custom_extensions?: CustomExtensions2;
|
|
1011
|
+
description?: Description3;
|
|
1012
|
+
expression?: Expression;
|
|
1013
|
+
format?: Format;
|
|
1014
|
+
group?: Group;
|
|
1015
|
+
hidden?: Hidden;
|
|
1016
|
+
id: Id3;
|
|
1017
|
+
is_time?: IsTime;
|
|
1018
|
+
label?: Label3;
|
|
1019
|
+
name?: Name2;
|
|
1020
|
+
type?: Type1;
|
|
1021
|
+
[k: string]: unknown;
|
|
1022
|
+
}
|
|
1023
|
+
/**
|
|
1024
|
+
* OSI-style multi-dialect expression block.
|
|
1025
|
+
*
|
|
1026
|
+
* ``dialects`` lists SQL or expression variants per warehouse. ``default`` is
|
|
1027
|
+
* available for row-level formulas or fallback SQL.
|
|
1028
|
+
*/
|
|
1029
|
+
interface Expression1 {
|
|
1030
|
+
default?: Default1;
|
|
1031
|
+
dialects?: Dialects;
|
|
1032
|
+
[k: string]: unknown;
|
|
1033
|
+
}
|
|
1034
|
+
/**
|
|
1035
|
+
* A single dialect expression for a field or metric.
|
|
1036
|
+
*/
|
|
1037
|
+
interface ExpressionDialect {
|
|
1038
|
+
dialect: Dialect;
|
|
1039
|
+
expression: Expression2;
|
|
1040
|
+
[k: string]: unknown;
|
|
1041
|
+
}
|
|
1042
|
+
/**
|
|
1043
|
+
* A pre-aggregated rollup the engine may read instead of the base source.
|
|
1044
|
+
*
|
|
1045
|
+
* ``grain`` lists the dimensions the rollup is aggregated to and ``metrics``
|
|
1046
|
+
* the measures it carries. A widget selection covered by both is answered from
|
|
1047
|
+
* ``source``; anything wider falls back to the dataset's own source, so the
|
|
1048
|
+
* rollup is an optimisation and never changes what a widget can ask for.
|
|
1049
|
+
*/
|
|
1050
|
+
interface DatasetMaterialization {
|
|
1051
|
+
enabled?: Enabled2;
|
|
1052
|
+
grain?: Grain;
|
|
1053
|
+
metrics?: Metrics1;
|
|
1054
|
+
source?: Source;
|
|
1055
|
+
[k: string]: unknown;
|
|
1056
|
+
}
|
|
1057
|
+
/**
|
|
1058
|
+
* How a mesh dataset stitches datasets from different data stores together.
|
|
1059
|
+
*/
|
|
1060
|
+
interface MeshPlan {
|
|
1061
|
+
join?: Join;
|
|
1062
|
+
join_columns?: JoinColumns;
|
|
1063
|
+
max_rows?: MaxRows;
|
|
1064
|
+
parts?: Parts;
|
|
1065
|
+
[k: string]: unknown;
|
|
1066
|
+
}
|
|
1067
|
+
/**
|
|
1068
|
+
* One dataset taking part in a mesh dataset.
|
|
1069
|
+
*/
|
|
1070
|
+
interface MeshPart {
|
|
1071
|
+
dataset: Dataset3;
|
|
1072
|
+
[k: string]: unknown;
|
|
1073
|
+
}
|
|
1074
|
+
/**
|
|
1075
|
+
* A calculated field or metric inside a Dataset.
|
|
1076
|
+
*/
|
|
1077
|
+
interface Metric {
|
|
1078
|
+
ai_context?: AiContext3;
|
|
1079
|
+
custom_extensions?: CustomExtensions3;
|
|
1080
|
+
dependencies?: Dependencies;
|
|
1081
|
+
description?: Description4;
|
|
1082
|
+
expression: Expression3;
|
|
1083
|
+
filter?: Filter1;
|
|
1084
|
+
format?: Format1;
|
|
1085
|
+
group?: Group1;
|
|
1086
|
+
hidden?: Hidden1;
|
|
1087
|
+
id: Id5;
|
|
1088
|
+
label?: Label4;
|
|
1089
|
+
name?: Name3;
|
|
1090
|
+
type?: Type2;
|
|
1091
|
+
[k: string]: unknown;
|
|
1092
|
+
}
|
|
1093
|
+
interface Params4 {
|
|
1094
|
+
[k: string]: JsonValue$1;
|
|
1095
|
+
}
|
|
1096
|
+
/**
|
|
1097
|
+
* A relationship between two datasets (OSI-style join).
|
|
1098
|
+
*/
|
|
1099
|
+
interface Relationship {
|
|
1100
|
+
ai_context?: AiContext4;
|
|
1101
|
+
custom_extensions?: CustomExtensions4;
|
|
1102
|
+
from: From1;
|
|
1103
|
+
from_columns?: FromColumns;
|
|
1104
|
+
name: Name5;
|
|
1105
|
+
relationship?: Relationship1;
|
|
1106
|
+
to: To;
|
|
1107
|
+
to_columns?: ToColumns;
|
|
1108
|
+
[k: string]: unknown;
|
|
1109
|
+
}
|
|
1110
|
+
/**
|
|
1111
|
+
* A reusable named query referenced by widgets.
|
|
1112
|
+
*/
|
|
1113
|
+
interface NamedQuery {
|
|
1114
|
+
data_model_id?: DataModelId6;
|
|
1115
|
+
dimensions?: Dimensions3;
|
|
1116
|
+
file?: File;
|
|
1117
|
+
filter_field?: FilterField2;
|
|
1118
|
+
filters?: Filters2;
|
|
1119
|
+
limit?: Limit;
|
|
1120
|
+
metrics?: Metrics4;
|
|
1121
|
+
model?: Model;
|
|
1122
|
+
params?: Params5;
|
|
1123
|
+
segments?: Segments;
|
|
1124
|
+
sort?: Sort;
|
|
1125
|
+
sql?: Sql;
|
|
1126
|
+
[k: string]: unknown;
|
|
1127
|
+
}
|
|
1128
|
+
interface Params5 {
|
|
1129
|
+
[k: string]: JsonValue$1;
|
|
1130
|
+
}
|
|
1131
|
+
/**
|
|
1132
|
+
* Top-level responsive grid configuration.
|
|
1133
|
+
*/
|
|
1134
|
+
interface DashboardResponsiveConfig {
|
|
1135
|
+
desktop?: BreakpointConfig;
|
|
1136
|
+
mobile?: BreakpointConfig;
|
|
1137
|
+
tablet?: BreakpointConfig;
|
|
1138
|
+
wide?: BreakpointConfig;
|
|
1139
|
+
[k: string]: unknown;
|
|
1140
|
+
}
|
|
1141
|
+
/**
|
|
1142
|
+
* Responsive breakpoint configuration for the dashboard grid.
|
|
1143
|
+
*/
|
|
1144
|
+
interface BreakpointConfig {
|
|
1145
|
+
cols?: Cols;
|
|
1146
|
+
containerPadding?: Containerpadding1;
|
|
1147
|
+
margin?: Margin2;
|
|
1148
|
+
row_height?: RowHeight;
|
|
1149
|
+
[k: string]: unknown;
|
|
1150
|
+
}
|
|
1151
|
+
/**
|
|
1152
|
+
* An OSI semantic model block (data stores, datasets, relationships, metrics).
|
|
1153
|
+
*/
|
|
1154
|
+
interface SemanticModel1 {
|
|
1155
|
+
ai_context?: AiContext5;
|
|
1156
|
+
custom_extensions?: CustomExtensions5;
|
|
1157
|
+
data_stores?: DataStores1;
|
|
1158
|
+
datasets?: Datasets1;
|
|
1159
|
+
description?: Description5;
|
|
1160
|
+
kind?: Kind9;
|
|
1161
|
+
metrics?: Metrics5;
|
|
1162
|
+
name: Name6;
|
|
1163
|
+
relationships?: Relationships2;
|
|
1164
|
+
[k: string]: unknown;
|
|
1165
|
+
}
|
|
1166
|
+
/**
|
|
1167
|
+
* A tab/page inside a dashboard.
|
|
1168
|
+
*/
|
|
1169
|
+
interface DashboardTab {
|
|
1170
|
+
default?: Default2;
|
|
1171
|
+
id: Id6;
|
|
1172
|
+
label: Label5;
|
|
1173
|
+
widgets?: Widgets1;
|
|
1174
|
+
[k: string]: unknown;
|
|
1175
|
+
}
|
|
1176
|
+
/**
|
|
1177
|
+
* A reference to a separate widget YAML file.
|
|
1178
|
+
*/
|
|
1179
|
+
interface WidgetRef {
|
|
1180
|
+
ref: Ref;
|
|
1181
|
+
[k: string]: unknown;
|
|
1182
|
+
}
|
|
1183
|
+
|
|
1184
|
+
type Kind = "widget";
|
|
1185
|
+
type Author = string | null;
|
|
1186
|
+
type Description = string;
|
|
1187
|
+
type Backgroundcolor = string | null;
|
|
1188
|
+
type Border = string | boolean | null;
|
|
1189
|
+
type Borderradius = string | number | null;
|
|
1190
|
+
type Color = string | null;
|
|
1191
|
+
type Fontsize = string | number | null;
|
|
1192
|
+
type Fontweight = string | number | null;
|
|
1193
|
+
type Padding = string | number | null;
|
|
1194
|
+
type Textalign = ("left" | "center" | "right" | "justify") | null;
|
|
1195
|
+
type Title = string | LabelBlock | null;
|
|
1196
|
+
type Icon = string | null;
|
|
1197
|
+
type Position = ("top" | "bottom" | "left" | "right") | null;
|
|
1198
|
+
type Text = string | null;
|
|
1199
|
+
type Tooltip = string | null;
|
|
1200
|
+
type Verticalalign = ("top" | "middle" | "bottom") | null;
|
|
1201
|
+
type Visible = boolean | null;
|
|
1202
|
+
type Id = string;
|
|
1203
|
+
type Name = string;
|
|
1204
|
+
type AllowEmbed = boolean;
|
|
1205
|
+
type Owner = string | null;
|
|
1206
|
+
type Public = boolean;
|
|
1207
|
+
type Roles = string[];
|
|
1208
|
+
type Scope = "org" | "project" | "dashboard" | "widget";
|
|
1209
|
+
type Status = "draft" | "published" | "archived";
|
|
1210
|
+
type Tags = string[];
|
|
1211
|
+
type Version = string;
|
|
1212
|
+
type Tags1 = string[];
|
|
1213
|
+
type Version1 = string;
|
|
1214
|
+
type Field = string;
|
|
1215
|
+
type Operator = "eq" | "in" | "gt" | "lt" | "gte" | "lte" | "contains" | "date" | "between";
|
|
1216
|
+
type Param = string | null;
|
|
1217
|
+
type Target = string;
|
|
1218
|
+
type Bindings = FilterBinding[];
|
|
1219
|
+
type Component = "echarts" | "kpi" | "filter" | "select" | "table" | "tabulator" | "pivot_table" | "text" | "image" | "markdown";
|
|
1220
|
+
type Data = Data1 | null;
|
|
1221
|
+
type Data1 = KpiDataSource | StaticDataSource | DemoDataSource | SqlDataSource | DatasetDataSource | QueryDataSource;
|
|
1222
|
+
type DataModelId = string | null;
|
|
1223
|
+
type Kind1 = "kpi";
|
|
1224
|
+
type Kpi = string;
|
|
1225
|
+
type Labelcolumn = string | null;
|
|
1226
|
+
type JsonValue = unknown;
|
|
1227
|
+
type Valuecolumn = string | null;
|
|
1228
|
+
type Columns = string[] | null;
|
|
1229
|
+
type Kind2 = "static";
|
|
1230
|
+
type Label = string;
|
|
1231
|
+
type Options = StaticOption[];
|
|
1232
|
+
type Rows = {
|
|
1233
|
+
[k: string]: JsonValue;
|
|
1234
|
+
}[];
|
|
1235
|
+
type Columns1 = string[] | null;
|
|
1236
|
+
type Dataset = string | null;
|
|
1237
|
+
type Kind3 = "demo";
|
|
1238
|
+
type Rows1 = number;
|
|
1239
|
+
type Seed = number;
|
|
1240
|
+
type DataModelId1 = string | null;
|
|
1241
|
+
type FilterField = string | null;
|
|
1242
|
+
type Kind4 = "sql";
|
|
1243
|
+
type Query = string;
|
|
1244
|
+
type Columns2 = string[] | null;
|
|
1245
|
+
type DataModelId2 = string | null;
|
|
1246
|
+
type Dataset1 = string;
|
|
1247
|
+
type Dimensions = string[] | null;
|
|
1248
|
+
type Field1 = string;
|
|
1249
|
+
type FilterId = string;
|
|
1250
|
+
type Operator1 = "eq" | "in" | "gt" | "lt" | "gte" | "lte" | "contains" | "date" | "between";
|
|
1251
|
+
type Param1 = string | null;
|
|
1252
|
+
type Filters$1 = IncomingFilter[];
|
|
1253
|
+
type Kind5 = "dataset";
|
|
1254
|
+
type Metrics = string[] | null;
|
|
1255
|
+
type DataModelId3 = string | null;
|
|
1256
|
+
type Kind6 = "query";
|
|
1257
|
+
type Query1 = string;
|
|
1258
|
+
type Background = string | null;
|
|
1259
|
+
type Border1 = string | boolean | null;
|
|
1260
|
+
type Borderradius1 = string | number | null;
|
|
1261
|
+
type Echarts = {
|
|
1262
|
+
[k: string]: JsonValue;
|
|
1263
|
+
} | null;
|
|
1264
|
+
type Filter = {
|
|
1265
|
+
[k: string]: JsonValue;
|
|
1266
|
+
} | null;
|
|
1267
|
+
type Image = {
|
|
1268
|
+
[k: string]: JsonValue;
|
|
1269
|
+
} | null;
|
|
1270
|
+
type Kpi1 = {
|
|
1271
|
+
[k: string]: JsonValue;
|
|
1272
|
+
} | null;
|
|
1273
|
+
type Margin = string | number | null;
|
|
1274
|
+
type Markdown = {
|
|
1275
|
+
[k: string]: JsonValue;
|
|
1276
|
+
} | null;
|
|
1277
|
+
type Padding1 = string | number | null;
|
|
1278
|
+
type PivotTable = {
|
|
1279
|
+
[k: string]: JsonValue;
|
|
1280
|
+
} | null;
|
|
1281
|
+
type Select = {
|
|
1282
|
+
[k: string]: JsonValue;
|
|
1283
|
+
} | null;
|
|
1284
|
+
type Shadow = string | boolean | null;
|
|
1285
|
+
type Table = {
|
|
1286
|
+
[k: string]: JsonValue;
|
|
1287
|
+
} | null;
|
|
1288
|
+
type Tabulator = {
|
|
1289
|
+
[k: string]: JsonValue;
|
|
1290
|
+
} | null;
|
|
1291
|
+
type Text1 = {
|
|
1292
|
+
[k: string]: JsonValue;
|
|
1293
|
+
} | null;
|
|
1294
|
+
type Filters1 = IncomingFilter[];
|
|
1295
|
+
type Id1 = string;
|
|
1296
|
+
type Label1 = string | null;
|
|
1297
|
+
type OpenIn = "modal" | "same" | "new" | "detail";
|
|
1298
|
+
type PassFilters = boolean;
|
|
1299
|
+
type PassSelection = boolean;
|
|
1300
|
+
type Target1 = string;
|
|
1301
|
+
type TargetType = "dashboard" | "url" | "filter" | "dimension";
|
|
1302
|
+
type Type = "drilldown" | "set_filter" | "navigate";
|
|
1303
|
+
type Field2 = string | null;
|
|
1304
|
+
type Kind7 = "event" | "filter" | "literal";
|
|
1305
|
+
type Target2 = string;
|
|
1306
|
+
type TargetType1 = "filter" | "dimension";
|
|
1307
|
+
type VariableMappings = InteractionVariableMapping[];
|
|
1308
|
+
type Interactions = WidgetInteraction[];
|
|
1309
|
+
type H = number;
|
|
1310
|
+
type Isbounded = boolean | null;
|
|
1311
|
+
type Isdraggable = boolean | null;
|
|
1312
|
+
type Isresizable = boolean | null;
|
|
1313
|
+
type Maxh = number | null;
|
|
1314
|
+
type Maxw = number | null;
|
|
1315
|
+
type Minh = number | null;
|
|
1316
|
+
type Minw = number | null;
|
|
1317
|
+
type Resizehandles = string[] | null;
|
|
1318
|
+
type H1 = number;
|
|
1319
|
+
type Isbounded1 = boolean | null;
|
|
1320
|
+
type Isdraggable1 = boolean | null;
|
|
1321
|
+
type Isresizable1 = boolean | null;
|
|
1322
|
+
type Maxh1 = number | null;
|
|
1323
|
+
type Maxw1 = number | null;
|
|
1324
|
+
type Minh1 = number | null;
|
|
1325
|
+
type Minw1 = number | null;
|
|
1326
|
+
type Resizehandles1 = string[] | null;
|
|
1327
|
+
type W = number;
|
|
1328
|
+
type X = number;
|
|
1329
|
+
type Y = number;
|
|
1330
|
+
type Unplaced = boolean | null;
|
|
1331
|
+
type W1 = number;
|
|
1332
|
+
type X1 = number;
|
|
1333
|
+
type Y1 = number;
|
|
1334
|
+
type Category = string | null;
|
|
1335
|
+
type Date = string | null;
|
|
1336
|
+
type Delta = string | null;
|
|
1337
|
+
type Label2 = string | null;
|
|
1338
|
+
type Series = string | null;
|
|
1339
|
+
type SeriesName = string | null;
|
|
1340
|
+
type Value = string | null;
|
|
1341
|
+
type X2 = string | null;
|
|
1342
|
+
type Y2 = string | null;
|
|
1343
|
+
type Version2 = string;
|
|
1344
|
+
/**
|
|
1345
|
+
* Specification for a single widget/object.
|
|
1346
|
+
*/
|
|
1347
|
+
interface WidgetSpec {
|
|
1348
|
+
kind?: Kind;
|
|
1349
|
+
metadata: Metadata;
|
|
1350
|
+
spec: WidgetSpecInner;
|
|
1351
|
+
version?: Version2;
|
|
1352
|
+
[k: string]: unknown;
|
|
1353
|
+
}
|
|
1354
|
+
/**
|
|
1355
|
+
* Common metadata for dashboards and widgets.
|
|
1356
|
+
*/
|
|
1357
|
+
interface Metadata {
|
|
1358
|
+
author?: Author;
|
|
1359
|
+
description?: Description;
|
|
1360
|
+
header?: WidgetHeader | null;
|
|
1361
|
+
id: Id;
|
|
1362
|
+
name: Name;
|
|
1363
|
+
platform?: PlatformAttributes;
|
|
1364
|
+
tags?: Tags1;
|
|
1365
|
+
version?: Version1;
|
|
1366
|
+
[k: string]: unknown;
|
|
1367
|
+
}
|
|
1368
|
+
/**
|
|
1369
|
+
* Object-level header/title configuration for any widget.
|
|
1370
|
+
*/
|
|
1371
|
+
interface WidgetHeader {
|
|
1372
|
+
backgroundColor?: Backgroundcolor;
|
|
1373
|
+
border?: Border;
|
|
1374
|
+
borderRadius?: Borderradius;
|
|
1375
|
+
color?: Color;
|
|
1376
|
+
fontSize?: Fontsize;
|
|
1377
|
+
fontWeight?: Fontweight;
|
|
1378
|
+
padding?: Padding;
|
|
1379
|
+
textAlign?: Textalign;
|
|
1380
|
+
title?: Title;
|
|
1381
|
+
verticalAlign?: Verticalalign;
|
|
1382
|
+
visible?: Visible;
|
|
1383
|
+
[k: string]: unknown;
|
|
1384
|
+
}
|
|
1385
|
+
/**
|
|
1386
|
+
* A rich label with optional tooltip and icon.
|
|
1387
|
+
*/
|
|
1388
|
+
interface LabelBlock {
|
|
1389
|
+
icon?: Icon;
|
|
1390
|
+
position?: Position;
|
|
1391
|
+
text?: Text;
|
|
1392
|
+
tooltip?: Tooltip;
|
|
1393
|
+
[k: string]: unknown;
|
|
1394
|
+
}
|
|
1395
|
+
/**
|
|
1396
|
+
* Cross-cutting platform attributes attached to every dashboard object.
|
|
1397
|
+
*
|
|
1398
|
+
* These attributes control the relationship of the object to the platform,
|
|
1399
|
+
* the dashboard, the user, and security. They are intentionally generic so
|
|
1400
|
+
* the spec can grow into the larger enterprise BI project.
|
|
1401
|
+
*/
|
|
1402
|
+
interface PlatformAttributes {
|
|
1403
|
+
allow_embed?: AllowEmbed;
|
|
1404
|
+
owner?: Owner;
|
|
1405
|
+
public?: Public;
|
|
1406
|
+
roles?: Roles;
|
|
1407
|
+
scope?: Scope;
|
|
1408
|
+
status?: Status;
|
|
1409
|
+
tags?: Tags;
|
|
1410
|
+
version?: Version;
|
|
1411
|
+
[k: string]: unknown;
|
|
1412
|
+
}
|
|
1413
|
+
/**
|
|
1414
|
+
* Inner spec body of a widget.
|
|
1415
|
+
*/
|
|
1416
|
+
interface WidgetSpecInner {
|
|
1417
|
+
bindings?: Bindings;
|
|
1418
|
+
component?: Component;
|
|
1419
|
+
data?: Data;
|
|
1420
|
+
display?: WidgetDisplay;
|
|
1421
|
+
filters?: Filters1;
|
|
1422
|
+
interactions?: Interactions;
|
|
1423
|
+
layout?: WidgetLayout;
|
|
1424
|
+
mappings?: FieldMapping;
|
|
1425
|
+
[k: string]: unknown;
|
|
1426
|
+
}
|
|
1427
|
+
/**
|
|
1428
|
+
* How a filter widget is wired to a target widget.
|
|
1429
|
+
*/
|
|
1430
|
+
interface FilterBinding {
|
|
1431
|
+
field: Field;
|
|
1432
|
+
operator?: Operator;
|
|
1433
|
+
param?: Param;
|
|
1434
|
+
target?: Target;
|
|
1435
|
+
[k: string]: unknown;
|
|
1436
|
+
}
|
|
1437
|
+
/**
|
|
1438
|
+
* Run a KPI from the catalog.
|
|
1439
|
+
*/
|
|
1440
|
+
interface KpiDataSource {
|
|
1441
|
+
data_model_id?: DataModelId;
|
|
1442
|
+
kind?: Kind1;
|
|
1443
|
+
kpi: Kpi;
|
|
1444
|
+
labelColumn?: Labelcolumn;
|
|
1445
|
+
params?: Params;
|
|
1446
|
+
valueColumn?: Valuecolumn;
|
|
1447
|
+
[k: string]: unknown;
|
|
1448
|
+
}
|
|
1449
|
+
interface Params {
|
|
1450
|
+
[k: string]: JsonValue;
|
|
1451
|
+
}
|
|
1452
|
+
/**
|
|
1453
|
+
* Static data supplied inline in the spec.
|
|
1454
|
+
*/
|
|
1455
|
+
interface StaticDataSource {
|
|
1456
|
+
columns?: Columns;
|
|
1457
|
+
default_value?: {
|
|
1458
|
+
[k: string]: unknown;
|
|
1459
|
+
};
|
|
1460
|
+
kind?: Kind2;
|
|
1461
|
+
options?: Options;
|
|
1462
|
+
rows?: Rows;
|
|
1463
|
+
[k: string]: unknown;
|
|
1464
|
+
}
|
|
1465
|
+
/**
|
|
1466
|
+
* A single option for a static select or filter.
|
|
1467
|
+
*/
|
|
1468
|
+
interface StaticOption {
|
|
1469
|
+
label: Label;
|
|
1470
|
+
value: JsonValue;
|
|
1471
|
+
[k: string]: unknown;
|
|
1472
|
+
}
|
|
1473
|
+
/**
|
|
1474
|
+
* Deterministic generated data for testing and previews.
|
|
1475
|
+
*/
|
|
1476
|
+
interface DemoDataSource {
|
|
1477
|
+
columns?: Columns1;
|
|
1478
|
+
dataset?: Dataset;
|
|
1479
|
+
kind?: Kind3;
|
|
1480
|
+
rows?: Rows1;
|
|
1481
|
+
seed?: Seed;
|
|
1482
|
+
[k: string]: unknown;
|
|
1483
|
+
}
|
|
1484
|
+
/**
|
|
1485
|
+
* Run an arbitrary SQL query against the configured data store.
|
|
1486
|
+
*/
|
|
1487
|
+
interface SqlDataSource {
|
|
1488
|
+
data_model_id?: DataModelId1;
|
|
1489
|
+
filter_field?: FilterField;
|
|
1490
|
+
kind?: Kind4;
|
|
1491
|
+
params?: Params1;
|
|
1492
|
+
query: Query;
|
|
1493
|
+
[k: string]: unknown;
|
|
1494
|
+
}
|
|
1495
|
+
interface Params1 {
|
|
1496
|
+
[k: string]: JsonValue;
|
|
1497
|
+
}
|
|
1498
|
+
/**
|
|
1499
|
+
* Reference a reusable Dataset defined in the dashboard manifest.
|
|
1500
|
+
*/
|
|
1501
|
+
interface DatasetDataSource {
|
|
1502
|
+
columns?: Columns2;
|
|
1503
|
+
data_model_id?: DataModelId2;
|
|
1504
|
+
dataset: Dataset1;
|
|
1505
|
+
dimensions?: Dimensions;
|
|
1506
|
+
filters?: Filters$1;
|
|
1507
|
+
kind?: Kind5;
|
|
1508
|
+
metrics?: Metrics;
|
|
1509
|
+
params?: Params2;
|
|
1510
|
+
[k: string]: unknown;
|
|
1511
|
+
}
|
|
1512
|
+
/**
|
|
1513
|
+
* How a target widget or dataset applies a filter broadcast from the dashboard.
|
|
1514
|
+
*/
|
|
1515
|
+
interface IncomingFilter {
|
|
1516
|
+
field: Field1;
|
|
1517
|
+
filter_id: FilterId;
|
|
1518
|
+
operator?: Operator1;
|
|
1519
|
+
param?: Param1;
|
|
1520
|
+
[k: string]: unknown;
|
|
1521
|
+
}
|
|
1522
|
+
interface Params2 {
|
|
1523
|
+
[k: string]: JsonValue;
|
|
1524
|
+
}
|
|
1525
|
+
/**
|
|
1526
|
+
* Reference a named query defined in the dashboard manifest.
|
|
1527
|
+
*/
|
|
1528
|
+
interface QueryDataSource {
|
|
1529
|
+
data_model_id?: DataModelId3;
|
|
1530
|
+
kind?: Kind6;
|
|
1531
|
+
params?: Params3;
|
|
1532
|
+
query: Query1;
|
|
1533
|
+
[k: string]: unknown;
|
|
1534
|
+
}
|
|
1535
|
+
interface Params3 {
|
|
1536
|
+
[k: string]: JsonValue;
|
|
1537
|
+
}
|
|
1538
|
+
/**
|
|
1539
|
+
* Display-specific configuration.
|
|
1540
|
+
*/
|
|
1541
|
+
interface WidgetDisplay {
|
|
1542
|
+
background?: Background;
|
|
1543
|
+
border?: Border1;
|
|
1544
|
+
borderRadius?: Borderradius1;
|
|
1545
|
+
echarts?: Echarts;
|
|
1546
|
+
filter?: Filter;
|
|
1547
|
+
image?: Image;
|
|
1548
|
+
kpi?: Kpi1;
|
|
1549
|
+
margin?: Margin;
|
|
1550
|
+
markdown?: Markdown;
|
|
1551
|
+
padding?: Padding1;
|
|
1552
|
+
pivot_table?: PivotTable;
|
|
1553
|
+
select?: Select;
|
|
1554
|
+
shadow?: Shadow;
|
|
1555
|
+
table?: Table;
|
|
1556
|
+
tabulator?: Tabulator;
|
|
1557
|
+
text?: Text1;
|
|
1558
|
+
[k: string]: unknown;
|
|
1559
|
+
}
|
|
1560
|
+
/**
|
|
1561
|
+
* A user-driven interaction on a widget.
|
|
1562
|
+
*/
|
|
1563
|
+
interface WidgetInteraction {
|
|
1564
|
+
id: Id1;
|
|
1565
|
+
label?: Label1;
|
|
1566
|
+
open_in?: OpenIn;
|
|
1567
|
+
pass_filters?: PassFilters;
|
|
1568
|
+
pass_selection?: PassSelection;
|
|
1569
|
+
target: Target1;
|
|
1570
|
+
target_type?: TargetType;
|
|
1571
|
+
type: Type;
|
|
1572
|
+
variable_mappings?: VariableMappings;
|
|
1573
|
+
[k: string]: unknown;
|
|
1574
|
+
}
|
|
1575
|
+
/**
|
|
1576
|
+
* Map a source value (event, filter, or literal) to a target filter/variable.
|
|
1577
|
+
*/
|
|
1578
|
+
interface InteractionVariableMapping {
|
|
1579
|
+
source?: InteractionVariableSource;
|
|
1580
|
+
target: Target2;
|
|
1581
|
+
target_type?: TargetType1;
|
|
1582
|
+
[k: string]: unknown;
|
|
1583
|
+
}
|
|
1584
|
+
/**
|
|
1585
|
+
* Source of a value for an interaction variable mapping.
|
|
1586
|
+
*/
|
|
1587
|
+
interface InteractionVariableSource {
|
|
1588
|
+
field?: Field2;
|
|
1589
|
+
kind?: Kind7;
|
|
1590
|
+
value?: unknown;
|
|
1591
|
+
[k: string]: unknown;
|
|
1592
|
+
}
|
|
1593
|
+
/**
|
|
1594
|
+
* Layout configuration for a widget.
|
|
1595
|
+
*/
|
|
1596
|
+
interface WidgetLayout {
|
|
1597
|
+
h?: H;
|
|
1598
|
+
isBounded?: Isbounded;
|
|
1599
|
+
isDraggable?: Isdraggable;
|
|
1600
|
+
isResizable?: Isresizable;
|
|
1601
|
+
maxH?: Maxh;
|
|
1602
|
+
maxW?: Maxw;
|
|
1603
|
+
minH?: Minh;
|
|
1604
|
+
minW?: Minw;
|
|
1605
|
+
resizeHandles?: Resizehandles;
|
|
1606
|
+
responsive?: ResponsiveLayout;
|
|
1607
|
+
unplaced?: Unplaced;
|
|
1608
|
+
w?: W1;
|
|
1609
|
+
x?: X1;
|
|
1610
|
+
y?: Y1;
|
|
1611
|
+
[k: string]: unknown;
|
|
1612
|
+
}
|
|
1613
|
+
/**
|
|
1614
|
+
* Responsive overrides for a layout item.
|
|
1615
|
+
*/
|
|
1616
|
+
interface ResponsiveLayout {
|
|
1617
|
+
desktop?: LayoutItem$1 | null;
|
|
1618
|
+
mobile?: LayoutItem$1 | null;
|
|
1619
|
+
tablet?: LayoutItem$1 | null;
|
|
1620
|
+
wide?: LayoutItem$1 | null;
|
|
1621
|
+
[k: string]: unknown;
|
|
1622
|
+
}
|
|
1623
|
+
/**
|
|
1624
|
+
* A single position/size entry in a responsive grid.
|
|
1625
|
+
*/
|
|
1626
|
+
interface LayoutItem$1 {
|
|
1627
|
+
h?: H1;
|
|
1628
|
+
isBounded?: Isbounded1;
|
|
1629
|
+
isDraggable?: Isdraggable1;
|
|
1630
|
+
isResizable?: Isresizable1;
|
|
1631
|
+
maxH?: Maxh1;
|
|
1632
|
+
maxW?: Maxw1;
|
|
1633
|
+
minH?: Minh1;
|
|
1634
|
+
minW?: Minw1;
|
|
1635
|
+
resizeHandles?: Resizehandles1;
|
|
1636
|
+
w?: W;
|
|
1637
|
+
x?: X;
|
|
1638
|
+
y?: Y;
|
|
1639
|
+
[k: string]: unknown;
|
|
1640
|
+
}
|
|
1641
|
+
/**
|
|
1642
|
+
* Map widget fields to columns in the data source.
|
|
1643
|
+
*/
|
|
1644
|
+
interface FieldMapping {
|
|
1645
|
+
category?: Category;
|
|
1646
|
+
date?: Date;
|
|
1647
|
+
delta?: Delta;
|
|
1648
|
+
label?: Label2;
|
|
1649
|
+
series?: Series;
|
|
1650
|
+
series_name?: SeriesName;
|
|
1651
|
+
value?: Value;
|
|
1652
|
+
x?: X2;
|
|
1653
|
+
y?: Y2;
|
|
1654
|
+
[k: string]: unknown;
|
|
1655
|
+
}
|
|
1656
|
+
|
|
1657
|
+
type Breakpoint = "mobile" | "tablet" | "desktop" | "wide";
|
|
1658
|
+
type ResizeHandle = "s" | "w" | "e" | "n" | "sw" | "nw" | "se" | "ne";
|
|
1659
|
+
interface LayoutItem {
|
|
1660
|
+
i: string;
|
|
1661
|
+
x: number;
|
|
1662
|
+
y: number;
|
|
1663
|
+
w: number;
|
|
1664
|
+
h: number;
|
|
1665
|
+
minW?: number;
|
|
1666
|
+
maxW?: number;
|
|
1667
|
+
minH?: number;
|
|
1668
|
+
maxH?: number;
|
|
1669
|
+
isBounded?: boolean;
|
|
1670
|
+
isDraggable?: boolean;
|
|
1671
|
+
isResizable?: boolean;
|
|
1672
|
+
resizeHandles?: ResizeHandle[];
|
|
1673
|
+
}
|
|
1674
|
+
type ResponsiveLayouts = Record<string, LayoutItem[] | null | undefined>;
|
|
1675
|
+
interface DashboardModelMetricDiagnostic {
|
|
1676
|
+
metric: Record<string, unknown>;
|
|
1677
|
+
dialect: string;
|
|
1678
|
+
resolved_expression: string;
|
|
1679
|
+
dependencies: string[];
|
|
1680
|
+
dataset_ids?: string[];
|
|
1681
|
+
sample_query: string | null;
|
|
1682
|
+
issues: string[];
|
|
1683
|
+
}
|
|
1684
|
+
interface DashboardModelDataStoreDiagnostic {
|
|
1685
|
+
id: string;
|
|
1686
|
+
name: string | null;
|
|
1687
|
+
vendor: string | null;
|
|
1688
|
+
data_model_id: string | null;
|
|
1689
|
+
default: boolean;
|
|
1690
|
+
dialect: string;
|
|
1691
|
+
dataset_ids: string[];
|
|
1692
|
+
issues: string[];
|
|
1693
|
+
notes?: string[];
|
|
1694
|
+
}
|
|
1695
|
+
interface DashboardModelDatasetDiagnostic {
|
|
1696
|
+
id: string;
|
|
1697
|
+
name: string | null;
|
|
1698
|
+
data_store_id: string | null;
|
|
1699
|
+
resolved_data_store_id: string | null;
|
|
1700
|
+
data_model_id: string | null;
|
|
1701
|
+
source_type: string | null;
|
|
1702
|
+
source: string | null;
|
|
1703
|
+
dialect: string;
|
|
1704
|
+
dimension_ids: string[];
|
|
1705
|
+
metric_ids: string[];
|
|
1706
|
+
filter_field: string | null;
|
|
1707
|
+
sample_sql: string | null;
|
|
1708
|
+
issues: string[];
|
|
1709
|
+
}
|
|
1710
|
+
interface DashboardModelRelationshipDiagnostic {
|
|
1711
|
+
name: string;
|
|
1712
|
+
from: string;
|
|
1713
|
+
to: string;
|
|
1714
|
+
from_columns: string[];
|
|
1715
|
+
to_columns: string[];
|
|
1716
|
+
relationship: string | null;
|
|
1717
|
+
issues: string[];
|
|
1718
|
+
}
|
|
1719
|
+
interface DashboardModelAiGrounding {
|
|
1720
|
+
dataset_count: number;
|
|
1721
|
+
metric_count: number;
|
|
1722
|
+
preview: string;
|
|
1723
|
+
}
|
|
1724
|
+
interface DashboardModelDiagnostics {
|
|
1725
|
+
model: {
|
|
1726
|
+
name: string;
|
|
1727
|
+
description: string | null;
|
|
1728
|
+
dialect: string;
|
|
1729
|
+
issues: string[];
|
|
1730
|
+
};
|
|
1731
|
+
data_stores: DashboardModelDataStoreDiagnostic[];
|
|
1732
|
+
datasets: DashboardModelDatasetDiagnostic[];
|
|
1733
|
+
relationships: DashboardModelRelationshipDiagnostic[];
|
|
1734
|
+
metrics: DashboardModelMetricDiagnostic[];
|
|
1735
|
+
/** Present only where the host grounds an assistant on the model. */
|
|
1736
|
+
ai_grounding?: DashboardModelAiGrounding;
|
|
1737
|
+
}
|
|
1738
|
+
|
|
1739
|
+
interface WidgetInteractionContext {
|
|
1740
|
+
widgetId: string;
|
|
1741
|
+
data?: Record<string, unknown>;
|
|
1742
|
+
value?: unknown;
|
|
1743
|
+
}
|
|
1744
|
+
|
|
1745
|
+
/**
|
|
1746
|
+
* Put semantic model problems on the line that causes them.
|
|
1747
|
+
*
|
|
1748
|
+
* Diagnostics come back keyed by object id ("dataset daily_sales: ..."), which
|
|
1749
|
+
* leaves the reader to find `daily_sales` in a few hundred lines of YAML by eye.
|
|
1750
|
+
* These helpers locate the node that declares each id and turn the issues into
|
|
1751
|
+
* editor markers, so a problem is underlined where it lives.
|
|
1752
|
+
*/
|
|
1753
|
+
|
|
1754
|
+
type ModelMarkerSeverity = "error" | "warning" | "info";
|
|
1755
|
+
interface ModelMarker {
|
|
1756
|
+
/** 1-based, as common code editors count. */
|
|
1757
|
+
startLineNumber: number;
|
|
1758
|
+
startColumn: number;
|
|
1759
|
+
endLineNumber: number;
|
|
1760
|
+
endColumn: number;
|
|
1761
|
+
message: string;
|
|
1762
|
+
severity: ModelMarkerSeverity;
|
|
1763
|
+
}
|
|
1764
|
+
|
|
1765
|
+
type ChartOption = Record<string, unknown>;
|
|
1766
|
+
type DataRow = Record<string, unknown>;
|
|
1767
|
+
type WidgetResult = Record<string, unknown>;
|
|
1768
|
+
type WidgetComponent = "echarts" | "kpi" | "filter" | "select" | "table" | "tabulator" | "pivot_table" | "text" | "image" | "markdown";
|
|
1769
|
+
interface RendererLabel {
|
|
1770
|
+
text?: string;
|
|
1771
|
+
position: "top" | "bottom";
|
|
1772
|
+
tooltip?: string;
|
|
1773
|
+
tooltipIcon?: "info" | "check" | "help" | "warning";
|
|
1774
|
+
}
|
|
1775
|
+
interface WidgetTheme {
|
|
1776
|
+
padding?: string | number;
|
|
1777
|
+
margin?: string | number;
|
|
1778
|
+
borderRadius?: string | number;
|
|
1779
|
+
background?: string;
|
|
1780
|
+
border?: string | boolean;
|
|
1781
|
+
shadow?: string | boolean;
|
|
1782
|
+
}
|
|
1783
|
+
type WidgetDefaults = Partial<Record<WidgetComponent | "global", WidgetTheme>>;
|
|
1784
|
+
interface RendererFrame {
|
|
1785
|
+
widgetId: string;
|
|
1786
|
+
component: string;
|
|
1787
|
+
theme: WidgetTheme;
|
|
1788
|
+
showObjectHeader: boolean;
|
|
1789
|
+
label?: RendererLabel;
|
|
1790
|
+
interactive: boolean;
|
|
1791
|
+
}
|
|
1792
|
+
interface KpiDeltaModel {
|
|
1793
|
+
value: number;
|
|
1794
|
+
formattedValue: string;
|
|
1795
|
+
tone: "up" | "down" | "flat";
|
|
1796
|
+
icon: "up" | "down" | "neutral" | "none";
|
|
1797
|
+
comparedWith?: string;
|
|
1798
|
+
tooltip?: string;
|
|
1799
|
+
tooltipIcon?: "info" | "check" | "help" | "warning";
|
|
1800
|
+
color?: string;
|
|
1801
|
+
reference?: {
|
|
1802
|
+
value: number;
|
|
1803
|
+
formattedValue: string;
|
|
1804
|
+
};
|
|
1805
|
+
}
|
|
1806
|
+
interface KpiValueFormat {
|
|
1807
|
+
format: string;
|
|
1808
|
+
prefix: string;
|
|
1809
|
+
suffix: string;
|
|
1810
|
+
compact: boolean;
|
|
1811
|
+
decimals?: number;
|
|
1812
|
+
}
|
|
1813
|
+
interface KpiRendererModel {
|
|
1814
|
+
kind: "kpi";
|
|
1815
|
+
frame: RendererFrame;
|
|
1816
|
+
value: number;
|
|
1817
|
+
formattedValue: string;
|
|
1818
|
+
settledValue: string;
|
|
1819
|
+
/** How the value was formatted, so a host can format intermediate values the same way. */
|
|
1820
|
+
valueFormat: KpiValueFormat;
|
|
1821
|
+
delta?: KpiDeltaModel;
|
|
1822
|
+
note?: string;
|
|
1823
|
+
}
|
|
1824
|
+
interface ChartRendererModel {
|
|
1825
|
+
kind: "chart";
|
|
1826
|
+
frame: RendererFrame;
|
|
1827
|
+
option: ChartOption;
|
|
1828
|
+
axisKey: string;
|
|
1829
|
+
structureKey: string;
|
|
1830
|
+
loading: boolean;
|
|
1831
|
+
}
|
|
1832
|
+
interface TextRendererStyle {
|
|
1833
|
+
textAlign: "left" | "center" | "right" | "justify";
|
|
1834
|
+
verticalAlign: "top" | "middle" | "bottom";
|
|
1835
|
+
fontSize?: string | number;
|
|
1836
|
+
fontWeight?: string | number;
|
|
1837
|
+
color?: string;
|
|
1838
|
+
lineHeight?: string | number;
|
|
1839
|
+
letterSpacing?: string | number;
|
|
1840
|
+
whiteSpace?: "normal" | "nowrap" | "pre" | "pre-wrap" | "pre-line";
|
|
1841
|
+
truncate: boolean;
|
|
1842
|
+
custom: Record<string, string | number>;
|
|
1843
|
+
}
|
|
1844
|
+
interface TextRendererModel {
|
|
1845
|
+
kind: "text";
|
|
1846
|
+
frame: RendererFrame;
|
|
1847
|
+
content: string;
|
|
1848
|
+
contentFormat: "text" | "markdown";
|
|
1849
|
+
style: TextRendererStyle;
|
|
1850
|
+
}
|
|
1851
|
+
interface MarkdownRendererModel {
|
|
1852
|
+
kind: "markdown";
|
|
1853
|
+
frame: RendererFrame;
|
|
1854
|
+
content: string;
|
|
1855
|
+
}
|
|
1856
|
+
interface ImageRendererModel {
|
|
1857
|
+
kind: "image";
|
|
1858
|
+
frame: RendererFrame;
|
|
1859
|
+
source: string | null;
|
|
1860
|
+
alt: string;
|
|
1861
|
+
objectFit: "cover" | "contain";
|
|
1862
|
+
}
|
|
1863
|
+
type SortDirection = "asc" | "desc";
|
|
1864
|
+
interface TableSortState {
|
|
1865
|
+
column: string;
|
|
1866
|
+
direction: SortDirection;
|
|
1867
|
+
}
|
|
1868
|
+
interface TableExportModel {
|
|
1869
|
+
csv: boolean;
|
|
1870
|
+
excel: boolean;
|
|
1871
|
+
filename: string;
|
|
1872
|
+
}
|
|
1873
|
+
interface TableColumnModel {
|
|
1874
|
+
field: string;
|
|
1875
|
+
title: string;
|
|
1876
|
+
sortable: boolean;
|
|
1877
|
+
sortDirection: SortDirection | null;
|
|
1878
|
+
}
|
|
1879
|
+
interface TableCellModel {
|
|
1880
|
+
field: string;
|
|
1881
|
+
value: unknown;
|
|
1882
|
+
text: string;
|
|
1883
|
+
}
|
|
1884
|
+
interface TableRowModel {
|
|
1885
|
+
key: number;
|
|
1886
|
+
data: DataRow;
|
|
1887
|
+
cells: TableCellModel[];
|
|
1888
|
+
}
|
|
1889
|
+
interface TableRendererModel {
|
|
1890
|
+
kind: "table";
|
|
1891
|
+
frame: RendererFrame;
|
|
1892
|
+
columns: TableColumnModel[];
|
|
1893
|
+
rows: TableRowModel[];
|
|
1894
|
+
allRows: DataRow[];
|
|
1895
|
+
page: number;
|
|
1896
|
+
pageSize: number;
|
|
1897
|
+
pageCount: number;
|
|
1898
|
+
totalRows: number;
|
|
1899
|
+
sort: TableSortState | null;
|
|
1900
|
+
exports: TableExportModel;
|
|
1901
|
+
}
|
|
1902
|
+
type GridColumnFormatterModel = {
|
|
1903
|
+
kind: "percent";
|
|
1904
|
+
precision: number;
|
|
1905
|
+
params: Record<string, unknown>;
|
|
1906
|
+
} | {
|
|
1907
|
+
kind: "named";
|
|
1908
|
+
name: string;
|
|
1909
|
+
params: Record<string, unknown>;
|
|
1910
|
+
};
|
|
1911
|
+
interface GridColumnModel {
|
|
1912
|
+
field: string;
|
|
1913
|
+
title: string;
|
|
1914
|
+
frozen: boolean;
|
|
1915
|
+
headerSort: boolean;
|
|
1916
|
+
formatter?: GridColumnFormatterModel;
|
|
1917
|
+
width?: number | string;
|
|
1918
|
+
headerTooltip?: string;
|
|
1919
|
+
sorter?: string;
|
|
1920
|
+
}
|
|
1921
|
+
interface GridOptionsModel {
|
|
1922
|
+
layout: "fitColumns" | "fitData" | "fitDataFill";
|
|
1923
|
+
pagination: boolean;
|
|
1924
|
+
pageSize?: number;
|
|
1925
|
+
groupBy?: string;
|
|
1926
|
+
groupStartOpen: boolean;
|
|
1927
|
+
sortable: boolean;
|
|
1928
|
+
}
|
|
1929
|
+
interface TabulatorRendererModel {
|
|
1930
|
+
kind: "tabulator";
|
|
1931
|
+
frame: RendererFrame;
|
|
1932
|
+
columns: GridColumnModel[];
|
|
1933
|
+
rows: DataRow[];
|
|
1934
|
+
options: GridOptionsModel;
|
|
1935
|
+
exports: TableExportModel;
|
|
1936
|
+
}
|
|
1937
|
+
type PivotAggregation = "sum" | "avg" | "min" | "max" | "count" | "count_distinct";
|
|
1938
|
+
interface PivotFieldPayload {
|
|
1939
|
+
key: string;
|
|
1940
|
+
label: string;
|
|
1941
|
+
}
|
|
1942
|
+
interface PivotMeasurePayload {
|
|
1943
|
+
key: string;
|
|
1944
|
+
label: string;
|
|
1945
|
+
agg: PivotAggregation;
|
|
1946
|
+
format: "number" | "currency" | "percent" | null;
|
|
1947
|
+
decimals: number | null;
|
|
1948
|
+
}
|
|
1949
|
+
interface PivotColumnNode {
|
|
1950
|
+
key: string;
|
|
1951
|
+
label: string;
|
|
1952
|
+
column: string | null;
|
|
1953
|
+
measure: string | null;
|
|
1954
|
+
is_total: boolean;
|
|
1955
|
+
is_group_total: boolean;
|
|
1956
|
+
children: PivotColumnNode[];
|
|
1957
|
+
}
|
|
1958
|
+
type PivotRowKind = "group" | "leaf" | "other" | "grand_total";
|
|
1959
|
+
type PivotDirection = "asc" | "desc";
|
|
1960
|
+
interface PivotRowPayload {
|
|
1961
|
+
key: string;
|
|
1962
|
+
label: string;
|
|
1963
|
+
path: string[];
|
|
1964
|
+
depth: number;
|
|
1965
|
+
kind: PivotRowKind;
|
|
1966
|
+
cells: Record<string, number | null>;
|
|
1967
|
+
}
|
|
1968
|
+
interface PivotTablePayload {
|
|
1969
|
+
row_fields: PivotFieldPayload[];
|
|
1970
|
+
column_fields: PivotFieldPayload[];
|
|
1971
|
+
measures: PivotMeasurePayload[];
|
|
1972
|
+
column_tree: PivotColumnNode[];
|
|
1973
|
+
column_keys: string[];
|
|
1974
|
+
column_labels: Record<string, string>;
|
|
1975
|
+
rows: PivotRowPayload[];
|
|
1976
|
+
total_row: PivotRowPayload | null;
|
|
1977
|
+
value_range: Record<string, {
|
|
1978
|
+
min: number;
|
|
1979
|
+
max: number;
|
|
1980
|
+
}>;
|
|
1981
|
+
empty_value: string;
|
|
1982
|
+
subtotals: "expanded" | "collapsed" | "none";
|
|
1983
|
+
heatmap_measure: string | null;
|
|
1984
|
+
snapshot_expand: number | null;
|
|
1985
|
+
snapshot_expand_columns?: number | null;
|
|
1986
|
+
sort: {
|
|
1987
|
+
column: string | null;
|
|
1988
|
+
measure: string | null;
|
|
1989
|
+
direction: PivotDirection;
|
|
1990
|
+
};
|
|
1991
|
+
truncated: {
|
|
1992
|
+
row_groups: number;
|
|
1993
|
+
row_groups_total: number;
|
|
1994
|
+
rolled_up: number;
|
|
1995
|
+
columns: number;
|
|
1996
|
+
columns_total: number;
|
|
1997
|
+
};
|
|
1998
|
+
fields: {
|
|
1999
|
+
dimensions: PivotFieldPayload[];
|
|
2000
|
+
measures: PivotFieldPayload[];
|
|
2001
|
+
};
|
|
2002
|
+
explore: boolean;
|
|
2003
|
+
explored: boolean;
|
|
2004
|
+
source?: {
|
|
2005
|
+
records: (string | number | null)[][];
|
|
2006
|
+
};
|
|
2007
|
+
}
|
|
2008
|
+
interface PivotDetailColumn {
|
|
2009
|
+
key: string;
|
|
2010
|
+
label: string;
|
|
2011
|
+
}
|
|
2012
|
+
interface PivotDetailResult {
|
|
2013
|
+
component: "pivot_detail";
|
|
2014
|
+
columns: PivotDetailColumn[];
|
|
2015
|
+
rows: DataRow[];
|
|
2016
|
+
row_count: number;
|
|
2017
|
+
truncated: boolean;
|
|
2018
|
+
}
|
|
2019
|
+
declare const PIVOT_META_PROP = "__pivotMeta";
|
|
2020
|
+
interface PivotGridRowMeta {
|
|
2021
|
+
key: string;
|
|
2022
|
+
label: string;
|
|
2023
|
+
path: string[];
|
|
2024
|
+
depth: number;
|
|
2025
|
+
kind: PivotRowKind;
|
|
2026
|
+
}
|
|
2027
|
+
interface PivotGridRow {
|
|
2028
|
+
[PIVOT_META_PROP]: PivotGridRowMeta;
|
|
2029
|
+
[prop: string]: string | number | null | PivotGridRowMeta;
|
|
2030
|
+
}
|
|
2031
|
+
interface PivotGridColumn {
|
|
2032
|
+
prop: string;
|
|
2033
|
+
name: string;
|
|
2034
|
+
columnKey: string | null;
|
|
2035
|
+
measure: string | null;
|
|
2036
|
+
isTotal: boolean;
|
|
2037
|
+
isRowField: boolean;
|
|
2038
|
+
pinStart: boolean;
|
|
2039
|
+
}
|
|
2040
|
+
interface PivotGridColumnGroup {
|
|
2041
|
+
name: string;
|
|
2042
|
+
key: string;
|
|
2043
|
+
foldable: boolean;
|
|
2044
|
+
folded: boolean;
|
|
2045
|
+
leafCount: number;
|
|
2046
|
+
children: PivotGridColumnDefinition[];
|
|
2047
|
+
}
|
|
2048
|
+
type PivotGridColumnDefinition = PivotGridColumn | PivotGridColumnGroup;
|
|
2049
|
+
interface PivotSortState {
|
|
2050
|
+
column: string;
|
|
2051
|
+
direction: PivotDirection;
|
|
2052
|
+
}
|
|
2053
|
+
type PivotFilterOp = "gte" | "gt" | "eq" | "lte" | "lt";
|
|
2054
|
+
interface PivotColumnFilter {
|
|
2055
|
+
op: PivotFilterOp;
|
|
2056
|
+
value: number;
|
|
2057
|
+
}
|
|
2058
|
+
interface PivotViewState {
|
|
2059
|
+
collapsed: ReadonlySet<string>;
|
|
2060
|
+
collapsedColumns: ReadonlySet<string>;
|
|
2061
|
+
search: string;
|
|
2062
|
+
filters: Readonly<Record<string, PivotColumnFilter>>;
|
|
2063
|
+
sort: PivotSortState | null;
|
|
2064
|
+
}
|
|
2065
|
+
interface PivotOpenLevels {
|
|
2066
|
+
rows: number | null;
|
|
2067
|
+
columns: number | null;
|
|
2068
|
+
}
|
|
2069
|
+
interface PivotControlsModel {
|
|
2070
|
+
searchPlaceholder: string;
|
|
2071
|
+
expandable: boolean;
|
|
2072
|
+
groupCount: number;
|
|
2073
|
+
filterCount: number;
|
|
2074
|
+
reordered: boolean;
|
|
2075
|
+
canFilter: true;
|
|
2076
|
+
canRearrange: false;
|
|
2077
|
+
embedded: boolean;
|
|
2078
|
+
}
|
|
2079
|
+
interface MissingPivotRendererModel {
|
|
2080
|
+
kind: "pivot";
|
|
2081
|
+
status: "missing";
|
|
2082
|
+
frame: RendererFrame;
|
|
2083
|
+
message: "This widget did not return a pivot table.";
|
|
2084
|
+
}
|
|
2085
|
+
interface ReadyPivotRendererModel {
|
|
2086
|
+
kind: "pivot";
|
|
2087
|
+
status: "ready";
|
|
2088
|
+
frame: RendererFrame;
|
|
2089
|
+
payload: PivotTablePayload;
|
|
2090
|
+
view: PivotViewState;
|
|
2091
|
+
columns: PivotGridColumnDefinition[];
|
|
2092
|
+
rows: PivotGridRow[];
|
|
2093
|
+
totalRow: PivotGridRow | null;
|
|
2094
|
+
valueColumns: PivotFieldPayload[];
|
|
2095
|
+
columnGroups: PivotFieldPayload[];
|
|
2096
|
+
truncation: string | null;
|
|
2097
|
+
controls: PivotControlsModel;
|
|
2098
|
+
exports: TableExportModel;
|
|
2099
|
+
openLevels: PivotOpenLevels;
|
|
2100
|
+
}
|
|
2101
|
+
type PivotRendererModel = MissingPivotRendererModel | ReadyPivotRendererModel;
|
|
2102
|
+
interface UnknownRendererModel {
|
|
2103
|
+
kind: "unknown";
|
|
2104
|
+
frame: RendererFrame;
|
|
2105
|
+
message: "Unknown widget type";
|
|
2106
|
+
}
|
|
2107
|
+
interface ExtensionRendererModel {
|
|
2108
|
+
kind: "extension";
|
|
2109
|
+
frame: RendererFrame;
|
|
2110
|
+
name: string;
|
|
2111
|
+
content: unknown;
|
|
2112
|
+
}
|
|
2113
|
+
type BasicRendererModel = KpiRendererModel | ChartRendererModel | TableRendererModel | TabulatorRendererModel | PivotRendererModel | TextRendererModel | MarkdownRendererModel | ImageRendererModel | UnknownRendererModel | ExtensionRendererModel;
|
|
2114
|
+
interface RendererContext {
|
|
2115
|
+
filters?: Record<string, unknown>;
|
|
2116
|
+
filterLabels?: Record<string, string>;
|
|
2117
|
+
widgetDefaults?: WidgetDefaults;
|
|
2118
|
+
reducedMotion?: boolean;
|
|
2119
|
+
answeredOnce?: boolean;
|
|
2120
|
+
loading?: boolean;
|
|
2121
|
+
retryable?: boolean;
|
|
2122
|
+
registry?: RendererRegistry;
|
|
2123
|
+
tableSort?: TableSortState | null;
|
|
2124
|
+
tablePage?: number;
|
|
2125
|
+
pivotView?: PivotViewState;
|
|
2126
|
+
capture?: boolean;
|
|
2127
|
+
embedded?: boolean;
|
|
2128
|
+
/**
|
|
2129
|
+
* True when a host frame already draws the card around the renderer, so the
|
|
2130
|
+
* renderer keeps only its inner padding and draws no border, shadow, radius
|
|
2131
|
+
* or background of its own.
|
|
2132
|
+
*/
|
|
2133
|
+
framed?: boolean;
|
|
2134
|
+
/**
|
|
2135
|
+
* False when no host exporter can write Excel files, so renderers hide
|
|
2136
|
+
* their Excel button and keep CSV.
|
|
2137
|
+
*/
|
|
2138
|
+
excelExport?: boolean;
|
|
2139
|
+
}
|
|
2140
|
+
interface RendererExtensionInput {
|
|
2141
|
+
widget: WidgetSpec;
|
|
2142
|
+
result: WidgetResult;
|
|
2143
|
+
frame: RendererFrame;
|
|
2144
|
+
context: RendererContext;
|
|
2145
|
+
}
|
|
2146
|
+
type RendererExtension = (input: RendererExtensionInput) => unknown;
|
|
2147
|
+
interface RendererRegistry {
|
|
2148
|
+
register(name: string, renderer: RendererExtension): void;
|
|
2149
|
+
unregister(name: string): void;
|
|
2150
|
+
get(name: string): RendererExtension | undefined;
|
|
2151
|
+
}
|
|
2152
|
+
|
|
2153
|
+
/**
|
|
2154
|
+
* The authoring side of the transport seam.
|
|
2155
|
+
*
|
|
2156
|
+
* Same rule as the reader: no fetch, no URL and no host client is written
|
|
2157
|
+
* inside the package, and every call carries the scope it acts on rather than
|
|
2158
|
+
* reading one from an ambient session. Nothing here returns a host database
|
|
2159
|
+
* model: a widget arrives as its YAML text and a preview as plain rows.
|
|
2160
|
+
*/
|
|
2161
|
+
interface WidgetDocumentRequest {
|
|
2162
|
+
dashboardId: string;
|
|
2163
|
+
widgetId: string;
|
|
2164
|
+
signal?: AbortSignal;
|
|
2165
|
+
}
|
|
2166
|
+
interface WidgetDocument {
|
|
2167
|
+
widgetId: string;
|
|
2168
|
+
specYaml: string;
|
|
2169
|
+
}
|
|
2170
|
+
interface WidgetSaveRequest {
|
|
2171
|
+
dashboardId: string;
|
|
2172
|
+
widgetId: string;
|
|
2173
|
+
specYaml: string;
|
|
2174
|
+
}
|
|
2175
|
+
interface WidgetCreateRequest {
|
|
2176
|
+
dashboardId: string;
|
|
2177
|
+
specYaml: string;
|
|
2178
|
+
}
|
|
2179
|
+
interface WidgetDeleteRequest {
|
|
2180
|
+
dashboardId: string;
|
|
2181
|
+
widgetId: string;
|
|
2182
|
+
}
|
|
2183
|
+
interface DashboardDocumentRequest {
|
|
2184
|
+
dashboardId: string;
|
|
2185
|
+
signal?: AbortSignal;
|
|
2186
|
+
}
|
|
2187
|
+
/** The dashboard document as YAML text, which is all the YAML editor needs. */
|
|
2188
|
+
interface DashboardDocument {
|
|
2189
|
+
dashboardId: string;
|
|
2190
|
+
specYaml: string;
|
|
2191
|
+
/** The version stamp the host uses for optimistic concurrency, if it has one. */
|
|
2192
|
+
updatedAt?: string;
|
|
2193
|
+
}
|
|
2194
|
+
interface DashboardDocumentSaveRequest {
|
|
2195
|
+
dashboardId: string;
|
|
2196
|
+
specYaml: string;
|
|
2197
|
+
expectedUpdatedAt?: string;
|
|
2198
|
+
}
|
|
2199
|
+
/** Name and description edits made inline on the page header. */
|
|
2200
|
+
interface DashboardMetadataSaveRequest {
|
|
2201
|
+
dashboardId: string;
|
|
2202
|
+
name?: string;
|
|
2203
|
+
description?: string;
|
|
2204
|
+
}
|
|
2205
|
+
interface DashboardCopyRequest {
|
|
2206
|
+
dashboardId: string;
|
|
2207
|
+
name?: string;
|
|
2208
|
+
}
|
|
2209
|
+
interface DashboardCopyResponse {
|
|
2210
|
+
/** How the host addresses the copy, so the page can navigate to it. */
|
|
2211
|
+
dashboardId: string;
|
|
2212
|
+
}
|
|
2213
|
+
interface WidgetInventoryRequest {
|
|
2214
|
+
dashboardId: string;
|
|
2215
|
+
signal?: AbortSignal;
|
|
2216
|
+
}
|
|
2217
|
+
interface WidgetInventoryResponse {
|
|
2218
|
+
widgets: Record<string, WidgetSpec>;
|
|
2219
|
+
/** Widgets belonging to the dashboard that no tab places on its grid. */
|
|
2220
|
+
unplacedWidgetIds: string[];
|
|
2221
|
+
}
|
|
2222
|
+
interface WidgetDiagnosticsRequest {
|
|
2223
|
+
dashboardId: string;
|
|
2224
|
+
widgetId: string;
|
|
2225
|
+
filters?: Record<string, unknown>;
|
|
2226
|
+
signal?: AbortSignal;
|
|
2227
|
+
}
|
|
2228
|
+
/** One query a widget ran, as the engine reports it. */
|
|
2229
|
+
interface WidgetQueryDiagnostic {
|
|
2230
|
+
kind: string;
|
|
2231
|
+
sql: string;
|
|
2232
|
+
params: Record<string, unknown>;
|
|
2233
|
+
dataStoreId: string | null;
|
|
2234
|
+
filterField: string | null;
|
|
2235
|
+
/** The scope the query was narrowed to, or null when it was not narrowed. */
|
|
2236
|
+
effectiveLocations: string[] | null;
|
|
2237
|
+
note?: string;
|
|
2238
|
+
returnedColumns?: string[];
|
|
2239
|
+
rowCount?: number;
|
|
2240
|
+
cache?: string;
|
|
2241
|
+
cacheTtlSeconds?: number;
|
|
2242
|
+
}
|
|
2243
|
+
interface WidgetMappingDiagnostic {
|
|
2244
|
+
rowCount: number;
|
|
2245
|
+
availableColumns: string[];
|
|
2246
|
+
mappedFields: Record<string, string>;
|
|
2247
|
+
issues: string[];
|
|
2248
|
+
}
|
|
2249
|
+
interface WidgetDiagnosticsResponse {
|
|
2250
|
+
widgetId: string;
|
|
2251
|
+
component: string;
|
|
2252
|
+
queries: WidgetQueryDiagnostic[];
|
|
2253
|
+
mapping?: WidgetMappingDiagnostic;
|
|
2254
|
+
notes?: string[];
|
|
2255
|
+
error?: string;
|
|
2256
|
+
}
|
|
2257
|
+
interface ModelLoadRequest {
|
|
2258
|
+
signal?: AbortSignal;
|
|
2259
|
+
}
|
|
2260
|
+
interface ModelDocument {
|
|
2261
|
+
specYaml: string;
|
|
2262
|
+
version: number | null;
|
|
2263
|
+
/** False when the caller may read the model but not write it. */
|
|
2264
|
+
editable: boolean;
|
|
2265
|
+
}
|
|
2266
|
+
interface ModelSaveRequest {
|
|
2267
|
+
specYaml: string;
|
|
2268
|
+
note?: string;
|
|
2269
|
+
}
|
|
2270
|
+
interface ModelValidateRequest {
|
|
2271
|
+
specYaml: string;
|
|
2272
|
+
signal?: AbortSignal;
|
|
2273
|
+
}
|
|
2274
|
+
interface ModelVersionSummary {
|
|
2275
|
+
version: number;
|
|
2276
|
+
createdAt: string;
|
|
2277
|
+
sizeBytes: number;
|
|
2278
|
+
datasetCount: number;
|
|
2279
|
+
note: string | null;
|
|
2280
|
+
/** True when this version is exactly what the model says now. */
|
|
2281
|
+
isCurrent: boolean;
|
|
2282
|
+
}
|
|
2283
|
+
interface ModelVersionRequest {
|
|
2284
|
+
version: number;
|
|
2285
|
+
signal?: AbortSignal;
|
|
2286
|
+
}
|
|
2287
|
+
interface ModelVersionRestoreRequest {
|
|
2288
|
+
version: number;
|
|
2289
|
+
note?: string;
|
|
2290
|
+
}
|
|
2291
|
+
/** A warehouse connection the host offers, named without exposing its record. */
|
|
2292
|
+
interface DataModelConnection {
|
|
2293
|
+
id: string;
|
|
2294
|
+
label: string;
|
|
2295
|
+
vendor: string | null;
|
|
2296
|
+
}
|
|
2297
|
+
interface WarehouseColumn {
|
|
2298
|
+
name: string;
|
|
2299
|
+
dataType: string;
|
|
2300
|
+
}
|
|
2301
|
+
interface WarehouseTable {
|
|
2302
|
+
schemaName: string;
|
|
2303
|
+
tableName: string;
|
|
2304
|
+
tableType: string;
|
|
2305
|
+
columns: WarehouseColumn[];
|
|
2306
|
+
}
|
|
2307
|
+
interface WarehouseSchemaRequest {
|
|
2308
|
+
connectionId: string | null;
|
|
2309
|
+
signal?: AbortSignal;
|
|
2310
|
+
}
|
|
2311
|
+
interface DatasetPreviewRequest {
|
|
2312
|
+
/** The model text as it stands in the editor, saved or not. */
|
|
2313
|
+
specYaml: string;
|
|
2314
|
+
datasetId: string;
|
|
2315
|
+
limit: number;
|
|
2316
|
+
columns?: string[];
|
|
2317
|
+
signal?: AbortSignal;
|
|
2318
|
+
}
|
|
2319
|
+
interface DatasetPreviewResult {
|
|
2320
|
+
columns: string[];
|
|
2321
|
+
rows: Record<string, unknown>[];
|
|
2322
|
+
rowCount: number;
|
|
2323
|
+
/** The scope the preview ran under, or null when it was not narrowed. */
|
|
2324
|
+
effectiveLocations: string[] | null;
|
|
2325
|
+
sql: string | null;
|
|
2326
|
+
}
|
|
2327
|
+
/** A change an assistant proposes, which an author reads before applying it. */
|
|
2328
|
+
interface AuthoringProposal {
|
|
2329
|
+
id: string;
|
|
2330
|
+
summary: string;
|
|
2331
|
+
specYaml: string;
|
|
2332
|
+
}
|
|
2333
|
+
interface ProposalRequest {
|
|
2334
|
+
dashboardId: string;
|
|
2335
|
+
widgetId: string | null;
|
|
2336
|
+
instruction: string;
|
|
2337
|
+
specYaml: string;
|
|
2338
|
+
signal?: AbortSignal;
|
|
2339
|
+
}
|
|
2340
|
+
interface ProposalOutcomeRequest {
|
|
2341
|
+
proposalId: string;
|
|
2342
|
+
applied: boolean;
|
|
2343
|
+
}
|
|
2344
|
+
interface LayoutWidgetRequest {
|
|
2345
|
+
dashboardId: string;
|
|
2346
|
+
widgetId: string;
|
|
2347
|
+
}
|
|
2348
|
+
interface AuthoringTransport {
|
|
2349
|
+
loadWidgetDocument: (request: WidgetDocumentRequest) => Promise<WidgetDocument>;
|
|
2350
|
+
saveWidget: (request: WidgetSaveRequest) => Promise<void>;
|
|
2351
|
+
createWidget: (request: WidgetCreateRequest) => Promise<WidgetDocument>;
|
|
2352
|
+
deleteWidget: (request: WidgetDeleteRequest) => Promise<void>;
|
|
2353
|
+
listWidgets: (request: WidgetInventoryRequest) => Promise<WidgetInventoryResponse>;
|
|
2354
|
+
diagnoseWidget: (request: WidgetDiagnosticsRequest) => Promise<WidgetDiagnosticsResponse>;
|
|
2355
|
+
loadModel: (request: ModelLoadRequest) => Promise<ModelDocument>;
|
|
2356
|
+
saveModel: (request: ModelSaveRequest) => Promise<ModelDocument>;
|
|
2357
|
+
validateModel: (request: ModelValidateRequest) => Promise<DashboardModelDiagnostics>;
|
|
2358
|
+
listModelVersions: (request: {
|
|
2359
|
+
signal?: AbortSignal;
|
|
2360
|
+
}) => Promise<ModelVersionSummary[]>;
|
|
2361
|
+
loadModelVersion: (request: ModelVersionRequest) => Promise<ModelDocument>;
|
|
2362
|
+
restoreModelVersion: (request: ModelVersionRestoreRequest) => Promise<ModelDocument>;
|
|
2363
|
+
listConnections: (request: {
|
|
2364
|
+
signal?: AbortSignal;
|
|
2365
|
+
}) => Promise<DataModelConnection[]>;
|
|
2366
|
+
listWarehouseTables: (request: WarehouseSchemaRequest) => Promise<WarehouseTable[]>;
|
|
2367
|
+
previewDataset: (request: DatasetPreviewRequest) => Promise<DatasetPreviewResult>;
|
|
2368
|
+
/** Places an existing widget on the dashboard grid. */
|
|
2369
|
+
addWidgetToLayout: (request: LayoutWidgetRequest) => Promise<void>;
|
|
2370
|
+
/** Takes a widget off the grid without deleting the widget itself. */
|
|
2371
|
+
removeWidgetFromLayout: (request: LayoutWidgetRequest) => Promise<void>;
|
|
2372
|
+
/** Optional: the dashboard document itself, for the dashboard YAML editor. */
|
|
2373
|
+
loadDashboardDocument?: (request: DashboardDocumentRequest) => Promise<DashboardDocument>;
|
|
2374
|
+
saveDashboardDocument?: (request: DashboardDocumentSaveRequest) => Promise<DashboardDocument>;
|
|
2375
|
+
/** Optional: inline rename and description edits on the page header. */
|
|
2376
|
+
saveDashboardMetadata?: (request: DashboardMetadataSaveRequest) => Promise<void>;
|
|
2377
|
+
/** Optional: Make a copy. */
|
|
2378
|
+
copyDashboard?: (request: DashboardCopyRequest) => Promise<DashboardCopyResponse>;
|
|
2379
|
+
/** Optional: an assistant that writes a document from a sentence. */
|
|
2380
|
+
proposeDocument?: (request: ProposalRequest) => Promise<AuthoringProposal>;
|
|
2381
|
+
/** Optional: tells the host whether a proposal was kept. */
|
|
2382
|
+
recordProposalOutcome?: (request: ProposalOutcomeRequest) => Promise<void>;
|
|
2383
|
+
}
|
|
2384
|
+
interface CodeEditorProps {
|
|
2385
|
+
value: string;
|
|
2386
|
+
onChange: (value: string) => void;
|
|
2387
|
+
language: "yaml";
|
|
2388
|
+
readOnly?: boolean | undefined;
|
|
2389
|
+
markers?: ModelMarker[] | undefined;
|
|
2390
|
+
ariaLabel?: string | undefined;
|
|
2391
|
+
className?: string | undefined;
|
|
2392
|
+
}
|
|
2393
|
+
/**
|
|
2394
|
+
* The editor seam. A host passes Monaco, CodeMirror or anything else, and the
|
|
2395
|
+
* package falls back to a plain textarea, so no editor is bundled here.
|
|
2396
|
+
*/
|
|
2397
|
+
type CodeEditor = ComponentType<CodeEditorProps>;
|
|
2398
|
+
|
|
2399
|
+
/**
|
|
2400
|
+
* Every glyph the reader and builder draw. `defaultIcons` covers them all with
|
|
2401
|
+
* inline SVG; a host maps any subset onto its own icon library and the rest
|
|
2402
|
+
* fall back to the built-in glyphs.
|
|
2403
|
+
*/
|
|
2404
|
+
type IconName = "activity" | "alert" | "arrowDown" | "arrowLeft" | "arrowUp" | "arrowUpDown" | "building" | "calendar" | "check" | "chevronDown" | "chevronLeft" | "chevronRight" | "close" | "code" | "copy" | "download" | "expand" | "eye" | "filter" | "grip" | "help" | "info" | "layers" | "loader" | "lock" | "minus" | "more" | "plus" | "refresh" | "save" | "search" | "settings" | "share" | "sliders" | "sparkles" | "spreadsheet" | "trash" | "trendDown" | "trendFlat" | "trendUp" | "undo" | "users";
|
|
2405
|
+
interface IconProps {
|
|
2406
|
+
className?: string | undefined;
|
|
2407
|
+
title?: string | undefined;
|
|
2408
|
+
}
|
|
2409
|
+
type IconSet = Record<IconName, ComponentType<IconProps>>;
|
|
2410
|
+
interface UiButtonProps {
|
|
2411
|
+
children?: ReactNode;
|
|
2412
|
+
className?: string | undefined;
|
|
2413
|
+
disabled?: boolean | undefined;
|
|
2414
|
+
onClick?: (() => void) | undefined;
|
|
2415
|
+
title?: string | undefined;
|
|
2416
|
+
ariaLabel?: string | undefined;
|
|
2417
|
+
variant?: "primary" | "secondary" | "ghost" | "link" | undefined;
|
|
2418
|
+
size?: "sm" | "md" | undefined;
|
|
2419
|
+
type?: "button" | "submit" | undefined;
|
|
2420
|
+
}
|
|
2421
|
+
interface UiTooltipProps {
|
|
2422
|
+
label: ReactNode;
|
|
2423
|
+
children: ReactNode;
|
|
2424
|
+
side?: "top" | "bottom" | "left" | "right" | undefined;
|
|
2425
|
+
}
|
|
2426
|
+
interface UiPopoverProps {
|
|
2427
|
+
open: boolean;
|
|
2428
|
+
onOpenChange: (open: boolean) => void;
|
|
2429
|
+
trigger: ReactNode;
|
|
2430
|
+
children: ReactNode;
|
|
2431
|
+
align?: "start" | "center" | "end" | undefined;
|
|
2432
|
+
className?: string | undefined;
|
|
2433
|
+
}
|
|
2434
|
+
interface UiModalProps {
|
|
2435
|
+
open: boolean;
|
|
2436
|
+
onOpenChange: (open: boolean) => void;
|
|
2437
|
+
title: ReactNode;
|
|
2438
|
+
description?: ReactNode;
|
|
2439
|
+
/** Replaces the plain title row, for a modal that carries its own navigation. */
|
|
2440
|
+
header?: ReactNode;
|
|
2441
|
+
footer?: ReactNode;
|
|
2442
|
+
children: ReactNode;
|
|
2443
|
+
size?: "md" | "lg" | "xl" | undefined;
|
|
2444
|
+
}
|
|
2445
|
+
interface UiSelectOption {
|
|
2446
|
+
value: string;
|
|
2447
|
+
label: string;
|
|
2448
|
+
disabled?: boolean | undefined;
|
|
2449
|
+
}
|
|
2450
|
+
interface UiSelectProps {
|
|
2451
|
+
value: string;
|
|
2452
|
+
options: UiSelectOption[];
|
|
2453
|
+
onChange: (value: string) => void;
|
|
2454
|
+
placeholder?: string | undefined;
|
|
2455
|
+
disabled?: boolean | undefined;
|
|
2456
|
+
ariaLabel?: string | undefined;
|
|
2457
|
+
className?: string | undefined;
|
|
2458
|
+
}
|
|
2459
|
+
interface UiTextInputProps {
|
|
2460
|
+
value: string;
|
|
2461
|
+
onChange: (value: string) => void;
|
|
2462
|
+
placeholder?: string | undefined;
|
|
2463
|
+
disabled?: boolean | undefined;
|
|
2464
|
+
ariaLabel?: string | undefined;
|
|
2465
|
+
className?: string | undefined;
|
|
2466
|
+
type?: "text" | "number" | "date" | "search" | undefined;
|
|
2467
|
+
onCommit?: (() => void) | undefined;
|
|
2468
|
+
}
|
|
2469
|
+
interface UiCheckboxProps {
|
|
2470
|
+
checked: boolean;
|
|
2471
|
+
onChange: (checked: boolean) => void;
|
|
2472
|
+
label: ReactNode;
|
|
2473
|
+
disabled?: boolean | undefined;
|
|
2474
|
+
className?: string | undefined;
|
|
2475
|
+
}
|
|
2476
|
+
interface UiBadgeProps {
|
|
2477
|
+
children: ReactNode;
|
|
2478
|
+
tone?: "neutral" | "info" | "success" | "warning" | "danger" | undefined;
|
|
2479
|
+
className?: string | undefined;
|
|
2480
|
+
title?: string | undefined;
|
|
2481
|
+
}
|
|
2482
|
+
interface UiSkeletonProps {
|
|
2483
|
+
className?: string | undefined;
|
|
2484
|
+
style?: CSSProperties | undefined;
|
|
2485
|
+
}
|
|
2486
|
+
interface UiMenuItem {
|
|
2487
|
+
id: string;
|
|
2488
|
+
label: string;
|
|
2489
|
+
icon?: IconName | undefined;
|
|
2490
|
+
disabled?: boolean | undefined;
|
|
2491
|
+
onSelect: () => void;
|
|
2492
|
+
}
|
|
2493
|
+
interface UiMenuProps {
|
|
2494
|
+
items: UiMenuItem[];
|
|
2495
|
+
trigger: ReactNode;
|
|
2496
|
+
ariaLabel?: string | undefined;
|
|
2497
|
+
}
|
|
2498
|
+
/**
|
|
2499
|
+
* The design system seam. A host passes its own primitives, so the reader runs
|
|
2500
|
+
* unchanged on shadcn, on Material, or on the plain elements the reference host
|
|
2501
|
+
* uses to prove the package carries no design system of its own.
|
|
2502
|
+
*/
|
|
2503
|
+
interface UiKit {
|
|
2504
|
+
Badge: ComponentType<UiBadgeProps>;
|
|
2505
|
+
Button: ComponentType<UiButtonProps>;
|
|
2506
|
+
Checkbox: ComponentType<UiCheckboxProps>;
|
|
2507
|
+
Menu: ComponentType<UiMenuProps>;
|
|
2508
|
+
Modal: ComponentType<UiModalProps>;
|
|
2509
|
+
Popover: ComponentType<UiPopoverProps>;
|
|
2510
|
+
Select: ComponentType<UiSelectProps>;
|
|
2511
|
+
Skeleton: ComponentType<UiSkeletonProps>;
|
|
2512
|
+
TextInput: ComponentType<UiTextInputProps>;
|
|
2513
|
+
Tooltip: ComponentType<UiTooltipProps>;
|
|
2514
|
+
}
|
|
2515
|
+
interface AssetResolver {
|
|
2516
|
+
/** Turns a stored image reference into something an img tag can load. */
|
|
2517
|
+
resolve: (reference: string) => string;
|
|
2518
|
+
}
|
|
2519
|
+
interface HostLinkProps {
|
|
2520
|
+
href: string;
|
|
2521
|
+
children: ReactNode;
|
|
2522
|
+
className?: string | undefined;
|
|
2523
|
+
target?: "_blank" | "_self" | undefined;
|
|
2524
|
+
onNavigate?: (() => void) | undefined;
|
|
2525
|
+
}
|
|
2526
|
+
interface HostLinks {
|
|
2527
|
+
Link: ComponentType<HostLinkProps>;
|
|
2528
|
+
/** The route the reader currently sits on, when the host tracks one. */
|
|
2529
|
+
currentHref?: string | undefined;
|
|
2530
|
+
navigate?: (href: string, options?: {
|
|
2531
|
+
newTab?: boolean;
|
|
2532
|
+
params?: Record<string, unknown>;
|
|
2533
|
+
}) => void;
|
|
2534
|
+
}
|
|
2535
|
+
interface Notice {
|
|
2536
|
+
tone: "info" | "success" | "warning" | "error";
|
|
2537
|
+
message: string;
|
|
2538
|
+
detail?: string;
|
|
2539
|
+
}
|
|
2540
|
+
type NoticeSink = (notice: Notice) => void;
|
|
2541
|
+
interface DashboardRunRequest {
|
|
2542
|
+
dashboardId: string;
|
|
2543
|
+
filters?: Record<string, unknown>;
|
|
2544
|
+
signal?: AbortSignal;
|
|
2545
|
+
}
|
|
2546
|
+
interface DashboardRunResponse {
|
|
2547
|
+
results: Record<string, WidgetResult>;
|
|
2548
|
+
/** Present when the caller did not already hold the specs, as a drill does. */
|
|
2549
|
+
dashboard: DashboardSpec;
|
|
2550
|
+
widgets: Record<string, WidgetSpec>;
|
|
2551
|
+
name?: string;
|
|
2552
|
+
errors?: Record<string, string>;
|
|
2553
|
+
}
|
|
2554
|
+
interface WidgetRunRequest {
|
|
2555
|
+
dashboardId: string;
|
|
2556
|
+
widgetId: string;
|
|
2557
|
+
filters?: Record<string, unknown>;
|
|
2558
|
+
signal?: AbortSignal;
|
|
2559
|
+
}
|
|
2560
|
+
interface WidgetDetailRequest extends WidgetRunRequest {
|
|
2561
|
+
/** The clicked cell, named by the labels the pivot printed. */
|
|
2562
|
+
cell: Record<string, string>;
|
|
2563
|
+
label?: string;
|
|
2564
|
+
limit?: number;
|
|
2565
|
+
}
|
|
2566
|
+
interface DrillRunRequest {
|
|
2567
|
+
dashboardId: string;
|
|
2568
|
+
widgetId: string;
|
|
2569
|
+
interaction: WidgetInteraction;
|
|
2570
|
+
context: WidgetInteractionContext;
|
|
2571
|
+
filters?: Record<string, unknown>;
|
|
2572
|
+
signal?: AbortSignal;
|
|
2573
|
+
}
|
|
2574
|
+
interface DrillRunResponse {
|
|
2575
|
+
columns: string[];
|
|
2576
|
+
rows: Record<string, unknown>[];
|
|
2577
|
+
truncated?: boolean;
|
|
2578
|
+
}
|
|
2579
|
+
interface LayoutSaveRequest {
|
|
2580
|
+
dashboardId: string;
|
|
2581
|
+
/** Positions per breakpoint key (`lg`, `md`, `sm`, `xs`, `xxs`). */
|
|
2582
|
+
layouts: ResponsiveLayouts;
|
|
2583
|
+
/** Row height and column overrides per breakpoint, when the author changed them. */
|
|
2584
|
+
gridOverrides?: Partial<Record<Breakpoint, {
|
|
2585
|
+
rowHeight?: number;
|
|
2586
|
+
cols?: number;
|
|
2587
|
+
}>>;
|
|
2588
|
+
/** Widgets kept off the grid without being deleted. */
|
|
2589
|
+
unplacedWidgetIds?: string[];
|
|
2590
|
+
/** The row limit after any Add rows the author clicked. */
|
|
2591
|
+
maxRows?: number;
|
|
2592
|
+
/** A breakpoint name that caps the dashboard width, or `null` to lift the cap. */
|
|
2593
|
+
maxLayoutWidth?: string | null;
|
|
2594
|
+
/** Dashboard level grid behaviour the author toggled in the Grid popover. */
|
|
2595
|
+
grid?: {
|
|
2596
|
+
isBounded?: boolean;
|
|
2597
|
+
preventCollision?: boolean;
|
|
2598
|
+
};
|
|
2599
|
+
/** The data store widgets query by default, or `null` for the host default. */
|
|
2600
|
+
dataModelId?: string | null;
|
|
2601
|
+
/**
|
|
2602
|
+
* The dashboard's `updatedAt` when editing began. A host that supports
|
|
2603
|
+
* optimistic concurrency rejects the save with `LayoutConflictError` when a
|
|
2604
|
+
* newer version exists.
|
|
2605
|
+
*/
|
|
2606
|
+
expectedUpdatedAt?: string;
|
|
2607
|
+
signal?: AbortSignal;
|
|
2608
|
+
}
|
|
2609
|
+
interface LayoutSaveResponse {
|
|
2610
|
+
/** The dashboard's version stamp after the save, for the next request. */
|
|
2611
|
+
updatedAt?: string;
|
|
2612
|
+
}
|
|
2613
|
+
/**
|
|
2614
|
+
* The only way the reader reaches a server. No fetch, no server action and no
|
|
2615
|
+
* URL is written inside the package.
|
|
2616
|
+
*/
|
|
2617
|
+
interface DashboardTransport {
|
|
2618
|
+
runDashboard: (request: DashboardRunRequest) => Promise<DashboardRunResponse>;
|
|
2619
|
+
runWidget: (request: WidgetRunRequest) => Promise<WidgetResult>;
|
|
2620
|
+
runWidgetDetail?: (request: WidgetDetailRequest) => Promise<PivotDetailResult>;
|
|
2621
|
+
runDrill?: (request: DrillRunRequest) => Promise<DrillRunResponse>;
|
|
2622
|
+
saveLayout?: (request: LayoutSaveRequest) => Promise<LayoutSaveResponse | void>;
|
|
2623
|
+
}
|
|
2624
|
+
/**
|
|
2625
|
+
* Structural copy of the lifecycle the browser renderer packages return. It is
|
|
2626
|
+
* declared here rather than imported so the React package keeps its dependency
|
|
2627
|
+
* on the concrete renderers optional and host owned.
|
|
2628
|
+
*/
|
|
2629
|
+
interface ReaderRenderer {
|
|
2630
|
+
update: (input: RendererMountInput) => void;
|
|
2631
|
+
resize: () => void;
|
|
2632
|
+
destroy: () => void;
|
|
2633
|
+
}
|
|
2634
|
+
interface RendererMountCallbacks {
|
|
2635
|
+
onInteraction?: (interaction: WidgetInteraction, context: WidgetInteractionContext) => void;
|
|
2636
|
+
onRetry?: () => void;
|
|
2637
|
+
onFilterChange?: (widgetId: string, value: unknown) => void;
|
|
2638
|
+
onFilterLabelChange?: (widgetId: string, label: string) => void;
|
|
2639
|
+
onError?: (error: Error) => void;
|
|
2640
|
+
onPivotDetail?: (payload: PivotDetailPayload) => void;
|
|
2641
|
+
onPivotView?: (widgetId: string, view: Record<string, unknown>) => void;
|
|
2642
|
+
onExport?: (request: RendererExportRequest$1) => void | Promise<void>;
|
|
2643
|
+
}
|
|
2644
|
+
/** A CSV or Excel export a concrete renderer's toolbar asked the reader for. */
|
|
2645
|
+
interface RendererExportRequest$1 {
|
|
2646
|
+
widgetId: string;
|
|
2647
|
+
format: "csv" | "excel";
|
|
2648
|
+
filename: string;
|
|
2649
|
+
}
|
|
2650
|
+
/**
|
|
2651
|
+
* A pivot cell a reader asked to see behind, exactly as the concrete pivot
|
|
2652
|
+
* renderer raises it: the cell is named by the dimension labels the pivot
|
|
2653
|
+
* printed, because the labels are all the browser holds.
|
|
2654
|
+
*/
|
|
2655
|
+
interface PivotDetailPayload {
|
|
2656
|
+
widgetId: string;
|
|
2657
|
+
/** The clicked cell in words, which titles the detail modal. */
|
|
2658
|
+
label: string;
|
|
2659
|
+
filters: Record<string, string>;
|
|
2660
|
+
}
|
|
2661
|
+
interface RendererMountInput {
|
|
2662
|
+
element: HTMLElement;
|
|
2663
|
+
widget: WidgetSpec;
|
|
2664
|
+
result?: WidgetResult;
|
|
2665
|
+
context?: RendererContext;
|
|
2666
|
+
filterValue?: unknown;
|
|
2667
|
+
callbacks?: RendererMountCallbacks;
|
|
2668
|
+
theme?: Record<string, unknown>;
|
|
2669
|
+
}
|
|
2670
|
+
type RendererFactory = (input: RendererMountInput) => ReaderRenderer | Promise<ReaderRenderer>;
|
|
2671
|
+
/**
|
|
2672
|
+
* Renderer factories keyed by widget component. Hosts wire the phase 8 packages
|
|
2673
|
+
* here: createEChartsRenderer for charts, createTabulatorRenderer for grids,
|
|
2674
|
+
* createRevoGridRenderer for pivots, createNativeWidgetRenderer for the rest.
|
|
2675
|
+
*/
|
|
2676
|
+
type RendererFactories = Partial<Record<string, RendererFactory>> & {
|
|
2677
|
+
default?: RendererFactory;
|
|
2678
|
+
};
|
|
2679
|
+
|
|
2680
|
+
/**
|
|
2681
|
+
* The dashboard management seam: listing, creating, describing, sharing and
|
|
2682
|
+
* exporting dashboards. The reader and builder never touch it; the ready-made
|
|
2683
|
+
* list page, workspace toolbar, share dialog and export menu do.
|
|
2684
|
+
*
|
|
2685
|
+
* Who may see what is the host's decision, made on the server. This port only
|
|
2686
|
+
* carries the answer: a `DashboardSummary` already says what the caller may do
|
|
2687
|
+
* with it, and the share dialog offers whatever principals `searchPrincipals`
|
|
2688
|
+
* returns, or a typed identifier when the host offers no lookup.
|
|
2689
|
+
*/
|
|
2690
|
+
/** Who the dashboard is visible to. Hosts may add their own values. */
|
|
2691
|
+
type DashboardVisibility = "personal" | "shared" | "org" | string;
|
|
2692
|
+
interface DashboardSummary {
|
|
2693
|
+
dashboardId: string;
|
|
2694
|
+
name: string;
|
|
2695
|
+
description: string | null;
|
|
2696
|
+
visibility: DashboardVisibility;
|
|
2697
|
+
/** The owner as the host names them, for the list cards. */
|
|
2698
|
+
ownerName: string | null;
|
|
2699
|
+
/** The caller's permission as the host names it, for example `owner`, `edit`, `view`. */
|
|
2700
|
+
permission: string;
|
|
2701
|
+
canRead: boolean;
|
|
2702
|
+
canWrite: boolean;
|
|
2703
|
+
isOwner: boolean;
|
|
2704
|
+
sharedWithCount: number;
|
|
2705
|
+
updatedAt: string | null;
|
|
2706
|
+
}
|
|
2707
|
+
interface DashboardShare {
|
|
2708
|
+
principalId: string;
|
|
2709
|
+
permission: string;
|
|
2710
|
+
displayName: string | null;
|
|
2711
|
+
}
|
|
2712
|
+
interface DashboardDetail extends DashboardSummary {
|
|
2713
|
+
/** Empty unless the caller is the owner. */
|
|
2714
|
+
shares: DashboardShare[];
|
|
2715
|
+
/** Whether the caller may publish this dashboard to the organisation. */
|
|
2716
|
+
canPublish: boolean;
|
|
2717
|
+
}
|
|
2718
|
+
/** Someone or something a dashboard may be shared with. */
|
|
2719
|
+
interface Principal {
|
|
2720
|
+
principalId: string;
|
|
2721
|
+
displayName: string;
|
|
2722
|
+
/** A qualifier for the picker, for example a role or team name. */
|
|
2723
|
+
detail?: string | undefined;
|
|
2724
|
+
}
|
|
2725
|
+
interface ShareGrant {
|
|
2726
|
+
principalId: string;
|
|
2727
|
+
permission: string;
|
|
2728
|
+
}
|
|
2729
|
+
interface ReportFormat {
|
|
2730
|
+
format: string;
|
|
2731
|
+
label: string;
|
|
2732
|
+
mimeType: string;
|
|
2733
|
+
}
|
|
2734
|
+
interface DownloadedReport {
|
|
2735
|
+
filename: string;
|
|
2736
|
+
format: string;
|
|
2737
|
+
mimeType: string;
|
|
2738
|
+
blob: Blob;
|
|
2739
|
+
}
|
|
2740
|
+
interface DashboardManagementTransport {
|
|
2741
|
+
listDashboards: (input: {
|
|
2742
|
+
signal?: AbortSignal | undefined;
|
|
2743
|
+
}) => Promise<DashboardSummary[]>;
|
|
2744
|
+
loadDashboard: (input: {
|
|
2745
|
+
dashboardId: string;
|
|
2746
|
+
signal?: AbortSignal | undefined;
|
|
2747
|
+
}) => Promise<DashboardDetail>;
|
|
2748
|
+
/** Absent when the caller may not create dashboards; the list hides the button. */
|
|
2749
|
+
createDashboard?: (input: {
|
|
2750
|
+
name: string;
|
|
2751
|
+
description: string | null;
|
|
2752
|
+
/** A preferred identifier; the host may grant another and return it. */
|
|
2753
|
+
dashboardId?: string | undefined;
|
|
2754
|
+
specYaml?: string | undefined;
|
|
2755
|
+
visibility?: DashboardVisibility | undefined;
|
|
2756
|
+
}) => Promise<DashboardSummary>;
|
|
2757
|
+
deleteDashboard?: (input: {
|
|
2758
|
+
dashboardId: string;
|
|
2759
|
+
}) => Promise<void>;
|
|
2760
|
+
replaceShares?: (input: {
|
|
2761
|
+
dashboardId: string;
|
|
2762
|
+
grants: ShareGrant[];
|
|
2763
|
+
}) => Promise<DashboardDetail>;
|
|
2764
|
+
revokeShare?: (input: {
|
|
2765
|
+
dashboardId: string;
|
|
2766
|
+
principalId: string;
|
|
2767
|
+
}) => Promise<DashboardDetail>;
|
|
2768
|
+
setVisibility?: (input: {
|
|
2769
|
+
dashboardId: string;
|
|
2770
|
+
visibility: DashboardVisibility;
|
|
2771
|
+
}) => Promise<DashboardDetail>;
|
|
2772
|
+
/** People and roles a dashboard may be shared with; without it the share dialog takes a typed identifier. */
|
|
2773
|
+
searchPrincipals?: (input: {
|
|
2774
|
+
query: string;
|
|
2775
|
+
signal?: AbortSignal | undefined;
|
|
2776
|
+
}) => Promise<Principal[]>;
|
|
2777
|
+
/** The export menu appears only when both report methods exist. */
|
|
2778
|
+
listReportFormats?: (input: {
|
|
2779
|
+
signal?: AbortSignal | undefined;
|
|
2780
|
+
}) => Promise<ReportFormat[]>;
|
|
2781
|
+
downloadReport?: (input: {
|
|
2782
|
+
dashboardId: string;
|
|
2783
|
+
format: string;
|
|
2784
|
+
filters: Record<string, unknown>;
|
|
2785
|
+
}) => Promise<DownloadedReport>;
|
|
2786
|
+
}
|
|
2787
|
+
|
|
2788
|
+
type AssistantIntent = "create" | "edit";
|
|
2789
|
+
interface DashboardWorkspaceProps {
|
|
2790
|
+
dashboardId: string;
|
|
2791
|
+
/** The reader's data client. */
|
|
2792
|
+
transport: DashboardTransport;
|
|
2793
|
+
/** Without it the page is read only: no edit mode, editors or inventory. */
|
|
2794
|
+
authoringTransport?: AuthoringTransport | undefined;
|
|
2795
|
+
/** Detail, sharing and exports. */
|
|
2796
|
+
management: DashboardManagementTransport;
|
|
2797
|
+
ui?: Partial<UiKit> | undefined;
|
|
2798
|
+
icons?: Partial<IconSet> | undefined;
|
|
2799
|
+
renderers?: RendererFactories | undefined;
|
|
2800
|
+
links?: HostLinks | undefined;
|
|
2801
|
+
assets?: AssetResolver | undefined;
|
|
2802
|
+
editor?: CodeEditor | undefined;
|
|
2803
|
+
/** Shows the Semantic model button in edit mode. */
|
|
2804
|
+
canEditModel?: boolean | undefined;
|
|
2805
|
+
/** Opens in edit mode when the caller may write, for a freshly created dashboard. */
|
|
2806
|
+
startInEditMode?: boolean | undefined;
|
|
2807
|
+
filters?: Record<string, unknown> | undefined;
|
|
2808
|
+
onFiltersChange?: ((filters: Record<string, unknown>) => void) | undefined;
|
|
2809
|
+
/** Where unsaved drafts survive a reload; defaults to localStorage, null keeps them in memory. */
|
|
2810
|
+
storage?: Pick<Storage, "getItem" | "setItem" | "removeItem"> | null | undefined;
|
|
2811
|
+
/** The Dashboards button; hidden when the host gives no way back. */
|
|
2812
|
+
onBack?: (() => void) | undefined;
|
|
2813
|
+
/** Runs after Make a copy with the new identifier. */
|
|
2814
|
+
onOpenDashboard?: ((dashboardId: string) => void) | undefined;
|
|
2815
|
+
/** Create with AI and Edit with AI; hidden when the host has no assistant. */
|
|
2816
|
+
onAssistant?: ((intent: AssistantIntent, dashboardId: string) => void) | undefined;
|
|
2817
|
+
/** Notices also reach the host, for its own toasts or logs. */
|
|
2818
|
+
onNotice?: NoticeSink | undefined;
|
|
2819
|
+
/** Host buttons placed at the end of the toolbar, a Schedule button for example. */
|
|
2820
|
+
toolbarExtra?: ReactNode;
|
|
2821
|
+
className?: string | undefined;
|
|
2822
|
+
}
|
|
2823
|
+
|
|
2824
|
+
interface DashboardShelf {
|
|
2825
|
+
/** Whether a dashboard sits on this shelf; the first shelf that holds it wins. */
|
|
2826
|
+
holds: (item: DashboardSummary) => boolean;
|
|
2827
|
+
title: string;
|
|
2828
|
+
blurb?: string | undefined;
|
|
2829
|
+
}
|
|
2830
|
+
interface DashboardListProps {
|
|
2831
|
+
management: DashboardManagementTransport;
|
|
2832
|
+
/** Opens a dashboard; `editing` is set for a dashboard just created. */
|
|
2833
|
+
onOpen: (dashboardId: string, options: {
|
|
2834
|
+
editing: boolean;
|
|
2835
|
+
}) => void;
|
|
2836
|
+
ui?: Partial<UiKit> | undefined;
|
|
2837
|
+
icons?: Partial<IconSet> | undefined;
|
|
2838
|
+
shelves?: readonly DashboardShelf[] | undefined;
|
|
2839
|
+
title?: string | undefined;
|
|
2840
|
+
description?: string | undefined;
|
|
2841
|
+
/** Extra header actions beside New dashboard. */
|
|
2842
|
+
actions?: ReactNode;
|
|
2843
|
+
/** The visibility a new dashboard starts with. */
|
|
2844
|
+
newVisibility?: string | undefined;
|
|
2845
|
+
className?: string | undefined;
|
|
2846
|
+
}
|
|
2847
|
+
|
|
2848
|
+
interface BrowserRenderer<TInput> {
|
|
2849
|
+
update(input: TInput): void;
|
|
2850
|
+
resize(): void;
|
|
2851
|
+
destroy(): void;
|
|
2852
|
+
}
|
|
2853
|
+
interface RendererThemeTokens {
|
|
2854
|
+
foreground: string;
|
|
2855
|
+
mutedForeground: string;
|
|
2856
|
+
border: string;
|
|
2857
|
+
surface: string;
|
|
2858
|
+
surfaceForeground: string;
|
|
2859
|
+
primary: string;
|
|
2860
|
+
secondary: string;
|
|
2861
|
+
danger: string;
|
|
2862
|
+
fontFamily: string;
|
|
2863
|
+
seriesColors: string[];
|
|
2864
|
+
heatmapColors: string[];
|
|
2865
|
+
}
|
|
2866
|
+
interface RendererExtensionMount {
|
|
2867
|
+
element: HTMLElement;
|
|
2868
|
+
model: Extract<BasicRendererModel, {
|
|
2869
|
+
kind: "extension";
|
|
2870
|
+
}>;
|
|
2871
|
+
}
|
|
2872
|
+
interface RendererExportRequest {
|
|
2873
|
+
widgetId: string;
|
|
2874
|
+
format: "csv" | "excel";
|
|
2875
|
+
filename: string;
|
|
2876
|
+
}
|
|
2877
|
+
interface RendererPivotDetailRequest {
|
|
2878
|
+
widgetId: string;
|
|
2879
|
+
filters: Record<string, string>;
|
|
2880
|
+
label: string;
|
|
2881
|
+
}
|
|
2882
|
+
interface RendererHostCallbacks {
|
|
2883
|
+
onInteraction?: (interaction: WidgetInteraction, context: WidgetInteractionContext) => void;
|
|
2884
|
+
onFilterChange?: (widgetId: string, value: unknown) => void;
|
|
2885
|
+
onFilterLabelChange?: (widgetId: string, label: string) => void;
|
|
2886
|
+
onExport?: (request: RendererExportRequest) => void | Promise<void>;
|
|
2887
|
+
onPivotViewChange?: (widgetId: string, view: PivotViewState) => void;
|
|
2888
|
+
onPivotDetail?: (request: RendererPivotDetailRequest) => void | Promise<void>;
|
|
2889
|
+
onRetry?: () => void;
|
|
2890
|
+
onError?: (error: Error) => void;
|
|
2891
|
+
renderExtension?: (input: RendererExtensionMount) => BrowserRenderer<RendererExtensionMount> | void;
|
|
2892
|
+
}
|
|
2893
|
+
interface NativeWidgetRenderInput {
|
|
2894
|
+
element: HTMLElement;
|
|
2895
|
+
widget: WidgetSpec;
|
|
2896
|
+
result?: WidgetResult;
|
|
2897
|
+
context?: RendererContext;
|
|
2898
|
+
filterValue?: unknown;
|
|
2899
|
+
callbacks?: RendererHostCallbacks;
|
|
2900
|
+
theme?: Partial<RendererThemeTokens>;
|
|
2901
|
+
}
|
|
2902
|
+
/**
|
|
2903
|
+
* One widget renderer, whatever library draws it. A shell mounts a widget by
|
|
2904
|
+
* asking a factory for this handle, then updates it as results and filters
|
|
2905
|
+
* change, and destroys it on unmount.
|
|
2906
|
+
*/
|
|
2907
|
+
type WidgetRendererHandle = BrowserRenderer<NativeWidgetRenderInput>;
|
|
2908
|
+
type WidgetRendererFactory = (input: NativeWidgetRenderInput) => WidgetRendererHandle | Promise<WidgetRendererHandle>;
|
|
2909
|
+
/**
|
|
2910
|
+
* Factories keyed by widget component, with a fallback for every component the
|
|
2911
|
+
* host did not name. A host wires the concrete renderer packages here, so no
|
|
2912
|
+
* shell carries a charting or grid dependency of its own.
|
|
2913
|
+
*/
|
|
2914
|
+
type WidgetRendererFactories = Partial<Record<string, WidgetRendererFactory>> & {
|
|
2915
|
+
default?: WidgetRendererFactory;
|
|
2916
|
+
};
|
|
2917
|
+
|
|
2918
|
+
/**
|
|
2919
|
+
* A theme is either fixed tokens or a function of the mount element, which is
|
|
2920
|
+
* how a host reads its CSS custom properties live so dark mode and brand
|
|
2921
|
+
* changes reach the charts and grids.
|
|
2922
|
+
*/
|
|
2923
|
+
type RendererThemeSource = Partial<RendererThemeTokens> | ((element: HTMLElement) => Partial<RendererThemeTokens>);
|
|
2924
|
+
interface DefaultRenderersOptions {
|
|
2925
|
+
readonly theme?: RendererThemeSource;
|
|
2926
|
+
/** Extra or replacement factories, merged over the defaults by component name. */
|
|
2927
|
+
readonly overrides?: WidgetRendererFactories;
|
|
2928
|
+
}
|
|
2929
|
+
|
|
2930
|
+
interface HttpTransportOptions {
|
|
2931
|
+
/** The dashboards prefix, for example `/api/custom-dashboards`. */
|
|
2932
|
+
readonly baseUrl: string;
|
|
2933
|
+
/** The authoring prefix; defaults to `${baseUrl}/authoring`. */
|
|
2934
|
+
readonly authoringUrl?: string;
|
|
2935
|
+
/** Defaults to the global `fetch`. */
|
|
2936
|
+
readonly fetch?: typeof fetch;
|
|
2937
|
+
/**
|
|
2938
|
+
* Last word on every request: add an Authorization header, a tenant query
|
|
2939
|
+
* parameter, credentials, whatever the host's API expects.
|
|
2940
|
+
*/
|
|
2941
|
+
readonly prepare?: (url: string, init: RequestInit) => RequestInit | void;
|
|
2942
|
+
/** Extra query parameters appended to every URL, for example `{ person }`. */
|
|
2943
|
+
readonly query?: Readonly<Record<string, string>>;
|
|
2944
|
+
}
|
|
2945
|
+
interface HttpManagementOptions extends HttpTransportOptions {
|
|
2946
|
+
/** The reports prefix; defaults to `${baseUrl}/reports`. */
|
|
2947
|
+
readonly reportsUrl?: string;
|
|
2948
|
+
/** Route groups the host serves; the matching optional methods are omitted otherwise. */
|
|
2949
|
+
readonly features?: {
|
|
2950
|
+
/** `DELETE {baseUrl}/{id}`. */
|
|
2951
|
+
readonly delete?: boolean;
|
|
2952
|
+
/** `GET {baseUrl}/principals?q=`. */
|
|
2953
|
+
readonly principals?: boolean;
|
|
2954
|
+
/** `GET {reportsUrl}/formats` and `POST {reportsUrl}/{id}/{format}`. */
|
|
2955
|
+
readonly reports?: boolean;
|
|
2956
|
+
};
|
|
2957
|
+
}
|
|
2958
|
+
|
|
2959
|
+
/** How the component reaches the host's API when no transport is given. */
|
|
2960
|
+
interface BideuxHttpOptions extends HttpManagementOptions {
|
|
2961
|
+
/** Set to false for a read only page that never builds an authoring transport. */
|
|
2962
|
+
readonly authoring?: boolean;
|
|
2963
|
+
}
|
|
2964
|
+
type WorkspaceRest = Omit<DashboardWorkspaceProps, "transport" | "authoringTransport" | "management" | "renderers">;
|
|
2965
|
+
interface BideuxDashboardProps extends WorkspaceRest {
|
|
2966
|
+
/** The dashboards prefix, for example `/api/custom-dashboards`; the transports are built from it. */
|
|
2967
|
+
baseUrl?: string | undefined;
|
|
2968
|
+
/** Everything about the HTTP client: fetch, prepare, query, reports URL, features. */
|
|
2969
|
+
http?: Omit<BideuxHttpOptions, "baseUrl"> | undefined;
|
|
2970
|
+
/** Custom clients; each one given replaces the HTTP one for that role. */
|
|
2971
|
+
transport?: DashboardTransport | undefined;
|
|
2972
|
+
authoringTransport?: AuthoringTransport | undefined;
|
|
2973
|
+
management?: DashboardManagementTransport | undefined;
|
|
2974
|
+
/** Widget renderers; defaults to ECharts, Tabulator, RevoGrid and the DOM renderer. */
|
|
2975
|
+
renderers?: DashboardWorkspaceProps["renderers"];
|
|
2976
|
+
/** Theme and overrides for the default renderers when `renderers` is not given. */
|
|
2977
|
+
rendererOptions?: DefaultRenderersOptions | undefined;
|
|
2978
|
+
}
|
|
2979
|
+
interface BideuxDashboardListProps extends Omit<DashboardListProps, "management"> {
|
|
2980
|
+
baseUrl?: string | undefined;
|
|
2981
|
+
http?: Omit<HttpManagementOptions, "baseUrl"> | undefined;
|
|
2982
|
+
management?: DashboardManagementTransport | undefined;
|
|
2983
|
+
}
|
|
2984
|
+
|
|
2985
|
+
type Filters = Record<string, unknown>;
|
|
2986
|
+
type Prepare = NonNullable<BideuxHttpOptions["prepare"]>;
|
|
2987
|
+
/** Shared by both elements: a React root, attribute reads and re-render on change. */
|
|
2988
|
+
declare abstract class BideuxElement extends HTMLElement {
|
|
2989
|
+
#private;
|
|
2990
|
+
/** Last word on every request; set as a property, or use `bearer-token`. */
|
|
2991
|
+
prepare: Prepare | undefined;
|
|
2992
|
+
/** Replaces the global fetch. */
|
|
2993
|
+
fetch: typeof globalThis.fetch | undefined;
|
|
2994
|
+
/** Host UI controls and icons; a partial set merges with the built-in ones. */
|
|
2995
|
+
ui: Partial<UiKit> | undefined;
|
|
2996
|
+
icons: Partial<IconSet> | undefined;
|
|
2997
|
+
/** A custom management client; wins over `base-url`. */
|
|
2998
|
+
management: DashboardManagementTransport | undefined;
|
|
2999
|
+
connectedCallback(): void;
|
|
3000
|
+
disconnectedCallback(): void;
|
|
3001
|
+
attributeChangedCallback(): void;
|
|
3002
|
+
/** Re-render after a property change; attribute changes call it for you. */
|
|
3003
|
+
requestRender(): void;
|
|
3004
|
+
protected emit<T>(type: string, detail: T): void;
|
|
3005
|
+
protected text(name: string): string | undefined;
|
|
3006
|
+
protected flag(name: string): boolean;
|
|
3007
|
+
protected http(): Omit<HttpManagementOptions, "baseUrl">;
|
|
3008
|
+
protected abstract render(): ReactNode;
|
|
3009
|
+
}
|
|
3010
|
+
declare class BideuxDashboardElement extends BideuxElement {
|
|
3011
|
+
#private;
|
|
3012
|
+
static get observedAttributes(): readonly string[];
|
|
3013
|
+
/** Custom clients; each one given replaces the HTTP one built from `base-url`. */
|
|
3014
|
+
transport: DashboardTransport | undefined;
|
|
3015
|
+
authoringTransport: AuthoringTransport | undefined;
|
|
3016
|
+
rendererOptions: DefaultRenderersOptions | undefined;
|
|
3017
|
+
renderers: BideuxDashboardProps["renderers"];
|
|
3018
|
+
links: BideuxDashboardProps["links"];
|
|
3019
|
+
assets: BideuxDashboardProps["assets"];
|
|
3020
|
+
editor: BideuxDashboardProps["editor"];
|
|
3021
|
+
storage: BideuxDashboardProps["storage"];
|
|
3022
|
+
/** The applied filters; setting it re-renders, the `filters` attribute is the JSON form. */
|
|
3023
|
+
get filters(): Filters | undefined;
|
|
3024
|
+
set filters(value: Filters | undefined);
|
|
3025
|
+
protected render(): ReactNode;
|
|
3026
|
+
}
|
|
3027
|
+
declare class BideuxDashboardListElement extends BideuxElement {
|
|
3028
|
+
static get observedAttributes(): readonly string[];
|
|
3029
|
+
shelves: BideuxDashboardListProps["shelves"];
|
|
3030
|
+
protected render(): ReactNode;
|
|
3031
|
+
}
|
|
3032
|
+
/** Registers both tags once; importing this module calls it in a browser. */
|
|
3033
|
+
declare function defineBideuxElements(names?: {
|
|
3034
|
+
dashboard?: string;
|
|
3035
|
+
list?: string;
|
|
3036
|
+
}): void;
|
|
3037
|
+
declare global {
|
|
3038
|
+
interface HTMLElementTagNameMap {
|
|
3039
|
+
"bideux-dashboard": BideuxDashboardElement;
|
|
3040
|
+
"bideux-dashboard-list": BideuxDashboardListElement;
|
|
3041
|
+
}
|
|
3042
|
+
}
|
|
3043
|
+
|
|
3044
|
+
export { BideuxDashboardElement, BideuxDashboardListElement, defineBideuxElements };
|