npm.io
3.0.5 • Published 2 weeks ago

@x12i/memorix-relationship-store

Licence
exellix-license
Version
3.0.5
Deps
1
Size
76 kB
Vulns
0
Weekly
0

@x12i/memorix-relationship-store

Logical RelationshipStore contract, deterministic relationship ids, in-memory oracle (tests), and production Mongo adapter (Candidate C: central per-category relationships collections).

Stores four-field links only — never related payloads.

Install

npm install @x12i/memorix-relationship-store@3.0.2
Audience Use this package?
Remote app No — use /api/relationships
Platform / engines Yes (data plane + relationships engine)
Unit tests In-memory oracle without Mongo
{
  relationshipId: string;
  relationshipDefinitionId: string;
  fromRecordId: string;
  toRecordId: string;
}

Exports

import {
  createInMemoryRelationshipStore,
  createMongoRelationshipStore,
  computeRelationshipId,
  ensureRelationshipIndexes,
  FORBIDDEN_LINK_FIELDS,
} from "@x12i/memorix-relationship-store";
// Mongo-only entry also available:
import { createMongoRelationshipStore } from "@x12i/memorix-relationship-store/mongo";
Export Role
createInMemoryRelationshipStore Test oracle
createMongoRelationshipStore Candidate C Mongo adapter
computeRelationshipId Deterministic link id
FORBIDDEN_LINK_FIELDS Reject payload fields on links

Typical store operations: put/get/list by endpoint, batch upsert, delete by id — all org-scoped.

Need Use
Discover / materialize / verify @x12i/memorix-relationships
Read expansion on content @x12i/memorix-data reader include options
HTTP /api/relationships/* (no ad-hoc link PUT/DELETE)

Docs

npm test