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

@edirect/audit-core

v11.0.48

Published

Core `AuditService` orchestrator for the eDirect Audit system. This package provides the `AuditService` class that coordinates between exporters and instrumentation middleware to produce and dispatch audit events.

Readme

@edirect/audit-core

Core AuditService orchestrator for the eDirect Audit system. This package provides the AuditService class that coordinates between exporters and instrumentation middleware to produce and dispatch audit events.

Package Role in the Audit System

@edirect/audit-domain       ← Models, Exporter interface
       ↑
@edirect/audit-core         ← You are here (AuditService orchestrator)
       ↑
@edirect/audit-nestjs       ← NestJS DI wrapper around AuditService
       ↑
@edirect/audit-exporter-http-axios   ← Axios HTTP transport
@edirect/audit-exporter-http-fetch   ← Fetch HTTP transport
@edirect/audit-instrumentation-express ← Auto-instrumentation from Express requests

Installation

pnpm add @edirect/audit-core
# or
npm install @edirect/audit-core

You typically don't use @edirect/audit-core directly in application code — use @edirect/audit-nestjs for NestJS apps. This package is useful if you need to use the audit service outside of NestJS.

Usage (standalone)

import { AuditService } from '@edirect/audit-core';
import { HttpAxiosExporter } from '@edirect/audit-exporter-http-axios';

const auditService = new AuditService({
  exporter: new HttpAxiosExporter({
    basePath: 'https://audit.example.com',
    accessToken: process.env.AUDIT_ACCESS_TOKEN,
  }),
  service: 'policy-issuing-service',
  domain: 'policy',
  tenant: 'th-broker',
});

await auditService.audit({
  originType: 'HTTP',
  actorType: 'AGENT',
  actorGroup: 'th-broker-agents',
  actorId: 'user-uuid-123',
  actionCategory: 'DATA_MODIFICATION_EVENT',
  actionKey: 'CREATE',
  targetKey: 'Policy',
  targetId: ['policy-uuid-456'],
  actionDetail: 'Agent created a new motor policy',
  resultKey: 'SUCCESS',
  eventTimestamp: new Date(),
});

AuditService Configuration

| Option | Type | Required | Description | |--------|------|----------|-------------| | exporter | Exporter | Yes | Transport that sends events to the audit backend | | service | string | Yes | Name of the service emitting the event | | domain | string | Yes | Business domain (e.g., 'policy', 'payment') | | tenant | string | Yes | Tenant identifier (e.g., 'th-broker') | | instrumentation | Middleware[] | No | Auto-instrumentation middlewares (e.g., from Express requests) | | disabled | boolean | No | Disable audit emission (default: false) | | throwErrors | boolean | No | Re-throw exporter errors (default: false) | | bulkLimit | number | No | Max events per bulk export call |

BasicAuditRequest

The AuditService.audit() method accepts a BasicAuditRequest, which is a reduced version of AuditRequest — fields like service, domain, tenant, traceId, sessionId, originIpAddress, and originUrl are omitted or made optional because the AuditService fills them in automatically.

type BasicAuditRequest = {
  originType: string;
  actorType: AuditRequestActorType;
  actorGroup: string;
  actorId?: string;
  actionCategory: AuditRequestActionCategory;
  actionKey: AuditRequestActionKey;
  targetKey: string;
  targetId?: string[];
  actionDetail: string;
  actionPayload?: object;
  resultKey: AuditRequestResultKey;
  resultDetail?: string;
  resultPayload?: object;
  eventTimestamp: Date;
};

Related Packages

| Package | Role | |---------|------| | @edirect/audit-domain | AuditRequest model, Exporter interface | | @edirect/audit-nestjs | NestJS AuditModule + AuditService with DI | | @edirect/audit-exporter-http-axios | HTTP exporter via Axios | | @edirect/audit-exporter-http-fetch | HTTP exporter via Fetch API | | @edirect/audit-instrumentation-express | Express request auto-instrumentation |