@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.
Files changed (87) hide show
  1. package/README.md +32 -50
  2. package/dist/{RenderedResult-BcEDcw0V.es.js → RenderedResult-CYJ2Y9Fm.es.js} +24 -24
  3. package/dist/{RenderedResult-uT2oc6ke.cjs.js → RenderedResult-hRvgFMAF.cjs.js} +1 -1
  4. package/dist/ServerProvider-DeVejmVr.cjs.js +1 -0
  5. package/dist/{ServerProvider-vmEUjlEu.es.js → ServerProvider-DzzfVDg_.es.js} +1314 -1712
  6. package/dist/builder/index.cjs.js +12 -12
  7. package/dist/builder/index.es.js +4 -9
  8. package/dist/client/api.d.ts +63 -506
  9. package/dist/client/configuration.d.ts +1 -1
  10. package/dist/client/index.cjs.js +1 -1
  11. package/dist/client/index.d.ts +1 -1
  12. package/dist/client/index.es.js +132 -144
  13. package/dist/components/Dashboard/DashboardGrid.d.ts +1 -1
  14. package/dist/components/Model/ExplorerPage.d.ts +1 -3
  15. package/dist/components/Model/Model.d.ts +1 -4
  16. package/dist/components/Model/ModelExplorer.d.ts +1 -2
  17. package/dist/components/Package/reportQueries.d.ts +2 -4
  18. package/dist/components/Report/Report.d.ts +20 -9
  19. package/dist/components/{legacy → Report}/malloynb/CellRunnerView.d.ts +13 -16
  20. package/dist/components/Report/malloynb/MalloynbReport.d.ts +11 -0
  21. package/dist/components/{legacy → Report}/malloynb/cellKind.d.ts +1 -1
  22. package/dist/components/ServerProvider.d.ts +1 -3
  23. package/dist/components/drill/drillClauses.d.ts +8 -9
  24. package/dist/components/drill/rowsTarget.d.ts +7 -9
  25. package/dist/components/legacy/index.d.ts +3 -7
  26. package/dist/components/modelPage.d.ts +2 -5
  27. package/dist/hooks/useModelGivens.d.ts +2 -2
  28. package/dist/hooks/useQueryResult.d.ts +7 -0
  29. package/dist/index.cjs.js +33 -33
  30. package/dist/index.es.js +8799 -8903
  31. package/dist/{useCompiledDocument-h5-Kc1Zh.cjs.js → useCompiledDocument-BCr-xB_i.cjs.js} +4 -4
  32. package/dist/{useCompiledDocument-rOwDSK_s.es.js → useCompiledDocument-E0tU5KzP.es.js} +266 -277
  33. package/package.json +1 -1
  34. package/src/components/Dashboard/DashboardGrid.tsx +1 -1
  35. package/src/components/Dashboard/DashboardTile.spec.tsx +1 -1
  36. package/src/components/Model/ExplorerPage.tsx +1 -3
  37. package/src/components/Model/Model.tsx +1 -4
  38. package/src/components/Model/ModelExplorer.tsx +1 -2
  39. package/src/components/Package/Package.tsx +1 -5
  40. package/src/components/Package/reportQueries.ts +3 -15
  41. package/src/components/Report/Report.malloynb.spec.tsx +230 -0
  42. package/src/components/Report/Report.spec.tsx +429 -38
  43. package/src/components/Report/Report.telemetry.spec.tsx +51 -10
  44. package/src/components/Report/Report.tsx +63 -44
  45. package/src/components/{legacy → Report}/malloynb/CellRunnerView.spec.tsx +11 -44
  46. package/src/components/{legacy → Report}/malloynb/CellRunnerView.tsx +63 -107
  47. package/src/components/Report/malloynb/MalloynbReport.tsx +110 -0
  48. package/src/components/{legacy → Report}/malloynb/cellKind.ts +5 -4
  49. package/src/components/ReportBuilder/EditorSurface.tsx +3 -3
  50. package/src/components/ReportBuilder/ReportBuilder.spec.tsx +2 -2
  51. package/src/components/ReportBuilder/ReportEditor.notebook.spec.tsx +0 -4
  52. package/src/components/ReportBuilder/ReportEditor.queryVersion.spec.tsx +0 -1
  53. package/src/components/ReportBuilder/ReportEditor.resourceUri.spec.tsx +3 -3
  54. package/src/components/ReportBuilder/ReportEditor.tsx +1 -1
  55. package/src/components/ReportBuilder/loadMalloy.ts +1 -4
  56. package/src/components/ReportBuilder/useSaveChannel.ts +1 -6
  57. package/src/components/ServerProvider.tsx +0 -4
  58. package/src/components/drill/drillClauses.ts +8 -9
  59. package/src/components/drill/rowsTarget.ts +7 -9
  60. package/src/components/index.ts +2 -3
  61. package/src/components/legacy/index.ts +3 -7
  62. package/src/components/modelPage.ts +2 -5
  63. package/src/hooks/useGivensState.ts +8 -8
  64. package/src/hooks/useModelGivens.ts +2 -2
  65. package/src/hooks/useQueryResult.ts +30 -18
  66. package/test/README.md +4 -4
  67. package/dist/ServerProvider-DDRwHiPz.cjs.js +0 -1
  68. package/dist/components/legacy/Dashboard.d.ts +0 -68
  69. package/dist/components/legacy/malloynb/MalloynbCells.d.ts +0 -13
  70. package/dist/components/legacy/malloynb/Notebook.d.ts +0 -15
  71. package/dist/components/legacy/queryKeys.d.ts +0 -8
  72. package/src/components/legacy/Dashboard.spec.tsx +0 -242
  73. package/src/components/legacy/Dashboard.tsx +0 -181
  74. package/src/components/legacy/malloynb/MalloynbCells.tsx +0 -88
  75. package/src/components/legacy/malloynb/Notebook.layout.spec.tsx +0 -103
  76. package/src/components/legacy/malloynb/Notebook.served.spec.tsx +0 -84
  77. package/src/components/legacy/malloynb/Notebook.spec.tsx +0 -223
  78. package/src/components/legacy/malloynb/Notebook.tsx +0 -46
  79. package/src/components/legacy/queryKeys.ts +0 -26
  80. /package/dist/components/{legacy → Report}/malloynb/NotebookCell.d.ts +0 -0
  81. /package/dist/components/{legacy → Report}/malloynb/runPlan.d.ts +0 -0
  82. /package/dist/components/{legacy → Report}/malloynb/types.d.ts +0 -0
  83. /package/src/components/{legacy → Report}/malloynb/NotebookCell.tsx +0 -0
  84. /package/src/components/{legacy → Report}/malloynb/cellKind.spec.ts +0 -0
  85. /package/src/components/{legacy → Report}/malloynb/runPlan.spec.ts +0 -0
  86. /package/src/components/{legacy → Report}/malloynb/runPlan.ts +0 -0
  87. /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:`, measured on Malloy 0.0.435. `drill:` needs the
18
- * view's own path for every dimension, and a refined or named query reports a
19
- * plain source field with none (`region`, not `by_month.region`), so its rows
20
- * could not be named that way. And a `drill:` on a joined field
21
- * (`by_name.name`, grouped as `customers.name`) does not bring the join in,
22
- * so its query failed with `Referenced table … not found`; the same filter as
23
- * `where:` does (malloydata/malloy#3158). Once a Malloy release with that fix
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 wrappers
3
- * over the deprecated `…/dashboards*` and `…/notebooks*` routes, the
4
- * by-name lookups behind old links, and the kind-typed vocabulary. Report
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`. The Explorer
3
- * writes the queries it builds back to Malloy text with string values unescaped
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, RawNotebook } from '../client';
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: RawNotebook | undefined): Given[];
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>;