@malloy-publisher/server 0.9.9 → 0.9.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/app/api-doc.yaml +48 -41
- package/dist/app/assets/EnvironmentPage-tIGzymgb.js +1 -0
- package/dist/app/assets/HomePage-7QkNvQ_3.js +1 -0
- package/dist/app/assets/MainPage-BpE_5WuW.js +1 -0
- package/dist/app/assets/ModelPage-ftyDI1tw.js +2 -0
- package/dist/app/assets/PackagePage-QGnFwlHu.js +1 -0
- package/dist/app/assets/RenderedResult-Cmx8sX8d.es-du-Qe1x0.js +153 -0
- package/dist/app/assets/{RouteError-ziodz3bt.js → RouteError-zM4SSZaU.js} +1 -1
- package/dist/app/assets/{ThemeEditorPage-Cs3rIs4e.js → ThemeEditorPage-DhZJXGJm.js} +1 -1
- package/dist/app/assets/ToggleButtonGroup-TKxhg0Mg.js +1 -0
- package/dist/app/assets/{documentRoutes-1Qgo5Pvl.js → documentRoutes-D4TbSIi5.js} +1 -1
- package/dist/app/assets/editPageMounted-0kzl2sgg.js +2 -0
- package/dist/app/assets/{index-CXJpj7He.js → index-B-qJVEXn.js} +1 -1
- package/dist/app/assets/{index-Bwc6-9Dc.js → index-Bzi4YH8Y.js} +1 -1
- package/dist/app/assets/{index-CA5a5gJj.js → index-CS4mmuDD.js} +1 -1
- package/dist/app/assets/{index-sKcoT1e_.js → index-DFDVJFPm.js} +32 -32
- package/dist/app/assets/index-gQEuz0Cg.js +480 -0
- package/dist/app/assets/index.es-B3P9tIm3.js +143 -0
- package/dist/app/index.html +1 -1
- package/dist/package_load_worker.mjs +36 -12
- package/dist/server.mjs +782 -653
- package/package.json +1 -1
- package/dist/app/assets/EnvironmentPage-DaNUmaHg.js +0 -1
- package/dist/app/assets/HomePage-CRLoVDIs.js +0 -1
- package/dist/app/assets/MainPage-BsV5UnlK.js +0 -1
- package/dist/app/assets/ModelPage-DOOiyJAE.js +0 -2
- package/dist/app/assets/PackagePage-QHG55rBw.js +0 -1
- package/dist/app/assets/RenderedResult-BHuJpdSn.es-C37LMpwi.js +0 -153
- package/dist/app/assets/ToggleButtonGroup-BrygJ1WP.js +0 -1
- package/dist/app/assets/index-BK0mbcyQ.js +0 -483
- package/dist/app/assets/index.es-CxcPJdYO.js +0 -195
- package/dist/sshcrypto-cqb52edz.node +0 -0
package/dist/app/index.html
CHANGED
|
@@ -16,7 +16,7 @@ SPDX-License-Identifier: MIT
|
|
|
16
16
|
href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap"
|
|
17
17
|
/>
|
|
18
18
|
<title>Malloy Publisher</title>
|
|
19
|
-
<script type="module" crossorigin src="/assets/index-
|
|
19
|
+
<script type="module" crossorigin src="/assets/index-gQEuz0Cg.js"></script>
|
|
20
20
|
<link rel="stylesheet" crossorigin href="/assets/index-DUqldpo0.css">
|
|
21
21
|
</head>
|
|
22
22
|
<body>
|
|
@@ -20619,6 +20619,12 @@ function ownLevelNoteTexts(annote) {
|
|
|
20619
20619
|
function ownLevelNotes(annote) {
|
|
20620
20620
|
return [...annote?.blockNotes ?? [], ...annote?.notes ?? []];
|
|
20621
20621
|
}
|
|
20622
|
+
function sameNotePosition(a, b) {
|
|
20623
|
+
return a.url === b.url && a.range.start.line === b.range.start.line && a.range.start.character === b.range.start.character && a.range.end.line === b.range.end.line && a.range.end.character === b.range.end.character;
|
|
20624
|
+
}
|
|
20625
|
+
function notePositionKey(at) {
|
|
20626
|
+
return `${at.url}#${at.range.start.line}:${at.range.start.character}-${at.range.end.line}:${at.range.end.character}`;
|
|
20627
|
+
}
|
|
20622
20628
|
|
|
20623
20629
|
// src/service/notebook.ts
|
|
20624
20630
|
var ARTIFACT_NOTE = {
|
|
@@ -21071,7 +21077,7 @@ ${body}`;
|
|
|
21071
21077
|
if (artifactAt < 0) {
|
|
21072
21078
|
return refuse({
|
|
21073
21079
|
line: 1,
|
|
21074
|
-
message: "Line 1: this notebook has no ## artifact note, so its header cannot be told from its cells. Fix: add `## artifact { layout=linear }` after the ##! line."
|
|
21080
|
+
message: "Line 1: this notebook has no ## artifact note, so its header cannot be told from its cells. Fix: add `## artifact { layout=linear tiles=[…] }` after the ##! line."
|
|
21075
21081
|
});
|
|
21076
21082
|
}
|
|
21077
21083
|
const runCount = items.filter((item) => item.kind === "statement" && item.run).length;
|
|
@@ -21271,12 +21277,14 @@ function readReportTag(modelNotes) {
|
|
|
21271
21277
|
const kind = tagText(artifact, "kind");
|
|
21272
21278
|
if (kind !== undefined)
|
|
21273
21279
|
return { status: "kind-removed", kind };
|
|
21274
|
-
const
|
|
21275
|
-
if (
|
|
21276
|
-
return { status: "
|
|
21277
|
-
|
|
21278
|
-
|
|
21279
|
-
|
|
21280
|
+
const hasTiles = artifact.has("tiles");
|
|
21281
|
+
if (hasTiles && artifact.array("tiles") === undefined)
|
|
21282
|
+
return { status: "unparsed" };
|
|
21283
|
+
const declared = tagText(artifact, "layout");
|
|
21284
|
+
const layout = parseLayoutValue(declared) ?? (hasTiles || tags?.tag("dashboard") !== undefined ? "grid" : "linear");
|
|
21285
|
+
if (layout === "linear" && !hasTiles)
|
|
21286
|
+
return declared !== undefined && parseLayoutValue(declared) === undefined ? { status: "cells-removed", unknownLayout: declared } : { status: "cells-removed" };
|
|
21287
|
+
return { status: "report", layout };
|
|
21280
21288
|
}
|
|
21281
21289
|
function readReportTagOfText(text) {
|
|
21282
21290
|
return readReportTag(modelNotesOfText(text));
|
|
@@ -23480,6 +23488,9 @@ function extractSourcesFromModelDef(modelDef, givens, onParseError) {
|
|
|
23480
23488
|
const authorizeMap = new Map;
|
|
23481
23489
|
const misplacedAuthorize = [];
|
|
23482
23490
|
const gatedSourceOwnAuthorizeNotes = new Set;
|
|
23491
|
+
const gatedSourceOwnAuthorizeNoteKeys = new Set;
|
|
23492
|
+
const noteKey = (note) => `${notePositionKey(note.at)}#${note.text}`;
|
|
23493
|
+
const isGatedSourceOwnNote = (note) => gatedSourceOwnAuthorizeNotes.has(note) || gatedSourceOwnAuthorizeNoteKeys.has(noteKey(note));
|
|
23483
23494
|
const authorizeNoteDeclaredBy = new Map;
|
|
23484
23495
|
const nearMissAuthorize = [];
|
|
23485
23496
|
const sweptStructs = [];
|
|
@@ -23491,6 +23502,7 @@ function extractSourcesFromModelDef(modelDef, givens, onParseError) {
|
|
|
23491
23502
|
for (const note of ownLevelNotes(struct.annotations)) {
|
|
23492
23503
|
if (containsAuthorizeAnnotationTag([note.text])) {
|
|
23493
23504
|
gatedSourceOwnAuthorizeNotes.add(note);
|
|
23505
|
+
gatedSourceOwnAuthorizeNoteKeys.add(noteKey(note));
|
|
23494
23506
|
considerNoteOwner(authorizeNoteDeclaredBy, note, struct);
|
|
23495
23507
|
}
|
|
23496
23508
|
}
|
|
@@ -23509,6 +23521,7 @@ function extractSourcesFromModelDef(modelDef, givens, onParseError) {
|
|
|
23509
23521
|
for (const note of ownLevelNotes(entry.annotations)) {
|
|
23510
23522
|
if (containsAuthorizeAnnotationTag([note.text])) {
|
|
23511
23523
|
gatedSourceOwnAuthorizeNotes.add(note);
|
|
23524
|
+
gatedSourceOwnAuthorizeNoteKeys.add(noteKey(note));
|
|
23512
23525
|
considerNoteOwner(authorizeNoteDeclaredBy, note, entry);
|
|
23513
23526
|
}
|
|
23514
23527
|
}
|
|
@@ -23607,7 +23620,7 @@ function extractSourcesFromModelDef(modelDef, givens, onParseError) {
|
|
|
23607
23620
|
const fieldAuthorizeNotes = ownLevelNotes(field.annotations).filter((note) => containsAuthorizeAnnotationTag([note.text]));
|
|
23608
23621
|
if (fieldAuthorizeNotes.length === 0)
|
|
23609
23622
|
continue;
|
|
23610
|
-
if (fieldAuthorizeNotes.every(
|
|
23623
|
+
if (fieldAuthorizeNotes.every(isGatedSourceOwnNote)) {
|
|
23611
23624
|
continue;
|
|
23612
23625
|
}
|
|
23613
23626
|
const fieldName = field.as || field.name;
|
|
@@ -23715,6 +23728,11 @@ function readGivenControlSpec(annotationTexts2) {
|
|
|
23715
23728
|
}
|
|
23716
23729
|
return spec;
|
|
23717
23730
|
}
|
|
23731
|
+
function givenDeclaresNoDefault(given) {
|
|
23732
|
+
const loose = given;
|
|
23733
|
+
const parsed = "default" in loose ? loose.default : loose._internal?.default;
|
|
23734
|
+
return parsed === undefined && loose._internal?.defaultText === undefined;
|
|
23735
|
+
}
|
|
23718
23736
|
function malloyGivenToApi(given) {
|
|
23719
23737
|
const type = given.type;
|
|
23720
23738
|
const renderedType = type.type === "filter expression" ? `filter<${type.filterType}>` : type.type === "array" && type.elementTypeDef?.type ? `${type.elementTypeDef.type}[]` : type.type;
|
|
@@ -23725,7 +23743,8 @@ function malloyGivenToApi(given) {
|
|
|
23725
23743
|
annotations: allNotes.filter((note) => !isReservedRoute(note.route) && note.route !== MARKDOWN_ROUTE).map((note) => note.text),
|
|
23726
23744
|
...readGivenControlSpec(allNotes.map((note) => note.text)),
|
|
23727
23745
|
...allNotes.some((note) => note.route === "secure") && { secure: true },
|
|
23728
|
-
default: given._internal?.defaultText
|
|
23746
|
+
default: given._internal?.defaultText,
|
|
23747
|
+
...givenDeclaresNoDefault(given) && { required: true }
|
|
23729
23748
|
};
|
|
23730
23749
|
}
|
|
23731
23750
|
function collectGivenRefs(value, into) {
|
|
@@ -26370,7 +26389,13 @@ async function prepareForMainThread(job, malloyConfig, load, model) {
|
|
|
26370
26389
|
const pastDeadline = () => performance.now() >= load.softDeadline;
|
|
26371
26390
|
const { modelPath, materializer, importBaseURL } = model;
|
|
26372
26391
|
const renderTagResults = [];
|
|
26373
|
-
|
|
26392
|
+
const targets = renderTagTargets(model.queries, model.sources);
|
|
26393
|
+
if (targets.length > 0 && !load.failed && !pastDeadline()) {
|
|
26394
|
+
try {
|
|
26395
|
+
model.model.queryModel;
|
|
26396
|
+
} catch {}
|
|
26397
|
+
}
|
|
26398
|
+
for (const target of targets) {
|
|
26374
26399
|
if (load.failed || pastDeadline())
|
|
26375
26400
|
break;
|
|
26376
26401
|
try {
|
|
@@ -26408,8 +26433,7 @@ async function prepareForMainThread(job, malloyConfig, load, model) {
|
|
|
26408
26433
|
contents: model.model._modelDef.contents,
|
|
26409
26434
|
getRuntime: companionRuntime
|
|
26410
26435
|
}) ?? null : undefined;
|
|
26411
|
-
if (wantsPlan &&
|
|
26412
|
-
load.planLeftToMainThread = true;
|
|
26436
|
+
if (wantsPlan && load.planLeftToMainThread) {
|
|
26413
26437
|
wantsPlan = false;
|
|
26414
26438
|
}
|
|
26415
26439
|
if (wantsPlan && companion !== undefined && !load.failed) {
|