@malloy-publisher/sdk 0.17.0 → 0.17.2
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/README.md +32 -50
- package/dist/{RenderedResult-BcEDcw0V.es.js → RenderedResult-CYJ2Y9Fm.es.js} +24 -24
- package/dist/{RenderedResult-uT2oc6ke.cjs.js → RenderedResult-hRvgFMAF.cjs.js} +1 -1
- package/dist/ServerProvider-DeVejmVr.cjs.js +1 -0
- package/dist/{ServerProvider-vmEUjlEu.es.js → ServerProvider-DzzfVDg_.es.js} +1314 -1712
- package/dist/builder/index.cjs.js +12 -12
- package/dist/builder/index.es.js +4 -9
- package/dist/client/api.d.ts +63 -506
- package/dist/client/configuration.d.ts +1 -1
- package/dist/client/index.cjs.js +1 -1
- package/dist/client/index.d.ts +1 -1
- package/dist/client/index.es.js +132 -144
- package/dist/components/Dashboard/DashboardGrid.d.ts +1 -1
- package/dist/components/Model/ExplorerPage.d.ts +1 -3
- package/dist/components/Model/Model.d.ts +1 -4
- package/dist/components/Model/ModelExplorer.d.ts +1 -2
- package/dist/components/Package/reportQueries.d.ts +2 -4
- package/dist/components/Report/Report.d.ts +20 -9
- package/dist/components/{legacy → Report}/malloynb/CellRunnerView.d.ts +13 -16
- package/dist/components/Report/malloynb/MalloynbReport.d.ts +11 -0
- package/dist/components/{legacy → Report}/malloynb/cellKind.d.ts +1 -1
- package/dist/components/ServerProvider.d.ts +1 -3
- package/dist/components/drill/drillClauses.d.ts +8 -9
- package/dist/components/drill/rowsTarget.d.ts +7 -9
- package/dist/components/legacy/index.d.ts +3 -7
- package/dist/components/modelPage.d.ts +2 -5
- package/dist/hooks/useModelGivens.d.ts +2 -2
- package/dist/hooks/useQueryResult.d.ts +7 -0
- package/dist/index.cjs.js +33 -33
- package/dist/index.es.js +8799 -8903
- package/dist/{useCompiledDocument-h5-Kc1Zh.cjs.js → useCompiledDocument-BCr-xB_i.cjs.js} +4 -4
- package/dist/{useCompiledDocument-rOwDSK_s.es.js → useCompiledDocument-E0tU5KzP.es.js} +266 -277
- package/package.json +1 -1
- package/src/components/Dashboard/DashboardGrid.tsx +1 -1
- package/src/components/Dashboard/DashboardTile.spec.tsx +1 -1
- package/src/components/Model/ExplorerPage.tsx +1 -3
- package/src/components/Model/Model.tsx +1 -4
- package/src/components/Model/ModelExplorer.tsx +1 -2
- package/src/components/Package/Package.tsx +1 -5
- package/src/components/Package/reportQueries.ts +3 -15
- package/src/components/Report/Report.malloynb.spec.tsx +230 -0
- package/src/components/Report/Report.spec.tsx +429 -38
- package/src/components/Report/Report.telemetry.spec.tsx +51 -10
- package/src/components/Report/Report.tsx +63 -44
- package/src/components/{legacy → Report}/malloynb/CellRunnerView.spec.tsx +11 -44
- package/src/components/{legacy → Report}/malloynb/CellRunnerView.tsx +63 -107
- package/src/components/Report/malloynb/MalloynbReport.tsx +110 -0
- package/src/components/{legacy → Report}/malloynb/cellKind.ts +5 -4
- package/src/components/ReportBuilder/EditorSurface.tsx +3 -3
- package/src/components/ReportBuilder/ReportBuilder.spec.tsx +2 -2
- package/src/components/ReportBuilder/ReportEditor.notebook.spec.tsx +0 -4
- package/src/components/ReportBuilder/ReportEditor.queryVersion.spec.tsx +0 -1
- package/src/components/ReportBuilder/ReportEditor.resourceUri.spec.tsx +3 -3
- package/src/components/ReportBuilder/ReportEditor.tsx +1 -1
- package/src/components/ReportBuilder/loadMalloy.ts +1 -4
- package/src/components/ReportBuilder/useSaveChannel.ts +1 -6
- package/src/components/ServerProvider.tsx +0 -4
- package/src/components/drill/drillClauses.ts +8 -9
- package/src/components/drill/rowsTarget.ts +7 -9
- package/src/components/index.ts +2 -3
- package/src/components/legacy/index.ts +3 -7
- package/src/components/modelPage.ts +2 -5
- package/src/hooks/useGivensState.ts +8 -8
- package/src/hooks/useModelGivens.ts +2 -2
- package/src/hooks/useQueryResult.ts +30 -18
- package/test/README.md +4 -4
- package/dist/ServerProvider-DDRwHiPz.cjs.js +0 -1
- package/dist/components/legacy/Dashboard.d.ts +0 -68
- package/dist/components/legacy/malloynb/MalloynbCells.d.ts +0 -13
- package/dist/components/legacy/malloynb/Notebook.d.ts +0 -15
- package/dist/components/legacy/queryKeys.d.ts +0 -8
- package/src/components/legacy/Dashboard.spec.tsx +0 -242
- package/src/components/legacy/Dashboard.tsx +0 -181
- package/src/components/legacy/malloynb/MalloynbCells.tsx +0 -88
- package/src/components/legacy/malloynb/Notebook.layout.spec.tsx +0 -103
- package/src/components/legacy/malloynb/Notebook.served.spec.tsx +0 -84
- package/src/components/legacy/malloynb/Notebook.spec.tsx +0 -223
- package/src/components/legacy/malloynb/Notebook.tsx +0 -46
- package/src/components/legacy/queryKeys.ts +0 -26
- /package/dist/components/{legacy → Report}/malloynb/NotebookCell.d.ts +0 -0
- /package/dist/components/{legacy → Report}/malloynb/runPlan.d.ts +0 -0
- /package/dist/components/{legacy → Report}/malloynb/types.d.ts +0 -0
- /package/src/components/{legacy → Report}/malloynb/NotebookCell.tsx +0 -0
- /package/src/components/{legacy → Report}/malloynb/cellKind.spec.ts +0 -0
- /package/src/components/{legacy → Report}/malloynb/runPlan.spec.ts +0 -0
- /package/src/components/{legacy → Report}/malloynb/runPlan.ts +0 -0
- /package/src/components/{legacy → Report}/malloynb/types.ts +0 -0
|
@@ -14,15 +14,13 @@ import type * as Malloy from "@malloydata/malloy-interfaces";
|
|
|
14
14
|
* whatever the tile was written as: `source -> view`, a refined view, a
|
|
15
15
|
* named query, an inline query, a nest.
|
|
16
16
|
*
|
|
17
|
-
* `where:` and not `drill:`,
|
|
18
|
-
*
|
|
19
|
-
* plain source field with none (`region`, not `by_month.region`), so its
|
|
20
|
-
* could not be named that way.
|
|
21
|
-
*
|
|
22
|
-
*
|
|
23
|
-
*
|
|
24
|
-
* reaches Publisher, the join is no longer a reason; the refined query's
|
|
25
|
-
* missing view path still is.
|
|
17
|
+
* `where:` and not `drill:`, because `drill:` needs the view's own path for
|
|
18
|
+
* every dimension, and a refined view, or a query with no view at all, reports
|
|
19
|
+
* a plain source field with none (`region`, not `by_month.region`), so its
|
|
20
|
+
* rows could not be named that way. Measured on Malloy 0.0.438, for a refined
|
|
21
|
+
* view written inline and as a named query. A `drill:` on a joined field no
|
|
22
|
+
* longer fails to bring the join in (malloydata/malloy#3158, fixed in
|
|
23
|
+
* 0.0.437), so that is not a reason.
|
|
26
24
|
*
|
|
27
25
|
* A field reads as having rows only when every piece is there: a source with
|
|
28
26
|
* no arguments, every level on the way down marked `drillable` (one stage),
|
|
@@ -1,11 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Deprecated surface kept for hosts that still use it: the by-name
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
* code imports nothing from here; removing a feature is deleting its module
|
|
6
|
-
* and its line below.
|
|
2
|
+
* Deprecated surface kept for hosts that still use it: the by-name lookups
|
|
3
|
+
* behind old links, and the kind-typed vocabulary. Report code imports nothing
|
|
4
|
+
* from here; removing a feature is deleting its module and its line below.
|
|
7
5
|
*/
|
|
8
|
-
export { Dashboard, type DashboardProps } from './Dashboard';
|
|
9
|
-
export { default as Notebook } from './malloynb/Notebook';
|
|
10
6
|
export { type DocumentKind } from './kindAdapter';
|
|
11
7
|
export { documentRoute, legacyAliasOf, locateDocument, locateReportByName, type NameLookup, } from './nameAlias';
|
|
@@ -1,9 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* The model page a server asks for, its `PUBLISHER_MODEL_PAGE
|
|
3
|
-
*
|
|
4
|
-
* (`escapeString` in `@malloydata/malloy-interfaces` is a TODO), so a drilled
|
|
5
|
-
* value holding a double quote rewrites its query; `viewer` shows a page that
|
|
6
|
-
* builds none.
|
|
2
|
+
* The model page a server asks for, its `PUBLISHER_MODEL_PAGE`: `explorer`
|
|
3
|
+
* builds queries, `viewer` shows a page that builds none.
|
|
7
4
|
*/
|
|
8
5
|
export type ModelPage = "explorer" | "viewer";
|
|
9
6
|
/**
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Given,
|
|
1
|
+
import { Given, ReportCells } from '../client';
|
|
2
2
|
/**
|
|
3
3
|
* Extracts the deduplicated list of model-level `given:` declarations from
|
|
4
4
|
* a notebook's sources. The server attaches the same model-level givens to
|
|
@@ -7,4 +7,4 @@ import { Given, RawNotebook } from '../client';
|
|
|
7
7
|
*
|
|
8
8
|
* Returns an empty array when no givens are declared on any source.
|
|
9
9
|
*/
|
|
10
|
-
export declare function useModelGivens(notebook:
|
|
10
|
+
export declare function useModelGivens(notebook: ReportCells | undefined): Given[];
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { QueryKey, UseQueryResult } from '@tanstack/react-query';
|
|
2
|
+
import { ApiClients } from '../components/ServerProvider';
|
|
2
3
|
import { AxiosResponse } from 'axios';
|
|
3
4
|
import { QueryResult } from '../client';
|
|
4
5
|
import { ApiError } from '../components/ApiErrorDisplay';
|
|
@@ -35,6 +36,12 @@ export interface QueryRequestSpec {
|
|
|
35
36
|
export declare function queryResultKey(spec: QueryRequestSpec): QueryKey;
|
|
36
37
|
/** Every cached result of one model, for invalidating after the model is saved. */
|
|
37
38
|
export declare function modelResultsKey(spec: Pick<QueryRequestSpec, "environmentName" | "packageName" | "versionId" | "modelPath">): QueryKey;
|
|
39
|
+
/**
|
|
40
|
+
* The request for `spec`, cancelled by `signal`: what {@link useQueryResult}
|
|
41
|
+
* sends for a tile and a `.malloynb` sends for a cell, so a result cached
|
|
42
|
+
* under {@link queryResultKey} is the same answer whichever of them asked.
|
|
43
|
+
*/
|
|
44
|
+
export declare function requestQueryResult(apiClients: ApiClients, spec: QueryRequestSpec, signal?: AbortSignal): Promise< AxiosResponse<QueryResult, any, {}, any>>;
|
|
38
45
|
export declare function useQueryResult(spec: QueryRequestSpec, { enabled }?: {
|
|
39
46
|
enabled?: boolean;
|
|
40
47
|
}): UseQueryResult<AxiosResponse<QueryResult, any, {}, any>, ApiError>;
|