You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Implement all 8 Control Streams methods in url_builder.ts and add Control Streams method tests to url_builder.spec.ts. Control Streams is the eighth Phase 2 resource type and mirrors the DataStreams pattern (Issue #10) but for control/actuation rather than observation/sensing. It introduces the cmdFormat parameter and feasibility checking.
Add 8 Control Streams methods with resource validation
src/ogc-api/csapi/url_builder.spec.ts
Modify
~30–40 added
Add Control Streams method tests
Blueprint Reference
Follow the DataStreams methods pattern from Issue #10 (same file) — Control Streams is architecturally parallel to DataStreams. Also reference the EDR pattern in src/ogc-api/edr/url_builder.ts (562 lines) for resource validation and URL construction. The schema endpoint uses cmdFormat (analogous to obsFormat for DataStreams) and feasibility checking is a new pattern.
Scope — What to Implement
8 Control Streams Methods
Each method validates resource availability (~2 lines), builds a URL using buildResourceUrl(), appends query parameters using buildQueryString(), and returns the constructed URL string.
Collection query:
getControlStreams(options?: ControlStreamQueryOptions): string — GET /controlstreams with pagination, filtering, sorting
Single resource:
getControlStream(id: string, options?): string — GET /controlstreams/{id}
CRUD operations:
createControlStream(body: object): string — POST /controlstreams
updateControlStream(id: string, body: object): string — PUT /controlstreams/{id}
getControlStreamSchema(id: string, options?): string — GET /controlstreams/{id}/schema (note: cmdFormat parameter is required per Part 2, Req 25; omitting it returns 400)
Command sub-resource:
getControlStreamCommands(id: string, options?): string — GET /controlstreams/{id}/commands
Feasibility checking:
checkCommandFeasibility(controlStreamId: string, body: object): string — POST /controlstreams/{controlStreamId}/feasibility (tests whether a command can be executed before submitting)
Control Streams Query Parameters
Control Streams support: system, controlledProperty, datetime, executionTime, issueTime, id, uid, q, property filters, limit, offset, f, sortBy, sortOrder.
All parameters are serialised by the shared buildQueryString() helper (Issue #3). Temporal support per the Guide §6 temporal applicability matrix: datetime (validTime), executionTime, issueTime. No phenomenonTime or resultTime.
Note: The getControlStreamCommands sub-resource supports the Commands temporal parameters (issueTime, executionTime) and cursor-based pagination (cursor).
JSDoc Requirements
Document each method with @param for all parameters, @returns description, and usage example
Add @see links to OGC CSAPI Part 2 specification sections for Control Streams endpoints
Document the cmdFormat requirement on getControlStreamSchema
Document feasibility checking pattern for checkCommandFeasibility
Task
Implement all 8 Control Streams methods in
url_builder.tsand add Control Streams method tests tourl_builder.spec.ts. Control Streams is the eighth Phase 2 resource type and mirrors the DataStreams pattern (Issue #10) but for control/actuation rather than observation/sensing. It introduces thecmdFormatparameter and feasibility checking.ROADMAP Reference: Phase 2, Task 8 — Control Streams Methods (~1.5–2 hours implementation + ~0.5 hour testing, Medium-High complexity)
Files to Create or Modify
src/ogc-api/csapi/url_builder.tssrc/ogc-api/csapi/url_builder.spec.tsBlueprint Reference
Follow the DataStreams methods pattern from Issue #10 (same file) — Control Streams is architecturally parallel to DataStreams. Also reference the EDR pattern in
src/ogc-api/edr/url_builder.ts(562 lines) for resource validation and URL construction. The schema endpoint usescmdFormat(analogous toobsFormatfor DataStreams) and feasibility checking is a new pattern.Scope — What to Implement
8 Control Streams Methods
Each method validates resource availability (~2 lines), builds a URL using
buildResourceUrl(), appends query parameters usingbuildQueryString(), and returns the constructed URL string.Collection query:
getControlStreams(options?: ControlStreamQueryOptions): string—GET /controlstreamswith pagination, filtering, sortingSingle resource:
getControlStream(id: string, options?): string—GET /controlstreams/{id}CRUD operations:
createControlStream(body: object): string—POST /controlstreamsupdateControlStream(id: string, body: object): string—PUT /controlstreams/{id}deleteControlStream(id: string): string—DELETE /controlstreams/{id}Schema retrieval:
getControlStreamSchema(id: string, options?): string—GET /controlstreams/{id}/schema(note:cmdFormatparameter is required per Part 2, Req 25; omitting it returns 400)Command sub-resource:
getControlStreamCommands(id: string, options?): string—GET /controlstreams/{id}/commandsFeasibility checking:
checkCommandFeasibility(controlStreamId: string, body: object): string—POST /controlstreams/{controlStreamId}/feasibility(tests whether a command can be executed before submitting)Control Streams Query Parameters
Control Streams support:
system,controlledProperty,datetime,executionTime,issueTime,id,uid,q, property filters,limit,offset,f,sortBy,sortOrder.All parameters are serialised by the shared
buildQueryString()helper (Issue #3). Temporal support per the Guide §6 temporal applicability matrix:datetime(validTime),executionTime,issueTime. NophenomenonTimeorresultTime.Note: The
getControlStreamCommandssub-resource supports the Commands temporal parameters (issueTime,executionTime) and cursor-based pagination (cursor).JSDoc Requirements
@paramfor all parameters,@returnsdescription, and usage example@seelinks to OGC CSAPI Part 2 specification sections for Control Streams endpointscmdFormatrequirement ongetControlStreamSchemacheckCommandFeasibilitysrc/ogc-api/edr/url_builder.tsand the DataStreams methods from Issue Phase 2.6: DataStreams Methods #10Testing Requirements
src/ogc-api/csapi/url_builder.spec.ts(~30–40 lines)getControlStreamSchemawithcmdFormatparameter)checkCommandFeasibilityproduces correct URL)getControlStreamCommands)controlstreamsis not inavailableResourcesthrows an errorsrc/ogc-api/edr/url_builder.spec.tsScope — What NOT to Touch
model.ts— type definitions belong to Issue Phase 1.1: Create Type System (csapi/model.ts) #1helpers.ts— helper utilities belong to Issue Phase 1.2: Create Helper Utilities (csapi/helpers.ts) #2buildResourceUrl(),buildQueryString(),extractAvailableResources(), oravailableResources— those belong to Issue Phase 1.3: Create Stub QueryBuilder (csapi/url_builder.ts) #3endpoint.ts,info.ts, orsrc/index.ts— integration belongs to Issue Phase 1.4: Integrate with OgcApiEndpoint #4Acceptance Criteria
url_builder.tscontains all 8 Control Streams methods listed abovebuildResourceUrl()andbuildQueryString()helpersgetControlStreamSchemacorrectly includes thecmdFormatparametercheckCommandFeasibilitycorrectly routes to/controlstreams/{id}/feasibility@param,@returns,@seeurl_builder.spec.tscontains Control Streams tests covering schema retrieval, feasibility checking, command listing, CRUD, and resource validation (~30–40 lines)npm test)Dependencies
Blocked by: Issue #1 (Type System — provides
ControlStreamQueryOptionsand resource types), Issue #2 (Helper Utilities — provides encoding helpers), Issue #3 (Stub QueryBuilder — provides constructor,buildResourceUrl,buildQueryString,availableResources), Issue #5 (Systems Methods — establishes the pattern), Issue #10 (DataStreams Methods — architectural mirror)Blocks: Issue #13 (Commands Methods — commands flow through control streams)
Operational Constraints
Key constraints for this task:
References
Read these documents before starting implementation. They are ordered by priority.
Primary References (must read)
docs/planning/csapi-implementation-guide.mddocs/planning/csapi-implementation-guide.mddocs/planning/csapi-implementation-guide.mdsrc/ogc-api/edr/url_builder.tssrc/ogc-api/edr/url_builder.spec.tsdocs/planning/ROADMAP.mdUpstream Type/Import References (files this task imports from)
src/ogc-api/csapi/model.tsControlStreamQueryOptions,CSAPIResourceType(created by Issue #1)src/ogc-api/csapi/helpers.tsencodeDateTime,encodeArray(created by Issue #2)Research References (context, not required reading)
docs/research/requirements/csapi-part2-requirements.mddocs/research/requirements/csapi-query-parameters.mddocs/research/upstream/pr114-analysis.mdSpecification References (for
@seelinks and field accuracy)Convention Quick Reference
.jsextension for relative importsimport { X } from './file.js'import typefor interfaces/typesimport type { Y } from './model.js'export interface Z { ... }as constarrays for enum-like valuesexport const XTypes = [...] as constglobalThis.fetch = jest.fn()