@@ -7,7 +7,7 @@ import { checkDetailOf, toCheck, toCheckEvidence, toCheckSql } from './http-chec
77import { findNode , nodeDetailOf , toCatalogNodes , nodeJobsOf , toMicrobatchCoverage , toNodeRuns , toColumnLineage } from './http-catalog' ;
88import { auditMatches , toAuditEntry } from './http-audit' ;
99import { toSnapshotChanges } from './http-changes' ;
10- import { manualConnectionTest , toLocationDetail , toLocationSummary , toWarehouseConnection , warehouseSyncOf } from './http-locations' ;
10+ import { manualConnectionTest , snapshotOf , toLocationDetail , toLocationSummary , toWarehouseConnection , warehouseSyncOf } from './http-locations' ;
1111import { toAccount , toRoleAssignments , toServerSettings } from './http-people' ;
1212import { toMaintenanceHistory } from './http-maintenance' ;
1313import { overviewOf } from './http-overview' ;
@@ -17,7 +17,7 @@ import { jobDetailOf, runWindowOf, toJob, toTick, toTrigger, toTriggerStateEvent
1717import { timelineOf } from './http-timeline' ;
1818import { RUN_WINDOW , groupRunNodes , parseRunCursor , planResultOf , queueEntriesOf , toAdhocCheck , runDetailOf , runRowPageOver , runsMatching , runTabCountsOf , toRunNode , toRuns , toRunEvent , toRunOutput , toRunStatements } from './http-runs' ;
1919import type { ChangeSubscription , ChangedChannel , ChangedSignal , ConnectionState } from './signals' ;
20- import type { AuthMode , Bootstrap , Capability , Location , NavCounts , PlatformEvent , Scope , WarehouseSync } from './types' ;
20+ import type { AuthMode , Bootstrap , Capability , Location , NavCounts , PlatformEvent , Scope , Snapshot , WarehouseSync } from './types' ;
2121import type { Account , AuditEntry , AuditQuery , ConnectionTest , LocationDetail , ServerSettings , WarehouseConnection , LocationSummary , PlatformEventQuery , PlatformEventRecord , PlatformHealth , MaintenanceHistory , RoleAssignment , RoleAssignmentRequest , RoleDefinition , RoleDetail } from './types/platform' ;
2222import type { Acknowledgement , CatalogNode , CatalogNodeDetail , Check , CheckDetail , CheckEvidence , CheckSql , Overview , SnapshotChange , ColumnLineage } from './types/build' ;
2323import type { AdhocRunCheck , AdhocRunRequest , BulkRunResult , PlanResult , QueueEntry , Timeline , Job , JobDetail , JobLaunchOptions , RerunMode , SnapshotNode , Run , RunDetail , RunListQuery , RunRowPage , RunRowQuery , RunTabCounts , Trigger , TriggerDetail , TriggerState , RunEventPage , RunNodeError , RunOutputLine , RunStatement , StatementSql } from './types/operate' ;
@@ -79,6 +79,7 @@ const SUPPORTED: ReadonlySet<string> = new Set<keyof ApiClient>([
7979 'platformHealth' ,
8080 'listRoles' ,
8181 'getRole' ,
82+ 'getLatestSnapshot' ,
8283 'getWarehouseSync' ,
8384 'requestWarehouseSync' ,
8485 'maintenanceHistory' ,
@@ -547,6 +548,13 @@ export function createHttpClient({ baseUrl = '', onUnauthorized, fetch: answer,
547548 }
548549 return found . slice ( 0 , limit ) ;
549550 } ,
551+ async getLatestSnapshot ( scope : Scope ) : Promise < Snapshot | null > {
552+ const { locationId, target } = parseLocationKey ( scope . locationId ) ;
553+ const { data, error, response } = await http . GET ( '/api/control/locations/{location_id}/targets/{target}/snapshots' , { params : { path : { location_id : locationId , target } , query : { limit : 1 } } } ) ;
554+ if ( response . status === 401 ) onUnauthorized ( ) ;
555+ if ( ! data ) throw new ApiError ( errorText ( error , response ) , response . status ) ;
556+ return snapshotOf ( data [ 0 ] ?? null ) ;
557+ } ,
550558 async getWarehouseSync ( scope : Scope ) : Promise < WarehouseSync | null > {
551559 const { locationId, target } = parseLocationKey ( scope . locationId ) ;
552560 const { data, error, response } = await http . GET ( '/api/control/locations/{location_id}/targets/{target}/health' , { params : { path : { location_id : locationId , target } } } ) ;
0 commit comments