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

@x12i/memorix-source-connector

v1.8.1

Published

Metadata-driven generic source connector runtime for Memorix

Readme

@x12i/memorix-source-connector

Metadata-driven source connector runtime for memorix-connector/1. Definitions must set "role": "source". Peer: @x12i/memorix-connector-sdk@^1.

An installed provider definition supplies adapters, operations, response mappings, streams, workflow, credential policy, error mappings, and execution ceilings; this package validates it and returns a normal SDK defineConnector implementation.

npm install @x12i/memorix-source-connector
import { createMetadataConnector, validateDefinition } from "@x12i/memorix-source-connector";
import definition from "./connector.json" with { type: "json" };

const validation = validateDefinition(definition);
if (!validation.valid) throw new Error("Invalid connector metadata");

export default createMetadataConnector(definition);

Supported protocol adapters are governed HTTP, GraphQL and SOAP, plus explicitly permitted SFTP, read-only PostgreSQL/MySQL, and POP3 material-lease adapters. HTTP response forms include JSON, XML, text, exact binary staging, and ndjson (newline-delimited JSON with optional response.stream.maxBytes / onTruncation). XML list mapping uses shared JMESPath paths (itemsPath / itemPath) with stable attribute (@_…) handling. Request templates may use a host-supplied scope root, hydrate batch root, and forEachPaginated parent root. Optional session preconditions and workflow compose / poll / hydrate / forEachPaginated / cleanup steps, optional streams, applied offset/cursor pagination, and semantic profile handoff (semanticProfileId / acquisitionRouteId on stream and collect-like steps) are documented in the monorepo metadata contract. POP3 uses Credorix material-lease for username/password; host and port stay in non-secret configuration.

Product metadata (MGC-12)

Operations (and optionally 1:1 streams) may declare:

  • goodFor / failureAffect — short string arrays for product use and failure impact
  • requiredness"must" (default when omitted) or "optional"
  • requiresEntitlements — operator hints (SKU, OAuth scope, appliance feature); not a license API

Explorer DATA collections (X12I-MGC-04)

Default Explorer retention collection is {objectType}-raw. Override with stream explorerCollection; set dataRetention to "explorer" or "none" (omit to retain). Use objectCatalogStubs(def) / explorerCollectionFor(objectType) for catalog stubs without Map-1 joins. System collection connector-integrity-runs is the integrity ledger (ABS-03 schema).

Set connector cache.ttlSeconds so MCP mgc_fetch knows when _raw is stale. Optional agent.resources documents fetch identity keys; the catalog auto-derives resources from streams when omitted.

Vendor totals (MGC-13)

response.totalCountPath / optional truncatedPath feed page returnedCount, matchedCount, and truncated (matchedCount > returnedCount or flag or NDJSON cut → complete: false). Export classifyAcquisitionStream for host integrity status (complete / partial / failed / skipped / unsupported).

Parent-keyed hydrate merge (MGC-14)

hydrate with mergeIntoParent: true loads parent records from a prior saveAs, reads a child op per parentIdPath, stamps mergeMap fields onto each parent, and collects the parent stream. This is not compose (union of streams) and not a Level-1 abstract compile. | in mergeMap is first-non-empty. Child 404/410 leaves the parent metadata-only.

Foreign-id inspect (MGC-15)

idOwnership: "foreign" on collect/hydrate/forEachPaginated means the ids were not allocated this run. Default cleanup is "never"; pairing those ids with a kind: "cleanup" / delete step is a load-time error. Connector-allocated jobs still use create→poll→collect→cleanup always (MGC-07). Foreign inspect is not teardown. 404/410 skip as unsupported-by-retention.

The runtime never accepts executable JavaScript in metadata, never reads provider secrets, and never writes directly to Memorix storage. Provider requests use the host-supplied governed port; collection and atomic checkpoint advancement use ctx.collectStream; large content uses ctx.content.stage.

Only staged and installed definitions execute. The host must pin connector ID, semantic version, and definition hash.

Pausable acquisition (host ports)

executePausableWorkflow accepts a full SDK ConnectorPullContext or a thin host envelope (orgId, http, …). Missing workflow.run is self-hosted via createWorkflowRunner; missing source is {}. Missing http still fails closed (GOVERNED_HTTP_REQUIRED).

Hosts that are not an SDK pull host should build context with createPausableAcquisitionContext (HTTP wrap, auth headers, in-memory collectStream, workflow runner):

import {
  MetadataConnectorRuntime,
  createPausableAcquisitionContext,
} from "@x12i/memorix-source-connector";

const runtime = new MetadataConnectorRuntime();
const pullContext = createPausableAcquisitionContext({
  definition,
  orgId,
  pullId,
  http: hostHttpPort,
  authHeaders,
  signal,
});
const paused = await runtime.executePausableWorkflow(definition, pullContext, {
  signal: pauseSignal,
  authHeaders,
});