@loradb/lora-graphql 0.24.1 → 0.25.1

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.
Files changed (54) hide show
  1. package/README.md +201 -50
  2. package/dist/analyze/input-schemas.d.ts +11 -0
  3. package/dist/analyze/plans.d.ts +8 -0
  4. package/dist/analyze/stored.d.ts +29 -0
  5. package/dist/cli.js +263 -244
  6. package/dist/cli.js.map +1 -1
  7. package/dist/compile/cache.d.ts +9 -1
  8. package/dist/compile/context.d.ts +3 -0
  9. package/dist/compile/read/common.d.ts +2 -0
  10. package/dist/compile/read/root.d.ts +7 -0
  11. package/dist/compile/selection.d.ts +5 -0
  12. package/dist/diff-BZZNZs76.js +134 -0
  13. package/dist/diff-BZZNZs76.js.map +1 -0
  14. package/dist/driver.d.ts +36 -1
  15. package/dist/errors.d.ts +21 -1
  16. package/dist/events/outbox.d.ts +14 -0
  17. package/dist/events/worker.d.ts +67 -0
  18. package/dist/execute/changes.d.ts +8 -0
  19. package/dist/execute/cypher-mutation.d.ts +5 -1
  20. package/dist/execute/mutate/checks.d.ts +16 -0
  21. package/dist/execute/mutate/env.d.ts +50 -0
  22. package/dist/execute/mutate/errors.d.ts +6 -0
  23. package/dist/execute/mutate/links.d.ts +38 -0
  24. package/dist/execute/mutate/plan.d.ts +5 -0
  25. package/dist/execute/mutate/reported.d.ts +26 -0
  26. package/dist/execute/mutate/runner.d.ts +107 -25
  27. package/dist/execute/mutate/single-call.d.ts +92 -0
  28. package/dist/execute/mutate/triggers.d.ts +27 -0
  29. package/dist/execute/mutate/unique-together.d.ts +5 -1
  30. package/dist/execute/mutate/validate.d.ts +11 -0
  31. package/dist/execute/transaction.d.ts +13 -2
  32. package/dist/index.d.ts +7 -2
  33. package/dist/index.js +16 -15
  34. package/dist/lora-graphql-RvZQdHNA.js +17411 -0
  35. package/dist/lora-graphql-RvZQdHNA.js.map +1 -0
  36. package/dist/lora-graphql.d.ts +30 -1
  37. package/dist/model/build/authorization.d.ts +11 -1
  38. package/dist/model/build/constraints.d.ts +22 -0
  39. package/dist/model/build/rule-checks.d.ts +6 -1
  40. package/dist/model/build/trigger.d.ts +16 -0
  41. package/dist/model/constraints.d.ts +112 -0
  42. package/dist/model/desugar.d.ts +7 -0
  43. package/dist/model/directives.d.ts +1 -1
  44. package/dist/model/types.d.ts +55 -0
  45. package/dist/options.d.ts +76 -3
  46. package/dist/results.d.ts +12 -1
  47. package/dist/schema/scalars.d.ts +8 -1
  48. package/dist/standard-schema.d.ts +37 -0
  49. package/dist/testing.js +1 -1
  50. package/package.json +2 -2
  51. package/dist/diff-K8-GSeKH.js +0 -100
  52. package/dist/diff-K8-GSeKH.js.map +0 -1
  53. package/dist/driver-CXKPLfkz.js +0 -14447
  54. package/dist/driver-CXKPLfkz.js.map +0 -1
package/dist/cli.js CHANGED
@@ -1,11 +1,11 @@
1
1
  #!/usr/bin/env node
2
- import { execFileSync as re } from "node:child_process";
3
- import { stat as M, readFile as ce, readdir as ue, mkdir as le, writeFile as _ } from "node:fs/promises";
4
- import { dirname as fe, basename as de, join as O, relative as pe } from "node:path";
5
- import { parse as j, Kind as p, visit as Y, print as Z, typeFromAST as me, isNonNullType as G, isListType as he, getNamedType as ge, isEnumType as ve, isInputObjectType as we } from "graphql";
6
- import { d as Ee } from "./diff-K8-GSeKH.js";
7
- import { q as K, e as be, M as Te, a as R, l as X, g as x, u as ee, c as Ne, i as ye, r as Se, w as Ie } from "./driver-CXKPLfkz.js";
8
- const $e = /* @__PURE__ */ new Set(["Query", "Mutation", "Subscription"]), W = {
2
+ import { execFileSync as ue } from "node:child_process";
3
+ import { stat as F, readFile as le, readdir as fe, mkdir as de, writeFile as M } from "node:fs/promises";
4
+ import { dirname as pe, basename as me, join as k, relative as he } from "node:path";
5
+ import { parse as x, Kind as p, visit as Z, print as K, typeFromAST as ge, isNonNullType as W, isListType as ve, getNamedType as we, isEnumType as be, isInputObjectType as Ee } from "graphql";
6
+ import { d as Te } from "./diff-BZZNZs76.js";
7
+ import { w as X, j as ye, c as ee, e as Ne, M as Se, a as P, l as te, g as C, x as ne, i as $e, r as Ie, y as ke } from "./lora-graphql-RvZQdHNA.js";
8
+ const Oe = /* @__PURE__ */ new Set(["Query", "Mutation", "Subscription"]), z = {
9
9
  coalesce: "@coalesce is not supported: it hides predicates from indexes; store a value instead",
10
10
  subscriptionsAuthorization: "@subscriptionsAuthorization is not supported: SUBSCRIBE rules go in @authorization",
11
11
  shareable: "federation (@shareable) is not supported",
@@ -14,7 +14,7 @@ const $e = /* @__PURE__ */ new Set(["Query", "Mutation", "Subscription"]), W = {
14
14
  provides: "federation (@provides) is not supported",
15
15
  exclude: "@exclude: use @query / @mutation to choose operations",
16
16
  vector: "@vector on types (with a provider) is not supported: put @vector(dimensions:, similarity:) on a [Float!] field"
17
- }, ke = [
17
+ }, De = [
18
18
  ["_NOT_IN", "IN"],
19
19
  ["_STARTS_WITH", "STARTS_WITH"],
20
20
  ["_ENDS_WITH", "ENDS_WITH"],
@@ -26,7 +26,7 @@ const $e = /* @__PURE__ */ new Set(["Query", "Mutation", "Subscription"]), W = {
26
26
  ["_LT", "LT"],
27
27
  ["_IN", "IN"],
28
28
  ["_EQ", "EQ"]
29
- ], Oe = {
29
+ ], Le = {
30
30
  eq: "EQ",
31
31
  in: "IN",
32
32
  lt: "LT",
@@ -39,43 +39,43 @@ const $e = /* @__PURE__ */ new Set(["Query", "Mutation", "Subscription"]), W = {
39
39
  includes: "INCLUDES",
40
40
  caseInsensitive: "CASE_INSENSITIVE"
41
41
  };
42
- function De(n, s = []) {
43
- const i = j(n, { noLocation: !0 }), a = [], e = i.definitions.filter(
44
- (o) => o.kind === p.OBJECT_TYPE_DEFINITION && !$e.has(o.name.value) && !k(o.directives, "relationshipProperties") && !k(o.directives, "jwt")
45
- ), c = new Set(e.map((o) => o.name.value)), t = s.length > 0 ? je(s, e) : void 0, u = Y(i, {
42
+ function je(n, s = []) {
43
+ const i = x(n, { noLocation: !0 }), a = [], e = i.definitions.filter(
44
+ (o) => o.kind === p.OBJECT_TYPE_DEFINITION && !Oe.has(o.name.value) && !I(o.directives, "relationshipProperties") && !I(o.directives, "jwt")
45
+ ), c = new Set(e.map((o) => o.name.value)), t = s.length > 0 ? _e(s, e) : void 0, u = Z(i, {
46
46
  ObjectTypeDefinition(o) {
47
47
  if (!c.has(o.name.value)) return;
48
48
  const r = o.name.value;
49
- let l = te(
49
+ let l = se(
50
50
  o.directives ?? [],
51
51
  r,
52
52
  void 0,
53
53
  a
54
54
  );
55
- k(l, "node") || (l = [...l, I("node")]);
56
- const f = t?.mutations.get(r);
57
- k(l, "mutation") || (t ? f && f.size > 0 && (l = [
55
+ I(l, "node") || (l = [...l, $("node")]);
56
+ const d = t?.mutations.get(r);
57
+ I(l, "mutation") || (t ? d && d.size > 0 && (l = [
58
58
  ...l,
59
- I("mutation", {
60
- operations: F([...f].sort())
59
+ $("mutation", {
60
+ operations: U([...d].sort())
61
61
  })
62
- ]) : (l = [...l, I("mutation")], a.push(
62
+ ]) : (l = [...l, $("mutation")], a.push(
63
63
  `${r}: @mutation added (@neo4j/graphql generates mutations for every type); remove it or narrow its operations`
64
64
  )));
65
- const m = (o.fields ?? []).filter((v) => k(v.directives, "id"));
65
+ const m = (o.fields ?? []).filter((v) => I(v.directives, "id"));
66
66
  m.length === 0 ? a.push(
67
67
  `${r}: no @id field; add a required @key field (the sort tie-breaker and mutation address)`
68
68
  ) : m.length > 1 && a.push(`${r}: several @id fields; keep one as the @key`);
69
69
  const h = (o.fields ?? []).map(
70
- (v) => Le(v, r, t, a)
70
+ (v) => Ae(v, r, t, a)
71
71
  );
72
72
  return { ...o, directives: l, fields: h };
73
73
  }
74
74
  });
75
- return { typeDefs: Z(u), todos: a };
75
+ return { typeDefs: K(u), todos: a };
76
76
  }
77
- function Le(n, s, i, a) {
78
- let e = te(
77
+ function Ae(n, s, i, a) {
78
+ let e = se(
79
79
  n.directives ?? [],
80
80
  s,
81
81
  n.name.value,
@@ -83,18 +83,18 @@ function Le(n, s, i, a) {
83
83
  );
84
84
  e.find((u) => u.name.value === "id") && (e = e.filter(
85
85
  (u) => u.name.value !== "id" && u.name.value !== "unique"
86
- ), e.push(I("key", { generate: se(!0) })));
86
+ ), e.push($("key", { generate: oe(!0) })));
87
87
  const t = i?.filters.get(s)?.get(n.name.value);
88
- return t && t.size > 0 && !k(e, "filterable") && e.push(
89
- k(e, "relationship") ? I("filterable") : I("filterable", { byValue: F([...t].sort()) })
90
- ), i?.sorts.get(s)?.has(n.name.value) && !k(e, "sortable") && e.push(I("sortable")), { ...n, directives: e };
88
+ return t && t.size > 0 && !I(e, "filterable") && e.push(
89
+ I(e, "relationship") ? $("filterable") : $("filterable", { byValue: U([...t].sort()) })
90
+ ), i?.sorts.get(s)?.has(n.name.value) && !I(e, "sortable") && e.push($("sortable")), { ...n, directives: e };
91
91
  }
92
- function te(n, s, i, a) {
92
+ function se(n, s, i, a) {
93
93
  const e = i ? `${s}.${i}` : s, c = [];
94
94
  for (const t of n) {
95
95
  const u = t.name.value;
96
- if (u in W) {
97
- a.push(`${e}: ${W[u]}`);
96
+ if (u in z) {
97
+ a.push(`${e}: ${z[u]}`);
98
98
  continue;
99
99
  }
100
100
  if (u === "key" && !i) {
@@ -102,19 +102,19 @@ function te(n, s, i, a) {
102
102
  continue;
103
103
  }
104
104
  if (u === "unique") {
105
- c.push(I("unique"));
105
+ c.push($("unique"));
106
106
  continue;
107
107
  }
108
108
  if (u === "relationship") {
109
- c.push(Ae(t, e, a));
109
+ c.push(qe(t, e, a));
110
110
  continue;
111
111
  }
112
112
  if (u === "fulltext") {
113
- c.push(xe(t, "indexes", "indexName", "name"));
113
+ c.push(Ce(t, "indexes", "indexName", "name"));
114
114
  continue;
115
115
  }
116
116
  if (u === "subscription") {
117
- c.push(qe(t, e, a));
117
+ c.push(xe(t, e, a));
118
118
  continue;
119
119
  }
120
120
  (u === "authorization" || u === "authentication") && a.push(
@@ -123,12 +123,12 @@ function te(n, s, i, a) {
123
123
  }
124
124
  return c;
125
125
  }
126
- function Ae(n, s, i) {
126
+ function qe(n, s, i) {
127
127
  const a = [];
128
128
  for (const e of n.arguments ?? []) {
129
129
  const c = e.name.value;
130
130
  if (c === "queryDirection" && e.value.kind === p.ENUM) {
131
- e.value.value.includes("UNDIRECTED") && a.push(q("queryDirection", ne("UNDIRECTED")));
131
+ e.value.value.includes("UNDIRECTED") && a.push(q("queryDirection", ae("UNDIRECTED")));
132
132
  continue;
133
133
  }
134
134
  if (c === "nestedOperations" && e.value.kind === p.LIST) {
@@ -142,7 +142,7 @@ function Ae(n, s, i) {
142
142
  }
143
143
  return { ...n, arguments: a };
144
144
  }
145
- function qe(n, s, i) {
145
+ function xe(n, s, i) {
146
146
  const a = n.arguments?.find((t) => t.name.value === "events")?.value;
147
147
  if (!a || a.kind !== p.LIST) return n;
148
148
  const e = /* @__PURE__ */ new Set();
@@ -151,83 +151,83 @@ function qe(n, s, i) {
151
151
  t.kind === p.ENUM && (t.value.startsWith("CREATED") && !t.value.includes("RELATIONSHIP") ? e.add("CREATE") : t.value.startsWith("UPDATED") ? e.add("UPDATE") : t.value.startsWith("DELETED") && !t.value.includes("RELATIONSHIP") ? e.add("DELETE") : t.value.includes("RELATIONSHIP") && (c = !0));
152
152
  return i.push(
153
153
  `${s}: subscriptions see writes made through this library (or the engine change feed), not CDC`
154
- ), I("subscription", {
155
- operations: F([...e].sort()),
156
- ...c ? { relationships: se(!0) } : {}
154
+ ), $("subscription", {
155
+ operations: U([...e].sort()),
156
+ ...c ? { relationships: oe(!0) } : {}
157
157
  });
158
158
  }
159
- function je(n, s) {
159
+ function _e(n, s) {
160
160
  const i = {
161
161
  filters: /* @__PURE__ */ new Map(),
162
162
  sorts: /* @__PURE__ */ new Map(),
163
163
  mutations: /* @__PURE__ */ new Map()
164
164
  }, a = /* @__PURE__ */ new Map();
165
165
  for (const r of s)
166
- a.set(K(r.name.value), r), a.set(Ce(r.name.value), r);
167
- const e = new Map(s.map((r) => [r.name.value, r])), c = (r, l, f) => {
166
+ a.set(X(r.name.value), r), a.set(Re(r.name.value), r);
167
+ const e = new Map(s.map((r) => [r.name.value, r])), c = (r, l, d) => {
168
168
  const m = i.filters.get(r) ?? /* @__PURE__ */ new Map(), h = m.get(l) ?? /* @__PURE__ */ new Set();
169
- h.add(f), m.set(l, h), i.filters.set(r, m);
169
+ h.add(d), m.set(l, h), i.filters.set(r, m);
170
170
  }, t = (r, l) => {
171
171
  if (l.kind === p.OBJECT)
172
- for (const f of l.fields) {
173
- const m = f.name.value;
172
+ for (const d of l.fields) {
173
+ const m = d.name.value;
174
174
  if (m === "AND" || m === "OR") {
175
- if (f.value.kind === p.LIST)
176
- for (const w of f.value.values) t(r, w);
175
+ if (d.value.kind === p.LIST)
176
+ for (const w of d.value.values) t(r, w);
177
177
  continue;
178
178
  }
179
179
  if (m === "NOT") {
180
- t(r, f.value);
180
+ t(r, d.value);
181
181
  continue;
182
182
  }
183
183
  const h = /^(.+)_(SOME|ALL|NONE|SINGLE)$/.exec(m);
184
184
  if (h) {
185
- const w = r.fields?.find((D) => D.name.value === h[1]), y = w && e.get(z(w));
186
- w && y && (c(r.name.value, h[1], "EQ"), t(y, f.value));
185
+ const w = r.fields?.find((O) => O.name.value === h[1]), N = w && e.get(H(w));
186
+ w && N && (c(r.name.value, h[1], "EQ"), t(N, d.value));
187
187
  continue;
188
188
  }
189
- const v = ke.find(([w]) => m.endsWith(w)), b = v ? m.slice(0, -v[0].length) : m, g = r.fields?.find((w) => w.name.value === b);
189
+ const v = De.find(([w]) => m.endsWith(w)), E = v ? m.slice(0, -v[0].length) : m, g = r.fields?.find((w) => w.name.value === E);
190
190
  if (!g) continue;
191
- const N = e.get(z(g));
192
- if (N) {
193
- if (c(r.name.value, b, "EQ"), f.value.kind === p.OBJECT) {
194
- for (const w of f.value.fields) t(N, w.value);
195
- t(N, f.value);
191
+ const y = e.get(H(g));
192
+ if (y) {
193
+ if (c(r.name.value, E, "EQ"), d.value.kind === p.OBJECT) {
194
+ for (const w of d.value.fields) t(y, w.value);
195
+ t(y, d.value);
196
196
  }
197
197
  continue;
198
198
  }
199
- if (v) c(r.name.value, b, v[1]);
200
- else if (f.value.kind === p.OBJECT)
201
- for (const w of f.value.fields) {
202
- const y = Oe[w.name.value];
203
- y && c(r.name.value, b, y);
199
+ if (v) c(r.name.value, E, v[1]);
200
+ else if (d.value.kind === p.OBJECT)
201
+ for (const w of d.value.fields) {
202
+ const N = Le[w.name.value];
203
+ N && c(r.name.value, E, N);
204
204
  }
205
- else c(r.name.value, b, "EQ");
205
+ else c(r.name.value, E, "EQ");
206
206
  }
207
207
  }, u = (r, l) => {
208
- for (const f of r?.selections ?? []) {
209
- if (f.kind !== p.FIELD) continue;
210
- const m = f.name.value;
208
+ for (const d of r?.selections ?? []) {
209
+ if (d.kind !== p.FIELD) continue;
210
+ const m = d.name.value;
211
211
  if (l) {
212
- const h = /^(create|update|delete|upsert)(.+)$/.exec(m), v = m.replace(/(Connection|Aggregate)$/, ""), b = a.get(v) ?? (h ? a.get(ae(h[2])) : void 0);
213
- if (b && h) {
214
- const g = i.mutations.get(b.name.value) ?? /* @__PURE__ */ new Set(), N = h[1].toUpperCase();
215
- N === "UPSERT" ? (g.add("CREATE"), g.add("UPDATE")) : g.add(N), i.mutations.set(b.name.value, g);
212
+ const h = /^(create|update|delete|upsert)(.+)$/.exec(m), v = m.replace(/(Connection|Aggregate)$/, ""), E = a.get(v) ?? (h ? a.get(ie(h[2])) : void 0);
213
+ if (E && h) {
214
+ const g = i.mutations.get(E.name.value) ?? /* @__PURE__ */ new Set(), y = h[1].toUpperCase();
215
+ y === "UPSERT" ? (g.add("CREATE"), g.add("UPDATE")) : g.add(y), i.mutations.set(E.name.value, g);
216
216
  }
217
- if (b)
218
- for (const g of f.arguments ?? []) o(b, g);
217
+ if (E)
218
+ for (const g of d.arguments ?? []) o(E, g);
219
219
  }
220
- u(f.selectionSet, !1);
220
+ u(d.selectionSet, !1);
221
221
  }
222
222
  }, o = (r, l) => {
223
223
  if (l.name.value === "where" && t(r, l.value), l.name.value === "sort" || l.name.value === "options") {
224
- const f = i.sorts.get(r.name.value) ?? /* @__PURE__ */ new Set(), m = (h) => {
224
+ const d = i.sorts.get(r.name.value) ?? /* @__PURE__ */ new Set(), m = (h) => {
225
225
  if (h.kind === p.LIST) h.values.forEach(m);
226
226
  else if (h.kind === p.OBJECT)
227
227
  for (const v of h.fields)
228
- v.name.value === "sort" ? m(v.value) : v.value.kind === p.ENUM && f.add(v.name.value);
228
+ v.name.value === "sort" ? m(v.value) : v.value.kind === p.ENUM && d.add(v.name.value);
229
229
  };
230
- m(l.value), i.sorts.set(r.name.value, f);
230
+ m(l.value), i.sorts.set(r.name.value, d);
231
231
  }
232
232
  };
233
233
  for (const r of n)
@@ -235,15 +235,15 @@ function je(n, s) {
235
235
  l.kind === p.OPERATION_DEFINITION && u(l.selectionSet, !0);
236
236
  return i;
237
237
  }
238
- function z(n) {
238
+ function H(n) {
239
239
  let s = n.type;
240
240
  for (; s.kind !== p.NAMED_TYPE; ) s = s.type;
241
241
  return s.name.value;
242
242
  }
243
- function k(n, s) {
243
+ function I(n, s) {
244
244
  return (n ?? []).some((i) => i.name.value === s);
245
245
  }
246
- function I(n, s = {}) {
246
+ function $(n, s = {}) {
247
247
  return {
248
248
  kind: p.DIRECTIVE,
249
249
  name: { kind: p.NAME, value: n },
@@ -253,17 +253,17 @@ function I(n, s = {}) {
253
253
  function q(n, s) {
254
254
  return { kind: p.ARGUMENT, name: { kind: p.NAME, value: n }, value: s };
255
255
  }
256
- const ne = (n) => ({
256
+ const ae = (n) => ({
257
257
  kind: p.ENUM,
258
258
  value: n
259
- }), se = (n) => ({
259
+ }), oe = (n) => ({
260
260
  kind: p.BOOLEAN,
261
261
  value: n
262
- }), F = (n) => ({
262
+ }), U = (n) => ({
263
263
  kind: p.LIST,
264
- values: n.map(ne)
264
+ values: n.map(ae)
265
265
  });
266
- function xe(n, s, i, a) {
266
+ function Ce(n, s, i, a) {
267
267
  return {
268
268
  ...n,
269
269
  arguments: (n.arguments ?? []).map(
@@ -281,7 +281,7 @@ function xe(n, s, i, a) {
281
281
  )
282
282
  };
283
283
  }
284
- const _e = {
284
+ const Me = {
285
285
  person: "people",
286
286
  man: "men",
287
287
  woman: "women",
@@ -291,23 +291,25 @@ const _e = {
291
291
  foot: "feet",
292
292
  tooth: "teeth"
293
293
  };
294
- function Ce(n) {
295
- const s = ae(n), i = s.toLowerCase();
296
- for (const [a, e] of Object.entries(_e))
294
+ function Re(n) {
295
+ const s = ie(n), i = s.toLowerCase();
296
+ for (const [a, e] of Object.entries(Me))
297
297
  if (i.endsWith(a))
298
298
  return s.slice(0, s.length - a.length) + e;
299
- return K(n);
299
+ return X(n);
300
300
  }
301
- function ae(n) {
301
+ function ie(n) {
302
302
  return n.charAt(0).toLowerCase() + n.slice(1);
303
303
  }
304
- const H = `lora-graphql <command>
304
+ const Q = `lora-graphql <command>
305
305
 
306
306
  print <schema.graphql> the public SDL clients see
307
307
  directives the directive definitions, for editors
308
308
  access <schema.graphql> [--json] who may do what: each type and guarded field,
309
309
  operation and kind of caller
310
310
  requirements <schema.graphql> [--ddl] constraints and indexes the API needs
311
+ json-schema <schema.graphql> the validation rules of every create and
312
+ update input, as JSON Schema, for clients
311
313
  check <schema.graphql> [--operations <file|dir>]... [--json]
312
314
  [--variables <file>] [--context <file>]
313
315
  [--baseline <file> [--update-baseline]]
@@ -329,62 +331,68 @@ const H = `lora-graphql <command>
329
331
  on a breaking change or a destructive statement
330
332
  (--base: the SDL files at a git ref against the
331
333
  working tree, each side concatenated)`;
332
- async function Me(n, s = Ye) {
334
+ async function Fe(n, s = Ke) {
333
335
  const [i, ...a] = n, e = /* @__PURE__ */ new Set(), c = /* @__PURE__ */ new Map(), t = [], u = [];
334
336
  for (let o = 0; o < a.length; o++) {
335
337
  const r = a[o];
336
- r === "--operations" ? u.push(a[++o] ?? "") : Re.has(r) ? c.set(r, a[++o] ?? "") : r.startsWith("--") ? e.add(r) : t.push(r);
338
+ r === "--operations" ? u.push(a[++o] ?? "") : Pe.has(r) ? c.set(r, a[++o] ?? "") : r.startsWith("--") ? e.add(r) : t.push(r);
337
339
  }
338
340
  try {
339
341
  switch (i) {
340
342
  case "print":
341
- return await Pe(S(t, 1), s);
343
+ return await Je(S(t, 1), s);
342
344
  case "directives":
343
- return s.out(be.trim()), 0;
345
+ return s.out(Ne.trim()), 0;
344
346
  case "access":
345
- return await Fe(S(t, 1), e.has("--json"), s);
347
+ return await Ue(S(t, 1), e.has("--json"), s);
346
348
  case "requirements":
347
- return await Ue(S(t, 1), e.has("--ddl"), s);
349
+ return await Be(S(t, 1), e.has("--ddl"), s);
350
+ case "json-schema": {
351
+ const [o] = S(t, 1);
352
+ return s.out(
353
+ JSON.stringify(ye(ee(await b(o))), null, 2)
354
+ ), 0;
355
+ }
348
356
  case "check":
349
- return await Je(S(t, 1), u, e, c, s);
357
+ return await Ge(S(t, 1), u, e, c, s);
350
358
  case "compile":
351
- return await Ge(S(t, 1), u, c, s);
359
+ return await ze(S(t, 1), u, c, s);
352
360
  case "analyze":
353
- return await We(S(t, 1), c, s);
361
+ return await He(S(t, 1), c, s);
354
362
  case "migrate": {
355
363
  const [o, r] = S(t, 2);
356
- if (o !== "neo4j") throw new L("migrate supports neo4j");
364
+ if (o !== "neo4j") throw new D("migrate supports neo4j");
357
365
  const l = [];
358
366
  for (const m of u)
359
- for (const h of await A(m)) l.push(j(h.source));
360
- const f = De(await E(r), l);
361
- for (const m of f.todos) s.out(`# TODO(migrate): ${m}`);
362
- return f.todos.length > 0 && s.out(""), s.out(f.typeDefs), 0;
367
+ for (const h of await j(m)) l.push(x(h.source));
368
+ const d = je(await b(r), l);
369
+ for (const m of d.todos) s.out(`# TODO(migrate): ${m}`);
370
+ return d.todos.length > 0 && s.out(""), s.out(d.typeDefs), 0;
363
371
  }
364
372
  case "diff": {
365
373
  const o = c.get("--base");
366
374
  if (o !== void 0) {
367
- if (!o) throw new L("--base takes a git ref");
368
- const f = S(t, 1), m = await Ve(o, f);
375
+ if (!o) throw new D("--base takes a git ref");
376
+ const d = S(t, 1), m = await Ze(o, d);
369
377
  return m === void 0 ? (s.out(
370
- `${o} has none of ${f.join(", ")}; nothing to compare`
371
- ), 0) : V(m, await Qe(f), e, s);
378
+ `${o} has none of ${d.join(", ")}; nothing to compare`
379
+ ), 0) : Y(m, await Ye(d), e, s);
372
380
  }
373
381
  const [r, l] = S(t, 2);
374
- return V(await E(r), await E(l), e, s);
382
+ return Y(await b(r), await b(l), e, s);
375
383
  }
376
384
  default:
377
- return s.err(H), 2;
385
+ return s.err(Q), 2;
378
386
  }
379
387
  } catch (o) {
380
- return o instanceof L ? (s.err(`${o.message}
388
+ return o instanceof D ? (s.err(`${o.message}
381
389
 
382
- ${H}`), 2) : o instanceof Te ? (s.err(o.message), 1) : (s.err(o instanceof Error ? o.message : String(o)), 1);
390
+ ${Q}`), 2) : o instanceof Se ? (s.err(o.message), 1) : (s.err(o instanceof Error ? o.message : String(o)), 1);
383
391
  }
384
392
  }
385
- class L extends Error {
393
+ class D extends Error {
386
394
  }
387
- const Re = /* @__PURE__ */ new Set([
395
+ const Pe = /* @__PURE__ */ new Set([
388
396
  "--base",
389
397
  "--out",
390
398
  "--variables",
@@ -397,18 +405,18 @@ const Re = /* @__PURE__ */ new Set([
397
405
  ]);
398
406
  function S(n, s) {
399
407
  if (n.length < s)
400
- throw new L(`expected ${s} file argument(s)`);
408
+ throw new D(`expected ${s} file argument(s)`);
401
409
  return n;
402
410
  }
403
- const E = (n) => ce(n, "utf8");
404
- function P(n) {
411
+ const b = (n) => le(n, "utf8");
412
+ function J(n) {
405
413
  const s = {
406
414
  run: () => Promise.reject(new Error("no database"))
407
415
  };
408
- return new R({ typeDefs: n, driver: s });
416
+ return new P({ typeDefs: n, driver: s });
409
417
  }
410
- async function Fe([n], s, i) {
411
- const a = P(await E(n)).accessMatrix();
418
+ async function Ue([n], s, i) {
419
+ const a = J(await b(n)).accessMatrix();
412
420
  if (s)
413
421
  return i.out(JSON.stringify(a, null, 2)), 0;
414
422
  const e = a.map((t) => [
@@ -426,18 +434,18 @@ async function Fe([n], s, i) {
426
434
  );
427
435
  return 0;
428
436
  }
429
- async function Pe([n], s) {
430
- return s.out(P(await E(n)).printPublicSchema()), 0;
437
+ async function Je([n], s) {
438
+ return s.out(J(await b(n)).printPublicSchema()), 0;
431
439
  }
432
- async function Ue([n], s, i) {
433
- const a = Ne(await E(n));
434
- for (const e of ye(a))
440
+ async function Be([n], s, i) {
441
+ const a = ee(await b(n));
442
+ for (const e of $e(a))
435
443
  i.out(
436
- s ? `${Se(e)};` : `${ee(e)}, because ${e.reason}`
444
+ s ? `${Ie(e)};` : `${ne(e)}, because ${e.reason}`
437
445
  );
438
446
  return 0;
439
447
  }
440
- async function oe(n, s) {
448
+ async function re(n, s) {
441
449
  try {
442
450
  const { createDatabase: i } = await import("@loradb/lora-node");
443
451
  return i;
@@ -448,183 +456,194 @@ async function oe(n, s) {
448
456
  return;
449
457
  }
450
458
  }
451
- async function Je([n], s, i, a, e) {
452
- const c = i.has("--json"), t = await E(n), u = await oe(e, "check");
459
+ async function Ge([n], s, i, a, e) {
460
+ const c = i.has("--json"), t = await b(n), u = await re(e, "check");
453
461
  if (!u) return 1;
454
462
  const o = a.get("--database"), r = await u(
455
463
  o ? a.get("--name") ?? "app" : void 0,
456
464
  o ? { databaseDir: o } : {}
457
- ), l = new R({
465
+ ), l = new P({
458
466
  typeDefs: t,
459
- driver: X(r)
467
+ driver: te(r)
460
468
  });
461
469
  o || await l.assertSchema({ create: !0 });
462
- const f = l.getSchema(), m = a.has("--variables") ? JSON.parse(await E(a.get("--variables"))) : {}, h = a.has("--context") ? JSON.parse(await E(a.get("--context"))) : {}, v = [];
463
- for (const d of s)
464
- for (const T of await A(d))
465
- for (const $ of ze(f, T.path, T.source)) {
466
- const U = $.name.split("#")[1] ?? "", J = m[$.name] ?? m[U], B = h[$.name] ?? h[U] ?? h["*"];
470
+ const d = l.getSchema(), m = a.has("--variables") ? JSON.parse(await b(a.get("--variables"))) : {}, h = a.has("--context") ? JSON.parse(await b(a.get("--context"))) : {}, v = [];
471
+ for (const f of s)
472
+ for (const T of await j(f))
473
+ for (const { mutation: L, ...A } of Qe(
474
+ d,
475
+ T.path,
476
+ T.source
477
+ )) {
478
+ const B = A.name.split("#")[1] ?? "", _ = m[A.name] ?? m[B];
479
+ if (L && !_) continue;
480
+ const G = h[A.name] ?? h[B] ?? h["*"];
467
481
  v.push({
468
- ...$,
469
- ...J ? { variables: J } : {},
470
- ...B !== void 0 ? { context: B } : {}
482
+ ...A,
483
+ ..._ ? { variables: _ } : {},
484
+ ...G !== void 0 ? { context: G } : {}
471
485
  });
472
486
  }
473
- const b = a.has("--row-budget") ? Number(a.get("--row-budget")) : void 0, g = await l.check({
487
+ const E = a.has("--row-budget") ? Number(a.get("--row-budget")) : void 0, g = await l.check({
474
488
  operations: v,
475
- ...b !== void 0 ? { rowBudget: b } : {}
476
- }), N = a.get("--baseline"), w = {};
477
- for (const d of g.plans)
478
- w[`${d.operation} › ${d.field}`] = d.reports.map((T) => T.operators);
479
- const y = [];
480
- if (N) {
481
- let d;
489
+ ...E !== void 0 ? { rowBudget: E } : {}
490
+ }), y = a.get("--baseline"), w = {};
491
+ for (const f of g.plans)
492
+ w[`${f.operation} › ${f.field}`] = f.reports.map((T) => T.operators);
493
+ const N = [];
494
+ if (y) {
495
+ let f;
482
496
  try {
483
- d = JSON.parse(await E(N));
497
+ f = JSON.parse(await b(y));
484
498
  } catch {
485
- d = void 0;
499
+ f = void 0;
486
500
  }
487
- if (i.has("--update-baseline") || !d)
488
- await _(N, JSON.stringify(w, null, 2) + `
501
+ if (i.has("--update-baseline") || !f)
502
+ await M(y, JSON.stringify(w, null, 2) + `
489
503
  `);
490
504
  else
491
505
  for (const T of /* @__PURE__ */ new Set([
492
- ...Object.keys(d),
506
+ ...Object.keys(f),
493
507
  ...Object.keys(w)
494
508
  ]))
495
- JSON.stringify(d[T]) !== JSON.stringify(w[T]) && y.push(T);
509
+ JSON.stringify(f[T]) !== JSON.stringify(w[T]) && N.push(T);
496
510
  }
497
- const D = g.ok && y.length === 0;
511
+ const O = g.ok && N.length === 0;
498
512
  if (c)
499
- return e.out(JSON.stringify({ ...g, ok: D, planChanges: y }, null, 2)), D ? 0 : 1;
500
- for (const d of g.warnings) e.out(`warning ${x(d)}`);
501
- for (const d of g.lint) e.out(`lint ${x(d)}`);
502
- for (const d of g.unused)
513
+ return e.out(JSON.stringify({ ...g, ok: O, planChanges: N }, null, 2)), O ? 0 : 1;
514
+ for (const f of g.warnings) e.out(`warning ${C(f)}`);
515
+ for (const f of g.lint) e.out(`lint ${C(f)}`);
516
+ for (const f of g.unused)
517
+ e.out(
518
+ `unused ${f.type} index ${f.name} on :${f.labels.join(":")}(${f.properties.join(", ")})`
519
+ );
520
+ for (const f of g.stored)
503
521
  e.out(
504
- `unused ${d.type} index ${d.name} on :${d.labels.join(":")}(${d.properties.join(", ")})`
522
+ `stored ${f.type} ${JSON.stringify(f.key)}.${f.field} ${f.message}`
505
523
  );
506
- for (const d of g.security) e.out(`error ${x(d)}`);
507
- for (const d of g.missing)
508
- e.out(`error missing ${ee(d)}`);
509
- for (const d of g.cypher)
510
- e.out(`error ${d.type}.${d.field}: ${d.message}`);
511
- for (const d of g.errors)
512
- e.out(`error ${d.operation}: ${d.message}`);
513
- for (const d of g.plans)
514
- for (const T of d.reports) {
515
- for (const $ of T.findings)
516
- e.out(`error ${d.operation} › ${d.field}: ${$.message}`);
517
- for (const $ of T.notes)
518
- e.out(`lint ${d.operation} › ${d.field}: ${$.message}`);
524
+ for (const f of g.security) e.out(`error ${C(f)}`);
525
+ for (const f of g.missing)
526
+ e.out(`error missing ${ne(f)}`);
527
+ for (const f of g.cypher)
528
+ e.out(`error ${f.type}.${f.field}: ${f.message}`);
529
+ for (const f of g.errors)
530
+ e.out(`error ${f.operation}: ${f.message}`);
531
+ for (const f of g.plans)
532
+ for (const T of f.reports) {
533
+ for (const L of T.findings)
534
+ e.out(`error ${f.operation} › ${f.field}: ${L.message}`);
535
+ for (const L of T.notes)
536
+ e.out(`lint ${f.operation} › ${f.field}: ${L.message}`);
519
537
  }
520
- for (const d of y)
538
+ for (const f of N)
521
539
  e.out(
522
- `error ${d}: the plan differs from the baseline (--update-baseline to accept)`
540
+ `error ${f}: the plan differs from the baseline (--update-baseline to accept)`
523
541
  );
524
- const ie = g.plans.length;
542
+ const ce = g.plans.length;
525
543
  return e.out(
526
- D ? `ok ${ie} root field(s) in ${v.length} operation(s) seek as expected` : "failed"
527
- ), D ? 0 : 1;
544
+ O ? `ok ${ce} root field(s) in ${v.length} operation(s) seek as expected` : "failed"
545
+ ), O ? 0 : 1;
528
546
  }
529
- async function Be(n) {
547
+ async function We(n) {
530
548
  const s = {};
531
549
  for (const i of n) {
532
- if ((await M(i)).isFile() && i.endsWith(".json")) {
550
+ if ((await F(i)).isFile() && i.endsWith(".json")) {
533
551
  Object.assign(
534
552
  s,
535
- JSON.parse(await E(i))
553
+ JSON.parse(await b(i))
536
554
  );
537
555
  continue;
538
556
  }
539
- for (const e of await A(i)) {
540
- const c = j(e.source), t = new Map(
557
+ for (const e of await j(i)) {
558
+ const c = x(e.source), t = new Map(
541
559
  c.definitions.filter(
542
560
  (o) => o.kind === p.FRAGMENT_DEFINITION
543
561
  ).map((o) => [o.name.value, o])
544
- ), u = pe(process.cwd(), e.path);
562
+ ), u = he(process.cwd(), e.path);
545
563
  c.definitions.filter(
546
564
  (o) => o.kind === p.OPERATION_DEFINITION
547
565
  ).forEach((o, r) => {
548
566
  const l = `${u}#${o.name?.value ?? r + 1}`;
549
- s[l] = Z({
567
+ s[l] = K({
550
568
  kind: p.DOCUMENT,
551
- definitions: [o, ...Ie(o, t)]
569
+ definitions: [o, ...ke(o, t)]
552
570
  });
553
571
  });
554
572
  }
555
573
  }
556
574
  return s;
557
575
  }
558
- async function Ge([n], s, i, a) {
576
+ async function ze([n], s, i, a) {
559
577
  if (s.length === 0)
560
- throw new L("compile needs --operations <file|dir>");
561
- const e = P(await E(n)), c = e.buildManifest(
562
- await Be(s)
578
+ throw new D("compile needs --operations <file|dir>");
579
+ const e = J(await b(n)), c = e.buildManifest(
580
+ await We(s)
563
581
  ), t = i.get("--out") ?? "lora-graphql";
564
- return await le(t, { recursive: !0 }), await _(
565
- O(t, "manifest.json"),
582
+ return await de(t, { recursive: !0 }), await M(
583
+ k(t, "manifest.json"),
566
584
  JSON.stringify(c) + `
567
585
  `
568
- ), await _(
569
- O(t, "operations.d.ts"),
586
+ ), await M(
587
+ k(t, "operations.d.ts"),
570
588
  e.generateTypes(c)
571
589
  ), a.out(
572
- `wrote ${Object.keys(c.operations).length} operation(s) to ${O(t, "manifest.json")} and ${O(t, "operations.d.ts")}`
590
+ `wrote ${Object.keys(c.operations).length} operation(s) to ${k(t, "manifest.json")} and ${k(t, "operations.d.ts")}`
573
591
  ), 0;
574
592
  }
575
- async function We([n], s, i) {
593
+ async function He([n], s, i) {
576
594
  const a = s.get("--database");
577
- if (!a) throw new L("analyze needs --database <dir>");
578
- const e = await oe(i, "analyze");
595
+ if (!a) throw new D("analyze needs --database <dir>");
596
+ const e = await re(i, "analyze");
579
597
  if (!e) return 1;
580
598
  const c = await e(s.get("--name") ?? "app", {
581
599
  databaseDir: a
582
- }), t = new R({
583
- typeDefs: await E(n),
584
- driver: X(c)
600
+ }), t = new P({
601
+ typeDefs: await b(n),
602
+ driver: te(c)
585
603
  }), u = s.has("--sample") ? Number(s.get("--sample")) : void 0, o = await t.analyze(u !== void 0 ? { sample: u } : {});
586
604
  return i.out(JSON.stringify(o, null, 2)), c.dispose?.(), 0;
587
605
  }
588
- async function A(n) {
589
- if ((await M(n)).isFile()) return [{ path: n, source: await E(n) }];
606
+ async function j(n) {
607
+ if ((await F(n)).isFile()) return [{ path: n, source: await b(n) }];
590
608
  const i = [];
591
- for (const a of await ue(n, { withFileTypes: !0 })) {
592
- const e = O(n, a.name);
593
- a.isDirectory() ? i.push(...await A(e)) : /\.(graphql|gql)$/.test(a.name) && i.push({ path: e, source: await E(e) });
609
+ for (const a of await fe(n, { withFileTypes: !0 })) {
610
+ const e = k(n, a.name);
611
+ a.isDirectory() ? i.push(...await j(e)) : /\.(graphql|gql)$/.test(a.name) && i.push({ path: e, source: await b(e) });
594
612
  }
595
613
  return i;
596
614
  }
597
- function ze(n, s, i) {
598
- const a = j(i), e = new Map(
615
+ function Qe(n, s, i) {
616
+ const a = x(i), e = new Map(
599
617
  a.definitions.filter(
600
618
  (t) => t.kind === p.FRAGMENT_DEFINITION
601
619
  ).map((t) => [t.name.value, t])
602
620
  ), c = (t) => {
603
- const u = /* @__PURE__ */ new Map(), o = (r) => Y(r, {
621
+ const u = /* @__PURE__ */ new Map(), o = (r) => Z(r, {
604
622
  FragmentSpread(l) {
605
- const f = e.get(l.name.value);
606
- f && !u.has(f.name.value) && (u.set(f.name.value, f), o(f));
623
+ const d = e.get(l.name.value);
624
+ d && !u.has(d.name.value) && (u.set(d.name.value, d), o(d));
607
625
  }
608
626
  });
609
627
  return o(t), [...u.values()];
610
628
  };
611
629
  return a.definitions.filter(
612
- (t) => t.kind === p.OPERATION_DEFINITION && t.operation === "query"
630
+ (t) => t.kind === p.OPERATION_DEFINITION && t.operation !== "subscription"
613
631
  ).map((t, u) => {
614
632
  const o = {};
615
633
  for (const r of t.variableDefinitions ?? []) {
616
634
  if (r.defaultValue || r.type.kind !== p.NON_NULL_TYPE) continue;
617
- const l = me(n, r.type);
618
- l && (o[r.variable.name.value] = C(l));
635
+ const l = ge(n, r.type);
636
+ l && (o[r.variable.name.value] = R(l));
619
637
  }
620
638
  return {
621
639
  name: `${s}${t.name ? `#${t.name.value}` : `#${u + 1}`}`,
622
640
  document: { kind: p.DOCUMENT, definitions: [t, ...c(t)] },
623
- variables: o
641
+ variables: o,
642
+ mutation: t.operation === "mutation"
624
643
  };
625
644
  });
626
645
  }
627
- const He = {
646
+ const Ve = {
628
647
  String: "x",
629
648
  ID: "x",
630
649
  Int: 1,
@@ -638,31 +657,31 @@ const He = {
638
657
  LocalDateTime: "2026-01-01T12:00:00",
639
658
  Duration: "P1D"
640
659
  };
641
- function C(n) {
642
- const s = G(n) ? n.ofType : n;
643
- if (he(s)) return [C(s.ofType)];
644
- const i = ge(s);
645
- if (ve(i)) return i.getValues()[0]?.value;
646
- if (we(i)) {
660
+ function R(n) {
661
+ const s = W(n) ? n.ofType : n;
662
+ if (ve(s)) return [R(s.ofType)];
663
+ const i = we(s);
664
+ if (be(i)) return i.getValues()[0]?.value;
665
+ if (Ee(i)) {
647
666
  const a = {};
648
667
  for (const e of Object.values(i.getFields()))
649
- G(e.type) && e.defaultValue === void 0 && (a[e.name] = C(e.type));
668
+ W(e.type) && e.defaultValue === void 0 && (a[e.name] = R(e.type));
650
669
  return a;
651
670
  }
652
- return He[i.name] ?? "x";
671
+ return Ve[i.name] ?? "x";
653
672
  }
654
- const Q = /\.(graphql|gql)$/;
655
- async function Qe(n) {
673
+ const V = /\.(graphql|gql)$/;
674
+ async function Ye(n) {
656
675
  const s = [];
657
676
  for (const i of n) {
658
- const a = await A(i);
677
+ const a = await j(i);
659
678
  a.sort((e, c) => e.path < c.path ? -1 : e.path > c.path ? 1 : 0), s.push(...a.map((e) => e.source));
660
679
  }
661
680
  return s.join(`
662
681
  `);
663
682
  }
664
- async function Ve(n, s) {
665
- const i = (c, ...t) => re("git", t, {
683
+ async function Ze(n, s) {
684
+ const i = (c, ...t) => ue("git", t, {
666
685
  cwd: c,
667
686
  encoding: "utf8",
668
687
  stdio: ["ignore", "pipe", "pipe"],
@@ -670,10 +689,10 @@ async function Ve(n, s) {
670
689
  }), a = [];
671
690
  let e = !1;
672
691
  for (const c of s) {
673
- const t = await M(c).then(
692
+ const t = await F(c).then(
674
693
  (r) => r.isDirectory(),
675
- () => !Q.test(c)
676
- ), u = t ? c : fe(c);
694
+ () => !V.test(c)
695
+ ), u = t ? c : pe(c);
677
696
  try {
678
697
  i(u, "rev-parse", "--verify", "--quiet", `${n}^{commit}`);
679
698
  } catch {
@@ -683,16 +702,16 @@ async function Ve(n, s) {
683
702
  }
684
703
  if (!t) {
685
704
  try {
686
- a.push(i(u, "show", `${n}:./${de(c)}`)), e = !0;
705
+ a.push(i(u, "show", `${n}:./${me(c)}`)), e = !0;
687
706
  } catch {
688
707
  }
689
708
  continue;
690
709
  }
691
710
  const o = i(u, "ls-tree", "-r", "--name-only", n, "--", ".").split(`
692
- `).filter((r) => Q.test(r));
711
+ `).filter((r) => V.test(r));
693
712
  o.sort((r, l) => {
694
- const f = O(c, r), m = O(c, l);
695
- return f < m ? -1 : f > m ? 1 : 0;
713
+ const d = k(c, r), m = k(c, l);
714
+ return d < m ? -1 : d > m ? 1 : 0;
696
715
  });
697
716
  for (const r of o)
698
717
  a.push(i(u, "show", `${n}:./${r}`)), e = !0;
@@ -700,8 +719,8 @@ async function Ve(n, s) {
700
719
  return e ? a.join(`
701
720
  `) : void 0;
702
721
  }
703
- function V(n, s, i, a) {
704
- const e = Ee(n, s), c = e.api.breaking.length > 0, t = e.database.statements.some((o) => o.destructive), u = (c || t) && !i.has("--allow-breaking") ? 1 : 0;
722
+ function Y(n, s, i, a) {
723
+ const e = Te(n, s), c = e.api.breaking.length > 0, t = e.database.statements.some((o) => o.destructive), u = (c || t) && !i.has("--allow-breaking") ? 1 : 0;
705
724
  if (i.has("--json"))
706
725
  return a.out(JSON.stringify(e, null, 2)), u;
707
726
  a.out("# Database"), e.database.statements.length === 0 && a.out("no changes");
@@ -714,14 +733,14 @@ function V(n, s, i, a) {
714
733
  for (const o of e.notes) a.out(`note ${o}`);
715
734
  return u;
716
735
  }
717
- const Ye = {
736
+ const Ke = {
718
737
  out: (n) => process.stdout.write(n + `
719
738
  `),
720
739
  err: (n) => process.stderr.write(n + `
721
740
  `)
722
- }, Ze = typeof process < "u" && process.argv[1] !== void 0 && /lora-graphql(\.js)?$|cli\.js$/.test(process.argv[1]);
723
- Ze && Me(process.argv.slice(2)).then((n) => process.exit(n));
741
+ }, Xe = typeof process < "u" && process.argv[1] !== void 0 && /lora-graphql(\.js)?$|cli\.js$/.test(process.argv[1]);
742
+ Xe && Fe(process.argv.slice(2)).then((n) => process.exit(n));
724
743
  export {
725
- Me as main
744
+ Fe as main
726
745
  };
727
746
  //# sourceMappingURL=cli.js.map