Skip to content

Encapsulation leak: users.ts directly imports ExtractRoutesFromAPI from ApiClass.ts #43051

Open

Description

@Sarthak-Pandey

Description

In the server API subsystem, apps/meteor/server/api/api.ts acts as the public API gateway/entry point, while apps/meteor/server/api/ApiClass.ts contains the internal implementation details of the API class.

Currently, route definition modules like apps/meteor/server/api/v1/users.ts import API from api.ts, but simultaneously bypass this public gateway to import internal type helpers like ExtractRoutesFromAPI directly from ApiClass.ts.

This creates an architectural bypass edge and violates encapsulation boundaries: consumers should consume public types and instances exclusively through the gateway/public facade rather than reaching into back-office class implementation files.


Current Behavior

In apps/meteor/server/api/v1/users.ts:

import type { ExtractRoutesFromAPI } from '../ApiClass'; // ⚠️ Bypassing public API module
import { API } from '../api';                           //  Using public gateway

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    type: featurePull requests that introduces new feature

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions