@malloy-publisher/server 0.9.6 → 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 (28) hide show
  1. package/dist/app/api-doc.yaml +866 -376
  2. package/dist/app/assets/EnvironmentPage-1dxk_vne.js +1 -0
  3. package/dist/app/assets/{HomePage-BPFJHBxN.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-BUb2Xvr2.es-17Y63pbB.js → RenderedResult-DZj-FnOJ.es-8Pxk7Ln2.js} +2 -2
  8. package/dist/app/assets/{RouteError-B4yUUZFj.js → RouteError-CXf8Frkp.js} +1 -1
  9. package/dist/app/assets/{ThemeEditorPage-CjK8EVnV.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-B3woRPfQ.js → index-Buv5Qzfs.js} +1 -1
  13. package/dist/app/assets/{index-dQ3jNgKw.js → index-BuyzVBLU.js} +1 -1
  14. package/dist/app/assets/index-CDTd6FbM.js +483 -0
  15. package/dist/app/assets/{index-CfX148tj.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 +20861 -22039
  19. package/dist/server.mjs +11545 -10927
  20. package/package.json +2 -2
  21. package/dist/app/assets/EnvironmentPage-wGTml4WZ.js +0 -1
  22. package/dist/app/assets/MainPage-CNLgQje2.js +0 -1
  23. package/dist/app/assets/ModelPage-Br6I_s4J.js +0 -2
  24. package/dist/app/assets/PackagePage-B6lmG1Uq.js +0 -1
  25. package/dist/app/assets/ToggleButtonGroup-BKiI79mw.js +0 -1
  26. package/dist/app/assets/documentRoutes-D_78AAbq.js +0 -1
  27. package/dist/app/assets/index-BIqIsMFr.js +0 -484
  28. package/dist/app/assets/index.es-Bhhg6pWY.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/
@@ -653,6 +656,10 @@ paths:
653
656
  $ref: "#/components/responses/NotFound"
654
657
  "500":
655
658
  $ref: "#/components/responses/InternalServerError"
659
+ "424":
660
+ $ref: "#/components/responses/ConnectionUnavailable"
661
+ "502":
662
+ $ref: "#/components/responses/DatabaseUnreachable"
656
663
  "503":
657
664
  $ref: "#/components/responses/ServiceUnavailable"
658
665
 
@@ -710,6 +717,10 @@ paths:
710
717
  $ref: "#/components/responses/NotFound"
711
718
  "500":
712
719
  $ref: "#/components/responses/InternalServerError"
720
+ "424":
721
+ $ref: "#/components/responses/ConnectionUnavailable"
722
+ "502":
723
+ $ref: "#/components/responses/DatabaseUnreachable"
713
724
  "503":
714
725
  $ref: "#/components/responses/ServiceUnavailable"
715
726
 
@@ -762,8 +773,12 @@ paths:
762
773
  $ref: "#/components/responses/Unauthorized"
763
774
  "404":
764
775
  $ref: "#/components/responses/NotFound"
776
+ "424":
777
+ $ref: "#/components/responses/ConnectionUnavailable"
765
778
  "500":
766
779
  $ref: "#/components/responses/InternalServerError"
780
+ "502":
781
+ $ref: "#/components/responses/DatabaseUnreachable"
767
782
  "503":
768
783
  $ref: "#/components/responses/ServiceUnavailable"
769
784
 
@@ -812,8 +827,12 @@ paths:
812
827
  $ref: "#/components/responses/Unauthorized"
813
828
  "404":
814
829
  $ref: "#/components/responses/NotFound"
830
+ "424":
831
+ $ref: "#/components/responses/ConnectionUnavailable"
815
832
  "500":
816
833
  $ref: "#/components/responses/InternalServerError"
834
+ "502":
835
+ $ref: "#/components/responses/DatabaseUnreachable"
817
836
  "503":
818
837
  $ref: "#/components/responses/ServiceUnavailable"
819
838
 
@@ -890,8 +909,12 @@ paths:
890
909
  $ref: "#/components/responses/NotFound"
891
910
  "413":
892
911
  $ref: "#/components/responses/PayloadTooLarge"
912
+ "424":
913
+ $ref: "#/components/responses/ConnectionUnavailable"
893
914
  "500":
894
915
  $ref: "#/components/responses/InternalServerError"
916
+ "502":
917
+ $ref: "#/components/responses/DatabaseUnreachable"
895
918
  "503":
896
919
  $ref: "#/components/responses/ServiceUnavailable"
897
920
  "504":
@@ -940,8 +963,12 @@ paths:
940
963
  $ref: "#/components/responses/Unauthorized"
941
964
  "404":
942
965
  $ref: "#/components/responses/NotFound"
966
+ "424":
967
+ $ref: "#/components/responses/ConnectionUnavailable"
943
968
  "500":
944
969
  $ref: "#/components/responses/InternalServerError"
970
+ "502":
971
+ $ref: "#/components/responses/DatabaseUnreachable"
945
972
  "503":
946
973
  $ref: "#/components/responses/ServiceUnavailable"
947
974
 
@@ -1008,6 +1035,10 @@ paths:
1008
1035
  $ref: "#/components/responses/NotFound"
1009
1036
  "500":
1010
1037
  $ref: "#/components/responses/InternalServerError"
1038
+ "424":
1039
+ $ref: "#/components/responses/ConnectionUnavailable"
1040
+ "502":
1041
+ $ref: "#/components/responses/DatabaseUnreachable"
1011
1042
  "503":
1012
1043
  $ref: "#/components/responses/ServiceUnavailable"
1013
1044
 
@@ -1070,6 +1101,10 @@ paths:
1070
1101
  $ref: "#/components/responses/NotFound"
1071
1102
  "500":
1072
1103
  $ref: "#/components/responses/InternalServerError"
1104
+ "424":
1105
+ $ref: "#/components/responses/ConnectionUnavailable"
1106
+ "502":
1107
+ $ref: "#/components/responses/DatabaseUnreachable"
1073
1108
  "503":
1074
1109
  $ref: "#/components/responses/ServiceUnavailable"
1075
1110
 
@@ -1126,8 +1161,12 @@ paths:
1126
1161
  $ref: "#/components/responses/Unauthorized"
1127
1162
  "404":
1128
1163
  $ref: "#/components/responses/NotFound"
1164
+ "424":
1165
+ $ref: "#/components/responses/ConnectionUnavailable"
1129
1166
  "500":
1130
1167
  $ref: "#/components/responses/InternalServerError"
1168
+ "502":
1169
+ $ref: "#/components/responses/DatabaseUnreachable"
1131
1170
  "503":
1132
1171
  $ref: "#/components/responses/ServiceUnavailable"
1133
1172
 
@@ -1182,8 +1221,12 @@ paths:
1182
1221
  $ref: "#/components/responses/Unauthorized"
1183
1222
  "404":
1184
1223
  $ref: "#/components/responses/NotFound"
1224
+ "424":
1225
+ $ref: "#/components/responses/ConnectionUnavailable"
1185
1226
  "500":
1186
1227
  $ref: "#/components/responses/InternalServerError"
1228
+ "502":
1229
+ $ref: "#/components/responses/DatabaseUnreachable"
1187
1230
  "503":
1188
1231
  $ref: "#/components/responses/ServiceUnavailable"
1189
1232
 
@@ -1262,8 +1305,12 @@ paths:
1262
1305
  $ref: "#/components/responses/NotFound"
1263
1306
  "413":
1264
1307
  $ref: "#/components/responses/PayloadTooLarge"
1308
+ "424":
1309
+ $ref: "#/components/responses/ConnectionUnavailable"
1265
1310
  "500":
1266
1311
  $ref: "#/components/responses/InternalServerError"
1312
+ "502":
1313
+ $ref: "#/components/responses/DatabaseUnreachable"
1267
1314
  "503":
1268
1315
  $ref: "#/components/responses/ServiceUnavailable"
1269
1316
  "504":
@@ -1318,8 +1365,12 @@ paths:
1318
1365
  $ref: "#/components/responses/Unauthorized"
1319
1366
  "404":
1320
1367
  $ref: "#/components/responses/NotFound"
1368
+ "424":
1369
+ $ref: "#/components/responses/ConnectionUnavailable"
1321
1370
  "500":
1322
1371
  $ref: "#/components/responses/InternalServerError"
1372
+ "502":
1373
+ $ref: "#/components/responses/DatabaseUnreachable"
1323
1374
  "503":
1324
1375
  $ref: "#/components/responses/ServiceUnavailable"
1325
1376
 
@@ -1587,11 +1638,10 @@ paths:
1587
1638
 
1588
1639
  On a package with a surface (a root `index.malloy`, or a legacy `explores`), only the
1589
1640
  files on that surface are listed, unless `includeHiddenFilesAndSources` is true. With it, every
1590
- model file is listed, and `isHidden` marks the ones the package hides. Dashboard files
1591
- are listed by the dashboards route either way. Served notebooks (a `.malloy` at the top of
1592
- `notebooks/` or `dashboards/` whose model-level `## artifact` tag says `kind=notebook`, or
1593
- names no `kind` and sits under `notebooks/`) are not models here, with or without a
1594
- 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.
1595
1645
  parameters:
1596
1646
  - name: environmentName
1597
1647
  in: path
@@ -1646,15 +1696,14 @@ paths:
1646
1696
  On a package with a surface (a root `index.malloy`, or a legacy `explores`), a file off
1647
1697
  that surface answers 404 with the same message a query to it gets, unless
1648
1698
  `includeHiddenFilesAndSources` is true. With it, the file is returned with its `sourceText`, whatever
1649
- sources the text names. Dashboard files and served notebooks (a `.malloy` at the top of
1650
- `notebooks/` or `dashboards/` whose model-level `## artifact` tag says `kind=notebook`, or
1651
- 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
1652
1701
  `queryableSources: "all"`, returns every file. For a file it returns, `modelDef.contents` and `modelDef.exports`,
1653
1702
  `modelInfo`, `sources` and `sourceInfos` are limited to the names the file publishes, so
1654
1703
  the surface file does not carry the hidden sources it imports. A join to a hidden source
1655
1704
  keeps only its name and the names and types of its fields. `sourceText` is left out
1656
1705
  when the text names a source the file does not publish, unless
1657
- `includeHiddenFilesAndSources` is true; the text of a dashboard is always returned.
1706
+ `includeHiddenFilesAndSources` is true; the text of a report is always returned.
1658
1707
  parameters:
1659
1708
  - name: environmentName
1660
1709
  in: path
@@ -1702,15 +1751,29 @@ paths:
1702
1751
  tags:
1703
1752
  - models
1704
1753
  operationId: update-model-source
1705
- summary: Write a dashboard or notebook file into the package
1754
+ summary: Write a report file into the package
1706
1755
  description: |
1707
- Writes the Malloy text of a dashboard file — `dashboards/<slug>.malloy` —
1708
- or a notebook file — `notebooks/<slug>.malloy`, which must carry an
1709
- `## artifact` tag (an untagged file there is a shared include and is
1710
- refused with 400, and so is a write over an existing file that is
1711
- not a notebook) — the only paths this endpoint accepts,
1712
- into the package, and reloads the package in place so it is served from
1713
- 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.
1714
1777
 
1715
1778
  The text is compiled first, as the file, and refused with its problems
1716
1779
  when it does not compile; nothing is written. The write is atomic (a
@@ -1728,21 +1791,16 @@ paths:
1728
1791
  merged: the caller re-opens and reapplies its change. Omit it to CREATE
1729
1792
  the file: a file that already exists is then refused with 409 too, so
1730
1793
  an unconditional overwrite is not something a caller can ask for by
1731
- leaving a field out. A notebook path over an existing file the package
1732
- does not serve as a notebook answers 400 instead, with or without a
1733
- 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,
1734
1797
  the reload and the restore all happen under one hold of the package
1735
1798
  lock, so two saves racing on one file cannot both pass the check, and a
1736
1799
  rollback cannot revert the other writer's text instead of its own.
1737
1800
 
1738
- A dashboard whose name (the file's basename) another file already holds
1739
- is refused with 409 before anything is written, since the name is its
1740
- URL and its `# drill` target. A `dashboards/` file whose text has no
1741
- `# artifact` or `## artifact` tag (an `artifact` property anywhere on a
1742
- tag line, outside a string) is refused with 400 before anything is
1743
- written; a tag only inside a block comment passes that check but the
1744
- compiled model carries none, so it is rolled back and answers 500. A
1745
- 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.
1746
1804
 
1747
1805
  A create answers 201 and an update 200; `created` in the body says the
1748
1806
  same thing.
@@ -1765,7 +1823,7 @@ paths:
1765
1823
  type: string
1766
1824
  - name: path
1767
1825
  in: path
1768
- 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`
1769
1827
  required: true
1770
1828
  schema:
1771
1829
  $ref: "#/components/schemas/PathPattern"
@@ -1804,9 +1862,8 @@ paths:
1804
1862
  $ref: "#/components/responses/NotFound"
1805
1863
  "409":
1806
1864
  description:
1807
- The file changed since the caller opened it, already exists and
1808
- no `expectedHash` was sent, or is a dashboard whose name another
1809
- file already holds
1865
+ The file changed since the caller opened it, or already exists and
1866
+ no `expectedHash` was sent
1810
1867
  content:
1811
1868
  application/json:
1812
1869
  schema:
@@ -1884,6 +1941,10 @@ paths:
1884
1941
  $ref: "#/components/responses/InternalServerError"
1885
1942
  "501":
1886
1943
  $ref: "#/components/responses/NotImplemented"
1944
+ "424":
1945
+ $ref: "#/components/responses/ConnectionUnavailable"
1946
+ "502":
1947
+ $ref: "#/components/responses/DatabaseUnreachable"
1887
1948
  "503":
1888
1949
  $ref: "#/components/responses/ServiceUnavailable"
1889
1950
  "504":
@@ -1925,9 +1986,11 @@ paths:
1925
1986
  that is both gated and hidden from the caller answers 404 for the whole
1926
1987
  request, as it does without a document. In a document, problem positions
1927
1988
  are lines of the submitted text, problems carry no `model` tag, and
1928
- `includeSql` returns no `sql`. A tag that names no `kind` is a dashboard
1929
- when it lists `tiles` or carries a `dashboard { … }` grid tag, and a
1930
- 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.
1931
1994
  parameters:
1932
1995
  - name: environmentName
1933
1996
  in: path
@@ -1975,20 +2038,165 @@ paths:
1975
2038
  "503":
1976
2039
  $ref: "#/components/responses/ServiceUnavailable"
1977
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.
1978
2179
  /environments/{environmentName}/packages/{packageName}/dashboards:
1979
2180
  get:
1980
2181
  tags:
1981
2182
  - dashboards
1982
2183
  operationId: list-dashboards
1983
- summary: List package dashboards
2184
+ deprecated: true
2185
+ summary: List package dashboards (deprecated; use list-reports)
1984
2186
  description: |
1985
- Lists the dashboards in the specified package — every tagged `.malloy`
1986
- file at the top of `dashboards/` or `notebooks/` carrying an
1987
- `# artifact` (or model-level `## artifact`) annotation whose `kind` is
1988
- `dashboard`, or names none under `dashboards/`. A `kind=notebook` file is
1989
- listed as a notebook instead, whichever folder it sits in. A file with
1990
- no artifact tag is a shared include and is not listed, whether or not it
1991
- 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`.
1992
2200
 
1993
2201
  A tagged dashboard that failed to compile is listed carrying its
1994
2202
  `error` where that state can arise at all, so a broken dashboard is
@@ -2055,14 +2263,27 @@ paths:
2055
2263
  tags:
2056
2264
  - dashboards
2057
2265
  operationId: get-dashboard
2058
- summary: Get a dashboard manifest
2266
+ deprecated: true
2267
+ summary: Get a dashboard manifest (deprecated; use get-report)
2059
2268
  description: |
2060
- Retrieves everything a viewer needs to render one dashboard: the artifact
2061
- tag's declarations plus the control contract derived from the givens its
2062
- 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
2063
2273
  query, each tile, and each control's suggest query all run
2064
2274
  through the model query endpoint with `givens`, using the manifest's
2065
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/`.
2066
2287
  parameters:
2067
2288
  - name: environmentName
2068
2289
  in: path
@@ -2079,11 +2300,11 @@ paths:
2079
2300
  - name: dashboardName
2080
2301
  in: path
2081
2302
  description: >-
2082
- The dashboard's name: its filename basename. Conventionally letters,
2303
+ The report's name: its filename basename. Conventionally letters,
2083
2304
  digits, "-" and "_", and a package is warned when one of its
2084
- dashboards falls outside that. It is NOT constrained to it, because
2305
+ grid reports falls outside that. It is NOT constrained to it, because
2085
2306
  the name comes from a filename rather than being chosen: a file such
2086
- as `dashboards/v1.2.malloy` is served, and its published `resource`
2307
+ as `v1.2.malloy` is served, and its published `resource`
2087
2308
  carries the name percent-encoded. Send it percent-encoded.
2088
2309
  required: true
2089
2310
  schema:
@@ -2106,6 +2327,14 @@ paths:
2106
2327
  $ref: "#/components/responses/Unauthorized"
2107
2328
  "404":
2108
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"
2109
2338
  "500":
2110
2339
  $ref: "#/components/responses/InternalServerError"
2111
2340
  "501":
@@ -2118,14 +2347,20 @@ paths:
2118
2347
  tags:
2119
2348
  - notebooks
2120
2349
  operationId: list-notebooks
2121
- summary: List package notebooks
2350
+ deprecated: true
2351
+ summary: List package notebooks (deprecated; use list-reports)
2122
2352
  description: |
2123
- Retrieves a list of all Malloy notebooks within the specified package: every
2124
- `.malloynb` file, and every `.malloy` file at the top of `notebooks/` or `dashboards/`
2125
- whose model-level `## artifact` tag says `kind=notebook` (or names no `kind` and sits
2126
- under `notebooks/`). Each notebook entry includes the relative path,
2127
- package name, title, description, and any compilation or reading error. This endpoint
2128
- 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.
2129
2364
  parameters:
2130
2365
  - name: environmentName
2131
2366
  in: path
@@ -2170,13 +2405,14 @@ paths:
2170
2405
  tags:
2171
2406
  - notebooks
2172
2407
  operationId: get-notebook
2173
- summary: Get Malloy notebook cells
2408
+ deprecated: true
2409
+ summary: Get Malloy notebook cells (deprecated; use get-report)
2174
2410
  description: |
2175
- Retrieves a Malloy notebook with its raw cell contents (markdown and code).
2176
- Cell execution should be done separately via the execute-notebook-cell endpoint.
2177
- A served notebook (a `.malloy` at the top of `notebooks/` or `dashboards/` whose
2178
- model-level `## artifact` tag says `kind=notebook`, or names no `kind` and sits under
2179
- `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`.
2180
2416
  On a package with a surface, the response shows only the sources the notebook may read.
2181
2417
  parameters:
2182
2418
  - name: environmentName
@@ -2224,13 +2460,19 @@ paths:
2224
2460
  tags:
2225
2461
  - notebooks
2226
2462
  operationId: execute-notebook-cell
2227
- summary: Execute a specific notebook cell
2463
+ deprecated: true
2464
+ summary: Execute a specific notebook cell (deprecated)
2228
2465
  description: |
2229
- Executes a specific cell in a Malloy notebook by index. For code cells, this compiles
2230
- and runs the Malloy code, returning query results and any new sources defined.
2231
- For markdown cells, this simply returns the cell content. A served notebook
2232
- (tagged `kind=notebook`, or untagged-kind under `notebooks/`) answers here as well as a
2233
- `.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`.
2234
2476
 
2235
2477
  On a package with a surface (a root `index.malloy`, or a legacy `explores`) with
2236
2478
  `queryableSources` left at `"declared"`, a code cell may read only sources the surface
@@ -2328,6 +2570,10 @@ paths:
2328
2570
  $ref: "#/components/responses/InternalServerError"
2329
2571
  "501":
2330
2572
  $ref: "#/components/responses/NotImplemented"
2573
+ "424":
2574
+ $ref: "#/components/responses/ConnectionUnavailable"
2575
+ "502":
2576
+ $ref: "#/components/responses/DatabaseUnreachable"
2331
2577
  "503":
2332
2578
  $ref: "#/components/responses/ServiceUnavailable"
2333
2579
  "504":
@@ -2869,6 +3115,31 @@ components:
2869
3115
  application/json:
2870
3116
  schema:
2871
3117
  $ref: "#/components/schemas/Error"
3118
+ ConnectionUnavailable:
3119
+ description: |
3120
+ The connection is misconfigured, so the query never ran. `reason`
3121
+ says how: CONNECTION_AUTH_FAILED (the database rejected the
3122
+ connection's credentials) or CONNECTION_NOT_FOUND (the model names a
3123
+ connection the environment does not have). The query is fine, and a
3124
+ retry fails the same way until the connection is fixed. For
3125
+ CONNECTION_AUTH_FAILED the body carries a fixed message, because the
3126
+ driver's text can name a user; it is logged.
3127
+ content:
3128
+ application/json:
3129
+ schema:
3130
+ $ref: "#/components/schemas/Error"
3131
+ DatabaseUnreachable:
3132
+ description: |
3133
+ The database connection failed. With `reason: CONNECTION_FAILED` the
3134
+ connection is down: the database could not be reached (refused, reset, timed out,
3135
+ or closed by the server), so the query never ran and a retry can
3136
+ succeed. That reason is what marks the customer's database being down
3137
+ rather than this server failing. The body carries a fixed message,
3138
+ because the driver's text can name an internal host; it is logged.
3139
+ content:
3140
+ application/json:
3141
+ schema:
3142
+ $ref: "#/components/schemas/Error"
2872
3143
  GatewayTimeout:
2873
3144
  description: |
2874
3145
  The query exceeded the per-request wall-clock budget
@@ -3313,11 +3584,11 @@ components:
3313
3584
  paths relative to the package root. Only these models are listed
3314
3585
  via `listModels()`, and the surface is the union of their
3315
3586
  `export {}` closures. Every other .malloy file still compiles for
3316
- import/join resolution but is hidden. Notebooks and dashboards are
3317
- always listed regardless of this field, and a dashboard entry
3318
- needs no listing: a tagged dashboard listed here reads the surface
3319
- and adds nothing to it. An untagged file under `dashboards/` that
3320
- 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.
3321
3592
  DEPRECATED, still honored. Every non-empty value gets a load
3322
3593
  warning naming the replacement: a root `index.malloy` that imports
3323
3594
  the listed files and exports what they publish. `[]` is deprecated
@@ -3376,23 +3647,28 @@ components:
3376
3647
  `queryableSources: "declared"`, and a root file such as
3377
3648
  `Index.malloy` that differs from `index.malloy` only in case and
3378
3649
  so is ignored. A root `index.malloy` with no manifest keys gets no
3379
- warning. Dashboard findings: a
3380
- `dashboards/` file whose `# artifact` tag does not parse or does not
3381
- describe a dashboard, a tile or suggest query that does not resolve,
3382
- a `# drill` naming a destination that is not a dashboard, and a
3383
- tile, single query or filter suggest that reads a source the
3384
- surface does not export, so it won't load. Two dashboard findings are about Publisher rather
3385
- than about the package: one when a file carrying an artifact tag
3386
- could not be read and so is not served at all, and one when the lint
3387
- stops early, in which case the list must be read as incomplete
3388
- rather than as a clean package. Notebook findings: a `notebooks/`
3389
- file with an `## artifact` note whose cells could not be read, which
3390
- names the line and the fix and is reported with severity `error`,
3391
- because the notebook is served with that error instead of opening.
3392
- The same family carries findings on files under `notebooks/` and
3393
- `dashboards/`, each naming its line and the fix; they are computed
3394
- at discovery and are also returned by `/compile` at file and
3395
- 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`:
3396
3672
  `notebook-statement-above-artifact` and `notebook-tag-above-artifact`
3397
3673
  (a statement or a tag above a served notebook's `## artifact`),
3398
3674
  `notebook-markdown-above-artifact` (a `(markdown)` annotation above
@@ -3403,9 +3679,18 @@ components:
3403
3679
  `notebook-markdown-attached-nowhere` (a `#(markdown)` annotation
3404
3680
  with no statement to take it), `notebook-artifact-unparsed` (an
3405
3681
  `## artifact` tag does not parse), and `notebook-cells-unreadable`
3406
- (the reader could not read a served notebook's cells). The rest are
3407
- `warn` (a mistyped `(markdown)` opener, a missing `kind=notebook`, a
3408
- 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).
3689
+ Deprecated-format findings, all `warn`: each `.malloynb` notebook
3690
+ (`model` is its path), and each source a file declares deprecated
3691
+ `#(filter)` annotations on (`model` is that file, `subject` the
3692
+ source; a source that only inherits or imports a filter is not
3693
+ reported). Both still load and run.
3409
3694
  Server-computed and read-only:
3410
3695
  ignored on
3411
3696
  create/update requests and only returned in responses. Present only
@@ -3496,8 +3781,8 @@ components:
3496
3781
  description: >-
3497
3782
  What the finding is about: the query or view a render finding
3498
3783
  sits on (`by_carrier`, `flights -> by_carrier`), the source a
3499
- materialization finding belongs to, or, for a dashboard
3500
- 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
3501
3786
  `# drill` is declared on. Absent when a finding sits on none
3502
3787
  of those, either because it spans several, in which case the
3503
3788
  message names them, or because it is about the lint itself
@@ -3505,13 +3790,33 @@ components:
3505
3790
  message:
3506
3791
  type: string
3507
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.
3508
3811
  severity:
3509
3812
  type: string
3510
3813
  enum:
3511
3814
  - error
3512
3815
  - warn
3513
3816
  description: >-
3514
- 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
3515
3820
  a tag malformed for the field it sits on, which renders as
3516
3821
  "[object Object]" or an inline error at query time, and `warn`
3517
3822
  for one that is well-formed but inert where it sits and so is
@@ -4110,240 +4415,155 @@ components:
4110
4415
  type: string
4111
4416
  description: Error message if the model failed to compile or load
4112
4417
 
4113
- Notebook:
4114
- type: object
4115
- description: Malloy notebook metadata and status information
4116
- properties:
4117
- environmentName:
4118
- type: string
4119
- description: Name of the environment containing this notebook
4120
- packageName:
4121
- type: string
4122
- description: Name of the package containing this notebook
4123
- path:
4124
- type: string
4125
- description: Relative path to the notebook file within its package directory
4126
- title:
4127
- type: string
4128
- description:
4129
- Human title. For a `.malloynb`, resolved from its own `## title="…"`,
4130
- then its `#"` doc comment, then its first markdown heading. For a
4131
- `.malloy` notebook, from the `title` in its `## artifact` tag, then
4132
- the first line of the `"` notes above that tag, then its first
4133
- markdown heading when no prose precedes it. Absent when none of
4134
- those resolve, leaving the caller to show the path.
4135
- description:
4136
- type: string
4137
- description:
4138
- The notebook's doc comment, when it has one. For a `.malloy`
4139
- notebook that is the `"` notes above the `## artifact` line; prose
4140
- below it is a `##(markdown)` or `##|(markdown)` cell.
4141
- error:
4142
- type: string
4143
- description: Error message if the notebook failed to compile or load
4144
-
4145
- Dashboard:
4418
+ Report:
4146
4419
  type: object
4420
+ required: [resource, packageName, path, name, layout, title, editable]
4147
4421
  description: |
4148
- A dashboard within a Malloy package: a self-contained `.malloy` file at
4149
- the top of the package's `dashboards/` or `notebooks/` directory carrying an `# artifact` (or
4150
- model-level `## artifact`) annotation. The list entry; see
4151
- 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.
4152
4426
  properties:
4153
4427
  resource:
4154
4428
  type: string
4155
- description: Resource path to the dashboard
4429
+ description: Resource path to the report (get-report)
4156
4430
  packageName:
4157
4431
  type: string
4158
- 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.
4159
4438
  name:
4160
4439
  type: string
4161
- description:
4162
- The dashboard's slug — its filename basename. Addresses it in a URL
4163
- and as a `# drill` target.
4164
- 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:
4165
4444
  type: string
4166
- description:
4167
- Relative path to the dashboard file within its package directory
4168
- (`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.
4169
4450
  title:
4170
4451
  type: string
4171
- description:
4172
- Human title from the artifact tag, falling back to the file's `#"`
4173
- 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`.
4174
4456
  description:
4175
4457
  type: string
4458
+ description: The report's doc comment, when it has one.
4459
+ editable:
4460
+ type: boolean
4176
4461
  description: >-
4177
- The file's unnamed `"` notes above the `## artifact` tag; when it
4178
- has none there, the ones below it (a legacy spot the lint flags). For
4179
- 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.
4180
4464
  error:
4181
4465
  type: string
4182
- 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.
4183
4469
 
4184
- DashboardManifest:
4185
- type: object
4470
+ ReportManifest:
4186
4471
  description: |
4187
- Everything a viewer needs to render one dashboard: the artifact tag's
4188
- declarations plus the control contract derived from the givens its query
4189
- references. Running needs no dashboard-specific endpoint — the query,
4190
- each tile, and each control's suggest query all run through
4191
- 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`.
4192
4534
  properties:
4193
- resource:
4194
- type: string
4195
- description: Resource path to the dashboard
4196
- packageName:
4535
+ kind:
4197
4536
  type: string
4198
- 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`.
4199
4541
  name:
4200
- type: string
4201
- description:
4202
- The dashboard's slug — its filename basename. Addresses it in a URL
4203
- and as a `# drill` target.
4204
- path:
4205
- type: string
4206
- description: |
4207
- Relative path to the dashboard file within its package directory
4208
- (`dashboards/<name>.malloy`). This is also the model to POST to:
4209
- `query`, each tile, and each control's suggest query all run through
4210
- `POST /environments/{environmentName}/packages/{packageName}/models/{path}/query`
4211
- with `givens`, which is why there is no dashboard-specific run
4212
- endpoint.
4213
- title:
4214
- type: string
4215
- description:
4216
- Human title from the artifact tag, falling back to the file's `#"`
4217
- doc comment and then to the slug
4218
- description:
4219
4542
  type: string
4220
4543
  description: >-
4221
- The file's unnamed `"` notes above the `## artifact` tag; when it
4222
- has none there, the ones below it (a legacy spot the lint flags). For
4223
- a dashboard whose tag sits on one query, that query's `#"` notes.
4224
- error:
4225
- type: string
4226
- description: Error message if the dashboard file failed to compile
4227
- 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:
4228
4547
  type: string
4229
- enum: [dashboard, notebook]
4230
4548
  description: >-
4231
- What the document is, from the `kind` property of its artifact tag
4232
- (the folder only decides the default when the tag says nothing). A
4233
- `notebook` is laid out as one column: `dashboardColumns` is 1
4234
- whatever the file says. Always `dashboard` on
4235
- `GET …/dashboards/{dashboardName}`; a notebook's manifest is the
4236
- `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.
4237
4552
  query:
4238
4553
  type: string
4239
4554
  description: >-
4240
- Name of the tagged query whose single result IS the page. Set when the
4241
- `# artifact` tag sits on a `query:`; a dashboard authored the ordinary
4242
- way carries `tiles` instead and leaves this absent. A NAME rather than
4243
- an expression, so it goes in the `queryName` field of a
4244
- `POST …/models/{path}/query` body. A tile's `query` is the other shape
4245
- and is not interchangeable with this one; see `DashboardTile.query`.
4246
- tiles:
4247
- type: array
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:
4560
+ type: boolean
4248
4561
  description: >-
4249
- The dashboard's tiles, each run as its own query and combined into one
4250
- grid. This is how a dashboard is normally authored, and the only form
4251
- that can span sources. Absent when the `# artifact` tag sits on a
4252
- `query:` instead, in which case `query` is set.
4253
- items:
4254
- $ref: "#/components/schemas/DashboardTile"
4255
- dashboardColumns:
4256
- type: integer
4257
- description: >-
4258
- Grid width, from the `# dashboard {columns=N}` render tag beside the
4259
- artifact tag. One spelling wherever the artifact tag sits: Publisher
4260
- reads it at model level to lay out `tiles`, and `@malloydata/render`
4261
- reads the same tag off a tagged `query:`. Absent means the viewer's
4262
- default.
4263
- startingGivens:
4264
- allOf:
4265
- - $ref: "#/components/schemas/EncodedGivenValues"
4266
- description:
4267
- Per-dashboard starting values for controls, from the artifact tag.
4268
- URL parameters override these, which is why the two share a shape.
4269
- autorun:
4270
- type: boolean
4271
- description:
4272
- False batches control changes behind an Apply button instead of
4273
- re-running on every change. Defaults to true.
4274
- givens:
4275
- type: array
4276
- description: |
4277
- The control row. Normally one entry per given the dashboard runs
4278
- with: the union over `tiles` (less a given only a source's gate
4279
- reads, which a host injects rather than a viewer sets), or what `query` references when the tag
4280
- sits on a query, and which the entry file
4281
- can bind. The row widens to
4282
- every given the entry file surfaces when any tile is one discovery
4283
- cannot resolve, because that tile's givens are otherwise absent from
4284
- the row it filters by; see `DashboardTile.givenNames`. So an entry
4285
- here is always bindable, but on a widened row it is not necessarily
4286
- referenced by any tile. A given reachable only
4287
- through an import chain the entry file does not import itself
4288
- cannot be bound at query time, so no control is offered for it and
4289
- it stays at its default; that case is reported in the package's
4290
- `warnings` rather than represented here by an unusable entry. Plain
4291
- `Given`s, because the presentation a control takes is declared on
4292
- the given itself, so a dashboard and a notebook render the same
4293
- control for the same given, `#(description=…)` helper text
4294
- included.
4295
-
4296
- ONE DELIBERATE DIVERGENCE from `Given` as the model surface sends
4297
- it: `default` here is the value the QUERY ENDPOINT takes, not the
4298
- Malloy source literal. A `filter<…>` given declared `f'West'`
4299
- publishes `West`. As the literal it could not be used as a default
4300
- at all, since sending it back verbatim matches zero rows silently,
4301
- with no error to search for. Only filter-typed givens are unwrapped,
4302
- so a plain string default that merely reads like `f'x'` is
4303
- untouched. `startingGivens` uses the same shape for the same reason.
4304
- items:
4305
- $ref: "#/components/schemas/Given"
4306
-
4307
- DashboardTile:
4308
- type: object
4309
- description: >-
4310
- One tile of a dashboard. A `query` tile (the default) runs a query; a
4311
- `text` tile shows markdown and runs nothing, so a caller that runs a
4312
- dashboard's tiles skips the ones with `kind` `text`.
4313
- properties:
4314
- kind:
4315
- type: string
4316
- enum: [query, text]
4317
- description: >-
4318
- `query` runs `query` through the model query endpoint; `text` shows
4319
- `markdown`. Absent means `query`.
4320
- name:
4321
- type: string
4322
- description: >-
4323
- A text tile's name: the bare word in `tiles=[…]` and on its
4324
- `##|(markdown) name` block. Absent on a query tile.
4325
- markdown:
4326
- type: string
4327
- description: >-
4328
- A text tile's body, the text of its `##|(markdown) name` block
4329
- without the opener. Empty when the file has no such block. Absent on
4330
- a query tile.
4331
- query:
4332
- type: string
4333
- description: >-
4334
- Absent on a text tile. The run expression exactly as written in `tiles=[…]`, for example
4335
- "orders -> by_month". An EXPRESSION rather than a name, so it goes in
4336
- the `query` field of a `POST …/models/{path}/query` body, prefixed
4337
- with `run:`. Sending it in `queryName`, the field
4338
- `DashboardManifest.query` takes, is rejected.
4339
- restricted:
4340
- type: boolean
4341
- description: >-
4342
- Set on a tile of a compiled document (`CompileResult.document`) whose
4343
- source the caller may not read. The tile carries its `query` and
4344
- nothing derived from the source: no `givenNames`, no layout tags.
4345
- givenNames:
4346
- type: array
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:
4566
+ type: array
4347
4567
  items:
4348
4568
  type: string
4349
4569
  description: |
@@ -4358,7 +4578,7 @@ components:
4358
4578
  could not resolve the tile (its expression neither compiles nor is
4359
4579
  a plain `source -> view` or named query the static walk reads), in
4360
4580
  which case send the whole control row. One such tile
4361
- widens `DashboardManifest.givens` to every given the entry file
4581
+ widens `ReportManifest.givens` to every given the entry file
4362
4582
  surfaces, rather than the union over the resolvable tiles, so that
4363
4583
  the row actually contains the givens that tile filters by.
4364
4584
  label:
@@ -4397,43 +4617,11 @@ components:
4397
4617
  resolves for a `# dashboard` nest child, read the same way here so one
4398
4618
  view presents identically as a tile and as a nest.
4399
4619
 
4400
- DataApp:
4401
- type: object
4402
- description:
4403
- An in-package HTML data app within a Malloy package - a static page
4404
- served from the package's public/ directory
4405
- properties:
4406
- resource:
4407
- type: string
4408
- description:
4409
- Canonical URL to the served data app. Root-relative and does
4410
- NOT carry the /api/v0 prefix, because a data app is a static asset
4411
- served off the server root rather than an API resource.
4412
- packageName:
4413
- type: string
4414
- description: Name of the package containing this data app
4415
- path:
4416
- type: string
4417
- description: Relative path to the HTML file within its package directory
4418
- title:
4419
- type: string
4420
- description:
4421
- Title extracted from the file's <title> tag, or the path if
4422
- not present
4423
- fit:
4424
- type: string
4425
- enum:
4426
- - viewport
4427
- description:
4428
- Layout hint read from a <meta name="publisher:fit"> tag in the
4429
- page <head>. "viewport" tells the embedded viewer to fill the
4430
- available height instead of auto-sizing to the content height, for
4431
- full-screen apps like slide decks. Omitted for an ordinary
4432
- content-driven app, which keeps content-height auto-sizing.
4433
-
4434
- RawNotebook:
4620
+ ReportCells:
4435
4621
  type: object
4436
- 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.
4437
4625
  properties:
4438
4626
  type:
4439
4627
  type: string
@@ -4450,9 +4638,8 @@ components:
4450
4638
  enum: ["malloynb", "malloy"]
4451
4639
  description:
4452
4640
  The file format the notebook is written in. `malloynb` is the
4453
- cell-separated format; `malloy` is a `.malloy` at the top of `notebooks/` or
4454
- `dashboards/` whose model-level `## artifact` tag says `kind=notebook` (or names no
4455
- `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
4456
4643
  its statements and its floating `(markdown)` notes in file order.
4457
4644
  malloyVersion:
4458
4645
  type: string
@@ -4465,16 +4652,6 @@ components:
4465
4652
  description: Array of notebook cells containing raw markdown and code content
4466
4653
  items:
4467
4654
  $ref: "#/components/schemas/NotebookCell"
4468
- dashboard:
4469
- allOf:
4470
- - $ref: "#/components/schemas/DashboardManifest"
4471
- description: >-
4472
- The tile layout of a notebook written as one (`## artifact {
4473
- kind=notebook tiles=[…] }`), in the shape a dashboard has, with
4474
- `kind` `notebook` and one column. Absent on a notebook written as
4475
- cells. Its tiles run through the model query endpoint at
4476
- `modelPath`; `notebookCells` carries the same content as cells for
4477
- readers that do not draw a layout.
4478
4655
  annotations:
4479
4656
  type: array
4480
4657
  description:
@@ -4513,6 +4690,271 @@ components:
4513
4690
  items:
4514
4691
  $ref: "#/components/schemas/Query"
4515
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
+
4516
4958
  CompiledModel:
4517
4959
  type: object
4518
4960
  description: Compiled Malloy model with sources, queries, and metadata
@@ -4890,7 +5332,9 @@ components:
4890
5332
  type: string
4891
5333
  description:
4892
5334
  Query string to execute on the model. If the query parameter is
4893
- set, the queryName parameter must be empty.
5335
+ set, the queryName parameter must be empty. It may hold one run
5336
+ statement, after any source or query definitions; text with more
5337
+ than one run statement is a 400, since only the last would run.
4894
5338
  sourceName:
4895
5339
  type: string
4896
5340
  description: |
@@ -5704,8 +6148,7 @@ components:
5704
6148
  type: integer
5705
6149
  minimum: 1
5706
6150
  maximum: 2147483647
5707
- description:
5708
- Maximum run time of each statement on the database, in
6151
+ description: Maximum run time of each statement on the database, in
5709
6152
  milliseconds. The database cancels a statement that exceeds it.
5710
6153
  When omitted, the database's own statement_timeout applies. Not
5711
6154
  applied to a DuckLake catalog connection.
@@ -5911,6 +6354,7 @@ components:
5911
6354
  required:
5912
6355
  - storage
5913
6356
  - catalog
6357
+
5914
6358
  BigqueryConnection:
5915
6359
  type: object
5916
6360
  description: Google BigQuery database connection configuration
@@ -6077,11 +6521,13 @@ components:
6077
6521
  DuckdbConnection:
6078
6522
  type: object
6079
6523
  description: >
6080
- DuckDB database connection configuration. Exposes data-source intent,
6081
- attached foreign databases, and optional setup SQL for initialization
6082
- (e.g. ATTACH commands for external lakehouses), subject to Publisher policy
6083
- (setup SQL must be enabled with PUBLISHER_ALLOW_DUCKDB_SETUP_SQL=true and
6084
- is refused under EXTENSION_FETCH_POLICY=local-only).
6524
+ DuckDB database connection configuration: attached foreign databases,
6525
+ and optional setup SQL for anything they do not cover (e.g. ATTACH
6526
+ commands for external lakehouses). Setup SQL must be enabled with
6527
+ PUBLISHER_ALLOW_DUCKDB_SETUP_SQL=true and is refused under
6528
+ EXTENSION_FETCH_POLICY=local-only. Database files, working directories,
6529
+ filesystem/network policy, extension loading, temp directories, and
6530
+ resource knobs remain owned by Publisher.
6085
6531
  properties:
6086
6532
  setupSQL:
6087
6533
  type: string
@@ -6089,7 +6535,11 @@ components:
6089
6535
  Optional initialization SQL script executed against the DuckDB
6090
6536
  session upon connection (e.g. ATTACH commands for external lakehouses).
6091
6537
  Multiple statements must be separated by a semicolon and newline (;\n).
6092
- Refused unless the deployment sets PUBLISHER_ALLOW_DUCKDB_SETUP_SQL=true.
6538
+ Use absolute paths: a relative path resolves against the server's
6539
+ working directory. Withheld from responses like a credential; an
6540
+ update that omits it keeps the stored script, and an empty string
6541
+ removes it. Refused unless the deployment sets
6542
+ PUBLISHER_ALLOW_DUCKDB_SETUP_SQL=true.
6093
6543
  attachedDatabases:
6094
6544
  type: array
6095
6545
  items:
@@ -6122,6 +6572,7 @@ components:
6122
6572
  azureConnection:
6123
6573
  $ref: "#/components/schemas/AzureConnection"
6124
6574
  # TODO: What is this? Can we remove it?
6575
+
6125
6576
  SqlSource:
6126
6577
  type: object
6127
6578
  properties:
@@ -6199,12 +6650,28 @@ components:
6199
6650
  says nothing about whether the caller reached the right server; the
6200
6651
  latter is a routing problem worth retrying elsewhere.
6201
6652
 
6653
+ CONNECTION_FAILED, on a 502, means the database could not be
6654
+ reached (the connection was refused, reset or timed out, or the
6655
+ server closed it), so the query never ran. The query and the model
6656
+ are fine; retrying elsewhere will not help, and neither will
6657
+ rewriting the query.
6658
+
6659
+ CONNECTION_AUTH_FAILED, on a 424, means the database rejected the
6660
+ connection's credentials (a wrong password, an invalid key, an
6661
+ expired token), so the query never ran. Whoever configures the
6662
+ connection has to fix it; retrying fails the same way.
6663
+
6664
+ CONNECTION_NOT_FOUND, on a 424, means the model names a connection
6665
+ the environment does not have, usually one deleted after the
6666
+ package was loaded.
6667
+
6202
6668
  Deliberately an open string rather than an enum. Generators render
6203
6669
  an enum closed, so adding a second value here would break every
6204
6670
  client generated before it -- on the one field whose purpose is to
6205
6671
  grow. Callers must treat an unrecognized value as absent.
6206
6672
 
6207
- Known values: TABLE_NOT_FOUND.
6673
+ Known values: TABLE_NOT_FOUND, CONNECTION_FAILED,
6674
+ CONNECTION_AUTH_FAILED, CONNECTION_NOT_FOUND.
6208
6675
  problems:
6209
6676
  type: array
6210
6677
  description: |
@@ -6314,10 +6781,16 @@ components:
6314
6781
  "package" runs the same worker compiler and file selection as
6315
6782
  reload over every .malloy and .malloynb file, without swapping the
6316
6783
  result into the served package; with a source, importers compile
6317
- against the replacement. Package diagnostics can name files hidden
6318
- from discovery. No rows or SQL are returned, and caller-provided
6319
- source remains subject to authorize gates. includeSql is not
6320
- available at "package".
6784
+ against the replacement. It also reports the render-tag findings
6785
+ (code "render-tag") and the dashboard, given and drill findings
6786
+ (code "dashboard-lint") a reload would put on the package's
6787
+ warnings, at their own severity and with no position. The
6788
+ package's other warnings (storage, persist, materialization,
6789
+ explores, surface and discovery warnings, among others) are not
6790
+ reported. Package diagnostics can name
6791
+ files hidden from discovery. No rows or SQL are returned, and
6792
+ caller-provided source remains subject to authorize gates.
6793
+ includeSql is not available at "package".
6321
6794
 
6322
6795
  "append" text is checked against the model's PUBLISHED surface, so
6323
6796
  it may not declare its own data roots: import, connection.table(…),
@@ -6422,13 +6895,20 @@ components:
6422
6895
  serves once saved. Present only when the source carries a model-level
6423
6896
  `## artifact` tag and compiled far enough to read.
6424
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.
6425
6905
  kind:
6426
6906
  type: string
6427
6907
  enum: [dashboard, notebook]
6908
+ deprecated: true
6428
6909
  description: >-
6429
- From the tag's `kind`. When it names none, a document that lists
6430
- `tiles` or carries a `dashboard { … }` grid tag is a dashboard and
6431
- 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.
6432
6912
  manifest:
6433
6913
  allOf:
6434
6914
  - $ref: "#/components/schemas/DashboardManifest"
@@ -6816,6 +7296,7 @@ components:
6816
7296
  The given names this term reads, in first-seen order. A reader must
6817
7297
  bind these for the term to apply; binding none applies each given's
6818
7298
  declared default, as a live query would.
7299
+
6819
7300
  JoinedTerms:
6820
7301
  type: object
6821
7302
  required: [alias, source, terms]
@@ -6838,6 +7319,7 @@ components:
6838
7319
  description: >-
6839
7320
  The joined source's own stripped terms, which its binding re-applies
6840
7321
  with the caller's values.
7322
+
6841
7323
  PersistSourcePlan:
6842
7324
  type: object
6843
7325
  required: [name, sourceID, connectionName, sourceEntityId, sql, columns]
@@ -7783,14 +8265,22 @@ components:
7783
8265
  file does not publish. That text can include `#(authorize)`
7784
8266
  expressions, `given:` defaults, connection names and raw SQL.
7785
8267
 
7786
- Only the models list, the model GET and the query route read it. The
7787
- notebook-cell route, the dashboards route, the MCP tools, and the legacy
7788
- `/projects/...` aliases of these routes ignore it.
8268
+ Only the models list, the model GET and the query route read it, plus
8269
+ the MCP `execute_query` tool's argument of the same name, which runs a
8270
+ query the way this route does. MCP offers that argument only when
8271
+ `publisher.config.json` sets `"mcp": { "includeHiddenFilesAndSources":
8272
+ true }`, which is for authoring servers. Without it the argument is not
8273
+ in the tool's schema and is ignored if sent, so an agent answering
8274
+ questions stays on the curated surface.
8275
+ This route is not affected by that setting. The notebook-cell route, the dashboards
8276
+ route, the other MCP tools, and the legacy `/projects/...` aliases of
8277
+ these routes ignore it.
7789
8278
 
7790
8279
  Like every route on this server, it is unauthenticated. A deployment
7791
8280
  that authenticates in front of Publisher decides who may send it, and
7792
8281
  should pass it only for callers allowed to work with a package's hidden
7793
- files, such as its authors.
8282
+ files, such as its authors. A deployment that exposes the MCP port has
8283
+ to make the same decision for the `execute_query` argument.
7794
8284
 
7795
8285
  Only `true` and `false` are accepted. Any other value is refused with
7796
8286
  400.