fastapi-voyager 0.12.10__py3-none-any.whl → 0.12.12__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/render.py +1 -1
- fastapi_voyager/version.py +1 -1
- fastapi_voyager/web/graph-ui.js +11 -4
- fastapi_voyager/web/index.html +10 -2
- fastapi_voyager/web/store.js +7 -1
- fastapi_voyager/web/vue-main.js +32 -10
- {fastapi_voyager-0.12.10.dist-info → fastapi_voyager-0.12.12.dist-info}/METADATA +2 -3
- {fastapi_voyager-0.12.10.dist-info → fastapi_voyager-0.12.12.dist-info}/RECORD +11 -11
- {fastapi_voyager-0.12.10.dist-info → fastapi_voyager-0.12.12.dist-info}/WHEEL +0 -0
- {fastapi_voyager-0.12.10.dist-info → fastapi_voyager-0.12.12.dist-info}/entry_points.txt +0 -0
- {fastapi_voyager-0.12.10.dist-info → fastapi_voyager-0.12.12.dist-info}/licenses/LICENSE +0 -0
fastapi_voyager/render.py
CHANGED
|
@@ -57,7 +57,7 @@ class Renderer:
|
|
|
57
57
|
header_color = 'tomato' if node.id == self.schema else default_color
|
|
58
58
|
header = f"""<tr><td cellpadding="6" bgcolor="{header_color}" align="center" colspan="1" port="{PK}"> <font color="white"> {node.name} </font></td> </tr>"""
|
|
59
59
|
field_content = ''.join(fields_parts) if fields_parts else ''
|
|
60
|
-
return f"""<<table border="
|
|
60
|
+
return f"""<<table border="0" cellborder="1" cellpadding="0" cellspacing="0" bgcolor="white"> {header} {field_content} </table>>"""
|
|
61
61
|
|
|
62
62
|
def _handle_schema_anchor(self, source: str) -> str:
|
|
63
63
|
if '::' in source:
|
fastapi_voyager/version.py
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
__all__ = ["__version__"]
|
|
2
|
-
__version__ = "0.12.
|
|
2
|
+
__version__ = "0.12.12"
|
fastapi_voyager/web/graph-ui.js
CHANGED
|
@@ -91,7 +91,13 @@ export class GraphUI {
|
|
|
91
91
|
ready: function () {
|
|
92
92
|
self.gv = this;
|
|
93
93
|
|
|
94
|
-
self.gv.nodes()
|
|
94
|
+
const nodes = self.gv.nodes();
|
|
95
|
+
const edges = self.gv.edges();
|
|
96
|
+
|
|
97
|
+
nodes.off(".graphui");
|
|
98
|
+
edges.off(".graphui");
|
|
99
|
+
|
|
100
|
+
nodes.on("dblclick.graphui", function (event) {
|
|
95
101
|
event.stopPropagation();
|
|
96
102
|
try {
|
|
97
103
|
self.highlightSchemaBanner(this)
|
|
@@ -110,7 +116,7 @@ export class GraphUI {
|
|
|
110
116
|
}
|
|
111
117
|
});
|
|
112
118
|
|
|
113
|
-
|
|
119
|
+
edges.on("click.graphui", function (event) {
|
|
114
120
|
const up = $();
|
|
115
121
|
const down = $();
|
|
116
122
|
const edge = $();
|
|
@@ -127,13 +133,14 @@ export class GraphUI {
|
|
|
127
133
|
self._highlightEdgeNodes();
|
|
128
134
|
})
|
|
129
135
|
|
|
130
|
-
|
|
136
|
+
nodes.on("click.graphui", function (event) {
|
|
131
137
|
const set = $();
|
|
132
138
|
set.push(this);
|
|
133
139
|
const obj = { set, direction: "bidirectional" };
|
|
134
140
|
|
|
135
141
|
const schemaName = event.currentTarget.dataset.name;
|
|
136
|
-
|
|
142
|
+
console.log("shift click detected");
|
|
143
|
+
if (event.shiftKey && self.options.onSchemaShiftClick) {
|
|
137
144
|
if (schemaName) {
|
|
138
145
|
try {
|
|
139
146
|
self.options.onSchemaShiftClick(schemaName);
|
fastapi_voyager/web/index.html
CHANGED
|
@@ -158,7 +158,16 @@
|
|
|
158
158
|
@update:model-value="onSearchSchemaChange"
|
|
159
159
|
@filter="filterSearchSchemas"
|
|
160
160
|
@clear="resetSearch"
|
|
161
|
-
|
|
161
|
+
>
|
|
162
|
+
<template v-slot:option="scope">
|
|
163
|
+
<q-item v-bind="scope.itemProps">
|
|
164
|
+
<q-item-section>
|
|
165
|
+
<q-item-label>{{ scope.opt.label }}</q-item-label>
|
|
166
|
+
<q-item-label caption>{{ scope.opt.desc }}</q-item-label>
|
|
167
|
+
</q-item-section>
|
|
168
|
+
</q-item>
|
|
169
|
+
</template>
|
|
170
|
+
</q-select>
|
|
162
171
|
|
|
163
172
|
<q-select
|
|
164
173
|
dense
|
|
@@ -272,7 +281,6 @@
|
|
|
272
281
|
expand-separator
|
|
273
282
|
:model-value="store.state.leftPanel._tag === tag.name || store.state.search.mode"
|
|
274
283
|
@update:model-value="(val) => toggleTag(tag.name, val)"
|
|
275
|
-
@click="() => toggleTag(tag.name, true)"
|
|
276
284
|
:header-class="store.state.leftPanel.tag === tag.name ? 'text-primary text-bold tag-bg' : 'tag-bg'"
|
|
277
285
|
content-class="q-pa-none"
|
|
278
286
|
>
|
fastapi_voyager/web/store.js
CHANGED
|
@@ -9,6 +9,12 @@ const state = reactive({
|
|
|
9
9
|
config: {
|
|
10
10
|
initial_page_policy: 'first'
|
|
11
11
|
},
|
|
12
|
+
|
|
13
|
+
previousTagRoute: { // for shift + click, store previous tag/route, and populate back when needed
|
|
14
|
+
hasValue: false,
|
|
15
|
+
tag: null,
|
|
16
|
+
routeId: null
|
|
17
|
+
},
|
|
12
18
|
|
|
13
19
|
swagger: {
|
|
14
20
|
url: ''
|
|
@@ -87,7 +93,7 @@ const state = reactive({
|
|
|
87
93
|
hidePrimitiveRoute: false,
|
|
88
94
|
showFields: 'object',
|
|
89
95
|
brief: false,
|
|
90
|
-
showModule:
|
|
96
|
+
showModule: false,
|
|
91
97
|
}
|
|
92
98
|
|
|
93
99
|
})
|
fastapi_voyager/web/vue-main.js
CHANGED
|
@@ -12,14 +12,11 @@ const app = createApp({
|
|
|
12
12
|
let graphUI = null;
|
|
13
13
|
const allSchemaOptions = ref([]);
|
|
14
14
|
|
|
15
|
-
const NBSP = String.fromCharCode(160);
|
|
16
|
-
const formatSchemaLabel = (name, id) =>
|
|
17
|
-
`${name}${NBSP}${NBSP}${NBSP}-${NBSP}${NBSP}${NBSP}${id}`;
|
|
18
|
-
|
|
19
15
|
function rebuildSchemaOptions() {
|
|
20
16
|
const dict = store.state.graph.schemaMap || {};
|
|
21
17
|
const opts = Object.values(dict).map((s) => ({
|
|
22
|
-
label:
|
|
18
|
+
label: s.name,
|
|
19
|
+
desc: s.id,
|
|
23
20
|
value: s.id,
|
|
24
21
|
}));
|
|
25
22
|
allSchemaOptions.value = opts;
|
|
@@ -136,9 +133,19 @@ const app = createApp({
|
|
|
136
133
|
|
|
137
134
|
async function resetSearch() {
|
|
138
135
|
store.state.search.mode = false;
|
|
139
|
-
store.state.
|
|
140
|
-
store.state.
|
|
141
|
-
store.state.
|
|
136
|
+
console.log(store.state.previousTagRoute.hasValue)
|
|
137
|
+
console.log(store.state.previousTagRoute)
|
|
138
|
+
if (store.state.previousTagRoute.hasValue) {
|
|
139
|
+
store.state.leftPanel.tag = store.state.previousTagRoute.tag;
|
|
140
|
+
store.state.leftPanel._tag = store.state.previousTagRoute.tag;
|
|
141
|
+
store.state.leftPanel.routeId = store.state.previousTagRoute.routeId;
|
|
142
|
+
store.state.previousTagRoute.hasValue = false;
|
|
143
|
+
} else {
|
|
144
|
+
store.state.leftPanel.tag = null;
|
|
145
|
+
store.state.leftPanel._tag = null;
|
|
146
|
+
store.state.leftPanel.routeId = null;
|
|
147
|
+
}
|
|
148
|
+
|
|
142
149
|
syncSelectionToUrl()
|
|
143
150
|
await loadSearchedTags();
|
|
144
151
|
renderBasedOnInitialPolicy()
|
|
@@ -274,12 +281,19 @@ const app = createApp({
|
|
|
274
281
|
graphUI = new GraphUI("#graph", {
|
|
275
282
|
onSchemaShiftClick: (id) => {
|
|
276
283
|
if (store.state.graph.schemaKeys.has(id)) {
|
|
284
|
+
|
|
285
|
+
console.log(store.state.leftPanel)
|
|
286
|
+
store.state.previousTagRoute.tag = store.state.leftPanel.tag;
|
|
287
|
+
store.state.previousTagRoute.routeId = store.state.leftPanel.routeId;
|
|
288
|
+
store.state.previousTagRoute.hasValue = true;
|
|
289
|
+
|
|
277
290
|
store.state.search.mode = true;
|
|
278
291
|
store.state.search.schemaName = id;
|
|
279
292
|
onSearch();
|
|
280
293
|
}
|
|
281
294
|
},
|
|
282
295
|
onSchemaClick: (id) => {
|
|
296
|
+
console.log("schema clicked:", id);
|
|
283
297
|
resetDetailPanels();
|
|
284
298
|
if (store.state.graph.schemaKeys.has(id)) {
|
|
285
299
|
store.state.schemaDetail.schemaCodeName = id;
|
|
@@ -318,7 +332,7 @@ const app = createApp({
|
|
|
318
332
|
}
|
|
319
333
|
|
|
320
334
|
function toggleTag(tagName, expanded = null) {
|
|
321
|
-
if (expanded === true) {
|
|
335
|
+
if (expanded === true || store.state.search.mode === true) {
|
|
322
336
|
store.state.leftPanel._tag = tagName;
|
|
323
337
|
store.state.leftPanel.tag = tagName;
|
|
324
338
|
store.state.leftPanel.routeId = "";
|
|
@@ -335,16 +349,24 @@ const app = createApp({
|
|
|
335
349
|
}
|
|
336
350
|
|
|
337
351
|
function selectRoute(routeId) {
|
|
352
|
+
// find belonging tag
|
|
353
|
+
const belongingTag = findTagByRoute(routeId);
|
|
354
|
+
if (belongingTag) {
|
|
355
|
+
store.state.leftPanel.tag = belongingTag;
|
|
356
|
+
store.state.leftPanel._tag = belongingTag;
|
|
357
|
+
}
|
|
358
|
+
|
|
338
359
|
if (store.state.leftPanel.routeId === routeId) {
|
|
339
360
|
store.state.leftPanel.routeId = "";
|
|
340
361
|
} else {
|
|
341
362
|
store.state.leftPanel.routeId = routeId;
|
|
342
363
|
}
|
|
364
|
+
|
|
343
365
|
store.state.rightDrawer.drawer = false;
|
|
344
366
|
store.state.routeDetail.show = false;
|
|
345
367
|
store.state.schemaDetail.schemaCodeName = "";
|
|
346
|
-
onGenerate();
|
|
347
368
|
syncSelectionToUrl();
|
|
369
|
+
onGenerate();
|
|
348
370
|
}
|
|
349
371
|
|
|
350
372
|
function toggleShowModule(val) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: fastapi-voyager
|
|
3
|
-
Version: 0.12.
|
|
3
|
+
Version: 0.12.12
|
|
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
|
|
@@ -31,7 +31,6 @@ Description-Content-Type: text/markdown
|
|
|
31
31
|
[](https://pepy.tech/projects/fastapi-voyager)
|
|
32
32
|
|
|
33
33
|
|
|
34
|
-
|
|
35
34
|
Visualize your FastAPI endpoints, and explore them interactively.
|
|
36
35
|
|
|
37
36
|
> This repo is still in early stage, it supports pydantic v2 only
|
|
@@ -49,7 +48,7 @@ app.mount('/voyager',
|
|
|
49
48
|
module_color={'src.services': 'tomato'},
|
|
50
49
|
module_prefix='src.services',
|
|
51
50
|
swagger_url="/docs",
|
|
52
|
-
ga_id="G-
|
|
51
|
+
ga_id="G-XXXXXXXXVL",
|
|
53
52
|
initial_page_policy='first',
|
|
54
53
|
online_repo_url='https://github.com/allmonday/composition-oriented-development-pattern/blob/master'))
|
|
55
54
|
```
|
|
@@ -2,20 +2,20 @@ fastapi_voyager/__init__.py,sha256=kqwzThE1YhmQ_7jPKGlnWvqRGC-hFrRqq_lKhKaleYU,2
|
|
|
2
2
|
fastapi_voyager/cli.py,sha256=td3yIIigEomhSdDO-Xkh-CgpEwCafwlwnpvxnT9QsBo,10488
|
|
3
3
|
fastapi_voyager/filter.py,sha256=AN_HIu8-DtKisIq5mFt7CnqRHtxKewedNGyyaI82hSY,11529
|
|
4
4
|
fastapi_voyager/module.py,sha256=h9YR3BpS-CAcJW9WCdVkF4opqwY32w9T67g9GfdLytk,3425
|
|
5
|
-
fastapi_voyager/render.py,sha256=
|
|
5
|
+
fastapi_voyager/render.py,sha256=O_HR8ypOrFhjejkBpKIH_8foB78DgzH0hvO-CWeYt0w,9976
|
|
6
6
|
fastapi_voyager/server.py,sha256=wwCFl1eeq_jn8nfIwcy7s8Sh6MB55SN8u9AsJRnkFWQ,7979
|
|
7
7
|
fastapi_voyager/type.py,sha256=7EL1zaIwKVRGpLig7fqaOrZGN5k0Rm31C9COfck3CSs,1750
|
|
8
8
|
fastapi_voyager/type_helper.py,sha256=UTCFWluFeGdGkJX3wiE_bZ2EgZsu4JkmqHjsJVdG81Q,9953
|
|
9
|
-
fastapi_voyager/version.py,sha256=
|
|
9
|
+
fastapi_voyager/version.py,sha256=uMVhHNPllcfXfpMIZdSROm4RSeWFftaJbfJVxfSYOMo,50
|
|
10
10
|
fastapi_voyager/voyager.py,sha256=qJZvkLh5W_18X5B4pJ8XYbytx2Wvcz-0OnYoHWw8XlA,14046
|
|
11
|
-
fastapi_voyager/web/graph-ui.js,sha256=
|
|
11
|
+
fastapi_voyager/web/graph-ui.js,sha256=hTsZO1Ly1JuoRg0kZWQ62jeLiD2kbnzACfbSPd0F95U,6634
|
|
12
12
|
fastapi_voyager/web/graphviz.svg.css,sha256=zDCjjpT0Idufu5YOiZI76PL70-avP3vTyzGPh9M85Do,1563
|
|
13
13
|
fastapi_voyager/web/graphviz.svg.js,sha256=wZwz_lBztoXmujEN21P0w-HMpdmbqPwTQQ6Ebxd9rGo,18569
|
|
14
|
-
fastapi_voyager/web/index.html,sha256=
|
|
14
|
+
fastapi_voyager/web/index.html,sha256=SNa6Vt3juCbRztA3ZH1PpJ0kW5fFSY1Mb0vVock2SOY,18774
|
|
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/store.js,sha256=
|
|
18
|
-
fastapi_voyager/web/vue-main.js,sha256=
|
|
17
|
+
fastapi_voyager/web/store.js,sha256=rC9dMRv9sYuVHa5SJWaDI5cxgBZQ6bXk5F2M2e6KtmY,1958
|
|
18
|
+
fastapi_voyager/web/vue-main.js,sha256=DFSje-Axno70B9NmmNAYhMsJU7YXZypz5hFdt3xcVK4,15061
|
|
19
19
|
fastapi_voyager/web/component/demo.js,sha256=bQb16Un4XZ3Mf8qL6gvyrXe_mmA3V3mSIRMQAWg2MNk,352
|
|
20
20
|
fastapi_voyager/web/component/render-graph.js,sha256=e8Xgh2Kl-nYU0P1gstEmAepCgFnk2J6UdxW8TlMafGs,2322
|
|
21
21
|
fastapi_voyager/web/component/route-code-display.js,sha256=8NJPPjNRUC21gjpY8XYEQs4RBbhX1pCiqEhJp39ku6k,3678
|
|
@@ -27,8 +27,8 @@ fastapi_voyager/web/icon/favicon-16x16.png,sha256=JC07jEzfIYxBIoQn_FHXvyHuxESdhW
|
|
|
27
27
|
fastapi_voyager/web/icon/favicon-32x32.png,sha256=C7v1h58cfWOsiLp9yOIZtlx-dLasBcq3NqpHVGRmpt4,1859
|
|
28
28
|
fastapi_voyager/web/icon/favicon.ico,sha256=tZolYIXkkBcFiYl1A8ksaXN2VjGamzcSdes838dLvNc,15406
|
|
29
29
|
fastapi_voyager/web/icon/site.webmanifest,sha256=ep4Hzh9zhmiZF2At3Fp1dQrYQuYF_3ZPZxc1KcGBvwQ,263
|
|
30
|
-
fastapi_voyager-0.12.
|
|
31
|
-
fastapi_voyager-0.12.
|
|
32
|
-
fastapi_voyager-0.12.
|
|
33
|
-
fastapi_voyager-0.12.
|
|
34
|
-
fastapi_voyager-0.12.
|
|
30
|
+
fastapi_voyager-0.12.12.dist-info/METADATA,sha256=8bnLo4QwIIFzKc2esih1Vw2pQ9SwGxIi_FY3E3emp_I,6523
|
|
31
|
+
fastapi_voyager-0.12.12.dist-info/WHEEL,sha256=WLgqFyCfm_KASv4WHyYy0P3pM_m7J5L9k2skdKLirC8,87
|
|
32
|
+
fastapi_voyager-0.12.12.dist-info/entry_points.txt,sha256=pEIKoUnIDXEtdMBq8EmXm70m16vELIu1VPz9-TBUFWM,53
|
|
33
|
+
fastapi_voyager-0.12.12.dist-info/licenses/LICENSE,sha256=lNVRR3y_bFVoFKuK2JM8N4sFaj3m-7j29kvL3olFi5Y,1067
|
|
34
|
+
fastapi_voyager-0.12.12.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|