AbsoluteJS

Reliability

@absolutejs/reliabilityv0.1.0betaPlatform & Infra

Provider-neutral atomic inbox, transaction, and idempotent-operation primitives for AbsoluteJS.

#Installation

BASH
bun add @absolutejs/reliability

#Capabilities

Overview

Provider-neutral reliability primitives for side-effecting integrations:

checked-out PostgreSQL transactions that keep every statement on one connection;

scoped, payload-fingerprinted idempotent operations with fencing and an explicit

Show 3 more

indeterminate state after an external side effect may have started;

an atomic webhook inbox with leases, replay claims, completion, and retention purge.

The package has no database-driver dependency. Pass a pool with connect() to createPostgresTransactionRunner(), apply the exported schemas, and construct the stores. A plain pool-level query() is intentionally not accepted because it cannot guarantee transaction connection affinity.

Idempotent operations

Use createPostgresIdempotentOperationStore() in multi-process production deployments. The store fences concurrent claims and preserves an indeterminate result when an external side effect may have started but its final outcome is unknown.

Durable webhook inbox

createMemoryWebhookInboxStore() covers tests. createPostgresWebhookInboxStore() and drainWebhookInbox() provide atomic leases, retries, replay protection, completion, and retention purging for production webhook consumers.

Transaction affinity

createPostgresTransactionRunner() checks out one connection for the complete transaction. This prevents transaction statements from accidentally crossing pooled connections.

Outcomes

What you can build

Overview

Provider-neutral reliability primitives for side-effecting integrations:

Idempotent operations

Use createPostgresIdempotentOperationStore() in multi-process production deployments. The store fences concurrent claims and preserves an indeterminate result when an external side effect may have started but its final outcome is unknown.

Durable webhook inbox

createMemoryWebhookInboxStore() covers tests. createPostgresWebhookInboxStore() and drainWebhookInbox() provide atomic leases, retries, replay protection, completion, and retention purging for production webhook consumers.

Hardening checklist

Production guidance

Idempotent operationsUse createPostgresIdempotentOperationStore() in multi-process production deployments. The store fences concurrent claims and preserves an indeterminate result when an external side effect may have started but its final outcome is unknown.
Durable webhook inboxcreateMemoryWebhookInboxStore() covers tests. createPostgresWebhookInboxStore() and drainWebhookInbox() provide atomic leases, retries, replay protection, completion, and retention purging for production webhook consumers.

Follow in order

Troubleshooting path

1
Trace from the first failed boundary
Reproduce the smallest canonical @absolutejs/reliability example, confirm the supported entry point and version in the API explorer, then inspect the first boundary that did not produce its documented result.

#Idempotent operations

Partial snippet

Working example for Idempotent operations.

TS
import {
	createMemoryIdempotentOperationStore,
	fingerprintPayload,
	operationId
} from '@absolutejs/reliability';

const scope = { actorId: 'tenant-1', key: 'charge-42', operation: 'charge' };
const id = operationId(scope);
const fingerprint = await fingerprintPayload({ amount: 2500, currency: 'usd' });
const store = createMemoryIdempotentOperationStore();

#Public entry points

Supported entry points declared by this project’s package manifest. Internal dist paths are not part of the package contract.

Public package entry point declared in package.json.

@absolutejs/reliability@absolutejs/reliability/manifest@absolutejs/reliability/manifest.json

#Package commands

Scripts declared by this project’s package manifest.

bun run buildrm -rf dist && bun build src/index.ts src/manifest.ts --outdir dist --sourcemap --target=bun --external @absolutejs/manifest --external @sinclair/typebox && tsc --project tsconfig.build.json && absolute-manifest emit
bun run check:packagebun run typecheck && bun run test && bun run verify-package && bun run build && bun run verify-package --artifacts
bun run formatprettier --write "./**/*.{ts,json,md}"
bun run testbun test
bun run typechecktsc --noEmit

#API reference

Search the declarations exported by the current package type files. Expand a symbol to inspect its source-backed signature.

20 symbols
OperationScopetypePermalink
TS
type OperationScope = {
    account?: string;
    key: string;
    namespace: string;
    provider?: string;
    tenant?: string;
};
Exported from @absolutejs/reliability
Use this API in an outcome:Deliver messages safely

Continue toward an outcome

These playbooks show where this package fits, how to verify the combined system, and what changes before production.