npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@ebca/rest-gateway

v0.0.11

Published

Universal REST and Swagger gateway adapter for EBCA inbound components and read queries.

Readme

@ebca/rest-gateway

Optional REST adapter for EBCA applications.

The package exposes generic HTTP endpoints for the same declarative runtime metadata used by the other EBCA gateways:

  • inbound components marked with @Component({ inbound: { expose: true } });
  • read queries declared with @EbcaQuery(...); omit query gates for every query transport, use gates: ['rest'] to narrow exposure, or gates: [] for internal repository helpers.

It also exports setupEbcaRestSwagger, a small helper that installs Swagger UI for the generic REST contract.

Install

npm install @ebca/rest-gateway @nestjs/swagger

@ebca/core, NestJS, reflect-metadata, and RxJS are peer dependencies supplied by the application.

Usage

import { Module } from '@nestjs/common';
import { EbcaRestAuthAdapter, EbcaRestGatewayModule } from '@ebca/rest-gateway';

class AppRestAuthAdapter implements EbcaRestAuthAdapter {
  resolveIdentity() {
    return { identityId: 'system-rest-client', roles: ['operator'] };
  }
}

@Module({
  imports: [
    EbcaRestGatewayModule.forRoot({
      authAdapter: AppRestAuthAdapter,
    }),
  ],
})
export class AppModule {}

In main.ts:

import { setupEbcaRestSwagger } from '@ebca/rest-gateway';

setupEbcaRestSwagger(app, {
  path: 'docs',
  title: 'EBCA API',
});

Endpoints

| Method | Path | Purpose | | --- | --- | --- | | POST | /ebca/components/:entityName/:entityId/:componentName/:operation | Add, update, upsert, or remove an exposed component. | | GET | /ebca/queries/:name | Execute a read query using URL query params. | | POST | /ebca/queries/:name | Execute a read query using JSON params. | | GET | /ebca/meta | Inspect REST-open queries and inbound components. |

Command Mutations

Command components use the same ComponentManager path as other inbound writes. They stay transient unless core metadata sets transient: false. REST creates a random commandId when one is missing, so idempotent retries need a stable caller-provided commandId exposed in inbound.fields.

Security

REST gateway is transport glue, not an authentication framework. Use authAdapter to map your app-owned HTTP auth into an EBCA identity and roles. Without an adapter, the gateway uses only defaultIdentityId and defaultRoles; it does not trust arbitrary request headers.

For writes, exposed components must declare inbound.fields. Those fields are the REST mutation contract and keep framework/domain fields such as command status, rejection details, and internal identifiers out of arbitrary JSON payloads.

REST stays an adapter. Domain decisions still live in EBCA systems and read repositories.

License

Apache-2.0.