@shivaedev/contract 0.49.0 → 0.51.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/CHANGELOG.md +22 -0
- package/README.md +160 -123
- package/dist/bind.d.ts +7 -0
- package/dist/bind.d.ts.map +1 -1
- package/dist/bind.js +2 -1
- package/dist/bind.js.map +1 -1
- package/dist/clientOperations.d.ts +5 -1
- package/dist/clientOperations.d.ts.map +1 -1
- package/dist/clientOperations.js +4 -0
- package/dist/clientOperations.js.map +1 -1
- package/dist/commandSignal.d.ts.map +1 -1
- package/dist/commandSignal.js +17 -13
- package/dist/commandSignal.js.map +1 -1
- package/dist/connectionReadiness.js +1 -1
- package/dist/connectionReadiness.js.map +1 -1
- package/dist/defineModule.d.ts +5 -7
- package/dist/defineModule.d.ts.map +1 -1
- package/dist/defineModule.js.map +1 -1
- package/dist/failureKind.d.ts +10 -0
- package/dist/failureKind.d.ts.map +1 -0
- package/dist/failureKind.js +20 -0
- package/dist/failureKind.js.map +1 -0
- package/dist/live.d.ts.map +1 -1
- package/dist/live.js +16 -6
- package/dist/live.js.map +1 -1
- package/dist/liveHintQueue.d.ts.map +1 -1
- package/dist/liveHintQueue.js +19 -14
- package/dist/liveHintQueue.js.map +1 -1
- package/dist/moduleHandlers.d.ts +3 -3
- package/dist/moduleHandlers.d.ts.map +1 -1
- package/dist/moduleHandlers.js.map +1 -1
- package/dist/moduleProof.d.ts +10 -12
- package/dist/moduleProof.d.ts.map +1 -1
- package/dist/querySubscription.js +5 -1
- package/dist/querySubscription.js.map +1 -1
- package/dist/reflection.d.ts.map +1 -1
- package/dist/reflection.js +3 -3
- package/dist/reflection.js.map +1 -1
- package/dist/runProof.d.ts +2 -1
- package/dist/runProof.d.ts.map +1 -1
- package/dist/servedOperation.d.ts.map +1 -1
- package/dist/servedOperation.js +2 -1
- package/dist/servedOperation.js.map +1 -1
- package/dist/socketProtocol.js +1 -1
- package/dist/socketProtocol.js.map +1 -1
- package/dist/staleWrite.d.ts +10 -0
- package/dist/staleWrite.d.ts.map +1 -0
- package/dist/staleWrite.js +14 -0
- package/dist/staleWrite.js.map +1 -0
- package/package.json +9 -9
- package/src/bind.ts +9 -9
- package/src/clientOperations.ts +4 -0
- package/src/commandSignal.ts +16 -12
- package/src/connectionReadiness.ts +1 -1
- package/src/defineModule.ts +13 -10
- package/src/failureKind.ts +33 -0
- package/src/live.ts +19 -6
- package/src/liveHintQueue.ts +20 -14
- package/src/moduleHandlers.ts +3 -3
- package/src/moduleProof.ts +15 -23
- package/src/querySubscription.ts +7 -1
- package/src/reflection.ts +88 -86
- package/src/runProof.ts +3 -1
- package/src/servedOperation.ts +2 -1
- package/src/socketProtocol.ts +1 -1
- package/src/staleWrite.ts +23 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,27 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.51.0 - 2026-11-20
|
|
4
|
+
|
|
5
|
+
### Added
|
|
6
|
+
|
|
7
|
+
- a stale versioned write that reaches the end of an operation's `run` answers the caller with the shared `Conflict` from `@shivaedev/errors/taxonomy.ts`, whose message tells the person to refresh and try again. The generated wire lists `Conflict` for that operation, so its client sees a typed rejection and the default notice shows the message.
|
|
8
|
+
|
|
9
|
+
### Breaking
|
|
10
|
+
|
|
11
|
+
- an operation's `run` now fails with `Conflict` where its body lets an `OptimisticConcurrencyError` from an `@shivaedev/sql` repository through, so code that calls `Operation.run` and catches `OptimisticConcurrencyError` after it catches `Conflict` instead. Delete each `Effect.catchTag("OptimisticConcurrencyError", …)` in `run` that only returned a `Conflict`; keep one that answers something else.
|
|
12
|
+
|
|
13
|
+
## 0.50.0 - 2026-11-20
|
|
14
|
+
|
|
15
|
+
### Added
|
|
16
|
+
|
|
17
|
+
- `failureKind(error)` in `failureKind.ts` returns `"request"`, `"framework"` or `"app"`, with the `FrameworkFailure` and `AppRejection<E>` types and the `isFrameworkFailure` guard.
|
|
18
|
+
- a bound command carries `runtime`, the atom runtime of its client, and `payload`, its declared payload schema. Bound queries and streams carry `runtime` too.
|
|
19
|
+
|
|
20
|
+
### Breaking
|
|
21
|
+
|
|
22
|
+
- `defineModule` no longer takes `requires`: delete the `requires` line from every `defineModule({ ... })`, and the imports only it used. The module's type now carries, for each operation, the services its `run` and read policy yield, less what its middleware and subject provide per call, and `moduleHandlers(module)` requires exactly those services. An operation that starts to yield another service needs no other edit.
|
|
23
|
+
- `OperationNeedsUndeclaredServices` and `Allowed` are removed from `@shivaedev/contract/moduleProof.ts`, and `NameProof` takes the operations and the wire only. A module's `"~requires"` is now a record from each operation's name to the services it needs, and `AnyModule["~requires"]` is `ModuleServices`.
|
|
24
|
+
|
|
3
25
|
## 0.49.0 - 2026-11-20
|
|
4
26
|
|
|
5
27
|
### Added
|