@malloy-publisher/server 0.18.2 → 0.18.4
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 +46 -11
- package/dist/app/assets/{EnvironmentPage-CsFUI8IX.js → EnvironmentPage-BxNqq3cN.js} +1 -1
- package/dist/app/assets/{HomePage-B_FVtnN-.js → HomePage-B4iN5rso.js} +1 -1
- package/dist/app/assets/{MainPage-wFF9nPEr.js → MainPage-DGiMH0eU.js} +1 -1
- package/dist/app/assets/{ModelPage-CxenqDcz.js → ModelPage-BJmyMnQo.js} +2 -2
- package/dist/app/assets/{PackagePage-dcF6vrvw.js → PackagePage-D2Pay_Xy.js} +1 -1
- package/dist/app/assets/{PackageSplatRoute-CASBZk0k.js → PackageSplatRoute-CQ7PxhkD.js} +2 -2
- package/dist/app/assets/{RenderedResult--fYcsY1h.es-DzOt5Lwv.js → RenderedResult-BEJ_GMaW.es-DS2oXAjc.js} +1 -1
- package/dist/app/assets/{RouteError-CUIolYwb.js → RouteError-BysHaT0t.js} +1 -1
- package/dist/app/assets/{ThemeEditorPage-DgU2YYq6.js → ThemeEditorPage-BFyTBbqA.js} +1 -1
- package/dist/app/assets/{ToggleButtonGroup-Dmr-hVlD.js → ToggleButtonGroup-eURRljZv.js} +1 -1
- package/dist/app/assets/{documentRoutes-Drv-WDwO.js → documentRoutes-DgTzGqfC.js} +1 -1
- package/dist/app/assets/{editPageMounted-C5yJiIVi.js → editPageMounted-CWBeAIbE.js} +2 -2
- package/dist/app/assets/{index-BSyL0zds.js → index-CCLHq9po.js} +15 -15
- package/dist/app/assets/{index-Dtw4eTxH.js → index-D4DhR2vg.js} +1 -1
- package/dist/app/assets/{index-BIoSdsU9.js → index-N8X9kVzc.js} +1 -1
- package/dist/app/assets/{index-DxF3kMLJ.js → index-We9Zzxmt.js} +1 -1
- package/dist/app/assets/{index.es-CX9m4CBD.js → index.es-D_O2KdNW.js} +1 -1
- package/dist/app/assets/usePackageLinkNavigate-CllycPZP.js +1 -0
- package/dist/app/assets/{usePackageRoute-wJGaZEiY.js → usePackageRoute-DEUbQLf3.js} +1 -1
- package/dist/app/index.html +1 -1
- package/dist/instrumentation.mjs +1 -1
- package/dist/package_load_worker.mjs +441 -281
- package/dist/server.mjs +998 -340
- package/package.json +2 -2
- package/dist/app/assets/usePackageLinkNavigate-qNjcXPcY.js +0 -1
|
@@ -20380,6 +20380,21 @@ function kindOf(def, base) {
|
|
|
20380
20380
|
return "rename";
|
|
20381
20381
|
return "query";
|
|
20382
20382
|
}
|
|
20383
|
+
function detachedNode(def) {
|
|
20384
|
+
const d = def;
|
|
20385
|
+
if (!d || typeof d !== "object" || typeof d.sourceID !== "string") {
|
|
20386
|
+
return;
|
|
20387
|
+
}
|
|
20388
|
+
const base = baseEdgeOf(d, undefined);
|
|
20389
|
+
return {
|
|
20390
|
+
sourceID: d.sourceID,
|
|
20391
|
+
name: undefined,
|
|
20392
|
+
kind: kindOf(d, base),
|
|
20393
|
+
base,
|
|
20394
|
+
members: compositeMemberIds(d),
|
|
20395
|
+
def: d
|
|
20396
|
+
};
|
|
20397
|
+
}
|
|
20383
20398
|
function sourceChain(struct, modelDef) {
|
|
20384
20399
|
return SourceMap.of(modelDef).chainOf(struct);
|
|
20385
20400
|
}
|
|
@@ -31546,13 +31561,26 @@ function duckdbTableCollations(definition) {
|
|
|
31546
31561
|
function unquoted(name) {
|
|
31547
31562
|
return /^".*"$/.test(name) ? name.slice(1, -1).replace(/""/g, '"') : name;
|
|
31548
31563
|
}
|
|
31564
|
+
function bigqueryNamesNoCollation(name) {
|
|
31565
|
+
return typeof name !== "string" || BQ_NO_COLLATION.includes(name.trim().toUpperCase());
|
|
31566
|
+
}
|
|
31567
|
+
function bigqueryCollatedSql(column) {
|
|
31568
|
+
return `UPPER(TRIM(COALESCE(${column}, ''))) NOT IN (${BQ_NO_COLLATION.map((v) => `'${v}'`).join(", ")})`;
|
|
31569
|
+
}
|
|
31549
31570
|
function bigqueryColumnCollation(name) {
|
|
31550
|
-
return
|
|
31571
|
+
return bigqueryNamesNoCollation(name) ? BINARY_COLLATION : `bigquery:${name.trim()}`;
|
|
31572
|
+
}
|
|
31573
|
+
function canonicalCollation(identity) {
|
|
31574
|
+
const prefix = "bigquery:";
|
|
31575
|
+
return identity.startsWith(prefix) && bigqueryNamesNoCollation(identity.slice(prefix.length)) ? BINARY_COLLATION : identity;
|
|
31551
31576
|
}
|
|
31552
31577
|
function postgresColumnCollation(identity, judged) {
|
|
31553
31578
|
return judged === "binary" ? BINARY_COLLATION : `postgres:${identity}`;
|
|
31554
31579
|
}
|
|
31555
|
-
var BINARY_COLLATION = "binary", PG_COLLATION_COLUMNS = "c.collname AS name, c.collisdeterministic AS det, c.collcollate AS cc, c.collprovider AS prov, d.datcollate AS dbc, to_jsonb(d) ->> 'datlocprovider' AS dbp", PG_COLLATION_IDENTITY = `CASE WHEN c.collname = 'default' AND c.collnamespace = 'pg_catalog'::regnamespace THEN concat_ws('|', 'db', coalesce(to_jsonb(d) ->> 'datlocprovider', ''), d.datcollate, d.datctype, coalesce(to_jsonb(d) ->> 'daticulocale', ''), coalesce(to_jsonb(d) ->> 'datlocale', ''), coalesce(to_jsonb(d) ->> 'daticurules', ''), coalesce(to_jsonb(d) ->> 'datcollversion', '')) ELSE concat_ws('|', 'coll', c.collprovider, c.collisdeterministic::text, coalesce(c.collcollate, ''), coalesce(c.collctype, ''), coalesce(to_jsonb(c) ->> 'colliculocale', ''), coalesce(to_jsonb(c) ->> 'colllocale', ''), coalesce(to_jsonb(c) ->> 'collicurules', ''), coalesce(to_jsonb(c) ->> 'collversion', '')) END`, DUCKDB_COLLATE_DEFINITIONS = "SELECT (SELECT count(*) FROM duckdb_tables() WHERE NOT internal AND sql ILIKE '%collate%') + (SELECT count(*) FROM duckdb_views() WHERE NOT internal AND sql ILIKE '%collate%') + (SELECT count(*) FROM duckdb_functions() WHERE NOT internal AND function_type IN ('macro', 'table_macro') AND (macro_definition IS NULL OR macro_definition ILIKE '%collate%')) AS n";
|
|
31580
|
+
var BINARY_COLLATION = "binary", PG_COLLATION_COLUMNS = "c.collname AS name, c.collisdeterministic AS det, c.collcollate AS cc, c.collprovider AS prov, d.datcollate AS dbc, to_jsonb(d) ->> 'datlocprovider' AS dbp", PG_COLLATION_IDENTITY = `CASE WHEN c.collname = 'default' AND c.collnamespace = 'pg_catalog'::regnamespace THEN concat_ws('|', 'db', coalesce(to_jsonb(d) ->> 'datlocprovider', ''), d.datcollate, d.datctype, coalesce(to_jsonb(d) ->> 'daticulocale', ''), coalesce(to_jsonb(d) ->> 'datlocale', ''), coalesce(to_jsonb(d) ->> 'daticurules', ''), coalesce(to_jsonb(d) ->> 'datcollversion', '')) ELSE concat_ws('|', 'coll', c.collprovider, c.collisdeterministic::text, coalesce(c.collcollate, ''), coalesce(c.collctype, ''), coalesce(to_jsonb(c) ->> 'colliculocale', ''), coalesce(to_jsonb(c) ->> 'colllocale', ''), coalesce(to_jsonb(c) ->> 'collicurules', ''), coalesce(to_jsonb(c) ->> 'collversion', '')) END`, BQ_NO_COLLATION, DUCKDB_COLLATE_DEFINITIONS = "SELECT (SELECT count(*) FROM duckdb_tables() WHERE NOT internal AND sql ILIKE '%collate%') + (SELECT count(*) FROM duckdb_views() WHERE NOT internal AND sql ILIKE '%collate%') + (SELECT count(*) FROM duckdb_functions() WHERE NOT internal AND function_type IN ('macro', 'table_macro') AND (macro_definition IS NULL OR macro_definition ILIKE '%collate%')) AS n";
|
|
31581
|
+
var init_collation = __esm(() => {
|
|
31582
|
+
BQ_NO_COLLATION = ["", "NULL"];
|
|
31583
|
+
});
|
|
31556
31584
|
|
|
31557
31585
|
// src/service/materialization/domain/vocabulary.ts
|
|
31558
31586
|
var init_vocabulary = () => {};
|
|
@@ -31728,7 +31756,7 @@ function parseContract(raw) {
|
|
|
31728
31756
|
columns.push({
|
|
31729
31757
|
name: c.name,
|
|
31730
31758
|
nativeType: c.nativeType,
|
|
31731
|
-
collation: typeof c.collation === "string" ? c.collation : null,
|
|
31759
|
+
collation: typeof c.collation === "string" ? canonicalCollation(c.collation) : null,
|
|
31732
31760
|
compare: typeof c.compare === "string" && COMPARES.has(c.compare) ? c.compare : "none",
|
|
31733
31761
|
gateExact: c.gateExact === true,
|
|
31734
31762
|
...typeof c.declaredType === "string" && c.declaredType !== "" ? { declaredType: c.declaredType } : {}
|
|
@@ -31771,13 +31799,16 @@ function columnNamed(columns, name) {
|
|
|
31771
31799
|
const folded = columns.filter((c) => c.name.toLowerCase() === name.toLowerCase());
|
|
31772
31800
|
return folded.length === 1 ? folded[0] : undefined;
|
|
31773
31801
|
}
|
|
31774
|
-
function
|
|
31775
|
-
return nativeType.replace(
|
|
31802
|
+
function committedNativeType(nativeType, dialect) {
|
|
31803
|
+
return dialect === STORAGE_DIALECT ? nativeType.replace(DUCKDB_GEOMETRY_CRS, "GEOMETRY") : nativeType;
|
|
31804
|
+
}
|
|
31805
|
+
function spelledType(nativeType, dialect) {
|
|
31806
|
+
return committedNativeType(nativeType, dialect).replace(/\s+/g, " ").replace(/\s*([(),])\s*/g, "$1").trim().toUpperCase();
|
|
31776
31807
|
}
|
|
31777
31808
|
function contractDigest(contract) {
|
|
31778
31809
|
const canonical = contract.columns.map((c) => [
|
|
31779
31810
|
c.name,
|
|
31780
|
-
spelledType(c.nativeType),
|
|
31811
|
+
spelledType(c.nativeType, contract.dialect),
|
|
31781
31812
|
c.collation
|
|
31782
31813
|
]);
|
|
31783
31814
|
return createHash("sha256").update(JSON.stringify(canonical)).digest("hex").slice(0, 32);
|
|
@@ -31817,7 +31848,7 @@ function deriveContract(args) {
|
|
|
31817
31848
|
const collation = c.isString && stored.collations ? collationOf(stored.collations, c.name) : null;
|
|
31818
31849
|
return {
|
|
31819
31850
|
name: c.name,
|
|
31820
|
-
nativeType: c.nativeType,
|
|
31851
|
+
nativeType: committedNativeType(c.nativeType, stored.dialect),
|
|
31821
31852
|
collation,
|
|
31822
31853
|
compare: columnCompare(args, c.isString, collation, c.name),
|
|
31823
31854
|
gateExact: tier === "database" ? c.storedAsDouble !== true : gateColumnTypeExact(c.nativeType, upstreamTypeNamed(args.upstreamTypes, c.name)),
|
|
@@ -31877,7 +31908,7 @@ function compatible(contract, observed) {
|
|
|
31877
31908
|
continue;
|
|
31878
31909
|
}
|
|
31879
31910
|
const type = now.nativeType ?? now.type;
|
|
31880
|
-
if (type === undefined || spelledType(type) !== spelledType(c.nativeType)) {
|
|
31911
|
+
if (type === undefined || spelledType(type, contract.dialect) !== spelledType(c.nativeType, contract.dialect)) {
|
|
31881
31912
|
retyped.push(c.name);
|
|
31882
31913
|
continue;
|
|
31883
31914
|
}
|
|
@@ -31910,10 +31941,13 @@ function declaredMoves(contract, declared) {
|
|
|
31910
31941
|
return now !== undefined && now !== "" && now !== c.declaredType ? [c.name] : [];
|
|
31911
31942
|
});
|
|
31912
31943
|
}
|
|
31913
|
-
var CONTRACT_VERSION = 1, COMPARES, COMPARE_RANK;
|
|
31944
|
+
var CONTRACT_VERSION = 1, COMPARES, DUCKDB_GEOMETRY_CRS, COMPARE_RANK;
|
|
31914
31945
|
var init_column_contract = __esm(() => {
|
|
31946
|
+
init_collation();
|
|
31947
|
+
init_dialect();
|
|
31915
31948
|
init_gate_policy();
|
|
31916
31949
|
COMPARES = new Set(["exact", "equality", "none"]);
|
|
31950
|
+
DUCKDB_GEOMETRY_CRS = /\bGEOMETRY\s*\(\s*'(?:[^']|'')*'\s*\)/gi;
|
|
31917
31951
|
COMPARE_RANK = {
|
|
31918
31952
|
none: 0,
|
|
31919
31953
|
equality: 1,
|
|
@@ -33972,6 +34006,9 @@ var init_served_copy_containment = __esm(() => {
|
|
|
33972
34006
|
});
|
|
33973
34007
|
|
|
33974
34008
|
// src/service/materialization/text/kept_ancestors.ts
|
|
34009
|
+
function nodeIn(map, sourceID, elsewhere) {
|
|
34010
|
+
return map.node(sourceID) ?? detachedNode(elsewhere?.(sourceID));
|
|
34011
|
+
}
|
|
33975
34012
|
function plainRenamesOf(map, sourceID, url) {
|
|
33976
34013
|
const out = [];
|
|
33977
34014
|
const reached = new Set([sourceID]);
|
|
@@ -34021,15 +34058,15 @@ function locatedIn(def, url) {
|
|
|
34021
34058
|
const location = def?.location;
|
|
34022
34059
|
return location?.url === url && typeof location.range?.start?.line === "number" && typeof location.range?.end?.line === "number" ? location.range : undefined;
|
|
34023
34060
|
}
|
|
34024
|
-
function keptAncestorChain(map, sourceID, url) {
|
|
34061
|
+
function keptAncestorChain(map, sourceID, url, elsewhere) {
|
|
34025
34062
|
const out = [];
|
|
34026
|
-
let node = map
|
|
34063
|
+
let node = nodeIn(map, sourceID, elsewhere);
|
|
34027
34064
|
let childURL = url;
|
|
34028
34065
|
for (let hops = 0;node && hops < MAX_HOPS; hops++) {
|
|
34029
34066
|
const base = node.base;
|
|
34030
34067
|
if (!base || base.hop === "query" || base.sourceID === undefined)
|
|
34031
34068
|
break;
|
|
34032
|
-
const parent = map
|
|
34069
|
+
const parent = nodeIn(map, base.sourceID, elsewhere);
|
|
34033
34070
|
const parentURL = declaringURLOf(parent?.def);
|
|
34034
34071
|
const range = parentURL ? locatedIn(parent?.def, parentURL) : undefined;
|
|
34035
34072
|
if (!parent || !parentURL || !range)
|
|
@@ -34046,17 +34083,29 @@ function keptAncestorChain(map, sourceID, url) {
|
|
|
34046
34083
|
}
|
|
34047
34084
|
return out;
|
|
34048
34085
|
}
|
|
34049
|
-
function keptAncestorChainOrDeclared(map, sourceID, url, fileText) {
|
|
34050
|
-
const
|
|
34051
|
-
const
|
|
34052
|
-
|
|
34053
|
-
|
|
34054
|
-
|
|
34055
|
-
|
|
34056
|
-
|
|
34057
|
-
|
|
34086
|
+
function keptAncestorChainOrDeclared(map, sourceID, url, fileText, elsewhere) {
|
|
34087
|
+
const out = [];
|
|
34088
|
+
const seen = new Set([sourceID]);
|
|
34089
|
+
let tail = { sourceID, url };
|
|
34090
|
+
for (let hops = 0;hops < MAX_HOPS; hops++) {
|
|
34091
|
+
const chain = keptAncestorChain(map, tail.sourceID, tail.url, elsewhere);
|
|
34092
|
+
out.push(...chain);
|
|
34093
|
+
tail = chain.at(-1) ?? tail;
|
|
34094
|
+
const node = nodeIn(map, tail.sourceID, elsewhere);
|
|
34095
|
+
if (!node || node.base !== undefined)
|
|
34096
|
+
break;
|
|
34097
|
+
const base = declaredTableBase(node.def, tail.url, fileText, (id) => nodeIn(map, id, elsewhere));
|
|
34098
|
+
for (const a of chain)
|
|
34099
|
+
seen.add(a.sourceID);
|
|
34100
|
+
if (!base || seen.has(base.sourceID))
|
|
34101
|
+
break;
|
|
34102
|
+
seen.add(base.sourceID);
|
|
34103
|
+
out.push(base);
|
|
34104
|
+
tail = base;
|
|
34105
|
+
}
|
|
34106
|
+
return out;
|
|
34058
34107
|
}
|
|
34059
|
-
function declaredTableBase(def, url,
|
|
34108
|
+
function declaredTableBase(def, url, fileText, nodeOf) {
|
|
34060
34109
|
const own = def;
|
|
34061
34110
|
if (own?.type !== "table")
|
|
34062
34111
|
return;
|
|
@@ -34067,8 +34116,8 @@ function declaredTableBase(def, url, map, fileText) {
|
|
|
34067
34116
|
const name = declaredBaseName(text, range);
|
|
34068
34117
|
if (name === undefined)
|
|
34069
34118
|
return;
|
|
34070
|
-
const parentID =
|
|
34071
|
-
const parent = parentID ?
|
|
34119
|
+
const parentID = declaredBaseID(name, url, text, nodeOf);
|
|
34120
|
+
const parent = parentID ? nodeOf(parentID) : undefined;
|
|
34072
34121
|
const base = parent?.def;
|
|
34073
34122
|
if (!parent || base?.type !== "table" || base.connection !== own.connection || base.tablePath !== own.tablePath) {
|
|
34074
34123
|
return;
|
|
@@ -34084,6 +34133,16 @@ function declaredTableBase(def, url, map, fileText) {
|
|
|
34084
34133
|
}
|
|
34085
34134
|
return { sourceID: parent.sourceID, url: parentURL, range: parentRange };
|
|
34086
34135
|
}
|
|
34136
|
+
function declaredBaseID(name, url, text, nodeOf) {
|
|
34137
|
+
const imports = topLevelImports(text, url);
|
|
34138
|
+
if (!imports)
|
|
34139
|
+
return;
|
|
34140
|
+
const found = [
|
|
34141
|
+
`${name}@${url}`,
|
|
34142
|
+
...imports.filter((i) => i.whole).map((i) => `${name}@${i.resolved}`)
|
|
34143
|
+
].filter((id) => nodeOf(id) !== undefined);
|
|
34144
|
+
return found.length === 1 ? found[0] : undefined;
|
|
34145
|
+
}
|
|
34087
34146
|
function fieldList(def) {
|
|
34088
34147
|
return Array.isArray(def.fields) ? def.fields : [];
|
|
34089
34148
|
}
|
|
@@ -34279,6 +34338,7 @@ var MAX_HOPS = 64;
|
|
|
34279
34338
|
var init_kept_ancestors = __esm(() => {
|
|
34280
34339
|
init_declaration_text();
|
|
34281
34340
|
init_malloy_lexer_core();
|
|
34341
|
+
init_source_map();
|
|
34282
34342
|
init_table_plans();
|
|
34283
34343
|
});
|
|
34284
34344
|
|
|
@@ -38284,6 +38344,21 @@ class ServedCopyServe {
|
|
|
38284
38344
|
async loadQuery(queryString, givens, pinned = this.current()) {
|
|
38285
38345
|
return this.answer(await this.ensureCompiled(pinned), queryString, givens, pinned);
|
|
38286
38346
|
}
|
|
38347
|
+
async queriedSourceIDs(compiled, queryString) {
|
|
38348
|
+
if (!compiled.leftOutColumns?.size)
|
|
38349
|
+
return;
|
|
38350
|
+
try {
|
|
38351
|
+
const prepared = await this.host.authorPreparedQuery?.(queryString);
|
|
38352
|
+
if (prepared === undefined)
|
|
38353
|
+
return;
|
|
38354
|
+
const view = preparedQueryView(prepared);
|
|
38355
|
+
const modelDef = view.modelDef ?? this.host.modelDef();
|
|
38356
|
+
const struct = resolveStructRefSource(view.structRef, modelDef);
|
|
38357
|
+
return struct ? sourceIDsReadThrough(struct, modelDef) : undefined;
|
|
38358
|
+
} catch {
|
|
38359
|
+
return;
|
|
38360
|
+
}
|
|
38361
|
+
}
|
|
38287
38362
|
async beginAttempt(compiled, queryString, givens) {
|
|
38288
38363
|
if (!compiled.materializer || compiled.rerooted.length === 0) {
|
|
38289
38364
|
const crossConnection = compiled.problems.some((p) => p.reason === "cross_connection_unbuilt");
|
|
@@ -38320,24 +38395,9 @@ class ServedCopyServe {
|
|
|
38320
38395
|
if (zoned.size > 0 && readsMissingName(zoned, error, queryString)) {
|
|
38321
38396
|
decline(ZONED_TRUNCATION_REASON, "served_copy_time_zone");
|
|
38322
38397
|
}
|
|
38323
|
-
const
|
|
38324
|
-
|
|
38325
|
-
|
|
38326
|
-
if (storedLeftOut.size > 0 && readsMissingName(storedLeftOut, error, queryString)) {
|
|
38327
|
-
const missing = new Set([
|
|
38328
|
-
...String(error instanceof Error ? error.message : error).matchAll(/'([^']+)' is not defined/g)
|
|
38329
|
-
].map((m) => m[1]));
|
|
38330
|
-
const read = [...storedLeftOut].filter((n) => missing.has(n));
|
|
38331
|
-
const named = read.length > 0 ? read : [...storedLeftOut];
|
|
38332
|
-
const sourceIDs = new Set([...compiled.leftOutColumns ?? []].filter(([, names]) => names.some((n) => named.includes(n))).map(([sourceID]) => sourceID));
|
|
38333
|
-
const tableIds = compiled.aliased.filter((b) => b.sourceIDs?.some((id) => sourceIDs.has(id))).map((b) => b.virtualHandle);
|
|
38334
|
-
const why = [
|
|
38335
|
-
...new Set(named.flatMap((c) => {
|
|
38336
|
-
const reasons = [...sourceIDs].map((id) => compiled.leftOutWhy?.get(id)?.get(c)).filter((w) => w !== undefined);
|
|
38337
|
-
return reasons.length > 0 ? reasons : [noCastPhrase("a stored column")];
|
|
38338
|
-
}))
|
|
38339
|
-
];
|
|
38340
|
-
decline("the query reads a stored column the served copy leaves out of its table's type", "served_copy_column_left_out", `the stored table cannot answer with live's columns: ${why.join("; ")}`, tableIds);
|
|
38398
|
+
const leftOut = columnLeftOutDecline(compiled, error, queryString, await this.queriedSourceIDs(compiled, queryString));
|
|
38399
|
+
if (leftOut) {
|
|
38400
|
+
decline("the query reads a stored column the served copy leaves out of its table's type", "served_copy_column_left_out", leftOut.detail, leftOut.tableIds);
|
|
38341
38401
|
}
|
|
38342
38402
|
throw error;
|
|
38343
38403
|
}
|
|
@@ -38765,8 +38825,8 @@ class ServedCopyServe {
|
|
|
38765
38825
|
const plan = this.materializePlans[reroot.sourceID];
|
|
38766
38826
|
if (!plan)
|
|
38767
38827
|
return;
|
|
38768
|
-
const confirmed = confirmedAncestors(fileText, reroot.url, reroot.range, keptAncestorChainOrDeclared(map, reroot.sourceID, reroot.url, fileText));
|
|
38769
|
-
const needed = confirmed.some((a) => this.materializePlans[a.sourceID] !== undefined) || confirmed.some((a) => declaresBlocks(map.node(a.sourceID)?.def));
|
|
38828
|
+
const confirmed = confirmedAncestors(fileText, reroot.url, reroot.range, keptAncestorChainOrDeclared(map, reroot.sourceID, reroot.url, fileText, this.declarationOf));
|
|
38829
|
+
const needed = confirmed.some((a) => this.materializePlans[a.sourceID] !== undefined) || confirmed.some((a) => declaresBlocks(map.node(a.sourceID)?.def ?? this.declarationOf?.(a.sourceID)));
|
|
38770
38830
|
if (!needed)
|
|
38771
38831
|
return;
|
|
38772
38832
|
return confirmed.flatMap((a) => a.runText ? [a.runText] : []).reverse().join(" ");
|
|
@@ -39619,6 +39679,66 @@ function leftOutPhrase(ref, field, storedType) {
|
|
|
39619
39679
|
function leftOutPhraseOf(subject, c) {
|
|
39620
39680
|
return leftOutPhrase(subject.columnRef(c.name), subject.fieldsByName.get(c.name), c.type);
|
|
39621
39681
|
}
|
|
39682
|
+
function sourceIDsReadThrough(struct, modelDef) {
|
|
39683
|
+
const map = SourceMap.of(modelDef);
|
|
39684
|
+
const out = new Map;
|
|
39685
|
+
const walk = (def, path, depth) => {
|
|
39686
|
+
for (const id of map.chainOf(def)) {
|
|
39687
|
+
if (!out.has(id))
|
|
39688
|
+
out.set(id, path);
|
|
39689
|
+
}
|
|
39690
|
+
if (depth >= JOIN_DEPTH_LIMIT)
|
|
39691
|
+
return;
|
|
39692
|
+
const fields = def?.fields;
|
|
39693
|
+
if (!Array.isArray(fields))
|
|
39694
|
+
return;
|
|
39695
|
+
for (const f of fields) {
|
|
39696
|
+
if (f?.join === undefined)
|
|
39697
|
+
continue;
|
|
39698
|
+
const name = f.as ?? f.name;
|
|
39699
|
+
if (!name)
|
|
39700
|
+
continue;
|
|
39701
|
+
walk(f, path ? `${path}.${name}` : name, depth + 1);
|
|
39702
|
+
}
|
|
39703
|
+
};
|
|
39704
|
+
walk(struct, "", 0);
|
|
39705
|
+
return out;
|
|
39706
|
+
}
|
|
39707
|
+
function columnLeftOutDecline(compiled, error, queryString, readIDs) {
|
|
39708
|
+
const storedLeftOut = new Set([...compiled.leftOutColumns?.values() ?? []].flatMap((n) => [...n]));
|
|
39709
|
+
if (storedLeftOut.size === 0 || !readsMissingName(storedLeftOut, error, queryString)) {
|
|
39710
|
+
return;
|
|
39711
|
+
}
|
|
39712
|
+
const missing = new Set([
|
|
39713
|
+
...String(error instanceof Error ? error.message : error).matchAll(/'([^']+)' is not defined/g)
|
|
39714
|
+
].map((m) => m[1]));
|
|
39715
|
+
const read = [...storedLeftOut].filter((n) => missing.has(n));
|
|
39716
|
+
const named = read.length > 0 ? read : [...storedLeftOut];
|
|
39717
|
+
const leaving = [...compiled.leftOutColumns ?? []].filter(([, names]) => names.some((n) => named.includes(n))).map(([sourceID]) => sourceID);
|
|
39718
|
+
const scoped = readIDs ? leaving.filter((id) => readIDs.has(id)) : [];
|
|
39719
|
+
const sourceIDs = new Set(scoped.length > 0 ? scoped : leaving);
|
|
39720
|
+
const pathOf = (id) => scoped.length > 0 ? readIDs?.get(id) : "";
|
|
39721
|
+
const tableIds = compiled.aliased.filter((b) => b.sourceIDs?.some((id) => sourceIDs.has(id))).map((b) => b.virtualHandle);
|
|
39722
|
+
const why = [
|
|
39723
|
+
...new Set(named.flatMap((c) => {
|
|
39724
|
+
const reasons = [...sourceIDs].flatMap((id) => {
|
|
39725
|
+
const phrase = compiled.leftOutWhy?.get(id)?.get(c);
|
|
39726
|
+
if (phrase === undefined)
|
|
39727
|
+
return [];
|
|
39728
|
+
const path = pathOf(id);
|
|
39729
|
+
const own = `column \`${c}\``;
|
|
39730
|
+
return [
|
|
39731
|
+
path && phrase.startsWith(own) ? `column \`${path}.${c}\`${phrase.slice(own.length)}` : phrase
|
|
39732
|
+
];
|
|
39733
|
+
});
|
|
39734
|
+
return reasons.length > 0 ? reasons : [noCastPhrase("a stored column")];
|
|
39735
|
+
}))
|
|
39736
|
+
];
|
|
39737
|
+
return {
|
|
39738
|
+
detail: `the stored table cannot answer with live's columns: ${why.join("; ")}`,
|
|
39739
|
+
tableIds
|
|
39740
|
+
};
|
|
39741
|
+
}
|
|
39622
39742
|
function noCastPhrase(ref) {
|
|
39623
39743
|
return `no cast reads ${ref} as declared`;
|
|
39624
39744
|
}
|
|
@@ -40481,7 +40601,7 @@ function zonedTruncations(columns, def, fieldsByName, chainZone, restatesStageZo
|
|
|
40481
40601
|
restated: []
|
|
40482
40602
|
};
|
|
40483
40603
|
}
|
|
40484
|
-
var NOTHING_PINNED, NO_DESTINATIONS = () => new MalloyConfig3({ connections: {} }), PAIR_BLOCKS_DETAIL = "The table stores more than one inlined join_many, one block of rows each, and the query reads more than one of them (live aggregates each by its own key over their cross product, which no block holds), so it is answered without this table.", LEFT_OUT_JOIN_DETAIL = "The query uses a join to a source on another connection than the destination this table is stored in, so it is answered live.", MISSING_FIELD_CODES, SERVED_COPY_WARNING_CODE = "served-copy-not-served", DECLINED_LIMIT = 1000, knownRerootFailures, REROOT_FAILURE_TTL_MS, ESCAPED_FAILURE_RETRY_MS = 30000, REROOT_FAILURES_PER_CONFIG = 64, GATE_GRAFT_DECLINE, HIDDEN_COLUMN = "a hidden column";
|
|
40604
|
+
var NOTHING_PINNED, NO_DESTINATIONS = () => new MalloyConfig3({ connections: {} }), PAIR_BLOCKS_DETAIL = "The table stores more than one inlined join_many, one block of rows each, and the query reads more than one of them (live aggregates each by its own key over their cross product, which no block holds), so it is answered without this table.", LEFT_OUT_JOIN_DETAIL = "The query uses a join to a source on another connection than the destination this table is stored in, so it is answered live.", MISSING_FIELD_CODES, SERVED_COPY_WARNING_CODE = "served-copy-not-served", DECLINED_LIMIT = 1000, knownRerootFailures, REROOT_FAILURE_TTL_MS, ESCAPED_FAILURE_RETRY_MS = 30000, REROOT_FAILURES_PER_CONFIG = 64, GATE_GRAFT_DECLINE, HIDDEN_COLUMN = "a hidden column", JOIN_DEPTH_LIMIT = 8;
|
|
40485
40605
|
var init_served_copy_serve = __esm(() => {
|
|
40486
40606
|
init_ducklake_catalog_unavailable();
|
|
40487
40607
|
init_served_copy_lanes();
|
|
@@ -40788,6 +40908,216 @@ var init_error_wire = __esm(() => {
|
|
|
40788
40908
|
init_errors2();
|
|
40789
40909
|
});
|
|
40790
40910
|
|
|
40911
|
+
// src/package_load/job_files.ts
|
|
40912
|
+
import {
|
|
40913
|
+
CacheManager,
|
|
40914
|
+
InMemoryModelCache
|
|
40915
|
+
} from "@malloydata/malloy";
|
|
40916
|
+
import { createHash as createHash3 } from "crypto";
|
|
40917
|
+
import * as path6 from "path";
|
|
40918
|
+
import { fileURLToPath as fileURLToPath5, pathToFileURL as pathToFileURL5 } from "url";
|
|
40919
|
+
function jobFiles(inner) {
|
|
40920
|
+
const texts = new Map;
|
|
40921
|
+
const stylesByUrl = new Map;
|
|
40922
|
+
const reads = new Map;
|
|
40923
|
+
const reader = {
|
|
40924
|
+
readURL: (url) => {
|
|
40925
|
+
const key = url.toString();
|
|
40926
|
+
let read = reads.get(key);
|
|
40927
|
+
if (!read) {
|
|
40928
|
+
read = (async () => {
|
|
40929
|
+
const contents = await inner.readURL(url);
|
|
40930
|
+
texts.set(key, contents);
|
|
40931
|
+
stylesByUrl.set(key, await dataStylesForFile(key, contents, inner));
|
|
40932
|
+
return contents;
|
|
40933
|
+
})();
|
|
40934
|
+
reads.set(key, read);
|
|
40935
|
+
read.catch(() => reads.delete(key));
|
|
40936
|
+
}
|
|
40937
|
+
return read;
|
|
40938
|
+
}
|
|
40939
|
+
};
|
|
40940
|
+
return {
|
|
40941
|
+
reader,
|
|
40942
|
+
texts,
|
|
40943
|
+
stylesByUrl,
|
|
40944
|
+
models: new Map,
|
|
40945
|
+
imported: new Set,
|
|
40946
|
+
stats: { stored: 0, reused: 0 }
|
|
40947
|
+
};
|
|
40948
|
+
}
|
|
40949
|
+
function urlKey(url) {
|
|
40950
|
+
try {
|
|
40951
|
+
return new URL(url).href;
|
|
40952
|
+
} catch {
|
|
40953
|
+
return url;
|
|
40954
|
+
}
|
|
40955
|
+
}
|
|
40956
|
+
function decodedUrl(url) {
|
|
40957
|
+
try {
|
|
40958
|
+
return decodeURI(url);
|
|
40959
|
+
} catch {
|
|
40960
|
+
return url;
|
|
40961
|
+
}
|
|
40962
|
+
}
|
|
40963
|
+
function modelFileTexts(files, modelUrl, dependencies) {
|
|
40964
|
+
const byPath = new Map;
|
|
40965
|
+
for (const url of [modelUrl, ...importReadOrder(dependencies)]) {
|
|
40966
|
+
const key = urlKey(url);
|
|
40967
|
+
const text = files.texts.get(key);
|
|
40968
|
+
if (text !== undefined && key.startsWith("file:")) {
|
|
40969
|
+
byPath.set(fileURLToPath5(key), text);
|
|
40970
|
+
}
|
|
40971
|
+
}
|
|
40972
|
+
return byPath;
|
|
40973
|
+
}
|
|
40974
|
+
function fileTextDigests(files) {
|
|
40975
|
+
const digests = {};
|
|
40976
|
+
for (const [url, text] of files.texts) {
|
|
40977
|
+
const key = urlKey(url);
|
|
40978
|
+
if (!key.startsWith("file:"))
|
|
40979
|
+
continue;
|
|
40980
|
+
digests[key] = createHash3("sha256").update(text).digest("hex");
|
|
40981
|
+
}
|
|
40982
|
+
return digests;
|
|
40983
|
+
}
|
|
40984
|
+
function modelReadKeys(modelUrl, dependencies) {
|
|
40985
|
+
return [modelUrl, ...importReadOrder(dependencies)].map(urlKey);
|
|
40986
|
+
}
|
|
40987
|
+
function dataStylesForModel(files, modelUrl, dependencies) {
|
|
40988
|
+
let styles = {};
|
|
40989
|
+
for (const url of [modelUrl, ...importReadOrder(dependencies)]) {
|
|
40990
|
+
styles = { ...styles, ...files.stylesByUrl.get(urlKey(url)) ?? {} };
|
|
40991
|
+
}
|
|
40992
|
+
return styles;
|
|
40993
|
+
}
|
|
40994
|
+
function importReadOrder(tree) {
|
|
40995
|
+
const order = [];
|
|
40996
|
+
const seen = new Set;
|
|
40997
|
+
const descended = new Set;
|
|
40998
|
+
const visit = (node) => {
|
|
40999
|
+
if (!node || typeof node !== "object")
|
|
41000
|
+
return;
|
|
41001
|
+
const entries = Object.entries(node);
|
|
41002
|
+
for (const [url] of entries) {
|
|
41003
|
+
if (!seen.has(url)) {
|
|
41004
|
+
seen.add(url);
|
|
41005
|
+
order.push(url);
|
|
41006
|
+
}
|
|
41007
|
+
}
|
|
41008
|
+
for (const [url, sub] of entries) {
|
|
41009
|
+
if (descended.has(url))
|
|
41010
|
+
continue;
|
|
41011
|
+
descended.add(url);
|
|
41012
|
+
visit(sub);
|
|
41013
|
+
}
|
|
41014
|
+
};
|
|
41015
|
+
visit(tree);
|
|
41016
|
+
return order;
|
|
41017
|
+
}
|
|
41018
|
+
async function compileOrder(packagePath, modelPaths, reader, imported = new Set) {
|
|
41019
|
+
const malloy = modelPaths.filter((p) => p.endsWith(MODEL_FILE_SUFFIX));
|
|
41020
|
+
const inPackage = new Set(malloy);
|
|
41021
|
+
const imports = new Map;
|
|
41022
|
+
for (const modelPath of malloy) {
|
|
41023
|
+
const url = pathToFileURL5(path6.join(packagePath, modelPath));
|
|
41024
|
+
let text = "";
|
|
41025
|
+
try {
|
|
41026
|
+
text = await reader.readURL(url);
|
|
41027
|
+
} catch {}
|
|
41028
|
+
const deps = [];
|
|
41029
|
+
for (const match of text.matchAll(IMPORT_RE)) {
|
|
41030
|
+
const target = match[1] ?? match[2];
|
|
41031
|
+
if (!target)
|
|
41032
|
+
continue;
|
|
41033
|
+
try {
|
|
41034
|
+
const resolved = new URL(target, url);
|
|
41035
|
+
if (resolved.protocol !== "file:")
|
|
41036
|
+
continue;
|
|
41037
|
+
const rel = path6.relative(packagePath, fileURLToPath5(resolved)).replace(/\\/g, "/");
|
|
41038
|
+
if (inPackage.has(rel)) {
|
|
41039
|
+
deps.push(rel);
|
|
41040
|
+
imported.add(urlKey(resolved.href));
|
|
41041
|
+
}
|
|
41042
|
+
} catch {}
|
|
41043
|
+
}
|
|
41044
|
+
imports.set(modelPath, deps);
|
|
41045
|
+
}
|
|
41046
|
+
const level = new Map;
|
|
41047
|
+
const visiting = new Set;
|
|
41048
|
+
const levelOf = (modelPath) => {
|
|
41049
|
+
const known = level.get(modelPath);
|
|
41050
|
+
if (known !== undefined)
|
|
41051
|
+
return known;
|
|
41052
|
+
if (visiting.has(modelPath))
|
|
41053
|
+
return 0;
|
|
41054
|
+
visiting.add(modelPath);
|
|
41055
|
+
let mine = 0;
|
|
41056
|
+
for (const dep of imports.get(modelPath) ?? []) {
|
|
41057
|
+
mine = Math.max(mine, levelOf(dep) + 1);
|
|
41058
|
+
}
|
|
41059
|
+
visiting.delete(modelPath);
|
|
41060
|
+
level.set(modelPath, mine);
|
|
41061
|
+
return mine;
|
|
41062
|
+
};
|
|
41063
|
+
const levels = [];
|
|
41064
|
+
const waitsOn = new Map;
|
|
41065
|
+
for (const modelPath of malloy) {
|
|
41066
|
+
const mine = levelOf(modelPath);
|
|
41067
|
+
(levels[mine] ??= []).push(modelPath);
|
|
41068
|
+
waitsOn.set(modelPath, (imports.get(modelPath) ?? []).filter((dep) => levelOf(dep) < mine));
|
|
41069
|
+
}
|
|
41070
|
+
const rest = modelPaths.filter((p) => !p.endsWith(MODEL_FILE_SUFFIX));
|
|
41071
|
+
for (const modelPath of rest)
|
|
41072
|
+
waitsOn.set(modelPath, []);
|
|
41073
|
+
return {
|
|
41074
|
+
waitsOn,
|
|
41075
|
+
levels: [
|
|
41076
|
+
...levels.filter((l) => l !== undefined && l.length > 0),
|
|
41077
|
+
...rest.length > 0 ? [rest] : []
|
|
41078
|
+
]
|
|
41079
|
+
};
|
|
41080
|
+
}
|
|
41081
|
+
var sameUrl = (a, b) => a === b || urlKey(a) === urlKey(b), ModelCacheView, IMPORT_RE;
|
|
41082
|
+
var init_job_files = __esm(() => {
|
|
41083
|
+
init_constants();
|
|
41084
|
+
init_data_styles();
|
|
41085
|
+
ModelCacheView = class ModelCacheView extends CacheManager {
|
|
41086
|
+
files;
|
|
41087
|
+
ownUrl;
|
|
41088
|
+
constructor(files, ownUrl) {
|
|
41089
|
+
super(new InMemoryModelCache);
|
|
41090
|
+
this.files = files;
|
|
41091
|
+
this.ownUrl = ownUrl;
|
|
41092
|
+
}
|
|
41093
|
+
async getCachedModelDef(...[, url]) {
|
|
41094
|
+
if (sameUrl(url, this.ownUrl))
|
|
41095
|
+
return;
|
|
41096
|
+
const hit = this.files.models.get(url);
|
|
41097
|
+
if (!hit)
|
|
41098
|
+
return;
|
|
41099
|
+
this.files.stats.reused++;
|
|
41100
|
+
return {
|
|
41101
|
+
modelDef: structuredClone(hit.modelDef),
|
|
41102
|
+
invalidationKeys: { ...hit.invalidationKeys }
|
|
41103
|
+
};
|
|
41104
|
+
}
|
|
41105
|
+
async setCachedModelDef(...[url, cached]) {
|
|
41106
|
+
if (!this.files.imported.has(urlKey(url)))
|
|
41107
|
+
return false;
|
|
41108
|
+
if (sameUrl(url, this.ownUrl) && decodedUrl(url) !== url)
|
|
41109
|
+
return false;
|
|
41110
|
+
this.files.models.set(url, {
|
|
41111
|
+
modelDef: structuredClone(cached.modelDef),
|
|
41112
|
+
invalidationKeys: { ...cached.invalidationKeys }
|
|
41113
|
+
});
|
|
41114
|
+
this.files.stats.stored++;
|
|
41115
|
+
return true;
|
|
41116
|
+
}
|
|
41117
|
+
};
|
|
41118
|
+
IMPORT_RE = /^\s*import\s+(?:\{[^}]*\}\s+from\s+)?(?:"([^"]+)"|'([^']+)')/gim;
|
|
41119
|
+
});
|
|
41120
|
+
|
|
40791
41121
|
// src/service/translator_error.ts
|
|
40792
41122
|
import { MalloyError as MalloyError6 } from "@malloydata/malloy";
|
|
40793
41123
|
function translatorInvariantProblem(error) {
|
|
@@ -40928,12 +41258,12 @@ function compareText(a, b) {
|
|
|
40928
41258
|
}
|
|
40929
41259
|
|
|
40930
41260
|
// src/service/package_revision.ts
|
|
40931
|
-
import { createHash as
|
|
41261
|
+
import { createHash as createHash4, randomUUID } from "crypto";
|
|
40932
41262
|
import fs5 from "fs";
|
|
40933
41263
|
import path7 from "path";
|
|
40934
41264
|
import { pathToFileURL as pathToFileURL6 } from "url";
|
|
40935
41265
|
function computeSourceContentSha(packagePath, contentPaths, extra, contentShas) {
|
|
40936
|
-
const hash =
|
|
41266
|
+
const hash = createHash4("sha256");
|
|
40937
41267
|
for (const relativePath of [...contentPaths].sort()) {
|
|
40938
41268
|
hash.update(relativePath);
|
|
40939
41269
|
hash.update("\x00");
|
|
@@ -40967,7 +41297,7 @@ function boundedManifestValue(value) {
|
|
|
40967
41297
|
return "[unreadable: too deep or too large]";
|
|
40968
41298
|
}
|
|
40969
41299
|
function canonicalSha(value) {
|
|
40970
|
-
return
|
|
41300
|
+
return createHash4("sha256").update(canonicalJson(value)).digest("hex");
|
|
40971
41301
|
}
|
|
40972
41302
|
function mintServedRevision() {
|
|
40973
41303
|
return randomUUID();
|
|
@@ -42046,9 +42376,9 @@ var init_dim_index_discovery = __esm(() => {
|
|
|
42046
42376
|
});
|
|
42047
42377
|
|
|
42048
42378
|
// src/service/entities/dim_index_entity_id.ts
|
|
42049
|
-
import { createHash as
|
|
42379
|
+
import { createHash as createHash5 } from "crypto";
|
|
42050
42380
|
function computeSqlFingerprint(compiledSql) {
|
|
42051
|
-
return
|
|
42381
|
+
return createHash5("sha256").update(compiledSql, "utf8").digest("hex");
|
|
42052
42382
|
}
|
|
42053
42383
|
function buildFingerprintQuery(sourceName, dimensionPath, requiredFilterDimensions, gateDimensions = []) {
|
|
42054
42384
|
const sortedFilters = [...requiredFilterDimensions].sort();
|
|
@@ -42068,6 +42398,10 @@ var init_dim_index_entity_id = __esm(() => {
|
|
|
42068
42398
|
// src/service/entities/source_extraction.ts
|
|
42069
42399
|
import path8 from "path";
|
|
42070
42400
|
import { fileURLToPath as fileURLToPath7 } from "url";
|
|
42401
|
+
import {
|
|
42402
|
+
isJoined as isJoined5,
|
|
42403
|
+
isJoinedSource
|
|
42404
|
+
} from "@malloydata/malloy";
|
|
42071
42405
|
function buildSourceToModelPathMap(explores, relpath, packageRoot) {
|
|
42072
42406
|
const sourceToModelPath = new Map;
|
|
42073
42407
|
for (const explore of explores) {
|
|
@@ -42113,6 +42447,17 @@ function parseJoinCode(joinCode, fieldName, sourceToModelPath) {
|
|
|
42113
42447
|
is_nested_index: isNestedIndex
|
|
42114
42448
|
};
|
|
42115
42449
|
}
|
|
42450
|
+
function joinMetadataOf(field, docString, sourceToModelPath) {
|
|
42451
|
+
const structDef = field.structDef;
|
|
42452
|
+
const metadata = isJoinedSource(structDef) ? parseJoinCode(extractCodeFromEntity(field, docString), field.name, sourceToModelPath) : {
|
|
42453
|
+
original_source_name: null,
|
|
42454
|
+
original_source_path: null,
|
|
42455
|
+
is_nested_index: true
|
|
42456
|
+
};
|
|
42457
|
+
if (isJoined5(structDef))
|
|
42458
|
+
metadata.relationship = structDef.join;
|
|
42459
|
+
return metadata;
|
|
42460
|
+
}
|
|
42116
42461
|
function descendsIntoJoin(joinMetadata, rootSourceName, topLevelExploreNames, boundary) {
|
|
42117
42462
|
const targetName = joinMetadata.original_source_name;
|
|
42118
42463
|
const targetIsAtTopLevel = targetName != null && topLevelExploreNames.has(targetName);
|
|
@@ -42123,7 +42468,7 @@ function descendsIntoJoin(joinMetadata, rootSourceName, topLevelExploreNames, bo
|
|
|
42123
42468
|
function joinDescent(explores, relativePath, packageRoot, docString, boundary) {
|
|
42124
42469
|
const sourceToModelPath = buildSourceToModelPathMap(explores, relativePath, packageRoot);
|
|
42125
42470
|
const topLevelExploreNames = new Set(explores.map((e) => e.name));
|
|
42126
|
-
return (join, parentSourceName) => descendsIntoJoin(
|
|
42471
|
+
return (join, parentSourceName) => descendsIntoJoin(joinMetadataOf(join, docString, sourceToModelPath), parentSourceName.split(".")[0], topLevelExploreNames, boundary);
|
|
42127
42472
|
}
|
|
42128
42473
|
function getEntitiesFromExplore(explore, docString, relativePath, parentPath, sourceToModelPath, dimIndexFingerprints, topLevelExploreNames, boundary, guard) {
|
|
42129
42474
|
const entities = [];
|
|
@@ -42135,8 +42480,7 @@ function getEntitiesFromExplore(explore, docString, relativePath, parentPath, so
|
|
|
42135
42480
|
}
|
|
42136
42481
|
let joinMetadata = null;
|
|
42137
42482
|
if (field.isExploreField()) {
|
|
42138
|
-
|
|
42139
|
-
joinMetadata = parseJoinCode(joinCode, field.name, sourceToModelPath);
|
|
42483
|
+
joinMetadata = joinMetadataOf(field, docString, sourceToModelPath);
|
|
42140
42484
|
const descent = descendsIntoJoin(joinMetadata, rootSourceName, topLevelExploreNames, boundary);
|
|
42141
42485
|
if (descent !== false) {
|
|
42142
42486
|
const nestedEntities = getEntitiesFromExplore(field, docString, relativePath, sourceName, sourceToModelPath, dimIndexFingerprints, topLevelExploreNames, boundary, descent === true ? guard : guardDescent(guard, rootSourceName, descent.unlessQueryable));
|
|
@@ -42172,8 +42516,7 @@ function planJoinAuthorizeMetadata(explore, docString, relativePath, parentPath,
|
|
|
42172
42516
|
}
|
|
42173
42517
|
if (getAccessModifier(field) !== "public" /* Public */)
|
|
42174
42518
|
continue;
|
|
42175
|
-
const
|
|
42176
|
-
const joinMetadata = parseJoinCode(joinCode, field.name, sourceToModelPath);
|
|
42519
|
+
const joinMetadata = joinMetadataOf(field, docString, sourceToModelPath);
|
|
42177
42520
|
const targetName = joinMetadata.original_source_name;
|
|
42178
42521
|
const descent = descendsIntoJoin(joinMetadata, rootSourceName, topLevelExploreNames, boundary);
|
|
42179
42522
|
const joinedExplore = field;
|
|
@@ -42822,7 +43165,7 @@ var init_package_relative_text = __esm(() => {
|
|
|
42822
43165
|
});
|
|
42823
43166
|
|
|
42824
43167
|
// src/service/package_retrieval_settings.ts
|
|
42825
|
-
import { createHash as
|
|
43168
|
+
import { createHash as createHash6 } from "crypto";
|
|
42826
43169
|
import * as fs8 from "fs";
|
|
42827
43170
|
import * as path10 from "path";
|
|
42828
43171
|
import { pathToFileURL as pathToFileURL9 } from "url";
|
|
@@ -43062,7 +43405,7 @@ async function readPromptFile(packageRoot, key, rel) {
|
|
|
43062
43405
|
return {
|
|
43063
43406
|
path: rel,
|
|
43064
43407
|
text,
|
|
43065
|
-
hash:
|
|
43408
|
+
hash: createHash6("sha256").update(text).digest("hex")
|
|
43066
43409
|
};
|
|
43067
43410
|
}
|
|
43068
43411
|
async function readPackageRetrieval(packageRoot, raw) {
|
|
@@ -43363,15 +43706,26 @@ function errorCodeOf(err) {
|
|
|
43363
43706
|
}
|
|
43364
43707
|
return "Error";
|
|
43365
43708
|
}
|
|
43366
|
-
|
|
43709
|
+
function runtimeErrorTextOf(err) {
|
|
43710
|
+
for (const e of causeChain(err)) {
|
|
43711
|
+
const { code } = e;
|
|
43712
|
+
if (typeof code === "number" && RUNTIME_ERROR_NAMES.has(e.name) && typeof e.message === "string" && RUNTIME_TEXT.test(e.message)) {
|
|
43713
|
+
return e.message;
|
|
43714
|
+
}
|
|
43715
|
+
}
|
|
43716
|
+
return;
|
|
43717
|
+
}
|
|
43718
|
+
var CODE_PATTERN, RUNTIME_ERROR_NAMES, RUNTIME_TEXT;
|
|
43367
43719
|
var init_error_code = __esm(() => {
|
|
43368
43720
|
init_driver_errors();
|
|
43369
43721
|
init_errors2();
|
|
43370
43722
|
CODE_PATTERN = /^[A-Za-z0-9][A-Za-z0-9_.:-]{0,63}$/;
|
|
43723
|
+
RUNTIME_ERROR_NAMES = new Set(["TimeoutError", "AbortError"]);
|
|
43724
|
+
RUNTIME_TEXT = /^[A-Za-z][A-Za-z ,.'-]{0,119}$/;
|
|
43371
43725
|
});
|
|
43372
43726
|
|
|
43373
43727
|
// src/service/materialization/domain/table_name.ts
|
|
43374
|
-
import { createHash as
|
|
43728
|
+
import { createHash as createHash7 } from "crypto";
|
|
43375
43729
|
function leafBudget(dialect, inDestination) {
|
|
43376
43730
|
if (inDestination)
|
|
43377
43731
|
return DESTINATION_LEAF_BUDGET;
|
|
@@ -43475,7 +43829,7 @@ function fitPrefix(prefix, room) {
|
|
|
43475
43829
|
}
|
|
43476
43830
|
function readableTableName(args) {
|
|
43477
43831
|
const { identity } = args;
|
|
43478
|
-
const hash =
|
|
43832
|
+
const hash = createHash7("sha256").update(JSON.stringify([
|
|
43479
43833
|
"publisher-table/1",
|
|
43480
43834
|
identity.environmentName,
|
|
43481
43835
|
identity.packageName,
|
|
@@ -47218,7 +47572,7 @@ var init_preaggregation_classifier = __esm(() => {
|
|
|
47218
47572
|
import {
|
|
47219
47573
|
expressionIsAggregate,
|
|
47220
47574
|
expressionIsAnalytic,
|
|
47221
|
-
isJoined as
|
|
47575
|
+
isJoined as isJoined6
|
|
47222
47576
|
} from "@malloydata/malloy";
|
|
47223
47577
|
function isAccessRestricted(f) {
|
|
47224
47578
|
return f.accessModifier != null && f.accessModifier !== "public";
|
|
@@ -47230,7 +47584,7 @@ function isView(f) {
|
|
|
47230
47584
|
return f.type === "turtle";
|
|
47231
47585
|
}
|
|
47232
47586
|
function isFanoutJoin(f) {
|
|
47233
|
-
return
|
|
47587
|
+
return isJoined6(f) && f.join !== "one";
|
|
47234
47588
|
}
|
|
47235
47589
|
function hasFanoutJoin(source) {
|
|
47236
47590
|
return (source.fields ?? []).some((f) => isFanoutJoin(f));
|
|
@@ -47239,7 +47593,7 @@ function isMeasure(f) {
|
|
|
47239
47593
|
return expressionIsAggregate(f.expressionType) && !expressionIsAnalytic(f.expressionType);
|
|
47240
47594
|
}
|
|
47241
47595
|
function isGroupableDimension(f) {
|
|
47242
|
-
if (
|
|
47596
|
+
if (isJoined6(f) || isView(f))
|
|
47243
47597
|
return false;
|
|
47244
47598
|
if (f.expressionType === undefined)
|
|
47245
47599
|
return true;
|
|
@@ -47259,7 +47613,7 @@ function validateGrainDimension(sourceName, measure, source, grainDimension) {
|
|
|
47259
47613
|
if (!field) {
|
|
47260
47614
|
return violation("unknown_grain_dimension", `Measure \`${measure}\` declares \`#@ preaggregate\` at a grain naming \`${grainDimension}\`, but \`${head}\` is not a field of \`${sourceName}\`. Use a dimension that exists on the source; a rollup can only group by the source's own dimensions.`);
|
|
47261
47615
|
}
|
|
47262
|
-
if (
|
|
47616
|
+
if (isJoined6(field)) {
|
|
47263
47617
|
return violation("grain_path_through_join", `Measure \`${measure}\` declares a grain of \`${grainDimension}\`, which reaches through the join \`${head}\`. Pre-aggregating across a join is not supported in this version; copy the value into a dimension on \`${sourceName}\` and group by that instead.`);
|
|
47264
47618
|
}
|
|
47265
47619
|
if (parts.length > 1) {
|
|
@@ -47334,7 +47688,7 @@ function validateSourcePreaggregation(sourceName, source) {
|
|
|
47334
47688
|
}
|
|
47335
47689
|
function fieldViolations(sourceName, source, field, declaration, grains, violations) {
|
|
47336
47690
|
const name = fieldName4(field);
|
|
47337
|
-
if (
|
|
47691
|
+
if (isJoined6(field)) {
|
|
47338
47692
|
violations.push({
|
|
47339
47693
|
code: "misplaced_on_join",
|
|
47340
47694
|
sourceName,
|
|
@@ -48394,7 +48748,7 @@ function rollupLabel(plan) {
|
|
|
48394
48748
|
}
|
|
48395
48749
|
|
|
48396
48750
|
// src/service/materialization/plan/rollup_plan.ts
|
|
48397
|
-
import { createHash as
|
|
48751
|
+
import { createHash as createHash8 } from "node:crypto";
|
|
48398
48752
|
import { Annotations as Annotations8 } from "@malloydata/malloy";
|
|
48399
48753
|
function isRollupRoute(route) {
|
|
48400
48754
|
return route === ROLLUP_ROUTE || route === ROLLUP_ALIAS_ROUTE;
|
|
@@ -48527,7 +48881,7 @@ function byCodepoint2(a, b) {
|
|
|
48527
48881
|
return a < b ? -1 : a > b ? 1 : 0;
|
|
48528
48882
|
}
|
|
48529
48883
|
function digest(parts) {
|
|
48530
|
-
return
|
|
48884
|
+
return createHash8("sha256").update(parts.join("\x00")).digest("hex").slice(0, 8);
|
|
48531
48885
|
}
|
|
48532
48886
|
function rollupName(baseDeclaredName, packageRelativeSourceID, grain, placement) {
|
|
48533
48887
|
const slug = grain.join("_").replace(/[^A-Za-z0-9_]/g, "_");
|
|
@@ -50557,13 +50911,13 @@ var init_pair_reroot = __esm(() => {
|
|
|
50557
50911
|
});
|
|
50558
50912
|
|
|
50559
50913
|
// src/service/materialization/plan/materialize_plan.ts
|
|
50560
|
-
import { createHash as
|
|
50914
|
+
import { createHash as createHash9 } from "crypto";
|
|
50561
50915
|
import { Annotations as Annotations9 } from "@malloydata/malloy";
|
|
50562
50916
|
function materializeTableName(sourceName) {
|
|
50563
50917
|
if (PLAIN_TABLE_NAME.test(sourceName))
|
|
50564
50918
|
return sourceName;
|
|
50565
50919
|
const folded = sourceName.replace(/[^A-Za-z0-9_-]+/g, "_").replace(/^_+|_+$/g, "");
|
|
50566
|
-
const hash =
|
|
50920
|
+
const hash = createHash9("sha256").update(sourceName).digest("hex");
|
|
50567
50921
|
return `${folded || "source"}_${hash.slice(0, 8)}`;
|
|
50568
50922
|
}
|
|
50569
50923
|
function readMaterializeDeclaration(def, contents = {}) {
|
|
@@ -56924,13 +57278,14 @@ async function collectGeneratedTables(parts, args) {
|
|
|
56924
57278
|
parts.modelGateLines.nameProblems.push(...persistNameProblems(text, modelPath));
|
|
56925
57279
|
}
|
|
56926
57280
|
}
|
|
57281
|
+
const materializeOn = getMaterializeEnabled();
|
|
56927
57282
|
collectPersistQueryFindings(parts, {
|
|
56928
57283
|
modelPath,
|
|
56929
57284
|
packagePath,
|
|
56930
57285
|
malloyModel,
|
|
56931
|
-
notBuilt: !
|
|
57286
|
+
notBuilt: !materializeOn
|
|
56932
57287
|
});
|
|
56933
|
-
if (!
|
|
57288
|
+
if (!materializeOn) {
|
|
56934
57289
|
collectPersistViewFindingsSwitchedOff(parts, {
|
|
56935
57290
|
modelPath,
|
|
56936
57291
|
packagePath,
|
|
@@ -56938,7 +57293,7 @@ async function collectGeneratedTables(parts, args) {
|
|
|
56938
57293
|
});
|
|
56939
57294
|
}
|
|
56940
57295
|
let materialized;
|
|
56941
|
-
if (
|
|
57296
|
+
if (materializeOn) {
|
|
56942
57297
|
materialized = await collectGeneratedMaterialize(parts, {
|
|
56943
57298
|
modelPath,
|
|
56944
57299
|
packagePath,
|
|
@@ -57055,7 +57410,7 @@ function reportPersistLineFindings(parts, targets, planned, args) {
|
|
|
57055
57410
|
route: "@",
|
|
57056
57411
|
tier: "malformed",
|
|
57057
57412
|
code: "persist-not-materializable",
|
|
57058
|
-
message: `#@ persist source "${name}" is not a source Malloy can ` + `materialize: only a query or aggregate source builds, and a ` + `filtered pass-through, a table with only added fields, or an ` + `unbound parameterized source does not.
|
|
57413
|
+
message: `#@ persist source "${name}" is not a source Malloy can ` + `materialize: only a query or aggregate source builds, and a ` + `filtered pass-through, a table with only added fields, or an ` + `unbound parameterized source does not. ` + (getMaterializeEnabled() ? `Mark a table-shaped source \`#(materialize)\` instead, ` + `which stores a table-shaped source as well as a ` + `query-shaped one; or persist a query source over it, ` : `Persist a query source over it, `) + `invoke a parameterized source with a bound argument, or ` + `remove the annotation`,
|
|
57059
57414
|
subject: name,
|
|
57060
57415
|
model: modelPath
|
|
57061
57416
|
});
|
|
@@ -57803,6 +58158,16 @@ init_data_styles();
|
|
|
57803
58158
|
init_overlay_key();
|
|
57804
58159
|
init_errors2();
|
|
57805
58160
|
init_error_wire();
|
|
58161
|
+
init_job_files();
|
|
58162
|
+
init_translator_error();
|
|
58163
|
+
init_model_load_checks();
|
|
58164
|
+
init_model_info();
|
|
58165
|
+
init_model_notebook_cell();
|
|
58166
|
+
init_package_revision();
|
|
58167
|
+
init_package_manifest();
|
|
58168
|
+
init_plan();
|
|
58169
|
+
init_package_retrieval_settings();
|
|
58170
|
+
init_utils();
|
|
57806
58171
|
import {
|
|
57807
58172
|
contextOverlay,
|
|
57808
58173
|
MalloyConfig as MalloyConfig4,
|
|
@@ -57811,216 +58176,10 @@ import {
|
|
|
57811
58176
|
import * as fs10 from "fs";
|
|
57812
58177
|
import * as path20 from "path";
|
|
57813
58178
|
import { AsyncLocalStorage as AsyncLocalStorage3 } from "node:async_hooks";
|
|
57814
|
-
import { createHash as
|
|
58179
|
+
import { createHash as createHash10 } from "node:crypto";
|
|
57815
58180
|
import { parentPort, threadId, workerData as workerData2 } from "node:worker_threads";
|
|
57816
58181
|
import { fileURLToPath as fileURLToPath12, pathToFileURL as pathToFileURL17 } from "url";
|
|
57817
58182
|
|
|
57818
|
-
// src/package_load/job_files.ts
|
|
57819
|
-
init_constants();
|
|
57820
|
-
init_data_styles();
|
|
57821
|
-
import {
|
|
57822
|
-
CacheManager,
|
|
57823
|
-
InMemoryModelCache
|
|
57824
|
-
} from "@malloydata/malloy";
|
|
57825
|
-
import * as path6 from "path";
|
|
57826
|
-
import { fileURLToPath as fileURLToPath5, pathToFileURL as pathToFileURL5 } from "url";
|
|
57827
|
-
function jobFiles(inner) {
|
|
57828
|
-
const texts = new Map;
|
|
57829
|
-
const stylesByUrl = new Map;
|
|
57830
|
-
const reads = new Map;
|
|
57831
|
-
const reader = {
|
|
57832
|
-
readURL: (url) => {
|
|
57833
|
-
const key = url.toString();
|
|
57834
|
-
let read = reads.get(key);
|
|
57835
|
-
if (!read) {
|
|
57836
|
-
read = (async () => {
|
|
57837
|
-
const contents = await inner.readURL(url);
|
|
57838
|
-
texts.set(key, contents);
|
|
57839
|
-
stylesByUrl.set(key, await dataStylesForFile(key, contents, inner));
|
|
57840
|
-
return contents;
|
|
57841
|
-
})();
|
|
57842
|
-
reads.set(key, read);
|
|
57843
|
-
read.catch(() => reads.delete(key));
|
|
57844
|
-
}
|
|
57845
|
-
return read;
|
|
57846
|
-
}
|
|
57847
|
-
};
|
|
57848
|
-
return {
|
|
57849
|
-
reader,
|
|
57850
|
-
texts,
|
|
57851
|
-
stylesByUrl,
|
|
57852
|
-
models: new Map,
|
|
57853
|
-
imported: new Set,
|
|
57854
|
-
stats: { stored: 0, reused: 0 }
|
|
57855
|
-
};
|
|
57856
|
-
}
|
|
57857
|
-
function urlKey(url) {
|
|
57858
|
-
try {
|
|
57859
|
-
return new URL(url).href;
|
|
57860
|
-
} catch {
|
|
57861
|
-
return url;
|
|
57862
|
-
}
|
|
57863
|
-
}
|
|
57864
|
-
var sameUrl = (a, b) => a === b || urlKey(a) === urlKey(b);
|
|
57865
|
-
function decodedUrl(url) {
|
|
57866
|
-
try {
|
|
57867
|
-
return decodeURI(url);
|
|
57868
|
-
} catch {
|
|
57869
|
-
return url;
|
|
57870
|
-
}
|
|
57871
|
-
}
|
|
57872
|
-
|
|
57873
|
-
class ModelCacheView extends CacheManager {
|
|
57874
|
-
files;
|
|
57875
|
-
ownUrl;
|
|
57876
|
-
constructor(files, ownUrl) {
|
|
57877
|
-
super(new InMemoryModelCache);
|
|
57878
|
-
this.files = files;
|
|
57879
|
-
this.ownUrl = ownUrl;
|
|
57880
|
-
}
|
|
57881
|
-
async getCachedModelDef(...[, url]) {
|
|
57882
|
-
if (sameUrl(url, this.ownUrl))
|
|
57883
|
-
return;
|
|
57884
|
-
const hit = this.files.models.get(url);
|
|
57885
|
-
if (!hit)
|
|
57886
|
-
return;
|
|
57887
|
-
this.files.stats.reused++;
|
|
57888
|
-
return {
|
|
57889
|
-
modelDef: structuredClone(hit.modelDef),
|
|
57890
|
-
invalidationKeys: { ...hit.invalidationKeys }
|
|
57891
|
-
};
|
|
57892
|
-
}
|
|
57893
|
-
async setCachedModelDef(...[url, cached]) {
|
|
57894
|
-
if (!this.files.imported.has(urlKey(url)))
|
|
57895
|
-
return false;
|
|
57896
|
-
if (sameUrl(url, this.ownUrl) && decodedUrl(url) !== url)
|
|
57897
|
-
return false;
|
|
57898
|
-
this.files.models.set(url, {
|
|
57899
|
-
modelDef: structuredClone(cached.modelDef),
|
|
57900
|
-
invalidationKeys: { ...cached.invalidationKeys }
|
|
57901
|
-
});
|
|
57902
|
-
this.files.stats.stored++;
|
|
57903
|
-
return true;
|
|
57904
|
-
}
|
|
57905
|
-
}
|
|
57906
|
-
function modelFileTexts(files, modelUrl, dependencies) {
|
|
57907
|
-
const byPath = new Map;
|
|
57908
|
-
for (const url of [modelUrl, ...importReadOrder(dependencies)]) {
|
|
57909
|
-
const key = urlKey(url);
|
|
57910
|
-
const text = files.texts.get(key);
|
|
57911
|
-
if (text !== undefined && key.startsWith("file:")) {
|
|
57912
|
-
byPath.set(fileURLToPath5(key), text);
|
|
57913
|
-
}
|
|
57914
|
-
}
|
|
57915
|
-
return byPath;
|
|
57916
|
-
}
|
|
57917
|
-
function dataStylesForModel(files, modelUrl, dependencies) {
|
|
57918
|
-
let styles = {};
|
|
57919
|
-
for (const url of [modelUrl, ...importReadOrder(dependencies)]) {
|
|
57920
|
-
styles = { ...styles, ...files.stylesByUrl.get(urlKey(url)) ?? {} };
|
|
57921
|
-
}
|
|
57922
|
-
return styles;
|
|
57923
|
-
}
|
|
57924
|
-
function importReadOrder(tree) {
|
|
57925
|
-
const order = [];
|
|
57926
|
-
const seen = new Set;
|
|
57927
|
-
const descended = new Set;
|
|
57928
|
-
const visit = (node) => {
|
|
57929
|
-
if (!node || typeof node !== "object")
|
|
57930
|
-
return;
|
|
57931
|
-
const entries = Object.entries(node);
|
|
57932
|
-
for (const [url] of entries) {
|
|
57933
|
-
if (!seen.has(url)) {
|
|
57934
|
-
seen.add(url);
|
|
57935
|
-
order.push(url);
|
|
57936
|
-
}
|
|
57937
|
-
}
|
|
57938
|
-
for (const [url, sub] of entries) {
|
|
57939
|
-
if (descended.has(url))
|
|
57940
|
-
continue;
|
|
57941
|
-
descended.add(url);
|
|
57942
|
-
visit(sub);
|
|
57943
|
-
}
|
|
57944
|
-
};
|
|
57945
|
-
visit(tree);
|
|
57946
|
-
return order;
|
|
57947
|
-
}
|
|
57948
|
-
var IMPORT_RE = /^\s*import\s+(?:\{[^}]*\}\s+from\s+)?(?:"([^"]+)"|'([^']+)')/gim;
|
|
57949
|
-
async function compileOrder(packagePath, modelPaths, reader, imported = new Set) {
|
|
57950
|
-
const malloy = modelPaths.filter((p) => p.endsWith(MODEL_FILE_SUFFIX));
|
|
57951
|
-
const inPackage = new Set(malloy);
|
|
57952
|
-
const imports = new Map;
|
|
57953
|
-
for (const modelPath of malloy) {
|
|
57954
|
-
const url = pathToFileURL5(path6.join(packagePath, modelPath));
|
|
57955
|
-
let text = "";
|
|
57956
|
-
try {
|
|
57957
|
-
text = await reader.readURL(url);
|
|
57958
|
-
} catch {}
|
|
57959
|
-
const deps = [];
|
|
57960
|
-
for (const match of text.matchAll(IMPORT_RE)) {
|
|
57961
|
-
const target = match[1] ?? match[2];
|
|
57962
|
-
if (!target)
|
|
57963
|
-
continue;
|
|
57964
|
-
try {
|
|
57965
|
-
const resolved = new URL(target, url);
|
|
57966
|
-
if (resolved.protocol !== "file:")
|
|
57967
|
-
continue;
|
|
57968
|
-
const rel = path6.relative(packagePath, fileURLToPath5(resolved)).replace(/\\/g, "/");
|
|
57969
|
-
if (inPackage.has(rel)) {
|
|
57970
|
-
deps.push(rel);
|
|
57971
|
-
imported.add(urlKey(resolved.href));
|
|
57972
|
-
}
|
|
57973
|
-
} catch {}
|
|
57974
|
-
}
|
|
57975
|
-
imports.set(modelPath, deps);
|
|
57976
|
-
}
|
|
57977
|
-
const level = new Map;
|
|
57978
|
-
const visiting = new Set;
|
|
57979
|
-
const levelOf = (modelPath) => {
|
|
57980
|
-
const known = level.get(modelPath);
|
|
57981
|
-
if (known !== undefined)
|
|
57982
|
-
return known;
|
|
57983
|
-
if (visiting.has(modelPath))
|
|
57984
|
-
return 0;
|
|
57985
|
-
visiting.add(modelPath);
|
|
57986
|
-
let mine = 0;
|
|
57987
|
-
for (const dep of imports.get(modelPath) ?? []) {
|
|
57988
|
-
mine = Math.max(mine, levelOf(dep) + 1);
|
|
57989
|
-
}
|
|
57990
|
-
visiting.delete(modelPath);
|
|
57991
|
-
level.set(modelPath, mine);
|
|
57992
|
-
return mine;
|
|
57993
|
-
};
|
|
57994
|
-
const levels = [];
|
|
57995
|
-
const waitsOn = new Map;
|
|
57996
|
-
for (const modelPath of malloy) {
|
|
57997
|
-
const mine = levelOf(modelPath);
|
|
57998
|
-
(levels[mine] ??= []).push(modelPath);
|
|
57999
|
-
waitsOn.set(modelPath, (imports.get(modelPath) ?? []).filter((dep) => levelOf(dep) < mine));
|
|
58000
|
-
}
|
|
58001
|
-
const rest = modelPaths.filter((p) => !p.endsWith(MODEL_FILE_SUFFIX));
|
|
58002
|
-
for (const modelPath of rest)
|
|
58003
|
-
waitsOn.set(modelPath, []);
|
|
58004
|
-
return {
|
|
58005
|
-
waitsOn,
|
|
58006
|
-
levels: [
|
|
58007
|
-
...levels.filter((l) => l !== undefined && l.length > 0),
|
|
58008
|
-
...rest.length > 0 ? [rest] : []
|
|
58009
|
-
]
|
|
58010
|
-
};
|
|
58011
|
-
}
|
|
58012
|
-
|
|
58013
|
-
// src/package_load/package_load_worker.ts
|
|
58014
|
-
init_translator_error();
|
|
58015
|
-
init_model_load_checks();
|
|
58016
|
-
init_model_info();
|
|
58017
|
-
init_model_notebook_cell();
|
|
58018
|
-
init_package_revision();
|
|
58019
|
-
init_package_manifest();
|
|
58020
|
-
init_plan();
|
|
58021
|
-
init_package_retrieval_settings();
|
|
58022
|
-
init_utils();
|
|
58023
|
-
|
|
58024
58183
|
// src/package_load/rpc_wait_accountant.ts
|
|
58025
58184
|
class RpcWaitAccountant {
|
|
58026
58185
|
now;
|
|
@@ -58777,7 +58936,7 @@ var REFERENCE_ID = /reference_id = \\"[0-9a-f-]{36}\\"/g;
|
|
|
58777
58936
|
function digestRenderTagResults(results) {
|
|
58778
58937
|
try {
|
|
58779
58938
|
const json = JSON.stringify(results).replace(REFERENCE_ID, "reference_id = \\\"\\\"");
|
|
58780
|
-
return
|
|
58939
|
+
return createHash10("sha256").update(json).digest("hex");
|
|
58781
58940
|
} catch {
|
|
58782
58941
|
return;
|
|
58783
58942
|
}
|
|
@@ -58973,6 +59132,7 @@ async function loadPackage(job) {
|
|
|
58973
59132
|
models,
|
|
58974
59133
|
replacementMatchedExisting,
|
|
58975
59134
|
...refresh ? { refreshedSchemaKeys: [...refresh.refetched] } : {},
|
|
59135
|
+
fileDigests: fileTextDigests(files),
|
|
58976
59136
|
loadDurationMs: loadEnd - loadStart,
|
|
58977
59137
|
timings: {
|
|
58978
59138
|
compileDurationMs: Math.max(0, compileEnd - compileRegionStart - schemaFetchDurationMs),
|