Parent Issue
Split from #145 — assertResourceAvailable() + buildResourceUrl() two-line pattern repeated 90 times in url_builder.ts — DRY violation.
This is Part 2 of 3. See also: #158 (Part 1 — build() helper + Systems/Deployments/Procedures) and Part 3 (issue to follow).
Scope — Part 2 Only
Rewrite SamplingFeatures (8) + Properties (6) + Datastreams (11) = 25 methods to delegate to the build() helper created in Part 1 (#158).
Context
Part 1 (#158) created the build() helper and established the pattern by rewriting 33 methods. This part continues the same mechanical transformation for the next 3 resource types.
Methods to Rewrite (25)
SamplingFeatures (8): getSamplingFeatures, getSamplingFeature, createSamplingFeature, updateSamplingFeature, deleteSamplingFeature, getSamplingFeatureSystems, plus others — rewrite from this.buildResourceUrl(...) to this.build(...).
Properties (6): getProperties, getProperty, updateProperty, deleteProperty, getPropertyDataStreams, getPropertyControlStreams — rewrite to this.build(...).
Datastreams (11): getDataStreams, getDataStream, createDataStream, updateDataStream, deleteDataStream, getDataStreamSchema, getDataStreamObservations, createObservation, plus others — rewrite to this.build(...).
Pattern
Same as Part 1. Each method body changes from:
return this.buildResourceUrl('samplingFeatures', id, undefined, options);
to:
return this.build('samplingFeatures', id, undefined, options);
For list/create methods that still have the guard:
// Before:
getSamplingFeatures(options?: QueryOptions): string {
this.assertResourceAvailable('samplingFeatures');
return this.buildResourceUrl('samplingFeatures', undefined, undefined, options);
}
// After:
getSamplingFeatures(options?: QueryOptions): string {
return this.build('samplingFeatures', undefined, undefined, options);
}
File to Modify
| File |
Action |
src/ogc-api/csapi/url_builder.ts |
Rewrite 25 methods to delegate to build() |
What NOT to Touch
Acceptance Criteria (Part 2)
Dependencies
Blocked by: #158 (Part 1 — build() helper must exist)
Blocks: Part 3
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 #145 —
assertResourceAvailable()+buildResourceUrl()two-line pattern repeated 90 times inurl_builder.ts— DRY violation.This is Part 2 of 3. See also: #158 (Part 1 —
build()helper + Systems/Deployments/Procedures) and Part 3 (issue to follow).Scope — Part 2 Only
Rewrite SamplingFeatures (8) + Properties (6) + Datastreams (11) = 25 methods to delegate to the
build()helper created in Part 1 (#158).Context
Part 1 (#158) created the
build()helper and established the pattern by rewriting 33 methods. This part continues the same mechanical transformation for the next 3 resource types.Methods to Rewrite (25)
SamplingFeatures (8):
getSamplingFeatures,getSamplingFeature,createSamplingFeature,updateSamplingFeature,deleteSamplingFeature,getSamplingFeatureSystems, plus others — rewrite fromthis.buildResourceUrl(...)tothis.build(...).Properties (6):
getProperties,getProperty,updateProperty,deleteProperty,getPropertyDataStreams,getPropertyControlStreams— rewrite tothis.build(...).Datastreams (11):
getDataStreams,getDataStream,createDataStream,updateDataStream,deleteDataStream,getDataStreamSchema,getDataStreamObservations,createObservation, plus others — rewrite tothis.build(...).Pattern
Same as Part 1. Each method body changes from:
to:
For list/create methods that still have the guard:
File to Modify
src/ogc-api/csapi/url_builder.tsbuild()What NOT to Touch
build()helper + rewrite Systems, Deployments, Procedures (33 methods) #158)build()helper itself — already created in Part 1url_builder.tsAcceptance Criteria (Part 2)
build()build()build()this.assertResourceAvailable()or directthis.buildResourceUrl()calls remain in these 25 methodstsc --noEmit— zero errorsnpm test— all tests passnpm run lint— zero errorsDependencies
Blocked by: #158 (Part 1 —
build()helper must exist)Blocks: Part 3
References
assertResourceAvailable()+buildResourceUrl()DRY violation (87 methods) → #158 + #159 + #160 #145 — parent issue with full analysisbuild()helper + rewrite Systems, Deployments, Procedures (33 methods) #158 — Part 1 (createsbuild()helper)Operational 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.