@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.cjs CHANGED
@@ -958,7 +958,12 @@ var TsSchemaGenerator = class {
958
958
  return ts.factory.createObjectLiteralExpression(fields, true);
959
959
  }
960
960
  createComputedFieldsObject(fields) {
961
- return ts.factory.createObjectLiteralExpression(fields.map((field) => ts.factory.createMethodDeclaration(void 0, void 0, field.name, void 0, void 0, [], ts.factory.createTypeReferenceNode("OperandExpression", [
961
+ return ts.factory.createObjectLiteralExpression(fields.map((field) => ts.factory.createMethodDeclaration(void 0, void 0, field.name, void 0, void 0, [
962
+ // parameter: `context: { currentModel: string }`
963
+ ts.factory.createParameterDeclaration(void 0, void 0, "_context", void 0, ts.factory.createTypeLiteralNode([
964
+ ts.factory.createPropertySignature(void 0, "currentModel", void 0, ts.factory.createKeywordTypeNode(ts.SyntaxKind.StringKeyword))
965
+ ]), void 0)
966
+ ], ts.factory.createTypeReferenceNode("OperandExpression", [
962
967
  ts.factory.createTypeReferenceNode(this.mapFieldTypeToTSType(field.type))
963
968
  ]), ts.factory.createBlock([
964
969
  ts.factory.createThrowStatement(ts.factory.createNewExpression(ts.factory.createIdentifier("Error"), void 0, [