@zenstackhq/language 3.5.6 → 3.6.0
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/ast-Clidp86c.cjs +1465 -0
- package/dist/ast-Clidp86c.cjs.map +1 -0
- package/dist/ast-DEfhnj8j.mjs +765 -0
- package/dist/ast-DEfhnj8j.mjs.map +1 -0
- package/dist/ast-DQDdBZQ3.d.mts +525 -0
- package/dist/ast-W2h6Qtfk.d.cts +525 -0
- package/dist/ast.cjs +130 -1432
- package/dist/ast.cjs.map +1 -1
- package/dist/ast.d.cts +2 -541
- package/dist/ast.d.mts +2 -0
- package/dist/ast.mjs +20 -0
- package/dist/ast.mjs.map +1 -0
- package/dist/factory.cjs +754 -2030
- package/dist/factory.cjs.map +1 -1
- package/dist/factory.d.cts +220 -215
- package/dist/factory.d.mts +289 -0
- package/dist/factory.mjs +778 -0
- package/dist/factory.mjs.map +1 -0
- package/dist/index.cjs +2691 -5454
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +104 -103
- package/dist/index.d.mts +170 -0
- package/dist/index.mjs +6925 -0
- package/dist/index.mjs.map +1 -0
- package/dist/utils-BB6L7ug2.mjs +529 -0
- package/dist/utils-BB6L7ug2.mjs.map +1 -0
- package/dist/utils-CfXGZkv7.cjs +842 -0
- package/dist/utils-CfXGZkv7.cjs.map +1 -0
- package/dist/utils.cjs +47 -1650
- package/dist/utils.d.cts +101 -10
- package/dist/{utils.d.ts → utils.d.mts} +101 -10
- package/dist/utils.mjs +2 -0
- package/package.json +16 -15
- package/dist/ast.d.ts +0 -541
- package/dist/ast.js +0 -1288
- package/dist/ast.js.map +0 -1
- package/dist/factory.d.ts +0 -284
- package/dist/factory.js +0 -2020
- package/dist/factory.js.map +0 -1
- package/dist/index.d.ts +0 -169
- package/dist/index.js +0 -9656
- package/dist/index.js.map +0 -1
- package/dist/utils.cjs.map +0 -1
- package/dist/utils.js +0 -1572
- package/dist/utils.js.map +0 -1
|
@@ -0,0 +1,842 @@
|
|
|
1
|
+
const require_ast = require("./ast-Clidp86c.cjs");
|
|
2
|
+
let langium = require("langium");
|
|
3
|
+
let node_fs = require("node:fs");
|
|
4
|
+
node_fs = require_ast.__toESM(node_fs, 1);
|
|
5
|
+
let node_path = require("node:path");
|
|
6
|
+
node_path = require_ast.__toESM(node_path, 1);
|
|
7
|
+
let node_url = require("node:url");
|
|
8
|
+
let node_module = require("node:module");
|
|
9
|
+
//#region src/constants.ts
|
|
10
|
+
/**
|
|
11
|
+
* Supported db providers
|
|
12
|
+
*/
|
|
13
|
+
const SUPPORTED_PROVIDERS = [
|
|
14
|
+
"sqlite",
|
|
15
|
+
"postgresql",
|
|
16
|
+
"mysql"
|
|
17
|
+
];
|
|
18
|
+
/**
|
|
19
|
+
* All scalar types
|
|
20
|
+
*/
|
|
21
|
+
const SCALAR_TYPES = [
|
|
22
|
+
"String",
|
|
23
|
+
"Int",
|
|
24
|
+
"Float",
|
|
25
|
+
"Decimal",
|
|
26
|
+
"BigInt",
|
|
27
|
+
"Boolean",
|
|
28
|
+
"Bytes",
|
|
29
|
+
"DateTime"
|
|
30
|
+
];
|
|
31
|
+
/**
|
|
32
|
+
* Name of standard library module
|
|
33
|
+
*/
|
|
34
|
+
const STD_LIB_MODULE_NAME = "stdlib.zmodel";
|
|
35
|
+
/**
|
|
36
|
+
* Name of module contributed by plugins
|
|
37
|
+
*/
|
|
38
|
+
const PLUGIN_MODULE_NAME = "plugin.zmodel";
|
|
39
|
+
/**
|
|
40
|
+
* Validation issues
|
|
41
|
+
*/
|
|
42
|
+
let IssueCodes = /* @__PURE__ */ function(IssueCodes) {
|
|
43
|
+
IssueCodes["MissingOppositeRelation"] = "miss-opposite-relation";
|
|
44
|
+
return IssueCodes;
|
|
45
|
+
}({});
|
|
46
|
+
/**
|
|
47
|
+
* Expression context
|
|
48
|
+
*/
|
|
49
|
+
let ExpressionContext = /* @__PURE__ */ function(ExpressionContext) {
|
|
50
|
+
ExpressionContext["DefaultValue"] = "DefaultValue";
|
|
51
|
+
ExpressionContext["AccessPolicy"] = "AccessPolicy";
|
|
52
|
+
ExpressionContext["ValidationRule"] = "ValidationRule";
|
|
53
|
+
ExpressionContext["Index"] = "Index";
|
|
54
|
+
return ExpressionContext;
|
|
55
|
+
}({});
|
|
56
|
+
/**
|
|
57
|
+
* Database providers that support list field types.
|
|
58
|
+
*/
|
|
59
|
+
const DB_PROVIDERS_SUPPORTING_LIST_TYPE = ["postgresql"];
|
|
60
|
+
//#endregion
|
|
61
|
+
//#region src/utils.ts
|
|
62
|
+
function hasAttribute(decl, name) {
|
|
63
|
+
return !!getAttribute(decl, name);
|
|
64
|
+
}
|
|
65
|
+
function getAttribute(decl, name) {
|
|
66
|
+
return decl.attributes.find((attr) => attr.decl.$refText === name);
|
|
67
|
+
}
|
|
68
|
+
function isFromStdlib(node) {
|
|
69
|
+
const model = langium.AstUtils.getContainerOfType(node, require_ast.isModel);
|
|
70
|
+
return !!model && !!model.$document && model.$document.uri.path.endsWith("stdlib.zmodel");
|
|
71
|
+
}
|
|
72
|
+
function isAuthInvocation(node) {
|
|
73
|
+
return require_ast.isInvocationExpr(node) && node.function.ref?.name === "auth" && isFromStdlib(node.function.ref);
|
|
74
|
+
}
|
|
75
|
+
/**
|
|
76
|
+
* Try getting string value from a potential string literal expression
|
|
77
|
+
*/
|
|
78
|
+
function getStringLiteral(node) {
|
|
79
|
+
return require_ast.isStringLiteral(node) ? node.value : void 0;
|
|
80
|
+
}
|
|
81
|
+
const isoDateTimeRegex = /^\d{4}(-\d\d(-\d\d(T\d\d:\d\d(:\d\d)?(\.\d+)?(([+-]\d\d:\d\d)|Z)?)?)?)?$/i;
|
|
82
|
+
/**
|
|
83
|
+
* Determines if the given sourceType is assignable to a destination of destType
|
|
84
|
+
*/
|
|
85
|
+
function typeAssignable(destType, sourceType, sourceExpr) {
|
|
86
|
+
if (destType === "DateTime" && sourceType === "String" && sourceExpr && require_ast.isStringLiteral(sourceExpr)) {
|
|
87
|
+
const literal = getStringLiteral(sourceExpr);
|
|
88
|
+
if (literal && isoDateTimeRegex.test(literal)) sourceType = "DateTime";
|
|
89
|
+
}
|
|
90
|
+
switch (destType) {
|
|
91
|
+
case "Any": return true;
|
|
92
|
+
case "Float": return sourceType === "Any" || sourceType === "Int" || sourceType === "Float";
|
|
93
|
+
default: return sourceType === "Any" || sourceType === destType;
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
/**
|
|
97
|
+
* Maps a ZModel builtin type to expression type
|
|
98
|
+
*/
|
|
99
|
+
function mapBuiltinTypeToExpressionType(type) {
|
|
100
|
+
switch (type) {
|
|
101
|
+
case "Any":
|
|
102
|
+
case "Boolean":
|
|
103
|
+
case "String":
|
|
104
|
+
case "DateTime":
|
|
105
|
+
case "Int":
|
|
106
|
+
case "Float":
|
|
107
|
+
case "Null":
|
|
108
|
+
case "Object":
|
|
109
|
+
case "Unsupported":
|
|
110
|
+
case "Void":
|
|
111
|
+
case "Undefined": return type;
|
|
112
|
+
case "BigInt": return "Int";
|
|
113
|
+
case "Decimal": return "Float";
|
|
114
|
+
case "Json":
|
|
115
|
+
case "Bytes": return "Any";
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
/**
|
|
119
|
+
* Determines if the given expression is an invocation of `auth` or a member access on the result of an `auth` invocation (e.g. `auth().role`).
|
|
120
|
+
*/
|
|
121
|
+
function isAuthOrAuthMemberAccess(expr) {
|
|
122
|
+
return isAuthInvocation(expr) || require_ast.isMemberAccessExpr(expr) && isAuthOrAuthMemberAccess(expr.operand);
|
|
123
|
+
}
|
|
124
|
+
/**
|
|
125
|
+
* Determines if the given expression is a reference to an enum field.
|
|
126
|
+
*/
|
|
127
|
+
function isEnumFieldReference(node) {
|
|
128
|
+
return require_ast.isReferenceExpr(node) && require_ast.isEnumField(node.target.ref);
|
|
129
|
+
}
|
|
130
|
+
/**
|
|
131
|
+
* Determines if the given expression is a reference to a data field.
|
|
132
|
+
*/
|
|
133
|
+
function isDataFieldReference(node) {
|
|
134
|
+
return require_ast.isReferenceExpr(node) && require_ast.isDataField(node.target.ref);
|
|
135
|
+
}
|
|
136
|
+
/**
|
|
137
|
+
* Returns if the given field is a relation field.
|
|
138
|
+
*/
|
|
139
|
+
function isRelationshipField(field) {
|
|
140
|
+
return require_ast.isDataModel(field.type.reference?.ref);
|
|
141
|
+
}
|
|
142
|
+
/**
|
|
143
|
+
* Returns if the given field is a computed field.
|
|
144
|
+
*/
|
|
145
|
+
function isComputedField(field) {
|
|
146
|
+
return hasAttribute(field, "@computed");
|
|
147
|
+
}
|
|
148
|
+
/**
|
|
149
|
+
* Determines if the given data model is a delegate model (i.e. marked with `@@delegate` attribute).
|
|
150
|
+
*/
|
|
151
|
+
function isDelegateModel(node) {
|
|
152
|
+
return require_ast.isDataModel(node) && hasAttribute(node, "@@delegate");
|
|
153
|
+
}
|
|
154
|
+
/**
|
|
155
|
+
* Resolves the given reference and returns the target AST node. Throws an error if the reference is not resolved.
|
|
156
|
+
*/
|
|
157
|
+
function resolved(ref) {
|
|
158
|
+
if (!ref.ref) throw new Error(`Reference not resolved: ${ref.$refText}`);
|
|
159
|
+
return ref.ref;
|
|
160
|
+
}
|
|
161
|
+
/**
|
|
162
|
+
* Gets all base models and mixins of a data model or type def, recursively.
|
|
163
|
+
*/
|
|
164
|
+
function getRecursiveBases(decl, includeDelegate = true, documents, seen = /* @__PURE__ */ new Set()) {
|
|
165
|
+
const result = [];
|
|
166
|
+
if (seen.has(decl)) return result;
|
|
167
|
+
seen.add(decl);
|
|
168
|
+
[...decl.mixins, ...require_ast.isDataModel(decl) && decl.baseModel ? [decl.baseModel] : []].forEach((base) => {
|
|
169
|
+
let baseDecl;
|
|
170
|
+
if (base.ref && (require_ast.isTypeDef(base.ref) || require_ast.isDataModel(base.ref))) baseDecl = base.ref;
|
|
171
|
+
else baseDecl = (documents ? getAllDeclarationsIncludingImports(documents, decl.$container) : decl.$container.declarations).find((d) => (require_ast.isTypeDef(d) || require_ast.isDataModel(d)) && d.name === base.$refText);
|
|
172
|
+
if (baseDecl) {
|
|
173
|
+
if (!includeDelegate && isDelegateModel(baseDecl)) return;
|
|
174
|
+
result.push(baseDecl);
|
|
175
|
+
result.push(...getRecursiveBases(baseDecl, includeDelegate, documents, seen));
|
|
176
|
+
}
|
|
177
|
+
});
|
|
178
|
+
return result;
|
|
179
|
+
}
|
|
180
|
+
/**
|
|
181
|
+
* Gets `@@id` fields declared at the data model level (including search in base models)
|
|
182
|
+
*/
|
|
183
|
+
function getModelIdFields(model) {
|
|
184
|
+
const modelsToCheck = [model, ...getRecursiveBases(model)];
|
|
185
|
+
for (const modelToCheck of modelsToCheck) {
|
|
186
|
+
const idAttr = getAllAttributes(modelToCheck).find((attr) => attr.decl.$refText === "@@id");
|
|
187
|
+
if (!idAttr) continue;
|
|
188
|
+
const fieldsArg = idAttr.args.find((a) => a.$resolvedParam?.name === "fields");
|
|
189
|
+
if (!fieldsArg || !require_ast.isArrayExpr(fieldsArg.value)) continue;
|
|
190
|
+
return fieldsArg.value.items.filter((item) => require_ast.isReferenceExpr(item)).map((item) => resolved(item.target));
|
|
191
|
+
}
|
|
192
|
+
return [];
|
|
193
|
+
}
|
|
194
|
+
/**
|
|
195
|
+
* Gets `@@unique` fields declared at the data model level (including search in base models)
|
|
196
|
+
*/
|
|
197
|
+
function getModelUniqueFields(model) {
|
|
198
|
+
const modelsToCheck = [model, ...getRecursiveBases(model)];
|
|
199
|
+
for (const modelToCheck of modelsToCheck) {
|
|
200
|
+
const uniqueAttr = getAllAttributes(modelToCheck).find((attr) => attr.decl.$refText === "@@unique");
|
|
201
|
+
if (!uniqueAttr) continue;
|
|
202
|
+
const fieldsArg = uniqueAttr.args.find((a) => a.$resolvedParam?.name === "fields");
|
|
203
|
+
if (!fieldsArg || !require_ast.isArrayExpr(fieldsArg.value)) continue;
|
|
204
|
+
return fieldsArg.value.items.filter((item) => require_ast.isReferenceExpr(item)).map((item) => resolved(item.target));
|
|
205
|
+
}
|
|
206
|
+
return [];
|
|
207
|
+
}
|
|
208
|
+
/**
|
|
209
|
+
* Gets lists of unique fields declared at the data model level
|
|
210
|
+
*
|
|
211
|
+
* TODO: merge this with {@link getModelUniqueFields}
|
|
212
|
+
*/
|
|
213
|
+
function getUniqueFields(model) {
|
|
214
|
+
return model.attributes.filter((attr) => attr.decl.ref?.name === "@@unique" || attr.decl.ref?.name === "@@id").map((uniqueAttr) => {
|
|
215
|
+
const fieldsArg = uniqueAttr.args.find((a) => a.$resolvedParam?.name === "fields");
|
|
216
|
+
if (!fieldsArg || !require_ast.isArrayExpr(fieldsArg.value)) return [];
|
|
217
|
+
return fieldsArg.value.items.filter((item) => require_ast.isReferenceExpr(item)).map((item) => resolved(item.target));
|
|
218
|
+
});
|
|
219
|
+
}
|
|
220
|
+
/**
|
|
221
|
+
* Finds the first ancestor of the given AST node that satisfies the given predicate function. Returns `undefined` if no such ancestor is found.
|
|
222
|
+
*/
|
|
223
|
+
function findUpAst(node, predicate) {
|
|
224
|
+
let curr = node;
|
|
225
|
+
while (curr) {
|
|
226
|
+
if (predicate(curr)) return curr;
|
|
227
|
+
curr = curr.$container;
|
|
228
|
+
}
|
|
229
|
+
}
|
|
230
|
+
/**
|
|
231
|
+
* Tries to get the literal value from the given expression. Returns `undefined` if the expression is not a literal or if the literal value cannot be determined.
|
|
232
|
+
*/
|
|
233
|
+
function getLiteral(expr) {
|
|
234
|
+
switch (expr?.$type) {
|
|
235
|
+
case "ObjectExpr": return getObjectLiteral(expr);
|
|
236
|
+
case "StringLiteral":
|
|
237
|
+
case "BooleanLiteral": return expr.value;
|
|
238
|
+
case "NumberLiteral": return parseFloat(expr.value);
|
|
239
|
+
default: return;
|
|
240
|
+
}
|
|
241
|
+
}
|
|
242
|
+
/**
|
|
243
|
+
* Tries to get an object literal from the given expression. Returns `undefined` if the expression is not an object literal or if any of the field values cannot be determined.
|
|
244
|
+
*/
|
|
245
|
+
function getObjectLiteral(expr) {
|
|
246
|
+
if (!expr || !require_ast.isObjectExpr(expr)) return;
|
|
247
|
+
const result = {};
|
|
248
|
+
for (const field of expr.fields) {
|
|
249
|
+
let fieldValue;
|
|
250
|
+
if (require_ast.isLiteralExpr(field.value)) fieldValue = getLiteral(field.value);
|
|
251
|
+
else if (require_ast.isArrayExpr(field.value)) fieldValue = getLiteralArray(field.value);
|
|
252
|
+
else if (require_ast.isObjectExpr(field.value)) fieldValue = getObjectLiteral(field.value);
|
|
253
|
+
if (fieldValue === void 0) return;
|
|
254
|
+
else result[field.name] = fieldValue;
|
|
255
|
+
}
|
|
256
|
+
return result;
|
|
257
|
+
}
|
|
258
|
+
function getLiteralArray(expr) {
|
|
259
|
+
const arr = getArray(expr);
|
|
260
|
+
if (!arr) return;
|
|
261
|
+
return arr.map((item) => require_ast.isExpression(item) && getLiteral(item)).filter((v) => v !== void 0);
|
|
262
|
+
}
|
|
263
|
+
function getArray(expr) {
|
|
264
|
+
return require_ast.isArrayExpr(expr) || require_ast.isConfigArrayExpr(expr) ? expr.items : void 0;
|
|
265
|
+
}
|
|
266
|
+
/**
|
|
267
|
+
* Gets the value of the argument with the given name from the given attribute. Returns `undefined` if no such argument is found or if the argument value cannot be determined.
|
|
268
|
+
*/
|
|
269
|
+
function getAttributeArg(attr, name) {
|
|
270
|
+
return attr.args.find((arg) => arg.$resolvedParam?.name === name)?.value;
|
|
271
|
+
}
|
|
272
|
+
/**
|
|
273
|
+
* Gets the literal value of the argument with the given name from the given attribute. Returns `undefined` if no such argument is found or if the argument value cannot be determined or is not a literal.
|
|
274
|
+
*/
|
|
275
|
+
function getAttributeArgLiteral(attr, name) {
|
|
276
|
+
for (const arg of attr.args) if (arg.$resolvedParam?.name === name) return getLiteral(arg.value);
|
|
277
|
+
}
|
|
278
|
+
/**
|
|
279
|
+
* Gets the allowed expression contexts for the given function declaration by looking for `@@expressionContext` attribute.
|
|
280
|
+
* Returns an empty array if no such attribute is found or if the attribute value cannot be determined.
|
|
281
|
+
*/
|
|
282
|
+
function getFunctionExpressionContext(funcDecl) {
|
|
283
|
+
const funcAllowedContext = [];
|
|
284
|
+
const funcAttr = funcDecl.attributes.find((attr) => attr.decl.$refText === "@@@expressionContext");
|
|
285
|
+
if (funcAttr) {
|
|
286
|
+
const contextArg = funcAttr.args[0]?.value;
|
|
287
|
+
if (require_ast.isArrayExpr(contextArg)) contextArg.items.forEach((item) => {
|
|
288
|
+
if (isEnumFieldReference(item)) funcAllowedContext.push(item.target.$refText);
|
|
289
|
+
});
|
|
290
|
+
}
|
|
291
|
+
return funcAllowedContext;
|
|
292
|
+
}
|
|
293
|
+
/**
|
|
294
|
+
* Gets the data field referenced by the given expression, if any. Returns `undefined` if the expression is not a reference to a data field.
|
|
295
|
+
*/
|
|
296
|
+
function getFieldReference(expr) {
|
|
297
|
+
if (require_ast.isReferenceExpr(expr) && require_ast.isDataField(expr.target.ref)) return expr.target.ref;
|
|
298
|
+
else if (require_ast.isMemberAccessExpr(expr) && require_ast.isDataField(expr.member.ref)) return expr.member.ref;
|
|
299
|
+
else return;
|
|
300
|
+
}
|
|
301
|
+
function isCheckInvocation(node) {
|
|
302
|
+
return require_ast.isInvocationExpr(node) && node.function.ref?.name === "check";
|
|
303
|
+
}
|
|
304
|
+
/**
|
|
305
|
+
* Resolves the transitive imports of the given model and returns the list of imported models. The given model itself is not included in the result.
|
|
306
|
+
*/
|
|
307
|
+
function resolveTransitiveImports(documents, model) {
|
|
308
|
+
return resolveTransitiveImportsInternal(documents, model);
|
|
309
|
+
}
|
|
310
|
+
function resolveTransitiveImportsInternal(documents, model, initialModel = model, visited = /* @__PURE__ */ new Set(), models = /* @__PURE__ */ new Set()) {
|
|
311
|
+
const doc = langium.AstUtils.getDocument(model);
|
|
312
|
+
if (langium.AstUtils.getDocument(initialModel).uri.fsPath.toLowerCase() !== doc.uri.fsPath.toLowerCase()) models.add(model);
|
|
313
|
+
const normalizedPath = doc.uri.fsPath.toLowerCase();
|
|
314
|
+
if (!visited.has(normalizedPath)) {
|
|
315
|
+
visited.add(normalizedPath);
|
|
316
|
+
for (const imp of model.imports) {
|
|
317
|
+
const importedModel = resolveImport(documents, imp);
|
|
318
|
+
if (importedModel) resolveTransitiveImportsInternal(documents, importedModel, initialModel, visited, models);
|
|
319
|
+
}
|
|
320
|
+
}
|
|
321
|
+
return Array.from(models);
|
|
322
|
+
}
|
|
323
|
+
/**
|
|
324
|
+
* Resolves the given import and returns the imported model. Returns `undefined`
|
|
325
|
+
* if the import cannot be resolved.
|
|
326
|
+
*/
|
|
327
|
+
function resolveImport(documents, imp) {
|
|
328
|
+
const resolvedUri = resolveImportUri(imp);
|
|
329
|
+
try {
|
|
330
|
+
if (resolvedUri) {
|
|
331
|
+
let resolvedDocument = documents.getDocument(resolvedUri);
|
|
332
|
+
if (!resolvedDocument) {
|
|
333
|
+
const content = node_fs.default.readFileSync(resolvedUri.fsPath, "utf-8");
|
|
334
|
+
resolvedDocument = documents.createDocument(resolvedUri, content);
|
|
335
|
+
}
|
|
336
|
+
const node = resolvedDocument.parseResult.value;
|
|
337
|
+
if (require_ast.isModel(node)) return node;
|
|
338
|
+
}
|
|
339
|
+
} catch {}
|
|
340
|
+
}
|
|
341
|
+
/**
|
|
342
|
+
* Resolves the given import and returns the URI of the imported model.
|
|
343
|
+
* Returns `undefined` if the import cannot be resolved.
|
|
344
|
+
*/
|
|
345
|
+
function resolveImportUri(imp) {
|
|
346
|
+
if (!imp.path) return;
|
|
347
|
+
const doc = langium.AstUtils.getDocument(imp);
|
|
348
|
+
const dir = node_path.default.dirname(doc.uri.fsPath);
|
|
349
|
+
const importPath = imp.path.endsWith(".zmodel") ? imp.path : `${imp.path}.zmodel`;
|
|
350
|
+
return langium.URI.file(node_path.default.resolve(dir, importPath));
|
|
351
|
+
}
|
|
352
|
+
/**
|
|
353
|
+
* Gets data models and type defs in the ZModel schema.
|
|
354
|
+
*/
|
|
355
|
+
function getDataModelAndTypeDefs(model, includeIgnored = false) {
|
|
356
|
+
const r = model.declarations.filter((d) => require_ast.isDataModel(d) || require_ast.isTypeDef(d));
|
|
357
|
+
if (includeIgnored) return r;
|
|
358
|
+
else return r.filter((model) => !hasAttribute(model, "@@ignore"));
|
|
359
|
+
}
|
|
360
|
+
/**
|
|
361
|
+
* Gets all declarations of the given model and its transitive imports.
|
|
362
|
+
*/
|
|
363
|
+
function getAllDeclarationsIncludingImports(documents, model) {
|
|
364
|
+
const imports = resolveTransitiveImports(documents, model);
|
|
365
|
+
return model.declarations.concat(...imports.map((imp) => imp.declarations));
|
|
366
|
+
}
|
|
367
|
+
/**
|
|
368
|
+
* Gets the model used for auth context, by looking for a model with `@@auth` attribute or a model named `User`.
|
|
369
|
+
* Returns `undefined` if no such model is found.
|
|
370
|
+
*/
|
|
371
|
+
function getAuthDecl(decls) {
|
|
372
|
+
let authModel = decls.find((d) => hasAttribute(d, "@@auth"));
|
|
373
|
+
if (!authModel) authModel = decls.find((d) => d.name === "User");
|
|
374
|
+
return authModel;
|
|
375
|
+
}
|
|
376
|
+
function isBeforeInvocation(node) {
|
|
377
|
+
return require_ast.isInvocationExpr(node) && node.function.ref?.name === "before";
|
|
378
|
+
}
|
|
379
|
+
/**
|
|
380
|
+
* Determines if the given AST node is a collection predicate.
|
|
381
|
+
*/
|
|
382
|
+
function isCollectionPredicate(node) {
|
|
383
|
+
return require_ast.isBinaryExpr(node) && [
|
|
384
|
+
"?",
|
|
385
|
+
"!",
|
|
386
|
+
"^"
|
|
387
|
+
].includes(node.operator);
|
|
388
|
+
}
|
|
389
|
+
/**
|
|
390
|
+
* Gets all data models and type defs from the given documents registry.
|
|
391
|
+
*/
|
|
392
|
+
function getAllLoadedDataModelsAndTypeDefs(langiumDocuments) {
|
|
393
|
+
return langiumDocuments.all.map((doc) => doc.parseResult.value).flatMap((model) => model.declarations.filter((d) => require_ast.isDataModel(d) || require_ast.isTypeDef(d))).toArray();
|
|
394
|
+
}
|
|
395
|
+
/**
|
|
396
|
+
* Gets all data models from the given documents registry and the transitive imports of the given model.
|
|
397
|
+
*/
|
|
398
|
+
function getAllDataModelsIncludingImports(documents, model) {
|
|
399
|
+
return getAllDeclarationsIncludingImports(documents, model).filter(require_ast.isDataModel);
|
|
400
|
+
}
|
|
401
|
+
/**
|
|
402
|
+
* Gets all data models and type defs from the given documents registry and the transitive imports
|
|
403
|
+
* of the given model. If `fromModel` is not provided, returns all loaded data models and type defs.
|
|
404
|
+
*/
|
|
405
|
+
function getAllLoadedAndReachableDataModelsAndTypeDefs(langiumDocuments, fromModel) {
|
|
406
|
+
const allDataModels = getAllLoadedDataModelsAndTypeDefs(langiumDocuments);
|
|
407
|
+
if (fromModel) {
|
|
408
|
+
const model = langium.AstUtils.getContainerOfType(fromModel, require_ast.isModel);
|
|
409
|
+
if (model) getAllDataModelsIncludingImports(langiumDocuments, model).forEach((dm) => {
|
|
410
|
+
if (!allDataModels.includes(dm)) allDataModels.push(dm);
|
|
411
|
+
});
|
|
412
|
+
}
|
|
413
|
+
return allDataModels;
|
|
414
|
+
}
|
|
415
|
+
/**
|
|
416
|
+
* Gets the containing data model of the given AST node, if any.
|
|
417
|
+
* Returns `undefined` if the node is not contained in a data model.
|
|
418
|
+
*/
|
|
419
|
+
function getContainingDataModel(node) {
|
|
420
|
+
let curr = node.$container;
|
|
421
|
+
while (curr) {
|
|
422
|
+
if (require_ast.isDataModel(curr)) return curr;
|
|
423
|
+
curr = curr.$container;
|
|
424
|
+
}
|
|
425
|
+
}
|
|
426
|
+
/**
|
|
427
|
+
* Determines if the given AST node can contain members.
|
|
428
|
+
*/
|
|
429
|
+
function isMemberContainer(node) {
|
|
430
|
+
return require_ast.isDataModel(node) || require_ast.isTypeDef(node);
|
|
431
|
+
}
|
|
432
|
+
/**
|
|
433
|
+
* Gets all fields of a data model or type def, including inherited fields from base models and mixins.
|
|
434
|
+
*/
|
|
435
|
+
function getAllFields(decl, includeIgnored = false, seen = /* @__PURE__ */ new Set()) {
|
|
436
|
+
if (seen.has(decl)) return [];
|
|
437
|
+
seen.add(decl);
|
|
438
|
+
const fields = [];
|
|
439
|
+
for (const mixin of decl.mixins) if (mixin.ref) fields.push(...getAllFields(mixin.ref, includeIgnored, seen));
|
|
440
|
+
if (require_ast.isDataModel(decl) && decl.baseModel) {
|
|
441
|
+
if (decl.baseModel.ref) fields.push(...getAllFields(decl.baseModel.ref, includeIgnored, seen));
|
|
442
|
+
}
|
|
443
|
+
fields.push(...decl.fields.filter((f) => includeIgnored || !hasAttribute(f, "@ignore")));
|
|
444
|
+
return fields;
|
|
445
|
+
}
|
|
446
|
+
/**
|
|
447
|
+
* Gets all attributes of a data model or type def, including inherited attributes
|
|
448
|
+
* from base models and mixins.
|
|
449
|
+
*/
|
|
450
|
+
function getAllAttributes(decl, seen = /* @__PURE__ */ new Set()) {
|
|
451
|
+
if (seen.has(decl)) return [];
|
|
452
|
+
seen.add(decl);
|
|
453
|
+
const attributes = [];
|
|
454
|
+
for (const mixin of decl.mixins) if (mixin.ref) attributes.push(...getAllAttributes(mixin.ref, seen));
|
|
455
|
+
if (require_ast.isDataModel(decl) && decl.baseModel) {
|
|
456
|
+
if (decl.baseModel.ref) {
|
|
457
|
+
const attrs = getAllAttributes(decl.baseModel.ref, seen).filter((attr) => !isNonInheritableAttribute(attr));
|
|
458
|
+
attributes.push(...attrs);
|
|
459
|
+
}
|
|
460
|
+
}
|
|
461
|
+
attributes.push(...decl.attributes);
|
|
462
|
+
return attributes;
|
|
463
|
+
}
|
|
464
|
+
function isNonInheritableAttribute(attr) {
|
|
465
|
+
const attrName = attr.decl.ref?.name ?? attr.decl.$refText;
|
|
466
|
+
return [
|
|
467
|
+
"@@map",
|
|
468
|
+
"@@unique",
|
|
469
|
+
"@@index"
|
|
470
|
+
].includes(attrName);
|
|
471
|
+
}
|
|
472
|
+
/**
|
|
473
|
+
* Retrieve the document in which the given AST node is contained. A reference to the document is
|
|
474
|
+
* usually held by the root node of the AST.
|
|
475
|
+
*
|
|
476
|
+
* @throws an error if the node is not contained in a document.
|
|
477
|
+
*/
|
|
478
|
+
function getDocument(node) {
|
|
479
|
+
const result = findRootNode(node).$document;
|
|
480
|
+
if (!result) throw new Error("AST node has no document.");
|
|
481
|
+
return result;
|
|
482
|
+
}
|
|
483
|
+
/**
|
|
484
|
+
* Gets the list of plugin documents from the given model.
|
|
485
|
+
*/
|
|
486
|
+
function getPluginDocuments(model, schemaPath) {
|
|
487
|
+
const result = [];
|
|
488
|
+
for (const decl of model.declarations.filter(require_ast.isPlugin)) {
|
|
489
|
+
const providerField = decl.fields.find((f) => f.name === "provider");
|
|
490
|
+
if (!providerField) continue;
|
|
491
|
+
const provider = getLiteral(providerField.value);
|
|
492
|
+
if (!provider) continue;
|
|
493
|
+
let pluginModelFile;
|
|
494
|
+
let providerPath = node_path.default.resolve(node_path.default.dirname(schemaPath), provider);
|
|
495
|
+
if (node_fs.default.existsSync(providerPath)) {
|
|
496
|
+
if (node_fs.default.statSync(providerPath).isDirectory()) providerPath = node_path.default.join(providerPath, "index.js");
|
|
497
|
+
pluginModelFile = node_path.default.resolve(node_path.default.dirname(providerPath), PLUGIN_MODULE_NAME);
|
|
498
|
+
if (!node_fs.default.existsSync(pluginModelFile)) pluginModelFile = findUp([PLUGIN_MODULE_NAME], node_path.default.dirname(providerPath));
|
|
499
|
+
}
|
|
500
|
+
if (!pluginModelFile) {
|
|
501
|
+
if (typeof {}.resolve === "function") try {
|
|
502
|
+
pluginModelFile = (0, node_url.fileURLToPath)({}.resolve(`${provider}/${PLUGIN_MODULE_NAME}`));
|
|
503
|
+
} catch {}
|
|
504
|
+
}
|
|
505
|
+
if (!pluginModelFile) try {
|
|
506
|
+
pluginModelFile = (0, node_module.createRequire)((0, node_url.pathToFileURL)(schemaPath)).resolve(`${provider}/${PLUGIN_MODULE_NAME}`);
|
|
507
|
+
} catch {}
|
|
508
|
+
if (pluginModelFile && node_fs.default.existsSync(pluginModelFile)) result.push(pluginModelFile);
|
|
509
|
+
}
|
|
510
|
+
return result;
|
|
511
|
+
}
|
|
512
|
+
function findUp(names, cwd = process.cwd(), multiple = false, result = []) {
|
|
513
|
+
if (!names.some((name) => !!name)) return;
|
|
514
|
+
const target = names.find((name) => node_fs.default.existsSync(node_path.default.join(cwd, name)));
|
|
515
|
+
if (multiple === false && target) return node_path.default.join(cwd, target);
|
|
516
|
+
if (target) result.push(node_path.default.join(cwd, target));
|
|
517
|
+
const up = node_path.default.resolve(cwd, "..");
|
|
518
|
+
if (up === cwd) return multiple && result.length > 0 ? result : void 0;
|
|
519
|
+
return findUp(names, up, multiple, result);
|
|
520
|
+
}
|
|
521
|
+
/**
|
|
522
|
+
* Returns the root node of the given AST node by following the `$container` references.
|
|
523
|
+
*/
|
|
524
|
+
function findRootNode(node) {
|
|
525
|
+
while (node.$container) node = node.$container;
|
|
526
|
+
return node;
|
|
527
|
+
}
|
|
528
|
+
//#endregion
|
|
529
|
+
Object.defineProperty(exports, "DB_PROVIDERS_SUPPORTING_LIST_TYPE", {
|
|
530
|
+
enumerable: true,
|
|
531
|
+
get: function() {
|
|
532
|
+
return DB_PROVIDERS_SUPPORTING_LIST_TYPE;
|
|
533
|
+
}
|
|
534
|
+
});
|
|
535
|
+
Object.defineProperty(exports, "ExpressionContext", {
|
|
536
|
+
enumerable: true,
|
|
537
|
+
get: function() {
|
|
538
|
+
return ExpressionContext;
|
|
539
|
+
}
|
|
540
|
+
});
|
|
541
|
+
Object.defineProperty(exports, "IssueCodes", {
|
|
542
|
+
enumerable: true,
|
|
543
|
+
get: function() {
|
|
544
|
+
return IssueCodes;
|
|
545
|
+
}
|
|
546
|
+
});
|
|
547
|
+
Object.defineProperty(exports, "PLUGIN_MODULE_NAME", {
|
|
548
|
+
enumerable: true,
|
|
549
|
+
get: function() {
|
|
550
|
+
return PLUGIN_MODULE_NAME;
|
|
551
|
+
}
|
|
552
|
+
});
|
|
553
|
+
Object.defineProperty(exports, "SCALAR_TYPES", {
|
|
554
|
+
enumerable: true,
|
|
555
|
+
get: function() {
|
|
556
|
+
return SCALAR_TYPES;
|
|
557
|
+
}
|
|
558
|
+
});
|
|
559
|
+
Object.defineProperty(exports, "STD_LIB_MODULE_NAME", {
|
|
560
|
+
enumerable: true,
|
|
561
|
+
get: function() {
|
|
562
|
+
return STD_LIB_MODULE_NAME;
|
|
563
|
+
}
|
|
564
|
+
});
|
|
565
|
+
Object.defineProperty(exports, "SUPPORTED_PROVIDERS", {
|
|
566
|
+
enumerable: true,
|
|
567
|
+
get: function() {
|
|
568
|
+
return SUPPORTED_PROVIDERS;
|
|
569
|
+
}
|
|
570
|
+
});
|
|
571
|
+
Object.defineProperty(exports, "findRootNode", {
|
|
572
|
+
enumerable: true,
|
|
573
|
+
get: function() {
|
|
574
|
+
return findRootNode;
|
|
575
|
+
}
|
|
576
|
+
});
|
|
577
|
+
Object.defineProperty(exports, "findUpAst", {
|
|
578
|
+
enumerable: true,
|
|
579
|
+
get: function() {
|
|
580
|
+
return findUpAst;
|
|
581
|
+
}
|
|
582
|
+
});
|
|
583
|
+
Object.defineProperty(exports, "getAllAttributes", {
|
|
584
|
+
enumerable: true,
|
|
585
|
+
get: function() {
|
|
586
|
+
return getAllAttributes;
|
|
587
|
+
}
|
|
588
|
+
});
|
|
589
|
+
Object.defineProperty(exports, "getAllDataModelsIncludingImports", {
|
|
590
|
+
enumerable: true,
|
|
591
|
+
get: function() {
|
|
592
|
+
return getAllDataModelsIncludingImports;
|
|
593
|
+
}
|
|
594
|
+
});
|
|
595
|
+
Object.defineProperty(exports, "getAllDeclarationsIncludingImports", {
|
|
596
|
+
enumerable: true,
|
|
597
|
+
get: function() {
|
|
598
|
+
return getAllDeclarationsIncludingImports;
|
|
599
|
+
}
|
|
600
|
+
});
|
|
601
|
+
Object.defineProperty(exports, "getAllFields", {
|
|
602
|
+
enumerable: true,
|
|
603
|
+
get: function() {
|
|
604
|
+
return getAllFields;
|
|
605
|
+
}
|
|
606
|
+
});
|
|
607
|
+
Object.defineProperty(exports, "getAllLoadedAndReachableDataModelsAndTypeDefs", {
|
|
608
|
+
enumerable: true,
|
|
609
|
+
get: function() {
|
|
610
|
+
return getAllLoadedAndReachableDataModelsAndTypeDefs;
|
|
611
|
+
}
|
|
612
|
+
});
|
|
613
|
+
Object.defineProperty(exports, "getAllLoadedDataModelsAndTypeDefs", {
|
|
614
|
+
enumerable: true,
|
|
615
|
+
get: function() {
|
|
616
|
+
return getAllLoadedDataModelsAndTypeDefs;
|
|
617
|
+
}
|
|
618
|
+
});
|
|
619
|
+
Object.defineProperty(exports, "getAttribute", {
|
|
620
|
+
enumerable: true,
|
|
621
|
+
get: function() {
|
|
622
|
+
return getAttribute;
|
|
623
|
+
}
|
|
624
|
+
});
|
|
625
|
+
Object.defineProperty(exports, "getAttributeArg", {
|
|
626
|
+
enumerable: true,
|
|
627
|
+
get: function() {
|
|
628
|
+
return getAttributeArg;
|
|
629
|
+
}
|
|
630
|
+
});
|
|
631
|
+
Object.defineProperty(exports, "getAttributeArgLiteral", {
|
|
632
|
+
enumerable: true,
|
|
633
|
+
get: function() {
|
|
634
|
+
return getAttributeArgLiteral;
|
|
635
|
+
}
|
|
636
|
+
});
|
|
637
|
+
Object.defineProperty(exports, "getAuthDecl", {
|
|
638
|
+
enumerable: true,
|
|
639
|
+
get: function() {
|
|
640
|
+
return getAuthDecl;
|
|
641
|
+
}
|
|
642
|
+
});
|
|
643
|
+
Object.defineProperty(exports, "getContainingDataModel", {
|
|
644
|
+
enumerable: true,
|
|
645
|
+
get: function() {
|
|
646
|
+
return getContainingDataModel;
|
|
647
|
+
}
|
|
648
|
+
});
|
|
649
|
+
Object.defineProperty(exports, "getDataModelAndTypeDefs", {
|
|
650
|
+
enumerable: true,
|
|
651
|
+
get: function() {
|
|
652
|
+
return getDataModelAndTypeDefs;
|
|
653
|
+
}
|
|
654
|
+
});
|
|
655
|
+
Object.defineProperty(exports, "getDocument", {
|
|
656
|
+
enumerable: true,
|
|
657
|
+
get: function() {
|
|
658
|
+
return getDocument;
|
|
659
|
+
}
|
|
660
|
+
});
|
|
661
|
+
Object.defineProperty(exports, "getFieldReference", {
|
|
662
|
+
enumerable: true,
|
|
663
|
+
get: function() {
|
|
664
|
+
return getFieldReference;
|
|
665
|
+
}
|
|
666
|
+
});
|
|
667
|
+
Object.defineProperty(exports, "getFunctionExpressionContext", {
|
|
668
|
+
enumerable: true,
|
|
669
|
+
get: function() {
|
|
670
|
+
return getFunctionExpressionContext;
|
|
671
|
+
}
|
|
672
|
+
});
|
|
673
|
+
Object.defineProperty(exports, "getLiteral", {
|
|
674
|
+
enumerable: true,
|
|
675
|
+
get: function() {
|
|
676
|
+
return getLiteral;
|
|
677
|
+
}
|
|
678
|
+
});
|
|
679
|
+
Object.defineProperty(exports, "getLiteralArray", {
|
|
680
|
+
enumerable: true,
|
|
681
|
+
get: function() {
|
|
682
|
+
return getLiteralArray;
|
|
683
|
+
}
|
|
684
|
+
});
|
|
685
|
+
Object.defineProperty(exports, "getModelIdFields", {
|
|
686
|
+
enumerable: true,
|
|
687
|
+
get: function() {
|
|
688
|
+
return getModelIdFields;
|
|
689
|
+
}
|
|
690
|
+
});
|
|
691
|
+
Object.defineProperty(exports, "getModelUniqueFields", {
|
|
692
|
+
enumerable: true,
|
|
693
|
+
get: function() {
|
|
694
|
+
return getModelUniqueFields;
|
|
695
|
+
}
|
|
696
|
+
});
|
|
697
|
+
Object.defineProperty(exports, "getObjectLiteral", {
|
|
698
|
+
enumerable: true,
|
|
699
|
+
get: function() {
|
|
700
|
+
return getObjectLiteral;
|
|
701
|
+
}
|
|
702
|
+
});
|
|
703
|
+
Object.defineProperty(exports, "getPluginDocuments", {
|
|
704
|
+
enumerable: true,
|
|
705
|
+
get: function() {
|
|
706
|
+
return getPluginDocuments;
|
|
707
|
+
}
|
|
708
|
+
});
|
|
709
|
+
Object.defineProperty(exports, "getRecursiveBases", {
|
|
710
|
+
enumerable: true,
|
|
711
|
+
get: function() {
|
|
712
|
+
return getRecursiveBases;
|
|
713
|
+
}
|
|
714
|
+
});
|
|
715
|
+
Object.defineProperty(exports, "getStringLiteral", {
|
|
716
|
+
enumerable: true,
|
|
717
|
+
get: function() {
|
|
718
|
+
return getStringLiteral;
|
|
719
|
+
}
|
|
720
|
+
});
|
|
721
|
+
Object.defineProperty(exports, "getUniqueFields", {
|
|
722
|
+
enumerable: true,
|
|
723
|
+
get: function() {
|
|
724
|
+
return getUniqueFields;
|
|
725
|
+
}
|
|
726
|
+
});
|
|
727
|
+
Object.defineProperty(exports, "hasAttribute", {
|
|
728
|
+
enumerable: true,
|
|
729
|
+
get: function() {
|
|
730
|
+
return hasAttribute;
|
|
731
|
+
}
|
|
732
|
+
});
|
|
733
|
+
Object.defineProperty(exports, "isAuthInvocation", {
|
|
734
|
+
enumerable: true,
|
|
735
|
+
get: function() {
|
|
736
|
+
return isAuthInvocation;
|
|
737
|
+
}
|
|
738
|
+
});
|
|
739
|
+
Object.defineProperty(exports, "isAuthOrAuthMemberAccess", {
|
|
740
|
+
enumerable: true,
|
|
741
|
+
get: function() {
|
|
742
|
+
return isAuthOrAuthMemberAccess;
|
|
743
|
+
}
|
|
744
|
+
});
|
|
745
|
+
Object.defineProperty(exports, "isBeforeInvocation", {
|
|
746
|
+
enumerable: true,
|
|
747
|
+
get: function() {
|
|
748
|
+
return isBeforeInvocation;
|
|
749
|
+
}
|
|
750
|
+
});
|
|
751
|
+
Object.defineProperty(exports, "isCheckInvocation", {
|
|
752
|
+
enumerable: true,
|
|
753
|
+
get: function() {
|
|
754
|
+
return isCheckInvocation;
|
|
755
|
+
}
|
|
756
|
+
});
|
|
757
|
+
Object.defineProperty(exports, "isCollectionPredicate", {
|
|
758
|
+
enumerable: true,
|
|
759
|
+
get: function() {
|
|
760
|
+
return isCollectionPredicate;
|
|
761
|
+
}
|
|
762
|
+
});
|
|
763
|
+
Object.defineProperty(exports, "isComputedField", {
|
|
764
|
+
enumerable: true,
|
|
765
|
+
get: function() {
|
|
766
|
+
return isComputedField;
|
|
767
|
+
}
|
|
768
|
+
});
|
|
769
|
+
Object.defineProperty(exports, "isDataFieldReference", {
|
|
770
|
+
enumerable: true,
|
|
771
|
+
get: function() {
|
|
772
|
+
return isDataFieldReference;
|
|
773
|
+
}
|
|
774
|
+
});
|
|
775
|
+
Object.defineProperty(exports, "isDelegateModel", {
|
|
776
|
+
enumerable: true,
|
|
777
|
+
get: function() {
|
|
778
|
+
return isDelegateModel;
|
|
779
|
+
}
|
|
780
|
+
});
|
|
781
|
+
Object.defineProperty(exports, "isEnumFieldReference", {
|
|
782
|
+
enumerable: true,
|
|
783
|
+
get: function() {
|
|
784
|
+
return isEnumFieldReference;
|
|
785
|
+
}
|
|
786
|
+
});
|
|
787
|
+
Object.defineProperty(exports, "isFromStdlib", {
|
|
788
|
+
enumerable: true,
|
|
789
|
+
get: function() {
|
|
790
|
+
return isFromStdlib;
|
|
791
|
+
}
|
|
792
|
+
});
|
|
793
|
+
Object.defineProperty(exports, "isMemberContainer", {
|
|
794
|
+
enumerable: true,
|
|
795
|
+
get: function() {
|
|
796
|
+
return isMemberContainer;
|
|
797
|
+
}
|
|
798
|
+
});
|
|
799
|
+
Object.defineProperty(exports, "isRelationshipField", {
|
|
800
|
+
enumerable: true,
|
|
801
|
+
get: function() {
|
|
802
|
+
return isRelationshipField;
|
|
803
|
+
}
|
|
804
|
+
});
|
|
805
|
+
Object.defineProperty(exports, "mapBuiltinTypeToExpressionType", {
|
|
806
|
+
enumerable: true,
|
|
807
|
+
get: function() {
|
|
808
|
+
return mapBuiltinTypeToExpressionType;
|
|
809
|
+
}
|
|
810
|
+
});
|
|
811
|
+
Object.defineProperty(exports, "resolveImport", {
|
|
812
|
+
enumerable: true,
|
|
813
|
+
get: function() {
|
|
814
|
+
return resolveImport;
|
|
815
|
+
}
|
|
816
|
+
});
|
|
817
|
+
Object.defineProperty(exports, "resolveImportUri", {
|
|
818
|
+
enumerable: true,
|
|
819
|
+
get: function() {
|
|
820
|
+
return resolveImportUri;
|
|
821
|
+
}
|
|
822
|
+
});
|
|
823
|
+
Object.defineProperty(exports, "resolveTransitiveImports", {
|
|
824
|
+
enumerable: true,
|
|
825
|
+
get: function() {
|
|
826
|
+
return resolveTransitiveImports;
|
|
827
|
+
}
|
|
828
|
+
});
|
|
829
|
+
Object.defineProperty(exports, "resolved", {
|
|
830
|
+
enumerable: true,
|
|
831
|
+
get: function() {
|
|
832
|
+
return resolved;
|
|
833
|
+
}
|
|
834
|
+
});
|
|
835
|
+
Object.defineProperty(exports, "typeAssignable", {
|
|
836
|
+
enumerable: true,
|
|
837
|
+
get: function() {
|
|
838
|
+
return typeAssignable;
|
|
839
|
+
}
|
|
840
|
+
});
|
|
841
|
+
|
|
842
|
+
//# sourceMappingURL=utils-CfXGZkv7.cjs.map
|