@malloy-publisher/sdk 0.8.0 → 0.8.1
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/{DocumentStorage-BypSIWDg.es.js → DocumentStorage-BCpTBa7U.es.js} +2 -2
- package/dist/{RenderedResult-CYyhQekT.es.js → RenderedResult-CDA9mN_6.es.js} +2 -2
- package/dist/{ServerProvider-AsUiy22k.es.js → ServerProvider-CvMqBhuj.es.js} +20 -20
- package/dist/builder/index.cjs.js +31 -31
- package/dist/builder/index.es.js +1167 -1142
- package/dist/client/api.d.ts +26 -26
- package/dist/client/index.es.js +1 -1
- package/dist/components/DashboardBuilder/catalog.d.ts +18 -0
- package/dist/index.es.js +5 -5
- package/package.json +1 -1
- package/src/components/DashboardBuilder/DashboardEditor.resourceUri.spec.tsx +6 -1
- package/src/components/DashboardBuilder/DashboardEditor.spec.tsx +60 -30
- package/src/components/DashboardBuilder/DashboardEditor.tsx +35 -16
- package/src/components/DashboardBuilder/catalog.spec.ts +44 -0
- package/src/components/DashboardBuilder/catalog.ts +36 -0
package/dist/client/api.d.ts
CHANGED
|
@@ -567,7 +567,7 @@ export interface CompiledModel {
|
|
|
567
567
|
*/
|
|
568
568
|
'givens'?: Array<Given>;
|
|
569
569
|
/**
|
|
570
|
-
* The model file\'s Malloy text, verbatim, so a client can show the code beside the compiled view of the same file without a second, differently-shaped fetch. Named `sourceText`, not `source`, because `sources` on this same object are the model\'s Malloy sources. Optional
|
|
570
|
+
* The model file\'s Malloy text, verbatim, so a client can show the code beside the compiled view of the same file without a second, differently-shaped fetch. Named `sourceText`, not `source`, because `sources` on this same object are the model\'s Malloy sources. Optional: absent from servers that predate it; omitted (with a server-side warning) when the file cannot be read, so a compiled model is never withheld for want of its text; and omitted when the file text names a source it does not publish, on a package with a surface. A dashboard\'s text is always returned.
|
|
571
571
|
* @type {string}
|
|
572
572
|
* @memberof CompiledModel
|
|
573
573
|
*/
|
|
@@ -2157,7 +2157,7 @@ export interface NotebookCell {
|
|
|
2157
2157
|
*/
|
|
2158
2158
|
'newSources'?: Array<string>;
|
|
2159
2159
|
/**
|
|
2160
|
-
* JSON string containing QueryInfo object for the query in this cell (if the cell contains a query)
|
|
2160
|
+
* JSON string containing QueryInfo object for the query in this cell (if the cell contains a query). On a package with a surface, left out for a cell whose query reads a source the notebook may not read.
|
|
2161
2161
|
* @type {string}
|
|
2162
2162
|
* @memberof NotebookCell
|
|
2163
2163
|
*/
|
|
@@ -2241,7 +2241,7 @@ export interface Package {
|
|
|
2241
2241
|
*/
|
|
2242
2242
|
'scope'?: PackageScopeEnum;
|
|
2243
2243
|
/**
|
|
2244
|
-
* The package\'s discovery surface and query boundary: model file paths relative to the package root. Only these models are listed via `listModels()`, and
|
|
2244
|
+
* The package\'s discovery surface and query boundary: model file paths relative to the package root. Only these models are listed via `listModels()`, and the surface is the union of their `export {}` closures. Every other .malloy file still compiles for import/join resolution but is hidden. Notebooks and dashboards are always listed regardless of this field, and a dashboard entry needs no listing: a tagged dashboard listed here reads the surface and adds nothing to it. An untagged file under `dashboards/` that is listed is an ordinary surface file. DEPRECATED, still honored. Every non-empty value gets a load warning naming the replacement: a root `index.malloy` that imports the listed files and exports what they publish. `[]` is deprecated too: beside an `index.malloy` it stops that file from limiting what the package publishes (the fix is to rename `index.malloy` and delete this key), and without one it does nothing. A value that is not a list of strings refuses the package load (424). This value MAY have been derived by the server from a root `index.malloy` rather than written by the package author, and the response does not distinguish the two — deliberately, because nothing downstream treats them differently. An explicit key always wins over `index.malloy`. A package is uncurated only when it has neither this key nor a root `index.malloy`.
|
|
2245
2245
|
* @type {Array<string>}
|
|
2246
2246
|
* @memberof Package
|
|
2247
2247
|
*/
|
|
@@ -2253,13 +2253,13 @@ export interface Package {
|
|
|
2253
2253
|
*/
|
|
2254
2254
|
'exploresWarnings'?: Array<string>;
|
|
2255
2255
|
/**
|
|
2256
|
-
* Non-fatal findings collected when the package loaded, none of which stop the model compiling or the package loading. Render-tag findings: a render annotation (e.g. `# big_value`, `# currency` or `# colspan`) the renderer cannot apply as written, either malformed for the field it sits on, so it renders as \"[object Object]\" or an inline error at query time, or inert where it sits and silently ignored. Materialization findings: a `storage=` source not served from storage, a `#@ persist` source that was not recognized as materializable, a `#@ persist` REFUSED by the compile-time eligibility gate (one entry per `BuildPlan.refusedSources` member, carrying that gate\'s own message), a persist-target collision, and materialization-config problems that degrade attribution. A refusal is the one materialization finding the build plan cannot also be read for: a refused `storage`/`colocated` source is ABSENT from `BuildPlan.sources`, so nothing there records that the annotation was written at all. Discovery findings: a model on the package\'s surface whose export closure surfaces no sources or named queries, so it lists as empty and renders a blank page; a surface whose every model failed to compile, so every model in the package answers 404 by name; and, on the reload that caused it, a package that had a surface and now has none, so every source that surface
|
|
2256
|
+
* Non-fatal findings collected when the package loaded, none of which stop the model compiling or the package loading. Render-tag findings: a render annotation (e.g. `# big_value`, `# currency` or `# colspan`) the renderer cannot apply as written, either malformed for the field it sits on, so it renders as \"[object Object]\" or an inline error at query time, or inert where it sits and silently ignored. Materialization findings: a `storage=` source not served from storage, a `#@ persist` source that was not recognized as materializable, a `#@ persist` REFUSED by the compile-time eligibility gate (one entry per `BuildPlan.refusedSources` member, carrying that gate\'s own message), a persist-target collision, and materialization-config problems that degrade attribution. A refusal is the one materialization finding the build plan cannot also be read for: a refused `storage`/`colocated` source is ABSENT from `BuildPlan.sources`, so nothing there records that the annotation was written at all. Discovery findings: a model on the package\'s surface whose export closure surfaces no sources or named queries, so it lists as empty and renders a blank page; a surface whose every model failed to compile, so every model in the package answers 404 by name; and, on the reload that caused it, a package that had a surface and now has none, so every source that surface hid is listed and queryable by name again. Manifest findings: each deprecated use of `explores` or of `queryableSources: \"declared\"`, and a root file such as `Index.malloy` that differs from `index.malloy` only in case and so is ignored. A root `index.malloy` with no manifest keys gets no warning. Dashboard findings: a `dashboards/` file whose `# artifact` tag does not parse or does not describe a dashboard, a tile or suggest query that does not resolve, a `# drill` naming a destination that is not a dashboard, and a tile, single query or filter suggest that reads a source the surface does not export, so it won\'t load. Two dashboard findings are about Publisher rather than about the package: one when a file carrying an artifact tag could not be read and so is not served at all, and one when the lint stops early, in which case the list must be read as incomplete rather than as a clean package. Server-computed and read-only: ignored on create/update requests and only returned in responses. Present only when there are such findings. **Almost every `#@ preaggregate` that cannot be honored REJECTS A PUBLISH — a 400 at publish or PATCH — and fails a load thereafter.** The two access-modifier violations are the exception: they warn at BOTH gates and appear in this array. See the split below. Rejected are a `#@ preaggregate` anywhere but on a measure; a `#@ preaggregate` with no `grain=`; a grain naming anything but a dimension the base source itself declares, which rules out an inline time truncation such as `order_time.day`; a measure that cannot be correctly re-aggregated to a coarser grain, whether because its aggregate has no exact merge function (`count(distinct)`, `median`, percentiles, `mode`, and `avg` until it is decomposed) or because it carries its own filter, an ungrouping (`all`, `exclude`), or a required group-by; a measure whose expression cannot be POSITIVELY classified as re-aggregatable, which fails closed rather than being guessed at; a base source with a FAN-OUT join (`join_many` or `join_cross`), which can multiply rows, while a `join_one` is permitted and a measure aggregating through one is served normally; a base source that already fails persist eligibility (unbound parameters, `given` references, authorize gates); `sharing=` or `schedule=` at the resource level; and a synthesized rollup name that collides with an existing model object. WARNED rather than rejected, at publish and at load alike, is a `#@ preaggregate` on a measure the source does not publicly expose, or a grain naming a hidden dimension — a rollup STORES its grain and each measure\'s partial, and the stored table is served under the base\'s name without the source\'s field visibility applying to it. Each names the measure and the fix. Refusing rather than silently dropping the measure is the deliberate choice. A dropped measure is not served from the rollup at ANY grain, so the declaration would have no effect whatsoever while still reading as applied — and the build cost of the rollup would still be paid. An author who writes `#@ preaggregate` on a measure that cannot be rolled up has made a modeling mistake, and an error is where a mistake belongs. The same verdict is enforced at LOAD for every violation EXCEPT the two access-modifier ones, so a package whose declarations stopped being honorable does not load at all: it is absent from its environment and reported in `ServerStatus.loadErrors`. Worth knowing because whether a measure can be re-aggregated is derived from the compiled model, so a Malloy version change can in principle reclassify a measure that published cleanly long before. That surfaces as a package that stops loading rather than as a package quietly serving without its rollups — louder, and deliberately so, since the alternative is paying for rollups that answer nothing. The two access-modifier violations are the deliberate exception, and for two reasons rather than a lesser severity. They WARN at publish and at load alike and appear in this array. First, a package annotating a hidden field published and loaded before this rule existed — refusing it would stop an already-published package from doing either because a new validation was added, which is not a thing a server upgrade may do. Second, the refusal was unfollowable: an annotation INHERITED onto a source that then hides the measure raises it, while that source produces no plan at all and nothing is exposed, so the advice to make the field public or drop the annotation asks an author to give up either the hiding or the rollup over a model that was already safe. Warning is safe here and would not be for the others: what keeps a hidden field out of a rollup is that the planner refuses to plan one at all, so no table is built and nothing can be served whether or not anyone reads the message. For the other violations the refusal IS the enforcement, which is why they stay fatal.
|
|
2257
2257
|
* @type {Array<PackageWarningsInner>}
|
|
2258
2258
|
* @memberof Package
|
|
2259
2259
|
*/
|
|
2260
2260
|
'warnings'?: Array<PackageWarningsInner>;
|
|
2261
2261
|
/**
|
|
2262
|
-
* Controls whether the discovery surface is also a query boundary. `\"declared\"` (the default) makes queryable == discoverable: when
|
|
2262
|
+
* Controls whether the discovery surface is also a query boundary. `\"declared\"` (the default) makes queryable == discoverable: when the package has a surface (a root `index.malloy`, or `explores`), only the surface\'s model files are valid query entry points, and the queryable sources are the union of those files\' `export {}` closures — so a source exported by any listed file stays queryable whichever listed model path the request addresses it through. Admission is by declaration, not by name: a request clears only when the model it names resolves the name to the very source a listed file exported, so a same-named source declared in a hidden file is not admitted by the coincidence. Every other source still compiles, imports, joins, and extends but is not directly queryable (denied with 404). The `/compile` endpoint is exempt (compile is the authoring loop; the boundary is discovery curation, not access control — for confidentiality use `#(authorize)`, which gates compile too). A source that is both hidden and authorize-gated still answers `/compile` with the generic 404, so the exemption cannot be used to enumerate gated names. `\"all\"` decouples the axes: the surface gates discovery only, every compiled source stays directly queryable, and model files off the surface are returned by path. The two modes are equivalent (everything queryable) only where there is no curated surface at all, which means no `explores` AND no root `index.malloy` — a package with that file has a surface whether or not the key is present. Invalid values fall back to `\"declared\"`. Identity-based access is a separate concern — see `#(authorize)` and `#(access_filter)`. `\"declared\"` is DEPRECATED: it is already the default, so the key changes nothing, and writing it gets a load warning saying to delete it. `\"all\"` is supported, with no warning, and works beside a root `index.malloy`. It is the one way to hide an `#(authorize)`-gated source from listings while authorized callers can still query it by name.
|
|
2263
2263
|
* @type {string}
|
|
2264
2264
|
* @memberof Package
|
|
2265
2265
|
* @deprecated
|
|
@@ -2470,7 +2470,7 @@ export interface PackageWarningsInner {
|
|
|
2470
2470
|
*/
|
|
2471
2471
|
'message'?: string;
|
|
2472
2472
|
/**
|
|
2473
|
-
* Finding severity. Render-tag findings use both: `error` for a tag malformed for the field it sits on, which renders as \"[object Object]\" or an inline error at query time, and `warn` for one that is well-formed but inert where it sits and so is silently ignored (e.g. `# colspan` outside `# dashboard { columns=N }`), where nothing looks broken at query time and the layout simply is not what was written. Those are the only two severities the renderer emits, so no render finding is withheld. Materialization and dashboard findings use both: `error` for something that cannot work as written, such as a tile naming a view the source does not have, and `warn` for something that works but not as the author probably intended, such as a dashboard
|
|
2473
|
+
* Finding severity. Render-tag findings use both: `error` for a tag malformed for the field it sits on, which renders as \"[object Object]\" or an inline error at query time, and `warn` for one that is well-formed but inert where it sits and so is silently ignored (e.g. `# colspan` outside `# dashboard { columns=N }`), where nothing looks broken at query time and the layout simply is not what was written. Those are the only two severities the renderer emits, so no render finding is withheld. Materialization and dashboard findings use both: `error` for something that cannot work as written, such as a tile naming a view the source does not have, and `warn` for something that works but not as the author probably intended, such as a dashboard name outside the conventional shape. The two findings about Publisher rather than about the package split across both: a file that carries an artifact tag and could not be read is `error`, because the dashboard it should have produced does not exist, and a lint that stopped early is `warn`, because the lint failing is not itself a defect in the package. That `warn` does NOT mean the package is free of `error`-severity findings, since the ones the lint never reached are exactly what it cannot report.
|
|
2474
2474
|
* @type {string}
|
|
2475
2475
|
* @memberof PackageWarningsInner
|
|
2476
2476
|
*/
|
|
@@ -4859,14 +4859,14 @@ export declare const DashboardsApiAxiosParamCreator: (configuration?: Configurat
|
|
|
4859
4859
|
* @summary Get a dashboard manifest
|
|
4860
4860
|
* @param {string} environmentName Name of the environment
|
|
4861
4861
|
* @param {string} packageName Name of the package
|
|
4862
|
-
* @param {string} dashboardName The dashboard\'s name: its filename basename. Conventionally letters, digits, \"-\" and \"_\", and a package is warned when one of its
|
|
4862
|
+
* @param {string} dashboardName The dashboard\'s name: its filename basename. Conventionally letters, digits, \"-\" and \"_\", and a package is warned when one of its dashboards falls outside that. It is NOT constrained to it, because the name comes from a filename rather than being chosen: a file such as `dashboards/v1.2.malloy` is served, and its published `resource` carries the name percent-encoded. Send it percent-encoded.
|
|
4863
4863
|
* @param {string} [versionId] Version identifier for the package
|
|
4864
4864
|
* @param {*} [options] Override http request option.
|
|
4865
4865
|
* @throws {RequiredError}
|
|
4866
4866
|
*/
|
|
4867
4867
|
getDashboard: (environmentName: string, packageName: string, dashboardName: string, versionId?: string, options?: RawAxiosRequestConfig) => Promise<RequestArgs>;
|
|
4868
4868
|
/**
|
|
4869
|
-
* Lists the dashboards in the specified package — every `.malloy` file in the package\'s `dashboards/` directory that carries an `# artifact` (or model-level `## artifact`) annotation. A file in that directory with no artifact tag is a shared include and is not listed, whether or not it compiles. A tagged dashboard that failed to compile is listed carrying its `error` where that state can arise at all, so a broken dashboard is visibly broken rather than silently absent. In practice it rarely does: a package whose model fails to compile is not loaded, and a reload that would break one is refused and leaves the previously loaded package serving, so `error` is only reachable on the paths that keep per-model placeholders. Treat it as present-but-uncommon rather than the normal way a broken dashboard surfaces.
|
|
4869
|
+
* Lists the dashboards in the specified package — every `.malloy` file in the package\'s `dashboards/` directory that carries an `# artifact` (or model-level `## artifact`) annotation. A file in that directory with no artifact tag is a shared include and is not listed, whether or not it compiles. A tagged dashboard that failed to compile is listed carrying its `error` where that state can arise at all, so a broken dashboard is visibly broken rather than silently absent. In practice it rarely does: a package whose model fails to compile is not loaded, and a reload that would break one is refused and leaves the previously loaded package serving, so `error` is only reachable on the paths that keep per-model placeholders. Treat it as present-but-uncommon rather than the normal way a broken dashboard surfaces. Every tagged dashboard is listed, whatever the package\'s surface. To hide one, remove its `# artifact` tag. On a package with a surface (a root `index.malloy`, or a legacy `explores`) with `queryableSources` left at `\"declared\"`, a dashboard\'s tiles, its single query and its filter `suggest` queries may read only sources the surface exports. A source the dashboard declares on top of a surface source may be read; one over a hidden source may not. The dashboard file\'s own `export {}` and named queries add nothing to the surface. A tile over a hidden source answers 404 when it runs, and the package\'s `warnings` report each such tile, single query and suggest, with severity `error`, as of the last load, naming the source and the fix. Under `\"all\"` nothing is refused, so the situation does not arise.
|
|
4870
4870
|
* @summary List package dashboards
|
|
4871
4871
|
* @param {string} environmentName Name of the environment
|
|
4872
4872
|
* @param {string} packageName Name of the package
|
|
@@ -4886,14 +4886,14 @@ export declare const DashboardsApiFp: (configuration?: Configuration) => {
|
|
|
4886
4886
|
* @summary Get a dashboard manifest
|
|
4887
4887
|
* @param {string} environmentName Name of the environment
|
|
4888
4888
|
* @param {string} packageName Name of the package
|
|
4889
|
-
* @param {string} dashboardName The dashboard\'s name: its filename basename. Conventionally letters, digits, \"-\" and \"_\", and a package is warned when one of its
|
|
4889
|
+
* @param {string} dashboardName The dashboard\'s name: its filename basename. Conventionally letters, digits, \"-\" and \"_\", and a package is warned when one of its dashboards falls outside that. It is NOT constrained to it, because the name comes from a filename rather than being chosen: a file such as `dashboards/v1.2.malloy` is served, and its published `resource` carries the name percent-encoded. Send it percent-encoded.
|
|
4890
4890
|
* @param {string} [versionId] Version identifier for the package
|
|
4891
4891
|
* @param {*} [options] Override http request option.
|
|
4892
4892
|
* @throws {RequiredError}
|
|
4893
4893
|
*/
|
|
4894
4894
|
getDashboard(environmentName: string, packageName: string, dashboardName: string, versionId?: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<DashboardManifest>>;
|
|
4895
4895
|
/**
|
|
4896
|
-
* Lists the dashboards in the specified package — every `.malloy` file in the package\'s `dashboards/` directory that carries an `# artifact` (or model-level `## artifact`) annotation. A file in that directory with no artifact tag is a shared include and is not listed, whether or not it compiles. A tagged dashboard that failed to compile is listed carrying its `error` where that state can arise at all, so a broken dashboard is visibly broken rather than silently absent. In practice it rarely does: a package whose model fails to compile is not loaded, and a reload that would break one is refused and leaves the previously loaded package serving, so `error` is only reachable on the paths that keep per-model placeholders. Treat it as present-but-uncommon rather than the normal way a broken dashboard surfaces.
|
|
4896
|
+
* Lists the dashboards in the specified package — every `.malloy` file in the package\'s `dashboards/` directory that carries an `# artifact` (or model-level `## artifact`) annotation. A file in that directory with no artifact tag is a shared include and is not listed, whether or not it compiles. A tagged dashboard that failed to compile is listed carrying its `error` where that state can arise at all, so a broken dashboard is visibly broken rather than silently absent. In practice it rarely does: a package whose model fails to compile is not loaded, and a reload that would break one is refused and leaves the previously loaded package serving, so `error` is only reachable on the paths that keep per-model placeholders. Treat it as present-but-uncommon rather than the normal way a broken dashboard surfaces. Every tagged dashboard is listed, whatever the package\'s surface. To hide one, remove its `# artifact` tag. On a package with a surface (a root `index.malloy`, or a legacy `explores`) with `queryableSources` left at `\"declared\"`, a dashboard\'s tiles, its single query and its filter `suggest` queries may read only sources the surface exports. A source the dashboard declares on top of a surface source may be read; one over a hidden source may not. The dashboard file\'s own `export {}` and named queries add nothing to the surface. A tile over a hidden source answers 404 when it runs, and the package\'s `warnings` report each such tile, single query and suggest, with severity `error`, as of the last load, naming the source and the fix. Under `\"all\"` nothing is refused, so the situation does not arise.
|
|
4897
4897
|
* @summary List package dashboards
|
|
4898
4898
|
* @param {string} environmentName Name of the environment
|
|
4899
4899
|
* @param {string} packageName Name of the package
|
|
@@ -4913,14 +4913,14 @@ export declare const DashboardsApiFactory: (configuration?: Configuration, baseP
|
|
|
4913
4913
|
* @summary Get a dashboard manifest
|
|
4914
4914
|
* @param {string} environmentName Name of the environment
|
|
4915
4915
|
* @param {string} packageName Name of the package
|
|
4916
|
-
* @param {string} dashboardName The dashboard\'s name: its filename basename. Conventionally letters, digits, \"-\" and \"_\", and a package is warned when one of its
|
|
4916
|
+
* @param {string} dashboardName The dashboard\'s name: its filename basename. Conventionally letters, digits, \"-\" and \"_\", and a package is warned when one of its dashboards falls outside that. It is NOT constrained to it, because the name comes from a filename rather than being chosen: a file such as `dashboards/v1.2.malloy` is served, and its published `resource` carries the name percent-encoded. Send it percent-encoded.
|
|
4917
4917
|
* @param {string} [versionId] Version identifier for the package
|
|
4918
4918
|
* @param {*} [options] Override http request option.
|
|
4919
4919
|
* @throws {RequiredError}
|
|
4920
4920
|
*/
|
|
4921
4921
|
getDashboard(environmentName: string, packageName: string, dashboardName: string, versionId?: string, options?: RawAxiosRequestConfig): AxiosPromise<DashboardManifest>;
|
|
4922
4922
|
/**
|
|
4923
|
-
* Lists the dashboards in the specified package — every `.malloy` file in the package\'s `dashboards/` directory that carries an `# artifact` (or model-level `## artifact`) annotation. A file in that directory with no artifact tag is a shared include and is not listed, whether or not it compiles. A tagged dashboard that failed to compile is listed carrying its `error` where that state can arise at all, so a broken dashboard is visibly broken rather than silently absent. In practice it rarely does: a package whose model fails to compile is not loaded, and a reload that would break one is refused and leaves the previously loaded package serving, so `error` is only reachable on the paths that keep per-model placeholders. Treat it as present-but-uncommon rather than the normal way a broken dashboard surfaces.
|
|
4923
|
+
* Lists the dashboards in the specified package — every `.malloy` file in the package\'s `dashboards/` directory that carries an `# artifact` (or model-level `## artifact`) annotation. A file in that directory with no artifact tag is a shared include and is not listed, whether or not it compiles. A tagged dashboard that failed to compile is listed carrying its `error` where that state can arise at all, so a broken dashboard is visibly broken rather than silently absent. In practice it rarely does: a package whose model fails to compile is not loaded, and a reload that would break one is refused and leaves the previously loaded package serving, so `error` is only reachable on the paths that keep per-model placeholders. Treat it as present-but-uncommon rather than the normal way a broken dashboard surfaces. Every tagged dashboard is listed, whatever the package\'s surface. To hide one, remove its `# artifact` tag. On a package with a surface (a root `index.malloy`, or a legacy `explores`) with `queryableSources` left at `\"declared\"`, a dashboard\'s tiles, its single query and its filter `suggest` queries may read only sources the surface exports. A source the dashboard declares on top of a surface source may be read; one over a hidden source may not. The dashboard file\'s own `export {}` and named queries add nothing to the surface. A tile over a hidden source answers 404 when it runs, and the package\'s `warnings` report each such tile, single query and suggest, with severity `error`, as of the last load, naming the source and the fix. Under `\"all\"` nothing is refused, so the situation does not arise.
|
|
4924
4924
|
* @summary List package dashboards
|
|
4925
4925
|
* @param {string} environmentName Name of the environment
|
|
4926
4926
|
* @param {string} packageName Name of the package
|
|
@@ -4942,7 +4942,7 @@ export declare class DashboardsApi extends BaseAPI {
|
|
|
4942
4942
|
* @summary Get a dashboard manifest
|
|
4943
4943
|
* @param {string} environmentName Name of the environment
|
|
4944
4944
|
* @param {string} packageName Name of the package
|
|
4945
|
-
* @param {string} dashboardName The dashboard\'s name: its filename basename. Conventionally letters, digits, \"-\" and \"_\", and a package is warned when one of its
|
|
4945
|
+
* @param {string} dashboardName The dashboard\'s name: its filename basename. Conventionally letters, digits, \"-\" and \"_\", and a package is warned when one of its dashboards falls outside that. It is NOT constrained to it, because the name comes from a filename rather than being chosen: a file such as `dashboards/v1.2.malloy` is served, and its published `resource` carries the name percent-encoded. Send it percent-encoded.
|
|
4946
4946
|
* @param {string} [versionId] Version identifier for the package
|
|
4947
4947
|
* @param {*} [options] Override http request option.
|
|
4948
4948
|
* @throws {RequiredError}
|
|
@@ -4950,7 +4950,7 @@ export declare class DashboardsApi extends BaseAPI {
|
|
|
4950
4950
|
*/
|
|
4951
4951
|
getDashboard(environmentName: string, packageName: string, dashboardName: string, versionId?: string, options?: RawAxiosRequestConfig): Promise< AxiosResponse<DashboardManifest, any, {}>>;
|
|
4952
4952
|
/**
|
|
4953
|
-
* Lists the dashboards in the specified package — every `.malloy` file in the package\'s `dashboards/` directory that carries an `# artifact` (or model-level `## artifact`) annotation. A file in that directory with no artifact tag is a shared include and is not listed, whether or not it compiles. A tagged dashboard that failed to compile is listed carrying its `error` where that state can arise at all, so a broken dashboard is visibly broken rather than silently absent. In practice it rarely does: a package whose model fails to compile is not loaded, and a reload that would break one is refused and leaves the previously loaded package serving, so `error` is only reachable on the paths that keep per-model placeholders. Treat it as present-but-uncommon rather than the normal way a broken dashboard surfaces.
|
|
4953
|
+
* Lists the dashboards in the specified package — every `.malloy` file in the package\'s `dashboards/` directory that carries an `# artifact` (or model-level `## artifact`) annotation. A file in that directory with no artifact tag is a shared include and is not listed, whether or not it compiles. A tagged dashboard that failed to compile is listed carrying its `error` where that state can arise at all, so a broken dashboard is visibly broken rather than silently absent. In practice it rarely does: a package whose model fails to compile is not loaded, and a reload that would break one is refused and leaves the previously loaded package serving, so `error` is only reachable on the paths that keep per-model placeholders. Treat it as present-but-uncommon rather than the normal way a broken dashboard surfaces. Every tagged dashboard is listed, whatever the package\'s surface. To hide one, remove its `# artifact` tag. On a package with a surface (a root `index.malloy`, or a legacy `explores`) with `queryableSources` left at `\"declared\"`, a dashboard\'s tiles, its single query and its filter `suggest` queries may read only sources the surface exports. A source the dashboard declares on top of a surface source may be read; one over a hidden source may not. The dashboard file\'s own `export {}` and named queries add nothing to the surface. A tile over a hidden source answers 404 when it runs, and the package\'s `warnings` report each such tile, single query and suggest, with severity `error`, as of the last load, naming the source and the fix. Under `\"all\"` nothing is refused, so the situation does not arise.
|
|
4954
4954
|
* @summary List package dashboards
|
|
4955
4955
|
* @param {string} environmentName Name of the environment
|
|
4956
4956
|
* @param {string} packageName Name of the package
|
|
@@ -5564,7 +5564,7 @@ export declare const ModelsApiAxiosParamCreator: (configuration?: Configuration)
|
|
|
5564
5564
|
*/
|
|
5565
5565
|
executeQueryModel: (environmentName: string, packageName: string, path: string, queryRequest: QueryRequest, options?: RawAxiosRequestConfig) => Promise<RequestArgs>;
|
|
5566
5566
|
/**
|
|
5567
|
-
* Retrieves a compiled Malloy model with its source information, queries, and metadata. The model is compiled using the specified version of the Malloy compiler. This endpoint provides access to the model\'s structure, sources, and named queries for use in applications.
|
|
5567
|
+
* Retrieves a compiled Malloy model with its source information, queries, and metadata. The model is compiled using the specified version of the Malloy compiler. This endpoint provides access to the model\'s structure, sources, and named queries for use in applications. On a package with a surface (a root `index.malloy`, or a legacy `explores`), a file off that surface answers 404 with the same message a query to it gets. Dashboard files are always returned. A package with no surface, or with `queryableSources: \"all\"`, returns every file. For a file it returns, `modelDef.contents` and `modelDef.exports`, `modelInfo`, `sources` and `sourceInfos` are limited to the names the file publishes, so the surface file does not carry the hidden sources it imports. A join to a hidden source keeps only its name and the names and types of its fields. `sourceText` is left out when the text names a source the file does not publish; a dashboard\'s text is always returned.
|
|
5568
5568
|
* @summary Get compiled Malloy model
|
|
5569
5569
|
* @param {string} environmentName Name of the environment
|
|
5570
5570
|
* @param {string} packageName Name of the package
|
|
@@ -5625,7 +5625,7 @@ export declare const ModelsApiFp: (configuration?: Configuration) => {
|
|
|
5625
5625
|
*/
|
|
5626
5626
|
executeQueryModel(environmentName: string, packageName: string, path: string, queryRequest: QueryRequest, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<QueryResult>>;
|
|
5627
5627
|
/**
|
|
5628
|
-
* Retrieves a compiled Malloy model with its source information, queries, and metadata. The model is compiled using the specified version of the Malloy compiler. This endpoint provides access to the model\'s structure, sources, and named queries for use in applications.
|
|
5628
|
+
* Retrieves a compiled Malloy model with its source information, queries, and metadata. The model is compiled using the specified version of the Malloy compiler. This endpoint provides access to the model\'s structure, sources, and named queries for use in applications. On a package with a surface (a root `index.malloy`, or a legacy `explores`), a file off that surface answers 404 with the same message a query to it gets. Dashboard files are always returned. A package with no surface, or with `queryableSources: \"all\"`, returns every file. For a file it returns, `modelDef.contents` and `modelDef.exports`, `modelInfo`, `sources` and `sourceInfos` are limited to the names the file publishes, so the surface file does not carry the hidden sources it imports. A join to a hidden source keeps only its name and the names and types of its fields. `sourceText` is left out when the text names a source the file does not publish; a dashboard\'s text is always returned.
|
|
5629
5629
|
* @summary Get compiled Malloy model
|
|
5630
5630
|
* @param {string} environmentName Name of the environment
|
|
5631
5631
|
* @param {string} packageName Name of the package
|
|
@@ -5686,7 +5686,7 @@ export declare const ModelsApiFactory: (configuration?: Configuration, basePath?
|
|
|
5686
5686
|
*/
|
|
5687
5687
|
executeQueryModel(environmentName: string, packageName: string, path: string, queryRequest: QueryRequest, options?: RawAxiosRequestConfig): AxiosPromise<QueryResult>;
|
|
5688
5688
|
/**
|
|
5689
|
-
* Retrieves a compiled Malloy model with its source information, queries, and metadata. The model is compiled using the specified version of the Malloy compiler. This endpoint provides access to the model\'s structure, sources, and named queries for use in applications.
|
|
5689
|
+
* Retrieves a compiled Malloy model with its source information, queries, and metadata. The model is compiled using the specified version of the Malloy compiler. This endpoint provides access to the model\'s structure, sources, and named queries for use in applications. On a package with a surface (a root `index.malloy`, or a legacy `explores`), a file off that surface answers 404 with the same message a query to it gets. Dashboard files are always returned. A package with no surface, or with `queryableSources: \"all\"`, returns every file. For a file it returns, `modelDef.contents` and `modelDef.exports`, `modelInfo`, `sources` and `sourceInfos` are limited to the names the file publishes, so the surface file does not carry the hidden sources it imports. A join to a hidden source keeps only its name and the names and types of its fields. `sourceText` is left out when the text names a source the file does not publish; a dashboard\'s text is always returned.
|
|
5690
5690
|
* @summary Get compiled Malloy model
|
|
5691
5691
|
* @param {string} environmentName Name of the environment
|
|
5692
5692
|
* @param {string} packageName Name of the package
|
|
@@ -5751,7 +5751,7 @@ export declare class ModelsApi extends BaseAPI {
|
|
|
5751
5751
|
*/
|
|
5752
5752
|
executeQueryModel(environmentName: string, packageName: string, path: string, queryRequest: QueryRequest, options?: RawAxiosRequestConfig): Promise< AxiosResponse<QueryResult, any, {}>>;
|
|
5753
5753
|
/**
|
|
5754
|
-
* Retrieves a compiled Malloy model with its source information, queries, and metadata. The model is compiled using the specified version of the Malloy compiler. This endpoint provides access to the model\'s structure, sources, and named queries for use in applications.
|
|
5754
|
+
* Retrieves a compiled Malloy model with its source information, queries, and metadata. The model is compiled using the specified version of the Malloy compiler. This endpoint provides access to the model\'s structure, sources, and named queries for use in applications. On a package with a surface (a root `index.malloy`, or a legacy `explores`), a file off that surface answers 404 with the same message a query to it gets. Dashboard files are always returned. A package with no surface, or with `queryableSources: \"all\"`, returns every file. For a file it returns, `modelDef.contents` and `modelDef.exports`, `modelInfo`, `sources` and `sourceInfos` are limited to the names the file publishes, so the surface file does not carry the hidden sources it imports. A join to a hidden source keeps only its name and the names and types of its fields. `sourceText` is left out when the text names a source the file does not publish; a dashboard\'s text is always returned.
|
|
5755
5755
|
* @summary Get compiled Malloy model
|
|
5756
5756
|
* @param {string} environmentName Name of the environment
|
|
5757
5757
|
* @param {string} packageName Name of the package
|
|
@@ -5793,7 +5793,7 @@ export declare class ModelsApi extends BaseAPI {
|
|
|
5793
5793
|
*/
|
|
5794
5794
|
export declare const NotebooksApiAxiosParamCreator: (configuration?: Configuration) => {
|
|
5795
5795
|
/**
|
|
5796
|
-
* Executes a specific cell in a Malloy notebook by index. For code cells, this compiles and runs the Malloy code, returning query results and any new sources defined. For markdown cells, this simply returns the cell content.
|
|
5796
|
+
* Executes a specific cell in a Malloy notebook by index. For code cells, this compiles and runs the Malloy code, returning query results and any new sources defined. For markdown cells, this simply returns the cell content. On a package with a surface (a root `index.malloy`, or a legacy `explores`) with `queryableSources` left at `\"declared\"`, a code cell may read only sources the surface exports. A cell over a hidden source answers 404, and 404 rather than 403 even when the source is also `#(authorize)`-gated. A source an earlier cell declares on top of a published source still works. A cell\'s own source over a raw table (`duckdb.table(...)` or `.sql(...)`) has no published source under it, so it is refused. The response shows only the sources the notebook may read.
|
|
5797
5797
|
* @summary Execute a specific notebook cell
|
|
5798
5798
|
* @param {string} environmentName Name of the environment
|
|
5799
5799
|
* @param {string} packageName Name of the package
|
|
@@ -5808,7 +5808,7 @@ export declare const NotebooksApiAxiosParamCreator: (configuration?: Configurati
|
|
|
5808
5808
|
*/
|
|
5809
5809
|
executeNotebookCell: (environmentName: string, packageName: string, path: string, cellIndex: number, versionId?: string, filterParams?: string, bypassFilters?: ExecuteNotebookCellBypassFiltersEnum, givens?: string, options?: RawAxiosRequestConfig) => Promise<RequestArgs>;
|
|
5810
5810
|
/**
|
|
5811
|
-
* Retrieves a Malloy notebook with its raw cell contents (markdown and code). Cell execution should be done separately via the execute-notebook-cell endpoint.
|
|
5811
|
+
* Retrieves a Malloy notebook with its raw cell contents (markdown and code). Cell execution should be done separately via the execute-notebook-cell endpoint. On a package with a surface, the response shows only the sources the notebook may read.
|
|
5812
5812
|
* @summary Get Malloy notebook cells
|
|
5813
5813
|
* @param {string} environmentName Name of the environment
|
|
5814
5814
|
* @param {string} packageName Name of the package
|
|
@@ -5835,7 +5835,7 @@ export declare const NotebooksApiAxiosParamCreator: (configuration?: Configurati
|
|
|
5835
5835
|
*/
|
|
5836
5836
|
export declare const NotebooksApiFp: (configuration?: Configuration) => {
|
|
5837
5837
|
/**
|
|
5838
|
-
* Executes a specific cell in a Malloy notebook by index. For code cells, this compiles and runs the Malloy code, returning query results and any new sources defined. For markdown cells, this simply returns the cell content.
|
|
5838
|
+
* Executes a specific cell in a Malloy notebook by index. For code cells, this compiles and runs the Malloy code, returning query results and any new sources defined. For markdown cells, this simply returns the cell content. On a package with a surface (a root `index.malloy`, or a legacy `explores`) with `queryableSources` left at `\"declared\"`, a code cell may read only sources the surface exports. A cell over a hidden source answers 404, and 404 rather than 403 even when the source is also `#(authorize)`-gated. A source an earlier cell declares on top of a published source still works. A cell\'s own source over a raw table (`duckdb.table(...)` or `.sql(...)`) has no published source under it, so it is refused. The response shows only the sources the notebook may read.
|
|
5839
5839
|
* @summary Execute a specific notebook cell
|
|
5840
5840
|
* @param {string} environmentName Name of the environment
|
|
5841
5841
|
* @param {string} packageName Name of the package
|
|
@@ -5850,7 +5850,7 @@ export declare const NotebooksApiFp: (configuration?: Configuration) => {
|
|
|
5850
5850
|
*/
|
|
5851
5851
|
executeNotebookCell(environmentName: string, packageName: string, path: string, cellIndex: number, versionId?: string, filterParams?: string, bypassFilters?: ExecuteNotebookCellBypassFiltersEnum, givens?: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<NotebookCellResult>>;
|
|
5852
5852
|
/**
|
|
5853
|
-
* Retrieves a Malloy notebook with its raw cell contents (markdown and code). Cell execution should be done separately via the execute-notebook-cell endpoint.
|
|
5853
|
+
* Retrieves a Malloy notebook with its raw cell contents (markdown and code). Cell execution should be done separately via the execute-notebook-cell endpoint. On a package with a surface, the response shows only the sources the notebook may read.
|
|
5854
5854
|
* @summary Get Malloy notebook cells
|
|
5855
5855
|
* @param {string} environmentName Name of the environment
|
|
5856
5856
|
* @param {string} packageName Name of the package
|
|
@@ -5877,7 +5877,7 @@ export declare const NotebooksApiFp: (configuration?: Configuration) => {
|
|
|
5877
5877
|
*/
|
|
5878
5878
|
export declare const NotebooksApiFactory: (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) => {
|
|
5879
5879
|
/**
|
|
5880
|
-
* Executes a specific cell in a Malloy notebook by index. For code cells, this compiles and runs the Malloy code, returning query results and any new sources defined. For markdown cells, this simply returns the cell content.
|
|
5880
|
+
* Executes a specific cell in a Malloy notebook by index. For code cells, this compiles and runs the Malloy code, returning query results and any new sources defined. For markdown cells, this simply returns the cell content. On a package with a surface (a root `index.malloy`, or a legacy `explores`) with `queryableSources` left at `\"declared\"`, a code cell may read only sources the surface exports. A cell over a hidden source answers 404, and 404 rather than 403 even when the source is also `#(authorize)`-gated. A source an earlier cell declares on top of a published source still works. A cell\'s own source over a raw table (`duckdb.table(...)` or `.sql(...)`) has no published source under it, so it is refused. The response shows only the sources the notebook may read.
|
|
5881
5881
|
* @summary Execute a specific notebook cell
|
|
5882
5882
|
* @param {string} environmentName Name of the environment
|
|
5883
5883
|
* @param {string} packageName Name of the package
|
|
@@ -5892,7 +5892,7 @@ export declare const NotebooksApiFactory: (configuration?: Configuration, basePa
|
|
|
5892
5892
|
*/
|
|
5893
5893
|
executeNotebookCell(environmentName: string, packageName: string, path: string, cellIndex: number, versionId?: string, filterParams?: string, bypassFilters?: ExecuteNotebookCellBypassFiltersEnum, givens?: string, options?: RawAxiosRequestConfig): AxiosPromise<NotebookCellResult>;
|
|
5894
5894
|
/**
|
|
5895
|
-
* Retrieves a Malloy notebook with its raw cell contents (markdown and code). Cell execution should be done separately via the execute-notebook-cell endpoint.
|
|
5895
|
+
* Retrieves a Malloy notebook with its raw cell contents (markdown and code). Cell execution should be done separately via the execute-notebook-cell endpoint. On a package with a surface, the response shows only the sources the notebook may read.
|
|
5896
5896
|
* @summary Get Malloy notebook cells
|
|
5897
5897
|
* @param {string} environmentName Name of the environment
|
|
5898
5898
|
* @param {string} packageName Name of the package
|
|
@@ -5921,7 +5921,7 @@ export declare const NotebooksApiFactory: (configuration?: Configuration, basePa
|
|
|
5921
5921
|
*/
|
|
5922
5922
|
export declare class NotebooksApi extends BaseAPI {
|
|
5923
5923
|
/**
|
|
5924
|
-
* Executes a specific cell in a Malloy notebook by index. For code cells, this compiles and runs the Malloy code, returning query results and any new sources defined. For markdown cells, this simply returns the cell content.
|
|
5924
|
+
* Executes a specific cell in a Malloy notebook by index. For code cells, this compiles and runs the Malloy code, returning query results and any new sources defined. For markdown cells, this simply returns the cell content. On a package with a surface (a root `index.malloy`, or a legacy `explores`) with `queryableSources` left at `\"declared\"`, a code cell may read only sources the surface exports. A cell over a hidden source answers 404, and 404 rather than 403 even when the source is also `#(authorize)`-gated. A source an earlier cell declares on top of a published source still works. A cell\'s own source over a raw table (`duckdb.table(...)` or `.sql(...)`) has no published source under it, so it is refused. The response shows only the sources the notebook may read.
|
|
5925
5925
|
* @summary Execute a specific notebook cell
|
|
5926
5926
|
* @param {string} environmentName Name of the environment
|
|
5927
5927
|
* @param {string} packageName Name of the package
|
|
@@ -5937,7 +5937,7 @@ export declare class NotebooksApi extends BaseAPI {
|
|
|
5937
5937
|
*/
|
|
5938
5938
|
executeNotebookCell(environmentName: string, packageName: string, path: string, cellIndex: number, versionId?: string, filterParams?: string, bypassFilters?: ExecuteNotebookCellBypassFiltersEnum, givens?: string, options?: RawAxiosRequestConfig): Promise< AxiosResponse<NotebookCellResult, any, {}>>;
|
|
5939
5939
|
/**
|
|
5940
|
-
* Retrieves a Malloy notebook with its raw cell contents (markdown and code). Cell execution should be done separately via the execute-notebook-cell endpoint.
|
|
5940
|
+
* Retrieves a Malloy notebook with its raw cell contents (markdown and code). Cell execution should be done separately via the execute-notebook-cell endpoint. On a package with a surface, the response shows only the sources the notebook may read.
|
|
5941
5941
|
* @summary Get Malloy notebook cells
|
|
5942
5942
|
* @param {string} environmentName Name of the environment
|
|
5943
5943
|
* @param {string} packageName Name of the package
|
package/dist/client/index.es.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { A as e, a as i, C as o, b as n, c as t, aC as r, e as p, f as u, d as A, O as m, I as c, K as E, J as l, X as C, U as y, W as P, V as F, $ as b, Y as g, _ as d, Z as S, D as k, a3 as M, a0 as h, a2 as x, a1 as v, h as D, a7 as T, a4 as R, a6 as f, a5 as z, ab as N, a8 as Q, aa as W, a9 as B, ap as O, F as I, i as L, G as q, L as w, j, k as G, M as H, l as J, ag as K, m as U, af as V, ac as X, ae as Y, ad as Z, ak as _, ah as $, aj as aa, ai as sa, n as ea, N as ia, ao as oa, al as na, an as ta, am as ra, q as pa, p as ua, o as Aa, P as ma, r as ca, s as Ea, at as la, aq as Ca, as as ya, ar as Pa, t as Fa, v as ba, ax as ga, au as da, aw as Sa, av as ka, Q as Ma, w as ha, x as xa, R as va, z as Da, y as Ta, B as Ra, E as fa, S as za, H as Na, T as Qa, aB as Wa, ay as Ba, aA as Oa, az as Ia, g as La, u as qa } from "../ServerProvider-
|
|
1
|
+
import { A as e, a as i, C as o, b as n, c as t, aC as r, e as p, f as u, d as A, O as m, I as c, K as E, J as l, X as C, U as y, W as P, V as F, $ as b, Y as g, _ as d, Z as S, D as k, a3 as M, a0 as h, a2 as x, a1 as v, h as D, a7 as T, a4 as R, a6 as f, a5 as z, ab as N, a8 as Q, aa as W, a9 as B, ap as O, F as I, i as L, G as q, L as w, j, k as G, M as H, l as J, ag as K, m as U, af as V, ac as X, ae as Y, ad as Z, ak as _, ah as $, aj as aa, ai as sa, n as ea, N as ia, ao as oa, al as na, an as ta, am as ra, q as pa, p as ua, o as Aa, P as ma, r as ca, s as Ea, at as la, aq as Ca, as as ya, ar as Pa, t as Fa, v as ba, ax as ga, au as da, aw as Sa, av as ka, Q as Ma, w as ha, x as xa, R as va, z as Da, y as Ta, B as Ra, E as fa, S as za, H as Na, T as Qa, aB as Wa, ay as Ba, aA as Oa, az as Ia, g as La, u as qa } from "../ServerProvider-CvMqBhuj.es.js";
|
|
2
2
|
export {
|
|
3
3
|
e as AttachedDatabaseTypeEnum,
|
|
4
4
|
i as AzureConnectionAuthTypeEnum,
|
|
@@ -60,3 +60,21 @@ export declare function filterableFields(catalog: PackageCatalog | undefined, so
|
|
|
60
60
|
*/
|
|
61
61
|
export declare const isDashboardModel: (path: string | undefined) => boolean;
|
|
62
62
|
export declare function buildCatalog(models: CompiledModel[]): PackageCatalog;
|
|
63
|
+
/**
|
|
64
|
+
* The part of the package catalog a dashboard file can actually use.
|
|
65
|
+
*
|
|
66
|
+
* The builder never writes an import, so a source the file cannot see would
|
|
67
|
+
* produce a tile that does not compile. A named import says exactly which
|
|
68
|
+
* names it brings. A whole-file import of a published model brings that
|
|
69
|
+
* model's sources. A whole-file import of a file off the surface cannot be
|
|
70
|
+
* read, so then every published source is offered and a wrong pick is caught
|
|
71
|
+
* by the compile check the editor already runs.
|
|
72
|
+
*/
|
|
73
|
+
export declare function visibleToDashboard(catalog: PackageCatalog, imports: ReadonlyArray<{
|
|
74
|
+
kind: "all";
|
|
75
|
+
path: string;
|
|
76
|
+
} | {
|
|
77
|
+
kind: "names";
|
|
78
|
+
names: string[];
|
|
79
|
+
path: string;
|
|
80
|
+
}>, published: CompiledModel[]): PackageCatalog;
|
package/dist/index.es.js
CHANGED
|
@@ -2,14 +2,14 @@ import { jsx as r, jsxs as T, Fragment as se } from "react/jsx-runtime";
|
|
|
2
2
|
import { Link as nc, Box as ne, Typography as X, Stack as Oe, Tooltip as Ot, IconButton as ut, TextField as Nt, Button as dt, Grid as ln, Paper as sa, FormControlLabel as Is, Switch as $s, Divider as un, List as Ns, ListItemButton as Fs, ListItemText as Lt, TableContainer as rc, Table as Bn, TableHead as jn, TableRow as bt, TableCell as le, TableBody as Zn, Snackbar as kr, Menu as Yn, MenuItem as Ft, ListItemIcon as hn, Container as ka, FormGroup as ac, Dialog as oa, DialogTitle as la, Chip as ic, DialogContent as ca, Alert as yr, CircularProgress as sc, LinearProgress as oc } from "@mui/material";
|
|
3
3
|
import * as pe from "react";
|
|
4
4
|
import be, { useMemo as Qe, useRef as ot, useCallback as gt, useState as G, useEffect as Re, useId as lc } from "react";
|
|
5
|
-
import { e as Ne, q as xe, p as De, L as vt, P as ua, S as Gn, v as et, E as cc, F as da, H as Hi, I as As, J as uc, K as Zr, M as Pt, N as wt, O as Rt, Q as Ze, R as At, U as qt, V as dc, W as Bt, X as Vi, Y as hc, Z as ct, _ as fc, $ as ht, a0 as xt, a1 as Xn, g as Le, a2 as mc, a3 as pc, a4 as yc, a5 as gr, a6 as ge, a7 as Ui, a8 as gc, a9 as _s, aa as Sa, ab as de, A as Ls, ac as Ps, ad as $e, ae as Sr, af as Ct, ag as Bi, ah as ji, ai as Zi, aj as Yi, ak as bc, al as Gi, am as Xi, an as Yr, ao as vc, ap as _t, aq as wc, ar as kc, as as ha, at as Sc, au as Rs, av as Cc, aw as Ki, ax as xc, ay as Tc, C as Mc, az as qs, aA as Oc, aB as Ws, aC as Hn, aD as zs, aE as Dc, aF as Ec, aG as Ic, aH as Hs, aI as $c, aJ as Nc, w as Fc, aK as Ac, B as _c, aL as Lc, u as Pc, aM as Rc } from "./DocumentStorage-
|
|
6
|
-
import { aO as If, aN as $f, f as Nf, x as Ff, a$ as Af, aV as _f, aX as Lf, aW as Pf, y as Rf, T as qf, h as Wf, a_ as zf, b as Hf, d as Vf, aP as Uf, aQ as Bf, aR as jf, aS as Zf, aY as Yf, s as Gf, m as Xf, b3 as Kf, a as Jf, aT as Qf, aZ as em, r as tm, b0 as nm, aU as rm, b1 as am, b2 as im } from "./DocumentStorage-
|
|
7
|
-
import { u as Se, aG as je, d as Ji, A as Vs, aH as Ca, m as Pe, P as hr, ag as qc, aE as Us, aI as Rn, aJ as Wc, aK as zc, aL as an } from "./ServerProvider-
|
|
8
|
-
import { aM as om, S as lm, aO as cm, aN as um, aF as dm } from "./ServerProvider-
|
|
5
|
+
import { e as Ne, q as xe, p as De, L as vt, P as ua, S as Gn, v as et, E as cc, F as da, H as Hi, I as As, J as uc, K as Zr, M as Pt, N as wt, O as Rt, Q as Ze, R as At, U as qt, V as dc, W as Bt, X as Vi, Y as hc, Z as ct, _ as fc, $ as ht, a0 as xt, a1 as Xn, g as Le, a2 as mc, a3 as pc, a4 as yc, a5 as gr, a6 as ge, a7 as Ui, a8 as gc, a9 as _s, aa as Sa, ab as de, A as Ls, ac as Ps, ad as $e, ae as Sr, af as Ct, ag as Bi, ah as ji, ai as Zi, aj as Yi, ak as bc, al as Gi, am as Xi, an as Yr, ao as vc, ap as _t, aq as wc, ar as kc, as as ha, at as Sc, au as Rs, av as Cc, aw as Ki, ax as xc, ay as Tc, C as Mc, az as qs, aA as Oc, aB as Ws, aC as Hn, aD as zs, aE as Dc, aF as Ec, aG as Ic, aH as Hs, aI as $c, aJ as Nc, w as Fc, aK as Ac, B as _c, aL as Lc, u as Pc, aM as Rc } from "./DocumentStorage-BCpTBa7U.es.js";
|
|
6
|
+
import { aO as If, aN as $f, f as Nf, x as Ff, a$ as Af, aV as _f, aX as Lf, aW as Pf, y as Rf, T as qf, h as Wf, a_ as zf, b as Hf, d as Vf, aP as Uf, aQ as Bf, aR as jf, aS as Zf, aY as Yf, s as Gf, m as Xf, b3 as Kf, a as Jf, aT as Qf, aZ as em, r as tm, b0 as nm, aU as rm, b1 as am, b2 as im } from "./DocumentStorage-BCpTBa7U.es.js";
|
|
7
|
+
import { u as Se, aG as je, d as Ji, A as Vs, aH as Ca, m as Pe, P as hr, ag as qc, aE as Us, aI as Rn, aJ as Wc, aK as zc, aL as an } from "./ServerProvider-CvMqBhuj.es.js";
|
|
8
|
+
import { aM as om, S as lm, aO as cm, aN as um, aF as dm } from "./ServerProvider-CvMqBhuj.es.js";
|
|
9
9
|
import { useQueryClient as Cr } from "@tanstack/react-query";
|
|
10
10
|
import { createBox as Hc, createStack as Vc } from "@mui/system";
|
|
11
11
|
import { Delete as xr, Edit as xa, MoreVert as Tr } from "@mui/icons-material";
|
|
12
|
-
import { D as fm, R as mm, b as pm, a as ym, d as gm, m as bm, r as vm } from "./RenderedResult-
|
|
12
|
+
import { D as fm, R as mm, b as pm, a as ym, d as gm, m as bm, r as vm } from "./RenderedResult-CDA9mN_6.es.js";
|
|
13
13
|
import { useNavigate as Bs, useSearchParams as Uc, useLocation as Bc } from "react-router-dom";
|
|
14
14
|
const jc = Ne(/* @__PURE__ */ r("path", {
|
|
15
15
|
d: "M20 11H7.83l5.59-5.59L12 4l-8 8 8 8 1.41-1.41L7.83 13H20z"
|
package/package.json
CHANGED
|
@@ -63,6 +63,9 @@ const getDashboard = mock(
|
|
|
63
63
|
data: { path: "dashboards/overview.malloy", givens: [], tiles: [] },
|
|
64
64
|
}),
|
|
65
65
|
);
|
|
66
|
+
const listModels = mock((_env: string, _pkg: string, _versionId?: string) =>
|
|
67
|
+
Promise.resolve({ data: [{ path: "data_app.malloy" }] }),
|
|
68
|
+
);
|
|
66
69
|
const listDashboards = mock((_env: string, _pkg: string, _versionId?: string) =>
|
|
67
70
|
Promise.resolve({ data: [{ name: "overview" }] }),
|
|
68
71
|
);
|
|
@@ -94,7 +97,7 @@ const executeQueryModel = mock(
|
|
|
94
97
|
const serverContext = { mutable: false };
|
|
95
98
|
mockServerProvider(
|
|
96
99
|
{
|
|
97
|
-
models: { getModel, executeQueryModel, updateModelSource },
|
|
100
|
+
models: { getModel, executeQueryModel, updateModelSource, listModels },
|
|
98
101
|
dashboards: { getDashboard, listDashboards },
|
|
99
102
|
},
|
|
100
103
|
serverContext,
|
|
@@ -137,6 +140,7 @@ beforeEach(() => {
|
|
|
137
140
|
getModel.mockClear();
|
|
138
141
|
getDashboard.mockClear();
|
|
139
142
|
listDashboards.mockClear();
|
|
143
|
+
listModels.mockClear();
|
|
140
144
|
updateModelSource.mockClear();
|
|
141
145
|
// Uncleared, a tile query from an earlier test carries into the next one's
|
|
142
146
|
// assertions, where it looks like the component under test made it.
|
|
@@ -200,6 +204,7 @@ describe("versionId", () => {
|
|
|
200
204
|
"v7",
|
|
201
205
|
]);
|
|
202
206
|
expect(listDashboards.mock.calls[0]).toEqual(["env", "pkg", "v7"]);
|
|
207
|
+
expect(listModels.mock.calls[0]).toEqual(["env", "pkg", "v7"]);
|
|
203
208
|
|
|
204
209
|
// The key too, appended last, never spliced in the middle of it: a
|
|
205
210
|
// version in the wrong slot is a key that cannot tell two versions of
|
|
@@ -28,34 +28,39 @@ source: a is scoped_orders extend {
|
|
|
28
28
|
}`;
|
|
29
29
|
|
|
30
30
|
const getModel = mock((_env: string, _pkg: string, path: string) =>
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
modelPath: path,
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
31
|
+
path === "broken.malloy"
|
|
32
|
+
? Promise.reject(new Error("reloading"))
|
|
33
|
+
: Promise.resolve({
|
|
34
|
+
data:
|
|
35
|
+
path === "dashboards/overview.malloy"
|
|
36
|
+
? { modelPath: path, sourceText: PACKAGE_FILE }
|
|
37
|
+
: {
|
|
38
|
+
modelPath: path,
|
|
39
|
+
sources: [
|
|
40
|
+
{
|
|
41
|
+
name: "scoped_orders",
|
|
42
|
+
views: [
|
|
43
|
+
{ name: "by_category" },
|
|
44
|
+
{ name: "by_brand" },
|
|
45
|
+
],
|
|
46
|
+
},
|
|
47
|
+
],
|
|
48
|
+
sourceInfos: [
|
|
49
|
+
JSON.stringify({
|
|
50
|
+
name: "scoped_orders",
|
|
51
|
+
schema: {
|
|
52
|
+
fields: [
|
|
53
|
+
{
|
|
54
|
+
name: "cat",
|
|
55
|
+
kind: "dimension",
|
|
56
|
+
type: { kind: "string_type" },
|
|
57
|
+
},
|
|
58
|
+
],
|
|
59
|
+
},
|
|
60
|
+
}),
|
|
61
|
+
],
|
|
62
|
+
},
|
|
63
|
+
}),
|
|
59
64
|
);
|
|
60
65
|
const getDashboard = mock(() =>
|
|
61
66
|
Promise.resolve({
|
|
@@ -66,8 +71,13 @@ const listDashboards = mock(() =>
|
|
|
66
71
|
Promise.resolve({ data: [{ name: "overview" }, { name: "regions" }] }),
|
|
67
72
|
);
|
|
68
73
|
const executeQueryModel = mock(() => pending());
|
|
74
|
+
// What the package publishes: the catalog is built from these, not from
|
|
75
|
+
// whatever file the dashboard imports.
|
|
76
|
+
const listModels = mock(() =>
|
|
77
|
+
Promise.resolve({ data: [{ path: "data_app.malloy" }] }),
|
|
78
|
+
);
|
|
69
79
|
mockServerProvider({
|
|
70
|
-
models: { getModel, executeQueryModel },
|
|
80
|
+
models: { getModel, executeQueryModel, listModels },
|
|
71
81
|
dashboards: { getDashboard, listDashboards },
|
|
72
82
|
});
|
|
73
83
|
|
|
@@ -113,7 +123,11 @@ describe("DashboardEditor", () => {
|
|
|
113
123
|
mount();
|
|
114
124
|
expect(await screen.findByText("Storefront")).toBeDefined();
|
|
115
125
|
expect(screen.getByLabelText("Tile by_cat")).toBeDefined();
|
|
116
|
-
// The catalog came from the
|
|
126
|
+
// The catalog came from the published models, and the file's import of
|
|
127
|
+
// scoped_orders is what keeps it on offer.
|
|
128
|
+
await waitFor(() =>
|
|
129
|
+
expect(listModels.mock.calls.length).toBeGreaterThan(0),
|
|
130
|
+
);
|
|
117
131
|
await waitFor(() =>
|
|
118
132
|
expect(
|
|
119
133
|
getModel.mock.calls.some((call) => call[2] === "data_app.malloy"),
|
|
@@ -122,6 +136,22 @@ describe("DashboardEditor", () => {
|
|
|
122
136
|
await screen.findByRole("button", { name: "Add tile", hidden: true });
|
|
123
137
|
});
|
|
124
138
|
|
|
139
|
+
it("keeps the catalog when one published model fails to load", async () => {
|
|
140
|
+
listModels.mockImplementationOnce(() =>
|
|
141
|
+
Promise.resolve({
|
|
142
|
+
data: [{ path: "data_app.malloy" }, { path: "broken.malloy" }],
|
|
143
|
+
}),
|
|
144
|
+
);
|
|
145
|
+
mount();
|
|
146
|
+
await waitFor(() =>
|
|
147
|
+
expect(
|
|
148
|
+
getModel.mock.calls.some((call) => call[2] === "broken.malloy"),
|
|
149
|
+
).toBe(true),
|
|
150
|
+
);
|
|
151
|
+
// Adding a tile needs a catalog, so the button is the proof it built.
|
|
152
|
+
await screen.findByRole("button", { name: "Add tile", hidden: true });
|
|
153
|
+
});
|
|
154
|
+
|
|
125
155
|
it("saves an edit into the browser and marks it saved", async () => {
|
|
126
156
|
const storage = mount();
|
|
127
157
|
await screen.findByText("Storefront");
|