@ferricstore/ferricstore 0.5.2 → 0.11.4

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 (111) hide show
  1. package/README.md +44 -5
  2. package/dist/index.cjs +825 -298
  3. package/dist/index.cjs.map +1 -1
  4. package/dist/index.d.cts +90 -26
  5. package/dist/index.d.ts +90 -26
  6. package/dist/index.js +825 -298
  7. package/dist/index.js.map +1 -1
  8. package/docs/api/assets/hierarchy.js +1 -1
  9. package/docs/api/assets/navigation.js +1 -1
  10. package/docs/api/assets/search.js +1 -1
  11. package/docs/api/classes/ConnectionClosedError.html +1 -1
  12. package/docs/api/classes/FerricStoreClient.html +3 -3
  13. package/docs/api/classes/FerricStoreError.html +1 -1
  14. package/docs/api/classes/FlowAlreadyExistsError.html +1 -1
  15. package/docs/api/classes/FlowBatchError.html +1 -1
  16. package/docs/api/classes/FlowNotFoundError.html +1 -1
  17. package/docs/api/classes/FlowQueryError.html +1 -1
  18. package/docs/api/classes/FlowWrongStateError.html +1 -1
  19. package/docs/api/classes/InvalidCommandError.html +1 -1
  20. package/docs/api/classes/LeaseRenewalError.html +1 -1
  21. package/docs/api/classes/LockHeldError.html +1 -1
  22. package/docs/api/classes/LockNotOwnedError.html +1 -1
  23. package/docs/api/classes/OverloadedError.html +1 -1
  24. package/docs/api/classes/QueueCompletionError.html +1 -1
  25. package/docs/api/classes/RequestTimeoutError.html +1 -1
  26. package/docs/api/classes/RerouteError.html +1 -1
  27. package/docs/api/classes/StaleLeaseError.html +1 -1
  28. package/docs/api/classes/StalePolicyGenerationError.html +1 -1
  29. package/docs/api/hierarchy.html +1 -1
  30. package/docs/api/index.html +34 -5
  31. package/docs/api/interfaces/AdminListOptions.html +2 -2
  32. package/docs/api/interfaces/ApprovalListOptions.html +2 -2
  33. package/docs/api/interfaces/ApprovalRequestOptions.html +2 -2
  34. package/docs/api/interfaces/AttributeQueryOptions.html +2 -2
  35. package/docs/api/interfaces/AutoBatchOptions.html +2 -2
  36. package/docs/api/interfaces/BudgetCommitOptions.html +2 -2
  37. package/docs/api/interfaces/BudgetReserveOptions.html +2 -2
  38. package/docs/api/interfaces/CancelOptions.html +2 -2
  39. package/docs/api/interfaces/CircuitOpenOptions.html +2 -2
  40. package/docs/api/interfaces/ClaimDueOptions.html +3 -3
  41. package/docs/api/interfaces/ClaimHydrationItem.html +2 -2
  42. package/docs/api/interfaces/CompleteJobsAndClaimJobsResult.html +6 -6
  43. package/docs/api/interfaces/CompleteManyOptions.html +2 -2
  44. package/docs/api/interfaces/CompleteOptions.html +2 -2
  45. package/docs/api/interfaces/CompleteOutcome.html +1 -1
  46. package/docs/api/interfaces/CreateManyOptions.html +5 -5
  47. package/docs/api/interfaces/CreateOptions.html +3 -3
  48. package/docs/api/interfaces/EffectCompensateOptions.html +2 -2
  49. package/docs/api/interfaces/EffectConfirmOptions.html +2 -2
  50. package/docs/api/interfaces/EffectFailOptions.html +2 -2
  51. package/docs/api/interfaces/EffectReserveOptions.html +2 -2
  52. package/docs/api/interfaces/EffectStatusOptions.html +2 -2
  53. package/docs/api/interfaces/ExtendLeaseOptions.html +2 -2
  54. package/docs/api/interfaces/FailOptions.html +2 -2
  55. package/docs/api/interfaces/FailOutcome.html +1 -1
  56. package/docs/api/interfaces/FerricStoreClientFromUrlOptions.html +4 -4
  57. package/docs/api/interfaces/FerricStoreClientOptions.html +4 -4
  58. package/docs/api/interfaces/FlowBatchCompletedItem.html +2 -2
  59. package/docs/api/interfaces/FlowPolicyOptions.html +5 -5
  60. package/docs/api/interfaces/FlowQueryCountResult.html +1 -1
  61. package/docs/api/interfaces/FlowQueryIndexBuild.html +1 -1
  62. package/docs/api/interfaces/FlowQueryIndexProgress.html +1 -1
  63. package/docs/api/interfaces/FlowQueryIndexValidation.html +1 -1
  64. package/docs/api/interfaces/FlowQueryRecordsResult.html +1 -1
  65. package/docs/api/interfaces/FlowStatePolicy.html +2 -2
  66. package/docs/api/interfaces/FlowStatsOptions.html +2 -2
  67. package/docs/api/interfaces/GovernanceLedgerOptions.html +2 -2
  68. package/docs/api/interfaces/HistoryOptions.html +2 -2
  69. package/docs/api/interfaces/InvocationCreateOptions.html +2 -2
  70. package/docs/api/interfaces/LeaseMutationOptions.html +2 -2
  71. package/docs/api/interfaces/LimitAmountOptions.html +2 -2
  72. package/docs/api/interfaces/LimitLeaseOptions.html +2 -2
  73. package/docs/api/interfaces/LimitListOptions.html +2 -2
  74. package/docs/api/interfaces/LimitReleaseOptions.html +2 -2
  75. package/docs/api/interfaces/MutateOptions.html +2 -2
  76. package/docs/api/interfaces/NamedValueMutation.html +1 -1
  77. package/docs/api/interfaces/ReadOptions.html +3 -3
  78. package/docs/api/interfaces/ReclaimOptions.html +2 -2
  79. package/docs/api/interfaces/RequestContext.html +2 -2
  80. package/docs/api/interfaces/RequestContextOptions.html +2 -2
  81. package/docs/api/interfaces/RetryOptions.html +2 -2
  82. package/docs/api/interfaces/RetryOutcome.html +1 -1
  83. package/docs/api/interfaces/RunStepsItem.html +2 -2
  84. package/docs/api/interfaces/RunStepsManyOptions.html +2 -2
  85. package/docs/api/interfaces/ScheduleFireDueOptions.html +3 -2
  86. package/docs/api/interfaces/ScheduleFireOptions.html +3 -0
  87. package/docs/api/interfaces/ScheduleListOptions.html +2 -2
  88. package/docs/api/interfaces/ScheduleOptions.html +4 -2
  89. package/docs/api/interfaces/SearchOptions.html +3 -3
  90. package/docs/api/interfaces/StartAndClaimOptions.html +3 -3
  91. package/docs/api/interfaces/StepContinueOptions.html +3 -3
  92. package/docs/api/interfaces/TDigestCreateOptions.html +1 -1
  93. package/docs/api/interfaces/TDigestMergeOptions.html +1 -1
  94. package/docs/api/interfaces/TransitionOptions.html +2 -2
  95. package/docs/api/interfaces/TransitionOutcome.html +1 -1
  96. package/docs/api/modules.html +1 -1
  97. package/docs/api/types/ConnectionRequestDisposition.html +1 -1
  98. package/docs/api/types/FlowStateMode.html +1 -1
  99. package/docs/api/types/FlowStatePolicyLike.html +1 -1
  100. package/docs/api/types/ManagementPairs.html +1 -1
  101. package/docs/api/types/ScheduleCatchupPolicy.html +2 -0
  102. package/docs/api/types/ScheduleFireDueResult.html +3 -0
  103. package/docs/api/types/ScheduleFireResult.html +2 -0
  104. package/docs/api/types/ScheduleKind.html +1 -0
  105. package/docs/api/types/ScheduleOverlapPolicy.html +1 -0
  106. package/docs/api/types/ScheduleRecord.html +12 -0
  107. package/docs/api/types/ScheduleState.html +1 -0
  108. package/docs/api/types/SearchStateMeta.html +1 -1
  109. package/docs/api/variables/FERRICSTORE_MINIMUM_SERVER_VERSION.html +1 -1
  110. package/docs/api/variables/FERRICSTORE_SDK_VERSION.html +1 -1
  111. package/package.json +2 -2
package/README.md CHANGED
@@ -18,10 +18,10 @@ 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.5.x` requires FerricStore server `0.11.0` or newer and is tested against
22
- FerricStore `0.11.3`. 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
21
+ TypeScript SDK `0.11.4` requires FerricStore server `0.11.4` or newer because
22
+ schedule responses now use the complete recurrence contract. The native wire
23
+ protocol remains v1 (`FSNP` framing and existing opcode numbers are unchanged).
24
+ Capabilities and response-size limits are negotiated
25
25
  per connection from the HELLO-shaped startup response rather than inferred from
26
26
  a server version table.
27
27
 
@@ -43,7 +43,7 @@ const { FerricStoreClient, JsonCodec } = require("@ferricstore/ferricstore");
43
43
  docker run -p 6388:6388 \
44
44
  -e FERRICSTORE_PROTECTED_MODE=false \
45
45
  -v ferricstore_data:/data \
46
- ghcr.io/ferricstore/ferricstore:0.11.3
46
+ ghcr.io/ferricstore/ferricstore:0.11.4
47
47
  ```
48
48
 
49
49
  ## Query durable runs
@@ -428,6 +428,45 @@ await flow.scheduleCreate("orders-every-five-minutes", {
428
428
  });
429
429
  ```
430
430
 
431
+ Overdue interval schedules use bounded `fire_once` catch-up. Recovery creates
432
+ one target, coalesces additional elapsed periods in constant time, and sets the
433
+ next run one full interval after recovery:
434
+
435
+ ```ts
436
+ const schedule = await flow.scheduleCreate("billing-sweep", {
437
+ catchupPolicy: "fire_once",
438
+ everyMs: 60_000,
439
+ kind: "interval",
440
+ overlapPolicy: "queue_after_previous",
441
+ target: { id_prefix: "billing-sweep", type: "billing" }
442
+ });
443
+ ```
444
+
445
+ `ScheduleRecord` exposes the complete recurrence configuration through
446
+ `created_at_ms`, `every_ms`, `cron`, `timezone`, `overlap_policy`, and
447
+ `overlap_retry_ms`, in addition to `catchup_policy`, `coalesced_count`,
448
+ `last_coalesced_count`, `last_catchup_at_ms`, and `last_planning_error`, using
449
+ the server's canonical field names. Non-applicable recurrence fields are
450
+ `null`, not omitted. `scheduleFireDue()` returns
451
+ `ScheduleFireDueResult`, including the
452
+ batch `coalesced` total. Its `errors` entries correspond to claimed schedules;
453
+ `claim_error` separately reports a failure to request a later wave after
454
+ completed outcomes were preserved. Catch-up handles scheduler delay; overlap
455
+ policy separately handles a previous target that is still active. `fire_once` is the
456
+ default and only catch-up policy for intervals; other schedule kinds reject it.
457
+ The built-in server scheduler normally owns due execution. Call
458
+ `scheduleFireDue()` only for tests, administration, or a deployment that
459
+ deliberately disables the built-in runner and supplies a custom one.
460
+
461
+ Recurring targets reject a fixed `id`. Set `id_prefix` to choose their
462
+ generated prefix, or omit it to use the schedule ID. `ScheduleState` includes
463
+ the transient `"running"` state used while the server holds a due-execution
464
+ lease. Bounded catch-up is interval-only; overdue cron schedules advance one
465
+ matching occurrence per successful automatic fire.
466
+ When planning fails, `state` is `"failed"`, `end_reason` is
467
+ `"planning_failed"`, and `last_planning_error` contains the actionable error.
468
+ `scheduleDelete()` resolves to `undefined` only after an `OK` server reply.
469
+
431
470
  FIFO Flow state policy is opt-in per state:
432
471
 
433
472
  ```ts