Skip to content

Commit 79a30e1

Browse files
gckokentwelcome
authored andcommitted
refactor(api): declare catalog coverage response type
Signed-off-by: Jared Scott <jared.scott@datarecce.io>
1 parent eeb776a commit 79a30e1

3 files changed

Lines changed: 53 additions & 0 deletions

File tree

‎js/packages/ui/src/api/index.ts‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ export type { RecceServerFlags } from "./flag";
6262
export { getServerFlag, markRelaunchHintCompleted } from "./flag";
6363
// Server info API (lineage, environment, dbt metadata)
6464
export type {
65+
CatalogCoverage,
6566
CatalogMetadata,
6667
GitInfo,
6768
LineageData,
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
import { describe, expectTypeOf, it } from "vitest";
2+
3+
import type { CatalogCoverage, ServerInfoResult } from "./index";
4+
5+
type CatalogStatus =
6+
| "complete"
7+
| "partial"
8+
| "empty"
9+
| "absent"
10+
| "not_applicable"
11+
| "unknown";
12+
13+
describe("ServerInfoResult catalog coverage contract", () => {
14+
it("exports the canonical optional and nullable cloud payload", () => {
15+
expectTypeOf<CatalogCoverage>().toEqualTypeOf<{
16+
status: CatalogStatus;
17+
warn: boolean;
18+
covered_count: number;
19+
expected_count: number;
20+
catalog_entry_count: number;
21+
computed_at: string;
22+
}>();
23+
24+
expectTypeOf<ServerInfoResult["catalog_coverage"]>().toEqualTypeOf<
25+
CatalogCoverage | null | undefined
26+
>();
27+
});
28+
});

‎js/packages/ui/src/api/info.ts‎

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,25 @@ export interface StateMetadata {
158158
generated_at: string;
159159
}
160160

161+
/**
162+
* Catalog coverage fields returned by the cloud backend after artifact
163+
* classification.
164+
*/
165+
export interface CatalogCoverage {
166+
status:
167+
| "complete"
168+
| "partial"
169+
| "empty"
170+
| "absent"
171+
| "not_applicable"
172+
| "unknown";
173+
warn: boolean;
174+
covered_count: number;
175+
expected_count: number;
176+
catalog_entry_count: number;
177+
computed_at: string;
178+
}
179+
161180
/**
162181
* Session staleness fields returned by the backend when the PR session's
163182
* frozen-snapshot base may have diverged from the project's current shared base.
@@ -227,6 +246,11 @@ export interface ServerInfoResult {
227246
support_tasks: Record<string, boolean>;
228247
/** Session staleness fields (cloud mode only, null for OSS / legacy sessions). */
229248
session_staleness?: SessionStaleness;
249+
/**
250+
* Catalog coverage fields in cloud mode. Omitted by OSS and legacy servers;
251+
* null when the cloud session has not produced a conclusive classification.
252+
*/
253+
catalog_coverage?: CatalogCoverage | null;
230254
}
231255

232256
/**

0 commit comments

Comments
 (0)