fastapi-voyager 0.10.1__tar.gz → 0.10.3__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {fastapi_voyager-0.10.1 → fastapi_voyager-0.10.3}/PKG-INFO +15 -7
- {fastapi_voyager-0.10.1 → fastapi_voyager-0.10.3}/README.md +14 -6
- {fastapi_voyager-0.10.1 → fastapi_voyager-0.10.3}/src/fastapi_voyager/filter.py +1 -1
- {fastapi_voyager-0.10.1 → fastapi_voyager-0.10.3}/src/fastapi_voyager/server.py +3 -1
- {fastapi_voyager-0.10.1 → fastapi_voyager-0.10.3}/src/fastapi_voyager/version.py +1 -1
- {fastapi_voyager-0.10.1 → fastapi_voyager-0.10.3}/src/fastapi_voyager/voyager.py +15 -4
- {fastapi_voyager-0.10.1 → fastapi_voyager-0.10.3}/src/fastapi_voyager/web/index.html +6 -5
- {fastapi_voyager-0.10.1 → fastapi_voyager-0.10.3}/src/fastapi_voyager/web/vue-main.js +12 -5
- {fastapi_voyager-0.10.1 → fastapi_voyager-0.10.3}/tests/test_filter.py +3 -3
- {fastapi_voyager-0.10.1 → fastapi_voyager-0.10.3}/.gitignore +0 -0
- {fastapi_voyager-0.10.1 → fastapi_voyager-0.10.3}/.python-version +0 -0
- {fastapi_voyager-0.10.1 → fastapi_voyager-0.10.3}/LICENSE +0 -0
- {fastapi_voyager-0.10.1 → fastapi_voyager-0.10.3}/pyproject.toml +0 -0
- {fastapi_voyager-0.10.1 → fastapi_voyager-0.10.3}/src/fastapi_voyager/__init__.py +0 -0
- {fastapi_voyager-0.10.1 → fastapi_voyager-0.10.3}/src/fastapi_voyager/cli.py +0 -0
- {fastapi_voyager-0.10.1 → fastapi_voyager-0.10.3}/src/fastapi_voyager/module.py +0 -0
- {fastapi_voyager-0.10.1 → fastapi_voyager-0.10.3}/src/fastapi_voyager/render.py +0 -0
- {fastapi_voyager-0.10.1 → fastapi_voyager-0.10.3}/src/fastapi_voyager/type.py +0 -0
- {fastapi_voyager-0.10.1 → fastapi_voyager-0.10.3}/src/fastapi_voyager/type_helper.py +0 -0
- {fastapi_voyager-0.10.1 → fastapi_voyager-0.10.3}/src/fastapi_voyager/web/component/render-graph.js +0 -0
- {fastapi_voyager-0.10.1 → fastapi_voyager-0.10.3}/src/fastapi_voyager/web/component/route-code-display.js +0 -0
- {fastapi_voyager-0.10.1 → fastapi_voyager-0.10.3}/src/fastapi_voyager/web/component/schema-code-display.js +0 -0
- {fastapi_voyager-0.10.1 → fastapi_voyager-0.10.3}/src/fastapi_voyager/web/component/schema-field-filter.js +0 -0
- {fastapi_voyager-0.10.1 → fastapi_voyager-0.10.3}/src/fastapi_voyager/web/graph-ui.js +0 -0
- {fastapi_voyager-0.10.1 → fastapi_voyager-0.10.3}/src/fastapi_voyager/web/graphviz.svg.css +0 -0
- {fastapi_voyager-0.10.1 → fastapi_voyager-0.10.3}/src/fastapi_voyager/web/graphviz.svg.js +0 -0
- {fastapi_voyager-0.10.1 → fastapi_voyager-0.10.3}/src/fastapi_voyager/web/icon/android-chrome-192x192.png +0 -0
- {fastapi_voyager-0.10.1 → fastapi_voyager-0.10.3}/src/fastapi_voyager/web/icon/android-chrome-512x512.png +0 -0
- {fastapi_voyager-0.10.1 → fastapi_voyager-0.10.3}/src/fastapi_voyager/web/icon/apple-touch-icon.png +0 -0
- {fastapi_voyager-0.10.1 → fastapi_voyager-0.10.3}/src/fastapi_voyager/web/icon/favicon-16x16.png +0 -0
- {fastapi_voyager-0.10.1 → fastapi_voyager-0.10.3}/src/fastapi_voyager/web/icon/favicon-32x32.png +0 -0
- {fastapi_voyager-0.10.1 → fastapi_voyager-0.10.3}/src/fastapi_voyager/web/icon/favicon.ico +0 -0
- {fastapi_voyager-0.10.1 → fastapi_voyager-0.10.3}/src/fastapi_voyager/web/icon/site.webmanifest +0 -0
- {fastapi_voyager-0.10.1 → fastapi_voyager-0.10.3}/src/fastapi_voyager/web/quasar.min.css +0 -0
- {fastapi_voyager-0.10.1 → fastapi_voyager-0.10.3}/src/fastapi_voyager/web/quasar.min.js +0 -0
- {fastapi_voyager-0.10.1 → fastapi_voyager-0.10.3}/tests/__init__.py +0 -0
- {fastapi_voyager-0.10.1 → fastapi_voyager-0.10.3}/tests/demo.py +0 -0
- {fastapi_voyager-0.10.1 → fastapi_voyager-0.10.3}/tests/demo_anno.py +0 -0
- {fastapi_voyager-0.10.1 → fastapi_voyager-0.10.3}/tests/programatic.py +0 -0
- {fastapi_voyager-0.10.1 → fastapi_voyager-0.10.3}/tests/service/__init__.py +0 -0
- {fastapi_voyager-0.10.1 → fastapi_voyager-0.10.3}/tests/service/schema.py +0 -0
- {fastapi_voyager-0.10.1 → fastapi_voyager-0.10.3}/tests/test_analysis.py +0 -0
- {fastapi_voyager-0.10.1 → fastapi_voyager-0.10.3}/tests/test_generic.py +0 -0
- {fastapi_voyager-0.10.1 → fastapi_voyager-0.10.3}/tests/test_import.py +0 -0
- {fastapi_voyager-0.10.1 → fastapi_voyager-0.10.3}/tests/test_module.py +0 -0
- {fastapi_voyager-0.10.1 → fastapi_voyager-0.10.3}/tests/test_type_helper.py +0 -0
- {fastapi_voyager-0.10.1 → fastapi_voyager-0.10.3}/uv.lock +0 -0
- {fastapi_voyager-0.10.1 → fastapi_voyager-0.10.3}/voyager.jpg +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: fastapi-voyager
|
|
3
|
-
Version: 0.10.
|
|
3
|
+
Version: 0.10.3
|
|
4
4
|
Summary: Visualize FastAPI application's routing tree and dependencies
|
|
5
5
|
Project-URL: Homepage, https://github.com/allmonday/fastapi-voyager
|
|
6
6
|
Project-URL: Source, https://github.com/allmonday/fastapi-voyager
|
|
@@ -226,12 +226,20 @@ or you can open router_viz.dot with vscode extension `graphviz interactive previ
|
|
|
226
226
|
- [x] route list should have a max height
|
|
227
227
|
|
|
228
228
|
#### 0.10
|
|
229
|
-
-
|
|
230
|
-
- [x]
|
|
231
|
-
- [x]
|
|
232
|
-
- [x]
|
|
233
|
-
- [x]
|
|
234
|
-
- [x]
|
|
229
|
+
- 0.10.1
|
|
230
|
+
- [x] refactor voyager.py tag -> route structure
|
|
231
|
+
- [x] fix missing route (tag has only one route which return primitive value)
|
|
232
|
+
- [x] make right panel resizable by dragging
|
|
233
|
+
- [x] allow closing tag expansion item
|
|
234
|
+
- [x] hide brief mode if not configured
|
|
235
|
+
- [x] add focus button to only show related nodes under current route/tag graph in dialog
|
|
236
|
+
- 0.10.2
|
|
237
|
+
- [x] fix graph height
|
|
238
|
+
- [x] show version in title
|
|
239
|
+
- 0.10.3
|
|
240
|
+
- [x] fix focus in brief-mode
|
|
241
|
+
- [x] ui: adjust focus position
|
|
242
|
+
- [x] refactor naming
|
|
235
243
|
|
|
236
244
|
#### 0.11
|
|
237
245
|
- [ ] enable/disable module cluster (to save space)
|
|
@@ -199,12 +199,20 @@ or you can open router_viz.dot with vscode extension `graphviz interactive previ
|
|
|
199
199
|
- [x] route list should have a max height
|
|
200
200
|
|
|
201
201
|
#### 0.10
|
|
202
|
-
-
|
|
203
|
-
- [x]
|
|
204
|
-
- [x]
|
|
205
|
-
- [x]
|
|
206
|
-
- [x]
|
|
207
|
-
- [x]
|
|
202
|
+
- 0.10.1
|
|
203
|
+
- [x] refactor voyager.py tag -> route structure
|
|
204
|
+
- [x] fix missing route (tag has only one route which return primitive value)
|
|
205
|
+
- [x] make right panel resizable by dragging
|
|
206
|
+
- [x] allow closing tag expansion item
|
|
207
|
+
- [x] hide brief mode if not configured
|
|
208
|
+
- [x] add focus button to only show related nodes under current route/tag graph in dialog
|
|
209
|
+
- 0.10.2
|
|
210
|
+
- [x] fix graph height
|
|
211
|
+
- [x] show version in title
|
|
212
|
+
- 0.10.3
|
|
213
|
+
- [x] fix focus in brief-mode
|
|
214
|
+
- [x] ui: adjust focus position
|
|
215
|
+
- [x] refactor naming
|
|
208
216
|
|
|
209
217
|
#### 0.11
|
|
210
218
|
- [ ] enable/disable module cluster (to save space)
|
|
@@ -9,6 +9,7 @@ from fastapi_voyager.voyager import Voyager
|
|
|
9
9
|
from fastapi_voyager.type import Tag, FieldInfo, CoreData, SchemaNode
|
|
10
10
|
from fastapi_voyager.render import Renderer
|
|
11
11
|
from fastapi_voyager.type_helper import get_source, get_vscode_link
|
|
12
|
+
from fastapi_voyager.version import __version__
|
|
12
13
|
|
|
13
14
|
|
|
14
15
|
WEB_DIR = Path(__file__).parent / "web"
|
|
@@ -20,6 +21,7 @@ class OptionParam(BaseModel):
|
|
|
20
21
|
schemas: list[SchemaNode]
|
|
21
22
|
dot: str
|
|
22
23
|
enable_brief_mode: bool
|
|
24
|
+
version: str
|
|
23
25
|
|
|
24
26
|
class Payload(BaseModel):
|
|
25
27
|
tags: Optional[list[str]] = None
|
|
@@ -54,7 +56,7 @@ def create_route(
|
|
|
54
56
|
schemas = voyager.nodes[:]
|
|
55
57
|
schemas.sort(key=lambda s: s.name)
|
|
56
58
|
|
|
57
|
-
return OptionParam(tags=tags, schemas=schemas, dot=dot, enable_brief_mode=bool(module_prefix))
|
|
59
|
+
return OptionParam(tags=tags, schemas=schemas, dot=dot, enable_brief_mode=bool(module_prefix), version=__version__)
|
|
58
60
|
|
|
59
61
|
@router.post("/dot", response_class=PlainTextResponse)
|
|
60
62
|
def get_filtered_dot(payload: Payload) -> str:
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
__all__ = ["__version__"]
|
|
2
|
-
__version__ = "0.10.
|
|
2
|
+
__version__ = "0.10.3"
|
|
@@ -14,7 +14,7 @@ from fastapi_voyager.type_helper import (
|
|
|
14
14
|
)
|
|
15
15
|
from pydantic import BaseModel
|
|
16
16
|
from fastapi_voyager.type import Route, SchemaNode, Link, Tag, LinkType, FieldType, PK, CoreData
|
|
17
|
-
from fastapi_voyager.filter import filter_graph,
|
|
17
|
+
from fastapi_voyager.filter import filter_graph, filter_subgraph_by_module_prefix
|
|
18
18
|
from fastapi_voyager.render import Renderer
|
|
19
19
|
import pydantic_resolve.constant as const
|
|
20
20
|
|
|
@@ -308,14 +308,25 @@ class Voyager:
|
|
|
308
308
|
return renderer.render_dot(_tags, _routes, _nodes, _links)
|
|
309
309
|
|
|
310
310
|
def render_brief_dot(self, module_prefix: str | None = None):
|
|
311
|
-
_tags, _routes, _nodes, _links =
|
|
312
|
-
|
|
311
|
+
_tags, _routes, _nodes, _links = filter_graph(
|
|
312
|
+
schema=self.schema,
|
|
313
|
+
schema_field=self.schema_field,
|
|
313
314
|
tags=self.tags,
|
|
314
315
|
routes=self.routes,
|
|
315
316
|
nodes=self.nodes,
|
|
316
317
|
links=self.links,
|
|
318
|
+
node_set=self.node_set,
|
|
319
|
+
)
|
|
320
|
+
|
|
321
|
+
_tags, _routes, _nodes, _links = filter_subgraph_by_module_prefix(
|
|
322
|
+
module_prefix=module_prefix,
|
|
323
|
+
tags=_tags,
|
|
324
|
+
routes=_routes,
|
|
325
|
+
nodes=_nodes,
|
|
326
|
+
links=_links,
|
|
317
327
|
)
|
|
318
|
-
|
|
328
|
+
|
|
329
|
+
renderer = Renderer(show_fields=self.show_fields, module_color=self.module_color, schema=self.schema)
|
|
319
330
|
|
|
320
331
|
_tags, _routes, _links = self.handle_hide(_tags, _routes, _links)
|
|
321
332
|
return renderer.render_dot(_tags, _routes, _nodes, _links, True)
|
|
@@ -57,7 +57,7 @@
|
|
|
57
57
|
}
|
|
58
58
|
|
|
59
59
|
.adjust-fit {
|
|
60
|
-
height: calc(
|
|
60
|
+
height: calc(100vh - 54px);
|
|
61
61
|
}
|
|
62
62
|
</style>
|
|
63
63
|
<body>
|
|
@@ -67,10 +67,11 @@
|
|
|
67
67
|
<q-toolbar class="row text-grey-9 bg-white" style="width: 100%">
|
|
68
68
|
<div
|
|
69
69
|
class="col-auto text-primary"
|
|
70
|
-
style="font-size:
|
|
70
|
+
style="font-size: 18px; font-weight: bold; display: flex; align-items: baseline;"
|
|
71
71
|
>
|
|
72
72
|
<q-icon class="q-mr-sm" name="satellite_alt"></q-icon>
|
|
73
73
|
<span> FastAPI Voyager </span>
|
|
74
|
+
<span v-if="state.version" style="font-size: 12px; margin-left: 8px; font-weight: normal;">{{ state.version }}</span>
|
|
74
75
|
</div>
|
|
75
76
|
<div class="col-auto" style="font-size: 16px">
|
|
76
77
|
<q-option-group
|
|
@@ -151,7 +152,6 @@
|
|
|
151
152
|
shift + click to see schema's dependencies without
|
|
152
153
|
unrelated nodes
|
|
153
154
|
</li>
|
|
154
|
-
<li>alt + click to see schema details</li>
|
|
155
155
|
</ul>
|
|
156
156
|
</div>
|
|
157
157
|
</q-tooltip>
|
|
@@ -279,13 +279,14 @@
|
|
|
279
279
|
|
|
280
280
|
<template #after>
|
|
281
281
|
<div style="position: relative; width: 100%; height: 100%;">
|
|
282
|
-
<div id="graph" class="fit"></div>
|
|
282
|
+
<div id="graph" class="adjust-fit"></div>
|
|
283
283
|
<q-toggle
|
|
284
284
|
v-model="state.focus"
|
|
285
285
|
v-show="schemaCodeName"
|
|
286
286
|
@update:model-value="val => onFocusChange(val)"
|
|
287
287
|
label="Focus"
|
|
288
|
-
|
|
288
|
+
title="pick a schema and toggle focus on to display related nodes only"
|
|
289
|
+
style="position: absolute; left: 8px; bottom: 8px; z-index: 10; background: rgba(255,255,255,0.85); border-radius: 4px; padding: 2px 8px;"
|
|
289
290
|
size="sm"
|
|
290
291
|
/>
|
|
291
292
|
</div>
|
|
@@ -31,7 +31,8 @@ const app = createApp({
|
|
|
31
31
|
// Splitter size (left panel width in px)
|
|
32
32
|
splitter: 300,
|
|
33
33
|
detailDrawer: false,
|
|
34
|
-
drawerWidth:
|
|
34
|
+
drawerWidth: 300, // drawer 宽度
|
|
35
|
+
version: "", // version from backend
|
|
35
36
|
});
|
|
36
37
|
|
|
37
38
|
const showDetail = ref(false);
|
|
@@ -75,6 +76,7 @@ const app = createApp({
|
|
|
75
76
|
return acc;
|
|
76
77
|
}, {});
|
|
77
78
|
state.enableBriefMode = data.enable_brief_mode || false;
|
|
79
|
+
state.version = data.version || "";
|
|
78
80
|
|
|
79
81
|
// default route options placeholder
|
|
80
82
|
} catch (e) {
|
|
@@ -91,7 +93,6 @@ const app = createApp({
|
|
|
91
93
|
await onGenerate(false, null)
|
|
92
94
|
setTimeout(() => {
|
|
93
95
|
const ele = $(`[data-name='${schemaCodeName.value}'] polygon`)
|
|
94
|
-
debugger
|
|
95
96
|
ele.click()
|
|
96
97
|
}, 1)
|
|
97
98
|
}
|
|
@@ -119,11 +120,13 @@ const app = createApp({
|
|
|
119
120
|
const graphUI = new GraphUI("#graph", {
|
|
120
121
|
onSchemaShiftClick: (id) => {
|
|
121
122
|
if (state.rawSchemas.has(id)) {
|
|
123
|
+
resetDetailPanels()
|
|
122
124
|
schemaFieldFilterSchema.value = id;
|
|
123
125
|
showSchemaFieldFilter.value = true;
|
|
124
126
|
}
|
|
125
127
|
},
|
|
126
128
|
onSchemaClick: (id) => {
|
|
129
|
+
resetDetailPanels()
|
|
127
130
|
if (state.rawSchemas.has(id)) {
|
|
128
131
|
schemaCodeName.value = id;
|
|
129
132
|
state.detailDrawer = true;
|
|
@@ -134,9 +137,7 @@ const app = createApp({
|
|
|
134
137
|
}
|
|
135
138
|
},
|
|
136
139
|
resetCb: () => {
|
|
137
|
-
|
|
138
|
-
showRouteDetail.value = false;
|
|
139
|
-
schemaCodeName.value = ''
|
|
140
|
+
resetDetailPanels()
|
|
140
141
|
}
|
|
141
142
|
});
|
|
142
143
|
|
|
@@ -210,6 +211,12 @@ const app = createApp({
|
|
|
210
211
|
showSchemaFieldFilter.value = true;
|
|
211
212
|
}
|
|
212
213
|
|
|
214
|
+
function resetDetailPanels() {
|
|
215
|
+
state.detailDrawer = false
|
|
216
|
+
showRouteDetail.value = false;
|
|
217
|
+
schemaCodeName.value = ''
|
|
218
|
+
}
|
|
219
|
+
|
|
213
220
|
async function onReset() {
|
|
214
221
|
state.tag = null;
|
|
215
222
|
state.routeId = "";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
from fastapi_voyager.filter import
|
|
1
|
+
from fastapi_voyager.filter import filter_subgraph_by_module_prefix
|
|
2
2
|
from fastapi_voyager.type import Tag, Route, SchemaNode, Link, PK
|
|
3
3
|
|
|
4
4
|
|
|
@@ -42,7 +42,7 @@ def test_filter_subgraph_filters_nodes_and_links():
|
|
|
42
42
|
routes = [route]
|
|
43
43
|
nodes = [node_a, node_b]
|
|
44
44
|
|
|
45
|
-
_, _, filtered_nodes, filtered_links =
|
|
45
|
+
_, _, filtered_nodes, filtered_links = filter_subgraph_by_module_prefix(
|
|
46
46
|
tags=tags,
|
|
47
47
|
routes=routes,
|
|
48
48
|
links=links,
|
|
@@ -110,7 +110,7 @@ def test_filter_subgraph_handles_cycles_and_multiple_matches():
|
|
|
110
110
|
|
|
111
111
|
nodes = [node_root, node_mid, node_target1, node_target2]
|
|
112
112
|
|
|
113
|
-
_, _, filtered_nodes, filtered_links =
|
|
113
|
+
_, _, filtered_nodes, filtered_links = filter_subgraph_by_module_prefix(
|
|
114
114
|
tags=[tag],
|
|
115
115
|
routes=[route],
|
|
116
116
|
links=links,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{fastapi_voyager-0.10.1 → fastapi_voyager-0.10.3}/src/fastapi_voyager/web/component/render-graph.js
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{fastapi_voyager-0.10.1 → fastapi_voyager-0.10.3}/src/fastapi_voyager/web/icon/apple-touch-icon.png
RENAMED
|
File without changes
|
{fastapi_voyager-0.10.1 → fastapi_voyager-0.10.3}/src/fastapi_voyager/web/icon/favicon-16x16.png
RENAMED
|
File without changes
|
{fastapi_voyager-0.10.1 → fastapi_voyager-0.10.3}/src/fastapi_voyager/web/icon/favicon-32x32.png
RENAMED
|
File without changes
|
|
File without changes
|
{fastapi_voyager-0.10.1 → fastapi_voyager-0.10.3}/src/fastapi_voyager/web/icon/site.webmanifest
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|