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

@oondemand/oon-core-back

v0.1.3

Published

Core runtime para Centrais Oon: Model Registry, CRUD/RBAC automáticos, módulos opinativos (Omie, Assistentes, Multi-moedas, Esteiras, Documentos) e deploy embutido.

Downloads

570

Readme

@oondemand/oon-core-back

📖 Documentação completa → ooncoredoc.vercel.app

Core runtime para Centrais Oon. O backend de uma Central passa a ser apenas domínio: você escreve central.config.js + src/models (e, quando preciso, validations / triggers / pipelines / documents / integrations / routes) e sobe tudo com oonCore-back start.

Toda a infraestrutura — boot, banco, auth, RBAC, logs, auditoria, paginação, metadata, CRUD, módulos opinativos (Omie, Assistentes, Multi-moedas, Esteiras, Documentos) e deploy (Docker + k8s) — vive aqui dentro.

Instalação

npm install @oondemand/oon-core-back

Uso mínimo

central.config.js:

module.exports = {
  serviceName: "minha-central",
  // opcional: provedor de auth (default = Meus Apps)
  // auth: { verifyToken: async (token) => ({ tipo, nome, email }) },
};

src/models/Produto.js:

const { defineModel, fields } = require("@oondemand/oon-core-back");

defineModel({
  name: "Produto",
  schema: {
    nome: fields.string({ required: true }),
    preco: fields.currency(),
    moeda: fields.currencyCode(),
  },
  crud: { enabled: true, roles: { write: ["admin"] } },
});

Subir:

npx oonCore-back start   # produção
npx oonCore-back dev     # watch/reload

Isso já expõe, para Produto:

GET    /produtos            (list + paginação/filtros/busca/ordenação)
GET    /produtos/:id
POST   /produtos
PUT    /produtos/:id
PATCH  /produtos/:id
DELETE /produtos/:id
POST   /produtos/import
GET    /produtos/export

Todas privadas (auth obrigatório), com RBAC e auditoria nas mutações.

API pública

const {
  start, createApp, activate,
  defineCentral, defineModel, fields,
  defineCollection, defineDocument, definePipeline,
  defineOmieMapping, defineRoutes, defineValidation, defineTrigger,
  omie, GenericError, registry,
} = require("@oondemand/oon-core-back");

defineRoutes — rotas customizadas com o contrato de segurança

Nunca se usa express.Router() cru. router.private.* aplica auth + RBAC (+ auditoria opcional); router.public.* é aberto.

const { defineRoutes } = require("@oondemand/oon-core-back");

defineRoutes("/relatorios", (router) => {
  router.private.get("/resumo", { roles: ["admin"] }, async (req, res) => {
    res.json({ ok: true, usuario: req.usuario });
  });
  router.public.get("/health", async (_req, res) => res.json({ up: true }));
});

Rotas /core/* (contrato com o oonCore-front)

GET /core/metadata     GET /core/models      GET /core/models/:name
GET /core/collections  GET /core/documents   GET /core/pipelines
GET /core/integrations GET /core/permissions GET /core/actions
GET /core/menus        GET /core/features

CLI

oonCore-back start        # produção
oonCore-back dev          # watch/reload
oonCore-back activate     # seed/ativação (singleton Sistema + hook)
oonCore-back build:image  # renderiza Dockerfile + docker build
oonCore-back k8s:render   # renderiza manifests a partir de central.manifest.json
oonCore-back deploy       # kubectl apply dos manifests

O consumidor não escreve YAML: ajusta central.manifest.json e o Core renderiza Dockerfile + ConfigMap/Secret/Deployment/Service/Ingress/HPA/Certificate.

Testes

npm test                 # invariantes de segurança (offline)
MONGO_URI=... npm test   # inclui CRUD + auditoria (requer Mongo)

Variáveis de ambiente principais

SERVICE_NAME, SERVICE_VERSION, PORT, NODE_ENV, DB_SERVER/DB_NAME/DB_USER/DB_PASSWORD/DB_AUTH_SOURCE/DB_REPLICA_SET/DB_TSL (ou MONGO_URI), MEUS_APPS_BACKEND_URL, OMIE_APP_KEY/OMIE_APP_SECRET.