Skip to content

#100 Part 2: Remove assertResourceAvailable from per-ID methods — Properties, Datastreams, Observations, ControlStreams, Commands (39 methods) #157

@Sam-Bolling

Description

@Sam-Bolling

Parent Issue

Split from #100assertResourceAvailable() 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)

  • 39 this.assertResourceAvailable(...) calls removed from per-ID methods for Properties, Datastreams, Observations, ControlStreams, Commands
  • 7 list/create methods for these 5 types still have their assertResourceAvailable() guards
  • Combined with Part 1: zero assertResourceAvailable() calls remain in any per-ID method across all 9 resource types
  • Only 15 assertResourceAvailable() calls remain total (all in list/create methods)
  • tsc --noEmit — zero errors
  • npm test — all tests pass
  • npm run lint — zero errors

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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions