@malloydata/malloy 0.0.399 → 0.0.400
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/annotation-utils.d.ts +36 -0
- package/dist/api/annotation-utils.js +76 -0
- package/dist/api/core.js +3 -3
- package/dist/api/foundation/annotation.d.ts +115 -0
- package/dist/{annotation.js → api/foundation/annotation.js} +87 -42
- package/dist/api/foundation/compile.js +3 -3
- package/dist/api/foundation/core.d.ts +80 -17
- package/dist/api/foundation/core.js +135 -43
- package/dist/api/foundation/index.d.ts +1 -1
- package/dist/api/foundation/index.js +3 -2
- package/dist/api/foundation/runtime.js +2 -2
- package/dist/{taggable.d.ts → api/foundation/taggable.d.ts} +4 -4
- package/dist/api/foundation/types.d.ts +1 -1
- package/dist/connection/types.d.ts +3 -2
- package/dist/index.d.ts +9 -2
- package/dist/index.js +17 -4
- package/dist/{prefix.js → lang/annotation-prefix.js} +1 -1
- package/dist/lang/ast/expressions/expr-given.js +1 -1
- package/dist/lang/ast/field-space/dynamic-space.d.ts +1 -1
- package/dist/lang/ast/field-space/dynamic-space.js +2 -2
- package/dist/lang/ast/field-space/include-utils.d.ts +3 -3
- package/dist/lang/ast/field-space/query-spaces.js +2 -2
- package/dist/lang/ast/field-space/reference-field.js +5 -5
- package/dist/lang/ast/field-space/refined-space.d.ts +2 -2
- package/dist/lang/ast/field-space/refined-space.js +3 -3
- package/dist/lang/ast/field-space/rename-space-field.d.ts +2 -2
- package/dist/lang/ast/field-space/rename-space-field.js +4 -4
- package/dist/lang/ast/field-space/static-space.js +1 -1
- package/dist/lang/ast/query-elements/anonymous-query.d.ts +2 -2
- package/dist/lang/ast/query-elements/anonymous-query.js +3 -3
- package/dist/lang/ast/query-elements/query-arrow.js +2 -2
- package/dist/lang/ast/query-items/field-declaration.d.ts +2 -2
- package/dist/lang/ast/query-items/field-declaration.js +1 -1
- package/dist/lang/ast/query-items/field-references.d.ts +3 -3
- package/dist/lang/ast/query-properties/nest.js +2 -2
- package/dist/lang/ast/source-elements/composite-source.d.ts +2 -2
- package/dist/lang/ast/source-elements/refined-source.d.ts +2 -2
- package/dist/lang/ast/source-elements/sql-source.js +1 -1
- package/dist/lang/ast/source-elements/typed-source.js +7 -4
- package/dist/lang/ast/source-properties/join.d.ts +2 -2
- package/dist/lang/ast/source-properties/join.js +2 -2
- package/dist/lang/ast/source-properties/renames.d.ts +2 -2
- package/dist/lang/ast/source-properties/user-type-shape.d.ts +2 -2
- package/dist/lang/ast/source-properties/user-type-shape.js +7 -7
- package/dist/lang/ast/source-properties/view-field-declaration.d.ts +1 -1
- package/dist/lang/ast/source-properties/view-field-declaration.js +2 -2
- package/dist/lang/ast/source-query-elements/include-item.d.ts +3 -3
- package/dist/lang/ast/statements/define-given.d.ts +2 -2
- package/dist/lang/ast/statements/define-given.js +2 -2
- package/dist/lang/ast/statements/define-query.d.ts +2 -2
- package/dist/lang/ast/statements/define-query.js +2 -2
- package/dist/lang/ast/statements/define-source.d.ts +2 -2
- package/dist/lang/ast/statements/define-source.js +2 -2
- package/dist/lang/ast/statements/define-user-type.d.ts +2 -2
- package/dist/lang/ast/statements/define-user-type.js +1 -1
- package/dist/lang/ast/statements/import-statement.js +1 -1
- package/dist/lang/ast/types/annotation-elements.js +3 -3
- package/dist/lang/ast/types/definition-list.d.ts +3 -3
- package/dist/lang/ast/types/literal.d.ts +1 -1
- package/dist/lang/ast/types/malloy-element.d.ts +4 -4
- package/dist/lang/ast/types/malloy-element.js +15 -15
- package/dist/lang/ast/types/noteable.d.ts +5 -5
- package/dist/lang/ast/types/pipeline-comp.d.ts +2 -2
- package/dist/lang/ast/view-elements/reference-view.js +1 -1
- package/dist/lang/ast/view-elements/view-refine.js +1 -1
- package/dist/lang/composite-source-utils.d.ts +2 -2
- package/dist/lang/composite-source-utils.js +6 -6
- package/dist/lang/malloy-to-ast.d.ts +3 -3
- package/dist/lang/malloy-to-ast.js +5 -5
- package/dist/lang/malloy-to-stable-query.d.ts +2 -2
- package/dist/lang/parse-malloy.js +6 -6
- package/dist/lang/parse-tree-walkers/model-annotation-walker.d.ts +2 -2
- package/dist/lang/parse-tree-walkers/model-annotation-walker.js +2 -2
- package/dist/lang/prettify/index.js +1 -1
- package/dist/lang/prettify/leaf.js +2 -2
- package/dist/lang/translate-response.d.ts +2 -2
- package/dist/model/malloy_types.d.ts +28 -24
- package/dist/model/persist_utils.js +3 -3
- package/dist/model/query_model_impl.js +1 -1
- package/dist/model/query_node.js +8 -8
- package/dist/model/query_query.js +13 -13
- package/dist/model/source_def_utils.js +4 -4
- package/dist/run_sql_options.d.ts +6 -4
- package/dist/to_stable.d.ts +2 -2
- package/dist/to_stable.js +7 -7
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +4 -4
- package/dist/annotation.d.ts +0 -96
- /package/dist/{taggable.js → api/foundation/taggable.js} +0 -0
- /package/dist/{prefix.d.ts → lang/annotation-prefix.d.ts} +0 -0
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { AnnotationsDef, DocumentLocation, FieldDef } from '../../../model/malloy_types';
|
|
2
2
|
import { SpaceField } from '../types/space-field';
|
|
3
3
|
export declare class RenameSpaceField extends SpaceField {
|
|
4
4
|
private readonly otherField;
|
|
5
5
|
private readonly newName;
|
|
6
6
|
private readonly location;
|
|
7
7
|
private note;
|
|
8
|
-
constructor(otherField: SpaceField, newName: string, location: DocumentLocation, note:
|
|
8
|
+
constructor(otherField: SpaceField, newName: string, location: DocumentLocation, note: AnnotationsDef | undefined);
|
|
9
9
|
fieldDef(): FieldDef | undefined;
|
|
10
10
|
typeDesc(): import("../../..").TypeDesc;
|
|
11
11
|
}
|
|
@@ -39,14 +39,14 @@ class RenameSpaceField extends space_field_1.SpaceField {
|
|
|
39
39
|
return undefined;
|
|
40
40
|
}
|
|
41
41
|
if (this.note) {
|
|
42
|
-
if (returnFieldDef.
|
|
43
|
-
returnFieldDef.
|
|
42
|
+
if (returnFieldDef.annotations) {
|
|
43
|
+
returnFieldDef.annotations = {
|
|
44
44
|
...this.note,
|
|
45
|
-
inherits: returnFieldDef.
|
|
45
|
+
inherits: returnFieldDef.annotations,
|
|
46
46
|
};
|
|
47
47
|
}
|
|
48
48
|
else {
|
|
49
|
-
returnFieldDef.
|
|
49
|
+
returnFieldDef.annotations = this.note;
|
|
50
50
|
}
|
|
51
51
|
}
|
|
52
52
|
return {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { AnnotationsDef } from '../../../model';
|
|
2
2
|
import type { DocStatement, Document } from '../types/malloy-element';
|
|
3
3
|
import { MalloyElement } from '../types/malloy-element';
|
|
4
4
|
import type { Noteable } from '../types/noteable';
|
|
@@ -10,6 +10,6 @@ export declare class AnonymousQuery extends MalloyElement implements DocStatemen
|
|
|
10
10
|
constructor(queryExpr: SourceQueryElement);
|
|
11
11
|
readonly isNoteableObj = true;
|
|
12
12
|
extendNote: typeof extendNoteMethod;
|
|
13
|
-
note?:
|
|
13
|
+
note?: AnnotationsDef;
|
|
14
14
|
execute(doc: Document): void;
|
|
15
15
|
}
|
|
@@ -42,11 +42,11 @@ class AnonymousQuery extends malloy_element_1.MalloyElement {
|
|
|
42
42
|
}
|
|
43
43
|
const modelQuery = { ...queryObj.query() };
|
|
44
44
|
const annotation = this.note || {};
|
|
45
|
-
if (modelQuery.
|
|
46
|
-
annotation.inherits = modelQuery.
|
|
45
|
+
if (modelQuery.annotations) {
|
|
46
|
+
annotation.inherits = modelQuery.annotations;
|
|
47
47
|
}
|
|
48
48
|
if (annotation.notes || annotation.blockNotes || annotation.inherits) {
|
|
49
|
-
modelQuery.
|
|
49
|
+
modelQuery.annotations = annotation;
|
|
50
50
|
}
|
|
51
51
|
doc.queryList.push(modelQuery);
|
|
52
52
|
}
|
|
@@ -69,11 +69,11 @@ class QueryArrow extends query_base_1.QueryBase {
|
|
|
69
69
|
inputStruct = lhsQuery.outputStruct;
|
|
70
70
|
fieldSpace = new static_space_1.StaticSourceSpace(lhsQuery.outputStruct, 'public');
|
|
71
71
|
}
|
|
72
|
-
const { pipeline: rhsPipeline,
|
|
72
|
+
const { pipeline: rhsPipeline, annotations, outputStruct, name, } = this.view.pipelineComp(fieldSpace);
|
|
73
73
|
const query = {
|
|
74
74
|
...queryBase,
|
|
75
75
|
name,
|
|
76
|
-
|
|
76
|
+
annotations,
|
|
77
77
|
pipeline: [...queryBase.pipeline, ...rhsPipeline],
|
|
78
78
|
};
|
|
79
79
|
const compositeResolvedSourceDef = (_a = query.compositeResolvedSourceDef) !== null && _a !== void 0 ? _a : this.resolveCompositeSource(inputStruct, rhsPipeline);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { AnnotationsDef, TypeDesc, FieldDef, AtomicFieldDef } from '../../../model/malloy_types';
|
|
2
2
|
import type { ExprValue } from '../types/expr-value';
|
|
3
3
|
import type { ExpressionDef } from '../types/expression-def';
|
|
4
4
|
import type { FieldSpace } from '../types/field-space';
|
|
@@ -15,7 +15,7 @@ export declare abstract class AtomicFieldDeclaration extends MalloyElement imple
|
|
|
15
15
|
readonly exprSrc?: string | undefined;
|
|
16
16
|
readonly isNoteableObj = true;
|
|
17
17
|
extendNote: typeof extendNoteMethod;
|
|
18
|
-
note?:
|
|
18
|
+
note?: AnnotationsDef;
|
|
19
19
|
constructor(expr: ExpressionDef, defineName: string, exprSrc?: string | undefined);
|
|
20
20
|
getName(): string;
|
|
21
21
|
fieldDef(fs: FieldSpace, exprName: string): FieldDef;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { AnnotationsDef, FieldDef, RefToField, TypeDesc } from '../../../model/malloy_types';
|
|
2
2
|
import type { DynamicSpace } from '../field-space/dynamic-space';
|
|
3
3
|
import { DefinitionList } from '../types/definition-list';
|
|
4
4
|
import type { FieldName, FieldSpace } from '../types/field-space';
|
|
@@ -10,7 +10,7 @@ import type { MakeEntry } from '../types/space-entry';
|
|
|
10
10
|
export type FieldReferenceConstructor = new (names: FieldName[]) => FieldReference;
|
|
11
11
|
export declare abstract class FieldReference extends ListOf<FieldName> implements Noteable, MakeEntry {
|
|
12
12
|
readonly isNoteableObj = true;
|
|
13
|
-
note?:
|
|
13
|
+
note?: AnnotationsDef;
|
|
14
14
|
extendNote: typeof extendNoteMethod;
|
|
15
15
|
constructor(names: FieldName[]);
|
|
16
16
|
makeEntry(fs: DynamicSpace): void;
|
|
@@ -97,7 +97,7 @@ export declare class ViewOrScalarFieldReference extends FieldReference {
|
|
|
97
97
|
export declare class WildcardFieldReference extends MalloyElement implements Noteable {
|
|
98
98
|
readonly joinPath: FieldReference | undefined;
|
|
99
99
|
elementType: string;
|
|
100
|
-
note?:
|
|
100
|
+
note?: AnnotationsDef;
|
|
101
101
|
readonly isNoteableObj = true;
|
|
102
102
|
extendNote: typeof extendNoteMethod;
|
|
103
103
|
except: Set<string>;
|
|
@@ -76,7 +76,7 @@ class NestFieldDeclaration extends view_field_declaration_1.ViewFieldDeclaration
|
|
|
76
76
|
if (this.turtleDef)
|
|
77
77
|
return this.turtleDef;
|
|
78
78
|
if (fs.isQueryFieldSpace()) {
|
|
79
|
-
const { pipeline,
|
|
79
|
+
const { pipeline, annotations } = this.view.pipelineComp(fs, fs.outputSpace());
|
|
80
80
|
const refSummary = pipeline[0] && model.isQuerySegment(pipeline[0])
|
|
81
81
|
? pipeline[0].refSummary
|
|
82
82
|
: undefined;
|
|
@@ -86,7 +86,7 @@ class NestFieldDeclaration extends view_field_declaration_1.ViewFieldDeclaration
|
|
|
86
86
|
type: 'turtle',
|
|
87
87
|
name: this.name,
|
|
88
88
|
pipeline: pipelineWithDrillPaths,
|
|
89
|
-
|
|
89
|
+
annotations: { ...this.note, inherits: annotations },
|
|
90
90
|
location: this.location,
|
|
91
91
|
refSummary,
|
|
92
92
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { AnnotationsDef, SourceDef } from '../../../model/malloy_types';
|
|
2
2
|
import type { HasParameter } from '../parameters/has-parameter';
|
|
3
3
|
import { Source } from './source';
|
|
4
4
|
import type { ParameterSpace } from '../field-space/parameter-space';
|
|
@@ -9,7 +9,7 @@ import type { ParameterSpace } from '../field-space/parameter-space';
|
|
|
9
9
|
export declare class CompositeSource extends Source {
|
|
10
10
|
readonly sources: Source[];
|
|
11
11
|
elementType: string;
|
|
12
|
-
currentAnnotation?:
|
|
12
|
+
currentAnnotation?: AnnotationsDef;
|
|
13
13
|
constructor(sources: Source[]);
|
|
14
14
|
getSourceDef(parameterSpace: ParameterSpace | undefined): SourceDef;
|
|
15
15
|
withParameters(parameterSpace: ParameterSpace | undefined, pList: HasParameter[] | undefined): SourceDef;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { AnnotationsDef, SourceDef } from '../../../model/malloy_types';
|
|
2
2
|
import type { HasParameter } from '../parameters/has-parameter';
|
|
3
3
|
import type { SourceDesc } from '../types/source-desc';
|
|
4
4
|
import { Source } from './source';
|
|
@@ -12,7 +12,7 @@ export declare class RefinedSource extends Source {
|
|
|
12
12
|
readonly refinement: SourceDesc;
|
|
13
13
|
readonly includeList: IncludeItem[] | undefined;
|
|
14
14
|
elementType: string;
|
|
15
|
-
currentAnnotation?:
|
|
15
|
+
currentAnnotation?: AnnotationsDef;
|
|
16
16
|
constructor(source: Source, refinement: SourceDesc, includeList: IncludeItem[] | undefined);
|
|
17
17
|
getSourceDef(parameterSpace: ParameterSpace | undefined): SourceDef;
|
|
18
18
|
withParameters(parameterSpace: ParameterSpace | undefined, pList: HasParameter[] | undefined): SourceDef;
|
|
@@ -149,7 +149,7 @@ class SQLSource extends source_1.Source {
|
|
|
149
149
|
const fromDoc = this.document();
|
|
150
150
|
const modelAnnotation = fromDoc === null || fromDoc === void 0 ? void 0 : fromDoc.currentModelAnnotation();
|
|
151
151
|
if (modelAnnotation) {
|
|
152
|
-
locStruct.
|
|
152
|
+
locStruct.modelAnnotations = modelAnnotation;
|
|
153
153
|
}
|
|
154
154
|
return locStruct;
|
|
155
155
|
}
|
|
@@ -80,11 +80,14 @@ class TypedSource extends source_1.Source {
|
|
|
80
80
|
? { ...f, accessModifier: exports.USER_TYPE_HIDDEN_ACCESS }
|
|
81
81
|
: f;
|
|
82
82
|
}
|
|
83
|
-
const shapeAnnotation = shapeEntry.field.
|
|
83
|
+
const shapeAnnotation = shapeEntry.field.annotations;
|
|
84
84
|
if (!shapeAnnotation) {
|
|
85
85
|
return f;
|
|
86
86
|
}
|
|
87
|
-
return {
|
|
87
|
+
return {
|
|
88
|
+
...f,
|
|
89
|
+
annotations: mergeAnnotation(f.annotations, shapeAnnotation),
|
|
90
|
+
};
|
|
88
91
|
});
|
|
89
92
|
return {
|
|
90
93
|
...sourceDef,
|
|
@@ -105,8 +108,8 @@ class TypedSource extends source_1.Source {
|
|
|
105
108
|
}
|
|
106
109
|
for (const sf of entry.entry.fields) {
|
|
107
110
|
const field = (0, malloy_types_1.mkFieldDef)(sf.typeDef, sf.name);
|
|
108
|
-
if (sf.
|
|
109
|
-
field.
|
|
111
|
+
if (sf.annotations) {
|
|
112
|
+
field.annotations = sf.annotations;
|
|
110
113
|
}
|
|
111
114
|
next.set(sf.name, { field, fromShape: ref });
|
|
112
115
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { AnnotationsDef, JoinFieldDef, JoinType, MatrixOperation, SourceDef, AccessModifierLabel } from '../../../model/malloy_types';
|
|
2
2
|
import type { DynamicSpace } from '../field-space/dynamic-space';
|
|
3
3
|
import { DefinitionList } from '../types/definition-list';
|
|
4
4
|
import type { QueryBuilder } from '../types/query-builder';
|
|
@@ -20,7 +20,7 @@ export declare abstract class Join extends MalloyElement implements Noteable, Ma
|
|
|
20
20
|
readonly isNoteableObj = true;
|
|
21
21
|
extendNote: typeof extendNoteMethod;
|
|
22
22
|
abstract sourceExpr: SourceQueryElement;
|
|
23
|
-
note?:
|
|
23
|
+
note?: AnnotationsDef;
|
|
24
24
|
makeEntry(fs: DynamicSpace): void;
|
|
25
25
|
getName(): string;
|
|
26
26
|
protected getStructDefFromExpr(parameterSpace: ParameterSpace): SourceDef;
|
|
@@ -77,7 +77,7 @@ class KeyJoin extends Join {
|
|
|
77
77
|
};
|
|
78
78
|
delete joinStruct.as;
|
|
79
79
|
if (this.note) {
|
|
80
|
-
joinStruct.
|
|
80
|
+
joinStruct.annotations = this.note;
|
|
81
81
|
}
|
|
82
82
|
(_a = this.document()) === null || _a === void 0 ? void 0 : _a.rememberToAddModelAnnotations(joinStruct);
|
|
83
83
|
return joinStruct;
|
|
@@ -172,7 +172,7 @@ class ExpressionJoin extends Join {
|
|
|
172
172
|
};
|
|
173
173
|
delete joinStruct.as;
|
|
174
174
|
if (this.note) {
|
|
175
|
-
joinStruct.
|
|
175
|
+
joinStruct.annotations = this.note;
|
|
176
176
|
}
|
|
177
177
|
(_a = this.document()) === null || _a === void 0 ? void 0 : _a.rememberToAddModelAnnotations(joinStruct);
|
|
178
178
|
return joinStruct;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { AccessModifierLabel,
|
|
1
|
+
import type { AccessModifierLabel, AnnotationsDef } from '../../../model';
|
|
2
2
|
import type { DynamicSpace } from '../field-space/dynamic-space';
|
|
3
3
|
import { DefinitionList } from '../types/definition-list';
|
|
4
4
|
import type { FieldName } from '../types/field-space';
|
|
@@ -9,7 +9,7 @@ export declare class RenameField extends MalloyElement implements Noteable, Make
|
|
|
9
9
|
readonly newName: string;
|
|
10
10
|
readonly oldName: FieldName;
|
|
11
11
|
elementType: string;
|
|
12
|
-
note?:
|
|
12
|
+
note?: AnnotationsDef;
|
|
13
13
|
extendNote: typeof extendNoteMethod;
|
|
14
14
|
readonly isNoteableObj = true;
|
|
15
15
|
constructor(newName: string, oldName: FieldName);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { AnnotationsDef, AtomicTypeDef, UserTypeFieldDef } from '../../../model/malloy_types';
|
|
2
2
|
import { ListOf, MalloyElement } from '../types/malloy-element';
|
|
3
3
|
import type { Noteable } from '../types/noteable';
|
|
4
4
|
import { extendNoteMethod } from '../types/noteable';
|
|
@@ -6,7 +6,7 @@ export declare abstract class UserTypeMember extends MalloyElement implements No
|
|
|
6
6
|
readonly name: string;
|
|
7
7
|
readonly isNoteableObj = true;
|
|
8
8
|
extendNote: typeof extendNoteMethod;
|
|
9
|
-
note?:
|
|
9
|
+
note?: AnnotationsDef;
|
|
10
10
|
constructor(name: string);
|
|
11
11
|
abstract userTypeFieldDef(): UserTypeFieldDef;
|
|
12
12
|
}
|
|
@@ -29,7 +29,7 @@ class UserTypeMemberDef extends UserTypeMember {
|
|
|
29
29
|
typeDef: this.typeDef,
|
|
30
30
|
};
|
|
31
31
|
if (this.note) {
|
|
32
|
-
field.
|
|
32
|
+
field.annotations = this.note;
|
|
33
33
|
}
|
|
34
34
|
return field;
|
|
35
35
|
}
|
|
@@ -62,8 +62,8 @@ class UserTypeMemberIndirect extends UserTypeMember {
|
|
|
62
62
|
}
|
|
63
63
|
const fieldsFromReferencedType = modelEntry.entry.fields.map(f => {
|
|
64
64
|
const field = (0, malloy_types_1.mkFieldDef)(f.typeDef, f.name);
|
|
65
|
-
if (f.
|
|
66
|
-
field.
|
|
65
|
+
if (f.annotations) {
|
|
66
|
+
field.annotations = f.annotations;
|
|
67
67
|
}
|
|
68
68
|
return field;
|
|
69
69
|
});
|
|
@@ -76,12 +76,12 @@ class UserTypeMemberIndirect extends UserTypeMember {
|
|
|
76
76
|
}
|
|
77
77
|
const field = { name: this.name, typeDef };
|
|
78
78
|
if (this.note) {
|
|
79
|
-
field.
|
|
80
|
-
? { ...this.note, inherits: modelEntry.entry.
|
|
79
|
+
field.annotations = modelEntry.entry.annotations
|
|
80
|
+
? { ...this.note, inherits: modelEntry.entry.annotations }
|
|
81
81
|
: this.note;
|
|
82
82
|
}
|
|
83
|
-
else if (modelEntry.entry.
|
|
84
|
-
field.
|
|
83
|
+
else if (modelEntry.entry.annotations) {
|
|
84
|
+
field.annotations = { inherits: modelEntry.entry.annotations };
|
|
85
85
|
}
|
|
86
86
|
return field;
|
|
87
87
|
}
|
|
@@ -12,7 +12,7 @@ export declare class ViewFieldDeclaration extends MalloyElement implements Notea
|
|
|
12
12
|
elementType: string;
|
|
13
13
|
readonly isNoteableObj = true;
|
|
14
14
|
extendNote: typeof extendNoteMethod;
|
|
15
|
-
note?: model.
|
|
15
|
+
note?: model.AnnotationsDef;
|
|
16
16
|
constructor(name: string, view: View);
|
|
17
17
|
makeEntry(fs: DynamicSpace): void;
|
|
18
18
|
getName(): string;
|
|
@@ -44,13 +44,13 @@ class ViewFieldDeclaration extends malloy_element_1.MalloyElement {
|
|
|
44
44
|
return this.name;
|
|
45
45
|
}
|
|
46
46
|
getFieldDef(fs) {
|
|
47
|
-
const { pipeline,
|
|
47
|
+
const { pipeline, annotations } = this.view.pipelineComp(fs);
|
|
48
48
|
const checkedPipeline = (0, query_utils_1.detectAndRemovePartialStages)(pipeline, this);
|
|
49
49
|
const def = {
|
|
50
50
|
type: 'turtle',
|
|
51
51
|
name: this.name,
|
|
52
52
|
pipeline: checkedPipeline,
|
|
53
|
-
|
|
53
|
+
annotations: { ...this.note, inherits: annotations },
|
|
54
54
|
location: this.location,
|
|
55
55
|
};
|
|
56
56
|
return def;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { MalloyElement } from '../types/malloy-element';
|
|
2
2
|
import type { AccessModifierFieldReference, FieldReference, WildcardFieldReference } from '../query-items/field-references';
|
|
3
|
-
import type {
|
|
3
|
+
import type { AnnotationsDef } from '../../../model';
|
|
4
4
|
import type { Noteable } from '../types/noteable';
|
|
5
5
|
import { extendNoteMethod } from '../types/noteable';
|
|
6
6
|
export declare abstract class IncludeItem extends MalloyElement {
|
|
@@ -12,7 +12,7 @@ export declare class IncludeAccessItem extends IncludeItem implements Noteable {
|
|
|
12
12
|
elementType: string;
|
|
13
13
|
readonly isNoteableObj = true;
|
|
14
14
|
extendNote: typeof extendNoteMethod;
|
|
15
|
-
note?:
|
|
15
|
+
note?: AnnotationsDef;
|
|
16
16
|
constructor(kind: 'private' | 'public' | 'internal' | undefined, fields: IncludeListItem[]);
|
|
17
17
|
}
|
|
18
18
|
export declare class IncludeExceptItem extends IncludeItem {
|
|
@@ -27,6 +27,6 @@ export declare class IncludeListItem extends MalloyElement implements Noteable {
|
|
|
27
27
|
elementType: string;
|
|
28
28
|
readonly isNoteableObj = true;
|
|
29
29
|
extendNote: typeof extendNoteMethod;
|
|
30
|
-
note?:
|
|
30
|
+
note?: AnnotationsDef;
|
|
31
31
|
constructor(name: AccessModifierFieldReference | WildcardFieldReference, as: string | undefined);
|
|
32
32
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { AnnotationsDef, GivenTypeDef } from '../../../model/malloy_types';
|
|
2
2
|
import type { ConstantExpression } from '../expressions/constant-expression';
|
|
3
3
|
import type { DocStatement, Document } from '../types/malloy-element';
|
|
4
4
|
import { DocStatementList, MalloyElement } from '../types/malloy-element';
|
|
@@ -11,7 +11,7 @@ export declare class GivenDeclaration extends MalloyElement implements DocStatem
|
|
|
11
11
|
elementType: string;
|
|
12
12
|
readonly isNoteableObj = true;
|
|
13
13
|
extendNote: typeof extendNoteMethod;
|
|
14
|
-
note?:
|
|
14
|
+
note?: AnnotationsDef;
|
|
15
15
|
readonly default?: ConstantExpression;
|
|
16
16
|
constructor(name: string, typeDef: GivenTypeDef, defaultExpr?: ConstantExpression, inline?: boolean);
|
|
17
17
|
protected varInfo(): string;
|
|
@@ -173,7 +173,7 @@ class GivenDeclaration extends malloy_element_1.MalloyElement {
|
|
|
173
173
|
defaultText,
|
|
174
174
|
givenUsage,
|
|
175
175
|
location: this.location,
|
|
176
|
-
|
|
176
|
+
annotations: this.note,
|
|
177
177
|
...(this.inline ? { inline: true } : {}),
|
|
178
178
|
};
|
|
179
179
|
doc.documentGivens.set(id, givenIR);
|
|
@@ -195,7 +195,7 @@ class GivenDeclaration extends malloy_element_1.MalloyElement {
|
|
|
195
195
|
},
|
|
196
196
|
definition: {
|
|
197
197
|
type: (0, utils_1.typeDefToString)(this.typeDef),
|
|
198
|
-
|
|
198
|
+
annotations: this.note,
|
|
199
199
|
location: this.location,
|
|
200
200
|
defaultText,
|
|
201
201
|
},
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { AnnotationsDef } from '../../../model/malloy_types';
|
|
2
2
|
import type { DocStatement, Document } from '../types/malloy-element';
|
|
3
3
|
import { MalloyElement, DocStatementList } from '../types/malloy-element';
|
|
4
4
|
import type { Noteable } from '../types/noteable';
|
|
@@ -11,7 +11,7 @@ export declare class DefineQuery extends MalloyElement implements DocStatement,
|
|
|
11
11
|
constructor(name: string, queryExpr: SourceQueryElement);
|
|
12
12
|
readonly isNoteableObj = true;
|
|
13
13
|
extendNote: typeof extendNoteMethod;
|
|
14
|
-
note?:
|
|
14
|
+
note?: AnnotationsDef;
|
|
15
15
|
execute(doc: Document): void;
|
|
16
16
|
}
|
|
17
17
|
export declare class DefineQueryList extends DocStatementList {
|
|
@@ -52,8 +52,8 @@ class DefineQuery extends malloy_element_1.MalloyElement {
|
|
|
52
52
|
location: this.location,
|
|
53
53
|
};
|
|
54
54
|
if (this.note) {
|
|
55
|
-
entry.
|
|
56
|
-
? { ...this.note, inherits: entry.
|
|
55
|
+
entry.annotations = entry.annotations
|
|
56
|
+
? { ...this.note, inherits: entry.annotations }
|
|
57
57
|
: this.note;
|
|
58
58
|
}
|
|
59
59
|
doc.setEntry(this.name, { entry, exported: true });
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { AnnotationsDef } from '../../../model/malloy_types';
|
|
2
2
|
import type { HasParameter } from '../parameters/has-parameter';
|
|
3
3
|
import type { DocStatement, Document } from '../types/malloy-element';
|
|
4
4
|
import { MalloyElement, DocStatementList } from '../types/malloy-element';
|
|
@@ -14,7 +14,7 @@ export declare class DefineSource extends MalloyElement implements DocStatement,
|
|
|
14
14
|
constructor(name: string, sourceExpr: SourceQueryElement | undefined, exported: boolean, parameters?: HasParameter[] | undefined);
|
|
15
15
|
readonly isNoteableObj = true;
|
|
16
16
|
extendNote: typeof extendNoteMethod;
|
|
17
|
-
note?:
|
|
17
|
+
note?: AnnotationsDef;
|
|
18
18
|
execute(doc: Document): void;
|
|
19
19
|
private deduplicatedParameters;
|
|
20
20
|
private validateParameterShadowing;
|
|
@@ -69,8 +69,8 @@ class DefineSource extends malloy_element_1.MalloyElement {
|
|
|
69
69
|
location: this.location,
|
|
70
70
|
};
|
|
71
71
|
if (this.note) {
|
|
72
|
-
entry.
|
|
73
|
-
? { ...this.note, inherits: structDef.
|
|
72
|
+
entry.annotations = structDef.annotations
|
|
73
|
+
? { ...this.note, inherits: structDef.annotations }
|
|
74
74
|
: this.note;
|
|
75
75
|
}
|
|
76
76
|
if ((0, malloy_types_1.isPersistableSourceDef)(entry)) {
|
|
@@ -2,7 +2,7 @@ import type { DocStatement, Document } from '../types/malloy-element';
|
|
|
2
2
|
import { MalloyElement, DocStatementList } from '../types/malloy-element';
|
|
3
3
|
import type { Noteable } from '../types/noteable';
|
|
4
4
|
import { extendNoteMethod } from '../types/noteable';
|
|
5
|
-
import type {
|
|
5
|
+
import type { AnnotationsDef, UserTypeFieldDef } from '../../../model/malloy_types';
|
|
6
6
|
import type { UserTypeMember } from '../source-properties/user-type-shape';
|
|
7
7
|
import { UserTypeShape } from '../source-properties/user-type-shape';
|
|
8
8
|
export declare class ExtendedUserTypeShape extends UserTypeShape {
|
|
@@ -19,7 +19,7 @@ export declare class DefineUserType extends MalloyElement implements DocStatemen
|
|
|
19
19
|
constructor(name: string, shapeDef: UserTypeShape, exported: boolean);
|
|
20
20
|
readonly isNoteableObj = true;
|
|
21
21
|
extendNote: typeof extendNoteMethod;
|
|
22
|
-
note?:
|
|
22
|
+
note?: AnnotationsDef;
|
|
23
23
|
execute(doc: Document): void;
|
|
24
24
|
}
|
|
25
25
|
export declare class DefineUserTypeList extends DocStatementList {
|
|
@@ -166,7 +166,7 @@ class ImportStatement extends malloy_element_1.ListOf {
|
|
|
166
166
|
location: importOne.location,
|
|
167
167
|
definition: {
|
|
168
168
|
type: (0, utils_1.typeDefToString)(givenIR.type),
|
|
169
|
-
|
|
169
|
+
annotations: givenIR.annotations,
|
|
170
170
|
location: givenIR.location,
|
|
171
171
|
defaultText: givenIR.defaultText,
|
|
172
172
|
},
|
|
@@ -54,10 +54,10 @@ class ModelAnnotation extends ObjectAnnotation {
|
|
|
54
54
|
this.logError('restricted-construct-forbidden', `\`${line}\` cannot be used in a restricted query — compiler-flag annotations are not permitted.`, { at: note.at });
|
|
55
55
|
}
|
|
56
56
|
}
|
|
57
|
-
if (doc.
|
|
58
|
-
doc.
|
|
57
|
+
if (doc.annotations.notes === undefined) {
|
|
58
|
+
doc.annotations.notes = [];
|
|
59
59
|
}
|
|
60
|
-
doc.
|
|
60
|
+
doc.annotations.notes.push(...this.notes);
|
|
61
61
|
}
|
|
62
62
|
}
|
|
63
63
|
exports.ModelAnnotation = ModelAnnotation;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { AnnotationsDef } from '../../../model';
|
|
2
2
|
import type { MalloyElement } from './malloy-element';
|
|
3
3
|
import { ListOf } from './malloy-element';
|
|
4
4
|
import type { Noteable } from '../types/noteable';
|
|
5
5
|
export declare abstract class DefinitionList<DT extends MalloyElement> extends ListOf<DT> implements Noteable {
|
|
6
6
|
readonly isNoteableObj = true;
|
|
7
|
-
note?:
|
|
8
|
-
extendNote(ext: Partial<
|
|
7
|
+
note?: AnnotationsDef;
|
|
8
|
+
extendNote(ext: Partial<AnnotationsDef>): void;
|
|
9
9
|
distributeAnnotation(): void;
|
|
10
10
|
protected newContents(): void;
|
|
11
11
|
}
|
|
@@ -4,4 +4,4 @@ import { LiteralDay, LiteralHour, LiteralMonth, LiteralTimestamp, LiteralYear }
|
|
|
4
4
|
import { ExprNumber } from '../expressions/expr-number';
|
|
5
5
|
import type { ExpressionDef } from './expression-def';
|
|
6
6
|
export type Literal = LiteralTimestamp | LiteralHour | LiteralMonth | LiteralDay | LiteralYear | ExprNumber | ExprString | Boolean;
|
|
7
|
-
export declare function isLiteral(value: ExpressionDef): value is ExprString |
|
|
7
|
+
export declare function isLiteral(value: ExpressionDef): value is ExprString | Boolean | LiteralTimestamp | LiteralHour | LiteralDay | LiteralMonth | LiteralYear | ExprNumber;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { AnnotationsDef, DocumentLocation, DocumentReference, Given, ModelDef, ModelAnnotationsDef, NamedModelObject, Query, SourceID, SourceRegistryValue, StructDef } from '../../../model/malloy_types';
|
|
2
2
|
import { Tag } from '@malloydata/malloy-tag';
|
|
3
3
|
import type { LogMessageOptions, MessageLogger, MessageParameterType, MessageCode } from '../../parse-log';
|
|
4
4
|
import type { MalloyTranslation } from '../../parse-malloy';
|
|
@@ -101,7 +101,7 @@ export declare class DocStatementList extends ListOf<DocStatement | DocStatement
|
|
|
101
101
|
execCursor: number;
|
|
102
102
|
readonly isNoteableObj = true;
|
|
103
103
|
extendNote: typeof extendNoteMethod;
|
|
104
|
-
note?:
|
|
104
|
+
note?: AnnotationsDef;
|
|
105
105
|
noteCursor: number;
|
|
106
106
|
executeList(doc: Document): ModelDataRequest;
|
|
107
107
|
}
|
|
@@ -116,7 +116,7 @@ export declare class Document extends MalloyElement implements NameSpace {
|
|
|
116
116
|
statements: DocStatementList;
|
|
117
117
|
didInitModel: boolean;
|
|
118
118
|
modelWasModified: boolean;
|
|
119
|
-
|
|
119
|
+
annotations: AnnotationsDef;
|
|
120
120
|
experiments: Tag;
|
|
121
121
|
constructor(statements: (DocStatement | DocStatementList)[]);
|
|
122
122
|
initModelDef(extendingModelDef: ModelDef | undefined): void;
|
|
@@ -126,7 +126,7 @@ export declare class Document extends MalloyElement implements NameSpace {
|
|
|
126
126
|
private checkGivenAliasCollisions;
|
|
127
127
|
private checkQueryGivenSatisfiability;
|
|
128
128
|
hasAnnotation(): boolean;
|
|
129
|
-
currentModelAnnotation():
|
|
129
|
+
currentModelAnnotation(): ModelAnnotationsDef | undefined;
|
|
130
130
|
modelDef(): ModelDef;
|
|
131
131
|
getEntry(str: string): ModelEntry | undefined;
|
|
132
132
|
setEntry(str: string, ent: ModelEntry): void;
|