zudoku 0.3.0-dev.20 → 0.3.0-dev.22
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/config/config.d.ts +1 -1
- package/dist/lib/authentication/authentication.d.ts +1 -1
- package/dist/lib/plugins/api-keys/index.js +1 -0
- package/dist/lib/plugins/api-keys/index.js.map +1 -1
- package/dist/lib/plugins/markdown/generateRoutes.js +1 -1
- package/dist/lib/plugins/markdown/generateRoutes.js.map +1 -1
- package/dist/lib/plugins/openapi/OperationList.js +1 -1
- package/dist/lib/plugins/openapi/OperationList.js.map +1 -1
- package/dist/lib/plugins/openapi/PlaygroundDialogWrapper.js +1 -1
- package/dist/lib/plugins/openapi/PlaygroundDialogWrapper.js.map +1 -1
- package/dist/lib/plugins/openapi/Route.d.ts +6 -0
- package/dist/lib/plugins/openapi/Route.js +8 -0
- package/dist/lib/plugins/openapi/Route.js.map +1 -0
- package/dist/lib/plugins/openapi/context.d.ts +5 -0
- package/dist/lib/plugins/openapi/context.js +11 -0
- package/dist/lib/plugins/openapi/context.js.map +1 -0
- package/dist/lib/plugins/openapi/index.d.ts +1 -19
- package/dist/lib/plugins/openapi/index.js +17 -18
- package/dist/lib/plugins/openapi/index.js.map +1 -1
- package/dist/lib/plugins/openapi/interfaces.d.ts +15 -0
- package/dist/lib/plugins/openapi/interfaces.js +2 -0
- package/dist/lib/plugins/openapi/interfaces.js.map +1 -0
- package/dist/vite/build.js +4 -1
- package/dist/vite/build.js.map +1 -1
- package/dist/vite/config.d.ts +7 -7
- package/dist/vite/config.js +33 -38
- package/dist/vite/config.js.map +1 -1
- package/dist/vite/config.test.js +6 -3
- package/dist/vite/config.test.js.map +1 -1
- package/dist/vite/dev-server.js +3 -3
- package/dist/vite/dev-server.js.map +1 -1
- package/dist/vite/plugin-api-keys.js +2 -2
- package/dist/vite/plugin-api-keys.js.map +1 -1
- package/dist/vite/plugin-api.js +2 -2
- package/dist/vite/plugin-api.js.map +1 -1
- package/dist/vite/plugin-auth.js +2 -2
- package/dist/vite/plugin-auth.js.map +1 -1
- package/dist/vite/plugin-config.d.ts +1 -1
- package/dist/vite/plugin-config.js +7 -6
- package/dist/vite/plugin-config.js.map +1 -1
- package/dist/vite/plugin-redirect.js +2 -2
- package/dist/vite/plugin-redirect.js.map +1 -1
- package/lib/{util-voKLTRDG.js → AnchorLink-DIUlXlf0.js} +149 -184
- package/lib/DevPortalProvider-gzyAGqHT.js +1080 -0
- package/lib/{Markdown-5LmPZyLV.js → Markdown-BjA7peYW.js} +3 -3
- package/lib/{MdxComponents-DYD_QPVF.js → MdxComponents-W-fE1ISO.js} +130 -129
- package/lib/MdxPage-DQ7lZBzE.js +216 -0
- package/lib/OperationList-DuIBqFNA.js +5545 -0
- package/lib/Route-B98Y2MdH.js +13 -0
- package/lib/{Select-DR3PiqjV.js → Select-DczD5e29.js} +24 -22
- package/lib/{Spinner-DjQ2eBxC.js → Spinner-CSoij67T.js} +3 -3
- package/lib/cn-DpqTslo9.js +2341 -0
- package/lib/context-_fYfJFgk.js +13 -0
- package/lib/{hook-FCY9-FHO.js → hook-CBXxHulF.js} +1 -1
- package/lib/{index-By9bEW57.js → index-C7O9D7f6.js} +15 -15
- package/lib/index-CKvOcM7w.js +712 -0
- package/lib/index-Cg6lXS1z.js +709 -0
- package/lib/index-ClDDiRmC.js +463 -0
- package/lib/router-DibNxKUP.js +3008 -0
- package/lib/util-CaVongBq.js +40 -0
- package/lib/zudoku.auth-openid.js +7 -6
- package/lib/zudoku.components.js +73 -69
- package/lib/zudoku.plugin-api-keys.js +26 -23
- package/lib/zudoku.plugin-markdown.js +33 -237
- package/lib/zudoku.plugin-openapi.js +5 -6238
- package/lib/zudoku.plugin-redirect.js +7 -6
- package/package.json +1 -2
- package/src/lib/authentication/authentication.ts +1 -1
- package/src/lib/plugins/api-keys/index.tsx +1 -0
- package/src/lib/plugins/markdown/generateRoutes.tsx +2 -2
- package/src/lib/plugins/openapi/OperationList.tsx +1 -1
- package/src/lib/plugins/openapi/PlaygroundDialogWrapper.tsx +1 -1
- package/src/lib/plugins/openapi/Route.tsx +21 -0
- package/src/lib/plugins/openapi/context.tsx +16 -0
- package/src/lib/plugins/openapi/index.tsx +19 -46
- package/src/lib/plugins/openapi/interfaces.ts +9 -0
- package/lib/DevPortalProvider-CRKuwoXc.js +0 -4123
- package/lib/index-PyGcnQFX.js +0 -3462
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import { j as
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
import { j as s } from "./router-DibNxKUP.js";
|
|
2
|
+
import { N as i } from "./index-ClDDiRmC.js";
|
|
3
|
+
const p = (t) => ({
|
|
4
|
+
getRoutes: () => t.redirects.map(({ from: e, to: r, replace: o }) => ({
|
|
5
|
+
path: e,
|
|
6
|
+
element: /* @__PURE__ */ s.jsx(i, { to: r, replace: o })
|
|
6
7
|
}))
|
|
7
8
|
});
|
|
8
9
|
export {
|
|
9
|
-
|
|
10
|
+
p as redirectPlugin
|
|
10
11
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "zudoku",
|
|
3
|
-
"version": "0.3.0-dev.
|
|
3
|
+
"version": "0.3.0-dev.22",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"files": [
|
|
6
6
|
"dist",
|
|
@@ -78,7 +78,6 @@
|
|
|
78
78
|
"autoprefixer": "10.4.19",
|
|
79
79
|
"chokidar": "^3.6.0",
|
|
80
80
|
"dotenv": "16.4.5",
|
|
81
|
-
"esbuild": "0.23.0",
|
|
82
81
|
"express": "4.19.2",
|
|
83
82
|
"graphql": "16.9.0",
|
|
84
83
|
"graphql-type-json": "0.3.2",
|
|
@@ -2,7 +2,7 @@ import { useTopNavigationItem } from "../../components/context/DevPortalProvider
|
|
|
2
2
|
import { isPathItem } from "../../components/navigation/util.js";
|
|
3
3
|
import { Navigate, type RouteObject } from "../../core/router.js";
|
|
4
4
|
import { traverseNavigation } from "../../util/traverseNavigation.js";
|
|
5
|
-
|
|
5
|
+
|
|
6
6
|
import {
|
|
7
7
|
MarkdownPluginDefaultOptions,
|
|
8
8
|
MarkdownPluginOptions,
|
|
@@ -29,8 +29,8 @@ export const generateRoutes = (
|
|
|
29
29
|
return {
|
|
30
30
|
path: routePath,
|
|
31
31
|
lazy: async () => {
|
|
32
|
+
const { MdxPage } = await import("./MdxPage.js");
|
|
32
33
|
const { default: Component, ...props } = await importPromise();
|
|
33
|
-
|
|
34
34
|
return {
|
|
35
35
|
element: (
|
|
36
36
|
<MdxPage
|
|
@@ -4,8 +4,8 @@ import { Heading } from "../../components/Heading.js";
|
|
|
4
4
|
import { Markdown } from "../../components/Markdown.js";
|
|
5
5
|
import { cn } from "../../util/cn.js";
|
|
6
6
|
import { OperationListItem } from "./OperationListItem.js";
|
|
7
|
+
import { useOasConfig } from "./context.js";
|
|
7
8
|
import { graphql } from "./graphql/index.js";
|
|
8
|
-
import { useOasConfig } from "./index.js";
|
|
9
9
|
import { SchemaProseClasses } from "./util/prose.js";
|
|
10
10
|
import { useQuery } from "./util/urql.js";
|
|
11
11
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
+
import { useOasConfig } from "./context.js";
|
|
1
2
|
import { graphql } from "./graphql/index.js";
|
|
2
|
-
import { useOasConfig } from "./index.js";
|
|
3
3
|
import type { OperationListItemResult } from "./OperationList.js";
|
|
4
4
|
import { PlaygroundDialog } from "./playground/PlaygroundDialog.js";
|
|
5
5
|
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { Outlet } from "../../core/router.js";
|
|
2
|
+
import { OasConfigProvider } from "./context.js";
|
|
3
|
+
import { OasPluginConfig } from "./interfaces.js";
|
|
4
|
+
|
|
5
|
+
import { Provider, Client as UrqlClient } from "./util/urql.js";
|
|
6
|
+
|
|
7
|
+
export function OpenApiRoute({
|
|
8
|
+
config,
|
|
9
|
+
client,
|
|
10
|
+
}: {
|
|
11
|
+
config: OasPluginConfig;
|
|
12
|
+
client: typeof UrqlClient;
|
|
13
|
+
}) {
|
|
14
|
+
return (
|
|
15
|
+
<Provider value={client}>
|
|
16
|
+
<OasConfigProvider value={{ config }}>
|
|
17
|
+
<Outlet />
|
|
18
|
+
</OasConfigProvider>
|
|
19
|
+
</Provider>
|
|
20
|
+
);
|
|
21
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { createContext, useContext } from "react";
|
|
2
|
+
import { OasPluginConfig } from "./interfaces.js";
|
|
3
|
+
|
|
4
|
+
const OasContext = createContext<{ config: OasPluginConfig } | undefined>(
|
|
5
|
+
undefined,
|
|
6
|
+
);
|
|
7
|
+
|
|
8
|
+
export const OasConfigProvider = OasContext.Provider;
|
|
9
|
+
|
|
10
|
+
export const useOasConfig = () => {
|
|
11
|
+
const ctx = useContext(OasContext);
|
|
12
|
+
if (!ctx) {
|
|
13
|
+
throw new Error("useOasConfig must be used within a OasConfigProvider");
|
|
14
|
+
}
|
|
15
|
+
return ctx.config;
|
|
16
|
+
};
|
|
@@ -1,60 +1,18 @@
|
|
|
1
|
-
import { createContext, useContext } from "react";
|
|
2
1
|
import {
|
|
3
2
|
type DevPortalPlugin,
|
|
4
3
|
type PluginNavigationCategory,
|
|
5
4
|
} from "../../core/plugins.js";
|
|
6
|
-
import {
|
|
5
|
+
import { matchPath, type RouteObject } from "../../core/router.js";
|
|
7
6
|
import { MethodBadge } from "./MethodBadge.js";
|
|
8
|
-
import { OperationList } from "./OperationList.js";
|
|
9
7
|
import { graphql } from "./graphql/index.js";
|
|
10
8
|
import {
|
|
11
|
-
Provider,
|
|
12
9
|
Client as UrqlClient,
|
|
13
10
|
cacheExchange,
|
|
14
11
|
fetchExchange,
|
|
15
12
|
} from "./util/urql.js";
|
|
16
13
|
|
|
17
14
|
import { createSharedWorkerClient } from "virtual:zudoku-openapi-worker";
|
|
18
|
-
|
|
19
|
-
const OasContext = createContext<{ config: OasPluginConfig } | undefined>(
|
|
20
|
-
undefined,
|
|
21
|
-
);
|
|
22
|
-
|
|
23
|
-
export const OasConfigProvider = OasContext.Provider;
|
|
24
|
-
|
|
25
|
-
export const useOasConfig = () => {
|
|
26
|
-
const ctx = useContext(OasContext);
|
|
27
|
-
if (!ctx) {
|
|
28
|
-
throw new Error("useOasConfig must be used within a OasConfigProvider");
|
|
29
|
-
}
|
|
30
|
-
return ctx.config;
|
|
31
|
-
};
|
|
32
|
-
|
|
33
|
-
type OasSource =
|
|
34
|
-
| { type: "url"; input: string }
|
|
35
|
-
| { type: "yaml"; input: string }
|
|
36
|
-
| { type: "json"; input: object };
|
|
37
|
-
|
|
38
|
-
export type OasPluginConfig = {
|
|
39
|
-
server?: string;
|
|
40
|
-
path?: string;
|
|
41
|
-
} & OasSource;
|
|
42
|
-
|
|
43
|
-
const OasContextProvider = ({
|
|
44
|
-
config,
|
|
45
|
-
client,
|
|
46
|
-
}: {
|
|
47
|
-
config: OasPluginConfig;
|
|
48
|
-
client: typeof UrqlClient;
|
|
49
|
-
}) => {
|
|
50
|
-
return (
|
|
51
|
-
<Provider value={client}>
|
|
52
|
-
<OasConfigProvider value={{ config }}>
|
|
53
|
-
<Outlet />
|
|
54
|
-
</OasConfigProvider>
|
|
55
|
-
</Provider>
|
|
56
|
-
);
|
|
57
|
-
};
|
|
15
|
+
import { OasPluginConfig } from "./interfaces.js";
|
|
58
16
|
|
|
59
17
|
const GetCategoriesQuery = graphql(`
|
|
60
18
|
query GetCategories($input: JSON!, $type: SchemaType!) {
|
|
@@ -148,11 +106,26 @@ export const openApiPlugin = (config: OasPluginConfig): DevPortalPlugin => {
|
|
|
148
106
|
getRoutes: () =>
|
|
149
107
|
[
|
|
150
108
|
{
|
|
151
|
-
|
|
109
|
+
async lazy() {
|
|
110
|
+
const { OpenApiRoute } = await import("./Route.js");
|
|
111
|
+
return {
|
|
112
|
+
element: <OpenApiRoute client={client} config={config} />,
|
|
113
|
+
};
|
|
114
|
+
},
|
|
152
115
|
children: [
|
|
153
116
|
{
|
|
154
117
|
path: basePath,
|
|
155
|
-
children: [
|
|
118
|
+
children: [
|
|
119
|
+
{
|
|
120
|
+
index: true,
|
|
121
|
+
async lazy() {
|
|
122
|
+
const { OperationList } = await import(
|
|
123
|
+
"./OperationList.js"
|
|
124
|
+
);
|
|
125
|
+
return { element: <OperationList /> };
|
|
126
|
+
},
|
|
127
|
+
},
|
|
128
|
+
],
|
|
156
129
|
},
|
|
157
130
|
],
|
|
158
131
|
},
|