@ferricstore/ferricstore 0.1.3 → 0.1.5

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.
Files changed (74) hide show
  1. package/README.md +37 -1
  2. package/dist/index.cjs +1264 -36
  3. package/dist/index.cjs.map +1 -1
  4. package/dist/index.d.cts +277 -6
  5. package/dist/index.d.ts +277 -6
  6. package/dist/index.js +1259 -36
  7. package/dist/index.js.map +1 -1
  8. package/docs/api/assets/hierarchy.js +1 -1
  9. package/docs/api/assets/highlight.css +6 -6
  10. package/docs/api/assets/navigation.js +1 -1
  11. package/docs/api/assets/search.js +1 -1
  12. package/docs/api/classes/FerricStoreClient.html +19 -2
  13. package/docs/api/classes/FerricStoreError.html +3 -3
  14. package/docs/api/classes/FlowAlreadyExistsError.html +3 -3
  15. package/docs/api/classes/FlowNotFoundError.html +3 -3
  16. package/docs/api/classes/FlowWrongStateError.html +3 -3
  17. package/docs/api/classes/InvalidCommandError.html +3 -3
  18. package/docs/api/classes/LockHeldError.html +3 -3
  19. package/docs/api/classes/LockNotOwnedError.html +3 -3
  20. package/docs/api/classes/NativeAdapter.html +3 -2
  21. package/docs/api/classes/OverloadedError.html +3 -3
  22. package/docs/api/classes/ReconnectingExecutor.html +7 -0
  23. package/docs/api/classes/RoutingTopology.html +9 -0
  24. package/docs/api/classes/StaleLeaseError.html +3 -3
  25. package/docs/api/classes/TopologyNativeAdapterPool.html +8 -0
  26. package/docs/api/functions/isReconnectableClosedConnectionError.html +1 -0
  27. package/docs/api/hierarchy.html +1 -1
  28. package/docs/api/index.html +16 -7
  29. package/docs/api/interfaces/AutoBatchOptions.html +2 -2
  30. package/docs/api/interfaces/CancelOptions.html +2 -2
  31. package/docs/api/interfaces/ClaimDueOptions.html +2 -2
  32. package/docs/api/interfaces/ClaimedItem.html +2 -3
  33. package/docs/api/interfaces/CommandExecutor.html +4 -2
  34. package/docs/api/interfaces/CompleteOptions.html +2 -2
  35. package/docs/api/interfaces/CompleteOutcome.html +1 -1
  36. package/docs/api/interfaces/CreateManyOptions.html +2 -2
  37. package/docs/api/interfaces/CreateOptions.html +2 -2
  38. package/docs/api/interfaces/ExecutePipelineOptions.html +2 -2
  39. package/docs/api/interfaces/FailOptions.html +2 -2
  40. package/docs/api/interfaces/FailOutcome.html +1 -1
  41. package/docs/api/interfaces/FencedItem.html +2 -2
  42. package/docs/api/interfaces/FerricStoreClientFromUrlOptions.html +6 -0
  43. package/docs/api/interfaces/FerricStoreClientOptions.html +2 -2
  44. package/docs/api/interfaces/FetchOrComputeResult.html +2 -2
  45. package/docs/api/interfaces/FlowRecord.html +2 -2
  46. package/docs/api/interfaces/KeyInfo.html +2 -2
  47. package/docs/api/interfaces/MutateOptions.html +2 -2
  48. package/docs/api/interfaces/NamedValueMutation.html +1 -1
  49. package/docs/api/interfaces/NativeAdapterOptions.html +12 -2
  50. package/docs/api/interfaces/ProtocolCommand.html +5 -0
  51. package/docs/api/interfaces/RateLimitResult.html +2 -2
  52. package/docs/api/interfaces/ReadOptions.html +2 -2
  53. package/docs/api/interfaces/ReclaimOptions.html +2 -2
  54. package/docs/api/interfaces/ReconnectOptions.html +2 -0
  55. package/docs/api/interfaces/RetryOptions.html +2 -2
  56. package/docs/api/interfaces/RetryOutcome.html +1 -1
  57. package/docs/api/interfaces/RoutingEndpoint.html +5 -0
  58. package/docs/api/interfaces/RoutingRoute.html +7 -0
  59. package/docs/api/interfaces/SearchOptions.html +12 -0
  60. package/docs/api/interfaces/TDigestCreateOptions.html +1 -1
  61. package/docs/api/interfaces/TDigestMergeOptions.html +1 -1
  62. package/docs/api/interfaces/TransitionOptions.html +2 -2
  63. package/docs/api/interfaces/TransitionOutcome.html +1 -1
  64. package/docs/api/modules.html +1 -1
  65. package/docs/api/types/CommandArgument.html +1 -1
  66. package/docs/api/types/EndpointPolicy.html +1 -0
  67. package/docs/api/types/ManagementPairs.html +1 -0
  68. package/docs/api/types/QueueBatchHandler.html +1 -1
  69. package/docs/api/types/QueueHandler.html +1 -1
  70. package/docs/api/types/QueueJob.html +1 -0
  71. package/docs/api/types/SearchStateMeta.html +1 -0
  72. package/docs/api/variables/COMMAND_OPCODES.html +1 -0
  73. package/docs/python-parity.md +4 -1
  74. package/package.json +1 -1
package/README.md CHANGED
@@ -34,7 +34,43 @@ const { FerricStoreClient, JsonCodec } = require("@ferricstore/ferricstore");
34
34
  docker run -p 6388:6388 \
35
35
  -e FERRICSTORE_PROTECTED_MODE=false \
36
36
  -v ferricstore_data:/data \
37
- ghcr.io/ferricstore/ferricstore:0.6.0
37
+ ghcr.io/ferricstore/ferricstore:0.7.2
38
+ ```
39
+
40
+ ## Cluster-aware client
41
+
42
+ For a single node, use `fromUrl`. For a FerricStore cluster, pass multiple seed URLs. The SDK fetches the server `SHARDS` topology, routes keyed commands to the current shard leader, and refuses learned hosts outside the seed-host trust set by default.
43
+
44
+ ```ts
45
+ const flow = await FerricStoreClient.fromUrls(
46
+ [
47
+ "ferric://fs0.example.com:6388",
48
+ "ferric://fs1.example.com:6388",
49
+ "ferric://fs2.example.com:6388"
50
+ ],
51
+ {
52
+ codec: new JsonCodec(),
53
+ nativeOptions: {
54
+ // Use "any" only inside a trusted private network.
55
+ endpointPolicy: "seed_hosts",
56
+ warmConnections: true
57
+ }
58
+ }
59
+ );
60
+
61
+ await flow.refreshTopology();
62
+ console.log(await flow.route("tenant-a:order-1"));
63
+ ```
64
+
65
+ You can also keep one primary URL and add seeds:
66
+
67
+ ```ts
68
+ const flow = await FerricStoreClient.fromUrl("ferric://fs0.example.com:6388", {
69
+ nativeOptions: {
70
+ haRouting: true,
71
+ seeds: ["ferric://fs1.example.com:6388", "ferric://fs2.example.com:6388"]
72
+ }
73
+ });
38
74
  ```
39
75
 
40
76
  ## Durable Queue