paisa-mcp 0.4.10 → 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 +16 -9
- package/dist/index.js.map +6 -6
- 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
|
|
@@ -62318,7 +62325,7 @@ function registerResources2(server2, tools) {
|
|
|
62318
62325
|
// package.json
|
|
62319
62326
|
var package_default = {
|
|
62320
62327
|
name: "paisa-mcp",
|
|
62321
|
-
version: "0.4.
|
|
62328
|
+
version: "0.4.11",
|
|
62322
62329
|
repository: {
|
|
62323
62330
|
type: "git",
|
|
62324
62331
|
url: "git+https://github.com/nimit9/paisa.git",
|
|
@@ -62417,5 +62424,5 @@ main().catch((err) => {
|
|
|
62417
62424
|
process.exit(1);
|
|
62418
62425
|
});
|
|
62419
62426
|
|
|
62420
|
-
//# debugId=
|
|
62427
|
+
//# debugId=D3FDD8B3EB48082164756E2164756E21
|
|
62421
62428
|
//# sourceMappingURL=index.js.map
|