@malloydata/malloy 0.0.298 → 0.0.299
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/api/core.d.ts +1 -0
- package/dist/api/core.js +16 -10
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +4 -4
package/dist/api/core.d.ts
CHANGED
|
@@ -27,6 +27,7 @@ export interface CompileModelState {
|
|
|
27
27
|
translator: MalloyTranslator;
|
|
28
28
|
done: boolean;
|
|
29
29
|
hasSource: boolean;
|
|
30
|
+
excludeReferences: boolean;
|
|
30
31
|
}
|
|
31
32
|
export declare function updateCompileModelState(state: CompileModelState, needs: Malloy.CompilerNeeds | undefined): void;
|
|
32
33
|
export declare function newCompileModelState(request: Malloy.CompileModelRequest): CompileModelState;
|
package/dist/api/core.js
CHANGED
|
@@ -258,17 +258,18 @@ function updateCompileModelState(state, needs) {
|
|
|
258
258
|
const update = compilerNeedsToUpdate(needs);
|
|
259
259
|
performUpdate(state, update);
|
|
260
260
|
}
|
|
261
|
-
function _newCompileModelState(modelURL, compilerNeeds, extendURL) {
|
|
261
|
+
function _newCompileModelState(modelURL, compilerNeeds, extendURL, excludeReferences = false) {
|
|
262
262
|
var _a, _b, _c, _d;
|
|
263
263
|
const translator = new lang_1.MalloyTranslator(modelURL, null, compilerNeedsToUpdate(compilerNeeds));
|
|
264
264
|
const hasSource = ((_b = (_a = compilerNeeds === null || compilerNeeds === void 0 ? void 0 : compilerNeeds.files) === null || _a === void 0 ? void 0 : _a.some(f => f.url === modelURL)) !== null && _b !== void 0 ? _b : false) ||
|
|
265
265
|
((_d = (_c = compilerNeeds === null || compilerNeeds === void 0 ? void 0 : compilerNeeds.translations) === null || _c === void 0 ? void 0 : _c.some(t => t.url === modelURL)) !== null && _d !== void 0 ? _d : false);
|
|
266
266
|
if (extendURL) {
|
|
267
267
|
return {
|
|
268
|
-
extending: _newCompileModelState(extendURL, compilerNeeds),
|
|
268
|
+
extending: _newCompileModelState(extendURL, compilerNeeds, undefined, excludeReferences),
|
|
269
269
|
translator,
|
|
270
270
|
done: false,
|
|
271
271
|
hasSource,
|
|
272
|
+
excludeReferences,
|
|
272
273
|
};
|
|
273
274
|
}
|
|
274
275
|
else {
|
|
@@ -276,14 +277,15 @@ function _newCompileModelState(modelURL, compilerNeeds, extendURL) {
|
|
|
276
277
|
translator,
|
|
277
278
|
done: false,
|
|
278
279
|
hasSource,
|
|
280
|
+
excludeReferences,
|
|
279
281
|
};
|
|
280
282
|
}
|
|
281
283
|
}
|
|
282
284
|
function newCompileModelState(request) {
|
|
283
|
-
return _newCompileModelState(request.model_url, request.compiler_needs, request.extend_model_url);
|
|
285
|
+
return _newCompileModelState(request.model_url, request.compiler_needs, request.extend_model_url, request.exclude_references);
|
|
284
286
|
}
|
|
285
287
|
function newCompileSourceState(request) {
|
|
286
|
-
return _newCompileModelState(request.model_url, request.compiler_needs, request.extend_model_url);
|
|
288
|
+
return _newCompileModelState(request.model_url, request.compiler_needs, request.extend_model_url, request.exclude_references);
|
|
287
289
|
}
|
|
288
290
|
// function hasNeeds(needs: Malloy.CompilerNeeds | undefined): boolean {
|
|
289
291
|
// if (needs === undefined) return false;
|
|
@@ -328,7 +330,7 @@ function _statedCompileModel(state) {
|
|
|
328
330
|
const model = (0, to_stable_1.modelDefToModelInfo)(result.modelDef);
|
|
329
331
|
return {
|
|
330
332
|
model,
|
|
331
|
-
modelDef: result.modelDef,
|
|
333
|
+
modelDef: maybeExcludeReferences(result.modelDef, state.excludeReferences),
|
|
332
334
|
timingInfo,
|
|
333
335
|
};
|
|
334
336
|
}
|
|
@@ -348,6 +350,14 @@ function _statedCompileModel(state) {
|
|
|
348
350
|
return { compilerNeeds, logs: result.problems, timingInfo };
|
|
349
351
|
}
|
|
350
352
|
}
|
|
353
|
+
function maybeExcludeReferences(modelDef, excludeReferences) {
|
|
354
|
+
if (!excludeReferences)
|
|
355
|
+
return modelDef;
|
|
356
|
+
return {
|
|
357
|
+
...modelDef,
|
|
358
|
+
references: undefined,
|
|
359
|
+
};
|
|
360
|
+
}
|
|
351
361
|
function wrapResponse(response, defaultURL) {
|
|
352
362
|
const logs = response.logs ? (0, util_1.mapLogs)(response.logs, defaultURL) : undefined;
|
|
353
363
|
if (response.compilerNeeds) {
|
|
@@ -375,10 +385,6 @@ function wrapResponse(response, defaultURL) {
|
|
|
375
385
|
};
|
|
376
386
|
}
|
|
377
387
|
}
|
|
378
|
-
function _compileModel(modelURL, compilerNeeds, extendURL, state) {
|
|
379
|
-
state !== null && state !== void 0 ? state : (state = _newCompileModelState(modelURL, compilerNeeds, extendURL));
|
|
380
|
-
return _statedCompileModel(state);
|
|
381
|
-
}
|
|
382
388
|
function compileModel(request, state) {
|
|
383
389
|
state !== null && state !== void 0 ? state : (state = newCompileModelState(request));
|
|
384
390
|
return statedCompileModel(state);
|
|
@@ -435,7 +441,7 @@ function newCompileQueryState(request) {
|
|
|
435
441
|
...((_b = needs.files) !== null && _b !== void 0 ? _b : []),
|
|
436
442
|
];
|
|
437
443
|
return {
|
|
438
|
-
..._newCompileModelState(queryURL, needs, request.model_url),
|
|
444
|
+
..._newCompileModelState(queryURL, needs, request.model_url, request.exclude_references),
|
|
439
445
|
defaultRowLimit: request.default_row_limit,
|
|
440
446
|
};
|
|
441
447
|
}
|
package/dist/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const MALLOY_VERSION = "0.0.
|
|
1
|
+
export declare const MALLOY_VERSION = "0.0.299";
|
package/dist/version.js
CHANGED
|
@@ -2,5 +2,5 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.MALLOY_VERSION = void 0;
|
|
4
4
|
// generated with 'generate-version-file' script; do not edit manually
|
|
5
|
-
exports.MALLOY_VERSION = '0.0.
|
|
5
|
+
exports.MALLOY_VERSION = '0.0.299';
|
|
6
6
|
//# sourceMappingURL=version.js.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@malloydata/malloy",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.299",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"exports": {
|
|
6
6
|
".": "./dist/index.js",
|
|
@@ -41,9 +41,9 @@
|
|
|
41
41
|
"generate-version-file": "VERSION=$(npm pkg get version --workspaces=false | tr -d \\\")\necho \"// generated with 'generate-version-file' script; do not edit manually\\nexport const MALLOY_VERSION = '$VERSION';\" > src/version.ts"
|
|
42
42
|
},
|
|
43
43
|
"dependencies": {
|
|
44
|
-
"@malloydata/malloy-filter": "0.0.
|
|
45
|
-
"@malloydata/malloy-interfaces": "0.0.
|
|
46
|
-
"@malloydata/malloy-tag": "0.0.
|
|
44
|
+
"@malloydata/malloy-filter": "0.0.299",
|
|
45
|
+
"@malloydata/malloy-interfaces": "0.0.299",
|
|
46
|
+
"@malloydata/malloy-tag": "0.0.299",
|
|
47
47
|
"antlr4ts": "^0.5.0-alpha.4",
|
|
48
48
|
"assert": "^2.0.0",
|
|
49
49
|
"jaro-winkler": "^0.2.8",
|