@zenstackhq/sdk 3.0.0-beta.4 → 3.0.0-beta.6
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 +5 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +5 -2
- package/dist/index.js.map +1 -1
- package/dist/schema.d.cts +1 -0
- package/dist/schema.d.ts +1 -0
- package/package.json +5 -5
package/dist/index.js
CHANGED
|
@@ -907,6 +907,9 @@ var TsSchemaGenerator = class {
|
|
|
907
907
|
// subModels
|
|
908
908
|
...subModels.length > 0 ? [
|
|
909
909
|
ts.factory.createPropertyAssignment("subModels", ts.factory.createArrayLiteralExpression(subModels.map((subModel) => ts.factory.createStringLiteral(subModel))))
|
|
910
|
+
] : [],
|
|
911
|
+
...dm.isView ? [
|
|
912
|
+
ts.factory.createPropertyAssignment("isView", ts.factory.createTrue())
|
|
910
913
|
] : []
|
|
911
914
|
];
|
|
912
915
|
const computedFields = dm.fields.filter((f) => hasAttribute(f, "@computed"));
|
|
@@ -935,9 +938,9 @@ var TsSchemaGenerator = class {
|
|
|
935
938
|
}
|
|
936
939
|
createComputedFieldsObject(fields) {
|
|
937
940
|
return ts.factory.createObjectLiteralExpression(fields.map((field) => ts.factory.createMethodDeclaration(void 0, void 0, field.name, void 0, void 0, [
|
|
938
|
-
// parameter: `context: {
|
|
941
|
+
// parameter: `context: { modelAlias: string }`
|
|
939
942
|
ts.factory.createParameterDeclaration(void 0, void 0, "_context", void 0, ts.factory.createTypeLiteralNode([
|
|
940
|
-
ts.factory.createPropertySignature(void 0, "
|
|
943
|
+
ts.factory.createPropertySignature(void 0, "modelAlias", void 0, ts.factory.createKeywordTypeNode(ts.SyntaxKind.StringKeyword))
|
|
941
944
|
]), void 0)
|
|
942
945
|
], ts.factory.createTypeReferenceNode("OperandExpression", [
|
|
943
946
|
ts.factory.createTypeReferenceNode(this.mapFieldTypeToTSType(field.type))
|