@zenstackhq/sdk 3.0.0-alpha.28 → 3.0.0-alpha.29

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.js CHANGED
@@ -925,7 +925,12 @@ var TsSchemaGenerator = class {
925
925
  return ts.factory.createObjectLiteralExpression(fields, true);
926
926
  }
927
927
  createComputedFieldsObject(fields) {
928
- return ts.factory.createObjectLiteralExpression(fields.map((field) => ts.factory.createMethodDeclaration(void 0, void 0, field.name, void 0, void 0, [], ts.factory.createTypeReferenceNode("OperandExpression", [
928
+ return ts.factory.createObjectLiteralExpression(fields.map((field) => ts.factory.createMethodDeclaration(void 0, void 0, field.name, void 0, void 0, [
929
+ // parameter: `context: { currentModel: string }`
930
+ ts.factory.createParameterDeclaration(void 0, void 0, "_context", void 0, ts.factory.createTypeLiteralNode([
931
+ ts.factory.createPropertySignature(void 0, "currentModel", void 0, ts.factory.createKeywordTypeNode(ts.SyntaxKind.StringKeyword))
932
+ ]), void 0)
933
+ ], ts.factory.createTypeReferenceNode("OperandExpression", [
929
934
  ts.factory.createTypeReferenceNode(this.mapFieldTypeToTSType(field.type))
930
935
  ]), ts.factory.createBlock([
931
936
  ts.factory.createThrowStatement(ts.factory.createNewExpression(ts.factory.createIdentifier("Error"), void 0, [