Skip to content

Commit 191c18c

Browse files
committed
refactor: move domain types to domain.ts file
1 parent f3ec810 commit 191c18c

File tree

3 files changed

+30
-41
lines changed

3 files changed

+30
-41
lines changed

src/dbt_integration/dbtIntegrationAdapter.ts

Lines changed: 3 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -18,15 +18,11 @@ import {
1818
import { ProjectHealthcheck } from "./dbtCoreIntegration";
1919
import {
2020
DataPilotHealtCheckParams,
21-
DocMetaMap,
22-
ExposureMetaMap,
2321
GraphMetaMap,
24-
MacroMetaMap,
25-
MetricMetaMap,
26-
NodeMetaMap,
27-
SourceMetaMap,
22+
ParsedManifest,
23+
RunResultsData,
24+
RunResultsEventData,
2825
Table,
29-
TestMetaMap,
3026
} from "./domain";
3127
import { DBTConfiguration } from "./configuration";
3228
import { DBTFacade } from "./dbtFacade";
@@ -57,30 +53,6 @@ export const debounce = (fn: (args: unknown) => void, wait: number) => {
5753
};
5854
};
5955

60-
export interface ParsedManifest {
61-
nodeMetaMap: NodeMetaMap;
62-
macroMetaMap: MacroMetaMap;
63-
metricMetaMap: MetricMetaMap;
64-
sourceMetaMap: SourceMetaMap;
65-
graphMetaMap: GraphMetaMap;
66-
testMetaMap: TestMetaMap;
67-
docMetaMap: DocMetaMap;
68-
exposureMetaMap: ExposureMetaMap;
69-
modelDepthMap: Map<string, number>;
70-
}
71-
72-
export interface RunResultsData {
73-
results: Array<{
74-
unique_id: string;
75-
}>;
76-
}
77-
78-
export interface RunResultsEventData {
79-
results: Array<{
80-
unique_id: string;
81-
}>;
82-
}
83-
8456
/**
8557
* DBTProjectIntegrationAdapter provides a framework-agnostic implementation of DBTFacade
8658
* that delegates to the appropriate dbt integration (core, cloud, fusion, corecommand)

src/dbt_integration/domain.ts

Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
import * as path from "path";
2-
31
export type MacroMetaMap = Map<string, MacroMetaData>;
42
export type MetricMetaMap = Map<string, MetricMetaData>;
53
export type SourceMetaMap = Map<string, SourceMetaData>;
@@ -9,6 +7,30 @@ export type DocMetaMap = Map<string, DocMetaData>;
97
export type NodeMetaType = NodeMetaData;
108
export type SourceMetaType = SourceTable;
119

10+
export interface ParsedManifest {
11+
nodeMetaMap: NodeMetaMap;
12+
macroMetaMap: MacroMetaMap;
13+
metricMetaMap: MetricMetaMap;
14+
sourceMetaMap: SourceMetaMap;
15+
graphMetaMap: GraphMetaMap;
16+
testMetaMap: TestMetaMap;
17+
docMetaMap: DocMetaMap;
18+
exposureMetaMap: ExposureMetaMap;
19+
modelDepthMap: Map<string, number>;
20+
}
21+
22+
export interface RunResultsData {
23+
results: Array<{
24+
unique_id: string;
25+
}>;
26+
}
27+
28+
export interface RunResultsEventData {
29+
results: Array<{
30+
unique_id: string;
31+
}>;
32+
}
33+
1234
type ConfigOption =
1335
| { configPath: string; configType: "Manual" }
1436
| {

src/manifest/dbtProject.ts

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -43,10 +43,7 @@ import {
4343
DBTCommand,
4444
validateSQLUsingSqlGlot,
4545
DBT_PROJECT_FILE,
46-
RESOURCE_TYPE_ANALYSIS,
4746
RESOURCE_TYPE_MODEL,
48-
RESOURCE_TYPE_SEED,
49-
RESOURCE_TYPE_SNAPSHOT,
5047
RESOURCE_TYPE_SOURCE,
5148
MANIFEST_FILE,
5249
CATALOG_FILE,
@@ -64,6 +61,8 @@ import {
6461
ColumnMetaData,
6562
DataPilotHealtCheckParams,
6663
NodeMetaData,
64+
ParsedManifest,
65+
RunResultsEventData,
6766
Table,
6867
} from "../dbt_integration/domain";
6968
import { SharedStateService } from "../services/sharedStateService";
@@ -74,11 +73,7 @@ import { AltimateAuthService } from "../services/altimateAuthService";
7473
import { getProjectRelativePath } from "../utils";
7574
import { inject } from "inversify";
7675
import { DBTFacade } from "../dbt_integration/dbtFacade";
77-
import {
78-
DBTProjectIntegrationAdapter,
79-
ParsedManifest,
80-
RunResultsEventData,
81-
} from "../dbt_integration/dbtIntegrationAdapter";
76+
import { DBTProjectIntegrationAdapter } from "../dbt_integration/dbtIntegrationAdapter";
8277
import { DBTDiagnosticData } from "../dbt_integration/diagnostics";
8378

8479
interface FileNameTemplateMap {

0 commit comments

Comments
 (0)