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 déclarationsSELECT 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 imports · 35 affichés

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
Votre vue

Make room for your context.

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

Votre contexte

The different parts of you

Choose a starting point

Un mélange utile de contexte, de visuels et de guidage discret.

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

Confort de lecture

Choisir votre langue

La langue de l’interface change uniquement le texte. Les marchés, les prix et les parcours conservent leurs propres paramètres.

Couverture des traductions

Une partie du contenu est affichée en anglais.

Navigation151
Graphe616
Catégories378
Portfolio833
Exemples2 035
Aperçu de la source1 542

D’autres traductions seront ajoutées à mesure que le contenu sera relu.

Cette préférence est enregistrée dans ce navigateur.

Rechercher sur le site

Des points de départ utiles

Aucun résultat. Essayez une expression plus courte, un nom d’opération ou un autre périmètre de recherche.

UN PEU DE PLACE POUR EXPLORER

Trouvez quelque chose à explorer.

Ouvrez un aperçu détaillé sur cette page, essayez une autre perspective ou suivez le détail vers sa propre page.

Fonctionnement des aperçus et des commandes
01

Regarder avant de partir

Survolez un lien ou sélectionnez-le avec Tab pour voir un aperçu. Cliquer sur le lien d’origine ou appuyer sur Entrée ouvre toujours sa destination.

02

Rester dans le contexte

Entrez dans l’aperçu pour explorer ses sections. Depuis un lien sélectionné, utilisez Alt + ↓ pour y entrer au clavier. Échap le ferme.

03

Ouvrir les possibilités

Les lignes dépliables, les choix de perspective et les commandes mises en évidence révèlent davantage. Votre vue adapte le confort de lecture et le contexte exploré.

Un bouton séparé pour voir de plus près

Affichez de petits boutons d’aperçu à côté des liens quand l’espace le permet. Touchez l’œil pour examiner ou le lien pour y aller directement. Ce choix reste dans cet onglet.

Aucun historique de navigation n’est collecté. La réduction des animations suit votre appareil et Votre vue.