zudoku 0.23.9 → 0.24.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.
Files changed (62) hide show
  1. package/dist/cli/cmds/dev.js +5 -0
  2. package/dist/cli/cmds/dev.js.map +1 -1
  3. package/dist/cli/dev/handler.d.ts +1 -0
  4. package/dist/cli/dev/handler.js +1 -1
  5. package/dist/cli/dev/handler.js.map +1 -1
  6. package/dist/lib/authentication/providers/openid.js +2 -1
  7. package/dist/lib/authentication/providers/openid.js.map +1 -1
  8. package/dist/lib/components/index.d.ts +17 -13
  9. package/dist/lib/components/index.js +6 -2
  10. package/dist/lib/components/index.js.map +1 -1
  11. package/dist/lib/components/navigation/SidebarItem.js +1 -1
  12. package/dist/lib/components/navigation/SidebarItem.js.map +1 -1
  13. package/dist/lib/oas/parser/dereference/index.d.ts +1 -0
  14. package/dist/lib/oas/parser/dereference/index.js +6 -3
  15. package/dist/lib/oas/parser/dereference/index.js.map +1 -1
  16. package/dist/lib/plugins/openapi/schema/SchemaComponents.js +7 -1
  17. package/dist/lib/plugins/openapi/schema/SchemaComponents.js.map +1 -1
  18. package/dist/vite/dev-server.d.ts +1 -0
  19. package/dist/vite/dev-server.js +4 -0
  20. package/dist/vite/dev-server.js.map +1 -1
  21. package/lib/{AuthenticationPlugin-fB7viE7A.js → AuthenticationPlugin-DVLEc6cm.js} +2 -2
  22. package/lib/{AuthenticationPlugin-fB7viE7A.js.map → AuthenticationPlugin-DVLEc6cm.js.map} +1 -1
  23. package/lib/{MdxPage-CPBw4_lf.js → MdxPage-DKMbBROv.js} +2 -2
  24. package/lib/{MdxPage-CPBw4_lf.js.map → MdxPage-DKMbBROv.js.map} +1 -1
  25. package/lib/{OperationList-ChQR0IcQ.js → OperationList-CqLL5P5l.js} +574 -568
  26. package/lib/{OperationList-ChQR0IcQ.js.map → OperationList-CqLL5P5l.js.map} +1 -1
  27. package/lib/{Route-Ag5MH86N.js → Route-DYwKZ_c_.js} +2 -2
  28. package/lib/{Route-Ag5MH86N.js.map → Route-DYwKZ_c_.js.map} +1 -1
  29. package/lib/{Select-D3XuKKuH.js → Select-B_IxRUUC.js} +3 -3
  30. package/lib/{Select-D3XuKKuH.js.map → Select-B_IxRUUC.js.map} +1 -1
  31. package/lib/{utils-B4O1uet5.js → ZudokuContext-hmLMUdf2.js} +37 -37
  32. package/lib/ZudokuContext-hmLMUdf2.js.map +1 -0
  33. package/lib/assets/{worker-D2kRl-cG.js → worker-DV9Ecqy9.js} +348 -346
  34. package/lib/assets/{worker-D2kRl-cG.js.map → worker-DV9Ecqy9.js.map} +1 -1
  35. package/lib/{createServer-69sLlmQA.js → createServer-C4C0OO0m.js} +1250 -1285
  36. package/lib/createServer-C4C0OO0m.js.map +1 -0
  37. package/lib/{hook-DgGeo5iL.js → hook-CHq7pFyz.js} +2 -2
  38. package/lib/{hook-DgGeo5iL.js.map → hook-CHq7pFyz.js.map} +1 -1
  39. package/lib/index-DyBL--Kz.js +826 -0
  40. package/lib/index-DyBL--Kz.js.map +1 -0
  41. package/lib/{index-DtJxZrbj.js → index-DzRORsY1.js} +7 -7
  42. package/lib/{index-DtJxZrbj.js.map → index-DzRORsY1.js.map} +1 -1
  43. package/lib/zudoku.auth-clerk.js +1 -1
  44. package/lib/zudoku.auth-openid.js +176 -175
  45. package/lib/zudoku.auth-openid.js.map +1 -1
  46. package/lib/zudoku.components.js +173 -172
  47. package/lib/zudoku.components.js.map +1 -1
  48. package/lib/zudoku.openapi-worker.js +1 -1
  49. package/lib/zudoku.plugin-api-catalog.js +1 -1
  50. package/lib/zudoku.plugin-api-keys.js +3 -3
  51. package/lib/zudoku.plugin-markdown.js +1 -1
  52. package/lib/zudoku.plugin-openapi.js +3 -3
  53. package/package.json +3 -3
  54. package/src/lib/authentication/providers/openid.tsx +6 -1
  55. package/src/lib/components/index.ts +7 -3
  56. package/src/lib/components/navigation/SidebarItem.tsx +1 -1
  57. package/src/lib/oas/parser/dereference/index.ts +9 -4
  58. package/src/lib/plugins/openapi/schema/SchemaComponents.tsx +25 -1
  59. package/lib/createServer-69sLlmQA.js.map +0 -1
  60. package/lib/object_hash-BNWPnMN9.js +0 -787
  61. package/lib/object_hash-BNWPnMN9.js.map +0 -1
  62. package/lib/utils-B4O1uet5.js.map +0 -1
@@ -2,7 +2,7 @@ const o = () => {
2
2
  const r = new SharedWorker(
3
3
  new URL(
4
4
  /* @vite-ignore */
5
- "./assets/worker-D2kRl-cG.js",
5
+ "./assets/worker-DV9Ecqy9.js",
6
6
  import.meta.url
7
7
  ),
8
8
  { type: "module" }
@@ -1,6 +1,6 @@
1
1
  import { j as e } from "./jsx-runtime-Dx-03ztt.js";
2
2
  import { s as j } from "./index-LNp6rxyU.js";
3
- import { u as b } from "./utils-B4O1uet5.js";
3
+ import { u as b } from "./ZudokuContext-hmLMUdf2.js";
4
4
  import { b as y } from "./chunk-D52XG6IA-Dl7HLe6j.js";
5
5
  import { Head as v, Link as N } from "./zudoku.components.js";
6
6
  import { u as w } from "./state-CFQsUZUP.js";
@@ -2,13 +2,13 @@ import { j as e } from "./jsx-runtime-Dx-03ztt.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
3
  import { D as k, S as m, R as N } from "./SlotletProvider-pfc9oejW.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-D3XuKKuH.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-B_IxRUUC.js";
6
6
  import { a as P } from "./index.esm-BnnBRKJX.js";
7
7
  import { a as D, L as u, O as R } from "./chunk-D52XG6IA-Dl7HLe6j.js";
8
- import { a as y, e as q, u as O } from "./utils-B4O1uet5.js";
8
+ import { a as y, e as q, u as O } from "./ZudokuContext-hmLMUdf2.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-DgGeo5iL.js";
11
+ import { u as F } from "./hook-CHq7pFyz.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 }) => {
@@ -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-CPBw4_lf.js"), { default: p, ...g } = await a();
77
+ const { MdxPage: l } = await import("./MdxPage-DKMbBROv.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-Dx-03ztt.js";
2
2
  import "./chunk-D52XG6IA-Dl7HLe6j.js";
3
- import { o as a } from "./index-DtJxZrbj.js";
4
- import "./utils-B4O1uet5.js";
3
+ import { o as a } from "./index-DzRORsY1.js";
4
+ import "./ZudokuContext-hmLMUdf2.js";
5
5
  import "lucide-react";
6
- import "./hook-DgGeo5iL.js";
6
+ import "./hook-CHq7pFyz.js";
7
7
  import "./ui/Button.js";
8
8
  export {
9
9
  a as openApiPlugin
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "zudoku",
3
- "version": "0.23.9",
3
+ "version": "0.24.1",
4
4
  "type": "module",
5
5
  "homepage": "https://zudoku.dev",
6
6
  "repository": {
@@ -122,7 +122,7 @@
122
122
  "@mdx-js/react": "3.1.0",
123
123
  "@mdx-js/rollup": "3.1.0",
124
124
  "@pothos/core": "3.41.0",
125
- "@radix-ui/react-accordion": "1.2.1",
125
+ "@radix-ui/react-accordion": "1.2.2",
126
126
  "@radix-ui/react-alert-dialog": "1.1.4",
127
127
  "@radix-ui/react-aspect-ratio": "1.1.1",
128
128
  "@radix-ui/react-checkbox": "1.1.2",
@@ -250,7 +250,7 @@
250
250
  },
251
251
  "optionalDependencies": {
252
252
  "@clerk/clerk-js": "^5.43.4",
253
- "@sentry/react": "^8.45.1"
253
+ "@sentry/react": "^8.48.0"
254
254
  },
255
255
  "scripts": {
256
256
  "build": "tsc --project tsconfig.json",
@@ -1,6 +1,7 @@
1
1
  import logger from "loglevel";
2
2
  import * as oauth from "oauth4webapi";
3
3
  import { OpenIDAuthenticationConfig } from "../../../config/config.js";
4
+ import { ClientOnly } from "../../components/ClientOnly.js";
4
5
  import {
5
6
  AuthenticationProvider,
6
7
  AuthenticationProviderInitializer,
@@ -32,7 +33,11 @@ class OpenIdAuthPlugin extends AuthenticationPlugin {
32
33
  ...super.getRoutes(),
33
34
  {
34
35
  path: this.callbackUrlPath,
35
- element: <CallbackHandler handleCallback={this.handleCallback} />,
36
+ element: (
37
+ <ClientOnly>
38
+ <CallbackHandler handleCallback={this.handleCallback} />
39
+ </ClientOnly>
40
+ ),
36
41
  },
37
42
  ];
38
43
  }
@@ -1,11 +1,13 @@
1
1
  import { useMDXComponents as useMDXComponentsImport } from "@mdx-js/react";
2
2
  import { Helmet } from "@zudoku/react-helmet-async";
3
3
  import { Link as LinkImport } from "react-router";
4
- import { useAuthState } from "../authentication/state.js";
4
+ import { useAuth as useAuthImport } from "../authentication/hook.js";
5
5
  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";
9
11
  import {
10
12
  Bootstrap as BootstrapImport,
11
13
  BootstrapStatic as BootstrapStaticImport,
@@ -24,10 +26,12 @@ export const BootstrapStatic = /*@__PURE__*/ BootstrapStaticImport;
24
26
  export const Head = /*@__PURE__*/ Helmet;
25
27
 
26
28
  export const useZudoku = /*@__PURE__*/ useZudokuImport;
27
- export const useAuth = /*@__PURE__*/ useAuthState;
29
+ export const useAuth = /*@__PURE__*/ useAuthImport;
28
30
  export const Zudoku = /*@__PURE__*/ ZudokuImport;
29
31
 
30
32
  export const Callout = /*@__PURE__*/ CalloutImport;
33
+ export const Markdown = /*@__PURE__*/ MarkdownImport;
34
+ export const Spinner = /*@__PURE__*/ SpinnerImport;
31
35
  export const ClientOnly = /*@__PURE__*/ ClientOnlyImport;
32
36
  export const Button = /*@__PURE__*/ ButtonImport;
33
- export const Link: typeof LinkImport = /*@__PURE__*/ LinkImport;
37
+ export const Link = /*@__PURE__*/ LinkImport;
@@ -10,7 +10,7 @@ import { SidebarBadge } from "./SidebarBadge.js";
10
10
  import { SidebarCategory } from "./SidebarCategory.js";
11
11
 
12
12
  export const navigationListItem = cva(
13
- "flex items-center gap-2 px-[--padding-nav-item] py-1.5 rounded-lg hover:bg-accent transition-colors duration-300",
13
+ "flex items-center gap-2 px-[--padding-nav-item] py-1.5 rounded-lg hover:bg-accent",
14
14
  {
15
15
  variants: {
16
16
  isActive: {
@@ -3,6 +3,8 @@ import { resolveLocalRef } from "./resolveRef.js";
3
3
 
4
4
  export type JSONSchema = JSONSchema4 | JSONSchema6;
5
5
 
6
+ export const CIRCULAR_REF = "$[Circular Reference]";
7
+
6
8
  type CustomResolver = (ref: string) => Promise<JSONSchema | undefined>;
7
9
 
8
10
  const cache = new Map<JSONSchema, JSONSchema>();
@@ -21,12 +23,12 @@ export const dereference = async (
21
23
  }
22
24
 
23
25
  const cloned = structuredClone(schema);
24
- const visited = new Set();
26
+ const visited = new Set<unknown>();
25
27
 
26
28
  const resolve = async (current: unknown, path: string) => {
27
29
  if (isIndexableObject(current)) {
28
30
  if (visited.has(current)) {
29
- return current;
31
+ return CIRCULAR_REF;
30
32
  }
31
33
 
32
34
  visited.add(current);
@@ -39,15 +41,18 @@ export const dereference = async (
39
41
  if ("$ref" in current && typeof current.$ref === "string") {
40
42
  for (const resolver of resolvers) {
41
43
  const resolved = await resolver(current.$ref);
42
- if (resolved) return resolved;
44
+ if (resolved) return await resolve(resolved, path);
43
45
  }
44
- return await resolveLocalRef(cloned, current.$ref);
46
+ const resolved = await resolveLocalRef(cloned, current.$ref);
47
+ return await resolve(resolved, path);
45
48
  }
46
49
 
47
50
  for (const key in current) {
48
51
  current[key] = await resolve(current[key], `${path}/${key}`);
49
52
  }
50
53
  }
54
+
55
+ visited.delete(current);
51
56
  }
52
57
 
53
58
  return current;
@@ -1,7 +1,8 @@
1
1
  import * as Collapsible from "@radix-ui/react-collapsible";
2
- import { ListPlusIcon } from "lucide-react";
2
+ import { ListPlusIcon, RefreshCcwDotIcon } from "lucide-react";
3
3
  import { useCallback, useState } from "react";
4
4
  import { Markdown, ProseClasses } from "../../../components/Markdown.js";
5
+ import { CIRCULAR_REF } from "../../../oas/parser/dereference/index.js";
5
6
  import type { SchemaObject } from "../../../oas/parser/index.js";
6
7
  import { Button } from "../../../ui/Button.js";
7
8
  import { cn } from "../../../util/cn.js";
@@ -39,6 +40,16 @@ export const SchemaLogicalGroup = ({
39
40
  }
40
41
  };
41
42
 
43
+ const isCircularRef = (schema: unknown): schema is string =>
44
+ schema === CIRCULAR_REF;
45
+
46
+ const RecursiveIndicator = () => (
47
+ <div className="flex items-center gap-2 italic text-sm text-muted-foreground font-mono bg-muted px-2 py-0.5 rounded-md">
48
+ <RefreshCcwDotIcon size={16} />
49
+ <span>recursive</span>
50
+ </div>
51
+ );
52
+
42
53
  export const SchemaPropertyItem = ({
43
54
  name,
44
55
  schema,
@@ -56,6 +67,19 @@ export const SchemaPropertyItem = ({
56
67
  }) => {
57
68
  const [isOpen, setIsOpen] = useState(defaultOpen);
58
69
 
70
+ if (isCircularRef(schema)) {
71
+ return (
72
+ <li className="p-4 bg-border/20 hover:bg-border/30">
73
+ <div className="flex flex-col gap-1 justify-between text-sm">
74
+ <div className="flex gap-2 items-center">
75
+ <code>{name}</code>
76
+ <RecursiveIndicator />
77
+ </div>
78
+ </div>
79
+ </li>
80
+ );
81
+ }
82
+
59
83
  return (
60
84
  <li className="p-4 bg-border/20 hover:bg-border/30">
61
85
  <div className="flex flex-col gap-1 justify-between text-sm">