@zenstackhq/plugin-policy 3.4.0-beta.3 → 3.4.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/index.js CHANGED
@@ -502,7 +502,7 @@ var ExpressionTransformer = class {
502
502
  const predicateResult = match2(expr2.op).with("?", () => BinaryOperationNode2.create(count, OperatorNode2.create(">"), ValueNode2.createImmediate(0))).with("!", () => BinaryOperationNode2.create(count, OperatorNode2.create("="), ValueNode2.createImmediate(0))).with("^", () => BinaryOperationNode2.create(count, OperatorNode2.create("="), ValueNode2.createImmediate(0))).exhaustive();
503
503
  return this.transform(expr2.left, {
504
504
  ...context,
505
- memberSelect: SelectionNode.create(AliasNode2.create(predicateResult, IdentifierNode.create("$t"))),
505
+ memberSelect: SelectionNode.create(AliasNode2.create(predicateResult, IdentifierNode.create("_"))),
506
506
  memberFilter: predicateFilter
507
507
  });
508
508
  }
@@ -775,7 +775,7 @@ var ExpressionTransformer = class {
775
775
  return {
776
776
  ...receiver,
777
777
  selections: [
778
- SelectionNode.create(AliasNode2.create(currNode, IdentifierNode.create("$t")))
778
+ SelectionNode.create(AliasNode2.create(currNode, IdentifierNode.create("_")))
779
779
  ]
780
780
  };
781
781
  }
@@ -1378,7 +1378,7 @@ var PolicyHandler = class extends OperationNodeTransformer {
1378
1378
  SelectionNode2.create(SelectAllNode.create())
1379
1379
  ];
1380
1380
  }
1381
- const modelPolicyFilter = this.buildPolicyFilter(model, alias, operation);
1381
+ const modelPolicyFilter = this.buildPolicyFilter(model, model, operation);
1382
1382
  if (!isTrueNode(modelPolicyFilter)) {
1383
1383
  hasPolicies = true;
1384
1384
  }
@@ -1484,9 +1484,9 @@ var PolicyHandler = class extends OperationNodeTransformer {
1484
1484
  invariant3(bValue !== null && bValue !== void 0, "B value cannot be null or undefined");
1485
1485
  const eb = expressionBuilder2();
1486
1486
  const filterA = this.buildPolicyFilter(m2m.firstModel, void 0, "update");
1487
- const queryA = eb.selectFrom(m2m.firstModel).where(eb(eb.ref(`${m2m.firstModel}.${m2m.firstIdField}`), "=", aValue)).select(() => new ExpressionWrapper2(filterA).as("$t"));
1487
+ const queryA = eb.selectFrom(m2m.firstModel).where(eb(eb.ref(`${m2m.firstModel}.${m2m.firstIdField}`), "=", aValue)).select(() => new ExpressionWrapper2(filterA).as("_"));
1488
1488
  const filterB = this.buildPolicyFilter(m2m.secondModel, void 0, "update");
1489
- const queryB = eb.selectFrom(m2m.secondModel).where(eb(eb.ref(`${m2m.secondModel}.${m2m.secondIdField}`), "=", bValue)).select(() => new ExpressionWrapper2(filterB).as("$t"));
1489
+ const queryB = eb.selectFrom(m2m.secondModel).where(eb(eb.ref(`${m2m.secondModel}.${m2m.secondIdField}`), "=", bValue)).select(() => new ExpressionWrapper2(filterB).as("_"));
1490
1490
  const queryNode = {
1491
1491
  kind: "SelectQueryNode",
1492
1492
  selections: [