@actual-app/api 26.6.0-nightly.20260601 → 26.6.0

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
@@ -17806,7 +17806,6 @@ var schema = {
17806
17806
  show_hidden: f("integer", { default: 0 }),
17807
17807
  show_uncategorized: f("integer", { default: 0 }),
17808
17808
  trim_intervals: f("integer", { default: 0 }),
17809
- show_trend_lines: f("integer", { default: 0 }),
17810
17809
  include_current: f("integer", { default: 0 }),
17811
17810
  graph_type: f("string", { default: "BarGraph" }),
17812
17811
  conditions: f("json"),
@@ -18984,14 +18983,6 @@ var currencies = [
18984
18983
  numberFormat: "comma-dot-in",
18985
18984
  symbolFirst: true
18986
18985
  },
18987
- {
18988
- code: "IRR",
18989
- name: "Iranian Rial",
18990
- symbol: "﷼",
18991
- decimalPlaces: 0,
18992
- numberFormat: "comma-dot",
18993
- symbolFirst: false
18994
- },
18995
18986
  {
18996
18987
  code: "JMD",
18997
18988
  name: "Jamaican Dollar",
@@ -19048,14 +19039,6 @@ var currencies = [
19048
19039
  numberFormat: "comma-dot",
19049
19040
  symbolFirst: true
19050
19041
  },
19051
- {
19052
- code: "PKR",
19053
- name: "Pakistani Rupee",
19054
- symbol: "Rs.",
19055
- decimalPlaces: 2,
19056
- numberFormat: "comma-dot",
19057
- symbolFirst: true
19058
- },
19059
19042
  {
19060
19043
  code: "PLN",
19061
19044
  name: "Polish Złoty",
@@ -107633,8 +107616,7 @@ var TYPE_INFO = {
107633
107616
  "isNot",
107634
107617
  "doesNotContain",
107635
107618
  "notOneOf",
107636
- "hasTags",
107637
- "hasAnyTag"
107619
+ "hasTags"
107638
107620
  ],
107639
107621
  nullable: true
107640
107622
  },
@@ -107658,7 +107640,7 @@ var TYPE_INFO = {
107658
107640
  var FIELD_INFO = {
107659
107641
  imported_payee: {
107660
107642
  type: "string",
107661
- disallowedOps: new Set(["hasTags", "hasAnyTag"])
107643
+ disallowedOps: new Set(["hasTags"])
107662
107644
  },
107663
107645
  payee: {
107664
107646
  type: "id",
@@ -111023,7 +111005,6 @@ var OP_SCORES = {
111023
111005
  doesNotContain: 0,
111024
111006
  matches: 0,
111025
111007
  hasTags: 0,
111026
- hasAnyTag: 0,
111027
111008
  onBudget: 0,
111028
111009
  offBudget: 0
111029
111010
  };
@@ -111416,21 +111397,6 @@ var Action = class {
111416
111397
  }
111417
111398
  };
111418
111399
  //#endregion
111419
- //#region ../loot-core/src/shared/tags.ts
111420
- function extractTagsForFilter(value) {
111421
- if (!value) return [];
111422
- const tagValues = [];
111423
- const seenTags = /* @__PURE__ */ new Set();
111424
- for (const [_, tag] of value.matchAll(/#*([^#\s]+)/g)) {
111425
- const tagWithHash = "#" + tag;
111426
- if (!seenTags.has(tagWithHash)) {
111427
- seenTags.add(tagWithHash);
111428
- tagValues.push(tagWithHash);
111429
- }
111430
- }
111431
- return tagValues;
111432
- }
111433
- //#endregion
111434
111400
  //#region ../loot-core/src/server/rules/condition.ts
111435
111401
  var CONDITION_TYPES = {
111436
111402
  date: {
@@ -111482,8 +111448,7 @@ var CONDITION_TYPES = {
111482
111448
  "isNot",
111483
111449
  "doesNotContain",
111484
111450
  "notOneOf",
111485
- "hasTags",
111486
- "hasAnyTag"
111451
+ "hasTags"
111487
111452
  ],
111488
111453
  nullable: true,
111489
111454
  parse(op, value, fieldName) {
@@ -111492,8 +111457,8 @@ var CONDITION_TYPES = {
111492
111457
  return value.filter(Boolean).map((val) => val.toLowerCase());
111493
111458
  }
111494
111459
  assert(typeof value === "string", "not-string", `Invalid string value (field: ${fieldName})`);
111495
- if (op === "contains" || op === "matches" || op === "doesNotContain" || op === "hasTags" || op === "hasAnyTag") assert(value.length > 0, "no-empty-string", `${op} must have non-empty string (field: ${fieldName})`);
111496
- if (op === "hasTags" || op === "hasAnyTag") return value;
111460
+ if (op === "contains" || op === "matches" || op === "doesNotContain" || op === "hasTags") assert(value.length > 0, "no-empty-string", `${op} must have non-empty string (field: ${fieldName})`);
111461
+ if (op === "hasTags") return value;
111497
111462
  return value.toLowerCase();
111498
111463
  }
111499
111464
  },
@@ -111617,19 +111582,7 @@ var Condition = class {
111617
111582
  return this.value.indexOf(fieldValue) !== -1;
111618
111583
  case "hasTags":
111619
111584
  if (fieldValue === null) return false;
111620
- const normalizedFieldValue = String(fieldValue);
111621
- return !extractTagsForFilter(this.value).some((tag) => {
111622
- const escapedTag = tag.toLowerCase().replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
111623
- return !new RegExp(`(?<!#)${escapedTag}([\\s#]|$)`).test(normalizedFieldValue);
111624
- });
111625
- case "hasAnyTag": {
111626
- if (fieldValue === null) return false;
111627
- const normalizedFieldValue = String(fieldValue);
111628
- return extractTagsForFilter(this.value).some((tag) => {
111629
- const escapedTag = tag.toLowerCase().replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
111630
- return new RegExp(`(?<!#)${escapedTag}([\\s#]|$)`).test(normalizedFieldValue);
111631
- });
111632
- }
111585
+ return String(fieldValue).indexOf(this.value) !== -1;
111633
111586
  case "notOneOf":
111634
111587
  if (fieldValue === null) return false;
111635
111588
  return this.value.indexOf(fieldValue) === -1;
@@ -112402,7 +112355,7 @@ function conditionsToAQL(conditions, { recurDateBounds = 100, applySpecialCases
112402
112355
  }
112403
112356
  return { amount: { [aqlOp]: value } };
112404
112357
  } else if (type === "string") return { [field]: {
112405
- $transform: !["hasTags", "hasAnyTag"].includes(op) ? "$lower" : void 0,
112358
+ $transform: op !== "hasTags" ? "$lower" : void 0,
112406
112359
  [aqlOp]: value
112407
112360
  } };
112408
112361
  else if (type === "date") return { [field]: { [aqlOp]: value.date } };
@@ -112456,17 +112409,18 @@ function conditionsToAQL(conditions, { recurDateBounds = 100, applySpecialCases
112456
112409
  if (values.length === 0) return { id: null };
112457
112410
  return { $or: values.map((v) => apply(field, "$eq", v)) };
112458
112411
  case "hasTags": {
112459
- const tagValues = extractTagsForFilter(value);
112412
+ const tagValues = [];
112413
+ const seenTags = /* @__PURE__ */ new Set();
112414
+ for (const [_, tag] of value.matchAll(/(?<!#)(#[^#\s]+)/g)) if (!seenTags.has(tag)) {
112415
+ seenTags.add(tag);
112416
+ tagValues.push(tag);
112417
+ }
112460
112418
  if (tagValues.length === 0) return { id: null };
112461
112419
  return { $and: tagValues.map((v) => {
112462
112420
  const pattern = `(?<!#)${v.replace(/[.*+?^${}()|[\]\\]/g, "\\$&").replace(/\\\$/g, "[$]")}([\\s#]|$)`;
112463
112421
  return apply(field, "$regexp", pattern);
112464
112422
  }) };
112465
112423
  }
112466
- case "hasAnyTag": return { $or: extractTagsForFilter(value).map((v) => {
112467
- const pattern = `(?<!#)${v.replace(/[.*+?^${}()|[\]\\]/g, "\\$&").replace(/\\\$/g, "[$]")}([\\s#]|$)`;
112468
- return apply(field, "$regexp", pattern);
112469
- }) };
112470
112424
  case "notOneOf":
112471
112425
  const notValues = value;
112472
112426
  if (notValues.length === 0) return { id: null };
@@ -116857,9 +116811,6 @@ async function checkIfScheduleExists(name, scheduleId) {
116857
116811
  if (scheduleId) return idForName["id"] !== scheduleId;
116858
116812
  return true;
116859
116813
  }
116860
- function normalizeScheduleName(name) {
116861
- return name?.trim() || null;
116862
- }
116863
116814
  async function createSchedule$1({ schedule = null, conditions = [] } = {}) {
116864
116815
  const scheduleId = schedule?.id || v4();
116865
116816
  const { date: dateCond } = extractScheduleConds(conditions);
@@ -116867,15 +116818,9 @@ async function createSchedule$1({ schedule = null, conditions = [] } = {}) {
116867
116818
  if (dateCond.value == null) throw new Error("Date is required");
116868
116819
  const nextDate = getNextDate(dateCond);
116869
116820
  const nextDateRepr = nextDate ? toDateRepr(nextDate) : null;
116870
- const scheduleFields = schedule && {
116871
- ...schedule,
116872
- name: normalizeScheduleName(schedule.name)
116873
- };
116874
- if (scheduleFields) {
116875
- if (scheduleFields.name) {
116876
- if (await checkIfScheduleExists(scheduleFields.name, scheduleId)) throw new Error("Cannot create schedules with the same name");
116877
- }
116878
- }
116821
+ if (schedule) if (schedule.name) {
116822
+ if (await checkIfScheduleExists(schedule.name, scheduleId)) throw new Error("Cannot create schedules with the same name");
116823
+ } else schedule.name = null;
116879
116824
  const ruleId = await insertRule({
116880
116825
  stage: null,
116881
116826
  conditionsOp: "and",
@@ -116894,7 +116839,7 @@ async function createSchedule$1({ schedule = null, conditions = [] } = {}) {
116894
116839
  base_next_date_ts: now
116895
116840
  });
116896
116841
  await insertWithSchema("schedules", {
116897
- ...scheduleFields,
116842
+ ...schedule,
116898
116843
  id: scheduleId,
116899
116844
  rule: ruleId
116900
116845
  });
@@ -116902,11 +116847,6 @@ async function createSchedule$1({ schedule = null, conditions = [] } = {}) {
116902
116847
  }
116903
116848
  async function updateSchedule$1({ schedule, conditions, resetNextDate }) {
116904
116849
  if (schedule.rule) throw new Error("You cannot change the rule of a schedule");
116905
- const scheduleFields = { ...schedule };
116906
- if ("name" in scheduleFields) {
116907
- scheduleFields.name = normalizeScheduleName(scheduleFields.name);
116908
- if (scheduleFields.name && await checkIfScheduleExists(scheduleFields.name, scheduleFields.id)) throw new Error("Cannot update schedules with the same name");
116909
- }
116910
116850
  let rule;
116911
116851
  if (conditions) {
116912
116852
  const { date: dateCond } = extractScheduleConds(conditions);
@@ -116932,9 +116872,9 @@ async function updateSchedule$1({ schedule, conditions, resetNextDate }) {
116932
116872
  id: schedule.id,
116933
116873
  reset: true
116934
116874
  });
116935
- await updateWithSchema("schedules", scheduleFields);
116875
+ await updateWithSchema("schedules", schedule);
116936
116876
  });
116937
- return scheduleFields.id;
116877
+ return schedule.id;
116938
116878
  }
116939
116879
  async function deleteSchedule$1({ id }) {
116940
116880
  const { data: ruleId } = await aqlQuery$1(q$1("schedules").filter({ id }).calculate("rule"));
@@ -125575,7 +125515,6 @@ var reportModel = {
125575
125515
  showHiddenCategories: row.show_hidden === 1,
125576
125516
  showUncategorized: row.show_uncategorized === 1,
125577
125517
  trimIntervals: row.trim_intervals === 1,
125578
- showTrendLines: row.show_trend_lines === 1,
125579
125518
  includeCurrentInterval: row.include_current === 1,
125580
125519
  graphType: row.graph_type,
125581
125520
  conditions: row.conditions ?? [],
@@ -125601,7 +125540,6 @@ var reportModel = {
125601
125540
  show_hidden: report.showHiddenCategories ? 1 : 0,
125602
125541
  show_uncategorized: report.showUncategorized ? 1 : 0,
125603
125542
  trim_intervals: report.trimIntervals ? 1 : 0,
125604
- show_trend_lines: report.showTrendLines ? 1 : 0,
125605
125543
  include_current: report.includeCurrentInterval ? 1 : 0,
125606
125544
  graph_type: report.graphType,
125607
125545
  conditions: report.conditions,