zudoku 0.77.0 → 0.78.0

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 (37) hide show
  1. package/dist/cli/cli.js +49 -24
  2. package/dist/declarations/config/validators/ZudokuConfig.d.ts +41 -0
  3. package/dist/declarations/lib/authentication/providers/clerk.d.ts +15 -2
  4. package/dist/declarations/lib/authentication/providers/openid.d.ts +7 -1
  5. package/dist/declarations/lib/core/ZudokuContext.d.ts +3 -0
  6. package/dist/declarations/lib/plugins/openapi/GeneratedExampleSidecarBox.d.ts +2 -1
  7. package/dist/declarations/lib/plugins/openapi/playground/Playground.d.ts +6 -1
  8. package/dist/declarations/lib/plugins/openapi/playground/buildRequestBody.d.ts +14 -0
  9. package/dist/declarations/lib/plugins/openapi/playground/request-panel/UrlEncodedField.d.ts +8 -0
  10. package/dist/declarations/lib/plugins/openapi/util/createHttpSnippet.d.ts +3 -3
  11. package/dist/declarations/lib/plugins/openapi/util/formatRequestBody.d.ts +11 -0
  12. package/dist/flat-config.d.ts +5 -0
  13. package/docs/configuration/api-reference.md +4 -0
  14. package/docs/configuration/docs.md +1 -1
  15. package/docs/configuration/overview.md +6 -0
  16. package/docs/guides/mcp-servers.md +1 -1
  17. package/package.json +18 -18
  18. package/src/app/main.tsx +1 -0
  19. package/src/config/validators/ZudokuConfig.ts +22 -2
  20. package/src/lib/authentication/providers/clerk.tsx +33 -2
  21. package/src/lib/authentication/providers/openid.tsx +19 -1
  22. package/src/lib/components/Header.tsx +2 -1
  23. package/src/lib/components/MobileTopNavigation.tsx +2 -1
  24. package/src/lib/core/ZudokuContext.ts +3 -0
  25. package/src/lib/plugins/markdown/MdxPage.tsx +3 -1
  26. package/src/lib/plugins/openapi/GeneratedExampleSidecarBox.tsx +3 -1
  27. package/src/lib/plugins/openapi/MCPEndpoint.tsx +26 -2
  28. package/src/lib/plugins/openapi/Sidecar.tsx +16 -2
  29. package/src/lib/plugins/openapi/SidecarExamples.tsx +9 -27
  30. package/src/lib/plugins/openapi/playground/BodyPanel.tsx +64 -3
  31. package/src/lib/plugins/openapi/playground/Playground.tsx +17 -18
  32. package/src/lib/plugins/openapi/playground/buildRequestBody.ts +46 -0
  33. package/src/lib/plugins/openapi/playground/request-panel/UrlEncodedField.tsx +32 -0
  34. package/src/lib/plugins/openapi/util/createHttpSnippet.ts +111 -67
  35. package/src/lib/plugins/openapi/util/formatRequestBody.ts +84 -0
  36. package/src/lib/util/flattenAllOf.ts +13 -0
  37. package/src/vite/api/SchemaManager.ts +16 -2
package/dist/cli/cli.js CHANGED
@@ -2963,7 +2963,10 @@ var init_ZudokuConfig = __esm({
2963
2963
  showVersionSelect: z7.enum(["always", "if-available", "hide"]),
2964
2964
  expandAllTags: z7.boolean(),
2965
2965
  showInfoPage: z7.boolean(),
2966
- schemaDownload: z7.object({ enabled: z7.boolean() }).partial(),
2966
+ schemaDownload: z7.object({
2967
+ enabled: z7.boolean(),
2968
+ fileName: z7.string().regex(/^[A-Za-z0-9_-]+$/).optional()
2969
+ }).partial(),
2967
2970
  transformExamples: z7.custom(
2968
2971
  (val) => typeof val === "function"
2969
2972
  ),
@@ -3112,7 +3115,7 @@ var init_ZudokuConfig = __esm({
3112
3115
  }).partial();
3113
3116
  DocsConfigSchema = z7.object({
3114
3117
  files: z7.union([z7.string(), z7.array(z7.string())]).transform((val) => typeof val === "string" ? [val] : val).default([DEFAULT_DOCS_FILES]),
3115
- publishMarkdown: z7.boolean().default(false).describe(
3118
+ publishMarkdown: z7.boolean().default(true).describe(
3116
3119
  "When enabled, generates .md files for each document during build. Access documents at their URL path with .md extension (e.g., /foo/hello.md). Markdown files are generated without frontmatter."
3117
3120
  ),
3118
3121
  defaultOptions: z7.object({
@@ -3214,6 +3217,7 @@ var init_ZudokuConfig = __esm({
3214
3217
  issuer: z7.string(),
3215
3218
  audience: z7.string().optional(),
3216
3219
  scopes: z7.array(z7.string()).optional(),
3220
+ allowInsecureRequests: z7.boolean().optional(),
3217
3221
  redirectToAfterSignUp: z7.string().optional(),
3218
3222
  redirectToAfterSignIn: z7.string().optional(),
3219
3223
  redirectToAfterSignOut: z7.string().optional(),
@@ -3350,6 +3354,9 @@ var init_ZudokuConfig = __esm({
3350
3354
  PlacementPosition = z7.enum(["start", "center", "end"]);
3351
3355
  HeaderConfigSchema = z7.object({
3352
3356
  navigation: HeaderNavigationSchema,
3357
+ themeSwitcher: z7.object({
3358
+ enabled: z7.boolean()
3359
+ }).partial().optional(),
3353
3360
  placements: z7.object({
3354
3361
  navigation: PlacementPosition,
3355
3362
  search: PlacementPosition,
@@ -3818,7 +3825,7 @@ import {
3818
3825
  // package.json
3819
3826
  var package_default = {
3820
3827
  name: "zudoku",
3821
- version: "0.76.0",
3828
+ version: "0.77.0",
3822
3829
  type: "module",
3823
3830
  sideEffects: [
3824
3831
  "**/*.css",
@@ -3896,10 +3903,10 @@ var package_default = {
3896
3903
  },
3897
3904
  dependencies: {
3898
3905
  "@apidevtools/json-schema-ref-parser": "15.3.5",
3899
- "@base-ui/react": "^1.4.0",
3906
+ "@base-ui/react": "^1.4.1",
3900
3907
  "@envelop/core": "5.5.1",
3901
3908
  "@graphql-typed-document-node/core": "3.2.0",
3902
- "@hono/node-server": "1.19.13",
3909
+ "@hono/node-server": "2.0.2",
3903
3910
  "@lekoarts/rehype-meta-as-attributes": "3.0.3",
3904
3911
  "@mdx-js/react": "3.1.1",
3905
3912
  "@mdx-js/rollup": "3.1.1",
@@ -3929,7 +3936,8 @@ var package_default = {
3929
3936
  "@radix-ui/react-tooltip": "1.2.8",
3930
3937
  "@radix-ui/react-visually-hidden": "1.2.4",
3931
3938
  "@scalar/openapi-parser": "0.23.13",
3932
- "@sentry/node": "10.49.0",
3939
+ "@scalar/snippetz": "0.9.6",
3940
+ "@sentry/node": "10.52.0",
3933
3941
  "@shikijs/langs": "4.0.2",
3934
3942
  "@shikijs/rehype": "4.0.2",
3935
3943
  "@shikijs/themes": "4.0.2",
@@ -3942,7 +3950,6 @@ var package_default = {
3942
3950
  "@types/react-dom": "catalog:",
3943
3951
  "@vitejs/plugin-react": "6.0.1",
3944
3952
  "@x0k/json-schema-merge": "1.0.2",
3945
- "@zudoku/httpsnippet": "10.0.9",
3946
3953
  "@zudoku/react-helmet-async": "2.0.5",
3947
3954
  "@zuplo/mcp": "0.0.32",
3948
3955
  bs58: "6.0.0",
@@ -3957,14 +3964,14 @@ var package_default = {
3957
3964
  "fast-equals": "6.0.0",
3958
3965
  glob: "13.0.6",
3959
3966
  "glob-parent": "6.0.2",
3960
- graphql: "16.13.2",
3967
+ graphql: "16.14.0",
3961
3968
  "graphql-type-json": "0.3.2",
3962
3969
  "graphql-yoga": "5.18.0",
3963
3970
  "gray-matter": "4.0.3",
3964
3971
  "hast-util-heading-rank": "3.0.0",
3965
3972
  "hast-util-to-jsx-runtime": "2.3.6",
3966
3973
  "hast-util-to-string": "3.0.1",
3967
- hono: "4.12.14",
3974
+ hono: "4.12.18",
3968
3975
  "http-terminator": "3.2.0",
3969
3976
  "javascript-stringify": "2.1.0",
3970
3977
  "json-schema-to-typescript-lite": "15.0.0",
@@ -3974,7 +3981,7 @@ var package_default = {
3974
3981
  "mdast-util-mdx": "3.0.0",
3975
3982
  "mdast-util-mdx-jsx": "3.2.0",
3976
3983
  "micromark-extension-mdxjs": "3.0.0",
3977
- motion: "12.35.1",
3984
+ motion: "12.38.0",
3978
3985
  nanoevents: "9.1.0",
3979
3986
  "next-themes": "0.4.6",
3980
3987
  oauth4webapi: "3.8.5",
@@ -3982,13 +3989,13 @@ var package_default = {
3982
3989
  pagefind: "1.5.2",
3983
3990
  picocolors: "1.1.1",
3984
3991
  piscina: "5.1.4",
3985
- "posthog-node": "5.26.0",
3992
+ "posthog-node": "5.33.4",
3986
3993
  "react-error-boundary": "6.1.1",
3987
- "react-hook-form": "7.71.2",
3994
+ "react-hook-form": "7.75.0",
3988
3995
  "react-is": "catalog:",
3989
3996
  "react-markdown": "10.1.0",
3990
3997
  "react-router": "7.14.1",
3991
- "rehype-mdx-import-media": "1.2.0",
3998
+ "rehype-mdx-import-media": "1.4.0",
3992
3999
  "rehype-raw": "7.0.0",
3993
4000
  "rehype-slug": "6.0.0",
3994
4001
  "remark-comment": "1.0.0",
@@ -3997,11 +4004,11 @@ var package_default = {
3997
4004
  "remark-frontmatter": "5.0.0",
3998
4005
  "remark-gfm": "4.0.1",
3999
4006
  "remark-mdx-frontmatter": "5.2.0",
4000
- semver: "7.7.4",
4007
+ semver: "7.8.0",
4001
4008
  shiki: "4.0.2",
4002
4009
  sitemap: "9.0.1",
4003
4010
  "strip-ansi": "7.2.0",
4004
- "tailwind-merge": "3.5.0",
4011
+ "tailwind-merge": "3.6.0",
4005
4012
  tailwindcss: "4.2.1",
4006
4013
  "tw-animate-css": "1.4.0",
4007
4014
  unified: "11.0.5",
@@ -4009,21 +4016,21 @@ var package_default = {
4009
4016
  vaul: "1.1.2",
4010
4017
  vfile: "6.0.3",
4011
4018
  vite: "8.0.9",
4012
- yaml: "2.8.3",
4019
+ yaml: "2.8.4",
4013
4020
  yargs: "18.0.0",
4014
4021
  zod: "4.3.6",
4015
- zustand: "5.0.12"
4022
+ zustand: "5.0.13"
4016
4023
  },
4017
4024
  devDependencies: {
4018
- "@clerk/clerk-js": "^6.7.4",
4019
- "@graphql-codegen/cli": "6.3.0",
4025
+ "@graphql-codegen/cli": "7.0.0",
4020
4026
  "@inkeep/cxkit-types": "0.5.117",
4021
4027
  "@testing-library/dom": "catalog:",
4022
4028
  "@testing-library/jest-dom": "catalog:",
4023
4029
  "@testing-library/react": "catalog:",
4024
4030
  "@testing-library/user-event": "catalog:",
4025
- "@types/estree": "1.0.8",
4031
+ "@types/estree": "1.0.9",
4026
4032
  "@types/glob-parent": "5.1.3",
4033
+ "@types/har-format": "^1.2.16",
4027
4034
  "@types/hast": "3.0.4",
4028
4035
  "@types/json-schema": "7.0.15",
4029
4036
  "@types/mdast": "4.0.4",
@@ -4362,7 +4369,20 @@ import {
4362
4369
  var { compareSchemaDefinitions, compareSchemaValues } = createComparator();
4363
4370
  var { mergeArrayOfSchemaDefinitions } = createMerger({
4364
4371
  intersectJson: createIntersector(compareSchemaValues),
4365
- deduplicateJsonSchemaDef: createDeduplicator(compareSchemaDefinitions)
4372
+ deduplicateJsonSchemaDef: createDeduplicator(compareSchemaDefinitions),
4373
+ // Default mergers throw on incompatible type/enum pairs, which aborts the
4374
+ // whole flatten even when the bad pair is one branch of a pairwise `anyOf`
4375
+ // combination. Union instead.
4376
+ mergers: {
4377
+ type: (a, b) => {
4378
+ if (a === b) return a;
4379
+ const aArr = Array.isArray(a) ? a : [a];
4380
+ const bArr = Array.isArray(b) ? b : [b];
4381
+ const set = /* @__PURE__ */ new Set([...aArr, ...bArr]);
4382
+ return set.size === 1 ? [...set][0] : [...set];
4383
+ },
4384
+ enum: (a, b) => Array.from(/* @__PURE__ */ new Set([...a, ...b]))
4385
+ }
4366
4386
  });
4367
4387
  var shallowAllOfMerge = createShallowAllOfMerge(
4368
4388
  mergeArrayOfSchemaDefinitions
@@ -5705,6 +5725,9 @@ var SchemaManager = class {
5705
5725
  const existingSchema = schemas[index];
5706
5726
  const schemaVersion = processedSchema.info.version ?? FALLBACK_VERSION;
5707
5727
  const versionPath = existingSchema?.path && existingSchema.path.length > 0 ? existingSchema.path : paramsPath(params) || schemaVersion;
5728
+ const config2 = ensureArray(this.config.apis ?? []).find(
5729
+ (c) => c.path === configuredPath
5730
+ );
5708
5731
  const processed = {
5709
5732
  schema: processedSchema,
5710
5733
  version: schemaVersion,
@@ -5717,7 +5740,8 @@ var SchemaManager = class {
5717
5740
  filePath,
5718
5741
  versionPath,
5719
5742
  configuredPath,
5720
- params
5743
+ params,
5744
+ config2?.options
5721
5745
  ),
5722
5746
  processedJsonPath,
5723
5747
  processedTime
@@ -5803,14 +5827,15 @@ var SchemaManager = class {
5803
5827
  }
5804
5828
  return map;
5805
5829
  };
5806
- createSchemaPath = (inputPath, versionPath, apiPath, params) => {
5830
+ createSchemaPath = (inputPath, versionPath, apiPath, params, config2) => {
5807
5831
  const suffix = paramsSuffix(params);
5808
5832
  const extension = suffix ? ".json" : path7.extname(inputPath);
5833
+ const fileName = config2?.schemaDownload?.fileName ?? this.config.defaults?.apis?.schemaDownload?.fileName ?? "schema";
5809
5834
  return joinUrl(
5810
5835
  this.config.basePath,
5811
5836
  apiPath,
5812
5837
  versionPath,
5813
- `schema${suffix}${extension}`
5838
+ `${fileName}${suffix}${extension}`
5814
5839
  );
5815
5840
  };
5816
5841
  validateSchema = async (schema2, filePath) => {
@@ -42,6 +42,29 @@ declare const AiAssistantsSchema: z.ZodOptional<z.ZodUnion<readonly [z.ZodLitera
42
42
  }) => string>]>;
43
43
  }, z.core.$strip>]>>]>>;
44
44
  export type AiAssistantsConfig = z.infer<typeof AiAssistantsSchema>;
45
+ declare const ApiOptionsSchema: z.ZodObject<{
46
+ examplesLanguage: z.ZodOptional<z.ZodString>;
47
+ supportedLanguages: z.ZodOptional<z.ZodArray<z.ZodObject<{
48
+ value: z.ZodString;
49
+ label: z.ZodString;
50
+ }, z.core.$strip>>>;
51
+ disablePlayground: z.ZodOptional<z.ZodBoolean>;
52
+ disableSidecar: z.ZodOptional<z.ZodBoolean>;
53
+ showVersionSelect: z.ZodOptional<z.ZodEnum<{
54
+ always: "always";
55
+ hide: "hide";
56
+ "if-available": "if-available";
57
+ }>>;
58
+ expandAllTags: z.ZodOptional<z.ZodBoolean>;
59
+ showInfoPage: z.ZodOptional<z.ZodBoolean>;
60
+ schemaDownload: z.ZodOptional<z.ZodObject<{
61
+ enabled: z.ZodOptional<z.ZodBoolean>;
62
+ fileName: z.ZodOptional<z.ZodOptional<z.ZodString>>;
63
+ }, z.core.$strip>>;
64
+ transformExamples: z.ZodOptional<z.ZodCustom<TransformExamplesFn, TransformExamplesFn>>;
65
+ generateCodeSnippet: z.ZodOptional<z.ZodCustom<GenerateCodeSnippetFn, GenerateCodeSnippetFn>>;
66
+ }, z.core.$strip>;
67
+ export type ApiOptionsConfig = z.infer<typeof ApiOptionsSchema>;
45
68
  declare const VersionConfigSchema: z.ZodObject<{
46
69
  path: z.ZodString;
47
70
  input: z.ZodString;
@@ -71,6 +94,7 @@ declare const ApiSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
71
94
  showInfoPage: z.ZodOptional<z.ZodBoolean>;
72
95
  schemaDownload: z.ZodOptional<z.ZodObject<{
73
96
  enabled: z.ZodOptional<z.ZodBoolean>;
97
+ fileName: z.ZodOptional<z.ZodOptional<z.ZodString>>;
74
98
  }, z.core.$strip>>;
75
99
  transformExamples: z.ZodOptional<z.ZodCustom<TransformExamplesFn, TransformExamplesFn>>;
76
100
  generateCodeSnippet: z.ZodOptional<z.ZodCustom<GenerateCodeSnippetFn, GenerateCodeSnippetFn>>;
@@ -105,6 +129,7 @@ declare const ApiSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
105
129
  showInfoPage: z.ZodOptional<z.ZodBoolean>;
106
130
  schemaDownload: z.ZodOptional<z.ZodObject<{
107
131
  enabled: z.ZodOptional<z.ZodBoolean>;
132
+ fileName: z.ZodOptional<z.ZodOptional<z.ZodString>>;
108
133
  }, z.core.$strip>>;
109
134
  transformExamples: z.ZodOptional<z.ZodCustom<TransformExamplesFn, TransformExamplesFn>>;
110
135
  generateCodeSnippet: z.ZodOptional<z.ZodCustom<GenerateCodeSnippetFn, GenerateCodeSnippetFn>>;
@@ -139,6 +164,7 @@ declare const ApiSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
139
164
  showInfoPage: z.ZodOptional<z.ZodBoolean>;
140
165
  schemaDownload: z.ZodOptional<z.ZodObject<{
141
166
  enabled: z.ZodOptional<z.ZodBoolean>;
167
+ fileName: z.ZodOptional<z.ZodOptional<z.ZodString>>;
142
168
  }, z.core.$strip>>;
143
169
  transformExamples: z.ZodOptional<z.ZodCustom<TransformExamplesFn, TransformExamplesFn>>;
144
170
  generateCodeSnippet: z.ZodOptional<z.ZodCustom<GenerateCodeSnippetFn, GenerateCodeSnippetFn>>;
@@ -336,6 +362,7 @@ declare const AuthenticationSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
336
362
  issuer: z.ZodString;
337
363
  audience: z.ZodOptional<z.ZodString>;
338
364
  scopes: z.ZodOptional<z.ZodArray<z.ZodString>>;
365
+ allowInsecureRequests: z.ZodOptional<z.ZodBoolean>;
339
366
  redirectToAfterSignUp: z.ZodOptional<z.ZodString>;
340
367
  redirectToAfterSignIn: z.ZodOptional<z.ZodString>;
341
368
  redirectToAfterSignOut: z.ZodOptional<z.ZodString>;
@@ -6420,6 +6447,9 @@ export declare const ZudokuConfig: z.ZodObject<{
6420
6447
  }, z.core.$strip>>;
6421
6448
  }, z.core.$strip>]>>;
6422
6449
  }, z.core.$strip>]>>>;
6450
+ themeSwitcher: z.ZodOptional<z.ZodOptional<z.ZodObject<{
6451
+ enabled: z.ZodOptional<z.ZodBoolean>;
6452
+ }, z.core.$strip>>>;
6423
6453
  placements: z.ZodOptional<z.ZodOptional<z.ZodObject<{
6424
6454
  navigation: z.ZodOptional<z.ZodEnum<{
6425
6455
  end: "end";
@@ -6708,6 +6738,7 @@ export declare const ZudokuConfig: z.ZodObject<{
6708
6738
  issuer: z.ZodString;
6709
6739
  audience: z.ZodOptional<z.ZodString>;
6710
6740
  scopes: z.ZodOptional<z.ZodArray<z.ZodString>>;
6741
+ allowInsecureRequests: z.ZodOptional<z.ZodBoolean>;
6711
6742
  redirectToAfterSignUp: z.ZodOptional<z.ZodString>;
6712
6743
  redirectToAfterSignIn: z.ZodOptional<z.ZodString>;
6713
6744
  redirectToAfterSignOut: z.ZodOptional<z.ZodString>;
@@ -6842,6 +6873,7 @@ export declare const ZudokuConfig: z.ZodObject<{
6842
6873
  showInfoPage: z.ZodOptional<z.ZodBoolean>;
6843
6874
  schemaDownload: z.ZodOptional<z.ZodObject<{
6844
6875
  enabled: z.ZodOptional<z.ZodBoolean>;
6876
+ fileName: z.ZodOptional<z.ZodOptional<z.ZodString>>;
6845
6877
  }, z.core.$strip>>;
6846
6878
  transformExamples: z.ZodOptional<z.ZodCustom<TransformExamplesFn, TransformExamplesFn>>;
6847
6879
  generateCodeSnippet: z.ZodOptional<z.ZodCustom<GenerateCodeSnippetFn, GenerateCodeSnippetFn>>;
@@ -6876,6 +6908,7 @@ export declare const ZudokuConfig: z.ZodObject<{
6876
6908
  showInfoPage: z.ZodOptional<z.ZodBoolean>;
6877
6909
  schemaDownload: z.ZodOptional<z.ZodObject<{
6878
6910
  enabled: z.ZodOptional<z.ZodBoolean>;
6911
+ fileName: z.ZodOptional<z.ZodOptional<z.ZodString>>;
6879
6912
  }, z.core.$strip>>;
6880
6913
  transformExamples: z.ZodOptional<z.ZodCustom<TransformExamplesFn, TransformExamplesFn>>;
6881
6914
  generateCodeSnippet: z.ZodOptional<z.ZodCustom<GenerateCodeSnippetFn, GenerateCodeSnippetFn>>;
@@ -6910,6 +6943,7 @@ export declare const ZudokuConfig: z.ZodObject<{
6910
6943
  showInfoPage: z.ZodOptional<z.ZodBoolean>;
6911
6944
  schemaDownload: z.ZodOptional<z.ZodObject<{
6912
6945
  enabled: z.ZodOptional<z.ZodBoolean>;
6946
+ fileName: z.ZodOptional<z.ZodOptional<z.ZodString>>;
6913
6947
  }, z.core.$strip>>;
6914
6948
  transformExamples: z.ZodOptional<z.ZodCustom<TransformExamplesFn, TransformExamplesFn>>;
6915
6949
  generateCodeSnippet: z.ZodOptional<z.ZodCustom<GenerateCodeSnippetFn, GenerateCodeSnippetFn>>;
@@ -6940,6 +6974,7 @@ export declare const ZudokuConfig: z.ZodObject<{
6940
6974
  showInfoPage: z.ZodOptional<z.ZodBoolean>;
6941
6975
  schemaDownload: z.ZodOptional<z.ZodObject<{
6942
6976
  enabled: z.ZodOptional<z.ZodBoolean>;
6977
+ fileName: z.ZodOptional<z.ZodOptional<z.ZodString>>;
6943
6978
  }, z.core.$strip>>;
6944
6979
  transformExamples: z.ZodOptional<z.ZodCustom<TransformExamplesFn, TransformExamplesFn>>;
6945
6980
  generateCodeSnippet: z.ZodOptional<z.ZodCustom<GenerateCodeSnippetFn, GenerateCodeSnippetFn>>;
@@ -6974,6 +7009,7 @@ export declare const ZudokuConfig: z.ZodObject<{
6974
7009
  showInfoPage: z.ZodOptional<z.ZodBoolean>;
6975
7010
  schemaDownload: z.ZodOptional<z.ZodObject<{
6976
7011
  enabled: z.ZodOptional<z.ZodBoolean>;
7012
+ fileName: z.ZodOptional<z.ZodOptional<z.ZodString>>;
6977
7013
  }, z.core.$strip>>;
6978
7014
  transformExamples: z.ZodOptional<z.ZodCustom<TransformExamplesFn, TransformExamplesFn>>;
6979
7015
  generateCodeSnippet: z.ZodOptional<z.ZodCustom<GenerateCodeSnippetFn, GenerateCodeSnippetFn>>;
@@ -7008,6 +7044,7 @@ export declare const ZudokuConfig: z.ZodObject<{
7008
7044
  showInfoPage: z.ZodOptional<z.ZodBoolean>;
7009
7045
  schemaDownload: z.ZodOptional<z.ZodObject<{
7010
7046
  enabled: z.ZodOptional<z.ZodBoolean>;
7047
+ fileName: z.ZodOptional<z.ZodOptional<z.ZodString>>;
7011
7048
  }, z.core.$strip>>;
7012
7049
  transformExamples: z.ZodOptional<z.ZodCustom<TransformExamplesFn, TransformExamplesFn>>;
7013
7050
  generateCodeSnippet: z.ZodOptional<z.ZodCustom<GenerateCodeSnippetFn, GenerateCodeSnippetFn>>;
@@ -7107,6 +7144,7 @@ export declare const ZudokuConfig: z.ZodObject<{
7107
7144
  showInfoPage: z.ZodOptional<z.ZodBoolean>;
7108
7145
  schemaDownload: z.ZodOptional<z.ZodObject<{
7109
7146
  enabled: z.ZodOptional<z.ZodBoolean>;
7147
+ fileName: z.ZodOptional<z.ZodOptional<z.ZodString>>;
7110
7148
  }, z.core.$strip>>;
7111
7149
  transformExamples: z.ZodOptional<z.ZodCustom<TransformExamplesFn, TransformExamplesFn>>;
7112
7150
  generateCodeSnippet: z.ZodOptional<z.ZodCustom<GenerateCodeSnippetFn, GenerateCodeSnippetFn>>;
@@ -7126,6 +7164,9 @@ type BaseZudokuConfig = z.input<typeof ZudokuConfig>;
7126
7164
  export type ZudokuConfig = Omit<BaseZudokuConfig, "header" | "navigation" | "navigationRules"> & {
7127
7165
  header?: {
7128
7166
  navigation?: z.infer<typeof HeaderNavigationSchema>;
7167
+ themeSwitcher?: {
7168
+ enabled?: boolean;
7169
+ };
7129
7170
  placements?: {
7130
7171
  navigation?: "start" | "center" | "end";
7131
7172
  search?: "start" | "center" | "end";
@@ -1,9 +1,22 @@
1
- import type { Clerk } from "@clerk/clerk-js";
2
1
  import type { ClerkAuthenticationConfig } from "../../../config/config.js";
3
2
  import type { AuthenticationProviderInitializer } from "../authentication.js";
3
+ type ClerkEmailAddress = {
4
+ emailAddress: string;
5
+ verification: {
6
+ status: string;
7
+ };
8
+ };
9
+ export type ClerkUser = {
10
+ id: string;
11
+ fullName: string | null;
12
+ imageUrl: string;
13
+ emailAddresses: ClerkEmailAddress[];
14
+ reload: () => Promise<unknown>;
15
+ [key: string]: unknown;
16
+ };
4
17
  export type ClerkProviderData = {
5
18
  type: "clerk";
6
- user: NonNullable<Clerk["session"]>["user"] | undefined;
19
+ user: ClerkUser | undefined;
7
20
  };
8
21
  declare module "../state.js" {
9
22
  interface ProviderDataRegistry {
@@ -38,7 +38,13 @@ export declare class OpenIDAuthenticationProvider extends CoreAuthenticationPlug
38
38
  protected readonly authorizationParams?: Record<string, string>;
39
39
  protected readonly forwardAuthorizationParams: string[];
40
40
  protected static readonly DEFAULT_FORWARD_AUTHORIZATION_PARAMS: string[];
41
- constructor({ issuer, audience, clientId, redirectToAfterSignUp, redirectToAfterSignIn, redirectToAfterSignOut, basePath, scopes, signUp, disableSignUp, authorizationParams, forwardAuthorizationParams, }: OpenIDAuthenticationConfig);
41
+ private readonly allowInsecureRequests;
42
+ constructor({ issuer, audience, clientId, redirectToAfterSignUp, redirectToAfterSignIn, redirectToAfterSignOut, basePath, scopes, signUp, disableSignUp, authorizationParams, forwardAuthorizationParams, allowInsecureRequests, }: OpenIDAuthenticationConfig);
43
+ protected get oauthOptions(): {
44
+ [oauth.allowInsecureRequests]: boolean;
45
+ } | {
46
+ [oauth.allowInsecureRequests]?: undefined;
47
+ };
42
48
  protected getAuthServer(): Promise<oauth.AuthorizationServer>;
43
49
  protected setTokensFromResponse(response: oauth.TokenEndpointResponse): void;
44
50
  signUp({ navigate }: {
@@ -71,6 +71,9 @@ type Site = Partial<{
71
71
  }>;
72
72
  type HeaderConfig = {
73
73
  navigation?: HeaderNavigation;
74
+ themeSwitcher?: {
75
+ enabled?: boolean;
76
+ };
74
77
  placements?: {
75
78
  navigation?: "start" | "center" | "end";
76
79
  search?: "start" | "center" | "end";
@@ -1,5 +1,6 @@
1
- export declare const GeneratedExampleSidecarBox: ({ code, isOnScreen, shouldLazyHighlight, }: {
1
+ export declare const GeneratedExampleSidecarBox: ({ code, language, isOnScreen, shouldLazyHighlight, }: {
2
2
  code: string;
3
+ language?: string;
3
4
  isOnScreen: boolean;
4
5
  shouldLazyHighlight?: boolean;
5
6
  }) => import("react/jsx-runtime").JSX.Element;
@@ -26,13 +26,18 @@ export type PathParam = {
26
26
  };
27
27
  export type PlaygroundForm = {
28
28
  body: string;
29
- bodyMode?: "text" | "file" | "multipart";
29
+ bodyMode?: "text" | "file" | "multipart" | "urlencoded";
30
30
  file?: File | null;
31
31
  multipartFormFields: Array<{
32
32
  name: string;
33
33
  value: File | string;
34
34
  active: boolean;
35
35
  }>;
36
+ urlencodedFormFields: Array<{
37
+ name: string;
38
+ value: string;
39
+ active: boolean;
40
+ }>;
36
41
  queryParams: Array<{
37
42
  name: string;
38
43
  value: string;
@@ -0,0 +1,14 @@
1
+ import type { PlaygroundForm } from "./Playground.js";
2
+ export type ContentTypeAction = {
3
+ kind: "preserve";
4
+ } | {
5
+ kind: "remove";
6
+ } | {
7
+ kind: "override";
8
+ value: string;
9
+ };
10
+ export type BuiltRequestBody = {
11
+ body: string | FormData | File | undefined;
12
+ contentType: ContentTypeAction;
13
+ };
14
+ export declare const buildRequestBody: (form: PlaygroundForm) => BuiltRequestBody;
@@ -0,0 +1,8 @@
1
+ import type { PlaygroundForm } from "../Playground.js";
2
+ import type { useKeyValueFieldManager } from "./useKeyValueFieldManager.js";
3
+ type UrlEncodedFieldProps = {
4
+ index: number;
5
+ manager: ReturnType<typeof useKeyValueFieldManager<PlaygroundForm, "urlencodedFormFields">>;
6
+ };
7
+ export declare const UrlEncodedField: ({ index, manager }: UrlEncodedFieldProps) => import("react/jsx-runtime").JSX.Element;
8
+ export {};
@@ -1,4 +1,4 @@
1
- import { HTTPSnippet } from "@zudoku/httpsnippet";
1
+ import type { HarRequest } from "@scalar/snippetz";
2
2
  import type { OperationsFragmentFragment } from "../graphql/graphql.js";
3
3
  export type ResolvedAuth = {
4
4
  headers: Array<{
@@ -19,5 +19,5 @@ export declare const createHttpSnippet: ({ operation, selectedServer, exampleBod
19
19
  text?: string;
20
20
  };
21
21
  resolvedAuth?: ResolvedAuth;
22
- }) => HTTPSnippet;
23
- export declare const getConverted: (snippet: HTTPSnippet, option: string) => any;
22
+ }) => Partial<HarRequest>;
23
+ export declare const getConverted: (request: Partial<HarRequest>, language: string) => string;
@@ -0,0 +1,11 @@
1
+ export type UrlEncodedRow = {
2
+ name: string;
3
+ value: string;
4
+ };
5
+ export declare const isUrlEncodedMediaType: (mediaType?: string) => boolean;
6
+ export declare const toUrlEncoded: (value: unknown) => string;
7
+ export declare const formatRequestBodyForDisplay: (mediaType: string | undefined, value: unknown) => string | undefined;
8
+ export declare const getLanguageForMediaType: (mediaType?: string) => string;
9
+ export declare const rowsToUrlEncoded: (rows: UrlEncodedRow[]) => string;
10
+ export declare const fromUrlEncoded: (text: string) => UrlEncodedRow[];
11
+ export declare const exampleToUrlEncodedRows: (value: unknown) => UrlEncodedRow[];
@@ -168,6 +168,9 @@ export interface FlatZudokuConfig {
168
168
  items: _Schema2[]
169
169
  })[]
170
170
  })[]
171
+ themeSwitcher?: {
172
+ enabled?: boolean
173
+ }
171
174
  placements?: {
172
175
  navigation?: _Schema3
173
176
  search?: _Schema3
@@ -278,6 +281,7 @@ export interface FlatZudokuConfig {
278
281
  issuer: string
279
282
  audience?: string
280
283
  scopes?: string[]
284
+ allowInsecureRequests?: boolean
281
285
  redirectToAfterSignUp?: string
282
286
  redirectToAfterSignIn?: string
283
287
  redirectToAfterSignOut?: string
@@ -485,6 +489,7 @@ export interface _Schema22 {
485
489
  showInfoPage?: boolean
486
490
  schemaDownload?: {
487
491
  enabled?: boolean
492
+ fileName?: string
488
493
  }
489
494
  transformExamples?: unknown
490
495
  generateCodeSnippet?: unknown
@@ -212,6 +212,7 @@ const config = {
212
212
  showInfoPage: true, // Show API information page as the index route
213
213
  schemaDownload: {
214
214
  enabled: true, // Enable schema download button
215
+ fileName: "schema", // Set name of the schema file when downloaded
215
216
  },
216
217
  },
217
218
  },
@@ -238,6 +239,8 @@ Available options:
238
239
  - `schemaDownload`: Enable schema download functionality. When enabled, displays a button allowing
239
240
  users to download the OpenAPI schema, copy it to clipboard, or open in a new tab.
240
241
  - `enabled`: Enable or disable the schema download button
242
+ - `fileName`: Set name of the schema file when downloaded (default: `schema`). Note: Do not
243
+ include a file extension, as that is added automatically based on the input file type.
241
244
  - `transformExamples`: Function to transform request/response examples before rendering. See
242
245
  [Transforming Examples](../guides/transforming-examples.md) for detailed usage
243
246
  - `generateCodeSnippet`: Function to generate custom code snippets for the API playground. See
@@ -261,6 +264,7 @@ const config = {
261
264
  showInfoPage: true, // Show API information page as the index route
262
265
  schemaDownload: {
263
266
  enabled: true, // Enable schema download button
267
+ fileName: "schema", // Set name of the schema file when downloaded
264
268
  },
265
269
  },
266
270
  },
@@ -228,7 +228,7 @@ The copy button provides:
228
228
 
229
229
  ### `publishMarkdown`
230
230
 
231
- **Type:** `boolean` **Default:** `false`
231
+ **Type:** `boolean` **Default:** `true`
232
232
 
233
233
  When enabled, generates `.md` files for each documentation page during build. Pages can then be
234
234
  accessed at their URL path with the `.md` extension appended (e.g., `/docs/quickstart.md`).
@@ -195,10 +195,16 @@ Configures the header navigation and placement of header elements (navigation, s
195
195
  search: "end", // "start" | "center" | "end"
196
196
  auth: "end", // "start" | "center" | "end" | "navigation"
197
197
  },
198
+ themeSwitcher: {
199
+ enabled: false, // optional, defaults to true
200
+ },
198
201
  }
199
202
  }
200
203
  ```
201
204
 
205
+ Use `header.themeSwitcher.enabled: false` to hide the light/dark theme switch from the desktop
206
+ header and mobile navigation drawer.
207
+
202
208
  ### `defaults`
203
209
 
204
210
  Sets global default options for APIs that apply to all API configurations. Individual API options
@@ -186,4 +186,4 @@ since they use a different interaction model.
186
186
 
187
187
  If you are using [Zuplo](https://zuplo.com) to host your API, the `x-mcp-server` extension is
188
188
  automatically added to POST operations that use the `mcpServerHandler`. No manual schema changes are
189
- needed. See the [Zuplo MCP documentation](https://zuplo.com/docs/handlers/mcp-handler) for details.
189
+ needed. See the [Zuplo MCP documentation](https://zuplo.com/docs/handlers/mcp-server) for details.