libraryPackage manifestv2.0.5

lib.data-exchange-server

Server-side adapters and execution services for SchemaModel-first data interchange

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

Source snapshot bcc79fcc · Declared package version 2.0.5. 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-serverplatform

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

6 declarationsSELECT TO INSPECT

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

Website: https://contractspec.io

Server-side adapters, execution services, and workflow templates for SchemaModel-first data interchange.

What It Provides

  • File, HTTP, SQL, and storage adapter families.
  • SQL adapters that preserve portable database endpoint metadata while delegating execution to injected clients/provider boundaries.
  • Dry-run, validation, preview, execute, retry, and audit services.
  • WorkflowSpec templates for interchange orchestration.
  • A fail-closed governed projection gateway, revocation reconciliation, and privacy-status projection for ecosystem data sharing.
  • A host-injected SecretProvider envelope sealer that canonicalizes the exact authorization as AES-256-GCM AAD and returns ciphertext-only product envelopes.
  • A bounded HTTPS materialization port that delivers one encrypted dispatch to an exact product ingress without ambient credentials or redirect following.

Usage

Import the root entrypoint from @lssm-tech/lib.data-exchange-server, or use ./adapters, ./governed, ./services, and ./workflow.

Template-Aware Imports

Server dry-runs and executions accept the same import templates as core. This lets users upload partner-specific CSV/JSON/XML layouts while the server previews normalized records before writing them.

ts
import { defineDataExchangeTemplate } from "@lssm-tech/lib.data-exchange-core";
import { dryRunImport, executeImport } from "@lssm-tech/lib.data-exchange-server";

const template = defineDataExchangeTemplate({
	key: "invoices.import",
	version: "1.0.0",
	columns: [
		{
			key: "id",
			label: "Invoice ID",
			targetField: "id",
			required: true,
			sourceAliases: ["Invoice Number", "No facture"],
		},
		{
			key: "amount",
			label: "Amount",
			targetField: "amount",
			format: {
				kind: "number",
				decimalSeparator: ",",
				thousandsSeparator: ".",
			},
		},
	],
});

const preview = await dryRunImport({
	source: {
		kind: "file",
		path: "partner.csv",
		format: "csv",
		codecOptions: { csv: { delimiter: ";", skipRows: 1 } },
	},
	target: { kind: "memory", format: "json" },
	schema: InvoiceImportSchema,
	template,
});

if (preview.issues.every((issue) => issue.severity !== "error")) {
	await executeImport({
		source: {
			kind: "file",
			path: "partner.csv",
			format: "csv",
			codecOptions: { csv: { delimiter: ";", skipRows: 1 } },
		},
		target: { kind: "memory", format: "json" },
		schema: InvoiceImportSchema,
		template,
	});
}

Execution audit entries record whether mappings came from explicit mappings, template resolution, or inference.

Governed projection gateway

@lssm-tech/lib.data-exchange-server/governed evaluates catalog, grant, subject, tenant, audience, purpose, field, time, residency, revision, and revocation-watermark authority before calling the injected source port. A denial is recorded without a payload or field disclosure; an allowed response returns only the exact requested field allowlist.

Revocation reconciliation suspends a share when a required consumer is missing, stale, or reports a failed acknowledgement. Hosts own durable stores, encryption, transport, deletion/export jobs, and operator workflows. The package never assumes that products share a database or that a managed runtime owns customer keys.

The delivery worker accepts provider-neutral consumer and rights-processor ports. Only an explicit applied/complete result advances a terminal success; exceptions are indeterminate and fail closed. Missing bindings are retryable, attempts are leased and bounded, and expired leases can be reclaimed without claiming that an unknown downstream side effect succeeded.

createSecretProviderGovernedEnvelopeSealer resolves a product-owned key reference through an injected binding and SecretProvider. It accepts only a 32-byte AES-256 key, requires payload fields to equal the authorized field allowlist, uses canonical authorization bytes as AAD, appends the GCM tag to the encoded ciphertext, hashes the randomized ciphertext rather than low-entropy plaintext, requires an exact configured key version when one is pinned, and rejects oversized payloads before encryption. It clears its local key copy after sealing. Provider errors are replaced with a redacted failure. The sealer never owns, rotates, serializes, or logs key material.

createGovernedRecoveryIngress is the product-side HTTP trust boundary. It requires a strong server-only bearer, exact application binding, matching idempotency header, bounded strict dispatch body, and schema-valid product evidence. Authentication or binding failures never invoke the product port; product exceptions become a generic 503 without leaking diagnostics.

createGovernedMaterializationIngressRegistry is the independent encrypted-copy boundary. It selects one ingress from the exact source application path and a distinct 32-character-or-longer source-to-receiver bearer. The strict dispatch must match receiver application and region, exact purpose, lawful-basis and consent evidence, fields, grant/revision/watermark, expiry and retention, receiver encryption algorithm/key reference, and idempotency key. Unknown sources, stale authority, plaintext, source subjects, central identity, and forged receipts fail before persistence. Hosts may bind recovery without materialization; materialization requires both an explicit receiver region and at least one source binding.

createGovernedMaterializationHttpPort is the matching source-side transport. It accepts one exact HTTPS origin, source application, strong server-only bearer, and optional injected fetch implementation. Requests carry the delivery ID as their idempotency key, omit ambient credentials, refuse redirects, and use a bounded timeout. Only a 200 application/json receipt under 64 KiB is parsed; the receipt must bind the exact delivery, materialization, and consumer. Network, status, media-type, body-size, parsing, and receipt failures collapse to one redacted unavailable error. The port never decrypts or logs product data.

createGovernedRecoveryHttpPort applies the same exact-origin, strong-bearer, idempotency, no-credentials, no-redirect, bounded-timeout, JSON media-type, and streaming response limits to projection revocation and privacy-rights work. It removes worker lease metadata before transport, rejects application substitution before network I/O, returns a bounded retry result for an explicit downstream status, and collapses network or invalid-receipt outcomes to one redacted error.

Declared capabilities.

Lib Data Exchange Server

Server-side adapters and execution services for SchemaModel-first data interchange

Use it to

  • Adopt server-side adapters and execution services for schemamodel-first data interchange

Requires

  • TypeScript

Choose another boundary when

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

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

@lssm-tech/lib.data-exchange-server/adapters

@lssm-tech/lib.data-exchange-server/adapters/file

@lssm-tech/lib.data-exchange-server/adapters/http

@lssm-tech/lib.data-exchange-server/adapters/sql

@lssm-tech/lib.data-exchange-server/adapters/storage

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

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

@lssm-tech/lib.data-exchange-server/services

@lssm-tech/lib.data-exchange-server/services/execution

@lssm-tech/lib.data-exchange-server/services/io

@lssm-tech/lib.data-exchange-server/services/retry

Imports and export paths.

33 entries

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

33 imports

Dependencies and related packages.

Runtime dependencies 6
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
Your view

Make room for your context.

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

Your context

The different parts of you

Choose a starting point

A useful mix of context, visuals and gentle guidance.

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

Reading comfort

Choose your language

Interface language changes text only. Markets, prices and workflows keep their own settings.

Translation coverage

Original source

Navigation151
Graph616
Categories378
Portfolio833
Examples2,035
Source preview1,542

More translations will be added as content is reviewed.

This preference is saved on this browser.

Search the website

Useful starting points

No results. Try a shorter phrase, an operation name or another search area.

A LITTLE ROOM TO EXPLORE

Find something to explore.

Open a closer look on this page, try a different perspective, or follow the detail into its own page.

How previews and controls work
01

Look before you leave

Hover a link or focus it with Tab to see a preview. Clicking the original link or pressing Enter always opens its destination.

02

Stay with the context

Move into the preview to explore its sections. Use Alt + ↓ from a focused link to enter it with the keyboard. Escape closes it.

03

Open the possibilities

Disclosure rows, perspective choices and highlighted controls reveal more. Your view changes reading comfort and the context you explore.

A separate button for a closer look

Show small preview buttons beside links where there is room. Tap the eye to inspect, or tap the link to go straight there. This choice stays in this tab.

No browsing history is collected. Reduced motion follows your device and Your view.