@adminforth/dashboard 1.7.0 → 1.8.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.
@@ -36,6 +36,7 @@ export declare function useWidgetData(slug: Ref<string>, widgetId: Ref<string>,
36
36
  page_size?: number | undefined;
37
37
  } | undefined;
38
38
  query: {
39
+ source?: "resource" | undefined;
39
40
  resource: string;
40
41
  select?: ({
41
42
  field: string;
@@ -82,6 +83,40 @@ export declare function useWidgetData(slug: Ref<string>, widgetId: Ref<string>,
82
83
  as: string;
83
84
  }[] | undefined;
84
85
  formatting?: Record<string, import("../model/dashboard.types.js").JsonValue> | undefined;
86
+ } | {
87
+ source: "steps";
88
+ steps: ({
89
+ name: string;
90
+ resource: string;
91
+ metric: {
92
+ agg: import("../model/dashboard.types.js").QueryAggregateOperation;
93
+ field?: string | undefined;
94
+ as: string;
95
+ filters?: any;
96
+ };
97
+ filters?: any;
98
+ } | {
99
+ name: string;
100
+ resource: string;
101
+ select: {
102
+ agg: import("../model/dashboard.types.js").QueryAggregateOperation;
103
+ field?: string | undefined;
104
+ as: string;
105
+ filters?: any;
106
+ }[];
107
+ filters?: any;
108
+ })[];
109
+ calcs?: {
110
+ calc: string;
111
+ as: string;
112
+ }[] | undefined;
113
+ order_by?: {
114
+ field: string;
115
+ direction?: "asc" | "desc" | undefined;
116
+ }[] | undefined;
117
+ limit?: number | undefined;
118
+ offset?: number | undefined;
119
+ formatting?: Record<string, import("../model/dashboard.types.js").JsonValue> | undefined;
85
120
  };
86
121
  } | {
87
122
  id: string;
@@ -136,6 +171,7 @@ export declare function useWidgetData(slug: Ref<string>, widgetId: Ref<string>,
136
171
  colors?: string[] | undefined;
137
172
  };
138
173
  query: {
174
+ source?: "resource" | undefined;
139
175
  resource: string;
140
176
  select?: ({
141
177
  field: string;
@@ -183,7 +219,8 @@ export declare function useWidgetData(slug: Ref<string>, widgetId: Ref<string>,
183
219
  }[] | undefined;
184
220
  formatting?: Record<string, import("../model/dashboard.types.js").JsonValue> | undefined;
185
221
  } | {
186
- steps: {
222
+ source: "steps";
223
+ steps: ({
187
224
  name: string;
188
225
  resource: string;
189
226
  metric: {
@@ -193,11 +230,28 @@ export declare function useWidgetData(slug: Ref<string>, widgetId: Ref<string>,
193
230
  filters?: any;
194
231
  };
195
232
  filters?: any;
196
- }[];
233
+ } | {
234
+ name: string;
235
+ resource: string;
236
+ select: {
237
+ agg: import("../model/dashboard.types.js").QueryAggregateOperation;
238
+ field?: string | undefined;
239
+ as: string;
240
+ filters?: any;
241
+ }[];
242
+ filters?: any;
243
+ })[];
197
244
  calcs?: {
198
245
  calc: string;
199
246
  as: string;
200
247
  }[] | undefined;
248
+ order_by?: {
249
+ field: string;
250
+ direction?: "asc" | "desc" | undefined;
251
+ }[] | undefined;
252
+ limit?: number | undefined;
253
+ offset?: number | undefined;
254
+ formatting?: Record<string, import("../model/dashboard.types.js").JsonValue> | undefined;
201
255
  };
202
256
  } | {
203
257
  id: string;
@@ -248,6 +302,7 @@ export declare function useWidgetData(slug: Ref<string>, widgetId: Ref<string>,
248
302
  } | undefined;
249
303
  };
250
304
  query: {
305
+ source?: "resource" | undefined;
251
306
  resource: string;
252
307
  select?: ({
253
308
  field: string;
@@ -294,6 +349,40 @@ export declare function useWidgetData(slug: Ref<string>, widgetId: Ref<string>,
294
349
  as: string;
295
350
  }[] | undefined;
296
351
  formatting?: Record<string, import("../model/dashboard.types.js").JsonValue> | undefined;
352
+ } | {
353
+ source: "steps";
354
+ steps: ({
355
+ name: string;
356
+ resource: string;
357
+ metric: {
358
+ agg: import("../model/dashboard.types.js").QueryAggregateOperation;
359
+ field?: string | undefined;
360
+ as: string;
361
+ filters?: any;
362
+ };
363
+ filters?: any;
364
+ } | {
365
+ name: string;
366
+ resource: string;
367
+ select: {
368
+ agg: import("../model/dashboard.types.js").QueryAggregateOperation;
369
+ field?: string | undefined;
370
+ as: string;
371
+ filters?: any;
372
+ }[];
373
+ filters?: any;
374
+ })[];
375
+ calcs?: {
376
+ calc: string;
377
+ as: string;
378
+ }[] | undefined;
379
+ order_by?: {
380
+ field: string;
381
+ direction?: "asc" | "desc" | undefined;
382
+ }[] | undefined;
383
+ limit?: number | undefined;
384
+ offset?: number | undefined;
385
+ formatting?: Record<string, import("../model/dashboard.types.js").JsonValue> | undefined;
297
386
  };
298
387
  } | {
299
388
  id: string;
@@ -329,6 +418,7 @@ export declare function useWidgetData(slug: Ref<string>, widgetId: Ref<string>,
329
418
  color?: string | undefined;
330
419
  };
331
420
  query: {
421
+ source?: "resource" | undefined;
332
422
  resource: string;
333
423
  select?: ({
334
424
  field: string;
@@ -375,6 +465,40 @@ export declare function useWidgetData(slug: Ref<string>, widgetId: Ref<string>,
375
465
  as: string;
376
466
  }[] | undefined;
377
467
  formatting?: Record<string, import("../model/dashboard.types.js").JsonValue> | undefined;
468
+ } | {
469
+ source: "steps";
470
+ steps: ({
471
+ name: string;
472
+ resource: string;
473
+ metric: {
474
+ agg: import("../model/dashboard.types.js").QueryAggregateOperation;
475
+ field?: string | undefined;
476
+ as: string;
477
+ filters?: any;
478
+ };
479
+ filters?: any;
480
+ } | {
481
+ name: string;
482
+ resource: string;
483
+ select: {
484
+ agg: import("../model/dashboard.types.js").QueryAggregateOperation;
485
+ field?: string | undefined;
486
+ as: string;
487
+ filters?: any;
488
+ }[];
489
+ filters?: any;
490
+ })[];
491
+ calcs?: {
492
+ calc: string;
493
+ as: string;
494
+ }[] | undefined;
495
+ order_by?: {
496
+ field: string;
497
+ direction?: "asc" | "desc" | undefined;
498
+ }[] | undefined;
499
+ limit?: number | undefined;
500
+ offset?: number | undefined;
501
+ formatting?: Record<string, import("../model/dashboard.types.js").JsonValue> | undefined;
378
502
  };
379
503
  } | {
380
504
  id: string;
@@ -407,6 +531,7 @@ export declare function useWidgetData(slug: Ref<string>, widgetId: Ref<string>,
407
531
  }[];
408
532
  };
409
533
  query: {
534
+ source?: "resource" | undefined;
410
535
  resource: string;
411
536
  select?: ({
412
537
  field: string;
@@ -453,6 +578,40 @@ export declare function useWidgetData(slug: Ref<string>, widgetId: Ref<string>,
453
578
  as: string;
454
579
  }[] | undefined;
455
580
  formatting?: Record<string, import("../model/dashboard.types.js").JsonValue> | undefined;
581
+ } | {
582
+ source: "steps";
583
+ steps: ({
584
+ name: string;
585
+ resource: string;
586
+ metric: {
587
+ agg: import("../model/dashboard.types.js").QueryAggregateOperation;
588
+ field?: string | undefined;
589
+ as: string;
590
+ filters?: any;
591
+ };
592
+ filters?: any;
593
+ } | {
594
+ name: string;
595
+ resource: string;
596
+ select: {
597
+ agg: import("../model/dashboard.types.js").QueryAggregateOperation;
598
+ field?: string | undefined;
599
+ as: string;
600
+ filters?: any;
601
+ }[];
602
+ filters?: any;
603
+ })[];
604
+ calcs?: {
605
+ calc: string;
606
+ as: string;
607
+ }[] | undefined;
608
+ order_by?: {
609
+ field: string;
610
+ direction?: "asc" | "desc" | undefined;
611
+ }[] | undefined;
612
+ limit?: number | undefined;
613
+ offset?: number | undefined;
614
+ formatting?: Record<string, import("../model/dashboard.types.js").JsonValue> | undefined;
456
615
  };
457
616
  };
458
617
  data: unknown;
@@ -491,6 +650,7 @@ export declare function useWidgetData(slug: Ref<string>, widgetId: Ref<string>,
491
650
  page_size?: number | undefined;
492
651
  } | undefined;
493
652
  query: {
653
+ source?: "resource" | undefined;
494
654
  resource: string;
495
655
  select?: ({
496
656
  field: string;
@@ -537,6 +697,40 @@ export declare function useWidgetData(slug: Ref<string>, widgetId: Ref<string>,
537
697
  as: string;
538
698
  }[] | undefined;
539
699
  formatting?: Record<string, import("../model/dashboard.types.js").JsonValue> | undefined;
700
+ } | {
701
+ source: "steps";
702
+ steps: ({
703
+ name: string;
704
+ resource: string;
705
+ metric: {
706
+ agg: import("../model/dashboard.types.js").QueryAggregateOperation;
707
+ field?: string | undefined;
708
+ as: string;
709
+ filters?: any;
710
+ };
711
+ filters?: any;
712
+ } | {
713
+ name: string;
714
+ resource: string;
715
+ select: {
716
+ agg: import("../model/dashboard.types.js").QueryAggregateOperation;
717
+ field?: string | undefined;
718
+ as: string;
719
+ filters?: any;
720
+ }[];
721
+ filters?: any;
722
+ })[];
723
+ calcs?: {
724
+ calc: string;
725
+ as: string;
726
+ }[] | undefined;
727
+ order_by?: {
728
+ field: string;
729
+ direction?: "asc" | "desc" | undefined;
730
+ }[] | undefined;
731
+ limit?: number | undefined;
732
+ offset?: number | undefined;
733
+ formatting?: Record<string, import("../model/dashboard.types.js").JsonValue> | undefined;
540
734
  };
541
735
  } | {
542
736
  id: string;
@@ -591,6 +785,7 @@ export declare function useWidgetData(slug: Ref<string>, widgetId: Ref<string>,
591
785
  colors?: string[] | undefined;
592
786
  };
593
787
  query: {
788
+ source?: "resource" | undefined;
594
789
  resource: string;
595
790
  select?: ({
596
791
  field: string;
@@ -638,7 +833,8 @@ export declare function useWidgetData(slug: Ref<string>, widgetId: Ref<string>,
638
833
  }[] | undefined;
639
834
  formatting?: Record<string, import("../model/dashboard.types.js").JsonValue> | undefined;
640
835
  } | {
641
- steps: {
836
+ source: "steps";
837
+ steps: ({
642
838
  name: string;
643
839
  resource: string;
644
840
  metric: {
@@ -648,11 +844,28 @@ export declare function useWidgetData(slug: Ref<string>, widgetId: Ref<string>,
648
844
  filters?: any;
649
845
  };
650
846
  filters?: any;
651
- }[];
847
+ } | {
848
+ name: string;
849
+ resource: string;
850
+ select: {
851
+ agg: import("../model/dashboard.types.js").QueryAggregateOperation;
852
+ field?: string | undefined;
853
+ as: string;
854
+ filters?: any;
855
+ }[];
856
+ filters?: any;
857
+ })[];
652
858
  calcs?: {
653
859
  calc: string;
654
860
  as: string;
655
861
  }[] | undefined;
862
+ order_by?: {
863
+ field: string;
864
+ direction?: "asc" | "desc" | undefined;
865
+ }[] | undefined;
866
+ limit?: number | undefined;
867
+ offset?: number | undefined;
868
+ formatting?: Record<string, import("../model/dashboard.types.js").JsonValue> | undefined;
656
869
  };
657
870
  } | {
658
871
  id: string;
@@ -703,6 +916,7 @@ export declare function useWidgetData(slug: Ref<string>, widgetId: Ref<string>,
703
916
  } | undefined;
704
917
  };
705
918
  query: {
919
+ source?: "resource" | undefined;
706
920
  resource: string;
707
921
  select?: ({
708
922
  field: string;
@@ -749,6 +963,40 @@ export declare function useWidgetData(slug: Ref<string>, widgetId: Ref<string>,
749
963
  as: string;
750
964
  }[] | undefined;
751
965
  formatting?: Record<string, import("../model/dashboard.types.js").JsonValue> | undefined;
966
+ } | {
967
+ source: "steps";
968
+ steps: ({
969
+ name: string;
970
+ resource: string;
971
+ metric: {
972
+ agg: import("../model/dashboard.types.js").QueryAggregateOperation;
973
+ field?: string | undefined;
974
+ as: string;
975
+ filters?: any;
976
+ };
977
+ filters?: any;
978
+ } | {
979
+ name: string;
980
+ resource: string;
981
+ select: {
982
+ agg: import("../model/dashboard.types.js").QueryAggregateOperation;
983
+ field?: string | undefined;
984
+ as: string;
985
+ filters?: any;
986
+ }[];
987
+ filters?: any;
988
+ })[];
989
+ calcs?: {
990
+ calc: string;
991
+ as: string;
992
+ }[] | undefined;
993
+ order_by?: {
994
+ field: string;
995
+ direction?: "asc" | "desc" | undefined;
996
+ }[] | undefined;
997
+ limit?: number | undefined;
998
+ offset?: number | undefined;
999
+ formatting?: Record<string, import("../model/dashboard.types.js").JsonValue> | undefined;
752
1000
  };
753
1001
  } | {
754
1002
  id: string;
@@ -784,6 +1032,7 @@ export declare function useWidgetData(slug: Ref<string>, widgetId: Ref<string>,
784
1032
  color?: string | undefined;
785
1033
  };
786
1034
  query: {
1035
+ source?: "resource" | undefined;
787
1036
  resource: string;
788
1037
  select?: ({
789
1038
  field: string;
@@ -830,6 +1079,40 @@ export declare function useWidgetData(slug: Ref<string>, widgetId: Ref<string>,
830
1079
  as: string;
831
1080
  }[] | undefined;
832
1081
  formatting?: Record<string, import("../model/dashboard.types.js").JsonValue> | undefined;
1082
+ } | {
1083
+ source: "steps";
1084
+ steps: ({
1085
+ name: string;
1086
+ resource: string;
1087
+ metric: {
1088
+ agg: import("../model/dashboard.types.js").QueryAggregateOperation;
1089
+ field?: string | undefined;
1090
+ as: string;
1091
+ filters?: any;
1092
+ };
1093
+ filters?: any;
1094
+ } | {
1095
+ name: string;
1096
+ resource: string;
1097
+ select: {
1098
+ agg: import("../model/dashboard.types.js").QueryAggregateOperation;
1099
+ field?: string | undefined;
1100
+ as: string;
1101
+ filters?: any;
1102
+ }[];
1103
+ filters?: any;
1104
+ })[];
1105
+ calcs?: {
1106
+ calc: string;
1107
+ as: string;
1108
+ }[] | undefined;
1109
+ order_by?: {
1110
+ field: string;
1111
+ direction?: "asc" | "desc" | undefined;
1112
+ }[] | undefined;
1113
+ limit?: number | undefined;
1114
+ offset?: number | undefined;
1115
+ formatting?: Record<string, import("../model/dashboard.types.js").JsonValue> | undefined;
833
1116
  };
834
1117
  } | {
835
1118
  id: string;
@@ -862,6 +1145,7 @@ export declare function useWidgetData(slug: Ref<string>, widgetId: Ref<string>,
862
1145
  }[];
863
1146
  };
864
1147
  query: {
1148
+ source?: "resource" | undefined;
865
1149
  resource: string;
866
1150
  select?: ({
867
1151
  field: string;
@@ -908,6 +1192,40 @@ export declare function useWidgetData(slug: Ref<string>, widgetId: Ref<string>,
908
1192
  as: string;
909
1193
  }[] | undefined;
910
1194
  formatting?: Record<string, import("../model/dashboard.types.js").JsonValue> | undefined;
1195
+ } | {
1196
+ source: "steps";
1197
+ steps: ({
1198
+ name: string;
1199
+ resource: string;
1200
+ metric: {
1201
+ agg: import("../model/dashboard.types.js").QueryAggregateOperation;
1202
+ field?: string | undefined;
1203
+ as: string;
1204
+ filters?: any;
1205
+ };
1206
+ filters?: any;
1207
+ } | {
1208
+ name: string;
1209
+ resource: string;
1210
+ select: {
1211
+ agg: import("../model/dashboard.types.js").QueryAggregateOperation;
1212
+ field?: string | undefined;
1213
+ as: string;
1214
+ filters?: any;
1215
+ }[];
1216
+ filters?: any;
1217
+ })[];
1218
+ calcs?: {
1219
+ calc: string;
1220
+ as: string;
1221
+ }[] | undefined;
1222
+ order_by?: {
1223
+ field: string;
1224
+ direction?: "asc" | "desc" | undefined;
1225
+ }[] | undefined;
1226
+ limit?: number | undefined;
1227
+ offset?: number | undefined;
1228
+ formatting?: Record<string, import("../model/dashboard.types.js").JsonValue> | undefined;
911
1229
  };
912
1230
  };
913
1231
  data: unknown;
@@ -151,8 +151,8 @@ Use resource, not resourceId.
151
151
 
152
152
  ## Query shape rules
153
153
 
154
- Use dashboard_configure_funnel_chart_widget for funnel charts and set query.steps.
155
- Do not use query.steps for kpi_card, gauge_card, table, pivot_table, line, bar, stacked bar, pie, or histogram charts.
154
+ All chart widgets, including funnel charts, use the same query shape.
155
+ Use a single-resource query by default.
156
156
 
157
157
  For kpi_card and normal charts, use:
158
158
  - query.resource
@@ -162,6 +162,29 @@ For kpi_card and normal charts, use:
162
162
  - optional query.order_by
163
163
  - optional query.calcs
164
164
 
165
+ For multi-resource charts or widgets, use the general steps source:
166
+
167
+ query:
168
+ source: steps
169
+ steps:
170
+ - name: Leads
171
+ resource: leads
172
+ metric:
173
+ agg: count
174
+ as: value
175
+ - name: Customers
176
+ resource: orders
177
+ metric:
178
+ agg: count_distinct
179
+ field: customer_id
180
+ as: value
181
+
182
+ Each step may use either:
183
+ - metric for one aggregate
184
+ - select for multiple aggregate fields
185
+
186
+ Do not use bare query.steps without source: steps.
187
+
165
188
  ## Date range rules
166
189
 
167
190
  Use only query.filters for time ranges.
@@ -203,7 +226,7 @@ select raw token totals:
203
226
  then query.calcs:
204
227
  - calculate total_spend from those aliases and lookup variables
205
228
 
206
- For today vs yesterday KPI, use multiple aggregate select items with filters and distinct aliases, then calcs. Do not use query.steps.
229
+ For today vs yesterday KPI, use multiple aggregate select items with filters and distinct aliases, then calcs.
207
230
 
208
231
  ## Calc variables
209
232