@holistics/anfra-sdk 0.21.0 → 0.22.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/api.d.ts +1 -1
- package/dist/app.d.ts +5 -5
- package/dist/app.js +3 -3
- package/dist/{bootstrap-BxBqFhgm.d.ts → bootstrap-fGoj2ap1.d.ts} +49 -4
- package/dist/build.d.ts +2 -2
- package/dist/{chunk-7NZOMBYE.js → chunk-7GQZU5FL.js} +1 -1
- package/dist/{chunk-ACKFOANJ.js → chunk-DWQUIHUX.js} +4 -1
- package/dist/{chunk-E3Q3FRKQ.js → chunk-EOFPMSND.js} +1 -1
- package/dist/{chunk-IHRNKDMO.js → chunk-YPGMBSOZ.js} +381 -11
- package/dist/common.d.ts +3 -3
- package/dist/common.js +1 -1
- package/dist/{errors-DR05L6-y.d.ts → errors-kH5eHvNO.d.ts} +1 -1
- package/dist/host.d.ts +2 -2
- package/dist/host.js +3 -3
- package/dist/{overview-KOQJNG2Y.js → overview-CD6NY3VQ.js} +2 -2
- package/dist/{plugin-BIcighnC.d.ts → plugin-DG2NDTCT.d.ts} +2 -2
- package/dist/plugins.d.ts +1 -1
- package/dist/plugins.js +3 -3
- package/dist/testing.d.ts +1 -1
- package/dist/testing.js +2 -2
- package/dist/{menu-CuTKq-dC.d.ts → theme-FQ_1b569.d.ts} +71 -55
- package/dist/{types-C_-1rgj2.d.ts → types-BE767W6G.d.ts} +94 -2
- package/package.json +1 -1
|
@@ -1,4 +1,72 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ap as Row, au as SelectionCondition, az as StructureNode, a as Annotation, ah as QueryStamp, D as DatasetDescriptor, aB as User } from './types-BE767W6G.js';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* What a menu on a Data App's content is about: a marked node of the page (a right-click on a
|
|
5
|
+
* block), or some of a query's result rows (a right-click on a chart's point, which the definition
|
|
6
|
+
* reports with `query.menu`). Built in the frame, and checked by the host, which trusts nothing the
|
|
7
|
+
* frame sends.
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
/** A box in the frame's viewport. */
|
|
11
|
+
interface TargetRect {
|
|
12
|
+
x: number;
|
|
13
|
+
y: number;
|
|
14
|
+
width: number;
|
|
15
|
+
height: number;
|
|
16
|
+
}
|
|
17
|
+
/** A point in the frame's viewport. */
|
|
18
|
+
interface TargetPoint {
|
|
19
|
+
x: number;
|
|
20
|
+
y: number;
|
|
21
|
+
}
|
|
22
|
+
/** A marked node, as the structure has it, its ancestors outermost first (both without children's children), and where it is. */
|
|
23
|
+
interface NodeTarget {
|
|
24
|
+
kind: 'node';
|
|
25
|
+
node: StructureNode;
|
|
26
|
+
ancestors: StructureNode[];
|
|
27
|
+
rect: TargetRect;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Rows of a query's result: the query, by its app's index and name; the rows as the definition
|
|
31
|
+
* passed them; the dimensions that took part; the measure the point belongs to, when the
|
|
32
|
+
* definition said; and the conditions they make, derived as a cross-filter's are (an AQL
|
|
33
|
+
* `expression` when per-field conditions would admit more rows). With the node the rows are drawn
|
|
34
|
+
* in, when the event was inside one.
|
|
35
|
+
*/
|
|
36
|
+
interface RowsTarget {
|
|
37
|
+
kind: 'rows';
|
|
38
|
+
app: number;
|
|
39
|
+
query: string;
|
|
40
|
+
rows: Row[];
|
|
41
|
+
fields: string[];
|
|
42
|
+
/** The result column of the measure the point shows: a chart's series. */
|
|
43
|
+
measure?: string;
|
|
44
|
+
conditions: SelectionCondition[];
|
|
45
|
+
expression?: string;
|
|
46
|
+
node?: NodeTarget;
|
|
47
|
+
/**
|
|
48
|
+
* Where the gesture that opened it was, a point in the frame's viewport: the right-click's for
|
|
49
|
+
* `query.menu`, the badge's when an item runs from the annotations badge's popover. A plugin
|
|
50
|
+
* anchors a popover about the rows there.
|
|
51
|
+
*/
|
|
52
|
+
at?: TargetPoint;
|
|
53
|
+
/**
|
|
54
|
+
* The annotations plugins set on these rows, for the frame's items only (a plugin's `when` on
|
|
55
|
+
* them, say): the host never gets them.
|
|
56
|
+
*/
|
|
57
|
+
annotations?: Annotation[];
|
|
58
|
+
}
|
|
59
|
+
type MenuTarget = NodeTarget | RowsTarget;
|
|
60
|
+
type MenuTargetKind = MenuTarget['kind'];
|
|
61
|
+
/** One entry of a menu, as the host answers it for a target. */
|
|
62
|
+
interface MenuEntry {
|
|
63
|
+
id: string;
|
|
64
|
+
label: string;
|
|
65
|
+
/** Why it can't run: shown, and the entry can't be picked. */
|
|
66
|
+
disabled?: string;
|
|
67
|
+
}
|
|
68
|
+
/** A target as the frame sends it, or undefined when it isn't one: of its shape only, never trusted further. */
|
|
69
|
+
declare function checkTarget(value: unknown): MenuTarget | undefined;
|
|
2
70
|
|
|
3
71
|
/**
|
|
4
72
|
* The bridge: the postMessage protocol between a Data App's frame (`app`'s bootstrap) and the
|
|
@@ -130,57 +198,5 @@ declare function designTheme(scheme: ThemeScheme, style: Pick<CSSStyleDeclaratio
|
|
|
130
198
|
*/
|
|
131
199
|
declare function resolveTheme(input: unknown): Theme;
|
|
132
200
|
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
* block), or some of a query's result rows (a right-click on a chart's point, which the definition
|
|
136
|
-
* reports with `query.menu`). Built in the frame, and checked by the host, which trusts nothing the
|
|
137
|
-
* frame sends.
|
|
138
|
-
*/
|
|
139
|
-
|
|
140
|
-
/** A box in the frame's viewport. */
|
|
141
|
-
interface TargetRect {
|
|
142
|
-
x: number;
|
|
143
|
-
y: number;
|
|
144
|
-
width: number;
|
|
145
|
-
height: number;
|
|
146
|
-
}
|
|
147
|
-
/** A marked node, as the structure has it, its ancestors outermost first (both without children's children), and where it is. */
|
|
148
|
-
interface NodeTarget {
|
|
149
|
-
kind: 'node';
|
|
150
|
-
node: StructureNode;
|
|
151
|
-
ancestors: StructureNode[];
|
|
152
|
-
rect: TargetRect;
|
|
153
|
-
}
|
|
154
|
-
/**
|
|
155
|
-
* Rows of a query's result: the query, by its app's index and name; the rows as the definition
|
|
156
|
-
* passed them; the dimensions that took part; the measure the point belongs to, when the
|
|
157
|
-
* definition said; and the conditions they make, derived as a cross-filter's are (an AQL
|
|
158
|
-
* `expression` when per-field conditions would admit more rows). With the node the rows are drawn
|
|
159
|
-
* in, when the event was inside one.
|
|
160
|
-
*/
|
|
161
|
-
interface RowsTarget {
|
|
162
|
-
kind: 'rows';
|
|
163
|
-
app: number;
|
|
164
|
-
query: string;
|
|
165
|
-
rows: Row[];
|
|
166
|
-
fields: string[];
|
|
167
|
-
/** The result column of the measure the point shows: a chart's series. */
|
|
168
|
-
measure?: string;
|
|
169
|
-
conditions: SelectionCondition[];
|
|
170
|
-
expression?: string;
|
|
171
|
-
node?: NodeTarget;
|
|
172
|
-
}
|
|
173
|
-
type MenuTarget = NodeTarget | RowsTarget;
|
|
174
|
-
type MenuTargetKind = MenuTarget['kind'];
|
|
175
|
-
/** One entry of a menu, as the host answers it for a target. */
|
|
176
|
-
interface MenuEntry {
|
|
177
|
-
id: string;
|
|
178
|
-
label: string;
|
|
179
|
-
/** Why it can't run: shown, and the entry can't be picked. */
|
|
180
|
-
disabled?: string;
|
|
181
|
-
}
|
|
182
|
-
/** A target as the frame sends it, or undefined when it isn't one: of its shape only, never trusted further. */
|
|
183
|
-
declare function checkTarget(value: unknown): MenuTarget | undefined;
|
|
184
|
-
|
|
185
|
-
export { DEFAULT_TOKENS as D, PROVISION_ELEMENT_ID as P, THEME_TOKENS as T, DESIGN_TOKENS as b, checkTarget as m, designTheme as n, resolveTheme as r };
|
|
186
|
-
export type { BridgeError as B, FrameMessage as F, HostMessage as H, MenuEntry as M, NodeTarget as N, RowsTarget as R, BridgeMessage as a, MenuTarget as c, MenuTargetKind as d, PluginInfo as e, Provision as f, TargetRect as g, Theme as h, ThemeInput as i, ThemeScheme as j, ThemeToken as k, ThemeTokens as l };
|
|
201
|
+
export { DEFAULT_TOKENS as D, PROVISION_ELEMENT_ID as P, THEME_TOKENS as T, DESIGN_TOKENS as b, checkTarget as n, designTheme as o, resolveTheme as r };
|
|
202
|
+
export type { BridgeError as B, FrameMessage as F, HostMessage as H, MenuEntry as M, NodeTarget as N, RowsTarget as R, BridgeMessage as a, MenuTarget as c, MenuTargetKind as d, PluginInfo as e, Provision as f, TargetPoint as g, TargetRect as h, Theme as i, ThemeInput as j, ThemeScheme as k, ThemeToken as l, ThemeTokens as m };
|
|
@@ -2651,6 +2651,98 @@ interface QueryPivot {
|
|
|
2651
2651
|
rows: number;
|
|
2652
2652
|
columns: number;
|
|
2653
2653
|
}
|
|
2654
|
+
/** How much an annotation matters: the theme's colour for it, and the badge's dot. */
|
|
2655
|
+
type AnnotationSeverity = 'info' | 'warning' | 'critical';
|
|
2656
|
+
/** The kinds the SDK defines; a plugin can't add one. */
|
|
2657
|
+
type AnnotationKind = 'mark' | 'focus' | 'line' | 'band' | 'series';
|
|
2658
|
+
/**
|
|
2659
|
+
* Rows of the query's result, each named by its dimension values (`{ month: '2026-03-01' }`), as
|
|
2660
|
+
* `query.selectedRows` matches them; `measure`, the measure column meant when a chart draws several.
|
|
2661
|
+
*/
|
|
2662
|
+
interface RowsAnchor {
|
|
2663
|
+
rows: readonly Row[];
|
|
2664
|
+
measure?: string;
|
|
2665
|
+
}
|
|
2666
|
+
/** A value on one column, a dimension's or a measure's, whether or not a row has it. */
|
|
2667
|
+
interface ValueAnchor {
|
|
2668
|
+
column: string;
|
|
2669
|
+
value: string;
|
|
2670
|
+
}
|
|
2671
|
+
/** A range on one column, from one value to another. */
|
|
2672
|
+
interface RangeAnchor {
|
|
2673
|
+
column: string;
|
|
2674
|
+
from: string;
|
|
2675
|
+
to: string;
|
|
2676
|
+
}
|
|
2677
|
+
/**
|
|
2678
|
+
* One point of a series, at dimension values the result may lack (a future month): a `value`, or
|
|
2679
|
+
* both bounds (`lower`, `upper`), or both.
|
|
2680
|
+
*/
|
|
2681
|
+
interface SeriesPoint {
|
|
2682
|
+
at: Row;
|
|
2683
|
+
value?: string;
|
|
2684
|
+
lower?: string;
|
|
2685
|
+
upper?: string;
|
|
2686
|
+
}
|
|
2687
|
+
/** New points through one measure, shaped like the query's rows. */
|
|
2688
|
+
interface SeriesAnchor {
|
|
2689
|
+
measure: string;
|
|
2690
|
+
points: readonly SeriesPoint[];
|
|
2691
|
+
}
|
|
2692
|
+
interface AnnotationText {
|
|
2693
|
+
/** The plugin's own name for it, unique in its set: its `key` is made from it. */
|
|
2694
|
+
id?: string;
|
|
2695
|
+
/** Short, for a chart's label. */
|
|
2696
|
+
label?: string;
|
|
2697
|
+
/** Longer, for a tooltip or a list. */
|
|
2698
|
+
detail?: string;
|
|
2699
|
+
severity?: AnnotationSeverity;
|
|
2700
|
+
}
|
|
2701
|
+
/**
|
|
2702
|
+
* Something a plugin says about a query's data, as its frame half sets it with `kernel.annotate`:
|
|
2703
|
+
* a kind, an anchor in the query's own column aliases, and optionally a label, a detail and a
|
|
2704
|
+
* severity. Values are strings, as rows carry them. See docs/designs/sdk-plugins.md.
|
|
2705
|
+
*/
|
|
2706
|
+
type AnnotationInput = AnnotationText & ({
|
|
2707
|
+
kind: 'mark' | 'focus';
|
|
2708
|
+
anchor: RowsAnchor;
|
|
2709
|
+
} | {
|
|
2710
|
+
kind: 'line';
|
|
2711
|
+
anchor: ValueAnchor;
|
|
2712
|
+
} | {
|
|
2713
|
+
kind: 'band';
|
|
2714
|
+
anchor: RangeAnchor;
|
|
2715
|
+
} | {
|
|
2716
|
+
kind: 'series';
|
|
2717
|
+
anchor: SeriesAnchor;
|
|
2718
|
+
});
|
|
2719
|
+
/** A rows anchor as `query.annotations` has it: with `index`, the rows' positions in `query.result.rows`. */
|
|
2720
|
+
interface ResolvedRowsAnchor extends RowsAnchor {
|
|
2721
|
+
index: number[];
|
|
2722
|
+
}
|
|
2723
|
+
interface AnnotationMeta {
|
|
2724
|
+
/** The plugin that set it. */
|
|
2725
|
+
plugin: string;
|
|
2726
|
+
/** Stable across reads: the plugin and its `id`, or its position in the plugin's set. */
|
|
2727
|
+
key: string;
|
|
2728
|
+
}
|
|
2729
|
+
/**
|
|
2730
|
+
* An annotation as the definition reads it, from `query.annotations`: what a plugin set, with its
|
|
2731
|
+
* plugin, its key, and a rows anchor's positions in the current result.
|
|
2732
|
+
*/
|
|
2733
|
+
type Annotation = AnnotationText & AnnotationMeta & ({
|
|
2734
|
+
kind: 'mark' | 'focus';
|
|
2735
|
+
anchor: ResolvedRowsAnchor;
|
|
2736
|
+
} | {
|
|
2737
|
+
kind: 'line';
|
|
2738
|
+
anchor: ValueAnchor;
|
|
2739
|
+
} | {
|
|
2740
|
+
kind: 'band';
|
|
2741
|
+
anchor: RangeAnchor;
|
|
2742
|
+
} | {
|
|
2743
|
+
kind: 'series';
|
|
2744
|
+
anchor: SeriesAnchor;
|
|
2745
|
+
});
|
|
2654
2746
|
type QueryState = 'idle' | 'executing' | 'success' | 'error';
|
|
2655
2747
|
interface ExecuteSummary {
|
|
2656
2748
|
succeeded: string[];
|
|
@@ -3101,5 +3193,5 @@ interface Backend {
|
|
|
3101
3193
|
lineage?(request: BackendLineageRequest, signal: AbortSignal): Promise<LineageResult>;
|
|
3102
3194
|
}
|
|
3103
3195
|
|
|
3104
|
-
export { FILTER_AGGREGATIONS as
|
|
3105
|
-
export type {
|
|
3196
|
+
export { FILTER_AGGREGATIONS as K };
|
|
3197
|
+
export type { LineageTarget as $, Aggregation as A, Backend as B, CallStamp as C, DatasetDescriptor as D, EntityKind as E, ExecuteSummary as F, ExportFormat as G, ExportFormatOptions as H, ExportOptions as I, ExportResult as J, FieldLineage as L, FieldSuggestionsRequest as M, FilterAggregation as N, FilterDeclaration as O, FilterValueType as P, InspectedApp as Q, InspectedControl as R, InspectedError as S, InspectedQuery as T, InspectedSelection as U, InspectedStructure as V, LineageCard as W, LineageDiagram as X, LineageNode as Y, LineageOptions as Z, LineageResult as _, Annotation as a, Listener as a0, LocateKind as a1, LocateTarget as a2, MappingJson as a3, Operator as a4, QueryCacheResult as a5, QueryCacheSettings as a6, QueryDebug as a7, QueryDeclaration as a8, QueryInput as a9, Unsubscribe as aA, User as aB, ValueAnchor as aC, WeekStartDay as aD, components as aE, paths as aF, QueryInputDefaults as aa, QueryPagination as ab, QueryPivot as ac, QueryRequest as ad, QueryResult as ae, QuerySeeds as af, QuerySort as ag, QueryStamp as ah, QueryState as ai, QueryTimings as aj, RangeAnchor as ak, RenderFormat as al, RenderRequest as am, Rendering as an, ResolvedRowsAnchor as ao, Row as ap, RowsAnchor as aq, SdkEnvironment as ar, SdkFeatures as as, Selection as at, SelectionCondition as au, SemanticType as av, SeriesAnchor as aw, SeriesPoint as ax, StructureKind as ay, StructureNode as az, AnnotationInput as b, AnnotationKind as c, AnnotationSeverity as d, AppDeclaration as e, AppJson as f, ArrowType as g, BackendCondition as h, BackendDateDrill as i, BackendExportRequest as j, BackendFilter as k, BackendLineageRequest as l, BackendQueryRequest as m, BackendQueryResult as n, BackendSort as o, ColumnMeta as p, Condition as q, ConditionValue as r, ControlMappingJson as s, CrossFilterJson as t, DateDrillDeclaration as u, DateGrain as v, DateTransformation as w, EntityRef as x, EntityUsage as y, ExecuteOptions as z };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@holistics/anfra-sdk",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.22.0",
|
|
4
4
|
"description": "Data Apps on anfra: the authoring layer (app), what hosts one (host), anfra's plugins (plugins), the core API client (api), and their shared contract (common)",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"repository": {
|