@x12i/catalox-contracts
v6.0.0
Published
Shared types and contracts for Catalox
Downloads
6,244
Readme
@x12i/catalox-contracts
Shared TypeScript contracts for the Catalox platform: catalog types, items, bindings, descriptors, outcomes, client error shapes, and helper functions used by the engine, API, and client SDK.
Part of the Catalox monorepo.
Role
Single source of truth for cross-package types so engine, HTTP API, and client stay aligned without circular dependencies.
Exports include:
- IDs —
AppId,CatalogId,ItemId, … - Catalog models —
CatalogDescriptor,CatalogListResult,CatalogGetItemResult, … - Outcomes —
CatalogListOutcome,CataloxResult,CataloxClientError - Items —
UnifiedCatalogItem,NativeCatalogItemRecord, scope types - Bindings & adapters — binding records, Mongo/API adapter config
- Helpers —
compactCatalogFilter,toCataloxResultFromList,formatCataloxErrorMessage, field path normalization
Install
npm install @x12i/catalox-contractsNo runtime dependencies (types + small pure functions only).
Usage
import type {
CatalogDescriptor,
CataloxResult,
CataloxClientError,
} from "@x12i/catalox-contracts";
import {
compactCatalogFilter,
toCataloxResultFromGetItemWithOutcome,
formatCataloxErrorMessage,
} from "@x12i/catalox-contracts";Subpath exports: @x12i/catalox-contracts/*.js maps to built dist/*.js modules.
Build & test
npm run build -w @x12i/catalox-contracts
npm test -w @x12i/catalox-contractsDocumentation
Related packages
| Package | Uses contracts for |
|---------|-------------------|
| @x12i/catalox-engine | Engine I/O types |
| @x12i/catalox-api | HTTP response shapes |
| @x12i/catalox-client | Client-side result mapping |
| @x12i/catalox-authix-bridge | Context mapping types |
