paisa-mcp 0.4.3 → 0.4.4
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 +39 -36
- package/dist/index.js.map +14 -14
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -53113,6 +53113,9 @@ function retryAfterMs(err) {
|
|
|
53113
53113
|
const ms = Number.isFinite(secs) ? secs * 1000 : Date.parse(raw) - Date.now();
|
|
53114
53114
|
return Number.isFinite(ms) && ms >= 0 ? Math.min(ms, 1e4) : undefined;
|
|
53115
53115
|
}
|
|
53116
|
+
function apiPath(strings, ...values) {
|
|
53117
|
+
return strings.reduce((out, s, i) => out + s + (i < values.length ? encodeURIComponent(String(values[i])) : ""), "");
|
|
53118
|
+
}
|
|
53116
53119
|
|
|
53117
53120
|
class PaisaApiClient {
|
|
53118
53121
|
retryBaseMs;
|
|
@@ -54359,7 +54362,7 @@ function alertRuleVariants(client) {
|
|
|
54359
54362
|
type: exports_external.string().describe("Rule type (e.g. budget_threshold, spending_spike)"),
|
|
54360
54363
|
enabled: exports_external.boolean().optional(),
|
|
54361
54364
|
threshold: exports_external.string().regex(/^\d{1,4}(\.\d{1,2})?$/).optional().nullable().describe('Decimal string, e.g. "80.50"')
|
|
54362
|
-
}), ({ type, enabled, threshold }) => client.patch(`/api/alerts/rules/${type}`, {
|
|
54365
|
+
}), ({ type, enabled, threshold }) => client.patch(apiPath`/api/alerts/rules/${type}`, {
|
|
54363
54366
|
...enabled !== undefined ? { enabled } : {},
|
|
54364
54367
|
...threshold !== undefined ? { threshold } : {}
|
|
54365
54368
|
}))
|
|
@@ -54380,14 +54383,14 @@ function alertTools(client) {
|
|
|
54380
54383
|
key: "action",
|
|
54381
54384
|
describe: { id: "Alert UUID", all: "", type: "" },
|
|
54382
54385
|
variants: {
|
|
54383
|
-
dismiss: variant(exports_external.object({ id: exports_external.string() }), ({ id }) => client.patch(`/api/alerts/${id}/dismiss`)),
|
|
54386
|
+
dismiss: variant(exports_external.object({ id: exports_external.string() }), ({ id }) => client.patch(apiPath`/api/alerts/${id}/dismiss`)),
|
|
54384
54387
|
read: variant(exports_external.object({
|
|
54385
54388
|
id: exports_external.string().uuid().optional(),
|
|
54386
54389
|
all: exports_external.boolean().optional().describe("read: mark every alert read")
|
|
54387
54390
|
}), async ({ id, all: all2 }) => {
|
|
54388
54391
|
if (!all2 && !id)
|
|
54389
54392
|
throw new Error("Provide an alert id, or all:true");
|
|
54390
|
-
const data = all2 ? await client.post("/api/alerts/read-all") : await client.patch(`/api/alerts/${id}/read`);
|
|
54393
|
+
const data = all2 ? await client.post("/api/alerts/read-all") : await client.patch(apiPath`/api/alerts/${id}/read`);
|
|
54391
54394
|
return data;
|
|
54392
54395
|
}),
|
|
54393
54396
|
list_rules: rules.list,
|
|
@@ -54684,7 +54687,7 @@ function dashboardTools(client, crypto4) {
|
|
|
54684
54687
|
function debtVariants(client) {
|
|
54685
54688
|
return {
|
|
54686
54689
|
list: variant(exports_external.object({}), () => client.get("/api/debts")),
|
|
54687
|
-
delete: variant(exports_external.object({ id: exports_external.string().uuid() }), ({ id }) => client.delete(`/api/debts/${id}`))
|
|
54690
|
+
delete: variant(exports_external.object({ id: exports_external.string().uuid() }), ({ id }) => client.delete(apiPath`/api/debts/${id}`))
|
|
54688
54691
|
};
|
|
54689
54692
|
}
|
|
54690
54693
|
function debtTools(client) {
|
|
@@ -54715,7 +54718,7 @@ function debtTools(client) {
|
|
|
54715
54718
|
id: exports_external.string(),
|
|
54716
54719
|
settledAmount: exports_external.string().optional().describe("settle: actual amount, if not 0")
|
|
54717
54720
|
}), async ({ id, settledAmount }) => {
|
|
54718
|
-
const data = await client.patch(`/api/debts/${id}`, {
|
|
54721
|
+
const data = await client.patch(apiPath`/api/debts/${id}`, {
|
|
54719
54722
|
isActive: false,
|
|
54720
54723
|
outstandingBalance: settledAmount ?? "0"
|
|
54721
54724
|
});
|
|
@@ -54742,7 +54745,7 @@ function accountVariants(client) {
|
|
|
54742
54745
|
billingDay: exports_external.number().optional(),
|
|
54743
54746
|
color: exports_external.string().optional()
|
|
54744
54747
|
}), async ({ id, ...rest }) => {
|
|
54745
|
-
const data = id ? await client.patch(`/api/accounts/${id}`, rest) : await client.post("/api/accounts", rest);
|
|
54748
|
+
const data = id ? await client.patch(apiPath`/api/accounts/${id}`, rest) : await client.post("/api/accounts", rest);
|
|
54746
54749
|
return data;
|
|
54747
54750
|
})
|
|
54748
54751
|
};
|
|
@@ -54761,10 +54764,10 @@ function categoryVariants(client) {
|
|
|
54761
54764
|
icon: exports_external.string().optional(),
|
|
54762
54765
|
color: exports_external.string().optional()
|
|
54763
54766
|
}), async ({ id, ...rest }) => {
|
|
54764
|
-
const data = id ? await client.patch(`/api/categories/${id}`, rest) : await client.post("/api/categories", rest);
|
|
54767
|
+
const data = id ? await client.patch(apiPath`/api/categories/${id}`, rest) : await client.post("/api/categories", rest);
|
|
54765
54768
|
return data;
|
|
54766
54769
|
}),
|
|
54767
|
-
delete: variant(exports_external.object({ id: exports_external.string().describe("Category UUID") }), ({ id }) => client.delete(`/api/categories/${id}`))
|
|
54770
|
+
delete: variant(exports_external.object({ id: exports_external.string().describe("Category UUID") }), ({ id }) => client.delete(apiPath`/api/categories/${id}`))
|
|
54768
54771
|
};
|
|
54769
54772
|
}
|
|
54770
54773
|
|
|
@@ -54788,13 +54791,13 @@ function goalVariants(client) {
|
|
|
54788
54791
|
isActive: exports_external.boolean().optional(),
|
|
54789
54792
|
notes: exports_external.string().optional()
|
|
54790
54793
|
}), async ({ id, ...body }) => {
|
|
54791
|
-
const data = id ? await client.patch(`/api/goals/insurance/${id}`, body) : await client.post("/api/goals/insurance", body);
|
|
54794
|
+
const data = id ? await client.patch(apiPath`/api/goals/insurance/${id}`, body) : await client.post("/api/goals/insurance", body);
|
|
54792
54795
|
return data;
|
|
54793
54796
|
}),
|
|
54794
|
-
deleteGoal: variant(byId, ({ id }) => client.delete(`/api/goals/${id}`)),
|
|
54795
|
-
deleteEmi: variant(byId, ({ id }) => client.delete(`/api/goals/emis/${id}`)),
|
|
54796
|
-
deleteInsurance: variant(byId, ({ id }) => client.delete(`/api/goals/insurance/${id}`)),
|
|
54797
|
-
deleteSinkingFund: variant(byId, ({ id }) => client.delete(`/api/goals/sinking-funds/${id}`))
|
|
54797
|
+
deleteGoal: variant(byId, ({ id }) => client.delete(apiPath`/api/goals/${id}`)),
|
|
54798
|
+
deleteEmi: variant(byId, ({ id }) => client.delete(apiPath`/api/goals/emis/${id}`)),
|
|
54799
|
+
deleteInsurance: variant(byId, ({ id }) => client.delete(apiPath`/api/goals/insurance/${id}`)),
|
|
54800
|
+
deleteSinkingFund: variant(byId, ({ id }) => client.delete(apiPath`/api/goals/sinking-funds/${id}`))
|
|
54798
54801
|
};
|
|
54799
54802
|
}
|
|
54800
54803
|
function goalListVariants(client) {
|
|
@@ -54808,7 +54811,7 @@ function goalListVariants(client) {
|
|
|
54808
54811
|
emis: collection("emis"),
|
|
54809
54812
|
sinking_funds: collection("sinking_funds"),
|
|
54810
54813
|
insurance: collection("insurance"),
|
|
54811
|
-
goal_contributions: variant(exports_external.object({ id: exports_external.string() }), ({ id }) => client.get(`/api/goals/${id}/contributions`))
|
|
54814
|
+
goal_contributions: variant(exports_external.object({ id: exports_external.string() }), ({ id }) => client.get(apiPath`/api/goals/${id}/contributions`))
|
|
54812
54815
|
};
|
|
54813
54816
|
}
|
|
54814
54817
|
function goalTools(client) {
|
|
@@ -54884,7 +54887,7 @@ function goalTools(client) {
|
|
|
54884
54887
|
};
|
|
54885
54888
|
if (!id2)
|
|
54886
54889
|
require2(["name", "targetAmount", "goalType"]);
|
|
54887
|
-
const data2 = id2 ? await client.patch(`/api/goals/${id2}`, body2) : await client.post("/api/goals", body2);
|
|
54890
|
+
const data2 = id2 ? await client.patch(apiPath`/api/goals/${id2}`, body2) : await client.post("/api/goals", body2);
|
|
54888
54891
|
return data2;
|
|
54889
54892
|
}
|
|
54890
54893
|
if (type === "emi") {
|
|
@@ -54926,7 +54929,7 @@ function goalTools(client) {
|
|
|
54926
54929
|
owner,
|
|
54927
54930
|
status
|
|
54928
54931
|
};
|
|
54929
|
-
const data2 = id2 ? await client.patch(`/api/goals/emis/${id2}`, body2) : await client.post("/api/goals/emis", body2);
|
|
54932
|
+
const data2 = id2 ? await client.patch(apiPath`/api/goals/emis/${id2}`, body2) : await client.post("/api/goals/emis", body2);
|
|
54930
54933
|
return data2;
|
|
54931
54934
|
}
|
|
54932
54935
|
const { id, name, targetAmount, targetDate, monthlyContribution, currentAmount } = fields;
|
|
@@ -54939,7 +54942,7 @@ function goalTools(client) {
|
|
|
54939
54942
|
monthlySetAside: monthlyContribution,
|
|
54940
54943
|
currentAmount
|
|
54941
54944
|
};
|
|
54942
|
-
const data = id ? await client.patch(`/api/goals/sinking-funds/${id}`, body) : await client.post("/api/goals/sinking-funds", body);
|
|
54945
|
+
const data = id ? await client.patch(apiPath`/api/goals/sinking-funds/${id}`, body) : await client.post("/api/goals/sinking-funds", body);
|
|
54943
54946
|
return data;
|
|
54944
54947
|
}
|
|
54945
54948
|
}),
|
|
@@ -54952,7 +54955,7 @@ function goalTools(client) {
|
|
|
54952
54955
|
date: exports_external.string().optional().describe("YYYY-MM-DD (default today)"),
|
|
54953
54956
|
notes: exports_external.string().optional()
|
|
54954
54957
|
}),
|
|
54955
|
-
handler: ({ id, ...body }) => client.post(`/api/goals/${id}/contribute`, body)
|
|
54958
|
+
handler: ({ id, ...body }) => client.post(apiPath`/api/goals/${id}/contribute`, body)
|
|
54956
54959
|
})
|
|
54957
54960
|
];
|
|
54958
54961
|
}
|
|
@@ -55063,7 +55066,7 @@ function householdVariants(client) {
|
|
|
55063
55066
|
}), (body) => client.patch("/api/households", body)),
|
|
55064
55067
|
listInvites: variant(exports_external.object({}), () => client.get("/api/households/invites")),
|
|
55065
55068
|
createInvite: variant(exports_external.object({ email: exports_external.string().email() }), ({ email: email3 }) => client.post("/api/households/invites", { email: email3 })),
|
|
55066
|
-
revokeInvite: variant(exports_external.object({ id: exports_external.string().describe("Invite UUID") }), ({ id }) => client.delete(`/api/households/invites/${id}`))
|
|
55069
|
+
revokeInvite: variant(exports_external.object({ id: exports_external.string().describe("Invite UUID") }), ({ id }) => client.delete(apiPath`/api/households/invites/${id}`))
|
|
55067
55070
|
};
|
|
55068
55071
|
}
|
|
55069
55072
|
|
|
@@ -55071,8 +55074,8 @@ function householdVariants(client) {
|
|
|
55071
55074
|
function investmentVariants(client) {
|
|
55072
55075
|
const byId = exports_external.object({ id: exports_external.string().describe("SIP or FD UUID") });
|
|
55073
55076
|
return {
|
|
55074
|
-
deleteSip: variant(byId, ({ id }) => client.delete(`/api/investments/sips/${id}`)),
|
|
55075
|
-
deleteFd: variant(byId, ({ id }) => client.delete(`/api/investments/fds/${id}`))
|
|
55077
|
+
deleteSip: variant(byId, ({ id }) => client.delete(apiPath`/api/investments/sips/${id}`)),
|
|
55078
|
+
deleteFd: variant(byId, ({ id }) => client.delete(apiPath`/api/investments/fds/${id}`))
|
|
55076
55079
|
};
|
|
55077
55080
|
}
|
|
55078
55081
|
function investmentListVariants(client) {
|
|
@@ -55080,7 +55083,7 @@ function investmentListVariants(client) {
|
|
|
55080
55083
|
holdings: variant(exports_external.object({}), () => client.get("/api/investments")),
|
|
55081
55084
|
sips: variant(exports_external.object({}), () => client.get("/api/investments/sips")),
|
|
55082
55085
|
fixed_deposits: variant(exports_external.object({}), () => client.get("/api/investments/fds")),
|
|
55083
|
-
investment_transactions: variant(exports_external.object({ id: exports_external.string() }), ({ id }) => client.get(`/api/investments/${id}/transactions`))
|
|
55086
|
+
investment_transactions: variant(exports_external.object({ id: exports_external.string() }), ({ id }) => client.get(apiPath`/api/investments/${id}/transactions`))
|
|
55084
55087
|
};
|
|
55085
55088
|
}
|
|
55086
55089
|
function investmentTools(client) {
|
|
@@ -55177,7 +55180,7 @@ function investmentTools(client) {
|
|
|
55177
55180
|
endDate,
|
|
55178
55181
|
platform: id2 ? platform : platform ?? "manual"
|
|
55179
55182
|
};
|
|
55180
|
-
const data2 = id2 ? await client.patch(`/api/investments/sips/${id2}`, sipFields) : await client.post("/api/investments/sips", sipFields);
|
|
55183
|
+
const data2 = id2 ? await client.patch(apiPath`/api/investments/sips/${id2}`, sipFields) : await client.post("/api/investments/sips", sipFields);
|
|
55181
55184
|
return data2;
|
|
55182
55185
|
}
|
|
55183
55186
|
const { id, bankName, amount, interestRate, startDate, maturityDate, owner, notes } = fields;
|
|
@@ -55203,7 +55206,7 @@ function investmentTools(client) {
|
|
|
55203
55206
|
owner,
|
|
55204
55207
|
notes
|
|
55205
55208
|
};
|
|
55206
|
-
const data = id ? await client.patch(`/api/investments/fds/${id}`, fdBody) : await client.post("/api/investments/fds", fdBody);
|
|
55209
|
+
const data = id ? await client.patch(apiPath`/api/investments/fds/${id}`, fdBody) : await client.post("/api/investments/fds", fdBody);
|
|
55207
55210
|
return data;
|
|
55208
55211
|
}
|
|
55209
55212
|
}),
|
|
@@ -55267,7 +55270,7 @@ function merchantVariants(client, crypto4) {
|
|
|
55267
55270
|
}
|
|
55268
55271
|
payload.categoryId = categoryId;
|
|
55269
55272
|
}
|
|
55270
|
-
const data = id ? await client.patch(`/api/merchants/${id}`, payload) : await client.post("/api/merchants", payload);
|
|
55273
|
+
const data = id ? await client.patch(apiPath`/api/merchants/${id}`, payload) : await client.post("/api/merchants", payload);
|
|
55271
55274
|
return data;
|
|
55272
55275
|
}),
|
|
55273
55276
|
delete: variant(exports_external.object({
|
|
@@ -55277,7 +55280,7 @@ function merchantVariants(client, crypto4) {
|
|
|
55277
55280
|
if (!id && (!ids || ids.length === 0)) {
|
|
55278
55281
|
throw new Error("Provide either id or ids");
|
|
55279
55282
|
}
|
|
55280
|
-
const data = ids ? await client.post("/api/merchants/bulk-delete", { ids }) : await client.delete(`/api/merchants/${id}`);
|
|
55283
|
+
const data = ids ? await client.post("/api/merchants/bulk-delete", { ids }) : await client.delete(apiPath`/api/merchants/${id}`);
|
|
55281
55284
|
return data;
|
|
55282
55285
|
})
|
|
55283
55286
|
};
|
|
@@ -55309,7 +55312,7 @@ function personVariants(client, crypto4) {
|
|
|
55309
55312
|
}), async ({ id, ...updates }) => {
|
|
55310
55313
|
if (crypto4) {
|
|
55311
55314
|
if (id) {
|
|
55312
|
-
const existing = await client.get(`/api/persons/${id}`);
|
|
55315
|
+
const existing = await client.get(apiPath`/api/persons/${id}`);
|
|
55313
55316
|
const personData = existing.data;
|
|
55314
55317
|
let current;
|
|
55315
55318
|
if (personData.cipher) {
|
|
@@ -55331,7 +55334,7 @@ function personVariants(client, crypto4) {
|
|
|
55331
55334
|
notes: updates.notes ?? current.notes ?? null
|
|
55332
55335
|
};
|
|
55333
55336
|
const payload2 = await encryptPersonCipher(merged, crypto4.key);
|
|
55334
|
-
const data3 = await client.patch(`/api/persons/${id}`, payload2);
|
|
55337
|
+
const data3 = await client.patch(apiPath`/api/persons/${id}`, payload2);
|
|
55335
55338
|
return data3;
|
|
55336
55339
|
}
|
|
55337
55340
|
if (!updates.name)
|
|
@@ -55347,14 +55350,14 @@ function personVariants(client, crypto4) {
|
|
|
55347
55350
|
const data2 = await client.post("/api/persons", payload);
|
|
55348
55351
|
return data2;
|
|
55349
55352
|
}
|
|
55350
|
-
const data = id ? await client.patch(`/api/persons/${id}`, updates) : await client.post("/api/persons", updates);
|
|
55353
|
+
const data = id ? await client.patch(apiPath`/api/persons/${id}`, updates) : await client.post("/api/persons", updates);
|
|
55351
55354
|
return data;
|
|
55352
55355
|
}),
|
|
55353
55356
|
list: variant(exports_external.object({
|
|
55354
55357
|
id: exports_external.string().optional().describe("persons: one person's UUID; omit to list all")
|
|
55355
55358
|
}), async ({ id }) => {
|
|
55356
55359
|
if (id) {
|
|
55357
|
-
const data2 = await client.get(`/api/persons/${id}`);
|
|
55360
|
+
const data2 = await client.get(apiPath`/api/persons/${id}`);
|
|
55358
55361
|
if (crypto4 && data2.data.cipher) {
|
|
55359
55362
|
const { data: decrypted, undecrypted } = await decryptPersonCiphers(data2.data, crypto4.key);
|
|
55360
55363
|
data2.data = decrypted;
|
|
@@ -55372,7 +55375,7 @@ function personVariants(client, crypto4) {
|
|
|
55372
55375
|
}
|
|
55373
55376
|
return data;
|
|
55374
55377
|
}),
|
|
55375
|
-
delete: variant(exports_external.object({ id: exports_external.string().describe("Person UUID") }), ({ id }) => client.delete(`/api/persons/${id}`))
|
|
55378
|
+
delete: variant(exports_external.object({ id: exports_external.string().describe("Person UUID") }), ({ id }) => client.delete(apiPath`/api/persons/${id}`))
|
|
55376
55379
|
};
|
|
55377
55380
|
}
|
|
55378
55381
|
|
|
@@ -59938,7 +59941,7 @@ function transactionTools(client, crypto4) {
|
|
|
59938
59941
|
body.categoryType = cat.type;
|
|
59939
59942
|
delete body.categorySlug;
|
|
59940
59943
|
}
|
|
59941
|
-
const data = await client.patch(`/api/transactions/${id}`, body);
|
|
59944
|
+
const data = await client.patch(apiPath`/api/transactions/${id}`, body);
|
|
59942
59945
|
return data;
|
|
59943
59946
|
}
|
|
59944
59947
|
}),
|
|
@@ -59972,7 +59975,7 @@ function transactionTools(client, crypto4) {
|
|
|
59972
59975
|
throw new Error("ids and resolution are required for action 'resolve'");
|
|
59973
59976
|
}
|
|
59974
59977
|
if (action === "flag") {
|
|
59975
|
-
const data2 = await client.patch(`/api/transactions/${transactionId}`, {
|
|
59978
|
+
const data2 = await client.patch(apiPath`/api/transactions/${transactionId}`, {
|
|
59976
59979
|
isDuplicate: true,
|
|
59977
59980
|
isIgnored: true
|
|
59978
59981
|
});
|
|
@@ -60080,7 +60083,7 @@ function transactionTools(client, crypto4) {
|
|
|
60080
60083
|
throw new Error("filters is empty (matches every transaction) — refusing; set confirmDeleteAll only after explicit user confirmation");
|
|
60081
60084
|
}
|
|
60082
60085
|
if (id) {
|
|
60083
|
-
const data2 = await client.delete(`/api/transactions/${id}`);
|
|
60086
|
+
const data2 = await client.delete(apiPath`/api/transactions/${id}`);
|
|
60084
60087
|
return data2;
|
|
60085
60088
|
}
|
|
60086
60089
|
const body = ids ? { ids } : { filters, ...confirmDeleteAll ? { confirmDeleteAll } : {} };
|
|
@@ -61014,7 +61017,7 @@ function registerResources2(server2, tools) {
|
|
|
61014
61017
|
// package.json
|
|
61015
61018
|
var package_default = {
|
|
61016
61019
|
name: "paisa-mcp",
|
|
61017
|
-
version: "0.4.
|
|
61020
|
+
version: "0.4.4",
|
|
61018
61021
|
repository: {
|
|
61019
61022
|
type: "git",
|
|
61020
61023
|
url: "git+https://github.com/nimit9/paisa.git",
|
|
@@ -61113,5 +61116,5 @@ main().catch((err) => {
|
|
|
61113
61116
|
process.exit(1);
|
|
61114
61117
|
});
|
|
61115
61118
|
|
|
61116
|
-
//# debugId=
|
|
61119
|
+
//# debugId=0BCBA1F2C8CA2E2E64756E2164756E21
|
|
61117
61120
|
//# sourceMappingURL=index.js.map
|