@malloy-publisher/server 0.9.7 → 0.9.8

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 (29) hide show
  1. package/dist/app/api-doc.yaml +727 -361
  2. package/dist/app/assets/EnvironmentPage-1dxk_vne.js +1 -0
  3. package/dist/app/assets/{HomePage-BM31X4Y8.js → HomePage-DOCeWyiv.js} +1 -1
  4. package/dist/app/assets/MainPage-Baqv8q6B.js +1 -0
  5. package/dist/app/assets/ModelPage-BuMKFY0Q.js +2 -0
  6. package/dist/app/assets/PackagePage-DMRAjKE6.js +1 -0
  7. package/dist/app/assets/{RenderedResult-CkUS04tl.es-CNz9JsEK.js → RenderedResult-DZj-FnOJ.es-8Pxk7Ln2.js} +2 -2
  8. package/dist/app/assets/{RouteError-DLJlCtRG.js → RouteError-CXf8Frkp.js} +1 -1
  9. package/dist/app/assets/{ThemeEditorPage-Ck4rJ1vv.js → ThemeEditorPage-BzjDFaw6.js} +1 -1
  10. package/dist/app/assets/ToggleButtonGroup-o0Gqmq5F.js +1 -0
  11. package/dist/app/assets/documentRoutes-B2MDvZ3y.js +1 -0
  12. package/dist/app/assets/{index-BcsfsLm3.js → index-Buv5Qzfs.js} +1 -1
  13. package/dist/app/assets/{index-D3HZqxOW.js → index-BuyzVBLU.js} +1 -1
  14. package/dist/app/assets/index-CDTd6FbM.js +483 -0
  15. package/dist/app/assets/{index-wawGd6k1.js → index-CvMqTqVr.js} +1 -1
  16. package/dist/app/assets/index.es-CECvOvgr.js +195 -0
  17. package/dist/app/index.html +1 -1
  18. package/dist/package_load_worker.mjs +15899 -17181
  19. package/dist/server.mjs +11292 -11153
  20. package/dist/sshcrypto-cqb52edz.node +0 -0
  21. package/package.json +1 -1
  22. package/dist/app/assets/EnvironmentPage-V6cQ_Kpr.js +0 -1
  23. package/dist/app/assets/MainPage-CQW3P4wB.js +0 -1
  24. package/dist/app/assets/ModelPage-dBHaHb6u.js +0 -2
  25. package/dist/app/assets/PackagePage-B-ruDCyR.js +0 -1
  26. package/dist/app/assets/ToggleButtonGroup-Bwj7gIJm.js +0 -1
  27. package/dist/app/assets/documentRoutes-DGm_-EUy.js +0 -1
  28. package/dist/app/assets/index-hnA8HjeH.js +0 -484
  29. package/dist/app/assets/index.es-B2kJpnhe.js +0 -195
@@ -65,12 +65,15 @@ tags:
65
65
  distribution
66
66
  - name: models
67
67
  description: Malloy model access and compilation operations
68
+ - name: reports
69
+ description:
70
+ Reports - any `.malloy` file in a package carrying an artifact tag,
71
+ wherever it lives, with a linear or grid layout - their listing,
72
+ manifests, and cells
68
73
  - name: notebooks
69
- description: Malloy notebook access and execution operations
74
+ description: Deprecated aliases for the linear reports. Use the `reports` routes.
70
75
  - name: dashboards
71
- description:
72
- Discovery and manifests for `# artifact` dashboards - layout, tiles, and
73
- the given specs behind their controls
76
+ description: Deprecated aliases for the grid reports. Use the `reports` routes.
74
77
  - name: data-apps
75
78
  description:
76
79
  In-package HTML data apps (static pages served from a package's public/
@@ -1635,11 +1638,10 @@ paths:
1635
1638
 
1636
1639
  On a package with a surface (a root `index.malloy`, or a legacy `explores`), only the
1637
1640
  files on that surface are listed, unless `includeHiddenFilesAndSources` is true. With it, every
1638
- model file is listed, and `isHidden` marks the ones the package hides. Dashboard files
1639
- are listed by the dashboards route either way. Served notebooks (a `.malloy` at the top of
1640
- `notebooks/` or `dashboards/` whose model-level `## artifact` tag says `kind=notebook`, or
1641
- names no `kind` and sits under `notebooks/`) are not models here, with or without a
1642
- surface; they are listed by list-notebooks.
1641
+ model file is listed, and `isHidden` marks the ones the package hides. Reports (any
1642
+ `.malloy` outside `public/` carrying an artifact tag, other than the root `index.malloy`;
1643
+ see list-reports) are listed by list-reports. A grid report is not a model here on a
1644
+ package with a surface; a linear report is not a model here with or without one.
1643
1645
  parameters:
1644
1646
  - name: environmentName
1645
1647
  in: path
@@ -1694,15 +1696,14 @@ paths:
1694
1696
  On a package with a surface (a root `index.malloy`, or a legacy `explores`), a file off
1695
1697
  that surface answers 404 with the same message a query to it gets, unless
1696
1698
  `includeHiddenFilesAndSources` is true. With it, the file is returned with its `sourceText`, whatever
1697
- sources the text names. Dashboard files and served notebooks (a `.malloy` at the top of
1698
- `notebooks/` or `dashboards/` whose model-level `## artifact` tag says `kind=notebook`, or
1699
- names no `kind` and sits under `notebooks/`) are always returned. A package with no surface, or with
1699
+ sources the text names. Reports (see list-reports), wherever they live in the package,
1700
+ are always returned. A package with no surface, or with
1700
1701
  `queryableSources: "all"`, returns every file. For a file it returns, `modelDef.contents` and `modelDef.exports`,
1701
1702
  `modelInfo`, `sources` and `sourceInfos` are limited to the names the file publishes, so
1702
1703
  the surface file does not carry the hidden sources it imports. A join to a hidden source
1703
1704
  keeps only its name and the names and types of its fields. `sourceText` is left out
1704
1705
  when the text names a source the file does not publish, unless
1705
- `includeHiddenFilesAndSources` is true; the text of a dashboard is always returned.
1706
+ `includeHiddenFilesAndSources` is true; the text of a report is always returned.
1706
1707
  parameters:
1707
1708
  - name: environmentName
1708
1709
  in: path
@@ -1750,15 +1751,29 @@ paths:
1750
1751
  tags:
1751
1752
  - models
1752
1753
  operationId: update-model-source
1753
- summary: Write a dashboard or notebook file into the package
1754
+ summary: Write a report file into the package
1754
1755
  description: |
1755
- Writes the Malloy text of a dashboard file — `dashboards/<slug>.malloy` —
1756
- or a notebook file — `notebooks/<slug>.malloy`, which must carry an
1757
- `## artifact` tag (an untagged file there is a shared include and is
1758
- refused with 400, and so is a write over an existing file that is
1759
- not a notebook) — the only paths this endpoint accepts,
1760
- into the package, and reloads the package in place so it is served from
1761
- the new text. This is the dashboard and notebook builder's save.
1756
+ Writes the Malloy text of a report into the package, and reloads the
1757
+ package in place so it is served from the new text. This is the report
1758
+ builder's save. A report is any `.malloy` file carrying an artifact tag
1759
+ (see list-reports), of either layout, wherever it lives in the package.
1760
+
1761
+ What it accepts:
1762
+
1763
+ - CREATE (no `expectedHash`): any `.malloy` path in the package that
1764
+ does not exist yet, outside `public/`, and never the root
1765
+ `index.malloy`. Missing directories are created, inside the package
1766
+ root only. The text must carry an artifact tag (`## artifact`, or the
1767
+ deprecated query-level `# artifact`): an `artifact` property anywhere
1768
+ on a tag line, outside a string. Text without one is refused with 400.
1769
+ - REPLACE (with `expectedHash`): only a file the package currently reads
1770
+ as an editable report: a tagged `.malloy` report of either layout,
1771
+ including a tagged grid report that has no tiles yet. A model, an
1772
+ untagged file, a `.malloynb`, the root `index.malloy` and anything in
1773
+ `public/` cannot be overwritten, wherever they live, and answer 400.
1774
+
1775
+ Two reports may share a basename in different directories; a report is
1776
+ identified by its path, so a taken basename is not refused.
1762
1777
 
1763
1778
  The text is compiled first, as the file, and refused with its problems
1764
1779
  when it does not compile; nothing is written. The write is atomic (a
@@ -1776,21 +1791,16 @@ paths:
1776
1791
  merged: the caller re-opens and reapplies its change. Omit it to CREATE
1777
1792
  the file: a file that already exists is then refused with 409 too, so
1778
1793
  an unconditional overwrite is not something a caller can ask for by
1779
- leaving a field out. A notebook path over an existing file the package
1780
- does not serve as a notebook answers 400 instead, with or without a
1781
- hash, because that check comes before the hash. The check, the write,
1794
+ leaving a field out. A path over an existing file the package does not
1795
+ read as a report answers 400 instead, with or without a hash, because
1796
+ that check comes before the hash. The check, the write,
1782
1797
  the reload and the restore all happen under one hold of the package
1783
1798
  lock, so two saves racing on one file cannot both pass the check, and a
1784
1799
  rollback cannot revert the other writer's text instead of its own.
1785
1800
 
1786
- A dashboard whose name (the file's basename) another file already holds
1787
- is refused with 409 before anything is written, since the name is its
1788
- URL and its `# drill` target. A `dashboards/` file whose text has no
1789
- `# artifact` or `## artifact` tag (an `artifact` property anywhere on a
1790
- tag line, outside a string) is refused with 400 before anything is
1791
- written; a tag only inside a block comment passes that check but the
1792
- compiled model carries none, so it is rolled back and answers 500. A
1793
- tagged dashboard with no tiles saves but is not served until it has one.
1801
+ A tag only inside a block comment passes the tag check but the compiled
1802
+ model carries none, so it is rolled back and answers 500. A tagged grid
1803
+ report with no tiles saves but is not served until it has one.
1794
1804
 
1795
1805
  A create answers 201 and an update 200; `created` in the body says the
1796
1806
  same thing.
@@ -1813,7 +1823,7 @@ paths:
1813
1823
  type: string
1814
1824
  - name: path
1815
1825
  in: path
1816
- description: The file, `dashboards/<slug>.malloy` or `notebooks/<slug>.malloy`
1826
+ description: The report file's path in the package, such as `sales/q3.malloy`
1817
1827
  required: true
1818
1828
  schema:
1819
1829
  $ref: "#/components/schemas/PathPattern"
@@ -1852,9 +1862,8 @@ paths:
1852
1862
  $ref: "#/components/responses/NotFound"
1853
1863
  "409":
1854
1864
  description:
1855
- The file changed since the caller opened it, already exists and
1856
- no `expectedHash` was sent, or is a dashboard whose name another
1857
- file already holds
1865
+ The file changed since the caller opened it, or already exists and
1866
+ no `expectedHash` was sent
1858
1867
  content:
1859
1868
  application/json:
1860
1869
  schema:
@@ -1977,9 +1986,11 @@ paths:
1977
1986
  that is both gated and hidden from the caller answers 404 for the whole
1978
1987
  request, as it does without a document. In a document, problem positions
1979
1988
  are lines of the submitted text, problems carry no `model` tag, and
1980
- `includeSql` returns no `sql`. A tag that names no `kind` is a dashboard
1981
- when it lists `tiles` or carries a `dashboard { … }` grid tag, and a
1982
- notebook otherwise, since submitted text has no folder to take a kind from.
1989
+ `includeSql` returns no `sql`. The document's `layout` follows the one
1990
+ rule every report follows (see list-reports): the tag's `layout=`, else
1991
+ its deprecated `kind=` (`dashboard` is grid, `notebook` is linear), else
1992
+ grid when the tag lists `tiles` or carries a `dashboard { … }` grid tag,
1993
+ else linear. Where a file lives never decides it.
1983
1994
  parameters:
1984
1995
  - name: environmentName
1985
1996
  in: path
@@ -2027,20 +2038,165 @@ paths:
2027
2038
  "503":
2028
2039
  $ref: "#/components/responses/ServiceUnavailable"
2029
2040
 
2041
+ /environments/{environmentName}/packages/{packageName}/reports:
2042
+ get:
2043
+ tags:
2044
+ - reports
2045
+ operationId: list-reports
2046
+ summary: List package reports
2047
+ description: |
2048
+ Lists every report in the package, in path order. A report is a
2049
+ `.malloy` file anywhere in the package, outside `public/`, that carries
2050
+ an artifact tag: a model-level `## artifact`, or the deprecated
2051
+ query-level `# artifact` on a `query:`. The package's root
2052
+ `index.malloy` is never a report (it is the surface). A legacy
2053
+ `.malloynb` is also a report, linear and read-only. Where a file lives
2054
+ carries no meaning: `dashboards/` and `notebooks/` are ordinary
2055
+ directory names. Everything else is an ordinary model, which a report
2056
+ may import.
2057
+
2058
+ A report's `layout` is decided by its tags, first match wins: the
2059
+ tag's `layout=` (`grid` or `linear`); else the deprecated `kind=`
2060
+ (`dashboard` is grid, `notebook` is linear); else grid for a
2061
+ query-level `# artifact`; else grid for a model-level tag that lists
2062
+ `tiles` or carries a `dashboard { … }` grid tag; else linear.
2063
+
2064
+ A report is identified by its `path`. `name`, its basename, is a
2065
+ display label only: two reports may share one.
2066
+
2067
+ Every report is listed whatever the package's surface; the surface
2068
+ limits what its tiles and cells may read, not whether it is listed. A
2069
+ report that failed to compile is listed with its `error`. A tagged grid
2070
+ report with no tiles yet is not served and not listed.
2071
+ parameters:
2072
+ - name: environmentName
2073
+ in: path
2074
+ description: Name of the environment
2075
+ required: true
2076
+ schema:
2077
+ $ref: "#/components/schemas/IdentifierPattern"
2078
+ - name: packageName
2079
+ in: path
2080
+ description: Name of the package
2081
+ required: true
2082
+ schema:
2083
+ $ref: "#/components/schemas/IdentifierPattern"
2084
+ - name: versionId
2085
+ in: query
2086
+ description: Version identifier for the package
2087
+ required: false
2088
+ schema:
2089
+ $ref: "#/components/schemas/VersionIdPattern"
2090
+ responses:
2091
+ "200":
2092
+ description: The reports in the package
2093
+ content:
2094
+ application/json:
2095
+ schema:
2096
+ type: array
2097
+ items:
2098
+ $ref: "#/components/schemas/Report"
2099
+ "401":
2100
+ $ref: "#/components/responses/Unauthorized"
2101
+ "404":
2102
+ $ref: "#/components/responses/NotFound"
2103
+ "500":
2104
+ $ref: "#/components/responses/InternalServerError"
2105
+ "501":
2106
+ $ref: "#/components/responses/NotImplemented"
2107
+ "503":
2108
+ $ref: "#/components/responses/ServiceUnavailable"
2109
+
2110
+ /environments/{environmentName}/packages/{packageName}/reports/{path}:
2111
+ get:
2112
+ tags:
2113
+ - reports
2114
+ operationId: get-report
2115
+ summary: Get a report manifest
2116
+ description: |
2117
+ Everything a viewer needs to render one report, addressed by its path in
2118
+ the package, including its extension, exactly as list-reports gives
2119
+ it (`sales/q3.malloy`). A report written as tiles, of either layout, carries the
2120
+ manifest fields (`tiles` or `query`, `dashboardColumns`,
2121
+ `startingGivens`, `autorun`, `givens`): its tiles run through the model
2122
+ query endpoint with `givens`, using `path` as the model. A linear
2123
+ report written as `run:` cells, or a `.malloynb`, carries `notebook`
2124
+ instead: its cells as get-notebook returned them. A `.malloy` report's
2125
+ cells run through the model query endpoint, each cell's `text` as
2126
+ `query` and `path` as the model; a `.malloynb`'s through the
2127
+ deprecated execute-notebook-cell.
2128
+ parameters:
2129
+ - name: environmentName
2130
+ in: path
2131
+ description: Name of the environment
2132
+ required: true
2133
+ schema:
2134
+ $ref: "#/components/schemas/IdentifierPattern"
2135
+ - name: packageName
2136
+ in: path
2137
+ description: Name of the package
2138
+ required: true
2139
+ schema:
2140
+ $ref: "#/components/schemas/IdentifierPattern"
2141
+ - name: path
2142
+ in: path
2143
+ description: >-
2144
+ The report's path within the package, including `.malloy` (or
2145
+ `.malloynb`): the `path` list-reports returns.
2146
+ required: true
2147
+ schema:
2148
+ type: string
2149
+ - name: versionId
2150
+ in: query
2151
+ description: Version identifier for the package
2152
+ required: false
2153
+ schema:
2154
+ $ref: "#/components/schemas/VersionIdPattern"
2155
+ responses:
2156
+ "200":
2157
+ description: The report manifest
2158
+ content:
2159
+ application/json:
2160
+ schema:
2161
+ $ref: "#/components/schemas/ReportManifest"
2162
+ "401":
2163
+ $ref: "#/components/responses/Unauthorized"
2164
+ "404":
2165
+ $ref: "#/components/responses/NotFound"
2166
+ "500":
2167
+ $ref: "#/components/responses/InternalServerError"
2168
+ "501":
2169
+ $ref: "#/components/responses/NotImplemented"
2170
+ "503":
2171
+ $ref: "#/components/responses/ServiceUnavailable"
2172
+
2173
+ # ── DEPRECATED ──────────────────────────────────────────────────────────
2174
+ # The `…/dashboards*` and `…/notebooks*` routes, kept for clients that still
2175
+ # read them, until a later release removes them. Use `…/reports*` above.
2176
+ # Their schemas (`Dashboard`, `DashboardManifest`, `DashboardTile`,
2177
+ # `Notebook`, `RawNotebook`) are in the deprecated section of the schemas;
2178
+ # no report schema references them.
2030
2179
  /environments/{environmentName}/packages/{packageName}/dashboards:
2031
2180
  get:
2032
2181
  tags:
2033
2182
  - dashboards
2034
2183
  operationId: list-dashboards
2035
- summary: List package dashboards
2184
+ deprecated: true
2185
+ summary: List package dashboards (deprecated; use list-reports)
2036
2186
  description: |
2037
- Lists the dashboards in the specified package — every tagged `.malloy`
2038
- file at the top of `dashboards/` or `notebooks/` carrying an
2039
- `# artifact` (or model-level `## artifact`) annotation whose `kind` is
2040
- `dashboard`, or names none under `dashboards/`. A `kind=notebook` file is
2041
- listed as a notebook instead, whichever folder it sits in. A file with
2042
- no artifact tag is a shared include and is not listed, whether or not it
2043
- compiles.
2187
+ **DEPRECATED**: use list-reports, which lists every report of either
2188
+ layout by path. This route lists the package's grid reports (see
2189
+ list-reports for what makes a file a report and which layout it has),
2190
+ wherever they live in the package. Two may share a `name`; their `path`
2191
+ tells them apart. A file with no artifact tag is an ordinary model and is
2192
+ not listed, whether or not it compiles.
2193
+
2194
+ **Contract change since reports.** This route used to list only
2195
+ `.malloy` files directly under `dashboards/`, so every `name` was unique
2196
+ and every `path` was `dashboards/<name>.malloy`. It now lists grid
2197
+ reports from anywhere in the package (`sales/q3.malloy`,
2198
+ `notebooks/x.malloy`, `a/b/c.malloy`), so `path` may have any depth and
2199
+ `name` may repeat. Key on `path`.
2044
2200
 
2045
2201
  A tagged dashboard that failed to compile is listed carrying its
2046
2202
  `error` where that state can arise at all, so a broken dashboard is
@@ -2107,14 +2263,27 @@ paths:
2107
2263
  tags:
2108
2264
  - dashboards
2109
2265
  operationId: get-dashboard
2110
- summary: Get a dashboard manifest
2266
+ deprecated: true
2267
+ summary: Get a dashboard manifest (deprecated; use get-report)
2111
2268
  description: |
2112
- Retrieves everything a viewer needs to render one dashboard: the artifact
2113
- tag's declarations plus the control contract derived from the givens its
2114
- query references. Running the dashboard needs no further endpoint — its
2269
+ **DEPRECATED**: use get-report, which addresses a report by its path.
2270
+ Retrieves everything a viewer needs to render one grid report: the
2271
+ artifact tag's declarations plus the control contract derived from the
2272
+ givens its query references. Running it needs no further endpoint — its
2115
2273
  query, each tile, and each control's suggest query all run
2116
2274
  through the model query endpoint with `givens`, using the manifest's
2117
2275
  `path` as the model.
2276
+
2277
+ `dashboardName` is a basename, which is not an identity: it resolves
2278
+ only when exactly one grid report in the package has it. When several
2279
+ do, the answer is 409 naming every matching path; address the report
2280
+ by path with get-report instead.
2281
+
2282
+ **Contract change since reports.** This route never answered 409
2283
+ before: a dashboard lived directly under `dashboards/`, so its name was
2284
+ unique. A grid report may now live anywhere, two may share a basename,
2285
+ and a client of this route must handle 409. The match also covers grid
2286
+ reports outside `dashboards/`.
2118
2287
  parameters:
2119
2288
  - name: environmentName
2120
2289
  in: path
@@ -2131,11 +2300,11 @@ paths:
2131
2300
  - name: dashboardName
2132
2301
  in: path
2133
2302
  description: >-
2134
- The dashboard's name: its filename basename. Conventionally letters,
2303
+ The report's name: its filename basename. Conventionally letters,
2135
2304
  digits, "-" and "_", and a package is warned when one of its
2136
- dashboards falls outside that. It is NOT constrained to it, because
2305
+ grid reports falls outside that. It is NOT constrained to it, because
2137
2306
  the name comes from a filename rather than being chosen: a file such
2138
- as `dashboards/v1.2.malloy` is served, and its published `resource`
2307
+ as `v1.2.malloy` is served, and its published `resource`
2139
2308
  carries the name percent-encoded. Send it percent-encoded.
2140
2309
  required: true
2141
2310
  schema:
@@ -2158,6 +2327,14 @@ paths:
2158
2327
  $ref: "#/components/responses/Unauthorized"
2159
2328
  "404":
2160
2329
  $ref: "#/components/responses/NotFound"
2330
+ "409":
2331
+ description:
2332
+ More than one grid report in the package has this basename. The
2333
+ message names every matching path; use get-report with one.
2334
+ content:
2335
+ application/json:
2336
+ schema:
2337
+ $ref: "#/components/schemas/Error"
2161
2338
  "500":
2162
2339
  $ref: "#/components/responses/InternalServerError"
2163
2340
  "501":
@@ -2170,14 +2347,20 @@ paths:
2170
2347
  tags:
2171
2348
  - notebooks
2172
2349
  operationId: list-notebooks
2173
- summary: List package notebooks
2350
+ deprecated: true
2351
+ summary: List package notebooks (deprecated; use list-reports)
2174
2352
  description: |
2175
- Retrieves a list of all Malloy notebooks within the specified package: every
2176
- `.malloynb` file, and every `.malloy` file at the top of `notebooks/` or `dashboards/`
2177
- whose model-level `## artifact` tag says `kind=notebook` (or names no `kind` and sits
2178
- under `notebooks/`). Each notebook entry includes the relative path,
2179
- package name, title, description, and any compilation or reading error. This endpoint
2180
- is useful for discovering available notebooks and checking their status.
2353
+ **DEPRECATED**: use list-reports. Lists the package's linear reports (see
2354
+ list-reports): every `.malloynb` file outside `public/`, and every tagged
2355
+ `.malloy` report whose layout is linear, wherever it lives. Each entry
2356
+ includes the relative path, package name, title, description, and any
2357
+ compilation or reading error.
2358
+
2359
+ **Contract change since reports.** This route used to list `.malloy`
2360
+ notebooks only directly under `notebooks/`. It now lists linear reports
2361
+ from anywhere in the package, including `dashboards/` and nested
2362
+ directories, and no longer lists a kindless tiled file in `notebooks/`,
2363
+ which is now grid.
2181
2364
  parameters:
2182
2365
  - name: environmentName
2183
2366
  in: path
@@ -2222,13 +2405,14 @@ paths:
2222
2405
  tags:
2223
2406
  - notebooks
2224
2407
  operationId: get-notebook
2225
- summary: Get Malloy notebook cells
2408
+ deprecated: true
2409
+ summary: Get Malloy notebook cells (deprecated; use get-report)
2226
2410
  description: |
2227
- Retrieves a Malloy notebook with its raw cell contents (markdown and code).
2228
- Cell execution should be done separately via the execute-notebook-cell endpoint.
2229
- A served notebook (a `.malloy` at the top of `notebooks/` or `dashboards/` whose
2230
- model-level `## artifact` tag says `kind=notebook`, or names no `kind` and sits under
2231
- `notebooks/`) answers here as well as a `.malloynb`.
2411
+ **DEPRECATED**: use get-report. Retrieves a linear report with its raw
2412
+ cell contents (markdown and code). A `.malloy` report's cells run
2413
+ through the model query endpoint (each cell's `text` as the query); a
2414
+ `.malloynb`'s through execute-notebook-cell. A linear `.malloy`
2415
+ report, wherever it lives, answers here as well as a `.malloynb`.
2232
2416
  On a package with a surface, the response shows only the sources the notebook may read.
2233
2417
  parameters:
2234
2418
  - name: environmentName
@@ -2276,13 +2460,19 @@ paths:
2276
2460
  tags:
2277
2461
  - notebooks
2278
2462
  operationId: execute-notebook-cell
2279
- summary: Execute a specific notebook cell
2463
+ deprecated: true
2464
+ summary: Execute a specific notebook cell (deprecated)
2280
2465
  description: |
2281
- Executes a specific cell in a Malloy notebook by index. For code cells, this compiles
2282
- and runs the Malloy code, returning query results and any new sources defined.
2283
- For markdown cells, this simply returns the cell content. A served notebook
2284
- (tagged `kind=notebook`, or untagged-kind under `notebooks/`) answers here as well as a
2285
- `.malloynb`.
2466
+ **DEPRECATED**: removed with the other notebook routes. For a `.malloy`
2467
+ report, run a cell through the model query endpoint instead: the
2468
+ report's path as the model, the cell's `text` (from get-report) as
2469
+ `query`, and `givens` in the body, which applies the same surface,
2470
+ `#(authorize)` and row-level gates. A `.malloynb` has no other route.
2471
+ Executes a specific cell in a linear report by index.
2472
+ For code cells, this compiles and runs the Malloy code, returning query
2473
+ results and any new sources defined. For markdown cells, this simply
2474
+ returns the cell content. A linear `.malloy` report, wherever it lives,
2475
+ answers here as well as a `.malloynb`.
2286
2476
 
2287
2477
  On a package with a surface (a root `index.malloy`, or a legacy `explores`) with
2288
2478
  `queryableSources` left at `"declared"`, a code cell may read only sources the surface
@@ -3394,11 +3584,11 @@ components:
3394
3584
  paths relative to the package root. Only these models are listed
3395
3585
  via `listModels()`, and the surface is the union of their
3396
3586
  `export {}` closures. Every other .malloy file still compiles for
3397
- import/join resolution but is hidden. Notebooks and dashboards are
3398
- always listed regardless of this field, and a dashboard entry
3399
- needs no listing: a tagged dashboard listed here reads the surface
3400
- and adds nothing to it. An untagged file under `dashboards/` that
3401
- is listed is an ordinary surface file.
3587
+ import/join resolution but is hidden. Reports are always listed
3588
+ regardless of this field, and a report needs no listing: a report
3589
+ listed here reads the surface and adds nothing to it, and the
3590
+ package warns about it (`report-on-surface`). An untagged file
3591
+ that is listed is an ordinary surface file, wherever it lives.
3402
3592
  DEPRECATED, still honored. Every non-empty value gets a load
3403
3593
  warning naming the replacement: a root `index.malloy` that imports
3404
3594
  the listed files and exports what they publish. `[]` is deprecated
@@ -3457,23 +3647,28 @@ components:
3457
3647
  `queryableSources: "declared"`, and a root file such as
3458
3648
  `Index.malloy` that differs from `index.malloy` only in case and
3459
3649
  so is ignored. A root `index.malloy` with no manifest keys gets no
3460
- warning. Dashboard findings: a
3461
- `dashboards/` file whose `# artifact` tag does not parse or does not
3462
- describe a dashboard, a tile or suggest query that does not resolve,
3463
- a `# drill` naming a destination that is not a dashboard, and a
3464
- tile, single query or filter suggest that reads a source the
3465
- surface does not export, so it won't load. Two dashboard findings are about Publisher rather
3466
- than about the package: one when a file carrying an artifact tag
3467
- could not be read and so is not served at all, and one when the lint
3468
- stops early, in which case the list must be read as incomplete
3469
- rather than as a clean package. Notebook findings: a `notebooks/`
3470
- file with an `## artifact` note whose cells could not be read, which
3471
- names the line and the fix and is reported with severity `error`,
3472
- because the notebook is served with that error instead of opening.
3473
- The same family carries findings on files under `notebooks/` and
3474
- `dashboards/`, each naming its line and the fix; they are computed
3475
- at discovery and are also returned by `/compile` at file and
3476
- package scope. Eight codes are `error` and fail `/compile`:
3650
+ warning. Report findings (one lint pass per report, of either
3651
+ layout, wherever it lives): a file whose artifact tag does not
3652
+ parse or does not describe a report, a tile or suggest query that
3653
+ does not resolve, a `# drill` naming a destination that is not a
3654
+ report, and a tile, single query or filter suggest that reads a
3655
+ source the surface does not export, so it won't load. A `# drill`
3656
+ destination is a path from the package root (a bare name is a file
3657
+ at the root); one that names no report is unresolved (`error`).
3658
+ Curation findings: a root `index.malloy` carrying an artifact tag,
3659
+ which is ignored (`index-is-not-a-report`, `error`); and a report
3660
+ that `index.malloy` imports or `explores` lists
3661
+ (`report-on-surface`, `warn`). Two report findings are about
3662
+ Publisher rather than about the package: one when a file carrying
3663
+ an artifact tag could not be read and so is not served at all, and
3664
+ one when the lint stops early, in which case the list must be read
3665
+ as incomplete rather than as a clean package. A linear report whose
3666
+ cells could not be read gets a finding that names the line and the
3667
+ fix and is reported with severity `error`, because it is served
3668
+ with that error instead of opening. The per-file report findings
3669
+ each name their line and the fix and carry a `code`; they are
3670
+ computed at discovery and are also returned by `/compile` at file
3671
+ and package scope. Eight codes are `error` and fail `/compile`:
3477
3672
  `notebook-statement-above-artifact` and `notebook-tag-above-artifact`
3478
3673
  (a statement or a tag above a served notebook's `## artifact`),
3479
3674
  `notebook-markdown-above-artifact` (a `(markdown)` annotation above
@@ -3484,9 +3679,13 @@ components:
3484
3679
  `notebook-markdown-attached-nowhere` (a `#(markdown)` annotation
3485
3680
  with no statement to take it), `notebook-artifact-unparsed` (an
3486
3681
  `## artifact` tag does not parse), and `notebook-cells-unreadable`
3487
- (the reader could not read a served notebook's cells). The rest are
3488
- `warn` (a mistyped `(markdown)` opener, a missing `kind=notebook`, a
3489
- block that never closes, and similar).
3682
+ (the reader could not read a linear report's cells), plus
3683
+ `report-kind-removed` (a tag that sets `kind=`, which is no longer
3684
+ read, so the file is not a report; the finding names the `layout=`
3685
+ to write) and `report-layout-unknown` (a `layout=` other than
3686
+ `grid` or `linear`). The rest are `warn` (a mistyped `(markdown)`
3687
+ opener, `report-layout-implicit` for a tag that names no layout and lists
3688
+ no tiles, a block that never closes, and similar).
3490
3689
  Deprecated-format findings, all `warn`: each `.malloynb` notebook
3491
3690
  (`model` is its path), and each source a file declares deprecated
3492
3691
  `#(filter)` annotations on (`model` is that file, `subject` the
@@ -3582,8 +3781,8 @@ components:
3582
3781
  description: >-
3583
3782
  What the finding is about: the query or view a render finding
3584
3783
  sits on (`by_carrier`, `flights -> by_carrier`), the source a
3585
- materialization finding belongs to, or, for a dashboard
3586
- finding, the dashboard's name or the `source.dimension` a
3784
+ materialization finding belongs to, or, for a report
3785
+ finding, the report's name or the `source.dimension` a
3587
3786
  `# drill` is declared on. Absent when a finding sits on none
3588
3787
  of those, either because it spans several, in which case the
3589
3788
  message names them, or because it is about the lint itself
@@ -3591,13 +3790,33 @@ components:
3591
3790
  message:
3592
3791
  type: string
3593
3792
  description: A description of the problem.
3793
+ code:
3794
+ type: string
3795
+ description: >-
3796
+ A stable identifier for the finding's family, for a client that
3797
+ acts on it rather than only showing it; absent for a family that
3798
+ has none yet. `deprecated-malloynb-notebook`: a `.malloynb`
3799
+ notebook, the deprecated cell format (one per file, `model`
3800
+ naming it). `deprecated-filter-annotation`: a source declaring
3801
+ deprecated `#(filter)` annotations (one per declaring source,
3802
+ `model` naming its file and `subject` the source).
3803
+ `report-name-ambiguous`: two or more grid reports share a
3804
+ basename, so the deprecated `GET …/dashboards/{name}` route
3805
+ answers 409 for it (one per name, `subject` naming it and the
3806
+ message every path; `warn`). The per-file
3807
+ report findings (`notebook-…`, `report-…`) and the report
3808
+ curation findings (`report-on-surface`,
3809
+ `index-is-not-a-report`). The message wording may change; the
3810
+ code does not.
3594
3811
  severity:
3595
3812
  type: string
3596
3813
  enum:
3597
3814
  - error
3598
3815
  - warn
3599
3816
  description: >-
3600
- Finding severity. Render-tag findings use both: `error` for
3817
+ Finding severity, `error` or `warn` and nothing else; a
3818
+ deprecated form that still loads (such as
3819
+ `deprecated-malloynb-notebook`) is `warn`. Render-tag findings use both: `error` for
3601
3820
  a tag malformed for the field it sits on, which renders as
3602
3821
  "[object Object]" or an inline error at query time, and `warn`
3603
3822
  for one that is well-formed but inert where it sits and so is
@@ -4196,242 +4415,157 @@ components:
4196
4415
  type: string
4197
4416
  description: Error message if the model failed to compile or load
4198
4417
 
4199
- Notebook:
4200
- type: object
4201
- description: Malloy notebook metadata and status information
4202
- properties:
4203
- environmentName:
4204
- type: string
4205
- description: Name of the environment containing this notebook
4206
- packageName:
4207
- type: string
4208
- description: Name of the package containing this notebook
4209
- path:
4210
- type: string
4211
- description: Relative path to the notebook file within its package directory
4212
- title:
4213
- type: string
4214
- description:
4215
- Human title. For a `.malloynb`, resolved from its own `## title="…"`,
4216
- then its `#"` doc comment, then its first markdown heading. For a
4217
- `.malloy` notebook, from the `title` in its `## artifact` tag, then
4218
- the first line of the `"` notes above that tag, then its first
4219
- markdown heading when no prose precedes it. Absent when none of
4220
- those resolve, leaving the caller to show the path.
4221
- description:
4222
- type: string
4223
- description:
4224
- The notebook's doc comment, when it has one. For a `.malloy`
4225
- notebook that is the `"` notes above the `## artifact` line; prose
4226
- below it is a `##(markdown)` or `##|(markdown)` cell.
4227
- error:
4228
- type: string
4229
- description: Error message if the notebook failed to compile or load
4230
-
4231
- Dashboard:
4418
+ Report:
4232
4419
  type: object
4420
+ required: [resource, packageName, path, name, layout, title, editable]
4233
4421
  description: |
4234
- A dashboard within a Malloy package: a self-contained `.malloy` file at
4235
- the top of the package's `dashboards/` or `notebooks/` directory carrying an `# artifact` (or
4236
- model-level `## artifact`) annotation. The list entry; see
4237
- DashboardManifest for the detail a viewer needs to render one.
4422
+ One report in a package, as list-reports lists it: a `.malloy` file
4423
+ whose model-level `## artifact` tag makes it one, wherever it lives
4424
+ outside `public/`, or a `.malloynb`. See ReportManifest for the detail a viewer needs to render
4425
+ one.
4238
4426
  properties:
4239
4427
  resource:
4240
4428
  type: string
4241
- description: Resource path to the dashboard
4429
+ description: Resource path to the report (get-report)
4242
4430
  packageName:
4243
4431
  type: string
4244
- description: Name of the package containing this dashboard
4432
+ description: Name of the package containing this report
4433
+ path:
4434
+ type: string
4435
+ description: >-
4436
+ The report's path within its package, such as `sales/q3.malloy`.
4437
+ Its identity, and the only thing that addresses it.
4245
4438
  name:
4246
4439
  type: string
4247
- description:
4248
- The dashboard's slug — its filename basename. Addresses it in a URL
4249
- and as a `# drill` target.
4250
- path:
4440
+ description: >-
4441
+ The file's basename without its extension. A display label only:
4442
+ two reports in different directories may share it.
4443
+ layout:
4251
4444
  type: string
4252
- description:
4253
- Relative path to the dashboard file within its package directory
4254
- (`dashboards/<name>.malloy`)
4445
+ enum: [grid, linear]
4446
+ description: >-
4447
+ How its tiles are placed: `linear` top to bottom, one column, or
4448
+ `grid` by `columns`, `colspan` and `break`. Decided by its tags (see
4449
+ list-reports), never by where the file lives.
4255
4450
  title:
4256
4451
  type: string
4257
- description:
4258
- Human title from the artifact tag, falling back to the file's `#"`
4259
- doc comment and then to the slug
4452
+ description: >-
4453
+ Human title: the artifact tag's `title`, else the first line of the
4454
+ `"` notes above the tag, else,
4455
+ for a linear report, its first markdown heading, else `name`.
4260
4456
  description:
4261
4457
  type: string
4458
+ description: The report's doc comment, when it has one.
4459
+ editable:
4460
+ type: boolean
4262
4461
  description: >-
4263
- The file's unnamed `"` notes above the `## artifact` tag; when it
4264
- has none there, the ones below it (a legacy spot the lint flags). For
4265
- a dashboard whose tag sits on one query, that query's `#"` notes.
4462
+ Whether the builder opens it as it is: false for a `.malloynb` and
4463
+ for a linear report written as `run:` cells.
4266
4464
  error:
4267
4465
  type: string
4268
- description: Error message if the dashboard file failed to compile
4466
+ description: >-
4467
+ Error message when the report failed to compile, or its cells could
4468
+ not be read.
4269
4469
 
4270
- DashboardManifest:
4271
- type: object
4470
+ ReportManifest:
4272
4471
  description: |
4273
- Everything a viewer needs to render one dashboard: the artifact tag's
4274
- declarations plus the control contract derived from the givens its query
4275
- references. Running needs no dashboard-specific endpoint — the query,
4276
- each tile, and each control's suggest query all run through
4277
- the ordinary model query endpoint with `givens`.
4472
+ A `Report` plus what a viewer needs to draw it. A report written as
4473
+ tiles, of either layout, carries `tiles`, `dashboardColumns`,
4474
+ `startingGivens`, `autorun` and `givens`, whose tiles and suggest
4475
+ queries run through `POST …/models/{path}/query` with `givens`. A
4476
+ linear report written as `run:` cells, or a `.malloynb`, carries
4477
+ `notebook` instead.
4478
+ allOf:
4479
+ - $ref: "#/components/schemas/Report"
4480
+ - type: object
4481
+ properties:
4482
+ tiles:
4483
+ type: array
4484
+ description: >-
4485
+ The report's tiles, each run as its own query (or shown as text),
4486
+ in order. Absent on a `run:`-cell report.
4487
+ items:
4488
+ $ref: "#/components/schemas/ReportTile"
4489
+ dashboardColumns:
4490
+ type: integer
4491
+ description: >-
4492
+ Grid width, from the `# dashboard {columns=N}` tag beside the
4493
+ artifact tag. 1 on a linear report. Absent means the viewer's
4494
+ default.
4495
+ startingGivens:
4496
+ allOf:
4497
+ - $ref: "#/components/schemas/EncodedGivenValues"
4498
+ description: >-
4499
+ Starting values for controls, from the artifact tag. URL
4500
+ parameters override these.
4501
+ autorun:
4502
+ type: boolean
4503
+ description: >-
4504
+ False batches control changes behind an Apply button instead of
4505
+ re-running on every change. Defaults to true.
4506
+ givens:
4507
+ type: array
4508
+ description: >-
4509
+ The control row: one entry per given the report's tiles run with
4510
+ (less a given only a source's gate reads, which a host injects),
4511
+ widened to every given the entry file surfaces when a tile cannot be
4512
+ resolved (see `ReportTile.givenNames`). `default` is the value the
4513
+ query endpoint takes, not the Malloy literal: a `filter<…>` given
4514
+ declared `f'West'` publishes `West`.
4515
+ items:
4516
+ $ref: "#/components/schemas/Given"
4517
+ notebook:
4518
+ allOf:
4519
+ - $ref: "#/components/schemas/ReportCells"
4520
+ description: >-
4521
+ For a linear report written as `run:` cells, or a `.malloynb`: its
4522
+ cells and model. Run a `.malloy`
4523
+ report's cell through the model query endpoint, its `text` as
4524
+ `query`; a `.malloynb`'s with execute-notebook-cell. Absent on a
4525
+ report written as tiles, and on a
4526
+ report that failed to compile.
4527
+
4528
+ ReportTile:
4529
+ type: object
4530
+ description: >-
4531
+ One tile of a report. A `query` tile (the default) runs a query; a
4532
+ `text` tile shows markdown and runs nothing, so a caller that runs a
4533
+ report's tiles skips the ones with `kind` `text`.
4278
4534
  properties:
4279
- resource:
4280
- type: string
4281
- description: Resource path to the dashboard
4282
- packageName:
4535
+ kind:
4283
4536
  type: string
4284
- description: Name of the package containing this dashboard
4537
+ enum: [query, text]
4538
+ description: >-
4539
+ `query` runs `query` through the model query endpoint; `text` shows
4540
+ `markdown`. Absent means `query`.
4285
4541
  name:
4286
- type: string
4287
- description:
4288
- The dashboard's slug — its filename basename. Addresses it in a URL
4289
- and as a `# drill` target.
4290
- path:
4291
- type: string
4292
- description: |
4293
- Relative path to the dashboard file within its package directory
4294
- (`dashboards/<name>.malloy`). This is also the model to POST to:
4295
- `query`, each tile, and each control's suggest query all run through
4296
- `POST /environments/{environmentName}/packages/{packageName}/models/{path}/query`
4297
- with `givens`, which is why there is no dashboard-specific run
4298
- endpoint.
4299
- title:
4300
- type: string
4301
- description:
4302
- Human title from the artifact tag, falling back to the file's `#"`
4303
- doc comment and then to the slug
4304
- description:
4305
4542
  type: string
4306
4543
  description: >-
4307
- The file's unnamed `"` notes above the `## artifact` tag; when it
4308
- has none there, the ones below it (a legacy spot the lint flags). For
4309
- a dashboard whose tag sits on one query, that query's `#"` notes.
4310
- error:
4311
- type: string
4312
- description: Error message if the dashboard file failed to compile
4313
- kind:
4544
+ A text tile's name: the bare word in `tiles=[…]` and on its
4545
+ `##|(markdown) name` block. Absent on a query tile.
4546
+ markdown:
4314
4547
  type: string
4315
- enum: [dashboard, notebook]
4316
4548
  description: >-
4317
- What the document is, from the `kind` property of its artifact tag
4318
- (the folder only decides the default when the tag says nothing). A
4319
- `notebook` is laid out as one column: `dashboardColumns` is 1
4320
- whatever the file says. Always `dashboard` on
4321
- `GET …/dashboards/{dashboardName}`; a notebook's manifest is the
4322
- `dashboard` field of `GET …/notebooks/{path}`.
4549
+ A text tile's body, the text of its `##|(markdown) name` block
4550
+ without the opener. Empty when the file has no such block. Absent on
4551
+ a query tile.
4323
4552
  query:
4324
4553
  type: string
4325
4554
  description: >-
4326
- Name of the tagged query whose single result IS the page. Set when the
4327
- `# artifact` tag sits on a `query:`; a dashboard authored the ordinary
4328
- way carries `tiles` instead and leaves this absent. A NAME rather than
4329
- an expression, so it goes in the `queryName` field of a
4330
- `POST …/models/{path}/query` body. A tile's `query` is the other shape
4331
- and is not interchangeable with this one; see `DashboardTile.query`.
4332
- tiles:
4333
- type: array
4334
- description: >-
4335
- The dashboard's tiles, each run as its own query and combined into one
4336
- grid. This is how a dashboard is normally authored, and the only form
4337
- that can span sources. Absent when the `# artifact` tag sits on a
4338
- `query:` instead, in which case `query` is set.
4339
- items:
4340
- $ref: "#/components/schemas/DashboardTile"
4341
- dashboardColumns:
4342
- type: integer
4343
- description: >-
4344
- Grid width, from the `# dashboard {columns=N}` render tag beside the
4345
- artifact tag. One spelling wherever the artifact tag sits: Publisher
4346
- reads it at model level to lay out `tiles`, and `@malloydata/render`
4347
- reads the same tag off a tagged `query:`. Absent means the viewer's
4348
- default.
4349
- startingGivens:
4350
- allOf:
4351
- - $ref: "#/components/schemas/EncodedGivenValues"
4352
- description:
4353
- Per-dashboard starting values for controls, from the artifact tag.
4354
- URL parameters override these, which is why the two share a shape.
4355
- autorun:
4555
+ Absent on a text tile. The run expression exactly as written in `tiles=[…]`, for example
4556
+ "orders -> by_month". An EXPRESSION rather than a name, so it goes in
4557
+ the `query` field of a `POST …/models/{path}/query` body, prefixed
4558
+ with `run:`.
4559
+ restricted:
4356
4560
  type: boolean
4357
- description:
4358
- False batches control changes behind an Apply button instead of
4359
- re-running on every change. Defaults to true.
4360
- givens:
4561
+ description: >-
4562
+ Set on a tile of a compiled document (`CompileResult.document`) whose
4563
+ source the caller may not read. The tile carries its `query` and
4564
+ nothing derived from the source: no `givenNames`, no layout tags.
4565
+ givenNames:
4361
4566
  type: array
4362
- description: |
4363
- The control row. Normally one entry per given the dashboard runs
4364
- with: the union over `tiles` (less a given only a source's gate
4365
- reads, which a host injects rather than a viewer sets), or what `query` references when the tag
4366
- sits on a query, and which the entry file
4367
- can bind. The row widens to
4368
- every given the entry file surfaces when any tile is one discovery
4369
- cannot resolve, because that tile's givens are otherwise absent from
4370
- the row it filters by; see `DashboardTile.givenNames`. So an entry
4371
- here is always bindable, but on a widened row it is not necessarily
4372
- referenced by any tile. A given reachable only
4373
- through an import chain the entry file does not import itself
4374
- cannot be bound at query time, so no control is offered for it and
4375
- it stays at its default; that case is reported in the package's
4376
- `warnings` rather than represented here by an unusable entry. Plain
4377
- `Given`s, because the presentation a control takes is declared on
4378
- the given itself, so a dashboard and a notebook render the same
4379
- control for the same given, `#(description=…)` helper text
4380
- included.
4381
-
4382
- ONE DELIBERATE DIVERGENCE from `Given` as the model surface sends
4383
- it: `default` here is the value the QUERY ENDPOINT takes, not the
4384
- Malloy source literal. A `filter<…>` given declared `f'West'`
4385
- publishes `West`. As the literal it could not be used as a default
4386
- at all, since sending it back verbatim matches zero rows silently,
4387
- with no error to search for. Only filter-typed givens are unwrapped,
4388
- so a plain string default that merely reads like `f'x'` is
4389
- untouched. `startingGivens` uses the same shape for the same reason.
4390
- items:
4391
- $ref: "#/components/schemas/Given"
4392
-
4393
- DashboardTile:
4394
- type: object
4395
- description: >-
4396
- One tile of a dashboard. A `query` tile (the default) runs a query; a
4397
- `text` tile shows markdown and runs nothing, so a caller that runs a
4398
- dashboard's tiles skips the ones with `kind` `text`.
4399
- properties:
4400
- kind:
4401
- type: string
4402
- enum: [query, text]
4403
- description: >-
4404
- `query` runs `query` through the model query endpoint; `text` shows
4405
- `markdown`. Absent means `query`.
4406
- name:
4407
- type: string
4408
- description: >-
4409
- A text tile's name: the bare word in `tiles=[…]` and on its
4410
- `##|(markdown) name` block. Absent on a query tile.
4411
- markdown:
4412
- type: string
4413
- description: >-
4414
- A text tile's body, the text of its `##|(markdown) name` block
4415
- without the opener. Empty when the file has no such block. Absent on
4416
- a query tile.
4417
- query:
4418
- type: string
4419
- description: >-
4420
- Absent on a text tile. The run expression exactly as written in `tiles=[…]`, for example
4421
- "orders -> by_month". An EXPRESSION rather than a name, so it goes in
4422
- the `query` field of a `POST …/models/{path}/query` body, prefixed
4423
- with `run:`. Sending it in `queryName`, the field
4424
- `DashboardManifest.query` takes, is rejected.
4425
- restricted:
4426
- type: boolean
4427
- description: >-
4428
- Set on a tile of a compiled document (`CompileResult.document`) whose
4429
- source the caller may not read. The tile carries its `query` and
4430
- nothing derived from the source: no `givenNames`, no layout tags.
4431
- givenNames:
4432
- type: array
4433
- items:
4434
- type: string
4567
+ items:
4568
+ type: string
4435
4569
  description: |
4436
4570
  Names of the givens this tile's compiled query reads: through its
4437
4571
  view, its source's `where:`, a joined source's `where:`, a
@@ -4444,7 +4578,7 @@ components:
4444
4578
  could not resolve the tile (its expression neither compiles nor is
4445
4579
  a plain `source -> view` or named query the static walk reads), in
4446
4580
  which case send the whole control row. One such tile
4447
- widens `DashboardManifest.givens` to every given the entry file
4581
+ widens `ReportManifest.givens` to every given the entry file
4448
4582
  surfaces, rather than the union over the resolvable tiles, so that
4449
4583
  the row actually contains the givens that tile filters by.
4450
4584
  label:
@@ -4483,43 +4617,11 @@ components:
4483
4617
  resolves for a `# dashboard` nest child, read the same way here so one
4484
4618
  view presents identically as a tile and as a nest.
4485
4619
 
4486
- DataApp:
4487
- type: object
4488
- description:
4489
- An in-package HTML data app within a Malloy package - a static page
4490
- served from the package's public/ directory
4491
- properties:
4492
- resource:
4493
- type: string
4494
- description:
4495
- Canonical URL to the served data app. Root-relative and does
4496
- NOT carry the /api/v0 prefix, because a data app is a static asset
4497
- served off the server root rather than an API resource.
4498
- packageName:
4499
- type: string
4500
- description: Name of the package containing this data app
4501
- path:
4502
- type: string
4503
- description: Relative path to the HTML file within its package directory
4504
- title:
4505
- type: string
4506
- description:
4507
- Title extracted from the file's <title> tag, or the path if
4508
- not present
4509
- fit:
4510
- type: string
4511
- enum:
4512
- - viewport
4513
- description:
4514
- Layout hint read from a <meta name="publisher:fit"> tag in the
4515
- page <head>. "viewport" tells the embedded viewer to fill the
4516
- available height instead of auto-sizing to the content height, for
4517
- full-screen apps like slide decks. Omitted for an ordinary
4518
- content-driven app, which keeps content-height auto-sizing.
4519
-
4520
- RawNotebook:
4620
+ ReportCells:
4521
4621
  type: object
4522
- description: Raw Malloy notebook with unexecuted cell contents
4622
+ description: >-
4623
+ A linear report written as cells, or a `.malloynb`: its cells, unexecuted,
4624
+ and its model.
4523
4625
  properties:
4524
4626
  type:
4525
4627
  type: string
@@ -4536,9 +4638,8 @@ components:
4536
4638
  enum: ["malloynb", "malloy"]
4537
4639
  description:
4538
4640
  The file format the notebook is written in. `malloynb` is the
4539
- cell-separated format; `malloy` is a `.malloy` at the top of `notebooks/` or
4540
- `dashboards/` whose model-level `## artifact` tag says `kind=notebook` (or names no
4541
- `kind` and sits under `notebooks/`), whose cells are
4641
+ cell-separated format; `malloy` is a linear `.malloy` report (see
4642
+ list-reports), wherever it lives, whose cells are
4542
4643
  its statements and its floating `(markdown)` notes in file order.
4543
4644
  malloyVersion:
4544
4645
  type: string
@@ -4551,16 +4652,6 @@ components:
4551
4652
  description: Array of notebook cells containing raw markdown and code content
4552
4653
  items:
4553
4654
  $ref: "#/components/schemas/NotebookCell"
4554
- dashboard:
4555
- allOf:
4556
- - $ref: "#/components/schemas/DashboardManifest"
4557
- description: >-
4558
- The tile layout of a notebook written as one (`## artifact {
4559
- kind=notebook tiles=[…] }`), in the shape a dashboard has, with
4560
- `kind` `notebook` and one column. Absent on a notebook written as
4561
- cells. Its tiles run through the model query endpoint at
4562
- `modelPath`; `notebookCells` carries the same content as cells for
4563
- readers that do not draw a layout.
4564
4655
  annotations:
4565
4656
  type: array
4566
4657
  description:
@@ -4599,6 +4690,271 @@ components:
4599
4690
  items:
4600
4691
  $ref: "#/components/schemas/Query"
4601
4692
 
4693
+ DataApp:
4694
+ type: object
4695
+ description:
4696
+ An in-package HTML data app within a Malloy package - a static page
4697
+ served from the package's public/ directory
4698
+ properties:
4699
+ resource:
4700
+ type: string
4701
+ description:
4702
+ Canonical URL to the served data app. Root-relative and does
4703
+ NOT carry the /api/v0 prefix, because a data app is a static asset
4704
+ served off the server root rather than an API resource.
4705
+ packageName:
4706
+ type: string
4707
+ description: Name of the package containing this data app
4708
+ path:
4709
+ type: string
4710
+ description: Relative path to the HTML file within its package directory
4711
+ title:
4712
+ type: string
4713
+ description:
4714
+ Title extracted from the file's <title> tag, or the path if
4715
+ not present
4716
+ fit:
4717
+ type: string
4718
+ enum:
4719
+ - viewport
4720
+ description:
4721
+ Layout hint read from a <meta name="publisher:fit"> tag in the
4722
+ page <head>. "viewport" tells the embedded viewer to fill the
4723
+ available height instead of auto-sizing to the content height, for
4724
+ full-screen apps like slide decks. Omitted for an ordinary
4725
+ content-driven app, which keeps content-height auto-sizing.
4726
+
4727
+ # ── DEPRECATED ────────────────────────────────────────────────────────
4728
+ # The shapes of the deprecated `…/dashboards*` and `…/notebooks*` routes.
4729
+ # No report schema references them; each removal deletes its block here.
4730
+
4731
+ Notebook:
4732
+ type: object
4733
+ deprecated: true
4734
+ description: DEPRECATED, use `Report`. A linear report as the deprecated
4735
+ list-notebooks route lists it.
4736
+ properties:
4737
+ environmentName:
4738
+ type: string
4739
+ description: Name of the environment containing this notebook
4740
+ packageName:
4741
+ type: string
4742
+ description: Name of the package containing this notebook
4743
+ path:
4744
+ type: string
4745
+ description: Relative path to the notebook file within its package directory
4746
+ title:
4747
+ type: string
4748
+ description:
4749
+ Human title. For a `.malloynb`, resolved from its own `## title="…"`,
4750
+ then its `#"` doc comment, then its first markdown heading. For a
4751
+ `.malloy` notebook, from the `title` in its `## artifact` tag, then
4752
+ the first line of the `"` notes above that tag, then its first
4753
+ markdown heading when no prose precedes it. Absent when none of
4754
+ those resolve, leaving the caller to show the path.
4755
+ description:
4756
+ type: string
4757
+ description:
4758
+ The notebook's doc comment, when it has one. For a `.malloy`
4759
+ notebook that is the `"` notes above the `## artifact` line; prose
4760
+ below it is a `##(markdown)` or `##|(markdown)` cell.
4761
+ error:
4762
+ type: string
4763
+ description: Error message if the notebook failed to compile or load
4764
+
4765
+ Dashboard:
4766
+ type: object
4767
+ deprecated: true
4768
+ description: |
4769
+ DEPRECATED: use `Report`. A grid report (see list-reports), as the
4770
+ deprecated list-dashboards route lists it. The list entry; see
4771
+ DashboardManifest for the detail a viewer needs to render one.
4772
+ properties:
4773
+ resource:
4774
+ type: string
4775
+ description: Resource path to the dashboard
4776
+ packageName:
4777
+ type: string
4778
+ description: Name of the package containing this dashboard
4779
+ name:
4780
+ type: string
4781
+ description: >-
4782
+ The report's filename basename: a display label, and the segment of
4783
+ the deprecated get-dashboard URL. Not an identity: two reports may
4784
+ share it. A change since reports: it used to be unique within the
4785
+ package (every dashboard was directly under `dashboards/`), and a
4786
+ client that keyed a map on it must key on `path` instead.
4787
+ path:
4788
+ type: string
4789
+ description:
4790
+ Relative path to the report file within its package directory,
4791
+ which is its identity
4792
+ title:
4793
+ type: string
4794
+ description:
4795
+ Human title from the artifact tag, falling back to the file's `#"`
4796
+ doc comment and then to the slug
4797
+ description:
4798
+ type: string
4799
+ description: >-
4800
+ The file's unnamed `"` notes above the `## artifact` tag; when it
4801
+ has none there, the ones below it (a legacy spot the lint flags). For
4802
+ a dashboard whose tag sits on one query, that query's `#"` notes.
4803
+ error:
4804
+ type: string
4805
+ description: Error message if the dashboard file failed to compile
4806
+
4807
+ DashboardManifest:
4808
+ type: object
4809
+ deprecated: true
4810
+ description: |
4811
+ DEPRECATED: use `ReportManifest`.
4812
+ Everything a viewer needs to render one dashboard: the artifact tag's
4813
+ declarations plus the control contract derived from the givens its query
4814
+ references. Running needs no dashboard-specific endpoint — the query,
4815
+ each tile, and each control's suggest query all run through
4816
+ the ordinary model query endpoint with `givens`.
4817
+ properties:
4818
+ resource:
4819
+ type: string
4820
+ description: Resource path to the dashboard
4821
+ packageName:
4822
+ type: string
4823
+ description: Name of the package containing this dashboard
4824
+ name:
4825
+ type: string
4826
+ description: >-
4827
+ The report's filename basename: a display label, and the segment of
4828
+ the deprecated get-dashboard URL. Not an identity: two reports may
4829
+ share it. A change since reports: it used to be unique within the
4830
+ package (every dashboard was directly under `dashboards/`), and a
4831
+ client that keyed a map on it must key on `path` instead.
4832
+ path:
4833
+ type: string
4834
+ description: |
4835
+ Relative path to the report file within its package directory,
4836
+ which is its identity. This is also the model to POST to:
4837
+ `query`, each tile, and each control's suggest query all run through
4838
+ `POST /environments/{environmentName}/packages/{packageName}/models/{path}/query`
4839
+ with `givens`, which is why there is no dashboard-specific run
4840
+ endpoint.
4841
+ title:
4842
+ type: string
4843
+ description:
4844
+ Human title from the artifact tag, falling back to the file's `#"`
4845
+ doc comment and then to the slug
4846
+ description:
4847
+ type: string
4848
+ description: >-
4849
+ The file's unnamed `"` notes above the `## artifact` tag; when it
4850
+ has none there, the ones below it (a legacy spot the lint flags). For
4851
+ a dashboard whose tag sits on one query, that query's `#"` notes.
4852
+ error:
4853
+ type: string
4854
+ description: Error message if the dashboard file failed to compile
4855
+ layout:
4856
+ type: string
4857
+ enum: [grid, linear]
4858
+ description: >-
4859
+ The report's layout (see list-reports). A `linear` report is laid
4860
+ out as one column: `dashboardColumns` is 1 whatever the file says.
4861
+ kind:
4862
+ type: string
4863
+ enum: [dashboard, notebook]
4864
+ deprecated: true
4865
+ description: >-
4866
+ DEPRECATED: read `layout`. The same thing in the old vocabulary:
4867
+ `dashboard` for a grid report, `notebook` for a linear one. Always
4868
+ `dashboard` on `GET …/dashboards/{dashboardName}`; a linear
4869
+ report's manifest is the `dashboard` field of
4870
+ `GET …/notebooks/{path}`.
4871
+ tiles:
4872
+ type: array
4873
+ description: >-
4874
+ The dashboard's tiles, each run as its own query and combined into one
4875
+ grid. Absent on a dashboard listed with its compile `error`.
4876
+ items:
4877
+ $ref: "#/components/schemas/DashboardTile"
4878
+ dashboardColumns:
4879
+ type: integer
4880
+ description: >-
4881
+ Grid width, from the `# dashboard {columns=N}` render tag beside the
4882
+ artifact tag. One spelling wherever the artifact tag sits: Publisher
4883
+ reads it at model level to lay out `tiles`, and `@malloydata/render`
4884
+ reads the same tag off a tagged `query:`. Absent means the viewer's
4885
+ default.
4886
+ startingGivens:
4887
+ allOf:
4888
+ - $ref: "#/components/schemas/EncodedGivenValues"
4889
+ description:
4890
+ Per-dashboard starting values for controls, from the artifact tag.
4891
+ URL parameters override these, which is why the two share a shape.
4892
+ autorun:
4893
+ type: boolean
4894
+ description:
4895
+ False batches control changes behind an Apply button instead of
4896
+ re-running on every change. Defaults to true.
4897
+ givens:
4898
+ type: array
4899
+ description: |
4900
+ The control row. Normally one entry per given the dashboard runs
4901
+ with: the union over `tiles` (less a given only a source's gate
4902
+ reads, which a host injects rather than a viewer sets), or what `query` references when the tag
4903
+ sits on a query, and which the entry file
4904
+ can bind. The row widens to
4905
+ every given the entry file surfaces when any tile is one discovery
4906
+ cannot resolve, because that tile's givens are otherwise absent from
4907
+ the row it filters by; see `DashboardTile.givenNames`. So an entry
4908
+ here is always bindable, but on a widened row it is not necessarily
4909
+ referenced by any tile. A given reachable only
4910
+ through an import chain the entry file does not import itself
4911
+ cannot be bound at query time, so no control is offered for it and
4912
+ it stays at its default; that case is reported in the package's
4913
+ `warnings` rather than represented here by an unusable entry. Plain
4914
+ `Given`s, because the presentation a control takes is declared on
4915
+ the given itself, so a dashboard and a notebook render the same
4916
+ control for the same given, `#(description=…)` helper text
4917
+ included.
4918
+
4919
+ ONE DELIBERATE DIVERGENCE from `Given` as the model surface sends
4920
+ it: `default` here is the value the QUERY ENDPOINT takes, not the
4921
+ Malloy source literal. A `filter<…>` given declared `f'West'`
4922
+ publishes `West`. As the literal it could not be used as a default
4923
+ at all, since sending it back verbatim matches zero rows silently,
4924
+ with no error to search for. Only filter-typed givens are unwrapped,
4925
+ so a plain string default that merely reads like `f'x'` is
4926
+ untouched. `startingGivens` uses the same shape for the same reason.
4927
+ items:
4928
+ $ref: "#/components/schemas/Given"
4929
+
4930
+ DashboardTile:
4931
+ deprecated: true
4932
+ description: >-
4933
+ DEPRECATED: `ReportTile`, under the name the deprecated dashboard
4934
+ routes gave it.
4935
+ allOf:
4936
+ - $ref: "#/components/schemas/ReportTile"
4937
+
4938
+ RawNotebook:
4939
+ deprecated: true
4940
+ description: >-
4941
+ DEPRECATED: `ReportCells`, as get-notebook answers them, plus the tile
4942
+ layout of a linear report written as tiles.
4943
+ allOf:
4944
+ - $ref: "#/components/schemas/ReportCells"
4945
+ - type: object
4946
+ properties:
4947
+ dashboard:
4948
+ allOf:
4949
+ - $ref: "#/components/schemas/DashboardManifest"
4950
+ description: >-
4951
+ The tile layout of a linear report written as one (`## artifact {
4952
+ layout=linear tiles=[…] }`), in the shape a dashboard has, with
4953
+ `layout` `linear` and one column. Absent on a notebook written as
4954
+ cells. Its tiles run through the model query endpoint at
4955
+ `modelPath`; `notebookCells` carries the same content as cells for
4956
+ readers that do not draw a layout.
4957
+
4602
4958
  CompiledModel:
4603
4959
  type: object
4604
4960
  description: Compiled Malloy model with sources, queries, and metadata
@@ -5792,8 +6148,7 @@ components:
5792
6148
  type: integer
5793
6149
  minimum: 1
5794
6150
  maximum: 2147483647
5795
- description:
5796
- Maximum run time of each statement on the database, in
6151
+ description: Maximum run time of each statement on the database, in
5797
6152
  milliseconds. The database cancels a statement that exceeds it.
5798
6153
  When omitted, the database's own statement_timeout applies. Not
5799
6154
  applied to a DuckLake catalog connection.
@@ -5999,6 +6354,7 @@ components:
5999
6354
  required:
6000
6355
  - storage
6001
6356
  - catalog
6357
+
6002
6358
  BigqueryConnection:
6003
6359
  type: object
6004
6360
  description: Google BigQuery database connection configuration
@@ -6216,6 +6572,7 @@ components:
6216
6572
  azureConnection:
6217
6573
  $ref: "#/components/schemas/AzureConnection"
6218
6574
  # TODO: What is this? Can we remove it?
6575
+
6219
6576
  SqlSource:
6220
6577
  type: object
6221
6578
  properties:
@@ -6538,13 +6895,20 @@ components:
6538
6895
  serves once saved. Present only when the source carries a model-level
6539
6896
  `## artifact` tag and compiled far enough to read.
6540
6897
  properties:
6898
+ layout:
6899
+ type: string
6900
+ enum: [grid, linear]
6901
+ description: >-
6902
+ The report's layout, by the one rule every report follows: the
6903
+ tag's `layout=`, else grid when it lists `tiles` or carries a
6904
+ `dashboard { … }` grid tag, else linear.
6541
6905
  kind:
6542
6906
  type: string
6543
6907
  enum: [dashboard, notebook]
6908
+ deprecated: true
6544
6909
  description: >-
6545
- From the tag's `kind`. When it names none, a document that lists
6546
- `tiles` or carries a `dashboard { … }` grid tag is a dashboard and
6547
- any other is a notebook: submitted text has no folder to decide.
6910
+ DEPRECATED: read `layout`. The same thing in the old vocabulary:
6911
+ `dashboard` for grid, `notebook` for linear.
6548
6912
  manifest:
6549
6913
  allOf:
6550
6914
  - $ref: "#/components/schemas/DashboardManifest"
@@ -6932,6 +7296,7 @@ components:
6932
7296
  The given names this term reads, in first-seen order. A reader must
6933
7297
  bind these for the term to apply; binding none applies each given's
6934
7298
  declared default, as a live query would.
7299
+
6935
7300
  JoinedTerms:
6936
7301
  type: object
6937
7302
  required: [alias, source, terms]
@@ -6954,6 +7319,7 @@ components:
6954
7319
  description: >-
6955
7320
  The joined source's own stripped terms, which its binding re-applies
6956
7321
  with the caller's values.
7322
+
6957
7323
  PersistSourcePlan:
6958
7324
  type: object
6959
7325
  required: [name, sourceID, connectionName, sourceEntityId, sql, columns]