@rotorsoft/act 1.34.3 → 1.35.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -2
- package/dist/.tsbuildinfo +1 -1
- package/dist/@types/act.d.ts +11 -8
- package/dist/@types/act.d.ts.map +1 -1
- package/dist/@types/builders/act-builder.d.ts.map +1 -1
- package/dist/@types/builders/state-builder.d.ts +1 -1
- package/dist/@types/internal/correlate-cycle.d.ts +4 -2
- package/dist/@types/internal/correlate-cycle.d.ts.map +1 -1
- package/dist/@types/internal/event-sourcing.d.ts +1 -6
- package/dist/@types/internal/event-sourcing.d.ts.map +1 -1
- package/dist/@types/internal/projection-fold.d.ts +1 -1
- package/dist/@types/internal/projection-fold.d.ts.map +1 -1
- package/dist/@types/internal/tracing.d.ts.map +1 -1
- package/dist/@types/types/act.d.ts +5 -21
- package/dist/@types/types/act.d.ts.map +1 -1
- package/dist/@types/types/action.d.ts +34 -16
- package/dist/@types/types/action.d.ts.map +1 -1
- package/dist/@types/types/builders.d.ts +26 -30
- package/dist/@types/types/builders.d.ts.map +1 -1
- package/dist/@types/types/errors.d.ts +56 -29
- package/dist/@types/types/errors.d.ts.map +1 -1
- package/dist/{chunk-GBAMBUDN.cjs → chunk-BNTVE7RQ.cjs} +13 -13
- package/dist/{chunk-GBAMBUDN.cjs.map → chunk-BNTVE7RQ.cjs.map} +1 -1
- package/dist/{chunk-BKCNU6FF.js → chunk-DH2HW5XJ.js} +13 -4
- package/dist/chunk-DH2HW5XJ.js.map +1 -0
- package/dist/{chunk-RF5MV72K.cjs → chunk-L66OOP2F.cjs} +14 -5
- package/dist/chunk-L66OOP2F.cjs.map +1 -0
- package/dist/{chunk-IEM2NS6J.js → chunk-MHPUVTMX.js} +2 -2
- package/dist/index.cjs +233 -231
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +76 -74
- package/dist/index.js.map +1 -1
- package/dist/test/index.cjs +4 -4
- package/dist/test/index.js +2 -2
- package/dist/types/index.cjs +4 -2
- package/dist/types/index.cjs.map +1 -1
- package/dist/types/index.js +3 -1
- package/package.json +1 -1
- package/dist/chunk-BKCNU6FF.js.map +0 -1
- package/dist/chunk-RF5MV72K.cjs.map +0 -1
- /package/dist/{chunk-IEM2NS6J.js.map → chunk-MHPUVTMX.js.map} +0 -0
package/README.md
CHANGED
|
@@ -8,7 +8,7 @@ _Event-sourcing framework for TypeScript — three primitives, Zod end to end, n
|
|
|
8
8
|
|
|
9
9
|
## Why this package
|
|
10
10
|
|
|
11
|
-
This is the framework core: the builders (`state`, `slice`, `projection`, `act`), the port interfaces (`Store`, `Cache`, `Logger`) with bundled in-memory implementations, the orchestrator that runs the correlate → drain loop, and the snapshot/cache layer that keeps `load()` fast on long streams. Around three primitives — **actions** (the changes you want to make), **state** (the data you care about), and **reactions** (what happens as a result) — it provides input validation against Zod schemas, named
|
|
11
|
+
This is the framework core: the builders (`state`, `slice`, `projection`, `act`), the port interfaces (`Store`, `Cache`, `Logger`) with bundled in-memory implementations, the orchestrator that runs the correlate → drain loop, and the snapshot/cache layer that keeps `load()` fast on long streams. Around three primitives — **actions** (the changes you want to make), **state** (the data you care about), and **reactions** (what happens as a result) — it provides input validation against Zod schemas, named preconditions (`.requires`), invariants (the state schema) checked on the folded state before every commit, optimistic-concurrency commit, derived state via patch reducers, fan-out reactions with backoff, blocked-stream recovery, time-travel queries against the same log.
|
|
12
12
|
|
|
13
13
|
Your domain stays in TypeScript; your schemas stay in Zod. Pick a store at bootstrap — Postgres (`@rotorsoft/act-pg`), SQLite (`@rotorsoft/act-sqlite`), or the bundled in-memory default — and the application code stays the same. The published surface is stable under [SemVer](../../STABILITY.md) as of 1.0.0.
|
|
14
14
|
|
|
@@ -54,7 +54,7 @@ Top-level exports:
|
|
|
54
54
|
- **Builders** — `state()`, `slice()`, `projection()`, `act()` build the domain. `withState`, `withSlice`, `withProjection` compose them.
|
|
55
55
|
- **Ports** — `store()`, `cache()`, `log()` are first-call-wins singletons; pass an adapter on first call to override the default. `dispose()` registers shutdown callbacks.
|
|
56
56
|
- **`Act` orchestrator** — `do`, `load`, `query`, `query_array`, `drain`, `correlate`, `settle`, `start_correlations`, `reset`, `unblock`, `blocked_streams`, `prioritize`, `close`, `forget`, `restore`, `audit`, `shutdown` plus lifecycle events (`committed`, `notified`, `settled`, `blocked`, `closed`, …). Subscription introspection (`query_streams`, `query_stats`) is on the store: `store().query_streams(...)`.
|
|
57
|
-
- **Errors** — `ValidationError`, `
|
|
57
|
+
- **Errors** — `ValidationError`, `PreconditionError`, `ConcurrencyError`, `StreamClosedError`, `NonRetryableError` plus the `Errors` constants (each error's `name`); match with `instanceof`.
|
|
58
58
|
- **In-memory adapters** — `InMemoryStore`, `InMemoryCache`, `ConsoleLogger`.
|
|
59
59
|
- **Constants** — `SNAP_EVENT`, `TOMBSTONE_EVENT`.
|
|
60
60
|
- **Types** — full re-export of port interfaces, builder result types, lifecycle event payloads.
|