@x12i/xentra-store
v0.2.0
Published
Storage interfaces and in-memory adapter for Xentra
Readme
@x12i/xentra-store
Storage interfaces and an in-memory adapter for all Xentra persistence. Production deployments typically use @x12i/xentra-store-mongo.
Install
npm install @x12i/xentra-storeUsage
import { createMemoryStore, type XentraStoreBundle } from "@x12i/xentra-store";
const store: XentraStoreBundle = createMemoryStore();
const account = await store.accounts.create({
id: "acc_1",
name: "Acme",
slug: "acme",
status: "active",
createdAt: new Date().toISOString(),
updatedAt: new Date().toISOString(),
});
const members = await store.memberships.listByAccount(account.id);Store bundle
XentraStoreBundle groups typed stores:
accounts,workspaces,users,teams,memberships,roles,permissionsinvitations,agents,tools,connectors,delegationsapprovals(policies + requests),audit,tokenGrants- Optional
transaction()for multi-write consistency
Each store extends CrudStore<T> or domain-specific list/query methods. See src/index.ts for full interface definitions.
In-memory adapter
createMemoryStore() returns a fully wired bundle suitable for local development, tests, and the default API server.
Related packages
@x12i/xentra-store-mongo— MongoDB-backed implementation (indexes + collections)- Domain services (
authx,agentic,approvals,audit) acceptXentraStoreBundlein their constructors
Development
npm run build -w @x12i/xentra-store
npm test -w @x12i/xentra-storeLicense
MIT
