From 1abb381b4715cd757cbcbfa4110ac7c04744047b Mon Sep 17 00:00:00 2001 From: Pushp Date: Thu, 19 Nov 2026 14:45:17 +0530 Subject: [PATCH] chore(api): typed liveness calls; regenerated manifest and telemetry headers - LivenessApi called createLivenessSession / getLivenessStatus through an any cast; they now use the generated client's typed inputs and outputs - apiManifest.ts, telemetryCatalog.ts and TELEMETRY_CONTRACT.txt follow the backend's regenerated headers (OneHookBackend #53) --- TELEMETRY_CONTRACT.txt | 4 +++- src/api/liveness.ts | 6 +++--- src/lib/analytics/generated/apiManifest.ts | 3 ++- src/lib/analytics/generated/telemetryCatalog.ts | 5 +++-- 4 files changed, 11 insertions(+), 7 deletions(-) diff --git a/TELEMETRY_CONTRACT.txt b/TELEMETRY_CONTRACT.txt index 2cc4fe3..055043d 100644 --- a/TELEMETRY_CONTRACT.txt +++ b/TELEMETRY_CONTRACT.txt @@ -17,7 +17,9 @@ NEVER edit the generated catalog file (TelemetryCatalog.* / telemetryCatalog.ts). Need a new id? Add it to OneHookBackend/packages/telemetry/src/catalog.ts, run npm run telemetry:generate && npm run telemetry:sync - and deploy the backend BEFORE shipping the client that uses it. + (web), publish onehook-api-client and bump it in OneHookPlatform + node scripts/sync-api-specs.mjs --bump onehook-api-client@ + (iOS, Android), and deploy the backend BEFORE shipping a client that uses it. Unregistered or wrong-platform ids are REJECTED by the server and never stored. 3. Parity: an element may be missing on a platform ONLY if it is listed, with a diff --git a/src/api/liveness.ts b/src/api/liveness.ts index 78eb3ee..f216976 100644 --- a/src/api/liveness.ts +++ b/src/api/liveness.ts @@ -20,13 +20,13 @@ export type LivenessStatus = export const LivenessApi = { /** Create a Rekognition streaming liveness session. */ createSession: async (): Promise<{ sessionId: string }> => { - const res: any = await (sdkClient as any).createLivenessSession({}); + const res = await sdkClient.createLivenessSession({}); return { sessionId: res.sessionId }; }, /** Read the authoritative liveness verification status for the caller. */ getStatus: async (): Promise<{ status: LivenessStatus }> => { - const res: any = await (sdkClient as any).getLivenessStatus({}); - return { status: (res?.status as LivenessStatus) ?? 'NONE' }; + const res = await sdkClient.getLivenessStatus({}); + return { status: (res.status as LivenessStatus | undefined) ?? 'NONE' }; }, }; diff --git a/src/lib/analytics/generated/apiManifest.ts b/src/lib/analytics/generated/apiManifest.ts index 91212b5..7fa8635 100644 --- a/src/lib/analytics/generated/apiManifest.ts +++ b/src/lib/analytics/generated/apiManifest.ts @@ -1,6 +1,7 @@ // GENERATED FILE - DO NOT EDIT. // Source of truth: OneHookBackend/packages/api-models/model/smithy/*.smithy (every HTTP route is a Smithy operation). -// Regenerate: (OneHookBackend) npm --prefix packages/api-models run build && npm run api:sync +// Regenerate: (OneHookBackend) npm --prefix packages/api-models run build && npm run api:sync. +// iOS / Android copies: pulled from onehook-api-client (manifest/) by OneHookPlatform scripts/sync-api-specs.mjs. /* eslint-disable */ export type ApiAuth = 'cognito' | 'iam' | 'none'; diff --git a/src/lib/analytics/generated/telemetryCatalog.ts b/src/lib/analytics/generated/telemetryCatalog.ts index 37bde7c..a36e470 100644 --- a/src/lib/analytics/generated/telemetryCatalog.ts +++ b/src/lib/analytics/generated/telemetryCatalog.ts @@ -1,7 +1,8 @@ // GENERATED FILE - DO NOT EDIT. -// telemetry-integrity: sha256 963a0e6c686534101845009a720ed931f8816e765ead51d78fce4706e8ac9258 +// telemetry-integrity: sha256 d6cec8a8fa32f0829743a77f20b9f22eaa3e5634975e8acfe5529d3a11b87e4d // Source of truth: OneHookBackend/packages/telemetry/src/catalog.ts -// Regenerate: (OneHookBackend) npm run telemetry:generate && npm run telemetry:sync +// Regenerate: (OneHookBackend) npm run telemetry:generate && npm run telemetry:sync. +// iOS / Android copies: pulled from onehook-api-client (telemetry/) by OneHookPlatform scripts/sync-api-specs.mjs. // Catalog version 1.24.0, hash 139c2761335ed6ce. // // HARD RULE: every user interaction MUST emit ui_interaction with an id from THIS file, and