Repository navigation
Description
Task
Add 7 missing spec-normative query option fields to 4 Part 2 QueryOptions interfaces and create the CommandStatusQueryOptions interface with its statusCode field, plus update getCommandStatus() to accept optional query options.
Finding Reference: Demo app finding from ogc-csapi-explorer#35
Severity: Low
Category: Design gap
Ownership: Ours
Problem Statement
The Part 2 QueryOptions interfaces in model.ts are missing optional filter fields that are normatively defined in OGC 23-002 §13 (Advanced Filtering). Callers cannot use type-safe filtering for foi, issueTime, executionTime, sender, or statusCode on the affected resource endpoints without type assertions.
This is not a runtime bug — buildQueryString() serializes arbitrary key-value pairs, so callers can work around the gaps via type assertion. The gap is purely in TypeScript type safety and discoverability.
Evidence:
During ogc-csapi-explorer#35, implementing query filter panels in the explorer demo app required filtering Part 2 resources by feature-of-interest, temporal ranges, and command sender. The TypeScript interfaces did not expose these fields:
| Interface | Missing Field | OGC 23-002 Requirement |
|---|---|---|
ControlStreamQueryOptions |
issueTime |
§13.4.1 Req 52 |
ControlStreamQueryOptions |
executionTime |
§13.4.2 Req 53 |
ControlStreamQueryOptions |
foiId |
§13.4.4 Req 55 |
DatastreamQueryOptions |
foiId |
§13.2.4 Req 48 |
ObservationQueryOptions |
foiId |
§13.3.3 Req 51 |
CommandQueryOptions |
sender |
§13.5.4 Req 59 |
CommandQueryOptions |
foiId |
§13.5.5 Req 60 |
CommandStatusQueryOptions (new) |
statusCode |
§13.6.1 Req 61 |
Impact: Callers lack type-safe access to 7 spec-normative query parameters. The getCommandStatus() method cannot accept any filtering options at all — no way to pass statusCode or even the base datetime/limit parameters.
Files to Create or Modify
| File | Action | Est. Lines | Purpose |
|---|---|---|---|
src/ogc-api/csapi/model.ts |
Modify | ~15 | Add optional fields to 4 interfaces + create CommandStatusQueryOptions |
src/ogc-api/csapi/url_builder.ts |
Modify | ~5 | Update getCommandStatus() to accept optional query options, import new type |
src/ogc-api/csapi/url_builder.spec.ts |
Modify | ~40 | Add tests for new query option fields |
src/index.ts |
Modify | ~1 | Export CommandStatusQueryOptions type |
Proposed Fix
All changes are additive:
-
model.ts — Add optional fields to existing interfaces:
ControlStreamQueryOptions: addissueTime?: DateTimeParameter,executionTime?: DateTimeParameter,foiId?: stringDatastreamQueryOptions: addfoiId?: stringObservationQueryOptions: addfoiId?: stringCommandQueryOptions: addsender?: string,foiId?: string
-
model.ts — Create new interface:
export interface CommandStatusQueryOptions extends QueryOptions { statusCode?: CommandStatusCode; }
-
url_builder.ts — Update method signature:
getCommandStatus(id: string, options?: CommandStatusQueryOptions): string
-
Naming convention: Use
foiId(notfoi) for consistency with Part 1'sSystemQueryOptions.foiId. The existingPARAM_NAME_MAPentry (foiId → foi) handles wire serialization.
Scope — What NOT to Touch
- ❌ Do NOT add
dataStreamtoObservationQueryOptions— not a spec-defined query parameter in §13.3. The nested endpointgetDataStreamObservations()is the spec-intended approach. - ❌ Do NOT add
controlStreamtoCommandQueryOptions— not a spec-defined query parameter in §13.5. The nested endpointgetControlStreamCommands()is the spec-intended approach. - ❌ Do NOT add
reportTimetoCommandStatusQueryOptions— not a named query parameter in §13.6. The basedatetimeparameter (already inQueryOptions) serves this purpose. - ❌ Do NOT modify
buildQueryString()— no new serialization logic needed - ❌ Do NOT modify
PARAM_NAME_MAPorTEMPORAL_KEYS— already configured correctly - ❌ Do NOT modify files outside the "Files to Create or Modify" table above
- ❌ Do NOT refactor existing code
Acceptance Criteria
-
ControlStreamQueryOptionshasissueTime,executionTime,foiIdoptional fields -
DatastreamQueryOptionshasfoiIdoptional field -
ObservationQueryOptionshasfoiIdoptional field -
CommandQueryOptionshassender,foiIdoptional fields -
CommandStatusQueryOptionsinterface exists withstatusCodeoptional field -
getCommandStatus()accepts optionalCommandStatusQueryOptionsparameter -
CommandStatusQueryOptionsis exported fromsrc/index.ts - All new fields have JSDoc comments with
@seelinks to OGC 23-002 §13 - Unit tests verify serialization of all new fields
- Existing tests still pass (
npm test) - No lint errors
Dependencies
Blocked by: #105 — Query parameter name mismatches (Resolved ✅)
Blocks: Nothing
Operational Constraints
⚠️ MANDATORY: Before starting work on this issue, review
docs/governance/AI_OPERATIONAL_CONSTRAINTS.md.
Key constraints:
- Precedence: OGC specifications → AI Collaboration Agreement → This issue description → Existing code → Conversational context
- No scope expansion: Fix the finding, nothing more
- Minimal diffs: Prefer the smallest change that satisfies the acceptance criteria
- Ask when unclear: If intent is ambiguous, stop and ask for clarification
References
| # | Document | What It Provides |
|---|---|---|
| 1 | Findings Report | Full gap-by-gap analysis, spec verification, risk assessment, naming decision |
| 2 | OGC 23-002 §13 — Advanced Filtering | Normative query parameter definitions |
| 3 | src/ogc-api/csapi/model.ts |
Interfaces to modify |
| 4 | src/ogc-api/csapi/url_builder.ts |
getCommandStatus() method to update |
| 5 | Issue #105 — Query parameter name mismatches | PARAM_NAME_MAP and TEMPORAL_KEYS already support all new fields |
| 6 | ogc-csapi-explorer#35 | Demo app finding that discovered the gaps |
Activity
docs: add findings report for Issue #106 — missing Part 2 query optio…
docs: add Phase 5.5 code review (Issues #99-#110 post-smoke-test)
Add missing Part 2 query option fields (Fixes OS4CSAPI#106)
merge: sync with upstream ogc-client-CSAPI_2 (Phase 5.5/5.6)