paisa-mcp 0.0.5 → 0.0.7

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
@@ -45260,15 +45260,19 @@ async function runRescan(client) {
45260
45260
  const personsRes = await client.get("/api/persons");
45261
45261
  const persons = (personsRes.data ?? []).filter((p2) => p2.name);
45262
45262
  const allRows = [];
45263
- let offset = 0;
45264
- const limit = 500;
45265
- while (true) {
45266
- const res = await client.get("/api/transactions", { limit, offset });
45263
+ const limit = 200;
45264
+ let cursor;
45265
+ const MAX_PAGES = 100;
45266
+ for (let page = 0;page < MAX_PAGES; page++) {
45267
+ const params = { limit };
45268
+ if (cursor)
45269
+ params.cursor = cursor;
45270
+ const res = await client.get("/api/transactions", params);
45267
45271
  const rows = res.data ?? [];
45268
45272
  allRows.push(...rows);
45269
- if (!res.hasMore || rows.length === 0)
45273
+ if (!res.hasMore || !res.nextCursor || rows.length === 0)
45270
45274
  break;
45271
- offset += limit;
45275
+ cursor = res.nextCursor;
45272
45276
  }
45273
45277
  const plan = autoCategorizeFromDescriptions({ rows: allRows, bag, globalMerchants, localMerchants, persons });
45274
45278
  const links = plan.suggestions.filter((s2) => s2.categoryId).flatMap((s2) => s2.transactionIds.map((txId) => ({
@@ -45555,5 +45559,5 @@ main().catch((err) => {
45555
45559
  process.exit(1);
45556
45560
  });
45557
45561
 
45558
- //# debugId=66937CD8E27A6C8364756E2164756E21
45562
+ //# debugId=D8F2B04A5FF304BF64756E2164756E21
45559
45563
  //# sourceMappingURL=index.js.map