Files
telegram-bot-workers/package.json
kappa f5df0c0ffe feat: add optimistic locking and improve type safety
- Implement optimistic locking for deposit balance updates
  - Prevent race conditions in concurrent deposit requests
  - Add automatic retry with exponential backoff (max 3 attempts)
  - Add version column to user_deposits table

- Improve type safety across codebase
  - Add explicit types for Namecheap API responses
  - Add typed function arguments (ManageDepositArgs, etc.)
  - Remove `any` types from deposit-agent and tool files

- Add reconciliation job for balance integrity verification
  - Compare user_deposits.balance vs SUM(confirmed transactions)
  - Alert admin on discrepancy detection

- Set up test environment with Vitest + Miniflare
  - Add 50+ test cases for deposit system
  - Add helper functions for test data creation

- Update documentation
  - Add migration guide for version columns
  - Document optimistic locking patterns

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-19 23:23:09 +09:00

39 lines
1.0 KiB
JSON

{
"name": "telegram-summary-bot",
"version": "1.0.0",
"description": "Telegram bot with rolling summary using Cloudflare Workers + D1",
"main": "src/index.ts",
"scripts": {
"dev": "wrangler dev",
"deploy": "wrangler deploy",
"db:create": "wrangler d1 create telegram-summary-db",
"db:init": "wrangler d1 execute telegram-summary-db --file=schema.sql",
"db:init:local": "wrangler d1 execute telegram-summary-db --local --file=schema.sql",
"tail": "wrangler tail",
"chat": "npx tsx scripts/chat.ts",
"test": "vitest run",
"test:watch": "vitest",
"test:coverage": "vitest run --coverage"
},
"devDependencies": {
"@cloudflare/vitest-pool-workers": "^0.1.0",
"@cloudflare/workers-types": "^4.20241127.0",
"@vitest/coverage-v8": "^1.2.0",
"miniflare": "^3.20231030.0",
"typescript": "^5.3.3",
"vitest": "^1.2.0",
"wrangler": "^4.59.2"
},
"keywords": [
"telegram",
"bot",
"cloudflare",
"workers",
"d1",
"ai"
],
"dependencies": {
"zod": "^4.3.5"
}
}