zudoku 0.26.0 → 0.26.1
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 -0
- package/dist/config/loader.js +1 -1
- package/dist/config/loader.js.map +1 -1
- package/dist/config/validators/common.d.ts +11 -0
- package/dist/config/validators/common.js +1 -0
- package/dist/config/validators/common.js.map +1 -1
- package/dist/config/validators/validate.d.ts +5 -0
- package/dist/lib/authentication/providers/auth0.js +1 -1
- package/dist/lib/authentication/providers/auth0.js.map +1 -1
- package/dist/lib/authentication/providers/openid.d.ts +1 -1
- package/dist/lib/authentication/providers/openid.js +10 -6
- package/dist/lib/authentication/providers/openid.js.map +1 -1
- package/dist/lib/components/Autocomplete.d.ts +12 -0
- package/dist/lib/components/Autocomplete.js +47 -0
- package/dist/lib/components/Autocomplete.js.map +1 -0
- package/dist/lib/components/Header.js +3 -3
- package/dist/lib/components/Header.js.map +1 -1
- package/dist/lib/components/index.js +2 -2
- package/dist/lib/components/index.js.map +1 -1
- package/dist/lib/plugins/markdown/MdxPage.js +8 -2
- package/dist/lib/plugins/markdown/MdxPage.js.map +1 -1
- package/dist/lib/plugins/openapi/PlaygroundDialogWrapper.d.ts +3 -1
- package/dist/lib/plugins/openapi/PlaygroundDialogWrapper.js +3 -2
- package/dist/lib/plugins/openapi/PlaygroundDialogWrapper.js.map +1 -1
- package/dist/lib/plugins/openapi/Sidecar.js +1 -1
- package/dist/lib/plugins/openapi/Sidecar.js.map +1 -1
- package/dist/lib/plugins/openapi/playground/ExamplesDropdown.d.ts +6 -0
- package/dist/lib/plugins/openapi/playground/ExamplesDropdown.js +12 -0
- package/dist/lib/plugins/openapi/playground/ExamplesDropdown.js.map +1 -0
- package/dist/lib/plugins/openapi/playground/Headers.js +66 -4
- package/dist/lib/plugins/openapi/playground/Headers.js.map +1 -1
- package/dist/lib/plugins/openapi/playground/Playground.d.ts +5 -1
- package/dist/lib/plugins/openapi/playground/Playground.js +36 -11
- package/dist/lib/plugins/openapi/playground/Playground.js.map +1 -1
- package/dist/lib/plugins/openapi/playground/QueryParams.js +20 -30
- package/dist/lib/plugins/openapi/playground/QueryParams.js.map +1 -1
- package/dist/lib/plugins/openapi/post-processors/removeExtensions.d.ts +2 -1
- package/dist/lib/plugins/openapi/post-processors/removeExtensions.js +5 -3
- package/dist/lib/plugins/openapi/post-processors/removeExtensions.js.map +1 -1
- package/dist/lib/plugins/openapi/post-processors/removeExtensions.test.js +49 -0
- package/dist/lib/plugins/openapi/post-processors/removeExtensions.test.js.map +1 -1
- package/dist/lib/plugins/openapi/post-processors/removeParameters.d.ts +10 -0
- package/dist/lib/plugins/openapi/post-processors/removeParameters.js +66 -0
- package/dist/lib/plugins/openapi/post-processors/removeParameters.js.map +1 -0
- package/dist/lib/plugins/openapi/post-processors/removeParameters.test.d.ts +1 -0
- package/dist/lib/plugins/openapi/post-processors/removeParameters.test.js +131 -0
- package/dist/lib/plugins/openapi/post-processors/removeParameters.test.js.map +1 -0
- package/dist/lib/ui/Command.d.ts +9 -1
- package/dist/lib/ui/Command.js +5 -1
- package/dist/lib/ui/Command.js.map +1 -1
- package/dist/lib/util/joinUrl.d.ts +1 -0
- package/dist/lib/util/joinUrl.js +40 -0
- package/dist/lib/util/joinUrl.js.map +1 -0
- package/dist/vite/build.js +10 -10
- package/dist/vite/build.js.map +1 -1
- package/dist/vite/config.js +4 -1
- package/dist/vite/config.js.map +1 -1
- package/dist/vite/dev-server.js +4 -1
- package/dist/vite/dev-server.js.map +1 -1
- package/dist/vite/plugin-api.d.ts +1 -1
- package/dist/vite/plugin-api.js +23 -5
- package/dist/vite/plugin-api.js.map +1 -1
- package/dist/vite/plugin-auth.js +4 -1
- package/dist/vite/plugin-auth.js.map +1 -1
- package/dist/vite/plugin-mdx.js +9 -4
- package/dist/vite/plugin-mdx.js.map +1 -1
- package/dist/vite/prerender.d.ts +2 -2
- package/dist/vite/prerender.js +4 -4
- package/dist/vite/prerender.js.map +1 -1
- package/dist/zuplo/enrich-with-zuplo.d.ts +5 -0
- package/dist/zuplo/enrich-with-zuplo.js +184 -0
- package/dist/zuplo/enrich-with-zuplo.js.map +1 -0
- package/dist/zuplo/env.d.ts +1 -0
- package/dist/zuplo/env.js +3 -0
- package/dist/zuplo/env.js.map +1 -1
- package/dist/zuplo/policy-types.d.ts +33 -0
- package/dist/zuplo/policy-types.js +8 -0
- package/dist/zuplo/policy-types.js.map +1 -0
- package/dist/zuplo/with-zuplo-processors.d.ts +3 -0
- package/dist/zuplo/with-zuplo-processors.js +26 -0
- package/dist/zuplo/with-zuplo-processors.js.map +1 -0
- package/dist/zuplo/with-zuplo.d.ts +1 -2
- package/dist/zuplo/with-zuplo.js +6 -27
- package/dist/zuplo/with-zuplo.js.map +1 -1
- package/lib/{AnchorLink-_Vu02ceN.js → AnchorLink-bObQitZv.js} +2 -2
- package/lib/{AnchorLink-_Vu02ceN.js.map → AnchorLink-bObQitZv.js.map} +1 -1
- package/lib/{AuthenticationPlugin-DNXBcsVN.js → AuthenticationPlugin-C9SwOxkc.js} +3 -3
- package/lib/{AuthenticationPlugin-DNXBcsVN.js.map → AuthenticationPlugin-C9SwOxkc.js.map} +1 -1
- package/lib/{Markdown-BrfrjEk_.js → Markdown-DFN6p0J-.js} +2 -2
- package/lib/{Markdown-BrfrjEk_.js.map → Markdown-DFN6p0J-.js.map} +1 -1
- package/lib/{MdxPage-LNZLj_A5.js → MdxPage-D9c4z09Q.js} +63 -58
- package/lib/MdxPage-D9c4z09Q.js.map +1 -0
- package/lib/{OperationList-PCwzTp1r.js → OperationList-DGJWDx1G.js} +875 -871
- package/lib/{OperationList-PCwzTp1r.js.map → OperationList-DGJWDx1G.js.map} +1 -1
- package/lib/{Route-Pzk6qwIk.js → Route-VdmEyOD0.js} +3 -3
- package/lib/{Route-Pzk6qwIk.js.map → Route-VdmEyOD0.js.map} +1 -1
- package/lib/{Select-DkOpAG0c.js → Select-D3O7wISy.js} +3 -3
- package/lib/{Select-DkOpAG0c.js.map → Select-D3O7wISy.js.map} +1 -1
- package/lib/{SlotletProvider-DPbx9KdU.js → SlotletProvider-_3zzX_g_.js} +4 -4
- package/lib/{SlotletProvider-DPbx9KdU.js.map → SlotletProvider-_3zzX_g_.js.map} +1 -1
- package/lib/{Button-oroWHXAy.js → Spinner-BlzrEEk1.js} +15 -12
- package/lib/Spinner-BlzrEEk1.js.map +1 -0
- package/lib/{ZudokuContext-D3ayHjP-.js → ZudokuContext-DeQZEp-x.js} +2 -2
- package/lib/{ZudokuContext-D3ayHjP-.js.map → ZudokuContext-DeQZEp-x.js.map} +1 -1
- package/lib/{chunk-SYFQ2XB5-KWlHsT7t.js → chunk-SYFQ2XB5-BF5IDYrB.js} +6 -5
- package/lib/{chunk-SYFQ2XB5-KWlHsT7t.js.map → chunk-SYFQ2XB5-BF5IDYrB.js.map} +1 -1
- package/lib/{hook-DUyACbIK.js → hook-BRQEDRbn.js} +2 -2
- package/lib/{hook-DUyACbIK.js.map → hook-BRQEDRbn.js.map} +1 -1
- package/lib/index-B7mqiOei.js +509 -0
- package/lib/index-B7mqiOei.js.map +1 -0
- package/lib/index-CXRrqOIl.js +1750 -0
- package/lib/index-CXRrqOIl.js.map +1 -0
- package/lib/joinUrl-BTy9bvoK.js +20 -0
- package/lib/joinUrl-BTy9bvoK.js.map +1 -0
- package/lib/post-processors/removeExtensions.js +7 -7
- package/lib/post-processors/removeExtensions.js.map +1 -1
- package/lib/post-processors/removeParameters.js +48 -0
- package/lib/post-processors/removeParameters.js.map +1 -0
- package/lib/ui/ActionButton.js +10 -11
- package/lib/ui/ActionButton.js.map +1 -1
- package/lib/ui/Command.js +125 -13
- package/lib/ui/Command.js.map +1 -1
- package/lib/{useExposedProps-BBHR7aLM.js → useExposedProps-CetwhZpP.js} +2 -2
- package/lib/{useExposedProps-BBHR7aLM.js.map → useExposedProps-CetwhZpP.js.map} +1 -1
- package/lib/zudoku.auth-auth0.js +7 -9
- package/lib/zudoku.auth-auth0.js.map +1 -1
- package/lib/zudoku.auth-clerk.js +1 -1
- package/lib/zudoku.auth-openid.js +223 -219
- package/lib/zudoku.auth-openid.js.map +1 -1
- package/lib/zudoku.components.js +219 -219
- package/lib/zudoku.components.js.map +1 -1
- package/lib/zudoku.plugin-api-catalog.js +3 -3
- package/lib/zudoku.plugin-api-keys.js +5 -5
- package/lib/zudoku.plugin-custom-pages.js +2 -2
- package/lib/zudoku.plugin-markdown.js +1 -1
- package/lib/zudoku.plugin-openapi.js +4 -4
- package/lib/zudoku.plugin-redirect.js +1 -1
- package/package.json +1 -1
- package/src/app/main.css +50 -50
- package/src/lib/authentication/providers/auth0.tsx +1 -4
- package/src/lib/authentication/providers/openid.tsx +12 -5
- package/src/lib/components/Autocomplete.tsx +111 -0
- package/src/lib/components/Header.tsx +3 -3
- package/src/lib/components/index.ts +2 -2
- package/src/lib/plugins/markdown/MdxPage.tsx +9 -1
- package/src/lib/plugins/openapi/PlaygroundDialogWrapper.tsx +5 -0
- package/src/lib/plugins/openapi/Sidecar.tsx +1 -0
- package/src/lib/plugins/openapi/playground/ExamplesDropdown.tsx +51 -0
- package/src/lib/plugins/openapi/playground/Headers.tsx +138 -41
- package/src/lib/plugins/openapi/playground/Playground.tsx +156 -62
- package/src/lib/plugins/openapi/playground/QueryParams.tsx +89 -122
- package/src/lib/plugins/openapi/post-processors/removeExtensions.test.ts +58 -0
- package/src/lib/plugins/openapi/post-processors/removeExtensions.ts +7 -4
- package/src/lib/plugins/openapi/post-processors/removeParameters.test.ts +148 -0
- package/src/lib/plugins/openapi/post-processors/removeParameters.ts +101 -0
- package/src/lib/ui/Command.tsx +20 -0
- package/src/lib/util/joinUrl.ts +57 -0
- package/dist/lib/plugins/openapi/playground/EnumSelector.d.ts +0 -8
- package/dist/lib/plugins/openapi/playground/EnumSelector.js +0 -21
- package/dist/lib/plugins/openapi/playground/EnumSelector.js.map +0 -1
- package/lib/Button-oroWHXAy.js.map +0 -1
- package/lib/Command-D5DE0DD7.js +0 -611
- package/lib/Command-D5DE0DD7.js.map +0 -1
- package/lib/MdxPage-LNZLj_A5.js.map +0 -1
- package/lib/Spinner-C5gHXrVz.js +0 -7
- package/lib/Spinner-C5gHXrVz.js.map +0 -1
- package/lib/index-CaILD1AV.js +0 -1292
- package/lib/index-CaILD1AV.js.map +0 -1
- package/src/lib/plugins/openapi/playground/EnumSelector.tsx +0 -86
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { j as e } from "./jsx-runtime-Bdg6XQ1m.js";
|
|
2
2
|
import { s as j } from "./index-LNp6rxyU.js";
|
|
3
|
-
import { u as b } from "./ZudokuContext-
|
|
4
|
-
import { b as y } from "./chunk-SYFQ2XB5-
|
|
3
|
+
import { u as b } from "./ZudokuContext-DeQZEp-x.js";
|
|
4
|
+
import { b as y } from "./chunk-SYFQ2XB5-BF5IDYrB.js";
|
|
5
5
|
import { Head as v, Link as N } from "./zudoku.components.js";
|
|
6
6
|
import { u as w } from "./state-mM7uaXTW.js";
|
|
7
|
-
import { M as C } from "./Markdown-
|
|
7
|
+
import { M as C } from "./Markdown-DFN6p0J-.js";
|
|
8
8
|
import { c as h } from "./cn-qaFjX9_3.js";
|
|
9
9
|
const f = (r, n) => j(`${r}-${n}`), k = ({
|
|
10
10
|
items: r,
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { j as e } from "./jsx-runtime-Bdg6XQ1m.js";
|
|
2
2
|
import { RotateCwIcon as g, TrashIcon as f, EyeOffIcon as j, EyeIcon as v, CheckIcon as w, CopyIcon as b, FileKey2Icon as K } from "lucide-react";
|
|
3
|
-
import { D as k, S as m, R as N } from "./SlotletProvider-
|
|
3
|
+
import { D as k, S as m, R as N } from "./SlotletProvider-_3zzX_g_.js";
|
|
4
4
|
import { i as c } from "./invariant-Caa8-XvF.js";
|
|
5
|
-
import { u as d, S as I, a as S, b as A, c as C, d as E, e as x } from "./Select-
|
|
5
|
+
import { u as d, S as I, a as S, b as A, c as C, d as E, e as x } from "./Select-D3O7wISy.js";
|
|
6
6
|
import { a as P } from "./index.esm-CrSoEshU.js";
|
|
7
|
-
import { a as D, L as u, O as R } from "./chunk-SYFQ2XB5-
|
|
8
|
-
import { a as y, e as q, u as O } from "./ZudokuContext-
|
|
7
|
+
import { a as D, L as u, O as R } from "./chunk-SYFQ2XB5-BF5IDYrB.js";
|
|
8
|
+
import { a as y, e as q, u as O } from "./ZudokuContext-DeQZEp-x.js";
|
|
9
9
|
import { Button as l } from "./ui/Button.js";
|
|
10
10
|
import { Input as z } from "./ui/Input.js";
|
|
11
|
-
import { u as F } from "./hook-
|
|
11
|
+
import { u as F } from "./hook-BRQEDRbn.js";
|
|
12
12
|
import { useState as p } from "react";
|
|
13
13
|
import { c as T } from "./cn-qaFjX9_3.js";
|
|
14
14
|
const L = ({ service: t }) => {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { j as o } from "./jsx-runtime-Bdg6XQ1m.js";
|
|
2
2
|
import a from "react";
|
|
3
|
-
import { P as n } from "./Markdown-
|
|
3
|
+
import { P as n } from "./Markdown-DFN6p0J-.js";
|
|
4
4
|
import { c } from "./cn-qaFjX9_3.js";
|
|
5
|
-
import { u as p } from "./useExposedProps-
|
|
5
|
+
import { u as p } from "./useExposedProps-CetwhZpP.js";
|
|
6
6
|
const u = ({
|
|
7
7
|
element: t,
|
|
8
8
|
render: s,
|
|
@@ -74,7 +74,7 @@ const C = (n) => ({
|
|
|
74
74
|
const h = {
|
|
75
75
|
path: r,
|
|
76
76
|
lazy: async () => {
|
|
77
|
-
const { MdxPage: l } = await import("./MdxPage-
|
|
77
|
+
const { MdxPage: l } = await import("./MdxPage-D9c4z09Q.js"), { default: p, ...g } = await a();
|
|
78
78
|
return {
|
|
79
79
|
element: /* @__PURE__ */ P.jsx(
|
|
80
80
|
l,
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import "./jsx-runtime-Bdg6XQ1m.js";
|
|
2
|
-
import "./chunk-SYFQ2XB5-
|
|
3
|
-
import { o as a } from "./index-
|
|
4
|
-
import "./ZudokuContext-
|
|
2
|
+
import "./chunk-SYFQ2XB5-BF5IDYrB.js";
|
|
3
|
+
import { o as a } from "./index-CXRrqOIl.js";
|
|
4
|
+
import "./ZudokuContext-DeQZEp-x.js";
|
|
5
5
|
import "lucide-react";
|
|
6
|
-
import "./hook-
|
|
6
|
+
import "./hook-BRQEDRbn.js";
|
|
7
7
|
import "./ui/Button.js";
|
|
8
8
|
export {
|
|
9
9
|
a as openApiPlugin
|
package/package.json
CHANGED
package/src/app/main.css
CHANGED
|
@@ -238,57 +238,57 @@
|
|
|
238
238
|
}
|
|
239
239
|
|
|
240
240
|
/* Theme */
|
|
241
|
-
|
|
242
|
-
@layer base {
|
|
243
|
-
:root {
|
|
244
|
-
--background: 0 0% 100%;
|
|
245
|
-
--foreground: 240 10% 3.9%;
|
|
246
|
-
--card: 0 0% 100%;
|
|
247
|
-
--card-foreground: 240 10% 3.9%;
|
|
248
|
-
--popover: 0 0% 100%;
|
|
249
|
-
--popover-foreground: 240 10% 3.9%;
|
|
250
|
-
--primary: 240 5.9% 10%;
|
|
251
|
-
--primary-foreground: 0 0% 98%;
|
|
252
|
-
--secondary: 240 4.8% 95.9%;
|
|
253
|
-
--secondary-foreground: 240 5.9% 10%;
|
|
254
|
-
--muted: 240 4.8% 95.9%;
|
|
255
|
-
--muted-foreground: 240 3.8% 46.1%;
|
|
256
|
-
--accent: 240 4.8% 95.9%;
|
|
257
|
-
--accent-foreground: 240 5.9% 10%;
|
|
258
|
-
--destructive: 0 84.2% 60.2%;
|
|
259
|
-
--destructive-foreground: 0 0% 98%;
|
|
260
|
-
--border: 240 5.9% 95%;
|
|
261
|
-
--input: 240 5.9% 90%;
|
|
262
|
-
--ring: 240 5.9% 10%;
|
|
263
|
-
--radius: 0.75rem;
|
|
264
|
-
--chart-1: 12 76% 61%;
|
|
265
|
-
--chart-2: 173 58% 39%;
|
|
266
|
-
--chart-3: 197 37% 24%;
|
|
267
|
-
--chart-4: 43 74% 66%;
|
|
268
|
-
--chart-5: 27 87% 67%;
|
|
269
|
-
}
|
|
270
241
|
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
242
|
+
@layer base {
|
|
243
|
+
:root {
|
|
244
|
+
--background: 0 0% 100%;
|
|
245
|
+
--foreground: 240 10% 3.9%;
|
|
246
|
+
--card: 0 0% 100%;
|
|
247
|
+
--card-foreground: 240 10% 3.9%;
|
|
248
|
+
--popover: 0 0% 100%;
|
|
249
|
+
--popover-foreground: 240 10% 3.9%;
|
|
250
|
+
--primary: 240 5.9% 10%;
|
|
251
|
+
--primary-foreground: 0 0% 98%;
|
|
252
|
+
--secondary: 240 4.8% 95.9%;
|
|
253
|
+
--secondary-foreground: 240 5.9% 10%;
|
|
254
|
+
--muted: 240 4.8% 95.9%;
|
|
255
|
+
--muted-foreground: 240 3.8% 46.1%;
|
|
256
|
+
--accent: 240 4.8% 95.9%;
|
|
257
|
+
--accent-foreground: 240 5.9% 10%;
|
|
258
|
+
--destructive: 0 84.2% 60.2%;
|
|
259
|
+
--destructive-foreground: 0 0% 98%;
|
|
260
|
+
--border: 240 5.9% 95%;
|
|
261
|
+
--input: 240 5.9% 90%;
|
|
262
|
+
--ring: 240 5.9% 10%;
|
|
263
|
+
--radius: 0.75rem;
|
|
264
|
+
--chart-1: 12 76% 61%;
|
|
265
|
+
--chart-2: 173 58% 39%;
|
|
266
|
+
--chart-3: 197 37% 24%;
|
|
267
|
+
--chart-4: 43 74% 66%;
|
|
268
|
+
--chart-5: 27 87% 67%;
|
|
269
|
+
}
|
|
270
|
+
|
|
271
|
+
.dark {
|
|
272
|
+
--background: 240 10% 3.9%;
|
|
273
|
+
--foreground: 0 0% 98%;
|
|
274
|
+
--card: 240 10% 3.9%;
|
|
275
|
+
--card-foreground: 0 0% 98%;
|
|
276
|
+
--popover: 240 10% 3.9%;
|
|
277
|
+
--popover-foreground: 0 0% 98%;
|
|
278
|
+
--primary: 0 0% 98%;
|
|
279
|
+
--primary-foreground: 240 5.9% 10%;
|
|
280
|
+
--secondary: 240 3.7% 15.9%;
|
|
281
|
+
--secondary-foreground: 0 0% 98%;
|
|
282
|
+
--muted: 240 3.7% 15.9%;
|
|
283
|
+
--muted-foreground: 240 5% 64.9%;
|
|
284
|
+
--accent: 240 3.7% 15.9%;
|
|
285
|
+
--accent-foreground: 0 0% 98%;
|
|
286
|
+
--destructive: 0 62.8% 30.6%;
|
|
287
|
+
--destructive-foreground: 0 0% 98%;
|
|
288
|
+
--border: 240 3.7% 15.9%;
|
|
289
|
+
--input: 240 3.7% 15.9%;
|
|
290
|
+
--ring: 240 4.9% 83.9%;
|
|
291
|
+
--chart-1: 220 70% 50%;
|
|
292
292
|
--chart-2: 160 60% 45%;
|
|
293
293
|
--chart-3: 30 80% 55%;
|
|
294
294
|
--chart-4: 280 65% 60%;
|
|
@@ -35,10 +35,7 @@ class Auth0AuthenticationProvider extends OpenIDAuthenticationProvider {
|
|
|
35
35
|
providerData: null,
|
|
36
36
|
});
|
|
37
37
|
|
|
38
|
-
const redirectUrl = new URL(
|
|
39
|
-
window.location.origin + this.logoutRedirectUrlPath,
|
|
40
|
-
);
|
|
41
|
-
|
|
38
|
+
const redirectUrl = new URL(window.location.origin);
|
|
42
39
|
redirectUrl.pathname = this.logoutRedirectUrlPath;
|
|
43
40
|
|
|
44
41
|
// SEE: https://auth0.com/docs/authenticate/login/logout/log-users-out-of-auth0
|
|
@@ -2,6 +2,7 @@ import logger from "loglevel";
|
|
|
2
2
|
import * as oauth from "oauth4webapi";
|
|
3
3
|
import { OpenIDAuthenticationConfig } from "../../../config/config.js";
|
|
4
4
|
import { ClientOnly } from "../../components/ClientOnly.js";
|
|
5
|
+
import { joinUrl } from "../../util/joinUrl.js";
|
|
5
6
|
import {
|
|
6
7
|
AuthenticationProvider,
|
|
7
8
|
AuthenticationProviderInitializer,
|
|
@@ -49,8 +50,8 @@ export class OpenIDAuthenticationProvider implements AuthenticationProvider {
|
|
|
49
50
|
|
|
50
51
|
protected authorizationServer: oauth.AuthorizationServer | undefined;
|
|
51
52
|
|
|
52
|
-
protected callbackUrlPath
|
|
53
|
-
protected logoutRedirectUrlPath
|
|
53
|
+
protected callbackUrlPath: string;
|
|
54
|
+
protected logoutRedirectUrlPath: string;
|
|
54
55
|
protected onAuthorizationUrl?: (
|
|
55
56
|
authorizationUrl: URL,
|
|
56
57
|
options: { isSignIn: boolean; isSignUp: boolean },
|
|
@@ -67,6 +68,7 @@ export class OpenIDAuthenticationProvider implements AuthenticationProvider {
|
|
|
67
68
|
redirectToAfterSignUp,
|
|
68
69
|
redirectToAfterSignIn,
|
|
69
70
|
redirectToAfterSignOut,
|
|
71
|
+
basePath,
|
|
70
72
|
}: OpenIDAuthenticationConfig) {
|
|
71
73
|
this.client = {
|
|
72
74
|
client_id: clientId,
|
|
@@ -74,9 +76,14 @@ export class OpenIDAuthenticationProvider implements AuthenticationProvider {
|
|
|
74
76
|
};
|
|
75
77
|
this.audience = audience;
|
|
76
78
|
this.issuer = issuer;
|
|
77
|
-
this.
|
|
78
|
-
|
|
79
|
-
|
|
79
|
+
this.callbackUrlPath = joinUrl(basePath, "/oauth/callback");
|
|
80
|
+
|
|
81
|
+
const root = joinUrl(basePath, "/");
|
|
82
|
+
|
|
83
|
+
this.logoutRedirectUrlPath = root;
|
|
84
|
+
this.redirectToAfterSignUp = redirectToAfterSignUp ?? root;
|
|
85
|
+
this.redirectToAfterSignIn = redirectToAfterSignIn ?? root;
|
|
86
|
+
this.redirectToAfterSignOut = redirectToAfterSignOut ?? root;
|
|
80
87
|
}
|
|
81
88
|
|
|
82
89
|
protected async getAuthServer() {
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
import { PopoverAnchor } from "@radix-ui/react-popover";
|
|
2
|
+
import { useCommandState } from "cmdk";
|
|
3
|
+
import { useRef, useState, type Ref } from "react";
|
|
4
|
+
import {
|
|
5
|
+
Command,
|
|
6
|
+
CommandInlineInput,
|
|
7
|
+
CommandItem,
|
|
8
|
+
CommandList,
|
|
9
|
+
} from "zudoku/ui/Command.js";
|
|
10
|
+
import { Popover, PopoverContent } from "zudoku/ui/Popover.js";
|
|
11
|
+
import { cn } from "../util/cn.js";
|
|
12
|
+
|
|
13
|
+
type AutocompleteProps = {
|
|
14
|
+
value: string;
|
|
15
|
+
options: readonly string[];
|
|
16
|
+
onChange: (e: string) => void;
|
|
17
|
+
className?: string;
|
|
18
|
+
placeholder?: string;
|
|
19
|
+
onEnterPress?: (e: React.KeyboardEvent<HTMLInputElement>) => void;
|
|
20
|
+
ref?: Ref<HTMLInputElement>;
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
const AutocompletePopover = ({
|
|
24
|
+
value,
|
|
25
|
+
options,
|
|
26
|
+
onChange,
|
|
27
|
+
className,
|
|
28
|
+
placeholder = "Enter value",
|
|
29
|
+
onEnterPress,
|
|
30
|
+
ref,
|
|
31
|
+
}: AutocompleteProps) => {
|
|
32
|
+
const [open, setOpen] = useState(false);
|
|
33
|
+
const [dontClose, setDontClose] = useState(false);
|
|
34
|
+
const count = useCommandState((state) => state.filtered.count);
|
|
35
|
+
const inputRef = useRef<HTMLInputElement>(null);
|
|
36
|
+
return (
|
|
37
|
+
<Popover open={open}>
|
|
38
|
+
<PopoverAnchor>
|
|
39
|
+
<CommandInlineInput
|
|
40
|
+
ref={(el) => {
|
|
41
|
+
inputRef.current = el;
|
|
42
|
+
if (typeof ref === "function") {
|
|
43
|
+
ref(el);
|
|
44
|
+
} else if (ref) {
|
|
45
|
+
ref.current = el;
|
|
46
|
+
}
|
|
47
|
+
}}
|
|
48
|
+
value={value}
|
|
49
|
+
placeholder={placeholder}
|
|
50
|
+
className={cn("h-9 bg-transparent", className)}
|
|
51
|
+
onFocus={() => setOpen(true)}
|
|
52
|
+
onBlur={() => {
|
|
53
|
+
if (dontClose) {
|
|
54
|
+
return;
|
|
55
|
+
}
|
|
56
|
+
setOpen(false);
|
|
57
|
+
}}
|
|
58
|
+
onKeyDown={(e) => {
|
|
59
|
+
if (e.key === "Enter") {
|
|
60
|
+
setOpen(false);
|
|
61
|
+
inputRef.current?.blur();
|
|
62
|
+
onEnterPress?.(e);
|
|
63
|
+
}
|
|
64
|
+
}}
|
|
65
|
+
onValueChange={(e) => onChange(e)}
|
|
66
|
+
/>
|
|
67
|
+
</PopoverAnchor>
|
|
68
|
+
<PopoverContent
|
|
69
|
+
onMouseEnter={() => setDontClose(true)}
|
|
70
|
+
onMouseLeave={() => setDontClose(false)}
|
|
71
|
+
onOpenAutoFocus={(e) => e.preventDefault()}
|
|
72
|
+
className={cn("p-0 w-[--radix-popover-trigger-width]", {
|
|
73
|
+
"border-0": count === 0,
|
|
74
|
+
})}
|
|
75
|
+
align="start"
|
|
76
|
+
side="bottom"
|
|
77
|
+
onWheel={(e) => {
|
|
78
|
+
// See: https://github.com/radix-ui/primitives/issues/1159
|
|
79
|
+
e.stopPropagation();
|
|
80
|
+
}}
|
|
81
|
+
onTouchMove={(e) => {
|
|
82
|
+
e.stopPropagation();
|
|
83
|
+
}}
|
|
84
|
+
>
|
|
85
|
+
<CommandList className="max-h-[140px]">
|
|
86
|
+
{options.map((enumValue) => (
|
|
87
|
+
<CommandItem
|
|
88
|
+
key={enumValue}
|
|
89
|
+
value={enumValue}
|
|
90
|
+
onSelect={(selected) => {
|
|
91
|
+
onChange(selected);
|
|
92
|
+
setOpen(false);
|
|
93
|
+
}}
|
|
94
|
+
className="cursor-pointer"
|
|
95
|
+
>
|
|
96
|
+
{enumValue}
|
|
97
|
+
</CommandItem>
|
|
98
|
+
))}
|
|
99
|
+
</CommandList>
|
|
100
|
+
</PopoverContent>
|
|
101
|
+
</Popover>
|
|
102
|
+
);
|
|
103
|
+
};
|
|
104
|
+
|
|
105
|
+
export const Autocomplete = (props: AutocompleteProps) => {
|
|
106
|
+
return (
|
|
107
|
+
<Command className="bg-transparent">
|
|
108
|
+
<AutocompletePopover {...props} />
|
|
109
|
+
</Command>
|
|
110
|
+
);
|
|
111
|
+
};
|
|
@@ -16,7 +16,7 @@ import {
|
|
|
16
16
|
DropdownMenuSubTrigger,
|
|
17
17
|
DropdownMenuTrigger,
|
|
18
18
|
} from "../ui/DropdownMenu.js";
|
|
19
|
-
import {
|
|
19
|
+
import { joinUrl } from "../util/joinUrl.js";
|
|
20
20
|
import { Banner } from "./Banner.js";
|
|
21
21
|
import { ClientOnly } from "./ClientOnly.js";
|
|
22
22
|
import { useZudoku } from "./context/ZudokuContext.js";
|
|
@@ -76,7 +76,7 @@ export const Header = memo(function HeaderInner() {
|
|
|
76
76
|
src={
|
|
77
77
|
/https?:\/\//.test(page.logo.src.light)
|
|
78
78
|
? page.logo.src.light
|
|
79
|
-
:
|
|
79
|
+
: joinUrl(
|
|
80
80
|
import.meta.env.BASE_URL,
|
|
81
81
|
page.logo.src.light,
|
|
82
82
|
)
|
|
@@ -90,7 +90,7 @@ export const Header = memo(function HeaderInner() {
|
|
|
90
90
|
src={
|
|
91
91
|
/https?:\/\//.test(page.logo.src.dark)
|
|
92
92
|
? page.logo.src.dark
|
|
93
|
-
:
|
|
93
|
+
: joinUrl(
|
|
94
94
|
import.meta.env.BASE_URL,
|
|
95
95
|
page.logo.src.dark,
|
|
96
96
|
)
|
|
@@ -6,14 +6,14 @@ import { RouterError as RouterErrorImport } from "../errors/RouterError.js";
|
|
|
6
6
|
import { ServerError as ServerErrorImport } from "../errors/ServerError.js";
|
|
7
7
|
import { Button as ButtonImport } from "../ui/Button.js";
|
|
8
8
|
import { Callout as CalloutImport } from "../ui/Callout.js";
|
|
9
|
-
import { Spinner as SpinnerImport } from "./Spinner.js";
|
|
10
|
-
import { Markdown as MarkdownImport } from "./Markdown.js";
|
|
11
9
|
import {
|
|
12
10
|
Bootstrap as BootstrapImport,
|
|
13
11
|
BootstrapStatic as BootstrapStaticImport,
|
|
14
12
|
} from "./Bootstrap.js";
|
|
15
13
|
import { ClientOnly as ClientOnlyImport } from "./ClientOnly.js";
|
|
16
14
|
import { Layout as LayoutImport } from "./Layout.js";
|
|
15
|
+
import { Markdown as MarkdownImport } from "./Markdown.js";
|
|
16
|
+
import { Spinner as SpinnerImport } from "./Spinner.js";
|
|
17
17
|
import { Zudoku as ZudokuImport } from "./Zudoku.js";
|
|
18
18
|
import { useZudoku as useZudokuImport } from "./context/ZudokuContext.js";
|
|
19
19
|
export const useMDXComponents = /*@__PURE__*/ useMDXComponentsImport;
|
|
@@ -2,7 +2,7 @@ import { useMDXComponents } from "@mdx-js/react";
|
|
|
2
2
|
import slugify from "@sindresorhus/slugify";
|
|
3
3
|
import { Helmet } from "@zudoku/react-helmet-async";
|
|
4
4
|
import { type PropsWithChildren, useEffect } from "react";
|
|
5
|
-
import { Link } from "react-router";
|
|
5
|
+
import { Link, useHref } from "react-router";
|
|
6
6
|
import { CategoryHeading } from "../../components/CategoryHeading.js";
|
|
7
7
|
import { Heading } from "../../components/Heading.js";
|
|
8
8
|
import { ProseClasses } from "../../components/Markdown.js";
|
|
@@ -51,6 +51,13 @@ export const MdxPage = ({
|
|
|
51
51
|
}
|
|
52
52
|
>) => {
|
|
53
53
|
const categoryTitle = useCurrentItem()?.categoryLabel;
|
|
54
|
+
let canonicalUrl = null;
|
|
55
|
+
const path = useHref("");
|
|
56
|
+
if (typeof window !== "undefined") {
|
|
57
|
+
const domain = window.location.origin;
|
|
58
|
+
canonicalUrl = `${domain}${path}`;
|
|
59
|
+
}
|
|
60
|
+
|
|
54
61
|
const title = frontmatter.title;
|
|
55
62
|
const category = frontmatter.category ?? categoryTitle;
|
|
56
63
|
const hideToc = frontmatter.toc === false || defaultOptions?.toc === false;
|
|
@@ -87,6 +94,7 @@ export const MdxPage = ({
|
|
|
87
94
|
<Helmet>
|
|
88
95
|
<title>{pageTitle}</title>
|
|
89
96
|
{excerpt && <meta name="description" content={excerpt} />}
|
|
97
|
+
{canonicalUrl && <link rel="canonical" href={canonicalUrl} />}
|
|
90
98
|
</Helmet>
|
|
91
99
|
<div
|
|
92
100
|
className={cn(
|
|
@@ -1,20 +1,24 @@
|
|
|
1
1
|
import type { OperationListItemResult } from "./OperationList.js";
|
|
2
2
|
import { PlaygroundDialog } from "./playground/PlaygroundDialog.js";
|
|
3
|
+
import { Content } from "./SidecarExamples.js";
|
|
3
4
|
|
|
4
5
|
export const PlaygroundDialogWrapper = ({
|
|
5
6
|
server,
|
|
6
7
|
servers,
|
|
7
8
|
operation,
|
|
9
|
+
examples,
|
|
8
10
|
}: {
|
|
9
11
|
server: string;
|
|
10
12
|
servers?: string[];
|
|
11
13
|
operation: OperationListItemResult;
|
|
14
|
+
examples?: Content;
|
|
12
15
|
}) => {
|
|
13
16
|
const headers = operation.parameters
|
|
14
17
|
?.filter((p) => p.in === "header")
|
|
15
18
|
.map((p) => ({
|
|
16
19
|
name: p.name,
|
|
17
20
|
defaultValue: p.examples?.find((x) => x.value)?.value ?? "",
|
|
21
|
+
defaultActive: false,
|
|
18
22
|
}));
|
|
19
23
|
const queryParams = operation.parameters
|
|
20
24
|
?.filter((p) => p.in === "query")
|
|
@@ -39,6 +43,7 @@ export const PlaygroundDialogWrapper = ({
|
|
|
39
43
|
headers={headers}
|
|
40
44
|
queryParams={queryParams}
|
|
41
45
|
pathParams={pathParams}
|
|
46
|
+
examples={examples}
|
|
42
47
|
/>
|
|
43
48
|
);
|
|
44
49
|
};
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { Button } from "zudoku/ui/Button.js";
|
|
2
|
+
import {
|
|
3
|
+
DropdownMenu,
|
|
4
|
+
DropdownMenuContent,
|
|
5
|
+
DropdownMenuGroup,
|
|
6
|
+
DropdownMenuItem,
|
|
7
|
+
DropdownMenuLabel,
|
|
8
|
+
DropdownMenuSeparator,
|
|
9
|
+
DropdownMenuTrigger,
|
|
10
|
+
} from "zudoku/ui/DropdownMenu.js";
|
|
11
|
+
import { Content, Example } from "../SidecarExamples.js";
|
|
12
|
+
|
|
13
|
+
const ExamplesDropdown = ({
|
|
14
|
+
examples,
|
|
15
|
+
onSelect,
|
|
16
|
+
}: {
|
|
17
|
+
examples: Content;
|
|
18
|
+
onSelect: (example: Example) => void;
|
|
19
|
+
}) => {
|
|
20
|
+
return (
|
|
21
|
+
<DropdownMenu>
|
|
22
|
+
<DropdownMenuTrigger asChild>
|
|
23
|
+
<Button variant="outline">Use Example</Button>
|
|
24
|
+
</DropdownMenuTrigger>
|
|
25
|
+
<DropdownMenuContent className="w-56">
|
|
26
|
+
{examples.map((example) => {
|
|
27
|
+
return (
|
|
28
|
+
<div key={example.mediaType}>
|
|
29
|
+
<DropdownMenuLabel>{example.mediaType}</DropdownMenuLabel>
|
|
30
|
+
<DropdownMenuSeparator />
|
|
31
|
+
<DropdownMenuGroup>
|
|
32
|
+
{example.examples?.map((example) => {
|
|
33
|
+
return (
|
|
34
|
+
<DropdownMenuItem
|
|
35
|
+
key={example.name}
|
|
36
|
+
onSelect={() => onSelect(example)}
|
|
37
|
+
>
|
|
38
|
+
{example.name}
|
|
39
|
+
</DropdownMenuItem>
|
|
40
|
+
);
|
|
41
|
+
})}
|
|
42
|
+
</DropdownMenuGroup>
|
|
43
|
+
</div>
|
|
44
|
+
);
|
|
45
|
+
})}
|
|
46
|
+
</DropdownMenuContent>
|
|
47
|
+
</DropdownMenu>
|
|
48
|
+
);
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
export default ExamplesDropdown;
|