paisa-mcp 0.4.9 → 0.4.11
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 +28 -10
- package/dist/index.js.map +7 -7
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -54355,20 +54355,25 @@ async function checkVerifier(key, encryptedVerifier) {
|
|
|
54355
54355
|
return false;
|
|
54356
54356
|
}
|
|
54357
54357
|
}
|
|
54358
|
+
async function toSearchHmacKey(key) {
|
|
54359
|
+
const raw = await crypto.subtle.exportKey("raw", key);
|
|
54360
|
+
return crypto.subtle.importKey("raw", raw, { name: "HMAC", hash: "SHA-256" }, false, ["sign"]);
|
|
54361
|
+
}
|
|
54362
|
+
async function searchHash(value, hmacKey) {
|
|
54363
|
+
const sig = await crypto.subtle.sign("HMAC", hmacKey, new TextEncoder().encode(value));
|
|
54364
|
+
return btoa(String.fromCharCode(...new Uint8Array(sig)));
|
|
54365
|
+
}
|
|
54358
54366
|
|
|
54359
54367
|
// src/crypto.ts
|
|
54360
54368
|
var ENCRYPTED_TXN_FIELDS = ["description", "referenceNumber", "notes"];
|
|
54361
54369
|
var ENCRYPTED_MERCHANT_FIELDS = ["cleanName", "rawId", "notes"];
|
|
54362
54370
|
async function hmacWithKey(value, key) {
|
|
54363
|
-
|
|
54364
|
-
const hmacKey = await crypto.subtle.importKey("raw", rawKey, { name: "HMAC", hash: "SHA-256" }, false, ["sign"]);
|
|
54365
|
-
const sig = await crypto.subtle.sign("HMAC", hmacKey, new TextEncoder().encode(value));
|
|
54366
|
-
return btoa(String.fromCharCode(...new Uint8Array(sig)));
|
|
54371
|
+
return searchHash(value, await toSearchHmacKey(key));
|
|
54367
54372
|
}
|
|
54368
54373
|
async function encryptPersonCipher(fields, key) {
|
|
54369
54374
|
const cipher = await encryptField(JSON.stringify(fields), key);
|
|
54370
|
-
const
|
|
54371
|
-
return { cipher, searchHash };
|
|
54375
|
+
const searchHash2 = await hmacWithKey(fields.name.toLowerCase().trim().replace(/\s+/g, " "), key);
|
|
54376
|
+
return { cipher, searchHash: searchHash2 };
|
|
54372
54377
|
}
|
|
54373
54378
|
async function decryptPersonCipher(cipher, key) {
|
|
54374
54379
|
const json2 = await decryptField(cipher, key);
|
|
@@ -55834,7 +55839,8 @@ function goalVariants(client) {
|
|
|
55834
55839
|
deleteGoal: variant(byId, ({ id }) => client.delete(apiPath`/api/goals/${id}`)),
|
|
55835
55840
|
deleteEmi: variant(byId, ({ id }) => client.delete(apiPath`/api/goals/emis/${id}`)),
|
|
55836
55841
|
deleteInsurance: variant(byId, ({ id }) => client.delete(apiPath`/api/goals/insurance/${id}`)),
|
|
55837
|
-
deleteSinkingFund: variant(byId, ({ id }) => client.delete(apiPath`/api/goals/sinking-funds/${id}`))
|
|
55842
|
+
deleteSinkingFund: variant(byId, ({ id }) => client.delete(apiPath`/api/goals/sinking-funds/${id}`)),
|
|
55843
|
+
deleteContribution: variant(byId, ({ id }) => client.delete(apiPath`/api/goals/contributions/${id}`))
|
|
55838
55844
|
};
|
|
55839
55845
|
}
|
|
55840
55846
|
function goalListVariants(client) {
|
|
@@ -56618,6 +56624,7 @@ function entityTools(client, crypto4) {
|
|
|
56618
56624
|
goal: goal.deleteGoal,
|
|
56619
56625
|
emi: goal.deleteEmi,
|
|
56620
56626
|
insurance: goal.deleteInsurance,
|
|
56627
|
+
goal_contribution: goal.deleteContribution,
|
|
56621
56628
|
sinking_fund: goal.deleteSinkingFund,
|
|
56622
56629
|
sip: investment.deleteSip,
|
|
56623
56630
|
fixed_deposit: investment.deleteFd
|
|
@@ -61857,7 +61864,18 @@ async function runCasImport(deps, args) {
|
|
|
61857
61864
|
});
|
|
61858
61865
|
added++;
|
|
61859
61866
|
}
|
|
61860
|
-
|
|
61867
|
+
let netWorth;
|
|
61868
|
+
try {
|
|
61869
|
+
const nw = await deps.client.post("/api/net-worth/auto", {});
|
|
61870
|
+
netWorth = { updated: true, total: Number(nw.data?.totalNetWorth ?? 0) };
|
|
61871
|
+
} catch (err) {
|
|
61872
|
+
const msg = err instanceof Error ? err.message : String(err);
|
|
61873
|
+
netWorth = {
|
|
61874
|
+
updated: false,
|
|
61875
|
+
reason: /manual|hand/i.test(msg) ? "This month's net worth was entered by hand; left as is (update_net_worth mode=auto overwrite=true replaces it)." : msg
|
|
61876
|
+
};
|
|
61877
|
+
}
|
|
61878
|
+
return { ...plan, dryRun: false, added, netWorth };
|
|
61861
61879
|
}
|
|
61862
61880
|
|
|
61863
61881
|
// src/lib/statement-import.ts
|
|
@@ -62307,7 +62325,7 @@ function registerResources2(server2, tools) {
|
|
|
62307
62325
|
// package.json
|
|
62308
62326
|
var package_default = {
|
|
62309
62327
|
name: "paisa-mcp",
|
|
62310
|
-
version: "0.4.
|
|
62328
|
+
version: "0.4.11",
|
|
62311
62329
|
repository: {
|
|
62312
62330
|
type: "git",
|
|
62313
62331
|
url: "git+https://github.com/nimit9/paisa.git",
|
|
@@ -62406,5 +62424,5 @@ main().catch((err) => {
|
|
|
62406
62424
|
process.exit(1);
|
|
62407
62425
|
});
|
|
62408
62426
|
|
|
62409
|
-
//# debugId=
|
|
62427
|
+
//# debugId=D3FDD8B3EB48082164756E2164756E21
|
|
62410
62428
|
//# sourceMappingURL=index.js.map
|