react-semaphor 0.1.444 → 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-Bg_SeBV8.js → dashboard-briefing-launcher-2SLNOaTg.js} +26 -24
- package/dist/chunks/{dashboard-briefing-launcher-Do6ZcOj4.js → dashboard-briefing-launcher-CHwjpUYz.cjs} +2 -2
- package/dist/chunks/{dashboard-controls-Da9MkPaf.js → dashboard-controls-BfL14aqO.js} +11 -9
- package/dist/chunks/{dashboard-controls-CYBi_mes.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-BtrdGo1U.js → dashboard-json-BZwq3EcS.js} +14 -12
- package/dist/chunks/{dashboard-CJNVq8XI.js → dashboard-u61yfU6u.js} +50081 -47351
- package/dist/chunks/edit-dashboard-visual-BdVCH0DJ.cjs +182 -0
- package/dist/chunks/{edit-dashboard-visual-kE6_3R3j.js → edit-dashboard-visual-njLPYip3.js} +6799 -6652
- package/dist/chunks/{editor-action-buttons-DROkx4PS.js → editor-action-buttons-BhLX5Q6m.js} +24 -23
- package/dist/chunks/{editor-action-buttons-8_CQa8Hb.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-Dq7rmN93.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-DxZuqe8t.js +0 -1402
- package/dist/chunks/dashboard-date-comparison-definition-DGZr3m-b.js +0 -1
- package/dist/chunks/dashboard-json-ezLyW7AK.js +0 -1
- package/dist/chunks/edit-dashboard-visual-DEb9MeSM.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-D5sIaFnb.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
|
@@ -1,19 +1,47 @@
|
|
|
1
|
-
export declare
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
export declare const AGGREGATE_TOTAL_MEMBER_MARKER: "__TOTAL__";
|
|
2
|
+
|
|
3
|
+
export declare type AggregateGroupCellPlacement = 'value' | 'label' | 'empty';
|
|
4
|
+
|
|
5
|
+
export declare interface AggregateGroupCellPresentation<T = string> {
|
|
6
|
+
columnKey: string;
|
|
7
|
+
text: T | string;
|
|
8
|
+
placement: AggregateGroupCellPlacement;
|
|
9
|
+
colSpan: number;
|
|
7
10
|
}
|
|
8
11
|
|
|
9
|
-
export declare interface
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
12
|
+
export declare interface AggregateGroupRowPresentation<T = string> {
|
|
13
|
+
kind: 'data' | 'subtotal' | 'grand-total';
|
|
14
|
+
cells: AggregateGroupCellPresentation<T>[];
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* React-free aggregate-table row presentation policy shared by browser and
|
|
19
|
+
* delivery adapters. Canonical tuple values and row metadata remain identity;
|
|
20
|
+
* this module owns authoritative group keys and group-cell placement.
|
|
21
|
+
*/
|
|
22
|
+
export declare interface AggregateSubtotalLabelInput {
|
|
23
|
+
aggregateFunction: string;
|
|
24
|
+
customLabel?: string;
|
|
25
|
+
levelValue: unknown;
|
|
26
|
+
formatValue?: (value: unknown) => string;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export declare interface AggregateTablePresentationColumnKeyMap {
|
|
30
|
+
byRole: Readonly<{
|
|
31
|
+
groupby?: Readonly<Record<string, {
|
|
32
|
+
rawKey: string;
|
|
33
|
+
outputKey?: string;
|
|
34
|
+
}>>;
|
|
35
|
+
}>;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
export declare interface AggregateTablePresentationContext {
|
|
39
|
+
groupColumnKeys: string[];
|
|
40
|
+
rowAggregates: Array<{
|
|
41
|
+
function: string;
|
|
42
|
+
groupLevel: string;
|
|
43
|
+
label?: string;
|
|
44
|
+
}>;
|
|
17
45
|
}
|
|
18
46
|
|
|
19
47
|
/**
|
|
@@ -30,7 +58,8 @@ export declare function buildFlatTableExportTotalsFooter(params: {
|
|
|
30
58
|
totalsByColumnId: FlatTableExportTotalsByColumnId;
|
|
31
59
|
visibleColumns: readonly string[];
|
|
32
60
|
labelColumnKey?: string;
|
|
33
|
-
|
|
61
|
+
snapshot: PresentationExecutionSnapshot;
|
|
62
|
+
scope: PresentationScope;
|
|
34
63
|
useFormattedValues: boolean;
|
|
35
64
|
delimiter: string;
|
|
36
65
|
}): string;
|
|
@@ -46,7 +75,25 @@ declare type CalendarContext = {
|
|
|
46
75
|
|
|
47
76
|
export declare type CanonicalDurationUnit = 'millisecond' | 'second' | 'minute' | 'hour' | 'day';
|
|
48
77
|
|
|
49
|
-
export declare type CanonicalFormatSpec = NumericCanonicalFormat | DateCanonicalFormat | DurationCanonicalFormat | StringCanonicalFormat;
|
|
78
|
+
export declare type CanonicalFormatSpec = NumericCanonicalFormat | DateCanonicalFormat | DurationCanonicalFormat | StringCanonicalFormat | TemporalBucketFormat;
|
|
79
|
+
|
|
80
|
+
declare type CanonicalPivotResultBase = {
|
|
81
|
+
columns: SemaphorResultColumn[];
|
|
82
|
+
columnKeyMap: QueryColumnKeyMap;
|
|
83
|
+
pivotResultContract: CanonicalPivotResultContract;
|
|
84
|
+
};
|
|
85
|
+
|
|
86
|
+
export declare type CanonicalPivotResultContract = {
|
|
87
|
+
version: 1;
|
|
88
|
+
expectedRoleFieldIds: PivotResultExpectedRoleFieldIds;
|
|
89
|
+
expectedMetricAliases: readonly string[];
|
|
90
|
+
columnKinds: Readonly<Record<string, PivotResultColumnKind>>;
|
|
91
|
+
columnClassifications: Readonly<Record<string, PivotResultColumnClassification | undefined>>;
|
|
92
|
+
};
|
|
93
|
+
|
|
94
|
+
export declare type CanonicalPivotResultState = 'loaded_empty' | 'loaded_valid';
|
|
95
|
+
|
|
96
|
+
export declare type CanonicalPivotResultTransport = LoadedEmptyPivotResult | LoadedValidPivotResult;
|
|
50
97
|
|
|
51
98
|
export declare interface ColorRange {
|
|
52
99
|
min: number;
|
|
@@ -106,6 +153,16 @@ export declare interface ColumnSubtotalMeta {
|
|
|
106
153
|
level: number;
|
|
107
154
|
}
|
|
108
155
|
|
|
156
|
+
export declare function createCanonicalPivotResultTransport(input: {
|
|
157
|
+
records: Record<string, unknown>[];
|
|
158
|
+
columns: SemaphorResultColumn[];
|
|
159
|
+
columnKeyMap: QueryColumnKeyMap;
|
|
160
|
+
expectedRoleFieldIds: PivotResultExpectedRoleFieldIds;
|
|
161
|
+
expectedMetricAliases?: readonly string[];
|
|
162
|
+
physicalPivotColumnKeys: readonly string[];
|
|
163
|
+
columnMetadata?: Readonly<Record<string, PivotResultColumnClassification | undefined>>;
|
|
164
|
+
}): CanonicalPivotResultTransport;
|
|
165
|
+
|
|
109
166
|
export declare interface CSVExportOptions {
|
|
110
167
|
delimiter: ',' | ';' | '\t';
|
|
111
168
|
includeHeaders: boolean;
|
|
@@ -140,6 +197,19 @@ export declare interface DateFormatOptions {
|
|
|
140
197
|
locale?: string;
|
|
141
198
|
}
|
|
142
199
|
|
|
200
|
+
/**
|
|
201
|
+
* Derives the authored identity expectations stored in a canonical pivot
|
|
202
|
+
* lifecycle contract. Producers and cache-compatibility consumers must use
|
|
203
|
+
* this same projection so generated Count and repeated metric instances cannot
|
|
204
|
+
* drift across the transport seam.
|
|
205
|
+
*/
|
|
206
|
+
export declare function derivePivotResultContractExpectations(input: {
|
|
207
|
+
groupByFields?: readonly IdentifiedField[];
|
|
208
|
+
metricFields?: readonly IdentifiedMetricField[];
|
|
209
|
+
pivotByFields?: readonly IdentifiedField[];
|
|
210
|
+
detailFields?: readonly IdentifiedField[];
|
|
211
|
+
}): PivotResultContractExpectations;
|
|
212
|
+
|
|
143
213
|
export declare type DurationCanonicalFormat = {
|
|
144
214
|
type: 'duration';
|
|
145
215
|
inputUnit?: CanonicalDurationUnit;
|
|
@@ -202,6 +272,18 @@ export declare interface ExportFormattingConfig {
|
|
|
202
272
|
visibleColumns: string[];
|
|
203
273
|
}
|
|
204
274
|
|
|
275
|
+
export declare function findResolvedNumericFormat(input: {
|
|
276
|
+
snapshot: PresentationExecutionSnapshot;
|
|
277
|
+
scope: PresentationScope;
|
|
278
|
+
target: NumericPresentationTarget;
|
|
279
|
+
}): NumericCanonicalFormat | undefined;
|
|
280
|
+
|
|
281
|
+
export declare function findResolvedTemporalBucketFormat(input: {
|
|
282
|
+
snapshot: PresentationExecutionSnapshot;
|
|
283
|
+
scope: PresentationScope;
|
|
284
|
+
target: TemporalBucketPresentationTarget;
|
|
285
|
+
}): ResolvedTemporalBucketFormat | undefined;
|
|
286
|
+
|
|
205
287
|
export declare type FlatTableExportTotalsBehavior = 'sum' | 'avg' | 'count' | 'label';
|
|
206
288
|
|
|
207
289
|
export declare type FlatTableExportTotalsByColumnId = Record<string, string | number | null>;
|
|
@@ -216,15 +298,22 @@ export declare type FlatTableExportTotalsRequest = {
|
|
|
216
298
|
}>;
|
|
217
299
|
};
|
|
218
300
|
|
|
219
|
-
|
|
220
|
-
* Format an aggregate table row for CSV export
|
|
221
|
-
*/
|
|
222
|
-
export declare function formatAggregateRow(row: AggregateRowData, aggregateConfig: AggregateExportConfig, formattingConfig: ExportFormattingConfig): string[];
|
|
301
|
+
export declare function formatAggregateGrandTotalLabel(aggregateFunction: string, customLabel?: string): string;
|
|
223
302
|
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
303
|
+
export declare function formatAggregateGroupCell(input: {
|
|
304
|
+
row: Record<string, unknown>;
|
|
305
|
+
context: AggregateTablePresentationContext;
|
|
306
|
+
columnKey: string;
|
|
307
|
+
formatValue: (value: unknown, columnKey: string) => string;
|
|
308
|
+
}): string;
|
|
309
|
+
|
|
310
|
+
export declare function formatAggregateGroupRow(input: {
|
|
311
|
+
row: Record<string, unknown>;
|
|
312
|
+
context: AggregateTablePresentationContext;
|
|
313
|
+
formatValue: (value: unknown, columnKey: string) => string;
|
|
314
|
+
}): string[];
|
|
315
|
+
|
|
316
|
+
export declare function formatAggregateSubtotalLabel(input: AggregateSubtotalLabelInput): string;
|
|
228
317
|
|
|
229
318
|
/**
|
|
230
319
|
* Format a cell value for export based on column settings
|
|
@@ -375,10 +464,11 @@ export declare type FormattedMetricComparisonPart = {
|
|
|
375
464
|
text: string | null;
|
|
376
465
|
};
|
|
377
466
|
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
467
|
+
export declare function formatTemporalBucket(input: {
|
|
468
|
+
value: TemporalBucketValue;
|
|
469
|
+
metadata: TemporalBucketMetadata;
|
|
470
|
+
format: ResolvedTemporalBucketFormat;
|
|
471
|
+
}): string;
|
|
382
472
|
|
|
383
473
|
/**
|
|
384
474
|
* Generate multi-level headers for pivot table
|
|
@@ -406,6 +496,35 @@ export declare interface GroupByField {
|
|
|
406
496
|
label?: string;
|
|
407
497
|
}
|
|
408
498
|
|
|
499
|
+
declare type IdentifiedField = {
|
|
500
|
+
id?: string;
|
|
501
|
+
};
|
|
502
|
+
|
|
503
|
+
declare type IdentifiedMetricField = IdentifiedField & MetricResultAliasInput;
|
|
504
|
+
|
|
505
|
+
export declare function isAggregateTotalMemberMarker(value: unknown): value is typeof AGGREGATE_TOTAL_MEMBER_MARKER;
|
|
506
|
+
|
|
507
|
+
export declare function isNumericCanonicalFormat(format: unknown): format is NumericCanonicalFormat;
|
|
508
|
+
|
|
509
|
+
export declare function isPivotEmptyTupleAllowed(input: {
|
|
510
|
+
expectedPivotFieldIds: readonly string[];
|
|
511
|
+
classification?: PivotResultColumnClassification;
|
|
512
|
+
}): boolean;
|
|
513
|
+
|
|
514
|
+
export declare function isPivotSubtotalPrefix(classification: PivotResultColumnClassification | undefined): boolean;
|
|
515
|
+
|
|
516
|
+
export declare function isTemporalBucketPreset(value: unknown): value is TemporalBucketPreset;
|
|
517
|
+
|
|
518
|
+
export declare type LoadedEmptyPivotResult = CanonicalPivotResultBase & {
|
|
519
|
+
pivotResultState: 'loaded_empty';
|
|
520
|
+
records: [];
|
|
521
|
+
};
|
|
522
|
+
|
|
523
|
+
export declare type LoadedValidPivotResult = CanonicalPivotResultBase & {
|
|
524
|
+
pivotResultState: 'loaded_valid';
|
|
525
|
+
records: [Record<string, unknown>, ...Record<string, unknown>[]];
|
|
526
|
+
};
|
|
527
|
+
|
|
409
528
|
declare type LocaleStyle = 'short' | 'medium' | 'long';
|
|
410
529
|
|
|
411
530
|
declare type MetricComparisonDirection = 'increase' | 'decrease' | 'no_change' | 'unknown';
|
|
@@ -425,6 +544,15 @@ declare type MetricComparisonEvaluation = {
|
|
|
425
544
|
|
|
426
545
|
declare type MetricComparisonSentiment = 'favorable' | 'unfavorable' | 'neutral';
|
|
427
546
|
|
|
547
|
+
declare type MetricResultAliasInput = {
|
|
548
|
+
alias?: string;
|
|
549
|
+
name: string;
|
|
550
|
+
entityName?: string;
|
|
551
|
+
role?: string;
|
|
552
|
+
aggregate?: string;
|
|
553
|
+
expression?: string;
|
|
554
|
+
};
|
|
555
|
+
|
|
428
556
|
declare type MonthAlignedFiscalCalendar = {
|
|
429
557
|
kind: 'month_aligned';
|
|
430
558
|
yearStartMonth: number;
|
|
@@ -450,15 +578,6 @@ export declare interface NumberFormatOptions {
|
|
|
450
578
|
useSuffix?: boolean;
|
|
451
579
|
}
|
|
452
580
|
|
|
453
|
-
/**
|
|
454
|
-
* Shared format types for export system
|
|
455
|
-
* IMPORTANT: No React imports allowed in this file
|
|
456
|
-
*
|
|
457
|
-
* These types are used by:
|
|
458
|
-
* - react-semaphor (browser) for client-side exports
|
|
459
|
-
* - semaphor-app (Next.js) for API routes
|
|
460
|
-
* - Lambda (Node.js) for async export processing
|
|
461
|
-
*/
|
|
462
581
|
export declare type NumericCanonicalFormat = {
|
|
463
582
|
type: 'number' | 'currency' | 'percent' | 'scientific';
|
|
464
583
|
locale?: string;
|
|
@@ -485,21 +604,6 @@ export declare type NumericCanonicalFormatParseResult = {
|
|
|
485
604
|
}>;
|
|
486
605
|
};
|
|
487
606
|
|
|
488
|
-
export declare type NumericPresentationExecutionSnapshot = {
|
|
489
|
-
reportContext: ReportRuntimeContext;
|
|
490
|
-
resolvedNumericFormats: NumericPresentationSnapshotEntry[];
|
|
491
|
-
};
|
|
492
|
-
|
|
493
|
-
export declare type NumericPresentationSnapshotEntry = {
|
|
494
|
-
scope: {
|
|
495
|
-
dashboardId: string;
|
|
496
|
-
cardId?: string;
|
|
497
|
-
attachmentIndex?: number;
|
|
498
|
-
};
|
|
499
|
-
target: NumericPresentationTarget;
|
|
500
|
-
format: NumericCanonicalFormat;
|
|
501
|
-
};
|
|
502
|
-
|
|
503
607
|
export declare type NumericPresentationTarget = {
|
|
504
608
|
kind: 'metric';
|
|
505
609
|
metricId: string;
|
|
@@ -518,18 +622,40 @@ export declare function objectsToCSV(data: Record<string, unknown>[], options?:
|
|
|
518
622
|
columns?: string[];
|
|
519
623
|
}): string;
|
|
520
624
|
|
|
625
|
+
/**
|
|
626
|
+
* Parses the canonical pivot wire shape once. Downstream presentation and
|
|
627
|
+
* delivery consumers receive this discriminated result and do not infer
|
|
628
|
+
* lifecycle or repeat physical-member validation.
|
|
629
|
+
*/
|
|
630
|
+
export declare function parseCanonicalPivotResultTransport(input: PivotResultLifecycleInput): CanonicalPivotResultTransport;
|
|
631
|
+
|
|
632
|
+
export declare type ParsedTemporalBucketValue = {
|
|
633
|
+
year: number;
|
|
634
|
+
month: number;
|
|
635
|
+
day: number;
|
|
636
|
+
hour: number;
|
|
637
|
+
minute: number;
|
|
638
|
+
second: number;
|
|
639
|
+
};
|
|
640
|
+
|
|
521
641
|
export declare function parseFlatTableExportTotalsByColumnId(input: unknown, path?: string): FlatTableExportTotalsByColumnId;
|
|
522
642
|
|
|
523
643
|
export declare function parseFlatTableExportTotalsRequest(input: unknown, path?: string): FlatTableExportTotalsRequest;
|
|
524
644
|
|
|
525
645
|
export declare function parseNumericCanonicalFormat(input: unknown): NumericCanonicalFormatParseResult;
|
|
526
646
|
|
|
527
|
-
export declare function
|
|
647
|
+
export declare function parsePresentationExecutionSnapshot(input: unknown): PresentationExecutionSnapshot;
|
|
528
648
|
|
|
529
|
-
export declare function
|
|
649
|
+
export declare function parsePresentationScope(input: unknown, path?: string): PresentationScope;
|
|
530
650
|
|
|
531
651
|
export declare function parseResolvedNumericCanonicalFormat(input: unknown): NumericCanonicalFormatParseResult;
|
|
532
652
|
|
|
653
|
+
export declare function parseResolvedPresentationEntries(input: unknown): ResolvedPresentationEntry[];
|
|
654
|
+
|
|
655
|
+
export declare function parseResolvedTemporalBucketFormat(input: unknown): ResolvedTemporalBucketFormatParseResult;
|
|
656
|
+
|
|
657
|
+
export declare function parseTemporalBucketValue(value: TemporalBucketValue, metadata: TemporalBucketMetadata): TemporalBucketValueParseResult;
|
|
658
|
+
|
|
533
659
|
/**
|
|
534
660
|
* Parse a date string with source timezone interpretation
|
|
535
661
|
*
|
|
@@ -552,14 +678,6 @@ export declare interface PivotCellData {
|
|
|
552
678
|
formatted?: string;
|
|
553
679
|
}
|
|
554
680
|
|
|
555
|
-
export declare interface PivotColumnSchema {
|
|
556
|
-
alias: string;
|
|
557
|
-
displayLabel?: string;
|
|
558
|
-
metricLabel?: string;
|
|
559
|
-
metricName?: string;
|
|
560
|
-
isMetricColumn: boolean;
|
|
561
|
-
}
|
|
562
|
-
|
|
563
681
|
export declare interface PivotExportConfig {
|
|
564
682
|
groupByColumns: GroupByField[];
|
|
565
683
|
pivotByColumns: PivotByColumn[];
|
|
@@ -571,6 +689,61 @@ export declare interface PivotExportConfig {
|
|
|
571
689
|
showRowTotals: boolean;
|
|
572
690
|
}
|
|
573
691
|
|
|
692
|
+
export declare type PivotHeaderPresentation = {
|
|
693
|
+
memberLabels: string[];
|
|
694
|
+
metricLabel?: string;
|
|
695
|
+
flattenedLabel: string;
|
|
696
|
+
};
|
|
697
|
+
|
|
698
|
+
export declare class PivotHeaderPresentationError extends Error {
|
|
699
|
+
readonly code: 'missing_resolved_temporal_format';
|
|
700
|
+
readonly deliveryBlocking = true;
|
|
701
|
+
constructor(code: 'missing_resolved_temporal_format', message: string);
|
|
702
|
+
}
|
|
703
|
+
|
|
704
|
+
export declare type PivotHeaderPresentationMember = {
|
|
705
|
+
fieldId: string;
|
|
706
|
+
value: string | null;
|
|
707
|
+
temporalBucket?: TemporalBucketMetadata;
|
|
708
|
+
};
|
|
709
|
+
|
|
710
|
+
export declare type PivotHeaderPresentationMode = 'formatted' | 'canonical';
|
|
711
|
+
|
|
712
|
+
export declare type PivotResultColumnClassification = {
|
|
713
|
+
isSubtotal?: boolean;
|
|
714
|
+
subtotalScope?: 'base' | 'pivot-value' | 'grand-total';
|
|
715
|
+
};
|
|
716
|
+
|
|
717
|
+
export declare type PivotResultColumnKind = 'row' | 'pivot_metric' | 'value';
|
|
718
|
+
|
|
719
|
+
export declare type PivotResultContractExpectations = {
|
|
720
|
+
expectedRoleFieldIds: PivotResultExpectedRoleFieldIds;
|
|
721
|
+
expectedMetricAliases: string[];
|
|
722
|
+
};
|
|
723
|
+
|
|
724
|
+
export declare type PivotResultExpectedRoleFieldIds = Readonly<Partial<Record<QueryColumnKeyRole, readonly string[]>>>;
|
|
725
|
+
|
|
726
|
+
export declare class PivotResultIdentityError extends Error {
|
|
727
|
+
readonly deliveryBlocking = true;
|
|
728
|
+
readonly code: "missing_pivot_member_identity";
|
|
729
|
+
constructor(message: string);
|
|
730
|
+
}
|
|
731
|
+
|
|
732
|
+
export declare class PivotResultLifecycleError extends Error {
|
|
733
|
+
readonly cause?: unknown | undefined;
|
|
734
|
+
readonly code: "invalid_pivot_result_lifecycle";
|
|
735
|
+
readonly deliveryBlocking = true;
|
|
736
|
+
constructor(message: string, cause?: unknown | undefined);
|
|
737
|
+
}
|
|
738
|
+
|
|
739
|
+
declare type PivotResultLifecycleInput = {
|
|
740
|
+
pivotResultState?: unknown;
|
|
741
|
+
pivotResultContract?: unknown;
|
|
742
|
+
records?: unknown;
|
|
743
|
+
columns?: unknown;
|
|
744
|
+
columnKeyMap?: unknown;
|
|
745
|
+
};
|
|
746
|
+
|
|
574
747
|
export declare interface PivotRowData {
|
|
575
748
|
fieldValues: string[];
|
|
576
749
|
cells: Record<string, PivotCellData>;
|
|
@@ -578,6 +751,57 @@ export declare interface PivotRowData {
|
|
|
578
751
|
isGrandTotal?: boolean;
|
|
579
752
|
}
|
|
580
753
|
|
|
754
|
+
/**
|
|
755
|
+
* Formats one physical aggregate group cell. Row metadata alone determines
|
|
756
|
+
* subtotal/grand-total ownership; null is always passed to the value formatter
|
|
757
|
+
* as a genuine blank member.
|
|
758
|
+
*/
|
|
759
|
+
export declare function presentAggregateGroupRow<T = string>(input: {
|
|
760
|
+
row: Record<string, unknown>;
|
|
761
|
+
context: AggregateTablePresentationContext;
|
|
762
|
+
formatValue: (value: unknown, columnKey: string) => T;
|
|
763
|
+
formatLabelValue?: (value: unknown, columnKey: string) => string;
|
|
764
|
+
}): AggregateGroupRowPresentation<T>;
|
|
765
|
+
|
|
766
|
+
export declare type PresentationExecutionSnapshot = {
|
|
767
|
+
reportContext: ReportRuntimeContext;
|
|
768
|
+
resolvedFormats: ResolvedPresentationEntry[];
|
|
769
|
+
};
|
|
770
|
+
|
|
771
|
+
export declare type PresentationScope = {
|
|
772
|
+
dashboardId: string;
|
|
773
|
+
cardId?: string;
|
|
774
|
+
attachmentIndex?: number;
|
|
775
|
+
};
|
|
776
|
+
|
|
777
|
+
/**
|
|
778
|
+
* React-free pivot header policy shared by interactive and delivery adapters.
|
|
779
|
+
* Canonical member values remain identity; this helper produces labels only.
|
|
780
|
+
*/
|
|
781
|
+
export declare function presentPivotHeader(input: {
|
|
782
|
+
members: readonly PivotHeaderPresentationMember[];
|
|
783
|
+
metricLabel?: string;
|
|
784
|
+
mode?: PivotHeaderPresentationMode;
|
|
785
|
+
resolveTemporalFormat?: (fieldId: string) => ResolvedTemporalBucketFormat | undefined;
|
|
786
|
+
}): PivotHeaderPresentation;
|
|
787
|
+
|
|
788
|
+
export declare interface QueryColumnKeyMap {
|
|
789
|
+
version: 1;
|
|
790
|
+
source: 'explorer';
|
|
791
|
+
byRole: QueryColumnKeyMapByRole;
|
|
792
|
+
byMetricAlias?: Record<string, QueryColumnKeyMapEntry>;
|
|
793
|
+
}
|
|
794
|
+
|
|
795
|
+
export declare type QueryColumnKeyMapByRole = Partial<Record<QueryColumnKeyRole, Record<string, QueryColumnKeyMapEntry>>>;
|
|
796
|
+
|
|
797
|
+
export declare interface QueryColumnKeyMapEntry {
|
|
798
|
+
role: QueryColumnKeyRole;
|
|
799
|
+
rawKey: string;
|
|
800
|
+
outputKey?: string;
|
|
801
|
+
}
|
|
802
|
+
|
|
803
|
+
export declare type QueryColumnKeyRole = 'groupby' | 'metric' | 'pivotby' | 'detail';
|
|
804
|
+
|
|
581
805
|
declare const REPORT_PREFERENCE_SOURCES: readonly ["viewer_user", "viewer_tenant_user", "session_initial", "viewer_tenant", "viewer_organization", "system_default"];
|
|
582
806
|
|
|
583
807
|
declare type ReportPreferenceSource = (typeof REPORT_PREFERENCE_SOURCES)[number];
|
|
@@ -593,6 +817,47 @@ declare type ReportRuntimeContext = {
|
|
|
593
817
|
preferenceSources: ReportPreferenceSources;
|
|
594
818
|
};
|
|
595
819
|
|
|
820
|
+
export declare function requirePivotHeaderMembers(input: {
|
|
821
|
+
identity: SemaphorPivotResultColumnIdentity;
|
|
822
|
+
columnKey: string;
|
|
823
|
+
expectedPivotFieldIds?: readonly string[];
|
|
824
|
+
allowPrefix?: boolean;
|
|
825
|
+
allowEmpty?: boolean;
|
|
826
|
+
}): readonly SemaphorPivotResultMember[];
|
|
827
|
+
|
|
828
|
+
export declare function requirePivotResultColumnIdentities(columns: readonly {
|
|
829
|
+
key: string;
|
|
830
|
+
pivotIdentity?: SemaphorPivotResultColumnIdentity;
|
|
831
|
+
}[], options: {
|
|
832
|
+
expectedPivotFieldIds: readonly string[];
|
|
833
|
+
columnClassifications?: Readonly<Record<string, PivotResultColumnClassification | undefined>>;
|
|
834
|
+
allowPrefixForColumn?: (column: {
|
|
835
|
+
key: string;
|
|
836
|
+
pivotIdentity?: SemaphorPivotResultColumnIdentity;
|
|
837
|
+
}) => boolean;
|
|
838
|
+
allowEmptyForColumn?: (column: {
|
|
839
|
+
key: string;
|
|
840
|
+
pivotIdentity?: SemaphorPivotResultColumnIdentity;
|
|
841
|
+
}) => boolean;
|
|
842
|
+
}): void;
|
|
843
|
+
|
|
844
|
+
/**
|
|
845
|
+
* Resolves saved field identity into the physical result keys used by rows.
|
|
846
|
+
* Missing groupByColumns is a valid metric-only aggregate-table shape.
|
|
847
|
+
*/
|
|
848
|
+
export declare function resolveAggregateTablePresentationContext(input: {
|
|
849
|
+
groupByColumns?: readonly unknown[];
|
|
850
|
+
rowAggregates?: readonly unknown[];
|
|
851
|
+
columnKeyMap?: AggregateTablePresentationColumnKeyMap;
|
|
852
|
+
}): AggregateTablePresentationContext;
|
|
853
|
+
|
|
854
|
+
/**
|
|
855
|
+
* Retains authored temporal presentation only when its grain is present and
|
|
856
|
+
* compatible. Boundary adapters decide whether an omitted result means
|
|
857
|
+
* rejecting the entire pair or preserving grain with automatic presentation.
|
|
858
|
+
*/
|
|
859
|
+
export declare function resolveApplicableTemporalBucketFormat(format: TemporalBucketFormat | undefined, granularity: SemaphorTimeGrain | undefined): TemporalBucketFormat | undefined;
|
|
860
|
+
|
|
596
861
|
export declare function resolveCurrencyFractionDigits(locale: string, currency: string): Pick<NumericCanonicalFormat, 'minimumFractionDigits' | 'maximumFractionDigits'>;
|
|
597
862
|
|
|
598
863
|
declare type ResolvedCalendarPreferenceSources = {
|
|
@@ -600,6 +865,40 @@ declare type ResolvedCalendarPreferenceSources = {
|
|
|
600
865
|
weekStart: ReportPreferenceSource;
|
|
601
866
|
};
|
|
602
867
|
|
|
868
|
+
export declare type ResolvedNumericPresentationEntry = {
|
|
869
|
+
scope: PresentationScope;
|
|
870
|
+
target: NumericPresentationTarget;
|
|
871
|
+
format: NumericCanonicalFormat;
|
|
872
|
+
};
|
|
873
|
+
|
|
874
|
+
export declare type ResolvedPresentationEntry = ResolvedNumericPresentationEntry | ResolvedTemporalBucketPresentationEntry;
|
|
875
|
+
|
|
876
|
+
export declare type ResolvedTemporalBucketFormat = TemporalBucketFormat & {
|
|
877
|
+
locale: string;
|
|
878
|
+
};
|
|
879
|
+
|
|
880
|
+
export declare type ResolvedTemporalBucketFormatParseResult = {
|
|
881
|
+
ok: true;
|
|
882
|
+
value: ResolvedTemporalBucketFormat;
|
|
883
|
+
} | {
|
|
884
|
+
ok: false;
|
|
885
|
+
issues: Array<{
|
|
886
|
+
path: string;
|
|
887
|
+
message: string;
|
|
888
|
+
}>;
|
|
889
|
+
};
|
|
890
|
+
|
|
891
|
+
export declare type ResolvedTemporalBucketPresentation = {
|
|
892
|
+
format: ResolvedTemporalBucketFormat;
|
|
893
|
+
source: 'card' | 'semantic' | 'automatic';
|
|
894
|
+
};
|
|
895
|
+
|
|
896
|
+
export declare type ResolvedTemporalBucketPresentationEntry = {
|
|
897
|
+
scope: PresentationScope;
|
|
898
|
+
target: TemporalBucketPresentationTarget;
|
|
899
|
+
format: ResolvedTemporalBucketFormat;
|
|
900
|
+
};
|
|
901
|
+
|
|
603
902
|
declare type ResolvedValueFormatPreferences = {
|
|
604
903
|
locale: string;
|
|
605
904
|
dateStyle: LocaleStyle;
|
|
@@ -620,8 +919,25 @@ declare type ResolvedValueFormatPreferenceSources = {
|
|
|
620
919
|
defaultCurrency: ReportPreferenceSource;
|
|
621
920
|
};
|
|
622
921
|
|
|
922
|
+
/** Stable result-instance identity shared by query producers and consumers. */
|
|
923
|
+
export declare function resolveMetricResultAlias(metric: MetricResultAliasInput): string;
|
|
924
|
+
|
|
623
925
|
export declare function resolveNumericPresentation(authored: NumericCanonicalFormat, preferences: ResolvedValueFormatPreferences, boundCurrency?: string): NumericCanonicalFormat;
|
|
624
926
|
|
|
927
|
+
export declare function resolveQueryColumnKeyMapEntry(columnKeyMap: QueryColumnKeyMap | undefined, fieldId: string, role: QueryColumnKeyRole): QueryColumnKeyMapEntry | undefined;
|
|
928
|
+
|
|
929
|
+
export declare function resolveTemporalBucketPresentation(input: ResolveTemporalBucketPresentationInput): ResolvedTemporalBucketPresentation;
|
|
930
|
+
|
|
931
|
+
export declare type ResolveTemporalBucketPresentationInput = {
|
|
932
|
+
metadata: TemporalBucketMetadata;
|
|
933
|
+
semanticFormat?: {
|
|
934
|
+
granularity: SemaphorTimeGrain;
|
|
935
|
+
format: TemporalBucketFormat;
|
|
936
|
+
};
|
|
937
|
+
cardFormat?: TemporalBucketFormat;
|
|
938
|
+
locale: string;
|
|
939
|
+
};
|
|
940
|
+
|
|
625
941
|
/**
|
|
626
942
|
* Date formatting utilities with timezone support
|
|
627
943
|
* IMPORTANT: No React imports allowed in this file
|
|
@@ -640,11 +956,166 @@ export declare function resolveNumericPresentation(authored: NumericCanonicalFor
|
|
|
640
956
|
*/
|
|
641
957
|
export declare function resolveTimezone(columnTimezone: string | undefined, contextTimezone: string): string;
|
|
642
958
|
|
|
643
|
-
export declare
|
|
644
|
-
|
|
645
|
-
|
|
959
|
+
export declare function resolveUniqueQueryColumnKeyMapEntry(columnKeyMap: QueryColumnKeyMap | undefined, fieldId: string): QueryColumnKeyMapEntry | undefined;
|
|
960
|
+
|
|
961
|
+
/** Stable field identity for the query builder's generated Count measure. */
|
|
962
|
+
export declare const SEMAPHOR_GENERATED_COUNT_METRIC_ID: "__auto_count__";
|
|
963
|
+
|
|
964
|
+
declare const SEMAPHOR_TIME_GRAINS: readonly ["second", "minute", "hour", "day", "week", "month", "quarter", "year"];
|
|
965
|
+
|
|
966
|
+
declare type SemaphorAggregateFunction = 'SUM' | 'COUNT' | 'AVG' | 'MIN' | 'MAX' | 'MEDIAN' | 'DISTINCT';
|
|
967
|
+
|
|
968
|
+
declare type SemaphorDerivedFieldAggregationBehavior = 'additive' | 'non_additive' | 'ratio_of_sums' | 'weighted' | 'pre_aggregated' | 'snapshot';
|
|
969
|
+
|
|
970
|
+
declare type SemaphorDerivedFieldAggregationStrategy = 'default' | 'symmetric_aggregate' | 'aggregate_then_join' | 'weighted';
|
|
971
|
+
|
|
972
|
+
declare type SemaphorDerivedFieldComputeStage = 'row' | 'aggregate';
|
|
973
|
+
|
|
974
|
+
declare type SemaphorDerivedFieldDefinition = {
|
|
975
|
+
kind: 'derived_field';
|
|
976
|
+
name: string;
|
|
977
|
+
label: string;
|
|
978
|
+
description?: string;
|
|
979
|
+
resultRole: SemaphorDerivedFieldResultRole;
|
|
980
|
+
dataType: NonNullable<SemaphorFieldRef['dataType']>;
|
|
981
|
+
computeStage: SemaphorDerivedFieldComputeStage;
|
|
982
|
+
expression: string;
|
|
983
|
+
expressionLanguage?: 'semaphor_sql_template';
|
|
984
|
+
inputs: Record<string, SemaphorDerivedFieldInput>;
|
|
985
|
+
defaultAggregate?: SemaphorAggregateFunction;
|
|
986
|
+
aggregationBehavior?: SemaphorDerivedFieldAggregationBehavior;
|
|
987
|
+
aggregationStrategy?: SemaphorDerivedFieldAggregationStrategy;
|
|
988
|
+
format?: SemaphorScalarValueFormat;
|
|
989
|
+
tags?: string[];
|
|
990
|
+
};
|
|
991
|
+
|
|
992
|
+
declare type SemaphorDerivedFieldInput = {
|
|
993
|
+
kind: 'field';
|
|
994
|
+
field: SemaphorFieldRef;
|
|
995
|
+
aggregate?: SemaphorAggregateFunction;
|
|
996
|
+
};
|
|
997
|
+
|
|
998
|
+
declare type SemaphorDerivedFieldResultRole = 'measure' | 'dimension' | 'date' | 'id' | 'unknown';
|
|
999
|
+
|
|
1000
|
+
declare type SemaphorDialect = 'postgres' | 'mysql' | 'mssql' | 'snowflake' | 'clickhouse' | 'bigquery' | 'redshift' | 'duckdb' | 'sqlite' | 'unknown';
|
|
1001
|
+
|
|
1002
|
+
declare type SemaphorFieldRef = {
|
|
1003
|
+
name: string;
|
|
646
1004
|
label?: string;
|
|
647
|
-
|
|
1005
|
+
role?: 'dimension' | 'measure' | 'date' | 'id' | 'unknown';
|
|
1006
|
+
dataType?: 'string' | 'number' | 'boolean' | 'date' | 'datetime' | 'unknown';
|
|
1007
|
+
source?: SemaphorSourceRef;
|
|
1008
|
+
aggregate?: SemaphorAggregateFunction;
|
|
1009
|
+
};
|
|
1010
|
+
|
|
1011
|
+
declare type SemaphorPivotResultColumnIdentity = {
|
|
1012
|
+
metricId: string;
|
|
1013
|
+
/** Collision-safe identity for this configured metric instance. */
|
|
1014
|
+
metricAlias: string;
|
|
1015
|
+
/**
|
|
1016
|
+
* Sole transported tuple identity in configured pivot-axis order. A leaf
|
|
1017
|
+
* carries the complete tuple, a subtotal carries its explicit prefix, and a
|
|
1018
|
+
* metric-only or grand-total column carries an empty tuple.
|
|
1019
|
+
*/
|
|
1020
|
+
members: SemaphorPivotResultMember[];
|
|
1021
|
+
};
|
|
1022
|
+
|
|
1023
|
+
declare type SemaphorPivotResultMember = {
|
|
1024
|
+
/** Stable identity of the configured pivot field. */
|
|
1025
|
+
fieldId: string;
|
|
1026
|
+
/** Canonical pivot member value; labels are resolved only at presentation. */
|
|
1027
|
+
value: SemaphorPivotValue;
|
|
1028
|
+
/** Present when this member is an activated governed temporal bucket. */
|
|
1029
|
+
temporalBucket?: TemporalBucketMetadata;
|
|
1030
|
+
};
|
|
1031
|
+
|
|
1032
|
+
/** Stable canonical scalar transported for one physical pivot member. */
|
|
1033
|
+
declare type SemaphorPivotValue = string | null;
|
|
1034
|
+
|
|
1035
|
+
declare type SemaphorResultColumn = {
|
|
1036
|
+
/**
|
|
1037
|
+
* Stable row accessor for this result. Consumers should read values with
|
|
1038
|
+
* `row[column.key]`; labels are display-only and may change.
|
|
1039
|
+
*/
|
|
1040
|
+
key: string;
|
|
1041
|
+
/**
|
|
1042
|
+
* Semantic/source field name before result-key disambiguation.
|
|
1043
|
+
*/
|
|
1044
|
+
name: string;
|
|
1045
|
+
/**
|
|
1046
|
+
* Human-facing display label.
|
|
1047
|
+
*/
|
|
1048
|
+
label: string;
|
|
1049
|
+
role?: SemaphorFieldRef['role'];
|
|
1050
|
+
dataType?: SemaphorFieldRef['dataType'];
|
|
1051
|
+
aggregate?: SemaphorFieldRef['aggregate'];
|
|
1052
|
+
source?: SemaphorFieldRef['source'];
|
|
1053
|
+
derivedField?: SemaphorDerivedFieldDefinition;
|
|
1054
|
+
temporalBucket?: TemporalBucketMetadata;
|
|
1055
|
+
pivotIdentity?: SemaphorPivotResultColumnIdentity;
|
|
1056
|
+
};
|
|
1057
|
+
|
|
1058
|
+
declare type SemaphorScalarValueFormat = {
|
|
1059
|
+
type: 'number' | 'currency' | 'percent' | 'percentage' | 'scientific';
|
|
1060
|
+
minimumFractionDigits?: number;
|
|
1061
|
+
maximumFractionDigits?: number;
|
|
1062
|
+
useGrouping?: boolean;
|
|
1063
|
+
prefix?: string;
|
|
1064
|
+
suffix?: string;
|
|
1065
|
+
negativeStyle?: 'minus' | 'parentheses';
|
|
1066
|
+
compact?: boolean;
|
|
1067
|
+
scale?: number;
|
|
1068
|
+
currency?: string;
|
|
1069
|
+
percentValueMode?: 'fraction' | 'whole';
|
|
1070
|
+
} | {
|
|
1071
|
+
type: 'date' | 'datetime';
|
|
1072
|
+
locale?: string;
|
|
1073
|
+
pattern?: string;
|
|
1074
|
+
relative?: boolean;
|
|
1075
|
+
timezone?: string;
|
|
1076
|
+
sourceTimezone?: string;
|
|
1077
|
+
prefix?: string;
|
|
1078
|
+
suffix?: string;
|
|
1079
|
+
} | {
|
|
1080
|
+
type: 'duration';
|
|
1081
|
+
inputUnit?: 'millisecond' | 'second' | 'minute' | 'hour' | 'day';
|
|
1082
|
+
outputStyle?: 'compact' | 'digital' | 'long';
|
|
1083
|
+
largestUnit?: 'millisecond' | 'second' | 'minute' | 'hour' | 'day';
|
|
1084
|
+
smallestUnit?: 'millisecond' | 'second' | 'minute' | 'hour' | 'day';
|
|
1085
|
+
maxUnits?: number;
|
|
1086
|
+
prefix?: string;
|
|
1087
|
+
suffix?: string;
|
|
1088
|
+
negativeStyle?: 'minus' | 'parentheses';
|
|
1089
|
+
} | {
|
|
1090
|
+
type: 'string';
|
|
1091
|
+
prefix?: string;
|
|
1092
|
+
suffix?: string;
|
|
1093
|
+
};
|
|
1094
|
+
|
|
1095
|
+
declare type SemaphorSourceRef = {
|
|
1096
|
+
kind: 'semantic';
|
|
1097
|
+
domainId: string;
|
|
1098
|
+
datasetName: string;
|
|
1099
|
+
datasetId?: string;
|
|
1100
|
+
label?: string;
|
|
1101
|
+
connectionId?: string;
|
|
1102
|
+
} | {
|
|
1103
|
+
kind: 'physical';
|
|
1104
|
+
connectionId: string;
|
|
1105
|
+
connectionType?: string;
|
|
1106
|
+
tableName: string;
|
|
1107
|
+
databaseName?: string;
|
|
1108
|
+
schemaName?: string;
|
|
1109
|
+
label?: string;
|
|
1110
|
+
dialect?: SemaphorDialect;
|
|
1111
|
+
} | {
|
|
1112
|
+
kind: 'sql';
|
|
1113
|
+
connectionId: string;
|
|
1114
|
+
dialect?: SemaphorDialect;
|
|
1115
|
+
label?: string;
|
|
1116
|
+
};
|
|
1117
|
+
|
|
1118
|
+
declare type SemaphorTimeGrain = (typeof SEMAPHOR_TIME_GRAINS)[number];
|
|
648
1119
|
|
|
649
1120
|
export declare type StringCanonicalFormat = {
|
|
650
1121
|
type: 'string';
|
|
@@ -652,8 +1123,103 @@ export declare type StringCanonicalFormat = {
|
|
|
652
1123
|
suffix?: string;
|
|
653
1124
|
};
|
|
654
1125
|
|
|
1126
|
+
export declare const TEMPORAL_BUCKET_PATTERN_TOKENS: readonly ["YYYY", "MMMM", "MMM", "YY", "MM", "DD", "HH", "mm", "ss"];
|
|
1127
|
+
|
|
1128
|
+
declare const TEMPORAL_BUCKET_PRESETS: readonly ["week_of_short", "week_of_long", "quarter_short", "quarter_long", "fiscal_quarter_short", "fiscal_year"];
|
|
1129
|
+
|
|
1130
|
+
export declare class TemporalBucketContractError extends Error {
|
|
1131
|
+
readonly code: 'invalid_temporal_bucket_format' | 'invalid_temporal_bucket_value';
|
|
1132
|
+
constructor(code: TemporalBucketContractError['code'], message: string);
|
|
1133
|
+
}
|
|
1134
|
+
|
|
1135
|
+
declare type TemporalBucketFormat = {
|
|
1136
|
+
type: 'temporal_bucket';
|
|
1137
|
+
presentation: TemporalBucketPresentation;
|
|
1138
|
+
};
|
|
1139
|
+
|
|
1140
|
+
export declare type TemporalBucketFormatApplicabilityErrorCode = 'invalid_temporal_bucket_pattern' | 'incompatible_temporal_bucket_pattern' | 'incompatible_temporal_bucket_preset';
|
|
1141
|
+
|
|
1142
|
+
export declare type TemporalBucketFormatApplicabilityResult = {
|
|
1143
|
+
ok: true;
|
|
1144
|
+
segments?: TemporalBucketPatternSegment[];
|
|
1145
|
+
} | {
|
|
1146
|
+
ok: false;
|
|
1147
|
+
code: TemporalBucketFormatApplicabilityErrorCode;
|
|
1148
|
+
message: string;
|
|
1149
|
+
};
|
|
1150
|
+
|
|
1151
|
+
export declare type TemporalBucketMetadata = {
|
|
1152
|
+
kind: 'temporal_bucket';
|
|
1153
|
+
granularity: SemaphorTimeGrain;
|
|
1154
|
+
calendar: Pick<CalendarContext, 'tz' | 'weekStart' | 'fiscalCalendar'>;
|
|
1155
|
+
};
|
|
1156
|
+
|
|
1157
|
+
export declare type TemporalBucketPatternSegment = {
|
|
1158
|
+
kind: 'token';
|
|
1159
|
+
value: TemporalBucketPatternToken;
|
|
1160
|
+
} | {
|
|
1161
|
+
kind: 'literal';
|
|
1162
|
+
value: string;
|
|
1163
|
+
};
|
|
1164
|
+
|
|
1165
|
+
export declare type TemporalBucketPatternToken = (typeof TEMPORAL_BUCKET_PATTERN_TOKENS)[number];
|
|
1166
|
+
|
|
1167
|
+
export declare type TemporalBucketPatternTokenizationResult = {
|
|
1168
|
+
ok: true;
|
|
1169
|
+
segments: TemporalBucketPatternSegment[];
|
|
1170
|
+
} | {
|
|
1171
|
+
ok: false;
|
|
1172
|
+
code: 'invalid_temporal_bucket_pattern';
|
|
1173
|
+
message: string;
|
|
1174
|
+
};
|
|
1175
|
+
|
|
1176
|
+
declare type TemporalBucketPresentation = {
|
|
1177
|
+
mode: 'auto';
|
|
1178
|
+
} | {
|
|
1179
|
+
mode: 'preset';
|
|
1180
|
+
preset: TemporalBucketPreset;
|
|
1181
|
+
} | {
|
|
1182
|
+
mode: 'pattern';
|
|
1183
|
+
pattern: string;
|
|
1184
|
+
};
|
|
1185
|
+
|
|
1186
|
+
export declare type TemporalBucketPresentationTarget = {
|
|
1187
|
+
kind: 'field';
|
|
1188
|
+
fieldId: string;
|
|
1189
|
+
/** Distinguishes one semantic field used on both pivot axes. */
|
|
1190
|
+
role?: 'groupby' | 'pivotby';
|
|
1191
|
+
} | {
|
|
1192
|
+
kind: 'column';
|
|
1193
|
+
columnKey: string;
|
|
1194
|
+
} | {
|
|
1195
|
+
kind: 'matrix_axis';
|
|
1196
|
+
axisInstanceId: string;
|
|
1197
|
+
};
|
|
1198
|
+
|
|
1199
|
+
declare type TemporalBucketPreset = (typeof TEMPORAL_BUCKET_PRESETS)[number];
|
|
1200
|
+
|
|
1201
|
+
export declare type TemporalBucketValue = string | null;
|
|
1202
|
+
|
|
1203
|
+
export declare type TemporalBucketValueParseResult = {
|
|
1204
|
+
ok: true;
|
|
1205
|
+
value: ParsedTemporalBucketValue | null;
|
|
1206
|
+
} | {
|
|
1207
|
+
ok: false;
|
|
1208
|
+
error: {
|
|
1209
|
+
code: 'invalid_temporal_bucket_value';
|
|
1210
|
+
message: string;
|
|
1211
|
+
};
|
|
1212
|
+
};
|
|
1213
|
+
|
|
1214
|
+
/**
|
|
1215
|
+
* Tokenizes the finite grouped-temporal pattern vocabulary from Plan 04.
|
|
1216
|
+
* It intentionally performs a deterministic left-to-right scan instead of
|
|
1217
|
+
* regex replacement or date-library token inference.
|
|
1218
|
+
*/
|
|
1219
|
+
export declare function tokenizeTemporalBucketPattern(pattern: string): TemporalBucketPatternTokenizationResult;
|
|
1220
|
+
|
|
655
1221
|
export declare function validateCardExportNumericPresentationSnapshot(input: {
|
|
656
|
-
|
|
1222
|
+
snapshot: PresentationExecutionSnapshot;
|
|
657
1223
|
expectedScope: {
|
|
658
1224
|
dashboardId: string;
|
|
659
1225
|
cardId: string;
|
|
@@ -662,6 +1228,18 @@ export declare function validateCardExportNumericPresentationSnapshot(input: {
|
|
|
662
1228
|
useFormattedValues: boolean;
|
|
663
1229
|
}): void;
|
|
664
1230
|
|
|
1231
|
+
export declare function validateCardExportPresentationSnapshot(input: {
|
|
1232
|
+
snapshot: PresentationExecutionSnapshot;
|
|
1233
|
+
expectedScope: {
|
|
1234
|
+
dashboardId: string;
|
|
1235
|
+
cardId: string;
|
|
1236
|
+
};
|
|
1237
|
+
visibleColumns?: string[];
|
|
1238
|
+
useFormattedValues: boolean;
|
|
1239
|
+
}): void;
|
|
1240
|
+
|
|
1241
|
+
export declare function validateTemporalBucketFormatApplicability(format: TemporalBucketFormat, granularity: SemaphorTimeGrain): TemporalBucketFormatApplicabilityResult;
|
|
1242
|
+
|
|
665
1243
|
declare type WeekStart = 0 | 1 | 2 | 3 | 4 | 5 | 6;
|
|
666
1244
|
|
|
667
1245
|
export { }
|