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

@fleetfolio/ontology

v0.0.3

Published

FleetFolio Drizzle Schema and Relations for Infrastructure Asset Management

Readme

@fleetfolio/ontology

FleetFolio Drizzle ORM schema and relations for infrastructure asset management and surveillance.

Overview

This package provides TypeScript-first database schemas and relations for FleetFolio, an infrastructure assurance platform that compares expected assets against discovered assets to identify gaps, shadow IT, and compliance issues.

Built on top of @surveilr/ontology, this package extends the base surveillance schema with FleetFolio-specific tables for:

  • Asset Management: Track infrastructure assets, their types, statuses, and assignments
  • Boundary Management: Define organizational and technical boundaries (networks, regions, environments)
  • Service Tracking: Monitor services running on assets with status tracking
  • Risk Management: Associate risks, threats, and probabilities with assets
  • Graph Relationships: Model complex infrastructure relationships

Installation

npm install @fleetfolio/ontology drizzle-orm

Usage

Import Everything (Recommended)

// Import from main entry - includes schema, relations, and utilities
import {
  // Schema tables
  asset,
  assetType,
  assetStatus,
  boundary,
  organization,
  // Relations
  assetRelations,
  organizationRelations,
  boundaryRelations,
  // Utilities
  generateInsert,
  sqlLiteral,
  raw
} from '@fleetfolio/ontology';

Import from Specific Modules

// Import only schema tables
import {
  asset,
  assetType,
  assetStatus,
  boundary,
  organization
} from '@fleetfolio/ontology/schema';

// Import only relations
import {
  assetRelations,
  organizationRelations,
  boundaryRelations
} from '@fleetfolio/ontology/models';

// Import only utilities
import {
  generateInsert,
  generateInsertBatch,
  sqlLiteral,
  raw,
  RawSQL,
  selectId
} from '@fleetfolio/ontology/common';

Full Example with Drizzle

import { drizzle } from 'drizzle-orm/better-sqlite3';
import Database from 'better-sqlite3';
import {
  asset,
  organization,
  boundary,
  assetRelations,
  generateInsert
} from '@fleetfolio/ontology';

const sqlite = new Database('fleetfolio.db');
const db = drizzle(sqlite);

// Query assets with their organization
const assetsWithOrg = await db.query.asset.findMany({
  with: {
    organization: true,
    assetType: true,
    assetStatus: true,
  },
});

// Generate SQL insert statements
const insertSQL = generateInsert('asset', {
  asset_id: 'server-001',
  name: 'Production Server',
  asset_type_id: 'server',
  organization_id: 'org-001'
});

Core Tables

Asset Management

  • asset - Infrastructure assets (servers, services, applications)
  • assetType - Asset type taxonomy
  • assetStatus - Asset lifecycle status
  • assignment - Asset ownership/assignment tracking

Boundaries

  • boundary - Organizational/technical boundaries
  • boundaryNature - Boundary type definitions
  • graph - Relationship graphs
  • graphNature - Graph type definitions

Services

  • assetService - Services running on assets
  • assetServiceType - Service type taxonomy
  • assetServiceStatus - Service status tracking

Risk Management

  • assetRisk - Asset risk associations
  • assetRiskType - Risk type taxonomy
  • threatEvent - Threat event definitions
  • probability - Likelihood ratings
  • severity - Impact ratings

Inherited Tables

This package re-exports all tables from @surveilr/ontology, including:

  • Organization and party management
  • Person and device tracking
  • Uniform resource ingestion
  • Orchestration sessions
  • osQuery integration
  • Code notebooks
  • And more...

See @surveilr/ontology documentation for details.

Package Exports

  • @fleetfolio/ontology - Main entry point (all schema tables, relations, and utilities)
  • @fleetfolio/ontology/models - Relations only
  • @fleetfolio/ontology/schema - Schema tables only
  • @fleetfolio/ontology/common - Common utilities only

Recommendation: Use the main entry point (@fleetfolio/ontology) for most use cases. Use specific module imports only when you need to minimize bundle size or avoid naming conflicts.

TypeScript Support

Full TypeScript support with generated type definitions for all tables and relations.

License

ISC

Repository

github.com/opsfolio/netspective-fleetfolio

Related Projects