@zenstackhq/sdk 3.0.0-beta.7 → 3.0.0-beta.8
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 +3 -7
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1 -2
- package/dist/index.d.ts +1 -2
- package/dist/index.js +5 -9
- package/dist/index.js.map +1 -1
- package/package.json +5 -5
package/dist/index.cjs
CHANGED
|
@@ -671,7 +671,7 @@ var PrismaSchemaGenerator = class {
|
|
|
671
671
|
(0, import_ast2.isTypeDef)(field.type.reference?.ref) ? false : field.type.array
|
|
672
672
|
);
|
|
673
673
|
const type = new ModelFieldType(fieldType, isArray, field.type.optional);
|
|
674
|
-
const attributes = field.attributes.filter((attr) => this.isPrismaAttribute(attr)).filter((attr) => !this.
|
|
674
|
+
const attributes = field.attributes.filter((attr) => this.isPrismaAttribute(attr)).filter((attr) => !this.isDefaultWithAuthInvocation(attr)).filter((attr) => (
|
|
675
675
|
// when building physical schema, exclude `@default` for id fields inherited from delegate base
|
|
676
676
|
!(model_utils_exports.isIdField(field, contextModel) && this.isInheritedFromDelegate(field, contextModel) && attr.decl.$refText === "@default")
|
|
677
677
|
)).map((attr) => this.makeFieldAttribute(attr));
|
|
@@ -681,7 +681,7 @@ var PrismaSchemaGenerator = class {
|
|
|
681
681
|
const result = model.addField(field.name, type, attributes, docs, addToFront);
|
|
682
682
|
return result;
|
|
683
683
|
}
|
|
684
|
-
|
|
684
|
+
isDefaultWithAuthInvocation(attr) {
|
|
685
685
|
if (attr.decl.ref?.name !== "@default") {
|
|
686
686
|
return false;
|
|
687
687
|
}
|
|
@@ -689,11 +689,7 @@ var PrismaSchemaGenerator = class {
|
|
|
689
689
|
if (!expr) {
|
|
690
690
|
return false;
|
|
691
691
|
}
|
|
692
|
-
return import_langium.AstUtils.streamAst(expr).some(
|
|
693
|
-
}
|
|
694
|
-
isFromPlugin(node) {
|
|
695
|
-
const model = import_langium.AstUtils.getContainerOfType(node, import_ast2.isModel);
|
|
696
|
-
return !!model && !!model.$document && model.$document.uri.path.endsWith("plugin.zmodel");
|
|
692
|
+
return import_langium.AstUtils.streamAst(expr).some(import_utils2.isAuthInvocation);
|
|
697
693
|
}
|
|
698
694
|
isInheritedFromDelegate(field, contextModel) {
|
|
699
695
|
return field.$container !== contextModel && model_utils_exports.isDelegateModel(field.$container);
|