@zenstackhq/language
Advanced tools
Comparing version 1.0.0-alpha.102 to 1.0.0-alpha.110
@@ -24,2 +24,11 @@ import { AbstractDeclaration, ExpressionType, BinaryExpr } from './generated/ast'; | ||
} | ||
interface DataModel { | ||
/** | ||
* Resolved fields, include inherited fields | ||
*/ | ||
$resolvedFields: Array<DataModelField>; | ||
} | ||
interface DataModelField { | ||
$isInherited?: boolean; | ||
} | ||
} | ||
@@ -26,0 +35,0 @@ declare module 'langium' { |
@@ -17,3 +17,3 @@ /****************************************************************************** | ||
export declare function isExpression(item: unknown): item is Expression; | ||
export type ExpressionType = 'Any' | 'Boolean' | 'DateTime' | 'Float' | 'Int' | 'Null' | 'Object' | 'String'; | ||
export type ExpressionType = 'Any' | 'Boolean' | 'DateTime' | 'Float' | 'Int' | 'Null' | 'Object' | 'String' | 'Unsupported'; | ||
export type QualifiedName = string; | ||
@@ -36,3 +36,3 @@ export type ReferenceTarget = DataModelField | EnumField | FunctionParam; | ||
export interface ArrayExpr extends AstNode { | ||
readonly $container: Argument | ArrayExpr | AttributeArg | BinaryExpr | DataSourceField | FieldInitializer | FunctionDecl | GeneratorField | MemberAccessExpr | PluginField | UnaryExpr; | ||
readonly $container: Argument | ArrayExpr | AttributeArg | BinaryExpr | DataSourceField | FieldInitializer | FunctionDecl | GeneratorField | MemberAccessExpr | PluginField | UnaryExpr | UnsupportedFieldType; | ||
readonly $type: 'ArrayExpr'; | ||
@@ -88,3 +88,3 @@ items: Array<Expression>; | ||
export interface BinaryExpr extends AstNode { | ||
readonly $container: Argument | ArrayExpr | AttributeArg | BinaryExpr | DataSourceField | FieldInitializer | FunctionDecl | GeneratorField | MemberAccessExpr | PluginField | UnaryExpr; | ||
readonly $container: Argument | ArrayExpr | AttributeArg | BinaryExpr | DataSourceField | FieldInitializer | FunctionDecl | GeneratorField | MemberAccessExpr | PluginField | UnaryExpr | UnsupportedFieldType; | ||
readonly $type: 'BinaryExpr'; | ||
@@ -103,3 +103,5 @@ left: Expression; | ||
fields: Array<DataModelField>; | ||
isAbstract: boolean; | ||
name: RegularID; | ||
superTypes: Array<Reference<DataModel>>; | ||
} | ||
@@ -141,2 +143,3 @@ export declare const DataModel = "DataModel"; | ||
type?: BuiltinType; | ||
unsupported?: UnsupportedFieldType; | ||
} | ||
@@ -233,3 +236,3 @@ export declare const DataModelFieldType = "DataModelFieldType"; | ||
export interface InvocationExpr extends AstNode { | ||
readonly $container: Argument | ArrayExpr | AttributeArg | BinaryExpr | DataSourceField | FieldInitializer | FunctionDecl | GeneratorField | MemberAccessExpr | PluginField | UnaryExpr; | ||
readonly $container: Argument | ArrayExpr | AttributeArg | BinaryExpr | DataSourceField | FieldInitializer | FunctionDecl | GeneratorField | MemberAccessExpr | PluginField | UnaryExpr | UnsupportedFieldType; | ||
readonly $type: 'InvocationExpr'; | ||
@@ -242,3 +245,3 @@ args: Array<Argument>; | ||
export interface LiteralExpr extends AstNode { | ||
readonly $container: Argument | ArrayExpr | AttributeArg | BinaryExpr | DataSourceField | FieldInitializer | FunctionDecl | GeneratorField | MemberAccessExpr | PluginField | UnaryExpr; | ||
readonly $container: Argument | ArrayExpr | AttributeArg | BinaryExpr | DataSourceField | FieldInitializer | FunctionDecl | GeneratorField | MemberAccessExpr | PluginField | UnaryExpr | UnsupportedFieldType; | ||
readonly $type: 'LiteralExpr'; | ||
@@ -250,3 +253,3 @@ value: boolean | number | string; | ||
export interface MemberAccessExpr extends AstNode { | ||
readonly $container: Argument | ArrayExpr | AttributeArg | BinaryExpr | DataSourceField | FieldInitializer | FunctionDecl | GeneratorField | MemberAccessExpr | PluginField | UnaryExpr; | ||
readonly $container: Argument | ArrayExpr | AttributeArg | BinaryExpr | DataSourceField | FieldInitializer | FunctionDecl | GeneratorField | MemberAccessExpr | PluginField | UnaryExpr | UnsupportedFieldType; | ||
readonly $type: 'MemberAccessExpr'; | ||
@@ -261,7 +264,15 @@ member: Reference<DataModelField>; | ||
declarations: Array<AbstractDeclaration>; | ||
imports: Array<ModelImport>; | ||
} | ||
export declare const Model = "Model"; | ||
export declare function isModel(item: unknown): item is Model; | ||
export interface ModelImport extends AstNode { | ||
readonly $container: Model; | ||
readonly $type: 'ModelImport'; | ||
path: string; | ||
} | ||
export declare const ModelImport = "ModelImport"; | ||
export declare function isModelImport(item: unknown): item is ModelImport; | ||
export interface NullExpr extends AstNode { | ||
readonly $container: Argument | ArrayExpr | AttributeArg | BinaryExpr | DataSourceField | FieldInitializer | FunctionDecl | GeneratorField | MemberAccessExpr | PluginField | UnaryExpr; | ||
readonly $container: Argument | ArrayExpr | AttributeArg | BinaryExpr | DataSourceField | FieldInitializer | FunctionDecl | GeneratorField | MemberAccessExpr | PluginField | UnaryExpr | UnsupportedFieldType; | ||
readonly $type: 'NullExpr'; | ||
@@ -273,3 +284,3 @@ value: string; | ||
export interface ObjectExpr extends AstNode { | ||
readonly $container: Argument | ArrayExpr | AttributeArg | BinaryExpr | DataSourceField | FieldInitializer | FunctionDecl | GeneratorField | MemberAccessExpr | PluginField | UnaryExpr; | ||
readonly $container: Argument | ArrayExpr | AttributeArg | BinaryExpr | DataSourceField | FieldInitializer | FunctionDecl | GeneratorField | MemberAccessExpr | PluginField | UnaryExpr | UnsupportedFieldType; | ||
readonly $type: 'ObjectExpr'; | ||
@@ -305,3 +316,3 @@ fields: Array<FieldInitializer>; | ||
export interface ReferenceExpr extends AstNode { | ||
readonly $container: Argument | ArrayExpr | AttributeArg | BinaryExpr | DataSourceField | FieldInitializer | FunctionDecl | GeneratorField | MemberAccessExpr | PluginField | UnaryExpr; | ||
readonly $container: Argument | ArrayExpr | AttributeArg | BinaryExpr | DataSourceField | FieldInitializer | FunctionDecl | GeneratorField | MemberAccessExpr | PluginField | UnaryExpr | UnsupportedFieldType; | ||
readonly $type: 'ReferenceExpr'; | ||
@@ -314,3 +325,3 @@ args: Array<ReferenceArg>; | ||
export interface ThisExpr extends AstNode { | ||
readonly $container: Argument | ArrayExpr | AttributeArg | BinaryExpr | DataSourceField | FieldInitializer | FunctionDecl | GeneratorField | MemberAccessExpr | PluginField | UnaryExpr; | ||
readonly $container: Argument | ArrayExpr | AttributeArg | BinaryExpr | DataSourceField | FieldInitializer | FunctionDecl | GeneratorField | MemberAccessExpr | PluginField | UnaryExpr | UnsupportedFieldType; | ||
readonly $type: 'ThisExpr'; | ||
@@ -322,3 +333,3 @@ value: string; | ||
export interface UnaryExpr extends AstNode { | ||
readonly $container: Argument | ArrayExpr | AttributeArg | BinaryExpr | DataSourceField | FieldInitializer | FunctionDecl | GeneratorField | MemberAccessExpr | PluginField | UnaryExpr; | ||
readonly $container: Argument | ArrayExpr | AttributeArg | BinaryExpr | DataSourceField | FieldInitializer | FunctionDecl | GeneratorField | MemberAccessExpr | PluginField | UnaryExpr | UnsupportedFieldType; | ||
readonly $type: 'UnaryExpr'; | ||
@@ -330,2 +341,9 @@ operand: Expression; | ||
export declare function isUnaryExpr(item: unknown): item is UnaryExpr; | ||
export interface UnsupportedFieldType extends AstNode { | ||
readonly $container: DataModelFieldType; | ||
readonly $type: 'UnsupportedFieldType'; | ||
value: LiteralExpr; | ||
} | ||
export declare const UnsupportedFieldType = "UnsupportedFieldType"; | ||
export declare function isUnsupportedFieldType(item: unknown): item is UnsupportedFieldType; | ||
export interface ZModelAstType { | ||
@@ -361,2 +379,3 @@ AbstractDeclaration: AbstractDeclaration; | ||
Model: Model; | ||
ModelImport: ModelImport; | ||
NullExpr: NullExpr; | ||
@@ -372,2 +391,3 @@ ObjectExpr: ObjectExpr; | ||
UnaryExpr: UnaryExpr; | ||
UnsupportedFieldType: UnsupportedFieldType; | ||
} | ||
@@ -374,0 +394,0 @@ export declare class ZModelAstReflection extends AbstractAstReflection { |
@@ -8,3 +8,3 @@ "use strict"; | ||
exports.isFunctionParamType = exports.FunctionParamType = exports.isFunctionParam = exports.FunctionParam = exports.isFunctionDecl = exports.FunctionDecl = exports.isFieldInitializer = exports.FieldInitializer = exports.isEnumField = exports.EnumField = exports.isEnum = exports.Enum = exports.isDataSourceField = exports.DataSourceField = exports.isDataSource = exports.DataSource = exports.isDataModelFieldType = exports.DataModelFieldType = exports.isDataModelFieldAttribute = exports.DataModelFieldAttribute = exports.isDataModelField = exports.DataModelField = exports.isDataModelAttribute = exports.DataModelAttribute = exports.isDataModel = exports.DataModel = exports.isBinaryExpr = exports.BinaryExpr = exports.isAttributeParamType = exports.AttributeParamType = exports.isAttributeParam = exports.AttributeParam = exports.isAttributeAttribute = exports.AttributeAttribute = exports.isAttributeArg = exports.AttributeArg = exports.isAttribute = exports.Attribute = exports.isArrayExpr = exports.ArrayExpr = exports.isArgument = exports.Argument = exports.isTypeDeclaration = exports.TypeDeclaration = exports.isReferenceTarget = exports.ReferenceTarget = exports.isExpression = exports.Expression = exports.isAbstractDeclaration = exports.AbstractDeclaration = void 0; | ||
exports.reflection = exports.ZModelAstReflection = exports.isUnaryExpr = exports.UnaryExpr = exports.isThisExpr = exports.ThisExpr = exports.isReferenceExpr = exports.ReferenceExpr = exports.isReferenceArg = exports.ReferenceArg = exports.isPluginField = exports.PluginField = exports.isPlugin = exports.Plugin = exports.isObjectExpr = exports.ObjectExpr = exports.isNullExpr = exports.NullExpr = exports.isModel = exports.Model = exports.isMemberAccessExpr = exports.MemberAccessExpr = exports.isLiteralExpr = exports.LiteralExpr = exports.isInvocationExpr = exports.InvocationExpr = exports.isGeneratorField = exports.GeneratorField = exports.isGeneratorDecl = exports.GeneratorDecl = void 0; | ||
exports.reflection = exports.ZModelAstReflection = exports.isUnsupportedFieldType = exports.UnsupportedFieldType = exports.isUnaryExpr = exports.UnaryExpr = exports.isThisExpr = exports.ThisExpr = exports.isReferenceExpr = exports.ReferenceExpr = exports.isReferenceArg = exports.ReferenceArg = exports.isPluginField = exports.PluginField = exports.isPlugin = exports.Plugin = exports.isObjectExpr = exports.ObjectExpr = exports.isNullExpr = exports.NullExpr = exports.isModelImport = exports.ModelImport = exports.isModel = exports.Model = exports.isMemberAccessExpr = exports.MemberAccessExpr = exports.isLiteralExpr = exports.LiteralExpr = exports.isInvocationExpr = exports.InvocationExpr = exports.isGeneratorField = exports.GeneratorField = exports.isGeneratorDecl = exports.GeneratorDecl = void 0; | ||
/* eslint-disable */ | ||
@@ -167,2 +167,7 @@ const langium_1 = require("langium"); | ||
exports.isModel = isModel; | ||
exports.ModelImport = 'ModelImport'; | ||
function isModelImport(item) { | ||
return exports.reflection.isInstance(item, exports.ModelImport); | ||
} | ||
exports.isModelImport = isModelImport; | ||
exports.NullExpr = 'NullExpr'; | ||
@@ -208,5 +213,10 @@ function isNullExpr(item) { | ||
exports.isUnaryExpr = isUnaryExpr; | ||
exports.UnsupportedFieldType = 'UnsupportedFieldType'; | ||
function isUnsupportedFieldType(item) { | ||
return exports.reflection.isInstance(item, exports.UnsupportedFieldType); | ||
} | ||
exports.isUnsupportedFieldType = isUnsupportedFieldType; | ||
class ZModelAstReflection extends langium_1.AbstractAstReflection { | ||
getAllTypes() { | ||
return ['AbstractDeclaration', 'Argument', 'ArrayExpr', 'Attribute', 'AttributeArg', 'AttributeAttribute', 'AttributeParam', 'AttributeParamType', 'BinaryExpr', 'DataModel', 'DataModelAttribute', 'DataModelField', 'DataModelFieldAttribute', 'DataModelFieldType', 'DataSource', 'DataSourceField', 'Enum', 'EnumField', 'Expression', 'FieldInitializer', 'FunctionDecl', 'FunctionParam', 'FunctionParamType', 'GeneratorDecl', 'GeneratorField', 'InvocationExpr', 'LiteralExpr', 'MemberAccessExpr', 'Model', 'NullExpr', 'ObjectExpr', 'Plugin', 'PluginField', 'ReferenceArg', 'ReferenceExpr', 'ReferenceTarget', 'ThisExpr', 'TypeDeclaration', 'UnaryExpr']; | ||
return ['AbstractDeclaration', 'Argument', 'ArrayExpr', 'Attribute', 'AttributeArg', 'AttributeAttribute', 'AttributeParam', 'AttributeParamType', 'BinaryExpr', 'DataModel', 'DataModelAttribute', 'DataModelField', 'DataModelFieldAttribute', 'DataModelFieldType', 'DataSource', 'DataSourceField', 'Enum', 'EnumField', 'Expression', 'FieldInitializer', 'FunctionDecl', 'FunctionParam', 'FunctionParamType', 'GeneratorDecl', 'GeneratorField', 'InvocationExpr', 'LiteralExpr', 'MemberAccessExpr', 'Model', 'ModelImport', 'NullExpr', 'ObjectExpr', 'Plugin', 'PluginField', 'ReferenceArg', 'ReferenceExpr', 'ReferenceTarget', 'ThisExpr', 'TypeDeclaration', 'UnaryExpr', 'UnsupportedFieldType']; | ||
} | ||
@@ -261,2 +271,5 @@ computeIsSubtype(subtype, supertype) { | ||
} | ||
case 'DataModel:superTypes': { | ||
return exports.DataModel; | ||
} | ||
case 'InvocationExpr:function': { | ||
@@ -326,3 +339,5 @@ return exports.FunctionDecl; | ||
{ name: 'comments', type: 'array' }, | ||
{ name: 'fields', type: 'array' } | ||
{ name: 'fields', type: 'array' }, | ||
{ name: 'isAbstract', type: 'boolean' }, | ||
{ name: 'superTypes', type: 'array' } | ||
] | ||
@@ -444,3 +459,4 @@ }; | ||
mandatory: [ | ||
{ name: 'declarations', type: 'array' } | ||
{ name: 'declarations', type: 'array' }, | ||
{ name: 'imports', type: 'array' } | ||
] | ||
@@ -447,0 +463,0 @@ }; |
{ | ||
"name": "@zenstackhq/language", | ||
"version": "1.0.0-alpha.102", | ||
"version": "1.0.0-alpha.110", | ||
"displayName": "ZenStack modeling language compiler", | ||
@@ -5,0 +5,0 @@ "description": "ZenStack modeling language compiler", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
145119
4407
1