paisa-mcp 0.0.10 → 0.0.12

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
@@ -38297,9 +38297,6 @@ async function encryptTransactionFields(items, key) {
38297
38297
  await encryptObjectFields(item, ENCRYPTED_TXN_FIELDS, key);
38298
38298
  }
38299
38299
  }
38300
- async function encryptMerchantFieldsOnObject(obj, key) {
38301
- await encryptObjectFields(obj, ENCRYPTED_MERCHANT_FIELDS, key);
38302
- }
38303
38300
 
38304
38301
  // ../../node_modules/.bun/zod@3.25.76/node_modules/zod/v3/external.js
38305
38302
  var exports_external = {};
@@ -42641,16 +42638,57 @@ function registerGoalTools(server, client) {
42641
42638
  }
42642
42639
  };
42643
42640
  if (type === "goal") {
42644
- const { id, goalType, name: name2, targetAmount: targetAmount2, targetDate: targetDate2, currentAmount: currentAmount2, monthlyContribution: monthlyContribution2, owner, icon, color, notes } = fields;
42645
- const body2 = { type: goalType, name: name2, targetAmount: targetAmount2, targetDate: targetDate2, currentAmount: currentAmount2, monthlyContribution: monthlyContribution2, owner, icon, color, notes };
42641
+ const {
42642
+ id,
42643
+ goalType,
42644
+ name: name2,
42645
+ targetAmount: targetAmount2,
42646
+ targetDate: targetDate2,
42647
+ currentAmount: currentAmount2,
42648
+ monthlyContribution: monthlyContribution2,
42649
+ owner,
42650
+ icon,
42651
+ color,
42652
+ notes
42653
+ } = fields;
42654
+ const body2 = {
42655
+ type: goalType,
42656
+ name: name2,
42657
+ targetAmount: targetAmount2,
42658
+ targetDate: targetDate2,
42659
+ currentAmount: currentAmount2,
42660
+ monthlyContribution: monthlyContribution2,
42661
+ owner,
42662
+ icon,
42663
+ color,
42664
+ notes
42665
+ };
42646
42666
  if (!id)
42647
42667
  require2(["name", "targetAmount", "goalType"]);
42648
42668
  const data2 = id ? await client.patch(`/api/goals/${id}`, body2) : await client.post("/api/goals", body2);
42649
42669
  return { content: [{ type: "text", text: JSON.stringify(data2) }] };
42650
42670
  }
42651
42671
  if (type === "emi") {
42652
- require2(["name", "totalAmount", "emiAmount", "startDate", "endDate", "totalMonths", "owner"]);
42653
- const { name: name2, totalAmount, emiAmount, interestRate, startDate, endDate, totalMonths, paidMonths, owner } = fields;
42672
+ require2([
42673
+ "name",
42674
+ "totalAmount",
42675
+ "emiAmount",
42676
+ "startDate",
42677
+ "endDate",
42678
+ "totalMonths",
42679
+ "owner"
42680
+ ]);
42681
+ const {
42682
+ name: name2,
42683
+ totalAmount,
42684
+ emiAmount,
42685
+ interestRate,
42686
+ startDate,
42687
+ endDate,
42688
+ totalMonths,
42689
+ paidMonths,
42690
+ owner
42691
+ } = fields;
42654
42692
  const body2 = {
42655
42693
  name: name2,
42656
42694
  totalAmount,
@@ -42980,8 +43018,6 @@ function registerMerchantTools(server, client, crypto3) {
42980
43018
  }
42981
43019
  payload.categoryId = categoryId;
42982
43020
  }
42983
- if (crypto3)
42984
- await encryptMerchantFieldsOnObject(payload, crypto3.key);
42985
43021
  const data = id ? await client.patch(`/api/merchants/${id}`, payload) : await client.post("/api/merchants", payload);
42986
43022
  return { content: [{ type: "text", text: JSON.stringify(data) }] };
42987
43023
  });
@@ -45380,7 +45416,13 @@ async function runRescan(client, crypto3) {
45380
45416
  break;
45381
45417
  cursor = res.nextCursor;
45382
45418
  }
45383
- const plan = autoCategorizeFromDescriptions({ rows: allRows, bag, globalMerchants, localMerchants, persons });
45419
+ const plan = autoCategorizeFromDescriptions({
45420
+ rows: allRows,
45421
+ bag,
45422
+ globalMerchants,
45423
+ localMerchants,
45424
+ persons
45425
+ });
45384
45426
  let categorized = 0;
45385
45427
  const links = plan.suggestions.flatMap((s2) => {
45386
45428
  const categoryId = s2.categoryId ?? (s2.entity.type === "merchant" ? merchantCategoryById.get(s2.entity.merchantId) ?? null : null);
@@ -45419,8 +45461,8 @@ function registerTransactionTools(server, client, crypto3) {
45419
45461
  }
45420
45462
  }, async (params) => {
45421
45463
  const data = await client.get("/api/transactions", Object.fromEntries(Object.entries(params).filter(([, v2]) => v2 !== undefined).map(([k2, v2]) => [k2, String(v2)])));
45422
- if (crypto3 && data.transactions)
45423
- await decryptTransactionFields(data.transactions, crypto3.key);
45464
+ if (crypto3 && data.data)
45465
+ await decryptTransactionFields(data.data, crypto3.key);
45424
45466
  return { content: [{ type: "text", text: JSON.stringify(data) }] };
45425
45467
  });
45426
45468
  server.registerTool("update_transaction", {
@@ -45549,11 +45591,19 @@ function registerTransactionTools(server, client, crypto3) {
45549
45591
  } catch (e2) {
45550
45592
  throw new Error(`Failed to read/parse ${filePath}: ${e2 instanceof Error ? e2.message : String(e2)}`);
45551
45593
  }
45552
- const data = await importTransactions(client, crypto3, { accountId, source, granularity, txns });
45594
+ const data = await importTransactions(client, crypto3, {
45595
+ accountId,
45596
+ source,
45597
+ granularity,
45598
+ txns
45599
+ });
45553
45600
  const rescan = await runRescan(client, crypto3);
45554
45601
  return {
45555
45602
  content: [
45556
- { type: "text", text: JSON.stringify({ import: data, count: txns.length, rescan }) }
45603
+ {
45604
+ type: "text",
45605
+ text: JSON.stringify({ import: data, count: txns.length, rescan })
45606
+ }
45557
45607
  ]
45558
45608
  };
45559
45609
  });
@@ -45696,5 +45746,5 @@ main().catch((err) => {
45696
45746
  process.exit(1);
45697
45747
  });
45698
45748
 
45699
- //# debugId=FB29DDFDDAE15AFC64756E2164756E21
45749
+ //# debugId=2A5FB457B4850D1E64756E2164756E21
45700
45750
  //# sourceMappingURL=index.js.map