react-semaphor 0.1.369 → 0.1.370
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/dist/analytics-protocol/index.cjs +1 -1
- package/dist/analytics-protocol/index.js +1 -1
- package/dist/chunks/validation-DYL3ArlL.js +1 -0
- package/dist/chunks/{validation-nOPr0mTk.js → validation-PPSpYtVf.js} +304 -207
- package/dist/chunks/validators-CgxWT8UX.js +1 -0
- package/dist/chunks/validators-DBNa-eb1.js +1799 -0
- package/dist/dashboard-authoring/index.cjs +1 -1
- package/dist/dashboard-authoring/index.js +1 -1
- package/dist/data-app-sdk/index.cjs +1 -1
- package/dist/data-app-sdk/index.js +251 -180
- package/dist/data-app-sdk-validation/index.cjs +1 -1
- package/dist/data-app-sdk-validation/index.js +3 -3
- package/dist/types/analytics-protocol.d.ts +451 -2
- package/dist/types/dashboard-assistant.d.ts +448 -2
- package/dist/types/dashboard-authoring.d.ts +159 -1
- package/dist/types/data-app-builder.d.ts +156 -1
- package/dist/types/data-app-sdk-validation.d.ts +470 -3
- package/dist/types/data-app-sdk.d.ts +490 -5
- package/dist/types/main.d.ts +156 -1
- package/package.json +1 -1
- package/dist/chunks/validation-Dsf7PydY.js +0 -1
- package/dist/chunks/validators-CVuWOHYv.js +0 -1032
- package/dist/chunks/validators-oc8qtP4q.js +0 -1
|
@@ -534,6 +534,289 @@ declare interface JoinPlan {
|
|
|
534
534
|
|
|
535
535
|
declare type LogicalOperator = 'AND' | 'OR';
|
|
536
536
|
|
|
537
|
+
declare type MatrixAxisLevelDescriptor = {
|
|
538
|
+
instanceId: string;
|
|
539
|
+
fieldKey: string;
|
|
540
|
+
label: string;
|
|
541
|
+
field: SemaphorFieldRef;
|
|
542
|
+
grain?: SemaphorTimeGrain;
|
|
543
|
+
subtotal?: SemaphorMatrixSubtotalOptions;
|
|
544
|
+
};
|
|
545
|
+
|
|
546
|
+
declare type MatrixAxisPayload = {
|
|
547
|
+
id: 'rows' | 'columns';
|
|
548
|
+
levels: MatrixAxisLevelDescriptor[];
|
|
549
|
+
nodes: MatrixNode[];
|
|
550
|
+
};
|
|
551
|
+
|
|
552
|
+
declare type MatrixCapability = 'rowHierarchy' | 'columnHierarchy' | 'rowSubtotals' | 'columnSubtotals' | 'grandTotals' | 'lazyRows' | 'lazyColumns' | 'conditionalFormatting' | 'visualExport' | (string & {});
|
|
553
|
+
|
|
554
|
+
declare type MatrixCell = {
|
|
555
|
+
id: string;
|
|
556
|
+
rowNodeId: string;
|
|
557
|
+
columnNodeId?: string;
|
|
558
|
+
measureInstanceId: string;
|
|
559
|
+
rowPath: MatrixMemberPathSegment[];
|
|
560
|
+
columnPath: MatrixMemberPathSegment[];
|
|
561
|
+
rawValue: unknown;
|
|
562
|
+
presence: MatrixCellPresence;
|
|
563
|
+
formattedValue?: string;
|
|
564
|
+
role: MatrixCellRole;
|
|
565
|
+
aggregateFunction?: SemaphorAggregateFunction;
|
|
566
|
+
formattingScope: MatrixCellFormattingScope;
|
|
567
|
+
actions?: MatrixCellAction[];
|
|
568
|
+
};
|
|
569
|
+
|
|
570
|
+
declare type MatrixCellAction = {
|
|
571
|
+
kind: 'requestSubgoal' | 'filter' | 'copyValue' | 'explainCalculation' | 'inspectContributingRows' | 'drillThrough' | (string & {});
|
|
572
|
+
label?: string;
|
|
573
|
+
payload?: Record<string, unknown>;
|
|
574
|
+
};
|
|
575
|
+
|
|
576
|
+
declare type MatrixCellFormattingScope = {
|
|
577
|
+
rowNodeId: string;
|
|
578
|
+
columnNodeId?: string;
|
|
579
|
+
measureInstanceId: string;
|
|
580
|
+
role: MatrixCellRole;
|
|
581
|
+
rowPath: MatrixMemberPathSegment[];
|
|
582
|
+
columnPath: MatrixMemberPathSegment[];
|
|
583
|
+
};
|
|
584
|
+
|
|
585
|
+
declare type MatrixCellPresence = 'present' | 'presentNull' | 'missing' | 'densified';
|
|
586
|
+
|
|
587
|
+
declare type MatrixCellRole = 'value' | 'rowSubtotal' | 'columnSubtotal' | 'subtotalIntersection' | 'rowGrandTotal' | 'columnGrandTotal' | 'matrixGrandTotal';
|
|
588
|
+
|
|
589
|
+
declare type MatrixExecutionMetadata = {
|
|
590
|
+
strategy?: MatrixQueryStrategy;
|
|
591
|
+
dialect?: SemaphorDialect;
|
|
592
|
+
rowNodeCount?: number;
|
|
593
|
+
columnNodeCount?: number;
|
|
594
|
+
cellCount?: number;
|
|
595
|
+
groupingSetCount?: number;
|
|
596
|
+
queryDurationMs?: number;
|
|
597
|
+
budgetRejected?: boolean;
|
|
598
|
+
cacheStatus?: 'hit' | 'miss' | 'bypass';
|
|
599
|
+
[key: string]: unknown;
|
|
600
|
+
};
|
|
601
|
+
|
|
602
|
+
declare type MatrixExpansionRequest = {
|
|
603
|
+
axis: 'row' | 'column';
|
|
604
|
+
path: MatrixMemberPathSegment[];
|
|
605
|
+
depth?: number;
|
|
606
|
+
};
|
|
607
|
+
|
|
608
|
+
declare type MatrixExpansionResponseHints = {
|
|
609
|
+
rowLazyLoading?: boolean;
|
|
610
|
+
columnLazyLoading?: boolean;
|
|
611
|
+
expandableRowNodeIds?: string[];
|
|
612
|
+
expandableColumnNodeIds?: string[];
|
|
613
|
+
nextRequests?: MatrixExpansionRequest[];
|
|
614
|
+
};
|
|
615
|
+
|
|
616
|
+
declare type MatrixFieldDescriptor = {
|
|
617
|
+
instanceId: string;
|
|
618
|
+
fieldKey: string;
|
|
619
|
+
field: SemaphorFieldRef;
|
|
620
|
+
role: 'row' | 'column' | 'measure' | 'sort' | 'filter';
|
|
621
|
+
label?: string;
|
|
622
|
+
};
|
|
623
|
+
|
|
624
|
+
declare type MatrixFieldDirectory = {
|
|
625
|
+
fieldsByInstanceId: Record<string, MatrixFieldDescriptor>;
|
|
626
|
+
};
|
|
627
|
+
|
|
628
|
+
declare type MatrixFormattingContext = {
|
|
629
|
+
domains?: Record<string, {
|
|
630
|
+
min?: number;
|
|
631
|
+
max?: number;
|
|
632
|
+
}>;
|
|
633
|
+
rules?: Array<Record<string, unknown>>;
|
|
634
|
+
};
|
|
635
|
+
|
|
636
|
+
declare type MatrixGridCell = {
|
|
637
|
+
id: string;
|
|
638
|
+
columnId: string;
|
|
639
|
+
cellId?: string;
|
|
640
|
+
rawValue: unknown;
|
|
641
|
+
formattedValue?: string;
|
|
642
|
+
presence: MatrixCellPresence;
|
|
643
|
+
role: MatrixCellRole;
|
|
644
|
+
measureInstanceId: string;
|
|
645
|
+
rowPath: MatrixMemberPathSegment[];
|
|
646
|
+
columnPath: MatrixMemberPathSegment[];
|
|
647
|
+
};
|
|
648
|
+
|
|
649
|
+
declare type MatrixGridColumn = {
|
|
650
|
+
id: string;
|
|
651
|
+
label: string;
|
|
652
|
+
columnNodeId?: string;
|
|
653
|
+
columnPath: MatrixMemberPathSegment[];
|
|
654
|
+
measureInstanceId: string;
|
|
655
|
+
role: 'value' | 'columnSubtotal' | 'columnGrandTotal';
|
|
656
|
+
};
|
|
657
|
+
|
|
658
|
+
declare type MatrixGridHeaderCell = {
|
|
659
|
+
id: string;
|
|
660
|
+
label: string;
|
|
661
|
+
role: 'rowHeader' | 'columnHeader' | 'measureHeader' | 'subtotal' | 'grandTotal';
|
|
662
|
+
colSpan: number;
|
|
663
|
+
rowSpan: number;
|
|
664
|
+
columnPath: MatrixMemberPathSegment[];
|
|
665
|
+
measureInstanceId?: string;
|
|
666
|
+
};
|
|
667
|
+
|
|
668
|
+
declare type MatrixGridHeaderRow = {
|
|
669
|
+
id: string;
|
|
670
|
+
cells: MatrixGridHeaderCell[];
|
|
671
|
+
};
|
|
672
|
+
|
|
673
|
+
declare type MatrixGridProjection = {
|
|
674
|
+
schemaVersion: 1;
|
|
675
|
+
shape: MatrixShape;
|
|
676
|
+
rowHeaderLevels: MatrixGridRowHeaderLevel[];
|
|
677
|
+
columnHeaderRows: MatrixGridHeaderRow[];
|
|
678
|
+
columns: MatrixGridColumn[];
|
|
679
|
+
rows: MatrixGridRow[];
|
|
680
|
+
};
|
|
681
|
+
|
|
682
|
+
declare type MatrixGridRow = {
|
|
683
|
+
id: string;
|
|
684
|
+
rowNodeId: string;
|
|
685
|
+
rowPath: MatrixMemberPathSegment[];
|
|
686
|
+
depth: number;
|
|
687
|
+
label: string;
|
|
688
|
+
role: 'value' | 'rowSubtotal' | 'rowGrandTotal';
|
|
689
|
+
isExpanded?: boolean;
|
|
690
|
+
hasChildren?: boolean;
|
|
691
|
+
cells: MatrixGridCell[];
|
|
692
|
+
};
|
|
693
|
+
|
|
694
|
+
declare type MatrixGridRowHeaderLevel = {
|
|
695
|
+
id: string;
|
|
696
|
+
label: string;
|
|
697
|
+
fieldInstanceId: string;
|
|
698
|
+
};
|
|
699
|
+
|
|
700
|
+
declare type MatrixMeasureDescriptor = {
|
|
701
|
+
instanceId: string;
|
|
702
|
+
fieldKey: string;
|
|
703
|
+
label: string;
|
|
704
|
+
field: SemaphorFieldRef;
|
|
705
|
+
aggregate?: SemaphorAggregateFunction;
|
|
706
|
+
totalBehavior?: SemaphorMatrixTotalCalculation;
|
|
707
|
+
};
|
|
708
|
+
|
|
709
|
+
declare type MatrixMeasureSemantics = {
|
|
710
|
+
kind: 'additive';
|
|
711
|
+
aggregate?: SemaphorAggregateFunction;
|
|
712
|
+
} | {
|
|
713
|
+
kind: 'semiAdditive';
|
|
714
|
+
aggregate?: SemaphorAggregateFunction;
|
|
715
|
+
grain?: SemaphorTimeGrain;
|
|
716
|
+
} | {
|
|
717
|
+
kind: 'nonAdditive';
|
|
718
|
+
aggregate?: SemaphorAggregateFunction;
|
|
719
|
+
} | {
|
|
720
|
+
kind: 'ratio';
|
|
721
|
+
numeratorMeasureInstanceId?: string;
|
|
722
|
+
denominatorMeasureInstanceId?: string;
|
|
723
|
+
} | {
|
|
724
|
+
kind: 'custom';
|
|
725
|
+
expressionId?: string;
|
|
726
|
+
};
|
|
727
|
+
|
|
728
|
+
declare type MatrixMemberPathSegment = {
|
|
729
|
+
instanceId: string;
|
|
730
|
+
fieldKey: string;
|
|
731
|
+
value: unknown;
|
|
732
|
+
label: string;
|
|
733
|
+
};
|
|
734
|
+
|
|
735
|
+
declare type MatrixNode = {
|
|
736
|
+
id: string;
|
|
737
|
+
axis: 'row' | 'column';
|
|
738
|
+
path: MatrixMemberPathSegment[];
|
|
739
|
+
level: number;
|
|
740
|
+
label: string;
|
|
741
|
+
value: unknown;
|
|
742
|
+
parentId?: string;
|
|
743
|
+
hasChildren: boolean;
|
|
744
|
+
isExpanded?: boolean;
|
|
745
|
+
isSubtotal?: boolean;
|
|
746
|
+
isGrandTotal?: boolean;
|
|
747
|
+
subtotalFunction?: SemaphorAggregateFunction;
|
|
748
|
+
childCount?: number;
|
|
749
|
+
actions?: MatrixNodeAction[];
|
|
750
|
+
};
|
|
751
|
+
|
|
752
|
+
declare type MatrixNodeAction = {
|
|
753
|
+
kind: 'expand' | 'collapse' | 'requestSubgoal' | 'filter' | 'drillThrough' | 'openRelatedRecords' | (string & {});
|
|
754
|
+
label?: string;
|
|
755
|
+
payload?: Record<string, unknown>;
|
|
756
|
+
};
|
|
757
|
+
|
|
758
|
+
declare type MatrixPageInfo = {
|
|
759
|
+
rowOffset?: number;
|
|
760
|
+
rowLimit?: number;
|
|
761
|
+
columnOffset?: number;
|
|
762
|
+
columnLimit?: number;
|
|
763
|
+
hasMoreRows?: boolean;
|
|
764
|
+
hasMoreColumns?: boolean;
|
|
765
|
+
};
|
|
766
|
+
|
|
767
|
+
declare type MatrixPayload = {
|
|
768
|
+
kind: 'matrixPayload';
|
|
769
|
+
schemaVersion: 1;
|
|
770
|
+
shape: MatrixShape;
|
|
771
|
+
capabilities: MatrixCapability[];
|
|
772
|
+
executionMetadata: MatrixExecutionMetadata;
|
|
773
|
+
axes: {
|
|
774
|
+
rows: MatrixAxisPayload;
|
|
775
|
+
columns: MatrixAxisPayload;
|
|
776
|
+
};
|
|
777
|
+
measures: MatrixMeasureDescriptor[];
|
|
778
|
+
measureSemantics: Record<string, MatrixMeasureSemantics>;
|
|
779
|
+
fieldDirectory: MatrixFieldDirectory;
|
|
780
|
+
rowNodes: MatrixNode[];
|
|
781
|
+
columnNodes: MatrixNode[];
|
|
782
|
+
cells: MatrixCell[];
|
|
783
|
+
totals: MatrixTotals;
|
|
784
|
+
sort: MatrixResolvedSort[];
|
|
785
|
+
formattingContext: MatrixFormattingContext;
|
|
786
|
+
pageInfo?: MatrixPageInfo;
|
|
787
|
+
warnings?: MatrixWarning[];
|
|
788
|
+
};
|
|
789
|
+
|
|
790
|
+
declare type MatrixQueryStrategy = 'tall' | 'wide' | 'lazy' | 'export';
|
|
791
|
+
|
|
792
|
+
declare type MatrixResolvedSort = {
|
|
793
|
+
id: string;
|
|
794
|
+
axis: 'row' | 'column';
|
|
795
|
+
targetInstanceId?: string;
|
|
796
|
+
direction: 'asc' | 'desc';
|
|
797
|
+
nulls?: 'warehouseDefault' | 'first' | 'last';
|
|
798
|
+
scope?: 'global' | 'withinParent';
|
|
799
|
+
by: SemaphorMatrixSortRule['by'];
|
|
800
|
+
};
|
|
801
|
+
|
|
802
|
+
declare type MatrixShape = 'hierarchical' | 'pivot';
|
|
803
|
+
|
|
804
|
+
declare type MatrixTotals = {
|
|
805
|
+
rows?: boolean;
|
|
806
|
+
columns?: boolean;
|
|
807
|
+
grandTotal?: boolean | {
|
|
808
|
+
rows?: boolean;
|
|
809
|
+
columns?: boolean;
|
|
810
|
+
};
|
|
811
|
+
};
|
|
812
|
+
|
|
813
|
+
declare type MatrixWarning = {
|
|
814
|
+
code: string;
|
|
815
|
+
message: string;
|
|
816
|
+
path?: string;
|
|
817
|
+
severity?: 'info' | 'warning' | 'error';
|
|
818
|
+
};
|
|
819
|
+
|
|
537
820
|
declare interface MetricField extends Field {
|
|
538
821
|
role: 'metric';
|
|
539
822
|
aggregate?: AggregateFunction;
|
|
@@ -648,7 +931,7 @@ declare type SemaphorAnalyticsFilterBase = {
|
|
|
648
931
|
|
|
649
932
|
declare type SemaphorAnalyticsFilterOperator = SemaphorInputOperator | 'not_contains' | 'is_null' | 'is_not_null';
|
|
650
933
|
|
|
651
|
-
declare type SemaphorAnalyticsIntent = SemaphorMetricIntent | SemaphorRecordsIntent | SemaphorInputOptionsIntent | SemaphorSqlIntent;
|
|
934
|
+
declare type SemaphorAnalyticsIntent = SemaphorMetricIntent | SemaphorRecordsIntent | SemaphorInputOptionsIntent | SemaphorSqlIntent | SemaphorMatrixIntent;
|
|
652
935
|
|
|
653
936
|
declare type SemaphorAnalyticsNullFilter = SemaphorAnalyticsFilterBase & {
|
|
654
937
|
operator: SemaphorAnalyticsNullFilterOperator;
|
|
@@ -673,7 +956,7 @@ declare type SemaphorAnalyticsRepairHint = {
|
|
|
673
956
|
recommendedNextStep: string;
|
|
674
957
|
};
|
|
675
958
|
|
|
676
|
-
declare type SemaphorAnalyticsResult = SemaphorMetricResult | SemaphorRecordsResult | SemaphorInputOptionsResult | SemaphorSqlResult;
|
|
959
|
+
declare type SemaphorAnalyticsResult = SemaphorMetricResult | SemaphorRecordsResult | SemaphorInputOptionsResult | SemaphorSqlResult | SemaphorMatrixResult;
|
|
677
960
|
|
|
678
961
|
declare type SemaphorAnalyticsResultBase = {
|
|
679
962
|
intentId?: string;
|
|
@@ -742,6 +1025,14 @@ declare type SemaphorExecutionFieldRef = SemaphorFieldRef & {
|
|
|
742
1025
|
aggregateSource?: SemaphorMetricAggregateSource;
|
|
743
1026
|
};
|
|
744
1027
|
|
|
1028
|
+
/**
|
|
1029
|
+
* Explorer-backed table source. This is intentionally distinct from raw SQL:
|
|
1030
|
+
* matrix planning needs stable source metadata, fields, and dialect context.
|
|
1031
|
+
*/
|
|
1032
|
+
declare type SemaphorExplorerSourceRef = Extract<SemaphorSourceRef, {
|
|
1033
|
+
kind: 'physical';
|
|
1034
|
+
}>;
|
|
1035
|
+
|
|
745
1036
|
declare type SemaphorFieldRef = {
|
|
746
1037
|
name: string;
|
|
747
1038
|
label?: string;
|
|
@@ -781,6 +1072,157 @@ declare type SemaphorInputOptionsResult = SemaphorAnalyticsResultBase & {
|
|
|
781
1072
|
}>;
|
|
782
1073
|
};
|
|
783
1074
|
|
|
1075
|
+
declare type SemaphorMatrixAxisExpansionOptions = {
|
|
1076
|
+
defaultDepth?: number;
|
|
1077
|
+
lazy?: boolean;
|
|
1078
|
+
expandedPaths?: SemaphorMatrixMemberPathSegment[][];
|
|
1079
|
+
};
|
|
1080
|
+
|
|
1081
|
+
declare type SemaphorMatrixAxisLevel = {
|
|
1082
|
+
id?: string;
|
|
1083
|
+
field: SemaphorFieldRef;
|
|
1084
|
+
grain?: SemaphorTimeGrain;
|
|
1085
|
+
label?: string;
|
|
1086
|
+
subtotal?: boolean | SemaphorMatrixSubtotalOptions;
|
|
1087
|
+
sortBy?: SemaphorMatrixAxisSortRule;
|
|
1088
|
+
};
|
|
1089
|
+
|
|
1090
|
+
declare type SemaphorMatrixAxisSortRule = {
|
|
1091
|
+
direction: 'asc' | 'desc';
|
|
1092
|
+
by: {
|
|
1093
|
+
kind: 'label';
|
|
1094
|
+
} | {
|
|
1095
|
+
kind: 'field';
|
|
1096
|
+
field: SemaphorFieldRef;
|
|
1097
|
+
aggregate?: SemaphorAggregateFunction;
|
|
1098
|
+
};
|
|
1099
|
+
nulls?: 'warehouseDefault' | 'first' | 'last';
|
|
1100
|
+
scope?: 'global' | 'withinParent';
|
|
1101
|
+
};
|
|
1102
|
+
|
|
1103
|
+
declare type SemaphorMatrixDisplayLimitOptions = {
|
|
1104
|
+
rows?: SemaphorMatrixDisplayLimitRule;
|
|
1105
|
+
columns?: SemaphorMatrixDisplayLimitRule;
|
|
1106
|
+
};
|
|
1107
|
+
|
|
1108
|
+
declare type SemaphorMatrixDisplayLimitRule = {
|
|
1109
|
+
limit: number;
|
|
1110
|
+
by?: 'label' | 'value';
|
|
1111
|
+
direction?: 'top' | 'bottom';
|
|
1112
|
+
others?: boolean | {
|
|
1113
|
+
label?: string;
|
|
1114
|
+
};
|
|
1115
|
+
};
|
|
1116
|
+
|
|
1117
|
+
declare type SemaphorMatrixExpansionOptions = {
|
|
1118
|
+
rows?: SemaphorMatrixAxisExpansionOptions;
|
|
1119
|
+
columns?: SemaphorMatrixAxisExpansionOptions;
|
|
1120
|
+
};
|
|
1121
|
+
|
|
1122
|
+
declare type SemaphorMatrixIntent = {
|
|
1123
|
+
kind: 'matrix';
|
|
1124
|
+
version?: SemaphorProtocolVersion;
|
|
1125
|
+
id?: string;
|
|
1126
|
+
label?: string;
|
|
1127
|
+
source: SemaphorMatrixSourceRef;
|
|
1128
|
+
rows: SemaphorMatrixAxisLevel[];
|
|
1129
|
+
columns?: SemaphorMatrixAxisLevel[];
|
|
1130
|
+
values: SemaphorMatrixValueField[];
|
|
1131
|
+
filters?: SemaphorAnalyticsFilter[];
|
|
1132
|
+
inputs?: SemaphorInputBinding[];
|
|
1133
|
+
totals?: SemaphorMatrixTotalOptions;
|
|
1134
|
+
sort?: SemaphorMatrixSortRule[];
|
|
1135
|
+
expansion?: SemaphorMatrixExpansionOptions;
|
|
1136
|
+
layout?: SemaphorMatrixLayoutOptions;
|
|
1137
|
+
displayLimits?: SemaphorMatrixDisplayLimitOptions;
|
|
1138
|
+
};
|
|
1139
|
+
|
|
1140
|
+
declare type SemaphorMatrixLayoutOptions = {
|
|
1141
|
+
hierarchy?: 'compact' | 'tabular' | 'outline';
|
|
1142
|
+
valuesPlacement?: 'columns' | 'rows';
|
|
1143
|
+
stickyRowHeaders?: boolean;
|
|
1144
|
+
stickyColumnHeaders?: boolean;
|
|
1145
|
+
};
|
|
1146
|
+
|
|
1147
|
+
declare type SemaphorMatrixMemberPathSegment = {
|
|
1148
|
+
levelId: string;
|
|
1149
|
+
value: unknown;
|
|
1150
|
+
};
|
|
1151
|
+
|
|
1152
|
+
declare type SemaphorMatrixResult = SemaphorAnalyticsResultBase & {
|
|
1153
|
+
kind: 'matrix';
|
|
1154
|
+
intent: SemaphorMatrixIntent;
|
|
1155
|
+
payload: MatrixPayload;
|
|
1156
|
+
grid: MatrixGridProjection;
|
|
1157
|
+
expansion?: MatrixExpansionResponseHints;
|
|
1158
|
+
};
|
|
1159
|
+
|
|
1160
|
+
declare type SemaphorMatrixSortRule = {
|
|
1161
|
+
axis: 'row' | 'column';
|
|
1162
|
+
targetId?: string;
|
|
1163
|
+
direction: 'asc' | 'desc';
|
|
1164
|
+
by: {
|
|
1165
|
+
kind: 'label';
|
|
1166
|
+
} | {
|
|
1167
|
+
kind: 'field';
|
|
1168
|
+
field: SemaphorFieldRef;
|
|
1169
|
+
aggregate?: SemaphorAggregateFunction;
|
|
1170
|
+
} | {
|
|
1171
|
+
kind: 'value';
|
|
1172
|
+
valueId: string;
|
|
1173
|
+
rowPath?: SemaphorMatrixMemberPathSegment[];
|
|
1174
|
+
columnPath?: SemaphorMatrixMemberPathSegment[];
|
|
1175
|
+
};
|
|
1176
|
+
nulls?: 'warehouseDefault' | 'first' | 'last';
|
|
1177
|
+
scope?: 'global' | 'withinParent';
|
|
1178
|
+
};
|
|
1179
|
+
|
|
1180
|
+
declare type SemaphorMatrixSourceRef = SemaphorSemanticSourceRef | SemaphorExplorerSourceRef;
|
|
1181
|
+
|
|
1182
|
+
declare type SemaphorMatrixSubtotalOptions = {
|
|
1183
|
+
enabled?: boolean;
|
|
1184
|
+
position?: 'before' | 'after';
|
|
1185
|
+
label?: string;
|
|
1186
|
+
};
|
|
1187
|
+
|
|
1188
|
+
declare type SemaphorMatrixTotalCalculation = {
|
|
1189
|
+
kind: 'defaultAggregate';
|
|
1190
|
+
} | {
|
|
1191
|
+
kind: 'blank';
|
|
1192
|
+
} | {
|
|
1193
|
+
kind: 'labelOnly';
|
|
1194
|
+
label?: string;
|
|
1195
|
+
} | {
|
|
1196
|
+
kind: 'customAggregate';
|
|
1197
|
+
aggregate: SemaphorAggregateFunction;
|
|
1198
|
+
} | {
|
|
1199
|
+
kind: 'percentOfParent';
|
|
1200
|
+
} | {
|
|
1201
|
+
kind: 'percentOfGrandTotal';
|
|
1202
|
+
} | {
|
|
1203
|
+
kind: 'customExpression';
|
|
1204
|
+
expressionId: string;
|
|
1205
|
+
};
|
|
1206
|
+
|
|
1207
|
+
declare type SemaphorMatrixTotalOptions = {
|
|
1208
|
+
rows?: boolean | 'perLevel';
|
|
1209
|
+
columns?: boolean | 'perLevel';
|
|
1210
|
+
grandTotal?: boolean | {
|
|
1211
|
+
rows?: boolean;
|
|
1212
|
+
columns?: boolean;
|
|
1213
|
+
};
|
|
1214
|
+
rowPosition?: 'top' | 'bottom';
|
|
1215
|
+
columnPosition?: 'left' | 'right';
|
|
1216
|
+
};
|
|
1217
|
+
|
|
1218
|
+
declare type SemaphorMatrixValueField = {
|
|
1219
|
+
id?: string;
|
|
1220
|
+
field: SemaphorFieldRef;
|
|
1221
|
+
aggregate?: SemaphorAggregateFunction;
|
|
1222
|
+
label?: string;
|
|
1223
|
+
totalBehavior?: SemaphorMatrixTotalCalculation;
|
|
1224
|
+
};
|
|
1225
|
+
|
|
784
1226
|
declare type SemaphorMetricAggregateSource = 'semantic_model' | 'caller_override' | 'default_sum';
|
|
785
1227
|
|
|
786
1228
|
declare type SemaphorMetricAnalysis = {
|
|
@@ -926,6 +1368,10 @@ declare type SemaphorResultColumn = {
|
|
|
926
1368
|
source?: SemaphorFieldRef['source'];
|
|
927
1369
|
};
|
|
928
1370
|
|
|
1371
|
+
declare type SemaphorSemanticSourceRef = Extract<SemaphorSourceRef, {
|
|
1372
|
+
kind: 'semantic';
|
|
1373
|
+
}>;
|
|
1374
|
+
|
|
929
1375
|
declare type SemaphorSourceRef = {
|
|
930
1376
|
kind: 'semantic';
|
|
931
1377
|
domainId: string;
|
|
@@ -1828,7 +1828,7 @@ declare type SemaphorAnalyticsFilterBase = {
|
|
|
1828
1828
|
|
|
1829
1829
|
declare type SemaphorAnalyticsFilterOperator = SemaphorInputOperator | 'not_contains' | 'is_null' | 'is_not_null';
|
|
1830
1830
|
|
|
1831
|
-
declare type SemaphorAnalyticsIntent = SemaphorMetricIntent | SemaphorRecordsIntent | SemaphorInputOptionsIntent | SemaphorSqlIntent;
|
|
1831
|
+
declare type SemaphorAnalyticsIntent = SemaphorMetricIntent | SemaphorRecordsIntent | SemaphorInputOptionsIntent | SemaphorSqlIntent | SemaphorMatrixIntent;
|
|
1832
1832
|
|
|
1833
1833
|
declare type SemaphorAnalyticsNullFilter = SemaphorAnalyticsFilterBase & {
|
|
1834
1834
|
operator: SemaphorAnalyticsNullFilterOperator;
|
|
@@ -1871,6 +1871,14 @@ declare type SemaphorDashboardViewIntent = {
|
|
|
1871
1871
|
|
|
1872
1872
|
declare type SemaphorDialect = 'postgres' | 'mysql' | 'mssql' | 'snowflake' | 'clickhouse' | 'bigquery' | 'redshift' | 'duckdb' | 'sqlite' | 'unknown';
|
|
1873
1873
|
|
|
1874
|
+
/**
|
|
1875
|
+
* Explorer-backed table source. This is intentionally distinct from raw SQL:
|
|
1876
|
+
* matrix planning needs stable source metadata, fields, and dialect context.
|
|
1877
|
+
*/
|
|
1878
|
+
declare type SemaphorExplorerSourceRef = Extract<SemaphorSourceRef, {
|
|
1879
|
+
kind: 'physical';
|
|
1880
|
+
}>;
|
|
1881
|
+
|
|
1874
1882
|
declare type SemaphorFieldRef = {
|
|
1875
1883
|
name: string;
|
|
1876
1884
|
label?: string;
|
|
@@ -1928,6 +1936,149 @@ declare type SemaphorInputSpec = {
|
|
|
1928
1936
|
scope?: SemaphorInputScope;
|
|
1929
1937
|
};
|
|
1930
1938
|
|
|
1939
|
+
declare type SemaphorMatrixAxisExpansionOptions = {
|
|
1940
|
+
defaultDepth?: number;
|
|
1941
|
+
lazy?: boolean;
|
|
1942
|
+
expandedPaths?: SemaphorMatrixMemberPathSegment[][];
|
|
1943
|
+
};
|
|
1944
|
+
|
|
1945
|
+
declare type SemaphorMatrixAxisLevel = {
|
|
1946
|
+
id?: string;
|
|
1947
|
+
field: SemaphorFieldRef;
|
|
1948
|
+
grain?: SemaphorTimeGrain;
|
|
1949
|
+
label?: string;
|
|
1950
|
+
subtotal?: boolean | SemaphorMatrixSubtotalOptions;
|
|
1951
|
+
sortBy?: SemaphorMatrixAxisSortRule;
|
|
1952
|
+
};
|
|
1953
|
+
|
|
1954
|
+
declare type SemaphorMatrixAxisSortRule = {
|
|
1955
|
+
direction: 'asc' | 'desc';
|
|
1956
|
+
by: {
|
|
1957
|
+
kind: 'label';
|
|
1958
|
+
} | {
|
|
1959
|
+
kind: 'field';
|
|
1960
|
+
field: SemaphorFieldRef;
|
|
1961
|
+
aggregate?: SemaphorAggregateFunction;
|
|
1962
|
+
};
|
|
1963
|
+
nulls?: 'warehouseDefault' | 'first' | 'last';
|
|
1964
|
+
scope?: 'global' | 'withinParent';
|
|
1965
|
+
};
|
|
1966
|
+
|
|
1967
|
+
declare type SemaphorMatrixDisplayLimitOptions = {
|
|
1968
|
+
rows?: SemaphorMatrixDisplayLimitRule;
|
|
1969
|
+
columns?: SemaphorMatrixDisplayLimitRule;
|
|
1970
|
+
};
|
|
1971
|
+
|
|
1972
|
+
declare type SemaphorMatrixDisplayLimitRule = {
|
|
1973
|
+
limit: number;
|
|
1974
|
+
by?: 'label' | 'value';
|
|
1975
|
+
direction?: 'top' | 'bottom';
|
|
1976
|
+
others?: boolean | {
|
|
1977
|
+
label?: string;
|
|
1978
|
+
};
|
|
1979
|
+
};
|
|
1980
|
+
|
|
1981
|
+
declare type SemaphorMatrixExpansionOptions = {
|
|
1982
|
+
rows?: SemaphorMatrixAxisExpansionOptions;
|
|
1983
|
+
columns?: SemaphorMatrixAxisExpansionOptions;
|
|
1984
|
+
};
|
|
1985
|
+
|
|
1986
|
+
declare type SemaphorMatrixIntent = {
|
|
1987
|
+
kind: 'matrix';
|
|
1988
|
+
version?: SemaphorProtocolVersion;
|
|
1989
|
+
id?: string;
|
|
1990
|
+
label?: string;
|
|
1991
|
+
source: SemaphorMatrixSourceRef;
|
|
1992
|
+
rows: SemaphorMatrixAxisLevel[];
|
|
1993
|
+
columns?: SemaphorMatrixAxisLevel[];
|
|
1994
|
+
values: SemaphorMatrixValueField[];
|
|
1995
|
+
filters?: SemaphorAnalyticsFilter[];
|
|
1996
|
+
inputs?: SemaphorInputBinding[];
|
|
1997
|
+
totals?: SemaphorMatrixTotalOptions;
|
|
1998
|
+
sort?: SemaphorMatrixSortRule[];
|
|
1999
|
+
expansion?: SemaphorMatrixExpansionOptions;
|
|
2000
|
+
layout?: SemaphorMatrixLayoutOptions;
|
|
2001
|
+
displayLimits?: SemaphorMatrixDisplayLimitOptions;
|
|
2002
|
+
};
|
|
2003
|
+
|
|
2004
|
+
declare type SemaphorMatrixLayoutOptions = {
|
|
2005
|
+
hierarchy?: 'compact' | 'tabular' | 'outline';
|
|
2006
|
+
valuesPlacement?: 'columns' | 'rows';
|
|
2007
|
+
stickyRowHeaders?: boolean;
|
|
2008
|
+
stickyColumnHeaders?: boolean;
|
|
2009
|
+
};
|
|
2010
|
+
|
|
2011
|
+
declare type SemaphorMatrixMemberPathSegment = {
|
|
2012
|
+
levelId: string;
|
|
2013
|
+
value: unknown;
|
|
2014
|
+
};
|
|
2015
|
+
|
|
2016
|
+
declare type SemaphorMatrixSortRule = {
|
|
2017
|
+
axis: 'row' | 'column';
|
|
2018
|
+
targetId?: string;
|
|
2019
|
+
direction: 'asc' | 'desc';
|
|
2020
|
+
by: {
|
|
2021
|
+
kind: 'label';
|
|
2022
|
+
} | {
|
|
2023
|
+
kind: 'field';
|
|
2024
|
+
field: SemaphorFieldRef;
|
|
2025
|
+
aggregate?: SemaphorAggregateFunction;
|
|
2026
|
+
} | {
|
|
2027
|
+
kind: 'value';
|
|
2028
|
+
valueId: string;
|
|
2029
|
+
rowPath?: SemaphorMatrixMemberPathSegment[];
|
|
2030
|
+
columnPath?: SemaphorMatrixMemberPathSegment[];
|
|
2031
|
+
};
|
|
2032
|
+
nulls?: 'warehouseDefault' | 'first' | 'last';
|
|
2033
|
+
scope?: 'global' | 'withinParent';
|
|
2034
|
+
};
|
|
2035
|
+
|
|
2036
|
+
declare type SemaphorMatrixSourceRef = SemaphorSemanticSourceRef | SemaphorExplorerSourceRef;
|
|
2037
|
+
|
|
2038
|
+
declare type SemaphorMatrixSubtotalOptions = {
|
|
2039
|
+
enabled?: boolean;
|
|
2040
|
+
position?: 'before' | 'after';
|
|
2041
|
+
label?: string;
|
|
2042
|
+
};
|
|
2043
|
+
|
|
2044
|
+
declare type SemaphorMatrixTotalCalculation = {
|
|
2045
|
+
kind: 'defaultAggregate';
|
|
2046
|
+
} | {
|
|
2047
|
+
kind: 'blank';
|
|
2048
|
+
} | {
|
|
2049
|
+
kind: 'labelOnly';
|
|
2050
|
+
label?: string;
|
|
2051
|
+
} | {
|
|
2052
|
+
kind: 'customAggregate';
|
|
2053
|
+
aggregate: SemaphorAggregateFunction;
|
|
2054
|
+
} | {
|
|
2055
|
+
kind: 'percentOfParent';
|
|
2056
|
+
} | {
|
|
2057
|
+
kind: 'percentOfGrandTotal';
|
|
2058
|
+
} | {
|
|
2059
|
+
kind: 'customExpression';
|
|
2060
|
+
expressionId: string;
|
|
2061
|
+
};
|
|
2062
|
+
|
|
2063
|
+
declare type SemaphorMatrixTotalOptions = {
|
|
2064
|
+
rows?: boolean | 'perLevel';
|
|
2065
|
+
columns?: boolean | 'perLevel';
|
|
2066
|
+
grandTotal?: boolean | {
|
|
2067
|
+
rows?: boolean;
|
|
2068
|
+
columns?: boolean;
|
|
2069
|
+
};
|
|
2070
|
+
rowPosition?: 'top' | 'bottom';
|
|
2071
|
+
columnPosition?: 'left' | 'right';
|
|
2072
|
+
};
|
|
2073
|
+
|
|
2074
|
+
declare type SemaphorMatrixValueField = {
|
|
2075
|
+
id?: string;
|
|
2076
|
+
field: SemaphorFieldRef;
|
|
2077
|
+
aggregate?: SemaphorAggregateFunction;
|
|
2078
|
+
label?: string;
|
|
2079
|
+
totalBehavior?: SemaphorMatrixTotalCalculation;
|
|
2080
|
+
};
|
|
2081
|
+
|
|
1931
2082
|
declare type SemaphorMetricAnalysis = {
|
|
1932
2083
|
kind: 'period_change';
|
|
1933
2084
|
orderBy?: 'absolute_change' | 'positive_change' | 'negative_change' | 'period';
|
|
@@ -1996,6 +2147,10 @@ declare type SemaphorRelativeTimeWindow = {
|
|
|
1996
2147
|
completeness?: 'include_partial' | 'complete_periods';
|
|
1997
2148
|
};
|
|
1998
2149
|
|
|
2150
|
+
declare type SemaphorSemanticSourceRef = Extract<SemaphorSourceRef, {
|
|
2151
|
+
kind: 'semantic';
|
|
2152
|
+
}>;
|
|
2153
|
+
|
|
1999
2154
|
declare type SemaphorSourceRef = {
|
|
2000
2155
|
kind: 'semantic';
|
|
2001
2156
|
domainId: string;
|
|
@@ -2051,6 +2206,9 @@ declare type SemaphorViewPresentation = {
|
|
|
2051
2206
|
} | {
|
|
2052
2207
|
kind: 'table';
|
|
2053
2208
|
columns?: string[];
|
|
2209
|
+
} | {
|
|
2210
|
+
kind: 'matrixTable';
|
|
2211
|
+
mode?: 'auto' | 'pivot' | 'hierarchical';
|
|
2054
2212
|
} | {
|
|
2055
2213
|
kind: 'text';
|
|
2056
2214
|
};
|