From 414ce973be652936564fa6c0333143db1d0558c5 Mon Sep 17 00:00:00 2001 From: Khaliq Date: Mon, 4 May 2026 22:29:31 +0200 Subject: [PATCH] sdk: add webhookHealthy to SyncProviderStatus MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Productized cloud-mount contract §7.4 mandates that the cloud `/sync` response surfaces a per-provider `webhookHealthy` boolean so consumers can render the "falling back to periodic sync" warning when webhook delivery is degraded. The cloud platform already populates the field in its provider-status summarizer (cloud#406); the relayfile CLI already renders the warning row when the field is false (relayfile#71). The TypeScript SDK type did not declare it, forcing both consumers to read it via permissive casts. Add it as an optional field on `SyncProviderStatus` in both the TS and Python SDK types so consumers can drop the cast. Non-breaking: the field is `?: boolean` (TS) / `bool | None = None` (Python). Older deployments that do not yet emit the field still deserialize cleanly. The Python client returns raw `dict[str, Any]` for sync status so no parser update is needed; the type is documentation for consumers who construct SyncProviderStatus instances by hand. --- packages/sdk/python/src/relayfile/types.py | 4 ++++ packages/sdk/typescript/src/types.ts | 5 +++++ 2 files changed, 9 insertions(+) diff --git a/packages/sdk/python/src/relayfile/types.py b/packages/sdk/python/src/relayfile/types.py index 830ea80..dc0dc92 100644 --- a/packages/sdk/python/src/relayfile/types.py +++ b/packages/sdk/python/src/relayfile/types.py @@ -331,6 +331,10 @@ class SyncProviderStatus: failure_codes: dict[str, int] | None = None dead_lettered_envelopes: int | None = None dead_lettered_ops: int | None = None + # Productized cloud-mount contract §7.4: cloud SHOULD set this to + # False when webhook delivery is degraded. Optional for backward + # compatibility with deployments that do not yet emit it. + webhook_healthy: bool | None = None @dataclass diff --git a/packages/sdk/typescript/src/types.ts b/packages/sdk/typescript/src/types.ts index b7e6833..96941e2 100644 --- a/packages/sdk/typescript/src/types.ts +++ b/packages/sdk/typescript/src/types.ts @@ -242,6 +242,11 @@ export interface SyncProviderStatus { failureCodes?: Record; deadLetteredEnvelopes?: number; deadLetteredOps?: number; + // Productized cloud-mount contract §7.4: cloud SHOULD set this to + // false when webhook delivery is degraded so consumers can render the + // "falling back to periodic sync" warning. Optional for backward + // compatibility with deployments that do not yet emit it. + webhookHealthy?: boolean; } export interface SyncStatusResponse {