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

@ontologie/mock-server

v0.1.0-preview.6

Published

Mock DataForge API server for testing without staging

Downloads

793

Readme

@ontologie/mock-server

In-process mock server for local SDK development. Exposes createMockServer() returning a createFetch() function compatible with the global fetch API.

Status — V1.0 (post-Phase-5)

| Surface | Status | Notes | |---------|--------|-------| | Read paths (ObjectSet.fetchPage, manifest, types, link-types, graph traverse/neighbors/paths) | ✅ Supported | Returns deterministic fixtures matching staging shapes | | Action describe (GET /api/v1/actions/:key/describe) | ✅ Supported | Returns stub action descriptor | | Calendar / Audit / Forms / Scenarios / Decision-compares (read+write) | ✅ Supported | In-memory state, deterministic round-trips | | V1 REST instance CRUD (POST /api/v1/object-types/:apiName/instances, PUT/DELETE /api/v1/instances/:id, /instances/batch) | ✅ Supported (Phase 5) | In-memory store, version increment on update, soft delete | | ActionBuilder (POST /api/v1/actions/:key/dry-run and /invoke) | ✅ Supported (Phase 5) | Returns PlanArtifactV1 + ActionResult stubs | | Legacy CQRS writes (POST /api/commands/execute, /api/commands/batch) | ⚠️ Returns 501 MOCK_LEGACY_CQRS_DEPRECATED | Defensive guard for legacy callers — current SDK uses REST routes above |

Usage

import { createMockServer } from '@ontologie/mock-server';
import { createClient } from '@ontologie/sdk-client';

const mock = createMockServer();
globalThis.fetch = mock.createFetch();

const client = createClient({
  baseUrl: 'http://mock.dataforge.local',
  apiKey: 'mock-key',
  workspaceId: 'mock-ws',
});

// Reads — fully supported:
const types = await client.ontology.types.list();
const result = await client.ontology.Employee.where(e => e.salary.gt(50000)).fetchPage();

// Writes — fully supported (Phase 5):
const employee = await client.ontology.Employee.create({ name: 'Alice', salary: 60000 });
const updated = await client.ontology.Employee.update(employee.data.id, { salary: 70000 });
await client.ontology.Employee.delete(employee.data.id);

// Batch operations:
const batch = await client.ontology.Employee.batchCreate([
  { name: 'Bob' },
  { name: 'Charlie' },
]);

// Actions:
const plan = await client.actions.on('Contract').action('approve').target('con-1').dryRun();
const result2 = await client.actions.on('Contract').action('approve').applyPlan(plan.planId);

Phase 5 implementation details (closes #1076)

Phase 5 of epic #1077 wires real handlers for V1 REST routes that the SDK uses post-Phase-4 (PR #1099). Pre-Phase-5 these returned 501. Now :

| Route | Behavior | |-------|----------| | POST /api/v1/object-types/:apiName/instances | Stores in MockServer.objects Map, returns {success, data: {id, object_type_id, data, version: 1, status: 'active', ...}} | | POST /api/v1/object-types/:apiName/instances/batch | Iterates body.updates[], dispatches by op type, returns {succeeded, failed, results[]} | | PUT /api/v1/instances/:id | Cross-type lookup, version increment, returns updated instance. 404 if not found | | DELETE /api/v1/instances/:id | Cross-type lookup, removes from store, returns {success, data: {id, status: 'deleted'}}. 404 if not found | | POST /api/v1/actions/:key/dry-run | Returns minimal PlanArtifactV1 stub with canApply: true, signature placeholders | | POST /api/v1/actions/:key/invoke | Returns ActionResult stub with runId, actionKey, empty editedRefs + blockedSideEffects |

Legacy CQRS writes (501 mitigation)

POST /api/commands/execute and /api/commands/batch now return MOCK_LEGACY_CQRS_DEPRECATED 501 with a message explaining that the SDK uses REST routes post-Phase-4. This is a defensive guard for legacy callers. Current SDK code does not hit these paths.

Cross-references