twenty-sdk 0.3.0 → 0.3.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.
package/dist/cli.mjs CHANGED
@@ -1,24 +1,25 @@
1
1
  #!/usr/bin/env node
2
2
  import F from "chalk";
3
3
  import { Command as oo, CommanderError as Q0 } from "commander";
4
+ import { inspect as z0 } from "util";
4
5
  import * as Ie from "fs-extra";
5
6
  import Ut from "inquirer";
6
7
  import * as Ys from "path";
7
- import Hn, { join as Yn, relative as ac, sep as uc, posix as z0, resolve as Y0 } from "path";
8
- import H0 from "lodash.camelcase";
8
+ import Hn, { join as Yn, relative as ac, sep as uc, posix as Y0, resolve as H0 } from "path";
9
+ import K0 from "lodash.camelcase";
9
10
  import yi from "lodash.kebabcase";
10
11
  import { v4 as _i } from "uuid";
11
12
  import { c as hi, s as zu } from "./ObjectRecordGroupByDateGranularity-CtpRADP1-Bft-VMSh.mjs";
12
13
  import Hs from "axios";
13
- import { createClient as K0 } from "graphql-sse";
14
- import * as X0 from "os";
15
- import { glob as Z0 } from "fast-glob";
16
- import { createJiti as ev } from "jiti";
17
- import { fileURLToPath as nv } from "url";
18
- import { parse as tv } from "jsonc-parser";
19
- import * as rv from "chokidar";
20
- import { generate as iv } from "@genql/cli";
21
- const vn = process.env.INIT_CWD || process.cwd(), sv = ({
14
+ import { createClient as X0 } from "graphql-sse";
15
+ import * as Z0 from "os";
16
+ import { glob as ev } from "fast-glob";
17
+ import { createJiti as nv } from "jiti";
18
+ import { fileURLToPath as tv } from "url";
19
+ import { parse as rv } from "jsonc-parser";
20
+ import * as iv from "chokidar";
21
+ import { generate as sv } from "@genql/cli";
22
+ const vn = process.env.INIT_CWD || process.cwd(), ov = ({
22
23
  data: t
23
24
  }) => `import { defineObject } from 'twenty-sdk';
24
25
 
@@ -40,7 +41,7 @@ export default defineObject({
40
41
  // },
41
42
  ],
42
43
  });
43
- `, ov = ({
44
+ `, av = ({
44
45
  name: t,
45
46
  universalIdentifier: i = _i()
46
47
  }) => {
@@ -91,7 +92,7 @@ export default defineFunction({
91
92
  ],
92
93
  });
93
94
  `;
94
- }, av = ({
95
+ }, uv = ({
95
96
  name: t,
96
97
  universalIdentifier: i = _i()
97
98
  }) => {
@@ -121,8 +122,8 @@ var fr = { exports: {} };
121
122
  * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
122
123
  * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
123
124
  */
124
- var uv = fr.exports, Yu;
125
- function cv() {
125
+ var cv = fr.exports, Yu;
126
+ function lv() {
126
127
  return Yu || (Yu = 1, function(t, i) {
127
128
  (function() {
128
129
  var r, a = "4.17.21", u = 200, p = "Unsupported core-js use. Try https://npms.io/search?q=ponyfill.", v = "Expected a function", I = "Invalid `variable` option passed into `_.template`", N = "__lodash_hash_undefined__", R = 500, O = "__lodash_placeholder__", M = 1, Z = 2, ce = 4, W = 1, Te = 2, fe = 1, ve = 2, tt = 4, ye = 8, Ne = 16, Re = 32, Je = 64, ke = 128, rt = 256, x = 512, G = 30, Qe = "...", Si = 800, el = 16, mo = 1, nl = 2, tl = 3, it = 1 / 0, Mn = 9007199254740991, rl = 17976931348623157e292, Tr = NaN, _n = 4294967295, il = _n - 1, sl = _n >>> 1, ol = [
@@ -3782,24 +3783,24 @@ function print() { __p += __j.call(arguments, '') }
3782
3783
  }], z.prototype.clone = op, z.prototype.reverse = ap, z.prototype.value = up, l.prototype.at = $d, l.prototype.chain = Pd, l.prototype.commit = Md, l.prototype.next = Bd, l.prototype.plant = Vd, l.prototype.reverse = Wd, l.prototype.toJSON = l.prototype.valueOf = l.prototype.value = jd, l.prototype.first = l.prototype.head, Ht && (l.prototype[Ht] = Gd), l;
3783
3784
  }, xt = Mf();
3784
3785
  st ? ((st.exports = xt)._ = xt, ji._ = xt) : Se._ = xt;
3785
- }).call(uv);
3786
+ }).call(cv);
3786
3787
  }(fr, fr.exports)), fr.exports;
3787
3788
  }
3788
- var lv = cv();
3789
+ var fv = lv();
3789
3790
  const Hu = (t) => {
3790
- const i = lv.startCase(t).toLowerCase();
3791
+ const i = fv.startCase(t).toLowerCase();
3791
3792
  return i.charAt(0).toUpperCase() + i.slice(1);
3792
- }, fv = "src/app";
3793
+ }, pv = "src/app";
3793
3794
  var Ti = /* @__PURE__ */ ((t) => (t.AGENT = "agent", t.OBJECT = "object", t.FUNCTION = "function", t.ROLE = "role", t))(Ti || {});
3794
- const pv = (t) => Object.values(Ti).includes(t);
3795
- class hv {
3795
+ const hv = (t) => Object.values(Ti).includes(t);
3796
+ class dv {
3796
3797
  async execute(i, r) {
3797
3798
  try {
3798
- const a = r ? Yn(vn, r) : Yn(vn, fv);
3799
+ const a = r ? Yn(vn, r) : Yn(vn, pv);
3799
3800
  await Ie.ensureDir(a);
3800
3801
  const u = i ?? await this.getEntity();
3801
3802
  if (u === "object") {
3802
- const p = await this.getObjectData(), v = p.nameSingular, I = `${H0(v)}.object.ts`, N = sv({
3803
+ const p = await this.getObjectData(), v = p.nameSingular, I = `${K0(v)}.object.ts`, N = ov({
3803
3804
  data: p,
3804
3805
  name: v
3805
3806
  }), R = Yn(a, I);
@@ -3810,7 +3811,7 @@ class hv {
3810
3811
  return;
3811
3812
  }
3812
3813
  if (u === "function") {
3813
- const p = await this.getEntityName(u), v = `${yi(p)}.function.ts`, I = ov({
3814
+ const p = await this.getEntityName(u), v = `${yi(p)}.function.ts`, I = av({
3814
3815
  name: p
3815
3816
  }), N = Yn(a, v);
3816
3817
  await Ie.writeFile(N, I), console.log(
@@ -3820,7 +3821,7 @@ class hv {
3820
3821
  return;
3821
3822
  }
3822
3823
  if (u === "role") {
3823
- const p = await this.getEntityName(u), v = `${yi(p)}.role.ts`, I = av({
3824
+ const p = await this.getEntityName(u), v = `${yi(p)}.role.ts`, I = uv({
3824
3825
  name: p
3825
3826
  }), N = Yn(a, v);
3826
3827
  await Ie.writeFile(N, I), console.log(
@@ -3911,10 +3912,10 @@ function mr(t, i) {
3911
3912
  i ?? "Unexpected invariant triggered."
3912
3913
  );
3913
3914
  }
3914
- const dv = /\r\n|[\n\r]/g;
3915
+ const gv = /\r\n|[\n\r]/g;
3915
3916
  function eo(t, i) {
3916
3917
  let r = 0, a = 1;
3917
- for (const u of t.body.matchAll(dv)) {
3918
+ for (const u of t.body.matchAll(gv)) {
3918
3919
  if (typeof u.index == "number" || mr(!1), u.index >= i)
3919
3920
  break;
3920
3921
  r = u.index + u[0].length, a += 1;
@@ -3924,7 +3925,7 @@ function eo(t, i) {
3924
3925
  column: i + 1 - r
3925
3926
  };
3926
3927
  }
3927
- function gv(t) {
3928
+ function mv(t) {
3928
3929
  return cc(
3929
3930
  t.source,
3930
3931
  eo(t.source, t.start)
@@ -3957,7 +3958,7 @@ function Ku(t) {
3957
3958
  return i.map(([a, u]) => a.padStart(r) + (u ? " " + u : "")).join(`
3958
3959
  `);
3959
3960
  }
3960
- function mv(t) {
3961
+ function vv(t) {
3961
3962
  const i = t[0];
3962
3963
  return i == null || "kind" in i || "length" in i ? {
3963
3964
  nodes: i,
@@ -4009,7 +4010,7 @@ class re extends Error {
4009
4010
  */
4010
4011
  constructor(i, ...r) {
4011
4012
  var a, u, p;
4012
- const { nodes: v, source: I, positions: N, path: R, originalError: O, extensions: M } = mv(r);
4013
+ const { nodes: v, source: I, positions: N, path: R, originalError: O, extensions: M } = vv(r);
4013
4014
  super(i), this.name = "GraphQLError", this.path = R ?? void 0, this.originalError = O ?? void 0, this.nodes = Xu(
4014
4015
  Array.isArray(v) ? v : v ? [v] : void 0
4015
4016
  );
@@ -4059,7 +4060,7 @@ class re extends Error {
4059
4060
  for (const r of this.nodes)
4060
4061
  r.loc && (i += `
4061
4062
 
4062
- ` + gv(r.loc));
4063
+ ` + mv(r.loc));
4063
4064
  else if (this.source && this.locations)
4064
4065
  for (const r of this.locations)
4065
4066
  i += `
@@ -4083,7 +4084,7 @@ function Ae(t, i, r) {
4083
4084
  positions: [i]
4084
4085
  });
4085
4086
  }
4086
- class vv {
4087
+ class yv {
4087
4088
  /**
4088
4089
  * The character offset at which this Node begins.
4089
4090
  */
@@ -4228,10 +4229,10 @@ const fc = {
4228
4229
  UnionTypeExtension: ["name", "directives", "types"],
4229
4230
  EnumTypeExtension: ["name", "directives", "values"],
4230
4231
  InputObjectTypeExtension: ["name", "directives", "fields"]
4231
- }, yv = new Set(Object.keys(fc));
4232
+ }, _v = new Set(Object.keys(fc));
4232
4233
  function Zu(t) {
4233
4234
  const i = t?.kind;
4234
- return typeof i == "string" && yv.has(i);
4235
+ return typeof i == "string" && _v.has(i);
4235
4236
  }
4236
4237
  var Un;
4237
4238
  (function(t) {
@@ -4261,12 +4262,12 @@ function ao(t) {
4261
4262
  function hc(t) {
4262
4263
  return pc(t) || dr(t) || t === 95;
4263
4264
  }
4264
- function _v(t) {
4265
+ function Tv(t) {
4265
4266
  var i;
4266
4267
  let r = Number.MAX_SAFE_INTEGER, a = null, u = -1;
4267
4268
  for (let v = 0; v < t.length; ++v) {
4268
4269
  var p;
4269
- const I = t[v], N = Tv(I);
4270
+ const I = t[v], N = wv(I);
4270
4271
  N !== I.length && (a = (p = a) !== null && p !== void 0 ? p : v, u = v, v !== 0 && N < r && (r = N));
4271
4272
  }
4272
4273
  return t.map((v, I) => I === 0 ? v : v.slice(r)).slice(
@@ -4274,13 +4275,13 @@ function _v(t) {
4274
4275
  u + 1
4275
4276
  );
4276
4277
  }
4277
- function Tv(t) {
4278
+ function wv(t) {
4278
4279
  let i = 0;
4279
4280
  for (; i < t.length && no(t.charCodeAt(i)); )
4280
4281
  ++i;
4281
4282
  return i;
4282
4283
  }
4283
- function wv(t) {
4284
+ function Ev(t) {
4284
4285
  if (t === "")
4285
4286
  return !0;
4286
4287
  let i = !0, r = !1, a = !0, u = !1;
@@ -4319,7 +4320,7 @@ function wv(t) {
4319
4320
  }
4320
4321
  return !(i || a && u);
4321
4322
  }
4322
- function Ev(t, i) {
4323
+ function Iv(t, i) {
4323
4324
  const r = t.replace(/"""/g, '\\"""'), a = r.split(/\r\n|[\n\r]/g), u = a.length === 1, p = a.length > 1 && a.slice(1).every((ce) => ce.length === 0 || no(ce.charCodeAt(0))), v = r.endsWith('\\"""'), I = t.endsWith('"') && !v, N = t.endsWith("\\"), R = I || N, O = (
4324
4325
  // add leading and trailing new lines only if it improves readability
4325
4326
  !u || t.length > 70 || R || p || v
@@ -4334,7 +4335,7 @@ var E;
4334
4335
  (function(t) {
4335
4336
  t.SOF = "<SOF>", t.EOF = "<EOF>", t.BANG = "!", t.DOLLAR = "$", t.AMP = "&", t.PAREN_L = "(", t.PAREN_R = ")", t.SPREAD = "...", t.COLON = ":", t.EQUALS = "=", t.AT = "@", t.BRACKET_L = "[", t.BRACKET_R = "]", t.BRACE_L = "{", t.PIPE = "|", t.BRACE_R = "}", t.NAME = "Name", t.INT = "Int", t.FLOAT = "Float", t.STRING = "String", t.BLOCK_STRING = "BlockString", t.COMMENT = "Comment";
4336
4337
  })(E || (E = {}));
4337
- class Iv {
4338
+ class xv {
4338
4339
  /**
4339
4340
  * The previously focused non-ignored token.
4340
4341
  */
@@ -4371,14 +4372,14 @@ class Iv {
4371
4372
  if (i.next)
4372
4373
  i = i.next;
4373
4374
  else {
4374
- const r = Av(this, i.end);
4375
+ const r = Nv(this, i.end);
4375
4376
  i.next = r, r.prev = i, i = r;
4376
4377
  }
4377
4378
  while (i.kind === E.COMMENT);
4378
4379
  return i;
4379
4380
  }
4380
4381
  }
4381
- function xv(t) {
4382
+ function Av(t) {
4382
4383
  return t === E.BANG || t === E.DOLLAR || t === E.AMP || t === E.PAREN_L || t === E.PAREN_R || t === E.SPREAD || t === E.COLON || t === E.EQUALS || t === E.AT || t === E.BRACKET_L || t === E.BRACKET_R || t === E.BRACE_L || t === E.PIPE || t === E.BRACE_R;
4383
4384
  }
4384
4385
  function Pt(t) {
@@ -4407,7 +4408,7 @@ function _e(t, i, r, a, u) {
4407
4408
  const p = t.line, v = 1 + r - t.lineStart;
4408
4409
  return new lc(i, r, a, p, v, u);
4409
4410
  }
4410
- function Av(t, i) {
4411
+ function Nv(t, i) {
4411
4412
  const r = t.source.body, a = r.length;
4412
4413
  let u = i;
4413
4414
  for (; u < a; ) {
@@ -4448,7 +4449,7 @@ function Av(t, i) {
4448
4449
  continue;
4449
4450
  // Comment
4450
4451
  case 35:
4451
- return Nv(t, u);
4452
+ return Sv(t, u);
4452
4453
  // Token ::
4453
4454
  // - Punctuator
4454
4455
  // - Name
@@ -4489,12 +4490,12 @@ function Av(t, i) {
4489
4490
  return _e(t, E.BRACE_R, u, u + 1);
4490
4491
  // StringValue
4491
4492
  case 34:
4492
- return r.charCodeAt(u + 1) === 34 && r.charCodeAt(u + 2) === 34 ? Cv(t, u) : bv(t, u);
4493
+ return r.charCodeAt(u + 1) === 34 && r.charCodeAt(u + 2) === 34 ? Dv(t, u) : Ov(t, u);
4493
4494
  }
4494
4495
  if (dr(p) || p === 45)
4495
- return Sv(t, u, p);
4496
+ return bv(t, u, p);
4496
4497
  if (ao(p))
4497
- return Dv(t, u);
4498
+ return Fv(t, u);
4498
4499
  throw Ae(
4499
4500
  t.source,
4500
4501
  u,
@@ -4503,7 +4504,7 @@ function Av(t, i) {
4503
4504
  }
4504
4505
  return _e(t, E.EOF, a, a);
4505
4506
  }
4506
- function Nv(t, i) {
4507
+ function Sv(t, i) {
4507
4508
  const r = t.source.body, a = r.length;
4508
4509
  let u = i + 1;
4509
4510
  for (; u < a; ) {
@@ -4525,7 +4526,7 @@ function Nv(t, i) {
4525
4526
  r.slice(i + 1, u)
4526
4527
  );
4527
4528
  }
4528
- function Sv(t, i, r) {
4529
+ function bv(t, i, r) {
4529
4530
  const a = t.source.body;
4530
4531
  let u = i, p = r, v = !1;
4531
4532
  if (p === 45 && (p = a.charCodeAt(++u)), p === 48) {
@@ -4573,7 +4574,7 @@ function Ks(t, i, r) {
4573
4574
  ++u;
4574
4575
  return u;
4575
4576
  }
4576
- function bv(t, i) {
4577
+ function Ov(t, i) {
4577
4578
  const r = t.source.body, a = r.length;
4578
4579
  let u = i + 1, p = u, v = "";
4579
4580
  for (; u < a; ) {
@@ -4582,7 +4583,7 @@ function bv(t, i) {
4582
4583
  return v += r.slice(p, u), _e(t, E.STRING, i, u + 1, v);
4583
4584
  if (I === 92) {
4584
4585
  v += r.slice(p, u);
4585
- const N = r.charCodeAt(u + 1) === 117 ? r.charCodeAt(u + 2) === 123 ? Ov(t, u) : Lv(t, u) : Rv(t, u);
4586
+ const N = r.charCodeAt(u + 1) === 117 ? r.charCodeAt(u + 2) === 123 ? Lv(t, u) : Rv(t, u) : Cv(t, u);
4586
4587
  v += N.value, u += N.size, p = u;
4587
4588
  continue;
4588
4589
  }
@@ -4604,7 +4605,7 @@ function bv(t, i) {
4604
4605
  }
4605
4606
  throw Ae(t.source, u, "Unterminated string.");
4606
4607
  }
4607
- function Ov(t, i) {
4608
+ function Lv(t, i) {
4608
4609
  const r = t.source.body;
4609
4610
  let a = 0, u = 3;
4610
4611
  for (; u < 12; ) {
@@ -4629,7 +4630,7 @@ function Ov(t, i) {
4629
4630
  )}".`
4630
4631
  );
4631
4632
  }
4632
- function Lv(t, i) {
4633
+ function Rv(t, i) {
4633
4634
  const r = t.source.body, a = ec(r, i + 2);
4634
4635
  if (Pt(a))
4635
4636
  return {
@@ -4656,7 +4657,7 @@ function ec(t, i) {
4656
4657
  function pr(t) {
4657
4658
  return t >= 48 && t <= 57 ? t - 48 : t >= 65 && t <= 70 ? t - 55 : t >= 97 && t <= 102 ? t - 87 : -1;
4658
4659
  }
4659
- function Rv(t, i) {
4660
+ function Cv(t, i) {
4660
4661
  const r = t.source.body;
4661
4662
  switch (r.charCodeAt(i + 1)) {
4662
4663
  case 34:
@@ -4710,7 +4711,7 @@ function Rv(t, i) {
4710
4711
  )}".`
4711
4712
  );
4712
4713
  }
4713
- function Cv(t, i) {
4714
+ function Dv(t, i) {
4714
4715
  const r = t.source.body, a = r.length;
4715
4716
  let u = t.lineStart, p = i + 3, v = p, I = "";
4716
4717
  const N = [];
@@ -4724,7 +4725,7 @@ function Cv(t, i) {
4724
4725
  i,
4725
4726
  p + 3,
4726
4727
  // Return a string of the lines joined with U+000A.
4727
- _v(N).join(`
4728
+ Tv(N).join(`
4728
4729
  `)
4729
4730
  );
4730
4731
  return t.line += N.length - 1, t.lineStart = u, O;
@@ -4753,7 +4754,7 @@ function Cv(t, i) {
4753
4754
  }
4754
4755
  throw Ae(t.source, p, "Unterminated string.");
4755
4756
  }
4756
- function Dv(t, i) {
4757
+ function Fv(t, i) {
4757
4758
  const r = t.source.body, a = r.length;
4758
4759
  let u = i + 1;
4759
4760
  for (; u < a; ) {
@@ -4771,7 +4772,7 @@ function Dv(t, i) {
4771
4772
  r.slice(i, u)
4772
4773
  );
4773
4774
  }
4774
- const Fv = 10, mc = 2;
4775
+ const kv = 10, mc = 2;
4775
4776
  function P(t) {
4776
4777
  return Ii(t, []);
4777
4778
  }
@@ -4782,45 +4783,45 @@ function Ii(t, i) {
4782
4783
  case "function":
4783
4784
  return t.name ? `[function ${t.name}]` : "[function]";
4784
4785
  case "object":
4785
- return kv(t, i);
4786
+ return Uv(t, i);
4786
4787
  default:
4787
4788
  return String(t);
4788
4789
  }
4789
4790
  }
4790
- function kv(t, i) {
4791
+ function Uv(t, i) {
4791
4792
  if (t === null)
4792
4793
  return "null";
4793
4794
  if (i.includes(t))
4794
4795
  return "[Circular]";
4795
4796
  const r = [...i, t];
4796
- if (Uv(t)) {
4797
+ if ($v(t)) {
4797
4798
  const a = t.toJSON();
4798
4799
  if (a !== t)
4799
4800
  return typeof a == "string" ? a : Ii(a, r);
4800
4801
  } else if (Array.isArray(t))
4801
- return Pv(t, r);
4802
- return $v(t, r);
4802
+ return Mv(t, r);
4803
+ return Pv(t, r);
4803
4804
  }
4804
- function Uv(t) {
4805
+ function $v(t) {
4805
4806
  return typeof t.toJSON == "function";
4806
4807
  }
4807
- function $v(t, i) {
4808
+ function Pv(t, i) {
4808
4809
  const r = Object.entries(t);
4809
- return r.length === 0 ? "{}" : i.length > mc ? "[" + Mv(t) + "]" : "{ " + r.map(
4810
+ return r.length === 0 ? "{}" : i.length > mc ? "[" + Bv(t) + "]" : "{ " + r.map(
4810
4811
  ([u, p]) => u + ": " + Ii(p, i)
4811
4812
  ).join(", ") + " }";
4812
4813
  }
4813
- function Pv(t, i) {
4814
+ function Mv(t, i) {
4814
4815
  if (t.length === 0)
4815
4816
  return "[]";
4816
4817
  if (i.length > mc)
4817
4818
  return "[Array]";
4818
- const r = Math.min(Fv, t.length), a = t.length - r, u = [];
4819
+ const r = Math.min(kv, t.length), a = t.length - r, u = [];
4819
4820
  for (let p = 0; p < r; ++p)
4820
4821
  u.push(Ii(t[p], i));
4821
4822
  return a === 1 ? u.push("... 1 more item") : a > 1 && u.push(`... ${a} more items`), "[" + u.join(", ") + "]";
4822
4823
  }
4823
- function Mv(t) {
4824
+ function Bv(t) {
4824
4825
  const i = Object.prototype.toString.call(t).replace(/^\[object /, "").replace(/]$/, "");
4825
4826
  if (i === "Object" && typeof t.constructor == "function") {
4826
4827
  const r = t.constructor.name;
@@ -4879,19 +4880,19 @@ class vc {
4879
4880
  return "Source";
4880
4881
  }
4881
4882
  }
4882
- function Bv(t) {
4883
+ function Gv(t) {
4883
4884
  return An(t, vc);
4884
4885
  }
4885
- function Gv(t, i) {
4886
- const r = new Vv(t, i);
4886
+ function Vv(t, i) {
4887
+ const r = new Wv(t, i);
4887
4888
  r.expectToken(E.SOF);
4888
4889
  const a = r.parseValueLiteral(!1);
4889
4890
  return r.expectToken(E.EOF), a;
4890
4891
  }
4891
- class Vv {
4892
+ class Wv {
4892
4893
  constructor(i, r = {}) {
4893
- const a = Bv(i) ? i : new vc(i);
4894
- this._lexer = new Iv(a), this._options = r, this._tokenCounter = 0;
4894
+ const a = Gv(i) ? i : new vc(i);
4895
+ this._lexer = new xv(a), this._options = r, this._tokenCounter = 0;
4895
4896
  }
4896
4897
  /**
4897
4898
  * Converts a name lex token into a name parse node.
@@ -5858,7 +5859,7 @@ class Vv {
5858
5859
  * given parsed object.
5859
5860
  */
5860
5861
  node(i, r) {
5861
- return this._options.noLocation !== !0 && (r.loc = new vv(
5862
+ return this._options.noLocation !== !0 && (r.loc = new yv(
5862
5863
  i,
5863
5864
  this._lexer.lastToken,
5864
5865
  this._lexer.source
@@ -5994,10 +5995,10 @@ function di(t) {
5994
5995
  return yc(t.kind) + (i != null ? ` "${i}"` : "");
5995
5996
  }
5996
5997
  function yc(t) {
5997
- return xv(t) ? `"${t}"` : t;
5998
+ return Av(t) ? `"${t}"` : t;
5998
5999
  }
5999
- const Wv = 5;
6000
- function jv(t, i) {
6000
+ const jv = 5;
6001
+ function qv(t, i) {
6001
6002
  const [r, a] = i ? [t, i] : [void 0, t];
6002
6003
  let u = " Did you mean ";
6003
6004
  r && (u += r + " ");
@@ -6010,7 +6011,7 @@ function jv(t, i) {
6010
6011
  case 2:
6011
6012
  return u + p[0] + " or " + p[1] + "?";
6012
6013
  }
6013
- const v = p.slice(0, Wv), I = v.pop();
6014
+ const v = p.slice(0, jv), I = v.pop();
6014
6015
  return u + v.join(", ") + ", or " + I + "?";
6015
6016
  }
6016
6017
  function nc(t) {
@@ -6034,7 +6035,7 @@ function xi(t, i) {
6034
6035
  r[a] = i(t[a], a);
6035
6036
  return r;
6036
6037
  }
6037
- function qv(t, i) {
6038
+ function Jv(t, i) {
6038
6039
  let r = 0, a = 0;
6039
6040
  for (; r < t.length && a < i.length; ) {
6040
6041
  let u = t.charCodeAt(r), p = i.charCodeAt(a);
@@ -6061,22 +6062,22 @@ function qv(t, i) {
6061
6062
  }
6062
6063
  return t.length - i.length;
6063
6064
  }
6064
- const to = 48, Jv = 57;
6065
+ const to = 48, Qv = 57;
6065
6066
  function gi(t) {
6066
- return !isNaN(t) && to <= t && t <= Jv;
6067
+ return !isNaN(t) && to <= t && t <= Qv;
6067
6068
  }
6068
- function Qv(t, i) {
6069
- const r = /* @__PURE__ */ Object.create(null), a = new zv(t), u = Math.floor(t.length * 0.4) + 1;
6069
+ function zv(t, i) {
6070
+ const r = /* @__PURE__ */ Object.create(null), a = new Yv(t), u = Math.floor(t.length * 0.4) + 1;
6070
6071
  for (const p of i) {
6071
6072
  const v = a.measure(p, u);
6072
6073
  v !== void 0 && (r[p] = v);
6073
6074
  }
6074
6075
  return Object.keys(r).sort((p, v) => {
6075
6076
  const I = r[p] - r[v];
6076
- return I !== 0 ? I : qv(p, v);
6077
+ return I !== 0 ? I : Jv(p, v);
6077
6078
  });
6078
6079
  }
6079
- class zv {
6080
+ class Yv {
6080
6081
  constructor(i) {
6081
6082
  this._input = i, this._inputLowerCase = i.toLowerCase(), this._inputArray = tc(this._inputLowerCase), this._rows = [
6082
6083
  new Array(i.length + 1).fill(0),
@@ -6143,14 +6144,14 @@ function un(t) {
6143
6144
  i[r] = a;
6144
6145
  return i;
6145
6146
  }
6146
- function Yv(t) {
6147
- return `"${t.replace(Hv, Kv)}"`;
6147
+ function Hv(t) {
6148
+ return `"${t.replace(Kv, Xv)}"`;
6148
6149
  }
6149
- const Hv = /[\x00-\x1f\x22\x5c\x7f-\x9f]/g;
6150
- function Kv(t) {
6151
- return Xv[t.charCodeAt(0)];
6150
+ const Kv = /[\x00-\x1f\x22\x5c\x7f-\x9f]/g;
6151
+ function Xv(t) {
6152
+ return Zv[t.charCodeAt(0)];
6152
6153
  }
6153
- const Xv = [
6154
+ const Zv = [
6154
6155
  "\\u0000",
6155
6156
  "\\u0001",
6156
6157
  "\\u0002",
@@ -6316,11 +6317,11 @@ const Xv = [
6316
6317
  "\\u009D",
6317
6318
  "\\u009E",
6318
6319
  "\\u009F"
6319
- ], Zv = Object.freeze({});
6320
- function ey(t, i, r = fc) {
6320
+ ], ey = Object.freeze({});
6321
+ function ny(t, i, r = fc) {
6321
6322
  const a = /* @__PURE__ */ new Map();
6322
6323
  for (const ve of Object.values(S))
6323
- a.set(ve, ny(i, ve));
6324
+ a.set(ve, ty(i, ve));
6324
6325
  let u, p = Array.isArray(t), v = [t], I = -1, N = [], R = t, O, M;
6325
6326
  const Z = [], ce = [];
6326
6327
  do {
@@ -6354,7 +6355,7 @@ function ey(t, i, r = fc) {
6354
6355
  var W, Te;
6355
6356
  Zu(R) || ne(!1, `Invalid AST Node: ${P(R)}.`);
6356
6357
  const Ne = ve ? (W = a.get(R.kind)) === null || W === void 0 ? void 0 : W.leave : (Te = a.get(R.kind)) === null || Te === void 0 ? void 0 : Te.enter;
6357
- if (ye = Ne?.call(i, R, O, M, Z, ce), ye === Zv)
6358
+ if (ye = Ne?.call(i, R, O, M, Z, ce), ye === ey)
6358
6359
  break;
6359
6360
  if (ye === !1) {
6360
6361
  if (!ve) {
@@ -6384,7 +6385,7 @@ function ey(t, i, r = fc) {
6384
6385
  } while (u !== void 0);
6385
6386
  return N.length !== 0 ? N[N.length - 1][1] : t;
6386
6387
  }
6387
- function ny(t, i) {
6388
+ function ty(t, i) {
6388
6389
  const r = t[i];
6389
6390
  return typeof r == "object" ? r : typeof r == "function" ? {
6390
6391
  enter: r,
@@ -6395,9 +6396,9 @@ function ny(t, i) {
6395
6396
  };
6396
6397
  }
6397
6398
  function on(t) {
6398
- return ey(t, ry);
6399
+ return ny(t, iy);
6399
6400
  }
6400
- const ty = 80, ry = {
6401
+ const ry = 80, iy = {
6401
6402
  Name: {
6402
6403
  leave: (t) => t.value
6403
6404
  },
@@ -6433,7 +6434,7 @@ const ty = 80, ry = {
6433
6434
  leave({ alias: t, name: i, arguments: r, directives: a, selectionSet: u }) {
6434
6435
  const p = Y("", t, ": ") + i;
6435
6436
  let v = p + Y("(", C(r, ", "), ")");
6436
- return v.length > ty && (v = p + Y(`(
6437
+ return v.length > ry && (v = p + Y(`(
6437
6438
  `, vi(C(r, `
6438
6439
  `)), `
6439
6440
  )`)), C([v, C(a, " "), u], " ");
@@ -6471,7 +6472,7 @@ const ty = 80, ry = {
6471
6472
  leave: ({ value: t }) => t
6472
6473
  },
6473
6474
  StringValue: {
6474
- leave: ({ value: t, block: i }) => i ? Ev(t) : Yv(t)
6475
+ leave: ({ value: t, block: i }) => i ? Iv(t) : Hv(t)
6475
6476
  },
6476
6477
  BooleanValue: {
6477
6478
  leave: ({ value: t }) => t ? "true" : "false"
@@ -6696,7 +6697,7 @@ function yn(t) {
6696
6697
  );
6697
6698
  return t;
6698
6699
  }
6699
- function iy(t) {
6700
+ function sy(t) {
6700
6701
  if (t === "true" || t === "false" || t === "null")
6701
6702
  throw new re(`Enum values cannot be named: ${t}`);
6702
6703
  return yn(t);
@@ -6710,7 +6711,7 @@ function Mt(t) {
6710
6711
  function $n(t) {
6711
6712
  return An(t, nt);
6712
6713
  }
6713
- function sy(t) {
6714
+ function oy(t) {
6714
6715
  if (!$n(t))
6715
6716
  throw new Error(`Expected ${P(t)} to be a GraphQL Object type.`);
6716
6717
  return t;
@@ -6718,7 +6719,7 @@ function sy(t) {
6718
6719
  function rn(t) {
6719
6720
  return An(t, Cc);
6720
6721
  }
6721
- function oy(t) {
6722
+ function ay(t) {
6722
6723
  if (!rn(t))
6723
6724
  throw new Error(
6724
6725
  `Expected ${P(t)} to be a GraphQL Interface type.`
@@ -6749,7 +6750,7 @@ function Ec(t) {
6749
6750
  function Ic(t) {
6750
6751
  return Mt(t) || Zn(t);
6751
6752
  }
6752
- function ay(t) {
6753
+ function uy(t) {
6753
6754
  return rn(t) || Xn(t);
6754
6755
  }
6755
6756
  class tn {
@@ -6789,12 +6790,12 @@ function uo(t) {
6789
6790
  function xc(t) {
6790
6791
  return Tc(t) && !Kn(t);
6791
6792
  }
6792
- function uy(t) {
6793
+ function cy(t) {
6793
6794
  if (!xc(t))
6794
6795
  throw new Error(`Expected ${P(t)} to be a GraphQL nullable type.`);
6795
6796
  return t;
6796
6797
  }
6797
- function cy(t) {
6798
+ function ly(t) {
6798
6799
  if (t) {
6799
6800
  let i = t;
6800
6801
  for (; uo(i); )
@@ -7002,7 +7003,7 @@ class Cc {
7002
7003
  class Dc {
7003
7004
  constructor(i) {
7004
7005
  var r;
7005
- this.name = yn(i.name), this.description = i.description, this.resolveType = i.resolveType, this.extensions = un(i.extensions), this.astNode = i.astNode, this.extensionASTNodes = (r = i.extensionASTNodes) !== null && r !== void 0 ? r : [], this._types = ly.bind(void 0, i), i.resolveType == null || typeof i.resolveType == "function" || ne(
7006
+ this.name = yn(i.name), this.description = i.description, this.resolveType = i.resolveType, this.extensions = un(i.extensions), this.astNode = i.astNode, this.extensionASTNodes = (r = i.extensionASTNodes) !== null && r !== void 0 ? r : [], this._types = fy.bind(void 0, i), i.resolveType == null || typeof i.resolveType == "function" || ne(
7006
7007
  !1,
7007
7008
  `${this.name} must provide "resolveType" as a function, but got: ${P(i.resolveType)}.`
7008
7009
  );
@@ -7031,7 +7032,7 @@ class Dc {
7031
7032
  return this.toString();
7032
7033
  }
7033
7034
  }
7034
- function ly(t) {
7035
+ function fy(t) {
7035
7036
  const i = Ac(t.types);
7036
7037
  return Array.isArray(i) || ne(
7037
7038
  !1,
@@ -7042,7 +7043,7 @@ class Ai {
7042
7043
  /* <T> */
7043
7044
  constructor(i) {
7044
7045
  var r;
7045
- this.name = yn(i.name), this.description = i.description, this.extensions = un(i.extensions), this.astNode = i.astNode, this.extensionASTNodes = (r = i.extensionASTNodes) !== null && r !== void 0 ? r : [], this._values = fy(this.name, i.values), this._valueLookup = new Map(
7046
+ this.name = yn(i.name), this.description = i.description, this.extensions = un(i.extensions), this.astNode = i.astNode, this.extensionASTNodes = (r = i.extensionASTNodes) !== null && r !== void 0 ? r : [], this._values = py(this.name, i.values), this._valueLookup = new Map(
7046
7047
  this._values.map((a) => [a.value, a])
7047
7048
  ), this._nameLookup = _c(this._values, (a) => a.name);
7048
7049
  }
@@ -7128,10 +7129,10 @@ class Ai {
7128
7129
  }
7129
7130
  }
7130
7131
  function mi(t, i) {
7131
- const r = t.getValues().map((u) => u.name), a = Qv(i, r);
7132
- return jv("the enum value", a);
7132
+ const r = t.getValues().map((u) => u.name), a = zv(i, r);
7133
+ return qv("the enum value", a);
7133
7134
  }
7134
- function fy(t, i) {
7135
+ function py(t, i) {
7135
7136
  return $t(i) || ne(
7136
7137
  !1,
7137
7138
  `${t} values must be an object with value names as keys.`
@@ -7139,7 +7140,7 @@ function fy(t, i) {
7139
7140
  !1,
7140
7141
  `${t}.${r} must refer to an object with a "value" key representing an internal value but got: ${P(a)}.`
7141
7142
  ), {
7142
- name: iy(r),
7143
+ name: sy(r),
7143
7144
  description: a.description,
7144
7145
  value: a.value !== void 0 ? a.value : r,
7145
7146
  deprecationReason: a.deprecationReason,
@@ -7150,7 +7151,7 @@ function fy(t, i) {
7150
7151
  class Fc {
7151
7152
  constructor(i) {
7152
7153
  var r;
7153
- this.name = yn(i.name), this.description = i.description, this.extensions = un(i.extensions), this.astNode = i.astNode, this.extensionASTNodes = (r = i.extensionASTNodes) !== null && r !== void 0 ? r : [], this._fields = py.bind(void 0, i);
7154
+ this.name = yn(i.name), this.description = i.description, this.extensions = un(i.extensions), this.astNode = i.astNode, this.extensionASTNodes = (r = i.extensionASTNodes) !== null && r !== void 0 ? r : [], this._fields = hy.bind(void 0, i);
7154
7155
  }
7155
7156
  get [Symbol.toStringTag]() {
7156
7157
  return "GraphQLInputObjectType";
@@ -7183,7 +7184,7 @@ class Fc {
7183
7184
  return this.toString();
7184
7185
  }
7185
7186
  }
7186
- function py(t) {
7187
+ function hy(t) {
7187
7188
  const i = Nc(t.fields);
7188
7189
  return $t(i) || ne(
7189
7190
  !1,
@@ -7201,7 +7202,7 @@ function py(t) {
7201
7202
  astNode: r.astNode
7202
7203
  }));
7203
7204
  }
7204
- const Xs = 2147483647, Zs = -2147483648, hy = new mt({
7205
+ const Xs = 2147483647, Zs = -2147483648, dy = new mt({
7205
7206
  name: "Int",
7206
7207
  description: "The `Int` scalar type represents non-fractional signed whole numeric values. Int can represent values between -(2^31) and 2^31 - 1.",
7207
7208
  serialize(t) {
@@ -7248,7 +7249,7 @@ const Xs = 2147483647, Zs = -2147483648, hy = new mt({
7248
7249
  );
7249
7250
  return i;
7250
7251
  }
7251
- }), dy = new mt({
7252
+ }), gy = new mt({
7252
7253
  name: "Float",
7253
7254
  description: "The `Float` scalar type represents signed double-precision fractional values as specified by [IEEE 754](https://en.wikipedia.org/wiki/IEEE_floating_point).",
7254
7255
  serialize(t) {
@@ -7371,12 +7372,12 @@ const Xs = 2147483647, Zs = -2147483648, hy = new mt({
7371
7372
  }
7372
7373
  }), Uc = Object.freeze([
7373
7374
  me,
7374
- hy,
7375
7375
  dy,
7376
+ gy,
7376
7377
  sn,
7377
7378
  kc
7378
7379
  ]);
7379
- function gy(t) {
7380
+ function my(t) {
7380
7381
  return Uc.some(({ name: i }) => t.name === i);
7381
7382
  }
7382
7383
  function yr(t) {
@@ -7391,7 +7392,7 @@ function yr(t) {
7391
7392
  }
7392
7393
  return t;
7393
7394
  }
7394
- function my(t) {
7395
+ function vy(t) {
7395
7396
  return An(t, Bt);
7396
7397
  }
7397
7398
  class Bt {
@@ -7425,7 +7426,7 @@ class Bt {
7425
7426
  return this.toString();
7426
7427
  }
7427
7428
  }
7428
- const vy = new Bt({
7429
+ const yy = new Bt({
7429
7430
  name: "include",
7430
7431
  description: "Directs the executor to include this field or fragment only when the `if` argument is true.",
7431
7432
  locations: [
@@ -7439,7 +7440,7 @@ const vy = new Bt({
7439
7440
  description: "Included when true."
7440
7441
  }
7441
7442
  }
7442
- }), yy = new Bt({
7443
+ }), _y = new Bt({
7443
7444
  name: "skip",
7444
7445
  description: "Directs the executor to skip this field or fragment when the `if` argument is true.",
7445
7446
  locations: [
@@ -7453,7 +7454,7 @@ const vy = new Bt({
7453
7454
  description: "Skipped when true."
7454
7455
  }
7455
7456
  }
7456
- }), $c = "No longer supported", _y = new Bt({
7457
+ }), $c = "No longer supported", Ty = new Bt({
7457
7458
  name: "deprecated",
7458
7459
  description: "Marks an element of a GraphQL schema as no longer supported.",
7459
7460
  locations: [
@@ -7469,7 +7470,7 @@ const vy = new Bt({
7469
7470
  defaultValue: $c
7470
7471
  }
7471
7472
  }
7472
- }), Ty = new Bt({
7473
+ }), wy = new Bt({
7473
7474
  name: "specifiedBy",
7474
7475
  description: "Exposes a URL that specifies the behavior of this scalar.",
7475
7476
  locations: [X.SCALAR],
@@ -7480,15 +7481,15 @@ const vy = new Bt({
7480
7481
  }
7481
7482
  }
7482
7483
  }), Pc = Object.freeze([
7483
- vy,
7484
7484
  yy,
7485
7485
  _y,
7486
- Ty
7486
+ Ty,
7487
+ wy
7487
7488
  ]);
7488
- function wy(t) {
7489
+ function Ey(t) {
7489
7490
  return Pc.some(({ name: i }) => i === t.name);
7490
7491
  }
7491
- function Ey(t) {
7492
+ function Iy(t) {
7492
7493
  return typeof t == "object" && typeof t?.[Symbol.iterator] == "function";
7493
7494
  }
7494
7495
  function kt(t, i) {
@@ -7504,7 +7505,7 @@ function kt(t, i) {
7504
7505
  return null;
7505
7506
  if (vr(i)) {
7506
7507
  const r = i.ofType;
7507
- if (Ey(t)) {
7508
+ if (Iy(t)) {
7508
7509
  const a = [];
7509
7510
  for (const u of t) {
7510
7511
  const p = kt(u, r);
@@ -7795,7 +7796,7 @@ In some cases, you need to provide options to alter GraphQL's execution behavior
7795
7796
  possibleTypes: {
7796
7797
  type: new tn(new K(In)),
7797
7798
  resolve(t, i, r, { schema: a }) {
7798
- if (ay(t))
7799
+ if (uy(t))
7799
7800
  return a.getPossibleTypes(t);
7800
7801
  }
7801
7802
  },
@@ -7983,10 +7984,10 @@ const jc = Object.freeze([
7983
7984
  Vc,
7984
7985
  Wc
7985
7986
  ]);
7986
- function Iy(t) {
7987
+ function xy(t) {
7987
7988
  return jc.some(({ name: i }) => t.name === i);
7988
7989
  }
7989
- class xy {
7990
+ class Ay {
7990
7991
  // Used as a cache for validateSchema().
7991
7992
  constructor(i) {
7992
7993
  var r, a;
@@ -8003,7 +8004,7 @@ class xy {
8003
8004
  u.delete(p), mn(p, u);
8004
8005
  this._queryType != null && mn(this._queryType, u), this._mutationType != null && mn(this._mutationType, u), this._subscriptionType != null && mn(this._subscriptionType, u);
8005
8006
  for (const p of this._directives)
8006
- if (my(p))
8007
+ if (vy(p))
8007
8008
  for (const v of p.args)
8008
8009
  mn(v.type, u);
8009
8010
  mn(co, u), this._typeMap = /* @__PURE__ */ Object.create(null), this._subTypeMap = /* @__PURE__ */ Object.create(null), this._implementationsMap = /* @__PURE__ */ Object.create(null);
@@ -8116,7 +8117,7 @@ class xy {
8116
8117
  }
8117
8118
  }
8118
8119
  function mn(t, i) {
8119
- const r = cy(t);
8120
+ const r = ly(t);
8120
8121
  if (!i.has(r)) {
8121
8122
  if (i.add(r), Xn(r))
8122
8123
  for (const a of r.getTypes())
@@ -8200,7 +8201,7 @@ function hr(t, i, r) {
8200
8201
  function sc(t, i) {
8201
8202
  return t.kind === S.VARIABLE && i == null;
8202
8203
  }
8203
- function Ay(t) {
8204
+ function Ny(t) {
8204
8205
  const i = {
8205
8206
  descriptions: !0,
8206
8207
  specifiedByUrl: !1,
@@ -8319,7 +8320,7 @@ function Ay(t) {
8319
8320
  }
8320
8321
  `;
8321
8322
  }
8322
- function Ny(t, i) {
8323
+ function Sy(t, i) {
8323
8324
  Pn(t) && Pn(t.__schema) || ne(
8324
8325
  !1,
8325
8326
  `Invalid or incomplete introspection result. Ensure that you are passing "data" property of introspection response and no "errors" was returned alongside: ${P(
@@ -8334,7 +8335,7 @@ function Ny(t, i) {
8334
8335
  for (const x of [...Uc, ...jc])
8335
8336
  a[x.name] && (a[x.name] = x);
8336
8337
  const u = r.queryType ? O(r.queryType) : null, p = r.mutationType ? O(r.mutationType) : null, v = r.subscriptionType ? O(r.subscriptionType) : null, I = r.directives ? r.directives.map(rt) : [];
8337
- return new xy({
8338
+ return new Ay({
8338
8339
  description: r.description,
8339
8340
  query: u,
8340
8341
  mutation: p,
@@ -8355,7 +8356,7 @@ function Ny(t, i) {
8355
8356
  if (!G)
8356
8357
  throw new Error("Decorated type deeper than introspection query.");
8357
8358
  const Qe = N(G);
8358
- return new K(uy(Qe));
8359
+ return new K(cy(Qe));
8359
8360
  }
8360
8361
  return R(x);
8361
8362
  }
@@ -8371,10 +8372,10 @@ function Ny(t, i) {
8371
8372
  return Qe;
8372
8373
  }
8373
8374
  function O(x) {
8374
- return sy(R(x));
8375
+ return oy(R(x));
8375
8376
  }
8376
8377
  function M(x) {
8377
- return oy(R(x));
8378
+ return ay(R(x));
8378
8379
  }
8379
8380
  function Z(x) {
8380
8381
  if (x != null && x.name != null && x.kind != null)
@@ -8524,7 +8525,7 @@ function Ny(t, i) {
8524
8525
  `Introspection must provide input type for arguments, but received: ${Si}.`
8525
8526
  );
8526
8527
  }
8527
- const Qe = x.defaultValue != null ? hr(Gv(x.defaultValue), G) : void 0;
8528
+ const Qe = x.defaultValue != null ? hr(Vv(x.defaultValue), G) : void 0;
8528
8529
  return {
8529
8530
  description: x.description,
8530
8531
  type: G,
@@ -8554,28 +8555,28 @@ function Ny(t, i) {
8554
8555
  });
8555
8556
  }
8556
8557
  }
8557
- function Sy(t) {
8558
- return Oy(
8558
+ function by(t) {
8559
+ return Ly(
8559
8560
  t,
8560
- (i) => !wy(i),
8561
- by
8561
+ (i) => !Ey(i),
8562
+ Oy
8562
8563
  );
8563
8564
  }
8564
- function by(t) {
8565
- return !gy(t) && !Iy(t);
8565
+ function Oy(t) {
8566
+ return !my(t) && !xy(t);
8566
8567
  }
8567
- function Oy(t, i, r) {
8568
+ function Ly(t, i, r) {
8568
8569
  const a = t.getDirectives().filter(i), u = Object.values(t.getTypeMap()).filter(r);
8569
8570
  return [
8570
- Ly(t),
8571
- ...a.map((p) => My(p)),
8572
- ...u.map((p) => Cy(p))
8571
+ Ry(t),
8572
+ ...a.map((p) => By(p)),
8573
+ ...u.map((p) => Dy(p))
8573
8574
  ].filter(Boolean).join(`
8574
8575
 
8575
8576
  `);
8576
8577
  }
8577
- function Ly(t) {
8578
- if (t.description == null && Ry(t))
8578
+ function Ry(t) {
8579
+ if (t.description == null && Cy(t))
8579
8580
  return;
8580
8581
  const i = [], r = t.getQueryType();
8581
8582
  r && i.push(` query: ${r.name}`);
@@ -8587,7 +8588,7 @@ ${i.join(`
8587
8588
  `)}
8588
8589
  }`;
8589
8590
  }
8590
- function Ry(t) {
8591
+ function Cy(t) {
8591
8592
  const i = t.getQueryType();
8592
8593
  if (i && i.name !== "Query")
8593
8594
  return !1;
@@ -8597,45 +8598,45 @@ function Ry(t) {
8597
8598
  const a = t.getSubscriptionType();
8598
8599
  return !(a && a.name !== "Subscription");
8599
8600
  }
8600
- function Cy(t) {
8601
+ function Dy(t) {
8601
8602
  if (Mt(t))
8602
- return Dy(t);
8603
- if ($n(t))
8604
8603
  return Fy(t);
8605
- if (rn(t))
8604
+ if ($n(t))
8606
8605
  return ky(t);
8607
- if (Xn(t))
8606
+ if (rn(t))
8608
8607
  return Uy(t);
8609
- if (Zn(t))
8608
+ if (Xn(t))
8610
8609
  return $y(t);
8611
- if (et(t))
8610
+ if (Zn(t))
8612
8611
  return Py(t);
8612
+ if (et(t))
8613
+ return My(t);
8613
8614
  mr(!1, "Unexpected type: " + P(t));
8614
8615
  }
8615
- function Dy(t) {
8616
- return an(t) + `scalar ${t.name}` + By(t);
8616
+ function Fy(t) {
8617
+ return an(t) + `scalar ${t.name}` + Gy(t);
8617
8618
  }
8618
8619
  function qc(t) {
8619
8620
  const i = t.getInterfaces();
8620
8621
  return i.length ? " implements " + i.map((r) => r.name).join(" & ") : "";
8621
8622
  }
8622
- function Fy(t) {
8623
+ function ky(t) {
8623
8624
  return an(t) + `type ${t.name}` + qc(t) + Jc(t);
8624
8625
  }
8625
- function ky(t) {
8626
+ function Uy(t) {
8626
8627
  return an(t) + `interface ${t.name}` + qc(t) + Jc(t);
8627
8628
  }
8628
- function Uy(t) {
8629
+ function $y(t) {
8629
8630
  const i = t.getTypes(), r = i.length ? " = " + i.join(" | ") : "";
8630
8631
  return an(t) + "union " + t.name + r;
8631
8632
  }
8632
- function $y(t) {
8633
+ function Py(t) {
8633
8634
  const i = t.getValues().map(
8634
8635
  (r, a) => an(r, " ", !a) + " " + r.name + fo(r.deprecationReason)
8635
8636
  );
8636
8637
  return an(t) + `enum ${t.name}` + lo(i);
8637
8638
  }
8638
- function Py(t) {
8639
+ function My(t) {
8639
8640
  const i = Object.values(t.getFields()).map(
8640
8641
  (r, a) => an(r, " ", !a) + " " + io(r)
8641
8642
  );
@@ -8666,7 +8667,7 @@ function io(t) {
8666
8667
  let r = t.name + ": " + String(t.type);
8667
8668
  return i && (r += ` = ${on(i)}`), r + fo(t.deprecationReason);
8668
8669
  }
8669
- function My(t) {
8670
+ function By(t) {
8670
8671
  return an(t) + "directive @" + t.name + Qc(t.args) + (t.isRepeatable ? " repeatable" : "") + " on " + t.locations.join(" | ");
8671
8672
  }
8672
8673
  function fo(t) {
@@ -8675,7 +8676,7 @@ function fo(t) {
8675
8676
  value: t
8676
8677
  })})` : " @deprecated";
8677
8678
  }
8678
- function By(t) {
8679
+ function Gy(t) {
8679
8680
  return t.specifiedByURL == null ? "" : ` @specifiedBy(url: ${on({
8680
8681
  kind: S.STRING,
8681
8682
  value: t.specifiedByURL
@@ -8688,7 +8689,7 @@ function an(t, i = "", r = !0) {
8688
8689
  const u = on({
8689
8690
  kind: S.STRING,
8690
8691
  value: a,
8691
- block: wv(a)
8692
+ block: Ev(a)
8692
8693
  });
8693
8694
  return (i && !r ? `
8694
8695
  ` + i : i) + u.replace(/\n/g, `
@@ -8697,7 +8698,7 @@ function an(t, i = "", r = !0) {
8697
8698
  }
8698
8699
  const lr = "default", wi = class wi {
8699
8700
  constructor() {
8700
- this.configPath = Ys.join(X0.homedir(), ".twenty", "config.json");
8701
+ this.configPath = Ys.join(Z0.homedir(), ".twenty", "config.json");
8701
8702
  }
8702
8703
  static setActiveWorkspace(i) {
8703
8704
  this.activeWorkspace = i ?? lr;
@@ -8874,7 +8875,7 @@ class Gt {
8874
8875
  }
8875
8876
  async getSchema() {
8876
8877
  try {
8877
- const i = Ay(), r = await this.client.post(
8878
+ const i = Ny(), r = await this.client.post(
8878
8879
  "/graphql",
8879
8880
  {
8880
8881
  query: i
@@ -8891,10 +8892,10 @@ class Gt {
8891
8892
  success: !1,
8892
8893
  error: `GraphQL introspection errors: ${JSON.stringify(r.data.errors)}`
8893
8894
  };
8894
- const a = Ny(r.data.data);
8895
+ const a = Sy(r.data.data);
8895
8896
  return {
8896
8897
  success: !0,
8897
- data: Sy(a),
8898
+ data: by(a),
8898
8899
  message: "Successfully load schema"
8899
8900
  };
8900
8901
  } catch (i) {
@@ -8911,7 +8912,7 @@ class Gt {
8911
8912
  functionUniversalIdentifier: r,
8912
8913
  functionName: a
8913
8914
  }) {
8914
- const u = await this.configService.getConfig(), p = K0({
8915
+ const u = await this.configService.getConfig(), p = X0({
8915
8916
  url: u.apiUrl + "/graphql",
8916
8917
  headers: {
8917
8918
  Authorization: `Bearer ${u.apiKey}`,
@@ -8944,7 +8945,7 @@ class Gt {
8944
8945
  );
8945
8946
  }
8946
8947
  }
8947
- const zc = () => ev(nv(import.meta.url), {
8948
+ const zc = () => nv(tv(import.meta.url), {
8948
8949
  moduleCache: !1,
8949
8950
  // Don't cache during dev for hot reload
8950
8951
  fsCache: !1,
@@ -8969,8 +8970,8 @@ const zc = () => ev(nv(import.meta.url), {
8969
8970
  `Failed to load config from ${t}: ${r.message}`
8970
8971
  ) : r;
8971
8972
  }
8972
- }, Gy = (t) => t.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"), Vy = (t, i, r, a) => {
8973
- const u = Gy(i), p = [
8973
+ }, Vy = (t) => t.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"), Wy = (t, i, r, a) => {
8974
+ const u = Vy(i), p = [
8974
8975
  // Named import: import { foo } from 'path' or import { foo, bar } from 'path'
8975
8976
  new RegExp(
8976
8977
  `import\\s*\\{[^}]*\\b${u}\\b[^}]*\\}\\s*from\\s*['"]([^'"]+)['"]`
@@ -8990,7 +8991,7 @@ const zc = () => ev(nv(import.meta.url), {
8990
8991
  }
8991
8992
  }
8992
8993
  return null;
8993
- }, Wy = async (t, i) => {
8994
+ }, jy = async (t, i) => {
8994
8995
  const r = zc();
8995
8996
  try {
8996
8997
  const a = await r.import(t), p = Yc(a, (O) => typeof O == "object" && O !== null && "handler" in O && typeof O.handler == "function");
@@ -9003,7 +9004,7 @@ const zc = () => ev(nv(import.meta.url), {
9003
9004
  throw new Error(
9004
9005
  `Handler function in ${t} must be a named function`
9005
9006
  );
9006
- const I = await Ie.readFile(t, "utf8"), R = Vy(
9007
+ const I = await Ie.readFile(t, "utf8"), R = Wy(
9007
9008
  I,
9008
9009
  v,
9009
9010
  t,
@@ -9026,8 +9027,8 @@ class so extends Error {
9026
9027
  super(i), this.parseErrors = r, this.filePath = a, this.name = "JsoncParseError";
9027
9028
  }
9028
9029
  }
9029
- const jy = (t, i = {}) => {
9030
- const r = [], a = tv(t, r, {
9030
+ const qy = (t, i = {}) => {
9031
+ const r = [], a = rv(t, r, {
9031
9032
  allowTrailingComma: i.allowTrailingComma ?? !0,
9032
9033
  disallowComments: i.disallowComments ?? !1,
9033
9034
  allowEmptyContent: i.allowEmptyContent ?? !1
@@ -9044,10 +9045,10 @@ ${u.join(`
9044
9045
  );
9045
9046
  }
9046
9047
  return a;
9047
- }, qy = async (t) => await Ie.readFile(t, "utf8"), Jy = async (t, i = {}) => {
9048
+ }, Jy = async (t) => await Ie.readFile(t, "utf8"), Qy = async (t, i = {}) => {
9048
9049
  try {
9049
9050
  const r = await Ie.readFile(t, "utf8");
9050
- return jy(r, i);
9051
+ return qy(r, i);
9051
9052
  } catch (r) {
9052
9053
  throw r instanceof so ? new so(r.message, r.parseErrors, t) : new Error(`Failed to read file ${t}: ${r}`);
9053
9054
  }
@@ -9060,7 +9061,7 @@ class ho extends Error {
9060
9061
  ${r}`), this.errors = i, this.name = "ManifestValidationError";
9061
9062
  }
9062
9063
  }
9063
- const Qy = (t) => {
9064
+ const zy = (t) => {
9064
9065
  const i = [];
9065
9066
  if (t.application?.universalIdentifier && i.push({
9066
9067
  id: t.application.universalIdentifier,
@@ -9101,14 +9102,14 @@ const Qy = (t) => {
9101
9102
  location: `roles/${r.label}`
9102
9103
  });
9103
9104
  return i;
9104
- }, zy = (t) => {
9105
+ }, Yy = (t) => {
9105
9106
  const i = /* @__PURE__ */ new Map();
9106
9107
  for (const { id: r, location: a } of t) {
9107
9108
  const u = i.get(r) ?? [];
9108
9109
  u.push(a), i.set(r, u);
9109
9110
  }
9110
9111
  return Array.from(i.entries()).filter(([r, a]) => a.length > 1).map(([r, a]) => ({ id: r, locations: a }));
9111
- }, Yy = (t, i) => {
9112
+ }, Hy = (t, i) => {
9112
9113
  if (!t) {
9113
9114
  i.push({
9114
9115
  path: "application",
@@ -9120,7 +9121,7 @@ const Qy = (t) => {
9120
9121
  path: "application",
9121
9122
  message: "Application must have a universalIdentifier"
9122
9123
  });
9123
- }, Hy = (t, i) => {
9124
+ }, Ky = (t, i) => {
9124
9125
  for (const r of t) {
9125
9126
  const a = `objects/${r.nameSingular ?? "unknown"}`;
9126
9127
  r.universalIdentifier || i.push({
@@ -9150,7 +9151,7 @@ const Qy = (t) => {
9150
9151
  });
9151
9152
  }
9152
9153
  }
9153
- }, Ky = (t, i) => {
9154
+ }, Xy = (t, i) => {
9154
9155
  for (const r of t) {
9155
9156
  const a = `functions/${r.name ?? r.handlerName ?? "unknown"}`;
9156
9157
  r.universalIdentifier || i.push({
@@ -9194,7 +9195,7 @@ const Qy = (t) => {
9194
9195
  }
9195
9196
  }
9196
9197
  }
9197
- }, Xy = (t, i) => {
9198
+ }, Zy = (t, i) => {
9198
9199
  for (const r of t) {
9199
9200
  const a = `roles/${r.label ?? "unknown"}`;
9200
9201
  r.universalIdentifier || i.push({
@@ -9205,10 +9206,10 @@ const Qy = (t) => {
9205
9206
  message: "Role must have a label"
9206
9207
  });
9207
9208
  }
9208
- }, Zy = (t) => {
9209
+ }, e_ = (t) => {
9209
9210
  const i = [], r = [];
9210
- Yy(t.application, i), Hy(t.objects ?? [], i), Ky(t.serverlessFunctions ?? [], i), Xy(t.roles ?? [], i);
9211
- const a = Qy(t), u = zy(a);
9211
+ Hy(t.application, i), Ky(t.objects ?? [], i), Xy(t.serverlessFunctions ?? [], i), Zy(t.roles ?? [], i);
9212
+ const a = zy(t), u = Yy(a);
9212
9213
  for (const p of u)
9213
9214
  i.push({
9214
9215
  path: p.locations.join(", "),
@@ -9223,7 +9224,7 @@ const Qy = (t) => {
9223
9224
  errors: i,
9224
9225
  warnings: r
9225
9226
  };
9226
- }, e_ = async (t) => {
9227
+ }, n_ = async (t) => {
9227
9228
  const i = Hn.join(t, "src", "app");
9228
9229
  if (!await Ie.pathExists(i))
9229
9230
  throw new Error(
@@ -9233,11 +9234,11 @@ Create it with: mkdir -p src/app`
9233
9234
  const r = Hn.join(t, "src", "app", "application.config.ts");
9234
9235
  if (!await Ie.pathExists(r))
9235
9236
  throw new Error("Missing src/app/application.config.ts");
9236
- }, go = (t, i) => ac(i, t).split(uc).join(z0.sep), _r = async (t, i) => Z0(t, {
9237
+ }, go = (t, i) => ac(i, t).split(uc).join(Y0.sep), _r = async (t, i) => ev(t, {
9237
9238
  cwd: i,
9238
9239
  absolute: !0,
9239
9240
  ignore: ["**/node_modules/**", "**/*.d.ts", "**/dist/**"]
9240
- }), n_ = async (t) => {
9241
+ }), t_ = async (t) => {
9241
9242
  const i = await _r(["src/app/**/*.object.ts"], t), r = [];
9242
9243
  for (const a of i)
9243
9244
  try {
@@ -9250,11 +9251,11 @@ Create it with: mkdir -p src/app`
9250
9251
  );
9251
9252
  }
9252
9253
  return r;
9253
- }, t_ = async (t) => {
9254
+ }, r_ = async (t) => {
9254
9255
  const i = await _r(["src/app/**/*.function.ts"], t), r = [];
9255
9256
  for (const a of i)
9256
9257
  try {
9257
- const { config: u, handlerName: p, handlerPath: v } = await Wy(
9258
+ const { config: u, handlerName: p, handlerPath: v } = await jy(
9258
9259
  a,
9259
9260
  t
9260
9261
  ), I = u, N = {
@@ -9274,7 +9275,7 @@ Create it with: mkdir -p src/app`
9274
9275
  );
9275
9276
  }
9276
9277
  return r;
9277
- }, r_ = async (t) => {
9278
+ }, i_ = async (t) => {
9278
9279
  const i = await _r(["src/app/**/*.role.ts"], t), r = [];
9279
9280
  for (const a of i)
9280
9281
  try {
@@ -9287,7 +9288,7 @@ Create it with: mkdir -p src/app`
9287
9288
  );
9288
9289
  }
9289
9290
  return r;
9290
- }, i_ = async (t) => {
9291
+ }, s_ = async (t) => {
9291
9292
  const i = {}, r = await _r(
9292
9293
  ["src/**/*.ts", "generated/**/*.ts"],
9293
9294
  t
@@ -9301,19 +9302,19 @@ Create it with: mkdir -p src/app`
9301
9302
  }
9302
9303
  }
9303
9304
  return i;
9304
- }, s_ = async (t) => {
9305
- const i = await _r(["src/**/*.ts"], t), r = /from\s+['"][^'"]*\/generated(?:\/[^'"]*)?['"]|from\s+['"]generated['"]/;
9306
- for (const a of i) {
9307
- const u = await Ie.readFile(a, "utf8");
9308
- if (r.test(u))
9305
+ }, o_ = async (t) => {
9306
+ const i = await _r(["src/**/*.ts"], t), r = /from\s+['"][^'"]*\/generated(?:\/[^'"]*)?['"]|from\s+['"]generated['"]/, a = /require\s*\(\s*['"][^'"]*\/generated(?:\/[^'"]*)?['"]\s*\)|require\s*\(\s*['"]generated['"]\s*\)/;
9307
+ for (const u of i) {
9308
+ const p = await Ie.readFile(u, "utf8");
9309
+ if (r.test(p) || a.test(p))
9309
9310
  return !0;
9310
9311
  }
9311
9312
  return !1;
9312
9313
  }, gr = async (t) => {
9313
- await e_(t);
9314
- const i = await Jy(
9314
+ await n_(t);
9315
+ const i = await Qy(
9315
9316
  await oc(t, "package.json")
9316
- ), r = await qy(
9317
+ ), r = await Jy(
9317
9318
  await oc(t, "yarn.lock")
9318
9319
  ), a = Hn.join(
9319
9320
  t,
@@ -9321,18 +9322,18 @@ Create it with: mkdir -p src/app`
9321
9322
  "app",
9322
9323
  "application.config.ts"
9323
9324
  ), u = await po(a), [p, v, I, N, R] = await Promise.all([
9324
- n_(t),
9325
9325
  t_(t),
9326
9326
  r_(t),
9327
9327
  i_(t),
9328
- s_(t)
9328
+ s_(t),
9329
+ o_(t)
9329
9330
  ]), O = {
9330
9331
  application: u,
9331
9332
  objects: p,
9332
9333
  serverlessFunctions: v,
9333
9334
  roles: I,
9334
9335
  sources: N
9335
- }, M = Zy({
9336
+ }, M = e_({
9336
9337
  application: u,
9337
9338
  objects: p,
9338
9339
  serverlessFunctions: v,
@@ -9348,7 +9349,7 @@ Create it with: mkdir -p src/app`
9348
9349
  warnings: M.warnings
9349
9350
  };
9350
9351
  };
9351
- class o_ {
9352
+ class a_ {
9352
9353
  constructor() {
9353
9354
  this.apiService = new Gt();
9354
9355
  }
@@ -9404,7 +9405,7 @@ const Hc = (t) => {
9404
9405
  console.log(F.red(` • ${i.path}: ${i.message}`));
9405
9406
  console.log("");
9406
9407
  };
9407
- class a_ {
9408
+ class u_ {
9408
9409
  constructor() {
9409
9410
  this.apiService = new Gt();
9410
9411
  }
@@ -9433,7 +9434,7 @@ class a_ {
9433
9434
  console.log(F.blue("🚀 Starting Twenty Application Development Mode")), console.log(F.gray(`📁 App Path: ${i}`)), console.log(F.gray(`⏱️ Debounce: ${r}ms`)), console.log("");
9434
9435
  }
9435
9436
  setupFileWatcher(i, r) {
9436
- const a = rv.watch(i, {
9437
+ const a = iv.watch(i, {
9437
9438
  ignored: /node_modules|\.git/,
9438
9439
  persistent: !0
9439
9440
  });
@@ -9458,13 +9459,13 @@ class a_ {
9458
9459
  });
9459
9460
  }
9460
9461
  }
9461
- const u_ = "TWENTY_API_KEY", c_ = "TWENTY_API_URL", l_ = "generated";
9462
+ const c_ = "TWENTY_API_KEY", l_ = "TWENTY_API_URL", f_ = "generated";
9462
9463
  class Zc {
9463
9464
  constructor() {
9464
9465
  this.configService = new xn(), this.apiService = new Gt();
9465
9466
  }
9466
9467
  async generateClient(i) {
9467
- const r = Yn(i, l_);
9468
+ const r = Yn(i, f_);
9468
9469
  console.log(F.blue("📦 Generating Twenty client...")), console.log(F.gray(`📁 Output Path: ${r}`)), console.log("");
9469
9470
  const a = await this.configService.getConfig(), u = a.apiUrl, p = a.apiKey;
9470
9471
  if (!u || !p) {
@@ -9479,8 +9480,8 @@ class Zc {
9479
9480
  const v = await this.apiService.getSchema();
9480
9481
  if (!v.success)
9481
9482
  return;
9482
- const { data: I } = v, N = Y0(r);
9483
- await iv({
9483
+ const { data: I } = v, N = H0(r);
9484
+ await sv({
9484
9485
  schema: I,
9485
9486
  output: N,
9486
9487
  scalarTypes: {
@@ -9498,10 +9499,10 @@ class Zc {
9498
9499
  // ----------------------------------------------------
9499
9500
 
9500
9501
  const defaultOptions: ClientOptions = {
9501
- url: \`\${process.env.${c_}}/graphql\`,
9502
+ url: \`\${process.env.${l_}}/graphql\`,
9502
9503
  headers: {
9503
9504
  'Content-Type': 'application/json',
9504
- Authorization: \`Bearer \${process.env.${u_}}\`,
9505
+ Authorization: \`Bearer \${process.env.${c_}}\`,
9505
9506
  },
9506
9507
  }
9507
9508
 
@@ -9534,7 +9535,7 @@ export default class Twenty {
9534
9535
  await Ie.appendFile(Yn(i, "index.ts"), r);
9535
9536
  }
9536
9537
  }
9537
- class f_ {
9538
+ class p_ {
9538
9539
  constructor() {
9539
9540
  this.apiService = new Gt(), this.generateService = new Zc();
9540
9541
  }
@@ -9576,7 +9577,7 @@ class f_ {
9576
9577
  }
9577
9578
  }
9578
9579
  const Ft = (t) => t && !t?.startsWith("/") ? Yn(vn, t) : t;
9579
- class p_ {
9580
+ class h_ {
9580
9581
  constructor() {
9581
9582
  this.generateService = new Zc();
9582
9583
  }
@@ -9591,7 +9592,7 @@ class p_ {
9591
9592
  }
9592
9593
  }
9593
9594
  }
9594
- class h_ {
9595
+ class d_ {
9595
9596
  constructor() {
9596
9597
  this.apiService = new Gt();
9597
9598
  }
@@ -9629,9 +9630,10 @@ class h_ {
9629
9630
  ), console.log("");
9630
9631
  }
9631
9632
  }
9632
- class d_ {
9633
+ z0.defaultOptions.depth = 10;
9634
+ class g_ {
9633
9635
  constructor() {
9634
- this.devCommand = new a_(), this.syncCommand = new f_(), this.uninstallCommand = new o_(), this.addCommand = new hv(), this.generateCommand = new p_(), this.logsCommand = new h_();
9636
+ this.devCommand = new u_(), this.syncCommand = new p_(), this.uninstallCommand = new a_(), this.addCommand = new dv(), this.generateCommand = new h_(), this.logsCommand = new d_();
9635
9637
  }
9636
9638
  getCommand() {
9637
9639
  const i = new oo("app");
@@ -9667,7 +9669,7 @@ class d_ {
9667
9669
  }), i.command("add [entityType]").option("--path <path>", "Path in which the entity should be created.").description(
9668
9670
  `Add a new entity to your application (${Object.values(Ti).join("|")})`
9669
9671
  ).action(async (r, a) => {
9670
- r && !pv(r) && (console.error(
9672
+ r && !hv(r) && (console.error(
9671
9673
  F.red(
9672
9674
  `Invalid entity type "${r}". Must be one of: ${Object.values(Ti).join("|")}`
9673
9675
  )
@@ -9693,7 +9695,7 @@ class d_ {
9693
9695
  ), i;
9694
9696
  }
9695
9697
  }
9696
- class g_ {
9698
+ class m_ {
9697
9699
  constructor() {
9698
9700
  this.configService = new xn(), this.apiService = new Gt();
9699
9701
  }
@@ -9790,10 +9792,10 @@ class g_ {
9790
9792
  }
9791
9793
  }
9792
9794
  }
9793
- const m_ = "0.3.0", v_ = {
9794
- version: m_
9795
+ const v_ = "0.3.1", y_ = {
9796
+ version: v_
9795
9797
  }, vt = new oo();
9796
- vt.name("twenty").description("CLI for Twenty application development").version(v_.version);
9798
+ vt.name("twenty").description("CLI for Twenty application development").version(y_.version);
9797
9799
  vt.option(
9798
9800
  "--workspace <name>",
9799
9801
  "Use a specific workspace configuration",
@@ -9805,8 +9807,8 @@ vt.hook("preAction", (t) => {
9805
9807
  F.gray(`👩‍💻 Workspace - ${xn.getActiveWorkspace()}`)
9806
9808
  );
9807
9809
  });
9810
+ vt.addCommand(new m_().getCommand());
9808
9811
  vt.addCommand(new g_().getCommand());
9809
- vt.addCommand(new d_().getCommand());
9810
9812
  vt.exitOverride();
9811
9813
  try {
9812
9814
  vt.parse();