🛠️ NyaySetu Fix Pack
Drop-in Cloudflare Pages Functions that fix the upload (1101) and leads (405) bugs and add DPDP-compliant PII redaction.
Available Endpoints
- GET /api/health
- POST /api/uploads/create
- PUT /api/uploads/:documentId/binary
- POST /api/uploads/:documentId/finalize
- GET /api/uploads/:documentId
- POST /api/leads
- POST /api/_internal/redact
✅ Built-in Compliance
- PII redaction module (Aadhaar, PAN, phone, account, DOB, voter, passport, DL, email, IFSC)
- Audit logging of every action to
audit_events
- Consent snapshot required + persisted on every upload
- Vertex AI region locked to
asia-south1 (Mumbai)
- Mandatory legal disclaimer helper for AI outputs
- Defensive input validation — no more 1101 crashes
- EN + HI bilingual error messages
⚠️ Important
This worker is intended to be deployed alongside or replacing the existing upload + leads endpoints. It writes to the same D1 database, R2 bucket, and queues. Test in a preview deployment before promoting.