Skip to content

Phase 8 / D1c: Re-privatize root/getCollectionDocument + remove isCollectionInfo cast #184

Closed

Description

@Sam-Bolling

Sub-task of #179. Subtractive pass: re-privatize the public surface and remove the isCollectionInfo runtime cast now that endpoint.csapi(id) (D1b) exists.

Goal

Restore OgcApiEndpoint.root and OgcApiEndpoint.getCollectionDocument to private visibility and delete the isCollectionInfo runtime cast. Migrate every internal call site to the new factory entry from D1b. After this commit, the public API matches the original ogc-client surface (no leaked CSAPI plumbing).

Tasks

  1. Migrate every internal consumer of endpoint.root / endpoint.getCollectionDocument to use endpoint.csapi(id) (D1b) where appropriate, or refactor through a private helper.
  2. Change root and getCollectionDocument visibility back to private.
  3. Delete the isCollectionInfo runtime cast.
  4. Update or remove tests that asserted on the public surface of root / getCollectionDocument.
  5. Run typecheck after each migrated module — TypeScript will cascade visibility errors and they need to be resolved in lockstep.

Acceptance

  • root and getCollectionDocument are private
  • isCollectionInfo runtime cast deleted
  • No remaining external references to endpoint.root / endpoint.getCollectionDocument in src/** (excluding the class itself) or app/**
  • npm run typecheck clean
  • npm run lint clean
  • npm run test:browser clean (CSAPI scope)
  • Existing CSAPI tests that previously routed via endpoint.root now route via endpoint.csapi() and still pass

Out of scope

  • Adding new tests for endpoint.csapi() — that was D1b
  • Final upstream-PR refresh — that is D1d / E2

Dependencies

Blocks: D1d
Blocked by: D1b

Parent

Refines #179.

Activity

  1. Sam-Bolling commented on Apr 30, 2026

    @Sam-Bolling
    Author

    D1c shipped in commit 02cf405.

    Changes:

    • src/ogc-api/endpoint.ts — public get root → private get root; public getCollectionDocument(id) → private getCollectionDocument(id). These were temporarily promoted to public in commit 20a35d2 for the previous async factory; with D1b''s csapi() facade they are no longer part of the package surface.
    • src/ogc-api/endpoint.spec.ts — deleted the redundant describe(''getCollectionDocument'') block (the only external caller). Its conformance assertion (iot-sensors carries ogc-cs:systems) is already covered by D1b''s csapi() happy-path test asserting builder.availableResources ⊇ ''systems''. The two jest.spyOn(endpoint, ''getCollectionDocument'') calls in the csapi() error-path tests are now jest.spyOn(endpoint as any, ''getCollectionDocument'') since the target is private; this is test-only and intentional — those tests validate csapi()''s try/catch wrapping by stubbing the internal collaborator.

    Sub-finding (already verified in D1b): the isCollectionInfo runtime cast is gone — git grep -n isCollectionInfo -- src/ returns 0 matches. Removed when factory.ts was reshaped to value-shaped inputs in a41ce07. No further action required for that line item.

    Verification:

    • npx tsc --noEmit → clean
    • npx eslint src/ogc-api/{endpoint,endpoint.spec}.ts → clean
    • npx prettier --check → clean
    • Scoped jest (endpoint.spec + factory.spec) → 93/93 passed (was 94 in D1b — minus the deleted redundant block)
    • Regression npx jest src/ogc-api src/shared/mime-type --forceExit → 1519/1519 passed, 36 suites

    Closing as completed. Proceeding to D1d/#185 (closeout) on next trigger.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions