@ferricstore/ferricstore 0.3.0 → 0.5.1
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 +59 -6
- package/dist/index.cjs +2273 -600
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +193 -30
- package/dist/index.d.ts +193 -30
- package/dist/index.js +2275 -605
- 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 +4 -4
- package/docs/api/classes/ConnectionClosedError.html +5 -5
- package/docs/api/classes/FerricStoreClient.html +6 -2
- package/docs/api/classes/FerricStoreError.html +5 -5
- package/docs/api/classes/FlowAlreadyExistsError.html +5 -5
- package/docs/api/classes/FlowBatchError.html +5 -5
- package/docs/api/classes/FlowNotFoundError.html +5 -5
- package/docs/api/classes/FlowQueryError.html +42 -0
- package/docs/api/classes/FlowWrongStateError.html +5 -5
- package/docs/api/classes/InvalidCommandError.html +5 -5
- package/docs/api/classes/LeaseRenewalError.html +5 -5
- package/docs/api/classes/LockHeldError.html +5 -5
- package/docs/api/classes/LockNotOwnedError.html +5 -5
- package/docs/api/classes/NativeAdapter.html +3 -3
- package/docs/api/classes/OverloadedError.html +5 -5
- package/docs/api/classes/QueueCompletionError.html +5 -5
- package/docs/api/classes/RequestTimeoutError.html +5 -5
- package/docs/api/classes/RerouteError.html +5 -5
- package/docs/api/classes/StaleLeaseError.html +5 -5
- package/docs/api/classes/StalePolicyGenerationError.html +5 -5
- package/docs/api/functions/projectFlowQuery.html +1 -0
- package/docs/api/hierarchy.html +1 -1
- package/docs/api/index.html +35 -7
- package/docs/api/interfaces/AdminListOptions.html +1 -1
- package/docs/api/interfaces/CancelOptions.html +1 -1
- package/docs/api/interfaces/CompleteOptions.html +1 -1
- 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/FailOptions.html +1 -1
- 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/FlowEventProjectionField.html +4 -0
- package/docs/api/interfaces/FlowExplainResult.html +10 -0
- package/docs/api/interfaces/FlowPolicyOptions.html +1 -1
- package/docs/api/interfaces/FlowQueryCountResult.html +7 -0
- package/docs/api/interfaces/FlowQueryErrorPosition.html +4 -0
- package/docs/api/interfaces/FlowQueryIndex.html +9 -0
- package/docs/api/interfaces/FlowQueryIndexFormat.html +7 -0
- package/docs/api/interfaces/FlowQueryIndexRegistry.html +3 -0
- package/docs/api/interfaces/FlowQueryIndexStatus.html +8 -0
- package/docs/api/interfaces/FlowQueryPage.html +3 -0
- package/docs/api/interfaces/FlowQueryQuality.html +5 -0
- package/docs/api/interfaces/FlowQueryRecordsResult.html +8 -0
- package/docs/api/interfaces/FlowQueryUsage.html +12 -0
- package/docs/api/interfaces/FlowRunProjectionField.html +4 -0
- package/docs/api/interfaces/HistoryOptions.html +2 -2
- package/docs/api/interfaces/InvocationCreateOptions.html +1 -1
- package/docs/api/interfaces/LeaseMutationOptions.html +1 -1
- package/docs/api/interfaces/LimitListOptions.html +1 -1
- package/docs/api/interfaces/MutateOptions.html +1 -1
- package/docs/api/interfaces/NamedValueMutation.html +1 -1
- package/docs/api/interfaces/ProtocolCommand.html +2 -2
- package/docs/api/interfaces/ReadOptions.html +5 -3
- package/docs/api/interfaces/ReclaimOptions.html +1 -1
- package/docs/api/interfaces/RequestContextOptions.html +1 -1
- package/docs/api/interfaces/RetryOptions.html +1 -1
- package/docs/api/interfaces/RetryOutcome.html +1 -1
- package/docs/api/interfaces/SearchOptions.html +4 -3
- package/docs/api/interfaces/StepContinueOptions.html +1 -1
- package/docs/api/interfaces/TDigestCreateOptions.html +1 -1
- package/docs/api/interfaces/TDigestMergeOptions.html +1 -1
- package/docs/api/interfaces/TransitionOptions.html +1 -1
- 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/FlowProjectionField.html +1 -0
- package/docs/api/types/FlowProjectionShape.html +1 -0
- package/docs/api/types/FlowQueryInteger.html +1 -0
- package/docs/api/types/FlowQueryParameter.html +1 -0
- package/docs/api/types/FlowQueryParameters.html +1 -0
- package/docs/api/types/FlowQueryRecord.html +1 -0
- package/docs/api/types/FlowQueryResult.html +1 -0
- package/docs/api/types/ManagementPairs.html +1 -1
- package/docs/api/types/SearchStateMeta.html +1 -1
- package/docs/api/variables/COMMAND_OPCODES.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/FlowProjection.html +1 -0
- package/package.json +4 -3
package/README.md
CHANGED
|
@@ -18,11 +18,12 @@ 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.
|
|
22
|
-
breaking beta API contract update,
|
|
23
|
-
(`FSNP` framing and existing opcode
|
|
24
|
-
response-size limits are negotiated
|
|
25
|
-
startup response rather than inferred from
|
|
21
|
+
SDK `0.5.x` requires FerricStore server `0.11.0` or newer and is tested against
|
|
22
|
+
FerricStore `0.11.2`. FerricStore 0.11 is a breaking beta API contract update,
|
|
23
|
+
while the native wire protocol remains v1 (`FSNP` framing and existing opcode
|
|
24
|
+
numbers are unchanged). Capabilities and response-size limits are negotiated
|
|
25
|
+
per connection from the HELLO-shaped startup response rather than inferred from
|
|
26
|
+
a server version table.
|
|
26
27
|
|
|
27
28
|
ESM:
|
|
28
29
|
|
|
@@ -42,7 +43,50 @@ const { FerricStoreClient, JsonCodec } = require("@ferricstore/ferricstore");
|
|
|
42
43
|
docker run -p 6388:6388 \
|
|
43
44
|
-e FERRICSTORE_PROTECTED_MODE=false \
|
|
44
45
|
-v ferricstore_data:/data \
|
|
45
|
-
ghcr.io/ferricstore/ferricstore:0.
|
|
46
|
+
ghcr.io/ferricstore/ferricstore:0.11.2
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
## Query durable runs
|
|
50
|
+
|
|
51
|
+
Use parameterized FQL for bounded, partition-scoped reads. Cursors are opaque
|
|
52
|
+
and must be reused with the same query and parameters.
|
|
53
|
+
|
|
54
|
+
```ts
|
|
55
|
+
const client = await FerricStoreClient.fromUrl("ferric://127.0.0.1:6388");
|
|
56
|
+
const query = `FROM runs
|
|
57
|
+
WHERE partition_key = @partition AND type = @type AND state = @state
|
|
58
|
+
ORDER BY updated_at_ms ASC LIMIT 25 RETURN RECORDS`;
|
|
59
|
+
const params = { partition: "partition-a", type: "invoice", state: "queued" };
|
|
60
|
+
|
|
61
|
+
const result = await client.query(query, params);
|
|
62
|
+
const plan = await client.explain(query, params);
|
|
63
|
+
const indexes = await client.queryIndexes();
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
Each index reports `coveringFields`, which identifies the built-in and dynamic
|
|
67
|
+
`attribute.*` or `state_meta.*` fields that it can return without record
|
|
68
|
+
hydration. Its `format` values are opaque storage-generation identifiers; use
|
|
69
|
+
them to detect a rebuild requirement, not to decode server storage. The
|
|
70
|
+
`counter` format is absent for indexes without counters.
|
|
71
|
+
|
|
72
|
+
Select a sparse result map by adding up to 32 source-specific fields after
|
|
73
|
+
`RETURN RECORD` or `RETURN RECORDS`, for example
|
|
74
|
+
`RETURN RECORDS (run_id, state, attribute['customer'])`. A bare return keeps the
|
|
75
|
+
complete public record. Projection runs after authorization, authoritative
|
|
76
|
+
recheck, ordering, and cursor calculation: it reduces retained result data,
|
|
77
|
+
encoding, network, and client decoding work, but not index scans or hydration.
|
|
78
|
+
|
|
79
|
+
Use the source-aware builder to avoid hand-quoting result selectors:
|
|
80
|
+
|
|
81
|
+
```ts
|
|
82
|
+
const projected = projectFlowQuery(
|
|
83
|
+
"FROM runs WHERE partition_key = @partition AND run_id = @run",
|
|
84
|
+
"record",
|
|
85
|
+
FlowProjection.run.id,
|
|
86
|
+
FlowProjection.run.state,
|
|
87
|
+
FlowProjection.run.attribute("customer")
|
|
88
|
+
);
|
|
89
|
+
const result = await client.query(projected, { partition: "partition-a", run: "run-1" });
|
|
46
90
|
```
|
|
47
91
|
|
|
48
92
|
## Cluster-aware client
|
|
@@ -550,6 +594,15 @@ FERRICSTORE_INTEGRATION=1 npm run test:integration
|
|
|
550
594
|
npm run integration:down
|
|
551
595
|
```
|
|
552
596
|
|
|
597
|
+
Benchmark raw FQL and the record convenience layer against a live server. The default
|
|
598
|
+
comparison interleaves both paths and fails if either performs more than one `FLOW.QUERY`
|
|
599
|
+
or any `FLOW.GET` hydration per operation:
|
|
600
|
+
|
|
601
|
+
```bash
|
|
602
|
+
npm run build
|
|
603
|
+
npm run bench:flow-query -- --requests 500 --concurrency 2 --rows 100 --pretty
|
|
604
|
+
```
|
|
605
|
+
|
|
553
606
|
Generate API docs with:
|
|
554
607
|
|
|
555
608
|
```bash
|