@actual-app/api 26.4.0 → 26.5.0-nightly.20260407

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -9949,7 +9949,7 @@ var _entityMap = {
9949
9949
  "'": "'",
9950
9950
  "/": "/"
9951
9951
  };
9952
- var escape$2 = (data) => {
9952
+ var escape = (data) => {
9953
9953
  if (isString$1(data)) return data.replace(/[&<>"'\/]/g, (s) => _entityMap[s]);
9954
9954
  return data;
9955
9955
  };
@@ -10793,7 +10793,7 @@ var Interpolator = class {
10793
10793
  init(options = {}) {
10794
10794
  if (!options.interpolation) options.interpolation = { escapeValue: true };
10795
10795
  const { escape: escape$1, escapeValue, useRawValueToEscape, prefix, prefixEscaped, suffix, suffixEscaped, formatSeparator, unescapeSuffix, unescapePrefix, nestingPrefix, nestingPrefixEscaped, nestingSuffix, nestingSuffixEscaped, nestingOptionsSeparator, maxReplaces, alwaysFormat } = options.interpolation;
10796
- this.escape = escape$1 !== void 0 ? escape$1 : escape$2;
10796
+ this.escape = escape$1 !== void 0 ? escape$1 : escape;
10797
10797
  this.escapeValue = escapeValue !== void 0 ? escapeValue : true;
10798
10798
  this.useRawValueToEscape = useRawValueToEscape !== void 0 ? useRawValueToEscape : false;
10799
10799
  this.prefix = prefix ? regexEscape(prefix) : prefixEscaped || "{{";
@@ -15620,6 +15620,14 @@ var currencies = [
15620
15620
  numberFormat: "apostrophe-dot",
15621
15621
  symbolFirst: true
15622
15622
  },
15623
+ {
15624
+ code: "CLP",
15625
+ name: "Chilean Peso",
15626
+ symbol: "CLP$",
15627
+ decimalPlaces: 2,
15628
+ numberFormat: "dot-comma",
15629
+ symbolFirst: true
15630
+ },
15623
15631
  {
15624
15632
  code: "CNY",
15625
15633
  name: "Yuan Renminbi",
@@ -64365,7 +64373,10 @@ function addSplitTransaction(transactions, id) {
64365
64373
  function updateTransaction$2(transactions, transaction) {
64366
64374
  return replaceTransactions(transactions, transaction.id, (trans) => {
64367
64375
  if (trans.is_parent) {
64368
- const parent = trans.id === transaction.id ? transaction : trans;
64376
+ const parent = trans.id === transaction.id ? {
64377
+ ...trans,
64378
+ ...transaction
64379
+ } : trans;
64369
64380
  const sub = (parent.subtransactions ?? trans.subtransactions)?.map((t) => {
64370
64381
  let child = t;
64371
64382
  if (trans.id === transaction.id) {
@@ -117473,12 +117484,6 @@ async function importActual(_filepath, buffer) {
117473
117484
  await upload().catch(() => {});
117474
117485
  }
117475
117486
  //#endregion
117476
- //#region ../../node_modules/slash/index.js
117477
- function slash(path) {
117478
- if (path.startsWith("\\\\?\\")) return path;
117479
- return path.replace(/\\/g, "/");
117480
- }
117481
- //#endregion
117482
117487
  //#region ../loot-core/src/server/importers/ynab4.ts
117483
117488
  var ynab4_exports = /* @__PURE__ */ __exportAll({
117484
117489
  doImport: () => doImport$1,
@@ -117694,7 +117699,7 @@ async function doImport$1(data) {
117694
117699
  logger.log("Setting up...");
117695
117700
  }
117696
117701
  function getBudgetName$1(filepath) {
117697
- let unixFilepath = slash(filepath);
117702
+ let unixFilepath = filepath.replace(/\\/g, "/");
117698
117703
  if (!/\.zip/.test(unixFilepath)) return null;
117699
117704
  unixFilepath = unixFilepath.replace(/\.zip$/, "").replace(/.ynab4$/, "");
117700
117705
  const m = unixFilepath.match(/([^/~]+)[^/]*$/);
@@ -118471,225 +118476,7 @@ function unlisten() {
118471
118476
  }
118472
118477
  }
118473
118478
  //#endregion
118474
- //#region ../../node_modules/crypt/crypt.js
118475
- var require_crypt = /* @__PURE__ */ __commonJSMin(((exports, module) => {
118476
- (function() {
118477
- var base64map = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/", crypt = {
118478
- rotl: function(n, b) {
118479
- return n << b | n >>> 32 - b;
118480
- },
118481
- rotr: function(n, b) {
118482
- return n << 32 - b | n >>> b;
118483
- },
118484
- endian: function(n) {
118485
- if (n.constructor == Number) return crypt.rotl(n, 8) & 16711935 | crypt.rotl(n, 24) & 4278255360;
118486
- for (var i = 0; i < n.length; i++) n[i] = crypt.endian(n[i]);
118487
- return n;
118488
- },
118489
- randomBytes: function(n) {
118490
- for (var bytes = []; n > 0; n--) bytes.push(Math.floor(Math.random() * 256));
118491
- return bytes;
118492
- },
118493
- bytesToWords: function(bytes) {
118494
- for (var words = [], i = 0, b = 0; i < bytes.length; i++, b += 8) words[b >>> 5] |= bytes[i] << 24 - b % 32;
118495
- return words;
118496
- },
118497
- wordsToBytes: function(words) {
118498
- for (var bytes = [], b = 0; b < words.length * 32; b += 8) bytes.push(words[b >>> 5] >>> 24 - b % 32 & 255);
118499
- return bytes;
118500
- },
118501
- bytesToHex: function(bytes) {
118502
- for (var hex = [], i = 0; i < bytes.length; i++) {
118503
- hex.push((bytes[i] >>> 4).toString(16));
118504
- hex.push((bytes[i] & 15).toString(16));
118505
- }
118506
- return hex.join("");
118507
- },
118508
- hexToBytes: function(hex) {
118509
- for (var bytes = [], c = 0; c < hex.length; c += 2) bytes.push(parseInt(hex.substr(c, 2), 16));
118510
- return bytes;
118511
- },
118512
- bytesToBase64: function(bytes) {
118513
- for (var base64 = [], i = 0; i < bytes.length; i += 3) {
118514
- var triplet = bytes[i] << 16 | bytes[i + 1] << 8 | bytes[i + 2];
118515
- for (var j = 0; j < 4; j++) if (i * 8 + j * 6 <= bytes.length * 8) base64.push(base64map.charAt(triplet >>> 6 * (3 - j) & 63));
118516
- else base64.push("=");
118517
- }
118518
- return base64.join("");
118519
- },
118520
- base64ToBytes: function(base64) {
118521
- base64 = base64.replace(/[^A-Z0-9+\/]/gi, "");
118522
- for (var bytes = [], i = 0, imod4 = 0; i < base64.length; imod4 = ++i % 4) {
118523
- if (imod4 == 0) continue;
118524
- bytes.push((base64map.indexOf(base64.charAt(i - 1)) & Math.pow(2, -2 * imod4 + 8) - 1) << imod4 * 2 | base64map.indexOf(base64.charAt(i)) >>> 6 - imod4 * 2);
118525
- }
118526
- return bytes;
118527
- }
118528
- };
118529
- module.exports = crypt;
118530
- })();
118531
- }));
118532
- //#endregion
118533
- //#region ../../node_modules/charenc/charenc.js
118534
- var require_charenc = /* @__PURE__ */ __commonJSMin(((exports, module) => {
118535
- var charenc = {
118536
- utf8: {
118537
- stringToBytes: function(str) {
118538
- return charenc.bin.stringToBytes(unescape(encodeURIComponent(str)));
118539
- },
118540
- bytesToString: function(bytes) {
118541
- return decodeURIComponent(escape(charenc.bin.bytesToString(bytes)));
118542
- }
118543
- },
118544
- bin: {
118545
- stringToBytes: function(str) {
118546
- for (var bytes = [], i = 0; i < str.length; i++) bytes.push(str.charCodeAt(i) & 255);
118547
- return bytes;
118548
- },
118549
- bytesToString: function(bytes) {
118550
- for (var str = [], i = 0; i < bytes.length; i++) str.push(String.fromCharCode(bytes[i]));
118551
- return str.join("");
118552
- }
118553
- }
118554
- };
118555
- module.exports = charenc;
118556
- }));
118557
- //#endregion
118558
- //#region ../../node_modules/is-buffer/index.js
118559
- var require_is_buffer = /* @__PURE__ */ __commonJSMin(((exports, module) => {
118560
- /*!
118561
- * Determine if an object is a Buffer
118562
- *
118563
- * @author Feross Aboukhadijeh <https://feross.org>
118564
- * @license MIT
118565
- */
118566
- module.exports = function(obj) {
118567
- return obj != null && (isBuffer(obj) || isSlowBuffer(obj) || !!obj._isBuffer);
118568
- };
118569
- function isBuffer(obj) {
118570
- return !!obj.constructor && typeof obj.constructor.isBuffer === "function" && obj.constructor.isBuffer(obj);
118571
- }
118572
- function isSlowBuffer(obj) {
118573
- return typeof obj.readFloatLE === "function" && typeof obj.slice === "function" && isBuffer(obj.slice(0, 0));
118574
- }
118575
- }));
118576
- //#endregion
118577
118479
  //#region ../loot-core/migrations/1632571489012_remove_cache.js
118578
- var import_md5 = /* @__PURE__ */ __toESM((/* @__PURE__ */ __commonJSMin(((exports, module) => {
118579
- (function() {
118580
- var crypt = require_crypt(), utf8 = require_charenc().utf8, isBuffer = require_is_buffer(), bin = require_charenc().bin, md5 = function(message, options) {
118581
- if (message.constructor == String) if (options && options.encoding === "binary") message = bin.stringToBytes(message);
118582
- else message = utf8.stringToBytes(message);
118583
- else if (isBuffer(message)) message = Array.prototype.slice.call(message, 0);
118584
- else if (!Array.isArray(message) && message.constructor !== Uint8Array) message = message.toString();
118585
- var m = crypt.bytesToWords(message), l = message.length * 8, a = 1732584193, b = -271733879, c = -1732584194, d = 271733878;
118586
- for (var i = 0; i < m.length; i++) m[i] = (m[i] << 8 | m[i] >>> 24) & 16711935 | (m[i] << 24 | m[i] >>> 8) & 4278255360;
118587
- m[l >>> 5] |= 128 << l % 32;
118588
- m[(l + 64 >>> 9 << 4) + 14] = l;
118589
- var FF = md5._ff, GG = md5._gg, HH = md5._hh, II = md5._ii;
118590
- for (var i = 0; i < m.length; i += 16) {
118591
- var aa = a, bb = b, cc = c, dd = d;
118592
- a = FF(a, b, c, d, m[i + 0], 7, -680876936);
118593
- d = FF(d, a, b, c, m[i + 1], 12, -389564586);
118594
- c = FF(c, d, a, b, m[i + 2], 17, 606105819);
118595
- b = FF(b, c, d, a, m[i + 3], 22, -1044525330);
118596
- a = FF(a, b, c, d, m[i + 4], 7, -176418897);
118597
- d = FF(d, a, b, c, m[i + 5], 12, 1200080426);
118598
- c = FF(c, d, a, b, m[i + 6], 17, -1473231341);
118599
- b = FF(b, c, d, a, m[i + 7], 22, -45705983);
118600
- a = FF(a, b, c, d, m[i + 8], 7, 1770035416);
118601
- d = FF(d, a, b, c, m[i + 9], 12, -1958414417);
118602
- c = FF(c, d, a, b, m[i + 10], 17, -42063);
118603
- b = FF(b, c, d, a, m[i + 11], 22, -1990404162);
118604
- a = FF(a, b, c, d, m[i + 12], 7, 1804603682);
118605
- d = FF(d, a, b, c, m[i + 13], 12, -40341101);
118606
- c = FF(c, d, a, b, m[i + 14], 17, -1502002290);
118607
- b = FF(b, c, d, a, m[i + 15], 22, 1236535329);
118608
- a = GG(a, b, c, d, m[i + 1], 5, -165796510);
118609
- d = GG(d, a, b, c, m[i + 6], 9, -1069501632);
118610
- c = GG(c, d, a, b, m[i + 11], 14, 643717713);
118611
- b = GG(b, c, d, a, m[i + 0], 20, -373897302);
118612
- a = GG(a, b, c, d, m[i + 5], 5, -701558691);
118613
- d = GG(d, a, b, c, m[i + 10], 9, 38016083);
118614
- c = GG(c, d, a, b, m[i + 15], 14, -660478335);
118615
- b = GG(b, c, d, a, m[i + 4], 20, -405537848);
118616
- a = GG(a, b, c, d, m[i + 9], 5, 568446438);
118617
- d = GG(d, a, b, c, m[i + 14], 9, -1019803690);
118618
- c = GG(c, d, a, b, m[i + 3], 14, -187363961);
118619
- b = GG(b, c, d, a, m[i + 8], 20, 1163531501);
118620
- a = GG(a, b, c, d, m[i + 13], 5, -1444681467);
118621
- d = GG(d, a, b, c, m[i + 2], 9, -51403784);
118622
- c = GG(c, d, a, b, m[i + 7], 14, 1735328473);
118623
- b = GG(b, c, d, a, m[i + 12], 20, -1926607734);
118624
- a = HH(a, b, c, d, m[i + 5], 4, -378558);
118625
- d = HH(d, a, b, c, m[i + 8], 11, -2022574463);
118626
- c = HH(c, d, a, b, m[i + 11], 16, 1839030562);
118627
- b = HH(b, c, d, a, m[i + 14], 23, -35309556);
118628
- a = HH(a, b, c, d, m[i + 1], 4, -1530992060);
118629
- d = HH(d, a, b, c, m[i + 4], 11, 1272893353);
118630
- c = HH(c, d, a, b, m[i + 7], 16, -155497632);
118631
- b = HH(b, c, d, a, m[i + 10], 23, -1094730640);
118632
- a = HH(a, b, c, d, m[i + 13], 4, 681279174);
118633
- d = HH(d, a, b, c, m[i + 0], 11, -358537222);
118634
- c = HH(c, d, a, b, m[i + 3], 16, -722521979);
118635
- b = HH(b, c, d, a, m[i + 6], 23, 76029189);
118636
- a = HH(a, b, c, d, m[i + 9], 4, -640364487);
118637
- d = HH(d, a, b, c, m[i + 12], 11, -421815835);
118638
- c = HH(c, d, a, b, m[i + 15], 16, 530742520);
118639
- b = HH(b, c, d, a, m[i + 2], 23, -995338651);
118640
- a = II(a, b, c, d, m[i + 0], 6, -198630844);
118641
- d = II(d, a, b, c, m[i + 7], 10, 1126891415);
118642
- c = II(c, d, a, b, m[i + 14], 15, -1416354905);
118643
- b = II(b, c, d, a, m[i + 5], 21, -57434055);
118644
- a = II(a, b, c, d, m[i + 12], 6, 1700485571);
118645
- d = II(d, a, b, c, m[i + 3], 10, -1894986606);
118646
- c = II(c, d, a, b, m[i + 10], 15, -1051523);
118647
- b = II(b, c, d, a, m[i + 1], 21, -2054922799);
118648
- a = II(a, b, c, d, m[i + 8], 6, 1873313359);
118649
- d = II(d, a, b, c, m[i + 15], 10, -30611744);
118650
- c = II(c, d, a, b, m[i + 6], 15, -1560198380);
118651
- b = II(b, c, d, a, m[i + 13], 21, 1309151649);
118652
- a = II(a, b, c, d, m[i + 4], 6, -145523070);
118653
- d = II(d, a, b, c, m[i + 11], 10, -1120210379);
118654
- c = II(c, d, a, b, m[i + 2], 15, 718787259);
118655
- b = II(b, c, d, a, m[i + 9], 21, -343485551);
118656
- a = a + aa >>> 0;
118657
- b = b + bb >>> 0;
118658
- c = c + cc >>> 0;
118659
- d = d + dd >>> 0;
118660
- }
118661
- return crypt.endian([
118662
- a,
118663
- b,
118664
- c,
118665
- d
118666
- ]);
118667
- };
118668
- md5._ff = function(a, b, c, d, x, s, t) {
118669
- var n = a + (b & c | ~b & d) + (x >>> 0) + t;
118670
- return (n << s | n >>> 32 - s) + b;
118671
- };
118672
- md5._gg = function(a, b, c, d, x, s, t) {
118673
- var n = a + (b & d | c & ~d) + (x >>> 0) + t;
118674
- return (n << s | n >>> 32 - s) + b;
118675
- };
118676
- md5._hh = function(a, b, c, d, x, s, t) {
118677
- var n = a + (b ^ c ^ d) + (x >>> 0) + t;
118678
- return (n << s | n >>> 32 - s) + b;
118679
- };
118680
- md5._ii = function(a, b, c, d, x, s, t) {
118681
- var n = a + (c ^ (b | ~d)) + (x >>> 0) + t;
118682
- return (n << s | n >>> 32 - s) + b;
118683
- };
118684
- md5._blocksize = 16;
118685
- md5._digestsize = 16;
118686
- module.exports = function(message, options) {
118687
- if (message === void 0 || message === null) throw new Error("Illegal argument " + message);
118688
- var digestbytes = crypt.wordsToBytes(md5(message, options));
118689
- return options && options.asBytes ? digestbytes : options && options.asString ? bin.bytesToString(digestbytes) : crypt.bytesToHex(digestbytes);
118690
- };
118691
- })();
118692
- })))());
118693
118480
  async function runMigration$4(db) {
118694
118481
  function getValue(node) {
118695
118482
  return node.expr != null ? node.expr : node.cachedValue;
@@ -119257,7 +119044,7 @@ async function updateViews() {
119257
119044
  const hashKey = "view-hash";
119258
119045
  const { value: hash } = await first$2("SELECT value FROM __meta__ WHERE key = ?", [hashKey]) || {};
119259
119046
  const views = makeViews(schema, schemaConfig);
119260
- const currentHash = (0, import_md5.default)(views);
119047
+ const currentHash = (0, node_crypto.createHash)("md5").update(views).digest("hex");
119261
119048
  if (hash !== currentHash) {
119262
119049
  execQuery(views);
119263
119050
  runQuery$1("INSERT OR REPLACE INTO __meta__ (key, value) VALUES (?, ?)", [hashKey, currentHash]);
@@ -121852,7 +121639,8 @@ function isWidgetType(type) {
121852
121639
  "summary-card",
121853
121640
  "calendar-card",
121854
121641
  "formula-card",
121855
- "custom-report"
121642
+ "custom-report",
121643
+ "sankey-card"
121856
121644
  ].includes(type);
121857
121645
  }
121858
121646
  var exportModel = { validate(dashboard) {
@@ -129976,9 +129764,6 @@ var integerToAmount = lib.integerToAmount;
129976
129764
  var internal = null;
129977
129765
  async function init(config = {}) {
129978
129766
  validateNodeVersion();
129979
- if (!globalThis.fetch) globalThis.fetch = (url, init) => {
129980
- return Promise.resolve().then(() => require("./src-iMkUmuwR.js")).then(({ default: fetch }) => fetch(url, init));
129981
- };
129982
129767
  internal = await init$1(config);
129983
129768
  return internal;
129984
129769
  }
@@ -129992,8 +129777,6 @@ async function shutdown() {
129992
129777
  }
129993
129778
  }
129994
129779
  //#endregion
129995
- exports.__commonJSMin = __commonJSMin;
129996
- exports.__toESM = __toESM;
129997
129780
  exports.addTransactions = addTransactions;
129998
129781
  exports.aqlQuery = aqlQuery;
129999
129782
  exports.batchBudgetUpdates = batchBudgetUpdates;