@malloydata/malloy 0.0.112-dev231205222129 → 0.0.112-dev231206183653

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 (33) hide show
  1. package/dist/lang/ast/elements/define-query.d.ts +1 -1
  2. package/dist/lang/ast/elements/define-source.d.ts +1 -1
  3. package/dist/lang/ast/elements/pipeline-desc.d.ts +2 -1
  4. package/dist/lang/ast/elements/refined-source.d.ts +2 -1
  5. package/dist/lang/ast/field-space/rename-space-field.d.ts +2 -1
  6. package/dist/lang/ast/query-items/field-declaration.d.ts +2 -1
  7. package/dist/lang/ast/query-items/field-references.d.ts +2 -1
  8. package/dist/lang/ast/query-properties/joins.d.ts +2 -1
  9. package/dist/lang/ast/query-properties/nest.d.ts +2 -1
  10. package/dist/lang/ast/types/annotation-elements.d.ts +1 -1
  11. package/dist/lang/ast/types/malloy-element.d.ts +2 -1
  12. package/dist/lang/ast/types/noteable.d.ts +1 -1
  13. package/dist/lang/malloy-parse-info.d.ts +1 -1
  14. package/dist/lang/malloy-to-ast.d.ts +1 -1
  15. package/dist/lang/parse-log.d.ts +1 -1
  16. package/dist/lang/parse-malloy.d.ts +2 -1
  17. package/dist/lang/parse-tree-walkers/document-highlight-walker.d.ts +1 -1
  18. package/dist/lang/parse-tree-walkers/document-symbol-walker.d.ts +1 -1
  19. package/dist/lang/parse-tree-walkers/find-external-references.d.ts +1 -1
  20. package/dist/lang/parse-tree-walkers/model-annotation-walker.d.ts +1 -1
  21. package/dist/lang/test/test-translator.d.ts +2 -1
  22. package/dist/lang/translate-response.d.ts +2 -1
  23. package/dist/lang/utils.d.ts +1 -1
  24. package/dist/lang/zone.d.ts +1 -1
  25. package/dist/model/index.d.ts +1 -0
  26. package/dist/model/index.js +1 -0
  27. package/dist/model/malloy_types.d.ts +1 -61
  28. package/dist/model/malloy_types.js +0 -1
  29. package/dist/model/model_runtime_types.d.ts +61 -0
  30. package/dist/model/model_runtime_types.js +3 -0
  31. package/dist/run_sql_options.d.ts +1 -1
  32. package/dist/runtime_types.d.ts +2 -1
  33. package/package.json +1 -1
@@ -1,4 +1,4 @@
1
- import { Annotation } from '../../../model/malloy_types';
1
+ import { Annotation } from '../../../model/model_runtime_types';
2
2
  import { DocStatement, Document, MalloyElement, DocStatementList } from '../types/malloy-element';
3
3
  import { Noteable, extendNoteMethod } from '../types/noteable';
4
4
  import { SourceQueryNode } from './source-query';
@@ -1,4 +1,4 @@
1
- import { Annotation } from '../../../model/malloy_types';
1
+ import { Annotation } from '../../../model/model_runtime_types';
2
2
  import { HasParameter } from '../parameters/has-parameter';
3
3
  import { DocStatement, Document, MalloyElement, DocStatementList } from '../types/malloy-element';
4
4
  import { Noteable, extendNoteMethod } from '../types/noteable';
@@ -1,4 +1,5 @@
1
- import { Annotation, DocumentLocation, PipeSegment, Pipeline, StructDef } from '../../../model/malloy_types';
1
+ import { PipeSegment, Pipeline, StructDef } from '../../../model/malloy_types';
2
+ import { DocumentLocation, Annotation } from '../../../model/model_runtime_types';
2
3
  import { FieldSpace } from '../types/field-space';
3
4
  import { MalloyElement } from '../types/malloy-element';
4
5
  import { QOPDesc } from '../query-properties/qop-desc';
@@ -1,4 +1,5 @@
1
- import { Annotation, StructDef } from '../../../model/malloy_types';
1
+ import { StructDef } from '../../../model/malloy_types';
2
+ import { Annotation } from '../../../model/model_runtime_types';
2
3
  import { HasParameter } from '../parameters/has-parameter';
3
4
  import { SourceDesc } from '../types/source-desc';
4
5
  import { Source } from './source';
@@ -1,4 +1,5 @@
1
- import { DocumentLocation, FieldDef, TypeDesc } from '../../../model/malloy_types';
1
+ import { FieldDef, TypeDesc } from '../../../model/malloy_types';
2
+ import { DocumentLocation } from '../../../model/model_runtime_types';
2
3
  import { SpaceField } from '../types/space-field';
3
4
  export declare class RenameSpaceField extends SpaceField {
4
5
  private readonly otherField;
@@ -1,5 +1,6 @@
1
1
  import { Dialect } from '../../../dialect/dialect';
2
- import { Annotation, FieldTypeDef, StructDef, TypeDesc, FieldDef, QueryFieldDef } from '../../../model/malloy_types';
2
+ import { FieldTypeDef, StructDef, TypeDesc, FieldDef, QueryFieldDef } from '../../../model/malloy_types';
3
+ import { Annotation } from '../../../model/model_runtime_types';
3
4
  import { ExprValue } from '../types/expr-value';
4
5
  import { ExpressionDef } from '../types/expression-def';
5
6
  import { FieldName, FieldSpace, QueryFieldSpace } from '../types/field-space';
@@ -1,4 +1,5 @@
1
- import { Annotation, FieldDef, TypeDesc } from '../../../model/malloy_types';
1
+ import { FieldDef, TypeDesc } from '../../../model/malloy_types';
2
+ import { Annotation } from '../../../model/model_runtime_types';
2
3
  import { DynamicSpace } from '../field-space/dynamic-space';
3
4
  import { DefinitionList } from '../types/definition-list';
4
5
  import { FieldName, FieldSpace } from '../types/field-space';
@@ -1,4 +1,5 @@
1
- import { Annotation, Expr, StructDef } from '../../../model/malloy_types';
1
+ import { Expr, StructDef } from '../../../model/malloy_types';
2
+ import { Annotation } from '../../../model/model_runtime_types';
2
3
  import { DynamicSpace } from '../field-space/dynamic-space';
3
4
  import { DefinitionList } from '../types/definition-list';
4
5
  import { QueryBuilder } from '../types/query-builder';
@@ -1,4 +1,5 @@
1
1
  import * as model from '../../../model/malloy_types';
2
+ import { Annotation } from '../../../model/model_runtime_types';
2
3
  import { FieldSpace } from '../types/field-space';
3
4
  import { MalloyElement } from '../types/malloy-element';
4
5
  import { Noteable, extendNoteMethod } from '../types/noteable';
@@ -15,7 +16,7 @@ declare abstract class TurtleDeclRoot extends TurtleHeadedPipe implements Noteab
15
16
  readonly name: string;
16
17
  readonly isNoteableObj = true;
17
18
  extendNote: typeof extendNoteMethod;
18
- note?: model.Annotation;
19
+ note?: Annotation;
19
20
  constructor(name: string);
20
21
  getPipeline(fs: FieldSpace): model.Pipeline;
21
22
  getFieldDef(fs: FieldSpace): model.TurtleDef;
@@ -1,4 +1,4 @@
1
- import { Note } from '../../../model/malloy_types';
1
+ import { Note } from '../../../model/model_runtime_types';
2
2
  import { Tag } from '../../../tags';
3
3
  import { MessageLogger } from '../../parse-log';
4
4
  import { Document, DocStatement, MalloyElement } from './malloy-element';
@@ -1,4 +1,5 @@
1
- import { Annotation, DocumentLocation, DocumentReference, ModelDef, ModelAnnotation, NamedModelObject, Query, SQLBlockStructDef, StructDef } from '../../../model/malloy_types';
1
+ import { DocumentReference, ModelDef, ModelAnnotation, NamedModelObject, Query, SQLBlockStructDef, StructDef } from '../../../model/malloy_types';
2
+ import { Annotation, DocumentLocation } from '../../../model/model_runtime_types';
2
3
  import { Tag } from '../../../tags';
3
4
  import { LogSeverity, MessageLogger } from '../../parse-log';
4
5
  import { MalloyTranslation } from '../../parse-malloy';
@@ -1,4 +1,4 @@
1
- import { Annotation } from '../../../model/malloy_types';
1
+ import { Annotation } from '../../../model/model_runtime_types';
2
2
  /**
3
3
  * An object which can receive annotations is "Noteable"
4
4
  */
@@ -1,6 +1,6 @@
1
1
  import { CodePointCharStream, CommonTokenStream, ParserRuleContext } from 'antlr4ts';
2
2
  import { ParseTree } from 'antlr4ts/tree';
3
- import { DocumentRange } from '../model/malloy_types';
3
+ import { DocumentRange } from '../model/model_runtime_types';
4
4
  export interface MalloyParseInfo {
5
5
  root: ParseTree;
6
6
  tokenStream: CommonTokenStream;
@@ -9,7 +9,7 @@ import { MalloyParseInfo } from './malloy-parse-info';
9
9
  import { FieldDeclarationConstructor } from './ast';
10
10
  import { HasString, HasID } from './parse-utils';
11
11
  import { CastType } from '../model';
12
- import { DocumentLocation, Note } from '../model/malloy_types';
12
+ import { DocumentLocation, Note } from '../model/model_runtime_types';
13
13
  import { Tag } from '../tags';
14
14
  declare class ErrorNode extends ast.SourceQueryNode {
15
15
  elementType: string;
@@ -1,4 +1,4 @@
1
- import { DocumentLocation } from '../model/malloy_types';
1
+ import { DocumentLocation } from '../model/model_runtime_types';
2
2
  export type LogSeverity = 'error' | 'warn' | 'debug';
3
3
  /**
4
4
  * Default severity is "error"
@@ -1,5 +1,6 @@
1
1
  import { ANTLRErrorListener, ParserRuleContext, Token } from 'antlr4ts';
2
- import { DocumentLocation, DocumentPosition, DocumentRange, DocumentReference, ImportLocation, ModelDef, NamedModelObject, Query, SQLBlockStructDef, StructDef } from '../model/malloy_types';
2
+ import { DocumentReference, ImportLocation, ModelDef, NamedModelObject, Query, SQLBlockStructDef, StructDef } from '../model/malloy_types';
3
+ import { DocumentLocation, DocumentPosition, DocumentRange } from '../model/model_runtime_types';
3
4
  import { LogMessage, MessageLog, MessageLogger } from './parse-log';
4
5
  import { Zone, ZoneData } from './zone';
5
6
  import { ReferenceList } from './reference-list';
@@ -1,6 +1,6 @@
1
1
  import { CommonTokenStream } from 'antlr4ts';
2
2
  import { ParseTree } from 'antlr4ts/tree';
3
- import { DocumentRange } from '../../model/malloy_types';
3
+ import { DocumentRange } from '../../model/model_runtime_types';
4
4
  export interface DocumentHighlight {
5
5
  range: DocumentRange;
6
6
  type: string;
@@ -1,6 +1,6 @@
1
1
  import { CommonTokenStream } from 'antlr4ts';
2
2
  import { ParseTree } from 'antlr4ts/tree';
3
- import { DocumentRange } from '../../model/malloy_types';
3
+ import { DocumentRange } from '../../model/model_runtime_types';
4
4
  import { MalloyTranslation } from '../parse-malloy';
5
5
  export interface DocumentSymbol {
6
6
  range: DocumentRange;
@@ -1,6 +1,6 @@
1
1
  import { CommonTokenStream } from 'antlr4ts';
2
2
  import { ParseTree } from 'antlr4ts/tree';
3
- import { DocumentRange } from '../../model/malloy_types';
3
+ import { DocumentRange } from '../../model/model_runtime_types';
4
4
  import { MalloyTranslation } from '../parse-malloy';
5
5
  type NeedImports = Record<string, DocumentRange>;
6
6
  type NeedTables = Record<string, {
@@ -1,5 +1,5 @@
1
1
  import { CommonTokenStream } from 'antlr4ts';
2
2
  import { MalloyTranslation } from '../parse-malloy';
3
- import { Annotation } from '../../model/malloy_types';
3
+ import { Annotation } from '../../model/model_runtime_types';
4
4
  import { MalloyParseInfo } from '../malloy-parse-info';
5
5
  export declare function walkForModelAnnotation(forParse: MalloyTranslation, tokens: CommonTokenStream, parseInfo: MalloyParseInfo): Annotation;
@@ -1,4 +1,5 @@
1
- import { DocumentLocation, FieldDef, ModelDef, NamedModelObject, PipeSegment, Query, SQLBlockSource, SQLBlockStructDef, StructDef, TurtleDef } from '../../model/malloy_types';
1
+ import { FieldDef, ModelDef, NamedModelObject, PipeSegment, Query, SQLBlockSource, SQLBlockStructDef, StructDef, TurtleDef } from '../../model/malloy_types';
2
+ import { DocumentLocation } from '../../model/model_runtime_types';
2
3
  import { MalloyElement } from '../ast';
3
4
  import { NameSpace } from '../ast/types/name-space';
4
5
  import { ModelEntry } from '../ast/types/model-entry';
@@ -1,4 +1,5 @@
1
- import { Annotation, ModelDef, Query, SQLBlockSource, SQLBlockStructDef } from '../model/malloy_types';
1
+ import { ModelDef, Query, SQLBlockSource, SQLBlockStructDef } from '../model/malloy_types';
2
+ import { Annotation } from '../model/model_runtime_types';
2
3
  import { MalloyElement } from './ast';
3
4
  import { LogMessage } from './parse-log';
4
5
  import { DocumentSymbol } from './parse-tree-walkers/document-symbol-walker';
@@ -1,2 +1,2 @@
1
- import { DocumentLocation, DocumentPosition } from '../model/malloy_types';
1
+ import { DocumentLocation, DocumentPosition } from '../model/model_runtime_types';
2
2
  export declare function locationContainsPosition(location: DocumentLocation, position: DocumentPosition): boolean;
@@ -1,4 +1,4 @@
1
- import { DocumentLocation } from '../model/malloy_types';
1
+ import { DocumentLocation } from '../model/model_runtime_types';
2
2
  export type ZoneData<TValue> = Record<string, TValue>;
3
3
  type EntryStatus = 'present' | 'reference' | 'error';
4
4
  interface AllEntries {
@@ -1,2 +1,3 @@
1
1
  export * from './malloy_types';
2
2
  export { Segment, QueryModel, flattenQuery } from './malloy_query';
3
+ export * from './model_runtime_types';
@@ -42,4 +42,5 @@ var malloy_query_1 = require("./malloy_query");
42
42
  Object.defineProperty(exports, "Segment", { enumerable: true, get: function () { return malloy_query_1.Segment; } });
43
43
  Object.defineProperty(exports, "QueryModel", { enumerable: true, get: function () { return malloy_query_1.QueryModel; } });
44
44
  Object.defineProperty(exports, "flattenQuery", { enumerable: true, get: function () { return malloy_query_1.flattenQuery; } });
45
+ __exportStar(require("./model_runtime_types"), exports);
45
46
  //# sourceMappingURL=index.js.map
@@ -1,4 +1,4 @@
1
- /// <reference types="node" />
1
+ import { SQLBlock, QueryRunStats, DocumentLocation, Annotation, NamedObject, AliasedName, QueryData, HasLocation, QueryValue } from './model_runtime_types';
2
2
  interface ParamBase {
3
3
  name: string;
4
4
  type: AtomicFieldType;
@@ -17,22 +17,10 @@ export type Parameter = ParamCondition | ParamValue;
17
17
  export declare function isValueParameter(p: Parameter): p is ParamValue;
18
18
  export declare function isConditionParameter(p: Parameter): p is ParamCondition;
19
19
  export declare function paramHasValue(p: Parameter): boolean;
20
- export interface DocumentRange {
21
- start: DocumentPosition;
22
- end: DocumentPosition;
23
- }
24
- export interface DocumentPosition {
25
- line: number;
26
- character: number;
27
- }
28
20
  export interface ImportLocation {
29
21
  importURL: string;
30
22
  location: DocumentLocation;
31
23
  }
32
- export interface DocumentLocation {
33
- url: string;
34
- range: DocumentRange;
35
- }
36
24
  interface DocumentReferenceBase {
37
25
  text: string;
38
26
  location: DocumentLocation;
@@ -59,15 +47,6 @@ export interface DocumentFieldReference extends DocumentReferenceBase {
59
47
  definition: FieldDef;
60
48
  }
61
49
  export type DocumentReference = DocumentExploreReference | DocumentQueryReference | DocumentSQLBlockReference | DocumentFieldReference | DocumentJoinReference;
62
- /** put location into the parse tree. */
63
- export interface HasLocation {
64
- location?: DocumentLocation;
65
- }
66
- /** All names have their source names and how they will appear in the symbol table that owns them */
67
- export interface AliasedName {
68
- name: string;
69
- as?: string;
70
- }
71
50
  export interface TypedObject {
72
51
  type: string;
73
52
  }
@@ -75,10 +54,6 @@ export interface FilteredAliasedName extends AliasedName {
75
54
  filterList?: FilterExpression[];
76
55
  }
77
56
  export declare function isFilteredAliasedName(f: FieldTypeRef): f is FilteredAliasedName;
78
- /** all named objects have a type an a name (optionally aliased) */
79
- export interface NamedObject extends AliasedName, HasLocation {
80
- type: string;
81
- }
82
57
  export interface ResultMetadataDef {
83
58
  sourceField: string;
84
59
  sourceExpression?: string;
@@ -493,11 +468,6 @@ export interface SQLBlockSource {
493
468
  connection?: string;
494
469
  select: SQLPhrase[];
495
470
  }
496
- export interface SQLBlock extends NamedObject {
497
- type: 'sqlBlock';
498
- connection?: string;
499
- selectStr: string;
500
- }
501
471
  interface SubquerySource {
502
472
  type: 'sql';
503
473
  method: 'subquery';
@@ -619,40 +589,10 @@ export interface ModelDef {
619
589
  /** Very common record type */
620
590
  export type NamedStructDefs = Record<string, StructDef>;
621
591
  export type NamedModelObjects = Record<string, NamedModelObject>;
622
- /** Malloy source annotations attached to objects */
623
- export interface Annotation {
624
- inherits?: Annotation;
625
- blockNotes?: Note[];
626
- notes?: Note[];
627
- }
628
- export interface Note {
629
- text: string;
630
- at: DocumentLocation;
631
- }
632
592
  /** Annotations with a uuid to make it easier to stream */
633
593
  export interface ModelAnnotation extends Annotation {
634
594
  id: string;
635
595
  }
636
- export type QueryScalar = string | boolean | number | Date | Buffer | null;
637
- /** One value in one column of returned data. */
638
- export type QueryValue = QueryScalar | QueryData | QueryDataRow;
639
- /** A row of returned data. */
640
- export type QueryDataRow = {
641
- [columnName: string]: QueryValue;
642
- };
643
- /** Returned query data. */
644
- export type QueryData = QueryDataRow[];
645
- /** Query execution stats. */
646
- export type QueryRunStats = {
647
- queryCostBytes?: number;
648
- };
649
- /** Returned Malloy query data */
650
- export type MalloyQueryData = {
651
- rows: QueryDataRow[];
652
- totalRows: number;
653
- runStats?: QueryRunStats;
654
- profilingUrl?: string;
655
- };
656
596
  export interface DrillSource {
657
597
  sourceExplore: string;
658
598
  sourceFilters?: FilterExpression[];
@@ -426,5 +426,4 @@ function isValueDate(value, field) {
426
426
  return field.type === 'date';
427
427
  }
428
428
  exports.isValueDate = isValueDate;
429
- // clang-format on
430
429
  //# sourceMappingURL=malloy_types.js.map
@@ -0,0 +1,61 @@
1
+ /// <reference types="node" />
2
+ /** Query execution stats. */
3
+ export type QueryRunStats = {
4
+ queryCostBytes?: number;
5
+ };
6
+ /** Malloy source annotations attached to objects */
7
+ export interface Annotation {
8
+ inherits?: Annotation;
9
+ blockNotes?: Note[];
10
+ notes?: Note[];
11
+ }
12
+ export interface Note {
13
+ text: string;
14
+ at: DocumentLocation;
15
+ }
16
+ export interface DocumentLocation {
17
+ url: string;
18
+ range: DocumentRange;
19
+ }
20
+ export interface DocumentRange {
21
+ start: DocumentPosition;
22
+ end: DocumentPosition;
23
+ }
24
+ export interface DocumentPosition {
25
+ line: number;
26
+ character: number;
27
+ }
28
+ /** A row of returned data. */
29
+ export type QueryDataRow = {
30
+ [columnName: string]: QueryValue;
31
+ };
32
+ export type QueryScalar = string | boolean | number | Date | Buffer | null;
33
+ /** One value in one column of returned data. */
34
+ export type QueryValue = QueryScalar | QueryData | QueryDataRow;
35
+ /** Returned query data. */
36
+ export type QueryData = QueryDataRow[];
37
+ /** Returned Malloy query data */
38
+ export type MalloyQueryData = {
39
+ rows: QueryDataRow[];
40
+ totalRows: number;
41
+ runStats?: QueryRunStats;
42
+ profilingUrl?: string;
43
+ };
44
+ /** All names have their source names and how they will appear in the symbol table that owns them */
45
+ export interface AliasedName {
46
+ name: string;
47
+ as?: string;
48
+ }
49
+ /** put location into the parse tree. */
50
+ export interface HasLocation {
51
+ location?: DocumentLocation;
52
+ }
53
+ /** all named objects have a type an a name (optionally aliased) */
54
+ export interface NamedObject extends AliasedName, HasLocation {
55
+ type: string;
56
+ }
57
+ export interface SQLBlock extends NamedObject {
58
+ type: 'sqlBlock';
59
+ connection?: string;
60
+ selectStr: string;
61
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=model_runtime_types.js.map
@@ -1,4 +1,4 @@
1
- import { Annotation } from './model/malloy_types';
1
+ import { Annotation } from './model/model_runtime_types';
2
2
  export interface RunSQLOptions {
3
3
  rowLimit?: number;
4
4
  abortSignal?: AbortSignal;
@@ -1,5 +1,6 @@
1
1
  import { RunSQLOptions } from './run_sql_options';
2
- import { Annotation, MalloyQueryData, QueryDataRow, QueryRunStats, SQLBlock, StructDef } from './model/malloy_types';
2
+ import { StructDef } from './model/malloy_types';
3
+ import { Annotation, QueryRunStats, QueryDataRow, MalloyQueryData, SQLBlock } from './model/model_runtime_types';
3
4
  import { Dialect } from './dialect';
4
5
  /**
5
6
  * The contents of a Malloy query document.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@malloydata/malloy",
3
- "version": "0.0.112-dev231205222129",
3
+ "version": "0.0.112-dev231206183653",
4
4
  "license": "MIT",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",