Task
Implement all 8 Procedures methods in url_builder.ts and add Procedures method tests to url_builder.spec.ts. Procedures is the third Phase 2 resource type and follows the pattern established by Systems (Issue #5 ) and Deployments (Issue #6 ).
ROADMAP Reference: Phase 2, Task 3 — Procedures Methods (~1.5–2 hours implementation + ~0.5 hour testing, Medium complexity)
Files to Create or Modify
File
Action
Est. Lines
Purpose
src/ogc-api/csapi/url_builder.ts
Modify
~50–70 added
Add 8 Procedures methods with resource validation
src/ogc-api/csapi/url_builder.spec.ts
Modify
~30–40 added
Add Procedures method tests
Blueprint Reference
Follow the Systems methods pattern established in Issue #5 (same file). Also reference the EDR pattern in src/ogc-api/edr/url_builder.ts (562 lines) for resource validation, URL construction, and query parameter appending.
Scope — What to Implement
8 Procedures 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:
getProcedures(options?: ProcedureQueryOptions): string — GET /procedures with pagination, filtering, sorting
Single resource:
getProcedure(id: string, options?): string — GET /procedures/{id}
CRUD operations:
createProcedure(body: object): string — POST /procedures
updateProcedure(id: string, body: object): string — PUT /procedures/{id}
deleteProcedure(id: string): string — DELETE /procedures/{id}
Association links:
getProcedureSystems(id: string, options?): string — GET /procedures/{id}/systems (systems using this procedure)
getProcedureDataStreams(id: string, options?): string — GET /procedures/{id}/datastreams (Part 2 cross-reference)
History:
getProcedureHistory(id: string, options?): string — GET /procedures/{id}/history
Procedures Query Parameters
Procedures support: system, id, uid, q, property filters, limit, offset, f, sortBy, sortOrder.
All parameters are serialised by the shared buildQueryString() helper (Issue #3 ). Note: Procedures do not support bbox, datetime, or any Part 2 temporal parameters (see Guide §6 temporal applicability matrix).
JSDoc Requirements
Document each method with @param for all parameters, @returns description, and usage example
Add @see links to OGC CSAPI Part 1 specification sections for Procedures endpoints
Follow the JSDoc style in src/ogc-api/edr/url_builder.ts and the Systems methods from Issue Phase 2.1: Systems Methods #5
Testing Requirements
Extend src/ogc-api/csapi/url_builder.spec.ts (~30–40 lines)
Test getProcedures collection query and getProcedure individual retrieval
Test CRUD operations (createProcedure, updateProcedure, deleteProcedure) produce correct URLs
Test system and datastream association methods (getProcedureSystems, getProcedureDataStreams)
Test resource validation — calling any Procedures method when procedures is not in availableResources throws an error
Follow test patterns from Systems tests (Issue Phase 2.1: Systems Methods #5 ) and src/ogc-api/edr/url_builder.spec.ts
Scope — What NOT to Touch
❌ Do NOT implement Systems, Deployments, Sampling Features, Properties, DataStreams, Observations, Control Streams, or Commands methods — Systems belongs to Issue Phase 2.1: Systems Methods #5 , Deployments to Issue Phase 2.2: Deployments Methods #6 , the rest to Issues Phase 2.4: Sampling Features Methods #8 –Phase 2.9: Commands Methods #13
❌ Do NOT modify model.ts — type definitions belong to Issue Phase 1.1: Create Type System (csapi/model.ts) #1
❌ Do NOT modify helpers.ts — helper utilities belong to Issue Phase 1.2: Create Helper Utilities (csapi/helpers.ts) #2
❌ Do NOT modify the constructor, buildResourceUrl(), buildQueryString(), extractAvailableResources(), or availableResources — those belong to Issue Phase 1.3: Create Stub QueryBuilder (csapi/url_builder.ts) #3
❌ Do NOT modify endpoint.ts, info.ts, or src/index.ts — integration belongs to Issue Phase 1.4: Integrate with OgcApiEndpoint #4
❌ Do NOT modify Systems or Deployments methods — those belong to Issues Phase 2.1: Systems Methods #5 and Phase 2.2: Deployments Methods #6
❌ Do NOT modify files outside the "Files to Create or Modify" table above
❌ Do NOT refactor existing code unless required to complete this task
Acceptance Criteria
Dependencies
Blocked by: Issue #1 (Type System — provides ProcedureQueryOptions and 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)
Blocks: Issues #8 –#13 (subsequent resource type methods)
Operational Constraints
⚠️ MANDATORY: Before starting work on this issue, review docs/governance/AI_OPERATIONAL_CONSTRAINTS.md .
Key constraints for this task:
Precedence: OGC specifications → AI Collaboration Agreement → This issue description → Existing code → Conversational context
No scope expansion: Do not infer unstated requirements or add unrequested features
No refactoring: Do not rename, restructure, or "improve" code outside this issue's scope
Minimal diffs: Prefer the smallest change that satisfies the acceptance criteria
Ask when unclear: If intent is ambiguous, stop and ask for clarification
References
Read these documents before starting implementation. They are ordered by priority.
Primary References (must read)
#
Document
Section/Lines
What It Provides
1
docs/planning/csapi-implementation-guide.md
§6 Procedures Resource Methods (lines 1448–1493)
Full CRUD operations, query parameters, relationship management, SensorML format notes
2
docs/planning/csapi-implementation-guide.md
§6 Complete Query Parameter Support (lines 1921–2000)
All query parameters with types, applicability, encoding rules
3
docs/planning/csapi-implementation-guide.md
§6 Query Parameters and Code Reuse (lines 720–900)
Parameter distribution analysis, temporal applicability matrix showing Procedures has no temporal params
4
src/ogc-api/edr/url_builder.ts
Full file (562 lines)
Blueprint: method structure, resource validation, URL construction pattern
5
src/ogc-api/edr/url_builder.spec.ts
Full file
Blueprint: test patterns for URL builder methods
6
docs/planning/ROADMAP.md
Phase 2, Task 3 (lines 188–204)
Authoritative task definition, method list, test requirements
Upstream Type/Import References (files this task imports from)
#
Document
What to Import
7
src/ogc-api/csapi/model.ts
ProcedureQueryOptions, CSAPIResourceType (created by Issue #1 )
8
src/ogc-api/csapi/helpers.ts
Encoding helpers: encodeArray (created by Issue #2 )
Research References (context, not required reading)
#
Document
What It Provides
9
docs/research/requirements/csapi-part1-requirements.md
Detailed client implementation requirements for Procedures including SensorML support
10
docs/research/requirements/csapi-query-parameters.md
Complete catalog of all CSAPI query parameters
Specification References (for @see links and field accuracy)
Convention Quick Reference
Rule
Example
Use .js extension for relative imports
import { X } from './file.js'
Use import type for interfaces/types
import type { Y } from './model.js'
Three-tier hierarchy: import from lower tiers only
shared → ogc-api → csapi
Named exports for types and utilities
export interface Z { ... }
as const arrays for enum-like values
export const XTypes = [...] as const
HTTP mocking: globalThis.fetch = jest.fn()
Never use nock, msw, or other libraries
Meaningful tests only
Verify behavior, not that code runs without throwing
Task
Implement all 8 Procedures methods in
url_builder.tsand add Procedures method tests tourl_builder.spec.ts. Procedures is the third Phase 2 resource type and follows the pattern established by Systems (Issue #5) and Deployments (Issue #6).ROADMAP Reference: Phase 2, Task 3 — Procedures Methods (~1.5–2 hours implementation + ~0.5 hour testing, Medium complexity)
Files to Create or Modify
src/ogc-api/csapi/url_builder.tssrc/ogc-api/csapi/url_builder.spec.tsBlueprint Reference
Follow the Systems methods pattern established in Issue #5 (same file). Also reference the EDR pattern in
src/ogc-api/edr/url_builder.ts(562 lines) for resource validation, URL construction, and query parameter appending.Scope — What to Implement
8 Procedures 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:
getProcedures(options?: ProcedureQueryOptions): string—GET /procedureswith pagination, filtering, sortingSingle resource:
getProcedure(id: string, options?): string—GET /procedures/{id}CRUD operations:
createProcedure(body: object): string—POST /proceduresupdateProcedure(id: string, body: object): string—PUT /procedures/{id}deleteProcedure(id: string): string—DELETE /procedures/{id}Association links:
getProcedureSystems(id: string, options?): string—GET /procedures/{id}/systems(systems using this procedure)getProcedureDataStreams(id: string, options?): string—GET /procedures/{id}/datastreams(Part 2 cross-reference)History:
getProcedureHistory(id: string, options?): string—GET /procedures/{id}/historyProcedures Query Parameters
Procedures support:
system,id,uid,q, property filters,limit,offset,f,sortBy,sortOrder.All parameters are serialised by the shared
buildQueryString()helper (Issue #3). Note: Procedures do not supportbbox,datetime, or any Part 2 temporal parameters (see Guide §6 temporal applicability matrix).JSDoc Requirements
@paramfor all parameters,@returnsdescription, and usage example@seelinks to OGC CSAPI Part 1 specification sections for Procedures endpointssrc/ogc-api/edr/url_builder.tsand the Systems methods from Issue Phase 2.1: Systems Methods #5Testing Requirements
src/ogc-api/csapi/url_builder.spec.ts(~30–40 lines)getProcedurescollection query andgetProcedureindividual retrievalcreateProcedure,updateProcedure,deleteProcedure) produce correct URLsgetProcedureSystems,getProcedureDataStreams)proceduresis 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 Procedures methods listed abovebuildResourceUrl()andbuildQueryString()helpers@param,@returns,@seeurl_builder.spec.tscontains Procedures tests covering collection/individual retrieval, CRUD, system/datastream associations, and resource validation (~30–40 lines)npm test)Dependencies
Blocked by: Issue #1 (Type System — provides
ProcedureQueryOptionsand 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)Blocks: Issues #8–#13 (subsequent resource type methods)
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.tsProcedureQueryOptions,CSAPIResourceType(created by Issue #1)src/ogc-api/csapi/helpers.tsencodeArray(created by Issue #2)Research References (context, not required reading)
docs/research/requirements/csapi-part1-requirements.mddocs/research/requirements/csapi-query-parameters.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()