Skip to content

Releases: Sodastech/rungs

Release list

Rungs 0.1.0

Choose a tag to compare

@github-actions github-actions released this 02 Nov 04:27
5db0dfe
npm install @rungsjs/core@0.1.0 @rungsjs/store-memory@0.1.0 @rungsjs/store-postgres@0.1.0

Documentation: https://sodastech.github.io/rungs/ · Edge case catalog: https://sodastech.github.io/rungs/edge-cases/

@rungsjs/core

Minor Changes

  • 964127b: Initial release.

    An approval workflow engine for TypeScript: pure, deterministic and without runtime dependencies.

    • Flows. defineFlow with static validation and fail-closed defaults. Sequential steps,
      parallel steps (any, all, { quorum }), conditional steps with a JSON condition language,
      and versioned flows per tenant with a global fallback.
    • Approvers. Users, roles and named resolvers supplied by the application. The requester and
      inactive users are removed, duplicates are merged, and earlier approvals carry over without
      closing a step on their own (four eyes). A step with nobody left to approve is refused at
      submit, or blocked mid-flow for an admin to reassign, retry or override.
    • Delegation. Out-of-office rules with chains, cycle detection and a depth limit, plus
      delegate, reassign and handing a task back. Delegation never gives anyone two votes in a
      step, and the approver a task acts for can still decide it directly.
    • Time. Deadlines, reminders, remind, auto-approve, auto-reject and escalate
      timeouts, resubmit deadlines and business-day calendars, driven by tick.
    • Lifecycle. return to the requester or an earlier step, resubmit with a return policy,
      withdraw and override.
    • Service. createRungs with optimistic concurrency (expectedVersion), tenant-scoped
      idempotency keys, an append-only audit trail, domain events delivered from an outbox, and
      queries: get, history, inbox, requests, blocked, preview and delegation rules.
    • Entry points. @rungsjs/core for applications, @rungsjs/core/store for store adapter
      authors and @rungsjs/core/engine for the pure decide function.
    • Typed errors extending RungsError, each with a stable code.

    Every behavior is described in the edge case catalog (EC-01 to EC-62), and every Core case has a
    test named after it: https://sodastech.github.io/rungs/edge-cases/

@rungsjs/store-memory

Minor Changes

  • 964127b: Initial release.

    memoryStore(), an in-memory store for tests and prototypes. Transactions run one at a time on a
    copy of the data, which replaces the data on success and is dropped when the command throws.
    snapshot() returns everything the store holds, for assertions and debugging. It passes the same
    store contract and service suites as the PostgreSQL store.

@rungsjs/store-postgres

Minor Changes

  • 964127b: Initial release.

    postgresStore(), a store for PostgreSQL 15 or newer with no runtime dependencies.

    • Bring your own driver: fromPg (node-postgres), fromPostgresJs (postgres.js) and
      fromPglite (PGlite).
    • migrate() creates or upgrades the tables and is safe to run from several processes;
      migrationSql() returns the same migrations as SQL for your own migration tool. Schema and
      table prefix are configurable.
    • Request state in JSONB with indexed columns for due requests, the inbox, request lists, blocked
      steps and the outbox. Row locks, compare-and-set on the request version, and SKIP LOCKED
      leases so several workers can run tick and event delivery.
    • An append-only audit table.
    • Data retention: purgeRequest, purgeRequests (with an explicit tenantId or
      allTenants: true), purgeIdempotency and purgeDispatchedEvents.

Every package is published from this repository's release workflow with npm provenance.