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

@antelopejs/interface-data-api

v0.6.3

Published

AntelopeJS interface that generates CRUD REST endpoints from database tables, with access rules, validation and pagination

Readme

@antelopejs/interface-data-api

The AntelopeJS interface that generates CRUD REST endpoints from a database table. Declare a data controller and its fields, and it serves the get, list, new, edit and delete routes with access rules, validation and pagination.

Part of AntelopeJS. Used by AntelopeJS DMS, the open-source back office for your PostgreSQL, MongoDB or RethinkDB database.

What it offers

  • DataController and @RegisterDataController() turn a table class into a controller with the default routes you pick from DefaultRoutes.
  • @Access decides which fields each route reads and writes. @Mandatory and @Validator check the written values.
  • @Listable, @Sortable and @Filter shape the paginated list route.
  • @Foreign, @Joined and @Computed resolve references, flatten remote fields and add values computed in the database.

Implementations

The package runs in your module and has no implementing module of its own. The project needs modules that implement the interfaces it builds on.

| Interface | Module | | -------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------ | | @antelopejs/interface-api | @antelopejs/api | | @antelopejs/interface-database | @antelopejs/mongodb or @antelopejs/rethinkdb |

Install

Add the package and its peer interfaces to your module.

pnpm add @antelopejs/interface-data-api @antelopejs/interface-api @antelopejs/interface-api-util @antelopejs/interface-core @antelopejs/interface-database @antelopejs/interface-database-decorators

Then add the implementations to the project.

ajs project modules add @antelopejs/api @antelopejs/mongodb

Quick start

import { Controller } from "@antelopejs/interface-api";
import {
  DataController,
  DefaultRoutes,
  RegisterDataController,
} from "@antelopejs/interface-data-api";
import {
  Access,
  AccessMode,
  Listable,
  Mandatory,
  ModelReference,
  Sortable,
} from "@antelopejs/interface-data-api/metadata";
import {
  BasicDataModel,
  Field,
  Model,
  RegisterSchema,
  RegisterTable,
  Table,
} from "@antelopejs/interface-database-decorators";

@RegisterTable("tasks", "todo")
class Task extends Table {
  declare _id: string;

  @Field("string")
  declare summary: string;
}

class TaskModel extends BasicDataModel(Task, "tasks") {}

@RegisterDataController()
class TaskAPI extends DataController(
  Task,
  DefaultRoutes.All,
  Controller("/tasks"),
) {
  @ModelReference()
  @Model(TaskModel)
  declare taskModel: TaskModel;

  @Listable()
  @Access(AccessMode.ReadOnly)
  declare _id: string;

  @Listable()
  @Sortable()
  @Mandatory("new")
  @Access(AccessMode.ReadWrite)
  declare summary: string;
}

export async function construct() {
  await RegisterSchema("todo");
}

The controller serves GET /tasks/get?id=, GET /tasks/list, POST /tasks/new, PUT /tasks/edit?id= and DELETE /tasks/delete?id=. A field without @Access stays out of every response and every write, unless @Joined or @Computed makes it read-only.

Documentation

Compatibility

The package declares these @antelopejs/* peer dependencies.

| Package | Supported | Tested with | | ------------------------------------------- | ----------------- | ----------- | | @antelopejs/interface-api | >=0.3.0 <1.0.0 | 0.2.0 | | @antelopejs/interface-api-util | >=0.1.3 <1.0.0 | 0.3.0 | | @antelopejs/interface-core | >=0.2.4 <1.0.0 | 0.4.0 | | @antelopejs/interface-database | >=0.1.10 <1.0.0 | 0.3.0 | | @antelopejs/interface-database-decorators | >=0.1.10 <1.0.0 | 0.2.0 |

Contributing

Read CONTRIBUTING.md before you open a pull request. Run the local checks with these commands.

pnpm install
pnpm lint
pnpm test

License

Apache-2.0