@altertable/data-app 0.76.0 → 0.78.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/CONTRIBUTING.md +3 -0
- package/REFERENCE.md +392 -276
- package/dist/chunks/contract-gu1rDsV0.js +1588 -0
- package/dist/chunks/contract-gu1rDsV0.js.map +1 -0
- package/dist/chunks/data-client-BMdL73Ab.js +122 -0
- package/dist/chunks/data-client-BMdL73Ab.js.map +1 -0
- package/dist/chunks/{date-time-range-value-TE8KCsfV.js → date-time-range-value-D-XfqVTT.js} +28 -31
- package/dist/chunks/date-time-range-value-D-XfqVTT.js.map +1 -0
- package/dist/chunks/{diagnostics-DhCqGklq.js → diagnostics-CX9SsU79.js} +240 -63
- package/dist/chunks/diagnostics-CX9SsU79.js.map +1 -0
- package/dist/chunks/record-Cr4Uk1K3.js +9 -0
- package/dist/chunks/record-Cr4Uk1K3.js.map +1 -0
- package/dist/client/index.js +4 -86
- package/dist/client/index.js.map +1 -1
- package/dist/core/appearance.js +3 -5
- package/dist/core/appearance.js.map +1 -1
- package/dist/core/config.js +11 -3
- package/dist/core/config.js.map +1 -1
- package/dist/core/contract.js +3 -4
- package/dist/core/format.js +1 -1
- package/dist/internal.js +58 -124
- package/dist/internal.js.map +1 -1
- package/dist/types/chunks/contract.d.ts +592 -308
- package/dist/types/chunks/data-client.d.ts +46 -0
- package/dist/types/chunks/date-time-range-value.d.ts +28 -2
- package/dist/types/chunks/index.d.ts +65 -53
- package/dist/types/client/index.d.ts +4 -3
- package/dist/types/core/config.d.ts +16 -6
- package/dist/types/core/contract.d.ts +3 -5
- package/dist/types/core/format.d.ts +1 -2
- package/dist/types/index.d.ts +4 -4
- package/dist/types/internal.d.ts +26 -7
- package/docs/app-authoring.md +23 -14
- package/docs/client.md +14 -48
- package/docs/contract.md +58 -56
- package/docs/data-context.md +13 -6
- package/docs/diagnostics.md +16 -23
- package/docs/embed.md +60 -25
- package/docs/filters.md +271 -0
- package/docs/hosted-apps.md +11 -10
- package/docs/layout.md +45 -18
- package/docs/local-data-apps.md +5 -6
- package/docs/react-embed.md +44 -2
- package/docs/react.md +1 -2
- package/docs/server-bun.md +8 -5
- package/docs/stories-and-export.md +23 -14
- package/docs/styling.md +2 -1
- package/docs/ui.md +18 -8
- package/docs/views.md +63 -26
- package/docs/widgets.md +40 -16
- package/docs/worker.md +1 -1
- package/package.json +1 -5
- package/dist/chunks/contract-DsyRYgN_.js +0 -626
- package/dist/chunks/contract-DsyRYgN_.js.map +0 -1
- package/dist/chunks/contract-kNFYPHRK.js +0 -713
- package/dist/chunks/contract-kNFYPHRK.js.map +0 -1
- package/dist/chunks/date-time-range-value-TE8KCsfV.js.map +0 -1
- package/dist/chunks/diagnostics-DhCqGklq.js.map +0 -1
- package/dist/chunks/operation-7tiT4cpJ.js +0 -134
- package/dist/chunks/operation-7tiT4cpJ.js.map +0 -1
- package/dist/chunks/request-body-H1qPmmTN.js +0 -50
- package/dist/chunks/request-body-H1qPmmTN.js.map +0 -1
- package/dist/server/index.js +0 -90
- package/dist/server/index.js.map +0 -1
- package/dist/types/chunks/contract2.d.ts +0 -207
- package/dist/types/chunks/date-time-range.d.ts +0 -29
- package/dist/types/server/index.d.ts +0 -17
- package/docs/server.md +0 -41
- package/docs/variables.md +0 -280
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { Bt as Lakehouse, Ft as DataQueryBody, Jt as IsUnion, Pt as DataOperations, Ut as OutputOf, Yt as KnownRecord, at as FilterCollection, dn as DimensionOption, xn as FacetFilter, zt as InputOf } from "./contract.js";
|
|
2
|
+
//#region src/client/data-client.d.ts
|
|
3
|
+
/**
|
|
4
|
+
* Parsed operation data and query evidence.
|
|
5
|
+
*/
|
|
6
|
+
type DataResponse<Output, Input = unknown> = DataQueryBody<Output> & {
|
|
7
|
+
/** The exact browser input that produced this response. */
|
|
8
|
+
input: Input;
|
|
9
|
+
};
|
|
10
|
+
/** The filters each operation reads, for operations that read any. */
|
|
11
|
+
type OperationFilters<Operations extends DataOperations> = { readonly [Name in keyof Operations as Operations[Name] extends {
|
|
12
|
+
filters: infer Filters extends FilterCollection;
|
|
13
|
+
} ? keyof Filters extends never ? never : Name : never]: Operations[Name] extends {
|
|
14
|
+
filters: infer Filters;
|
|
15
|
+
} ? Filters : never; };
|
|
16
|
+
declare const clientContract: unique symbol;
|
|
17
|
+
type DataClient<Operations extends DataOperations> = {
|
|
18
|
+
/** Preserve the operation registry when passing clients through helpers. */
|
|
19
|
+
readonly [clientContract]: (operations: Operations) => Operations;
|
|
20
|
+
/** Each operation's filters; views derive their inputs and controls from them. */
|
|
21
|
+
readonly filters: Readonly<Record<string, FilterCollection>>;
|
|
22
|
+
query<Name extends keyof Operations & string>(this: void, name: Name & (true extends IsUnion<NoInfer<Name>> ? never : unknown), input: InputOf<Operations[NoInfer<Name>]>, options?: {
|
|
23
|
+
signal?: AbortSignal;
|
|
24
|
+
}): Promise<DataResponse<OutputOf<Operations[Name]>, InputOf<Operations[Name]>>>;
|
|
25
|
+
};
|
|
26
|
+
/** Distribute over conditional filter members so each possible facet is checked. */
|
|
27
|
+
type UncheckedFacet<Operations extends DataOperations, Filter, Key> = Filter extends FacetFilter<infer Value, infer Source> ? Source extends keyof Operations ? OutputOf<Operations[Source]> extends readonly DimensionOption<Value>[] ? never : Key : Key : never;
|
|
28
|
+
/** The filter names whose facet options are missing or mistyped. Only known names:
|
|
29
|
+
* a typed contract may widen `filters` with an index signature. */
|
|
30
|
+
type UncheckedFacetNames<Operations extends DataOperations, Filters> = { [Key in keyof Filters as string extends Key ? never : Key]: UncheckedFacet<Operations, Filters[Key], Key>; } extends (infer Checked) ? Checked[keyof Checked] : never;
|
|
31
|
+
/** Every facet filter loads its options from a registered operation returning them. */
|
|
32
|
+
type CheckedFacets<Operations extends DataOperations> = { [Name in keyof Operations]: Operations[Name] extends {
|
|
33
|
+
filters: infer Filters;
|
|
34
|
+
} ? UncheckedFacetNames<Operations, Filters> : never; }[keyof Operations] extends never ? unknown : {
|
|
35
|
+
'Facet filter options must name a registered operation returning DimensionOption[]': never;
|
|
36
|
+
};
|
|
37
|
+
/** Execute declared operations in the browser against registered query IDs. */
|
|
38
|
+
type DataClientOptions<Operations extends DataOperations> = (KnownRecord<Operations> extends never ? never : true extends { [Name in keyof Operations]: IsUnion<Operations[Name]>; }[keyof Operations] ? never : unknown) & {
|
|
39
|
+
operations: Operations;
|
|
40
|
+
lakehouse?: Lakehouse;
|
|
41
|
+
} & CheckedFacets<Operations>;
|
|
42
|
+
/** Create a browser operation client. */
|
|
43
|
+
declare function createDataClient<Operations extends DataOperations>(options: DataClientOptions<Operations>): DataClient<Operations>;
|
|
44
|
+
//#endregion
|
|
45
|
+
export { createDataClient as a, OperationFilters as i, DataClientOptions as n, DataResponse as r, DataClient as t };
|
|
46
|
+
//# sourceMappingURL=data-client.d.ts.map
|
|
@@ -1,4 +1,30 @@
|
|
|
1
|
-
|
|
1
|
+
//#region src/core/date-time-range.d.ts
|
|
2
|
+
/** Frontend-compatible range values. Absolute dates encode wall-clock fields as UTC,
|
|
3
|
+
* not instants converted from a reporting timezone. The backend interprets that zone.
|
|
4
|
+
*/
|
|
5
|
+
type AbsoluteOrRelativeDateTime = Date | RelativeDateTime;
|
|
6
|
+
type DateTimeRange = {
|
|
7
|
+
/** Inclusive start; null or omitted means unbounded. */
|
|
8
|
+
from?: AbsoluteOrRelativeDateTime | null;
|
|
9
|
+
/** Exclusive end; null or omitted means now. */
|
|
10
|
+
to?: AbsoluteOrRelativeDateTime | null;
|
|
11
|
+
};
|
|
12
|
+
type RelativeDateTime = {
|
|
13
|
+
anchor: RelativeAnchor;
|
|
14
|
+
offset: RelativeOffset[];
|
|
15
|
+
};
|
|
16
|
+
type RelativeOffset = {
|
|
17
|
+
amount: number;
|
|
18
|
+
unit: RelativeUnit;
|
|
19
|
+
};
|
|
20
|
+
type RelativeAnchor = 'RELATIVE_ANCHOR_NOW' | 'RELATIVE_ANCHOR_START_OF_TODAY' | 'RELATIVE_ANCHOR_START_OF_YESTERDAY' | 'RELATIVE_ANCHOR_START_OF_TOMORROW' | 'RELATIVE_ANCHOR_START_OF_WEEK' | 'RELATIVE_ANCHOR_START_OF_MONTH' | 'RELATIVE_ANCHOR_START_OF_YEAR';
|
|
21
|
+
type RelativeUnit = 'SECOND' | 'MINUTE' | 'HOUR' | 'DAY' | 'WEEK' | 'MONTH' | 'YEAR';
|
|
22
|
+
/** Bounded, resolved wall-clock dates encoded in UTC, with an exclusive end. */
|
|
23
|
+
type ResolvedDateTimeRange = {
|
|
24
|
+
from: Date;
|
|
25
|
+
to: Date;
|
|
26
|
+
};
|
|
27
|
+
//#endregion
|
|
2
28
|
//#region src/core/date-time-range-value.d.ts
|
|
3
29
|
/** Validate and restore UTC-rebased dates from JSON, without resolving relative bounds. */
|
|
4
30
|
declare function parseDateTimeRange(value: unknown, { maxRangeDays }?: {
|
|
@@ -16,5 +42,5 @@ declare function formatDateTimeRange(value: DateTimeRange): string;
|
|
|
16
42
|
/** Parse one bound without resolving relative anchors or offsets. */
|
|
17
43
|
declare function parseDateTimeBound(text: string): AbsoluteOrRelativeDateTime | null;
|
|
18
44
|
//#endregion
|
|
19
|
-
export { resolveDateTimeRange as a, parseDateTimeRange as i, formatDateTimeRange as n, serializeDateTimeRange as o, parseDateTimeBound as r, formatDateTimeBound as t };
|
|
45
|
+
export { resolveDateTimeRange as a, DateTimeRange as c, RelativeOffset as d, RelativeUnit as f, parseDateTimeRange as i, RelativeAnchor as l, formatDateTimeRange as n, serializeDateTimeRange as o, ResolvedDateTimeRange as p, parseDateTimeBound as r, AbsoluteOrRelativeDateTime as s, formatDateTimeBound as t, RelativeDateTime as u };
|
|
20
46
|
//# sourceMappingURL=date-time-range-value.d.ts.map
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { D as RoutedMessage, E as MessageTransport, S as MessageOutput, l as DataAppAnnotationDraft, n as ExternalLinkModifiers, r as ExternalLinkResult, w as MessageRoutes, x as MessageInput } from "./contract2.js";
|
|
1
|
+
import { E as MessageTransport, O as RoutedMessage, Rt as HostedLakehouse, S as MessageOutput, Wt as QueryResult, _t as HistoryMode, gt as AppLocation, l as DataAppAnnotationDraft, n as ExternalLinkModifiers, r as ExternalLinkResult, tn as QueryParameters, w as MessageRoutes, x as MessageInput } from "./contract.js";
|
|
3
2
|
//#region src/core/logger.d.ts
|
|
4
3
|
/** Host-owned log sink; compatible with console and frontend createLogger(). */
|
|
5
4
|
type DataAppLogger = {
|
|
@@ -13,8 +12,49 @@ type LogEntry = {
|
|
|
13
12
|
args: unknown[];
|
|
14
13
|
};
|
|
15
14
|
//#endregion
|
|
15
|
+
//#region src/core/actions.d.ts
|
|
16
|
+
/** Page actions an embedded app offers its host, replaced as a whole on every change.
|
|
17
|
+
* An absent key means the app does not offer that action. */
|
|
18
|
+
type DataAppActions = {
|
|
19
|
+
/** Run `refresh`; while `refreshing`, run `cancelRefresh` if `cancellable`. */
|
|
20
|
+
refresh?: {
|
|
21
|
+
refreshing: boolean;
|
|
22
|
+
cancellable: boolean;
|
|
23
|
+
};
|
|
24
|
+
/** Run `exportCsv`. `tables` names the datasets an action's `table` may select. */
|
|
25
|
+
exportCsv?: {
|
|
26
|
+
enabled: boolean;
|
|
27
|
+
tables: readonly string[];
|
|
28
|
+
};
|
|
29
|
+
/** Run `presentStory`; while `presenting`, run `closeStory`. */
|
|
30
|
+
presentStory?: {
|
|
31
|
+
enabled: boolean;
|
|
32
|
+
presenting: boolean;
|
|
33
|
+
};
|
|
34
|
+
/** Run `aboutData` to open the data inspector. */
|
|
35
|
+
aboutData?: {
|
|
36
|
+
enabled: boolean;
|
|
37
|
+
};
|
|
38
|
+
};
|
|
39
|
+
/** A host request to run an offered page action. The app ignores unavailable actions. */
|
|
40
|
+
type DataAppAction = {
|
|
41
|
+
type: 'refresh';
|
|
42
|
+
} | {
|
|
43
|
+
type: 'cancelRefresh';
|
|
44
|
+
} |
|
|
45
|
+
/** Omit `table` to export every dataset, as a ZIP when there are several. */
|
|
46
|
+
{
|
|
47
|
+
type: 'exportCsv';
|
|
48
|
+
table?: string;
|
|
49
|
+
} | {
|
|
50
|
+
type: 'presentStory';
|
|
51
|
+
} | {
|
|
52
|
+
type: 'closeStory';
|
|
53
|
+
} | {
|
|
54
|
+
type: 'aboutData';
|
|
55
|
+
};
|
|
56
|
+
//#endregion
|
|
16
57
|
//#region src/client/transport.d.ts
|
|
17
|
-
type DataTransport = (operation: string, input: unknown, signal?: AbortSignal) => Promise<TransportResponse>;
|
|
18
58
|
declare const errorBrand: unique symbol;
|
|
19
59
|
declare class DataAppError extends Error {
|
|
20
60
|
readonly code: string;
|
|
@@ -23,48 +63,12 @@ declare class DataAppError extends Error {
|
|
|
23
63
|
static [Symbol.hasInstance](value: unknown): boolean;
|
|
24
64
|
constructor(message: string, code: string, requestId?: string | undefined);
|
|
25
65
|
}
|
|
26
|
-
declare function createHttpTransport({ endpoint, fetch: request }?: {
|
|
27
|
-
endpoint?: string;
|
|
28
|
-
fetch?: typeof fetch;
|
|
29
|
-
}): DataTransport;
|
|
30
66
|
//#endregion
|
|
31
|
-
//#region src/client/
|
|
32
|
-
/**
|
|
33
|
-
|
|
34
|
-
*/
|
|
35
|
-
|
|
36
|
-
/** The exact browser input that produced this response. */
|
|
37
|
-
input: Input;
|
|
38
|
-
};
|
|
39
|
-
declare const clientContract: unique symbol;
|
|
40
|
-
type DataClient<Operations extends DataOperations> = {
|
|
41
|
-
/** Preserve the operation registry when passing clients through helpers. */
|
|
42
|
-
readonly [clientContract]: (operations: Operations) => Operations;
|
|
43
|
-
query<Name extends keyof Operations & string>(this: void, name: Name & (true extends IsUnion<NoInfer<Name>> ? never : unknown), input: InputOf<Operations[NoInfer<Name>]>, options?: {
|
|
44
|
-
signal?: AbortSignal;
|
|
45
|
-
}): Promise<DataResponse<OutputOf<Operations[Name]>, InputOf<Operations[Name]>>>;
|
|
46
|
-
};
|
|
47
|
-
type TransportOptions = {
|
|
48
|
-
operations?: never;
|
|
49
|
-
lakehouse?: never;
|
|
50
|
-
transport?: DataTransport;
|
|
51
|
-
endpoint?: string;
|
|
52
|
-
fetch?: typeof fetch;
|
|
53
|
-
};
|
|
54
|
-
/** Browser operations and named-operation delivery are mutually exclusive. */
|
|
55
|
-
type DataClientOptions<Operations extends DataOperations> = (KnownRecord<Operations> extends never ? never : true extends { [Name in keyof Operations]: IsUnion<Operations[Name]>; }[keyof Operations] ? never : unknown) & ({
|
|
56
|
-
operations: Operations;
|
|
57
|
-
lakehouse?: Lakehouse;
|
|
58
|
-
transport?: never;
|
|
59
|
-
endpoint?: never;
|
|
60
|
-
fetch?: never;
|
|
61
|
-
} | TransportOptions);
|
|
62
|
-
/** Named HTTP operations, or browser-owned operations executed through an authorized SQL bridge. */
|
|
63
|
-
declare function createDataClient<Operations extends DataOperations>(options: DataClientOptions<Operations>): DataClient<Operations>;
|
|
64
|
-
/** Named clients derive data from the declared operations' run return types. */
|
|
65
|
-
declare function createDataClient<Operations extends DataOperations>(...args: DataClientOptions<Operations> extends never ? [options: never] : []): DataClient<Operations>;
|
|
66
|
-
/** Without an operation contract, external operation data remains unknown. */
|
|
67
|
-
declare function createDataClient(options?: TransportOptions): DataClient<DataOperations>;
|
|
67
|
+
//#region src/client/local-query.d.ts
|
|
68
|
+
/** Send registered query IDs to the local Bun server; SQL never crosses this request. */
|
|
69
|
+
declare function createLocalQueryLakehouse(endpoint?: string, request?: typeof fetch): HostedLakehouse;
|
|
70
|
+
/** Install the local query adapter before mounting an app with browser-run operations. */
|
|
71
|
+
declare function installLocalQueryLakehouse(frame?: Window, lakehouse?: HostedLakehouse): () => void;
|
|
68
72
|
//#endregion
|
|
69
73
|
//#region src/client/location.d.ts
|
|
70
74
|
type DataAppLocation = {
|
|
@@ -91,12 +95,10 @@ declare function createIframeTransport({ parentOrigin, window: frame, timeoutMs,
|
|
|
91
95
|
};
|
|
92
96
|
logger: DataAppLogger;
|
|
93
97
|
request: (message: RoutedMessage, signal?: AbortSignal) => Promise<unknown>;
|
|
94
|
-
transport: (operation: string, input: unknown, signal?: AbortSignal) => Promise<TransportResponse>;
|
|
95
98
|
lakehouse: {
|
|
96
|
-
|
|
99
|
+
queryAllById(queryId: string, { limit, signal, params }: {
|
|
97
100
|
limit: number;
|
|
98
101
|
signal: AbortSignal;
|
|
99
|
-
name?: string;
|
|
100
102
|
params?: QueryParameters;
|
|
101
103
|
}): Promise<QueryResult>;
|
|
102
104
|
};
|
|
@@ -105,6 +107,12 @@ declare function createIframeTransport({ parentOrigin, window: frame, timeoutMs,
|
|
|
105
107
|
snapshot(): unknown;
|
|
106
108
|
subscribe(listener: (state: unknown) => void): () => void;
|
|
107
109
|
ready(): void;
|
|
110
|
+
/** Offers page actions to the host, replacing the previous set; `{}` withdraws them.
|
|
111
|
+
* Unchanged sets are not resent, so callers can report their latest set on every render.
|
|
112
|
+
* The current set is resent when the host reconnects. */
|
|
113
|
+
setActions(value: DataAppActions): void;
|
|
114
|
+
/** Receives host requests to run offered page actions. */
|
|
115
|
+
onAction(listener: (action: DataAppAction) => void): () => void;
|
|
108
116
|
/** The UI owner calls this once its styles support content sizing; the parent's
|
|
109
117
|
* `sizing: 'content'` presentation then applies until the returned release runs. */
|
|
110
118
|
supportContentSizing(): () => void;
|
|
@@ -112,8 +120,8 @@ declare function createIframeTransport({ parentOrigin, window: frame, timeoutMs,
|
|
|
112
120
|
fail(cause?: unknown): void;
|
|
113
121
|
};
|
|
114
122
|
type IframeTransport = ReturnType<typeof createIframeTransport>;
|
|
115
|
-
type LocalBridge = Pick<
|
|
116
|
-
connect?: () => Promise<
|
|
123
|
+
type LocalBridge = Partial<Pick<IframeTransport, 'request'>> & {
|
|
124
|
+
connect?: () => Promise<IframeTransport>;
|
|
117
125
|
};
|
|
118
126
|
/** The URL opts into local preview; only same-origin server configuration establishes trust. */
|
|
119
127
|
declare function localFrameBridge(window?: Window): LocalBridge | undefined;
|
|
@@ -130,12 +138,10 @@ declare function getDataAppTransport(frame?: Window): {
|
|
|
130
138
|
};
|
|
131
139
|
logger: DataAppLogger;
|
|
132
140
|
request: (message: RoutedMessage, signal?: AbortSignal) => Promise<unknown>;
|
|
133
|
-
transport: (operation: string, input: unknown, signal?: AbortSignal) => Promise<TransportResponse>;
|
|
134
141
|
lakehouse: {
|
|
135
|
-
|
|
142
|
+
queryAllById(queryId: string, { limit, signal, params }: {
|
|
136
143
|
limit: number;
|
|
137
144
|
signal: AbortSignal;
|
|
138
|
-
name?: string;
|
|
139
145
|
params?: QueryParameters;
|
|
140
146
|
}): Promise<QueryResult>;
|
|
141
147
|
};
|
|
@@ -144,6 +150,12 @@ declare function getDataAppTransport(frame?: Window): {
|
|
|
144
150
|
snapshot(): unknown;
|
|
145
151
|
subscribe(listener: (state: unknown) => void): () => void;
|
|
146
152
|
ready(): void;
|
|
153
|
+
/** Offers page actions to the host, replacing the previous set; `{}` withdraws them.
|
|
154
|
+
* Unchanged sets are not resent, so callers can report their latest set on every render.
|
|
155
|
+
* The current set is resent when the host reconnects. */
|
|
156
|
+
setActions(value: DataAppActions): void;
|
|
157
|
+
/** Receives host requests to run offered page actions. */
|
|
158
|
+
onAction(listener: (action: DataAppAction) => void): () => void;
|
|
147
159
|
/** The UI owner calls this once its styles support content sizing; the parent's
|
|
148
160
|
* `sizing: 'content'` presentation then applies until the returned release runs. */
|
|
149
161
|
supportContentSizing(): () => void;
|
|
@@ -248,5 +260,5 @@ declare function navigateNewWindow(url: string, options?: NavigationOptions): Pr
|
|
|
248
260
|
/** Send only modifier keys, never the DOM/React event. Shift requests a window, Ctrl/Cmd a tab; otherwise no navigation. */
|
|
249
261
|
declare function navigateNewWindowOrTab(url: string, event: ExternalLinkModifiers, options?: NavigationOptions): Promise<ExternalLinkResult>;
|
|
250
262
|
//#endregion
|
|
251
|
-
export {
|
|
263
|
+
export { DataAppActions as C, DataAppAction as S, LogEntry as T, localFrameBridge as _, AppDiagnosticReport as a, installLocalQueryLakehouse as b, createAnnotationClient as c, createDataAppNavigation as d, getDataAppNavigation as f, installDataAppTransport as g, getDataAppTransport as h, appDiagnostics as i, createMessageClient as l, createIframeTransport as m, navigateNewWindow as n, AppFailure as o, IframeTransport as p, navigateNewWindowOrTab as r, parseAppDiagnosticReport as s, navigateNewTab as t, DataAppNavigation as u, DataAppLocation as v, DataAppLogger as w, DataAppError as x, createLocalQueryLakehouse as y };
|
|
252
264
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { C as
|
|
3
|
-
|
|
1
|
+
import { Ut as OutputOf, gt as AppLocation, zt as InputOf } from "../chunks/contract.js";
|
|
2
|
+
import { C as DataAppActions, S as DataAppAction, a as AppDiagnosticReport, b as installLocalQueryLakehouse, c as createAnnotationClient, d as createDataAppNavigation, f as getDataAppNavigation, g as installDataAppTransport, h as getDataAppTransport, i as appDiagnostics, l as createMessageClient, m as createIframeTransport, n as navigateNewWindow, o as AppFailure, p as IframeTransport, r as navigateNewWindowOrTab, t as navigateNewTab, u as DataAppNavigation, v as DataAppLocation, w as DataAppLogger, x as DataAppError, y as createLocalQueryLakehouse } from "../chunks/index.js";
|
|
3
|
+
import { a as createDataClient, i as OperationFilters, n as DataClientOptions, r as DataResponse, t as DataClient } from "../chunks/data-client.js";
|
|
4
|
+
export { type AppDiagnosticReport, type AppFailure, type AppLocation, type DataAppAction, type DataAppActions, DataAppError, type DataAppLocation, type DataAppLogger, type DataAppNavigation, type DataClient, type DataClientOptions, type DataResponse, type IframeTransport, type InputOf, type OperationFilters, type OutputOf, appDiagnostics, createAnnotationClient, createDataAppNavigation, createDataClient, createIframeTransport, createLocalQueryLakehouse, createMessageClient, getDataAppNavigation, getDataAppTransport, installDataAppTransport, installLocalQueryLakehouse, navigateNewTab, navigateNewWindow, navigateNewWindowOrTab };
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { At as
|
|
1
|
+
import { c as DateTimeRange, d as RelativeOffset, f as RelativeUnit, l as RelativeAnchor, s as AbsoluteOrRelativeDateTime, u as RelativeDateTime } from "../chunks/date-time-range-value.js";
|
|
2
|
+
import { $t as QueryParameter, At as DimensionSourceQueryName, I as DefinedOperation, L as FilterOperationDefinition, Pt as DataOperations, Qt as QueryField, R as InputOperationDefinition, V as WithFilterInput, Z as FilterInput, Zt as QueryDefinitions, an as QueryValueType, at as FilterCollection, en as QueryParameterValue, in as QuerySnapshot, jt as SourceDimensionFilter, kt as DimensionSourceConfig, nn as QueryProjections, qt as CheckedQueries, rn as QueryRow } from "../chunks/contract.js";
|
|
3
|
+
import { t as DataClient } from "../chunks/data-client.js";
|
|
3
4
|
import { o as AppearanceOptions } from "../chunks/appearance.js";
|
|
4
5
|
//#region src/core/config.d.ts
|
|
5
6
|
export type DataAppConfig<Queries extends QueryDefinitions = QueryDefinitions> = {
|
|
@@ -21,6 +22,10 @@ export type DataAppConfig<Queries extends QueryDefinitions = QueryDefinitions> =
|
|
|
21
22
|
/** Named SQL statements with typed parameters and result projections. */
|
|
22
23
|
queries: Queries;
|
|
23
24
|
};
|
|
25
|
+
export type DataAppOperationRegistry<Operations extends DataOperations> = Operations & {
|
|
26
|
+
/** Run operations in the browser using its installed query bridge. */
|
|
27
|
+
createDataClient(): DataClient<Operations>;
|
|
28
|
+
};
|
|
24
29
|
/** An app declaration with operations bound to its query registry. */
|
|
25
30
|
export type DataAppDefinition<Queries extends QueryDefinitions = QueryDefinitions> = Readonly<Omit<DataAppConfig<Queries>, 'queries'>> & {
|
|
26
31
|
readonly queries: QuerySnapshot<Queries>;
|
|
@@ -28,11 +33,17 @@ export type DataAppDefinition<Queries extends QueryDefinitions = QueryDefinition
|
|
|
28
33
|
source: {
|
|
29
34
|
query: DimensionSourceQueryName<Queries, NoInfer<Type>>;
|
|
30
35
|
};
|
|
31
|
-
}):
|
|
36
|
+
}): SourceDimensionFilter<{
|
|
32
37
|
string: string;
|
|
33
38
|
number: number;
|
|
34
39
|
}[Type]>;
|
|
35
|
-
|
|
40
|
+
/** Parse a destination's own input, such as a record id, and list valid `checks`.
|
|
41
|
+
* Declare `filters` too when it reads the displayed scope. */
|
|
42
|
+
defineOperation<Input, Output, const Filters extends FilterCollection = {}>(operation: InputOperationDefinition<Input, Output, Queries, Filters>): DefinedOperation<WithFilterInput<Filters, Input>, Output, Queries, keyof Filters extends never ? undefined : Filters>;
|
|
43
|
+
/** Declare the filters the operation reads; its input, checks, and views derive from them. */
|
|
44
|
+
defineOperation<const Filters extends FilterCollection = {}, Output = unknown>(operation: FilterOperationDefinition<Filters, Output, Queries>): DefinedOperation<FilterInput<Filters>, Output, Queries, Filters>;
|
|
45
|
+
/** Bind a named registry to these queries and derive its client and filters. */
|
|
46
|
+
defineOperations<const Operations extends DataOperations>(operations: Operations): DataAppOperationRegistry<Operations>;
|
|
36
47
|
};
|
|
37
48
|
/**
|
|
38
49
|
* Define the app's query source of truth while preserving exact query and parameter names.
|
|
@@ -50,8 +61,7 @@ export type DataAppDefinition<Queries extends QueryDefinitions = QueryDefinition
|
|
|
50
61
|
* references, and callbacks. Extraction reads literals without executing app code.
|
|
51
62
|
* TypeScript and runtime query rules own configuration validation.
|
|
52
63
|
*
|
|
53
|
-
*
|
|
54
|
-
* expand to DuckDB timestamp expressions while the range is bound as JSON.
|
|
64
|
+
* Statements use DuckDB SQL and bound parameters without SDK-only SQL syntax.
|
|
55
65
|
* Declare each parameter's type and optional defaultValue.
|
|
56
66
|
* Values are scalars or declared datetime ranges, never SQL fragments or identifiers.
|
|
57
67
|
* Host queryParams supply protected values; callers cannot override them.
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
import { i as
|
|
2
|
-
import { $ as
|
|
3
|
-
|
|
4
|
-
import { A as dataAppRoutes, C as MessageRoute, D as RoutedMessage, E as MessageTransport, F as dateTimeRangeSql, M as defineMessageRoute, N as navigationUpdateRoute, O as SqlQueryInput, P as sqlQueryRoute, S as MessageOutput, T as MessageRoutingError, _ as DataQueryRoute, a as OpenExternalLink, b as MessageHandlers, c as resolveExternalLinkTarget, d as annotationDraftRoute, f as annotationEditorStateRoute, g as parseDataAppAnnotationDraft, h as annotationUpdateRoute, i as ExternalLinkTarget, j as defineDataQueryRoute, k as createMessageRouter, l as DataAppAnnotationDraft, m as annotationSendRoute, n as ExternalLinkModifiers, o as openExternalLinkRoute, p as annotationModeRoute, r as ExternalLinkResult, s as parseExternalUrl, t as DataSourceError, u as DataAppAnnotationPresentation, v as MessageContext, w as MessageRoutes, x as MessageInput, y as MessageDispatcher } from "../chunks/contract2.js";
|
|
5
|
-
export { type AbsoluteOrRelativeDateTime, type BooleanFilter, type BooleanSelection, type ConnectionOperation, type DataAppAnnotationDraft, type DataAppAnnotationPresentation, type DataOperation, type DataOperations, type DataQueryBody, type DataQueryInput, type DataQueryRoute, DataSourceError, type DateRangeContract, type DateRangeContractOptions, type DateTimeRange, type DateTimeRangeComparisonRequest, type DateTimeRangeComparisonSelection, type DateTimeRangeComparisonVariable, type DateTimeRangeComparisonVariableOptions, type DateTimeRangeContract, type DateTimeRangePreset, type DateTimeRangeRequest, type DateTimeRangeVariable, type DateTimeRangeVariableOptions, type DimensionFilterOptions, type DimensionMember, type DimensionOption, type DimensionSelection, type DimensionVariable, type DisclosedQuery, type ExternalLinkModifiers, type ExternalLinkResult, type ExternalLinkTarget, type Lakehouse, type MessageContext, type MessageDispatcher, type MessageHandlers, type MessageInput, type MessageOutput, type MessageRoute, type MessageRoutes, MessageRoutingError, type MessageTransport, type NavigationUpdate, type NumberFilter, type NumberOperator, type NumberSelection, type OpenExternalLink, type OperationContext, type OperationContracts, type OperationDefinition, type QueryDefinitions, type QueryField, type QueryParameter, type QueryParameterValue, type QueryParameters, type QueryProjections, type QueryResult, type QueryRow, type QueryValueType, type RegisteredQuery, type RelativeDateTime, type ReportingPeriod, type ResolvedDateTimeRange, type RoutedMessage, type SqlQueryInput, type TransportResponse, annotationDraftRoute, annotationEditorStateRoute, annotationModeRoute, annotationSendRoute, annotationUpdateRoute, booleanFilter, connectionCheck, createMessageRouter, dataAppRoutes, dateTimeRangePresets, dateTimeRangeSql, dateTimeRangeVariable, defineDataQueryRoute, defineDateRangeContract, defineMessageRoute, defineOperation, defineQueryNames, dimensionFilter, dimensionPredicate, formatDateTimeBound, formatDateTimeRange, navigationUpdateRoute, numberFilter, openExternalLinkRoute, parseBooleanSelection, parseCount, parseDataAppAnnotationDraft, parseDateTimeBound, parseDateTimeRange, parseDimensionSelection, parseEmptyInput, parseExternalUrl, parseFacetOptions, parseLabel, parseNumberSelection, parseTrue, resolveDateTimeRange, resolveExternalLinkTarget, serializeDateTimeRange, sqlQueryRoute, variableInput };
|
|
1
|
+
import { a as resolveDateTimeRange, c as DateTimeRange, i as parseDateTimeRange, n as formatDateTimeRange, o as serializeDateTimeRange, p as ResolvedDateTimeRange, r as parseDateTimeBound, s as AbsoluteOrRelativeDateTime, t as formatDateTimeBound, u as RelativeDateTime } from "../chunks/date-time-range-value.js";
|
|
2
|
+
import { $t as QueryParameter, A as dataAppRoutes, An as dateTimeRangePresets, B as ReportingPeriod, Bt as Lakehouse, C as MessageRoute, Cn as DateTimeRangeComparison, Ct as NumberSelection, D as RegisteredQueryInput, Dt as parseBooleanSelection, E as MessageTransport, En as DateTimeRangePreset, F as ConnectionOperation, Ft as DataQueryBody, G as parseCount, Gt as SqlLakehouse, H as connectionCheck, Ht as OperationContracts, I as DefinedOperation, It as DataQueryInput, J as dateTimeRangeSql, K as parseLabel, Kt as TransportResponse, L as FilterOperationDefinition, Lt as DisclosedQuery, M as defineMessageRoute, Mn as DateTimeRangeInput, N as navigationUpdateRoute, Nn as DateTimeRangePolicy, Nt as DataOperation, O as RoutedMessage, On as DateTimeRangeSelection, Ot as parseNumberSelection, P as registeredQueryRoute, Pt as DataOperations, Qt as QueryField, R as InputOperationDefinition, Rt as HostedLakehouse, S as MessageOutput, St as NumberOperator, T as MessageRoutingError, Tn as DateTimeRangeFilterOptions, Tt as numberFilter, U as defineOperation, V as WithFilterInput, Vt as OperationContext, W as defineQueryNames, Wt as QueryResult, X as facetFilter, Y as resolvedDateTimeRangeParams, Z as FilterInput, Zt as QueryDefinitions, _ as DataOperationRoute, a as OpenExternalLink, an as QueryValueType, at as FilterCollection, b as MessageHandlers, bn as parseFacetOptions, bt as BooleanSelection, c as resolveExternalLinkTarget, cn as DimensionFilterOptions, ct as MultiChoiceFilter, d as annotationDraftRoute, dn as DimensionOption, en as QueryParameterValue, f as annotationEditorStateRoute, fn as DimensionSelection, ft as displayChoice, g as parseDataAppAnnotationDraft, gn as dimensionFilter, h as annotationUpdateRoute, i as ExternalLinkTarget, it as ChoiceOption, j as defineDataOperationRoute, jn as queryDateTimeRangeParams, k as createMessageRouter, kn as dateTimeRangeFilter, l as DataAppAnnotationDraft, lt as SearchFilter, m as annotationSendRoute, mt as searchFilter, n as ExternalLinkModifiers, nn as QueryProjections, o as openExternalLinkRoute, ot as FilterPresentation, p as annotationModeRoute, pt as multiChoiceFilter, q as parseTrue, r as ExternalLinkResult, rn as QueryRow, rt as ChoiceFilter, s as parseExternalUrl, sn as DimensionFilter, st as FilterValues, t as DataSourceError, tn as QueryParameters, tt as AppFilter, u as DataAppAnnotationPresentation, un as DimensionMember, ut as choiceFilter, v as MessageContext, vn as dimensionPredicate, vt as NavigationUpdate, w as MessageRoutes, wn as DateTimeRangeFilter, wt as booleanFilter, x as MessageInput, xn as FacetFilter, xt as NumberFilter, y as MessageDispatcher, yn as parseDimensionSelection, yt as BooleanFilter, z as RegisteredQuery } from "../chunks/contract.js";
|
|
3
|
+
export { type AbsoluteOrRelativeDateTime, type AppFilter, type BooleanFilter, type BooleanSelection, type ChoiceFilter, type ChoiceOption, type ConnectionOperation, type DataAppAnnotationDraft, type DataAppAnnotationPresentation, type DataOperation, type DataOperationRoute, type DataOperations, type DataQueryBody, type DataQueryInput, DataSourceError, type DateTimeRange, type DateTimeRangeComparison, type DateTimeRangeFilter, type DateTimeRangeFilterOptions, type DateTimeRangeInput, type DateTimeRangePolicy, type DateTimeRangePreset, type DateTimeRangeSelection, type DefinedOperation, type DimensionFilter, type DimensionFilterOptions, type DimensionMember, type DimensionOption, type DimensionSelection, type DisclosedQuery, type ExternalLinkModifiers, type ExternalLinkResult, type ExternalLinkTarget, type FacetFilter, type FilterCollection, type FilterInput, type FilterOperationDefinition, type FilterPresentation, type FilterValues, type HostedLakehouse, type InputOperationDefinition, type Lakehouse, type MessageContext, type MessageDispatcher, type MessageHandlers, type MessageInput, type MessageOutput, type MessageRoute, type MessageRoutes, MessageRoutingError, type MessageTransport, type MultiChoiceFilter, type NavigationUpdate, type NumberFilter, type NumberOperator, type NumberSelection, type OpenExternalLink, type OperationContext, type OperationContracts, type QueryDefinitions, type QueryField, type QueryParameter, type QueryParameterValue, type QueryParameters, type QueryProjections, type QueryResult, type QueryRow, type QueryValueType, type RegisteredQuery, type RegisteredQueryInput, type RelativeDateTime, type ReportingPeriod, type ResolvedDateTimeRange, type RoutedMessage, type SearchFilter, type SqlLakehouse, type TransportResponse, type WithFilterInput, annotationDraftRoute, annotationEditorStateRoute, annotationModeRoute, annotationSendRoute, annotationUpdateRoute, booleanFilter, choiceFilter, connectionCheck, createMessageRouter, dataAppRoutes, dateTimeRangeFilter, dateTimeRangePresets, dateTimeRangeSql, defineDataOperationRoute, defineMessageRoute, defineOperation, defineQueryNames, dimensionFilter, dimensionPredicate, displayChoice, facetFilter, formatDateTimeBound, formatDateTimeRange, multiChoiceFilter, navigationUpdateRoute, numberFilter, openExternalLinkRoute, parseBooleanSelection, parseCount, parseDataAppAnnotationDraft, parseDateTimeBound, parseDateTimeRange, parseDimensionSelection, parseExternalUrl, parseFacetOptions, parseLabel, parseNumberSelection, parseTrue, queryDateTimeRangeParams, registeredQueryRoute, resolveDateTimeRange, resolveExternalLinkTarget, resolvedDateTimeRangeParams, searchFilter, serializeDateTimeRange };
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { n as formatDateTimeRange } from "../chunks/date-time-range-value.js";
|
|
1
|
+
import { c as DateTimeRange, d as RelativeOffset, f as RelativeUnit, l as RelativeAnchor, n as formatDateTimeRange, s as AbsoluteOrRelativeDateTime, u as RelativeDateTime } from "../chunks/date-time-range-value.js";
|
|
3
2
|
//#region src/core/date-time-range-parser.d.ts
|
|
4
3
|
type DateTimeRangeParseFailureReason = 'empty' | 'unrecognized' | 'invalid-range' | 'ambiguous';
|
|
5
4
|
type DateTimeRangeParserOptions = {
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { DataAppConfig, DataAppDefinition, dataAppTitle, defineDataApp } from "./core/config.js";
|
|
4
|
-
export { type AbsoluteOrRelativeDateTime, type DataAppConfig, type DataAppDefinition, type DateTimeRange, type QueryDefinitions, type QueryField, type QueryParameter, type QueryParameterValue, type QueryProjections, type QueryRow, type QueryValueType, type RelativeAnchor, type RelativeDateTime, type RelativeOffset, type RelativeUnit, dataAppTitle, defineDataApp };
|
|
1
|
+
import { c as DateTimeRange, d as RelativeOffset, f as RelativeUnit, l as RelativeAnchor, s as AbsoluteOrRelativeDateTime, u as RelativeDateTime } from "./chunks/date-time-range-value.js";
|
|
2
|
+
import { $t as QueryParameter, Qt as QueryField, Zt as QueryDefinitions, an as QueryValueType, en as QueryParameterValue, nn as QueryProjections, rn as QueryRow } from "./chunks/contract.js";
|
|
3
|
+
import { DataAppConfig, DataAppDefinition, DataAppOperationRegistry, dataAppTitle, defineDataApp } from "./core/config.js";
|
|
4
|
+
export { type AbsoluteOrRelativeDateTime, type DataAppConfig, type DataAppDefinition, type DataAppOperationRegistry, type DateTimeRange, type QueryDefinitions, type QueryField, type QueryParameter, type QueryParameterValue, type QueryProjections, type QueryRow, type QueryValueType, type RelativeAnchor, type RelativeDateTime, type RelativeOffset, type RelativeUnit, dataAppTitle, defineDataApp };
|
package/dist/types/internal.d.ts
CHANGED
|
@@ -1,8 +1,6 @@
|
|
|
1
|
-
import { i as
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import { u as DataAppAnnotationPresentation } from "./chunks/contract2.js";
|
|
5
|
-
import { D as LogEntry, _ as localFrameBridge, s as parseAppDiagnosticReport } from "./chunks/index.js";
|
|
1
|
+
import { a as resolveDateTimeRange, c as DateTimeRange, f as RelativeUnit, i as parseDateTimeRange, n as formatDateTimeRange, o as serializeDateTimeRange, r as parseDateTimeBound, s as AbsoluteOrRelativeDateTime, t as formatDateTimeBound, u as RelativeDateTime } from "./chunks/date-time-range-value.js";
|
|
2
|
+
import { $ as dateFilterName, An as dateTimeRangePresets, Cn as DateTimeRangeComparison, Dn as DateTimeRangeRequest, En as DateTimeRangePreset, Et as numberOperatorLabels, Jt as IsUnion, Mn as DateTimeRangeInput, Mt as dimensionSource, On as DateTimeRangeSelection, Q as combineOperationFilters, Sn as facetSource, Tn as DateTimeRangeFilterOptions, Xt as MAX_QUERY_ROWS, Z as FilterInput, _n as dimensionMemberKey, _t as HistoryMode, at as FilterCollection, ct as MultiChoiceFilter, dt as defineAppFilters, et as resolveFilterInput, ft as displayChoice, hn as createDimensionFilter, ht as validateChoiceOptions, it as ChoiceOption, jt as SourceDimensionFilter, kn as dateTimeRangeFilter, ln as DimensionFilterSettings, lt as SearchFilter, mn as DimensionValue, mt as searchFilter, nt as CheckedFilterDeclarations, on as REGISTERED_QUERY_ID_PATTERN, ot as FilterPresentation, pn as DimensionSelectionFilter, pt as multiChoiceFilter, rt as ChoiceFilter, st as FilterValues, tt as AppFilter, u as DataAppAnnotationPresentation, ut as choiceFilter, wn as DateTimeRangeFilter, xn as FacetFilter } from "./chunks/contract.js";
|
|
3
|
+
import { C as DataAppActions, S as DataAppAction, T as LogEntry, _ as localFrameBridge, s as parseAppDiagnosticReport } from "./chunks/index.js";
|
|
6
4
|
import { c as Theme } from "./chunks/appearance.js";
|
|
7
5
|
//#region src/core/bridge.d.ts
|
|
8
6
|
/** Data app delivery protocol. IDs identify a document, a shell session, and an individual call. */
|
|
@@ -129,6 +127,23 @@ declare const bridgeProtocol: {
|
|
|
129
127
|
height: number;
|
|
130
128
|
};
|
|
131
129
|
};
|
|
130
|
+
/** The page actions the app currently offers; replaces the previous set. */
|
|
131
|
+
readonly actionsUpdate: {
|
|
132
|
+
wire: "actions:update";
|
|
133
|
+
from: "app";
|
|
134
|
+
session: "current";
|
|
135
|
+
parse: (fields: Fields) => {
|
|
136
|
+
actions: DataAppActions;
|
|
137
|
+
};
|
|
138
|
+
};
|
|
139
|
+
readonly actionRun: {
|
|
140
|
+
wire: "action:run";
|
|
141
|
+
from: "host";
|
|
142
|
+
session: "current";
|
|
143
|
+
parse: (fields: Fields) => {
|
|
144
|
+
action: DataAppAction;
|
|
145
|
+
};
|
|
146
|
+
};
|
|
132
147
|
/** CSS pixels of a content-sized frame hidden above and below the parent's visible area. */
|
|
133
148
|
readonly viewportUpdate: {
|
|
134
149
|
wire: "viewport:update";
|
|
@@ -295,7 +310,7 @@ type MetricValues = {
|
|
|
295
310
|
previous?: number | null;
|
|
296
311
|
};
|
|
297
312
|
type MetricReading = DataReading<MetricValues & {
|
|
298
|
-
period?:
|
|
313
|
+
period?: DateTimeRangeInput;
|
|
299
314
|
}>;
|
|
300
315
|
//#endregion
|
|
301
316
|
//#region src/core/uuid.d.ts
|
|
@@ -311,9 +326,13 @@ export declare function readRequestBody(request: Request, maxBytes: number): Pro
|
|
|
311
326
|
/** Separator for opaque composite keys, independent of URL and DOM ID formats. */
|
|
312
327
|
export declare const KEY_SEPARATOR = ":";
|
|
313
328
|
//#endregion
|
|
329
|
+
//#region src/core/parameter-sql.d.ts
|
|
330
|
+
/** Find SDK-only parameter syntax in SQL code, ignoring strings and comments. */
|
|
331
|
+
export declare function unsupportedParameterReference(statement: string): string | null;
|
|
332
|
+
//#endregion
|
|
314
333
|
//#region src/core/time-units.d.ts
|
|
315
334
|
/** Fixed durations in UTC-rebased arithmetic; months and years are calendar-dependent. */
|
|
316
335
|
export declare const fixedUnitMilliseconds: Partial<Record<RelativeUnit, number>> & Record<'SECOND' | 'MINUTE' | 'HOUR' | 'DAY' | 'WEEK', number>;
|
|
317
336
|
//#endregion
|
|
318
|
-
export { type AbsoluteOrRelativeDateTime, type
|
|
337
|
+
export { type AbsoluteOrRelativeDateTime, type AppFilter, type BridgeDiagnostic, type BridgeEventMessage, type CheckedFilterDeclarations, type ChoiceFilter, type ChoiceOption, type DataAppPresentation, type DataReading, type DataView, type DateTimeRange, type DateTimeRangeComparison, type DateTimeRangeFilter, type DateTimeRangeFilterOptions, type DateTimeRangePreset, type DateTimeRangeRequest, type DateTimeRangeSelection, type DimensionFilterSettings, type DimensionSelectionFilter, type DimensionValue, type DisplayedSnapshot, type FacetFilter, type FilterCollection, type FilterInput, type FilterPresentation, type FilterValues, type HistoryMode, type IsUnion, MAX_QUERY_ROWS, type MetricReading, type MetricValues, type MultiChoiceFilter, REGISTERED_QUERY_ID_PATTERN, type RelativeDateTime, type SearchFilter, type SourceDimensionFilter, choiceFilter, combineOperationFilters, createDimensionFilter, dateFilterName, dateTimeRangeFilter, dateTimeRangePresets, defineAppFilters, dimensionMemberKey, dimensionSource, displayChoice, facetSource, formatDateTimeBound, formatDateTimeRange, localFrameBridge, multiChoiceFilter, numberOperatorLabels, parseAppDiagnosticReport, parseDateTimeBound, parseDateTimeRange, resolveDateTimeRange, resolveFilterInput, searchFilter, serializeDateTimeRange, validateChoiceOptions };
|
|
319
338
|
//# sourceMappingURL=internal.d.ts.map
|
package/docs/app-authoring.md
CHANGED
|
@@ -19,11 +19,11 @@ for the requested change. For a new app, use the starter supplied by the authori
|
|
|
19
19
|
| Local Finding | `starter-local-finding-data-app` |
|
|
20
20
|
|
|
21
21
|
Choose the runtime and use case supplied by the app brief. Each starter is editable
|
|
22
|
-
source; replace fixture queries and sample content before publishing. The
|
|
23
|
-
→ context → view → dataset → widget composition
|
|
22
|
+
source; replace fixture queries and sample content before publishing. The starters demonstrate query → operation
|
|
23
|
+
→ context → view → dataset → widget composition.
|
|
24
24
|
Hosted apps stay in one file with public package imports
|
|
25
25
|
and a literal `defineDataApp()` declaration. Local apps use the same composition
|
|
26
|
-
with their existing server/client wiring. Replace fixture
|
|
26
|
+
with their existing server/client wiring. Replace fixture queries and example content; edit
|
|
27
27
|
app-owned files, not installed packages.
|
|
28
28
|
|
|
29
29
|
## Connect data and components
|
|
@@ -31,23 +31,32 @@ app-owned files, not installed packages.
|
|
|
31
31
|
1. **Define the question and scope.** Inspect relevant fields, definitions, time
|
|
32
32
|
coverage, and missing or incomplete observations. Establish the population,
|
|
33
33
|
grain, measures, and comparison. Choose a chart that answers the question.
|
|
34
|
-
2. **
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
34
|
+
2. **Separate independent results.** Give each independently queried result its
|
|
35
|
+
own named query and operation. Widgets may share one result when they show
|
|
36
|
+
the same rows or derive related metrics from the same summary, such as total
|
|
37
|
+
cost, customer count, and average cost. Keep unrelated results separate.
|
|
38
|
+
Write queries against inspected data and preserve supplied
|
|
39
|
+
metric definitions. Write DuckDB SQL with named parameters; declare `params`
|
|
40
|
+
and result aliases in `projections`.
|
|
41
|
+
Execute named queries with `query()` and derive results from its typed rows.
|
|
38
42
|
3. **Update context and bindings.** Describe definitions and coverage in the data
|
|
39
43
|
context, using the operation's `queryNames` for evidence. Declare each dataset
|
|
40
44
|
and metric once, with stable row keys, raw column values, and shared formats.
|
|
41
|
-
4. **
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
45
|
+
4. **Declare filters once, then one view per operation.** Declare each filter
|
|
46
|
+
and display choice as a constant and list the ones each operation reads in
|
|
47
|
+
its `filters`; the operation receives one flat input field per filter. Define
|
|
48
|
+
each view with `defineView({ operation, dataContext })`: its filters,
|
|
49
|
+
reporting period, and scope derive from the operation. Pass the headline view
|
|
50
|
+
to `<DataApp view>`, which renders every filter's control, and render each
|
|
51
|
+
view in its own `<DataSection>`. Keep protected values such as `orgId`
|
|
52
|
+
backend-owned. See [views](views.md#give-each-independent-result-its-own-view) and
|
|
53
|
+
[filters](filters.md).
|
|
46
54
|
5. **Compose the content.** Follow the app brief for section order and narrative.
|
|
47
55
|
Use `<Stack>` for sections, `<Grid>` for peers, and bound widgets
|
|
48
56
|
from `@altertable/data-app-react`. Keep static explanations outside loading
|
|
49
57
|
boundaries. Use app tabs only for distinct questions and widget `views` only
|
|
50
|
-
for alternate representations of one dataset.
|
|
58
|
+
for alternate representations of one dataset. See [layout](layout.md#adapt-to-the-available-container)
|
|
59
|
+
for container-based sizing. Keep default appearance;
|
|
51
60
|
customize when requested. Use custom UI only when bound components cannot
|
|
52
61
|
express the requirement.
|
|
53
62
|
6. **Connect shell features.** See [stories and export](stories-and-export.md)
|
|
@@ -113,7 +122,7 @@ Open only the section needed for a requirement the starter does not cover:
|
|
|
113
122
|
|
|
114
123
|
| When | Read |
|
|
115
124
|
| -------------------------------------------- | ----------------------------------------------------------------- |
|
|
116
|
-
| Adding categorical, numeric, or time filters | [
|
|
125
|
+
| Adding categorical, numeric, or time filters | [Filters](filters.md) |
|
|
117
126
|
| Adding a chart or narrative binding | [Widgets](widgets.md) |
|
|
118
127
|
| Adding supplemental control hints | [Tooltips](ui.md#tooltips-and-explanations) |
|
|
119
128
|
| Adding a detail destination | [Detail views](views.md#detail-destinations) |
|