@malloydata/malloy 0.0.240-dev250311202829 → 0.0.240-dev250311214430

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 (66) hide show
  1. package/dist/api/core.d.ts +1 -0
  2. package/dist/api/core.js +2 -1
  3. package/dist/lang/malloy-parse-info.d.ts +2 -10
  4. package/dist/lang/malloy-to-ast.d.ts +1 -0
  5. package/dist/lang/malloy-to-ast.js +9 -6
  6. package/dist/lang/malloy-to-stable-query.d.ts +76 -0
  7. package/dist/lang/malloy-to-stable-query.js +660 -0
  8. package/dist/lang/parse-log.d.ts +1 -0
  9. package/dist/lang/parse-malloy.d.ts +2 -9
  10. package/dist/lang/parse-malloy.js +7 -112
  11. package/dist/lang/parse-tree-walkers/model-annotation-walker.js +1 -1
  12. package/dist/lang/run-malloy-parser.d.ts +3 -0
  13. package/dist/lang/run-malloy-parser.js +53 -0
  14. package/dist/lang/syntax-errors/malloy-parser-error-listener.d.ts +4 -3
  15. package/dist/lang/syntax-errors/malloy-parser-error-listener.js +8 -4
  16. package/dist/lang/utils.d.ts +27 -1
  17. package/dist/lang/utils.js +78 -1
  18. package/package.json +3 -3
  19. package/dist/api/asynchronous.spec.d.ts +0 -1
  20. package/dist/api/asynchronous.spec.js +0 -240
  21. package/dist/api/sessioned.spec.d.ts +0 -1
  22. package/dist/api/sessioned.spec.js +0 -476
  23. package/dist/api/stateless.spec.d.ts +0 -1
  24. package/dist/api/stateless.spec.js +0 -400
  25. package/dist/lang/test/annotation.spec.d.ts +0 -14
  26. package/dist/lang/test/annotation.spec.js +0 -809
  27. package/dist/lang/test/composite-field-usage.spec.d.ts +0 -1
  28. package/dist/lang/test/composite-field-usage.spec.js +0 -261
  29. package/dist/lang/test/document-help-context-walker.spec.d.ts +0 -1
  30. package/dist/lang/test/document-help-context-walker.spec.js +0 -55
  31. package/dist/lang/test/document-symbol-walker.spec.d.ts +0 -1
  32. package/dist/lang/test/document-symbol-walker.spec.js +0 -209
  33. package/dist/lang/test/expressions.spec.d.ts +0 -1
  34. package/dist/lang/test/expressions.spec.js +0 -1181
  35. package/dist/lang/test/field-symbols.spec.d.ts +0 -1
  36. package/dist/lang/test/field-symbols.spec.js +0 -194
  37. package/dist/lang/test/find-table-path-walker.spec.d.ts +0 -1
  38. package/dist/lang/test/find-table-path-walker.spec.js +0 -50
  39. package/dist/lang/test/imports.spec.d.ts +0 -1
  40. package/dist/lang/test/imports.spec.js +0 -283
  41. package/dist/lang/test/lenses.spec.d.ts +0 -1
  42. package/dist/lang/test/lenses.spec.js +0 -384
  43. package/dist/lang/test/literals.spec.d.ts +0 -1
  44. package/dist/lang/test/literals.spec.js +0 -267
  45. package/dist/lang/test/locations.spec.d.ts +0 -1
  46. package/dist/lang/test/locations.spec.js +0 -679
  47. package/dist/lang/test/model-annotation-walker.spec.d.ts +0 -1
  48. package/dist/lang/test/model-annotation-walker.spec.js +0 -46
  49. package/dist/lang/test/model_serialization.spec.d.ts +0 -5
  50. package/dist/lang/test/model_serialization.spec.js +0 -116
  51. package/dist/lang/test/parameters.spec.d.ts +0 -1
  52. package/dist/lang/test/parameters.spec.js +0 -619
  53. package/dist/lang/test/parse.spec.d.ts +0 -1
  54. package/dist/lang/test/parse.spec.js +0 -893
  55. package/dist/lang/test/pretranslate.spec.d.ts +0 -1
  56. package/dist/lang/test/pretranslate.spec.js +0 -80
  57. package/dist/lang/test/query.spec.d.ts +0 -1
  58. package/dist/lang/test/query.spec.js +0 -1149
  59. package/dist/lang/test/source.spec.d.ts +0 -1
  60. package/dist/lang/test/source.spec.js +0 -570
  61. package/dist/lang/test/sql-block.spec.d.ts +0 -1
  62. package/dist/lang/test/sql-block.spec.js +0 -145
  63. package/dist/lang/test/syntax-errors.spec.d.ts +0 -1
  64. package/dist/lang/test/syntax-errors.spec.js +0 -142
  65. package/dist/model/utils.spec.d.ts +0 -1
  66. package/dist/model/utils.spec.js +0 -38
@@ -1,46 +0,0 @@
1
- "use strict";
2
- /*
3
- * Copyright 2023 Google LLC
4
- *
5
- * Permission is hereby granted, free of charge, to any person obtaining
6
- * a copy of this software and associated documentation files
7
- * (the "Software"), to deal in the Software without restriction,
8
- * including without limitation the rights to use, copy, modify, merge,
9
- * publish, distribute, sublicense, and/or sell copies of the Software,
10
- * and to permit persons to whom the Software is furnished to do so,
11
- * subject to the following conditions:
12
- *
13
- * The above copyright notice and this permission notice shall be
14
- * included in all copies or substantial portions of the Software.
15
- *
16
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17
- * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
19
- * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
20
- * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
21
- * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
22
- * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
23
- */
24
- Object.defineProperty(exports, "__esModule", { value: true });
25
- const test_translator_1 = require("./test-translator");
26
- test('model annotations can be retrieved', () => {
27
- var _a, _b;
28
- const src = (0, test_translator_1.markSource) `${'## foo'}`;
29
- const doc = new test_translator_1.TestTranslator(src.code);
30
- const { modelAnnotation } = doc.modelAnnotation();
31
- expect((_a = modelAnnotation === null || modelAnnotation === void 0 ? void 0 : modelAnnotation.notes) === null || _a === void 0 ? void 0 : _a.length).toBe(1);
32
- const notes = (_b = modelAnnotation === null || modelAnnotation === void 0 ? void 0 : modelAnnotation.notes) !== null && _b !== void 0 ? _b : [];
33
- expect(notes[0].text).toBe('## foo');
34
- expect(notes[0].at).toMatchObject(src.locations[0]);
35
- });
36
- test('does not explode if bad parse', () => {
37
- const src = (0, test_translator_1.markSource) `
38
- ${'## foo'}
39
- asd afsjei ; duavby {{}}}
40
- `;
41
- const doc = new test_translator_1.TestTranslator(src.code);
42
- const response = doc.modelAnnotation();
43
- expect(response.modelAnnotation).toBe(undefined);
44
- expect(response.final).toBe(true);
45
- });
46
- //# sourceMappingURL=model-annotation-walker.spec.js.map
@@ -1,5 +0,0 @@
1
- import { StructDef, TableSourceDef } from '../../model/malloy_types';
2
- export declare const CHILD_EXPLORE: TableSourceDef;
3
- export declare const PARENT_EXPLORE: TableSourceDef;
4
- export declare const GRANDPARENT_EXPLORE: TableSourceDef;
5
- export declare const SOURCE_EXPLORE: StructDef;
@@ -1,116 +0,0 @@
1
- "use strict";
2
- /*
3
- * Copyright 2023 Google LLC
4
- *
5
- * Permission is hereby granted, free of charge, to any person obtaining
6
- * a copy of this software and associated documentation files
7
- * (the "Software"), to deal in the Software without restriction,
8
- * including without limitation the rights to use, copy, modify, merge,
9
- * publish, distribute, sublicense, and/or sell copies of the Software,
10
- * and to permit persons to whom the Software is furnished to do so,
11
- * subject to the following conditions:
12
- *
13
- * The above copyright notice and this permission notice shall be
14
- * included in all copies or substantial portions of the Software.
15
- *
16
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17
- * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
19
- * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
20
- * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
21
- * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
22
- * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
23
- */
24
- Object.defineProperty(exports, "__esModule", { value: true });
25
- exports.SOURCE_EXPLORE = exports.GRANDPARENT_EXPLORE = exports.PARENT_EXPLORE = exports.CHILD_EXPLORE = void 0;
26
- const malloy_1 = require("../../malloy");
27
- exports.CHILD_EXPLORE = {
28
- type: 'table',
29
- name: 'some_ns.child',
30
- as: 'child',
31
- dialect: 'standardsql',
32
- tablePath: 'some_ns.child',
33
- connection: 'bigquery',
34
- primaryKey: 'id1',
35
- fields: [
36
- { type: 'string', name: 'carrier' },
37
- {
38
- type: 'number',
39
- name: 'flight_count',
40
- expressionType: 'aggregate',
41
- e: { node: 'aggregate', function: 'count', e: { node: '' } },
42
- },
43
- ],
44
- };
45
- exports.PARENT_EXPLORE = {
46
- type: 'table',
47
- name: 'some_ns.parent',
48
- as: 'parent',
49
- dialect: 'standardsql',
50
- tablePath: 'some_ns.parent',
51
- connection: 'bigquery',
52
- primaryKey: 'id2',
53
- fields: [
54
- { type: 'string', name: 'name' },
55
- {
56
- type: 'number',
57
- name: 'some_parent_count',
58
- expressionType: 'aggregate',
59
- e: { node: 'aggregate', function: 'count', e: { node: '' } },
60
- },
61
- ],
62
- };
63
- exports.GRANDPARENT_EXPLORE = {
64
- type: 'table',
65
- name: 'some_ns.gradparent',
66
- as: 'grandparent',
67
- dialect: 'standardsql',
68
- tablePath: 'some_ns.grandparent',
69
- connection: 'bigquery',
70
- primaryKey: 'id3',
71
- fields: [
72
- { type: 'string', name: 'name' },
73
- {
74
- type: 'number',
75
- name: 'some_grandparent_count',
76
- expressionType: 'aggregate',
77
- e: { node: 'aggregate', function: 'count', e: { node: '' } },
78
- },
79
- ],
80
- };
81
- exports.SOURCE_EXPLORE = {
82
- type: 'table',
83
- name: 'some_ns.source',
84
- as: 'source',
85
- dialect: 'standardsql',
86
- tablePath: 'some_ns.grandparent',
87
- connection: 'bigquery',
88
- primaryKey: 'id4',
89
- fields: [
90
- { type: 'string', name: 'name' },
91
- {
92
- type: 'number',
93
- name: 'some_child_count',
94
- expressionType: 'aggregate',
95
- e: { node: 'aggregate', function: 'count', e: { node: '' } },
96
- },
97
- ],
98
- };
99
- describe('serializeModel', () => {
100
- test('Stringify on an `explore` with no parent nor source explore', async () => {
101
- const parent_explore = new malloy_1.Explore(exports.PARENT_EXPLORE);
102
- expect(JSON.stringify(parent_explore)).toStrictEqual('{"_structDef":{"type":"table","name":"some_ns.parent","as":"parent","dialect":"standardsql","tablePath":"some_ns.parent","connection":"bigquery","primaryKey":"id2","fields":[{"type":"string","name":"name"},{"type":"number","name":"some_parent_count","expressionType":"aggregate","e":{"node":"aggregate","function":"count","e":{"node":""}}}]}}');
103
- });
104
- test('No parent nor source explore', async () => {
105
- const parent_explore = new malloy_1.Explore(exports.PARENT_EXPLORE);
106
- expect(malloy_1.Explore.fromJSON(parent_explore.toJSON())).toStrictEqual(parent_explore);
107
- });
108
- test('Having parent and source explores', async () => {
109
- const grandparent_explore = new malloy_1.Explore(exports.GRANDPARENT_EXPLORE);
110
- const parent_explore = new malloy_1.Explore(exports.PARENT_EXPLORE, grandparent_explore);
111
- const source_explore = new malloy_1.Explore(exports.SOURCE_EXPLORE);
112
- const child_explore = new malloy_1.Explore(exports.CHILD_EXPLORE, parent_explore, source_explore);
113
- expect(malloy_1.Explore.fromJSON(child_explore.toJSON())).toStrictEqual(child_explore);
114
- });
115
- });
116
- //# sourceMappingURL=model_serialization.spec.js.map
@@ -1 +0,0 @@
1
- import './parse-expects';