Parent Issue
Split from #100 — assertResourceAvailable() is overly strict for per-ID methods — blocks valid URL construction for nested resources.
This is Part 2 of 2. See also: #156 (Part 1 — Systems, Deployments, Procedures, SamplingFeatures).
Scope — Part 2 Only
Remove this.assertResourceAvailable(...) from per-ID methods for the remaining 5 resource types. These are the Part 2 resources + Properties — the group most commonly impacted by the original bug since Part 2 resources (datastreams, observations, controlStreams, commands) are often only available as nested paths under systems.
Resource Types in This Part
| Resource Type |
Per-ID Methods |
List/Create Methods (KEEP assert) |
| Properties |
5 |
1 |
| Datastreams |
9 |
2 |
| Observations |
7 |
1 |
| ControlStreams |
9 |
2 |
| Commands |
9 |
1 |
| Total |
39 |
7 |
File to Modify
| File |
Action |
src/ogc-api/csapi/url_builder.ts |
Remove this.assertResourceAvailable(...) line from 39 per-ID methods |
Pattern
Same as Part 1. Each per-ID method changes from:
getDataStreamSchema(id: string, options?: QueryOptions): string {
this.assertResourceAvailable('datastreams'); // ← Remove this line
return this.buildResourceUrl('datastreams', id, 'schema', options);
}
to:
getDataStreamSchema(id: string, options?: QueryOptions): string {
return this.buildResourceUrl('datastreams', id, 'schema', options);
}
Which Methods to Change (39 deletions)
Properties (5): All methods matching get/update/deleteProperty* that take an id parameter. Examples: getProperty(), updateProperty(), deleteProperty(), getPropertyDataStreams(), getPropertyControlStreams().
Datastreams (9): All methods matching get/update/deleteDataStream* that take an id parameter. Examples: getDataStream(), updateDataStream(), deleteDataStream(), getDataStreamSchema(), getDataStreamObservations(), createObservation(), etc.
Observations (7): All methods matching get/update/deleteObservation* that take an id parameter. Examples: getObservation(), updateObservation(), deleteObservation(), getObservationDatastream(), getObservationSystem(), etc.
ControlStreams (9): All methods matching get/update/deleteControlStream* that take an id parameter. Examples: getControlStream(), updateControlStream(), deleteControlStream(), getControlStreamSchema(), getControlStreamCommands(), createCommand(), etc.
Commands (9): All methods matching get/update/deleteCommand* that take an id parameter. Examples: getCommand(), updateCommand(), deleteCommand(), getCommandStatus(), updateCommandStatus(), getCommandResult(), cancelCommand(), etc.
Which Methods to KEEP Unchanged
All list/create methods (no id parameter) retain their assertResourceAvailable() guard:
getProperties(), getDataStreams(), createDataStream(), getObservations(), getControlStreams(), createControlStream(), getCommands()
What NOT to Touch
Acceptance Criteria (Part 2)
Dependencies
Blocked by: #156 (Part 1 — must be completed first so we don't double-count)
Blocks: #145 (build() wrapper), #102 (nested parent IDs)
References
Operational Constraints
⚠️ MANDATORY: Before starting work on this issue, review docs/governance/AI_OPERATIONAL_CONSTRAINTS.md.
Upstream Isolation Constraint
Per the upstream maintainer's comment on PR #136: url_builder.ts is within src/ogc-api/csapi/ — purely internal to the isolated CSAPI module.
Parent Issue
Split from #100 —
assertResourceAvailable()is overly strict for per-ID methods — blocks valid URL construction for nested resources.This is Part 2 of 2. See also: #156 (Part 1 — Systems, Deployments, Procedures, SamplingFeatures).
Scope — Part 2 Only
Remove
this.assertResourceAvailable(...)from per-ID methods for the remaining 5 resource types. These are the Part 2 resources + Properties — the group most commonly impacted by the original bug since Part 2 resources (datastreams, observations, controlStreams, commands) are often only available as nested paths under systems.Resource Types in This Part
File to Modify
src/ogc-api/csapi/url_builder.tsthis.assertResourceAvailable(...)line from 39 per-ID methodsPattern
Same as Part 1. Each per-ID method changes from:
to:
Which Methods to Change (39 deletions)
Properties (5): All methods matching
get/update/deleteProperty*that take anidparameter. Examples:getProperty(),updateProperty(),deleteProperty(),getPropertyDataStreams(),getPropertyControlStreams().Datastreams (9): All methods matching
get/update/deleteDataStream*that take anidparameter. Examples:getDataStream(),updateDataStream(),deleteDataStream(),getDataStreamSchema(),getDataStreamObservations(),createObservation(), etc.Observations (7): All methods matching
get/update/deleteObservation*that take anidparameter. Examples:getObservation(),updateObservation(),deleteObservation(),getObservationDatastream(),getObservationSystem(), etc.ControlStreams (9): All methods matching
get/update/deleteControlStream*that take anidparameter. Examples:getControlStream(),updateControlStream(),deleteControlStream(),getControlStreamSchema(),getControlStreamCommands(),createCommand(), etc.Commands (9): All methods matching
get/update/deleteCommand*that take anidparameter. Examples:getCommand(),updateCommand(),deleteCommand(),getCommandStatus(),updateCommandStatus(),getCommandResult(),cancelCommand(), etc.Which Methods to KEEP Unchanged
All list/create methods (no
idparameter) retain theirassertResourceAvailable()guard:getProperties(),getDataStreams(),createDataStream(),getObservations(),getControlStreams(),createControlStream(),getCommands()What NOT to Touch
assertResourceAvailablefrom per-ID methods — Systems, Deployments, Procedures, SamplingFeatures (33 methods) #156)idparameter) — keep their guardsassertResourceAvailable()definition itselfbuildResourceUrl()— no changes neededurl_builder.tsAcceptance Criteria (Part 2)
this.assertResourceAvailable(...)calls removed from per-ID methods for Properties, Datastreams, Observations, ControlStreams, CommandsassertResourceAvailable()guardsassertResourceAvailable()calls remain in any per-ID method across all 9 resource typesassertResourceAvailable()calls remain total (all in list/create methods)tsc --noEmit— zero errorsnpm test— all tests passnpm run lint— zero errorsDependencies
Blocked by: #156 (Part 1 — must be completed first so we don't double-count)
Blocks: #145 (build() wrapper), #102 (nested parent IDs)
References
assertResourceAvailablefrom per-ID methods — Systems, Deployments, Procedures, SamplingFeatures (33 methods) #156 — Part 1 (Systems, Deployments, Procedures, SamplingFeatures)CSAPIQueryBuilder.assertResourceAvailable():url_builder.ts~L320–327buildResourceUrl()fallback behavior:url_builder.ts~L256–273Operational Constraints
Upstream Isolation Constraint
Per the upstream maintainer's comment on PR #136:
url_builder.tsis withinsrc/ogc-api/csapi/— purely internal to the isolated CSAPI module.