API reference
Diagnostic HTTP API
Default: http://127.0.0.1:3000. GET only. When configured, Authorization: Bearer <CDF_API_TOKEN> is required for source and metrics routes. Production and non-loopback binds require a token. Health probes remain unauthenticated.
| Route | Behavior |
|---|---|
| /health | 200, {"status":"alive"}; process liveness |
| /ready | 200, {"status":"healthy"} after DuckDB probe; 503 on failure |
| /metrics | Prometheus text; queue/deadlines, duration histograms, memory, cache, requests and uptime |
| /api/sources | Names, types, ID fields, CRS; excludes paths/credentials |
| /api/sources/{name}/features | GeoJSON with CDF metadata and exceededTransferLimit |
Query/schema routes: /api/sources/{name}/query and /api/sources/{name}/schema; see the complete P1 parameter contract.
Feature parameters: limit is 1 through maxRecordCount (default maximum); offset is 0 through 1,000,000; geometry accepts GeoJSON or ArcGIS point/multipoint/envelope/paths/rings and uses intersects; inSR may specify 4326, 3857 or the configured source EPSG. Repeated/unknown parameters are rejected. The features route rejects where; use the restricted query grammar on the query route. GeometryCollections are unsupported.
curl "http://127.0.0.1:3000/api/sources/default/features?limit=1&offset=1"
Default data returns feature ID 2 with exceededTransferLimit true. Pages assume unchanged source data and globally unique source IDs. Updates between requests can change page contents.
{
"type": "FeatureCollection",
"features": [{
"type": "Feature", "id": 2,
"geometry": {"type": "Point", "coordinates": [-118.2437, 34.0522]},
"properties": {"id": 2, "name": "Los Angeles", "population": "3979576"}
}],
"metadata": {"idField": "id", "maxRecordCount": 2000, "inputCrs": 4326},
"exceededTransferLimit": true
}
BIGINT properties are strings; configured IDs are positive 32-bit integers. Geometry may be null. Errors use {"error":{"code":"...","message":"..."}}.
| Status | Meaning |
|---|---|
| 400 | Invalid query/geometry/pagination |
| 401 | Missing/incorrect token |
| 404 | Unknown route/source |
| 405 | Unsupported method |
| 409 | Approved schema/CRS drift or source change during a read |
| 422 | Invalid source identifiers/family, oversized dataset/result |
| 500 | Internal error with details withheld |
| 503 | Saturated queue, unavailable source identity/provider, or shutdown |
| 504 | Queue, initialization, execution or total request deadline |
Results/responses are bounded to 8 MiB. Enforce rate/connection limits at your proxy; the server has no application rate limiter.
ArcGIS model
const Model = require('./src/model');
const model = new Model({ configPath: 'config/config.json' });
try {
const data = await model.getData({ params: { dataSource: 'default' } });
} finally {
await model.close();
}
Async getData(req) has no callback. It selects req.params.dataSource or the default. Full-fetch remains the default and rejects overflow. Source queryMode pass-through processes the supported req.query subset and returns explicit field metadata, inputCrs, filtersApplied and exceededTransferLimit. CDF owns routes/output projection; certify the adapter in staging.
querySource(name, options) implements the restricted engine; sourceSchema(name, {signal}) discovers and checks mapped fields. queryFeatures(name, {limit, offset, geometry, inSR, signal}) is the diagnostic interface. preflightSource(name, {maxScanRows, expectedSchemaFingerprint, signal}) scans without cache. getData(req) accepts req.signal when the host supplies one. connect(), checkReadiness({signal}), and idempotent close() manage lifecycle.
See operational limits and CLI reports for cancellation, deadline codes and source qualification.
No login/edit/GraphQL/WebSocket/tenant/analytics routes are shipped. The model follows Esri's contract; deployment needs a matching SDK scaffold.