react-semaphor 0.1.603 → 0.1.604
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/activity/index.js +1 -73
- package/dist/analytics-protocol/index.js +1 -1491
- package/dist/appearance/index.js +1 -12
- package/dist/appearance-runtime/index.js +1 -5
- package/dist/assistant-context/index.js +1 -11
- package/dist/assistant-protocol/index.js +1 -152
- package/dist/brand-studio/index.js +4 -1594
- package/dist/briefings/index.js +1 -70
- package/dist/chunks/add-to-dashboard-DeHEBEqG.js +12 -0
- package/dist/chunks/analytics-base-schemas-BREc5WGv.js +1 -0
- package/dist/chunks/appearance-context-BqBZrijL.js +1 -0
- package/dist/chunks/appearance-runtime-provider-DmbCrOOG.js +1 -0
- package/dist/chunks/applied-constraints-CinevlKD.js +1 -0
- package/dist/chunks/assistant-chat-CjYrwVDa.js +56 -0
- package/dist/chunks/attribution-BEFSsbNn.js +1 -0
- package/dist/chunks/availability-3AIOf6Z-.js +1 -0
- package/dist/chunks/bookmark-impact-C89zBLq3.js +1 -0
- package/dist/chunks/bookmark-state-69YYnRql.js +1 -0
- package/dist/chunks/brand-DCaZyRt6.js +1 -0
- package/dist/chunks/card-filter-builder-CTp6RAz1.js +17 -0
- package/dist/chunks/column-bands-DwxbZ6UI.js +1 -0
- package/dist/chunks/comparison-window-caption-C312mn3s.js +1 -0
- package/dist/chunks/context-ALdccLHw.js +2 -0
- package/dist/chunks/conversation-JMK2kyTK.js +1 -0
- package/dist/chunks/dashboard-BX28ld6s.js +1 -0
- package/dist/chunks/dashboard-briefing-launcher-qo7GH4EO.js +37 -0
- package/dist/chunks/dashboard-controls-DhRjB7MA.js +42 -0
- package/dist/chunks/dashboard-json-9cHzhSjC.js +1 -0
- package/dist/chunks/dates-D-KP8G-z.js +1 -0
- package/dist/chunks/edit-DEAK0UZo.js +1 -0
- package/dist/chunks/edit-dashboard-visual-Duq_QkB_.js +93 -0
- package/dist/chunks/export-file-format-B-wQNHIn.js +4 -0
- package/dist/chunks/filter-line-CwQrqORc.js +1 -0
- package/dist/chunks/filter-reach-preview-gixPFlZj.js +1 -0
- package/dist/chunks/filter-value-text-B3tXakhd.js +1 -0
- package/dist/chunks/index-B-VF1ogs.js +1 -0
- package/dist/chunks/index-BE1DfxNs.js +1 -0
- package/dist/chunks/index-DViPGDFj.js +1 -0
- package/dist/chunks/layout-grid-BWtlgw0T.js +6 -0
- package/dist/chunks/matrix-analytical-definition-CtFqWyCK.js +1 -0
- package/dist/chunks/matrix-member-presentation-Q0MCJ-YK.js +1 -0
- package/dist/chunks/matrix-operation-contract-D1RC1bfi.js +1 -0
- package/dist/chunks/metric-comparison-DEZYXROZ.js +1 -0
- package/dist/chunks/normalize-dashboard-for-dirty-check-ILKfqgL3.js +1 -0
- package/dist/chunks/paintbrush-BjS3SbrH.js +6 -0
- package/dist/chunks/palette-BzC-CGOc.js +6 -0
- package/dist/chunks/pickers-DuBrUht0.js +1 -0
- package/dist/chunks/pivot-result-contract-expectations-DTQAgr4n.js +1 -0
- package/dist/chunks/pivot-result-identity-DTNCB--h.js +1 -0
- package/dist/chunks/raw-temporal-value-DeyEhL0S.js +1 -0
- package/dist/chunks/rendered-file-BbvwaU6z.js +1 -0
- package/dist/chunks/report-preferences-dialog-B_gUmCzG.js +1 -0
- package/dist/chunks/report-runtime-context-BWzIHCKK.js +1 -0
- package/dist/chunks/resolve-dashboard-input-context-B-TtRqxu.js +8 -0
- package/dist/chunks/resolver-AN9ChBfZ.js +1 -0
- package/dist/chunks/save-DdFUZcbi.js +6 -0
- package/dist/chunks/saved-dashboard-context-BAJ5tWiq.js +1 -0
- package/dist/chunks/schema-MC0cQSAb.js +4 -0
- package/dist/chunks/selection-filter-compiler-CCoCD25M.js +1 -0
- package/dist/chunks/semaphor-ready-indicator-DzjorP3t.js +999 -0
- package/dist/chunks/set-DuJfGkbY.js +1 -0
- package/dist/chunks/shelf-drop-preview-context-BlLJ5RsT.js +6 -0
- package/dist/chunks/stored-dashboard-Ctcpkllg.js +1 -0
- package/dist/chunks/style-sheet-parts-BRGt9O05.js +178 -0
- package/dist/chunks/table-export-sheet-rC5pKmXg.js +2 -0
- package/dist/chunks/token-types-Bj9iMy0w.js +1 -0
- package/dist/chunks/validators-CqV3Yka1.js +1 -0
- package/dist/chunks/variable-draft-DJrfUyhv.js +1 -0
- package/dist/chunks/visual-choice-DgEFfkE-.js +1 -0
- package/dist/dashboard/index.js +1 -7
- package/dist/dashboard-authoring/index.js +1 -4614
- package/dist/format-utils/index.js +1 -425
- package/dist/index.js +1 -554
- package/dist/layouts/index.js +1 -7
- package/dist/live-channel/index.js +1 -124
- package/dist/pdf-export-policy/index.js +1 -92
- package/dist/pdf-table-layout/index.js +1 -993
- package/dist/report-runtime-context/index.js +1 -9
- package/dist/shared/index.js +1 -6
- package/dist/style.css +1 -1
- package/dist/surfboard/index.js +1 -9
- package/dist/types/index.js +1 -88
- package/dist/types/lib/filter-values/build-card-filter-definition.d.ts +32 -0
- package/dist/types/lib/query-context/dashboard-filter-mapping-resolution.d.ts +9 -0
- package/dist/types/lib/stores/explorer-actions.d.ts +7 -6
- package/dist/types/lib/types/semantic-types.d.ts +6 -10
- package/dist/types/lib/utils/field-state-calculator.d.ts +7 -19
- package/dist/types/shared/dashboard-authoring/calculations/definition.d.ts +13 -0
- package/dist/types/shared/dashboard-authoring/card-data-source/card-base.d.ts +125 -0
- package/dist/types/shared/dashboard-authoring/card-data-source/card-field-folders.d.ts +55 -0
- package/dist/types/shared/dashboard-authoring/card-data-source/card-joins.d.ts +114 -0
- package/dist/types/shared/dashboard-authoring/card-data-source/card-prune.d.ts +12 -0
- package/dist/types/shared/dashboard-authoring/card-data-source/filter-field-catalog.d.ts +60 -0
- package/dist/types/shared/dashboard-authoring/card-data-source/filter-field-folders.d.ts +132 -0
- package/dist/types/shared/dashboard-authoring/card-data-source/index.d.ts +7 -0
- package/dist/types/shared/dashboard-authoring/card-data-source/join-reach.d.ts +42 -0
- package/dist/types/shared/dashboard-authoring/card-field-places.d.ts +28 -0
- package/dist/types/shared/dashboard-authoring/field-folders/field-folders.d.ts +115 -0
- package/dist/types/shared/dashboard-authoring/field-folders/index.d.ts +1 -0
- package/dist/types/shared/dashboard-authoring/filter-reach-decision.d.ts +11 -0
- package/dist/types/shared/dashboard-authoring/index.d.ts +6 -1
- package/dist/types/shared/dashboard-authoring/outline/outline-filters.d.ts +2 -0
- package/dist/types/shared/dashboard-authoring/see-records/result.d.ts +7 -22
- package/dist/usage-events/index.js +1 -285
- package/dist/value-format-preferences/index.js +1 -635
- package/package.json +4 -1
- package/dist/chunks/add-to-dashboard-CFF-wFU-.js +0 -291
- package/dist/chunks/analytics-base-schemas-DsUh5Q3C.js +0 -680
- package/dist/chunks/appearance-context-BwBp25ZG.js +0 -162
- package/dist/chunks/appearance-runtime-provider-BRHYELkC.js +0 -80
- package/dist/chunks/applied-constraints-DU-wndZ7.js +0 -47
- package/dist/chunks/assistant-chat-B6hNQI1t.js +0 -6115
- package/dist/chunks/attribution-BvoKvhcj.js +0 -32
- package/dist/chunks/availability-Bp5Gfu1I.js +0 -44
- package/dist/chunks/bookmark-impact-Ba2PLcGp.js +0 -76
- package/dist/chunks/bookmark-state-n7AaNzR_.js +0 -1667
- package/dist/chunks/brand-BoUV0iHF.js +0 -54
- package/dist/chunks/card-filter-builder-Y22HizVx.js +0 -4069
- package/dist/chunks/column-bands-RdM-kjDe.js +0 -47
- package/dist/chunks/comparison-window-caption-Ck2TIbnR.js +0 -741
- package/dist/chunks/context-UCQ7sere.js +0 -369
- package/dist/chunks/conversation-sQiWYUOb.js +0 -16
- package/dist/chunks/dashboard-BghI99oY.js +0 -14
- package/dist/chunks/dashboard-briefing-launcher-DtBAnGiH.js +0 -4875
- package/dist/chunks/dashboard-controls-CtFXlyjV.js +0 -2290
- package/dist/chunks/dashboard-json-DfGBUtCd.js +0 -66
- package/dist/chunks/dates-BnrXF4bb.js +0 -185
- package/dist/chunks/edit-9df1zOWe.js +0 -226
- package/dist/chunks/edit-dashboard-visual-oxt3x1wb.js +0 -18397
- package/dist/chunks/export-file-format-C-tJsxsf.js +0 -111
- package/dist/chunks/filter-line-Cy5YYqRL.js +0 -703
- package/dist/chunks/filter-reach-copy-CE_ZX147.js +0 -5111
- package/dist/chunks/filter-value-text-fWvSDwkl.js +0 -153
- package/dist/chunks/index-BVKzKl5d.js +0 -90
- package/dist/chunks/index-CV_Kzou0.js +0 -595
- package/dist/chunks/index-D5rxbtS4.js +0 -2795
- package/dist/chunks/layout-grid-9LndRoLa.js +0 -16
- package/dist/chunks/matrix-analytical-definition-CCp48UCw.js +0 -1233
- package/dist/chunks/matrix-member-presentation-zNehruXR.js +0 -391
- package/dist/chunks/matrix-operation-contract-DPBj69D8.js +0 -1413
- package/dist/chunks/metric-comparison-B0FR-Q8I.js +0 -600
- package/dist/chunks/normalize-dashboard-for-dirty-check-XKgH3GFX.js +0 -119
- package/dist/chunks/paintbrush-58FQYY-y.js +0 -27
- package/dist/chunks/palette-Be62Tkoa.js +0 -23
- package/dist/chunks/pickers-DkqmtnTL.js +0 -2403
- package/dist/chunks/pivot-result-contract-expectations-BYqAmG9n.js +0 -5092
- package/dist/chunks/pivot-result-identity-CAP4--iq.js +0 -77
- package/dist/chunks/raw-temporal-value-Dg_MTFF7.js +0 -3778
- package/dist/chunks/rendered-file-D8xEuVVx.js +0 -108
- package/dist/chunks/report-preferences-dialog-uJp9GBTM.js +0 -1651
- package/dist/chunks/report-runtime-context-c77_KF9v.js +0 -388
- package/dist/chunks/resolve-dashboard-input-context-Rtl1ffmE.js +0 -25324
- package/dist/chunks/resolver-DG_tfEpt.js +0 -156
- package/dist/chunks/save-C5A0JnEV.js +0 -21
- package/dist/chunks/saved-dashboard-context-tcyTU8jm.js +0 -618
- package/dist/chunks/schema-C9NPiIru.js +0 -2568
- package/dist/chunks/selection-filter-compiler-DNijjI5y.js +0 -150
- package/dist/chunks/semaphor-ready-indicator-FBvunj6S.js +0 -145603
- package/dist/chunks/shelf-drop-preview-context-QKStrcK9.js +0 -2466
- package/dist/chunks/stored-dashboard-CHozcAY9.js +0 -4075
- package/dist/chunks/style-sheet-parts-CDCG-8Ej.js +0 -8681
- package/dist/chunks/table-export-sheet-ZFIvs6Sj.js +0 -949
- package/dist/chunks/token-types-XbM6QByy.js +0 -8
- package/dist/chunks/upload-H15d7uHK.js +0 -15
- package/dist/chunks/validators-Baf3VIf5.js +0 -3686
- package/dist/chunks/variable-draft-C2y8Jp6Z.js +0 -242
- package/dist/chunks/visual-choice-DDfHfHvY.js +0 -172
package/dist/surfboard/index.js
CHANGED
|
@@ -1,9 +1 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { C as f, E as D } from "../chunks/bookmark-state-n7AaNzR_.js";
|
|
3
|
-
export {
|
|
4
|
-
f as CONTROL_CARD_DEFAULT_VALUE,
|
|
5
|
-
a as DisplayFormatPreferencesFields,
|
|
6
|
-
D as EMPTY_SELECTION,
|
|
7
|
-
s as ReportPreferencesDialog,
|
|
8
|
-
o as Surfboard
|
|
9
|
-
};
|
|
1
|
+
import{a,R as s,D as o}from"../chunks/report-preferences-dialog-B_gUmCzG.js";import{C as f,E as D}from"../chunks/bookmark-state-69YYnRql.js";export{f as CONTROL_CARD_DEFAULT_VALUE,a as DisplayFormatPreferencesFields,D as EMPTY_SELECTION,s as ReportPreferencesDialog,o as Surfboard};
|
package/dist/types/index.js
CHANGED
|
@@ -1,88 +1 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { C as V, D as w, L as z, d as U, g as k, e as B, h as K, f as v, c as Y, a as q, i as G, b as P, n as Q, s as W } from "../chunks/validators-Baf3VIf5.js";
|
|
3
|
-
import { D as J } from "../chunks/token-types-XbM6QByy.js";
|
|
4
|
-
import { r as H, a as Z } from "../chunks/pivot-result-identity-CAP4--iq.js";
|
|
5
|
-
import { D as ee } from "../chunks/report-runtime-context-c77_KF9v.js";
|
|
6
|
-
const e = [
|
|
7
|
-
"concatenate",
|
|
8
|
-
"conditional-category",
|
|
9
|
-
"date-part",
|
|
10
|
-
"date-difference",
|
|
11
|
-
"null-to-zero",
|
|
12
|
-
"safe-ratio",
|
|
13
|
-
"nested-conditional",
|
|
14
|
-
"membership-test",
|
|
15
|
-
"uppercase",
|
|
16
|
-
"lowercase",
|
|
17
|
-
"trim-whitespace",
|
|
18
|
-
"replace-text",
|
|
19
|
-
"first-characters",
|
|
20
|
-
"character-count",
|
|
21
|
-
"starts-with",
|
|
22
|
-
"number-to-text",
|
|
23
|
-
"start-of-month",
|
|
24
|
-
"start-of-quarter",
|
|
25
|
-
"start-of-year",
|
|
26
|
-
"year-number",
|
|
27
|
-
"add-days",
|
|
28
|
-
"round-number",
|
|
29
|
-
"round-down",
|
|
30
|
-
"round-up",
|
|
31
|
-
"absolute-value",
|
|
32
|
-
"cap-maximum",
|
|
33
|
-
"floor-minimum",
|
|
34
|
-
"fill-blanks",
|
|
35
|
-
"null-if-zero",
|
|
36
|
-
"is-blank"
|
|
37
|
-
];
|
|
38
|
-
export {
|
|
39
|
-
t as BOOKMARK_STATE_VERSION,
|
|
40
|
-
r as BOOKMARK_VISIBILITIES,
|
|
41
|
-
V as CALCULATED_FIELD_ENTITY_MARKER,
|
|
42
|
-
e as CALCULATED_FIELD_TEMPLATE_IDS,
|
|
43
|
-
l as CONTROL_CARD_DEFAULT_VALUE,
|
|
44
|
-
w as DATE_FORMAT_VALUES,
|
|
45
|
-
ee as DEFAULT_CALENDAR_CONTEXT,
|
|
46
|
-
J as DEFAULT_SEMANTIC_DOMAIN_ACCESS,
|
|
47
|
-
o as EMPTY_SELECTION,
|
|
48
|
-
z as LEGACY_CALCULATED_FIELD_ENTITY_MARKER,
|
|
49
|
-
i as VIEWER_LIMITS,
|
|
50
|
-
n as VIEWER_TABLE_SETTINGS_VERSION,
|
|
51
|
-
d as collectDatasetNamesFromExplorerField,
|
|
52
|
-
m as collectDatasetNamesFromFilterGroup,
|
|
53
|
-
u as collectExecutionDatasetNamesFromExplorerField,
|
|
54
|
-
c as collectPreferredDatasetNamesFromExplorerField,
|
|
55
|
-
E as collectQualifiedDatasetNamesFromExplorerField,
|
|
56
|
-
C as datasetRefFromSource,
|
|
57
|
-
T as dependencyDisplayIdentity,
|
|
58
|
-
U as getCalculatedFieldComputeStage,
|
|
59
|
-
p as getCustomizableTableCardIds,
|
|
60
|
-
k as getFieldRuntimeColumnName,
|
|
61
|
-
D as getSortableTableCardIds,
|
|
62
|
-
B as hasCalculatedFieldMarker,
|
|
63
|
-
K as hasCalculatedFormulaInputs,
|
|
64
|
-
A as hasColumnCustomization,
|
|
65
|
-
v as hasSyntheticCalculatedFieldOwner,
|
|
66
|
-
I as humanizeDatasetName,
|
|
67
|
-
Y as inspectCalculatedField,
|
|
68
|
-
q as isCalculatedDimension,
|
|
69
|
-
G as isCalculatedMetric,
|
|
70
|
-
P as isDerivedField,
|
|
71
|
-
_ as isEmptyViewerTableSettings,
|
|
72
|
-
F as isTableCardCustomizable,
|
|
73
|
-
S as isTableCardSortable,
|
|
74
|
-
b as measureJsonBytes,
|
|
75
|
-
Q as normalizeCalculatedFieldRepresentation,
|
|
76
|
-
L as normalizeTableColumnOrder,
|
|
77
|
-
f as normalizeViewerTableSettings,
|
|
78
|
-
N as parseBookmarkState,
|
|
79
|
-
y as parseTableColumnId,
|
|
80
|
-
R as parseViewerTableSettings,
|
|
81
|
-
h as parseViewerTableSettingsMap,
|
|
82
|
-
g as readBookmarkState,
|
|
83
|
-
x as resolveFieldDatasetDependencies,
|
|
84
|
-
H as resolveQueryColumnKeyMapEntry,
|
|
85
|
-
Z as resolveUniqueQueryColumnKeyMapEntry,
|
|
86
|
-
W as shouldDropInheritedCalculationAggregate,
|
|
87
|
-
M as toTableColumnId
|
|
88
|
-
};
|
|
1
|
+
import{B as t,z as r,C as l,E as o,V as i,j as n,c as d,g as m,f as u,b as c,e as E,d as C,a as T,y as p,x as D,o as A,h as I,q as _,w as F,v as S,m as b,n as L,l as f,p as N,k as y,s as R,u as h,i as g,r as x,t as M}from"../chunks/bookmark-state-69YYnRql.js";import{C as V,D as w,L as z,d as U,g as k,e as B,h as K,f as v,c as Y,a as q,i as G,b as P,n as Q,s as W}from"../chunks/validators-CqV3Yka1.js";import{D as J}from"../chunks/token-types-Bj9iMy0w.js";import{r as H,a as Z}from"../chunks/pivot-result-identity-DTNCB--h.js";import{D as ee}from"../chunks/report-runtime-context-BWzIHCKK.js";const e=["concatenate","conditional-category","date-part","date-difference","null-to-zero","safe-ratio","nested-conditional","membership-test","uppercase","lowercase","trim-whitespace","replace-text","first-characters","character-count","starts-with","number-to-text","start-of-month","start-of-quarter","start-of-year","year-number","add-days","round-number","round-down","round-up","absolute-value","cap-maximum","floor-minimum","fill-blanks","null-if-zero","is-blank"];export{t as BOOKMARK_STATE_VERSION,r as BOOKMARK_VISIBILITIES,V as CALCULATED_FIELD_ENTITY_MARKER,e as CALCULATED_FIELD_TEMPLATE_IDS,l as CONTROL_CARD_DEFAULT_VALUE,w as DATE_FORMAT_VALUES,ee as DEFAULT_CALENDAR_CONTEXT,J as DEFAULT_SEMANTIC_DOMAIN_ACCESS,o as EMPTY_SELECTION,z as LEGACY_CALCULATED_FIELD_ENTITY_MARKER,i as VIEWER_LIMITS,n as VIEWER_TABLE_SETTINGS_VERSION,d as collectDatasetNamesFromExplorerField,m as collectDatasetNamesFromFilterGroup,u as collectExecutionDatasetNamesFromExplorerField,c as collectPreferredDatasetNamesFromExplorerField,E as collectQualifiedDatasetNamesFromExplorerField,C as datasetRefFromSource,T as dependencyDisplayIdentity,U as getCalculatedFieldComputeStage,p as getCustomizableTableCardIds,k as getFieldRuntimeColumnName,D as getSortableTableCardIds,B as hasCalculatedFieldMarker,K as hasCalculatedFormulaInputs,A as hasColumnCustomization,v as hasSyntheticCalculatedFieldOwner,I as humanizeDatasetName,Y as inspectCalculatedField,q as isCalculatedDimension,G as isCalculatedMetric,P as isDerivedField,_ as isEmptyViewerTableSettings,F as isTableCardCustomizable,S as isTableCardSortable,b as measureJsonBytes,Q as normalizeCalculatedFieldRepresentation,L as normalizeTableColumnOrder,f as normalizeViewerTableSettings,N as parseBookmarkState,y as parseTableColumnId,R as parseViewerTableSettings,h as parseViewerTableSettingsMap,g as readBookmarkState,x as resolveFieldDatasetDependencies,H as resolveQueryColumnKeyMapEntry,Z as resolveUniqueQueryColumnKeyMapEntry,W as shouldDropInheritedCalculationAggregate,M as toTableColumnId};
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { TFilter } from '../../components/surfboard/filter/types.js';
|
|
2
|
+
import { DataSource, Field } from '../types/explorer-types.js';
|
|
3
|
+
export type CardFilterDefinition = Pick<TFilter, 'column' | 'title' | 'dataType' | 'nativeDataType' | 'qualifiedTableName' | 'connectionId' | 'operation' | 'sql' | 'fieldMeta' | 'semanticContext'> & {
|
|
4
|
+
table: string;
|
|
5
|
+
database: string;
|
|
6
|
+
};
|
|
7
|
+
/**
|
|
8
|
+
* The source a card's filters are built against: its data source and its
|
|
9
|
+
* connection, read in one order for every caller (the card filter builder's
|
|
10
|
+
* value browse, a pinned filter, a column filter). The editor's picked
|
|
11
|
+
* connection leads, then the data source's, then the card's own, since a card
|
|
12
|
+
* may store its connection only at card level.
|
|
13
|
+
*/
|
|
14
|
+
export declare function cardFilterSource(card: {
|
|
15
|
+
dataSource?: DataSource | null;
|
|
16
|
+
connectionId?: string;
|
|
17
|
+
}, selectedConnectionId?: string): {
|
|
18
|
+
dataSource?: DataSource | null;
|
|
19
|
+
connectionId?: string;
|
|
20
|
+
};
|
|
21
|
+
/**
|
|
22
|
+
* The one mapping from an explorer `Field` on a card to the filter
|
|
23
|
+
* definition the filter-values route understands.
|
|
24
|
+
*
|
|
25
|
+
* Used for card inline filters and for browsing values inside the card
|
|
26
|
+
* filter builder, so both read the same catalog coordinates (semantic
|
|
27
|
+
* context, field metadata, qualified table) for the same field.
|
|
28
|
+
*/
|
|
29
|
+
export declare function buildCardFilterDefinition(field: Field, source: {
|
|
30
|
+
dataSource?: DataSource | null;
|
|
31
|
+
connectionId?: string;
|
|
32
|
+
}): CardFilterDefinition;
|
|
@@ -187,6 +187,15 @@ export type DashboardFilterCardReach =
|
|
|
187
187
|
| 'relationship'
|
|
188
188
|
/** A server-side resolver confirmed the route the card will apply (RF-D15). */
|
|
189
189
|
| 'relationshipApplied' | 'notApplicable';
|
|
190
|
+
/** The reaches a reader counts as reaching the card: bound, the card's own field, a SQL card's plain helper, a confirmed route. */
|
|
191
|
+
export type DashboardFilterCardReached = 'bound' | 'automatic' | 'sql' | 'relationshipApplied';
|
|
192
|
+
/**
|
|
193
|
+
* Whether a reach is one a reader counts as reaching the card: the one rule
|
|
194
|
+
* the MCP outline, the filter pickers and an agent's pinned filter read
|
|
195
|
+
* (dashboard filter fields DF-D2). `relationship` (decided when the card runs)
|
|
196
|
+
* and `sqlTemplate` (decided by the card's SQL) are never counted.
|
|
197
|
+
*/
|
|
198
|
+
export declare function isFilterCardReached(reach: DashboardFilterCardReach): reach is DashboardFilterCardReached;
|
|
190
199
|
/**
|
|
191
200
|
* Why a filter in scope doesn't reach a card: a relationship resolver's
|
|
192
201
|
* reason, or `sql_no_filter_reference` for a SQL card whose SQL names no
|
|
@@ -1,12 +1,17 @@
|
|
|
1
|
-
import { CardConfig, DataSource, GroupByField, MetricField, FilterGroup,
|
|
1
|
+
import { CardConfig, DataSource, GroupByField, MetricField, FilterGroup, PivotByField, SortByField } from '../types/explorer-types.js';
|
|
2
2
|
import { TCard, TFrame } from '../types/common-types.js';
|
|
3
3
|
import { EditorStore } from './editor-store.js';
|
|
4
|
+
import { ReachedDatasetInfo } from '../../shared/dashboard-authoring/card-data-source/card-base.js';
|
|
5
|
+
/** A config write's context: the domain's datasets, when the writer has them (ledger P9-04). */
|
|
6
|
+
export type CardWriteOptions = {
|
|
7
|
+
datasets?: readonly ReachedDatasetInfo[];
|
|
8
|
+
};
|
|
4
9
|
export interface ExplorerActions {
|
|
5
10
|
updateFrame: (updates: Partial<TFrame>) => void;
|
|
6
11
|
setActiveCardInFrame: (cardId: string) => void;
|
|
7
12
|
addCard: () => void;
|
|
8
13
|
removeCard: (cardId: string) => void;
|
|
9
|
-
updateCard: (cardId: string, updates: Partial<TCard
|
|
14
|
+
updateCard: (cardId: string, updates: Partial<TCard>, options?: CardWriteOptions) => void;
|
|
10
15
|
setActiveCard: (cardId: string) => void;
|
|
11
16
|
setActiveTabCard: (cardId: string | null) => void;
|
|
12
17
|
updateDataSource: (dataSource: DataSource) => void;
|
|
@@ -37,9 +42,5 @@ export interface ExplorerActions {
|
|
|
37
42
|
updateSortByColumn: (cardId: string, columnId: string, updates: Partial<SortByField>) => void;
|
|
38
43
|
updateFilters: (cardId: string, filters: FilterGroup) => void;
|
|
39
44
|
clearFilters: (cardId: string) => void;
|
|
40
|
-
addJoin: (cardId: string, join: Join) => void;
|
|
41
|
-
removeJoin: (cardId: string, joinId: string) => void;
|
|
42
|
-
updateJoin: (cardId: string, joinId: string, updates: Partial<Join>) => void;
|
|
43
|
-
reorderJoins: (cardId: string, joinIds: string[]) => void;
|
|
44
45
|
}
|
|
45
46
|
export declare const createExplorerActions: (set: (fn: (draft: EditorStore) => void) => void, get: () => EditorStore) => ExplorerActions;
|
|
@@ -1,13 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
* Joinability types: the response of GET /api/v1/domains/[domainId]/joinability,
|
|
3
|
-
* used by field draggability states in the query builder.
|
|
4
|
-
*
|
|
5
|
-
* The domain template contract (datasets, fields, metrics, relationships) has one
|
|
6
|
-
* owner, semaphor-app (`src/lib/semantic/template/contract.ts`); it is not copied
|
|
7
|
-
* here. If a react-semaphor consumer ever needs template types, move the contract
|
|
8
|
-
* into react-semaphor's shared contracts and have the app import it, rather than
|
|
9
|
-
* copy it (domain template 2.1, ledger P2-20).
|
|
10
|
-
*/
|
|
1
|
+
import { JoinReachMap } from '../../shared/dashboard-authoring/card-data-source/join-reach.js';
|
|
11
2
|
/**
|
|
12
3
|
* Joinability map for a semantic domain
|
|
13
4
|
*
|
|
@@ -72,6 +63,11 @@ export interface JoinabilityMap {
|
|
|
72
63
|
export interface JoinabilityMapResponse {
|
|
73
64
|
/** Lightweight joinability map for field state calculation */
|
|
74
65
|
joinabilityMap: JoinabilityMap;
|
|
66
|
+
/**
|
|
67
|
+
* Per dataset, the datasets a card based on it reaches and the keys each
|
|
68
|
+
* step joins on, as the query would join them (one base per card OB-D15).
|
|
69
|
+
*/
|
|
70
|
+
reach: JoinReachMap;
|
|
75
71
|
/** Minimal dataset information */
|
|
76
72
|
datasets: Array<{
|
|
77
73
|
name: string;
|
|
@@ -5,6 +5,7 @@ import { resolveFieldDatasetDependencies, FieldDatasetDependency } from './field
|
|
|
5
5
|
import { getQualifiedEntityName } from './qualified-entity-name.js';
|
|
6
6
|
export interface DatasetIdentityAlias {
|
|
7
7
|
name: string;
|
|
8
|
+
label?: string | null;
|
|
8
9
|
table?: string | null;
|
|
9
10
|
catalog?: string | null;
|
|
10
11
|
schema?: string | null;
|
|
@@ -90,7 +91,12 @@ export interface FieldStateContext {
|
|
|
90
91
|
selectedFields: Field[];
|
|
91
92
|
joinPlan?: JoinPlan;
|
|
92
93
|
autoJoinMetadata?: AutoJoinMetadata;
|
|
93
|
-
|
|
94
|
+
/**
|
|
95
|
+
* The card's base (`cardBaseEntity`), read through the same identity as
|
|
96
|
+
* every other dataset here: a direct table by its qualified name, a domain
|
|
97
|
+
* dataset by its name (ledger P9-02, P9-07).
|
|
98
|
+
*/
|
|
99
|
+
baseEntity?: DatasetAnchorRef;
|
|
94
100
|
datasetAliases?: DatasetIdentityAlias[];
|
|
95
101
|
/**
|
|
96
102
|
* Whether the card reads from a semantic domain. Drives the fallback when
|
|
@@ -140,22 +146,4 @@ export declare function getFieldStateCopy(state: FieldDraggableState | undefined
|
|
|
140
146
|
* dataset
|
|
141
147
|
*/
|
|
142
148
|
export declare function calculateFieldState(field: Field, context: FieldStateContext): FieldStateResult;
|
|
143
|
-
/** One data-source dataset's connection to the visual's base, for the Datasets panel. */
|
|
144
|
-
export interface DataSourceConnection {
|
|
145
|
-
/** Dataset identity (name in semantic mode, qualified table in physical). */
|
|
146
|
-
entityName: string;
|
|
147
|
-
label: string;
|
|
148
|
-
state: FieldDraggableState;
|
|
149
|
-
reason?: string;
|
|
150
|
-
action?: string;
|
|
151
|
-
mentions?: string[];
|
|
152
|
-
}
|
|
153
|
-
/**
|
|
154
|
-
* How each selected dataset connects to the visual's base dataset, using
|
|
155
|
-
* the same identity, base cascade, and per-dataset evaluation as the field
|
|
156
|
-
* list. The Datasets panel shows this at selection time so the customer
|
|
157
|
-
* learns about an unconnected dataset before the first drag. Order and
|
|
158
|
-
* verdicts match `calculateFieldState` for a field of that dataset.
|
|
159
|
-
*/
|
|
160
|
-
export declare function describeDataSourceConnections(context: FieldStateContext): DataSourceConnection[];
|
|
161
149
|
export { resolveFieldDatasetDependencies, type FieldDatasetDependency };
|
|
@@ -127,3 +127,16 @@ export declare function dashboardFieldFromCompiled(input: {
|
|
|
127
127
|
description?: string;
|
|
128
128
|
id: string;
|
|
129
129
|
}): MetricField | GroupByField;
|
|
130
|
+
/** The semantic domain a dashboard calculated field's inputs read, when they name one. */
|
|
131
|
+
export declare function calculatedFieldDomainId(field: Field): string | undefined;
|
|
132
|
+
/**
|
|
133
|
+
* The one domain dataset a calculated field reads, when it reads exactly one:
|
|
134
|
+
* its inputs' dataset and their semantic domain (source identity is domain
|
|
135
|
+
* plus dataset). The MCP outline lists a dashboard calculation by it, and the
|
|
136
|
+
* filter pickers put the field in that dataset's folder (dashboard filter
|
|
137
|
+
* fields, review P6-04). Undefined for a field over several datasets or none.
|
|
138
|
+
*/
|
|
139
|
+
export declare function calculatedFieldSemanticSource(field: Field): {
|
|
140
|
+
domainId: string;
|
|
141
|
+
datasetName: string;
|
|
142
|
+
} | undefined;
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
import { TCard } from '../../../lib/types/common-types.js';
|
|
2
|
+
import { DataSource, DatabaseEntityReference, Field, MetricField } from '../../../lib/types/explorer-types.js';
|
|
3
|
+
import { SemaphorSourceRef } from '../../analytics-protocol/index.js';
|
|
4
|
+
type Entity = DatabaseEntityReference;
|
|
5
|
+
/** The base first, then each other entity once, in the order given. */
|
|
6
|
+
export declare function cardSelectedEntities<E extends {
|
|
7
|
+
name: string;
|
|
8
|
+
}>(base: E, reads: readonly E[], same?: (a: E, b: E) => boolean): E[];
|
|
9
|
+
/**
|
|
10
|
+
* The card's base as it is saved (OB-D11, OB-D17): the selected entity
|
|
11
|
+
* `queryBaseSource` names, else its own join plan's base, else the base the
|
|
12
|
+
* server resolved for its last query, else the first selected.
|
|
13
|
+
*/
|
|
14
|
+
export declare function cardBaseEntity(card: Pick<TCard, 'type' | 'config' | 'dataSource'>, resolvedBaseName?: string): Entity | undefined;
|
|
15
|
+
/**
|
|
16
|
+
* A dataset the base reaches, as a selected entity: the base's connection
|
|
17
|
+
* and domain, the dataset's own name, label and table (the joinability
|
|
18
|
+
* response's `datasets`).
|
|
19
|
+
*/
|
|
20
|
+
export declare function reachedDatasetEntity(base: Entity, dataset: {
|
|
21
|
+
name: string;
|
|
22
|
+
label?: string | null;
|
|
23
|
+
table?: string | null;
|
|
24
|
+
schema?: string | null;
|
|
25
|
+
catalog?: string | null;
|
|
26
|
+
type?: string;
|
|
27
|
+
}): Entity;
|
|
28
|
+
/**
|
|
29
|
+
* The domain dataset a saved selection's name stands for (ledger P0-02,
|
|
30
|
+
* P4-08): the name itself, then by case, by label, then a qualified name's
|
|
31
|
+
* last part. The one reader of a selection's spellings; a name no dataset
|
|
32
|
+
* answers comes back as it is.
|
|
33
|
+
*/
|
|
34
|
+
export declare function resolveDatasetName(name: string, datasets: readonly {
|
|
35
|
+
name: string;
|
|
36
|
+
label?: string | null;
|
|
37
|
+
}[] | undefined): string;
|
|
38
|
+
/** The source reference a base states as `config.queryBaseSource`. */
|
|
39
|
+
export declare function cardBaseSource(base: Entity, dataSource: Pick<DataSource, 'connectionId' | 'connectionType' | 'mode' | 'semanticDomainId'>): SemaphorSourceRef | undefined;
|
|
40
|
+
/** The datasets a field reads, by name (a calculated field's through its inputs). */
|
|
41
|
+
export declare function fieldDatasets(field: Field): string[];
|
|
42
|
+
/**
|
|
43
|
+
* The same source (ledger P7-13): inside a card, datasets and tables go by
|
|
44
|
+
* name, so wherever a source enters the card (a new base, a join's new table)
|
|
45
|
+
* its whole identity is compared here: a dataset's domain and name (never its
|
|
46
|
+
* connection, AGENTS source identity), a table's connection, database, schema
|
|
47
|
+
* and name. A coordinate one side doesn't state doesn't tell them apart.
|
|
48
|
+
*/
|
|
49
|
+
export declare function sameSource(a: Entity | undefined, b: Entity | undefined): boolean;
|
|
50
|
+
/** The same base: the same kind of source and the same identity (`sameSource`). */
|
|
51
|
+
export declare function sameBaseEntity(a: Entity | undefined, b: Entity | undefined): boolean;
|
|
52
|
+
export type CardBaseSwitch = {
|
|
53
|
+
card: TCard;
|
|
54
|
+
/** Placed fields that stayed, as they were placed. */
|
|
55
|
+
kept: Field[];
|
|
56
|
+
/** Placed fields that were removed. */
|
|
57
|
+
removed: Field[];
|
|
58
|
+
/** The card had joins of its own; they were removed with the old base. */
|
|
59
|
+
removedJoins: boolean;
|
|
60
|
+
/** Measures that stayed but lost a table calculation the new base can't run (P9-03). */
|
|
61
|
+
calculations: MetricField[];
|
|
62
|
+
};
|
|
63
|
+
/**
|
|
64
|
+
* The card on `nextBase` (OB-D3): a field of the old base stays when the new
|
|
65
|
+
* base has a column of the same name and kind (it takes that column's
|
|
66
|
+
* identity); a field of another dataset stays when the new base is that
|
|
67
|
+
* dataset or reaches it; everything else is removed, from every place. The
|
|
68
|
+
* card's own joins belong to the old base and are removed. The selection is
|
|
69
|
+
* the new base and the datasets the kept fields read; `queryBaseSource`
|
|
70
|
+
* states the new base.
|
|
71
|
+
*/
|
|
72
|
+
export declare function switchCardBase(input: {
|
|
73
|
+
card: TCard;
|
|
74
|
+
/** The old base. */
|
|
75
|
+
base: Entity;
|
|
76
|
+
nextBase: Entity;
|
|
77
|
+
/** The new data source (mode, connection, domain); its selection is rebuilt here. */
|
|
78
|
+
dataSource: DataSource;
|
|
79
|
+
/** The new base's columns. */
|
|
80
|
+
columns: readonly Field[];
|
|
81
|
+
/** Datasets the new base reaches (its folders). */
|
|
82
|
+
reaches: (dataset: string) => boolean;
|
|
83
|
+
/** The selected entity for a dataset the kept fields read. */
|
|
84
|
+
entityOf: (dataset: string) => Entity | undefined;
|
|
85
|
+
}): CardBaseSwitch;
|
|
86
|
+
/**
|
|
87
|
+
* A semantic card's selection with each dataset a write newly made it read
|
|
88
|
+
* (OB-D17): a field placed from a folder adds its dataset after the base, as
|
|
89
|
+
* the MCP's selection lists each dataset a card reads. Only datasets the
|
|
90
|
+
* card didn't read before the write are added, so a sort or format change
|
|
91
|
+
* adds nothing, and nothing is ever removed (OB-INV-1; ledger P4-09). The
|
|
92
|
+
* entity takes the dataset's table coordinates from the field's own catalog
|
|
93
|
+
* identity. Matrix and direct cards (whose joins write their selection) are
|
|
94
|
+
* left as they are. A card is semantic by its base, a dataset, whether or not
|
|
95
|
+
* its source states a mode (a new visual's states none; ledger P7-01).
|
|
96
|
+
*/
|
|
97
|
+
export declare function withReadDatasetsSelected(card: TCard, previous: TCard | undefined,
|
|
98
|
+
/**
|
|
99
|
+
* The domain's datasets, as the joinability response lists them (name,
|
|
100
|
+
* label, type, table, schema, catalog), when the caller has them: each
|
|
101
|
+
* added dataset is built from its entry by the one builder the base switch
|
|
102
|
+
* uses (`reachedDatasetEntity`), so its type and coordinates are the
|
|
103
|
+
* domain's, never parsed from a field's name (ledger P9-04). Without them,
|
|
104
|
+
* the entity carries the identity the server stamped on the field (domain,
|
|
105
|
+
* dataset, label) and no coordinates: the server fills those from the
|
|
106
|
+
* domain (canonicalize-semantic-card).
|
|
107
|
+
*/
|
|
108
|
+
datasets?: readonly ReachedDatasetInfo[]): TCard;
|
|
109
|
+
/** A domain dataset's entry, as the joinability response lists it. */
|
|
110
|
+
export type ReachedDatasetInfo = {
|
|
111
|
+
name: string;
|
|
112
|
+
label?: string | null;
|
|
113
|
+
table?: string | null;
|
|
114
|
+
schema?: string | null;
|
|
115
|
+
catalog?: string | null;
|
|
116
|
+
type?: string;
|
|
117
|
+
};
|
|
118
|
+
/**
|
|
119
|
+
* A placed field's words on its chip (OB-D5): a field of another dataset than
|
|
120
|
+
* the base names the folder it was picked from first ("Customer › Segment"
|
|
121
|
+
* from the Customer folder; ledger P7-03). Without a folder for its dataset,
|
|
122
|
+
* the dataset's label stands in.
|
|
123
|
+
*/
|
|
124
|
+
export declare function placedFieldLabel(field: Field, label: string, baseName: string | undefined, folderOf?: (dataset: string) => string | undefined): string;
|
|
125
|
+
export {};
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { Join } from '../../../lib/types/explorer-types.js';
|
|
2
|
+
import { FieldFolder, FieldFolderColumn } from '../field-folders/index.js';
|
|
3
|
+
import { JoinReach } from './join-reach.js';
|
|
4
|
+
export type CardFieldFolderRole =
|
|
5
|
+
/** The card's base. */
|
|
6
|
+
'base'
|
|
7
|
+
/** Reached through the domain's relationships (OB-D6). */
|
|
8
|
+
| 'related'
|
|
9
|
+
/** Joined by the card's own join (OB-D7, OB-D9). */
|
|
10
|
+
| 'join'
|
|
11
|
+
/** Reached only through a relationship that doesn't join automatically (OB-D9). */
|
|
12
|
+
| 'needsSetup'
|
|
13
|
+
/** On the card's saved selection, but neither the base nor reached from it (OB-D18): remove only. */
|
|
14
|
+
| 'alsoOnCard';
|
|
15
|
+
export type CardFieldFolder<C extends FieldFolderColumn = FieldFolderColumn> = FieldFolder<C> & {
|
|
16
|
+
role: CardFieldFolderRole;
|
|
17
|
+
/** A join folder's join. */
|
|
18
|
+
joinId?: string;
|
|
19
|
+
};
|
|
20
|
+
/**
|
|
21
|
+
* A card with joins of its own reads only those: the server skips automatic
|
|
22
|
+
* joining whenever a card states its own plan (auto-join-resolver). So a
|
|
23
|
+
* related dataset its plan doesn't reach needs setup (one step from a table
|
|
24
|
+
* on the card) or isn't reachable, in the folders and in field placement
|
|
25
|
+
* alike (ledger P4-10, P9-02).
|
|
26
|
+
*/
|
|
27
|
+
/**
|
|
28
|
+
* The folders a filter on the card reaches: its base, Related and joined
|
|
29
|
+
* datasets. A dataset that needs setup, or one the card names but doesn't
|
|
30
|
+
* reach, would never filter it (dashboard filter fields DF-D8).
|
|
31
|
+
*/
|
|
32
|
+
export declare const CARD_FILTER_FOLDER_ROLES: ReadonlySet<CardFieldFolderRole>;
|
|
33
|
+
export declare function cardReadsOnlyOwnJoins(joins: readonly Join[] | undefined): boolean;
|
|
34
|
+
/** The dataset a join entity stands for: its alias, else its name. */
|
|
35
|
+
export declare const joinEntityName: (entity: {
|
|
36
|
+
alias?: string;
|
|
37
|
+
name?: string;
|
|
38
|
+
} | undefined) => string;
|
|
39
|
+
export declare function cardFieldFolders<C extends FieldFolderColumn>(input: {
|
|
40
|
+
base: string;
|
|
41
|
+
/** Semantic: what the base reaches (the joinability response's `reach[base]`). */
|
|
42
|
+
reach?: readonly JoinReach[];
|
|
43
|
+
/** The card's authored joins (a direct card's, or a saved semantic card's own). */
|
|
44
|
+
joins?: readonly Join[];
|
|
45
|
+
/** The datasets the card's saved selection names, already resolved to dataset names. */
|
|
46
|
+
selected?: readonly string[];
|
|
47
|
+
columnsOf: (dataset: string) => readonly C[];
|
|
48
|
+
labelOf: (dataset: string) => string;
|
|
49
|
+
/**
|
|
50
|
+
* Name a semantic folder after its key ("Customer ID" → "Customer") when
|
|
51
|
+
* the key refers to that dataset's rows (`towardKey`). Off for tables,
|
|
52
|
+
* whose folders keep the table's name.
|
|
53
|
+
*/
|
|
54
|
+
keyLabels?: boolean;
|
|
55
|
+
}): CardFieldFolder<C>[];
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
import { TCard } from '../../../lib/types/common-types.js';
|
|
2
|
+
import { DatabaseEntityReference, Field, Join, JoinPlan, MetricField } from '../../../lib/types/explorer-types.js';
|
|
3
|
+
type Entity = DatabaseEntityReference;
|
|
4
|
+
/** One condition: a column of the table joined from, an operator, a column of the joined table. */
|
|
5
|
+
export type JoinConditionDraft = {
|
|
6
|
+
from: string;
|
|
7
|
+
operator: string;
|
|
8
|
+
to: string;
|
|
9
|
+
};
|
|
10
|
+
/** Conditions that hold together (AND) or any of which holds (OR); sets combine with AND. */
|
|
11
|
+
export type JoinSetDraft = {
|
|
12
|
+
operator: 'AND' | 'OR';
|
|
13
|
+
conditions: JoinConditionDraft[];
|
|
14
|
+
};
|
|
15
|
+
export type JoinMatches = NonNullable<Join['relationshipCardinality']>;
|
|
16
|
+
export type CardJoinDraft = {
|
|
17
|
+
/** The table joined from: the base or a table already joined. */
|
|
18
|
+
from: Entity;
|
|
19
|
+
/** The table joined. */
|
|
20
|
+
to: Entity;
|
|
21
|
+
joinType: Join['joinType'];
|
|
22
|
+
sets: JoinSetDraft[];
|
|
23
|
+
/** Not set until the author states it (OB-D10). */
|
|
24
|
+
matches?: JoinMatches;
|
|
25
|
+
};
|
|
26
|
+
/** A table as the join dialog's selects name it (connection, type, name, database, schema); a dataset whole. */
|
|
27
|
+
export declare function joinTableReference(entity: Entity): Entity;
|
|
28
|
+
/** The join a draft states. */
|
|
29
|
+
export declare function joinFromDraft(draft: CardJoinDraft, at: {
|
|
30
|
+
id: string;
|
|
31
|
+
sequence: number;
|
|
32
|
+
createId: () => string;
|
|
33
|
+
}): Join;
|
|
34
|
+
/** The draft a saved join reads as, for editing. */
|
|
35
|
+
export declare function draftFromJoin(join: Join, entityOf: (name: string) => Entity | undefined): CardJoinDraft;
|
|
36
|
+
/** A join's match count from the table it joins from, a reverse stamp read flipped (ledger P5-06). */
|
|
37
|
+
export declare function joinMatches(join: Pick<Join, 'relationshipCardinality' | 'relationshipTraversalDirection'>): JoinMatches | undefined;
|
|
38
|
+
/**
|
|
39
|
+
* A join today's dialog refuses (ledger P2-10): the base itself, or a table
|
|
40
|
+
* already on the card's joins (one alias per table). The one rule the dialog
|
|
41
|
+
* and any later caller read.
|
|
42
|
+
*/
|
|
43
|
+
export declare function joinTargetRefusal(card: TCard, base: Entity, to: Entity, replacingJoinId?: string): string | undefined;
|
|
44
|
+
/** The card with the draft joined (OB-D8): after its last join; the joined table added to the selection. */
|
|
45
|
+
export declare function addCardJoin(input: {
|
|
46
|
+
card: TCard;
|
|
47
|
+
base: Entity;
|
|
48
|
+
draft: CardJoinDraft;
|
|
49
|
+
catalog: readonly Field[];
|
|
50
|
+
createId: () => string;
|
|
51
|
+
/**
|
|
52
|
+
* The joins a semantic card's query makes today, when it has none of its
|
|
53
|
+
* own: its first join of its own keeps them, so what the card already
|
|
54
|
+
* joins keeps joining (ledger P5-07).
|
|
55
|
+
*/
|
|
56
|
+
resolvedPlan?: JoinPlan;
|
|
57
|
+
}): TCard;
|
|
58
|
+
export type CardJoinRemoval = {
|
|
59
|
+
card: TCard;
|
|
60
|
+
/** The joins removed: the join and every join from the tables it brought. */
|
|
61
|
+
joins: Join[];
|
|
62
|
+
/** Placed fields removed because they read a removed table. */
|
|
63
|
+
removed: Field[];
|
|
64
|
+
/** Measures that stayed but lost a table calculation the card can no longer run (P9-03). */
|
|
65
|
+
calculations?: MetricField[];
|
|
66
|
+
};
|
|
67
|
+
/**
|
|
68
|
+
* The card without the join and every join from the tables it brought, and
|
|
69
|
+
* without the fields that read those tables (OB-D7, OB-T-9). The tables leave
|
|
70
|
+
* the selection; no join left means no join plan. A Matrix card's plan is its
|
|
71
|
+
* definition's (`withAuthoredCardJoinPlan`); its measures aren't on the field
|
|
72
|
+
* walk, so they stay for the definition's own check, as the old join manager
|
|
73
|
+
* left them (ledger P5-02).
|
|
74
|
+
*/
|
|
75
|
+
export declare function removeCardJoin(card: TCard, joinId: string): CardJoinRemoval;
|
|
76
|
+
/**
|
|
77
|
+
* Start over (ledger P7-12): the card back to its base alone. Every join goes
|
|
78
|
+
* as Remove join removes it (the fields that read a joined table with it,
|
|
79
|
+
* filters included), then the shelves are emptied as Clear fields empties
|
|
80
|
+
* them. The base, and filters on the base, stay. Not for Matrix, whose
|
|
81
|
+
* fields live in its definition.
|
|
82
|
+
*/
|
|
83
|
+
export declare function startCardOver(card: TCard): {
|
|
84
|
+
card: TCard;
|
|
85
|
+
joins: Join[];
|
|
86
|
+
fields: number;
|
|
87
|
+
};
|
|
88
|
+
/**
|
|
89
|
+
* The card with a join changed. The same joined table keeps its place, its
|
|
90
|
+
* joins and the fields that read it; another table is a new join, so the old
|
|
91
|
+
* one is removed as Remove join removes it.
|
|
92
|
+
*/
|
|
93
|
+
export declare function updateCardJoin(input: {
|
|
94
|
+
card: TCard;
|
|
95
|
+
base: Entity;
|
|
96
|
+
joinId: string;
|
|
97
|
+
draft: CardJoinDraft;
|
|
98
|
+
catalog: readonly Field[];
|
|
99
|
+
createId: () => string;
|
|
100
|
+
}): CardJoinRemoval;
|
|
101
|
+
/**
|
|
102
|
+
* The condition a new join starts from (the author can change it): the
|
|
103
|
+
* joined-from table's `<to>_id` to the joined table's `id`, or the other way
|
|
104
|
+
* round, else a column both tables have (a key-like `_id` one first), else
|
|
105
|
+
* their first columns.
|
|
106
|
+
*/
|
|
107
|
+
export declare function suggestJoinCondition(from: {
|
|
108
|
+
name: string;
|
|
109
|
+
columns: readonly string[];
|
|
110
|
+
}, to: {
|
|
111
|
+
name: string;
|
|
112
|
+
columns: readonly string[];
|
|
113
|
+
}): JoinConditionDraft | undefined;
|
|
114
|
+
export {};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { TCard } from '../../../lib/types/common-types.js';
|
|
2
|
+
import { Field, MetricField } from '../../../lib/types/explorer-types.js';
|
|
3
|
+
export type PrunedCard = {
|
|
4
|
+
card: TCard;
|
|
5
|
+
/** Fields removed, as placed: the writer's decisions and the measures whose own condition went. */
|
|
6
|
+
removed: Field[];
|
|
7
|
+
/** Measures that kept their place but lost their table calculation. */
|
|
8
|
+
calculations: MetricField[];
|
|
9
|
+
};
|
|
10
|
+
export declare function pruneCardFields(card: TCard, decide: (field: Field) => Field | null): PrunedCard;
|
|
11
|
+
/** The words a toast adds for table calculations removed with the fields. */
|
|
12
|
+
export declare function calculationsRemovedWords(calculations: readonly MetricField[]): string;
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { TDataColumn } from '../../../lib/types/common-types.js';
|
|
2
|
+
import { Field } from '../../../lib/types/explorer-types.js';
|
|
3
|
+
import { FilterFieldFolder } from './filter-field-folders.js';
|
|
4
|
+
/** A dashboard or Document filter, or a card's pinned filter. */
|
|
5
|
+
export type FilterFieldPurpose = 'dashboard' | 'pinned';
|
|
6
|
+
/** One source's `/v1/columns` answer. */
|
|
7
|
+
export type FilterFieldColumnsResponse = {
|
|
8
|
+
columns?: TDataColumn[];
|
|
9
|
+
calculatedFields?: Field[];
|
|
10
|
+
} | undefined;
|
|
11
|
+
export type FilterFieldCatalog = {
|
|
12
|
+
/** Each folder's fields, by folder key. */
|
|
13
|
+
byKey: Map<string, Field[]>;
|
|
14
|
+
/** Calculated fields over several datasets, each with the folder whose source a filter on it stores (its domain's, the first it reads). */
|
|
15
|
+
several: Array<{
|
|
16
|
+
field: Field;
|
|
17
|
+
folderKey?: string;
|
|
18
|
+
}>;
|
|
19
|
+
};
|
|
20
|
+
/**
|
|
21
|
+
* A calculated field the picker may offer once the server says it reaches a
|
|
22
|
+
* card (DF-D11): its key in the per-card read, the folder it sits in (the one
|
|
23
|
+
* domain dataset it reads, when that dataset has a folder) and the folder
|
|
24
|
+
* whose source a filter on it stores.
|
|
25
|
+
*/
|
|
26
|
+
export type FilterFieldCalculatedCandidate = {
|
|
27
|
+
key: string;
|
|
28
|
+
field: Field;
|
|
29
|
+
folderKey?: string;
|
|
30
|
+
homeKey?: string;
|
|
31
|
+
};
|
|
32
|
+
type CatalogInput = {
|
|
33
|
+
folders: readonly FilterFieldFolder[];
|
|
34
|
+
/** Each folder's columns response, by folder key. */
|
|
35
|
+
responses: ReadonlyMap<string, FilterFieldColumnsResponse>;
|
|
36
|
+
/** The dashboard's calculated fields. */
|
|
37
|
+
dashboardCalculated?: readonly Field[];
|
|
38
|
+
/** A pinned filter's card: its own calculated fields, on its domain. */
|
|
39
|
+
cardCalculated?: {
|
|
40
|
+
fields: readonly Field[];
|
|
41
|
+
domainId?: string;
|
|
42
|
+
};
|
|
43
|
+
purpose: FilterFieldPurpose;
|
|
44
|
+
};
|
|
45
|
+
/**
|
|
46
|
+
* The calculated fields a picker could offer, each placed by source identity
|
|
47
|
+
* (domain plus dataset): a domain's calculations once per domain by the field
|
|
48
|
+
* list's namespace rule, the dashboard's by their inputs, a pinned card's own
|
|
49
|
+
* on its domain. Whether each is offered is the server's decision (DF-D11).
|
|
50
|
+
*/
|
|
51
|
+
export declare function filterFieldCalculatedCandidates(input: CatalogInput): FilterFieldCalculatedCandidate[];
|
|
52
|
+
export declare function filterFieldCatalog(input: CatalogInput & {
|
|
53
|
+
/**
|
|
54
|
+
* The cards each candidate reaches, by key, from the per-card read
|
|
55
|
+
* (DF-D11). A calculated field is offered only when it reaches one of
|
|
56
|
+
* the picker's cards; before the read answers, none is.
|
|
57
|
+
*/
|
|
58
|
+
calculatedReach?: ReadonlyMap<string, readonly string[]>;
|
|
59
|
+
}): FilterFieldCatalog;
|
|
60
|
+
export {};
|