CareflowDocumentation

.NET SDK Change Log

All notable changes to this project will be documented in this file.

[4.0.0] - 2026-10-14

Changed

  • GetDeploymentAsync now matches the renamed catalogue keys: DeploymentModel.Images is now Artifacts (wire artifacts), and DeploymentImage, DeploymentImageTopics and DeploymentImageConfiguration are now DeploymentArtifact, DeploymentArtifactTopics and DeploymentArtifactConfiguration. DeploymentArtifact.ArtifactId (wire artifact_id) replaces ImageId.

Removed

  • DeploymentImage.DeploymentImageId. The backend no longer returns deployment_image_id; use DeploymentInstanceId.
  • PipelineCommands.StatusGet, deprecated in 3.0.0; use PipelineCommands.RunStatus.

[3.0.0] - 2026-09-28

Added

  • PipelineCommands.DeploymentStatus, ArtifactGet and RunStatus.
  • ClientOptions.Logger: optional ILogger for SDK warnings (adds Microsoft.Extensions.Logging.Abstractions 8.0.3).

Changed

  • ConnectorRecord.Offset is now long? instead of int?, so offsets above int.MaxValue no longer fail deserialization.
  • DeploymentStorage.StorageType and DatabaseType are now the StorageType and DatabaseType enums instead of strings. Unrecognised values deserialize as Unknown.

Deprecated

  • PipelineCommands.StatusGet, now an alias of RunStatus (the broker renamed pipeline.status.get to pipeline.run.status); use RunStatus.
  • IAppService.PublishAsync, SubscribeAsync and FlushAsync; use client.Connector instead. They now call the connector service, so they require ConnectorBaseUrl, ConnectorSecret and mTLS settings, and log a warning on first use. Return types are unchanged, but subscribe now returns one connector page per call instead of every waiting record.

Removed

  • IAppService.ControlAsync and GetStreamUrlAsync, with ControlParams, GetStreamUrlParams and StreamUrlData. GetStreamUrlAsync's endpoint never existed; ControlAsync had no deployed consumer.

[2.8.1] - 2026-09-16

Changed

  • App and pipeline requests are now signed by default: RequireSigning defaults to true on all nine Models/Apps/*Params records and on ExecuteParams. The controller rejects unsigned App requests, so the previous false default produced requests that could not succeed; callers already setting RequireSigning = true are unaffected. Set RequireSigning = false to suppress the HMAC headers and exercise the rejection path. Signing requires ClientId/ClientSecret, so a client configured without them now throws CareflowInvalidDataException when the request is built rather than being rejected by the broker. Matches the same change in the Python SDK.

[2.8.0] - 2026-09-14

Added

  • client.Pipeline (IPipelineService/PipelineService) — a command-dispatch namespace alongside App and Connector. ExecuteAsync(new ExecuteParams { Command, Parameters, RequireSigning }) posts to POST /api/v1/pipeline, reusing App HMAC authentication (opt-in via RequireSigning, matching client.App). There is no per-command response model, so commands the broker adds later work without an SDK release. PipelineCommands lists the commands known today (DeploymentGet, DeploymentList, StatusGet, RunStart, RunStop) for autocomplete only — Command accepts any non-empty string.

Fixed

  • ConnectorSubscribeResult.DataSetMeta (and FlushAsync's result) is no longer null for multi-word fields. SubscribeAsync/FlushAsync hit the Java-based data-connector service, which returns camelCase fields (dataSetMeta, dataType, createdTime, lastModifiedTime), but the SDK previously deserialized every response with the shared snake_case naming policy, so these fields never matched and silently bound to null. These two calls now deserialize with camelCase naming instead; single-word fields (Records, Total) are unaffected.

[2.7.0] - 2026-09-09

Fixed

  • IStreamingService.ConnectAsync now correctly preserves a subpath segment in CAREFLOW_SDK_WS_GATEWAY_BASE_URL (e.g. wss://host/wsgateway) when building the WebSocket connection URL. Previously, the path was replaced outright rather than appended to, so the connection always dropped any subpath and went to <scheme>://<host>/ws regardless of what was configured. Bare-host base URLs (no path segment) are unaffected.

[2.6.0] - 2026-08-31

Added

  • DeploymentImage.Storages — GetDeploymentAsync now returns a DeploymentStorage[]? per image, exposing storage/database provisioning metadata (Label, StorageType, DatabaseType, Size, Provider, Version, InstanceType, RootDiskSize, ShareKey, IsPrimaryShare).

Fixed

  • Request URLs and HMAC signing now correctly preserve a subpath segment in AppBaseUrl/ConnectorBaseUrl (e.g. https://host/controller). Previously, a leading-slash relative route was treated as an absolute path and silently dropped the base URL's path segment, and the signing canonical string always used the raw route instead of the actual combined path — both broke authentication against any subpath-mounted deployment. Bare-host base URLs (no path segment) are unaffected.

[2.5.0] - 2026-07-14

Changed

  • Bumped Careflow.WsGateway dependency to 1.2.0. Streaming reconnection now survives unexpected errors (malformed messages, invalid auth responses, transport-level IO errors) instead of terminating the stream — errors are reported via ConnectOptions.OnError and retried per the reconnect policy. A single malformed message is skipped rather than dropping the connection.
  • Idle streaming connections now send WebSocket keep-alive frames (ConnectOptions.KeepAliveInterval, default 15 seconds) so dead connections are detected and reconnected instead of hanging, complementing the gateway's server-side ping/pong liveness checks.
  • WsInvalidTopicException is now always terminal, including when reconnecting with a session token.

[2.4.0] - 2026-06-24

Added

  • Streaming now supports skipping the backlog: set ConnectParams.SeekToLatest = true on IStreamingService.ConnectAsync to receive only data published after the connection is established (the gateway seeks the consumer to the latest offset on assignment). Defaults to false (existing replay behavior).

Changed

  • Bumped Careflow.WsGateway dependency to 1.1.0 (adds ConnectParams.SeekToLatest).

Fixed

  • WithOptions no longer creates a brand-new HttpClient for each copy when none was injected. Copies now reuse the original client's internal HttpClient — matching the behavior when one is injected — preventing socket/handler exhaustion from repeated WithOptions calls. A copy still gets its own client if it injects one or changes a TLS/certificate option (VerifySsl, Cert, Key, CaBundlePath).

[2.3.0] - 2026-06-18

Added

  • CareflowMissingProjectException — thrown by RequestPatientsAsync when no project is assigned to the app (server responseStatus.code 611, _MISSING_PROJECT).
  • CareflowMissingPatientListException — thrown by RequestPatientsAsync when a project is assigned but no patient list is configured, either because the project has no associated patient list or its patient-list topic has not been assigned (server responseStatus.code 612, _MISSING_PATIENT_LIST).

Changed

  • CareflowExceptionFactory now maps the 611 and 612 responseStatus codes to the two exceptions above; previously these surfaced as a generic CareflowUnexpectedStatusCodeException. The controller server now returns these codes instead of a successful response with null/empty topics, so a patient request against an unconfigured app raises a typed exception rather than returning an empty result.

[2.2.0] - 2026-06-10

Added

  • IConnectorService.FlushAsync — flushes a connector topic's index to the latest offset via GET /data-stream/subscribe with seekToLatest=true; includes Connectors.FlushParams (topic + optional client secret) and reuses ConnectorSubscribeResult (returns an empty result with Total of 0). Prefer this over SubscribeAsync when you only need to advance the read position.
  • IAppService.FlushAsync — App-service equivalent via GET /api/v1/deployment/subscribe with seekToLatest=true; includes Apps.FlushParams (topic, HMAC signing supported) and returns AppSubscribeResult.
  • Connectors.SubscribeParams.SeekToLatest and Apps.SubscribeParams.SeekToLatest — optional query parameter exposing the new Subscribe API flag (defaults to omitted, i.e. false).

Changed

  • Apps.RequestPatientsParams.RequireSigning now defaults to false, consistent with every other App parameter model (previously true). Callers that relied on the implicit signing default must now set RequireSigning = true explicitly.

[2.1.0] - 2026-06-02

Added

  • IAppService.RequestPatientsAsync — triggers a patient list feed through Careflow Publisher and returns matched topics via GET /api/v1/patients/request; includes RequestPatientsParams (HMAC signing enabled by default) and PatientsRequestResult with PatientTopic[]

[2.0.0] - 2026-05-25

Websocket related logic has been delegated to its own package. It is included as part of the Careflow.Sdk package.

Breaking Changes

  • IAppService.GetPatientsAsync and related models (PatientsData, Patient, PatientRecord, GetPatientsParams) — will come from a topic instead
  • WebSocket gateway functionality extracted to standalone Careflow.WsGateway package (v1.0.0)
  • StreamParams renamed to ConnectParams (namespace: Careflow.WsGateway)
  • StreamOptions renamed to ConnectOptions (namespace: Careflow.WsGateway)
  • WsMessage moved to Careflow.WsGateway.Models namespace
  • WsAuthenticationException, WsInvalidTopicException, WsReconnectExhaustedException moved to Careflow.WsGateway.Exceptions namespace
  • IStreamingService.ConnectAsync parameters now use gateway SDK types

Fixed

  • Streaming reconnect backoff no longer grows unboundedly across multiple disconnect cycles — the attempt counter now resets after each successful connection
  • Streaming reconnect no longer terminates permanently when a stale session token is rejected on re-authentication; the client now retries with fresh credentials
  • CareflowApiException.Message no longer includes the verbose .NET exception prefix — it now returns only the API response body
  • HttpResponse.Deserialize<T> now detects HTML error responses (by Content-Type: text/html or a < prefix) and throws a typed CareflowException instead of CareflowInvalidDataException
  • responseStatus.message arrays (field validation errors) now throw CareflowValidationException with a structured IReadOnlyList<FieldError> instead of being flattened into a single string; FieldError exposes Param and Message properties

[1.0.4] - 2026-05-13

Fixed

  • Removed default value on CAREFLOW_SDK_WS_GATEWAY_BASE_URL

[1.0.3] - 2026-05-11 (ARCHIVED)

Added

  • IAppService.GetPatientsAsync — retrieve the list of patients for the app via GET /api/v1/patients; includes GetPatientsParams with RequireSigning support
  • IStreamingService — new service for WebSocket streaming, accessible via client.Streaming
  • IStreamingService.ConnectAsync — real-time WebSocket streaming via IAsyncEnumerable<WsMessage>, connecting directly to the WsGateway using ConnectorSecret; supports multiple topics in a single connection
  • StreamParams (with Topics string[]), WsMessage, StreamOptions model records
  • WsAuthenticationException, WsInvalidTopicException (with Topics string[]), WsReconnectExhaustedException exceptions
  • Patient and PatientRecord models populated with full response field definitions
  • BooleanConverter added to HttpResponse deserializer to handle DB-backed TINYINT(1) fields arriving as integers rather than JSON booleans

[1.0.2] - 2026-04-23

Fixed

  • Environment variables for mTLS paths now correctly treat empty or whitespace values as unset
  • Added null/whitespace validation on mTLS environment variables (CAREFLOW_SDK_CLIENT_CERT_PATH, CAREFLOW_SDK_CLIENT_KEY_PATH)

[1.0.1] - 2026-04-10

Changed

  • Updated SDK .csproj to include NuGet package metadata for publishing

[1.0.0] - 2026-04-01

Added

  • Initial release
  • CareflowClient with App and Connector service endpoints
  • mTLS support via certificate/key file paths
  • HMAC-SHA256 request signing
  • Pub/sub support for connector topics
  • HTTP status exceptions for structured error handling