@ferricstore/ferricstore 0.2.0 → 0.3.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 +20 -3
- package/dist/index.cjs +515 -124
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +58 -7
- package/dist/index.d.ts +58 -7
- package/dist/index.js +502 -113
- package/dist/index.js.map +1 -1
- package/docs/api/assets/hierarchy.js +1 -1
- package/docs/api/assets/navigation.js +1 -1
- package/docs/api/assets/search.js +1 -1
- package/docs/api/classes/ClaimHydrationError.html +1 -1
- package/docs/api/classes/ConnectionClosedError.html +1 -1
- package/docs/api/classes/FerricStoreClient.html +3 -3
- package/docs/api/classes/FerricStoreError.html +1 -1
- package/docs/api/classes/FlowAlreadyExistsError.html +2 -2
- package/docs/api/classes/FlowBatchError.html +1 -1
- package/docs/api/classes/FlowNotFoundError.html +1 -1
- package/docs/api/classes/FlowWrongStateError.html +1 -1
- package/docs/api/classes/InvalidCommandError.html +2 -2
- package/docs/api/classes/LeaseRenewalError.html +1 -1
- package/docs/api/classes/LockHeldError.html +2 -2
- package/docs/api/classes/LockNotOwnedError.html +2 -2
- package/docs/api/classes/OverloadedError.html +2 -2
- package/docs/api/classes/QueueCompletionError.html +1 -1
- package/docs/api/classes/ReconnectingExecutor.html +4 -4
- package/docs/api/classes/RequestTimeoutError.html +1 -1
- package/docs/api/classes/RerouteError.html +2 -2
- package/docs/api/classes/StaleLeaseError.html +1 -1
- package/docs/api/classes/StalePolicyGenerationError.html +39 -0
- package/docs/api/classes/TopologyNativeAdapterPool.html +3 -3
- package/docs/api/classes/Workflow.html +1 -1
- package/docs/api/classes/WorkflowWorker.html +2 -2
- package/docs/api/functions/classifyServerError.html +1 -1
- package/docs/api/functions/isReconnectableClosedConnectionError.html +1 -1
- package/docs/api/functions/mapException.html +1 -1
- package/docs/api/hierarchy.html +1 -1
- package/docs/api/index.html +8 -4
- package/docs/api/interfaces/AdminListOptions.html +1 -1
- package/docs/api/interfaces/CancelOptions.html +2 -2
- package/docs/api/interfaces/CompleteOptions.html +2 -2
- package/docs/api/interfaces/CompleteOutcome.html +1 -1
- package/docs/api/interfaces/CreateManyOptions.html +1 -1
- package/docs/api/interfaces/EffectCompensateOptions.html +1 -1
- package/docs/api/interfaces/EffectConfirmOptions.html +1 -1
- package/docs/api/interfaces/EffectFailOptions.html +1 -1
- package/docs/api/interfaces/EffectStatusOptions.html +1 -1
- package/docs/api/interfaces/ExtendLeaseOptions.html +2 -2
- package/docs/api/interfaces/FailOptions.html +2 -2
- package/docs/api/interfaces/FailOutcome.html +1 -1
- package/docs/api/interfaces/FerricStoreClientFromUrlOptions.html +1 -1
- package/docs/api/interfaces/FerricStoreClientOptions.html +1 -1
- package/docs/api/interfaces/FlowPolicyBackoffSnapshot.html +5 -0
- package/docs/api/interfaces/FlowPolicyOptions.html +8 -4
- package/docs/api/interfaces/FlowPolicyRetentionSnapshot.html +3 -0
- package/docs/api/interfaces/FlowPolicyRetrySnapshot.html +4 -0
- package/docs/api/interfaces/FlowPolicySnapshot.html +17 -0
- package/docs/api/interfaces/FlowPolicyStateSnapshot.html +6 -0
- package/docs/api/interfaces/HistoryOptions.html +2 -2
- package/docs/api/interfaces/InvocationCreateOptions.html +2 -2
- package/docs/api/interfaces/LeaseMutationOptions.html +2 -2
- package/docs/api/interfaces/LimitListOptions.html +1 -1
- package/docs/api/interfaces/MutateOptions.html +2 -2
- package/docs/api/interfaces/NamedValueMutation.html +1 -1
- package/docs/api/interfaces/ProtocolCommand.html +2 -2
- package/docs/api/interfaces/ReadOptions.html +2 -2
- package/docs/api/interfaces/ReclaimOptions.html +1 -1
- package/docs/api/interfaces/RequestContext.html +2 -2
- package/docs/api/interfaces/RequestContextOptions.html +2 -2
- package/docs/api/interfaces/RetryOptions.html +2 -2
- package/docs/api/interfaces/RetryOutcome.html +1 -1
- package/docs/api/interfaces/RunStepsItem.html +2 -2
- package/docs/api/interfaces/RunStepsManyOptions.html +2 -2
- package/docs/api/interfaces/SearchOptions.html +2 -2
- package/docs/api/interfaces/StepContinueOptions.html +3 -3
- package/docs/api/interfaces/TDigestCreateOptions.html +1 -1
- package/docs/api/interfaces/TDigestMergeOptions.html +1 -1
- package/docs/api/interfaces/TransitionOptions.html +2 -2
- package/docs/api/interfaces/TransitionOutcome.html +1 -1
- package/docs/api/modules.html +1 -1
- package/docs/api/types/ConnectionRequestDisposition.html +1 -1
- package/docs/api/types/FlowPolicyBackoffKind.html +1 -0
- package/docs/api/types/ManagementPairs.html +1 -1
- package/docs/api/types/SearchStateMeta.html +1 -1
- package/docs/api/variables/FERRICSTORE_MINIMUM_SERVER_VERSION.html +1 -1
- package/docs/api/variables/FERRICSTORE_NATIVE_PROTOCOL_VERSION.html +1 -1
- package/docs/api/variables/FERRICSTORE_SDK_VERSION.html +1 -1
- package/docs/api/variables/MAX_FLOW_POLICY_GENERATION.html +1 -0
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -18,7 +18,7 @@ Requires Node.js 22.22 or newer. The SDK ships ESM and CommonJS builds and is te
|
|
|
18
18
|
|
|
19
19
|
## Compatibility
|
|
20
20
|
|
|
21
|
-
SDK `0.
|
|
21
|
+
SDK `0.3.x` requires FerricStore server `0.9.1` or newer. FerricStore 0.9.1 is a
|
|
22
22
|
breaking beta API contract update, while the native wire protocol remains v1
|
|
23
23
|
(`FSNP` framing and existing opcode numbers are unchanged). Capabilities and
|
|
24
24
|
response-size limits are negotiated per connection from the HELLO-shaped
|
|
@@ -42,7 +42,7 @@ const { FerricStoreClient, JsonCodec } = require("@ferricstore/ferricstore");
|
|
|
42
42
|
docker run -p 6388:6388 \
|
|
43
43
|
-e FERRICSTORE_PROTECTED_MODE=false \
|
|
44
44
|
-v ferricstore_data:/data \
|
|
45
|
-
ghcr.io/ferricstore/ferricstore:0.
|
|
45
|
+
ghcr.io/ferricstore/ferricstore:0.9.1
|
|
46
46
|
```
|
|
47
47
|
|
|
48
48
|
## Cluster-aware client
|
|
@@ -387,12 +387,25 @@ await flow.scheduleCreate("orders-every-five-minutes", {
|
|
|
387
387
|
FIFO Flow state policy is opt-in per state:
|
|
388
388
|
|
|
389
389
|
```ts
|
|
390
|
-
await flow.installPolicy("email", {
|
|
390
|
+
const policy = await flow.installPolicy("email", {
|
|
391
391
|
states: {
|
|
392
392
|
queued: { mode: "fifo" }
|
|
393
393
|
}
|
|
394
394
|
});
|
|
395
395
|
|
|
396
|
+
// Direct writes deep-patch by default. Fence concurrent editors with generation CAS.
|
|
397
|
+
const updated = await flow.installPolicy("email", {
|
|
398
|
+
expectedGeneration: policy.generation,
|
|
399
|
+
maxActiveMs: 300_000
|
|
400
|
+
});
|
|
401
|
+
|
|
402
|
+
// Full replacement is explicit on the client API.
|
|
403
|
+
await flow.installPolicy("email", {
|
|
404
|
+
expectedGeneration: updated.generation,
|
|
405
|
+
replace: true,
|
|
406
|
+
states: { queued: { mode: "fifo" } }
|
|
407
|
+
});
|
|
408
|
+
|
|
396
409
|
await flow.create("email-3", {
|
|
397
410
|
partitionKey: "tenant-a:email",
|
|
398
411
|
payload: Buffer.from("welcome"),
|
|
@@ -402,6 +415,10 @@ await flow.create("email-3", {
|
|
|
402
415
|
```
|
|
403
416
|
|
|
404
417
|
FIFO states require a `partitionKey`; priority is for parallel states.
|
|
418
|
+
`Workflow.installPolicy()` defaults to full replacement because workflow declarations
|
|
419
|
+
describe a complete policy. Pass `replace: false` when a workflow install should patch.
|
|
420
|
+
FIFO ordering is enforced by the server per `(type, state, partitionKey)`; worker
|
|
421
|
+
concurrency remains available across different partitions.
|
|
405
422
|
|
|
406
423
|
## FerricStore KV And Data Structures
|
|
407
424
|
|