react-semaphor 0.1.443 → 0.1.445
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/CHANGELOG.md +7 -0
- package/dist/analytics-protocol/index.cjs +1 -1
- package/dist/analytics-protocol/index.js +123 -107
- package/dist/appearance/index.cjs +1 -1
- package/dist/brand-studio/index.cjs +2 -2
- package/dist/brand-studio/index.js +5 -4
- package/dist/briefings/index.cjs +1 -1
- package/dist/briefings/index.js +526 -457
- package/dist/chunks/analyze-result-contract-BHb7sUUW.cjs +1 -0
- package/dist/chunks/analyze-result-contract-DUv3QnMl.js +29 -0
- package/dist/chunks/{braces-CbO-aIwH.js → braces-BKimshER.cjs} +1 -1
- package/dist/chunks/{code-editor-BpADiIlq.js → code-editor-B4gTfvc5.js} +6800 -6560
- package/dist/chunks/code-editor-BYVorgOf.cjs +138 -0
- package/dist/chunks/common-types-CQ6SHfLk.cjs +1 -0
- package/dist/chunks/{common-types-ClkOI-3O.js → common-types-DFsDdpH7.js} +22 -21
- package/dist/chunks/dashboard-CAiwJW3L.cjs +1397 -0
- package/dist/chunks/{dashboard-briefing-launcher-C60n8LqW.js → dashboard-briefing-launcher-2SLNOaTg.js} +26 -24
- package/dist/chunks/{dashboard-briefing-launcher-BYMLjZxG.js → dashboard-briefing-launcher-CHwjpUYz.cjs} +2 -2
- package/dist/chunks/{dashboard-controls-ti9Rcel2.js → dashboard-controls-BfL14aqO.js} +11 -9
- package/dist/chunks/{dashboard-controls-BH_fZYDU.js → dashboard-controls-BgGTg4yw.cjs} +2 -2
- package/dist/chunks/dashboard-date-comparison-definition-DZq0htjG.cjs +1 -0
- package/dist/chunks/dashboard-json-BOv8tCa9.cjs +1 -0
- package/dist/chunks/{dashboard-json-Bturr634.js → dashboard-json-BZwq3EcS.js} +14 -12
- package/dist/chunks/{dashboard-Bd1Quco-.js → dashboard-u61yfU6u.js} +50081 -47351
- package/dist/chunks/edit-dashboard-visual-BdVCH0DJ.cjs +182 -0
- package/dist/chunks/{edit-dashboard-visual-DglMds57.js → edit-dashboard-visual-njLPYip3.js} +6825 -6656
- package/dist/chunks/{editor-action-buttons-CRi0fhVW.js → editor-action-buttons-BhLX5Q6m.js} +24 -23
- package/dist/chunks/{editor-action-buttons-Cxo7_tNG.js → editor-action-buttons-CBVMFipA.cjs} +1 -1
- package/dist/chunks/{index-D7KJindZ.js → format-types-CSv0V7mm.cjs} +1 -1
- package/dist/chunks/{index-CnujJ3fa.js → format-types-CZH5w1lo.js} +23 -17
- package/dist/chunks/{layout-grid-B08pP7v6.js → layout-grid-3-HWzEwU.cjs} +1 -1
- package/dist/chunks/{metric-comparison-CPoDx56y.js → metric-comparison-BJ_Qu1ZF.js} +1 -1
- package/dist/chunks/metric-comparison-CUAJ8n4y.cjs +1 -0
- package/dist/chunks/{palette-C0yjT5Tv.js → palette-DW_l7Jr0.cjs} +1 -1
- package/dist/chunks/pivot-result-identity-B6QCWOSi.js +94 -0
- package/dist/chunks/pivot-result-identity-CDLRT-YG.cjs +1 -0
- package/dist/chunks/pivot-result-lifecycle-BM3Pl-D1.js +914 -0
- package/dist/chunks/pivot-result-lifecycle-DPc0ANwk.cjs +4 -0
- package/dist/chunks/presentation-execution-BTV-Q43g.cjs +1 -0
- package/dist/chunks/presentation-execution-CGlb7YZ6.js +637 -0
- package/dist/chunks/{report-preferences-dialog-TtwdAuNn.js → report-preferences-dialog-D_NJu2wU.js} +7 -6
- package/dist/chunks/report-preferences-dialog-r8QzOSFb.cjs +1 -0
- package/dist/chunks/report-runtime-context-C8LZFsqV.cjs +1 -0
- package/dist/chunks/report-runtime-context-Qzn11HQe.js +387 -0
- package/dist/chunks/{save-Xdc4pnys.js → save-4_uMnE6s.cjs} +1 -1
- package/dist/chunks/{search-Dcud9ajy.js → search-6ZmeMq55.cjs} +1 -1
- package/dist/chunks/temporal-bucket-BnPxGrAi.js +446 -0
- package/dist/chunks/temporal-bucket-authoring-BUZMuVca.js +205 -0
- package/dist/chunks/temporal-bucket-authoring-CPTwHzvs.cjs +1 -0
- package/dist/chunks/temporal-bucket-contract-B2bJ1oe4.js +108 -0
- package/dist/chunks/temporal-bucket-contract-ChDBWX8I.cjs +1 -0
- package/dist/chunks/temporal-bucket-pMnV-4Nj.cjs +1 -0
- package/dist/chunks/{comparison-document-migration-Dj6xZMCb.js → temporal-result-owner-Cb27SSG9.js} +152 -123
- package/dist/chunks/temporal-result-owner-f6-i65Fb.cjs +1 -0
- package/dist/chunks/token-types-BdQ8kHBm.cjs +1 -0
- package/dist/chunks/token-types-DLo91nOf.js +8 -0
- package/dist/chunks/{update-policy-DnF_74zC.js → update-policy-BxvYMYz0.cjs} +1 -1
- package/dist/chunks/{update-policy-De2NswtM.js → update-policy-eg59mQqv.js} +1 -1
- package/dist/chunks/validators-9D4KBqKD.cjs +1 -0
- package/dist/chunks/validators-wZ2WlNHc.js +4640 -0
- package/dist/dashboard/index.cjs +1 -1
- package/dist/dashboard/index.js +2 -2
- package/dist/dashboard-authoring/index.cjs +3 -3
- package/dist/dashboard-authoring/index.js +136 -126
- package/dist/data-app-builder/index.cjs +1 -1
- package/dist/data-app-builder/index.js +2 -2
- package/dist/data-app-codegen/index.cjs +1 -1
- package/dist/data-app-codegen/index.js +2 -2
- package/dist/data-app-codegen-node/index.cjs +1 -1
- package/dist/data-app-codegen-node/index.js +3 -3
- package/dist/data-app-sdk/index.cjs +2 -2
- package/dist/data-app-sdk/index.js +34 -35
- package/dist/data-app-sdk-adapters/index.cjs +1 -1
- package/dist/data-app-sdk-adapters/index.js +5 -5
- package/dist/data-app-sdk-validation/index.cjs +1 -1
- package/dist/data-app-sdk-validation/index.js +9 -10
- package/dist/format-utils/index.cjs +3 -3
- package/dist/format-utils/index.js +155 -176
- package/dist/index.cjs +1 -1
- package/dist/index.js +180 -174
- package/dist/report-runtime-context/index.cjs +1 -1
- package/dist/report-runtime-context/index.js +7 -392
- package/dist/shared/index.cjs +1 -1
- package/dist/style.css +1 -1
- package/dist/surfboard/index.cjs +1 -1
- package/dist/surfboard/index.js +3 -3
- package/dist/types/analytics-protocol.d.ts +257 -48
- package/dist/types/briefings.d.ts +138 -50
- package/dist/types/dashboard-assistant.d.ts +207 -52
- package/dist/types/dashboard-authoring.d.ts +182 -50
- package/dist/types/dashboard.d.ts +290 -48
- package/dist/types/data-app-builder.d.ts +48 -42
- package/dist/types/data-app-codegen-node.d.ts +50 -44
- package/dist/types/data-app-codegen.d.ts +50 -44
- package/dist/types/data-app-sdk-adapters.d.ts +48 -42
- package/dist/types/data-app-sdk-validation.d.ts +81 -43
- package/dist/types/data-app-sdk.d.ts +83 -45
- package/dist/types/format-utils.d.ts +645 -67
- package/dist/types/index.cjs +1 -1
- package/dist/types/index.js +19 -19
- package/dist/types/main.d.ts +298 -94
- package/dist/types/report-runtime-context.d.ts +3 -0
- package/dist/types/shared.d.ts +116 -41
- package/dist/types/surfboard.d.ts +290 -48
- package/dist/types/types.d.ts +455 -65
- package/package.json +3 -1
- package/dist/chunks/analyze-result-contract-BswhsmWT.js +0 -1
- package/dist/chunks/analyze-result-contract-CfOBEwaC.js +0 -1998
- package/dist/chunks/code-editor-M7HTUhdF.js +0 -138
- package/dist/chunks/common-types-C73-Ud1-.js +0 -1
- package/dist/chunks/comparison-document-migration-DbU_BTxR.js +0 -1
- package/dist/chunks/csv-utils-BZDvO2Fw.js +0 -376
- package/dist/chunks/csv-utils-Co0WxHke.js +0 -4
- package/dist/chunks/dashboard-cB3xmTNn.js +0 -1402
- package/dist/chunks/dashboard-date-comparison-definition-DGZr3m-b.js +0 -1
- package/dist/chunks/dashboard-json-Dw_55vSZ.js +0 -1
- package/dist/chunks/edit-dashboard-visual-BUc3NBQ4.js +0 -182
- package/dist/chunks/metric-comparison-DVy3fll_.js +0 -1
- package/dist/chunks/numeric-presentation-BJs5lSar.js +0 -517
- package/dist/chunks/numeric-presentation-Dlb-Dk4c.js +0 -1
- package/dist/chunks/report-preferences-dialog-CCvFqH4Q.js +0 -1
- package/dist/chunks/source-identity-5OPV4gvg.js +0 -92
- package/dist/chunks/source-identity-Cbo2LOHQ.js +0 -1
- package/dist/chunks/validators-B2vUAqTf.js +0 -1
- package/dist/chunks/validators-Bce_J7Vd.js +0 -2448
- /package/dist/chunks/{card-config-utils-15sRtebL.js → card-config-utils-15sRtebL.cjs} +0 -0
- /package/dist/chunks/{catalog-field-grounding-Bnx-3tE0.js → catalog-field-grounding-Bnx-3tE0.cjs} +0 -0
- /package/dist/chunks/{dashboard-input-contract-DV3cshjz.js → dashboard-input-contract-DV3cshjz.cjs} +0 -0
- /package/dist/chunks/{index-Dpm_VET4.js → index-Dpm_VET4.cjs} +0 -0
- /package/dist/chunks/{index-jSrCwPQz.js → index-jSrCwPQz.cjs} +0 -0
- /package/dist/chunks/{normalize-dashboard-for-dirty-check-BXRUMVb2.js → normalize-dashboard-for-dirty-check-BXRUMVb2.cjs} +0 -0
- /package/dist/chunks/{operators-DrTQsJXv.js → operators-DrTQsJXv.cjs} +0 -0
- /package/dist/chunks/{use-debounced-dirty-check-XHSwAefL.js → use-debounced-dirty-check-XHSwAefL.cjs} +0 -0
|
@@ -48,6 +48,31 @@ declare interface CalculatedFieldFormula {
|
|
|
48
48
|
*/
|
|
49
49
|
declare type CalculatedFieldOperation = 'sum' | 'difference' | 'product' | 'ratio' | 'change' | 'percentage' | 'scale' | 'custom';
|
|
50
50
|
|
|
51
|
+
declare type CalendarContext = {
|
|
52
|
+
tz: string;
|
|
53
|
+
weekStart: WeekStart;
|
|
54
|
+
anchor: 'now' | {
|
|
55
|
+
iso: string;
|
|
56
|
+
};
|
|
57
|
+
fiscalCalendar?: MonthAlignedFiscalCalendar;
|
|
58
|
+
};
|
|
59
|
+
|
|
60
|
+
declare type CanonicalPivotResultBase = {
|
|
61
|
+
columns: SemaphorResultColumn[];
|
|
62
|
+
columnKeyMap: QueryColumnKeyMap;
|
|
63
|
+
pivotResultContract: CanonicalPivotResultContract;
|
|
64
|
+
};
|
|
65
|
+
|
|
66
|
+
declare type CanonicalPivotResultContract = {
|
|
67
|
+
version: 1;
|
|
68
|
+
expectedRoleFieldIds: PivotResultExpectedRoleFieldIds;
|
|
69
|
+
expectedMetricAliases: readonly string[];
|
|
70
|
+
columnKinds: Readonly<Record<string, PivotResultColumnKind>>;
|
|
71
|
+
columnClassifications: Readonly<Record<string, PivotResultColumnClassification | undefined>>;
|
|
72
|
+
};
|
|
73
|
+
|
|
74
|
+
declare type CanonicalPivotResultTransport = LoadedEmptyPivotResult | LoadedValidPivotResult;
|
|
75
|
+
|
|
51
76
|
declare interface CardConfig {
|
|
52
77
|
/**
|
|
53
78
|
* Matrix table is the shared analytics-spine successor for pivot and
|
|
@@ -109,9 +134,6 @@ declare interface CardConfig {
|
|
|
109
134
|
* Configuration for on-click dashboard filters triggered by this card.
|
|
110
135
|
*/
|
|
111
136
|
clickFilterInteractions?: ClickFilterInteraction[];
|
|
112
|
-
showTrendline?: boolean;
|
|
113
|
-
trendlineWindow?: number;
|
|
114
|
-
trendlineGranularity?: 'day' | 'week' | 'month';
|
|
115
137
|
summary?: {
|
|
116
138
|
enabled?: boolean;
|
|
117
139
|
showOnCard?: boolean;
|
|
@@ -199,11 +221,14 @@ export declare type DashboardAssistantAnalysisRequest = {
|
|
|
199
221
|
export declare type DashboardAssistantArtifact = {
|
|
200
222
|
kind: 'analysis' | 'dynamic_visual' | 'clarification';
|
|
201
223
|
status: 'ready' | 'partial' | 'failed';
|
|
224
|
+
resultOwner?: TemporalResultOwner;
|
|
225
|
+
pivotResult?: CanonicalPivotResultTransport;
|
|
202
226
|
title?: string;
|
|
203
227
|
question?: string;
|
|
204
228
|
chartType?: TChartType;
|
|
205
229
|
records?: Record<string, unknown>[];
|
|
206
230
|
columns?: SemaphorResultColumn[];
|
|
231
|
+
columnKeyMap?: QueryColumnKeyMap_2;
|
|
207
232
|
sql?: string;
|
|
208
233
|
python?: string;
|
|
209
234
|
cardConfig?: CardConfig;
|
|
@@ -380,8 +405,9 @@ declare type EntityType = 'table' | 'view' | 'materialized view' | 'model' | 'fi
|
|
|
380
405
|
|
|
381
406
|
declare interface Field {
|
|
382
407
|
/**
|
|
383
|
-
*
|
|
384
|
-
*
|
|
408
|
+
* Stable authored/semantic field identifier (for joins, UI state, etc.).
|
|
409
|
+
* It is normally unique within a role, but one saved query may reuse it in
|
|
410
|
+
* different roles; result bindings must therefore include the role.
|
|
385
411
|
* Example: 'orders.customer_id', 'expr_12345', etc.
|
|
386
412
|
*/
|
|
387
413
|
id: string;
|
|
@@ -423,6 +449,12 @@ declare interface Field {
|
|
|
423
449
|
*/
|
|
424
450
|
derivedField?: SemaphorDerivedFieldDefinition;
|
|
425
451
|
format?: FormatSpec;
|
|
452
|
+
/**
|
|
453
|
+
* Source-level temporal presentation keeps the semantic grain that authored
|
|
454
|
+
* the format. The card's mutable `granularity` remains the active query
|
|
455
|
+
* grain, so changing it cannot accidentally retarget a semantic default.
|
|
456
|
+
*/
|
|
457
|
+
semanticTemporalPresentation?: SemanticTemporalPresentation;
|
|
426
458
|
aggregate?: AggregateFunction;
|
|
427
459
|
fieldScope?: FieldScope;
|
|
428
460
|
}
|
|
@@ -444,6 +476,10 @@ declare interface FilterCondition {
|
|
|
444
476
|
field: Field;
|
|
445
477
|
operator: Operator;
|
|
446
478
|
value: FilterValue;
|
|
479
|
+
/** Display-only label for canonical grouped-temporal values. */
|
|
480
|
+
label?: string;
|
|
481
|
+
/** Governed meaning for a canonical grouped-temporal scalar. */
|
|
482
|
+
temporalBucket?: TemporalBucketMetadata;
|
|
447
483
|
}
|
|
448
484
|
|
|
449
485
|
declare interface FilterGroup {
|
|
@@ -492,11 +528,16 @@ declare type FormatSpec = {
|
|
|
492
528
|
type: 'string';
|
|
493
529
|
prefix?: string;
|
|
494
530
|
suffix?: string;
|
|
495
|
-
};
|
|
531
|
+
} | TemporalBucketFormat;
|
|
496
532
|
|
|
497
533
|
declare interface GroupByField extends Field {
|
|
498
534
|
role: 'groupby';
|
|
499
535
|
granularity?: TimeGranularity;
|
|
536
|
+
/**
|
|
537
|
+
* Query transport policy for grouped temporal values. This is projected
|
|
538
|
+
* into executable card config and is not persisted authoring state.
|
|
539
|
+
*/
|
|
540
|
+
dateValueMode?: 'canonical' | 'formatted';
|
|
500
541
|
/**
|
|
501
542
|
* Optional SQL expression for grouping (e.g., DATE_TRUNC('month', order_date)).
|
|
502
543
|
* If present, used in SELECT and GROUP BY instead of just the column name.
|
|
@@ -565,6 +606,16 @@ declare interface JoinPlan {
|
|
|
565
606
|
joins: Join[];
|
|
566
607
|
}
|
|
567
608
|
|
|
609
|
+
declare type LoadedEmptyPivotResult = CanonicalPivotResultBase & {
|
|
610
|
+
pivotResultState: 'loaded_empty';
|
|
611
|
+
records: [];
|
|
612
|
+
};
|
|
613
|
+
|
|
614
|
+
declare type LoadedValidPivotResult = CanonicalPivotResultBase & {
|
|
615
|
+
pivotResultState: 'loaded_valid';
|
|
616
|
+
records: [Record<string, unknown>, ...Record<string, unknown>[]];
|
|
617
|
+
};
|
|
618
|
+
|
|
568
619
|
declare type LogicalOperator = 'AND' | 'OR';
|
|
569
620
|
|
|
570
621
|
declare type MatrixAxisLevelDescriptor = {
|
|
@@ -572,7 +623,7 @@ declare type MatrixAxisLevelDescriptor = {
|
|
|
572
623
|
fieldKey: string;
|
|
573
624
|
label: string;
|
|
574
625
|
field: SemaphorFieldRef;
|
|
575
|
-
grain?:
|
|
626
|
+
grain?: SemaphorMatrixTimeGrain;
|
|
576
627
|
subtotal?: SemaphorMatrixSubtotalOptions;
|
|
577
628
|
};
|
|
578
629
|
|
|
@@ -687,7 +738,7 @@ declare type MatrixMeasureDescriptor = {
|
|
|
687
738
|
label: string;
|
|
688
739
|
field: SemaphorFieldRef;
|
|
689
740
|
aggregate?: SemaphorAggregateFunction;
|
|
690
|
-
format?:
|
|
741
|
+
format?: SemaphorScalarValueFormat;
|
|
691
742
|
totalBehavior?: SemaphorMatrixTotalCalculation;
|
|
692
743
|
};
|
|
693
744
|
|
|
@@ -701,7 +752,7 @@ declare type MatrixMeasureSemantics = {
|
|
|
701
752
|
} | {
|
|
702
753
|
kind: 'semiAdditive';
|
|
703
754
|
aggregate?: SemaphorAggregateFunction;
|
|
704
|
-
grain?:
|
|
755
|
+
grain?: SemaphorMatrixTimeGrain;
|
|
705
756
|
} | {
|
|
706
757
|
kind: 'nonAdditive';
|
|
707
758
|
aggregate?: SemaphorAggregateFunction;
|
|
@@ -864,16 +915,63 @@ declare interface MetricField extends Field {
|
|
|
864
915
|
semanticComparisonPolarity?: MetricComparisonPolarity;
|
|
865
916
|
}
|
|
866
917
|
|
|
918
|
+
declare type MonthAlignedFiscalCalendar = {
|
|
919
|
+
kind: 'month_aligned';
|
|
920
|
+
yearStartMonth: number;
|
|
921
|
+
};
|
|
922
|
+
|
|
867
923
|
declare type Operator = '=' | '!=' | '>' | '>=' | '<' | '<=' | 'contains' | 'startsWith' | 'endsWith' | 'like' | 'not like' | 'in' | 'not in' | 'between' | 'not between' | 'isNull' | 'isNotNull';
|
|
868
924
|
|
|
869
925
|
declare interface PivotByField extends Field {
|
|
870
926
|
role: 'pivotby';
|
|
927
|
+
/**
|
|
928
|
+
* Query transport policy for grouped temporal pivot members. This is
|
|
929
|
+
* projected into executable config and is never persisted authoring state.
|
|
930
|
+
*/
|
|
931
|
+
dateValueMode?: 'canonical' | 'formatted';
|
|
871
932
|
}
|
|
872
933
|
|
|
934
|
+
declare type PivotResultColumnClassification = {
|
|
935
|
+
isSubtotal?: boolean;
|
|
936
|
+
subtotalScope?: 'base' | 'pivot-value' | 'grand-total';
|
|
937
|
+
};
|
|
938
|
+
|
|
939
|
+
declare type PivotResultColumnKind = 'row' | 'pivot_metric' | 'value';
|
|
940
|
+
|
|
941
|
+
declare type PivotResultExpectedRoleFieldIds = Readonly<Partial<Record<QueryColumnKeyRole, readonly string[]>>>;
|
|
942
|
+
|
|
943
|
+
declare interface QueryColumnKeyMap {
|
|
944
|
+
version: 1;
|
|
945
|
+
source: 'explorer';
|
|
946
|
+
byRole: QueryColumnKeyMapByRole;
|
|
947
|
+
byMetricAlias?: Record<string, QueryColumnKeyMapEntry>;
|
|
948
|
+
}
|
|
949
|
+
|
|
950
|
+
declare type QueryColumnKeyMap_2 = QueryColumnKeyMap;
|
|
951
|
+
|
|
952
|
+
declare type QueryColumnKeyMapByRole = Partial<Record<QueryColumnKeyRole, Record<string, QueryColumnKeyMapEntry>>>;
|
|
953
|
+
|
|
954
|
+
declare interface QueryColumnKeyMapEntry {
|
|
955
|
+
role: QueryColumnKeyRole;
|
|
956
|
+
rawKey: string;
|
|
957
|
+
outputKey?: string;
|
|
958
|
+
}
|
|
959
|
+
|
|
960
|
+
declare type QueryColumnKeyRole = 'groupby' | 'metric' | 'pivotby' | 'detail';
|
|
961
|
+
|
|
873
962
|
declare type SelectedEntities = SelectedEntity[];
|
|
874
963
|
|
|
875
964
|
declare type SelectedEntity = DatabaseEntityReference | DataModelEntityReference | DatasetEntityReference | FileEntityReference;
|
|
876
965
|
|
|
966
|
+
declare type SemanticTemporalPresentation = {
|
|
967
|
+
granularity: SemaphorTimeGrain;
|
|
968
|
+
format: TemporalBucketFormat;
|
|
969
|
+
};
|
|
970
|
+
|
|
971
|
+
declare const SEMAPHOR_MATRIX_TIME_GRAINS: ["hour", "day", "week", "month", "quarter", "year"];
|
|
972
|
+
|
|
973
|
+
declare const SEMAPHOR_TIME_GRAINS: readonly ["second", "minute", "hour", "day", "week", "month", "quarter", "year"];
|
|
974
|
+
|
|
877
975
|
declare type SemaphorAbsoluteTimeWindow = {
|
|
878
976
|
kind: 'absolute';
|
|
879
977
|
start: string;
|
|
@@ -1075,7 +1173,7 @@ declare type SemaphorDerivedFieldDefinition = {
|
|
|
1075
1173
|
defaultAggregate?: SemaphorAggregateFunction;
|
|
1076
1174
|
aggregationBehavior?: SemaphorDerivedFieldAggregationBehavior;
|
|
1077
1175
|
aggregationStrategy?: SemaphorDerivedFieldAggregationStrategy;
|
|
1078
|
-
format?:
|
|
1176
|
+
format?: SemaphorScalarValueFormat;
|
|
1079
1177
|
tags?: string[];
|
|
1080
1178
|
};
|
|
1081
1179
|
|
|
@@ -1159,7 +1257,7 @@ declare type SemaphorMatrixAxisExpansionOptions = {
|
|
|
1159
1257
|
declare type SemaphorMatrixAxisLevel = {
|
|
1160
1258
|
id?: string;
|
|
1161
1259
|
field: SemaphorFieldRef;
|
|
1162
|
-
grain?:
|
|
1260
|
+
grain?: SemaphorMatrixTimeGrain;
|
|
1163
1261
|
label?: string;
|
|
1164
1262
|
subtotal?: boolean | SemaphorMatrixSubtotalOptions;
|
|
1165
1263
|
sortBy?: SemaphorMatrixAxisSortRule;
|
|
@@ -1275,6 +1373,8 @@ declare type SemaphorMatrixSubtotalOptions = {
|
|
|
1275
1373
|
label?: string;
|
|
1276
1374
|
};
|
|
1277
1375
|
|
|
1376
|
+
declare type SemaphorMatrixTimeGrain = (typeof SEMAPHOR_MATRIX_TIME_GRAINS)[number];
|
|
1377
|
+
|
|
1278
1378
|
declare type SemaphorMatrixTotalCalculation = {
|
|
1279
1379
|
kind: 'defaultAggregate';
|
|
1280
1380
|
} | {
|
|
@@ -1310,7 +1410,7 @@ declare type SemaphorMatrixValueField = {
|
|
|
1310
1410
|
field: SemaphorFieldRef;
|
|
1311
1411
|
aggregate?: SemaphorAggregateFunction;
|
|
1312
1412
|
label?: string;
|
|
1313
|
-
format?:
|
|
1413
|
+
format?: SemaphorScalarValueFormat;
|
|
1314
1414
|
totalBehavior?: SemaphorMatrixTotalCalculation;
|
|
1315
1415
|
};
|
|
1316
1416
|
|
|
@@ -1390,6 +1490,30 @@ declare type SemaphorPaginationRequest = {
|
|
|
1390
1490
|
pageSize: number;
|
|
1391
1491
|
};
|
|
1392
1492
|
|
|
1493
|
+
declare type SemaphorPivotResultColumnIdentity = {
|
|
1494
|
+
metricId: string;
|
|
1495
|
+
/** Collision-safe identity for this configured metric instance. */
|
|
1496
|
+
metricAlias: string;
|
|
1497
|
+
/**
|
|
1498
|
+
* Sole transported tuple identity in configured pivot-axis order. A leaf
|
|
1499
|
+
* carries the complete tuple, a subtotal carries its explicit prefix, and a
|
|
1500
|
+
* metric-only or grand-total column carries an empty tuple.
|
|
1501
|
+
*/
|
|
1502
|
+
members: SemaphorPivotResultMember[];
|
|
1503
|
+
};
|
|
1504
|
+
|
|
1505
|
+
declare type SemaphorPivotResultMember = {
|
|
1506
|
+
/** Stable identity of the configured pivot field. */
|
|
1507
|
+
fieldId: string;
|
|
1508
|
+
/** Canonical pivot member value; labels are resolved only at presentation. */
|
|
1509
|
+
value: SemaphorPivotValue;
|
|
1510
|
+
/** Present when this member is an activated governed temporal bucket. */
|
|
1511
|
+
temporalBucket?: TemporalBucketMetadata;
|
|
1512
|
+
};
|
|
1513
|
+
|
|
1514
|
+
/** Stable canonical scalar transported for one physical pivot member. */
|
|
1515
|
+
declare type SemaphorPivotValue = string | null;
|
|
1516
|
+
|
|
1393
1517
|
declare type SemaphorProtocolIssue = {
|
|
1394
1518
|
code: string;
|
|
1395
1519
|
message: string;
|
|
@@ -1469,7 +1593,7 @@ declare type SemaphorRelationshipHint = {
|
|
|
1469
1593
|
|
|
1470
1594
|
declare type SemaphorRelativeTimeWindow = {
|
|
1471
1595
|
kind?: 'relative';
|
|
1472
|
-
unit:
|
|
1596
|
+
unit: SemaphorTimeGrain;
|
|
1473
1597
|
value: number;
|
|
1474
1598
|
anchor?: 'now' | 'latest_available';
|
|
1475
1599
|
completeness?: 'include_partial' | 'complete_periods';
|
|
@@ -1494,6 +1618,45 @@ declare type SemaphorResultColumn = {
|
|
|
1494
1618
|
aggregate?: SemaphorFieldRef['aggregate'];
|
|
1495
1619
|
source?: SemaphorFieldRef['source'];
|
|
1496
1620
|
derivedField?: SemaphorDerivedFieldDefinition;
|
|
1621
|
+
temporalBucket?: TemporalBucketMetadata;
|
|
1622
|
+
pivotIdentity?: SemaphorPivotResultColumnIdentity;
|
|
1623
|
+
};
|
|
1624
|
+
|
|
1625
|
+
declare type SemaphorScalarValueFormat = {
|
|
1626
|
+
type: 'number' | 'currency' | 'percent' | 'percentage' | 'scientific';
|
|
1627
|
+
minimumFractionDigits?: number;
|
|
1628
|
+
maximumFractionDigits?: number;
|
|
1629
|
+
useGrouping?: boolean;
|
|
1630
|
+
prefix?: string;
|
|
1631
|
+
suffix?: string;
|
|
1632
|
+
negativeStyle?: 'minus' | 'parentheses';
|
|
1633
|
+
compact?: boolean;
|
|
1634
|
+
scale?: number;
|
|
1635
|
+
currency?: string;
|
|
1636
|
+
percentValueMode?: 'fraction' | 'whole';
|
|
1637
|
+
} | {
|
|
1638
|
+
type: 'date' | 'datetime';
|
|
1639
|
+
locale?: string;
|
|
1640
|
+
pattern?: string;
|
|
1641
|
+
relative?: boolean;
|
|
1642
|
+
timezone?: string;
|
|
1643
|
+
sourceTimezone?: string;
|
|
1644
|
+
prefix?: string;
|
|
1645
|
+
suffix?: string;
|
|
1646
|
+
} | {
|
|
1647
|
+
type: 'duration';
|
|
1648
|
+
inputUnit?: 'millisecond' | 'second' | 'minute' | 'hour' | 'day';
|
|
1649
|
+
outputStyle?: 'compact' | 'digital' | 'long';
|
|
1650
|
+
largestUnit?: 'millisecond' | 'second' | 'minute' | 'hour' | 'day';
|
|
1651
|
+
smallestUnit?: 'millisecond' | 'second' | 'minute' | 'hour' | 'day';
|
|
1652
|
+
maxUnits?: number;
|
|
1653
|
+
prefix?: string;
|
|
1654
|
+
suffix?: string;
|
|
1655
|
+
negativeStyle?: 'minus' | 'parentheses';
|
|
1656
|
+
} | {
|
|
1657
|
+
type: 'string';
|
|
1658
|
+
prefix?: string;
|
|
1659
|
+
suffix?: string;
|
|
1497
1660
|
};
|
|
1498
1661
|
|
|
1499
1662
|
declare type SemaphorSemanticSourceRef = Extract<SemaphorSourceRef, {
|
|
@@ -1552,47 +1715,10 @@ declare type SemaphorSqlResult = SemaphorAnalyticsResultBase & {
|
|
|
1552
1715
|
};
|
|
1553
1716
|
};
|
|
1554
1717
|
|
|
1555
|
-
declare type SemaphorTimeGrain =
|
|
1718
|
+
declare type SemaphorTimeGrain = (typeof SEMAPHOR_TIME_GRAINS)[number];
|
|
1556
1719
|
|
|
1557
1720
|
declare type SemaphorTimeWindow = SemaphorRelativeTimeWindow | SemaphorAbsoluteTimeWindow;
|
|
1558
1721
|
|
|
1559
|
-
declare type SemaphorValueFormat = {
|
|
1560
|
-
type: 'number' | 'currency' | 'percent' | 'percentage' | 'scientific';
|
|
1561
|
-
minimumFractionDigits?: number;
|
|
1562
|
-
maximumFractionDigits?: number;
|
|
1563
|
-
useGrouping?: boolean;
|
|
1564
|
-
prefix?: string;
|
|
1565
|
-
suffix?: string;
|
|
1566
|
-
negativeStyle?: 'minus' | 'parentheses';
|
|
1567
|
-
compact?: boolean;
|
|
1568
|
-
scale?: number;
|
|
1569
|
-
currency?: string;
|
|
1570
|
-
percentValueMode?: 'fraction' | 'whole';
|
|
1571
|
-
} | {
|
|
1572
|
-
type: 'date' | 'datetime';
|
|
1573
|
-
locale?: string;
|
|
1574
|
-
pattern?: string;
|
|
1575
|
-
relative?: boolean;
|
|
1576
|
-
timezone?: string;
|
|
1577
|
-
sourceTimezone?: string;
|
|
1578
|
-
prefix?: string;
|
|
1579
|
-
suffix?: string;
|
|
1580
|
-
} | {
|
|
1581
|
-
type: 'duration';
|
|
1582
|
-
inputUnit?: 'millisecond' | 'second' | 'minute' | 'hour' | 'day';
|
|
1583
|
-
outputStyle?: 'compact' | 'digital' | 'long';
|
|
1584
|
-
largestUnit?: 'millisecond' | 'second' | 'minute' | 'hour' | 'day';
|
|
1585
|
-
smallestUnit?: 'millisecond' | 'second' | 'minute' | 'hour' | 'day';
|
|
1586
|
-
maxUnits?: number;
|
|
1587
|
-
prefix?: string;
|
|
1588
|
-
suffix?: string;
|
|
1589
|
-
negativeStyle?: 'minus' | 'parentheses';
|
|
1590
|
-
} | {
|
|
1591
|
-
type: 'string';
|
|
1592
|
-
prefix?: string;
|
|
1593
|
-
suffix?: string;
|
|
1594
|
-
};
|
|
1595
|
-
|
|
1596
1722
|
declare interface SortByField extends Field {
|
|
1597
1723
|
role: 'sortby';
|
|
1598
1724
|
direction: 'asc' | 'desc';
|
|
@@ -1634,6 +1760,33 @@ declare type TDynamicVisualIntent = {
|
|
|
1634
1760
|
includesKpis: boolean;
|
|
1635
1761
|
};
|
|
1636
1762
|
|
|
1763
|
+
declare const TEMPORAL_BUCKET_PRESETS: readonly ["week_of_short", "week_of_long", "quarter_short", "quarter_long", "fiscal_quarter_short", "fiscal_year"];
|
|
1764
|
+
|
|
1765
|
+
declare type TemporalBucketFormat = {
|
|
1766
|
+
type: 'temporal_bucket';
|
|
1767
|
+
presentation: TemporalBucketPresentation;
|
|
1768
|
+
};
|
|
1769
|
+
|
|
1770
|
+
declare type TemporalBucketMetadata = {
|
|
1771
|
+
kind: 'temporal_bucket';
|
|
1772
|
+
granularity: SemaphorTimeGrain;
|
|
1773
|
+
calendar: Pick<CalendarContext, 'tz' | 'weekStart' | 'fiscalCalendar'>;
|
|
1774
|
+
};
|
|
1775
|
+
|
|
1776
|
+
declare type TemporalBucketPresentation = {
|
|
1777
|
+
mode: 'auto';
|
|
1778
|
+
} | {
|
|
1779
|
+
mode: 'preset';
|
|
1780
|
+
preset: TemporalBucketPreset;
|
|
1781
|
+
} | {
|
|
1782
|
+
mode: 'pattern';
|
|
1783
|
+
pattern: string;
|
|
1784
|
+
};
|
|
1785
|
+
|
|
1786
|
+
declare type TemporalBucketPreset = (typeof TEMPORAL_BUCKET_PRESETS)[number];
|
|
1787
|
+
|
|
1788
|
+
declare type TemporalResultOwner = 'config' | 'freeform' | 'none';
|
|
1789
|
+
|
|
1637
1790
|
declare interface TimeDrillStep {
|
|
1638
1791
|
granularity: TimeGranularity;
|
|
1639
1792
|
next?: TimeGranularity;
|
|
@@ -1641,10 +1794,12 @@ declare interface TimeDrillStep {
|
|
|
1641
1794
|
rollingWindow?: number;
|
|
1642
1795
|
}
|
|
1643
1796
|
|
|
1644
|
-
declare type TimeGranularity =
|
|
1797
|
+
declare type TimeGranularity = SemaphorTimeGrain;
|
|
1645
1798
|
|
|
1646
1799
|
declare type TVisualizationMode = 'builtin' | 'dynamic';
|
|
1647
1800
|
|
|
1801
|
+
declare type WeekStart = 0 | 1 | 2 | 3 | 4 | 5 | 6;
|
|
1802
|
+
|
|
1648
1803
|
declare type WindowFunction = 'running_total' | 'moving_average' | 'previous_period_delta' | 'percent_of_total';
|
|
1649
1804
|
|
|
1650
1805
|
declare interface WindowTransform {
|