zudoku 0.35.0 → 0.35.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.
Files changed (27) hide show
  1. package/dist/config/validators/common.d.ts +179 -3
  2. package/dist/config/validators/common.js +2 -1
  3. package/dist/config/validators/common.js.map +1 -1
  4. package/dist/config/validators/validate.d.ts +64 -1
  5. package/dist/lib/authentication/providers/openid.js +4 -1
  6. package/dist/lib/authentication/providers/openid.js.map +1 -1
  7. package/dist/lib/plugins/openapi/OperationList.js +5 -3
  8. package/dist/lib/plugins/openapi/OperationList.js.map +1 -1
  9. package/dist/lib/plugins/openapi/interfaces.d.ts +1 -0
  10. package/dist/vite/plugin-api.js +1 -1
  11. package/dist/vite/plugin-api.js.map +1 -1
  12. package/lib/{OasProvider-DEL8ulKm.js → OasProvider-_ye9MUAd.js} +2 -2
  13. package/lib/{OasProvider-DEL8ulKm.js.map → OasProvider-_ye9MUAd.js.map} +1 -1
  14. package/lib/{OperationList-D6goKbzX.js → OperationList-Br5x22KD.js} +1135 -1134
  15. package/lib/{OperationList-D6goKbzX.js.map → OperationList-Br5x22KD.js.map} +1 -1
  16. package/lib/{createServer-BNBGpbLa.js → createServer-BEFAOb-x.js} +227 -221
  17. package/lib/createServer-BEFAOb-x.js.map +1 -0
  18. package/lib/{index-PKytqmuw.js → index-C7TIhpXK.js} +4 -4
  19. package/lib/{index-PKytqmuw.js.map → index-C7TIhpXK.js.map} +1 -1
  20. package/lib/zudoku.auth-openid.js +94 -94
  21. package/lib/zudoku.auth-openid.js.map +1 -1
  22. package/lib/zudoku.plugin-openapi.js +1 -1
  23. package/package.json +2 -2
  24. package/src/lib/authentication/providers/openid.tsx +5 -1
  25. package/src/lib/plugins/openapi/OperationList.tsx +7 -2
  26. package/src/lib/plugins/openapi/interfaces.ts +1 -0
  27. package/lib/createServer-BNBGpbLa.js.map +0 -1
@@ -5,7 +5,7 @@ import "./chunk-HA7DTUK3-ZGg2W6yV.js";
5
5
  import "./hook-CfCFKZ-2.js";
6
6
  import "./ui/Button.js";
7
7
  import "./joinUrl-10po2Jdj.js";
8
- import { U as n, o as s } from "./index-PKytqmuw.js";
8
+ import { U as n, o as s } from "./index-C7TIhpXK.js";
9
9
  export {
10
10
  n as UNTAGGED_PATH,
11
11
  s as openApiPlugin
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "zudoku",
3
- "version": "0.35.0",
3
+ "version": "0.35.2",
4
4
  "type": "module",
5
5
  "homepage": "https://zudoku.dev",
6
6
  "repository": {
@@ -134,7 +134,7 @@
134
134
  "@lekoarts/rehype-meta-as-attributes": "3.0.2",
135
135
  "@mdx-js/react": "3.1.0",
136
136
  "@mdx-js/rollup": "3.1.0",
137
- "@pothos/core": "4.3.0",
137
+ "@pothos/core": "4.5.0",
138
138
  "@radix-ui/react-accordion": "1.2.3",
139
139
  "@radix-ui/react-alert-dialog": "1.1.6",
140
140
  "@radix-ui/react-aspect-ratio": "1.1.2",
@@ -172,7 +172,11 @@ export class OpenIDAuthenticationProvider implements AuthenticationProvider {
172
172
  authorizationServer.authorization_endpoint,
173
173
  );
174
174
 
175
- sessionStorage.setItem("redirect-to", redirectTo);
175
+ const finalRedirect = redirectTo.startsWith(window.location.origin)
176
+ ? redirectTo.slice(window.location.origin.length)
177
+ : redirectTo;
178
+
179
+ sessionStorage.setItem("redirect-to", finalRedirect);
176
180
 
177
181
  const redirectUrl = new URL(window.location.origin);
178
182
  redirectUrl.pathname = this.callbackUrlPath;
@@ -131,7 +131,7 @@ export const OperationList = ({
131
131
  tag?: string;
132
132
  untagged?: boolean;
133
133
  }) => {
134
- const { input, type, versions, version } = useOasConfig();
134
+ const { input, type, versions, version, options } = useOasConfig();
135
135
  const query = useCreateQuery(AllOperationsQuery, {
136
136
  input,
137
137
  type,
@@ -164,7 +164,11 @@ export const OperationList = ({
164
164
  ? sanitizeMarkdownForMetatag(description)
165
165
  : undefined;
166
166
 
167
- const showVersions = Object.entries(versions).length > 1;
167
+ const hasMultipleVersions = Object.entries(versions).length > 1;
168
+
169
+ const showVersions =
170
+ options?.showVersionSelect === "always" ||
171
+ (hasMultipleVersions && options?.showVersionSelect !== "hide");
168
172
 
169
173
  return (
170
174
  <div
@@ -203,6 +207,7 @@ export const OperationList = ({
203
207
  <Select
204
208
  onValueChange={(version) => navigate(versions[version]!)}
205
209
  defaultValue={version}
210
+ disabled={!hasMultipleVersions}
206
211
  >
207
212
  <SelectTrigger className="w-[180px]">
208
213
  <SelectValue placeholder="Select version" />
@@ -19,6 +19,7 @@ type BaseOasConfig = {
19
19
  examplesLanguage?: string;
20
20
  disablePlayground?: boolean;
21
21
  loadTags?: boolean;
22
+ showVersionSelect?: "always" | "if-available" | "hide";
22
23
  };
23
24
  };
24
25