fumadocs-openapi 10.10.3 → 11.0.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 (234) hide show
  1. package/css/generated/shared.css +1 -1159
  2. package/css/preset.css +1 -0
  3. package/dist/.translations/index.d.ts +80 -0
  4. package/dist/.translations/keys.js +80 -0
  5. package/dist/_virtual/_rolldown/runtime.js +1 -10
  6. package/dist/generate-file.d.ts +0 -4
  7. package/dist/generate-file.js +4 -5
  8. package/dist/i18n.d.ts +5 -100
  9. package/dist/i18n.js +8 -108
  10. package/dist/index.d.ts +4 -4
  11. package/dist/node_modules/.pnpm/{@scalar_openapi-upgrader@0.2.8 → @scalar_openapi-upgrader@0.2.9}/node_modules/@scalar/openapi-upgrader/dist/2.0-to-3.0/upgrade-from-two-to-three.js +1 -1
  12. package/dist/node_modules/.pnpm/{@scalar_openapi-upgrader@0.2.8 → @scalar_openapi-upgrader@0.2.9}/node_modules/@scalar/openapi-upgrader/dist/3.0-to-3.1/upgrade-from-three-to-three-one.js +1 -1
  13. package/dist/node_modules/.pnpm/{@scalar_openapi-upgrader@0.2.8 → @scalar_openapi-upgrader@0.2.9}/node_modules/@scalar/openapi-upgrader/dist/3.1-to-3.2/upgrade-from-three-one-to-three-two.js +1 -1
  14. package/dist/node_modules/.pnpm/{@scalar_openapi-upgrader@0.2.8 → @scalar_openapi-upgrader@0.2.9}/node_modules/@scalar/openapi-upgrader/dist/helpers/traverse.js +1 -1
  15. package/dist/node_modules/.pnpm/{@scalar_openapi-upgrader@0.2.8 → @scalar_openapi-upgrader@0.2.9}/node_modules/@scalar/openapi-upgrader/dist/upgrade.js +1 -1
  16. package/dist/playground/auth.js +4 -4
  17. package/dist/playground/client.d.ts +12 -21
  18. package/dist/playground/client.js +80 -59
  19. package/dist/playground/components/oauth-dialog.js +33 -33
  20. package/dist/playground/components/result-display.d.ts +1 -2
  21. package/dist/playground/components/result-display.js +7 -8
  22. package/dist/playground/components/server-select.js +11 -11
  23. package/dist/playground/status-info.js +29 -37
  24. package/dist/requests/generators/csharp.js +3 -3
  25. package/dist/requests/generators/curl.js +2 -2
  26. package/dist/requests/generators/go.js +2 -2
  27. package/dist/requests/generators/index.d.ts +28 -41
  28. package/dist/requests/generators/index.js +18 -35
  29. package/dist/requests/generators/java.js +2 -2
  30. package/dist/requests/generators/javascript.js +2 -2
  31. package/dist/requests/generators/python.js +2 -2
  32. package/dist/scalar/client.js +3 -2
  33. package/dist/scalar/index.d.ts +2 -2
  34. package/dist/scalar/index.js +10 -9
  35. package/dist/server/index.d.ts +23 -27
  36. package/dist/server/index.js +42 -38
  37. package/dist/server/proxy.d.ts +0 -6
  38. package/dist/server/proxy.js +2 -4
  39. package/dist/{_openapi/types.d.ts → types/openapi.d.ts} +127 -136
  40. package/dist/types.d.ts +14 -18
  41. package/dist/ui/base.d.ts +15 -162
  42. package/dist/ui/base.js +148 -107
  43. package/dist/ui/components/codeblock.js +6 -14
  44. package/dist/ui/components/heading.js +8 -4
  45. package/dist/ui/components/markdown.js +12 -0
  46. package/dist/ui/contexts/api.js +8 -26
  47. package/dist/ui/index.d.ts +204 -7
  48. package/dist/ui/index.js +10 -15
  49. package/dist/ui/operation/context.js +48 -0
  50. package/dist/ui/operation/index.js +168 -126
  51. package/dist/ui/operation/request-tabs.d.ts +10 -5
  52. package/dist/ui/operation/request-tabs.js +35 -22
  53. package/dist/ui/operation/response-tabs.d.ts +5 -2
  54. package/dist/ui/operation/response-tabs.js +22 -15
  55. package/dist/ui/operation/usage-tabs.js +144 -0
  56. package/dist/utils/document/dereference.d.ts +1 -1
  57. package/dist/utils/document/dereference.js +5 -8
  58. package/dist/utils/document/load.js +17 -0
  59. package/dist/utils/get-example-requests.d.ts +13 -0
  60. package/dist/{ui/operation → utils}/get-example-requests.js +31 -20
  61. package/dist/utils/pages/builder.d.ts +38 -10
  62. package/dist/utils/pages/builder.js +12 -10
  63. package/dist/utils/pages/preset-auto.d.ts +1 -2
  64. package/dist/utils/pages/preset-auto.js +15 -15
  65. package/dist/utils/pages/to-static-data.js +5 -4
  66. package/dist/utils/pages/to-text.d.ts +1 -0
  67. package/dist/utils/pages/to-text.js +21 -11
  68. package/dist/utils/remove-undefined.js +14 -9
  69. package/dist/utils/schema.d.ts +2 -0
  70. package/dist/utils/{schema/index.js → schema.js} +3 -30
  71. package/dist/{ui/client → utils}/storage-key.js +3 -3
  72. package/package.json +15 -28
  73. package/dist/node_modules/.pnpm/@apidevtools_json-schema-ref-parser@15.3.5_@types_json-schema@7.0.15/node_modules/@apidevtools/json-schema-ref-parser/dist/lib/bundle.js +0 -239
  74. package/dist/node_modules/.pnpm/@apidevtools_json-schema-ref-parser@15.3.5_@types_json-schema@7.0.15/node_modules/@apidevtools/json-schema-ref-parser/dist/lib/dereference.js +0 -187
  75. package/dist/node_modules/.pnpm/@apidevtools_json-schema-ref-parser@15.3.5_@types_json-schema@7.0.15/node_modules/@apidevtools/json-schema-ref-parser/dist/lib/index.js +0 -136
  76. package/dist/node_modules/.pnpm/@apidevtools_json-schema-ref-parser@15.3.5_@types_json-schema@7.0.15/node_modules/@apidevtools/json-schema-ref-parser/dist/lib/normalize-args.js +0 -41
  77. package/dist/node_modules/.pnpm/@apidevtools_json-schema-ref-parser@15.3.5_@types_json-schema@7.0.15/node_modules/@apidevtools/json-schema-ref-parser/dist/lib/options.js +0 -124
  78. package/dist/node_modules/.pnpm/@apidevtools_json-schema-ref-parser@15.3.5_@types_json-schema@7.0.15/node_modules/@apidevtools/json-schema-ref-parser/dist/lib/parse.js +0 -109
  79. package/dist/node_modules/.pnpm/@apidevtools_json-schema-ref-parser@15.3.5_@types_json-schema@7.0.15/node_modules/@apidevtools/json-schema-ref-parser/dist/lib/parsers/binary.js +0 -30
  80. package/dist/node_modules/.pnpm/@apidevtools_json-schema-ref-parser@15.3.5_@types_json-schema@7.0.15/node_modules/@apidevtools/json-schema-ref-parser/dist/lib/parsers/json.js +0 -46
  81. package/dist/node_modules/.pnpm/@apidevtools_json-schema-ref-parser@15.3.5_@types_json-schema@7.0.15/node_modules/@apidevtools/json-schema-ref-parser/dist/lib/parsers/text.js +0 -36
  82. package/dist/node_modules/.pnpm/@apidevtools_json-schema-ref-parser@15.3.5_@types_json-schema@7.0.15/node_modules/@apidevtools/json-schema-ref-parser/dist/lib/parsers/yaml.js +0 -49
  83. package/dist/node_modules/.pnpm/@apidevtools_json-schema-ref-parser@15.3.5_@types_json-schema@7.0.15/node_modules/@apidevtools/json-schema-ref-parser/dist/lib/pointer.js +0 -242
  84. package/dist/node_modules/.pnpm/@apidevtools_json-schema-ref-parser@15.3.5_@types_json-schema@7.0.15/node_modules/@apidevtools/json-schema-ref-parser/dist/lib/ref.js +0 -247
  85. package/dist/node_modules/.pnpm/@apidevtools_json-schema-ref-parser@15.3.5_@types_json-schema@7.0.15/node_modules/@apidevtools/json-schema-ref-parser/dist/lib/refs.js +0 -210
  86. package/dist/node_modules/.pnpm/@apidevtools_json-schema-ref-parser@15.3.5_@types_json-schema@7.0.15/node_modules/@apidevtools/json-schema-ref-parser/dist/lib/resolve-external.js +0 -100
  87. package/dist/node_modules/.pnpm/@apidevtools_json-schema-ref-parser@15.3.5_@types_json-schema@7.0.15/node_modules/@apidevtools/json-schema-ref-parser/dist/lib/resolvers/file.js +0 -41
  88. package/dist/node_modules/.pnpm/@apidevtools_json-schema-ref-parser@15.3.5_@types_json-schema@7.0.15/node_modules/@apidevtools/json-schema-ref-parser/dist/lib/resolvers/http.js +0 -112
  89. package/dist/node_modules/.pnpm/@apidevtools_json-schema-ref-parser@15.3.5_@types_json-schema@7.0.15/node_modules/@apidevtools/json-schema-ref-parser/dist/lib/util/convert-path-to-posix.js +0 -8
  90. package/dist/node_modules/.pnpm/@apidevtools_json-schema-ref-parser@15.3.5_@types_json-schema@7.0.15/node_modules/@apidevtools/json-schema-ref-parser/dist/lib/util/errors.js +0 -146
  91. package/dist/node_modules/.pnpm/@apidevtools_json-schema-ref-parser@15.3.5_@types_json-schema@7.0.15/node_modules/@apidevtools/json-schema-ref-parser/dist/lib/util/is-windows.js +0 -5
  92. package/dist/node_modules/.pnpm/@apidevtools_json-schema-ref-parser@15.3.5_@types_json-schema@7.0.15/node_modules/@apidevtools/json-schema-ref-parser/dist/lib/util/maybe.js +0 -18
  93. package/dist/node_modules/.pnpm/@apidevtools_json-schema-ref-parser@15.3.5_@types_json-schema@7.0.15/node_modules/@apidevtools/json-schema-ref-parser/dist/lib/util/next.js +0 -11
  94. package/dist/node_modules/.pnpm/@apidevtools_json-schema-ref-parser@15.3.5_@types_json-schema@7.0.15/node_modules/@apidevtools/json-schema-ref-parser/dist/lib/util/plugins.js +0 -99
  95. package/dist/node_modules/.pnpm/@apidevtools_json-schema-ref-parser@15.3.5_@types_json-schema@7.0.15/node_modules/@apidevtools/json-schema-ref-parser/dist/lib/util/schema-resources.js +0 -30
  96. package/dist/node_modules/.pnpm/@apidevtools_json-schema-ref-parser@15.3.5_@types_json-schema@7.0.15/node_modules/@apidevtools/json-schema-ref-parser/dist/lib/util/url.js +0 -315
  97. package/dist/node_modules/.pnpm/@fastify_deepmerge@3.2.1/node_modules/@fastify/deepmerge/index.js +0 -108
  98. package/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/2020.js +0 -110
  99. package/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/compile/codegen/code.js +0 -138
  100. package/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/compile/codegen/index.js +0 -674
  101. package/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/compile/codegen/scope.js +0 -141
  102. package/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/compile/errors.js +0 -102
  103. package/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/compile/index.js +0 -223
  104. package/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/compile/names.js +0 -28
  105. package/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/compile/ref_error.js +0 -18
  106. package/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/compile/resolve.js +0 -133
  107. package/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/compile/rules.js +0 -61
  108. package/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/compile/util.js +0 -146
  109. package/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/compile/validate/applicability.js +0 -23
  110. package/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/compile/validate/boolSchema.js +0 -48
  111. package/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/compile/validate/dataType.js +0 -172
  112. package/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/compile/validate/defaults.js +0 -31
  113. package/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/compile/validate/index.js +0 -433
  114. package/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/compile/validate/keyword.js +0 -113
  115. package/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/compile/validate/subschema.js +0 -72
  116. package/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/core.js +0 -583
  117. package/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/refs/data.js +0 -18
  118. package/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/refs/json-schema-2020-12/index.js +0 -42
  119. package/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/refs/json-schema-2020-12/meta/applicator.js +0 -50
  120. package/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/refs/json-schema-2020-12/meta/content.js +0 -20
  121. package/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/refs/json-schema-2020-12/meta/core.js +0 -51
  122. package/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/refs/json-schema-2020-12/meta/format-annotation.js +0 -16
  123. package/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/refs/json-schema-2020-12/meta/meta-data.js +0 -36
  124. package/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/refs/json-schema-2020-12/meta/unevaluated.js +0 -19
  125. package/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/refs/json-schema-2020-12/meta/validation.js +0 -85
  126. package/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/refs/json-schema-2020-12/schema.js +0 -59
  127. package/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/runtime/equal.js +0 -12
  128. package/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/runtime/ucs2length.js +0 -25
  129. package/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/runtime/uri.js +0 -12
  130. package/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/runtime/validation_error.js +0 -16
  131. package/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/applicator/additionalItems.js +0 -57
  132. package/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/applicator/additionalProperties.js +0 -96
  133. package/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/applicator/allOf.js +0 -29
  134. package/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/applicator/anyOf.js +0 -16
  135. package/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/applicator/contains.js +0 -89
  136. package/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/applicator/dependencies.js +0 -87
  137. package/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/applicator/dependentSchemas.js +0 -16
  138. package/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/applicator/if.js +0 -62
  139. package/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/applicator/index.js +0 -60
  140. package/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/applicator/items.js +0 -59
  141. package/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/applicator/items2020.js +0 -34
  142. package/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/applicator/not.js +0 -31
  143. package/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/applicator/oneOf.js +0 -51
  144. package/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/applicator/patternProperties.js +0 -61
  145. package/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/applicator/prefixItems.js +0 -17
  146. package/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/applicator/properties.js +0 -52
  147. package/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/applicator/propertyNames.js +0 -41
  148. package/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/applicator/thenElse.js +0 -17
  149. package/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/code.js +0 -130
  150. package/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/core/id.js +0 -14
  151. package/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/core/index.js +0 -22
  152. package/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/core/ref.js +0 -112
  153. package/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/discriminator/index.js +0 -101
  154. package/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/discriminator/types.js +0 -14
  155. package/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/draft2020.js +0 -35
  156. package/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/dynamic/dynamicAnchor.js +0 -46
  157. package/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/dynamic/dynamicRef.js +0 -45
  158. package/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/dynamic/index.js +0 -22
  159. package/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/dynamic/recursiveAnchor.js +0 -20
  160. package/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/dynamic/recursiveRef.js +0 -15
  161. package/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/format/format.js +0 -92
  162. package/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/format/index.js +0 -10
  163. package/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/metadata.js +0 -23
  164. package/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/next.js +0 -19
  165. package/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/unevaluated/index.js +0 -13
  166. package/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/unevaluated/unevaluatedItems.js +0 -46
  167. package/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/unevaluated/unevaluatedProperties.js +0 -59
  168. package/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/validation/const.js +0 -27
  169. package/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/validation/dependentRequired.js +0 -17
  170. package/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/validation/enum.js +0 -49
  171. package/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/validation/index.js +0 -48
  172. package/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/validation/limitContains.js +0 -18
  173. package/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/validation/limitItems.js +0 -28
  174. package/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/validation/limitLength.js +0 -33
  175. package/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/validation/limitNumber.js +0 -47
  176. package/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/validation/limitProperties.js +0 -28
  177. package/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/validation/multipleOf.js +0 -27
  178. package/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/validation/pattern.js +0 -38
  179. package/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/validation/required.js +0 -72
  180. package/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/validation/uniqueItems.js +0 -70
  181. package/dist/node_modules/.pnpm/fast-deep-equal@3.1.3/node_modules/fast-deep-equal/index.js +0 -33
  182. package/dist/node_modules/.pnpm/fast-uri@3.1.0/node_modules/fast-uri/index.js +0 -236
  183. package/dist/node_modules/.pnpm/fast-uri@3.1.0/node_modules/fast-uri/lib/schemes.js +0 -187
  184. package/dist/node_modules/.pnpm/fast-uri@3.1.0/node_modules/fast-uri/lib/utils.js +0 -282
  185. package/dist/node_modules/.pnpm/json-schema-traverse@1.0.0/node_modules/json-schema-traverse/index.js +0 -78
  186. package/dist/playground/components/inputs.js +0 -419
  187. package/dist/playground/components/spinner.js +0 -15
  188. package/dist/playground/schema.d.ts +0 -15
  189. package/dist/playground/schema.js +0 -144
  190. package/dist/ui/api-page.d.ts +0 -31
  191. package/dist/ui/api-page.js +0 -59
  192. package/dist/ui/client/boundary.d.ts +0 -11
  193. package/dist/ui/client/boundary.js +0 -17
  194. package/dist/ui/client/boundary.lazy.js +0 -19
  195. package/dist/ui/client/full.js +0 -13
  196. package/dist/ui/client/i18n.js +0 -16
  197. package/dist/ui/client/index.d.ts +0 -42
  198. package/dist/ui/client/index.js +0 -7
  199. package/dist/ui/components/accordion.js +0 -67
  200. package/dist/ui/components/codeblock.d.ts +0 -14
  201. package/dist/ui/components/dialog.js +0 -56
  202. package/dist/ui/components/input.js +0 -17
  203. package/dist/ui/components/select-tab.js +0 -56
  204. package/dist/ui/components/select.js +0 -71
  205. package/dist/ui/contexts/api.d.ts +0 -29
  206. package/dist/ui/create-client.d.ts +0 -26
  207. package/dist/ui/create-client.js +0 -125
  208. package/dist/ui/operation/client.js +0 -78
  209. package/dist/ui/operation/get-example-requests.d.ts +0 -11
  210. package/dist/ui/operation/usage-tabs/client.d.ts +0 -14
  211. package/dist/ui/operation/usage-tabs/client.js +0 -91
  212. package/dist/ui/operation/usage-tabs/index.js +0 -54
  213. package/dist/ui/schema/client.d.ts +0 -18
  214. package/dist/ui/schema/client.js +0 -410
  215. package/dist/ui/schema/index.d.ts +0 -61
  216. package/dist/ui/schema/index.js +0 -256
  217. package/dist/utils/auto-anchor.client.js +0 -20
  218. package/dist/utils/auto-anchor.js +0 -17
  219. package/dist/utils/deep-equal.js +0 -21
  220. package/dist/utils/document/process.d.ts +0 -6
  221. package/dist/utils/document/process.js +0 -18
  222. package/dist/utils/id-to-title.js +0 -12
  223. package/dist/utils/is-plain-object.js +0 -8
  224. package/dist/utils/merge-refs.js +0 -11
  225. package/dist/utils/schema/dereference.js +0 -45
  226. package/dist/utils/schema/index.d.ts +0 -18
  227. package/dist/utils/schema/merge.js +0 -156
  228. package/dist/utils/schema/pick.js +0 -44
  229. package/dist/utils/schema/ref.js +0 -35
  230. package/dist/utils/schema/resolve-ref.js +0 -11
  231. package/dist/utils/schema/sample.js +0 -442
  232. package/dist/utils/schema/to-string.d.ts +0 -1
  233. package/dist/utils/schema/to-string.js +0 -53
  234. package/dist/utils/url.js +0 -39
package/css/preset.css CHANGED
@@ -1 +1,2 @@
1
1
  @import './generated/shared.css';
2
+ @import '@fumadocs/api-docs/css/preset.css';
@@ -0,0 +1,80 @@
1
+ //#region src/.translations/index.d.ts
2
+ type Translations = {
3
+ "Access Token(playground)": string;
4
+ "Authenticate using username and password.(OAuth dialog)": string;
5
+ "Authenticate with 3rd party services(OAuth dialog)": string;
6
+ "Authenticate with device.(OAuth dialog)": string;
7
+ "Authorization code(OAuth dialog)": string;
8
+ "Authorization(OAuth dialog)": string;
9
+ "Authorization(operation page)": string;
10
+ "Authorization(playground)": string;
11
+ "Authorization(security scheme)": string;
12
+ "Authorize(playground)": string;
13
+ "Bad Request(playground status info)": string;
14
+ "Basic <token>(security scheme)": string;
15
+ "Bearer <token>(security scheme)": string;
16
+ "Binary response body, {length} bytes(playground result display)": string;
17
+ "Body(playground)": string;
18
+ "Callbacks(operation page)": string;
19
+ "Client Credentials(OAuth dialog)": string;
20
+ "Client Error(playground result display)": string;
21
+ "Client ID(OAuth dialog)": string;
22
+ "Client Secret(OAuth dialog)": string;
23
+ "Close JSON Editor(playground)": string;
24
+ "Close(playground result display)": string;
25
+ "Cookie Parameters(operation page)": string;
26
+ "Cookies(playground)": string;
27
+ "Copy(TypeScript definitions)": string;
28
+ "Default(operation page)": string;
29
+ "Deprecated(operation page)": string;
30
+ "Deprecated(security scheme)": string;
31
+ "Device Authorization(OAuth dialog)": string;
32
+ "Empty(operation page)": string;
33
+ "Enter Value(playground server select)": string;
34
+ "Enter value(OAuth dialog)": string;
35
+ "Error(playground status info)": string;
36
+ "Example Requests(operation page)": string;
37
+ "Example {key}(operation page)": string;
38
+ "Example(operation page)": string;
39
+ "Failed to fetch token(playground)": string;
40
+ "Fetching token...(playground)": string;
41
+ "Forbidden(playground status info)": string;
42
+ "Header Parameters(operation page)": string;
43
+ "Header(playground)": string;
44
+ "Implicit(OAuth dialog)": string;
45
+ "In(security scheme)": string;
46
+ "Intended for the server-to-server authentication.(OAuth dialog)": string;
47
+ "Internal Server Error(playground status info)": string;
48
+ "Not Found(playground status info)": string;
49
+ "Obtain the access token for API.(OAuth dialog)": string;
50
+ "Open JSON Editor(playground)": string;
51
+ "OpenID Connect is not supported at the moment, you can still set an access token here.(playground)": string;
52
+ "OpenID Connect(security scheme)": string;
53
+ "Password(OAuth dialog)": string;
54
+ "Path Parameters(operation page)": string;
55
+ "Path(playground)": string;
56
+ "Query Parameters(operation page)": string;
57
+ "Query(playground)": string;
58
+ "Request Body(operation page)": string;
59
+ "Resource Owner Password Flow(OAuth dialog)": string;
60
+ "Response Body(operation page)": string;
61
+ "Retrieve the access token directly.(OAuth dialog)": string;
62
+ "Scope(security scheme)": string;
63
+ "Select a flow(OAuth dialog)": string;
64
+ "Send(playground)": string;
65
+ "Server URL(playground server select)": string;
66
+ "Submit(OAuth dialog)": string;
67
+ "Successful(playground status info)": string;
68
+ "Test(scalar API client)": string;
69
+ "The base URL of your API endpoint.(playground server select)": string;
70
+ "The client ID of your OAuth application.(OAuth dialog)": string;
71
+ "The client secret of your OAuth application.(OAuth dialog)": string;
72
+ "TypeScript Definitions(TypeScript definitions)": string;
73
+ "Unauthorized(playground status info)": string;
74
+ "Unsupported(OAuth dialog)": string;
75
+ "Use the {name} type in TypeScript.(TypeScript definitions)": string;
76
+ "Username(OAuth dialog)": string;
77
+ "loading...(playground server select)": string;
78
+ };
79
+ //#endregion
80
+ export { Translations };
@@ -0,0 +1,80 @@
1
+ //#region src/.translations/keys.json
2
+ var keys_default = [
3
+ "Access Token(playground)",
4
+ "Authenticate using username and password.(OAuth dialog)",
5
+ "Authenticate with 3rd party services(OAuth dialog)",
6
+ "Authenticate with device.(OAuth dialog)",
7
+ "Authorization code(OAuth dialog)",
8
+ "Authorization(OAuth dialog)",
9
+ "Authorization(operation page)",
10
+ "Authorization(playground)",
11
+ "Authorization(security scheme)",
12
+ "Authorize(playground)",
13
+ "Bad Request(playground status info)",
14
+ "Basic <token>(security scheme)",
15
+ "Bearer <token>(security scheme)",
16
+ "Binary response body, {length} bytes(playground result display)",
17
+ "Body(playground)",
18
+ "Callbacks(operation page)",
19
+ "Client Credentials(OAuth dialog)",
20
+ "Client Error(playground result display)",
21
+ "Client ID(OAuth dialog)",
22
+ "Client Secret(OAuth dialog)",
23
+ "Close JSON Editor(playground)",
24
+ "Close(playground result display)",
25
+ "Cookie Parameters(operation page)",
26
+ "Cookies(playground)",
27
+ "Copy(TypeScript definitions)",
28
+ "Default(operation page)",
29
+ "Deprecated(operation page)",
30
+ "Deprecated(security scheme)",
31
+ "Device Authorization(OAuth dialog)",
32
+ "Empty(operation page)",
33
+ "Enter Value(playground server select)",
34
+ "Enter value(OAuth dialog)",
35
+ "Error(playground status info)",
36
+ "Example Requests(operation page)",
37
+ "Example {key}(operation page)",
38
+ "Example(operation page)",
39
+ "Failed to fetch token(playground)",
40
+ "Fetching token...(playground)",
41
+ "Forbidden(playground status info)",
42
+ "Header Parameters(operation page)",
43
+ "Header(playground)",
44
+ "Implicit(OAuth dialog)",
45
+ "In(security scheme)",
46
+ "Intended for the server-to-server authentication.(OAuth dialog)",
47
+ "Internal Server Error(playground status info)",
48
+ "Not Found(playground status info)",
49
+ "Obtain the access token for API.(OAuth dialog)",
50
+ "Open JSON Editor(playground)",
51
+ "OpenID Connect is not supported at the moment, you can still set an access token here.(playground)",
52
+ "OpenID Connect(security scheme)",
53
+ "Password(OAuth dialog)",
54
+ "Path Parameters(operation page)",
55
+ "Path(playground)",
56
+ "Query Parameters(operation page)",
57
+ "Query(playground)",
58
+ "Request Body(operation page)",
59
+ "Resource Owner Password Flow(OAuth dialog)",
60
+ "Response Body(operation page)",
61
+ "Retrieve the access token directly.(OAuth dialog)",
62
+ "Scope(security scheme)",
63
+ "Select a flow(OAuth dialog)",
64
+ "Send(playground)",
65
+ "Server URL(playground server select)",
66
+ "Submit(OAuth dialog)",
67
+ "Successful(playground status info)",
68
+ "Test(scalar API client)",
69
+ "The base URL of your API endpoint.(playground server select)",
70
+ "The client ID of your OAuth application.(OAuth dialog)",
71
+ "The client secret of your OAuth application.(OAuth dialog)",
72
+ "TypeScript Definitions(TypeScript definitions)",
73
+ "Unauthorized(playground status info)",
74
+ "Unsupported(OAuth dialog)",
75
+ "Use the {name} type in TypeScript.(TypeScript definitions)",
76
+ "Username(OAuth dialog)",
77
+ "loading...(playground server select)"
78
+ ];
79
+ //#endregion
80
+ export { keys_default as default };
@@ -6,15 +6,6 @@ var __getOwnPropNames = Object.getOwnPropertyNames;
6
6
  var __getProtoOf = Object.getPrototypeOf;
7
7
  var __hasOwnProp = Object.prototype.hasOwnProperty;
8
8
  var __commonJSMin = (cb, mod) => () => (mod || (cb((mod = { exports: {} }).exports, mod), cb = null), mod.exports);
9
- var __exportAll = (all, no_symbols) => {
10
- let target = {};
11
- for (var name in all) __defProp(target, name, {
12
- get: all[name],
13
- enumerable: true
14
- });
15
- if (!no_symbols) __defProp(target, Symbol.toStringTag, { value: "Module" });
16
- return target;
17
- };
18
9
  var __copyProps = (to, from, except, desc) => {
19
10
  if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
20
11
  key = keys[i];
@@ -30,4 +21,4 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
30
21
  enumerable: true
31
22
  }) : target, mod));
32
23
  //#endregion
33
- export { __commonJSMin, __exportAll, __toESM };
24
+ export { __commonJSMin, __toESM };
@@ -2,7 +2,6 @@ import { OutputEntry } from "./utils/pages/builder.js";
2
2
  import { SchemaToPagesOptions } from "./utils/pages/preset-auto.js";
3
3
  import { OpenAPIServer } from "./server/index.js";
4
4
  import { DistributiveOmit } from "./types.js";
5
- import { DereferencedDocument } from "./utils/document/dereference.js";
6
5
  import { PagesToTextOptions } from "./utils/pages/to-text.js";
7
6
 
8
7
  //#region src/generate-file.d.ts
@@ -60,8 +59,6 @@ interface GenerateFilesConfig extends PagesToTextOptions {
60
59
  beforeWrite?: (this: BeforeWriteContext, files: OutputFile[]) => void | Promise<void>;
61
60
  }
62
61
  interface MetaOptions {
63
- /** @deprecated use `folderStyle` instead */
64
- groupStyle?: 'folder' | 'separator';
65
62
  folderStyle?: 'folder' | 'separator';
66
63
  }
67
64
  type Config = SchemaToPagesOptions & GenerateFilesConfig & {
@@ -75,7 +72,6 @@ type Config = SchemaToPagesOptions & GenerateFilesConfig & {
75
72
  interface BeforeWriteContext {
76
73
  readonly generated: Record<string, OutputFile[]>;
77
74
  readonly generatedEntries: Record<string, OutputEntry[]>;
78
- readonly documents: Record<string, DereferencedDocument>;
79
75
  }
80
76
  declare function generateFiles(options: Config): Promise<void>;
81
77
  declare function generateFilesOnly(options: DistributiveOmit<Config, 'output'>): Promise<OutputFile[]>;
@@ -36,7 +36,7 @@ async function generateFilesOnly(options) {
36
36
  if (entries.length === 0) throw new Error("No input files found.");
37
37
  const preset = createAutoPreset(options);
38
38
  for (const [id, schema] of entries) {
39
- const entries = fromSchema(id, schema, preset);
39
+ const entries = fromSchema(id, schema.bundled, preset);
40
40
  const schemaFiles = [];
41
41
  generatedEntries[id] = entries;
42
42
  function scan(entry) {
@@ -46,7 +46,7 @@ async function generateFilesOnly(options) {
46
46
  }
47
47
  schemaFiles.push({
48
48
  path: entry.path,
49
- content: toText(entry, schema, options)
49
+ content: toText(entry, schema.bundled, options)
50
50
  });
51
51
  }
52
52
  for (const entry of entries) scan(entry);
@@ -55,8 +55,7 @@ async function generateFilesOnly(options) {
55
55
  }
56
56
  const context = {
57
57
  generated,
58
- generatedEntries,
59
- documents: schemas
58
+ generatedEntries
60
59
  };
61
60
  if (options.index) files.push(...writeIndexFiles(context, options));
62
61
  if (options.meta) files.push(...generateMeta(context, options.meta === true ? {} : options.meta));
@@ -65,7 +64,7 @@ async function generateFilesOnly(options) {
65
64
  }
66
65
  function generateMeta(context, options) {
67
66
  const files = [];
68
- const folderStyle = options.folderStyle ?? options.groupStyle ?? "folder";
67
+ const folderStyle = options.folderStyle ?? "folder";
69
68
  function scan(entries, parent) {
70
69
  const pages = [];
71
70
  for (const entry of entries) {
package/dist/i18n.d.ts CHANGED
@@ -1,106 +1,11 @@
1
- import { TranslationValue, TranslationsAPIExtension } from "fumadocs-core/i18n";
1
+ import { Translations } from "./.translations/index.js";
2
+ import { Translations as Translations$1 } from "@fumadocs/api-docs/i18n";
3
+ import { TranslationExtension } from "fumadocs-core/i18n";
2
4
  import { I18nUIConfig } from "fumadocs-ui/i18n";
3
5
 
4
6
  //#region src/i18n.d.ts
5
- declare const defaultTranslations: {
6
- loading: string;
7
- empty: string;
8
- copy: string;
9
- send: string;
10
- authorization: string;
11
- cookies: string;
12
- query: string;
13
- path: string;
14
- header: string;
15
- body: string;
16
- deprecated: string;
17
- submit: string;
18
- test: string;
19
- unsupported: string;
20
- close: string;
21
- inputPlaceholder: string;
22
- titleRequestTabs: string;
23
- requestTabNameDefault: string;
24
- queryParameters: string;
25
- pathParameters: string;
26
- headerParameters: string;
27
- cookieParameters: string;
28
- titleRequestBody: string;
29
- titleResponseBody: string;
30
- titleCallbacks: string;
31
- authBasicTokenExample: string;
32
- authBearerTokenExample: string;
33
- openIdConnect: string;
34
- authTokenIn: string;
35
- authScope: string;
36
- typeScriptDefinitions: string;
37
- useTypeInTypeScript: TranslationValue<"name">;
38
- schemaDefault: string;
39
- schemaMatch: string;
40
- schemaFormat: string;
41
- schemaMultipleOf: string;
42
- schemaRange: string;
43
- schemaLength: string;
44
- schemaProperties: string;
45
- schemaItems: string;
46
- schemaValueIn: string;
47
- schemaExample: string;
48
- responseTabName: TranslationValue<"key">;
49
- responseTabNameDefault: string;
50
- closeJsonEditor: string;
51
- openJsonEditor: string;
52
- accessToken: string;
53
- authorize: string;
54
- openIdUnsupported: string;
55
- statusBadRequest: string;
56
- statusUnauthorized: string;
57
- statusForbidden: string;
58
- statusNotFound: string;
59
- statusInternalServerError: string;
60
- statusSuccessful: string;
61
- statusError: string;
62
- statusClientError: string;
63
- statusBinaryBody: TranslationValue<"length">;
64
- oauthFlowPlaceholder: string;
65
- obtainAccessToken: string;
66
- resourceOwnerPassword: string;
67
- resourceOwnerPasswordDesc: string;
68
- clientCredentials: string;
69
- clientCredentialsDesc: string;
70
- authorizationCode: string;
71
- authorizationCodeDesc: string;
72
- implicit: string;
73
- implicitDesc: string;
74
- deviceAuthorization: string;
75
- deviceAuthorizationDesc: string;
76
- clientId: string;
77
- clientIdHint: string;
78
- clientSecret: string;
79
- clientSecretHint: string;
80
- usernameField: string;
81
- passwordField: string;
82
- fetchingToken: string;
83
- fetchTokenError: string;
84
- serverUrl: string;
85
- serverUrlDescription: string;
86
- serverUrlFieldPlaceholder: string;
87
- schemaShowArray: string;
88
- schemaHideArray: string;
89
- schemaFilterPropertiesPlaceholder: string;
90
- schemaFilterPropertiesEmpty: string;
91
- playgroundShowProperty: string;
92
- playgroundPropertyPlaceholder: string;
93
- playgroundNewProperty: string;
94
- playgroundNewItem: string;
95
- playgroundRemoveItem: string;
96
- playgroundSelectPlaceholder: string;
97
- playgroundSelected: string;
98
- playgroundInputUpload: string;
99
- playgroundInputUnset: string;
100
- };
101
- type Translations = typeof defaultTranslations;
102
- declare function openapiTranslations(): TranslationsAPIExtension<'openapi', Translations>;
7
+ declare function openapiTranslations(): TranslationExtension<keyof Translations | keyof Translations$1>;
103
8
  /** @deprecated use `i18n.translations()` & `openapiTranslations()` instead */
104
9
  declare function defineI18nOpenAPI<Languages extends string>(config: I18nUIConfig<Languages>, translations: Partial<Record<NoInfer<Languages>, Partial<Translations>>>): I18nUIConfig<Languages>;
105
10
  //#endregion
106
- export { Translations, defaultTranslations, defineI18nOpenAPI, openapiTranslations };
11
+ export { type Translations, defineI18nOpenAPI, openapiTranslations };
package/dist/i18n.js CHANGED
@@ -1,105 +1,8 @@
1
+ import keys_default from "./.translations/keys.js";
2
+ import { apiDocsTranslations } from "@fumadocs/api-docs/i18n";
1
3
  //#region src/i18n.ts
2
- const defaultTranslations = {
3
- loading: "loading...",
4
- empty: "Empty",
5
- copy: "Copy",
6
- send: "Send",
7
- authorization: "Authorization",
8
- cookies: "Cookies",
9
- query: "Query",
10
- path: "Path",
11
- header: "Header",
12
- body: "Body",
13
- deprecated: "Deprecated",
14
- submit: "Submit",
15
- test: "Test",
16
- unsupported: "Unsupported",
17
- close: "Close",
18
- inputPlaceholder: "Enter value",
19
- titleRequestTabs: "Example Requests",
20
- requestTabNameDefault: "Default",
21
- queryParameters: "Query Parameters",
22
- pathParameters: "Path Parameters",
23
- headerParameters: "Header Parameters",
24
- cookieParameters: "Cookie Parameters",
25
- titleRequestBody: "Request Body",
26
- titleResponseBody: "Response Body",
27
- titleCallbacks: "Callbacks",
28
- authBasicTokenExample: "Basic <token>",
29
- authBearerTokenExample: "Bearer <token>",
30
- openIdConnect: "OpenID Connect",
31
- authTokenIn: "In",
32
- authScope: "Scope",
33
- typeScriptDefinitions: "TypeScript Definitions",
34
- useTypeInTypeScript: "Use the {name} type in TypeScript.",
35
- schemaDefault: "Default",
36
- schemaMatch: "Match",
37
- schemaFormat: "Format",
38
- schemaMultipleOf: "Multiple Of",
39
- schemaRange: "Range",
40
- schemaLength: "Length",
41
- schemaProperties: "Properties",
42
- schemaItems: "Items",
43
- schemaValueIn: "Value in",
44
- schemaExample: "Example",
45
- responseTabName: "Example {key}",
46
- responseTabNameDefault: "Example",
47
- closeJsonEditor: "Close JSON Editor",
48
- openJsonEditor: "Open JSON Editor",
49
- accessToken: "Access Token",
50
- authorize: "Authorize",
51
- openIdUnsupported: "OpenID Connect is not supported at the moment, you can still set an access token here.",
52
- statusBadRequest: "Bad Request",
53
- statusUnauthorized: "Unauthorized",
54
- statusForbidden: "Forbidden",
55
- statusNotFound: "Not Found",
56
- statusInternalServerError: "Internal Server Error",
57
- statusSuccessful: "Successful",
58
- statusError: "Error",
59
- statusClientError: "Client Error",
60
- statusBinaryBody: "Binary response body, {length} bytes",
61
- oauthFlowPlaceholder: "Select a flow",
62
- obtainAccessToken: "Obtain the access token for API.",
63
- resourceOwnerPassword: "Resource Owner Password Flow",
64
- resourceOwnerPasswordDesc: "Authenticate using username and password.",
65
- clientCredentials: "Client Credentials",
66
- clientCredentialsDesc: "Intended for the server-to-server authentication.",
67
- authorizationCode: "Authorization code",
68
- authorizationCodeDesc: "Authenticate with 3rd party services",
69
- implicit: "Implicit",
70
- implicitDesc: "Retrieve the access token directly.",
71
- deviceAuthorization: "Device Authorization",
72
- deviceAuthorizationDesc: "Authenticate with device.",
73
- clientId: "Client ID",
74
- clientIdHint: "The client ID of your OAuth application.",
75
- clientSecret: "Client Secret",
76
- clientSecretHint: "The client secret of your OAuth application.",
77
- usernameField: "Username",
78
- passwordField: "Password",
79
- fetchingToken: "Fetching token...",
80
- fetchTokenError: "Failed to fetch token",
81
- serverUrl: "Server URL",
82
- serverUrlDescription: "The base URL of your API endpoint.",
83
- serverUrlFieldPlaceholder: "Enter Value",
84
- schemaShowArray: "Array Item",
85
- schemaHideArray: "Array Item",
86
- schemaFilterPropertiesPlaceholder: "Filter Properties",
87
- schemaFilterPropertiesEmpty: "No property matching",
88
- playgroundShowProperty: "Show Property",
89
- playgroundPropertyPlaceholder: "Enter Property Name",
90
- playgroundNewProperty: "New",
91
- playgroundNewItem: "New Item",
92
- playgroundRemoveItem: "Remove Item",
93
- playgroundSelectPlaceholder: "Select",
94
- playgroundSelected: "Selected",
95
- playgroundInputUpload: "Upload",
96
- playgroundInputUnset: "Unset"
97
- };
98
4
  function openapiTranslations() {
99
- return {
100
- namespace: "openapi",
101
- defaultValue: defaultTranslations
102
- };
5
+ return { keys: [...apiDocsTranslations().keys, ...keys_default] };
103
6
  }
104
7
  /** @deprecated use `i18n.translations()` & `openapiTranslations()` instead */
105
8
  function defineI18nOpenAPI(config, translations) {
@@ -108,16 +11,13 @@ function defineI18nOpenAPI(config, translations) {
108
11
  provider(locale = config.defaultLanguage) {
109
12
  const out = config.provider(locale);
110
13
  const data = translations[locale];
111
- if (data) {
112
- out.translations ??= {};
113
- out.translations.openapi = {
114
- ...defaultTranslations,
115
- ...data
116
- };
117
- }
14
+ if (data) out.translations = {
15
+ ...out.translations,
16
+ ...data
17
+ };
118
18
  return out;
119
19
  }
120
20
  };
121
21
  }
122
22
  //#endregion
123
- export { defaultTranslations, defineI18nOpenAPI, openapiTranslations };
23
+ export { defineI18nOpenAPI, openapiTranslations };
package/dist/index.d.ts CHANGED
@@ -1,7 +1,7 @@
1
+ import { OpenAPI, OpenAPIV2, OpenAPIV3, OpenAPIV3_1, OpenAPIV3_2 } from "./types/openapi.js";
1
2
  import { MediaAdapter } from "./requests/media/adapter.js";
2
- import { OpenAPI, OpenAPIV2, OpenAPIV3, OpenAPIV3_1, OpenAPIV3_2 } from "./_openapi/types.js";
3
- import { OperationOutput, OutputEntry, OutputGroup, PageOutput, PagesBuilder, PagesBuilderConfig, WebhookOutput } from "./utils/pages/builder.js";
3
+ import { GeneratedPageProps, OperationItem, OperationOutput, OutputEntry, OutputGroup, PageOutput, PagesBuilder, PagesBuilderConfig, WebhookItem, WebhookOutput } from "./utils/pages/builder.js";
4
4
  import { SchemaToPagesOptions } from "./utils/pages/preset-auto.js";
5
- import { MethodInformation, RenderContext } from "./types.js";
5
+ import { RenderContext } from "./types.js";
6
6
  import { Config, OutputFile, generateFiles, generateFilesOnly } from "./generate-file.js";
7
- export { Config, type MediaAdapter, type MethodInformation, type OpenAPI, type OpenAPIV2, type OpenAPIV3, type OpenAPIV3_1, type OpenAPIV3_2, type OperationOutput, type OutputEntry, OutputFile, type OutputGroup, type PageOutput, type PagesBuilder, type PagesBuilderConfig, type RenderContext, type SchemaToPagesOptions, type WebhookOutput, generateFiles, generateFilesOnly };
7
+ export { Config, type GeneratedPageProps, type MediaAdapter, type OpenAPI, type OpenAPIV2, type OpenAPIV3, type OpenAPIV3_1, type OpenAPIV3_2, type OperationItem, type OperationOutput, type OutputEntry, OutputFile, type OutputGroup, type PageOutput, type PagesBuilder, type PagesBuilderConfig, type RenderContext, type SchemaToPagesOptions, type WebhookItem, type WebhookOutput, generateFiles, generateFilesOnly };
@@ -1,5 +1,5 @@
1
1
  import { traverse } from "../helpers/traverse.js";
2
- //#region ../../node_modules/.pnpm/@scalar+openapi-upgrader@0.2.8/node_modules/@scalar/openapi-upgrader/dist/2.0-to-3.0/upgrade-from-two-to-three.js
2
+ //#region ../../node_modules/.pnpm/@scalar+openapi-upgrader@0.2.9/node_modules/@scalar/openapi-upgrader/dist/2.0-to-3.0/upgrade-from-two-to-three.js
3
3
  const DEFAULT_MEDIA_TYPE = "application/json";
4
4
  /** Extracts and removes x-example and x-examples extensions from an object */
5
5
  function extractXExampleExtensions(obj) {
@@ -1,5 +1,5 @@
1
1
  import { traverse } from "../helpers/traverse.js";
2
- //#region ../../node_modules/.pnpm/@scalar+openapi-upgrader@0.2.8/node_modules/@scalar/openapi-upgrader/dist/3.0-to-3.1/upgrade-from-three-to-three-one.js
2
+ //#region ../../node_modules/.pnpm/@scalar+openapi-upgrader@0.2.9/node_modules/@scalar/openapi-upgrader/dist/3.0-to-3.1/upgrade-from-three-to-three-one.js
3
3
  const SCHEMA_SEGMENTS = new Set([
4
4
  "properties",
5
5
  "items",
@@ -1,4 +1,4 @@
1
- //#region ../../node_modules/.pnpm/@scalar+openapi-upgrader@0.2.8/node_modules/@scalar/openapi-upgrader/dist/3.1-to-3.2/upgrade-from-three-one-to-three-two.js
1
+ //#region ../../node_modules/.pnpm/@scalar+openapi-upgrader@0.2.9/node_modules/@scalar/openapi-upgrader/dist/3.1-to-3.2/upgrade-from-three-one-to-three-two.js
2
2
  /**
3
3
  * Recursively migrate XML object properties from 3.1 to 3.2 format
4
4
  */
@@ -1,4 +1,4 @@
1
- //#region ../../node_modules/.pnpm/@scalar+openapi-upgrader@0.2.8/node_modules/@scalar/openapi-upgrader/dist/helpers/traverse.js
1
+ //#region ../../node_modules/.pnpm/@scalar+openapi-upgrader@0.2.9/node_modules/@scalar/openapi-upgrader/dist/helpers/traverse.js
2
2
  /**
3
3
  * Recursively traverses the content and applies the transform function to each node.
4
4
  */
@@ -1,7 +1,7 @@
1
1
  import { upgradeFromThreeOneToThreeTwo } from "./3.1-to-3.2/upgrade-from-three-one-to-three-two.js";
2
2
  import { upgradeFromTwoToThree } from "./2.0-to-3.0/upgrade-from-two-to-three.js";
3
3
  import { upgradeFromThreeToThreeOne } from "./3.0-to-3.1/upgrade-from-three-to-three-one.js";
4
- //#region ../../node_modules/.pnpm/@scalar+openapi-upgrader@0.2.8/node_modules/@scalar/openapi-upgrader/dist/upgrade.js
4
+ //#region ../../node_modules/.pnpm/@scalar+openapi-upgrader@0.2.9/node_modules/@scalar/openapi-upgrader/dist/upgrade.js
5
5
  function upgrade(value, targetVersion) {
6
6
  const openapi30 = upgradeFromTwoToThree(value);
7
7
  if (targetVersion === "3.0") return openapi30;
@@ -1,5 +1,5 @@
1
1
  "use client";
2
- import { useApiContext } from "../ui/contexts/api.js";
2
+ import { useRenderContext } from "../ui/contexts/api.js";
3
3
  import { useQuery } from "../utils/use-query.js";
4
4
  import { createContext, use, useEffect, useMemo, useState } from "react";
5
5
  import { jsx } from "react/jsx-runtime";
@@ -11,10 +11,10 @@ function useAuth() {
11
11
  return ctx;
12
12
  }
13
13
  function AuthProvider({ children }) {
14
- const { schemes } = useApiContext();
14
+ const schemes = useRenderContext().schema.dereferenced.components?.securitySchemes;
15
15
  const [store, setStore] = useState({});
16
16
  const authCodeQuery = useQuery(async (code, state) => {
17
- const scheme = schemes[state.scheme];
17
+ const scheme = schemes?.[state.scheme];
18
18
  if (!scheme || scheme.type !== "oauth2") return;
19
19
  const value = scheme.flows?.authorizationCode;
20
20
  if (!value) return;
@@ -58,7 +58,7 @@ function AuthProvider({ children }) {
58
58
  const type = hash.get("token_type") ?? "Bearer";
59
59
  if (!state || !token) return;
60
60
  const parsedState = JSON.parse(state);
61
- const scheme = schemes[parsedState.scheme];
61
+ const scheme = schemes?.[parsedState.scheme];
62
62
  if (!scheme || scheme.type !== "oauth2" || !scheme.flows?.implicit) return;
63
63
  const info = {
64
64
  type: "implicit",
@@ -1,12 +1,11 @@
1
1
  import { BrowserFetcherOptions } from "./fetcher.js";
2
2
  import { DefaultResultDisplay, ResultDisplayProps } from "./components/result-display.js";
3
- import { SchemaScope } from "./schema.js";
4
- import { Document, HttpMethods, ParameterObject } from "../types.js";
5
- import { ParsedSchema, SecurityEntry } from "../utils/schema/index.js";
3
+ import { ParsedSchema } from "../utils/schema.js";
4
+ import { HttpMethods, OperationObject, ParameterObject, PathItemObject } from "../types.js";
6
5
  import { ComponentProps, FC, ReactNode } from "react";
7
- import * as _$react_jsx_runtime0 from "react/jsx-runtime";
8
6
  import { Collapsible } from "fumadocs-ui/components/ui/collapsible";
9
7
  import { FieldKey } from "@fumari/stf";
8
+ import { NoReference } from "@fumadocs/api-docs/schema";
10
9
 
11
10
  //#region src/playground/client.d.ts
12
11
  interface FormValues extends Record<string, unknown> {
@@ -16,14 +15,13 @@ interface FormValues extends Record<string, unknown> {
16
15
  cookie: Record<string, unknown>;
17
16
  body: unknown;
18
17
  }
19
- interface PlaygroundClientProps extends ComponentProps<'form'>, SchemaScope {
18
+ interface PlaygroundClientProps extends Omit<ComponentProps<'form'>, 'method'> {
20
19
  route: string;
21
20
  method: HttpMethods;
22
- securities: SecurityEntry[][];
23
- /** the OpenAPI document (not dereferenced) */
24
- doc: Document;
25
- proxyUrl?: string;
26
- deprecated?: boolean;
21
+ operation: NoReference<OperationObject>;
22
+ pathItem: NoReference<PathItemObject>;
23
+ writeOnly: boolean;
24
+ readOnly: boolean;
27
25
  }
28
26
  interface CollapsiblePanelProps extends Omit<ComponentProps<typeof Collapsible>, 'title'> {
29
27
  'data-type': 'authorization' | 'body' | ParamType;
@@ -35,11 +33,6 @@ interface PlaygroundClientOptions {
35
33
  */
36
34
  transformAuthInputs?: (fields: AuthField[]) => AuthField[];
37
35
  fetchOptions?: BrowserFetcherOptions;
38
- /**
39
- * Request timeout in seconds (default: 10s)
40
- * @deprecated use `fetchOptions.requestTimeout` instead.
41
- */
42
- requestTimeout?: number;
43
36
  components?: {
44
37
  ResultDisplay?: FC<ResultDisplayProps>;
45
38
  CollapsiblePanel?: FC<CollapsiblePanelProps>;
@@ -67,14 +60,12 @@ interface RequestBodyInfo {
67
60
  declare function PlaygroundClient({
68
61
  route,
69
62
  method,
70
- securities,
71
- doc,
72
- proxyUrl,
63
+ operation,
64
+ pathItem,
73
65
  writeOnly,
74
66
  readOnly,
75
- deprecated,
76
67
  ...rest
77
- }: PlaygroundClientProps): _$react_jsx_runtime0.JSX.Element;
68
+ }: PlaygroundClientProps): import("react").JSX.Element;
78
69
  declare const ParamTypes: readonly ["path", "header", "cookie", "query"];
79
70
  type ParamType = (typeof ParamTypes)[number];
80
71
  interface AuthField {
@@ -89,7 +80,7 @@ declare function DefaultCollapsiblePanel({
89
80
  title,
90
81
  children,
91
82
  ...props
92
- }: CollapsiblePanelProps): _$react_jsx_runtime0.JSX.Element;
83
+ }: CollapsiblePanelProps): import("react").JSX.Element;
93
84
  declare const Custom: {
94
85
  useController(fieldName: FieldKey, options?: {
95
86
  defaultValue?: unknown;