Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@zenstackhq/language

Package Overview
Dependencies
Maintainers
2
Versions
209
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@zenstackhq/language - npm Package Compare versions

Comparing version 1.8.2 to 2.0.0-alpha.1

24

ast.d.ts

@@ -1,4 +0,5 @@

import { AbstractDeclaration, ExpressionType, BinaryExpr } from './generated/ast';
import { AstNode } from 'langium';
import { AbstractDeclaration, BinaryExpr, DataModel, ExpressionType } from './generated/ast';
export { AstNode, Reference } from 'langium';
export * from './generated/ast';
export { AstNode, Reference } from 'langium';
/**

@@ -24,12 +25,21 @@ * Shape of type resolution result: an expression type or reference to a declaration

}
interface DataModelField {
$inheritedFrom?: DataModel;
}
interface DataModelAttribute {
$inheritedFrom?: DataModel;
}
interface DataModel {
/**
* Resolved fields, include inherited fields
* Indicates whether the model is already merged with the base types
*/
$resolvedFields: Array<DataModelField>;
$baseMerged?: boolean;
}
interface DataModelField {
$isInherited?: boolean;
}
}
export interface InheritableNode extends AstNode {
$inheritedFrom?: DataModel;
}
export interface InheritableNode extends AstNode {
$inheritedFrom?: DataModel;
}
declare module 'langium' {

@@ -36,0 +46,0 @@ interface AstNode {

/******************************************************************************
* This file was generated by langium-cli 1.2.0.
* This file was generated by langium-cli 1.3.1.
* DO NOT EDIT MANUALLY!
******************************************************************************/
import { AstNode, AbstractAstReflection, Reference, ReferenceInfo, TypeMetaData } from 'langium';
import type { AstNode, Reference, ReferenceInfo, TypeMetaData } from 'langium';
import { AbstractAstReflection } from 'langium';
export declare const ZModelTerminals: {
WS: RegExp;
INTERNAL_ATTRIBUTE_NAME: RegExp;
MODEL_ATTRIBUTE_NAME: RegExp;
FIELD_ATTRIBUTE_NAME: RegExp;
ID: RegExp;
STRING: RegExp;
NUMBER: RegExp;
TRIPLE_SLASH_COMMENT: RegExp;
ML_COMMENT: RegExp;
SL_COMMENT: RegExp;
};
export type AbstractDeclaration = Attribute | DataModel | DataSource | Enum | FunctionDecl | GeneratorDecl | Plugin;

@@ -27,3 +40,3 @@ export declare const AbstractDeclaration = "AbstractDeclaration";

export declare function isReferenceTarget(item: unknown): item is ReferenceTarget;
export type RegularID = 'abstract' | 'attribute' | 'datasource' | 'enum' | 'import' | 'in' | 'model' | 'plugin' | 'sort' | 'view' | string;
export type RegularID = 'abstract' | 'attribute' | 'datasource' | 'enum' | 'import' | 'in' | 'model' | 'plugin' | 'view' | string;
export declare function isRegularID(item: unknown): item is RegularID;

@@ -36,3 +49,2 @@ export type TypeDeclaration = DataModel | Enum;

readonly $type: 'Argument';
name?: RegularID;
value: Expression;

@@ -43,3 +55,3 @@ }

export interface ArrayExpr extends AstNode {
readonly $container: Argument | ArrayExpr | AttributeArg | BinaryExpr | ConfigArrayExpr | ConfigField | ConfigInvocationArg | FieldInitializer | FunctionDecl | MemberAccessExpr | PluginField | UnaryExpr | UnsupportedFieldType;
readonly $container: Argument | ArrayExpr | AttributeArg | BinaryExpr | ConfigArrayExpr | ConfigField | ConfigInvocationArg | FieldInitializer | FunctionDecl | MemberAccessExpr | PluginField | ReferenceArg | UnaryExpr | UnsupportedFieldType;
readonly $type: 'ArrayExpr';

@@ -90,3 +102,3 @@ items: Array<Expression>;

export interface BinaryExpr extends AstNode {
readonly $container: Argument | ArrayExpr | AttributeArg | BinaryExpr | ConfigArrayExpr | ConfigField | ConfigInvocationArg | FieldInitializer | FunctionDecl | MemberAccessExpr | PluginField | UnaryExpr | UnsupportedFieldType;
readonly $container: Argument | ArrayExpr | AttributeArg | BinaryExpr | ConfigArrayExpr | ConfigField | ConfigInvocationArg | FieldInitializer | FunctionDecl | MemberAccessExpr | PluginField | ReferenceArg | UnaryExpr | UnsupportedFieldType;
readonly $type: 'BinaryExpr';

@@ -100,3 +112,3 @@ left: Expression;

export interface BooleanLiteral extends AstNode {
readonly $container: Argument | ArrayExpr | AttributeArg | BinaryExpr | ConfigArrayExpr | ConfigField | ConfigInvocationArg | FieldInitializer | FunctionDecl | MemberAccessExpr | PluginField | UnaryExpr | UnsupportedFieldType;
readonly $container: Argument | ArrayExpr | AttributeArg | BinaryExpr | ConfigArrayExpr | ConfigField | ConfigInvocationArg | FieldInitializer | FunctionDecl | MemberAccessExpr | PluginField | ReferenceArg | UnaryExpr | UnsupportedFieldType;
readonly $type: 'BooleanLiteral';

@@ -108,3 +120,3 @@ value: Boolean;

export interface ConfigArrayExpr extends AstNode {
readonly $container: Argument | ArrayExpr | AttributeArg | BinaryExpr | ConfigArrayExpr | ConfigField | ConfigInvocationArg | FieldInitializer | FunctionDecl | MemberAccessExpr | PluginField | UnaryExpr | UnsupportedFieldType;
readonly $container: Argument | ArrayExpr | AttributeArg | BinaryExpr | ConfigArrayExpr | ConfigField | ConfigInvocationArg | FieldInitializer | FunctionDecl | MemberAccessExpr | PluginField | ReferenceArg | UnaryExpr | UnsupportedFieldType;
readonly $type: 'ConfigArrayExpr';

@@ -270,3 +282,3 @@ items: Array<ConfigInvocationExpr | LiteralExpr>;

export interface InvocationExpr extends AstNode {
readonly $container: Argument | ArrayExpr | AttributeArg | BinaryExpr | ConfigArrayExpr | ConfigField | ConfigInvocationArg | FieldInitializer | FunctionDecl | MemberAccessExpr | PluginField | UnaryExpr | UnsupportedFieldType;
readonly $container: Argument | ArrayExpr | AttributeArg | BinaryExpr | ConfigArrayExpr | ConfigField | ConfigInvocationArg | FieldInitializer | FunctionDecl | MemberAccessExpr | PluginField | ReferenceArg | UnaryExpr | UnsupportedFieldType;
readonly $type: 'InvocationExpr';

@@ -279,3 +291,3 @@ args: Array<Argument>;

export interface MemberAccessExpr extends AstNode {
readonly $container: Argument | ArrayExpr | AttributeArg | BinaryExpr | ConfigArrayExpr | ConfigField | ConfigInvocationArg | FieldInitializer | FunctionDecl | MemberAccessExpr | PluginField | UnaryExpr | UnsupportedFieldType;
readonly $container: Argument | ArrayExpr | AttributeArg | BinaryExpr | ConfigArrayExpr | ConfigField | ConfigInvocationArg | FieldInitializer | FunctionDecl | MemberAccessExpr | PluginField | ReferenceArg | UnaryExpr | UnsupportedFieldType;
readonly $type: 'MemberAccessExpr';

@@ -302,3 +314,3 @@ member: Reference<DataModelField>;

export interface NullExpr extends AstNode {
readonly $container: Argument | ArrayExpr | AttributeArg | BinaryExpr | ConfigArrayExpr | ConfigField | ConfigInvocationArg | FieldInitializer | FunctionDecl | MemberAccessExpr | PluginField | UnaryExpr | UnsupportedFieldType;
readonly $container: Argument | ArrayExpr | AttributeArg | BinaryExpr | ConfigArrayExpr | ConfigField | ConfigInvocationArg | FieldInitializer | FunctionDecl | MemberAccessExpr | PluginField | ReferenceArg | UnaryExpr | UnsupportedFieldType;
readonly $type: 'NullExpr';

@@ -310,3 +322,3 @@ value: 'null';

export interface NumberLiteral extends AstNode {
readonly $container: Argument | ArrayExpr | AttributeArg | BinaryExpr | ConfigArrayExpr | ConfigField | ConfigInvocationArg | FieldInitializer | FunctionDecl | MemberAccessExpr | PluginField | UnaryExpr | UnsupportedFieldType;
readonly $container: Argument | ArrayExpr | AttributeArg | BinaryExpr | ConfigArrayExpr | ConfigField | ConfigInvocationArg | FieldInitializer | FunctionDecl | MemberAccessExpr | PluginField | ReferenceArg | UnaryExpr | UnsupportedFieldType;
readonly $type: 'NumberLiteral';

@@ -318,3 +330,3 @@ value: string;

export interface ObjectExpr extends AstNode {
readonly $container: Argument | ArrayExpr | AttributeArg | BinaryExpr | ConfigArrayExpr | ConfigField | ConfigInvocationArg | FieldInitializer | FunctionDecl | MemberAccessExpr | PluginField | UnaryExpr | UnsupportedFieldType;
readonly $container: Argument | ArrayExpr | AttributeArg | BinaryExpr | ConfigArrayExpr | ConfigField | ConfigInvocationArg | FieldInitializer | FunctionDecl | MemberAccessExpr | PluginField | ReferenceArg | UnaryExpr | UnsupportedFieldType;
readonly $type: 'ObjectExpr';

@@ -344,4 +356,4 @@ fields: Array<FieldInitializer>;

readonly $type: 'ReferenceArg';
name: 'sort';
value: 'Asc' | 'Desc';
name: string;
value: Expression;
}

@@ -351,3 +363,3 @@ export declare const ReferenceArg = "ReferenceArg";

export interface ReferenceExpr extends AstNode {
readonly $container: Argument | ArrayExpr | AttributeArg | BinaryExpr | ConfigArrayExpr | ConfigField | ConfigInvocationArg | FieldInitializer | FunctionDecl | MemberAccessExpr | PluginField | UnaryExpr | UnsupportedFieldType;
readonly $container: Argument | ArrayExpr | AttributeArg | BinaryExpr | ConfigArrayExpr | ConfigField | ConfigInvocationArg | FieldInitializer | FunctionDecl | MemberAccessExpr | PluginField | ReferenceArg | UnaryExpr | UnsupportedFieldType;
readonly $type: 'ReferenceExpr';

@@ -360,3 +372,3 @@ args: Array<ReferenceArg>;

export interface StringLiteral extends AstNode {
readonly $container: Argument | ArrayExpr | AttributeArg | BinaryExpr | ConfigArrayExpr | ConfigField | ConfigInvocationArg | FieldInitializer | FunctionDecl | MemberAccessExpr | PluginField | UnaryExpr | UnsupportedFieldType;
readonly $container: Argument | ArrayExpr | AttributeArg | BinaryExpr | ConfigArrayExpr | ConfigField | ConfigInvocationArg | FieldInitializer | FunctionDecl | MemberAccessExpr | PluginField | ReferenceArg | UnaryExpr | UnsupportedFieldType;
readonly $type: 'StringLiteral';

@@ -368,3 +380,3 @@ value: string;

export interface ThisExpr extends AstNode {
readonly $container: Argument | ArrayExpr | AttributeArg | BinaryExpr | ConfigArrayExpr | ConfigField | ConfigInvocationArg | FieldInitializer | FunctionDecl | MemberAccessExpr | PluginField | UnaryExpr | UnsupportedFieldType;
readonly $container: Argument | ArrayExpr | AttributeArg | BinaryExpr | ConfigArrayExpr | ConfigField | ConfigInvocationArg | FieldInitializer | FunctionDecl | MemberAccessExpr | PluginField | ReferenceArg | UnaryExpr | UnsupportedFieldType;
readonly $type: 'ThisExpr';

@@ -376,3 +388,3 @@ value: 'this';

export interface UnaryExpr extends AstNode {
readonly $container: Argument | ArrayExpr | AttributeArg | BinaryExpr | ConfigArrayExpr | ConfigField | ConfigInvocationArg | FieldInitializer | FunctionDecl | MemberAccessExpr | PluginField | UnaryExpr | UnsupportedFieldType;
readonly $container: Argument | ArrayExpr | AttributeArg | BinaryExpr | ConfigArrayExpr | ConfigField | ConfigInvocationArg | FieldInitializer | FunctionDecl | MemberAccessExpr | PluginField | ReferenceArg | UnaryExpr | UnsupportedFieldType;
readonly $type: 'UnaryExpr';

@@ -379,0 +391,0 @@ operand: Expression;

"use strict";
/******************************************************************************
* This file was generated by langium-cli 1.2.0.
* This file was generated by langium-cli 1.3.1.
* DO NOT EDIT MANUALLY!
******************************************************************************/
Object.defineProperty(exports, "__esModule", { value: true });
exports.isDataModelFieldType = exports.DataModelFieldType = exports.isDataModelFieldAttribute = exports.DataModelFieldAttribute = exports.isDataModelField = exports.DataModelField = exports.isDataModelAttribute = exports.DataModelAttribute = exports.isDataModel = exports.DataModel = exports.isConfigInvocationExpr = exports.ConfigInvocationExpr = exports.isConfigInvocationArg = exports.ConfigInvocationArg = exports.isConfigField = exports.ConfigField = exports.isConfigArrayExpr = exports.ConfigArrayExpr = exports.isBooleanLiteral = exports.BooleanLiteral = exports.isBinaryExpr = exports.BinaryExpr = exports.isAttributeParamType = exports.AttributeParamType = exports.isAttributeParam = exports.AttributeParam = exports.isAttributeArg = exports.AttributeArg = exports.isAttribute = exports.Attribute = exports.isArrayExpr = exports.ArrayExpr = exports.isArgument = exports.Argument = exports.isTypeDeclaration = exports.TypeDeclaration = exports.isRegularID = exports.isReferenceTarget = exports.ReferenceTarget = exports.isLiteralExpr = exports.LiteralExpr = exports.isExpressionType = exports.isExpression = exports.Expression = exports.isConfigExpr = exports.ConfigExpr = exports.isBuiltinType = exports.isBoolean = exports.isAbstractDeclaration = exports.AbstractDeclaration = void 0;
exports.reflection = exports.ZModelAstReflection = exports.isUnsupportedFieldType = exports.UnsupportedFieldType = exports.isUnaryExpr = exports.UnaryExpr = exports.isThisExpr = exports.ThisExpr = exports.isStringLiteral = exports.StringLiteral = exports.isReferenceExpr = exports.ReferenceExpr = exports.isReferenceArg = exports.ReferenceArg = exports.isPluginField = exports.PluginField = exports.isPlugin = exports.Plugin = exports.isObjectExpr = exports.ObjectExpr = exports.isNumberLiteral = exports.NumberLiteral = exports.isNullExpr = exports.NullExpr = exports.isModelImport = exports.ModelImport = exports.isModel = exports.Model = exports.isMemberAccessExpr = exports.MemberAccessExpr = exports.isInvocationExpr = exports.InvocationExpr = exports.isInternalAttribute = exports.InternalAttribute = exports.isGeneratorDecl = exports.GeneratorDecl = 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.isDataSource = exports.DataSource = void 0;
/* eslint-disable */
exports.DataModelFieldType = exports.isDataModelFieldAttribute = exports.DataModelFieldAttribute = exports.isDataModelField = exports.DataModelField = exports.isDataModelAttribute = exports.DataModelAttribute = exports.isDataModel = exports.DataModel = exports.isConfigInvocationExpr = exports.ConfigInvocationExpr = exports.isConfigInvocationArg = exports.ConfigInvocationArg = exports.isConfigField = exports.ConfigField = exports.isConfigArrayExpr = exports.ConfigArrayExpr = exports.isBooleanLiteral = exports.BooleanLiteral = exports.isBinaryExpr = exports.BinaryExpr = exports.isAttributeParamType = exports.AttributeParamType = exports.isAttributeParam = exports.AttributeParam = exports.isAttributeArg = exports.AttributeArg = exports.isAttribute = exports.Attribute = exports.isArrayExpr = exports.ArrayExpr = exports.isArgument = exports.Argument = exports.isTypeDeclaration = exports.TypeDeclaration = exports.isRegularID = exports.isReferenceTarget = exports.ReferenceTarget = exports.isLiteralExpr = exports.LiteralExpr = exports.isExpressionType = exports.isExpression = exports.Expression = exports.isConfigExpr = exports.ConfigExpr = exports.isBuiltinType = exports.isBoolean = exports.isAbstractDeclaration = exports.AbstractDeclaration = exports.ZModelTerminals = void 0;
exports.ZModelAstReflection = exports.isUnsupportedFieldType = exports.UnsupportedFieldType = exports.isUnaryExpr = exports.UnaryExpr = exports.isThisExpr = exports.ThisExpr = exports.isStringLiteral = exports.StringLiteral = exports.isReferenceExpr = exports.ReferenceExpr = exports.isReferenceArg = exports.ReferenceArg = exports.isPluginField = exports.PluginField = exports.isPlugin = exports.Plugin = exports.isObjectExpr = exports.ObjectExpr = exports.isNumberLiteral = exports.NumberLiteral = exports.isNullExpr = exports.NullExpr = exports.isModelImport = exports.ModelImport = exports.isModel = exports.Model = exports.isMemberAccessExpr = exports.MemberAccessExpr = exports.isInvocationExpr = exports.InvocationExpr = exports.isInternalAttribute = exports.InternalAttribute = exports.isGeneratorDecl = exports.GeneratorDecl = 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.isDataSource = exports.DataSource = exports.isDataModelFieldType = void 0;
exports.reflection = void 0;
const langium_1 = require("langium");
exports.ZModelTerminals = {
WS: /\s+/,
INTERNAL_ATTRIBUTE_NAME: /@@@([_a-zA-Z][\w_]*\.)*[_a-zA-Z][\w_]*/,
MODEL_ATTRIBUTE_NAME: /@@([_a-zA-Z][\w_]*\.)*[_a-zA-Z][\w_]*/,
FIELD_ATTRIBUTE_NAME: /@([_a-zA-Z][\w_]*\.)*[_a-zA-Z][\w_]*/,
ID: /[_a-zA-Z][\w_]*/,
STRING: /"(\\.|[^"\\])*"|'(\\.|[^'\\])*'/,
NUMBER: /[+-]?[0-9]+(\.[0-9]+)?/,
TRIPLE_SLASH_COMMENT: /\/\/\/[^\n\r]*/,
ML_COMMENT: /\/\*[\s\S]*?\*\//,
SL_COMMENT: /\/\/[^\n\r]*/,
};
exports.AbstractDeclaration = 'AbstractDeclaration';

@@ -49,3 +61,3 @@ function isAbstractDeclaration(item) {

function isRegularID(item) {
return item === 'model' || item === 'enum' || item === 'attribute' || item === 'datasource' || item === 'plugin' || item === 'abstract' || item === 'in' || item === 'sort' || item === 'view' || item === 'import' || (typeof item === 'string' && (/[_a-zA-Z][\w_]*/.test(item)));
return item === 'model' || item === 'enum' || item === 'attribute' || item === 'datasource' || item === 'plugin' || item === 'abstract' || item === 'in' || item === 'view' || item === 'import' || (typeof item === 'string' && (/[_a-zA-Z][\w_]*/.test(item)));
}

@@ -52,0 +64,0 @@ exports.isRegularID = isRegularID;

/******************************************************************************
* This file was generated by langium-cli 1.2.0.
* This file was generated by langium-cli 1.3.1.
* DO NOT EDIT MANUALLY!
******************************************************************************/
import { Grammar } from 'langium';
import type { Grammar } from 'langium';
export declare const ZModelGrammar: () => Grammar;
/******************************************************************************
* This file was generated by langium-cli 1.2.0.
* This file was generated by langium-cli 1.3.1.
* DO NOT EDIT MANUALLY!
******************************************************************************/
import { LangiumGeneratedServices, LangiumGeneratedSharedServices, LangiumSharedServices, LangiumServices, LanguageMetaData, Module } from 'langium';
export declare const ZModelLanguageMetaData: LanguageMetaData;
import type { LangiumGeneratedServices, LangiumGeneratedSharedServices, LangiumSharedServices, LangiumServices, Module } from 'langium';
export declare const ZModelLanguageMetaData: {
readonly languageId: "zmodel";
readonly fileExtensions: readonly [".zmodel"];
readonly caseInsensitive: false;
};
export declare const ZModelGeneratedSharedModule: Module<LangiumSharedServices, LangiumGeneratedSharedServices>;
export declare const ZModelGeneratedModule: Module<LangiumServices, LangiumGeneratedServices>;
"use strict";
/******************************************************************************
* This file was generated by langium-cli 1.2.0.
* This file was generated by langium-cli 1.3.1.
* DO NOT EDIT MANUALLY!

@@ -5,0 +5,0 @@ ******************************************************************************/

{
"name": "@zenstackhq/language",
"version": "1.8.2",
"version": "2.0.0-alpha.1",
"displayName": "ZenStack modeling language compiler",

@@ -14,7 +14,7 @@ "description": "ZenStack modeling language compiler",

"devDependencies": {
"langium-cli": "1.2.0",
"langium-cli": "1.3.1",
"plist2": "^1.1.3"
},
"dependencies": {
"langium": "1.2.0"
"langium": "1.3.1"
},

@@ -21,0 +21,0 @@ "contributes": {

@@ -13,3 +13,3 @@ {

"name": "keyword.control.zmodel",
"match": "\\b(Any|Asc|BigInt|Boolean|Bytes|ContextType|DateTime|Decimal|Desc|FieldReference|Float|Int|Json|Null|Object|String|TransitiveFieldReference|Unsupported|abstract|attribute|datasource|enum|extends|false|function|generator|import|in|model|null|plugin|sort|this|true|view)\\b"
"match": "\\b(Any|BigInt|Boolean|Bytes|ContextType|DateTime|Decimal|FieldReference|Float|Int|Json|Null|Object|String|TransitiveFieldReference|Unsupported|abstract|attribute|datasource|enum|extends|false|function|generator|import|in|model|null|plugin|this|true|view)\\b"
},

@@ -16,0 +16,0 @@ {

Sorry, the diff of this file is not supported yet

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

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc