@zenstackhq/language 3.9.2 → 3.9.3
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/index.cjs +24 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +2 -1
- package/dist/index.d.mts +2 -1
- package/dist/index.mjs +24 -1
- package/dist/index.mjs.map +1 -1
- package/dist/{utils-BrAxz9iX.mjs → utils-78tewMvG.mjs} +2 -2
- package/dist/{utils-BrAxz9iX.mjs.map → utils-78tewMvG.mjs.map} +1 -1
- package/dist/{utils-DSpz4Ig6.cjs → utils-DjeCl0z6.cjs} +2 -2
- package/dist/{utils-DSpz4Ig6.cjs.map → utils-DjeCl0z6.cjs.map} +1 -1
- package/dist/utils.cjs +1 -1
- package/dist/utils.mjs +1 -1
- package/package.json +6 -6
package/dist/index.d.cts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { A as DataSource, G as Model, I as FunctionDecl, N as Expression, O as DataModel, Q as Procedure, V as InvocationExpr, ct as TypeDef, j as Enum, t as AstNode$1, u as Attribute, z as GeneratorDecl } from "./ast-C3-ORZMv.cjs";
|
|
1
|
+
import { A as DataSource, G as Model, I as FunctionDecl, N as Expression, O as DataModel, Q as Procedure, V as InvocationExpr, X as Plugin, ct as TypeDef, j as Enum, t as AstNode$1, u as Attribute, z as GeneratorDecl } from "./ast-C3-ORZMv.cjs";
|
|
2
2
|
import { DeepPartial, Module, ValidationAcceptor } from "langium";
|
|
3
3
|
import { DefaultSharedModuleContext, LangiumServices, LangiumSharedServices, PartialLangiumServices } from "langium/lsp";
|
|
4
4
|
|
|
@@ -28,6 +28,7 @@ declare class ZModelValidator {
|
|
|
28
28
|
checkFunctionInvocation(node: InvocationExpr, accept: ValidationAcceptor): void;
|
|
29
29
|
checkFunctionDecl(node: FunctionDecl, accept: ValidationAcceptor): void;
|
|
30
30
|
checkProcedure(node: Procedure, accept: ValidationAcceptor): void;
|
|
31
|
+
checkPlugin(node: Plugin, accept: ValidationAcceptor): void;
|
|
31
32
|
}
|
|
32
33
|
//#endregion
|
|
33
34
|
//#region src/module.d.ts
|
package/dist/index.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { A as DataSource, G as Model, I as FunctionDecl, N as Expression, O as DataModel, Q as Procedure, V as InvocationExpr, ct as TypeDef, j as Enum, t as AstNode$1, u as Attribute, z as GeneratorDecl } from "./ast-DoH2ngKH.mjs";
|
|
1
|
+
import { A as DataSource, G as Model, I as FunctionDecl, N as Expression, O as DataModel, Q as Procedure, V as InvocationExpr, X as Plugin, ct as TypeDef, j as Enum, t as AstNode$1, u as Attribute, z as GeneratorDecl } from "./ast-DoH2ngKH.mjs";
|
|
2
2
|
import { DeepPartial, Module, ValidationAcceptor } from "langium";
|
|
3
3
|
import { DefaultSharedModuleContext, LangiumServices, LangiumSharedServices, PartialLangiumServices } from "langium/lsp";
|
|
4
4
|
|
|
@@ -28,6 +28,7 @@ declare class ZModelValidator {
|
|
|
28
28
|
checkFunctionInvocation(node: InvocationExpr, accept: ValidationAcceptor): void;
|
|
29
29
|
checkFunctionDecl(node: FunctionDecl, accept: ValidationAcceptor): void;
|
|
30
30
|
checkProcedure(node: Procedure, accept: ValidationAcceptor): void;
|
|
31
|
+
checkPlugin(node: Plugin, accept: ValidationAcceptor): void;
|
|
31
32
|
}
|
|
32
33
|
//#endregion
|
|
33
34
|
//#region src/module.d.ts
|
package/dist/index.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { A as GeneratorDecl, B as ObjectExpr, Bt as isModel, C as Enum, Ct as isDataModel, D as FunctionDecl, Dt as isEnumField, Et as isEnum, Ft as isInternalAttribute, G as ReferenceArg, Gt as isPlugin, H as PluginField, Ht as isNullExpr, I as Model, It as isInvocationExpr, J as StringLiteral, K as ReferenceExpr, Kt as isPluginField, L as ModelImport, Lt as isLiteralExpr, M as InvocationExpr, Mt as isFunctionParam, N as LiteralExpr, O as FunctionParam, P as MemberAccessExpr, Pt as isGeneratorDecl, Q as UnaryExpr, R as NullExpr, Rt as isMemberAccessExpr, S as DataSource, St as isDataFieldType, Tt as isDataSource, Ut as isNumberLiteral, V as Plugin, Vt as isModelImport, Xt as isReferenceExpr, Y as ThisExpr, Z as TypeDef, _ as DataFieldAttribute, a as AttributeArg, at as isAttribute, b as DataModel, bt as isDataFieldAttribute, c as BinaryExpr, d as ConfigArrayExpr, dt as isBooleanLiteral, en as isStringLiteral, et as ZModelAstReflection, g as DataField, gt as isConfigField, h as ConfigInvocationExpr, i as Attribute, it as isArrayExpr, jt as isFunctionDecl, k as FunctionParamType, l as BooleanLiteral, mt as isConfigArrayExpr, nt as isAbstractDeclaration, o as AttributeParam, ot as isAttributeArg, p as ConfigField, pt as isCollectionPredicateBinding, r as ArrayExpr, rn as isTypeDef, s as AttributeParamType, tn as isThisExpr, w as EnumField, wt as isDataModelAttribute, x as DataModelAttribute, yt as isDataField, z as NumberLiteral } from "./ast-DJOHdY8l.mjs";
|
|
2
2
|
import { BinaryExprOperatorPriority } from "./ast.mjs";
|
|
3
|
-
import { A as isAuthOrAuthMemberAccess, B as isMemberContainer, D as getUniqueFields, E as getStringLiteral, F as isDataFieldReference, G as resolveImport, I as isDelegateModel, J as resolved, K as resolveImportUri, L as isEnumFieldReference, M as isCheckInvocation, N as isCollectionPredicate, O as hasAttribute, P as isComputedField, Q as IssueCodes, R as isFromStdlib, S as getModelUniqueFields, T as getRecursiveBases, U as isRelationshipField, V as isNativeTypeMappingAttribute, W as mapBuiltinTypeToExpressionType, X as DB_PROVIDERS_SUPPORTING_LIST_TYPE, Y as typeAssignable, Z as ExpressionContext, a as getAllDeclarationsIncludingImports, et as SCALAR_TYPES, f as getAuthDecl, g as getDocument, h as getDataSourceProvider, j as isBeforeInvocation, k as isAuthInvocation, l as getAttribute, m as getDataModelAndTypeDefs, n as findUpAst, nt as SUPPORTED_PROVIDERS, o as getAllFields, p as getContainingDataModel, q as resolveTransitiveImports, r as getAllAttributes, s as getAllLoadedAndReachableDataModelsAndTypeDefs, tt as STD_LIB_MODULE_NAME, u as getAttributeArg, v as getFunctionExpressionContext, w as getPluginDocuments, x as getModelIdFields, y as getLiteral } from "./utils-
|
|
3
|
+
import { A as isAuthOrAuthMemberAccess, B as isMemberContainer, D as getUniqueFields, E as getStringLiteral, F as isDataFieldReference, G as resolveImport, I as isDelegateModel, J as resolved, K as resolveImportUri, L as isEnumFieldReference, M as isCheckInvocation, N as isCollectionPredicate, O as hasAttribute, P as isComputedField, Q as IssueCodes, R as isFromStdlib, S as getModelUniqueFields, T as getRecursiveBases, U as isRelationshipField, V as isNativeTypeMappingAttribute, W as mapBuiltinTypeToExpressionType, X as DB_PROVIDERS_SUPPORTING_LIST_TYPE, Y as typeAssignable, Z as ExpressionContext, a as getAllDeclarationsIncludingImports, et as SCALAR_TYPES, f as getAuthDecl, g as getDocument, h as getDataSourceProvider, j as isBeforeInvocation, k as isAuthInvocation, l as getAttribute, m as getDataModelAndTypeDefs, n as findUpAst, nt as SUPPORTED_PROVIDERS, o as getAllFields, p as getContainingDataModel, q as resolveTransitiveImports, r as getAllAttributes, s as getAllLoadedAndReachableDataModelsAndTypeDefs, tt as STD_LIB_MODULE_NAME, u as getAttributeArg, v as getFunctionExpressionContext, w as getPluginDocuments, x as getModelIdFields, y as getLiteral } from "./utils-78tewMvG.mjs";
|
|
4
4
|
import { createRequire } from "node:module";
|
|
5
5
|
import { invariant } from "@zenstackhq/common-helpers";
|
|
6
6
|
import { AstUtils, Cancellation, DefaultCommentProvider, DefaultDocumentBuilder, DefaultLinker, DefaultScopeComputation, DefaultScopeProvider, DefaultWorkspaceManager, DocumentState, EMPTY_SCOPE, JSDocDocumentationProvider, StreamScope, TextDocument, URI, UriUtils, inject, interruptAndCheck, isAstNode, loadGrammarFromJson } from "langium";
|
|
@@ -4941,6 +4941,25 @@ var DataSourceValidator = class {
|
|
|
4941
4941
|
}
|
|
4942
4942
|
};
|
|
4943
4943
|
//#endregion
|
|
4944
|
+
//#region src/validators/plugin-validator.ts
|
|
4945
|
+
/**
|
|
4946
|
+
* Validates plugin declarations.
|
|
4947
|
+
*/
|
|
4948
|
+
var PluginValidator = class {
|
|
4949
|
+
validate(plugin, accept) {
|
|
4950
|
+
validateDuplicatedDeclarations(plugin, plugin.fields, accept);
|
|
4951
|
+
this.validateProvider(plugin, accept);
|
|
4952
|
+
}
|
|
4953
|
+
validateProvider(plugin, accept) {
|
|
4954
|
+
const provider = plugin.fields.find((f) => f.name === "provider");
|
|
4955
|
+
if (!provider) {
|
|
4956
|
+
accept("error", "plugin must include a \"provider\" field", { node: plugin });
|
|
4957
|
+
return;
|
|
4958
|
+
}
|
|
4959
|
+
if (!getStringLiteral(provider.value)) accept("error", "\"provider\" must be set to a non-empty string literal", { node: provider.value });
|
|
4960
|
+
}
|
|
4961
|
+
};
|
|
4962
|
+
//#endregion
|
|
4944
4963
|
//#region src/validators/enum-validator.ts
|
|
4945
4964
|
/**
|
|
4946
4965
|
* Validates enum declarations.
|
|
@@ -5429,6 +5448,7 @@ function registerValidationChecks(services) {
|
|
|
5429
5448
|
const checks = {
|
|
5430
5449
|
Model: validator.checkModel,
|
|
5431
5450
|
DataSource: validator.checkDataSource,
|
|
5451
|
+
Plugin: validator.checkPlugin,
|
|
5432
5452
|
GeneratorDecl: validator.checkGenerator,
|
|
5433
5453
|
DataModel: validator.checkDataModel,
|
|
5434
5454
|
TypeDef: validator.checkTypeDef,
|
|
@@ -5481,6 +5501,9 @@ var ZModelValidator = class {
|
|
|
5481
5501
|
checkProcedure(node, accept) {
|
|
5482
5502
|
new ProcedureValidator().validate(node, accept);
|
|
5483
5503
|
}
|
|
5504
|
+
checkPlugin(node, accept) {
|
|
5505
|
+
new PluginValidator().validate(node, accept);
|
|
5506
|
+
}
|
|
5484
5507
|
};
|
|
5485
5508
|
//#endregion
|
|
5486
5509
|
//#region src/zmodel-comment-provider.ts
|