@lukoweb/apitogo 0.1.0 → 0.1.2
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.
- package/dist/cli/cli.js +37 -147
- package/dist/declarations/lib/ui/Command.d.ts +1 -1
- package/dist/declarations/lib/util/MdxComponents.d.ts +1 -1
- package/package.json +1 -1
- package/src/app/main.tsx +150 -150
- package/src/config/loader.ts +245 -245
- package/src/index.ts +33 -33
- package/src/lib/authentication/components/CallbackHandler.tsx +45 -45
- package/src/lib/authentication/components/SignIn.tsx +46 -46
- package/src/lib/authentication/components/SignUp.tsx +48 -48
- package/src/lib/authentication/providers/clerk.tsx +224 -224
- package/src/lib/authentication/ui/AuthCard.tsx +7 -7
- package/src/lib/authentication/ui/EmailLinkCallbackUi.tsx +129 -125
- package/src/lib/authentication/ui/EmailLinkSentUi.tsx +105 -101
- package/src/lib/authentication/ui/EmailLinkSignInUi.tsx +100 -96
- package/src/lib/authentication/ui/EmailVerificationUi.tsx +128 -124
- package/src/lib/authentication/ui/ZudokuAuthUi.tsx +620 -616
- package/src/lib/components/AiAssistantMenuItems.tsx +102 -102
- package/src/lib/components/Autocomplete.tsx +123 -123
- package/src/lib/components/DeveloperHint.tsx +39 -35
- package/src/lib/components/Header.tsx +260 -260
- package/src/lib/components/Layout.tsx +53 -53
- package/src/lib/components/Main.tsx +51 -51
- package/src/lib/components/Mermaid.tsx +74 -70
- package/src/lib/components/MobileTopNavigation.tsx +276 -276
- package/src/lib/components/MultiSelect.tsx +86 -82
- package/src/lib/components/TopNavigation.tsx +103 -103
- package/src/lib/components/index.ts +26 -26
- package/src/lib/components/navigation/NavigationCategory.tsx +157 -157
- package/src/lib/components/navigation/NavigationFilterInput.tsx +35 -35
- package/src/lib/components/navigation/NavigationItem.tsx +181 -177
- package/src/lib/core/RouteGuard.tsx +193 -193
- package/src/lib/errors/ErrorMessage.tsx +50 -46
- package/src/lib/plugins/api-catalog/Catalog.tsx +80 -80
- package/src/lib/plugins/api-keys/CreateApiKey.tsx +128 -124
- package/src/lib/plugins/api-keys/CreateApiKeyDialog.tsx +49 -49
- package/src/lib/plugins/api-keys/SettingsApiKeys.tsx +72 -72
- package/src/lib/plugins/api-keys/settings/ApiKeyItem.tsx +342 -342
- package/src/lib/plugins/api-keys/settings/RevealApiKey.tsx +127 -127
- package/src/lib/plugins/markdown/MdxPage.tsx +285 -285
- package/src/lib/plugins/openapi/ApiHeader.tsx +96 -96
- package/src/lib/plugins/openapi/CollapsibleCode.tsx +88 -88
- package/src/lib/plugins/openapi/DownloadSchemaButton.tsx +94 -94
- package/src/lib/plugins/openapi/GeneratedExampleSidecarBox.tsx +52 -52
- package/src/lib/plugins/openapi/OperationListItem.tsx +183 -183
- package/src/lib/plugins/openapi/RequestBodySidecarBox.tsx +63 -63
- package/src/lib/plugins/openapi/ResponsesSidecarBox.tsx +120 -117
- package/src/lib/plugins/openapi/SchemaInfo.tsx +344 -344
- package/src/lib/plugins/openapi/SchemaList.tsx +113 -113
- package/src/lib/plugins/openapi/Sidecar.tsx +312 -309
- package/src/lib/plugins/openapi/SidecarExamples.tsx +177 -174
- package/src/lib/plugins/openapi/components/EnumValues.tsx +58 -58
- package/src/lib/plugins/openapi/components/ResponseContent.tsx +117 -114
- package/src/lib/plugins/openapi/playground/BodyPanel.tsx +274 -271
- package/src/lib/plugins/openapi/playground/CollapsibleHeader.tsx +51 -51
- package/src/lib/plugins/openapi/playground/ExamplesDropdown.tsx +60 -60
- package/src/lib/plugins/openapi/playground/Headers.tsx +188 -181
- package/src/lib/plugins/openapi/playground/IdentityDialog.tsx +75 -75
- package/src/lib/plugins/openapi/playground/IdentitySelector.tsx +38 -38
- package/src/lib/plugins/openapi/playground/ParamsGrid.tsx +45 -45
- package/src/lib/plugins/openapi/playground/Playground.tsx +602 -599
- package/src/lib/plugins/openapi/playground/PlaygroundDialog.tsx +56 -56
- package/src/lib/plugins/openapi/playground/QueryParams.tsx +151 -148
- package/src/lib/plugins/openapi/playground/RequestLoginDialog.tsx +70 -70
- package/src/lib/plugins/openapi/playground/request-panel/MultipartField.tsx +91 -91
- package/src/lib/plugins/openapi/playground/result-panel/AudioPlayer.tsx +50 -50
- package/src/lib/plugins/openapi/playground/result-panel/ResponseTab.tsx +355 -355
- package/src/lib/plugins/openapi/playground/result-panel/ResultPanel.tsx +106 -102
- package/src/lib/plugins/openapi/schema/SchemaPropertyItem.tsx +189 -184
- package/src/lib/plugins/openapi/schema/SchemaView.tsx +299 -299
- package/src/lib/plugins/search-pagefind/IndexingDialog.tsx +162 -162
- package/src/lib/plugins/search-pagefind/PagefindSearch.tsx +202 -202
- package/src/lib/plugins/search-pagefind/ResultList.tsx +122 -118
- package/src/lib/ui/ActionButton.tsx +21 -21
- package/src/lib/ui/Command.tsx +191 -191
- package/src/lib/util/MdxComponents.tsx +150 -150
- package/src/vite/config.ts +234 -231
- package/src/vite/dev-server.ts +291 -291
- package/src/vite/plugin-api-keys.ts +50 -50
- package/src/vite/plugin-api.ts +320 -318
- package/src/vite/plugin-auth.ts +38 -38
- package/src/vite/plugin-component.ts +45 -39
- package/src/vite/plugin-config.ts +75 -75
- package/src/vite/plugin-custom-pages.ts +36 -36
- package/src/vite/plugin-docs.ts +202 -202
- package/src/vite/plugin-markdown-export.ts +214 -214
- package/src/vite/plugin-mdx.ts +149 -149
- package/src/vite/plugin-navigation.ts +106 -106
- package/src/vite/plugin-search.ts +47 -47
- package/src/vite/plugin.ts +42 -42
- package/src/vite/prerender/prerender.ts +233 -233
|
@@ -1,162 +1,162 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
} from "
|
|
17
|
-
|
|
18
|
-
type IndexingState =
|
|
19
|
-
| { status: "idle" }
|
|
20
|
-
| { status: "indexing"; total: number; current: number; path: string }
|
|
21
|
-
| { status: "complete"; indexed: number }
|
|
22
|
-
| { status: "error"; message: string };
|
|
23
|
-
|
|
24
|
-
const ProgressBar = ({
|
|
25
|
-
total,
|
|
26
|
-
current,
|
|
27
|
-
barLength = 25,
|
|
28
|
-
emptyChar = "░",
|
|
29
|
-
filledChar = "█",
|
|
30
|
-
}: {
|
|
31
|
-
total: number;
|
|
32
|
-
current: number;
|
|
33
|
-
barLength?: number;
|
|
34
|
-
emptyChar?: string;
|
|
35
|
-
filledChar?: string;
|
|
36
|
-
}) => {
|
|
37
|
-
const percent = Math.round((current / total) * 100);
|
|
38
|
-
const filled = Math.round((percent / 100) * barLength);
|
|
39
|
-
const empty = barLength - filled;
|
|
40
|
-
|
|
41
|
-
return (
|
|
42
|
-
<>
|
|
43
|
-
{filledChar.repeat(filled)}
|
|
44
|
-
{emptyChar.repeat(empty)} {percent}% ({current}/{total})
|
|
45
|
-
</>
|
|
46
|
-
);
|
|
47
|
-
};
|
|
48
|
-
|
|
49
|
-
const IndexingDialog = ({ children }: PropsWithChildren) => {
|
|
50
|
-
const [indexingState, setIndexingState] = useState<IndexingState>({
|
|
51
|
-
status: "idle",
|
|
52
|
-
});
|
|
53
|
-
|
|
54
|
-
const startIndexing = useCallback(() => {
|
|
55
|
-
setIndexingState({ status: "indexing", total: 0, current: 0, path: "" });
|
|
56
|
-
|
|
57
|
-
const eventSource = new EventSource("/__z/pagefind-reindex");
|
|
58
|
-
|
|
59
|
-
eventSource.onmessage = (event) => {
|
|
60
|
-
const data = JSON.parse(event.data);
|
|
61
|
-
|
|
62
|
-
if (data.type === "progress") {
|
|
63
|
-
setIndexingState({
|
|
64
|
-
status: "indexing",
|
|
65
|
-
total: data.total,
|
|
66
|
-
current: data.current,
|
|
67
|
-
path: data.path,
|
|
68
|
-
});
|
|
69
|
-
} else if (data.type === "complete") {
|
|
70
|
-
eventSource.close();
|
|
71
|
-
if (data.success) {
|
|
72
|
-
setIndexingState({ status: "complete", indexed: data.indexed });
|
|
73
|
-
} else {
|
|
74
|
-
setIndexingState({
|
|
75
|
-
status: "error",
|
|
76
|
-
message: data.error ?? "Indexing failed",
|
|
77
|
-
});
|
|
78
|
-
}
|
|
79
|
-
}
|
|
80
|
-
};
|
|
81
|
-
|
|
82
|
-
eventSource.onerror = () => {
|
|
83
|
-
eventSource.close();
|
|
84
|
-
setIndexingState({
|
|
85
|
-
status: "error",
|
|
86
|
-
message: "Connection lost during indexing",
|
|
87
|
-
});
|
|
88
|
-
};
|
|
89
|
-
|
|
90
|
-
return () => eventSource.close();
|
|
91
|
-
}, []);
|
|
92
|
-
|
|
93
|
-
useEffect(() => {
|
|
94
|
-
return startIndexing();
|
|
95
|
-
}, [startIndexing]);
|
|
96
|
-
|
|
97
|
-
const handleDone = () => {
|
|
98
|
-
if (indexingState.status !== "complete") return;
|
|
99
|
-
window.location.reload();
|
|
100
|
-
};
|
|
101
|
-
|
|
102
|
-
return (
|
|
103
|
-
<Dialog>
|
|
104
|
-
<DialogTrigger asChild>{children}</DialogTrigger>
|
|
105
|
-
<DialogContent
|
|
106
|
-
className="max-w-sm! top-1/3"
|
|
107
|
-
showCloseButton={false}
|
|
108
|
-
onInteractOutside={(e) => e.preventDefault()}
|
|
109
|
-
>
|
|
110
|
-
<DialogHeader>
|
|
111
|
-
<DialogTitle>
|
|
112
|
-
{indexingState.status === "indexing" && "Building Search Index"}
|
|
113
|
-
{indexingState.status === "complete" && "Indexing Complete"}
|
|
114
|
-
{indexingState.status === "error" && "Indexing Failed"}
|
|
115
|
-
{indexingState.status === "idle" && "Build Search Index"}
|
|
116
|
-
</DialogTitle>
|
|
117
|
-
<DialogDescription>
|
|
118
|
-
{indexingState.status === "indexing" && (
|
|
119
|
-
<>
|
|
120
|
-
{indexingState.total > 0 && (
|
|
121
|
-
<span className="font-mono text-sm mb-2 block">
|
|
122
|
-
<ProgressBar {...indexingState} />
|
|
123
|
-
</span>
|
|
124
|
-
)}
|
|
125
|
-
{indexingState.path && (
|
|
126
|
-
<span className="block text-xs truncate">
|
|
127
|
-
{indexingState.path}
|
|
128
|
-
</span>
|
|
129
|
-
)}
|
|
130
|
-
</>
|
|
131
|
-
)}
|
|
132
|
-
{indexingState.status === "complete" && (
|
|
133
|
-
<>Successfully indexed {indexingState.indexed} pages.</>
|
|
134
|
-
)}
|
|
135
|
-
{indexingState.status === "error" && (
|
|
136
|
-
<span className="text-destructive">{indexingState.message}</span>
|
|
137
|
-
)}
|
|
138
|
-
</DialogDescription>
|
|
139
|
-
</DialogHeader>
|
|
140
|
-
<DialogFooter>
|
|
141
|
-
<div className="flex justify-end gap-2">
|
|
142
|
-
{indexingState.status === "complete" && (
|
|
143
|
-
<Button size="sm" onClick={handleDone}>
|
|
144
|
-
Close and reload
|
|
145
|
-
</Button>
|
|
146
|
-
)}
|
|
147
|
-
{indexingState.status === "error" && (
|
|
148
|
-
<>
|
|
149
|
-
<Button variant="outline" onClick={handleDone}>
|
|
150
|
-
Cancel
|
|
151
|
-
</Button>
|
|
152
|
-
<Button onClick={startIndexing}>Retry</Button>
|
|
153
|
-
</>
|
|
154
|
-
)}
|
|
155
|
-
</div>
|
|
156
|
-
</DialogFooter>
|
|
157
|
-
</DialogContent>
|
|
158
|
-
</Dialog>
|
|
159
|
-
);
|
|
160
|
-
};
|
|
161
|
-
|
|
162
|
-
export default IndexingDialog;
|
|
1
|
+
import { Button } from "@lukoweb/apitogo/ui/Button.js";
|
|
2
|
+
import {
|
|
3
|
+
Dialog,
|
|
4
|
+
DialogContent,
|
|
5
|
+
DialogDescription,
|
|
6
|
+
DialogFooter,
|
|
7
|
+
DialogHeader,
|
|
8
|
+
DialogTitle,
|
|
9
|
+
} from "@lukoweb/apitogo/ui/Dialog.js";
|
|
10
|
+
import { DialogTrigger } from "@radix-ui/react-dialog";
|
|
11
|
+
import {
|
|
12
|
+
type PropsWithChildren,
|
|
13
|
+
useCallback,
|
|
14
|
+
useEffect,
|
|
15
|
+
useState,
|
|
16
|
+
} from "react";
|
|
17
|
+
|
|
18
|
+
type IndexingState =
|
|
19
|
+
| { status: "idle" }
|
|
20
|
+
| { status: "indexing"; total: number; current: number; path: string }
|
|
21
|
+
| { status: "complete"; indexed: number }
|
|
22
|
+
| { status: "error"; message: string };
|
|
23
|
+
|
|
24
|
+
const ProgressBar = ({
|
|
25
|
+
total,
|
|
26
|
+
current,
|
|
27
|
+
barLength = 25,
|
|
28
|
+
emptyChar = "░",
|
|
29
|
+
filledChar = "█",
|
|
30
|
+
}: {
|
|
31
|
+
total: number;
|
|
32
|
+
current: number;
|
|
33
|
+
barLength?: number;
|
|
34
|
+
emptyChar?: string;
|
|
35
|
+
filledChar?: string;
|
|
36
|
+
}) => {
|
|
37
|
+
const percent = Math.round((current / total) * 100);
|
|
38
|
+
const filled = Math.round((percent / 100) * barLength);
|
|
39
|
+
const empty = barLength - filled;
|
|
40
|
+
|
|
41
|
+
return (
|
|
42
|
+
<>
|
|
43
|
+
{filledChar.repeat(filled)}
|
|
44
|
+
{emptyChar.repeat(empty)} {percent}% ({current}/{total})
|
|
45
|
+
</>
|
|
46
|
+
);
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
const IndexingDialog = ({ children }: PropsWithChildren) => {
|
|
50
|
+
const [indexingState, setIndexingState] = useState<IndexingState>({
|
|
51
|
+
status: "idle",
|
|
52
|
+
});
|
|
53
|
+
|
|
54
|
+
const startIndexing = useCallback(() => {
|
|
55
|
+
setIndexingState({ status: "indexing", total: 0, current: 0, path: "" });
|
|
56
|
+
|
|
57
|
+
const eventSource = new EventSource("/__z/pagefind-reindex");
|
|
58
|
+
|
|
59
|
+
eventSource.onmessage = (event) => {
|
|
60
|
+
const data = JSON.parse(event.data);
|
|
61
|
+
|
|
62
|
+
if (data.type === "progress") {
|
|
63
|
+
setIndexingState({
|
|
64
|
+
status: "indexing",
|
|
65
|
+
total: data.total,
|
|
66
|
+
current: data.current,
|
|
67
|
+
path: data.path,
|
|
68
|
+
});
|
|
69
|
+
} else if (data.type === "complete") {
|
|
70
|
+
eventSource.close();
|
|
71
|
+
if (data.success) {
|
|
72
|
+
setIndexingState({ status: "complete", indexed: data.indexed });
|
|
73
|
+
} else {
|
|
74
|
+
setIndexingState({
|
|
75
|
+
status: "error",
|
|
76
|
+
message: data.error ?? "Indexing failed",
|
|
77
|
+
});
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
};
|
|
81
|
+
|
|
82
|
+
eventSource.onerror = () => {
|
|
83
|
+
eventSource.close();
|
|
84
|
+
setIndexingState({
|
|
85
|
+
status: "error",
|
|
86
|
+
message: "Connection lost during indexing",
|
|
87
|
+
});
|
|
88
|
+
};
|
|
89
|
+
|
|
90
|
+
return () => eventSource.close();
|
|
91
|
+
}, []);
|
|
92
|
+
|
|
93
|
+
useEffect(() => {
|
|
94
|
+
return startIndexing();
|
|
95
|
+
}, [startIndexing]);
|
|
96
|
+
|
|
97
|
+
const handleDone = () => {
|
|
98
|
+
if (indexingState.status !== "complete") return;
|
|
99
|
+
window.location.reload();
|
|
100
|
+
};
|
|
101
|
+
|
|
102
|
+
return (
|
|
103
|
+
<Dialog>
|
|
104
|
+
<DialogTrigger asChild>{children}</DialogTrigger>
|
|
105
|
+
<DialogContent
|
|
106
|
+
className="max-w-sm! top-1/3"
|
|
107
|
+
showCloseButton={false}
|
|
108
|
+
onInteractOutside={(e) => e.preventDefault()}
|
|
109
|
+
>
|
|
110
|
+
<DialogHeader>
|
|
111
|
+
<DialogTitle>
|
|
112
|
+
{indexingState.status === "indexing" && "Building Search Index"}
|
|
113
|
+
{indexingState.status === "complete" && "Indexing Complete"}
|
|
114
|
+
{indexingState.status === "error" && "Indexing Failed"}
|
|
115
|
+
{indexingState.status === "idle" && "Build Search Index"}
|
|
116
|
+
</DialogTitle>
|
|
117
|
+
<DialogDescription>
|
|
118
|
+
{indexingState.status === "indexing" && (
|
|
119
|
+
<>
|
|
120
|
+
{indexingState.total > 0 && (
|
|
121
|
+
<span className="font-mono text-sm mb-2 block">
|
|
122
|
+
<ProgressBar {...indexingState} />
|
|
123
|
+
</span>
|
|
124
|
+
)}
|
|
125
|
+
{indexingState.path && (
|
|
126
|
+
<span className="block text-xs truncate">
|
|
127
|
+
{indexingState.path}
|
|
128
|
+
</span>
|
|
129
|
+
)}
|
|
130
|
+
</>
|
|
131
|
+
)}
|
|
132
|
+
{indexingState.status === "complete" && (
|
|
133
|
+
<>Successfully indexed {indexingState.indexed} pages.</>
|
|
134
|
+
)}
|
|
135
|
+
{indexingState.status === "error" && (
|
|
136
|
+
<span className="text-destructive">{indexingState.message}</span>
|
|
137
|
+
)}
|
|
138
|
+
</DialogDescription>
|
|
139
|
+
</DialogHeader>
|
|
140
|
+
<DialogFooter>
|
|
141
|
+
<div className="flex justify-end gap-2">
|
|
142
|
+
{indexingState.status === "complete" && (
|
|
143
|
+
<Button size="sm" onClick={handleDone}>
|
|
144
|
+
Close and reload
|
|
145
|
+
</Button>
|
|
146
|
+
)}
|
|
147
|
+
{indexingState.status === "error" && (
|
|
148
|
+
<>
|
|
149
|
+
<Button variant="outline" onClick={handleDone}>
|
|
150
|
+
Cancel
|
|
151
|
+
</Button>
|
|
152
|
+
<Button onClick={startIndexing}>Retry</Button>
|
|
153
|
+
</>
|
|
154
|
+
)}
|
|
155
|
+
</div>
|
|
156
|
+
</DialogFooter>
|
|
157
|
+
</DialogContent>
|
|
158
|
+
</Dialog>
|
|
159
|
+
);
|
|
160
|
+
};
|
|
161
|
+
|
|
162
|
+
export default IndexingDialog;
|