Skip to content

feat: add HTTP request logging, SSE parsing utilities, and expand enums#174

Open
fern-api[bot] wants to merge 1 commit intomasterfrom
fern-bot/2026-04-13T18-32Z
Open

feat: add HTTP request logging, SSE parsing utilities, and expand enums#174
fern-api[bot] wants to merge 1 commit intomasterfrom
fern-bot/2026-04-13T18-32Z

Conversation

@fern-api
Copy link
Copy Markdown
Contributor

@fern-api fern-api bot commented Apr 13, 2026

Version Bump: Removing LinkBulkExportRequestTeamId, LinkBulkImportRequestTeamId, LinkBulkPauseRequestTeamId, LinkBulkTriggerHistoricalPullRequestTeamId, LinkListBulkOpsRequestTeamId, removing the INSULIN_INJECTION enum member (breaking visit() call sites), and changing AppointmentPscLabs from a Literal type alias to a class are all breaking changes for existing callers.

  • Several breaking changes are included in this release:

  • The LinkBulkExportRequestTeamId, LinkBulkImportRequestTeamId, LinkBulkPauseRequestTeamId, LinkBulkTriggerHistoricalPullRequestTeamId, and LinkListBulkOpsRequestTeamId enum types have been removed from vital.link. Update any code that imports or references these types.

  • The INSULIN_INJECTION member has been removed from IntervalTimeseriesExprTimeseries. Callers using .visit(insulin_injection=...) must remove that argument.

  • AppointmentPscLabs has changed from Literal["quest"] to a StrEnum; code that compares against the string "quest" directly should use AppointmentPscLabs.QUEST instead.

New in this release: HTTP request/response logging with automatic sensitive-header redaction is now available via LogConfig/Logger, a status_code property has been added to BaseHttpResponse, and AppointmentPscLabs now includes the new SONORA_QUEST value.

  • Breaking changes:

  • The file parameter of parser_create_job (on both LabReportClient and AsyncLabReportClient) has changed from core.File to typing.List[core.File]. Callers must now pass a list, e.g. replace file=my_file with file=[my_file].

  • The following types have been removed from the top-level vital namespace: LinkBulkExportRequestTeamId, LinkBulkImportRequestTeamId, LinkBulkPauseRequestTeamId, LinkBulkTriggerHistoricalPullRequestTeamId, and LinkListBulkOpsRequestTeamId.

New capabilities:

The SDK now exposes three new submodules — vital.compendium, vital.lab_account, and vital.order_transaction — along with many new types including CanonicalCandidate, ClientFacingLabAccount, ClientFacingOrderTransaction, OrderSummary, OrderStatusDetail, SearchCompendiumResponse, UsState, UserAddress, and others. An optional logging parameter is now accepted by the client wrappers.

  • The SDK now supports additional optional parameters across lab test and appointment methods. New lab_slug and lab_account_id parameters are available on lab test create/update and get_markers methods; order_transaction_id can now be used to filter order listings; appointment_notes and clinical_notes fields are available on phlebotomy appointment requests and order creation respectively. The get_psc_appointment_availability method now accepts a required lab parameter (of type AppointmentPscLabs) and an optional allow_stale flag, and book_psc_appointment supports optional idempotency_key and idempotency_error parameters. Two new types, AppointmentPscLabs and Labs, are now exported from the SDK.
  • The get_psc_appointment_availability method now requires a lab parameter of type AppointmentPscLabs (previously the lab was hardcoded to "quest"). Callers must now pass lab=AppointmentPscLabs(...) explicitly.

Several new optional parameters have also been added across lab test and order APIs: lab_slug and lab_account_id on lab test create/update, lab_slug on get_markers, order_transaction_id on order listing, appointment_notes on PSC appointment reschedule, clinical_notes on order creation, and idempotency_key/idempotency_error on PSC appointment booking. Two new types (AppointmentPscLabs, Labs) are now available.

  • The team_id parameter has been removed from the following link client methods: list_bulk_ops, bulk_import, bulk_trigger_historical_pull, bulk_export, and bulk_pause. Callers passing team_id must remove that argument. The associated enum types (LinkBulkExportRequestTeamId, LinkBulkImportRequestTeamId, LinkBulkPauseRequestTeamId, LinkBulkTriggerHistoricalPullRequestTeamId, LinkListBulkOpsRequestTeamId) have also been removed and any imports of them will break.

The connect_manual_provider method now accepts two new optional parameters—vital_ios_sdk_version and vital_android_sdk_version (sent as request headers) and granted_permissions (sent in the request body)—enabling richer manual provider connections from mobile SDKs.

  • The address parameter type in user client methods (create_user_info / update_user_info) has changed from Address to UserAddress. Callers must import UserAddress from vital and replace any Address(...) instantiation with UserAddress(...).

The Jpeg.content and Png.content fields have changed from str to bytes, and ParsingJob.job_id has been removed; update any code that reads these fields accordingly.

New capabilities include compendium, lab_account, and order_transaction sub-clients on Vital/AsyncVital, an optional logging parameter on both client constructors, richer ClientFacingOrder fields (last_event, clinical_notes, origin, order_transaction), new insulin-injection metadata fields, additional OrderStatus enum values, and a gender field on ResultMetadata.

  • The SDK now includes two new resource clients: client.compendium provides search() and convert() methods for querying and converting lab test compendium data across labs, and client.lab_account provides a get_team_lab_accounts() method for retrieving your team's lab account information. A new structured logging system (ILogger, ConsoleLogger, Logger, LogConfig, create_logger) is also available from vital.core.

  • The SDK now includes a new order_transaction client namespace with three methods: get_transaction() for retrieving order transaction details, get_transaction_result() for fetching raw lab results, and get_transaction_result_pdf() for streaming PDF lab result reports. Both synchronous and asynchronous clients are available.

  • The SDK now exposes a large set of new types supporting lab account management (ClientFacingLabAccount, LabAccountStatus, LabAccountDelegatedFlow, GetTeamLabAccountsResponse), order transactions (ClientFacingOrderTransaction, GetOrderTransactionResponse, OrderTransactionStatus), compendium search and conversion (SearchCompendiumResponse, ConvertCompendiumResponse, SearchMode), and insulin injection detail enums (ClientFacingInsulinInjectionSampleBolusPurpose, ClientFacingInsulinInjectionSampleDeliveryForm, ClientFacingInsulinInjectionSampleDeliveryMode). New optional fields have been added to AppointmentBookingRequest (async confirmation controls), AppointmentRescheduleRequest, Address, and ClientFacingAppointment. New enum values SONORA_QUEST (AppointmentProvider) and INSULIN_PUMP (device/ECG source types) are also available.

  • The SDK now supports expanded lab account management with new ClientFacingLabAccount, LabAccountStatus, and LabAccountDelegatedFlow types. New order transaction models (ClientFacingOrderTransaction, GetOrderTransactionResponse, OrderOrigin) and insulin injection timeseries types (InsulinInjectionTimeseriesExpr, ClientFacingInsulinInjectionSampleDeliveryMode) are available. Additional new types include DerivedReadinessColumnExpr for readiness data queries, CompendiumSearchLabs/ConvertCompendiumResponse for lab compendium conversion, and lab report parsing job event models. Several existing models have new optional fields (recovery_readiness_score on ClientFacingSleep, status_detail on ClientFacingOrderEvent, order_transaction on LabResultsRaw), and multiple enums have been extended with new values including SONORA_QUEST, CRL, SAMSUNG_HEALTH, INSULIN_PUMP, CORRECTED, LAB_PROCESSING_BLOCKED, and DERIVED_READINESS.

  • The SDK now includes several new types and capabilities:

  • New models for compendium search: SearchCompendiumResponse, PerLabCandidate, RelatedCandidate, and ProviderIdConversionResponse

  • New order-related types: OrderStatusDetail, OrderSummary, and OrderTransactionStatus

  • New address types UserAddress and UsState, plus an optional access_notes field on all patient address models (PatientAddress, PatientAddressCompatible, PatientAddressWithValidation, UsAddress)

  • New provider values: TANDEM_SOURCE and SAMSUNG_HEALTH in Providers; TANDEM_SOURCE in PasswordProviders; APERO and PVERIFY in PayorCodeExternalProvider

  • New enums: ParsingJobFailureReason, SearchMode, and ResultMetadataGender

  • New query expression types (AwakeningsValueMacroExpr, DerivedReadinessColumnExpr, InsulinInjectionTimeseriesExpr) available in QueryGroupByItem and QuerySelectItem

  • RECOVERY_READINESS_SCORE added to SleepColumnExprSleep

Introduce structured HTTP request/response logging with sensitive header
redaction, a new `parse_sse_obj` utility for discriminated union SSE parsing,
an expanded `AppointmentPscLabs` enum, and a `status_code` property on
`BaseHttpResponse`. Also removes the `Link` bulk-ops team ID types and the
`INSULIN_INJECTION` value from `IntervalTimeseriesExprTimeseries`.

Key changes:
- Add opt-in HTTP request/response logging via `LogConfig`/`Logger` with automatic redaction of sensitive headers (authorization, API keys, cookies, etc.)
- Add `parse_sse_obj` helper in `pydantic_utilities` for smart SSE event parsing supporting both data-level and event-level discriminated unions
- Add `status_code` property to `BaseHttpResponse` for direct access to HTTP status codes
- Expand `AppointmentPscLabs` from a `Literal["quest"]` alias to a full `StrEnum` with `QUEST` and `SONORA_QUEST` values
- Remove `LinkBulkExportRequestTeamId`, `LinkBulkImportRequestTeamId`, `LinkBulkPauseRequestTeamId`, `LinkBulkTriggerHistoricalPullRequestTeamId`, and `LinkListBulkOpsRequestTeamId` enum types
- Remove `INSULIN_INJECTION` value from `IntervalTimeseriesExprTimeseries` enum and its `visit()` method

🌿 Generated with Fern
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants