@loradb/lora-graphql 0.26.1 → 0.26.2

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.
@@ -1,4 +1,4 @@
1
- import { GraphQLError as ve, getNullableType as Zc, isListType as en, Kind as fe, isInputObjectType as Mi, versionInfo as el, getArgumentValues as tl, getDirectiveValues as ai, GraphQLSkipDirective as nl, GraphQLIncludeDirective as sl, isAbstractType as il, isObjectType as tn, isNonNullType as lt, isScalarType as Wt, isEnumType as Lt, getNamedType as He, parse as Ze, GraphQLObjectType as we, GraphQLNonNull as We, GraphQLInt as me, GraphQLList as ji, GraphQLInputObjectType as Ae, GraphQLBoolean as $t, GraphQLFloat as Ne, visit as Br, valueFromASTUntyped as ol, validate as Ss, specifiedRules as Li, typeFromAST as rl, printSchema as qr, lexicographicSortSchema as Wr, isInterfaceType as ut, isUnionType as Rs, GraphQLSchema as Hr, ValidationContext as al, valueFromAST as cl, buildASTSchema as ll, concatAST as ul, getOperationAST as vn, GraphQLScalarType as ns, GraphQLEnumType as Sn, GraphQLString as _e, GraphQLInterfaceType as ci, GraphQLID as Rn, GraphQLUnionType as dl, validateSchema as fl, execute as ho, getVariableValues as pl, subscribe as hl } from "graphql";
1
+ import { GraphQLError as ve, getNullableType as Zc, isListType as en, Kind as fe, isInputObjectType as Mi, versionInfo as el, getArgumentValues as tl, getDirectiveValues as ai, GraphQLSkipDirective as nl, GraphQLIncludeDirective as sl, isAbstractType as il, isObjectType as tn, isNonNullType as lt, isScalarType as Wt, isEnumType as Lt, getNamedType as He, parse as Ze, GraphQLObjectType as we, GraphQLNonNull as We, GraphQLInt as he, GraphQLList as ji, GraphQLInputObjectType as Ae, GraphQLBoolean as $t, GraphQLFloat as Ne, visit as Br, valueFromASTUntyped as ol, validate as Ss, specifiedRules as Li, typeFromAST as rl, printSchema as qr, lexicographicSortSchema as Wr, isInterfaceType as ut, isUnionType as Rs, GraphQLSchema as Hr, ValidationContext as al, valueFromAST as cl, buildASTSchema as ll, concatAST as ul, getOperationAST as vn, GraphQLScalarType as ns, GraphQLEnumType as Sn, GraphQLString as _e, GraphQLInterfaceType as ci, GraphQLID as Rn, GraphQLUnionType as dl, validateSchema as fl, execute as ho, getVariableValues as pl, subscribe as hl } from "graphql";
2
2
  const Te = {
3
3
  /** `PENDING`, `CLAIMED`, `DONE` or `FAILED`. */
4
4
  state: "_outbox",
@@ -253,14 +253,14 @@ function li(e, t, n) {
253
253
  const i = e.labelsOrTypes, s = e.properties;
254
254
  return e.entityType === "NODE" && i?.length === 1 && i[0] === t && s?.length === 1 && s[0] === n;
255
255
  }
256
- const _ = (e) => ({ kind: "var", name: e }), $l = (e) => ({ kind: "param", name: e }), G = (e) => ({
256
+ const U = (e) => ({ kind: "var", name: e }), $l = (e) => ({ kind: "param", name: e }), G = (e) => ({
257
257
  kind: "literal",
258
258
  value: e
259
- }), ae = (e, t) => ({
259
+ }), ue = (e, t) => ({
260
260
  kind: "prop",
261
261
  target: e,
262
262
  key: t
263
- }), ee = (e, t, n) => ({
263
+ }), se = (e, t, n) => ({
264
264
  kind: "binary",
265
265
  op: e,
266
266
  left: t,
@@ -269,7 +269,7 @@ const _ = (e) => ({ kind: "var", name: e }), $l = (e) => ({ kind: "param", name:
269
269
  kind: "isNull",
270
270
  expr: e,
271
271
  negated: t
272
- }), oe = (e, ...t) => ({
272
+ }), ee = (e, ...t) => ({
273
273
  kind: "call",
274
274
  fn: e,
275
275
  args: t
@@ -283,7 +283,7 @@ function nn(...e) {
283
283
  function Gr(e, t) {
284
284
  const n = t.filter((i) => i !== void 0);
285
285
  if (n.length !== 0)
286
- return n.reduce((i, s) => ee(e, i, s));
286
+ return n.reduce((i, s) => se(e, i, s));
287
287
  }
288
288
  const Tl = /^[A-Za-z_][A-Za-z0-9_]*$/, Al = new Set(
289
289
  [
@@ -836,7 +836,7 @@ function B(e, t) {
836
836
  const n = `p${Object.keys(e.params).length}`;
837
837
  return e.params[n] = t, $l(n);
838
838
  }
839
- function he(e, t) {
839
+ function ye(e, t) {
840
840
  let n = t;
841
841
  for (let i = 1; e.vars.has(n); i++) n = `${t}${i}`;
842
842
  return e.vars.add(n), n;
@@ -887,12 +887,12 @@ function Tt(e, t) {
887
887
  }
888
888
  function Cs(e, t, n, i = {}) {
889
889
  if (t === "shortestLength" || t === "longestLength" || t === "averageLength") {
890
- const u = he(e, "agg_s"), d = {
890
+ const u = ye(e, "agg_s"), d = {
891
891
  kind: "listComprehension",
892
892
  variable: u,
893
893
  list: n,
894
- where: ct(_(u), !0),
895
- projection: oe("size", _(u))
894
+ where: ct(U(u), !0),
895
+ projection: ee("size", U(u))
896
896
  };
897
897
  return Cs(e, {
898
898
  shortestLength: "min",
@@ -900,13 +900,13 @@ function Cs(e, t, n, i = {}) {
900
900
  averageLength: "avg"
901
901
  }[t], d);
902
902
  }
903
- const s = he(e, "agg_v"), o = {
903
+ const s = ye(e, "agg_v"), o = {
904
904
  kind: "listComprehension",
905
905
  variable: s,
906
906
  list: n,
907
- where: ct(_(s), !0),
907
+ where: ct(U(s), !0),
908
908
  projection: void 0
909
- }, r = he(e, "agg_acc"), a = he(e, "agg_item"), c = (u, d) => ({
909
+ }, r = ye(e, "agg_acc"), a = ye(e, "agg_item"), c = (u, d) => ({
910
910
  kind: "reduce",
911
911
  accumulator: r,
912
912
  init: u,
@@ -916,7 +916,7 @@ function Cs(e, t, n, i = {}) {
916
916
  });
917
917
  switch (t) {
918
918
  case "count":
919
- return oe("size", o);
919
+ return ee("size", o);
920
920
  case "min":
921
921
  case "max":
922
922
  return c(G(null), {
@@ -924,11 +924,11 @@ function Cs(e, t, n, i = {}) {
924
924
  when: {
925
925
  kind: "binary",
926
926
  op: "OR",
927
- left: ct(_(r)),
928
- right: ee(t === "min" ? "<" : ">", _(a), _(r))
927
+ left: ct(U(r)),
928
+ right: se(t === "min" ? "<" : ">", U(a), U(r))
929
929
  },
930
- then: _(a),
931
- else: _(r)
930
+ then: U(a),
931
+ else: U(r)
932
932
  });
933
933
  case "shortest":
934
934
  case "longest":
@@ -937,54 +937,41 @@ function Cs(e, t, n, i = {}) {
937
937
  when: {
938
938
  kind: "binary",
939
939
  op: "OR",
940
- left: ct(_(r)),
941
- right: ee(
940
+ left: ct(U(r)),
941
+ right: se(
942
942
  t === "shortest" ? "<" : ">",
943
- oe("size", _(a)),
944
- oe("size", _(r))
943
+ ee("size", U(a)),
944
+ ee("size", U(r))
945
945
  )
946
946
  },
947
- then: _(a),
948
- else: _(r)
947
+ then: U(a),
948
+ else: U(r)
949
949
  });
950
950
  case "sum":
951
- return i.duration ? l() : c(G(0), ee("+", _(r), _(a)));
951
+ return i.duration ? l() : c(G(0), se("+", U(r), U(a)));
952
952
  case "avg":
953
953
  return {
954
954
  kind: "case",
955
- when: ee("=", oe("size", o), G(0)),
955
+ when: se("=", ee("size", o), G(0)),
956
956
  then: G(null),
957
- else: ee(
957
+ else: se(
958
958
  "/",
959
- i.duration ? l() : oe("toFloat", c(G(0), ee("+", _(r), _(a)))),
960
- oe("size", o)
959
+ i.duration ? l() : ee("toFloat", c(G(0), se("+", U(r), U(a)))),
960
+ ee("size", o)
961
961
  )
962
962
  };
963
963
  }
964
964
  function l() {
965
965
  return c(G(null), {
966
966
  kind: "case",
967
- when: ct(_(r)),
968
- then: _(a),
969
- else: ee("+", _(r), _(a))
967
+ when: ct(U(r)),
968
+ then: U(a),
969
+ else: se("+", U(r), U(a))
970
970
  });
971
971
  }
972
972
  }
973
- function xi(e, t) {
974
- const n = he(e, "seen"), i = he(e, "seen_key");
975
- return oe("size", {
976
- kind: "reduce",
977
- accumulator: n,
978
- init: { kind: "list", items: [] },
979
- variable: i,
980
- list: t,
981
- step: {
982
- kind: "case",
983
- when: ee("IN", _(i), _(n)),
984
- then: _(n),
985
- else: ee("+", _(n), { kind: "list", items: [_(i)] })
986
- }
987
- });
973
+ function xi(e) {
974
+ return ee("size", ee("list.unique", e));
988
975
  }
989
976
  const ta = 2, Pl = 1e3, xl = 1e4, Fl = /* @__PURE__ */ new Set(["eq", "in", "startsWith", "withinBBox", "distance"]), zl = /* @__PURE__ */ new Set(["lt", "lte", "gt", "gte"]);
990
977
  function Bl(e, t, n) {
@@ -1139,7 +1126,7 @@ function ia(e, t, n) {
1139
1126
  return (r) => {
1140
1127
  const a = is(
1141
1128
  e,
1142
- aa(e, t, s, n, ae(_(n), s.property)),
1129
+ aa(e, t, s, n, ue(U(n), s.property)),
1143
1130
  r
1144
1131
  );
1145
1132
  return a && yn(o, a);
@@ -1163,7 +1150,7 @@ function ia(e, t, n) {
1163
1150
  );
1164
1151
  const r = je(e, t, s, n, "READ");
1165
1152
  return (a) => {
1166
- const c = is(e, _(o), a);
1153
+ const c = is(e, U(o), a);
1167
1154
  return c && yn(r, c);
1168
1155
  };
1169
1156
  }
@@ -1202,7 +1189,7 @@ function ia(e, t, n) {
1202
1189
  };
1203
1190
  }
1204
1191
  function yn(e, t) {
1205
- return e ? pe(oe("coalesce", e, G(!1)), t) : t;
1192
+ return e ? pe(ee("coalesce", e, G(!1)), t) : t;
1206
1193
  }
1207
1194
  function Hs(e, t, n) {
1208
1195
  if (e.inAuth) return n();
@@ -1223,7 +1210,7 @@ function Hs(e, t, n) {
1223
1210
  function Us(e, t, n, i) {
1224
1211
  return Kt(e, i, (s) => {
1225
1212
  const o = t.fields.get(s);
1226
- return o && dn(e, t.name, o, "READ"), o ? (r) => is(e, ae(_(n), o.property), r) : void 0;
1213
+ return o && dn(e, t.name, o, "READ"), o ? (r) => is(e, ue(U(n), o.property), r) : void 0;
1227
1214
  });
1228
1215
  }
1229
1216
  function Kt(e, t, n) {
@@ -1285,7 +1272,7 @@ function is(e, t, n) {
1285
1272
  case "withinBBox": {
1286
1273
  const a = o;
1287
1274
  i.push(
1288
- oe(
1275
+ ee(
1289
1276
  "geo.within_bbox",
1290
1277
  t,
1291
1278
  B(e, $n(a.lowerLeft)),
@@ -1297,34 +1284,34 @@ function is(e, t, n) {
1297
1284
  case "distance": {
1298
1285
  const a = o;
1299
1286
  i.push(
1300
- ee(
1287
+ se(
1301
1288
  "<=",
1302
- oe("geo.distance", t, B(e, $n(a.from))),
1289
+ ee("geo.distance", t, B(e, $n(a.from))),
1303
1290
  B(e, a.lte)
1304
1291
  )
1305
1292
  );
1306
1293
  continue;
1307
1294
  }
1308
1295
  case "includes":
1309
- i.push(ee("IN", B(e, o), t));
1296
+ i.push(se("IN", B(e, o), t));
1310
1297
  continue;
1311
1298
  case "isNull":
1312
1299
  i.push(ct(t, o === !1));
1313
1300
  continue;
1314
1301
  case "caseInsensitive": {
1315
- const a = oe("toLower", t);
1302
+ const a = ee("toLower", t);
1316
1303
  for (const [c, l] of Object.entries(o)) {
1317
1304
  if (l == null) continue;
1318
1305
  const u = ko[c];
1319
1306
  if (!u) continue;
1320
1307
  const d = Array.isArray(l) ? l.map((f) => String(f).toLowerCase()) : String(l).toLowerCase();
1321
- i.push(ee(u, a, B(e, d)));
1308
+ i.push(se(u, a, B(e, d)));
1322
1309
  }
1323
1310
  continue;
1324
1311
  }
1325
1312
  }
1326
1313
  const r = ko[s];
1327
- r && i.push(ee(r, t, B(e, o)));
1314
+ r && i.push(se(r, t, B(e, o)));
1328
1315
  }
1329
1316
  return pe(...i);
1330
1317
  }
@@ -1344,12 +1331,12 @@ function Ut(e, t, n, i, s) {
1344
1331
  };
1345
1332
  }
1346
1333
  function Ft(e, t, n, i, s) {
1347
- const o = e.model.nodes.get(n.target), r = he(e, `${t}_${n.name}`), a = he(e, `${r}_rel`);
1334
+ const o = e.model.nodes.get(n.target), r = ye(e, `${t}_${n.name}`), a = ye(e, `${r}_rel`);
1348
1335
  return {
1349
1336
  kind: "comprehension",
1350
1337
  pattern: Ut(t, n, o.labels[0], r, a),
1351
1338
  // Related nodes the reader may not see do not count, in any quantifier.
1352
- where: pe(ce(e, o, r, "READ"), i(r, a)),
1339
+ where: pe(ae(e, o, r, "READ"), i(r, a)),
1353
1340
  projection: s(r, a)
1354
1341
  };
1355
1342
  }
@@ -1373,12 +1360,12 @@ function pi(e, t, n, i, s) {
1373
1360
  function Kl(e, t, n, i) {
1374
1361
  const s = jl(e.model, n), o = Je(e.model, n).map((f) => {
1375
1362
  const p = e.model.nodes.get(f.target);
1376
- return ge(e, p, "READ"), e.reads.labels.add(p.labels[0]), { field: f, node: p };
1363
+ return me(e, p, "READ"), e.reads.labels.add(p.labels[0]), { field: f, node: p };
1377
1364
  });
1378
1365
  e.reads.relationships.add(n.type);
1379
- const r = (f, p, h) => pi(e, s, f, p, h), a = (f) => f.length === 0 ? G(0) : f.reduce((p, h) => ee("+", p, h)), c = (f) => a(
1366
+ const r = (f, p, h) => pi(e, s, f, p, h), a = (f) => f.length === 0 ? G(0) : f.reduce((p, h) => se("+", p, h)), c = (f) => a(
1380
1367
  o.flatMap(({ field: p, node: h }) => r(h, "probe", f) === !1 ? [] : [
1381
- oe(
1368
+ ee(
1382
1369
  "size",
1383
1370
  Ft(
1384
1371
  e,
@@ -1396,41 +1383,35 @@ function Kl(e, t, n, i) {
1396
1383
  t,
1397
1384
  h,
1398
1385
  (g) => r(m, g, f) || void 0,
1399
- (g) => ({
1400
- kind: "list",
1401
- items: [G(m.name), ae(_(g), m.key.property)]
1402
- })
1386
+ (g) => ee("id", U(g))
1403
1387
  )
1404
1388
  ]);
1405
- return p.length === 0 ? G(0) : xi(
1406
- e,
1407
- p.reduce((h, m) => ee("+", h, m))
1408
- );
1389
+ return p.length === 0 ? G(0) : xi(p.reduce((h, m) => se("+", h, m)));
1409
1390
  }, u = (f) => o.some(({ node: p }) => {
1410
1391
  const h = { ...e, params: {}, vars: new Set(e.vars) };
1411
1392
  return pi(h, s, p, "probe", f) !== void 0;
1412
1393
  });
1413
1394
  if (!n.list)
1414
- return u(i) ? ee(">", c(i), G(0)) : void 0;
1395
+ return u(i) ? se(">", c(i), G(0)) : void 0;
1415
1396
  const d = [];
1416
1397
  for (const [f, p] of Object.entries(i)) {
1417
1398
  if (p == null) continue;
1418
1399
  const h = p;
1419
1400
  switch (f) {
1420
1401
  case "some":
1421
- u(h) && d.push(ee(">", c(h), G(0)));
1402
+ u(h) && d.push(se(">", c(h), G(0)));
1422
1403
  break;
1423
1404
  case "none":
1424
- u(h) && d.push(ee("=", c(h), G(0)));
1405
+ u(h) && d.push(se("=", c(h), G(0)));
1425
1406
  break;
1426
1407
  case "single":
1427
- u(h) && d.push(ee("=", l(h), G(1)));
1408
+ u(h) && d.push(se("=", l(h), G(1)));
1428
1409
  break;
1429
1410
  case "all": {
1430
1411
  if (!u(h)) break;
1431
1412
  const m = a(
1432
1413
  o.map(
1433
- ({ field: g, node: y }) => oe(
1414
+ ({ field: g, node: y }) => ee(
1434
1415
  "size",
1435
1416
  Ft(
1436
1417
  e,
@@ -1439,18 +1420,26 @@ function Kl(e, t, n, i) {
1439
1420
  (E) => {
1440
1421
  const b = r(y, E, h);
1441
1422
  if (b !== !1)
1442
- return b ? un(oe("coalesce", b, G(!1))) : G(!1);
1423
+ return b ? un(ee("coalesce", b, G(!1))) : G(!1);
1443
1424
  },
1444
1425
  () => G(1)
1445
1426
  )
1446
1427
  )
1447
1428
  )
1448
1429
  );
1449
- d.push(ee("=", m, G(0)));
1430
+ d.push(se("=", m, G(0)));
1450
1431
  break;
1451
1432
  }
1452
1433
  case "count":
1453
- d.push(oa(e, n, l(void 0), h));
1434
+ d.push(
1435
+ oa(
1436
+ e,
1437
+ n,
1438
+ () => l(void 0),
1439
+ () => c(void 0),
1440
+ h
1441
+ )
1442
+ );
1454
1443
  break;
1455
1444
  case "aggregate":
1456
1445
  s || d.push(eu(e, t, n, h));
@@ -1462,7 +1451,7 @@ function Kl(e, t, n, i) {
1462
1451
  function Xl(e, t, n, i) {
1463
1452
  const s = Je(e.model, n).map((r) => {
1464
1453
  const a = e.model.nodes.get(r.target);
1465
- return ge(e, a, "READ"), e.reads.labels.add(a.labels[0]), oe(
1454
+ return me(e, a, "READ"), e.reads.labels.add(a.labels[0]), ee(
1466
1455
  "size",
1467
1456
  Ft(
1468
1457
  e,
@@ -1475,32 +1464,32 @@ function Xl(e, t, n, i) {
1475
1464
  );
1476
1465
  });
1477
1466
  e.reads.relationships.add(n.type);
1478
- const o = s.length === 0 ? G(0) : s.reduce((r, a) => ee("+", r, a));
1479
- return ee(i ? ">" : "=", o, G(0));
1467
+ const o = s.length === 0 ? G(0) : s.reduce((r, a) => se("+", r, a));
1468
+ return se(i ? ">" : "=", o, G(0));
1480
1469
  }
1481
- function oa(e, t, n, i) {
1482
- const s = [];
1483
- for (const [o, r] of Object.entries(i)) {
1484
- if (r == null) continue;
1485
- const a = Ql[o];
1486
- if (a) {
1487
- if (!Number.isInteger(r) || r < 0)
1488
- throw M(
1489
- "BAD_USER_INPUT",
1490
- `${t.name}.count.${o} must be a non-negative integer`
1491
- );
1492
- s.push(ee(a, n, B(e, r)));
1493
- }
1470
+ function oa(e, t, n, i, s) {
1471
+ const o = [];
1472
+ for (const [r, a] of Object.entries(s)) {
1473
+ if (a == null) continue;
1474
+ const c = Ql[r];
1475
+ if (!c) continue;
1476
+ if (!Number.isInteger(a) || a < 0)
1477
+ throw M(
1478
+ "BAD_USER_INPUT",
1479
+ `${t.name}.count.${r} must be a non-negative integer`
1480
+ );
1481
+ const l = r === "lt" || r === "gte" ? a <= 1 : a === 0;
1482
+ o.push(se(c, l ? i() : n(), B(e, a)));
1494
1483
  }
1495
- return pe(...s);
1484
+ return pe(...o);
1496
1485
  }
1497
1486
  function Jl(e, t, n, i) {
1498
1487
  const s = e.model.nodes.get(n.target), o = e.model.relationshipProperties.get(n.properties);
1499
- ge(e, s, "READ"), e.reads.labels.add(s.labels[0]), e.reads.relationships.add(n.type);
1488
+ me(e, s, "READ"), e.reads.labels.add(s.labels[0]), e.reads.relationships.add(n.type);
1500
1489
  const r = (l) => (u, d) => pe(
1501
1490
  qe(e, s, u, l.node),
1502
1491
  Us(e, o, d, l.edge)
1503
- ), a = (l, u) => oe(
1492
+ ), a = (l, u) => ee(
1504
1493
  "size",
1505
1494
  Ft(
1506
1495
  e,
@@ -1508,7 +1497,7 @@ function Jl(e, t, n, i) {
1508
1497
  n,
1509
1498
  (d, f) => {
1510
1499
  const p = r(l)(d, f);
1511
- return u ? un(oe("coalesce", p, G(!1))) : p;
1500
+ return u ? un(ee("coalesce", p, G(!1))) : p;
1512
1501
  },
1513
1502
  () => G(1)
1514
1503
  )
@@ -1519,16 +1508,16 @@ function Jl(e, t, n, i) {
1519
1508
  if (Yl(e, s, o, d))
1520
1509
  switch (d.edge != null && da(e, n), l) {
1521
1510
  case "some":
1522
- c.push(ee(">", a(d, !1), G(0)));
1511
+ c.push(se(">", a(d, !1), G(0)));
1523
1512
  break;
1524
1513
  case "none":
1525
- c.push(ee("=", a(d, !1), G(0)));
1514
+ c.push(se("=", a(d, !1), G(0)));
1526
1515
  break;
1527
1516
  case "single":
1528
- c.push(ee("=", a(d, !1), G(1)));
1517
+ c.push(se("=", a(d, !1), G(1)));
1529
1518
  break;
1530
1519
  case "all":
1531
- c.push(ee("=", a(d, !0), G(0)));
1520
+ c.push(se("=", a(d, !0), G(0)));
1532
1521
  break;
1533
1522
  }
1534
1523
  }
@@ -1578,7 +1567,7 @@ function eu(e, t, n, i) {
1578
1567
  n,
1579
1568
  () => {
1580
1569
  },
1581
- (E, b) => ae(_(u ? b : E), p.property)
1570
+ (E, b) => ue(U(u ? b : E), p.property)
1582
1571
  ), y = Cs(e, h, g, {
1583
1572
  duration: p.type === "Duration"
1584
1573
  });
@@ -1595,18 +1584,20 @@ function eu(e, t, n, i) {
1595
1584
  },
1596
1585
  !1
1597
1586
  ), o && (i.edge != null && da(e, n), a(i.edge, (c) => o.fields.get(c), !0)), i.count) {
1598
- const c = xi(
1599
- e,
1600
- Ft(
1587
+ const c = (l) => Ft(e, t, n, () => {
1588
+ }, l);
1589
+ r.push(
1590
+ oa(
1601
1591
  e,
1602
- t,
1603
1592
  n,
1604
- () => {
1605
- },
1606
- (l) => ae(_(l), s.key.property)
1593
+ () => xi(c((l) => ee("id", U(l)))),
1594
+ () => ee(
1595
+ "size",
1596
+ c(() => G(1))
1597
+ ),
1598
+ i.count
1607
1599
  )
1608
1600
  );
1609
- r.push(oa(e, n, c, i.count));
1610
1601
  }
1611
1602
  return pe(...r);
1612
1603
  }
@@ -1626,14 +1617,14 @@ function Ms(e, t) {
1626
1617
  throw n;
1627
1618
  }
1628
1619
  }
1629
- function ge(e, t, n) {
1620
+ function me(e, t, n) {
1630
1621
  if (!e.inAuth && t.authentication?.has(n) && (!e.jwt || !Ms(e, t.authenticationJwt)))
1631
1622
  throw M(
1632
1623
  "UNAUTHENTICATED",
1633
1624
  `${n.toLowerCase()} on ${t.name} needs an authenticated request`
1634
1625
  );
1635
1626
  }
1636
- function ce(e, t, n, i) {
1627
+ function ae(e, t, n, i) {
1637
1628
  if (e.inAuth || Ue(e, t)) return;
1638
1629
  const s = (t.authorization?.filter ?? []).filter(
1639
1630
  (r) => r.operations.has(i)
@@ -1780,7 +1771,7 @@ function aa(e, t, n, i, s) {
1780
1771
  const l = B(e, a.value);
1781
1772
  r = c === !1 ? l : {
1782
1773
  kind: "case",
1783
- when: oe("coalesce", c, G(!1)),
1774
+ when: ee("coalesce", c, G(!1)),
1784
1775
  then: r,
1785
1776
  else: l
1786
1777
  };
@@ -1822,8 +1813,8 @@ function ca(e) {
1822
1813
  const i = it(e, t.claim, !0);
1823
1814
  if (typeof i != "string" && typeof i != "number") return G(null);
1824
1815
  if (t.field === n.key.name) return B(e, i);
1825
- const s = n.fields.get(t.field), o = s?.kind === "scalar" ? s.property : t.field, r = he(e, "viewer");
1826
- return oe("head", {
1816
+ const s = n.fields.get(t.field), o = s?.kind === "scalar" ? s.property : t.field, r = ye(e, "viewer");
1817
+ return ee("head", {
1827
1818
  kind: "comprehension",
1828
1819
  pattern: {
1829
1820
  start: {
@@ -1973,7 +1964,7 @@ function Ot(e, t, n, i, s = "write") {
1973
1964
  variable: i.target,
1974
1965
  labels: [e.model.nodes.get(l.target).labels[0]]
1975
1966
  };
1976
- return ee("OR", un(d), u === !1 ? G(!1) : u);
1967
+ return se("OR", un(d), u === !1 ? G(!1) : u);
1977
1968
  })
1978
1969
  );
1979
1970
  return c === !0 ? void 0 : c === !1 ? !1 : c;
@@ -2047,13 +2038,13 @@ function ru(e, t) {
2047
2038
  if (!n || !i) return !1;
2048
2039
  const s = an(`$jwt.${n.claim}`, e), o = an(t, e);
2049
2040
  if (!s.ok || !o.ok) throw new pt();
2050
- const r = i.fields.get(n.field), a = r?.kind === "scalar" ? r.property : n.field, c = he(e, "viewer"), l = e.inAuth;
2041
+ const r = i.fields.get(n.field), a = r?.kind === "scalar" ? r.property : n.field, c = ye(e, "viewer"), l = e.inAuth;
2051
2042
  e.inAuth = !0;
2052
2043
  try {
2053
2044
  const u = qe(e, i, c, o.value);
2054
- return ee(
2045
+ return se(
2055
2046
  ">",
2056
- oe("size", {
2047
+ ee("size", {
2057
2048
  kind: "comprehension",
2058
2049
  pattern: {
2059
2050
  start: {
@@ -2134,9 +2125,9 @@ function au(e, t, n) {
2134
2125
  s += String(h);
2135
2126
  continue;
2136
2127
  }
2137
- const m = p.fields.get(u), g = m?.kind === "scalar" ? m.property : u, y = he(e, "viewer");
2128
+ const m = p.fields.get(u), g = m?.kind === "scalar" ? m.property : u, y = ye(e, "viewer");
2138
2129
  a(), i.push(
2139
- oe("head", {
2130
+ ee("head", {
2140
2131
  kind: "comprehension",
2141
2132
  pattern: {
2142
2133
  start: {
@@ -2152,7 +2143,7 @@ function au(e, t, n) {
2152
2143
  hops: []
2153
2144
  },
2154
2145
  where: void 0,
2155
- projection: ae(_(y), g)
2146
+ projection: ue(U(y), g)
2156
2147
  })
2157
2148
  );
2158
2149
  continue;
@@ -2172,14 +2163,14 @@ function au(e, t, n) {
2172
2163
  return s += t.slice(r), o ? i.length === 0 ? { ok: !0, value: s } : (a(), {
2173
2164
  ok: !0,
2174
2165
  value: Ll(
2175
- i.length === 1 ? i[0] : i.reduce((c, l) => ee("+", c, l))
2166
+ i.length === 1 ? i[0] : i.reduce((c, l) => se("+", c, l))
2176
2167
  )
2177
2168
  }) : { ok: !1, value: void 0 };
2178
2169
  }
2179
2170
  function cu(e, t, n, i) {
2180
2171
  if (n === "edge") {
2181
2172
  const l = t?.edge, u = l?.props.fields.get(i);
2182
- return l && u ? ae(_(l.variable), u.property) : void 0;
2173
+ return l && u ? ue(U(l.variable), u.property) : void 0;
2183
2174
  }
2184
2175
  const s = t?.[n];
2185
2176
  if (!s) return;
@@ -2191,8 +2182,8 @@ function cu(e, t, n, i) {
2191
2182
  const d = r.fields.get(u);
2192
2183
  if (l === o.length - 1) {
2193
2184
  if (d?.kind !== "scalar") return;
2194
- const p = ae(_(c), d.property);
2195
- return a.length === 0 ? p : oe("head", {
2185
+ const p = ue(U(c), d.property);
2186
+ return a.length === 0 ? p : ee("head", {
2196
2187
  kind: "comprehension",
2197
2188
  pattern: { start: { variable: s.variable, labels: [] }, hops: a },
2198
2189
  where: void 0,
@@ -2202,7 +2193,7 @@ function cu(e, t, n, i) {
2202
2193
  if (d?.kind !== "relationship" || d.list) return;
2203
2194
  const f = e.model.nodes.get(d.target);
2204
2195
  if (!f) return;
2205
- c = he(e, `${s.variable}_${u}`), a.push({
2196
+ c = ye(e, `${s.variable}_${u}`), a.push({
2206
2197
  rel: {
2207
2198
  type: d.type,
2208
2199
  direction: d.queryDirection === "UNDIRECTED" ? "BOTH" : d.direction
@@ -2396,9 +2387,9 @@ function Ls(e, t, n) {
2396
2387
  const i = Re(e, t, n, "READ", "BEFORE");
2397
2388
  return i ? [
2398
2389
  {
2399
- expr: oe("sum", {
2390
+ expr: ee("sum", {
2400
2391
  kind: "case",
2401
- when: oe("coalesce", i, G(!1)),
2392
+ when: ee("coalesce", i, G(!1)),
2402
2393
  then: G(0),
2403
2394
  else: G(1)
2404
2395
  }),
@@ -2412,15 +2403,15 @@ function Ln(e) {
2412
2403
  }
2413
2404
  function qi(e, t) {
2414
2405
  return [
2415
- { kind: "with", items: [{ expr: oe("collect", e), alias: t }] },
2416
- { kind: "return", items: [{ expr: oe("head", _(t)), alias: t }] }
2406
+ { kind: "with", items: [{ expr: ee("collect", e), alias: t }] },
2407
+ { kind: "return", items: [{ expr: ee("head", U(t)), alias: t }] }
2417
2408
  ];
2418
2409
  }
2419
2410
  function Gn(e) {
2420
- return e && oe("coalesce", e, G(!1));
2411
+ return e && ee("coalesce", e, G(!1));
2421
2412
  }
2422
2413
  function pa(e, t) {
2423
- return t === void 0 ? [] : [{ kind: "with", items: [{ expr: _("this") }], limit: B(e, t) }];
2414
+ return t === void 0 ? [] : [{ kind: "with", items: [{ expr: U("this") }], limit: B(e, t) }];
2424
2415
  }
2425
2416
  const pu = ["some", "all", "none", "single"], hu = /* @__PURE__ */ new Map([
2426
2417
  ["some", 'ask `count: { gt: 0 }` for "has any"'],
@@ -2719,9 +2710,9 @@ function Hi(e, t, n) {
2719
2710
  "BAD_USER_INPUT",
2720
2711
  `${e.field.computedBy.owner}.${e.field.name} is computed by @cypher: sort by it in a root field only`
2721
2712
  );
2722
- return _(e.computed);
2713
+ return U(e.computed);
2723
2714
  }
2724
- return ae(_(e.edge ? n : t), e.field.property);
2715
+ return ue(U(e.edge ? n : t), e.field.property);
2725
2716
  }
2726
2717
  function It(e, t, n) {
2727
2718
  if (e == null) return t.default;
@@ -2811,7 +2802,7 @@ function Aa(e, t, n, i, s) {
2811
2802
  n.forEach((l, u) => {
2812
2803
  const d = Hi(l, t, s), f = i[u], p = f === null ? void 0 : B(e, f), h = yi(l);
2813
2804
  let m;
2814
- p === void 0 ? m = l.direction === "ASC" ? void 0 : ct(d, !0) : l.direction === "ASC" ? m = h ? ee(">", d, p) : nn(ee(">", d, p), ct(d)) : m = ee("<", d, p), m && o.push(pe(...r, m)), r.push(p === void 0 ? ct(d) : ee("=", d, p)), u === 0 && p !== void 0 && h && (a = ee(l.direction === "ASC" ? ">=" : "<=", d, p));
2805
+ p === void 0 ? m = l.direction === "ASC" ? void 0 : ct(d, !0) : l.direction === "ASC" ? m = h ? se(">", d, p) : nn(se(">", d, p), ct(d)) : m = se("<", d, p), m && o.push(pe(...r, m)), r.push(p === void 0 ? ct(d) : se("=", d, p)), u === 0 && p !== void 0 && h && (a = se(l.direction === "ASC" ? ">=" : "<=", d, p));
2815
2806
  });
2816
2807
  const c = nn(...o) ?? G(!1);
2817
2808
  return pe(a, c);
@@ -3245,21 +3236,21 @@ function ja(e, t, n) {
3245
3236
  return i;
3246
3237
  }
3247
3238
  function La(e, t, n, i, s, o, r, a, c) {
3248
- const l = he(e, `this_${n.name}`), u = pi(e, t, n, l, s);
3239
+ const l = ye(e, `this_${n.name}`), u = pi(e, t, n, l, s);
3249
3240
  if (u === !1) return;
3250
- ge(e, n, "READ"), e.reads.labels.add(n.labels[0]);
3241
+ me(e, n, "READ"), e.reads.labels.add(n.labels[0]);
3251
3242
  const d = i(l), f = [
3252
3243
  ...o.map((y) => {
3253
3244
  const E = n.fields.get(y.name);
3254
- return { expr: ae(_(l), E.property), direction: y.direction };
3245
+ return { expr: ue(U(l), E.property), direction: y.direction };
3255
3246
  }),
3256
- { expr: ae(_(l), n.key.property), direction: "ASC" }
3257
- ], p = Ye(e, n, l, a, c), h = p.expr, m = he(e, `${l}_list`), g = {
3247
+ { expr: ue(U(l), n.key.property), direction: "ASC" }
3248
+ ], p = Ye(e, n, l, a, c), h = p.expr, m = ye(e, `${l}_list`), g = {
3258
3249
  ...h,
3259
3250
  entries: [
3260
3251
  ...h.entries,
3261
3252
  { kind: "entry", key: "__typename", value: G(n.name) },
3262
- { kind: "entry", key: "__key", value: ae(_(l), n.key.property) },
3253
+ { kind: "entry", key: "__key", value: ue(U(l), n.key.property) },
3263
3254
  ...o.map((y, E) => ({
3264
3255
  kind: "entry",
3265
3256
  key: `__s${E}`,
@@ -3273,22 +3264,22 @@ function La(e, t, n, i, s, o, r, a, c) {
3273
3264
  {
3274
3265
  kind: "match",
3275
3266
  pattern: d.pattern,
3276
- where: pe(d.where, u, ce(e, n, l, "READ"))
3267
+ where: pe(d.where, u, ae(e, n, l, "READ"))
3277
3268
  },
3278
- { kind: "with", items: [{ expr: _(l) }], orderBy: f, limit: r },
3269
+ { kind: "with", items: [{ expr: U(l) }], orderBy: f, limit: r },
3279
3270
  ...p.pre,
3280
- { kind: "return", items: [{ expr: oe("collect", g), alias: m }] }
3271
+ { kind: "return", items: [{ expr: ee("collect", g), alias: m }] }
3281
3272
  ]
3282
3273
  };
3283
3274
  }
3284
3275
  function Pa(e, t) {
3285
3276
  return [
3286
3277
  ...t.map((n, i) => ({
3287
- expr: ae(_(e), `__s${i}`),
3278
+ expr: ue(U(e), `__s${i}`),
3288
3279
  direction: n.direction
3289
3280
  })),
3290
- { expr: ae(_(e), "__typename"), direction: "ASC" },
3291
- { expr: ae(_(e), "__key"), direction: "ASC" }
3281
+ { expr: ue(U(e), "__typename"), direction: "ASC" },
3282
+ { expr: ue(U(e), "__key"), direction: "ASC" }
3292
3283
  ];
3293
3284
  }
3294
3285
  function Lo(e, t, n, i) {
@@ -3322,16 +3313,16 @@ function Lo(e, t, n, i) {
3322
3313
  ...c,
3323
3314
  {
3324
3315
  kind: "unwind",
3325
- expr: l.length === 0 ? { kind: "list", items: [] } : l.map((d) => _(d)).reduce((d, f) => ee("+", d, f)),
3316
+ expr: l.length === 0 ? { kind: "list", items: [] } : l.map((d) => U(d)).reduce((d, f) => se("+", d, f)),
3326
3317
  alias: "this"
3327
3318
  },
3328
3319
  {
3329
3320
  kind: "with",
3330
- items: [{ expr: _("this") }],
3321
+ items: [{ expr: U("this") }],
3331
3322
  orderBy: Pa("this", o),
3332
3323
  limit: r
3333
3324
  },
3334
- { kind: "return", items: [{ expr: _("this"), alias: "this" }] }
3325
+ { kind: "return", items: [{ expr: U("this"), alias: "this" }] }
3335
3326
  ];
3336
3327
  return ot(
3337
3328
  e,
@@ -3367,39 +3358,39 @@ function Uu(e, t, n, i, s, o, r) {
3367
3358
  pre: [],
3368
3359
  expr: n.list ? { kind: "list", items: [] } : G(null)
3369
3360
  };
3370
- const p = he(e, `${t}_${i}_item`), h = he(e, `${t}_${i}`);
3361
+ const p = ye(e, `${t}_${i}_item`), h = ye(e, `${t}_${i}`);
3371
3362
  return d.push(
3372
3363
  {
3373
3364
  kind: "unwind",
3374
- expr: f.map((m) => _(m)).reduce((m, g) => ee("+", m, g)),
3365
+ expr: f.map((m) => U(m)).reduce((m, g) => se("+", m, g)),
3375
3366
  alias: p
3376
3367
  },
3377
3368
  {
3378
3369
  kind: "with",
3379
- items: [{ expr: _(p) }],
3370
+ items: [{ expr: U(p) }],
3380
3371
  orderBy: Pa(p, l),
3381
3372
  limit: u
3382
3373
  },
3383
3374
  ...n.list ? [
3384
3375
  {
3385
3376
  kind: "return",
3386
- items: [{ expr: oe("collect", _(p)), alias: h }]
3377
+ items: [{ expr: ee("collect", U(p)), alias: h }]
3387
3378
  }
3388
- ] : qi(_(p), h)
3389
- ), { pre: [{ kind: "call", imports: [t], body: d }], expr: _(h) };
3379
+ ] : qi(U(p), h)
3380
+ ), { pre: [{ kind: "call", imports: [t], body: d }], expr: U(h) };
3390
3381
  }
3391
3382
  function xa(e, t, n, i, s) {
3392
3383
  const o = [], r = [];
3393
3384
  for (const c of t.members) {
3394
3385
  const l = e.model.nodes.get(c);
3395
- ge(e, l, "READ"), e.reads.labels.add(l.labels[0]);
3386
+ me(e, l, "READ"), e.reads.labels.add(l.labels[0]);
3396
3387
  const u = Ye(e, l, n, i, s);
3397
3388
  o.push(...u.pre);
3398
3389
  const d = u.expr;
3399
3390
  r.push({
3400
3391
  when: pe(
3401
3392
  { kind: "hasLabels", variable: n, labels: [l.labels[0]] },
3402
- Gn(ce(e, l, n, "READ"))
3393
+ Gn(ae(e, l, n, "READ"))
3403
3394
  ) ?? G(!0),
3404
3395
  then: {
3405
3396
  ...d,
@@ -3435,7 +3426,7 @@ function Po(e, t, n, i) {
3435
3426
  const o = t.columnName, r = [s];
3436
3427
  if (t.node) {
3437
3428
  const c = e.model.nodes.get(t.node);
3438
- ge(e, c, "READ"), e.reads.labels.add(c.labels[0]);
3429
+ me(e, c, "READ"), e.reads.labels.add(c.labels[0]);
3439
3430
  const l = t.type.list ? c.limit.max : 1, u = Ye(
3440
3431
  e,
3441
3432
  c,
@@ -3446,8 +3437,8 @@ function Po(e, t, n, i) {
3446
3437
  r.push(
3447
3438
  {
3448
3439
  kind: "with",
3449
- items: [{ expr: _(o), alias: "this" }],
3450
- where: ce(e, c, "this", "READ")
3440
+ items: [{ expr: U(o), alias: "this" }],
3441
+ where: ae(e, c, "this", "READ")
3451
3442
  },
3452
3443
  ...u.pre,
3453
3444
  { kind: "return", items: [{ expr: u.expr, alias: "this" }] }
@@ -3463,7 +3454,7 @@ function Po(e, t, n, i) {
3463
3454
  r.push(
3464
3455
  {
3465
3456
  kind: "with",
3466
- items: [{ expr: _(o), alias: "this" }],
3457
+ items: [{ expr: U(o), alias: "this" }],
3467
3458
  where: u.where
3468
3459
  },
3469
3460
  ...u.pre,
@@ -3472,7 +3463,7 @@ function Po(e, t, n, i) {
3472
3463
  } else
3473
3464
  r.push({
3474
3465
  kind: "return",
3475
- items: [{ expr: _(o), alias: "this" }]
3466
+ items: [{ expr: U(o), alias: "this" }]
3476
3467
  });
3477
3468
  const a = t.type.list;
3478
3469
  return ot(
@@ -3553,10 +3544,10 @@ function ju(e, t, n) {
3553
3544
  }
3554
3545
  }
3555
3546
  function za(e, t, n, i, s, o, r) {
3556
- const a = he(e, `${t}_${i}`);
3547
+ const a = ye(e, `${t}_${i}`);
3557
3548
  e.cost += r * n.cost;
3558
3549
  const c = [];
3559
- t !== "this" && c.push({ kind: "with", items: [{ expr: _(t), alias: "this" }] }), c.push({
3550
+ t !== "this" && c.push({ kind: "with", items: [{ expr: U(t), alias: "this" }] }), c.push({
3560
3551
  kind: "call",
3561
3552
  imports: ["this"],
3562
3553
  body: [{ kind: "raw", text: Ji(e, n, s) }]
@@ -3564,38 +3555,38 @@ function za(e, t, n, i, s, o, r) {
3564
3555
  const l = n.columnName, u = (d) => n.type.list ? [
3565
3556
  {
3566
3557
  kind: "return",
3567
- items: [{ expr: oe("collect", d), alias: a }]
3558
+ items: [{ expr: ee("collect", d), alias: a }]
3568
3559
  }
3569
3560
  ] : qi(d, a);
3570
3561
  if (n.node) {
3571
3562
  const d = e.model.nodes.get(n.node);
3572
- ge(e, d, "READ"), e.reads.labels.add(d.labels[0]);
3573
- const f = he(e, `${a}_node`), p = n.type.list ? d.limit.default : 1, h = Ye(e, d, f, o, r * p);
3563
+ me(e, d, "READ"), e.reads.labels.add(d.labels[0]);
3564
+ const f = ye(e, `${a}_node`), p = n.type.list ? d.limit.default : 1, h = Ye(e, d, f, o, r * p);
3574
3565
  c.push(
3575
3566
  {
3576
3567
  kind: "with",
3577
- items: [{ expr: _(l), alias: f }],
3578
- where: ce(e, d, f, "READ")
3568
+ items: [{ expr: U(l), alias: f }],
3569
+ where: ae(e, d, f, "READ")
3579
3570
  },
3580
3571
  ...h.pre,
3581
3572
  ...u(h.expr)
3582
3573
  );
3583
3574
  } else if (n.abstract) {
3584
- const d = he(e, `${a}_node`), f = e.model.abstracts.get(n.abstract), p = n.type.list ? f.limit.default : 1, h = xa(e, f, d, o, r * p);
3575
+ const d = ye(e, `${a}_node`), f = e.model.abstracts.get(n.abstract), p = n.type.list ? f.limit.default : 1, h = xa(e, f, d, o, r * p);
3585
3576
  c.push(
3586
3577
  {
3587
3578
  kind: "with",
3588
- items: [{ expr: _(l), alias: d }],
3579
+ items: [{ expr: U(l), alias: d }],
3589
3580
  where: h.where
3590
3581
  },
3591
3582
  ...h.pre,
3592
3583
  ...u(h.expr)
3593
3584
  );
3594
3585
  } else
3595
- e.cost += r, c.push(...u(_(l)));
3586
+ e.cost += r, c.push(...u(U(l)));
3596
3587
  return {
3597
3588
  pre: [{ kind: "call", imports: [t], body: c }],
3598
- expr: _(a)
3589
+ expr: U(a)
3599
3590
  };
3600
3591
  }
3601
3592
  function Kn(e, t, n) {
@@ -3756,7 +3747,7 @@ function xu(e, t) {
3756
3747
  }
3757
3748
  const Fu = /* @__PURE__ */ new Set(["eq", "in"]), zu = /* @__PURE__ */ new Set(["lt", "lte", "gt", "gte"]), Bu = /* @__PURE__ */ new Set(["contains", "startsWith", "endsWith"]), qu = /* @__PURE__ */ new Set(["withinBBox", "distance"]);
3758
3749
  function _n(e, t, n, i, s) {
3759
- ge(e, t, "READ");
3750
+ me(e, t, "READ");
3760
3751
  const o = t.labels[0];
3761
3752
  e.reads.labels.add(o);
3762
3753
  const r = [];
@@ -3780,7 +3771,7 @@ function _n(e, t, n, i, s) {
3780
3771
  }));
3781
3772
  let g;
3782
3773
  const y = i[0];
3783
- return !p && !a && !m && !h && u.length === 0 && y && y.direction === "ASC" && yi(y) && (y.field.type === "String" || y.field.type === "ID") && (g = ee(">=", ae(_("this"), y.field.property), G("")), c = {
3774
+ return !p && !a && !m && !h && u.length === 0 && y && y.direction === "ASC" && yi(y) && (y.field.type === "String" || y.field.type === "ID") && (g = se(">=", ue(U("this"), y.field.property), G("")), c = {
3784
3775
  label: o,
3785
3776
  access: "range",
3786
3777
  reason: `ordered by ${t.name}.${y.field.name}`
@@ -3792,15 +3783,15 @@ function _n(e, t, n, i, s) {
3792
3783
  u.length === 0 ? p : void 0,
3793
3784
  u.length === 0 ? m : void 0,
3794
3785
  g,
3795
- ce(e, t, "this", "READ")
3786
+ ae(e, t, "this", "READ")
3796
3787
  )
3797
3788
  }), h && r.push({
3798
3789
  kind: "with",
3799
3790
  distinct: !0,
3800
- items: [{ expr: _("this") }]
3791
+ items: [{ expr: U("this") }]
3801
3792
  }), u.length > 0 && r.push(...f, {
3802
3793
  kind: "with",
3803
- items: [{ expr: _("this") }, ...d.map((E) => ({ expr: _(E) }))],
3794
+ items: [{ expr: U("this") }, ...d.map((E) => ({ expr: U(E) }))],
3804
3795
  where: pe(p, m)
3805
3796
  }), { clauses: r, expectation: c, carry: d };
3806
3797
  }
@@ -3829,11 +3820,11 @@ function Hu(e, t, n) {
3829
3820
  if (!a || typeof a != "object") continue;
3830
3821
  const c = a[r.key.name], l = c?.eq, u = c?.in;
3831
3822
  if (l == null && !Array.isArray(u)) continue;
3832
- const d = he(e, `this_${o.name}_anchor`), f = [];
3823
+ const d = ye(e, `this_${o.name}_anchor`), f = [];
3833
3824
  let p;
3834
- return l != null ? p = ee("=", ae(_(d), r.key.property), B(e, l)) : p = ee(
3825
+ return l != null ? p = se("=", ue(U(d), r.key.property), B(e, l)) : p = se(
3835
3826
  "IN",
3836
- ae(_(d), r.key.property),
3827
+ ue(U(d), r.key.property),
3837
3828
  B(e, Gu(u))
3838
3829
  ), f.push({
3839
3830
  kind: "match",
@@ -3908,11 +3899,11 @@ function xo(e) {
3908
3899
  }
3909
3900
  function Yi(e, t, n, i, s) {
3910
3901
  const o = i.filter(xo).map((d) => ({
3911
- expr: oe(d.agg, ae(_(t), d.field.property)),
3902
+ expr: ee(d.agg, ue(U(t), d.field.property)),
3912
3903
  alias: d.column
3913
3904
  })), r = i.filter((d) => !xo(d)), a = s?.keys ?? [], c = s ? {
3914
3905
  orderBy: a.map((d) => ({
3915
- expr: _(d.alias),
3906
+ expr: U(d.alias),
3916
3907
  direction: "ASC"
3917
3908
  })),
3918
3909
  limit: s.limit
@@ -3921,7 +3912,7 @@ function Yi(e, t, n, i, s) {
3921
3912
  return [{ kind: "return", items: [...a, ...n, ...o], ...c }];
3922
3913
  const l = /* @__PURE__ */ new Map();
3923
3914
  for (const d of r)
3924
- l.has(d.field) || l.set(d.field, he(e, `${d.field.name}_values`));
3915
+ l.has(d.field) || l.set(d.field, ye(e, `${d.field.name}_values`));
3925
3916
  const u = [...n, ...o];
3926
3917
  return [
3927
3918
  {
@@ -3930,7 +3921,7 @@ function Yi(e, t, n, i, s) {
3930
3921
  ...a,
3931
3922
  ...u,
3932
3923
  ...[...l].map(([d, f]) => ({
3933
- expr: oe("collect", ae(_(t), d.property)),
3924
+ expr: ee("collect", ue(U(t), d.property)),
3934
3925
  alias: f
3935
3926
  }))
3936
3927
  ]
@@ -3940,14 +3931,14 @@ function Yi(e, t, n, i, s) {
3940
3931
  ...c,
3941
3932
  items: [
3942
3933
  ...[...a, ...u].map((d) => ({
3943
- expr: _(d.alias),
3934
+ expr: U(d.alias),
3944
3935
  alias: d.alias
3945
3936
  })),
3946
3937
  ...r.map((d) => ({
3947
3938
  expr: Cs(
3948
3939
  e,
3949
3940
  d.agg,
3950
- _(l.get(d.field)),
3941
+ U(l.get(d.field)),
3951
3942
  { duration: d.field.type === "Duration" }
3952
3943
  ),
3953
3944
  alias: d.column
@@ -3962,7 +3953,7 @@ function Qu(e, t, n, i) {
3962
3953
  ), o = n.where, r = _n(e, t, o, []);
3963
3954
  e.cost += xt(e, t, o, t.limit.default, !0);
3964
3955
  const a = [
3965
- { expr: oe("count", _("this")), alias: "count" },
3956
+ { expr: ee("count", U("this")), alias: "count" },
3966
3957
  ...Ls(e, t, "this")
3967
3958
  ], c = qa(e, t, s, i), l = [
3968
3959
  ...r.clauses,
@@ -3993,10 +3984,10 @@ function Ku(e, t, n, i) {
3993
3984
  const u = qa(e, t, c, l), d = n.where, f = _n(e, t, d, []);
3994
3985
  e.cost += xt(e, t, d, r, !0);
3995
3986
  const p = o.map((g, y) => ({
3996
- expr: ae(_("this"), g.property),
3987
+ expr: ue(U("this"), g.property),
3997
3988
  alias: `by_${y}`
3998
3989
  })), h = [
3999
- { expr: oe("count", _("this")), alias: "count" },
3990
+ { expr: ee("count", U("this")), alias: "count" },
4000
3991
  ...Ls(e, t, "this")
4001
3992
  ];
4002
3993
  e.cost += r;
@@ -4052,7 +4043,7 @@ function Wa(e, t) {
4052
4043
  }
4053
4044
  function Xu(e, t, n, i, s, o, r) {
4054
4045
  const a = e.model.nodes.get(n.target);
4055
- ge(e, a, "READ");
4046
+ me(e, a, "READ");
4056
4047
  const c = a.labels[0];
4057
4048
  e.reads.labels.add(c), e.reads.relationships.add(n.type);
4058
4049
  const l = n.properties ? e.model.relationshipProperties.get(n.properties) : void 0, { first: u, sort: d, signature: f, cursor: p, backward: h } = $a(
@@ -4070,7 +4061,7 @@ function Xu(e, t, n, i, s, o, r) {
4070
4061
  o,
4071
4062
  a,
4072
4063
  l
4073
- ), $ = he(e, `${t}_${i}`), N = he(e, `${$}_rel`), O = Ut(t, n, c, $, N), I = l ? Ot(
4064
+ ), $ = ye(e, `${t}_${i}`), N = ye(e, `${$}_rel`), O = Ut(t, n, c, $, N), I = l ? Ot(
4074
4065
  e,
4075
4066
  n,
4076
4067
  "READ_EDGE",
@@ -4079,7 +4070,7 @@ function Xu(e, t, n, i, s, o, r) {
4079
4070
  ) : void 0, R = s.where, C = m ? R?.node : R, F = m ? R?.edge : void 0, Y = (Z, ne) => pe(
4080
4071
  qe(e, a, Z, C),
4081
4072
  l ? Us(e, l, ne, F) : void 0,
4082
- ce(e, a, Z, "READ")
4073
+ ae(e, a, Z, "READ")
4083
4074
  );
4084
4075
  if (I !== void 0 && (F != null || d.some((Z) => Z.edge) || (b.aggregate?.edge.length ?? 0) > 0))
4085
4076
  throw ua(n);
@@ -4103,14 +4094,14 @@ function Xu(e, t, n, i, s, o, r) {
4103
4094
  target: $
4104
4095
  })
4105
4096
  });
4106
- const x = he(e, `${$}_rows`), q = [
4107
- { key: "__rows", value: _(x) },
4097
+ const x = ye(e, `${$}_rows`), q = [
4098
+ { key: "__rows", value: U(x) },
4108
4099
  { key: "__first", value: B(e, u) },
4109
4100
  { key: "__after", value: B(e, p !== void 0) },
4110
4101
  { key: "__backward", value: B(e, h) },
4111
4102
  { key: "__sort", value: B(e, f) }
4112
4103
  ], X = (Z) => {
4113
- const ne = he(e, `${$}_all`), de = he(e, `${ne}_rel`);
4104
+ const ne = ye(e, `${$}_all`), de = ye(e, `${ne}_rel`);
4114
4105
  return {
4115
4106
  kind: "comprehension",
4116
4107
  pattern: Ut(t, n, c, ne, de),
@@ -4126,8 +4117,8 @@ function Xu(e, t, n, i, s, o, r) {
4126
4117
  key: ne,
4127
4118
  value: {
4128
4119
  kind: "map",
4129
- entries: de.map(({ field: U, fns: z }) => ({
4130
- key: U.name,
4120
+ entries: de.map(({ field: _, fns: z }) => ({
4121
+ key: _.name,
4131
4122
  value: {
4132
4123
  kind: "map",
4133
4124
  entries: z.map((V) => ({
@@ -4136,9 +4127,9 @@ function Xu(e, t, n, i, s, o, r) {
4136
4127
  e,
4137
4128
  V,
4138
4129
  X(
4139
- (H, re) => ae(_(ne === "node" ? H : re), U.property)
4130
+ (H, re) => ue(U(ne === "node" ? H : re), _.property)
4140
4131
  ),
4141
- { duration: U.type === "Duration" }
4132
+ { duration: _.type === "Duration" }
4142
4133
  )
4143
4134
  }))
4144
4135
  }
@@ -4160,14 +4151,11 @@ function Xu(e, t, n, i, s, o, r) {
4160
4151
  entries: [
4161
4152
  {
4162
4153
  key: "nodes",
4163
- value: xi(
4164
- e,
4165
- X((ne) => ae(_(ne), a.key.property))
4166
- )
4154
+ value: xi(X((ne) => ee("id", U(ne))))
4167
4155
  },
4168
4156
  {
4169
4157
  key: "edges",
4170
- value: oe(
4158
+ value: ee(
4171
4159
  "size",
4172
4160
  X(() => G(1))
4173
4161
  )
@@ -4181,10 +4169,10 @@ function Xu(e, t, n, i, s, o, r) {
4181
4169
  });
4182
4170
  }
4183
4171
  if (b.totalCount || b.aggregate) {
4184
- const Z = he(e, `${$}_count`), ne = he(e, `${Z}_rel`);
4172
+ const Z = ye(e, `${$}_count`), ne = ye(e, `${Z}_rel`);
4185
4173
  q.push({
4186
4174
  key: "__totalCount",
4187
- value: oe("size", {
4175
+ value: ee("size", {
4188
4176
  kind: "comprehension",
4189
4177
  pattern: Ut(t, n, c, Z, ne),
4190
4178
  where: Y(Z, ne),
@@ -4194,10 +4182,10 @@ function Xu(e, t, n, i, s, o, r) {
4194
4182
  const de = Re(e, a, Z, "READ", "BEFORE");
4195
4183
  de && q.push({
4196
4184
  key: "__denied",
4197
- value: oe("size", {
4185
+ value: ee("size", {
4198
4186
  kind: "comprehension",
4199
4187
  pattern: Ut(t, n, c, Z, ne),
4200
- where: pe(Y(Z, ne), un(oe("coalesce", de, G(!1)))),
4188
+ where: pe(Y(Z, ne), un(ee("coalesce", de, G(!1)))),
4201
4189
  projection: G(1)
4202
4190
  })
4203
4191
  });
@@ -4213,9 +4201,9 @@ function Xu(e, t, n, i, s, o, r) {
4213
4201
  kind: "with",
4214
4202
  // A READ_EDGE rule may test the parent end: keep it in scope.
4215
4203
  items: [
4216
- { expr: _(N) },
4217
- { expr: _($) },
4218
- ...I !== void 0 ? [{ expr: _(t) }] : []
4204
+ { expr: U(N) },
4205
+ { expr: U($) },
4206
+ ...I !== void 0 ? [{ expr: U(t) }] : []
4219
4207
  ],
4220
4208
  orderBy: Ps($, d, N),
4221
4209
  limit: B(e, u + 1)
@@ -4225,7 +4213,7 @@ function Xu(e, t, n, i, s, o, r) {
4225
4213
  kind: "return",
4226
4214
  items: [
4227
4215
  {
4228
- expr: oe("collect", { kind: "map", entries: A }),
4216
+ expr: ee("collect", { kind: "map", entries: A }),
4229
4217
  alias: x
4230
4218
  }
4231
4219
  ]
@@ -4253,7 +4241,7 @@ function Ju(e, t, n, i, s, o) {
4253
4241
  key: l,
4254
4242
  value: ds(
4255
4243
  { when: h, code: "FORBIDDEN" },
4256
- ae(_(n), d.property)
4244
+ ue(U(n), d.property)
4257
4245
  )
4258
4246
  });
4259
4247
  continue;
@@ -4275,13 +4263,13 @@ function Ju(e, t, n, i, s, o) {
4275
4263
  key: l,
4276
4264
  value: ds(
4277
4265
  { when: s === !1 ? G(!1) : s, code: "FORBIDDEN" },
4278
- ae(_(n), d.property)
4266
+ ue(U(n), d.property)
4279
4267
  )
4280
4268
  });
4281
4269
  continue;
4282
4270
  }
4283
4271
  c.push(
4284
- l === d.property ? { kind: "property", key: l } : { kind: "entry", key: l, value: ae(_(n), d.property) }
4272
+ l === d.property ? { kind: "property", key: l } : { kind: "entry", key: l, value: ue(U(n), d.property) }
4285
4273
  );
4286
4274
  }
4287
4275
  return { kind: "mapProjection", variable: n, entries: c };
@@ -4363,7 +4351,7 @@ function Ye(e, t, n, i, s) {
4363
4351
  a.push({
4364
4352
  kind: "entry",
4365
4353
  key: p,
4366
- value: ae(_(n), t.key.property)
4354
+ value: ue(U(n), t.key.property)
4367
4355
  });
4368
4356
  continue;
4369
4357
  }
@@ -4374,14 +4362,14 @@ function Ye(e, t, n, i, s) {
4374
4362
  t,
4375
4363
  y,
4376
4364
  n,
4377
- ae(_(n), y.property)
4365
+ ue(U(n), y.property)
4378
4366
  );
4379
4367
  b ? a.push({
4380
4368
  kind: "entry",
4381
4369
  key: p,
4382
4370
  value: ds(b, I)
4383
4371
  }) : y.authorization?.mask?.length ? a.push({ kind: "entry", key: p, value: I }) : a.push(
4384
- p === y.property ? { kind: "property", key: p } : { kind: "entry", key: p, value: ae(_(n), y.property) }
4372
+ p === y.property ? { kind: "property", key: p } : { kind: "entry", key: p, value: ue(U(n), y.property) }
4385
4373
  );
4386
4374
  continue;
4387
4375
  }
@@ -4434,7 +4422,7 @@ function Ye(e, t, n, i, s) {
4434
4422
  function ds(e, t) {
4435
4423
  return {
4436
4424
  kind: "case",
4437
- when: oe("coalesce", e.when, G(!1)),
4425
+ when: ee("coalesce", e.when, G(!1)),
4438
4426
  then: t,
4439
4427
  else: {
4440
4428
  kind: "map",
@@ -4456,26 +4444,26 @@ function Ha(e, t, n) {
4456
4444
  }
4457
4445
  function Zu(e, t, n, i, s, o, r) {
4458
4446
  const a = e.model.nodes.get(n.target);
4459
- ge(e, a, "READ");
4447
+ me(e, a, "READ");
4460
4448
  const c = a.labels[0];
4461
4449
  e.reads.labels.add(c), e.reads.relationships.add(n.type);
4462
- const l = he(e, `${t}_${i}`), u = Ut(t, n, c, l), d = pe(
4450
+ const l = ye(e, `${t}_${i}`), u = Ut(t, n, c, l), d = pe(
4463
4451
  qe(e, a, l, s.where),
4464
- ce(e, a, l, "READ")
4452
+ ae(e, a, l, "READ")
4465
4453
  );
4466
4454
  if (!n.list) {
4467
4455
  const E = Ye(e, a, l, o, r);
4468
4456
  if (E.pre.length === 0)
4469
4457
  return {
4470
4458
  pre: [],
4471
- expr: oe("head", {
4459
+ expr: ee("head", {
4472
4460
  kind: "comprehension",
4473
4461
  pattern: u,
4474
4462
  where: d,
4475
4463
  projection: E.expr
4476
4464
  })
4477
4465
  };
4478
- const b = he(e, `${l}_one`);
4466
+ const b = ye(e, `${l}_one`);
4479
4467
  return {
4480
4468
  pre: [
4481
4469
  {
@@ -4483,13 +4471,13 @@ function Zu(e, t, n, i, s, o, r) {
4483
4471
  imports: [t],
4484
4472
  body: [
4485
4473
  { kind: "match", pattern: u, where: d },
4486
- { kind: "with", items: [{ expr: _(l) }], limit: G(1) },
4474
+ { kind: "with", items: [{ expr: U(l) }], limit: G(1) },
4487
4475
  ...E.pre,
4488
4476
  ...qi(E.expr, b)
4489
4477
  ]
4490
4478
  }
4491
4479
  ],
4492
- expr: _(b)
4480
+ expr: U(b)
4493
4481
  };
4494
4482
  }
4495
4483
  const f = It(s.limit, n.limit ?? a.limit, "limit"), p = s.sort, h = B(e, f);
@@ -4500,7 +4488,7 @@ function Zu(e, t, n, i, s, o, r) {
4500
4488
  l,
4501
4489
  o,
4502
4490
  r * Ha(e, n, f)
4503
- ), g = Vi(e, a, p, !1), y = he(e, `${l}_list`);
4491
+ ), g = Vi(e, a, p, !1), y = ye(e, `${l}_list`);
4504
4492
  return {
4505
4493
  pre: [
4506
4494
  {
@@ -4510,33 +4498,33 @@ function Zu(e, t, n, i, s, o, r) {
4510
4498
  { kind: "match", pattern: u, where: d },
4511
4499
  {
4512
4500
  kind: "with",
4513
- items: [{ expr: _(l) }],
4501
+ items: [{ expr: U(l) }],
4514
4502
  orderBy: Ps(l, g),
4515
4503
  limit: h
4516
4504
  },
4517
4505
  ...m.pre,
4518
4506
  {
4519
4507
  kind: "return",
4520
- items: [{ expr: oe("collect", m.expr), alias: y }]
4508
+ items: [{ expr: ee("collect", m.expr), alias: y }]
4521
4509
  }
4522
4510
  ]
4523
4511
  }
4524
4512
  ],
4525
- expr: _(y)
4513
+ expr: U(y)
4526
4514
  };
4527
4515
  }
4528
4516
  function Va(e, t, n, i) {
4529
- ge(e, t, "READ");
4517
+ me(e, t, "READ");
4530
4518
  const s = t.labels[0];
4531
4519
  e.reads.labels.add(s);
4532
- const o = he(e, "this_key"), r = Ye(e, t, "this", i, n.length), a = [
4520
+ const o = ye(e, "this_key"), r = Ye(e, t, "this", i, n.length), a = [
4533
4521
  { kind: "unwind", expr: B(e, n), alias: o },
4534
4522
  {
4535
4523
  kind: "match",
4536
4524
  pattern: { start: { variable: "this", labels: [s] }, hops: [] },
4537
4525
  where: pe(
4538
- ee("=", ae(_("this"), t.key.property), _(o)),
4539
- ce(e, t, "this", "READ")
4526
+ se("=", ue(U("this"), t.key.property), U(o)),
4527
+ ae(e, t, "this", "READ")
4540
4528
  )
4541
4529
  },
4542
4530
  ...r.pre,
@@ -4544,7 +4532,7 @@ function Va(e, t, n, i) {
4544
4532
  kind: "return",
4545
4533
  items: [
4546
4534
  { expr: r.expr, alias: "this" },
4547
- { expr: ae(_("this"), t.key.property), alias: "__key" }
4535
+ { expr: ue(U("this"), t.key.property), alias: "__key" }
4548
4536
  ]
4549
4537
  }
4550
4538
  ];
@@ -4876,14 +4864,14 @@ function jt(e, t, n, i, s, o, r) {
4876
4864
  MATCH (${S(e)})${Xe(i, s, o, r)}
4877
4865
  WHERE ${kt(o, r)}`;
4878
4866
  }
4879
- const dd = (e) => e && ee("OR", ae(_("row"), "fresh"), e), ke = (e) => e ? ` AND (${P(e)})` : "";
4867
+ const dd = (e) => e && se("OR", ue(U("row"), "fresh"), e), ke = (e) => e ? ` AND (${P(e)})` : "";
4880
4868
  function no(e, t) {
4881
4869
  return [...e.nodes.get(t.target).fields.values()].filter(
4882
4870
  (i) => i.kind === "relationship" && i.type === t.type && i.members.includes(t.owner) && i.direction !== t.direction
4883
4871
  );
4884
4872
  }
4885
4873
  function fs(e, t, n) {
4886
- const i = ce(e, t, n, "READ");
4874
+ const i = ae(e, t, n, "READ");
4887
4875
  return i ? `coalesce(${P(i)}, false)` : "true";
4888
4876
  }
4889
4877
  function Ya(e, t, n) {
@@ -5709,8 +5697,8 @@ function Zt(e, t, n) {
5709
5697
  function Fd(e, t, n) {
5710
5698
  const i = Bd(t, n);
5711
5699
  try {
5712
- if (ge(e, t, n), Ue(e, t)) return { verdict: "allowed", by: ["bypass"] };
5713
- const s = n === "CREATE" ? void 0 : ce(e, t, "n", n);
5700
+ if (me(e, t, n), Ue(e, t)) return { verdict: "allowed", by: ["bypass"] };
5701
+ const s = n === "CREATE" ? void 0 : ae(e, t, "n", n);
5714
5702
  if (s && pc(s)) return { verdict: "denied", by: i };
5715
5703
  const o = Re(e, t, "n", n, "BEFORE") ?? (n === "READ" ? void 0 : Re(e, t, "n", n, "AFTER")), r = s ? "filtered" : o ? "validated" : "allowed";
5716
5704
  return { verdict: r, by: r === "allowed" ? fc(i) : i };
@@ -5787,7 +5775,7 @@ function qd(e, t) {
5787
5775
  ...o,
5788
5776
  authorization: { filter: [a], validate: [] }
5789
5777
  };
5790
- ce(l, u, "n", [...a.operations][0]) === void 0 && n.push({
5778
+ ae(l, u, "n", [...a.operations][0]) === void 0 && n.push({
5791
5779
  type: o.name,
5792
5780
  message: `filter[${c}] holds for every authenticated caller: it only keeps out anonymous ones (use @authentication for that)`
5793
5781
  });
@@ -6070,7 +6058,7 @@ function Ti(e) {
6070
6058
  ([t, n]) => t === "jwt" || t === "viewer" || t === "isViewer" || Ti(n)
6071
6059
  );
6072
6060
  }
6073
- const ue = {
6061
+ const le = {
6074
6062
  create: (e) => `create${Oe(e.plural)}`,
6075
6063
  update: (e) => `update${e.name}`,
6076
6064
  delete: (e) => `delete${e.name}`,
@@ -6135,20 +6123,20 @@ function sf(e, t) {
6135
6123
  }, d = (v, T) => {
6136
6124
  const D = n.nodes.get(T.target);
6137
6125
  return s(
6138
- ue.connect(v.name, T.name),
6126
+ le.connect(v.name, T.name),
6139
6127
  () => ({
6140
6128
  [D.key.name]: { type: $e(e.inputType(D.key)) },
6141
6129
  ...u(T)
6142
6130
  }),
6143
6131
  `Connect an existing ${D.name} by ${D.key.name}. Connecting a connected pair sets the relationship properties given and keeps the others.`
6144
6132
  );
6145
- }, f = (v, T) => s(ue.nestedCreate(v.name, T.name), () => ({
6133
+ }, f = (v, T) => s(le.nestedCreate(v.name, T.name), () => ({
6146
6134
  node: { type: $e(b(n.nodes.get(T.target))) },
6147
6135
  ...u(T)
6148
6136
  })), p = (v, T) => {
6149
6137
  const D = n.nodes.get(T.target), A = T.properties ? n.relationshipProperties.get(T.properties) : void 0, x = A ? c(A) : void 0, q = T.nestedOperations.has("UPDATE") && D.mutations.has("UPDATE") && cs(n, D) ? N(D) : void 0;
6150
6138
  if (!(!x && !q))
6151
- return s(ue.nestedUpdate(v.name, T.name), () => ({
6139
+ return s(le.nestedUpdate(v.name, T.name), () => ({
6152
6140
  ...T.list ? { [D.key.name]: { type: $e(e.inputType(D.key)) } } : {},
6153
6141
  ...x ? { edge: { type: x } } : {},
6154
6142
  ...q ? { node: { type: q } } : {}
@@ -6162,23 +6150,23 @@ function sf(e, t) {
6162
6150
  member: de.target,
6163
6151
  // A naming copy, so each member's inputs get their own type names.
6164
6152
  rel: { ...de, name: `${T.name}${de.target}` }
6165
- })), x = (de, U) => {
6153
+ })), x = (de, _) => {
6166
6154
  const z = {};
6167
6155
  for (const V of A) {
6168
- const H = U(V);
6156
+ const H = _(V);
6169
6157
  H && (z[V.member] = { type: H, ...m(T) });
6170
6158
  }
6171
6159
  return Object.keys(z).length > 0 ? s(`${v.name}${Oe(T.name)}${de}`, () => z) : void 0;
6172
6160
  }, q = {}, X = (de) => T.nestedOperations.has(de), Z = X("CONNECT") ? x("ConnectMembers", (de) => {
6173
- const U = d(v, de.rel);
6174
- return T.list ? Ke($e(U)) : U;
6161
+ const _ = d(v, de.rel);
6162
+ return T.list ? Ke($e(_)) : _;
6175
6163
  }) : void 0;
6176
6164
  Z && (q.connect = { type: Z });
6177
6165
  const ne = X("CREATE") ? x("CreateMembers", (de) => {
6178
6166
  if (!n.nodes.get(de.member).mutations.has("CREATE"))
6179
6167
  return;
6180
- const U = f(v, de.rel);
6181
- return T.list ? Ke($e(U)) : U;
6168
+ const _ = f(v, de.rel);
6169
+ return T.list ? Ke($e(_)) : _;
6182
6170
  }) : void 0;
6183
6171
  return ne && (q.create = { type: ne }), D && X("DISCONNECT") && (q.disconnect = T.list ? {
6184
6172
  type: x(
@@ -6225,7 +6213,7 @@ function sf(e, t) {
6225
6213
  description: `Which connected ${A.name} nodes; all of them when absent.`
6226
6214
  },
6227
6215
  limit: {
6228
- type: me,
6216
+ type: he,
6229
6217
  description: "At most this many (default: maxBatch); more matching is an error."
6230
6218
  }
6231
6219
  }),
@@ -6247,14 +6235,14 @@ function sf(e, t) {
6247
6235
  return q;
6248
6236
  }, E = (v) => [...v.fields.values()].filter(
6249
6237
  (T) => T.kind === "scalar"
6250
- ), b = (v) => s(ue.createInput(v.name), () => {
6238
+ ), b = (v) => s(le.createInput(v.name), () => {
6251
6239
  const T = r(E(v), "CREATE");
6252
6240
  for (const D of v.fields.values()) {
6253
6241
  if (D.kind !== "relationship" || !Se(D, "CREATE")) continue;
6254
6242
  const A = y(v, D, !1);
6255
6243
  if (Object.keys(A).length === 0) continue;
6256
6244
  const x = s(
6257
- ue.relationCreate(v.name, D.name),
6245
+ le.relationCreate(v.name, D.name),
6258
6246
  () => A
6259
6247
  );
6260
6248
  T[D.name] = {
@@ -6263,7 +6251,7 @@ function sf(e, t) {
6263
6251
  };
6264
6252
  }
6265
6253
  return T;
6266
- }), $ = (v) => s(ue.upsertInput(v.name), () => {
6254
+ }), $ = (v) => s(le.upsertInput(v.name), () => {
6267
6255
  const T = {};
6268
6256
  for (const D of v.fields.values())
6269
6257
  if (D.kind === "scalar") {
@@ -6278,7 +6266,7 @@ function sf(e, t) {
6278
6266
  if (Object.keys(A).length === 0) continue;
6279
6267
  T[D.name] = {
6280
6268
  type: s(
6281
- ue.relationCreate(v.name, D.name),
6269
+ le.relationCreate(v.name, D.name),
6282
6270
  () => A
6283
6271
  )
6284
6272
  };
@@ -6286,14 +6274,14 @@ function sf(e, t) {
6286
6274
  return T;
6287
6275
  });
6288
6276
  function N(v) {
6289
- return s(ue.updateInput(v.name), () => {
6277
+ return s(le.updateInput(v.name), () => {
6290
6278
  const T = r(E(v), "UPDATE");
6291
6279
  for (const D of v.fields.values()) {
6292
6280
  if (D.kind !== "relationship" || !Se(D, "UPDATE")) continue;
6293
6281
  const A = y(v, D, !0);
6294
6282
  Object.keys(A).length !== 0 && (T[D.name] = {
6295
6283
  type: s(
6296
- ue.relationUpdate(v.name, D.name),
6284
+ le.relationUpdate(v.name, D.name),
6297
6285
  () => A
6298
6286
  )
6299
6287
  });
@@ -6314,7 +6302,7 @@ function sf(e, t) {
6314
6302
  description: "Append these values (a missing list starts empty)."
6315
6303
  },
6316
6304
  pop: {
6317
- type: me,
6305
+ type: he,
6318
6306
  description: "Remove this many values from the end."
6319
6307
  },
6320
6308
  remove: {
@@ -6343,24 +6331,24 @@ function sf(e, t) {
6343
6331
  const T = E(v).filter(nf);
6344
6332
  if (T.length !== 0)
6345
6333
  return s(
6346
- ue.adjustInput(v.name),
6334
+ le.adjustInput(v.name),
6347
6335
  () => Object.fromEntries(T.map((D) => [D.name, { type: I(D) }]))
6348
6336
  );
6349
6337
  }, C = new we({
6350
6338
  name: "MutationInfo",
6351
6339
  description: "What a mutation wrote.",
6352
6340
  fields: {
6353
- nodesCreated: { type: new We(me) },
6354
- nodesUpdated: { type: new We(me) },
6355
- nodesDeleted: { type: new We(me) },
6356
- relationshipsCreated: { type: new We(me) },
6357
- relationshipsDeleted: { type: new We(me) }
6341
+ nodesCreated: { type: new We(he) },
6342
+ nodesUpdated: { type: new We(he) },
6343
+ nodesDeleted: { type: new We(he) },
6344
+ relationshipsCreated: { type: new We(he) },
6345
+ relationshipsDeleted: { type: new We(he) }
6358
6346
  }
6359
6347
  }), F = (v, T) => new We(
6360
6348
  new we({
6361
6349
  name: v,
6362
6350
  fields: {
6363
- [ue.createdField(T)]: {
6351
+ [le.createdField(T)]: {
6364
6352
  type: new We(
6365
6353
  new ji(new We(e.object(T.name)))
6366
6354
  )
@@ -6370,55 +6358,55 @@ function sf(e, t) {
6370
6358
  })
6371
6359
  ), Y = {};
6372
6360
  for (const v of n.nodes.values()) {
6373
- const T = e.object(v.name), D = { type: $e(e.inputType(v.key)) }, A = (Z) => (ne, de, U, z) => t(Z, v, z, U), x = cs(n, v), q = R(v), X = {
6361
+ const T = e.object(v.name), D = { type: $e(e.inputType(v.key)) }, A = (Z) => (ne, de, _, z) => t(Z, v, z, _), x = cs(n, v), q = R(v), X = {
6374
6362
  ...x ? { update: { type: N(v) } } : {},
6375
6363
  ...q ? { adjust: { type: q, description: "Math and list operators." } } : {}
6376
6364
  };
6377
- v.mutations.has("CREATE") && (Y[ue.create(v)] = {
6365
+ v.mutations.has("CREATE") && (Y[le.create(v)] = {
6378
6366
  description: `Create ${v.name} nodes, with their relationships, atomically.`,
6379
- type: F(ue.createPayload(v), v),
6367
+ type: F(le.createPayload(v), v),
6380
6368
  args: { input: { type: $e(Ke($e(b(v)))) } },
6381
6369
  resolve: A("CREATE")
6382
- }), v.mutations.has("UPDATE") && x && (Y[ue.update(v)] = {
6383
- description: `Update the ${v.name} with this ${v.key.name}. The payload's ${ue.updatedField(v)} is null when there is none.`,
6370
+ }), v.mutations.has("UPDATE") && x && (Y[le.update(v)] = {
6371
+ description: `Update the ${v.name} with this ${v.key.name}. The payload's ${le.updatedField(v)} is null when there is none.`,
6384
6372
  type: new We(
6385
6373
  new we({
6386
- name: ue.updatePayload(v),
6374
+ name: le.updatePayload(v),
6387
6375
  fields: {
6388
- [ue.updatedField(v)]: { type: T },
6376
+ [le.updatedField(v)]: { type: T },
6389
6377
  info: { type: new We(C) }
6390
6378
  }
6391
6379
  })
6392
6380
  ),
6393
6381
  args: { [v.key.name]: D, ...X },
6394
6382
  resolve: A("UPDATE")
6395
- }, Y[ue.updateMany(v)] = {
6383
+ }, Y[le.updateMany(v)] = {
6396
6384
  description: `Update every ${v.name} matching \`where\`, atomically. Fails, writing nothing, when more than \`limit\` match (default: the mutation batch limit). Relationships are updated one node at a time, with update${v.name}.`,
6397
- type: F(ue.updateManyPayload(v), v),
6385
+ type: F(le.updateManyPayload(v), v),
6398
6386
  args: {
6399
6387
  where: { type: $e(e.where(v.name)) },
6400
6388
  ...X,
6401
- limit: { type: me }
6389
+ limit: { type: he }
6402
6390
  },
6403
6391
  resolve: A("UPDATE_MANY")
6404
- }), v.mutations.has("CREATE") && v.mutations.has("UPDATE") && (Y[ue.upsert(v)] = {
6392
+ }), v.mutations.has("CREATE") && v.mutations.has("UPDATE") && (Y[le.upsert(v)] = {
6405
6393
  description: `Create the ${v.name} nodes whose ${v.key.name} is new and update the others, atomically. Fields required on create are required only for new nodes.`,
6406
- type: F(ue.upsertPayload(v), v),
6394
+ type: F(le.upsertPayload(v), v),
6407
6395
  args: {
6408
6396
  input: { type: $e(Ke($e($(v)))) }
6409
6397
  },
6410
6398
  resolve: A("UPSERT")
6411
- }), v.mutations.has("DELETE") && (Y[ue.delete(v)] = {
6399
+ }), v.mutations.has("DELETE") && (Y[le.delete(v)] = {
6412
6400
  description: `Delete the ${v.name} with this ${v.key.name}, its relationships, and what @relationship(onDelete: CASCADE) reaches.`,
6413
6401
  type: new We(C),
6414
6402
  args: { [v.key.name]: D },
6415
6403
  resolve: A("DELETE")
6416
- }, Y[ue.deleteMany(v)] = {
6404
+ }, Y[le.deleteMany(v)] = {
6417
6405
  description: `Delete every ${v.name} matching \`where\`, atomically. Fails, deleting nothing, when more than \`limit\` match (default: the mutation batch limit).`,
6418
6406
  type: new We(C),
6419
6407
  args: {
6420
6408
  where: { type: $e(e.where(v.name)) },
6421
- limit: { type: me }
6409
+ limit: { type: he }
6422
6410
  },
6423
6411
  resolve: A("DELETE_MANY")
6424
6412
  });
@@ -6462,7 +6450,7 @@ function of(e) {
6462
6450
  node: r,
6463
6451
  ops: c
6464
6452
  });
6465
- n.set(ue.create(r), a(["CREATE"])), n.set(ue.upsert(r), a(["CREATE", "UPDATE"])), n.set(ue.update(r), a(["UPDATE"])), n.set(ue.updateMany(r), a(["UPDATE"])), n.set(ue.delete(r), a(["DELETE"])), n.set(ue.deleteMany(r), a(["DELETE"])), i.set(`${ln(r.name)}Changed`, a(["SUBSCRIBE"]));
6453
+ n.set(le.create(r), a(["CREATE"])), n.set(le.upsert(r), a(["CREATE", "UPDATE"])), n.set(le.update(r), a(["UPDATE"])), n.set(le.updateMany(r), a(["UPDATE"])), n.set(le.delete(r), a(["DELETE"])), n.set(le.deleteMany(r), a(["DELETE"])), i.set(`${ln(r.name)}Changed`, a(["SUBSCRIBE"]));
6466
6454
  }
6467
6455
  for (const r of e.abstracts.values())
6468
6456
  t.set(r.plural, {
@@ -7098,7 +7086,7 @@ function vf(e, t, n, i) {
7098
7086
  ...a.clauses,
7099
7087
  {
7100
7088
  kind: "with",
7101
- items: [{ expr: _("this") }, ...a.carry.map((u) => ({ expr: _(u) }))],
7089
+ items: [{ expr: U("this") }, ...a.carry.map((u) => ({ expr: U(u) }))],
7102
7090
  orderBy: Ps("this", o),
7103
7091
  limit: B(e, s)
7104
7092
  },
@@ -7117,16 +7105,16 @@ function vf(e, t, n, i) {
7117
7105
  );
7118
7106
  }
7119
7107
  function bf(e, t, n, i) {
7120
- ge(e, t, "READ");
7108
+ me(e, t, "READ");
7121
7109
  const s = t.labels[0];
7122
7110
  e.reads.labels.add(s);
7123
7111
  const o = pe(
7124
- ee(
7112
+ se(
7125
7113
  "=",
7126
- ae(_("this"), t.key.property),
7114
+ ue(U("this"), t.key.property),
7127
7115
  B(e, n[t.key.name])
7128
7116
  ),
7129
- ce(e, t, "this", "READ")
7117
+ ae(e, t, "this", "READ")
7130
7118
  ), r = Ye(e, t, "this", i, 1), a = [
7131
7119
  {
7132
7120
  kind: "match",
@@ -7178,8 +7166,8 @@ function $f(e, t, n, i) {
7178
7166
  {
7179
7167
  kind: "with",
7180
7168
  items: [
7181
- { expr: _("this") },
7182
- ...b.carry.map((N) => ({ expr: _(N) }))
7169
+ { expr: U("this") },
7170
+ ...b.carry.map((N) => ({ expr: U(N) }))
7183
7171
  ],
7184
7172
  orderBy: Ps("this", o),
7185
7173
  limit: B(e, s + 1)
@@ -7207,7 +7195,7 @@ function $f(e, t, n, i) {
7207
7195
  }, $ = _n(b, t, l, []);
7208
7196
  h ??= $.expectation;
7209
7197
  const N = [
7210
- { expr: oe("count", _("this")), alias: "totalCount" },
7198
+ { expr: ee("count", U("this")), alias: "totalCount" },
7211
7199
  ...Ls(b, t, "this")
7212
7200
  ], O = [];
7213
7201
  for (const { field: C, fns: F } of f.aggregate?.node ?? [])
@@ -7274,19 +7262,19 @@ function Tf(e, t, n) {
7274
7262
  }
7275
7263
  const Ys = "score:DESC,key:ASC";
7276
7264
  function tr(e, t, n, i, s, o = !1) {
7277
- ge(e, t, "READ");
7265
+ me(e, t, "READ");
7278
7266
  const r = t.labels[0];
7279
7267
  e.reads.labels.add(r);
7280
7268
  const a = o ? It(i.first, t.limit, "first") : It(i.limit, t.limit, "limit"), c = o ? i.after : null, l = c != null ? ga(c, Ys, 2, e.model.cursorSecret) : void 0, u = l ? nn(
7281
- ee("<", _("score"), B(e, l[0])),
7269
+ se("<", U("score"), B(e, l[0])),
7282
7270
  pe(
7283
- ee("=", _("score"), B(e, l[0])),
7284
- ee(">", ae(_("this"), t.key.property), B(e, l[1]))
7271
+ se("=", U("score"), B(e, l[0])),
7272
+ se(">", ue(U("this"), t.key.property), B(e, l[1]))
7285
7273
  )
7286
7274
  ) : void 0, d = (g, y) => {
7287
7275
  const E = pe(
7288
7276
  qe(g, t, "this", i.where),
7289
- ce(g, t, "this", "READ"),
7277
+ ae(g, t, "this", "READ"),
7290
7278
  y
7291
7279
  ), b = [];
7292
7280
  if (n.kind === "fulltext") {
@@ -7324,15 +7312,15 @@ function tr(e, t, n, i, s, o = !1) {
7324
7312
  // The anchor's vector is read to rank the others: it must be
7325
7313
  // readable, or an unreadable node's vector would leak through them.
7326
7314
  where: pe(
7327
- ee("=", ae(_("anchor"), t.key.property), B(g, N)),
7328
- ce(g, t, "anchor", "READ"),
7315
+ se("=", ue(U("anchor"), t.key.property), B(g, N)),
7316
+ ae(g, t, "anchor", "READ"),
7329
7317
  Gn(Re(g, t, "anchor", "READ", "BEFORE")),
7330
7318
  Gn(je(g, t, n.field, "anchor", "READ"))
7331
7319
  )
7332
- }), C = ae(_("anchor"), n.field.property), F = ee(
7320
+ }), C = ue(U("anchor"), n.field.property), F = se(
7333
7321
  "<>",
7334
- ae(_("this"), t.key.property),
7335
- ae(_("anchor"), t.key.property)
7322
+ ue(U("this"), t.key.property),
7323
+ ue(U("anchor"), t.key.property)
7336
7324
  )) : C = B(g, $), b.push({
7337
7325
  kind: "procedure",
7338
7326
  procedure: "db.index.vector.queryNodes",
@@ -7354,10 +7342,10 @@ function tr(e, t, n, i, s, o = !1) {
7354
7342
  if (p.push(
7355
7343
  {
7356
7344
  kind: "with",
7357
- items: [{ expr: _("this") }, { expr: _("score") }],
7345
+ items: [{ expr: U("this") }, { expr: U("score") }],
7358
7346
  orderBy: [
7359
- { expr: _("score"), direction: "DESC" },
7360
- { expr: ae(_("this"), t.key.property), direction: "ASC" }
7347
+ { expr: U("score"), direction: "DESC" },
7348
+ { expr: ue(U("this"), t.key.property), direction: "ASC" }
7361
7349
  ],
7362
7350
  // One more than the page, to tell whether another follows.
7363
7351
  limit: B(e, o ? a + 1 : a)
@@ -7367,12 +7355,12 @@ function tr(e, t, n, i, s, o = !1) {
7367
7355
  kind: "return",
7368
7356
  items: [
7369
7357
  { expr: m.expr, alias: "node" },
7370
- { expr: _("score"), alias: "score" },
7358
+ { expr: U("score"), alias: "score" },
7371
7359
  ...o ? [
7372
7360
  {
7373
7361
  expr: {
7374
7362
  kind: "list",
7375
- items: [_("score"), ae(_("this"), t.key.property)]
7363
+ items: [U("score"), ue(U("this"), t.key.property)]
7376
7364
  },
7377
7365
  alias: "__cursor"
7378
7366
  }
@@ -7428,7 +7416,7 @@ function nr(e, t, n, i) {
7428
7416
  {
7429
7417
  kind: "return",
7430
7418
  items: [
7431
- { expr: oe("count", _("this")), alias: "totalCount" },
7419
+ { expr: ee("count", U("this")), alias: "totalCount" },
7432
7420
  ...Ls(s, t, "this")
7433
7421
  ]
7434
7422
  }
@@ -7989,11 +7977,11 @@ async function Si(e, t, n) {
7989
7977
  for (const [u, d] of r) {
7990
7978
  const f = s.get(u) ?? /* @__PURE__ */ new Map(), p = d.filter((E) => !f.has(J(E)));
7991
7979
  if (p.length === 0) continue;
7992
- ge(e.ctx(), u, "DELETE");
7980
+ me(e.ctx(), u, "DELETE");
7993
7981
  const h = e.ctx(), m = Re(h, u, "n", "DELETE", "BEFORE"), g = await e.run(
7994
7982
  `UNWIND ${P(B(h, p))} AS k
7995
7983
  MATCH (n:${S(u.labels[0])}) WHERE n.${S(u.key.property)} = k
7996
- RETURN n.${S(u.key.property)} AS key, ${m ? P(m) : "true"} AS ok, ${P(ce(h, u, "n", "DELETE") ?? G(!0))} AS visible`,
7984
+ RETURN n.${S(u.key.property)} AS key, ${m ? P(m) : "true"} AS ok, ${P(ae(h, u, "n", "DELETE") ?? G(!0))} AS visible`,
7997
7985
  h
7998
7986
  );
7999
7987
  for (const E of g) {
@@ -8179,12 +8167,12 @@ function sr(e, t, n) {
8179
8167
  "BAD_USER_INPUT",
8180
8168
  `adjust.${s} takes exactly one operation`
8181
8169
  );
8182
- const [c, l] = a[0], u = ae(_("n"), r.property);
8170
+ const [c, l] = a[0], u = ue(U("n"), r.property);
8183
8171
  let d;
8184
8172
  if (r.list) {
8185
- const f = oe("coalesce", u, { kind: "list", items: [] });
8173
+ const f = ee("coalesce", u, { kind: "list", items: [] });
8186
8174
  if (c === "push")
8187
- d = ee("+", f, B(e, l));
8175
+ d = se("+", f, B(e, l));
8188
8176
  else if (c === "pop") {
8189
8177
  if (!Number.isInteger(l) || l < 0)
8190
8178
  throw M(
@@ -8195,7 +8183,7 @@ function sr(e, t, n) {
8195
8183
  kind: "slice",
8196
8184
  target: f,
8197
8185
  from: void 0,
8198
- to: ee("-", oe("size", f), B(e, l))
8186
+ to: se("-", ee("size", f), B(e, l))
8199
8187
  };
8200
8188
  } else {
8201
8189
  const p = "adjust_item";
@@ -8203,23 +8191,23 @@ function sr(e, t, n) {
8203
8191
  kind: "listComprehension",
8204
8192
  variable: p,
8205
8193
  list: f,
8206
- where: { kind: "not", expr: ee("IN", _(p), B(e, l)) },
8194
+ where: { kind: "not", expr: se("IN", U(p), B(e, l)) },
8207
8195
  projection: void 0
8208
8196
  };
8209
8197
  }
8210
8198
  } else {
8211
- const f = oe("coalesce", u, G(0)), p = B(e, l);
8199
+ const f = ee("coalesce", u, G(0)), p = B(e, l);
8212
8200
  if (c === "divide" && Number(l) === 0)
8213
8201
  throw M(
8214
8202
  "BAD_USER_INPUT",
8215
8203
  `adjust.${s}.divide by zero`
8216
8204
  );
8217
- d = ee({
8205
+ d = se({
8218
8206
  add: "+",
8219
8207
  subtract: "-",
8220
8208
  multiply: "*",
8221
8209
  divide: "/"
8222
- }[c], f, p), c === "divide" && r.type === "Int" && (d = oe("toInteger", d));
8210
+ }[c], f, p), c === "divide" && r.type === "Int" && (d = ee("toInteger", d));
8223
8211
  }
8224
8212
  i.push(`n.${S(r.property)} = ${P(d)}`);
8225
8213
  }
@@ -8512,8 +8500,8 @@ function Ri(e, t, n, i, s) {
8512
8500
  ([p, h]) => `r.${S(p)} = CASE WHEN size(keys(row.props)) > 0 THEN ${h} ELSE r.${S(p)} END`
8513
8501
  );
8514
8502
  return { text: `UNWIND ${c} AS row
8515
- MATCH (a:${S(o.labels[0])}) WHERE a.${S(o.key.property)} = row.from` + ke(ce(a, o, "a", "CREATE_RELATIONSHIP")) + `
8516
- MATCH (b:${S(r.labels[0])}) WHERE b.${S(r.key.property)} = row.to` + ke(dd(ce(a, r, "b", "READ"))) + ke(ce(a, r, "b", "CREATE_RELATIONSHIP")) + (typeof s == "string" ? "" : `
8503
+ MATCH (a:${S(o.labels[0])}) WHERE a.${S(o.key.property)} = row.from` + ke(ae(a, o, "a", "CREATE_RELATIONSHIP")) + `
8504
+ MATCH (b:${S(r.labels[0])}) WHERE b.${S(r.key.property)} = row.to` + ke(dd(ae(a, r, "b", "READ"))) + ke(ae(a, r, "b", "CREATE_RELATIONSHIP")) + (typeof s == "string" ? "" : `
8517
8505
  WITH a, b, row, size([(a)${Xe(n, "", "b", void 0)} | 1]) > 0 AS existed`) + `
8518
8506
  MERGE (a)${Xe(n, "r", "b", void 0)}
8519
8507
  ON CREATE SET ${u.join(", ")}
@@ -8670,7 +8658,7 @@ class Gf {
8670
8658
  * the new node's required field pointing back.
8671
8659
  */
8672
8660
  create(t, n, i) {
8673
- ge(this.ctx, t, "CREATE");
8661
+ me(this.ctx, t, "CREATE");
8674
8662
  let s = n[t.key.name];
8675
8663
  if (s == null) {
8676
8664
  if (!t.key.generate)
@@ -8807,7 +8795,7 @@ class Gf {
8807
8795
  }
8808
8796
  const r = this.model.nodes.get(i.target), a = yt(s.connect), c = yt(s.create), l = yt(s.update), u = s.disconnect, d = s.delete;
8809
8797
  if (o && d != null && d !== !1) {
8810
- ge(this.ctx, r, "DELETE");
8798
+ me(this.ctx, r, "DELETE");
8811
8799
  const f = d === !0 ? {} : d;
8812
8800
  this.nestedDeletes.push({
8813
8801
  rel: i,
@@ -8821,17 +8809,17 @@ class Gf {
8821
8809
  "BAD_USER_INPUT",
8822
8810
  `${t.name}.${i.name} holds one ${r.name}: give connect or create, not both`
8823
8811
  );
8824
- if (a.length + c.length > 0 && (ge(this.ctx, t, "CREATE_RELATIONSHIP"), ge(this.ctx, r, "CREATE_RELATIONSHIP")), o) {
8812
+ if (a.length + c.length > 0 && (me(this.ctx, t, "CREATE_RELATIONSHIP"), me(this.ctx, r, "CREATE_RELATIONSHIP")), o) {
8825
8813
  if (i.list) {
8826
8814
  const f = yt(u);
8827
- f.length > 0 && (ge(this.ctx, t, "DELETE_RELATIONSHIP"), this.disconnects.push({ rel: i, from: n, to: f }));
8815
+ f.length > 0 && (me(this.ctx, t, "DELETE_RELATIONSHIP"), this.disconnects.push({ rel: i, from: n, to: f }));
8828
8816
  } else if (u === !0 || a.length + c.length > 0) {
8829
8817
  if (u === !0 && i.required && !i.via && a.length + c.length === 0)
8830
8818
  throw M(
8831
8819
  "BAD_USER_INPUT",
8832
8820
  `${t.name}.${i.name} is required: replace it with connect or create instead`
8833
8821
  );
8834
- ge(this.ctx, t, "DELETE_RELATIONSHIP");
8822
+ me(this.ctx, t, "DELETE_RELATIONSHIP");
8835
8823
  const f = a.length === 1 ? a[0][r.key.name] : void 0;
8836
8824
  this.disconnects.push({
8837
8825
  rel: i,
@@ -9244,7 +9232,7 @@ RETURN assert(count(n) = 0, ${P(G(Yn(t, n.name, s)))}) AS ok`,
9244
9232
  );
9245
9233
  this.assertBatch(void 0, 1);
9246
9234
  const c = this.ctx();
9247
- ge(c, n, "UPDATE");
9235
+ me(c, n, "UPDATE");
9248
9236
  const l = [
9249
9237
  .../* @__PURE__ */ new Set([...Object.keys(s), ...Object.keys(o ?? {})])
9250
9238
  ], u = l.map((N) => n.fields.get(N)).filter((N) => N?.kind === "scalar" && !N.key);
@@ -9278,7 +9266,7 @@ RETURN assert(count(n) = 0, ${P(G(Yn(t, n.name, s)))}) AS ok`,
9278
9266
  G(Yn("forbidden", n.name, "UPDATE"))
9279
9267
  ), E = `UNWIND ${P(B(d, [{ key: p.key, set: p.set }]))} AS row
9280
9268
  MATCH (n:${S(n.labels[0])}) WHERE n.${S(n.key.property)} = row.key` + // A node the caller cannot read is missing, not forbidden.
9281
- ke(ce(d, n, "n", "READ")) + ke(ce(d, n, "n", "UPDATE")) + `
9269
+ ke(ae(d, n, "n", "READ")) + ke(ae(d, n, "n", "UPDATE")) + `
9282
9270
  WITH n, row` + (g ? ", properties(n) AS lora_previous" : "") + (f ? `, assert(${P(f)}, ${y}) AS lora_before` : "") + `
9283
9271
  SET ${this.#l(n, m).join(", ")}` + (p.remove.length > 0 ? `
9284
9272
  REMOVE ${p.remove.map((N) => `n.${S(N)}`).join(", ")}` : "") + `
@@ -9289,7 +9277,7 @@ RETURN n.${S(n.key.property)} AS key` + (g ? ", lora_previous AS props" : "") +
9289
9277
  const N = this.ctx();
9290
9278
  this.#o.push(
9291
9279
  this.run(
9292
- `MATCH (n:${S(n.labels[0])}) WHERE n.${S(n.key.property)} = ${P(B(N, i))}` + ke(ce(N, n, "n", "READ")) + ke(ce(N, n, "n", "UPDATE")) + `
9280
+ `MATCH (n:${S(n.labels[0])}) WHERE n.${S(n.key.property)} = ${P(B(N, i))}` + ke(ae(N, n, "n", "READ")) + ke(ae(N, n, "n", "UPDATE")) + `
9293
9281
  WITH count(n) AS found
9294
9282
  RETURN assert(found > 0, ${this.assertions.failsAs(() => Sc)}) AS ok`,
9295
9283
  N
@@ -9408,7 +9396,7 @@ RETURN assert(found > 0, ${this.assertions.failsAs(() => Sc)}) AS ok`,
9408
9396
  async moveHiddenKeys(t) {
9409
9397
  const n = [];
9410
9398
  for (const [i, s] of t.creates) {
9411
- const o = this.ctx(), r = ce(o, i, "n", "READ");
9399
+ const o = this.ctx(), r = ae(o, i, "n", "READ");
9412
9400
  if (!r) continue;
9413
9401
  const a = s.map((l) => ({ key: l.key, to: Xf(i) }));
9414
9402
  this.#e.push({
@@ -9531,7 +9519,7 @@ CREATE (n:${r} { ${p.join(", ")} })`,
9531
9519
  keep: g.keep ?? null
9532
9520
  }))
9533
9521
  )
9534
- ), u = ke(ce(c, a, "b", "READ")) + ke(ce(c, a, "b", "DELETE_RELATIONSHIP")) + ke(ce(c, r, "a", "DELETE_RELATIONSHIP")), d = `b.${S(a.key.property)}`, f = `UNWIND ${l} AS row
9522
+ ), u = ke(ae(c, a, "b", "READ")) + ke(ae(c, a, "b", "DELETE_RELATIONSHIP")) + ke(ae(c, r, "a", "DELETE_RELATIONSHIP")), d = `b.${S(a.key.property)}`, f = `UNWIND ${l} AS row
9535
9523
  ` + (s ? `UNWIND row.to AS k
9536
9524
  ` : "") + jt("a", r, "row.from", i, "r", "b", a) + (s ? ` AND ${d} = k` : (
9537
9525
  // Re-connecting the current target keeps its relationship.
@@ -9584,7 +9572,7 @@ CREATE (n:${r} { ${p.join(", ")} })`,
9584
9572
  "r",
9585
9573
  "b",
9586
9574
  s
9587
- ) + (n.to !== void 0 ? ` AND b.${S(s.key.property)} = ${P(B(o, n.to))}` : "") + ke(ce(o, s, "b", "READ")) + `
9575
+ ) + (n.to !== void 0 ? ` AND b.${S(s.key.property)} = ${P(B(o, n.to))}` : "") + ke(ae(o, s, "b", "READ")) + `
9588
9576
  SET r += ${P(B(o, n.set))}` + ud(this.env.model, n.rel) + (n.remove.length > 0 ? `
9589
9577
  REMOVE ${n.remove.map((c) => `r.${S(c)}`).join(", ")}` : "") + `
9590
9578
  RETURN b.${S(s.key.property)} AS key`, a = await this.run(r, o);
@@ -9621,7 +9609,7 @@ RETURN b.${S(s.key.property)} AS key`, a = await this.run(r, o);
9621
9609
  "",
9622
9610
  "b",
9623
9611
  s
9624
- ) + ke(qe(r, s, "b", n.where)) + ke(ce(r, s, "b", "READ")) + ke(ce(r, s, "b", "DELETE")) + `
9612
+ ) + ke(qe(r, s, "b", n.where)) + ke(ae(r, s, "b", "READ")) + ke(ae(r, s, "b", "DELETE")) + `
9625
9613
  RETURN DISTINCT b.${S(s.key.property)} AS key ORDER BY key LIMIT ${P(B(r, o + 1))}`,
9626
9614
  r
9627
9615
  );
@@ -9673,7 +9661,7 @@ RETURN DISTINCT b.${S(s.key.property)} AS key`,
9673
9661
  if (i.length === 0) return [];
9674
9662
  await this.open(), this.assertBatch(void 0, i.length);
9675
9663
  const o = this.ctx();
9676
- ge(o, n, "UPDATE");
9664
+ me(o, n, "UPDATE");
9677
9665
  const r = /* @__PURE__ */ new Set();
9678
9666
  for (const { input: I } of i)
9679
9667
  for (const R of Object.keys(I)) r.add(R);
@@ -9694,7 +9682,7 @@ RETURN DISTINCT b.${S(s.key.property)} AS key`,
9694
9682
  )
9695
9683
  )} AS k
9696
9684
  MATCH (n:${S(n.labels[0])}) WHERE n.${S(n.key.property)} = k` + // A node the caller cannot read is missing, not forbidden.
9697
- ke(ce(c, n, "n", "READ")) + ke(ce(c, n, "n", "UPDATE")) + `
9685
+ ke(ae(c, n, "n", "READ")) + ke(ae(c, n, "n", "UPDATE")) + `
9698
9686
  RETURN n.${S(n.key.property)} AS key, ${l ? P(l) : "true"} AS ok` + (n.subscriptionOptions.previousState ? ", properties(n) AS props" : ""),
9699
9687
  c
9700
9688
  );
@@ -9847,7 +9835,7 @@ RETURN n.${S(t.key.property)} AS key, ${a} AS ok`;
9847
9835
  `\`where\` must filter something: bulk ${i.toLowerCase()}s never apply to every ${t.name} by accident`
9848
9836
  );
9849
9837
  const a = await this.run(
9850
- `MATCH (this:${S(t.labels[0])}) WHERE ${P(r)}` + ke(ce(o, t, "this", "READ")) + ke(ce(o, t, "this", i)) + `
9838
+ `MATCH (this:${S(t.labels[0])}) WHERE ${P(r)}` + ke(ae(o, t, "this", "READ")) + ke(ae(o, t, "this", i)) + `
9851
9839
  RETURN this.${S(t.key.property)} AS key ORDER BY key LIMIT ${P(B(o, s + 1))}`,
9852
9840
  o
9853
9841
  );
@@ -9901,7 +9889,7 @@ async function Zf(e, t, n) {
9901
9889
  let u;
9902
9890
  const d = [];
9903
9891
  try {
9904
- r.length > 0 && ge(i, t, "UPDATE"), u = pe(
9892
+ r.length > 0 && me(i, t, "UPDATE"), u = pe(
9905
9893
  Re(i, t, "n", "UPDATE", "BEFORE"),
9906
9894
  Re(i, t, "n", "UPDATE", "AFTER"),
9907
9895
  ...[...c].flatMap((m) => [
@@ -9919,7 +9907,7 @@ async function Zf(e, t, n) {
9919
9907
  const F = C.connects.get(g);
9920
9908
  F && (C.row[E] = b ? F.map((Y) => Y.to) : F);
9921
9909
  }
9922
- const $ = ` WHERE ${kt("m", y)}` + ke(ce(i, y, "m", "READ")) + ke(ce(i, y, "m", "CREATE_RELATIONSHIP")), N = `[(n)${Xe(g, "r", "m", void 0)}${$} AND m.${S(y.key.property)} = ${b ? "want" : "want.to"} | properties(r)]`, O = b ? `all(want IN row.${E} WHERE size(${N}) > 0)` : `all(want IN row.${E} WHERE any(edge IN ${N} WHERE all(k IN keys(want.props) WHERE edge[k] = want.props[k])))`, I = g.list ? "" : ` AND (row.${E} IS NULL OR size([(n)${Xe(g, "r", "m", void 0)} WHERE ${kt("m", y)} | 1]) = 1)`, R = ce(i, t, "n", "CREATE_RELATIONSHIP");
9910
+ const $ = ` WHERE ${kt("m", y)}` + ke(ae(i, y, "m", "READ")) + ke(ae(i, y, "m", "CREATE_RELATIONSHIP")), N = `[(n)${Xe(g, "r", "m", void 0)}${$} AND m.${S(y.key.property)} = ${b ? "want" : "want.to"} | properties(r)]`, O = b ? `all(want IN row.${E} WHERE size(${N}) > 0)` : `all(want IN row.${E} WHERE any(edge IN ${N} WHERE all(k IN keys(want.props) WHERE edge[k] = want.props[k])))`, I = g.list ? "" : ` AND (row.${E} IS NULL OR size([(n)${Xe(g, "r", "m", void 0)} WHERE ${kt("m", y)} | 1]) = 1)`, R = ae(i, t, "n", "CREATE_RELATIONSHIP");
9923
9911
  d.push(
9924
9912
  `(row.${E} IS NULL OR (${O}${I}${R ? ` AND ${P(R)}` : ""}))`
9925
9913
  );
@@ -9937,7 +9925,7 @@ async function Zf(e, t, n) {
9937
9925
  ...u ? [P(u)] : []
9938
9926
  ], h = await e.run(
9939
9927
  `UNWIND ${f} AS row
9940
- MATCH (n:${S(t.labels[0])}) WHERE n.${S(t.key.property)} = row.key` + ke(ce(i, t, "n", "READ")) + ke(ce(i, t, "n", "UPDATE")) + `
9928
+ MATCH (n:${S(t.labels[0])}) WHERE n.${S(t.key.property)} = row.key` + ke(ae(i, t, "n", "READ")) + ke(ae(i, t, "n", "UPDATE")) + `
9941
9929
  RETURN n.${S(t.key.property)} AS key, coalesce(${p.join(`
9942
9930
  AND `)}, false) AS same`,
9943
9931
  i
@@ -9997,7 +9985,7 @@ function tp(e, t, n) {
9997
9985
  for (const a of r)
9998
9986
  for (const c of ["BEFORE", "AFTER"])
9999
9987
  if (Re(e, t, "a", a, c) || Re(e, i, "b", a, c)) return !1;
10000
- be(e, t.name, n, "UPDATE"), be(e, t.name, n, "CREATE_RELATIONSHIP"), ge(e, t, "CREATE_RELATIONSHIP"), ge(e, i, "CREATE_RELATIONSHIP"), ge(e, t, "DELETE_RELATIONSHIP");
9988
+ be(e, t.name, n, "UPDATE"), be(e, t.name, n, "CREATE_RELATIONSHIP"), me(e, t, "CREATE_RELATIONSHIP"), me(e, i, "CREATE_RELATIONSHIP"), me(e, t, "DELETE_RELATIONSHIP");
10001
9989
  } catch {
10002
9990
  return !1;
10003
9991
  }
@@ -10262,7 +10250,7 @@ async function pp(e, t, n, i, s, o) {
10262
10250
  maxListFilter: e.maxListFilter,
10263
10251
  maxStringFilter: e.maxStringFilter
10264
10252
  }), c = t === "UPSERT" ? "CREATE" : t === "UPDATE_MANY" ? "UPDATE" : t === "DELETE_MANY" ? "DELETE" : t;
10265
- ge(a, n, c), t !== "UPSERT" && up(a, n, c), await cp(e.model, e.validators ?? {}, t, n, i), t === "UPDATE" && !i.update && (i = { ...i, update: {} }), e = { ...e, computed: fp(e, t, n, i) };
10253
+ me(a, n, c), t !== "UPSERT" && up(a, n, c), await cp(e.model, e.validators ?? {}, t, n, i), t === "UPDATE" && !i.update && (i = { ...i, update: {} }), e = { ...e, computed: fp(e, t, n, i) };
10266
10254
  const l = {
10267
10255
  mode: "write",
10268
10256
  timeoutMs: e.timeoutMs,
@@ -10300,20 +10288,20 @@ async function pp(e, t, n, i, s, o) {
10300
10288
  );
10301
10289
  let F;
10302
10290
  const Y = () => O(
10303
- ue.createPayload(n),
10304
- ue.createdField(n),
10291
+ le.createPayload(n),
10292
+ le.createdField(n),
10305
10293
  C
10306
10294
  );
10307
10295
  await h.apply(R, () => {
10308
10296
  g = h.single ? h.watch(Gt(h)) : Pe(Gt(h)), h.single && (F = h.watch(Y())), h.assertNothingMoved();
10309
10297
  }), I = {
10310
- [ue.createdField(n)]: await (F ?? Y()),
10298
+ [le.createdField(n)]: await (F ?? Y()),
10311
10299
  info: h.info
10312
10300
  };
10313
10301
  break;
10314
10302
  }
10315
10303
  case "UPDATE": {
10316
- const C = i[n.key.name], F = ue.updatedField(n), Y = i.update ?? {}, v = i.adjust;
10304
+ const C = i[n.key.name], F = le.updatedField(n), Y = i.update ?? {}, v = i.adjust;
10317
10305
  let T;
10318
10306
  const D = await h.updateInOne(
10319
10307
  R,
@@ -10329,7 +10317,7 @@ async function pp(e, t, n, i, s, o) {
10329
10317
  ]).then(() => {
10330
10318
  })
10331
10319
  ), T = h.watch(
10332
- O(ue.updatePayload(n), F, [C])
10320
+ O(le.updatePayload(n), F, [C])
10333
10321
  ), h.assertNothingMoved();
10334
10322
  }
10335
10323
  );
@@ -10337,8 +10325,8 @@ async function pp(e, t, n, i, s, o) {
10337
10325
  let ne, de;
10338
10326
  try {
10339
10327
  ne = await D.done, [de] = await T;
10340
- } catch (U) {
10341
- if (h.assertions.refusedBy(U) !== Sc) throw U;
10328
+ } catch (_) {
10329
+ if (h.assertions.refusedBy(_) !== Sc) throw _;
10342
10330
  h.nothingWritten(), g = Promise.resolve(), ne = [];
10343
10331
  }
10344
10332
  I = {
@@ -10349,7 +10337,7 @@ async function pp(e, t, n, i, s, o) {
10349
10337
  }
10350
10338
  const A = h.plan(), x = await h.update(A, n, [{ key: C, input: Y }], v);
10351
10339
  let q;
10352
- const X = () => x.length > 0 ? O(ue.updatePayload(n), F, [C]) : Promise.resolve([null]);
10340
+ const X = () => x.length > 0 ? O(le.updatePayload(n), F, [C]) : Promise.resolve([null]);
10353
10341
  await h.apply(A, () => {
10354
10342
  q = Pe(h.validateUpdated()), g = Pe(Gt(h));
10355
10343
  }), await q;
@@ -10364,7 +10352,7 @@ async function pp(e, t, n, i, s, o) {
10364
10352
  ))
10365
10353
  throw M(
10366
10354
  "BAD_USER_INPUT",
10367
- `update${n.name} changes relationships; ${ue.updateMany(n)} changes properties`
10355
+ `update${n.name} changes relationships; ${le.updateMany(n)} changes properties`
10368
10356
  );
10369
10357
  const F = await h.resolveKeys(
10370
10358
  n,
@@ -10379,14 +10367,14 @@ async function pp(e, t, n, i, s, o) {
10379
10367
  );
10380
10368
  let v;
10381
10369
  const T = () => O(
10382
- ue.updateManyPayload(n),
10383
- ue.createdField(n),
10370
+ le.updateManyPayload(n),
10371
+ le.createdField(n),
10384
10372
  Y
10385
10373
  );
10386
10374
  await h.apply(R, () => {
10387
10375
  v = Pe(h.validateUpdated()), g = Pe(Gt(h));
10388
10376
  }), await v, I = {
10389
- [ue.createdField(n)]: await T(),
10377
+ [le.createdField(n)]: await T(),
10390
10378
  info: h.info
10391
10379
  };
10392
10380
  break;
@@ -10396,7 +10384,7 @@ async function pp(e, t, n, i, s, o) {
10396
10384
  break;
10397
10385
  case "DELETE": {
10398
10386
  const C = h.ctx(), F = await h.run(
10399
- `MATCH (n:${S(n.labels[0])}) WHERE n.${S(n.key.property)} = ${P(B(C, i[n.key.name]))}` + ke(ce(C, n, "n", "READ")) + ke(ce(C, n, "n", "DELETE")) + `
10387
+ `MATCH (n:${S(n.labels[0])}) WHERE n.${S(n.key.property)} = ${P(B(C, i[n.key.name]))}` + ke(ae(C, n, "n", "READ")) + ke(ae(C, n, "n", "DELETE")) + `
10400
10388
  RETURN n.${S(n.key.property)} AS key`,
10401
10389
  C
10402
10390
  );
@@ -10473,9 +10461,9 @@ async function hp(e, t, n, i, s) {
10473
10461
  c.has(h) ? l.has(h) || u.push({ key: r[f], input: a[f] }) : t.create(n, p);
10474
10462
  }
10475
10463
  await e.update(t, n, u), await e.apply(t), await e.validateUpdated();
10476
- const d = ue.createdField(n);
10464
+ const d = le.createdField(n);
10477
10465
  return {
10478
- [d]: await s(ue.upsertPayload(n), d, r),
10466
+ [d]: await s(le.upsertPayload(n), d, r),
10479
10467
  info: e.info
10480
10468
  };
10481
10469
  }
@@ -10738,11 +10726,11 @@ function wp(e) {
10738
10726
  for (const n of e.nodes.values()) {
10739
10727
  const i = fr(n.fields);
10740
10728
  if (n.mutations.has("CREATE")) {
10741
- const s = ue.createInput(n.name);
10729
+ const s = le.createInput(n.name);
10742
10730
  t[s] = ni(e, s, i, "CREATE");
10743
10731
  }
10744
10732
  if (n.mutations.has("UPDATE")) {
10745
- const s = ue.updateInput(n.name);
10733
+ const s = le.updateInput(n.name);
10746
10734
  t[s] = ni(e, s, i, "UPDATE");
10747
10735
  }
10748
10736
  }
@@ -12153,7 +12141,7 @@ const wr = ["CONTAINS", "STARTS_WITH", "ENDS_WITH"], nt = ["LT", "LTE", "GT", "G
12153
12141
  CartesianPoint: ["WITHIN_BBOX", "DISTANCE"]
12154
12142
  }, qp = /* @__PURE__ */ new Set(["String", "ID", "Int", "BigInt"]), Wp = /* @__PURE__ */ new Set(["Point", "CartesianPoint", "Duration"]);
12155
12143
  function ts(e, t, n, i, s) {
12156
- const o = (se) => i.push({ type: e.name, field: t.name, message: se }), r = On(t.type), a = He(t.type);
12144
+ const o = (ie) => i.push({ type: e.name, field: t.name, message: ie }), r = On(t.type), a = He(t.type);
12157
12145
  let c, l;
12158
12146
  if (Lt(a))
12159
12147
  c = "Enum", l = a.name;
@@ -12172,9 +12160,9 @@ function ts(e, t, n, i, s) {
12172
12160
  const v = K(n("vector"), t, o);
12173
12161
  let T;
12174
12162
  if (v) {
12175
- const se = v.dimensions;
12176
- (c !== "Float" || !r.list) && o("@vector needs a [Float!] field"), s.allowKey || o("@vector is not allowed on relationship properties"), se >= 1 && se <= 4096 || o("@vector(dimensions:) must be between 1 and 4096"), T = {
12177
- dimensions: se,
12163
+ const ie = v.dimensions;
12164
+ (c !== "Float" || !r.list) && o("@vector needs a [Float!] field"), s.allowKey || o("@vector is not allowed on relationship properties"), ie >= 1 && ie <= 4096 || o("@vector(dimensions:) must be between 1 and 4096"), T = {
12165
+ dimensions: ie,
12178
12166
  similarity: v.similarity
12179
12167
  };
12180
12168
  }
@@ -12184,28 +12172,28 @@ function ts(e, t, n, i, s) {
12184
12172
  X && (r.list || c !== "DateTime" && c !== "LocalDateTime" && c !== "Date") && o("@timestamp needs a DateTime, LocalDateTime or Date field"), X && $ && o("@timestamp and @default are exclusive");
12185
12173
  let Z;
12186
12174
  if ($) {
12187
- const se = $.value;
12188
- co(c, r.list, se) || o(`@default(value:) does not fit ${r.list ? `[${c}]` : c}`), d && o("@key cannot have a @default; use @key(generate: true)"), (c === "Point" || c === "CartesianPoint") && o("Point fields cannot have a @default"), Z = { value: se };
12175
+ const ie = $.value;
12176
+ co(c, r.list, ie) || o(`@default(value:) does not fit ${r.list ? `[${c}]` : c}`), d && o("@key cannot have a @default; use @key(generate: true)"), (c === "Point" || c === "CartesianPoint") && o("Point fields cannot have a @default"), Z = { value: ie };
12189
12177
  }
12190
12178
  !s.allowKey && (d || f || h || b) && o("@key, @unique, @relayId and @index are not allowed here"), d && (qp.has(c) || o("@key must be String, ID, Int or BigInt"), r.required || o("@key fields must be non-null"), r.list && o("@key cannot be a list"), p && o("@key cannot be @private")), h && !d && o("@relayId belongs on the @key field"), f && r.list && o("@unique cannot be a list");
12191
12179
  let ne = /* @__PURE__ */ new Set();
12192
12180
  if (y) {
12193
- const se = r.list ? c === "Point" || c === "CartesianPoint" || v ? [] : ["INCLUDES", ...r.required ? [] : ["IS_NULL"]] : [
12181
+ const ie = r.list ? c === "Point" || c === "CartesianPoint" || v ? [] : ["INCLUDES", ...r.required ? [] : ["IS_NULL"]] : [
12194
12182
  ...Bp[c],
12195
12183
  ...r.required ? [] : ["IS_NULL"],
12196
12184
  ...c === "String" || c === "ID" ? ["CASE_INSENSITIVE"] : []
12197
- ], ye = y.byValue ?? (r.list ? ["INCLUDES"] : ["EQ", "IN"]).filter((w) => se.includes(w)), De = ye.filter((w) => !se.includes(w));
12185
+ ], ge = y.byValue ?? (r.list ? ["INCLUDES"] : ["EQ", "IN"]).filter((w) => ie.includes(w)), De = ge.filter((w) => !ie.includes(w));
12198
12186
  De.length > 0 && o(
12199
- `${c} does not support ${De.join(", ")}` + (se.length > 0 ? ` (allowed: ${se.join(", ")})` : "")
12200
- ), ne = new Set(ye.filter((w) => se.includes(w)));
12187
+ `${c} does not support ${De.join(", ")}` + (ie.length > 0 ? ` (allowed: ${ie.join(", ")})` : "")
12188
+ ), ne = new Set(ge.filter((w) => ie.includes(w)));
12201
12189
  }
12202
12190
  d && (ne.add("EQ"), ne.add("IN")), p && (y || m) && o("@private fields cannot be @filterable or @sortable"), m && (r.list || Wp.has(c)) && o(`${r.list ? "lists" : c} cannot be @sortable`), g && (r.list || c === "Point" || c === "CartesianPoint" || p || !s.allowKey) && o("@groupBy needs a readable, non-list, non-Point field of a @node type");
12203
12191
  const de = E?.property ?? t.name;
12204
12192
  de.length === 0 && o("@alias(property:) is empty");
12205
- const U = [];
12193
+ const _ = [];
12206
12194
  if (b) {
12207
- const se = b.kind;
12208
- se === "TEXT" && c !== "String" && c !== "ID" ? o("a TEXT index needs a String or ID field") : se === "POINT" && c !== "Point" && c !== "CartesianPoint" ? o("a POINT index needs a Point field") : se === "RANGE" && (c === "Point" || c === "CartesianPoint") ? o("use a POINT index for Point fields") : se === "RANGE" && Un.has(c) ? o(`${c} values have no order a RANGE index can use`) : U.push(se);
12195
+ const ie = b.kind;
12196
+ ie === "TEXT" && c !== "String" && c !== "ID" ? o("a TEXT index needs a String or ID field") : ie === "POINT" && c !== "Point" && c !== "CartesianPoint" ? o("a POINT index needs a Point field") : ie === "RANGE" && (c === "Point" || c === "CartesianPoint") ? o("use a POINT index for Point fields") : ie === "RANGE" && Un.has(c) ? o(`${c} values have no order a RANGE index can use`) : _.push(ie);
12209
12197
  }
12210
12198
  const z = X !== void 0 || !!F, V = {
12211
12199
  create: z && vr(t, "settable", "onCreate"),
@@ -12214,12 +12202,12 @@ function ts(e, t, n, i, s) {
12214
12202
  (V.create || V.update) && !s.allowKey && (o(
12215
12203
  "a @timestamp or @populatedBy relationship property cannot be made @settable"
12216
12204
  ), V.create = V.update = !1);
12217
- for (const [se, ye] of [
12205
+ for (const [ie, ge] of [
12218
12206
  ["CREATE", "onCreate"],
12219
12207
  ["UPDATE", "onUpdate"]
12220
12208
  ])
12221
- V[se === "CREATE" ? "create" : "update"] && (Y?.validate.some((De) => De.operations.has(se)) || o(
12222
- `@settable(${ye}: true) on a @timestamp or @populatedBy field needs a field-level @authorization(validate:) rule for ${se}: it decides who may supply the value (the schema's bypass is no such rule)`
12209
+ V[ie === "CREATE" ? "create" : "update"] && (Y?.validate.some((De) => De.operations.has(ie)) || o(
12210
+ `@settable(${ge}: true) on a @timestamp or @populatedBy field needs a field-level @authorization(validate:) rule for ${ie}: it decides who may supply the value (the schema's bypass is no such rule)`
12223
12211
  ));
12224
12212
  const H = Hc(n, t, o, {
12225
12213
  type: c,
@@ -12244,7 +12232,7 @@ function ts(e, t, n, i, s) {
12244
12232
  filters: ne,
12245
12233
  sortable: m && !p,
12246
12234
  groupBy: g,
12247
- indexes: U,
12235
+ indexes: _,
12248
12236
  generate: A,
12249
12237
  ...q ? { keyScope: q } : {},
12250
12238
  defaultValue: Z,
@@ -12516,7 +12504,7 @@ function Tr(e, t, n, i, s, o) {
12516
12504
  const ne = o.schema.getType(F), de = Hc(
12517
12505
  n,
12518
12506
  C,
12519
- (U) => r(`argument ${C.name}: ${U}`),
12507
+ (_) => r(`argument ${C.name}: ${_}`),
12520
12508
  {
12521
12509
  type: At[F] ?? (ne && Lt(ne) ? "Enum" : (ne && Cn(ne)) ?? "String"),
12522
12510
  list: Y.list,
@@ -13101,15 +13089,15 @@ function rh(e, t = {}) {
13101
13089
  for (const Q of Object.values(w.getFields())) {
13102
13090
  const W = K(o("jwtClaim"), Q, r(w.name));
13103
13091
  $.set(Q.name, W?.path ?? Q.name);
13104
- const le = K(o("viewer"), Q, r(w.name));
13105
- le && (O && s.push({
13092
+ const ce = K(o("viewer"), Q, r(w.name));
13093
+ ce && (O && s.push({
13106
13094
  type: w.name,
13107
13095
  field: Q.name,
13108
13096
  message: `only one @viewer claim is allowed (${O.claim} has one)`
13109
13097
  }), O = {
13110
13098
  claim: Q.name,
13111
- type: le.type,
13112
- field: le.field
13099
+ type: ce.type,
13100
+ field: ce.field
13113
13101
  });
13114
13102
  }
13115
13103
  continue;
@@ -13184,21 +13172,21 @@ function rh(e, t = {}) {
13184
13172
  type: w.name,
13185
13173
  message: `primary label \`${Q}\` is already used by ${W}`
13186
13174
  }), x.set(Q, w.name);
13187
- const le = /* @__PURE__ */ new Map();
13188
- for (const ie of Object.values(w.getFields())) {
13189
- const at = He(ie.type);
13190
- if (ie.name.startsWith("__")) {
13175
+ const ce = /* @__PURE__ */ new Map();
13176
+ for (const oe of Object.values(w.getFields())) {
13177
+ const at = He(oe.type);
13178
+ if (oe.name.startsWith("__")) {
13191
13179
  s.push({
13192
13180
  type: w.name,
13193
- field: ie.name,
13181
+ field: oe.name,
13194
13182
  message: "names starting with `__` are reserved"
13195
13183
  });
13196
13184
  continue;
13197
13185
  }
13198
13186
  const po = K(
13199
13187
  o("customResolver"),
13200
- ie,
13201
- (Ve) => s.push({ type: w.name, field: ie.name, message: Ve })
13188
+ oe,
13189
+ (Ve) => s.push({ type: w.name, field: oe.name, message: Ve })
13202
13190
  );
13203
13191
  if (po !== void 0) {
13204
13192
  for (const Ve of [
@@ -13209,86 +13197,86 @@ function rh(e, t = {}) {
13209
13197
  "sortable",
13210
13198
  "groupBy"
13211
13199
  ])
13212
- ie.astNode?.directives?.some((Yc) => Yc.name.value === Ve) && s.push({
13200
+ oe.astNode?.directives?.some((Yc) => Yc.name.value === Ve) && s.push({
13213
13201
  type: w.name,
13214
- field: ie.name,
13202
+ field: oe.name,
13215
13203
  message: `@${Ve} cannot be combined with @customResolver`
13216
13204
  });
13217
- le.set(ie.name, {
13205
+ ce.set(oe.name, {
13218
13206
  kind: "custom",
13219
13207
  authentication: oo(
13220
- K(o("authentication"), ie, D(w.name, ie.name))
13208
+ K(o("authentication"), oe, D(w.name, oe.name))
13221
13209
  ),
13222
- name: ie.name,
13210
+ name: oe.name,
13223
13211
  owner: w.name,
13224
13212
  requires: po.requires,
13225
- type: { named: at.name, ...Ei(On(ie.type)) },
13226
- description: ie.description ?? void 0
13213
+ type: { named: at.name, ...Ei(On(oe.type)) },
13214
+ description: oe.description ?? void 0
13227
13215
  });
13228
13216
  continue;
13229
13217
  }
13230
- if (ie.astNode?.directives?.some((Ve) => Ve.name.value === "cypher")) {
13231
- const Ve = Tr(w.name, ie, o, s, I, {
13218
+ if (oe.astNode?.directives?.some((Ve) => Ve.name.value === "cypher")) {
13219
+ const Ve = Tr(w.name, oe, o, s, I, {
13232
13220
  nodeNames: R,
13233
13221
  plainNames: C,
13234
13222
  schema: i,
13235
13223
  root: void 0,
13236
13224
  viewer: O !== void 0
13237
13225
  });
13238
- Ve && le.set(Ve.name, Ve);
13226
+ Ve && ce.set(Ve.name, Ve);
13239
13227
  continue;
13240
13228
  }
13241
13229
  if (Y.has(at.name)) {
13242
13230
  const Ve = Gp(
13243
13231
  w,
13244
- ie,
13232
+ oe,
13245
13233
  o,
13246
13234
  s,
13247
13235
  v,
13248
13236
  n
13249
13237
  );
13250
- Ve && le.set(Ve.name, Ve);
13238
+ Ve && ce.set(Ve.name, Ve);
13251
13239
  continue;
13252
13240
  }
13253
13241
  if (v.has(at.name)) {
13254
13242
  s.push({
13255
13243
  type: w.name,
13256
- field: ie.name,
13244
+ field: oe.name,
13257
13245
  message: `${at.name} is a @relationshipProperties type; reference it from @relationship(properties:)`
13258
13246
  });
13259
13247
  continue;
13260
13248
  }
13261
- if (K(o("relationship"), ie, r(w.name)) !== void 0) {
13249
+ if (K(o("relationship"), oe, r(w.name)) !== void 0) {
13262
13250
  s.push({
13263
13251
  type: w.name,
13264
- field: ie.name,
13252
+ field: oe.name,
13265
13253
  message: "@relationship target must be a @node type"
13266
13254
  });
13267
13255
  continue;
13268
13256
  }
13269
- const Ws = ts(w, ie, o, s, { allowKey: !0 });
13270
- Ws && le.set(Ws.name, Ws);
13257
+ const Ws = ts(w, oe, o, s, { allowKey: !0 });
13258
+ Ws && ce.set(Ws.name, Ws);
13271
13259
  }
13272
- const Ie = [...le.values()].filter(
13273
- (ie) => ie.kind === "scalar"
13260
+ const Ie = [...ce.values()].filter(
13261
+ (oe) => oe.kind === "scalar"
13274
13262
  );
13275
13263
  kr(w.name, Ie, s);
13276
- for (const ie of le.values())
13277
- ie.kind === "relationship" && !ie.list && le.has(`${ie.name}Exists`) && s.push({
13264
+ for (const oe of ce.values())
13265
+ oe.kind === "relationship" && !oe.list && ce.has(`${oe.name}Exists`) && s.push({
13278
13266
  type: w.name,
13279
- field: `${ie.name}Exists`,
13280
- message: `collides with the ${ie.name}Exists filter of the single relationship ${ie.name}; rename one`
13267
+ field: `${oe.name}Exists`,
13268
+ message: `collides with the ${oe.name}Exists filter of the single relationship ${oe.name}; rename one`
13281
13269
  });
13282
- const Me = Ie.filter((ie) => ie.key);
13270
+ const Me = Ie.filter((oe) => oe.key);
13283
13271
  if (Me.length !== 1) {
13284
13272
  s.push({
13285
13273
  type: w.name,
13286
- message: Me.length === 0 ? "a @node type needs exactly one @key field" : `only one @key field is allowed (found ${Me.map((ie) => ie.name).join(", ")})`
13274
+ message: Me.length === 0 ? "a @node type needs exactly one @key field" : `only one @key field is allowed (found ${Me.map((oe) => oe.name).join(", ")})`
13287
13275
  });
13288
13276
  continue;
13289
13277
  }
13290
13278
  const Le = Me[0];
13291
- Ie.some((ie) => ie.relayId) && le.has("id") && s.push({
13279
+ Ie.some((oe) => oe.relayId) && ce.has("id") && s.push({
13292
13280
  type: w.name,
13293
13281
  field: "id",
13294
13282
  message: "@relayId adds a global `id` field; rename this field or map it with @alias"
@@ -13307,14 +13295,14 @@ function rh(e, t = {}) {
13307
13295
  K(o("authorization"), w, r(w.name))
13308
13296
  );
13309
13297
  if (fo.has("CREATE"))
13310
- for (const ie of Ie)
13311
- ie.required && ie.readonly && !ie.defaultValue && !ie.timestamp?.has("CREATE") && !ie.populatedBy?.operations.has("CREATE") && !(ie.key && ie.generate) && s.push({
13298
+ for (const oe of Ie)
13299
+ oe.required && oe.readonly && !oe.defaultValue && !oe.timestamp?.has("CREATE") && !oe.populatedBy?.operations.has("CREATE") && !(oe.key && oe.generate) && s.push({
13312
13300
  type: w.name,
13313
- field: ie.name,
13301
+ field: oe.name,
13314
13302
  message: "is required but cannot be set on create; add @default, @timestamp, @populatedBy(operations: [CREATE]) or @key(generate: true), or drop @mutation(operations: CREATE)"
13315
13303
  });
13316
13304
  const Bn = k.plural ?? Gs(w.name);
13317
- for (const ie of [
13305
+ for (const oe of [
13318
13306
  Bn,
13319
13307
  `${Bn}Connection`,
13320
13308
  `${Bn}Aggregate`,
@@ -13322,17 +13310,17 @@ function rh(e, t = {}) {
13322
13310
  ...mt.map((at) => at.queryName),
13323
13311
  `${ln(w.name)}Changed`
13324
13312
  ]) {
13325
- const at = q.get(ie);
13313
+ const at = q.get(oe);
13326
13314
  at && s.push({
13327
13315
  type: w.name,
13328
- message: `root field \`${ie}\` collides with ${at}; set @node(plural:)`
13329
- }), q.set(ie, w.name);
13316
+ message: `root field \`${oe}\` collides with ${at}; set @node(plural:)`
13317
+ }), q.set(oe, w.name);
13330
13318
  }
13331
13319
  A.set(w.name, {
13332
13320
  name: w.name,
13333
13321
  labels: L,
13334
13322
  plural: Bn,
13335
- fields: le,
13323
+ fields: ce,
13336
13324
  key: Le,
13337
13325
  read: gt.read ?? !0,
13338
13326
  aggregate: gt.aggregate ?? !1,
@@ -13341,7 +13329,7 @@ function rh(e, t = {}) {
13341
13329
  authenticationJwt: qs?.jwt,
13342
13330
  authorization: Jc,
13343
13331
  search: mt,
13344
- interfaces: w.getInterfaces().map((ie) => ie.name),
13332
+ interfaces: w.getInterfaces().map((oe) => oe.name),
13345
13333
  uniqueTogether: [],
13346
13334
  triggers: [],
13347
13335
  outbox: K(o("outbox"), w, r(w.name)) !== void 0,
@@ -13397,7 +13385,7 @@ function rh(e, t = {}) {
13397
13385
  }
13398
13386
  }
13399
13387
  }
13400
- const le = K(o("query"), w, k) ?? {}, Ie = K(o("plural"), w, k)?.value ?? Gs(w.name), Me = q.get(Ie);
13388
+ const ce = K(o("query"), w, k) ?? {}, Ie = K(o("plural"), w, k)?.value ?? Gs(w.name), Me = q.get(Ie);
13401
13389
  Me && k(`root field \`${Ie}\` collides with ${Me}; set @plural`), q.set(Ie, w.name), X.set(w.name, {
13402
13390
  kind: ut(w) ? "interface" : "union",
13403
13391
  name: w.name,
@@ -13405,7 +13393,7 @@ function rh(e, t = {}) {
13405
13393
  fields: Q,
13406
13394
  relationships: W,
13407
13395
  plural: Ie,
13408
- read: le.read ?? !0,
13396
+ read: ce.read ?? !0,
13409
13397
  limit: Oi(
13410
13398
  K(o("limit"), w, k),
13411
13399
  n,
@@ -13478,13 +13466,13 @@ function rh(e, t = {}) {
13478
13466
  }
13479
13467
  k.size > 0 && de.set(w.name, k);
13480
13468
  }
13481
- const U = { schema: u, byType: de }, z = (w) => on(
13469
+ const _ = { schema: u, byType: de }, z = (w) => on(
13482
13470
  {
13483
13471
  nodes: A,
13484
13472
  props: T,
13485
13473
  viewer: O,
13486
13474
  abstracts: X,
13487
- rules: U,
13475
+ rules: _,
13488
13476
  at: (k) => s.push({
13489
13477
  type: "schema",
13490
13478
  message: `@authorization: ${k}`
@@ -13572,9 +13560,9 @@ function rh(e, t = {}) {
13572
13560
  );
13573
13561
  else if (k.kind === "scalar")
13574
13562
  for (const W of L) {
13575
- const le = W.missingValue;
13563
+ const ce = W.missingValue;
13576
13564
  W.value === null && k.required ? Q(
13577
- le ? "@authorization(mask:) on a non-null field needs a value" : "@authorization(mask:) value null does not fit a non-null field"
13565
+ ce ? "@authorization(mask:) on a non-null field needs a value" : "@authorization(mask:) value null does not fit a non-null field"
13578
13566
  ) : W.value !== null && (!co(k.type, k.list, W.value) || k.enumName !== void 0 && !(d.get(k.enumName)?.values ?? []).some(
13579
13567
  (Ie) => Ie.name === W.value
13580
13568
  )) && Q(
@@ -13615,14 +13603,14 @@ function rh(e, t = {}) {
13615
13603
  field: w.key.name,
13616
13604
  message: "@key(scope: VIEWER) needs a @viewer claim on the @jwt type: it names whose key space a create writes in"
13617
13605
  });
13618
- const H = O ? A.get(O.type) : void 0, re = (w, k, L, Q, W, le) => {
13606
+ const H = O ? A.get(O.type) : void 0, re = (w, k, L, Q, W, ce) => {
13619
13607
  const Ie = {
13620
13608
  nodes: A,
13621
- ...le ? { member: le } : {},
13609
+ ...ce ? { member: ce } : {},
13622
13610
  props: T,
13623
13611
  viewer: O,
13624
13612
  abstracts: X,
13625
- rules: U,
13613
+ rules: _,
13626
13614
  at: (Me) => s.push({
13627
13615
  type: k,
13628
13616
  ...L ? { field: L } : {},
@@ -13648,8 +13636,8 @@ function rh(e, t = {}) {
13648
13636
  for (const k of w.fields.values()) {
13649
13637
  if (!k.authorization) continue;
13650
13638
  for (const W of k.authorization.mask ?? []) {
13651
- const le = { where: W.unless };
13652
- re(w, w.name, k.name, [le]), W.unless = le.where;
13639
+ const ce = { where: W.unless };
13640
+ re(w, w.name, k.name, [ce]), W.unless = ce.where;
13653
13641
  }
13654
13642
  const L = k.authorization.validate.filter(Yt);
13655
13643
  re(w, w.name, k.name, [
@@ -13660,25 +13648,25 @@ function rh(e, t = {}) {
13660
13648
  Q ? re(void 0, w.name, k.name, L, Q) : k.kind === "relationship" && L.length > 0 && X.has(k.target) && (k.memberAuthorization = Ud(
13661
13649
  k,
13662
13650
  A,
13663
- (W, le) => re(
13651
+ (W, ce) => re(
13664
13652
  void 0,
13665
13653
  w.name,
13666
13654
  k.name,
13667
13655
  W,
13668
- { source: w, target: le },
13669
- le
13656
+ { source: w, target: ce },
13657
+ ce
13670
13658
  )
13671
13659
  ));
13672
13660
  }
13673
13661
  }
13674
- const se = /* @__PURE__ */ new Map();
13662
+ const ie = /* @__PURE__ */ new Map();
13675
13663
  for (const w of T.values()) {
13676
13664
  const k = [];
13677
13665
  for (const W of A.values())
13678
- for (const le of W.fields.values())
13679
- le.kind === "relationship" && le.properties === w.name && k.push(le);
13666
+ for (const ce of W.fields.values())
13667
+ ce.kind === "relationship" && ce.properties === w.name && k.push(ce);
13680
13668
  const L = [...new Set(k.map((W) => `${W.owner} → ${W.target}`))], Q = k[0] && V(k[0]);
13681
- se.set(
13669
+ ie.set(
13682
13670
  w.name,
13683
13671
  k.length === 0 ? `no relationship field uses ${w.name}` : L.length > 1 ? `the relationship fields using ${w.name} declare different ends (${k.map((W) => `${W.owner}.${W.name}: ${W.owner} → ${W.target}`).join(", ")})` : Q ?? `${L[0]} has an interface or union end; source and target need @node types`
13684
13672
  );
@@ -13686,7 +13674,7 @@ function rh(e, t = {}) {
13686
13674
  for (const w of T.values())
13687
13675
  for (const k of w.fields.values()) {
13688
13676
  if (!k.authorization) continue;
13689
- const L = se.get(w.name), Q = k.authorization.validate.filter(
13677
+ const L = ie.get(w.name), Q = k.authorization.validate.filter(
13690
13678
  (W) => In(W.where)
13691
13679
  );
13692
13680
  re(
@@ -13815,13 +13803,13 @@ function rh(e, t = {}) {
13815
13803
  if (W.kind !== "relationship" || W === k || W.type !== k.type || !W.members.includes(k.owner) || W.direction === k.direction || // Each pair once: reported on the field that sorts first.
13816
13804
  `${W.owner}.${W.name}` < `${k.owner}.${k.name}`)
13817
13805
  continue;
13818
- const le = [...Qo(W)].filter(
13806
+ const ce = [...Qo(W)].filter(
13819
13807
  (Ie) => L.has(Ie)
13820
13808
  );
13821
- le.length > 0 && s.push({
13809
+ ce.length > 0 && s.push({
13822
13810
  type: w.name,
13823
13811
  field: k.name,
13824
- message: `@authorization: ${le.join(", ")} ${le.length === 1 ? "rules are" : "rules are each"} declared on both ${k.owner}.${k.name} and ${W.owner}.${W.name}, the two sides of ${k.type}; a relationship's rules hold from either side, so declare each operation on one (combine with AND where both must pass)`
13812
+ message: `@authorization: ${ce.join(", ")} ${ce.length === 1 ? "rules are" : "rules are each"} declared on both ${k.owner}.${k.name} and ${W.owner}.${W.name}, the two sides of ${k.type}; a relationship's rules hold from either side, so declare each operation on one (combine with AND where both must pass)`
13825
13813
  });
13826
13814
  }
13827
13815
  }
@@ -13846,28 +13834,28 @@ function rh(e, t = {}) {
13846
13834
  for (const w of T.values())
13847
13835
  for (const k of w.fields.values()) {
13848
13836
  if (!k.authorization && !k.authentication) continue;
13849
- const L = (le) => s.push({ type: w.name, field: k.name, message: le });
13837
+ const L = (ce) => s.push({ type: w.name, field: k.name, message: ce });
13850
13838
  k.authorization?.filter.length && L(
13851
13839
  "@authorization on a relationship property takes validate rules only"
13852
13840
  ), k.authorization?.mask && L("@authorization(mask:) belongs on a scalar field of a @node type");
13853
13841
  const Q = [
13854
- ...(k.authorization?.validate ?? []).flatMap((le) => [...le.operations]),
13842
+ ...(k.authorization?.validate ?? []).flatMap((ce) => [...ce.operations]),
13855
13843
  ...k.authentication ?? []
13856
13844
  ], W = [
13857
- ...new Set(Q.filter((le) => !_d.has(le)))
13845
+ ...new Set(Q.filter((ce) => !_d.has(ce)))
13858
13846
  ];
13859
13847
  W.length > 0 && L(
13860
13848
  `rules on a relationship property apply to READ, CREATE and UPDATE, not ${W.join(", ")}`
13861
13849
  );
13862
- for (const le of k.authorization?.validate ?? []) {
13863
- const Ie = In(le.where) ? se.get(w.name) : void 0;
13850
+ for (const ce of k.authorization?.validate ?? []) {
13851
+ const Ie = In(ce.where) ? ie.get(w.name) : void 0;
13864
13852
  if (typeof Ie == "string") {
13865
13853
  L(
13866
13854
  `@authorization: source, target and edge need every relationship field using ${w.name} to declare the same ends, but ${Ie}`
13867
13855
  );
13868
13856
  continue;
13869
13857
  }
13870
- if (Ie && [...le.operations].some((Me) => Me !== "READ")) {
13858
+ if (Ie && [...ce.operations].some((Me) => Me !== "READ")) {
13871
13859
  L(
13872
13860
  "@authorization: source, target and edge decide per relationship, so they take READ rules only; CREATE and UPDATE rules on a relationship property test claims"
13873
13861
  );
@@ -13879,7 +13867,7 @@ function rh(e, t = {}) {
13879
13867
  void 0,
13880
13868
  w.name,
13881
13869
  k.name,
13882
- le.where,
13870
+ ce.where,
13883
13871
  s,
13884
13872
  $,
13885
13873
  Ie ? H : void 0,
@@ -13897,7 +13885,7 @@ function rh(e, t = {}) {
13897
13885
  $
13898
13886
  );
13899
13887
  }
13900
- const ye = new Set(
13888
+ const ge = new Set(
13901
13889
  [
13902
13890
  ...[...A.values()].flatMap((w) => [...w.fields.values()]),
13903
13891
  ...Z,
@@ -13905,7 +13893,7 @@ function rh(e, t = {}) {
13905
13893
  ].flatMap((w) => w.kind === "cypher" && w.object ? [w.object] : [])
13906
13894
  );
13907
13895
  for (const w of F.keys())
13908
- ye.has(w) || s.push({
13896
+ ge.has(w) || s.push({
13909
13897
  type: w,
13910
13898
  message: "object types need @node or @relationshipProperties, unless a @cypher field returns them"
13911
13899
  });
@@ -14524,11 +14512,11 @@ function Ih(e, t) {
14524
14512
  name: "CountFilter",
14525
14513
  description: "Compare the number of related nodes.",
14526
14514
  fields: {
14527
- eq: { type: me },
14528
- lt: { type: me },
14529
- lte: { type: me },
14530
- gt: { type: me },
14531
- gte: { type: me }
14515
+ eq: { type: he },
14516
+ lt: { type: he },
14517
+ lte: { type: he },
14518
+ gt: { type: he },
14519
+ gte: { type: he }
14532
14520
  }
14533
14521
  }), o = new we({
14534
14522
  name: "Point",
@@ -14537,7 +14525,7 @@ function Ih(e, t) {
14537
14525
  longitude: { type: j(Ne) },
14538
14526
  latitude: { type: j(Ne) },
14539
14527
  height: { type: Ne },
14540
- srid: { type: j(me) },
14528
+ srid: { type: j(he) },
14541
14529
  crs: { type: j(_e) }
14542
14530
  }
14543
14531
  }), r = new we({
@@ -14547,7 +14535,7 @@ function Ih(e, t) {
14547
14535
  x: { type: j(Ne) },
14548
14536
  y: { type: j(Ne) },
14549
14537
  z: { type: Ne },
14550
- srid: { type: j(me) },
14538
+ srid: { type: j(he) },
14551
14539
  crs: { type: j(_e) }
14552
14540
  }
14553
14541
  }), a = /* @__PURE__ */ new Map();
@@ -14617,7 +14605,7 @@ function Ih(e, t) {
14617
14605
  case "ID":
14618
14606
  return Rn;
14619
14607
  case "Int":
14620
- return me;
14608
+ return he;
14621
14609
  case "Float":
14622
14610
  return Ne;
14623
14611
  case "Boolean":
@@ -14676,7 +14664,7 @@ function Ch(e, t, n) {
14676
14664
  for (const r of e.nodes.values()) {
14677
14665
  if (!r.aggregate) continue;
14678
14666
  const a = {
14679
- count: { type: j(me) }
14667
+ count: { type: j(he) }
14680
14668
  };
14681
14669
  for (const c of r.fields.values())
14682
14670
  c.kind === "scalar" && (c.key || c.sortable || c.type === "Duration") && !c.list && c.selectableOn.aggregate && c.type !== "Boolean" && c.type !== "Enum" && (a[c.name] = { type: j(n(c)) });
@@ -14979,8 +14967,8 @@ function _h(e, t) {
14979
14967
  sum: { type: $(T) }
14980
14968
  } : {},
14981
14969
  ...v.type === "String" || v.type === "ID" ? {
14982
- shortestLength: { type: $(me) },
14983
- longestLength: { type: $(me) },
14970
+ shortestLength: { type: $(he) },
14971
+ longestLength: { type: $(he) },
14984
14972
  averageLength: { type: $(Ne) }
14985
14973
  } : {}
14986
14974
  }
@@ -15078,16 +15066,16 @@ function Lh(e, t, n, i, s, o) {
15078
15066
  customScalar: u,
15079
15067
  baseType: d,
15080
15068
  scalarOutput: f
15081
- } = n, { whereOf: p, polymorphic: h, connectionWhere: m } = i, g = /* @__PURE__ */ new Map(), y = /* @__PURE__ */ new Map(), E = /* @__PURE__ */ new Map(), b = (U) => U.__typename ?? void 0;
15082
- for (const U of e.abstracts.values())
15069
+ } = n, { whereOf: p, polymorphic: h, connectionWhere: m } = i, g = /* @__PURE__ */ new Map(), y = /* @__PURE__ */ new Map(), E = /* @__PURE__ */ new Map(), b = (_) => _.__typename ?? void 0;
15070
+ for (const _ of e.abstracts.values())
15083
15071
  E.set(
15084
- U.name,
15085
- U.kind === "interface" ? new ci({
15086
- name: U.name,
15087
- description: U.description,
15072
+ _.name,
15073
+ _.kind === "interface" ? new ci({
15074
+ name: _.name,
15075
+ description: _.description,
15088
15076
  fields: () => ({
15089
15077
  ...Object.fromEntries(
15090
- [...U.fields.values()].filter((z) => !z.private && z.selectableOn.read).map((z) => [
15078
+ [..._.fields.values()].filter((z) => !z.private && z.selectableOn.read).map((z) => [
15091
15079
  z.name,
15092
15080
  { type: f(z), description: z.description }
15093
15081
  ])
@@ -15095,8 +15083,8 @@ function Lh(e, t, n, i, s, o) {
15095
15083
  // Declared relationships: the implementations' field, whose
15096
15084
  // type and arguments the model checked are the same.
15097
15085
  ...Object.fromEntries(
15098
- [...U.relationships.values()].map((z) => {
15099
- const V = g.get(U.members[0]).getFields()[z.name];
15086
+ [..._.relationships.values()].map((z) => {
15087
+ const V = g.get(_.members[0]).getFields()[z.name];
15100
15088
  return [
15101
15089
  z.name,
15102
15090
  {
@@ -15119,58 +15107,58 @@ function Lh(e, t, n, i, s, o) {
15119
15107
  }),
15120
15108
  resolveType: b
15121
15109
  }) : new dl({
15122
- name: U.name,
15123
- description: U.description,
15124
- types: () => U.members.map((z) => g.get(z)),
15110
+ name: _.name,
15111
+ description: _.description,
15112
+ types: () => _.members.map((z) => g.get(z)),
15125
15113
  resolveType: b
15126
15114
  })
15127
15115
  );
15128
- const $ = (U) => g.get(U) ?? E.get(U), N = {
15129
- edges: (U) => Pr(U).map((z) => (ht(z.node), { ...z, __sort: U.__sort })),
15130
- pageInfo: (U) => {
15131
- const z = Pr(U);
15116
+ const $ = (_) => g.get(_) ?? E.get(_), N = {
15117
+ edges: (_) => Pr(_).map((z) => (ht(z.node), { ...z, __sort: _.__sort })),
15118
+ pageInfo: (_) => {
15119
+ const z = Pr(_);
15132
15120
  for (const re of z) ht(re.node);
15133
- const V = (re) => re ? gi(U.__sort, re.__cursor, e.cursorSecret) : null, H = U.__rows.length > U.__first;
15121
+ const V = (re) => re ? gi(_.__sort, re.__cursor, e.cursorSecret) : null, H = _.__rows.length > _.__first;
15134
15122
  return {
15135
- hasNextPage: U.__backward ? U.__after : H,
15136
- hasPreviousPage: U.__backward ? H : U.__after,
15123
+ hasNextPage: _.__backward ? _.__after : H,
15124
+ hasPreviousPage: _.__backward ? H : _.__after,
15137
15125
  startCursor: V(z[0]),
15138
15126
  endCursor: V(z[z.length - 1])
15139
15127
  };
15140
15128
  },
15141
- totalCount: (U) => {
15142
- if ((U.__denied ?? 0) > 0)
15129
+ totalCount: (_) => {
15130
+ if ((_.__denied ?? 0) > 0)
15143
15131
  throw M(
15144
15132
  "FORBIDDEN",
15145
15133
  "not allowed to read some of these nodes"
15146
15134
  );
15147
- return U.__totalCount ?? 0;
15135
+ return _.__totalCount ?? 0;
15148
15136
  }
15149
- }, O = (U, z, V, H, re) => {
15150
- const se = new we({
15137
+ }, O = (_, z, V, H, re) => {
15138
+ const ie = new we({
15151
15139
  name: z,
15152
15140
  fields: () => ({
15153
15141
  cursor: {
15154
15142
  type: j(_e),
15155
- resolve: (ye) => gi(ye.__sort, ye.__cursor, e.cursorSecret)
15143
+ resolve: (ge) => gi(ge.__sort, ge.__cursor, e.cursorSecret)
15156
15144
  },
15157
15145
  node: {
15158
15146
  type: j(V()),
15159
- resolve: (ye) => ye.node
15147
+ resolve: (ge) => ge.node
15160
15148
  },
15161
15149
  ...H ? {
15162
15150
  properties: {
15163
15151
  type: j(H()),
15164
- resolve: (ye) => ye.properties
15152
+ resolve: (ge) => ge.properties
15165
15153
  }
15166
15154
  } : {}
15167
15155
  })
15168
15156
  });
15169
15157
  return new we({
15170
- name: U,
15158
+ name: _,
15171
15159
  fields: () => ({
15172
15160
  edges: {
15173
- type: j(Ee(j(se))),
15161
+ type: j(Ee(j(ie))),
15174
15162
  resolve: N.edges
15175
15163
  },
15176
15164
  pageInfo: {
@@ -15178,14 +15166,14 @@ function Lh(e, t, n, i, s, o) {
15178
15166
  resolve: N.pageInfo
15179
15167
  },
15180
15168
  totalCount: {
15181
- type: j(me),
15169
+ type: j(he),
15182
15170
  resolve: N.totalCount
15183
15171
  },
15184
15172
  ...re?.() ? {
15185
15173
  aggregate: {
15186
15174
  type: j(re()),
15187
15175
  description: "Aggregates over every matching node (not just this page).",
15188
- resolve: (ye) => ye.__aggregate
15176
+ resolve: (ge) => ge.__aggregate
15189
15177
  }
15190
15178
  } : {}
15191
15179
  })
@@ -15194,14 +15182,14 @@ function Lh(e, t, n, i, s, o) {
15194
15182
  name: "RelationshipCount",
15195
15183
  description: "Related nodes, and the relationships to them: they differ when several relationships lead to the same node.",
15196
15184
  fields: {
15197
- nodes: { type: j(me) },
15198
- edges: { type: j(me) }
15185
+ nodes: { type: j(he) },
15186
+ edges: { type: j(he) }
15199
15187
  }
15200
- }), F = (U, z, V, H = !1) => {
15188
+ }), F = (_, z, V, H = !1) => {
15201
15189
  if (!z.aggregate) return;
15202
- let re = I.get(U);
15190
+ let re = I.get(_);
15203
15191
  if (!re) {
15204
- const se = (w, k) => {
15192
+ const ie = (w, k) => {
15205
15193
  if (R.has(w)) return R.get(w);
15206
15194
  const L = [...k].filter(Kc), Q = L.length > 0 ? new we({
15207
15195
  name: w,
@@ -15213,29 +15201,29 @@ function Lh(e, t, n, i, s, o) {
15213
15201
  )
15214
15202
  }) : void 0;
15215
15203
  return R.set(w, Q), Q;
15216
- }, ye = se(
15204
+ }, ge = ie(
15217
15205
  `${z.name}AggregateNode`,
15218
15206
  [...z.fields.values()].filter(
15219
15207
  (w) => w.kind === "scalar"
15220
15208
  )
15221
- ), De = V ? se(`${V.name}AggregateEdge`, V.fields.values()) : void 0;
15209
+ ), De = V ? ie(`${V.name}AggregateEdge`, V.fields.values()) : void 0;
15222
15210
  re = new we({
15223
- name: U,
15211
+ name: _,
15224
15212
  fields: {
15225
- count: H ? { type: j(C) } : { type: j(me), description: "Matching nodes." },
15226
- ...ye ? { node: { type: j(ye) } } : {},
15213
+ count: H ? { type: j(C) } : { type: j(he), description: "Matching nodes." },
15214
+ ...ge ? { node: { type: j(ge) } } : {},
15227
15215
  ...De ? { edge: { type: j(De) } } : {}
15228
15216
  }
15229
- }), I.set(U, re);
15217
+ }), I.set(_, re);
15230
15218
  }
15231
15219
  return re;
15232
- }, Y = /* @__PURE__ */ new Map(), v = (U) => {
15233
- let z = Y.get(U.name);
15220
+ }, Y = /* @__PURE__ */ new Map(), v = (_) => {
15221
+ let z = Y.get(_.name);
15234
15222
  return z || (z = new we({
15235
- name: U.name,
15236
- description: U.description,
15223
+ name: _.name,
15224
+ description: _.description,
15237
15225
  fields: () => Object.fromEntries(
15238
- [...U.fields.values()].filter((V) => !V.private && V.selectableOn.read).map((V) => [
15226
+ [..._.fields.values()].filter((V) => !V.private && V.selectableOn.read).map((V) => [
15239
15227
  V.name,
15240
15228
  {
15241
15229
  type: f(V),
@@ -15244,17 +15232,17 @@ function Lh(e, t, n, i, s, o) {
15244
15232
  }
15245
15233
  ])
15246
15234
  )
15247
- }), Y.set(U.name, z)), z;
15248
- }, T = (U) => ({
15249
- where: { type: p(U) },
15250
- ...s.has(U) ? { sort: { type: Ee(j(s.get(U))) } } : {},
15251
- limit: { type: me }
15252
- }), D = /* @__PURE__ */ new Map(), A = (U, z, V) => {
15235
+ }), Y.set(_.name, z)), z;
15236
+ }, T = (_) => ({
15237
+ where: { type: p(_) },
15238
+ ...s.has(_) ? { sort: { type: Ee(j(s.get(_))) } } : {},
15239
+ limit: { type: he }
15240
+ }), D = /* @__PURE__ */ new Map(), A = (_, z, V) => {
15253
15241
  const H = [...V.fields.values()].filter((De) => De.sortable), re = e.nodes.get(z.target);
15254
15242
  if (H.length === 0 || re.fields.has("edge")) return;
15255
- const se = `${te.relConnection(U.name, z.name)}Sort`;
15256
- let ye = D.get(se);
15257
- if (!ye) {
15243
+ const ie = `${te.relConnection(_.name, z.name)}Sort`;
15244
+ let ge = D.get(ie);
15245
+ if (!ge) {
15258
15246
  const De = te.sort(V.name);
15259
15247
  let w = D.get(De);
15260
15248
  w || (w = new Ae({
@@ -15263,8 +15251,8 @@ function Lh(e, t, n, i, s, o) {
15263
15251
  fields: Object.fromEntries(
15264
15252
  H.map((k) => [k.name, { type: r }])
15265
15253
  )
15266
- }), D.set(De, w)), ye = new Ae({
15267
- name: se,
15254
+ }), D.set(De, w)), ge = new Ae({
15255
+ name: ie,
15268
15256
  description: `Sorts ${z.name} by ${re.name} fields or, under \`edge\`, relationship properties. One field per item; the @key breaks ties.`,
15269
15257
  fields: () => ({
15270
15258
  ...Object.fromEntries(
@@ -15275,38 +15263,38 @@ function Lh(e, t, n, i, s, o) {
15275
15263
  ),
15276
15264
  edge: { type: w }
15277
15265
  })
15278
- }), D.set(se, ye);
15266
+ }), D.set(ie, ge);
15279
15267
  }
15280
- return ye;
15281
- }, x = (U, z = p(U), V = s.get(U)) => ({
15268
+ return ge;
15269
+ }, x = (_, z = p(_), V = s.get(_)) => ({
15282
15270
  where: { type: z },
15283
15271
  sort: { type: Ee(j(V)) },
15284
- first: { type: me },
15272
+ first: { type: he },
15285
15273
  after: { type: _e },
15286
15274
  last: {
15287
- type: me,
15275
+ type: he,
15288
15276
  description: "Page backward: the last n before `before`."
15289
15277
  },
15290
15278
  before: { type: _e }
15291
15279
  });
15292
- for (const U of e.nodes.values()) {
15280
+ for (const _ of e.nodes.values()) {
15293
15281
  const z = new we({
15294
- name: U.name,
15295
- description: U.description,
15282
+ name: _.name,
15283
+ description: _.description,
15296
15284
  interfaces: () => [
15297
- ...U.key.relayId && l ? [l] : [],
15298
- ...U.interfaces.map((V) => E.get(V)).filter(
15285
+ ..._.key.relayId && l ? [l] : [],
15286
+ ..._.interfaces.map((V) => E.get(V)).filter(
15299
15287
  (V) => V instanceof ci
15300
15288
  )
15301
15289
  ],
15302
15290
  fields: () => {
15303
15291
  const V = {};
15304
- U.key.relayId && (V.id = {
15292
+ _.key.relayId && (V.id = {
15305
15293
  type: j(Rn),
15306
15294
  description: "Global id.",
15307
- resolve: (H, re, se, ye) => Uh(U.name, H[ye.path.key])
15295
+ resolve: (H, re, ie, ge) => Uh(_.name, H[ge.path.key])
15308
15296
  });
15309
- for (const H of U.fields.values()) {
15297
+ for (const H of _.fields.values()) {
15310
15298
  if (H.kind === "scalar") {
15311
15299
  if (H.private || !H.selectableOn.read) continue;
15312
15300
  V[H.name] = {
@@ -15327,11 +15315,11 @@ function Lh(e, t, n, i, s, o) {
15327
15315
  continue;
15328
15316
  }
15329
15317
  if (H.kind === "custom") {
15330
- const se = Z(H.type.named), ye = H.type.list && H.type.itemRequired ? j(se) : se, De = H.type.list ? Ee(ye) : ye;
15318
+ const ie = Z(H.type.named), ge = H.type.list && H.type.itemRequired ? j(ie) : ie, De = H.type.list ? Ee(ge) : ge;
15331
15319
  V[H.name] = {
15332
15320
  type: H.type.required ? j(De) : De,
15333
15321
  description: H.description,
15334
- resolve: t.customResolver(U, H)
15322
+ resolve: t.customResolver(_, H)
15335
15323
  };
15336
15324
  continue;
15337
15325
  }
@@ -15351,58 +15339,58 @@ function Lh(e, t, n, i, s, o) {
15351
15339
  args: T(H.target),
15352
15340
  resolve: ri
15353
15341
  }, h(H) || (V[te.connectionField(H.name)] = q(
15354
- U,
15342
+ _,
15355
15343
  H
15356
15344
  ));
15357
15345
  }
15358
15346
  return V;
15359
15347
  }
15360
15348
  });
15361
- g.set(U.name, z), y.set(
15362
- U.name,
15349
+ g.set(_.name, z), y.set(
15350
+ _.name,
15363
15351
  O(
15364
- te.connection(U.name),
15365
- te.edge(U.name),
15352
+ te.connection(_.name),
15353
+ te.edge(_.name),
15366
15354
  () => z,
15367
15355
  void 0,
15368
15356
  () => F(
15369
- `${te.connection(U.name)}Aggregate`,
15370
- U,
15357
+ `${te.connection(_.name)}Aggregate`,
15358
+ _,
15371
15359
  void 0
15372
15360
  )
15373
15361
  )
15374
15362
  );
15375
15363
  }
15376
- function q(U, z) {
15364
+ function q(_, z) {
15377
15365
  if (!us(z)) {
15378
- const se = e.nodes.get(z.target), ye = z.aggregate && !se.aggregate ? y.get(z.target) : O(
15379
- te.relConnection(U.name, z.name),
15380
- te.relEdge(U.name, z.name),
15366
+ const ie = e.nodes.get(z.target), ge = z.aggregate && !ie.aggregate ? y.get(z.target) : O(
15367
+ te.relConnection(_.name, z.name),
15368
+ te.relEdge(_.name, z.name),
15381
15369
  () => g.get(z.target),
15382
15370
  void 0,
15383
15371
  z.aggregate ? () => F(
15384
- `${te.relConnection(U.name, z.name)}Aggregate`,
15385
- se,
15372
+ `${te.relConnection(_.name, z.name)}Aggregate`,
15373
+ ie,
15386
15374
  void 0,
15387
15375
  !0
15388
15376
  ) : void 0
15389
15377
  );
15390
15378
  return {
15391
- type: j(ye),
15379
+ type: j(ge),
15392
15380
  args: x(z.target),
15393
15381
  resolve: wn
15394
15382
  };
15395
15383
  }
15396
- const V = e.relationshipProperties.get(z.properties), H = m(U, z), re = O(
15397
- te.relConnection(U.name, z.name),
15398
- te.relEdge(U.name, z.name),
15384
+ const V = e.relationshipProperties.get(z.properties), H = m(_, z), re = O(
15385
+ te.relConnection(_.name, z.name),
15386
+ te.relEdge(_.name, z.name),
15399
15387
  () => g.get(z.target),
15400
15388
  // Every property hidden from reads (@private, @selectable(onRead:
15401
15389
  // false)): no edge type, and no `properties` on the edge. The
15402
15390
  // properties stay settable through `edge` inputs.
15403
- [...V.fields.values()].some((se) => !se.private && se.selectableOn.read) ? () => v(V) : void 0,
15391
+ [...V.fields.values()].some((ie) => !ie.private && ie.selectableOn.read) ? () => v(V) : void 0,
15404
15392
  z.aggregate ? () => F(
15405
- `${te.relConnection(U.name, z.name)}Aggregate`,
15393
+ `${te.relConnection(_.name, z.name)}Aggregate`,
15406
15394
  e.nodes.get(z.target),
15407
15395
  V,
15408
15396
  !0
@@ -15413,37 +15401,37 @@ function Lh(e, t, n, i, s, o) {
15413
15401
  args: x(
15414
15402
  z.target,
15415
15403
  H,
15416
- A(U, z, V) ?? s.get(z.target)
15404
+ A(_, z, V) ?? s.get(z.target)
15417
15405
  ),
15418
15406
  resolve: wn
15419
15407
  };
15420
15408
  }
15421
15409
  const X = /* @__PURE__ */ new Map();
15422
- for (const U of e.objects.values())
15410
+ for (const _ of e.objects.values())
15423
15411
  X.set(
15424
- U.name,
15412
+ _.name,
15425
15413
  new we({
15426
- name: U.name,
15427
- description: U.description,
15414
+ name: _.name,
15415
+ description: _.description,
15428
15416
  fields: () => Object.fromEntries(
15429
- [...U.fields.values()].map((z) => {
15417
+ [..._.fields.values()].map((z) => {
15430
15418
  const V = Z(z.type.named), H = z.type.list && z.type.itemRequired ? j(V) : V, re = z.type.list ? Ee(H) : H;
15431
15419
  return [z.name, { type: z.type.required ? j(re) : re }];
15432
15420
  })
15433
15421
  )
15434
15422
  })
15435
15423
  );
15436
- const Z = (U) => g.get(U) ?? E.get(U) ?? X.get(U) ?? c.get(U) ?? u(U) ?? d(U, void 0);
15437
- function ne(U) {
15438
- const z = Z(U.type.named), V = U.type.list && U.type.itemRequired ? j(z) : z, H = U.type.list ? Ee(V) : V;
15439
- return U.type.required ? j(H) : H;
15424
+ const Z = (_) => g.get(_) ?? E.get(_) ?? X.get(_) ?? c.get(_) ?? u(_) ?? d(_, void 0);
15425
+ function ne(_) {
15426
+ const z = Z(_.type.named), V = _.type.list && _.type.itemRequired ? j(z) : z, H = _.type.list ? Ee(V) : V;
15427
+ return _.type.required ? j(H) : H;
15440
15428
  }
15441
- function de(U) {
15429
+ function de(_) {
15442
15430
  const z = {};
15443
- for (const V of U.args) {
15444
- const H = Z(V.type.named), re = V.type.list && V.type.itemRequired ? j(H) : H, se = V.type.list ? Ee(re) : re;
15431
+ for (const V of _.args) {
15432
+ const H = Z(V.type.named), re = V.type.list && V.type.itemRequired ? j(H) : H, ie = V.type.list ? Ee(re) : re;
15445
15433
  z[V.name] = {
15446
- type: V.type.required ? j(se) : se,
15434
+ type: V.type.required ? j(ie) : ie,
15447
15435
  defaultValue: V.defaultValue,
15448
15436
  description: V.description
15449
15437
  };
@@ -15508,7 +15496,7 @@ function Ph(e, t, n, i, s, o) {
15508
15496
  args: {
15509
15497
  by: { type: j(Ee(j(F.field))) },
15510
15498
  where: { type: d(R.name) },
15511
- limit: { type: me }
15499
+ limit: { type: he }
15512
15500
  },
15513
15501
  resolve: I("grouped", R)
15514
15502
  });
@@ -15552,7 +15540,7 @@ function Ph(e, t, n, i, s, o) {
15552
15540
  resolve: m.pageInfo
15553
15541
  },
15554
15542
  totalCount: {
15555
- type: j(me),
15543
+ type: j(he),
15556
15544
  description: "Every match after `where` and the read rules (a vector search counts within its candidate window).",
15557
15545
  resolve: m.totalCount
15558
15546
  }
@@ -15561,7 +15549,7 @@ function Ph(e, t, n, i, s, o) {
15561
15549
  for (const T of R.search) {
15562
15550
  const D = {
15563
15551
  where: { type: d(R.name) },
15564
- limit: { type: me }
15552
+ limit: { type: he }
15565
15553
  }, A = T.kind === "fulltext" ? { query: { type: j(_e) } } : {
15566
15554
  vector: { type: Ee(j(Ne)) },
15567
15555
  to: { type: u(R.key) }
@@ -15572,7 +15560,7 @@ function Ph(e, t, n, i, s, o) {
15572
15560
  args: {
15573
15561
  ...A,
15574
15562
  where: { type: d(R.name) },
15575
- first: { type: me },
15563
+ first: { type: he },
15576
15564
  after: { type: _e }
15577
15565
  },
15578
15566
  resolve: (x, q, X, Z) => t.resolveSearch(R, T, Z, X, !0)
@@ -16290,9 +16278,9 @@ class Qh {
16290
16278
  fragments: {},
16291
16279
  variables: {}
16292
16280
  }, o = this.#e.context(s, i);
16293
- ge(o, t, "SUBSCRIBE"), ge(o, t, "READ");
16281
+ me(o, t, "SUBSCRIBE"), me(o, t, "READ");
16294
16282
  for (const y of ["SUBSCRIBE", "READ"])
16295
- ce(o, t, "n", y), Re(o, t, "n", y, "BEFORE");
16283
+ ae(o, t, "n", y), Re(o, t, "n", y, "BEFORE");
16296
16284
  const r = `${t.name[0].toLowerCase()}${t.name.slice(1)}Changed`, a = n.where;
16297
16285
  this.#e.charge(
16298
16286
  r,
@@ -16437,9 +16425,9 @@ class Qh {
16437
16425
  let l = o;
16438
16426
  if (!l || c === void 0 || l.claims !== c || !Fr(l.contextReads, s)) {
16439
16427
  const u = this.#e.context(i, s), d = [], f = pe(
16440
- ce(u, t, "n", "READ"),
16428
+ ae(u, t, "n", "READ"),
16441
16429
  Re(u, t, "n", "READ", "BEFORE"),
16442
- ce(u, t, "n", "SUBSCRIBE"),
16430
+ ae(u, t, "n", "SUBSCRIBE"),
16443
16431
  Re(u, t, "n", "SUBSCRIBE", "BEFORE")
16444
16432
  ), p = sn([
16445
16433
  { kind: "unwind", expr: B(u, d), alias: "k" },
@@ -16450,14 +16438,14 @@ class Qh {
16450
16438
  hops: []
16451
16439
  },
16452
16440
  where: pe(
16453
- ee("=", ae(_("n"), t.key.property), _("k")),
16441
+ se("=", ue(U("n"), t.key.property), U("k")),
16454
16442
  qe(u, t, "n", n),
16455
16443
  f
16456
16444
  )
16457
16445
  },
16458
16446
  {
16459
16447
  kind: "return",
16460
- items: [{ expr: ae(_("n"), t.key.property), alias: "key" }]
16448
+ items: [{ expr: ue(U("n"), t.key.property), alias: "key" }]
16461
16449
  }
16462
16450
  ]);
16463
16451
  l = {
@@ -16567,12 +16555,12 @@ class Qh {
16567
16555
  const [c, l] = n.field.split("."), u = c ? this.#t.nodes.get(c) : void 0, d = l ? u?.fields.get(l) : void 0, f = this.#e.context(s, o);
16568
16556
  let p, h;
16569
16557
  try {
16570
- if (ge(f, a, "READ"), p = pe(
16571
- ce(f, a, "m", "READ"),
16558
+ if (me(f, a, "READ"), p = pe(
16559
+ ae(f, a, "m", "READ"),
16572
16560
  Re(f, a, "m", "READ", "BEFORE")
16573
16561
  ), u && d?.kind === "relationship") {
16574
16562
  be(f, u.name, d);
16575
- const $ = Fi(f, u, d, i ? "n" : "m"), N = $ && oe("coalesce", $.when, G(!1));
16563
+ const $ = Fi(f, u, d, i ? "n" : "m"), N = $ && ee("coalesce", $.when, G(!1));
16576
16564
  i ? h = N : p = pe(p, N);
16577
16565
  }
16578
16566
  } catch {
@@ -16584,14 +16572,14 @@ class Qh {
16584
16572
  kind: "match",
16585
16573
  pattern: { start: { variable: $, labels: [N.labels[0]] }, hops: [] },
16586
16574
  where: pe(
16587
- ee("=", ae(_($), N.key.property), ae(_("p"), O)),
16575
+ se("=", ue(U($), N.key.property), ue(U("p"), O)),
16588
16576
  I
16589
16577
  )
16590
16578
  }), E = sn([
16591
16579
  { kind: "unwind", expr: g, alias: "p" },
16592
16580
  y("m", a, "r", p),
16593
16581
  ...h ? [y("n", t, "s", h)] : [],
16594
- { kind: "return", items: [{ expr: ae(_("p"), "i"), alias: "i" }] }
16582
+ { kind: "return", items: [{ expr: ue(U("p"), "i"), alias: "i" }] }
16595
16583
  ]), b = Object.keys(f.params).find(($) => f.params[$] === m);
16596
16584
  return {
16597
16585
  kind: "check",
@@ -17849,4 +17837,4 @@ export {
17849
17837
  Jh as x,
17850
17838
  tm as y
17851
17839
  };
17852
- //# sourceMappingURL=lora-graphql-CR1tRkf_.js.map
17840
+ //# sourceMappingURL=lora-graphql-CjaQGsy7.js.map