npm.io
6.0.0 • Published 1 week ago

@x12i/catalox-contracts

Licence
MIT
Version
6.0.0
Deps
0
Size
237 kB
Vulns
0
Weekly
0

@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:

  • IDsAppId, CatalogId, ItemId, …
  • Catalog modelsCatalogDescriptor, CatalogListResult, CatalogGetItemResult, …
  • OutcomesCatalogListOutcome, CataloxResult, CataloxClientError
  • ItemsUnifiedCatalogItem, NativeCatalogItemRecord, scope types
  • Bindings & adapters — binding records, Mongo/API adapter config
  • HelperscompactCatalogFilter, toCataloxResultFromList, formatCataloxErrorMessage, field path normalization

Install

npm install @x12i/catalox-contracts

No 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-contracts

Documentation


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