@fragment-dev/cli 2026.10.1-5 → 2026.10.1-8

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 (74) hide show
  1. package/README.md +16 -4
  2. package/dist/{chunk-T7PAZDQ2.js → chunk-23KWDUJZ.js} +7 -1
  3. package/dist/{chunk-JMFDKBJW.js → chunk-2LDAYJQR.js} +2 -2
  4. package/dist/{chunk-Q62TGFNL.js → chunk-2QR6NGWG.js} +1 -1
  5. package/dist/{chunk-LINOTI5E.js → chunk-3IA6BI6A.js} +1 -1
  6. package/dist/{chunk-GZF5GHBV.js → chunk-3IGRQ6LL.js} +3 -3
  7. package/dist/{chunk-MUN6P2HN.js → chunk-3K6ERQYV.js} +1 -1
  8. package/dist/{chunk-D65TXRLZ.js → chunk-5NKCOZCW.js} +2 -2
  9. package/dist/{chunk-VZA2YKI6.js → chunk-5UOYY7GS.js} +2 -2
  10. package/dist/{chunk-F6IDBMXZ.js → chunk-6PRTPBP7.js} +1 -1
  11. package/dist/{chunk-XUOVQRQH.js → chunk-D45KVQKB.js} +1 -1
  12. package/dist/{chunk-7LEHQFLL.js → chunk-DT372IG6.js} +1 -1
  13. package/dist/{chunk-I7HWZUNL.js → chunk-DYIB3NZM.js} +59 -12
  14. package/dist/{chunk-3QIKHVTA.js → chunk-E7ZKZZP4.js} +2 -2
  15. package/dist/{chunk-C67WHN2H.js → chunk-F4DGB2QI.js} +2 -2
  16. package/dist/{chunk-TXPR56T5.js → chunk-H3ZCVAW3.js} +1 -1
  17. package/dist/{chunk-B3OMOGVU.js → chunk-HK327LQP.js} +3 -3
  18. package/dist/{chunk-JV34IPXX.js → chunk-IQIFAKDJ.js} +3 -3
  19. package/dist/{chunk-BMPSZNHE.js → chunk-JO6OQM5C.js} +1 -1
  20. package/dist/{chunk-DURV4GOT.js → chunk-KVBNKJBH.js} +2 -2
  21. package/dist/{chunk-5VGUS75G.js → chunk-LDS5IWT5.js} +6 -6
  22. package/dist/{chunk-SWVXV42Y.js → chunk-M7BM6YC2.js} +1 -1
  23. package/dist/{chunk-5JTGKU4S.js → chunk-NJSYUXAC.js} +2 -2
  24. package/dist/chunk-NT74GT6W.js +1287 -0
  25. package/dist/{chunk-WUKDB7IX.js → chunk-PHWV3NOP.js} +162 -51
  26. package/dist/{chunk-KP7MQPVO.js → chunk-Q3JFAZ3A.js} +1 -1
  27. package/dist/{chunk-WCXDVPWC.js → chunk-Q6ZKCAYH.js} +2 -2
  28. package/dist/{chunk-EIF4FTEI.js → chunk-QBQANVTD.js} +2 -2
  29. package/dist/{chunk-E4TL7SOK.js → chunk-QGFJ5H4G.js} +2 -2
  30. package/dist/{chunk-PU52GTGB.js → chunk-QZNZYG2G.js} +24 -14
  31. package/dist/{chunk-76JJLPFT.js → chunk-RML6NQHP.js} +1 -1
  32. package/dist/{chunk-4IMXVHLX.js → chunk-SU5G5HM2.js} +2 -2
  33. package/dist/{chunk-2DFNUYYB.js → chunk-THGEB6PT.js} +3 -3
  34. package/dist/{chunk-I65PNYBQ.js → chunk-UJP55YSW.js} +25 -25
  35. package/dist/{chunk-JXIMFTTA.js → chunk-V3NABYUX.js} +2 -2
  36. package/dist/{chunk-MOBC7AAW.js → chunk-V4IQY3DF.js} +1 -1
  37. package/dist/{chunk-DVQMZBTY.js → chunk-WRUBCN4G.js} +2 -2
  38. package/dist/{chunk-DKAEBT2M.js → chunk-XJ2TNWI7.js} +8 -0
  39. package/dist/commands/add-ledger-entry.js +4 -4
  40. package/dist/commands/api-client/create.js +3 -3
  41. package/dist/commands/create-custom-link.js +4 -4
  42. package/dist/commands/create-ledger.js +4 -4
  43. package/dist/commands/delete-custom-txs.js +4 -4
  44. package/dist/commands/delete-ledger.js +4 -4
  45. package/dist/commands/delete-schema.js +4 -4
  46. package/dist/commands/gen-graphql.js +8 -8
  47. package/dist/commands/get-schema.js +5 -5
  48. package/dist/commands/init.js +3 -3
  49. package/dist/commands/login.js +4 -4
  50. package/dist/commands/migrate-ledger-entry.js +4 -4
  51. package/dist/commands/query/ledgerAccounts.js +4 -4
  52. package/dist/commands/query/ledgers.js +4 -4
  53. package/dist/commands/query/schema.js +4 -4
  54. package/dist/commands/query/schemas.js +4 -4
  55. package/dist/commands/reverse-ledger-entry.js +4 -4
  56. package/dist/commands/start.js +3 -3
  57. package/dist/commands/store-schema.js +4 -4
  58. package/dist/commands/token.js +4 -4
  59. package/dist/commands/update-ledger-account.js +4 -4
  60. package/dist/commands/update.js +4 -4
  61. package/dist/commands/verify-schema.js +9 -8
  62. package/dist/commands/version.js +3 -3
  63. package/dist/commands/workspace.js +4 -4
  64. package/dist/commands.js +37 -36
  65. package/dist/graphql.js +3 -3
  66. package/dist/index.js +37 -36
  67. package/dist/lib/authenticatedCommand.js +3 -3
  68. package/dist/lib/baseCommand.js +2 -2
  69. package/dist/utils/formatValidationErrors.js +2 -2
  70. package/dist/utils/schemaBackCompat.js +21 -0
  71. package/dist/utils/schemaValidation.js +5 -5
  72. package/dist/utils.js +5 -3
  73. package/oclif.manifest.json +18 -2
  74. package/package.json +1 -1
@@ -22,7 +22,7 @@ import {
22
22
  getStructuralPath,
23
23
  getStructuralSubpaths,
24
24
  getSubpaths
25
- } from "./chunk-T7PAZDQ2.js";
25
+ } from "./chunk-23KWDUJZ.js";
26
26
  import {
27
27
  BadRequestError,
28
28
  CurrencyMatchInputSchema,
@@ -38,7 +38,7 @@ import {
38
38
  mapValues_default,
39
39
  safe,
40
40
  z
41
- } from "./chunk-DKAEBT2M.js";
41
+ } from "./chunk-XJ2TNWI7.js";
42
42
  import {
43
43
  __commonJS,
44
44
  __toESM,
@@ -610,21 +610,21 @@ var require_types = __commonJS({
610
610
  "../../node_modules/zod/lib/types.js"(exports) {
611
611
  "use strict";
612
612
  init_cjs_shims();
613
- var __classPrivateFieldGet = exports && exports.__classPrivateFieldGet || function(receiver, state, kind, f) {
614
- if (kind === "a" && !f)
613
+ var __classPrivateFieldGet = exports && exports.__classPrivateFieldGet || function(receiver, state, kind, f2) {
614
+ if (kind === "a" && !f2)
615
615
  throw new TypeError("Private accessor was defined without a getter");
616
- if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
616
+ if (typeof state === "function" ? receiver !== state || !f2 : !state.has(receiver))
617
617
  throw new TypeError("Cannot read private member from an object whose class did not declare it");
618
- return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
618
+ return kind === "m" ? f2 : kind === "a" ? f2.call(receiver) : f2 ? f2.value : state.get(receiver);
619
619
  };
620
- var __classPrivateFieldSet = exports && exports.__classPrivateFieldSet || function(receiver, state, value, kind, f) {
620
+ var __classPrivateFieldSet = exports && exports.__classPrivateFieldSet || function(receiver, state, value, kind, f2) {
621
621
  if (kind === "m")
622
622
  throw new TypeError("Private method is not writable");
623
- if (kind === "a" && !f)
623
+ if (kind === "a" && !f2)
624
624
  throw new TypeError("Private accessor was defined without a setter");
625
- if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
625
+ if (typeof state === "function" ? receiver !== state || !f2 : !state.has(receiver))
626
626
  throw new TypeError("Cannot write private member to an object whose class did not declare it");
627
- return kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value), value;
627
+ return kind === "a" ? f2.call(receiver, value) : f2 ? f2.value = value : state.set(receiver, value), value;
628
628
  };
629
629
  var _ZodEnum_cache;
630
630
  var _ZodNativeEnum_cache;
@@ -2966,17 +2966,17 @@ var require_types = __commonJS({
2966
2966
  }
2967
2967
  };
2968
2968
  exports.ZodDiscriminatedUnion = ZodDiscriminatedUnion;
2969
- function mergeValues(a, b2) {
2970
- const aType = (0, util_1.getParsedType)(a);
2969
+ function mergeValues(a2, b2) {
2970
+ const aType = (0, util_1.getParsedType)(a2);
2971
2971
  const bType = (0, util_1.getParsedType)(b2);
2972
- if (a === b2) {
2973
- return { valid: true, data: a };
2972
+ if (a2 === b2) {
2973
+ return { valid: true, data: a2 };
2974
2974
  } else if (aType === util_1.ZodParsedType.object && bType === util_1.ZodParsedType.object) {
2975
2975
  const bKeys = util_1.util.objectKeys(b2);
2976
- const sharedKeys = util_1.util.objectKeys(a).filter((key) => bKeys.indexOf(key) !== -1);
2977
- const newObj = { ...a, ...b2 };
2976
+ const sharedKeys = util_1.util.objectKeys(a2).filter((key) => bKeys.indexOf(key) !== -1);
2977
+ const newObj = { ...a2, ...b2 };
2978
2978
  for (const key of sharedKeys) {
2979
- const sharedValue = mergeValues(a[key], b2[key]);
2979
+ const sharedValue = mergeValues(a2[key], b2[key]);
2980
2980
  if (!sharedValue.valid) {
2981
2981
  return { valid: false };
2982
2982
  }
@@ -2984,12 +2984,12 @@ var require_types = __commonJS({
2984
2984
  }
2985
2985
  return { valid: true, data: newObj };
2986
2986
  } else if (aType === util_1.ZodParsedType.array && bType === util_1.ZodParsedType.array) {
2987
- if (a.length !== b2.length) {
2987
+ if (a2.length !== b2.length) {
2988
2988
  return { valid: false };
2989
2989
  }
2990
2990
  const newArray = [];
2991
- for (let index = 0; index < a.length; index++) {
2992
- const itemA = a[index];
2991
+ for (let index = 0; index < a2.length; index++) {
2992
+ const itemA = a2[index];
2993
2993
  const itemB = b2[index];
2994
2994
  const sharedValue = mergeValues(itemA, itemB);
2995
2995
  if (!sharedValue.valid) {
@@ -2998,8 +2998,8 @@ var require_types = __commonJS({
2998
2998
  newArray.push(sharedValue.data);
2999
2999
  }
3000
3000
  return { valid: true, data: newArray };
3001
- } else if (aType === util_1.ZodParsedType.date && bType === util_1.ZodParsedType.date && +a === +b2) {
3002
- return { valid: true, data: a };
3001
+ } else if (aType === util_1.ZodParsedType.date && bType === util_1.ZodParsedType.date && +a2 === +b2) {
3002
+ return { valid: true, data: a2 };
3003
3003
  } else {
3004
3004
  return { valid: false };
3005
3005
  }
@@ -3988,9 +3988,9 @@ var require_types = __commonJS({
3988
3988
  }
3989
3989
  }
3990
3990
  }
3991
- static create(a, b2) {
3991
+ static create(a2, b2) {
3992
3992
  return new _ZodPipeline({
3993
- in: a,
3993
+ in: a2,
3994
3994
  out: b2,
3995
3995
  typeName: ZodFirstPartyTypeKind.ZodPipeline
3996
3996
  });
@@ -4739,37 +4739,60 @@ var s = (n2, o2, c2) => {
4739
4739
  if (Array.isArray(n2)) {
4740
4740
  if (!Array.isArray(o2))
4741
4741
  return false;
4742
- let t2 = [], r2 = [], a = [];
4742
+ let t2 = [], r2 = [], a2 = [];
4743
4743
  for (const s2 of n2.keys()) {
4744
4744
  const o3 = n2[s2];
4745
- i(o3) && o3[e] ? a.push(o3) : a.length ? r2.push(o3) : t2.push(o3);
4745
+ i(o3) && o3[e] ? a2.push(o3) : a2.length ? r2.push(o3) : t2.push(o3);
4746
4746
  }
4747
- if (a.length) {
4748
- if (a.length > 1)
4747
+ if (a2.length) {
4748
+ if (a2.length > 1)
4749
4749
  throw new Error("Pattern error: Using `...P.array(...)` several times in a single pattern is not allowed.");
4750
4750
  if (o2.length < t2.length + r2.length)
4751
4751
  return false;
4752
4752
  const e2 = o2.slice(0, t2.length), n3 = 0 === r2.length ? [] : o2.slice(-r2.length), i2 = o2.slice(t2.length, 0 === r2.length ? Infinity : -r2.length);
4753
- return t2.every((t3, n4) => s(t3, e2[n4], c2)) && r2.every((t3, e3) => s(t3, n3[e3], c2)) && (0 === a.length || s(a[0], i2, c2));
4753
+ return t2.every((t3, n4) => s(t3, e2[n4], c2)) && r2.every((t3, e3) => s(t3, n3[e3], c2)) && (0 === a2.length || s(a2[0], i2, c2));
4754
4754
  }
4755
4755
  return n2.length === o2.length && n2.every((t3, e2) => s(t3, o2[e2], c2));
4756
4756
  }
4757
4757
  return Reflect.ownKeys(n2).every((e2) => {
4758
4758
  const r2 = n2[e2];
4759
- return (e2 in o2 || i(a = r2) && "optional" === a[t]().matcherType) && s(r2, o2[e2], c2);
4760
- var a;
4759
+ return (e2 in o2 || i(a2 = r2) && "optional" === a2[t]().matcherType) && s(r2, o2[e2], c2);
4760
+ var a2;
4761
4761
  });
4762
4762
  }
4763
4763
  return Object.is(o2, n2);
4764
4764
  };
4765
4765
  var o = (e2) => {
4766
- var n2, s2, a;
4767
- return r(e2) ? i(e2) ? null != (n2 = null == (s2 = (a = e2[t]()).getSelectionKeys) ? void 0 : s2.call(a)) ? n2 : [] : Array.isArray(e2) ? c(e2, o) : c(Object.values(e2), o) : [];
4766
+ var n2, s2, a2;
4767
+ return r(e2) ? i(e2) ? null != (n2 = null == (s2 = (a2 = e2[t]()).getSelectionKeys) ? void 0 : s2.call(a2)) ? n2 : [] : Array.isArray(e2) ? c(e2, o) : c(Object.values(e2), o) : [];
4768
4768
  };
4769
4769
  var c = (t2, e2) => t2.reduce((t3, n2) => t3.concat(e2(n2)), []);
4770
+ function a(...t2) {
4771
+ if (1 === t2.length) {
4772
+ const [e2] = t2;
4773
+ return (t3) => s(e2, t3, () => {
4774
+ });
4775
+ }
4776
+ if (2 === t2.length) {
4777
+ const [e2, n2] = t2;
4778
+ return s(e2, n2, () => {
4779
+ });
4780
+ }
4781
+ throw new Error(`isMatching wasn't given the right number of arguments: expected 1 or 2, received ${t2.length}.`);
4782
+ }
4770
4783
  function u(t2) {
4771
4784
  return Object.assign(t2, { optional: () => h(t2), and: (e2) => m(t2, e2), or: (e2) => d(t2, e2), select: (e2) => void 0 === e2 ? y(t2) : y(e2, t2) });
4772
4785
  }
4786
+ function l(t2) {
4787
+ return Object.assign(((t3) => Object.assign(t3, { [Symbol.iterator]() {
4788
+ let n2 = 0;
4789
+ const r2 = [{ value: Object.assign(t3, { [e]: true }), done: false }, { done: true, value: void 0 }];
4790
+ return { next: () => {
4791
+ var t4;
4792
+ return null != (t4 = r2[n2++]) ? t4 : r2.at(-1);
4793
+ } };
4794
+ } }))(t2), { optional: () => l(h(t2)), select: (e2) => l(void 0 === e2 ? y(t2) : y(e2, t2)) });
4795
+ }
4773
4796
  function h(e2) {
4774
4797
  return u({ [t]: () => ({ match: (t2) => {
4775
4798
  let n2 = {};
@@ -4779,6 +4802,18 @@ function h(e2) {
4779
4802
  return void 0 === t2 ? (o(e2).forEach((t3) => r2(t3, void 0)), { matched: true, selections: n2 }) : { matched: s(e2, t2, r2), selections: n2 };
4780
4803
  }, getSelectionKeys: () => o(e2), matcherType: "optional" }) });
4781
4804
  }
4805
+ var f = (t2, e2) => {
4806
+ for (const n2 of t2)
4807
+ if (!e2(n2))
4808
+ return false;
4809
+ return true;
4810
+ };
4811
+ var g = (t2, e2) => {
4812
+ for (const [n2, r2] of t2.entries())
4813
+ if (!e2(r2, n2))
4814
+ return false;
4815
+ return true;
4816
+ };
4782
4817
  function m(...e2) {
4783
4818
  return u({ [t]: () => ({ match: (t2) => {
4784
4819
  let n2 = {};
@@ -4821,6 +4856,7 @@ function w(t2) {
4821
4856
  var S = u(p(function(t2) {
4822
4857
  return true;
4823
4858
  }));
4859
+ var O = S;
4824
4860
  var j = (t2) => Object.assign(u(t2), { startsWith: (e2) => {
4825
4861
  return j(m(t2, (n2 = e2, p((t3) => b(t3) && t3.startsWith(n2)))));
4826
4862
  var n2;
@@ -4851,6 +4887,68 @@ var _ = u(p(function(t2) {
4851
4887
  var k = u(p(function(t2) {
4852
4888
  return null != t2;
4853
4889
  }));
4890
+ var N = { __proto__: null, matcher: t, optional: h, array: function(...e2) {
4891
+ return l({ [t]: () => ({ match: (t2) => {
4892
+ if (!Array.isArray(t2))
4893
+ return { matched: false };
4894
+ if (0 === e2.length)
4895
+ return { matched: true };
4896
+ const n2 = e2[0];
4897
+ let r2 = {};
4898
+ if (0 === t2.length)
4899
+ return o(n2).forEach((t3) => {
4900
+ r2[t3] = [];
4901
+ }), { matched: true, selections: r2 };
4902
+ const i2 = (t3, e3) => {
4903
+ r2[t3] = (r2[t3] || []).concat([e3]);
4904
+ };
4905
+ return { matched: t2.every((t3) => s(n2, t3, i2)), selections: r2 };
4906
+ }, getSelectionKeys: () => 0 === e2.length ? [] : o(e2[0]) }) });
4907
+ }, set: function(...e2) {
4908
+ return u({ [t]: () => ({ match: (t2) => {
4909
+ if (!(t2 instanceof Set))
4910
+ return { matched: false };
4911
+ let n2 = {};
4912
+ if (0 === t2.size)
4913
+ return { matched: true, selections: n2 };
4914
+ if (0 === e2.length)
4915
+ return { matched: true };
4916
+ const r2 = (t3, e3) => {
4917
+ n2[t3] = (n2[t3] || []).concat([e3]);
4918
+ }, i2 = e2[0];
4919
+ return { matched: f(t2, (t3) => s(i2, t3, r2)), selections: n2 };
4920
+ }, getSelectionKeys: () => 0 === e2.length ? [] : o(e2[0]) }) });
4921
+ }, map: function(...e2) {
4922
+ return u({ [t]: () => ({ match: (t2) => {
4923
+ if (!(t2 instanceof Map))
4924
+ return { matched: false };
4925
+ let n2 = {};
4926
+ if (0 === t2.size)
4927
+ return { matched: true, selections: n2 };
4928
+ const r2 = (t3, e3) => {
4929
+ n2[t3] = (n2[t3] || []).concat([e3]);
4930
+ };
4931
+ if (0 === e2.length)
4932
+ return { matched: true };
4933
+ var i2;
4934
+ if (1 === e2.length)
4935
+ throw new Error(`\`P.map\` wasn't given enough arguments. Expected (key, value), received ${null == (i2 = e2[0]) ? void 0 : i2.toString()}`);
4936
+ const [o2, c2] = e2;
4937
+ return { matched: g(t2, (t3, e3) => {
4938
+ const n3 = s(o2, e3, r2), i3 = s(c2, t3, r2);
4939
+ return n3 && i3;
4940
+ }), selections: n2 };
4941
+ }, getSelectionKeys: () => 0 === e2.length ? [] : [...o(e2[0]), ...o(e2[1])] }) });
4942
+ }, intersection: m, union: d, not: function(e2) {
4943
+ return u({ [t]: () => ({ match: (t2) => ({ matched: !s(e2, t2, () => {
4944
+ }) }), getSelectionKeys: () => [], matcherType: "not" }) });
4945
+ }, when: p, select: y, any: S, _: O, string: K, number: E, bigint: P, boolean: T, symbol: B, nullish: _, nonNullable: k, instanceOf: function(t2) {
4946
+ return u(p(/* @__PURE__ */ function(t3) {
4947
+ return (e2) => e2 instanceof t3;
4948
+ }(t2)));
4949
+ }, shape: function(t2) {
4950
+ return u(p(a(t2)));
4951
+ } };
4854
4952
  var W = class extends Error {
4855
4953
  constructor(t2) {
4856
4954
  let e2;
@@ -4877,9 +4975,9 @@ var I = class _I {
4877
4975
  let i2;
4878
4976
  3 === t2.length && "function" == typeof t2[1] ? i2 = t2[1] : t2.length > 2 && r2.push(...t2.slice(1, t2.length - 1));
4879
4977
  let o2 = false, c2 = {};
4880
- const a = (t3, e3) => {
4978
+ const a2 = (t3, e3) => {
4881
4979
  o2 = true, c2[t3] = e3;
4882
- }, u2 = !r2.some((t3) => s(t3, this.input, a)) || i2 && !Boolean(i2(this.input)) ? $ : { matched: true, value: e2(o2 ? n in c2 ? c2[n] : c2 : this.input, this.input) };
4980
+ }, u2 = !r2.some((t3) => s(t3, this.input, a2)) || i2 && !Boolean(i2(this.input)) ? $ : { matched: true, value: e2(o2 ? n in c2 ? c2[n] : c2 : this.input, this.input) };
4883
4981
  return new _I(this.input, u2);
4884
4982
  }
4885
4983
  when(t2, e2) {
@@ -5600,19 +5698,23 @@ var evaluateExpressionWithVars = (expression) => {
5600
5698
  throw new BadRequestError(err.message);
5601
5699
  }
5602
5700
  };
5603
- var add = (a, b2) => {
5604
- const keys = /* @__PURE__ */ new Set([...a[1].keys(), ...b2[1].keys()]);
5701
+ var add = (a2, b2) => {
5702
+ const keys = /* @__PURE__ */ new Set([...a2[1].keys(), ...b2[1].keys()]);
5605
5703
  const result = new Map(
5606
- Array.from(keys).map((key) => [key, (a[1].get(key) ?? 0) + (b2[1].get(key) ?? 0)]).filter(([, n2]) => n2 !== 0)
5704
+ Array.from(keys).map((key) => [key, (a2[1].get(key) ?? 0) + (b2[1].get(key) ?? 0)]).filter(([, n2]) => n2 !== 0)
5607
5705
  );
5608
- return [a[0] + b2[0], result];
5706
+ return [a2[0] + b2[0], result];
5609
5707
  };
5610
- var subtract = (a, b2) => {
5611
- const keys = /* @__PURE__ */ new Set([...a[1].keys(), ...b2[1].keys()]);
5708
+ var subtract = (a2, b2) => {
5709
+ const keys = /* @__PURE__ */ new Set([...a2[1].keys(), ...b2[1].keys()]);
5612
5710
  const result = new Map(
5613
- Array.from(keys).map((key) => [key, (a[1].get(key) ?? 0) - (b2[1].get(key) ?? 0)]).filter(([, n2]) => n2 !== 0)
5711
+ Array.from(keys).map((key) => [key, (a2[1].get(key) ?? 0) - (b2[1].get(key) ?? 0)]).filter(([, n2]) => n2 !== 0)
5614
5712
  );
5615
- return [a[0] - b2[0], result];
5713
+ return [a2[0] - b2[0], result];
5714
+ };
5715
+ var areExpressionsEqual = (a2, b2) => {
5716
+ const variables = /* @__PURE__ */ new Set([...a2[1].keys(), ...b2[1].keys()]);
5717
+ return a2[0] === b2[0] && [...variables].every((key) => (a2[1].get(key) ?? 0) === (b2[1].get(key) ?? 0));
5616
5718
  };
5617
5719
  function abs(bigint) {
5618
5720
  return bigint < 0n ? -bigint : bigint;
@@ -5621,7 +5723,7 @@ var zero = [0n, /* @__PURE__ */ new Map()];
5621
5723
  var toString = (value, options = {}) => {
5622
5724
  const varMap = options.varMap ?? ((v2) => v2);
5623
5725
  const noCoefficients = options.noCoefficients ?? false;
5624
- const terms = Array.from(value[1].entries()).filter(([, n2]) => n2 !== 0).sort((a, b2) => b2[1] - a[1]).map(
5726
+ const terms = Array.from(value[1].entries()).filter(([, n2]) => n2 !== 0).sort((a2, b2) => b2[1] - a2[1]).map(
5625
5727
  ([key, n2]) => noCoefficients ? ` ${n2 >= 0 ? "+" : "-"} ${varMap(key)}`.repeat(Math.abs(n2)).substring(1) : `${n2 >= 0 ? "+" : "-"} ${Math.abs(n2) === 1 ? "" : `${Math.abs(n2)} * `}${varMap(key)}`
5626
5728
  ).join(" ");
5627
5729
  if (terms === "") {
@@ -5930,6 +6032,7 @@ var MAX_TAG_VALUE_LENGTH = 128;
5930
6032
  var MAX_TAG_KEY_LENGTH = 128;
5931
6033
  var MAX_TAG_COUNT = 20;
5932
6034
  var MAX_CONSISTENT_BALANCE_UPDATES = 30;
6035
+ var MIN_SCHEMA_LEDGER_ENTRY_DISABLED_DURATION_SECONDS = 45;
5933
6036
  var INVITE_EXPIRY_MS = 1e3 * 60 * 60 * 72;
5934
6037
 
5935
6038
  // ../../libs/types/entry.ts
@@ -6384,7 +6487,7 @@ var validateBalancedLineGroup = (entryType, entryParameters, lines, accountPathT
6384
6487
  entryType,
6385
6488
  entryParameters,
6386
6489
  lines.length === 2,
6387
- lines.some((l) => l.tx),
6490
+ lines.some((l2) => l2.tx),
6388
6491
  line,
6389
6492
  accountPathToAccount,
6390
6493
  options
@@ -6951,13 +7054,13 @@ var validateEntry = (ledgerEntry, accountPathToAccount, defaultConsistencyConfig
6951
7054
  errors.push(
6952
7055
  ...ledgerEntry.lines.flatMap((line, idx) => {
6953
7056
  const groupLines = line.repeated ? ledgerEntry.lines.filter(
6954
- (l) => l.repeated?.key === line.repeated?.key
6955
- ) : ledgerEntry.lines.filter((l) => !l.repeated);
7057
+ (l2) => l2.repeated?.key === line.repeated?.key
7058
+ ) : ledgerEntry.lines.filter((l2) => !l2.repeated);
6956
7059
  return validateLine(
6957
7060
  ledgerEntry.type,
6958
7061
  ledgerEntry.parameters,
6959
7062
  groupLines.length === 2,
6960
- groupLines.some((l) => l.tx),
7063
+ groupLines.some((l2) => l2.tx),
6961
7064
  parameterizeSchemaLedgerLineInput({
6962
7065
  line,
6963
7066
  entryParameters: ledgerEntry.parameters
@@ -7152,7 +7255,7 @@ var validateUniqueEntries = (entries) => {
7152
7255
  const errors = [];
7153
7256
  entries.forEach((entry, index) => {
7154
7257
  if (entry.groups) {
7155
- const groupSet = new Set(entry.groups.map((g) => `${g.key}-${g.value}`));
7258
+ const groupSet = new Set(entry.groups.map((g2) => `${g2.key}-${g2.value}`));
7156
7259
  if (groupSet.size !== entry.groups.length) {
7157
7260
  errors.push({
7158
7261
  message: "Entry cannot have duplicate groups",
@@ -7181,7 +7284,7 @@ var validateEntriesModifyClearingAccount = (group, entriesInGroup) => {
7181
7284
  const clearingAccount = group.reconciliation.clearingAccountPath.path;
7182
7285
  const entriesMissingClearingAccount = entriesInGroup.filter(
7183
7286
  (e2) => !e2?.lines?.some(
7184
- (l) => isAccountPathEquivalent(l.account.path, clearingAccount)
7287
+ (l2) => isAccountPathEquivalent(l2.account.path, clearingAccount)
7185
7288
  )
7186
7289
  );
7187
7290
  if (entriesMissingClearingAccount.length > 0) {
@@ -7247,7 +7350,7 @@ var validateGroup = (group, validatedCoA, validatedEntries, index) => {
7247
7350
  return errors;
7248
7351
  }
7249
7352
  const entriesInGroup = validatedEntries.types.filter(
7250
- (e2) => e2.groups.some((g) => g.key === group.key)
7353
+ (e2) => e2.groups.some((g2) => g2.key === group.key)
7251
7354
  );
7252
7355
  errors.push(
7253
7356
  ...setErrorPathPrefix(
@@ -8113,5 +8216,13 @@ var Schema = z.object({
8113
8216
 
8114
8217
  export {
8115
8218
  parseWithError,
8219
+ getAccountStatus,
8220
+ N,
8221
+ z2 as z,
8222
+ evaluateExpressionWithVars,
8223
+ areExpressionsEqual,
8224
+ stringify2 as stringify,
8225
+ MIN_SCHEMA_LEDGER_ENTRY_DISABLED_DURATION_SECONDS,
8226
+ ChartOfAccounts,
8116
8227
  Schema
8117
8228
  };
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  AuthenticatedCommand
3
- } from "./chunk-4IMXVHLX.js";
3
+ } from "./chunk-SU5G5HM2.js";
4
4
  import {
5
5
  init_cjs_shims
6
6
  } from "./chunk-7GH3YGSC.js";
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  AuthenticatedCommand
3
- } from "./chunk-4IMXVHLX.js";
3
+ } from "./chunk-SU5G5HM2.js";
4
4
  import {
5
5
  require_lib
6
- } from "./chunk-LINOTI5E.js";
6
+ } from "./chunk-3IA6BI6A.js";
7
7
  import {
8
8
  require_source
9
9
  } from "./chunk-QDAKBUNO.js";
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  AuthenticatedCommand
3
- } from "./chunk-4IMXVHLX.js";
3
+ } from "./chunk-SU5G5HM2.js";
4
4
  import {
5
5
  require_lib
6
- } from "./chunk-LINOTI5E.js";
6
+ } from "./chunk-3IA6BI6A.js";
7
7
  import {
8
8
  require_source
9
9
  } from "./chunk-QDAKBUNO.js";
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  AuthenticatedCommand
3
- } from "./chunk-4IMXVHLX.js";
3
+ } from "./chunk-SU5G5HM2.js";
4
4
  import {
5
5
  require_lib
6
- } from "./chunk-LINOTI5E.js";
6
+ } from "./chunk-3IA6BI6A.js";
7
7
  import {
8
8
  require_source
9
9
  } from "./chunk-QDAKBUNO.js";
@@ -9923,6 +9923,24 @@ var getParsedSchema = ({
9923
9923
  }
9924
9924
  return json;
9925
9925
  };
9926
+ var substituteEnvVariables = ({
9927
+ command,
9928
+ rawSchema,
9929
+ requireEnvVariables
9930
+ }) => rawSchema.replace(
9931
+ // Matches ${<ANYTHING>} -- <ANYTHING> is then passed to the fn as key
9932
+ /\${(\w*)}/g,
9933
+ (m, key) => {
9934
+ if (key in process.env) {
9935
+ return process.env[key];
9936
+ } else if (requireEnvVariables) {
9937
+ command.error(
9938
+ `${key} variable in schema must be present as environment variable. Exiting...`
9939
+ );
9940
+ }
9941
+ return `\${${key}}`;
9942
+ }
9943
+ );
9926
9944
  var getParsedSchemaString = ({
9927
9945
  command,
9928
9946
  schemaPath,
@@ -9938,20 +9956,11 @@ var getParsedSchemaString = ({
9938
9956
  silenceNonErrorLogging
9939
9957
  );
9940
9958
  const rawSchema = readFileSync(resolvedSchemaPath, "utf8");
9941
- const cleanedRawSchema = rawSchema.replace(
9942
- // Matches ${<ANYTHING>} -- <ANYTHING> is then passed to the fn as key
9943
- /\${(\w*)}/g,
9944
- (m, key) => {
9945
- if (key in process.env) {
9946
- return process.env[key];
9947
- } else if (requireEnvVariables) {
9948
- cmd.error(
9949
- `${key} variable in schema must be present as environment variable. Exiting...`
9950
- );
9951
- }
9952
- return `\${${key}}`;
9953
- }
9954
- );
9959
+ const cleanedRawSchema = substituteEnvVariables({
9960
+ command: cmd,
9961
+ rawSchema,
9962
+ requireEnvVariables
9963
+ });
9955
9964
  const [json, err] = parseJSON(cleanedRawSchema, stripComments);
9956
9965
  if (err) {
9957
9966
  if (!silenceNonErrorLogging) {
@@ -9987,6 +9996,7 @@ export {
9987
9996
  parseJSON,
9988
9997
  getSchemaPath,
9989
9998
  getParsedSchema,
9999
+ substituteEnvVariables,
9990
10000
  getParsedSchemaString,
9991
10001
  colorizeJson,
9992
10002
  emphasize
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  FragmentCommand,
3
3
  require_lib
4
- } from "./chunk-LINOTI5E.js";
4
+ } from "./chunk-3IA6BI6A.js";
5
5
  import {
6
6
  require_source
7
7
  } from "./chunk-QDAKBUNO.js";
@@ -5,10 +5,10 @@ import {
5
5
  FragmentCommand,
6
6
  GraphQLClient,
7
7
  require_lib
8
- } from "./chunk-LINOTI5E.js";
8
+ } from "./chunk-3IA6BI6A.js";
9
9
  import {
10
10
  colorizeJson
11
- } from "./chunk-PU52GTGB.js";
11
+ } from "./chunk-QZNZYG2G.js";
12
12
  import {
13
13
  __toESM,
14
14
  init_cjs_shims
@@ -1,12 +1,12 @@
1
1
  import {
2
2
  AuthenticatedCommand
3
- } from "./chunk-4IMXVHLX.js";
3
+ } from "./chunk-SU5G5HM2.js";
4
4
  import {
5
5
  require_lib
6
- } from "./chunk-LINOTI5E.js";
6
+ } from "./chunk-3IA6BI6A.js";
7
7
  import {
8
8
  getParsedSchema
9
- } from "./chunk-PU52GTGB.js";
9
+ } from "./chunk-QZNZYG2G.js";
10
10
  import {
11
11
  __toESM,
12
12
  init_cjs_shims
@@ -1,78 +1,78 @@
1
1
  import {
2
2
  Version
3
- } from "./chunk-7LEHQFLL.js";
3
+ } from "./chunk-DT372IG6.js";
4
4
  import {
5
5
  Workspace
6
- } from "./chunk-MUN6P2HN.js";
6
+ } from "./chunk-3K6ERQYV.js";
7
7
  import {
8
8
  QuerySchemas
9
- } from "./chunk-XUOVQRQH.js";
9
+ } from "./chunk-D45KVQKB.js";
10
10
  import {
11
11
  ReverseLedgerEntry
12
- } from "./chunk-VZA2YKI6.js";
12
+ } from "./chunk-5UOYY7GS.js";
13
13
  import {
14
14
  Start
15
- } from "./chunk-SWVXV42Y.js";
15
+ } from "./chunk-M7BM6YC2.js";
16
16
  import {
17
17
  StoreSchema
18
- } from "./chunk-B3OMOGVU.js";
18
+ } from "./chunk-HK327LQP.js";
19
19
  import {
20
20
  Token
21
- } from "./chunk-BMPSZNHE.js";
21
+ } from "./chunk-JO6OQM5C.js";
22
22
  import {
23
23
  UpdateLedgerAccount
24
- } from "./chunk-WCXDVPWC.js";
24
+ } from "./chunk-Q6ZKCAYH.js";
25
25
  import {
26
26
  Update
27
- } from "./chunk-C67WHN2H.js";
27
+ } from "./chunk-F4DGB2QI.js";
28
28
  import {
29
29
  VerifySchema
30
- } from "./chunk-I7HWZUNL.js";
30
+ } from "./chunk-DYIB3NZM.js";
31
31
  import {
32
32
  GenGraphQL
33
- } from "./chunk-5VGUS75G.js";
33
+ } from "./chunk-LDS5IWT5.js";
34
34
  import {
35
35
  GetSchema
36
- } from "./chunk-GZF5GHBV.js";
36
+ } from "./chunk-3IGRQ6LL.js";
37
37
  import {
38
38
  Init
39
- } from "./chunk-76JJLPFT.js";
39
+ } from "./chunk-RML6NQHP.js";
40
40
  import {
41
41
  Login
42
- } from "./chunk-5JTGKU4S.js";
42
+ } from "./chunk-NJSYUXAC.js";
43
43
  import {
44
44
  MigrateLedgerEntry
45
- } from "./chunk-JMFDKBJW.js";
45
+ } from "./chunk-2LDAYJQR.js";
46
46
  import {
47
47
  QueryLedgerAccounts
48
- } from "./chunk-JXIMFTTA.js";
48
+ } from "./chunk-V3NABYUX.js";
49
49
  import {
50
50
  QueryLedgers
51
- } from "./chunk-KP7MQPVO.js";
51
+ } from "./chunk-Q3JFAZ3A.js";
52
52
  import {
53
53
  GetSchema as GetSchema2
54
- } from "./chunk-DVQMZBTY.js";
54
+ } from "./chunk-WRUBCN4G.js";
55
55
  import {
56
56
  AddLedgerEntry
57
- } from "./chunk-3QIKHVTA.js";
57
+ } from "./chunk-E7ZKZZP4.js";
58
58
  import {
59
59
  ApiClientCreate
60
- } from "./chunk-Q62TGFNL.js";
60
+ } from "./chunk-2QR6NGWG.js";
61
61
  import {
62
62
  CreateCustomLink
63
- } from "./chunk-DURV4GOT.js";
63
+ } from "./chunk-KVBNKJBH.js";
64
64
  import {
65
65
  CreateLedger
66
- } from "./chunk-2DFNUYYB.js";
66
+ } from "./chunk-THGEB6PT.js";
67
67
  import {
68
68
  DeleteCustomTxs
69
- } from "./chunk-EIF4FTEI.js";
69
+ } from "./chunk-QBQANVTD.js";
70
70
  import {
71
71
  DeleteLedger
72
- } from "./chunk-E4TL7SOK.js";
72
+ } from "./chunk-QGFJ5H4G.js";
73
73
  import {
74
74
  DeleteSchema
75
- } from "./chunk-D65TXRLZ.js";
75
+ } from "./chunk-5NKCOZCW.js";
76
76
  import {
77
77
  init_cjs_shims
78
78
  } from "./chunk-7GH3YGSC.js";
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  AuthenticatedCommand
3
- } from "./chunk-4IMXVHLX.js";
3
+ } from "./chunk-SU5G5HM2.js";
4
4
  import {
5
5
  require_lib
6
- } from "./chunk-LINOTI5E.js";
6
+ } from "./chunk-3IA6BI6A.js";
7
7
  import {
8
8
  __toESM,
9
9
  init_cjs_shims
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  BadRequestError
3
- } from "./chunk-DKAEBT2M.js";
3
+ } from "./chunk-XJ2TNWI7.js";
4
4
  import {
5
5
  require_source
6
6
  } from "./chunk-QDAKBUNO.js";