libraryPackage manifestv2.0.4

lib.data-exchange-core

SchemaModel-first core primitives for data import/export and mapping

@lssm-tech/lib.data-exchange-core
Source, release and verification context

Source snapshot bcc79fcc · Declared package version 2.0.4. This page combines the checked-in package guide and manifest; commands and runtime behavior were not executed in this review.

Package source ↗ Manifest ↗
servernode
EXPLORE THE PACKAGE

See where this package fits.

Follow a declared connection, inspect an import, then open the source guide when you need the detail.

THIS PACKAGElib.data-exchange-coreplatform

Arrows point from a package to its direct dependency. Each count is derived from the captured manifests.

3 declaracionesSELECT TO INSPECT

@lssm-tech/lib.data-exchange-core

Website: https://contractspec.io

SchemaModel-first core primitives for data import, export, mapping, preview, and reconciliation planning.

What It Provides

  • Headless CSV, JSON, and XML codecs.
  • Normalized RecordBatch contracts for runtime data interchange.
  • SchemaModel mapping inference, coercion, and validation helpers.
  • Import/export planning and preview diff APIs.
  • Provider-neutral governed projection contracts for cross-product sharing, consent and lawful-basis grants, residency, retention, revocation, and privacy status.

Delivery contracts add leased pending → processing → retry_scheduled recovery with explicit applied or dead_letter terminals. Rights jobs follow the same bounded-attempt discipline. Operator projections expose application, state, attempt, redacted error, and evidence references only—never pairwise subjects or shared values.

Product recovery dispatches are a narrower contract than the central queue record. They carry only the receiving consumer or processor's pairwise subject, exact grant/projection event or rights operation, product binding, and idempotency identifier. Scheduler leases, attempt counters, payloads, credentials, and source values are rejected. Revocation and rights dispatches name the receiver-specific pairwise subject. They never reuse another relying party's subject or expose the canonical identity.

Installation

npm install @lssm-tech/lib.data-exchange-core

or

bun add @lssm-tech/lib.data-exchange-core

Usage

Import the root entrypoint from @lssm-tech/lib.data-exchange-core, or use subpaths such as ./codecs, ./governed, ./mapping, ./plans, ./preview, ./records, ./schema, and ./types.

SQL sources and targets may include optional portable database metadata (database.resource, fieldMapping, policyRefs, and provenance). The core package remains runtime-agnostic; server adapters and provider integrations decide how to execute PostgreSQL, SQLite, or MySQL work.

Import Templates

Developers can define the recommended import shape once, then let users upload files with different column labels or value formats:

ts
import {
	createImportPlan,
	createRecordBatch,
	defineDataExchangeTemplate,
	previewImport,
} from "@lssm-tech/lib.data-exchange-core";

const template = defineDataExchangeTemplate({
	key: "accounts.import",
	version: "1.0.0",
	columns: [
		{
			key: "id",
			label: "Account ID",
			targetField: "id",
			required: true,
			sourceAliases: ["Account Identifier", "External ID"],
		},
		{
			key: "amount",
			label: "Amount",
			targetField: "amount",
			format: {
				kind: "number",
				decimalSeparator: ",",
				thousandsSeparator: ".",
			},
		},
	],
});

const sourceBatch = createRecordBatch([
	{ "Account Identifier": "acc-1", Amount: "1.234,50" },
]);

const preview = previewImport(
	createImportPlan({
		source: { kind: "memory", batch: sourceBatch, format: "csv" },
		target: { kind: "memory", format: "json" },
		schema: AccountImportSchema,
		sourceBatch,
		template,
	})
);

Template resolution uses exact headers, aliases, normalized labels, and SchemaModel fallback inference. Explicit mappings still override template mappings. defineImportTemplate remains available as a backwards-compatible import-specific alias.

Governed ecosystem projections

@lssm-tech/lib.data-exchange-core/governed defines the portable contract for sharing a minimized projection between LSSM products. A catalog entry declares the source, schema, exact field paths, provenance, classification, and storage region. A separate grant binds one subject and optional tenant to one audience, purpose, lawful basis, field allowlist, expiry, retention horizon, region set, revision, and revocation watermark.

The access request and decision schemas are deliberately payload-free. They reject identity secrets and require denied decisions to disclose no field paths. Revocation events and consumer acknowledgements support deterministic reconciliation, while the privacy projection exposes who receives which fields and why without exposing the shared values.

A source product may publish an immutable sharing offer with an exact grantee, field subset, purpose code, legal-basis reference, EN/FR/ES consent copy, residency, expiry, and retention limit. User issuance accepts only the published offer id and locale; the resulting grant binds the projection schema version and preserves the exact localized consent text, version, and timestamp.

@lssm-tech/lib.data-exchange-core/governed/privacy-commands holds the pure privacy-rights transitions hosts compose: resolvePrivacyRightsProcessor routes export to the catalog source and erasure to the materialized consumer, createPrivacyRevocation derives the next revision/watermark revocation event and its payload-free pending delivery to the grant consumer, and resetFailedRightsJob requeues a failed rights job without stale terminal evidence. Event and delivery ids come from an injected deterministic opaqueId function so the package stays free of node:crypto.

This is not a shared raw database. Products keep their own persistence and local authorization; only a purpose-bound projection crosses the product boundary.

Receiving products persist a governed copy only through GovernedProductMaterialization: an exact pairwise subject, application, grant, projection/schema version, purpose, lawful-basis evidence, field allowlist, receiver region, grant expiry, retention horizon, revocation watermark, receiver key reference, and encrypted envelope. A separate payload-free authorization must match every one of those facts and the encryption algorithm exactly. The schema rejects plaintext, source subjects, canonical identity, credentials, leases, and payload fields. Product recovery and materialization receipts return evidence only; they never return the subject or shared values to the central identity authority.

Declared capabilities.

Lib Data Exchange Core

SchemaModel-first core primitives for data import/export and mapping

Use it to

  • Adopt schemamodel-first core primitives for data import/export and mapping

Requires

  • TypeScript

Choose another boundary when

  • The @lssm-tech/lib.data-exchange-core package constraints do not match the target runtime or platform.

@lssm-tech/lib.data-exchange-core

@lssm-tech/lib.data-exchange-core/codecs

@lssm-tech/lib.data-exchange-core/codecs/csv

@lssm-tech/lib.data-exchange-core/codecs/json

@lssm-tech/lib.data-exchange-core/codecs/xml

@lssm-tech/lib.data-exchange-core/data-exchange-core.feature

@lssm-tech/lib.data-exchange-core/governed

@lssm-tech/lib.data-exchange-core/mapping

@lssm-tech/lib.data-exchange-core/mapping/format

@lssm-tech/lib.data-exchange-core/mapping/format-parsers

@lssm-tech/lib.data-exchange-core/mapping/infer

@lssm-tech/lib.data-exchange-core/mapping/rules

Imports and export paths.

44 entries

These are package-manifest entry points. Named symbols listed above come from the capability catalogue; this is not an exhaustive TypeScript symbol reference.

44 importaciones · se muestran 35

Dependencies and related packages.

Runtime dependencies 3
zod
catalog:
Development dependencies 3
typescript
catalog:

Package scripts.

Commands declared by this package. Review its setup requirements before running them; no command here was executed by this review.

publish:pkgbun publish --tolerate-republish --ignore-scripts --verbose
publish:pkg:canarybun publish:pkg --tag canary
buildcontractspec-bun-build build
build:bundlecontractspec-bun-build transpile
build:typescontractspec-bun-build types
devcontractspec-bun-build dev
cleanrimraf dist .turbo
lintbun lint:fix
lint:fixnode ../../../../scripts/biome.cjs check --write --unsafe --only=nursery/useSortedClasses . && node ../../../../scripts/biome.cjs check --write .
lint:checknode ../../../../scripts/biome.cjs check .
prebuildcontractspec-bun-build prebuild
typechecktsgo --noEmit
Tu vista

Make room for your context.

Shape the presentation around this moment. You can change it whenever you need.

Tu contexto

The different parts of you

Choose a starting point

Una mezcla útil de contexto, imágenes y orientación discreta.

Tune each dimension
Each dimension can change independently. Product permissions and available actions stay unchanged.

Support the way you begin and return

Tune your support

Comodidad de lectura

Elige tu idioma

El idioma de la interfaz solo cambia el texto. Los mercados, precios y flujos de trabajo conservan sus propios ajustes.

Cobertura de traducción

Parte del contenido se muestra en inglés.

Navegación151
Grafo616
Categorías188
Portafolio332
Ejemplos2035
Vista previa de la fuente41

Se añadirán más traducciones a medida que se revise el contenido.

Esta preferencia se guarda en este navegador.

Buscar en el sitio web

Puntos de partida útiles

Sin resultados. Prueba una frase más corta, un nombre de operación u otro ámbito de búsqueda.

UN POCO DE ESPACIO PARA EXPLORAR

Encuentra algo que explorar.

Abre una vista detallada en esta página, prueba otra perspectiva o sigue el detalle a su propia página.

Cómo funcionan las vistas previas y los controles
01

Mirar antes de salir

Pasa el cursor por un enlace o enfócalo con Tab para ver una vista previa. Hacer clic en el enlace original o pulsar Intro siempre abre su destino.

02

Mantener el contexto

Entra en la vista previa para explorar sus secciones. Usa Alt + ↓ desde un enlace enfocado para entrar con el teclado. Escape la cierra.

03

Abrir las posibilidades

Las filas desplegables, las perspectivas y los controles destacados revelan más. Tu vista cambia la comodidad de lectura y el contexto que exploras.

Un botón separado para mirar más de cerca

Muestra pequeños botones de vista previa junto a los enlaces donde haya espacio. Toca el ojo para inspeccionar o el enlace para ir directamente. Esta elección permanece en esta pestaña.

No se recoge historial de navegación. El movimiento reducido sigue tu dispositivo y Tu vista.