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

@pipeline-builder/api-core

v3.4.79

Published

Core server-side utilities (auth middleware, response helpers, error codes, quota service, HTTP client, logging, AI provider catalog) shared by every Pipeline Builder backend service.

Readme

@pipeline-builder/api-core

📖 View documentation

Core server-side utilities (auth middleware, response helpers, error codes, quota service, HTTP client, logging, AI provider catalog) shared by every Pipeline Builder backend service.

Internal workspace package — consumed by other packages via workspace:*. Not published or used standalone.

Responsibilities

Provides the cross-cutting primitives every backend service depends on: JWT authentication and authorization middleware, inter-service token minting, standardized HTTP response and error helpers, request parameter/identity parsing, Zod validation schemas with an OpenAPI registry, a safe service-to-service HTTP client, quota enforcement types and client, structured Winston logging, an in-memory/Redis cache, domain event pub/sub, and the static AI provider catalog.

Key exports

Authentication & authorization (./middleware)

| Export | Purpose | | --- | --- | | requireAuth | JWT authentication middleware (accepts RequireAuthOptions, e.g. allowOrgHeaderOverride for internal routes) | | requireAdmin, requireSystemAdmin | Role gates (admin/owner; system-org admin/owner) | | requireFeature | Feature-flag gate | | isSystemOrgId, isSystemAdmin, isServicePrincipal | Authorization helpers (isServicePrincipal is true when req.user.sub starts with service:) | | resolveAccessModifier | Coerces requested 'public' to 'private' unless caller is admin/owner | | signServiceToken, getServiceAuthHeader | Mint short-lived inter-service JWTs (default TTL 5 min) accepted unmodified by requireAuth |

Responses & errors (./utils, ./errors)

| Export | Purpose | | --- | --- | | sendSuccess, sendError, sendBadRequest, sendInternalError, sendQuotaExceeded | Standardized JSON responses | | sendPaginated, sendPaginatedNested, parsePaginationParams | Paginated response helpers | | extractDbError, errorMessage | Safe DB-error and error-to-string extraction | | ErrorCode, getStatusForErrorCode | Standard error code enum and HTTP status mapping | | AppError, NotFoundError, ForbiddenError, ValidationError, ConflictError, UnauthorizedError | Typed HTTP error classes |

Request parsing (./utils)

| Export | Purpose | | --- | --- | | getParam, getRequiredParam, getParams, getOrgId, getAuthHeader | Request parameter/header extraction | | parseQueryBoolean, parseQueryInt, parseQueryString | Query-string coercion | | getIdentity, validateIdentity | Parsed JWT identity (RequestIdentity) helpers |

HTTP client & services (./services)

| Export | Purpose | | --- | --- | | InternalHttpClient, createSafeClient | Service-to-service HTTP client (ServiceConfig, RequestOptions) | | createComplianceClient / ComplianceClient | Typed compliance-service client built on the safe client | | QuotaService, createQuotaService, QuotaType, QuotaCheckResult, QuotaTier, QUOTA_TIERS, getTierLimits | Quota enforcement client and tier presets | | CacheService, createCacheService | In-memory TTL cache with optional Redis backend | | entityEvents | Process-local domain event pub/sub for entity changes |

Logging, validation & OpenAPI

| Export | Purpose | | --- | --- | | createLogger, logger | Winston structured logger factory and default instance | | AIGenerateBodySchema, AIGenerateFromUrlBodySchema, PluginCreateSchema, PipelineFilterSchema, MessageCreateSchema, plus PaginationSchema, UUIDSchema, AccessModifierSchema | Zod request-validation schemas and shared building blocks | | registry, generateOpenApiSpec | Shared schema registry and OpenAPI spec generation |

AI provider catalog (./constants)

| Export | Purpose | | --- | --- | | AI_PROVIDER_CATALOG | Static provider/model catalog | | AI_PROVIDER_ENV_VARS | Provider-to-env-var mapping | | getAIProviderModels, getAIProviderName | Lookup helpers for a provider's models/name |

Health (./routes)

| Export | Purpose | | --- | --- | | createHealthRouter | Registers GET /health (liveness) and GET /ready (readiness; 503 when a dependency is 'disconnected') |

Usage

import {
  requireAuth,
  sendSuccess,
  sendError,
  NotFoundError,
  createLogger,
} from '@pipeline-builder/api-core';

const log = createLogger('plugin-service');

router.get('/plugins/:id', requireAuth(), async (req, res) => {
  const plugin = await plugins.findById(req.params.id);
  if (!plugin) throw new NotFoundError('plugin not found');
  return sendSuccess(res, plugin);
});

Development

pnpm build   # projen build (compile + lint + test)
pnpm test    # run the Jest test suite

License

Apache-2.0. See LICENSE.