@malloydata/malloy 0.0.112-dev231206174321 → 0.0.112-dev231206194739

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 +1 -2
  4. package/dist/lang/ast/elements/refined-source.d.ts +1 -2
  5. package/dist/lang/ast/field-space/rename-space-field.d.ts +1 -2
  6. package/dist/lang/ast/query-items/field-declaration.d.ts +1 -2
  7. package/dist/lang/ast/query-items/field-references.d.ts +1 -2
  8. package/dist/lang/ast/query-properties/joins.d.ts +1 -2
  9. package/dist/lang/ast/query-properties/nest.d.ts +1 -2
  10. package/dist/lang/ast/types/annotation-elements.d.ts +1 -1
  11. package/dist/lang/ast/types/malloy-element.d.ts +1 -2
  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 +1 -2
  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 +1 -2
  22. package/dist/lang/translate-response.d.ts +1 -2
  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 +0 -1
  26. package/dist/model/index.js +0 -1
  27. package/dist/model/malloy_types.d.ts +61 -1
  28. package/dist/model/malloy_types.js +1 -0
  29. package/dist/run_sql_options.d.ts +1 -1
  30. package/dist/runtime_types.d.ts +1 -2
  31. package/package.json +1 -1
  32. package/dist/model/model_runtime_types.d.ts +0 -61
  33. package/dist/model/model_runtime_types.js +0 -3
@@ -1,4 +1,4 @@
1
- import { Annotation } from '../../../model/model_runtime_types';
1
+ import { Annotation } from '../../../model/malloy_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/model_runtime_types';
1
+ import { Annotation } from '../../../model/malloy_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,5 +1,4 @@
1
- import { PipeSegment, Pipeline, StructDef } from '../../../model/malloy_types';
2
- import { DocumentLocation, Annotation } from '../../../model/model_runtime_types';
1
+ import { Annotation, DocumentLocation, PipeSegment, Pipeline, StructDef } from '../../../model/malloy_types';
3
2
  import { FieldSpace } from '../types/field-space';
4
3
  import { MalloyElement } from '../types/malloy-element';
5
4
  import { QOPDesc } from '../query-properties/qop-desc';
@@ -1,5 +1,4 @@
1
- import { StructDef } from '../../../model/malloy_types';
2
- import { Annotation } from '../../../model/model_runtime_types';
1
+ import { Annotation, StructDef } from '../../../model/malloy_types';
3
2
  import { HasParameter } from '../parameters/has-parameter';
4
3
  import { SourceDesc } from '../types/source-desc';
5
4
  import { Source } from './source';
@@ -1,5 +1,4 @@
1
- import { FieldDef, TypeDesc } from '../../../model/malloy_types';
2
- import { DocumentLocation } from '../../../model/model_runtime_types';
1
+ import { DocumentLocation, FieldDef, TypeDesc } from '../../../model/malloy_types';
3
2
  import { SpaceField } from '../types/space-field';
4
3
  export declare class RenameSpaceField extends SpaceField {
5
4
  private readonly otherField;
@@ -1,6 +1,5 @@
1
1
  import { Dialect } from '../../../dialect/dialect';
2
- import { FieldTypeDef, StructDef, TypeDesc, FieldDef, QueryFieldDef } from '../../../model/malloy_types';
3
- import { Annotation } from '../../../model/model_runtime_types';
2
+ import { Annotation, FieldTypeDef, StructDef, TypeDesc, FieldDef, QueryFieldDef } from '../../../model/malloy_types';
4
3
  import { ExprValue } from '../types/expr-value';
5
4
  import { ExpressionDef } from '../types/expression-def';
6
5
  import { FieldName, FieldSpace, QueryFieldSpace } from '../types/field-space';
@@ -1,5 +1,4 @@
1
- import { FieldDef, TypeDesc } from '../../../model/malloy_types';
2
- import { Annotation } from '../../../model/model_runtime_types';
1
+ import { Annotation, FieldDef, TypeDesc } from '../../../model/malloy_types';
3
2
  import { DynamicSpace } from '../field-space/dynamic-space';
4
3
  import { DefinitionList } from '../types/definition-list';
5
4
  import { FieldName, FieldSpace } from '../types/field-space';
@@ -1,5 +1,4 @@
1
- import { Expr, StructDef } from '../../../model/malloy_types';
2
- import { Annotation } from '../../../model/model_runtime_types';
1
+ import { Annotation, Expr, StructDef } from '../../../model/malloy_types';
3
2
  import { DynamicSpace } from '../field-space/dynamic-space';
4
3
  import { DefinitionList } from '../types/definition-list';
5
4
  import { QueryBuilder } from '../types/query-builder';
@@ -1,5 +1,4 @@
1
1
  import * as model from '../../../model/malloy_types';
2
- import { Annotation } from '../../../model/model_runtime_types';
3
2
  import { FieldSpace } from '../types/field-space';
4
3
  import { MalloyElement } from '../types/malloy-element';
5
4
  import { Noteable, extendNoteMethod } from '../types/noteable';
@@ -16,7 +15,7 @@ declare abstract class TurtleDeclRoot extends TurtleHeadedPipe implements Noteab
16
15
  readonly name: string;
17
16
  readonly isNoteableObj = true;
18
17
  extendNote: typeof extendNoteMethod;
19
- note?: Annotation;
18
+ note?: model.Annotation;
20
19
  constructor(name: string);
21
20
  getPipeline(fs: FieldSpace): model.Pipeline;
22
21
  getFieldDef(fs: FieldSpace): model.TurtleDef;
@@ -1,4 +1,4 @@
1
- import { Note } from '../../../model/model_runtime_types';
1
+ import { Note } from '../../../model/malloy_types';
2
2
  import { Tag } from '../../../tags';
3
3
  import { MessageLogger } from '../../parse-log';
4
4
  import { Document, DocStatement, MalloyElement } from './malloy-element';
@@ -1,5 +1,4 @@
1
- import { DocumentReference, ModelDef, ModelAnnotation, NamedModelObject, Query, SQLBlockStructDef, StructDef } from '../../../model/malloy_types';
2
- import { Annotation, DocumentLocation } from '../../../model/model_runtime_types';
1
+ import { Annotation, DocumentLocation, DocumentReference, ModelDef, ModelAnnotation, NamedModelObject, Query, SQLBlockStructDef, StructDef } from '../../../model/malloy_types';
3
2
  import { Tag } from '../../../tags';
4
3
  import { LogSeverity, MessageLogger } from '../../parse-log';
5
4
  import { MalloyTranslation } from '../../parse-malloy';
@@ -1,4 +1,4 @@
1
- import { Annotation } from '../../../model/model_runtime_types';
1
+ import { Annotation } from '../../../model/malloy_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/model_runtime_types';
3
+ import { DocumentRange } from '../model/malloy_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/model_runtime_types';
12
+ import { DocumentLocation, Note } from '../model/malloy_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/model_runtime_types';
1
+ import { DocumentLocation } from '../model/malloy_types';
2
2
  export type LogSeverity = 'error' | 'warn' | 'debug';
3
3
  /**
4
4
  * Default severity is "error"
@@ -1,6 +1,5 @@
1
1
  import { ANTLRErrorListener, ParserRuleContext, Token } from 'antlr4ts';
2
- import { DocumentReference, ImportLocation, ModelDef, NamedModelObject, Query, SQLBlockStructDef, StructDef } from '../model/malloy_types';
3
- import { DocumentLocation, DocumentPosition, DocumentRange } from '../model/model_runtime_types';
2
+ import { DocumentLocation, DocumentPosition, DocumentRange, DocumentReference, ImportLocation, ModelDef, NamedModelObject, Query, SQLBlockStructDef, StructDef } from '../model/malloy_types';
4
3
  import { LogMessage, MessageLog, MessageLogger } from './parse-log';
5
4
  import { Zone, ZoneData } from './zone';
6
5
  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/model_runtime_types';
3
+ import { DocumentRange } from '../../model/malloy_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/model_runtime_types';
3
+ import { DocumentRange } from '../../model/malloy_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/model_runtime_types';
3
+ import { DocumentRange } from '../../model/malloy_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/model_runtime_types';
3
+ import { Annotation } from '../../model/malloy_types';
4
4
  import { MalloyParseInfo } from '../malloy-parse-info';
5
5
  export declare function walkForModelAnnotation(forParse: MalloyTranslation, tokens: CommonTokenStream, parseInfo: MalloyParseInfo): Annotation;
@@ -1,5 +1,4 @@
1
- import { FieldDef, ModelDef, NamedModelObject, PipeSegment, Query, SQLBlockSource, SQLBlockStructDef, StructDef, TurtleDef } from '../../model/malloy_types';
2
- import { DocumentLocation } from '../../model/model_runtime_types';
1
+ import { DocumentLocation, FieldDef, ModelDef, NamedModelObject, PipeSegment, Query, SQLBlockSource, SQLBlockStructDef, StructDef, TurtleDef } from '../../model/malloy_types';
3
2
  import { MalloyElement } from '../ast';
4
3
  import { NameSpace } from '../ast/types/name-space';
5
4
  import { ModelEntry } from '../ast/types/model-entry';
@@ -1,5 +1,4 @@
1
- import { ModelDef, Query, SQLBlockSource, SQLBlockStructDef } from '../model/malloy_types';
2
- import { Annotation } from '../model/model_runtime_types';
1
+ import { Annotation, ModelDef, Query, SQLBlockSource, SQLBlockStructDef } from '../model/malloy_types';
3
2
  import { MalloyElement } from './ast';
4
3
  import { LogMessage } from './parse-log';
5
4
  import { DocumentSymbol } from './parse-tree-walkers/document-symbol-walker';
@@ -1,2 +1,2 @@
1
- import { DocumentLocation, DocumentPosition } from '../model/model_runtime_types';
1
+ import { DocumentLocation, DocumentPosition } from '../model/malloy_types';
2
2
  export declare function locationContainsPosition(location: DocumentLocation, position: DocumentPosition): boolean;
@@ -1,4 +1,4 @@
1
- import { DocumentLocation } from '../model/model_runtime_types';
1
+ import { DocumentLocation } from '../model/malloy_types';
2
2
  export type ZoneData<TValue> = Record<string, TValue>;
3
3
  type EntryStatus = 'present' | 'reference' | 'error';
4
4
  interface AllEntries {
@@ -1,3 +1,2 @@
1
1
  export * from './malloy_types';
2
2
  export { Segment, QueryModel, flattenQuery } from './malloy_query';
3
- export * from './model_runtime_types';
@@ -42,5 +42,4 @@ 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);
46
45
  //# sourceMappingURL=index.js.map
@@ -1,4 +1,4 @@
1
- import { SQLBlock, QueryRunStats, DocumentLocation, Annotation, NamedObject, AliasedName, QueryData, HasLocation, QueryValue } from './model_runtime_types';
1
+ /// <reference types="node" />
2
2
  interface ParamBase {
3
3
  name: string;
4
4
  type: AtomicFieldType;
@@ -17,10 +17,22 @@ 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
+ }
20
28
  export interface ImportLocation {
21
29
  importURL: string;
22
30
  location: DocumentLocation;
23
31
  }
32
+ export interface DocumentLocation {
33
+ url: string;
34
+ range: DocumentRange;
35
+ }
24
36
  interface DocumentReferenceBase {
25
37
  text: string;
26
38
  location: DocumentLocation;
@@ -47,6 +59,15 @@ export interface DocumentFieldReference extends DocumentReferenceBase {
47
59
  definition: FieldDef;
48
60
  }
49
61
  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
+ }
50
71
  export interface TypedObject {
51
72
  type: string;
52
73
  }
@@ -54,6 +75,10 @@ export interface FilteredAliasedName extends AliasedName {
54
75
  filterList?: FilterExpression[];
55
76
  }
56
77
  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
+ }
57
82
  export interface ResultMetadataDef {
58
83
  sourceField: string;
59
84
  sourceExpression?: string;
@@ -468,6 +493,11 @@ export interface SQLBlockSource {
468
493
  connection?: string;
469
494
  select: SQLPhrase[];
470
495
  }
496
+ export interface SQLBlock extends NamedObject {
497
+ type: 'sqlBlock';
498
+ connection?: string;
499
+ selectStr: string;
500
+ }
471
501
  interface SubquerySource {
472
502
  type: 'sql';
473
503
  method: 'subquery';
@@ -589,10 +619,40 @@ export interface ModelDef {
589
619
  /** Very common record type */
590
620
  export type NamedStructDefs = Record<string, StructDef>;
591
621
  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
+ }
592
632
  /** Annotations with a uuid to make it easier to stream */
593
633
  export interface ModelAnnotation extends Annotation {
594
634
  id: string;
595
635
  }
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
+ };
596
656
  export interface DrillSource {
597
657
  sourceExplore: string;
598
658
  sourceFilters?: FilterExpression[];
@@ -426,4 +426,5 @@ function isValueDate(value, field) {
426
426
  return field.type === 'date';
427
427
  }
428
428
  exports.isValueDate = isValueDate;
429
+ // clang-format on
429
430
  //# sourceMappingURL=malloy_types.js.map
@@ -1,4 +1,4 @@
1
- import { Annotation } from './model/model_runtime_types';
1
+ import { Annotation } from './model/malloy_types';
2
2
  export interface RunSQLOptions {
3
3
  rowLimit?: number;
4
4
  abortSignal?: AbortSignal;
@@ -1,6 +1,5 @@
1
1
  import { RunSQLOptions } from './run_sql_options';
2
- import { StructDef } from './model/malloy_types';
3
- import { Annotation, QueryRunStats, QueryDataRow, MalloyQueryData, SQLBlock } from './model/model_runtime_types';
2
+ import { Annotation, MalloyQueryData, QueryDataRow, QueryRunStats, SQLBlock, StructDef } from './model/malloy_types';
4
3
  import { Dialect } from './dialect';
5
4
  /**
6
5
  * 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-dev231206174321",
3
+ "version": "0.0.112-dev231206194739",
4
4
  "license": "MIT",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -1,61 +0,0 @@
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
- }
@@ -1,3 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=model_runtime_types.js.map