-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtypes.ts
More file actions
96 lines (86 loc) · 1.64 KB
/
Copy pathtypes.ts
File metadata and controls
96 lines (86 loc) · 1.64 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
export type AssetKind =
| 'http_api'
| 'http_dependency'
| 'db_table'
| 'redis_key'
| 'topic'
| 'dto_schema'
| 'thread_pool';
export type RelationKind =
| 'uses_table'
| 'uses_redis'
| 'publishes'
| 'subscribes'
| 'uses_schema'
| 'calls_http'
| 'runs_on_pool'
| 'references';
export interface AssetRecord {
id: number;
kind: AssetKind;
name: string;
qualifiedName: string;
sourceFile: string;
definitionJson: string;
metadataJson: string;
}
export interface RelationRecord {
id: number;
relation: RelationKind;
fromId: number;
toId: number;
}
export interface SearchResult {
kind: AssetKind;
id: number;
name: string;
qualifiedName: string;
detail: string;
sourceFile: string;
}
export interface GraphStats {
totalAssets: number;
byKind: Record<AssetKind, number>;
relationCount: number;
fileCount: number;
indexStatus: 'stub' | 'ready';
}
export interface IndexResult {
filesIndexed: number;
assetsAdded: number;
relationsAdded: number;
durationMs: number;
stub: boolean;
}
export interface IndexProgress {
phase: 'scan' | 'parse' | 'write';
current: number;
total: number;
file?: string;
plugin?: string;
}
export interface IndexerResult {
assetsAdded: number;
relationsAdded: number;
skipped: boolean;
}
export const ASSET_KINDS: AssetKind[] = [
'http_api',
'http_dependency',
'db_table',
'redis_key',
'topic',
'dto_schema',
'thread_pool',
];
export function emptyKindCounts(): Record<AssetKind, number> {
return {
http_api: 0,
http_dependency: 0,
db_table: 0,
redis_key: 0,
topic: 0,
dto_schema: 0,
thread_pool: 0,
};
}