vat-validator-mcp 2.0.13 → 2.0.14

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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/server.js +8 -2
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "vat-validator-mcp",
3
3
  "mcpName": "io.github.OjasKord/vat-validator-mcp",
4
- "version": "2.0.13",
4
+ "version": "2.0.14",
5
5
  "description": "VAT number validator for AI agents. EU VIES, UK HMRC, AU ABR — auto-detects jurisdiction. Fraud risk scoring and invoice name cross-check in one call.",
6
6
  "main": "src/server.js",
7
7
  "scripts": {
package/src/server.js CHANGED
@@ -7,7 +7,7 @@ const Stripe = require('stripe');
7
7
  const stripe = Stripe(process.env.STRIPE_SECRET_KEY);
8
8
 
9
9
  const PERSIST_FILE = '/tmp/vat_stats.json';
10
- const VERSION = '2.0.13';
10
+ const VERSION = '2.0.14';
11
11
 
12
12
  // Persistent device ID for HMRC fraud prevention headers (BATCH_PROCESS_DIRECT)
13
13
  const DEVICE_ID_FILE = path.join(__dirname, '..', 'device-id.txt');
@@ -160,7 +160,13 @@ async function loadFreeTierFromRedis() {
160
160
 
161
161
  async function saveFreeTierToRedis() {
162
162
  try {
163
- await redisSet(FREE_TIER_REDIS_KEY, Array.from(freeTierUsage.entries()));
163
+ const existing = await redisGet(FREE_TIER_REDIS_KEY) || [];
164
+ const existingMap = new Map(existing);
165
+ for (const [key, value] of freeTierUsage.entries()) {
166
+ const existingCount = existingMap.get(key) || 0;
167
+ existingMap.set(key, Math.max(existingCount, value));
168
+ }
169
+ await redisSet(FREE_TIER_REDIS_KEY, Array.from(existingMap.entries()));
164
170
  } catch(e) { console.error('[FreeTier] save failed:', e); }
165
171
  }
166
172