Repository navigation
Description
Task
Modify src/ogc-api/endpoint.ts to remove all CSAPI imports, the CSAPI builder cache, the csapi() method, and extractRootResourceUrls(). Change root and getCollectionDocument from private to public so the factory function (created in Task 5) can access them. After this task, endpoint.ts has zero imports from csapi/.
ROADMAP Reference: Phase 6, Task 6 — Modify endpoint.ts (~0.5–1 hours, Medium complexity)
Implementation Branch: phase-6
Files to Create or Modify
| File | Action | Lines Removed | Lines Added | Net | Purpose |
|---|---|---|---|---|---|
src/ogc-api/endpoint.ts |
Modify | ~65 | ~2 | −63 | Remove CSAPI coupling, change visibility |
Total: 1 file modified, 896 → ~833 lines
Blueprint Reference
src/ogc-api/endpoint.tscurrent state — the file being modified- EDR pattern on endpoint —
hasConnectedSystemsandcsapiCollectionsfollow the same pattern as EDR getters that jahow approved - P6 Implementation Guide §7.1 — Complete modification specification with line references
Scope — What to Implement
Removals (5 items, ~67 lines removed)
| What | Location | Lines |
|---|---|---|
import CSAPIQueryBuilder from './csapi/url_builder.js' |
Line 52 | 1 |
import { scanCsapiLinks } from './csapi/helpers.js' |
Line 53 | 1 |
private collection_id_to_csapi_builder_: Map<...> |
Lines 70–71 | 2 |
csapi() method + JSDoc |
~Lines 363–411 | ~49 |
extractRootResourceUrls() + JSDoc |
~Lines 424–437 | ~14 |
Visibility Changes (2 items, 1-word changes)
| What | Before | After |
|---|---|---|
| Root accessor | private get root() |
public get root() |
| Collection doc method | private getCollectionDocument( |
public getCollectionDocument( |
These are 1-word changes each. The method implementations are completely unchanged.
JSDoc Update (1 item)
| What | Before | After |
|---|---|---|
hasConnectedSystems JSDoc @see |
@see {@link csapi} to create a query builder |
@see Import createCSAPIBuilder from '@camptocamp/ogc-client/csapi' |
What Stays (Confirmed Safe — Zero CSAPI Imports)
hasConnectedSystemsgetter — usesinfo.tscheckHasConnectedSystems()with conformance URI strings only. Zero CSAPI imports.csapiCollectionsgetter — filters collections by link relations. Zero CSAPI imports.- All other endpoint functionality — Features, EDR, Tiles, Records, Maps, Styles, etc. are completely unaffected.
Verification
# Endpoint compiles without errors
npx tsc --noEmit
# Zero CSAPI imports remain in endpoint.ts
git grep "from.*csapi" src/ogc-api/endpoint.ts
# Expected: 0 matches
# All existing tests pass (endpoint tests that remain should still work)
npm run test:browserTesting Requirements
- Run
npm run test:browser— existing endpoint tests forhasConnectedSystemsandcsapiCollectionsmust still pass - The 3 CSAPI method tests (
can produce a CSAPI query builder,caches the CSAPI query builder,throws an error when calling csapi()) will fail after this change — that's expected; they are removed in Task 7 - Run
npx tsc --noEmit— TypeScript must compile cleanly after removals and visibility changes
Scope — What NOT to Touch
- ❌ Do NOT modify
src/index.ts— that belongs to Task 7 - ❌ Do NOT modify
endpoint.spec.ts— that belongs to Task 7 (removes the 3 now-failing tests) - ❌ Do NOT modify
factory.tsorfactory.spec.ts— those were created in Task 5 - ❌ Do NOT modify the barrel file
csapi/index.ts— that was created in Task 4b - ❌ Do NOT modify
package.json— that belongs to Task 8 - ❌ Do NOT remove
hasConnectedSystemsorcsapiCollections— they have zero CSAPI imports and stay on endpoint - ❌ Do NOT modify
info.ts— it has zero CSAPI imports - ❌ Do NOT change any CSAPI business logic (types, builders, parsers, tests)
- ❌ Do NOT refactor existing code beyond the specified removals and visibility changes
Acceptance Criteria
- 2 CSAPI import lines removed (lines 52–53)
- CSAPI builder cache map removed (lines 70–71)
-
csapi()method and its JSDoc removed (~49 lines) -
extractRootResourceUrls()and its JSDoc removed (~14 lines) -
rootaccessor changed fromprivatetopublic -
getCollectionDocumentchanged fromprivatetopublic -
hasConnectedSystemsJSDoc@seeupdated to reference new import path -
git grep "from.*csapi" src/ogc-api/endpoint.tsreturns 0 matches -
npx tsc --noEmitpasses -
hasConnectedSystemsandcsapiCollectionsgetters unchanged and functional -
npm run test:browser— all non-CSAPI-method tests pass (3 CSAPI method tests expected to fail until Task 7)
Dependencies
Blocked by: Task 5 — Create Factory Function (factory must exist as the replacement before the method is removed)
Blocks: Task 7 — Modify index.ts + endpoint.spec.ts (removes old exports and migrated tests)
Operational Constraints
⚠️ MANDATORY: Before starting work on this issue, reviewdocs/governance/AI_OPERATIONAL_CONSTRAINTS.md.For Phase 6 issues: Review the P6 Implementation Guide §7.1 for the complete endpoint modification specification.
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
- Zero business logic changes: Phase 6 touches the integration boundary only
Phase 6 Architectural Constraints
- Factory function replaces
endpoint.csapi(): The method is removed here; its logic now lives infactory.ts(Task 5). hasConnectedSystemsandcsapiCollectionsstay on endpoint: These have zero CSAPI imports. They useinfo.tsfunctions. They follow the EDR pattern that jahow approved.rootandgetCollectionDocumentvisibility change:private→publicis a 1-word change. The methods are unchanged in implementation.- No new dependencies: Zero new imports added to endpoint.ts.
Phase 6 Task-Specific Scope Boundaries
- Task 6 (this task) must NOT modify
index.tsorendpoint.spec.ts— modifiesendpoint.tsonly - Task 5 must NOT modify
endpoint.ts— createsfactory.tsandfactory.spec.tsonly - Task 7 must NOT modify
endpoint.tsorfactory.ts— modifiesindex.tsandendpoint.spec.tsonly
References
Primary References (must read)
| # | Document | What It Provides |
|---|---|---|
| 1 | P6 Implementation Guide §7.1 | Complete removal list, visibility changes, what stays |
| 2 | P6 ROADMAP Task 6 | Task definition, deliverables, dependencies |
| 3 | P6 Contribution Goal | Criteria A3 (zero imports from csapi/ outside csapi/), B1/B2 (hasConnectedSystems/csapiCollections preserved) |
| 4 | Design Decision Resolution Report | Visibility decision, caching removal decision, hasConnectedSystems retention decision |
Convention Quick Reference
| Rule | Example |
|---|---|
| Visibility change | private get root() → public get root() |
| Removal verification | git grep "from.*csapi" src/ogc-api/endpoint.ts → 0 matches |
JSDoc @see update |
@see Import createCSAPIBuilder from '@camptocamp/ogc-client/csapi' |
| Preserve EDR pattern | hasConnectedSystems and csapiCollections stay — zero CSAPI imports |
Activity
refactor(endpoint): remove CSAPI coupling (Issue #122, Task 6)\n\nRem…
Sam-Bolling commentedon Feb 24, 2026
Task 6 Complete — Remove CSAPI Coupling from endpoint.ts
Commit:
20a35d2onphase-6Removals (5 items, 80 lines deleted)
import CSAPIQueryBuilder from './csapi/url_builder.js'import { scanCsapiLinks } from './csapi/helpers.js'collection_id_to_csapi_builder_cache mapcsapi()method + JSDocextractRootResourceUrls()+ JSDocVisibility Changes (2 items)
private get root()public get root()private getCollectionDocument()public getCollectionDocument()JSDoc Update
hasConnectedSystems@see→ referencescreateCSAPIBuilderimport pathPreserved (Zero CSAPI Imports)
hasConnectedSystemsgetter — still functionalcsapiCollectionsgetter — still functionalVerification
npx tsc --noEmit— zero errorsnpx prettier --check— compliantnpx eslint— zero warningsgit grep "^import.*from.*csapi" src/ogc-api/endpoint.ts— 0 matcheshasConnectedSystems+csapiCollectionstests passcsapi()method tests (removed in Task 7, Issue P6 Task 7: Modify index.ts and endpoint.spec.ts — Remove CSAPI Exports and Tests #123)Net change: 892 → 773 lines (−80 deletions, +3 insertions)
Closing.
fix: remove stale `as any` cast and outdated comment in factory.ts\n\…
feat(endpoint): add OgcApiEndpoint.csapi(); reshape createCSAPIBuilde…