fumadocs-openapi 10.8.5 → 10.9.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 (56) hide show
  1. package/css/generated/shared.css +26 -6
  2. package/dist/generate-file.d.ts +1 -1
  3. package/dist/generate-file.js +1 -1
  4. package/dist/i18n.d.ts +9 -4
  5. package/dist/i18n.js +14 -5
  6. package/dist/index.d.ts +2 -2
  7. package/dist/node_modules/.pnpm/{@scalar_helpers@0.6.0 → @scalar_helpers@0.8.0}/node_modules/@scalar/helpers/dist/general/create-limiter.js +1 -1
  8. package/dist/node_modules/.pnpm/{@scalar_helpers@0.6.0 → @scalar_helpers@0.8.0}/node_modules/@scalar/helpers/dist/object/is-object.js +1 -1
  9. package/dist/node_modules/.pnpm/{@scalar_helpers@0.6.0 → @scalar_helpers@0.8.0}/node_modules/@scalar/helpers/dist/object/prevent-pollution.js +1 -1
  10. package/dist/node_modules/.pnpm/{@scalar_helpers@0.6.0 → @scalar_helpers@0.8.0}/node_modules/@scalar/helpers/dist/queue/queue.js +1 -1
  11. package/dist/node_modules/.pnpm/{@scalar_helpers@0.6.0 → @scalar_helpers@0.8.0}/node_modules/@scalar/helpers/dist/string/generate-hash.js +1 -1
  12. package/dist/node_modules/.pnpm/{@scalar_json-magic@0.12.12 → @scalar_json-magic@0.12.14}/node_modules/@scalar/json-magic/dist/bundle/bundle.js +2 -2
  13. package/dist/node_modules/.pnpm/{@scalar_json-magic@0.12.12 → @scalar_json-magic@0.12.14}/node_modules/@scalar/json-magic/dist/bundle/plugins/fetch-urls/index.js +2 -2
  14. package/dist/node_modules/.pnpm/{@scalar_json-magic@0.12.12 → @scalar_json-magic@0.12.14}/node_modules/@scalar/json-magic/dist/bundle/plugins/read-files/index.js +1 -1
  15. package/dist/node_modules/.pnpm/{@scalar_json-magic@0.12.12 → @scalar_json-magic@0.12.14}/node_modules/@scalar/json-magic/dist/bundle/value-generator.js +2 -2
  16. package/dist/node_modules/.pnpm/{@scalar_json-magic@0.12.12 → @scalar_json-magic@0.12.14}/node_modules/@scalar/json-magic/dist/helpers/convert-to-local-ref.js +1 -1
  17. package/dist/node_modules/.pnpm/{@scalar_json-magic@0.12.12 → @scalar_json-magic@0.12.14}/node_modules/@scalar/json-magic/dist/helpers/escape-json-pointer.js +1 -1
  18. package/dist/node_modules/.pnpm/{@scalar_json-magic@0.12.12 → @scalar_json-magic@0.12.14}/node_modules/@scalar/json-magic/dist/helpers/get-schemas.js +1 -1
  19. package/dist/node_modules/.pnpm/{@scalar_json-magic@0.12.12 → @scalar_json-magic@0.12.14}/node_modules/@scalar/json-magic/dist/helpers/get-segments-from-path.js +1 -1
  20. package/dist/node_modules/.pnpm/{@scalar_json-magic@0.12.12 → @scalar_json-magic@0.12.14}/node_modules/@scalar/json-magic/dist/helpers/get-value-by-path.js +1 -1
  21. package/dist/node_modules/.pnpm/{@scalar_json-magic@0.12.12 → @scalar_json-magic@0.12.14}/node_modules/@scalar/json-magic/dist/helpers/is-file-path.js +1 -1
  22. package/dist/node_modules/.pnpm/{@scalar_json-magic@0.12.12 → @scalar_json-magic@0.12.14}/node_modules/@scalar/json-magic/dist/helpers/is-http-url.js +1 -1
  23. package/dist/node_modules/.pnpm/{@scalar_json-magic@0.12.12 → @scalar_json-magic@0.12.14}/node_modules/@scalar/json-magic/dist/helpers/is-json-object.js +2 -2
  24. package/dist/node_modules/.pnpm/{@scalar_json-magic@0.12.12 → @scalar_json-magic@0.12.14}/node_modules/@scalar/json-magic/dist/helpers/is-yaml.js +1 -1
  25. package/dist/node_modules/.pnpm/@scalar_json-magic@0.12.14/node_modules/@scalar/json-magic/dist/helpers/normalize.js +33 -0
  26. package/dist/node_modules/.pnpm/{@scalar_json-magic@0.12.12 → @scalar_json-magic@0.12.14}/node_modules/@scalar/json-magic/dist/helpers/resolve-reference-path.js +1 -1
  27. package/dist/node_modules/.pnpm/{@scalar_json-magic@0.12.12 → @scalar_json-magic@0.12.14}/node_modules/@scalar/json-magic/dist/helpers/set-value-at-path.js +2 -2
  28. package/dist/node_modules/.pnpm/{@scalar_json-magic@0.12.12 → @scalar_json-magic@0.12.14}/node_modules/@scalar/json-magic/dist/helpers/to-relative-path.js +1 -1
  29. package/dist/node_modules/.pnpm/{@scalar_json-magic@0.12.12 → @scalar_json-magic@0.12.14}/node_modules/@scalar/json-magic/dist/helpers/unescape-json-pointer.js +1 -1
  30. package/dist/playground/client.js +1 -1
  31. package/dist/playground/components/oauth-dialog.js +1 -1
  32. package/dist/playground/components/result-display.js +3 -2
  33. package/dist/playground/components/spinner.js +2 -1
  34. package/dist/scalar/client.js +2 -1
  35. package/dist/server/index.d.ts +108 -3
  36. package/dist/server/index.js +181 -2
  37. package/dist/server/proxy.d.ts +1 -1
  38. package/dist/types.d.ts +1 -1
  39. package/dist/ui/base.d.ts +1 -1
  40. package/dist/ui/client/i18n.js +7 -10
  41. package/dist/ui/components/method-label.js +1 -4
  42. package/dist/ui/index.d.ts +1 -1
  43. package/dist/utils/document/process.js +4 -4
  44. package/dist/utils/pages/builder.d.ts +4 -3
  45. package/dist/utils/pages/builder.js +20 -1
  46. package/dist/utils/pages/to-text.d.ts +1 -1
  47. package/dist/utils/pages/to-text.js +23 -42
  48. package/dist/utils/schema/sample.js +1 -1
  49. package/package.json +9 -9
  50. package/dist/node_modules/.pnpm/@scalar_json-magic@0.12.12/node_modules/@scalar/json-magic/dist/helpers/normalize.js +0 -26
  51. package/dist/server/create.d.ts +0 -40
  52. package/dist/server/create.js +0 -42
  53. package/dist/server/source-api.d.ts +0 -55
  54. package/dist/server/source-api.js +0 -149
  55. /package/dist/node_modules/.pnpm/{@scalar_json-magic@0.12.12 → @scalar_json-magic@0.12.14}/node_modules/@scalar/json-magic/dist/bundle/plugins/node.js +0 -0
  56. /package/dist/node_modules/.pnpm/{@scalar_json-magic@0.12.12 → @scalar_json-magic@0.12.14}/node_modules/@scalar/json-magic/dist/bundle/plugins/parse-yaml/index.js +0 -0
@@ -24,6 +24,7 @@
24
24
  @source inline("@fumari/stf");
25
25
  @source inline("@md:grid-cols-2");
26
26
  @source inline("@param");
27
+ @source inline("@private");
27
28
  @source inline("@radix-ui/react-accordion");
28
29
  @source inline("@radix-ui/react-dialog");
29
30
  @source inline("@radix-ui/react-select");
@@ -184,8 +185,10 @@
184
185
  @source inline("core");
185
186
  @source inline("could");
186
187
  @source inline("createAutoPreset");
188
+ @source inline("createCodeSample");
187
189
  @source inline("createContext");
188
190
  @source inline("createMethod");
191
+ @source inline("createProxy");
189
192
  @source inline("createRehypeCode");
190
193
  @source inline("credentials");
191
194
  @source inline("css");
@@ -242,6 +245,7 @@
242
245
  @source inline("development");
243
246
  @source inline("deviceAuthorization");
244
247
  @source inline("disable");
248
+ @source inline("disableCache");
245
249
  @source inline("disabled");
246
250
  @source inline("disabled:cursor-not-allowed");
247
251
  @source inline("disabled:opacity-50");
@@ -251,13 +255,17 @@
251
255
  @source inline("div");
252
256
  @source inline("divide-fd-border");
253
257
  @source inline("divide-y");
258
+ @source inline("do");
254
259
  @source inline("doc");
255
260
  @source inline("document");
261
+ @source inline("documents");
256
262
  @source inline("doesn");
257
263
  @source inline("domain");
264
+ @source inline("downloaded");
258
265
  @source inline("duplicated");
259
266
  @source inline("duration-200");
260
267
  @source inline("dynamic");
268
+ @source inline("dynamicSource");
261
269
  @source inline("e");
262
270
  @source inline("each");
263
271
  @source inline("element");
@@ -320,7 +328,6 @@
320
328
  @source inline("flex-col-reverse");
321
329
  @source inline("flex-row");
322
330
  @source inline("flex-wrap");
323
- @source inline("flow");
324
331
  @source inline("flows");
325
332
  @source inline("focus-visible:outline-none");
326
333
  @source inline("focus-visible:ring-1");
@@ -345,8 +352,9 @@
345
352
  @source inline("found");
346
353
  @source inline("from");
347
354
  @source inline("fromServer");
355
+ @source inline("fs");
348
356
  @source inline("full");
349
- @source inline("fumadocs-core/mdx-plugins");
357
+ @source inline("fumadocs-core/i18n");
350
358
  @source inline("fumadocs-core/source");
351
359
  @source inline("fumadocs-core/toc");
352
360
  @source inline("fumadocs-ui/mdx");
@@ -380,6 +388,8 @@
380
388
  @source inline("getExampleRequests");
381
389
  @source inline("getSchema");
382
390
  @source inline("getSchemaId");
391
+ @source inline("getSchemas");
392
+ @source inline("getWatchPaths");
383
393
  @source inline("ghost");
384
394
  @source inline("github-dark");
385
395
  @source inline("github-light");
@@ -450,6 +460,7 @@
450
460
  @source inline("instead");
451
461
  @source inline("integer");
452
462
  @source inline("interface");
463
+ @source inline("internal");
453
464
  @source inline("internal_legacy");
454
465
  @source inline("invalid");
455
466
  @source inline("is");
@@ -461,6 +472,7 @@
461
472
  @source inline("isMediaTypeSupported");
462
473
  @source inline("isNumber");
463
474
  @source inline("isRequired");
475
+ @source inline("issues");
464
476
  @source inline("it");
465
477
  @source inline("item");
466
478
  @source inline("itemId");
@@ -476,6 +488,7 @@
476
488
  @source inline("justify-center");
477
489
  @source inline("key");
478
490
  @source inline("keyof");
491
+ @source inline("keys");
479
492
  @source inline("kind");
480
493
  @source inline("label");
481
494
  @source inline("labelVariants");
@@ -497,9 +510,11 @@
497
510
  @source inline("light");
498
511
  @source inline("line-through");
499
512
  @source inline("list");
513
+ @source inline("listed");
500
514
  @source inline("listener");
501
515
  @source inline("listeners");
502
516
  @source inline("load");
517
+ @source inline("loaderPlugin");
503
518
  @source inline("localStorage");
504
519
  @source inline("lucide-react");
505
520
  @source inline("map");
@@ -561,6 +576,7 @@
561
576
  @source inline("newKey");
562
577
  @source inline("no-cache");
563
578
  @source inline("node");
579
+ @source inline("node:fs");
564
580
  @source inline("node:path");
565
581
  @source inline("non-RSC");
566
582
  @source inline("non-string");
@@ -659,7 +675,6 @@
659
675
  @source inline("place");
660
676
  @source inline("placeholder");
661
677
  @source inline("placeholder:text-fd-muted-foreground");
662
- @source inline("placeholders");
663
678
  @source inline("playground");
664
679
  @source inline("playgroundEnabled");
665
680
  @source inline("playgrounds");
@@ -714,6 +729,8 @@
714
729
  @source inline("react/jsx-runtime");
715
730
  @source inline("read");
716
731
  @source inline("readOnly");
732
+ @source inline("readonly");
733
+ @source inline("records");
717
734
  @source inline("recover");
718
735
  @source inline("red");
719
736
  @source inline("redirect_uri");
@@ -743,6 +760,7 @@
743
760
  @source inline("renderRequestTabsDefault");
744
761
  @source inline("renderResponseTabs");
745
762
  @source inline("renderResponseTabsDefault");
763
+ @source inline("renderTranslation");
746
764
  @source inline("renderTrigger");
747
765
  @source inline("renderWebhookLayout");
748
766
  @source inline("rendered");
@@ -783,6 +801,7 @@
783
801
  @source inline("result");
784
802
  @source inline("return");
785
803
  @source inline("returned");
804
+ @source inline("returning");
786
805
  @source inline("role");
787
806
  @source inline("root");
788
807
  @source inline("rotate-90");
@@ -906,6 +925,7 @@
906
925
  @source inline("specify");
907
926
  @source inline("src");
908
927
  @source inline("state");
928
+ @source inline("staticSource");
909
929
  @source inline("status");
910
930
  @source inline("statusBadRequest");
911
931
  @source inline("statusCode");
@@ -941,6 +961,7 @@
941
961
  @source inline("tab");
942
962
  @source inline("tabs");
943
963
  @source inline("tag");
964
+ @source inline("test");
944
965
  @source inline("testQuery");
945
966
  @source inline("text");
946
967
  @source inline("text-[0.8125rem]");
@@ -1007,7 +1028,6 @@
1007
1028
  @source inline("transition-colors");
1008
1029
  @source inline("transition-transform");
1009
1030
  @source inline("translated");
1010
- @source inline("translation");
1011
1031
  @source inline("tree");
1012
1032
  @source inline("trigger");
1013
1033
  @source inline("true");
@@ -1028,6 +1048,7 @@
1028
1048
  @source inline("union");
1029
1049
  @source inline("unionField");
1030
1050
  @source inline("unknown");
1051
+ @source inline("unlisted");
1031
1052
  @source inline("update");
1032
1053
  @source inline("updateInfo");
1033
1054
  @source inline("updated");
@@ -1043,7 +1064,6 @@
1043
1064
  @source inline("useAuth");
1044
1065
  @source inline("useCopyButton");
1045
1066
  @source inline("useFieldValue");
1046
- @source inline("useI18n");
1047
1067
  @source inline("useMemo");
1048
1068
  @source inline("useNamespace");
1049
1069
  @source inline("useObject");
@@ -1059,6 +1079,7 @@
1059
1079
  @source inline("useStorageKey");
1060
1080
  @source inline("useTheme");
1061
1081
  @source inline("useTranslations");
1082
+ @source inline("useTranslationsBase");
1062
1083
  @source inline("useTypeText");
1063
1084
  @source inline("used");
1064
1085
  @source inline("username");
@@ -1093,7 +1114,6 @@
1093
1114
  @source inline("will");
1094
1115
  @source inline("with");
1095
1116
  @source inline("withBase");
1096
- @source inline("withReplacements");
1097
1117
  @source inline("without");
1098
1118
  @source inline("wrap");
1099
1119
  @source inline("wrap-break-word");
@@ -1,6 +1,6 @@
1
- import { OpenAPIServer } from "./server/create.js";
2
1
  import { OutputEntry } from "./utils/pages/builder.js";
3
2
  import { SchemaToPagesOptions } from "./utils/pages/preset-auto.js";
3
+ import { OpenAPIServer } from "./server/index.js";
4
4
  import { DistributiveOmit } from "./types.js";
5
5
  import { DereferencedDocument } from "./utils/document/dereference.js";
6
6
  import { PagesToTextOptions } from "./utils/pages/to-text.js";
@@ -1,7 +1,7 @@
1
+ import { fromSchema } from "./utils/pages/builder.js";
1
2
  import { doubleQuote } from "./requests/string-utils.js";
2
3
  import { generateDocument, toText } from "./utils/pages/to-text.js";
3
4
  import { createAutoPreset } from "./utils/pages/preset-auto.js";
4
- import { fromSchema } from "./utils/pages/builder.js";
5
5
  import { mkdir, writeFile } from "node:fs/promises";
6
6
  import * as path$1 from "node:path";
7
7
  import { PathUtils, createGetUrl, getSlugs } from "fumadocs-core/source";
package/dist/i18n.d.ts CHANGED
@@ -1,3 +1,4 @@
1
+ import { TranslationValue, TranslationsAPIExtension } from "fumadocs-core/i18n";
1
2
  import { I18nUIConfig } from "fumadocs-ui/i18n";
2
3
 
3
4
  //#region src/i18n.d.ts
@@ -14,6 +15,7 @@ declare const defaultTranslations: {
14
15
  body: string;
15
16
  deprecated: string;
16
17
  submit: string;
18
+ test: string;
17
19
  unsupported: string;
18
20
  close: string;
19
21
  inputPlaceholder: string;
@@ -32,7 +34,7 @@ declare const defaultTranslations: {
32
34
  authTokenIn: string;
33
35
  authScope: string;
34
36
  typeScriptDefinitions: string;
35
- useTypeInTypeScript: string;
37
+ useTypeInTypeScript: TranslationValue<"name">;
36
38
  schemaDefault: string;
37
39
  schemaMatch: string;
38
40
  schemaFormat: string;
@@ -43,7 +45,7 @@ declare const defaultTranslations: {
43
45
  schemaItems: string;
44
46
  schemaValueIn: string;
45
47
  schemaExample: string;
46
- responseTabName: string;
48
+ responseTabName: TranslationValue<"key">;
47
49
  responseTabNameDefault: string;
48
50
  closeJsonEditor: string;
49
51
  openJsonEditor: string;
@@ -58,7 +60,8 @@ declare const defaultTranslations: {
58
60
  statusSuccessful: string;
59
61
  statusError: string;
60
62
  statusClientError: string;
61
- statusBinaryBody: string;
63
+ statusBinaryBody: TranslationValue<"length">;
64
+ oauthFlowPlaceholder: string;
62
65
  obtainAccessToken: string;
63
66
  resourceOwnerPassword: string;
64
67
  resourceOwnerPasswordDesc: string;
@@ -96,6 +99,8 @@ declare const defaultTranslations: {
96
99
  playgroundInputUnset: string;
97
100
  };
98
101
  type Translations = typeof defaultTranslations;
102
+ declare function openapiTranslations(): TranslationsAPIExtension<'openapi', Translations>;
103
+ /** @deprecated use `i18n.translations()` & `openapiTranslations()` instead */
99
104
  declare function defineI18nOpenAPI<Languages extends string>(config: I18nUIConfig<Languages>, translations: Partial<Record<NoInfer<Languages>, Partial<Translations>>>): I18nUIConfig<Languages>;
100
105
  //#endregion
101
- export { Translations, defaultTranslations, defineI18nOpenAPI };
106
+ export { Translations, defaultTranslations, defineI18nOpenAPI, openapiTranslations };
package/dist/i18n.js CHANGED
@@ -1,6 +1,4 @@
1
- import { require_deepmerge } from "./node_modules/.pnpm/@fastify_deepmerge@3.2.1/node_modules/@fastify/deepmerge/index.js";
2
1
  //#region src/i18n.ts
3
- var import_deepmerge = require_deepmerge();
4
2
  const defaultTranslations = {
5
3
  loading: "loading...",
6
4
  empty: "Empty",
@@ -14,6 +12,7 @@ const defaultTranslations = {
14
12
  body: "Body",
15
13
  deprecated: "Deprecated",
16
14
  submit: "Submit",
15
+ test: "Test",
17
16
  unsupported: "Unsupported",
18
17
  close: "Close",
19
18
  inputPlaceholder: "Enter value",
@@ -59,6 +58,7 @@ const defaultTranslations = {
59
58
  statusError: "Error",
60
59
  statusClientError: "Client Error",
61
60
  statusBinaryBody: "Binary response body, {length} bytes",
61
+ oauthFlowPlaceholder: "Select a flow",
62
62
  obtainAccessToken: "Obtain the access token for API.",
63
63
  resourceOwnerPassword: "Resource Owner Password Flow",
64
64
  resourceOwnerPasswordDesc: "Authenticate using username and password.",
@@ -95,8 +95,14 @@ const defaultTranslations = {
95
95
  playgroundInputUpload: "Upload",
96
96
  playgroundInputUnset: "Unset"
97
97
  };
98
+ function openapiTranslations() {
99
+ return {
100
+ namespace: "openapi",
101
+ defaultValue: defaultTranslations
102
+ };
103
+ }
104
+ /** @deprecated use `i18n.translations()` & `openapiTranslations()` instead */
98
105
  function defineI18nOpenAPI(config, translations) {
99
- const dm = (0, import_deepmerge.deepmerge)();
100
106
  return {
101
107
  ...config,
102
108
  provider(locale = config.defaultLanguage) {
@@ -104,11 +110,14 @@ function defineI18nOpenAPI(config, translations) {
104
110
  const data = translations[locale];
105
111
  if (data) {
106
112
  out.translations ??= {};
107
- out.translations.openapi = dm(defaultTranslations, data);
113
+ out.translations.openapi = {
114
+ ...defaultTranslations,
115
+ ...data
116
+ };
108
117
  }
109
118
  return out;
110
119
  }
111
120
  };
112
121
  }
113
122
  //#endregion
114
- export { defaultTranslations, defineI18nOpenAPI };
123
+ export { defaultTranslations, defineI18nOpenAPI, openapiTranslations };
package/dist/index.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import { MediaAdapter } from "./requests/media/adapter.js";
2
- import { OperationOutput, OutputEntry, OutputGroup, PageOutput, PagesBuilder, PagesBuilderConfig, WebhookOutput, fromSchema, fromServer } from "./utils/pages/builder.js";
2
+ import { OperationOutput, OutputEntry, OutputGroup, PageOutput, PagesBuilder, PagesBuilderConfig, WebhookOutput, fromSchema, fromServer, getPageProps } from "./utils/pages/builder.js";
3
3
  import { SchemaToPagesOptions, createAutoPreset } from "./utils/pages/preset-auto.js";
4
4
  import { Awaitable, CallbackObject, DistributiveOmit, Document, ExampleObject, HttpMethods, MediaTypeObject, MethodInformation, OAuth2SecurityScheme, OperationObject, ParameterObject, PathItemObject, ReferenceObject, RenderContext, RequestBodyObject, ResponseObject, SecuritySchemeObject, ServerObject, ServerVariableObject, TagObject } from "./types.js";
5
5
  import { Config, OutputFile, generateFiles, generateFilesOnly } from "./generate-file.js";
6
- export { Awaitable, CallbackObject, Config, DistributiveOmit, Document, ExampleObject, HttpMethods, type MediaAdapter, MediaTypeObject, MethodInformation, OAuth2SecurityScheme, OperationObject, OperationOutput, OutputEntry, OutputFile, OutputGroup, PageOutput, PagesBuilder, PagesBuilderConfig, ParameterObject, PathItemObject, ReferenceObject, RenderContext, RequestBodyObject, ResponseObject, SchemaToPagesOptions, SecuritySchemeObject, ServerObject, ServerVariableObject, TagObject, WebhookOutput, createAutoPreset, fromSchema, fromServer, generateFiles, generateFilesOnly };
6
+ export { Awaitable, CallbackObject, Config, DistributiveOmit, Document, ExampleObject, HttpMethods, type MediaAdapter, MediaTypeObject, MethodInformation, OAuth2SecurityScheme, OperationObject, OperationOutput, OutputEntry, OutputFile, OutputGroup, PageOutput, PagesBuilder, PagesBuilderConfig, ParameterObject, PathItemObject, ReferenceObject, RenderContext, RequestBodyObject, ResponseObject, SchemaToPagesOptions, SecuritySchemeObject, ServerObject, ServerVariableObject, TagObject, WebhookOutput, createAutoPreset, fromSchema, fromServer, generateFiles, generateFilesOnly, getPageProps };
@@ -1,5 +1,5 @@
1
1
  import { Queue } from "../queue/queue.js";
2
- //#region ../../node_modules/.pnpm/@scalar+helpers@0.6.0/node_modules/@scalar/helpers/dist/general/create-limiter.js
2
+ //#region ../../node_modules/.pnpm/@scalar+helpers@0.8.0/node_modules/@scalar/helpers/dist/general/create-limiter.js
3
3
  /**
4
4
  * Creates a function that limits the number of concurrent executions of async functions.
5
5
  *
@@ -1,4 +1,4 @@
1
- //#region ../../node_modules/.pnpm/@scalar+helpers@0.6.0/node_modules/@scalar/helpers/dist/object/is-object.js
1
+ //#region ../../node_modules/.pnpm/@scalar+helpers@0.8.0/node_modules/@scalar/helpers/dist/object/is-object.js
2
2
  /**
3
3
  * Returns true if the provided value is a record object
4
4
  * (i.e. not null, not an array, and has an actual object as the prototype).
@@ -1,4 +1,4 @@
1
- //#region ../../node_modules/.pnpm/@scalar+helpers@0.6.0/node_modules/@scalar/helpers/dist/object/prevent-pollution.js
1
+ //#region ../../node_modules/.pnpm/@scalar+helpers@0.8.0/node_modules/@scalar/helpers/dist/object/prevent-pollution.js
2
2
  /**
3
3
  * Set of dangerous keys that can be used for prototype pollution attacks.
4
4
  * These keys should never be used as property names in dynamic object operations.
@@ -1,4 +1,4 @@
1
- //#region ../../node_modules/.pnpm/@scalar+helpers@0.6.0/node_modules/@scalar/helpers/dist/queue/queue.js
1
+ //#region ../../node_modules/.pnpm/@scalar+helpers@0.8.0/node_modules/@scalar/helpers/dist/queue/queue.js
2
2
  /**
3
3
  * Represents a node in a singly linked list structure, used internally by the Queue.
4
4
  *
@@ -1,4 +1,4 @@
1
- //#region ../../node_modules/.pnpm/@scalar+helpers@0.6.0/node_modules/@scalar/helpers/dist/string/generate-hash.js
1
+ //#region ../../node_modules/.pnpm/@scalar+helpers@0.8.0/node_modules/@scalar/helpers/dist/string/generate-hash.js
2
2
  /**
3
3
  * MurmurHash3 implementation
4
4
  *
@@ -1,4 +1,4 @@
1
- import { isObject } from "../../../../../../@scalar_helpers@0.6.0/node_modules/@scalar/helpers/dist/object/is-object.js";
1
+ import { isObject } from "../../../../../../@scalar_helpers@0.8.0/node_modules/@scalar/helpers/dist/object/is-object.js";
2
2
  import { convertToLocalRef } from "../helpers/convert-to-local-ref.js";
3
3
  import { getId, getSchemas } from "../helpers/get-schemas.js";
4
4
  import { getValueByPath } from "../helpers/get-value-by-path.js";
@@ -10,7 +10,7 @@ import { setValueAtPath } from "../helpers/set-value-at-path.js";
10
10
  import { toRelativePath } from "../helpers/to-relative-path.js";
11
11
  import { escapeJsonPointer } from "../helpers/escape-json-pointer.js";
12
12
  import { getHash, uniqueValueGeneratorFactory } from "./value-generator.js";
13
- //#region ../../node_modules/.pnpm/@scalar+json-magic@0.12.12/node_modules/@scalar/json-magic/dist/bundle/bundle.js
13
+ //#region ../../node_modules/.pnpm/@scalar+json-magic@0.12.14/node_modules/@scalar/json-magic/dist/bundle/bundle.js
14
14
  /** Type guard to check if a value is an object with a $ref property */
15
15
  const hasRef = (value) => isObject(value) && "$ref" in value && typeof value["$ref"] === "string";
16
16
  /**
@@ -1,7 +1,7 @@
1
1
  import { isHttpUrl } from "../../../helpers/is-http-url.js";
2
- import { createLimiter } from "../../../../../../../../@scalar_helpers@0.6.0/node_modules/@scalar/helpers/dist/general/create-limiter.js";
2
+ import { createLimiter } from "../../../../../../../../@scalar_helpers@0.8.0/node_modules/@scalar/helpers/dist/general/create-limiter.js";
3
3
  import { normalize } from "../../../helpers/normalize.js";
4
- //#region ../../node_modules/.pnpm/@scalar+json-magic@0.12.12/node_modules/@scalar/json-magic/dist/bundle/plugins/fetch-urls/index.js
4
+ //#region ../../node_modules/.pnpm/@scalar+json-magic@0.12.14/node_modules/@scalar/json-magic/dist/bundle/plugins/fetch-urls/index.js
5
5
  /**
6
6
  * Safely checks for host from a URL
7
7
  * Needed because we cannot create a URL from a relative remote URL ex: examples/openapi.json
@@ -1,6 +1,6 @@
1
1
  import { isFilePath } from "../../../helpers/is-file-path.js";
2
2
  import { normalize } from "../../../helpers/normalize.js";
3
- //#region ../../node_modules/.pnpm/@scalar+json-magic@0.12.12/node_modules/@scalar/json-magic/dist/bundle/plugins/read-files/index.js
3
+ //#region ../../node_modules/.pnpm/@scalar+json-magic@0.12.14/node_modules/@scalar/json-magic/dist/bundle/plugins/read-files/index.js
4
4
  /**
5
5
  * Reads and normalizes data from a local file
6
6
  * @param path - The file path to read from
@@ -1,5 +1,5 @@
1
- import { generateHash } from "../../../../../../@scalar_helpers@0.6.0/node_modules/@scalar/helpers/dist/string/generate-hash.js";
2
- //#region ../../node_modules/.pnpm/@scalar+json-magic@0.12.12/node_modules/@scalar/json-magic/dist/bundle/value-generator.js
1
+ import { generateHash } from "../../../../../../@scalar_helpers@0.8.0/node_modules/@scalar/helpers/dist/string/generate-hash.js";
2
+ //#region ../../node_modules/.pnpm/@scalar+json-magic@0.12.14/node_modules/@scalar/json-magic/dist/bundle/value-generator.js
3
3
  /**
4
4
  * Generates a short hash from a string value using xxhash.
5
5
  *
@@ -1,4 +1,4 @@
1
- //#region ../../node_modules/.pnpm/@scalar+json-magic@0.12.12/node_modules/@scalar/json-magic/dist/helpers/convert-to-local-ref.js
1
+ //#region ../../node_modules/.pnpm/@scalar+json-magic@0.12.14/node_modules/@scalar/json-magic/dist/helpers/convert-to-local-ref.js
2
2
  /**
3
3
  * Translates a JSON Reference ($ref) to a local object path within the root schema.
4
4
  *
@@ -1,4 +1,4 @@
1
- //#region ../../node_modules/.pnpm/@scalar+json-magic@0.12.12/node_modules/@scalar/json-magic/dist/helpers/escape-json-pointer.js
1
+ //#region ../../node_modules/.pnpm/@scalar+json-magic@0.12.14/node_modules/@scalar/json-magic/dist/helpers/escape-json-pointer.js
2
2
  /**
3
3
  * Escapes a JSON pointer string.
4
4
  *
@@ -1,4 +1,4 @@
1
- //#region ../../node_modules/.pnpm/@scalar+json-magic@0.12.12/node_modules/@scalar/json-magic/dist/helpers/get-schemas.js
1
+ //#region ../../node_modules/.pnpm/@scalar+json-magic@0.12.14/node_modules/@scalar/json-magic/dist/helpers/get-schemas.js
2
2
  /**
3
3
  * Retrieves the $id property from the input object if it exists and is a string.
4
4
  *
@@ -1,5 +1,5 @@
1
1
  import { unescapeJsonPointer } from "./unescape-json-pointer.js";
2
- //#region ../../node_modules/.pnpm/@scalar+json-magic@0.12.12/node_modules/@scalar/json-magic/dist/helpers/get-segments-from-path.js
2
+ //#region ../../node_modules/.pnpm/@scalar+json-magic@0.12.14/node_modules/@scalar/json-magic/dist/helpers/get-segments-from-path.js
3
3
  /**
4
4
  * Translate `/paths/~1test` to `['paths', '/test']`
5
5
  */
@@ -1,5 +1,5 @@
1
1
  import { getId } from "./get-schemas.js";
2
- //#region ../../node_modules/.pnpm/@scalar+json-magic@0.12.12/node_modules/@scalar/json-magic/dist/helpers/get-value-by-path.js
2
+ //#region ../../node_modules/.pnpm/@scalar+json-magic@0.12.14/node_modules/@scalar/json-magic/dist/helpers/get-value-by-path.js
3
3
  /**
4
4
  * Traverses an object using an array of string segments (path keys) and returns
5
5
  * the value at the specified path along with its context (id if available).
@@ -1,7 +1,7 @@
1
1
  import { isHttpUrl } from "./is-http-url.js";
2
2
  import { isJsonObject } from "./is-json-object.js";
3
3
  import { isYaml } from "./is-yaml.js";
4
- //#region ../../node_modules/.pnpm/@scalar+json-magic@0.12.12/node_modules/@scalar/json-magic/dist/helpers/is-file-path.js
4
+ //#region ../../node_modules/.pnpm/@scalar+json-magic@0.12.14/node_modules/@scalar/json-magic/dist/helpers/is-file-path.js
5
5
  /**
6
6
  * Checks if a string represents a file path by ensuring it's not a remote URL,
7
7
  * YAML content, or JSON content.
@@ -1,4 +1,4 @@
1
- //#region ../../node_modules/.pnpm/@scalar+json-magic@0.12.12/node_modules/@scalar/json-magic/dist/helpers/is-http-url.js
1
+ //#region ../../node_modules/.pnpm/@scalar+json-magic@0.12.14/node_modules/@scalar/json-magic/dist/helpers/is-http-url.js
2
2
  /**
3
3
  * Checks if a string is a remote URL (starts with http:// or https://)
4
4
  * @param value - The URL string to check
@@ -1,5 +1,5 @@
1
- import { isObject } from "../../../../../../@scalar_helpers@0.6.0/node_modules/@scalar/helpers/dist/object/is-object.js";
2
- //#region ../../node_modules/.pnpm/@scalar+json-magic@0.12.12/node_modules/@scalar/json-magic/dist/helpers/is-json-object.js
1
+ import { isObject } from "../../../../../../@scalar_helpers@0.8.0/node_modules/@scalar/helpers/dist/object/is-object.js";
2
+ //#region ../../node_modules/.pnpm/@scalar+json-magic@0.12.14/node_modules/@scalar/json-magic/dist/helpers/is-json-object.js
3
3
  /**
4
4
  * Determines if a string represents a valid JSON object (i.e., a plain object, not an array, primitive, or null).
5
5
  * The function first checks if the string appears to start with an opening curly brace (ignoring leading whitespace),
@@ -1,4 +1,4 @@
1
- //#region ../../node_modules/.pnpm/@scalar+json-magic@0.12.12/node_modules/@scalar/json-magic/dist/helpers/is-yaml.js
1
+ //#region ../../node_modules/.pnpm/@scalar+json-magic@0.12.14/node_modules/@scalar/json-magic/dist/helpers/is-yaml.js
2
2
  /**
3
3
  * Checks if a string appears to be YAML content.
4
4
  * This function uses a simple heuristic: it looks for a line that starts with an optional dash,
@@ -0,0 +1,33 @@
1
+ import { parse } from "../../../../../../yaml@2.9.0/node_modules/yaml/browser/dist/public-api.js";
2
+ import "../../../../../../yaml@2.9.0/node_modules/yaml/browser/index.js";
3
+ //#region ../../node_modules/.pnpm/@scalar+json-magic@0.12.14/node_modules/@scalar/json-magic/dist/helpers/normalize.js
4
+ /**
5
+ * Strip a leading UTF-8 BOM (U+FEFF). Editors on Windows often write this
6
+ * prefix; {@link JSON.parse} rejects it as an unexpected token.
7
+ */
8
+ const stripLeadingUtf8Bom = (value) => value.startsWith("") ? value.slice(1) : value;
9
+ /**
10
+ * Normalize a string (YAML, JSON, object) to a JavaScript datatype.
11
+ */
12
+ function normalize(content) {
13
+ if (content === null) return;
14
+ if (typeof content === "string") {
15
+ const withoutBom = stripLeadingUtf8Bom(content);
16
+ if (withoutBom.trim() === "") return;
17
+ try {
18
+ return JSON.parse(withoutBom);
19
+ } catch {
20
+ const hasColon = /^[^:]+:/.test(withoutBom);
21
+ const trimmedStart = withoutBom.slice(0, 50).trimStart();
22
+ const looksLikeJson = trimmedStart.startsWith("{") || trimmedStart.startsWith("[");
23
+ if (!hasColon || looksLikeJson) return;
24
+ return parse(withoutBom, {
25
+ maxAliasCount: 1e4,
26
+ merge: true
27
+ });
28
+ }
29
+ }
30
+ return content;
31
+ }
32
+ //#endregion
33
+ export { normalize };
@@ -1,6 +1,6 @@
1
1
  import { isHttpUrl } from "./is-http-url.js";
2
2
  import { posix } from "../../../../../../pathe@2.0.3/node_modules/pathe/dist/index.js";
3
- //#region ../../node_modules/.pnpm/@scalar+json-magic@0.12.12/node_modules/@scalar/json-magic/dist/helpers/resolve-reference-path.js
3
+ //#region ../../node_modules/.pnpm/@scalar+json-magic@0.12.14/node_modules/@scalar/json-magic/dist/helpers/resolve-reference-path.js
4
4
  /**
5
5
  * Resolves a reference path by combining a base path with a relative path.
6
6
  * Handles both remote URLs and local file paths.
@@ -1,6 +1,6 @@
1
- import { preventPollution } from "../../../../../../@scalar_helpers@0.6.0/node_modules/@scalar/helpers/dist/object/prevent-pollution.js";
1
+ import { preventPollution } from "../../../../../../@scalar_helpers@0.8.0/node_modules/@scalar/helpers/dist/object/prevent-pollution.js";
2
2
  import { getSegmentsFromPath } from "./get-segments-from-path.js";
3
- //#region ../../node_modules/.pnpm/@scalar+json-magic@0.12.12/node_modules/@scalar/json-magic/dist/helpers/set-value-at-path.js
3
+ //#region ../../node_modules/.pnpm/@scalar+json-magic@0.12.14/node_modules/@scalar/json-magic/dist/helpers/set-value-at-path.js
4
4
  /**
5
5
  * Sets a value at a specified path in an object, creating intermediate objects/arrays as needed.
6
6
  * This function traverses the object structure and creates any missing intermediate objects
@@ -1,6 +1,6 @@
1
1
  import { isHttpUrl } from "./is-http-url.js";
2
2
  import { posix } from "../../../../../../pathe@2.0.3/node_modules/pathe/dist/index.js";
3
- //#region ../../node_modules/.pnpm/@scalar+json-magic@0.12.12/node_modules/@scalar/json-magic/dist/helpers/to-relative-path.js
3
+ //#region ../../node_modules/.pnpm/@scalar+json-magic@0.12.14/node_modules/@scalar/json-magic/dist/helpers/to-relative-path.js
4
4
  /**
5
5
  * Converts an input path or URL to a relative path based on the provided base.
6
6
  * Handles both remote URLs and local file system paths.
@@ -1,4 +1,4 @@
1
- //#region ../../node_modules/.pnpm/@scalar+json-magic@0.12.12/node_modules/@scalar/json-magic/dist/helpers/unescape-json-pointer.js
1
+ //#region ../../node_modules/.pnpm/@scalar+json-magic@0.12.14/node_modules/@scalar/json-magic/dist/helpers/unescape-json-pointer.js
2
2
  /**
3
3
  * Unescape JSON pointer
4
4
  *
@@ -1,6 +1,6 @@
1
1
  "use client";
2
- import { joinURL, resolveRequestData, resolveServerUrl, withBase } from "../utils/url.js";
3
2
  import { getPreferredType } from "../utils/schema/index.js";
3
+ import { joinURL, resolveRequestData, resolveServerUrl, withBase } from "../utils/url.js";
4
4
  import { useStorageKey } from "../ui/client/storage-key.js";
5
5
  import { useApiContext, useServerContext } from "../ui/contexts/api.js";
6
6
  import { useTranslations } from "../ui/client/i18n.js";
@@ -138,7 +138,7 @@ function Content({ schemeId, scopes, setToken, setOpen }) {
138
138
  /* @__PURE__ */ jsxs(Select, {
139
139
  value: type ?? "",
140
140
  onValueChange: setType,
141
- children: [/* @__PURE__ */ jsx(SelectTrigger, { children: /* @__PURE__ */ jsx(SelectValue, { placeholder: "Select a flow" }) }), /* @__PURE__ */ jsx(SelectContent, { children: Object.keys(scheme.flows).map((key) => {
141
+ children: [/* @__PURE__ */ jsx(SelectTrigger, { children: /* @__PURE__ */ jsx(SelectValue, { placeholder: t.oauthFlowPlaceholder }) }), /* @__PURE__ */ jsx(SelectContent, { children: Object.keys(scheme.flows).map((key) => {
142
142
  const { name, description } = allFlows[key];
143
143
  return /* @__PURE__ */ jsxs(SelectItem, {
144
144
  value: key,
@@ -1,5 +1,5 @@
1
1
  "use client";
2
- import { useTranslations, withReplacements } from "../../ui/client/i18n.js";
2
+ import { useTranslations } from "../../ui/client/i18n.js";
3
3
  import { useStatusInfo } from "../status-info.js";
4
4
  import { cn } from "../../utils/cn.js";
5
5
  import { ClientCodeBlock } from "../../ui/components/codeblock.js";
@@ -7,6 +7,7 @@ import { require_fast_content_type_parse } from "../../node_modules/.pnpm/fast-c
7
7
  import { useEffect, useMemo, useState } from "react";
8
8
  import { jsx, jsxs } from "react/jsx-runtime";
9
9
  import { CircleX } from "lucide-react";
10
+ import { renderTranslation } from "fumadocs-core/i18n";
10
11
  import { buttonVariants } from "fumadocs-ui/components/ui/button";
11
12
  import { cva } from "class-variance-authority";
12
13
  //#region src/playground/components/result-display.tsx
@@ -76,7 +77,7 @@ function ResponseResult({ data, reset, ...rest }) {
76
77
  });
77
78
  else content = /* @__PURE__ */ jsx("p", {
78
79
  className: "p-2 border rounded-lg bg-fd-card text-fd-card-foreground",
79
- children: withReplacements(t.statusBinaryBody, { length: String(data.body.byteLength) })
80
+ children: renderTranslation(t.statusBinaryBody, { length: String(data.body.byteLength) })
80
81
  });
81
82
  }
82
83
  return /* @__PURE__ */ jsxs("div", {
@@ -1,3 +1,4 @@
1
+ import { useTranslations } from "../../ui/client/i18n.js";
1
2
  import { cn } from "../../utils/cn.js";
2
3
  import { jsx } from "react/jsx-runtime";
3
4
  import { Loader2Icon } from "lucide-react";
@@ -5,7 +6,7 @@ import { Loader2Icon } from "lucide-react";
5
6
  function Spinner({ className, ...props }) {
6
7
  return /* @__PURE__ */ jsx(Loader2Icon, {
7
8
  role: "status",
8
- "aria-label": "Loading",
9
+ "aria-label": useTranslations().loading,
9
10
  className: cn("size-4 animate-spin", className),
10
11
  ...props
11
12
  });