Update to Chronicle 17.0.4 wire contracts - #61
Merged
Conversation
Cratis.Chronicle 17.0.4 replaced every hand-written gRPC service with ones generated from Arc [Command]/[ReadModel] artifacts: most RPC methods were renamed, request/response messages reshaped, and responses now travel inside a CommandResult/QueryResult envelope (validation results, exceptions, authorization) instead of bare payloads. EventSequences in particular split into a single-event-source AppendMany and a new AppendManyForEventSources for the multi-source batch this client already supported. - Bump @cratis/chronicle.contracts to 17.0.4. - Add ensureCommandResponse to callResults.ts for commands whose envelope carries a Response payload (Append, AppendMany, CompleteStream), alongside the existing ensureCommandSuccess/ensureQuerySuccess helpers. - Follow every RPC rename and reshape: EventTypes.register -> registerEventTypes, Webhooks add/remove -> addWebhooks/removeWebhooks (dropped the unused Owner field), EventSeeding.seed -> seedEvents, ReadModels.getSnapshotsByKey moved to the new ReadModelExplorer.allSnapshotsForReadModel service, AllEventStores/ AllNamespaces/AllJobs stopped streaming, and EventType filters on EventSequences queries collapsed from EventType[] to a comma-joined EventTypeIds string (mirrors the C# client's JoinEventTypeIds). - Reshape Append/AppendMany event content from a serialized JSON string to a parsed JSON object, matching the wire's new structured Content field. - Wire up the new ReadModelExplorer client end to end (ChronicleServices, ChronicleConnection). This is a breaking change for consumers only insofar as it requires the 17.0.4 kernel; the public TypeScript API is unchanged.
AllNamespaces stopped streaming in the 17.0.4 wire migration (observing was split out into a separate ObserveNamespaces RPC), so the snippet's stream-and- take-first pattern no longer compiles against the new client.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Changed
@cratis/chronicle.contracts17.0.4, matching Chronicle's wire-contract migration where every gRPC service moved to ones generated from Arc[Command]/[ReadModel]artifacts. Most RPC methods were renamed and responses now travel inside aCommandResult/QueryResultenvelope instead of bare payloads.EventSequence.appendMany(multi-event-source overload) now calls the newAppendManyForEventSourcesRPC; the wire's ownAppendManybecame single-event-source only.EventSequencesqueries (getTailSequenceNumber,getForEventSourceIdAndEventTypes,getFromSequenceNumber) now send a comma-joined list of event type ids instead of full event type objects, matching the C# client.ReadModels.getSnapshotsByIdnow calls the newReadModelExplorer.allSnapshotsForReadModelservice.Webhooks.registerDiscovered/register/removefollow the renamedaddWebhooks/removeWebhooksRPCs (theOwnerfield was dropped from the wire).EventSeeding.seed->seedEvents;EventTypes.register->registerEventTypes.AllEventStores/AllNamespaces/AllJobsstopped streaming; each now resolves a single response.Fixed
Contentfield (previously type-checked but would have serialized incorrectly at runtime).Important
This requires the Chronicle 17.0.4 kernel or later. The public TypeScript API surface is unchanged.
Test plan
yarn ci(clean + build) — zero errorsyarn test— 275/275 relevant specs pass (one pre-existing, unrelated@cratis/fundamentalspeer-range drift failure, not touched by this change)🤖 Generated with Claude Code