fastapi-voyager 0.9.3__py3-none-any.whl → 0.9.4__py3-none-any.whl
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/version.py +1 -1
- fastapi_voyager/voyager.py +5 -0
- fastapi_voyager/web/component/schema-code-display.js +7 -7
- fastapi_voyager/web/graph-ui.js +25 -0
- fastapi_voyager/web/index.html +3 -4
- fastapi_voyager/web/vue-main.js +12 -5
- {fastapi_voyager-0.9.3.dist-info → fastapi_voyager-0.9.4.dist-info}/METADATA +10 -38
- {fastapi_voyager-0.9.3.dist-info → fastapi_voyager-0.9.4.dist-info}/RECORD +11 -11
- {fastapi_voyager-0.9.3.dist-info → fastapi_voyager-0.9.4.dist-info}/WHEEL +0 -0
- {fastapi_voyager-0.9.3.dist-info → fastapi_voyager-0.9.4.dist-info}/entry_points.txt +0 -0
- {fastapi_voyager-0.9.3.dist-info → fastapi_voyager-0.9.4.dist-info}/licenses/LICENSE +0 -0
fastapi_voyager/version.py
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
__all__ = ["__version__"]
|
|
2
|
-
__version__ = "0.9.
|
|
2
|
+
__version__ = "0.9.4"
|
fastapi_voyager/voyager.py
CHANGED
|
@@ -144,6 +144,11 @@ class Voyager:
|
|
|
144
144
|
"""
|
|
145
145
|
full_name = full_class_name(schema)
|
|
146
146
|
bases_fields = get_bases_fields([s for s in schema.__bases__ if is_inheritance_of_pydantic_base(s)])
|
|
147
|
+
|
|
148
|
+
subset_reference = getattr(schema, const.ENSURE_SUBSET_REFERENCE, None)
|
|
149
|
+
if subset_reference and is_inheritance_of_pydantic_base(subset_reference):
|
|
150
|
+
bases_fields.update(get_bases_fields([subset_reference]))
|
|
151
|
+
|
|
147
152
|
if full_name not in self.node_set:
|
|
148
153
|
# skip meta info for normal queries
|
|
149
154
|
self.node_set[full_name] = SchemaNode(
|
|
@@ -20,7 +20,7 @@ export default defineComponent({
|
|
|
20
20
|
const link = ref("");
|
|
21
21
|
const error = ref("");
|
|
22
22
|
const fields = ref([]); // schema fields list
|
|
23
|
-
const tab = ref("
|
|
23
|
+
const tab = ref("fields");
|
|
24
24
|
|
|
25
25
|
|
|
26
26
|
async function highlightLater() {
|
|
@@ -138,24 +138,21 @@ export default defineComponent({
|
|
|
138
138
|
|
|
139
139
|
<div style="padding:8px 12px 0 12px; box-sizing:border-box;">
|
|
140
140
|
<q-tabs v-model="tab" align="left" dense active-color="primary" indicator-color="primary" class="text-grey-8">
|
|
141
|
-
<q-tab name="source" label="Source Code" />
|
|
142
141
|
<q-tab name="fields" label="Fields" />
|
|
142
|
+
<q-tab name="source" label="Source Code" />
|
|
143
143
|
</q-tabs>
|
|
144
144
|
</div>
|
|
145
145
|
<q-separator />
|
|
146
|
-
<div style="padding:8px 16px 16px 16px;
|
|
146
|
+
<div style="padding:8px 16px 16px 16px; box-sizing:border-box; overflow:auto;">
|
|
147
147
|
<div v-if="error" style="color:#c10015; font-family:Menlo, monospace; font-size:12px;">{{ error }}</div>
|
|
148
148
|
<template v-else>
|
|
149
|
-
<div v-show="tab === 'source'">
|
|
150
|
-
<pre style="margin:0;"><code class="language-python">{{ code }}</code></pre>
|
|
151
|
-
</div>
|
|
152
149
|
<div v-show="tab === 'fields'">
|
|
153
150
|
<table style="border-collapse:collapse; width:100%; font-size:12px; font-family:Menlo, monospace;">
|
|
154
151
|
<thead>
|
|
155
152
|
<tr>
|
|
156
153
|
<th style="text-align:left; border-bottom:1px solid #ddd; padding:4px 6px;">Field</th>
|
|
157
154
|
<th style="text-align:left; border-bottom:1px solid #ddd; padding:4px 6px;">Type</th>
|
|
158
|
-
<th style="text-align:left; border-bottom:1px solid #ddd; padding:4px 6px;">
|
|
155
|
+
<th style="text-align:left; border-bottom:1px solid #ddd; padding:4px 6px;">Inherited</th>
|
|
159
156
|
</tr>
|
|
160
157
|
</thead>
|
|
161
158
|
<tbody>
|
|
@@ -170,6 +167,9 @@ export default defineComponent({
|
|
|
170
167
|
</tbody>
|
|
171
168
|
</table>
|
|
172
169
|
</div>
|
|
170
|
+
<div v-show="tab === 'source'">
|
|
171
|
+
<pre style="margin:0;"><code class="language-python">{{ code }}</code></pre>
|
|
172
|
+
</div>
|
|
173
173
|
</template>
|
|
174
174
|
</div>
|
|
175
175
|
</div>
|
fastapi_voyager/web/graph-ui.js
CHANGED
|
@@ -105,6 +105,31 @@ export class GraphUI {
|
|
|
105
105
|
self._highlight();
|
|
106
106
|
});
|
|
107
107
|
|
|
108
|
+
// svg 背景点击高亮清空
|
|
109
|
+
|
|
110
|
+
$(document).off('click.graphui').on('click.graphui', function (evt) {
|
|
111
|
+
// 如果点击目标不在 graph 容器内,直接退出
|
|
112
|
+
const graphContainer = $(self.selector)[0];
|
|
113
|
+
if (!graphContainer || !evt.target || !graphContainer.contains(evt.target)) {
|
|
114
|
+
return;
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
let isNode = false;
|
|
118
|
+
const $nodes = self.gv.nodes();
|
|
119
|
+
const node = evt.target.parentNode;
|
|
120
|
+
$nodes.each(function () {
|
|
121
|
+
if (this === node) {
|
|
122
|
+
isNode = true;
|
|
123
|
+
}
|
|
124
|
+
});
|
|
125
|
+
if (!isNode && self.gv) {
|
|
126
|
+
self.gv.highlight();
|
|
127
|
+
if (self.options.resetCb) {
|
|
128
|
+
self.options.resetCb();
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
});
|
|
132
|
+
|
|
108
133
|
$(document).on("keydown.graphui", function (evt) {
|
|
109
134
|
if (evt.keyCode === 27 && self.gv) {
|
|
110
135
|
self.gv.highlight();
|
fastapi_voyager/web/index.html
CHANGED
|
@@ -163,7 +163,7 @@
|
|
|
163
163
|
|
|
164
164
|
<q-drawer
|
|
165
165
|
v-model="state.detailDrawer"
|
|
166
|
-
width="
|
|
166
|
+
width="500"
|
|
167
167
|
side="right"
|
|
168
168
|
overlay
|
|
169
169
|
bordered
|
|
@@ -178,7 +178,6 @@
|
|
|
178
178
|
icon="chevron_right"
|
|
179
179
|
/>
|
|
180
180
|
</div>
|
|
181
|
-
<!-- move to bottom -->
|
|
182
181
|
<schema-code-display
|
|
183
182
|
:schema-name="schemaCodeName"
|
|
184
183
|
:schemas="state.rawSchemasFull"
|
|
@@ -290,8 +289,8 @@
|
|
|
290
289
|
/>
|
|
291
290
|
</q-dialog>
|
|
292
291
|
|
|
293
|
-
<q-dialog v-model="showRouteDetail" position="bottom">
|
|
294
|
-
<q-card style="width: 1100px; max-width: 1100px">
|
|
292
|
+
<q-dialog v-model="showRouteDetail" seamless position="bottom">
|
|
293
|
+
<q-card style="width: 1100px; max-width: 1100px; max-height: 40vh">
|
|
295
294
|
<route-code-display :route-id="routeCodeId" @close="showRouteDetail=false" />
|
|
296
295
|
</q-card>
|
|
297
296
|
</q-dialog>
|
fastapi_voyager/web/vue-main.js
CHANGED
|
@@ -27,7 +27,7 @@ const app = createApp({
|
|
|
27
27
|
initializing: true,
|
|
28
28
|
// Splitter size (left panel width in px)
|
|
29
29
|
splitter: 300,
|
|
30
|
-
detailDrawer: false
|
|
30
|
+
detailDrawer: false,
|
|
31
31
|
});
|
|
32
32
|
|
|
33
33
|
const showDetail = ref(false);
|
|
@@ -42,7 +42,7 @@ const app = createApp({
|
|
|
42
42
|
const schemaFieldFilterSchema = ref(null); // external schemaName for schema-field-filter
|
|
43
43
|
const schemaCodeName = ref("");
|
|
44
44
|
const routeCodeId = ref("");
|
|
45
|
-
const showRouteDetail = ref(false)
|
|
45
|
+
const showRouteDetail = ref(false);
|
|
46
46
|
|
|
47
47
|
function openDetail() {
|
|
48
48
|
showDetail.value = true;
|
|
@@ -109,13 +109,17 @@ const app = createApp({
|
|
|
109
109
|
onSchemaClick: (id) => {
|
|
110
110
|
if (state.rawSchemas.has(id)) {
|
|
111
111
|
schemaCodeName.value = id;
|
|
112
|
-
state.detailDrawer = true
|
|
112
|
+
state.detailDrawer = true;
|
|
113
113
|
}
|
|
114
114
|
if (id in state.routeItems) {
|
|
115
115
|
routeCodeId.value = id;
|
|
116
|
-
showRouteDetail.value = true
|
|
116
|
+
showRouteDetail.value = true;
|
|
117
117
|
}
|
|
118
118
|
},
|
|
119
|
+
resetCb: () => {
|
|
120
|
+
state.detailDrawer = false;
|
|
121
|
+
showRouteDetail.value = false;
|
|
122
|
+
}
|
|
119
123
|
});
|
|
120
124
|
|
|
121
125
|
await graphUI.render(dotText, resetZoom);
|
|
@@ -202,8 +206,9 @@ const app = createApp({
|
|
|
202
206
|
state.tag = tagName;
|
|
203
207
|
state.routeId = "";
|
|
204
208
|
onGenerate();
|
|
205
|
-
return;
|
|
206
209
|
}
|
|
210
|
+
state.detailDrawer = false;
|
|
211
|
+
showRouteDetail.value = false;
|
|
207
212
|
}
|
|
208
213
|
|
|
209
214
|
function selectRoute(routeId) {
|
|
@@ -212,6 +217,8 @@ const app = createApp({
|
|
|
212
217
|
} else {
|
|
213
218
|
state.routeId = routeId;
|
|
214
219
|
}
|
|
220
|
+
state.detailDrawer = false;
|
|
221
|
+
showRouteDetail.value = false;
|
|
215
222
|
onGenerate();
|
|
216
223
|
}
|
|
217
224
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: fastapi-voyager
|
|
3
|
-
Version: 0.9.
|
|
3
|
+
Version: 0.9.4
|
|
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
|
|
@@ -212,9 +212,15 @@ or you can open router_viz.dot with vscode extension `graphviz interactive previ
|
|
|
212
212
|
- [x] improve initialization time cost
|
|
213
213
|
- [x] query route / schema info through realtime api
|
|
214
214
|
- [x] adjust fe
|
|
215
|
-
-
|
|
216
|
-
- [x]
|
|
217
|
-
|
|
215
|
+
- 0.9.3
|
|
216
|
+
- [x] adjust layout
|
|
217
|
+
- [x] show field detail in right panel
|
|
218
|
+
- [x] show route info in bottom
|
|
219
|
+
- 0.9.4
|
|
220
|
+
- [x] close schema sidebar when switch tag/route
|
|
221
|
+
- [x] schema detail panel show fields by default
|
|
222
|
+
- [x] adjust schema panel's height
|
|
223
|
+
- [x] show from base information in subset case
|
|
218
224
|
|
|
219
225
|
#### 0.10
|
|
220
226
|
- [ ] support opening route in swagger
|
|
@@ -263,37 +269,3 @@ pydantic-resolve's @ensure_subset decorator is helpful to pick fields from `sour
|
|
|
263
269
|
- [pydantic-resolve](https://github.com/allmonday/pydantic-resolve)
|
|
264
270
|
- Quasar
|
|
265
271
|
|
|
266
|
-
|
|
267
|
-
## Changelog
|
|
268
|
-
|
|
269
|
-
- 0.9:
|
|
270
|
-
- 0.9.3:
|
|
271
|
-
- enhancement: better UI
|
|
272
|
-
- 0.9.2:
|
|
273
|
-
- fix: missing fields in schema detail panel
|
|
274
|
-
- optimization: clean up fe codes.
|
|
275
|
-
- 0.9.1:
|
|
276
|
-
- api change: from `create_app_with_fastapi` to `create_voyager`, and expose as `from fastapi_voyager import create_voyager`
|
|
277
|
-
- optimization: lazy load vscode link and source code, speed up the initialization.
|
|
278
|
-
- 0.8:
|
|
279
|
-
- 0.8.3
|
|
280
|
-
- upgrade theme
|
|
281
|
-
- 0.8.2
|
|
282
|
-
- fix silly typo.
|
|
283
|
-
- 0.8.1
|
|
284
|
-
- add feature: hide primitive routes
|
|
285
|
-
- 0.7:
|
|
286
|
-
- 0.7.5
|
|
287
|
-
- fix show all display issue
|
|
288
|
-
- 0.7.4
|
|
289
|
-
- optimize tag/route, move to left.
|
|
290
|
-
- fresh on change, no need to click generate any more.
|
|
291
|
-
- 0.7.3
|
|
292
|
-
- fix `module_color` failure
|
|
293
|
-
- 0.7.2
|
|
294
|
-
- keep links inside filtered nodes.
|
|
295
|
-
- 0.7.1
|
|
296
|
-
- support brief mode, you can use `--module_prefix tests.service` to show links between routes and filtered schemas, to make the graph less complicated.
|
|
297
|
-
- 0.6:
|
|
298
|
-
- 0.6.2:
|
|
299
|
-
- fix generic related issue
|
|
@@ -6,18 +6,18 @@ fastapi_voyager/render.py,sha256=qy3g1Rz1s8XkuR_6n1Q1YPwy_oMOjWjNswTHQjdz4N0,776
|
|
|
6
6
|
fastapi_voyager/server.py,sha256=pg-LHDj4yU0usDA1b2X2Kt2_OCrexFA2G9ifGxb52Uc,6196
|
|
7
7
|
fastapi_voyager/type.py,sha256=pWYKmgb9e0W_JeD7k54Mr2lxUZV_Ir9TNpewGRwHyHQ,1629
|
|
8
8
|
fastapi_voyager/type_helper.py,sha256=hjBC4E0tgBpQDlYxGg74uK07SXjsrAgictEETJfIpYM,9231
|
|
9
|
-
fastapi_voyager/version.py,sha256=
|
|
10
|
-
fastapi_voyager/voyager.py,sha256=
|
|
11
|
-
fastapi_voyager/web/graph-ui.js,sha256=
|
|
9
|
+
fastapi_voyager/version.py,sha256=IZXkxs2gZAlAzk5SmuL6_BaHzvWZi9m7CX8vM0JMzW8,48
|
|
10
|
+
fastapi_voyager/voyager.py,sha256=QKWletUwZeHm8e8ZRcGm6OuhAdiik3tT7sOU-QnEuGA,11036
|
|
11
|
+
fastapi_voyager/web/graph-ui.js,sha256=FmKA3eeHMEeUDNuay3f54_fv4eGHT7MT0TaGqXhyMWQ,4978
|
|
12
12
|
fastapi_voyager/web/graphviz.svg.css,sha256=zDCjjpT0Idufu5YOiZI76PL70-avP3vTyzGPh9M85Do,1563
|
|
13
13
|
fastapi_voyager/web/graphviz.svg.js,sha256=lvAdbjHc-lMSk4GQp-iqYA2PCFX4RKnW7dFaoe0LUHs,16005
|
|
14
|
-
fastapi_voyager/web/index.html,sha256=
|
|
14
|
+
fastapi_voyager/web/index.html,sha256=tbrtun9cDFMwnUIN5S0gtMEs18bwZLgXuxsSaKxgcI0,13728
|
|
15
15
|
fastapi_voyager/web/quasar.min.css,sha256=F5jQe7X2XT54VlvAaa2V3GsBFdVD-vxDZeaPLf6U9CU,203145
|
|
16
16
|
fastapi_voyager/web/quasar.min.js,sha256=h0ftyPMW_CRiyzeVfQqiup0vrVt4_QWojpqmpnpn07E,502974
|
|
17
|
-
fastapi_voyager/web/vue-main.js,sha256=
|
|
17
|
+
fastapi_voyager/web/vue-main.js,sha256=bn4Q9FqX5RJVG9bA5xgUUt5TJf9CjiXcKtn_ikLsaKQ,8357
|
|
18
18
|
fastapi_voyager/web/component/render-graph.js,sha256=e8Xgh2Kl-nYU0P1gstEmAepCgFnk2J6UdxW8TlMafGs,2322
|
|
19
19
|
fastapi_voyager/web/component/route-code-display.js,sha256=8NJPPjNRUC21gjpY8XYEQs4RBbhX1pCiqEhJp39ku6k,3678
|
|
20
|
-
fastapi_voyager/web/component/schema-code-display.js,sha256=
|
|
20
|
+
fastapi_voyager/web/component/schema-code-display.js,sha256=UgFotzvqSuhnPXNOr6w_r1fV2_savRiCdokEvferutE,6244
|
|
21
21
|
fastapi_voyager/web/component/schema-field-filter.js,sha256=PR8d2_u1UiSLrS5zqAvY2UR8LbvjBqiUDt71tm1DJTs,6345
|
|
22
22
|
fastapi_voyager/web/icon/android-chrome-192x192.png,sha256=35sBy6jmUFJCcquStaafHH1qClZIbd-X3PIKSeLkrNo,37285
|
|
23
23
|
fastapi_voyager/web/icon/android-chrome-512x512.png,sha256=eb2eDjCwIruc05029_0L9hcrkVkv8KceLn1DJMYU0zY,210789
|
|
@@ -26,8 +26,8 @@ fastapi_voyager/web/icon/favicon-16x16.png,sha256=JC07jEzfIYxBIoQn_FHXvyHuxESdhW
|
|
|
26
26
|
fastapi_voyager/web/icon/favicon-32x32.png,sha256=C7v1h58cfWOsiLp9yOIZtlx-dLasBcq3NqpHVGRmpt4,1859
|
|
27
27
|
fastapi_voyager/web/icon/favicon.ico,sha256=tZolYIXkkBcFiYl1A8ksaXN2VjGamzcSdes838dLvNc,15406
|
|
28
28
|
fastapi_voyager/web/icon/site.webmanifest,sha256=ep4Hzh9zhmiZF2At3Fp1dQrYQuYF_3ZPZxc1KcGBvwQ,263
|
|
29
|
-
fastapi_voyager-0.9.
|
|
30
|
-
fastapi_voyager-0.9.
|
|
31
|
-
fastapi_voyager-0.9.
|
|
32
|
-
fastapi_voyager-0.9.
|
|
33
|
-
fastapi_voyager-0.9.
|
|
29
|
+
fastapi_voyager-0.9.4.dist-info/METADATA,sha256=jYmSddqIU_P3mROi5Rg9jjderpGJ4ASMDY4pZdoYBCs,8642
|
|
30
|
+
fastapi_voyager-0.9.4.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
|
31
|
+
fastapi_voyager-0.9.4.dist-info/entry_points.txt,sha256=pEIKoUnIDXEtdMBq8EmXm70m16vELIu1VPz9-TBUFWM,53
|
|
32
|
+
fastapi_voyager-0.9.4.dist-info/licenses/LICENSE,sha256=lNVRR3y_bFVoFKuK2JM8N4sFaj3m-7j29kvL3olFi5Y,1067
|
|
33
|
+
fastapi_voyager-0.9.4.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|