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.ts current state — the file being modified
- EDR pattern on endpoint —
hasConnectedSystems and csapiCollections follow 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)
hasConnectedSystems getter — uses info.ts checkHasConnectedSystems() with conformance URI strings only. Zero CSAPI imports.
csapiCollections getter — 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:browser
Testing Requirements
- Run
npm run test:browser — existing endpoint tests for hasConnectedSystems and csapiCollections must 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.ts or factory.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
hasConnectedSystems or csapiCollections — 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
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, review docs/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 in factory.ts (Task 5).
hasConnectedSystems and csapiCollections stay on endpoint: These have zero CSAPI imports. They use info.ts functions. They follow the EDR pattern that jahow approved.
root and getCollectionDocument visibility change: private → public is 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.ts or endpoint.spec.ts — modifies endpoint.ts only
- Task 5 must NOT modify
endpoint.ts — creates factory.ts and factory.spec.ts only
- Task 7 must NOT modify
endpoint.ts or factory.ts — modifies index.ts and endpoint.spec.ts only
References
Primary References (must read)
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 |
Task
Modify
src/ogc-api/endpoint.tsto remove all CSAPI imports, the CSAPI builder cache, thecsapi()method, andextractRootResourceUrls(). ChangerootandgetCollectionDocumentfromprivatetopublicso the factory function (created in Task 5) can access them. After this task,endpoint.tshas zero imports fromcsapi/.ROADMAP Reference: Phase 6, Task 6 — Modify
endpoint.ts(~0.5–1 hours, Medium complexity)Implementation Branch:
phase-6Files to Create or Modify
src/ogc-api/endpoint.tsTotal: 1 file modified, 896 → ~833 lines
Blueprint Reference
src/ogc-api/endpoint.tscurrent state — the file being modifiedhasConnectedSystemsandcsapiCollectionsfollow the same pattern as EDR getters that jahow approvedScope — What to Implement
Removals (5 items, ~67 lines removed)
import CSAPIQueryBuilder from './csapi/url_builder.js'import { scanCsapiLinks } from './csapi/helpers.js'private collection_id_to_csapi_builder_: Map<...>csapi()method + JSDocextractRootResourceUrls()+ JSDocVisibility Changes (2 items, 1-word changes)
private get root()public get root()private getCollectionDocument(public getCollectionDocument(These are 1-word changes each. The method implementations are completely unchanged.
JSDoc Update (1 item)
hasConnectedSystemsJSDoc@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.Verification
Testing Requirements
npm run test:browser— existing endpoint tests forhasConnectedSystemsandcsapiCollectionsmust still passcan 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 7npx tsc --noEmit— TypeScript must compile cleanly after removals and visibility changesScope — What NOT to Touch
src/index.ts— that belongs to Task 7endpoint.spec.ts— that belongs to Task 7 (removes the 3 now-failing tests)factory.tsorfactory.spec.ts— those were created in Task 5csapi/index.ts— that was created in Task 4bpackage.json— that belongs to Task 8hasConnectedSystemsorcsapiCollections— they have zero CSAPI imports and stay on endpointinfo.ts— it has zero CSAPI importsAcceptance Criteria
csapi()method and its JSDoc removed (~49 lines)extractRootResourceUrls()and its JSDoc removed (~14 lines)rootaccessor changed fromprivatetopublicgetCollectionDocumentchanged fromprivatetopublichasConnectedSystemsJSDoc@seeupdated to reference new import pathgit grep "from.*csapi" src/ogc-api/endpoint.tsreturns 0 matchesnpx tsc --noEmitpasseshasConnectedSystemsandcsapiCollectionsgetters unchanged and functionalnpm 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
Key constraints for this task:
Phase 6 Architectural Constraints
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.Phase 6 Task-Specific Scope Boundaries
index.tsorendpoint.spec.ts— modifiesendpoint.tsonlyendpoint.ts— createsfactory.tsandfactory.spec.tsonlyendpoint.tsorfactory.ts— modifiesindex.tsandendpoint.spec.tsonlyReferences
Primary References (must read)
Convention Quick Reference
private get root()→public get root()git grep "from.*csapi" src/ogc-api/endpoint.ts→ 0 matches@seeupdate@see Import createCSAPIBuilder from '@camptocamp/ogc-client/csapi'hasConnectedSystemsandcsapiCollectionsstay — zero CSAPI imports