Repository navigation
Description
Task
Modify two files: (1) Remove all ~183 lines of CSAPI exports from src/index.ts (lines 45–227), and (2) Remove 3 CSAPI method tests from src/ogc-api/endpoint.spec.ts that were migrated to factory.spec.ts or are obsolete. After this task, index.ts has zero CSAPI references and the endpoint test suite reflects the new architecture.
ROADMAP Reference: Phase 6, Task 7 — Modify index.ts and endpoint.spec.ts (~0.5 hours, Low complexity)
Implementation Branch: phase-6
Files to Create or Modify
| File | Action | Lines Removed | Lines Added | Net | Purpose |
|---|---|---|---|---|---|
src/index.ts |
Modify | ~183 | 0 | −183 | Remove all CSAPI export lines |
src/ogc-api/endpoint.spec.ts |
Modify | ~30 | 0 | −30 | Remove 3 migrated/obsolete CSAPI tests |
Total: 2 files modified, ~213 lines removed, 0 lines added
Blueprint Reference
src/index.tscurrent state (252 lines) — lines 45–227 are the CSAPI exports being removedsrc/ogc-api/endpoint.spec.tscurrent state (2,888 lines) — CSAPI test block at lines 2836–2887- P6 Implementation Guide §7.2 — Complete
index.tsmodification specification - P6 Implementation Guide §7.3 — Complete
endpoint.spec.tsmodification specification with test disposition table
Scope — What to Implement
index.ts — Remove CSAPI Exports
Remove all CSAPI export lines (lines 45–227). These are all re-export statements (export { ... } from '...'), not import statements — removal creates no unused imports.
What stays:
- Lines 1–43: WFS, WMS, WMTS, shared model exports
- Line 44:
export * from './ogc-api/model.js'(OGC API shared types — NOT CSAPI) - Lines 228+: TMS, STAC, cache, shared utilities, worker exports (renumbered after removal)
Result: src/index.ts shrinks from 252 lines to ~69 lines.
Verification:
git grep "csapi\|CSAPI" src/index.ts
# Expected: 0 matchesendpoint.spec.ts — Remove 3 Tests
Remove 3 tests from the CSAPI block (lines 2836–2887). The remaining 3 tests stay.
Test disposition (6 tests in the CSAPI block):
| Test | Line | Decision | Reason |
|---|---|---|---|
detects Connected Systems support |
2845 | Stays | Tests hasConnectedSystems (still on endpoint) |
can list all CSAPI collections |
2849 | Stays | Tests csapiCollections (still on endpoint) |
can produce a CSAPI query builder |
2854 | Remove | Migrated to factory.spec.ts (Task 5) |
caches the CSAPI query builder |
2862 | Remove | No auto-caching in factory — behavior no longer exists |
reports no Connected Systems support |
2877 | Stays | Tests non-CSAPI endpoint |
throws an error when calling csapi() |
2881 | Remove | Migrated to factory.spec.ts (Task 5) |
Remaining CSAPI block in endpoint.spec.ts (3 tests):
describe('OgcApiEndpoint with CSAPI', () => {
let endpoint: OgcApiEndpoint;
describe('nominal case', () => {
beforeEach(() => {
endpoint = new OgcApiEndpoint('http://local/csapi/sample-data-hub');
});
it('detects Connected Systems support', async () => {
await expect(endpoint.hasConnectedSystems).resolves.toBe(true);
});
it('can list all CSAPI collections', async () => {
await expect(endpoint.csapiCollections).resolves.toEqual([
'iot-sensors',
]);
});
});
describe('non-CSAPI endpoint', () => {
beforeEach(() => {
endpoint = new OgcApiEndpoint('http://local/sample-data/');
});
it('reports no Connected Systems support', async () => {
await expect(endpoint.hasConnectedSystems).resolves.toBe(false);
});
});
});Verification
# Zero CSAPI references in index.ts
git grep "csapi\|CSAPI" src/index.ts
# Expected: 0 matches
# TypeScript compiles cleanly
npx tsc --noEmit
# All tests pass (including the 3 remaining endpoint CSAPI tests + 2 factory tests)
npm run test:browser
# ESLint passes
npx eslint src/index.ts src/ogc-api/endpoint.spec.tsTesting Requirements
npm run test:browsermust pass with all tests — the 3 removed tests should no longer appear- The 3 remaining endpoint CSAPI tests must still pass (
hasConnectedSystems,csapiCollections, non-CSAPI endpoint) - The 2 factory tests (Task 5) must still pass
- Total test count should decrease by exactly 3
Scope — What NOT to Touch
- ❌ Do NOT modify
endpoint.ts— that was done in Task 6 - ❌ 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 the
hasConnectedSystemsorcsapiCollectionstests — those test endpoint functionality that remains - ❌ Do NOT modify lines 1–44 or lines 228+ of
index.ts— only remove lines 45–227 - ❌ Do NOT change any CSAPI business logic (types, builders, parsers)
- ❌ Do NOT refactor existing code beyond the specified removals
Acceptance Criteria
-
src/index.tsreduced from ~252 to ~69 lines - All CSAPI export lines (45–227) removed from
index.ts -
git grep "csapi\|CSAPI" src/index.tsreturns 0 matches - Non-CSAPI exports in
index.ts(WFS, WMS, WMTS, TMS, STAC, shared, cache, worker) are unchanged - 3 CSAPI method tests removed from
endpoint.spec.ts - 3 CSAPI endpoint tests remain (
hasConnectedSystems,csapiCollections, non-CSAPI) -
npx tsc --noEmitpasses -
npm run test:browserpasses — all remaining tests pass, total count decreased by 3 -
npx eslint src/index.ts src/ogc-api/endpoint.spec.tspasses
Dependencies
Blocked by: Task 6 — Modify endpoint.ts (CSAPI method removed first, then tests referencing it are removed here)
Blocks: Task 8 — Modify package.json, Task 9 — Verify and Commit (Commit 15)
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.2–7.3 for the complete
index.tsandendpoint.spec.tsmodification specifications.
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
- CSAPI symbols must not appear in root
index.ts: This is jahow's explicit requirement Phase 1.1: Create Type System (csapi/model.ts) #1. After this task, consumers must import CSAPI via@camptocamp/ogc-client/csapi. - Test migration is complete: The 2 migrated tests already exist in
factory.spec.ts(Task 5). This task only removes the originals. - No unused imports created: The removed lines are all re-exports, not imports.
Phase 6 Task-Specific Scope Boundaries
- Task 7 (this task) must NOT modify
endpoint.tsorfactory.ts— modifiesindex.tsandendpoint.spec.tsonly - Task 6 must NOT modify
index.tsorendpoint.spec.ts— modifiesendpoint.tsonly - Task 8 must NOT modify any TypeScript files — modifies
package.jsononly
References
Primary References (must read)
| # | Document | What It Provides |
|---|---|---|
| 1 | P6 Implementation Guide §7.2 | Complete index.ts modification — which lines to remove, what stays |
| 2 | P6 Implementation Guide §7.3 | Test disposition table — which 3 tests to remove, which 3 stay |
| 3 | P6 ROADMAP Task 7 | Task definition, deliverables, dependencies |
| 4 | P6 Contribution Goal | Criteria A1 (zero CSAPI in index.ts), B1/B2 (hasConnectedSystems/csapiCollections preserved) |
Convention Quick Reference
| Rule | Example |
|---|---|
| Removal verification | git grep "csapi|CSAPI" src/index.ts → 0 matches |
| Test count change | Exactly 3 tests removed from endpoint.spec.ts |
| What stays in index.ts | Lines 1–44 (core exports) + Lines 228+ (TMS, STAC, etc.) |
| What stays in endpoint.spec.ts | 3 tests: hasConnectedSystems, csapiCollections, non-CSAPI |
Activity
refactor: remove CSAPI exports and migrated tests (Issue #123, Task 7…
Sam-Bolling commentedon Feb 24, 2026
Task 7 Complete — Remove CSAPI Exports and Migrated Tests
Commit:
ed27108onphase-6src/index.ts (252 → 66 lines, −186)
git grep "csapi\|CSAPI" src/index.ts→ 0 matchessrc/ogc-api/endpoint.spec.ts (2886 → 2805 lines, −81)
Verification
npx tsc --noEmit— zero errorsnpx prettier --check— compliantnpx eslint— zero warningsgit grep "csapi\|CSAPI" src/index.ts— 0 matchesnpm run test:browser -- --testPathPattern endpoint— 80/80 pass (was 83, −3 exactly)npm run test:browser -- --testPathPattern factory— 2/2 passClosing.