6d935e7180
- Add Redis-backed opportunity cache with background refresh (30s interval) - Fix concurrency bug: use lazy thunks instead of eager promises for batching - Add withCwRetry utility with exponential backoff for transient CW errors - Add adaptive TTL algorithms (primary, sub-resource, products) based on opportunity activity - Add include query param on GET /sales/opportunities/:id (notes,contacts,products) - Add opt-in CW API logger (LOG_CW_API env var) with timestamped files in cw-api-logs/ - Add debug-scripts/analyze-cw-calls.py for API call analysis - Add computeSubResourceCacheTTL and computeProductsCacheTTL algorithms with tests - Increase CW API timeout from 15s to 30s - Unblock cache refresh from startup chain (remove await) - Prioritize recently updated opportunities in refresh cycle - Add CACHING.md documentation - Update API_ROUTES.md with caching details and include param - Update copilot instructions to require CACHING.md sync - Add dev:log script for CW API call logging during development
55 lines
1.7 KiB
JSON
55 lines
1.7 KiB
JSON
{
|
|
"name": "tts-optima-api",
|
|
"homepage": "https://totaltech.net",
|
|
"version": "v0.1.0",
|
|
"author": {
|
|
"name": "Jackson Roberts",
|
|
"email": "jackson.roberts@totaltech.net",
|
|
"url": "https://totaltech.net"
|
|
},
|
|
"module": "src/index.ts",
|
|
"type": "module",
|
|
"private": true,
|
|
"devDependencies": {
|
|
"@types/bun": "latest",
|
|
"@types/jsonwebtoken": "^9.0.10"
|
|
},
|
|
"peerDependencies": {
|
|
"typescript": "^5"
|
|
},
|
|
"scripts": {
|
|
"dev": "NODE_ENV=development bun --watch src/index.ts",
|
|
"dev:log": "LOG_CW_API=1 NODE_ENV=development bun --watch src/index.ts",
|
|
"test": "bun test --preload ./tests/setup.ts",
|
|
"db:gen": "prisma generate",
|
|
"db:push": "prisma migrate dev --skip-generate",
|
|
"db:deploy": "prisma migrate deploy",
|
|
"utils:dev": "docker compose -f .docker/docker-compose.yml up --build",
|
|
"utils:gen_private_keys": "bun ./utils/genPrivateKeys",
|
|
"utils:create_admin_role": "bun ./utils/createAdminRole",
|
|
"utils:assign_user_role": "bun ./utils/assignUserRole",
|
|
"utils:analyze_cw": "python3 debug-scripts/analyze-cw-calls.py",
|
|
"db:check": "bunx prisma migrate diff --from-migrations prisma/migrations --to-schema prisma/schema.prisma --shadow-database-url $DATABASE_URL --exit-code"
|
|
},
|
|
"dependencies": {
|
|
"@azure/msal-node": "^5.0.2",
|
|
"@discordjs/collection": "^2.1.1",
|
|
"@duxcore/eventra": "^1.1.0",
|
|
"@prisma/adapter-pg": "^7.3.0",
|
|
"@prisma/client": "^7.3.0",
|
|
"@socket.io/bun-engine": "^0.1.0",
|
|
"axios": "^1.13.3",
|
|
"blakets": "^0.1.12",
|
|
"cors": "^2.8.6",
|
|
"cuid": "^3.0.0",
|
|
"hono": "^4.11.5",
|
|
"ioredis": "^5.10.0",
|
|
"jsonwebtoken": "^9.0.3",
|
|
"keypair": "^1.0.4",
|
|
"prisma": "^7.3.0",
|
|
"socket.io": "^4.8.3",
|
|
"zod": "^4.3.6",
|
|
"zon": "^1.0.3"
|
|
}
|
|
}
|