Repository navigation
Recent Uploads
The projects that most recently received a document the caller may read, newest first. Backs
eagle-public's homepage "Recent Uploads" panel (Jira PUBLIC-152). Route: src/http/routes.js.
Controller: src/controllers/nosql/document.js (getRecentUploads, rankRecentUploads).
Repository: src/repositories/documents.js (projectUploadMaxima, newestUploads).
GET /api/documents/recent-uploads — passive auth: works anonymously or with a credential,
registered ahead of /documents/:id in the route table so the literal path is not read as a
document id.
| Parameter | Required | Notes |
|---|---|---|
limit |
no | Plain integer 1-10, default 5. Padded, signed, decimal, exponent, hex spellings (05, +5, 5.0, 5e0, 0x5) and a repeated query key are refused with 400, not normalised |
{
"items": [
{
"projectId": "…",
"eagleProjectId": "…",
"projectName": "…",
"dateUploaded": "2026-09-10T12:00:00.000Z",
"documents": [
{ "id": "…", "eagleId": "…", "displayName": "…", "documentFileName": "…", "type": "…", "dateUploaded": "…" }
]
}
]
}Each item is one project, expanded to up to five of its newest readable documents. Fewer than
limit items is a normal answer — the list is never padded, and a project with fewer than five
documents lists what it has. Projects tie-break by id and documents tie-break by id, so the same
data renders the same way on every call. The project's dateUploaded is that of its first listed
document.
Two steps, so a bulk import of hundreds of documents into one project still takes one place in the list:
-
projectUploadMaximagroups thedocumentscontainer byprojectIdand takesMAX(dateUploaded)— one row per project, ranked newest first in JS (Cosmos allowsGROUP BYonly withoutORDER BY). - For each candidate project in that order,
newestUploadsruns a single-partitionTOP 5 … ORDER BY dateUploaded DESCread scoped to that one project.
A project the caller cannot read, or whose row the redactor withholds, is skipped and the walk continues rather than shortening the list.
Both projectUploadMaxima and newestUploads exclude documents with documentSource: 'UPDATE' —
images uploaded through an Update's gallery or featured-image field. They show on their Update
only, never in this list.
Both the aggregate query and the per-project reads carry the normal ACL predicate
(access-sql.js), and every project and document row is passed through redactForAccess before
any field is read off it — the same redaction used everywhere else, not a second implementation.
Anonymous requests (no credential of any kind) are memoised in process for 60 seconds, keyed on
limit, and the response carries Cache-Control: public, max-age=300 plus Vary: Authorization, X-Api-Key, so a downstream cache can hold it longer than the in-process copy. A request that
presents any credential is never memoised and carries Cache-Control: private, no-store, because
the ranking can differ per caller.
The ranking query depends on /dateUploaded/? being in the documents container's indexing
policy (azure/modules/cosmos-nosql.bicep). Run scripts/deploy-infra.sh test to apply it before
relying on this route being fast against a real container. An index-only change can use scripts/apply-cosmos-index.sh instead; see Operating-DEMI-in-Azure.
- Environment Reality & Gotchas
- Architecture
- Seeding — filling Cosmos from Track and Eagle
- Sources and Status — every source, one state
- Search & Retrieval — overview
- Search Index Reference
- Search Query Construction
- Search Measurements
- Extraction Pipeline
- Extraction Quality — coverage, word-joining, tiling
- Identity Model — which id means what
- Attribute-Level Access — field-visibility levels, catalog
- Sync Architecture — how records get in
- Eagle Mirror Reference — mirrored kinds, refusals, drift classes
- ENGAGE Rows Reference — ENGAGE-owned comment periods, reconcile
- Public-Read Backfill — filling and repairing the mirror containers
-
Short Links —
/s/{code}redirect and/api/links -
Recent Uploads —
/api/documents/recent-uploads, eagle-public homepage panel - Reports — comment export and BCGW CSV reads
-
User Data — saved map areas, preferences,
/meroutes -
Bulk Download —
/api/bulk-downloads, zip jobs - Bulk Download: Operations — enable, poison-queue runbook
- Document Intake — upload link, malware scan, release
- Connecting an Application to DEMI
- Azure Environments
- Document Backup — archive copy of originals, run and check
- Document Backup: Revert and Drill — put documents back from the archive
- PDF Titles — public name written into stored PDFs, run, restore
- Secret Sync — Key Vault, secret-sync Function app, required names
-
Operating DEMI in Azure — deploy, verify
- Operating the DEMI Data Plane — devbox access, probes, audit and cost reads
- Edge ban detector — hourly timer, modes, kill switch, soak and promote
-
CI Workflows — every GitHub Actions workflow, trigger, identity, roles
- CI Deploy Workflows — eagle-demi staging and production deploys
- CI Admin Frontend Workflows — eagle-demi-admin checks and deploys
- Release Process — cutting, tagging, shipping and rolling back a version
- Runbook: Search Outage — index/app schema drift, diagnose, fix, roll back
- BC Gov Landing Zone
- Business Rules
- EPIC.search Business Rules — where DEMI differs from EPIC.search
- 001: Typesense for DFL Search — superseded
- 002: Async Processing (MongoDB Queue) — superseded
- 003: Rule-Based Classification
- 004: Read ACL Authorization Model
- 005: Cosmos Full-Text Search Ruled Out
- 006: AI Summarization over BM25
- 007: Service-to-Service Credentials
- 008: Audit and Usage Analytics Store
- 009: Track Feed — proposed
- 010: Attribute-Level Access Control
- 011: Public Read Surface
- 012: Public Config Surface
- 013: Stored Project Summaries — proposed
- 014: Sync-out to Eagle
- 015: Malware scanning on intake