fumadocs-openapi 10.7.0 → 10.8.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.
- package/css/generated/shared.css +1 -1
- package/dist/_virtual/_rolldown/runtime.js +1 -1
- package/dist/node_modules/.pnpm/{@scalar_helpers@0.4.3 → @scalar_helpers@0.5.1}/node_modules/@scalar/helpers/dist/general/create-limiter.js +1 -1
- package/dist/node_modules/.pnpm/{@scalar_helpers@0.4.3 → @scalar_helpers@0.5.1}/node_modules/@scalar/helpers/dist/object/is-object.js +12 -11
- package/dist/node_modules/.pnpm/{@scalar_helpers@0.4.3 → @scalar_helpers@0.5.1}/node_modules/@scalar/helpers/dist/object/prevent-pollution.js +1 -1
- package/dist/node_modules/.pnpm/{@scalar_helpers@0.4.3 → @scalar_helpers@0.5.1}/node_modules/@scalar/helpers/dist/queue/queue.js +1 -1
- package/dist/node_modules/.pnpm/{@scalar_helpers@0.4.3 → @scalar_helpers@0.5.1}/node_modules/@scalar/helpers/dist/string/generate-hash.js +1 -1
- package/dist/node_modules/.pnpm/{@scalar_json-magic@0.12.5 → @scalar_json-magic@0.12.7}/node_modules/@scalar/json-magic/dist/bundle/bundle.js +2 -2
- package/dist/node_modules/.pnpm/{@scalar_json-magic@0.12.5 → @scalar_json-magic@0.12.7}/node_modules/@scalar/json-magic/dist/bundle/plugins/fetch-urls/index.js +2 -2
- package/dist/node_modules/.pnpm/{@scalar_json-magic@0.12.5 → @scalar_json-magic@0.12.7}/node_modules/@scalar/json-magic/dist/bundle/plugins/read-files/index.js +1 -1
- package/dist/node_modules/.pnpm/{@scalar_json-magic@0.12.5 → @scalar_json-magic@0.12.7}/node_modules/@scalar/json-magic/dist/bundle/value-generator.js +2 -2
- package/dist/node_modules/.pnpm/{@scalar_json-magic@0.12.5 → @scalar_json-magic@0.12.7}/node_modules/@scalar/json-magic/dist/helpers/convert-to-local-ref.js +1 -1
- package/dist/node_modules/.pnpm/{@scalar_json-magic@0.12.5 → @scalar_json-magic@0.12.7}/node_modules/@scalar/json-magic/dist/helpers/escape-json-pointer.js +1 -1
- package/dist/node_modules/.pnpm/{@scalar_json-magic@0.12.5 → @scalar_json-magic@0.12.7}/node_modules/@scalar/json-magic/dist/helpers/get-schemas.js +1 -1
- package/dist/node_modules/.pnpm/{@scalar_json-magic@0.12.5 → @scalar_json-magic@0.12.7}/node_modules/@scalar/json-magic/dist/helpers/get-segments-from-path.js +1 -1
- package/dist/node_modules/.pnpm/{@scalar_json-magic@0.12.5 → @scalar_json-magic@0.12.7}/node_modules/@scalar/json-magic/dist/helpers/get-value-by-path.js +1 -1
- package/dist/node_modules/.pnpm/{@scalar_json-magic@0.12.5 → @scalar_json-magic@0.12.7}/node_modules/@scalar/json-magic/dist/helpers/is-file-path.js +1 -1
- package/dist/node_modules/.pnpm/{@scalar_json-magic@0.12.5 → @scalar_json-magic@0.12.7}/node_modules/@scalar/json-magic/dist/helpers/is-http-url.js +1 -1
- package/dist/node_modules/.pnpm/{@scalar_json-magic@0.12.5 → @scalar_json-magic@0.12.7}/node_modules/@scalar/json-magic/dist/helpers/is-json-object.js +2 -2
- package/dist/node_modules/.pnpm/{@scalar_json-magic@0.12.5 → @scalar_json-magic@0.12.7}/node_modules/@scalar/json-magic/dist/helpers/is-yaml.js +1 -1
- package/dist/node_modules/.pnpm/{@scalar_json-magic@0.12.5 → @scalar_json-magic@0.12.7}/node_modules/@scalar/json-magic/dist/helpers/normalize.js +1 -1
- package/dist/node_modules/.pnpm/{@scalar_json-magic@0.12.5 → @scalar_json-magic@0.12.7}/node_modules/@scalar/json-magic/dist/helpers/resolve-reference-path.js +1 -1
- package/dist/node_modules/.pnpm/{@scalar_json-magic@0.12.5 → @scalar_json-magic@0.12.7}/node_modules/@scalar/json-magic/dist/helpers/set-value-at-path.js +2 -2
- package/dist/node_modules/.pnpm/{@scalar_json-magic@0.12.5 → @scalar_json-magic@0.12.7}/node_modules/@scalar/json-magic/dist/helpers/to-relative-path.js +1 -1
- package/dist/node_modules/.pnpm/{@scalar_json-magic@0.12.5 → @scalar_json-magic@0.12.7}/node_modules/@scalar/json-magic/dist/helpers/unescape-json-pointer.js +1 -1
- package/dist/node_modules/.pnpm/{@scalar_openapi-upgrader@0.2.4 → @scalar_openapi-upgrader@0.2.5}/node_modules/@scalar/openapi-upgrader/dist/2.0-to-3.0/upgrade-from-two-to-three.js +1 -1
- package/dist/node_modules/.pnpm/{@scalar_openapi-upgrader@0.2.4 → @scalar_openapi-upgrader@0.2.5}/node_modules/@scalar/openapi-upgrader/dist/3.0-to-3.1/upgrade-from-three-to-three-one.js +1 -1
- package/dist/node_modules/.pnpm/{@scalar_openapi-upgrader@0.2.4 → @scalar_openapi-upgrader@0.2.5}/node_modules/@scalar/openapi-upgrader/dist/3.1-to-3.2/upgrade-from-three-one-to-three-two.js +1 -1
- package/dist/node_modules/.pnpm/{@scalar_openapi-upgrader@0.2.4 → @scalar_openapi-upgrader@0.2.5}/node_modules/@scalar/openapi-upgrader/dist/helpers/traverse.js +1 -1
- package/dist/node_modules/.pnpm/{@scalar_openapi-upgrader@0.2.4 → @scalar_openapi-upgrader@0.2.5}/node_modules/@scalar/openapi-upgrader/dist/upgrade.js +1 -1
- package/dist/node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/browser/dist/compose/resolve-block-scalar.js +1 -0
- package/dist/node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/browser/dist/compose/resolve-flow-scalar.js +2 -0
- package/dist/node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/browser/dist/parse/parser.js +3 -0
- package/dist/playground/client.d.ts +1 -1
- package/dist/playground/components/inputs.js +1 -2
- package/dist/server/index.d.ts +2 -2
- package/dist/server/source-api.d.ts +8 -8
- package/dist/server/source-api.js +1 -1
- package/dist/ui/base.d.ts +2 -2
- package/dist/ui/components/dialog.js +0 -1
- package/dist/ui/components/select.js +0 -1
- package/dist/ui/schema/index.js +3 -3
- package/dist/utils/document/process.js +5 -5
- package/dist/utils/pages/to-text.d.ts +1 -1
- package/dist/utils/schema/to-string.js +5 -10
- package/package.json +11 -11
- /package/dist/node_modules/.pnpm/{@scalar_json-magic@0.12.5 → @scalar_json-magic@0.12.7}/node_modules/@scalar/json-magic/dist/bundle/plugins/node.js +0 -0
- /package/dist/node_modules/.pnpm/{@scalar_json-magic@0.12.5 → @scalar_json-magic@0.12.7}/node_modules/@scalar/json-magic/dist/bundle/plugins/parse-yaml/index.js +0 -0
package/css/generated/shared.css
CHANGED
|
@@ -193,7 +193,7 @@
|
|
|
193
193
|
@source inline("current");
|
|
194
194
|
@source inline("currentRef");
|
|
195
195
|
@source inline("currentValue");
|
|
196
|
-
@source inline("
|
|
196
|
+
@source inline("customization");
|
|
197
197
|
@source inline("cva");
|
|
198
198
|
@source inline("dark");
|
|
199
199
|
@source inline("dark:text-blue-400");
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
//#region \0rolldown/runtime.js
|
|
2
2
|
var __defProp = Object.defineProperty;
|
|
3
|
-
var __commonJSMin = (cb, mod) => () => (mod || cb((mod = { exports: {} }).exports, mod), mod.exports);
|
|
3
|
+
var __commonJSMin = (cb, mod) => () => (mod || (cb((mod = { exports: {} }).exports, mod), cb = null), mod.exports);
|
|
4
4
|
var __exportAll = (all, no_symbols) => {
|
|
5
5
|
let target = {};
|
|
6
6
|
for (var name in all) __defProp(target, name, {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Queue } from "../queue/queue.js";
|
|
2
|
-
//#region ../../node_modules/.pnpm/@scalar+helpers@0.
|
|
2
|
+
//#region ../../node_modules/.pnpm/@scalar+helpers@0.5.1/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.
|
|
1
|
+
//#region ../../node_modules/.pnpm/@scalar+helpers@0.5.1/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).
|
|
@@ -6,16 +6,17 @@
|
|
|
6
6
|
* Differs from the previous isObject in that it returns false for Date,
|
|
7
7
|
* RegExp, Error, Map, Set, WeakMap, WeakSet, Promise, and other non-plain objects.
|
|
8
8
|
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
-
*
|
|
17
|
-
*
|
|
18
|
-
*
|
|
9
|
+
* | Value | Result |
|
|
10
|
+
* | :--- | :--- |
|
|
11
|
+
* | `isObject({})` | `true` |
|
|
12
|
+
* | `isObject({ a: 1 })` | `true` |
|
|
13
|
+
* | `isObject([])` | `false` (Array) |
|
|
14
|
+
* | `isObject(null)` | `false` |
|
|
15
|
+
* | `isObject(123)` | `false` |
|
|
16
|
+
* | `isObject('string')` | `false` |
|
|
17
|
+
* | `isObject(new Error('test'))` | `false` |
|
|
18
|
+
* | `isObject(new Date())` | `false` |
|
|
19
|
+
* | `isObject(Object.create(null))` | `true` |
|
|
19
20
|
*/
|
|
20
21
|
const isObject = (value) => {
|
|
21
22
|
if (value === null || typeof value !== "object") return false;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
//#region ../../node_modules/.pnpm/@scalar+helpers@0.
|
|
1
|
+
//#region ../../node_modules/.pnpm/@scalar+helpers@0.5.1/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.
|
|
1
|
+
//#region ../../node_modules/.pnpm/@scalar+helpers@0.5.1/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.
|
|
1
|
+
//#region ../../node_modules/.pnpm/@scalar+helpers@0.5.1/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.
|
|
1
|
+
import { isObject } from "../../../../../../@scalar_helpers@0.5.1/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.
|
|
13
|
+
//#region ../../node_modules/.pnpm/@scalar+json-magic@0.12.7/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.
|
|
2
|
+
import { createLimiter } from "../../../../../../../../@scalar_helpers@0.5.1/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.
|
|
4
|
+
//#region ../../node_modules/.pnpm/@scalar+json-magic@0.12.7/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.
|
|
3
|
+
//#region ../../node_modules/.pnpm/@scalar+json-magic@0.12.7/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.
|
|
2
|
-
//#region ../../node_modules/.pnpm/@scalar+json-magic@0.12.
|
|
1
|
+
import { generateHash } from "../../../../../../@scalar_helpers@0.5.1/node_modules/@scalar/helpers/dist/string/generate-hash.js";
|
|
2
|
+
//#region ../../node_modules/.pnpm/@scalar+json-magic@0.12.7/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.
|
|
1
|
+
//#region ../../node_modules/.pnpm/@scalar+json-magic@0.12.7/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.
|
|
1
|
+
//#region ../../node_modules/.pnpm/@scalar+json-magic@0.12.7/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.
|
|
1
|
+
//#region ../../node_modules/.pnpm/@scalar+json-magic@0.12.7/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.
|
|
2
|
+
//#region ../../node_modules/.pnpm/@scalar+json-magic@0.12.7/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.
|
|
2
|
+
//#region ../../node_modules/.pnpm/@scalar+json-magic@0.12.7/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.
|
|
4
|
+
//#region ../../node_modules/.pnpm/@scalar+json-magic@0.12.7/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.
|
|
1
|
+
//#region ../../node_modules/.pnpm/@scalar+json-magic@0.12.7/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.
|
|
2
|
-
//#region ../../node_modules/.pnpm/@scalar+json-magic@0.12.
|
|
1
|
+
import { isObject } from "../../../../../../@scalar_helpers@0.5.1/node_modules/@scalar/helpers/dist/object/is-object.js";
|
|
2
|
+
//#region ../../node_modules/.pnpm/@scalar+json-magic@0.12.7/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.
|
|
1
|
+
//#region ../../node_modules/.pnpm/@scalar+json-magic@0.12.7/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,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { parse } from "../../../../../../yaml@2.8.3/node_modules/yaml/browser/dist/public-api.js";
|
|
2
2
|
import "../../../../../../yaml@2.8.3/node_modules/yaml/browser/index.js";
|
|
3
|
-
//#region ../../node_modules/.pnpm/@scalar+json-magic@0.12.
|
|
3
|
+
//#region ../../node_modules/.pnpm/@scalar+json-magic@0.12.7/node_modules/@scalar/json-magic/dist/helpers/normalize.js
|
|
4
4
|
/**
|
|
5
5
|
* Normalize a string (YAML, JSON, object) to a JavaScript datatype.
|
|
6
6
|
*/
|
|
@@ -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.
|
|
3
|
+
//#region ../../node_modules/.pnpm/@scalar+json-magic@0.12.7/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.
|
|
1
|
+
import { preventPollution } from "../../../../../../@scalar_helpers@0.5.1/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.
|
|
3
|
+
//#region ../../node_modules/.pnpm/@scalar+json-magic@0.12.7/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.
|
|
3
|
+
//#region ../../node_modules/.pnpm/@scalar+json-magic@0.12.7/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.
|
|
1
|
+
//#region ../../node_modules/.pnpm/@scalar+json-magic@0.12.7/node_modules/@scalar/json-magic/dist/helpers/unescape-json-pointer.js
|
|
2
2
|
/**
|
|
3
3
|
* Unescape JSON pointer
|
|
4
4
|
*
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { traverse } from "../helpers/traverse.js";
|
|
2
|
-
//#region ../../node_modules/.pnpm/@scalar+openapi-upgrader@0.2.
|
|
2
|
+
//#region ../../node_modules/.pnpm/@scalar+openapi-upgrader@0.2.5/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.
|
|
2
|
+
//#region ../../node_modules/.pnpm/@scalar+openapi-upgrader@0.2.5/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.
|
|
1
|
+
//#region ../../node_modules/.pnpm/@scalar+openapi-upgrader@0.2.5/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.
|
|
1
|
+
//#region ../../node_modules/.pnpm/@scalar+openapi-upgrader@0.2.5/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.
|
|
4
|
+
//#region ../../node_modules/.pnpm/@scalar+openapi-upgrader@0.2.5/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;
|
|
@@ -145,6 +145,7 @@ function parseBlockScalarHeader({ offset, props }, strict, onError) {
|
|
|
145
145
|
onError(token, "UNEXPECTED_TOKEN", token.message);
|
|
146
146
|
length += token.source.length;
|
|
147
147
|
break;
|
|
148
|
+
/* istanbul ignore next should not happen */
|
|
148
149
|
default: {
|
|
149
150
|
onError(token, "UNEXPECTED_TOKEN", `Unexpected token in block scalar header: ${token.type}`);
|
|
150
151
|
const ts = token.source;
|
|
@@ -19,6 +19,7 @@ function resolveFlowScalar(scalar, strict, onError) {
|
|
|
19
19
|
_type = Scalar.QUOTE_DOUBLE;
|
|
20
20
|
value = doubleQuotedValue(source, _onError);
|
|
21
21
|
break;
|
|
22
|
+
/* istanbul ignore next should not happen */
|
|
22
23
|
default:
|
|
23
24
|
onError(scalar, "UNEXPECTED_TOKEN", `Expected a flow scalar value, but found: ${type}`);
|
|
24
25
|
return {
|
|
@@ -48,6 +49,7 @@ function resolveFlowScalar(scalar, strict, onError) {
|
|
|
48
49
|
function plainValue(source, onError) {
|
|
49
50
|
let badChar = "";
|
|
50
51
|
switch (source[0]) {
|
|
52
|
+
/* istanbul ignore next should not happen */
|
|
51
53
|
case " ":
|
|
52
54
|
badChar = "a tab character";
|
|
53
55
|
break;
|
|
@@ -32,6 +32,7 @@ function getPrevProps(parent) {
|
|
|
32
32
|
return it.sep ?? it.start;
|
|
33
33
|
}
|
|
34
34
|
case "block-seq": return parent.items[parent.items.length - 1].start;
|
|
35
|
+
/* istanbul ignore next should not happen */
|
|
35
36
|
default: return [];
|
|
36
37
|
}
|
|
37
38
|
}
|
|
@@ -283,6 +284,7 @@ var Parser = class {
|
|
|
283
284
|
});
|
|
284
285
|
return;
|
|
285
286
|
}
|
|
287
|
+
/* istanbul ignore next should not happen */
|
|
286
288
|
default:
|
|
287
289
|
yield* this.pop();
|
|
288
290
|
yield* this.pop(token);
|
|
@@ -400,6 +402,7 @@ var Parser = class {
|
|
|
400
402
|
}
|
|
401
403
|
yield* this.pop();
|
|
402
404
|
break;
|
|
405
|
+
/* istanbul ignore next should not happen */
|
|
403
406
|
default:
|
|
404
407
|
yield* this.pop();
|
|
405
408
|
yield* this.step();
|
|
@@ -55,7 +55,7 @@ interface PlaygroundClientOptions {
|
|
|
55
55
|
/**
|
|
56
56
|
* render the input for API endpoint body.
|
|
57
57
|
*
|
|
58
|
-
* @see renderParameterField for
|
|
58
|
+
* @see renderParameterField for customization tips
|
|
59
59
|
*/
|
|
60
60
|
renderBodyField?: (fieldName: 'body', info: RequestBodyInfo) => ReactNode;
|
|
61
61
|
}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { useTranslations } from "../../ui/client/i18n.js";
|
|
3
3
|
import { cn } from "../../utils/cn.js";
|
|
4
|
-
import { FormatFlags } from "../../utils/schema/to-string.js";
|
|
5
4
|
import { anyFields, useFieldInfo, useResolvedSchema, useSchemaScope, useSchemaUtils } from "../schema.js";
|
|
6
5
|
import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from "../../ui/components/select.js";
|
|
7
6
|
import { Input, labelVariants } from "../../ui/components/input.js";
|
|
@@ -283,7 +282,7 @@ function FieldSet({ field: _field, fieldName, toolbar, name, isRequired, depth =
|
|
|
283
282
|
children: union.map((item, i) => /* @__PURE__ */ jsx("option", {
|
|
284
283
|
value: i,
|
|
285
284
|
className: "bg-fd-popover text-fd-popover-foreground",
|
|
286
|
-
children: schemaToString(item,
|
|
285
|
+
children: schemaToString(item, 1)
|
|
287
286
|
}, i))
|
|
288
287
|
}), toolbar] })
|
|
289
288
|
});
|
package/dist/server/index.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { OpenAPIOptions, OpenAPIServer, createCodeSample, createOpenAPI } from "./create.js";
|
|
2
|
-
import { InternalOpenAPIMeta, openapiPlugin, openapiSource, transformerOpenAPI } from "./source-api.js";
|
|
3
|
-
export { InternalOpenAPIMeta, OpenAPIOptions, OpenAPIServer, createCodeSample, createOpenAPI, openapiPlugin, openapiSource, transformerOpenAPI };
|
|
2
|
+
import { InternalOpenAPIMeta, OpenAPIPageData, OpenAPISourceOptions, openapiPlugin, openapiSource, transformerOpenAPI } from "./source-api.js";
|
|
3
|
+
export { InternalOpenAPIMeta, OpenAPIOptions, OpenAPIPageData, OpenAPIServer, OpenAPISourceOptions, createCodeSample, createOpenAPI, openapiPlugin, openapiSource, transformerOpenAPI };
|
|
@@ -33,16 +33,16 @@ interface OpenAPIPageData extends PageData {
|
|
|
33
33
|
structuredData: StructuredData;
|
|
34
34
|
toc: TOCItemType[];
|
|
35
35
|
}
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
36
|
+
type OpenAPISourceOptions = SchemaToPagesOptions & {
|
|
37
|
+
baseDir?: string; /** Generate `meta.json` files */
|
|
38
|
+
meta?: boolean | {
|
|
39
|
+
folderStyle?: 'folder' | 'separator';
|
|
40
|
+
};
|
|
41
|
+
};
|
|
39
42
|
/**
|
|
40
43
|
* Generate virtual pages for Fumadocs Source API
|
|
41
44
|
*/
|
|
42
|
-
declare function openapiSource(server: OpenAPIServer, options?:
|
|
43
|
-
baseDir?: string; /** Generate `meta.json` files */
|
|
44
|
-
meta?: boolean | MetaOptions;
|
|
45
|
-
}): Promise<Source<{
|
|
45
|
+
declare function openapiSource(server: OpenAPIServer, options?: OpenAPISourceOptions): Promise<Source<{
|
|
46
46
|
metaData: MetaData;
|
|
47
47
|
pageData: OpenAPIPageData;
|
|
48
48
|
}>>;
|
|
@@ -51,4 +51,4 @@ declare function openapiSource(server: OpenAPIServer, options?: SchemaToPagesOpt
|
|
|
51
51
|
*/
|
|
52
52
|
declare function transformerOpenAPI(): PageTreeTransformer;
|
|
53
53
|
//#endregion
|
|
54
|
-
export { InternalOpenAPIMeta, openapiPlugin, openapiSource, transformerOpenAPI };
|
|
54
|
+
export { InternalOpenAPIMeta, OpenAPIPageData, OpenAPISourceOptions, openapiPlugin, openapiSource, transformerOpenAPI };
|
|
@@ -97,7 +97,7 @@ async function openapiSource(server, options = {}) {
|
|
|
97
97
|
else pages.push(`---${entry.info.title}---`, `...${relativePath}`);
|
|
98
98
|
} else {
|
|
99
99
|
onEntry(entry);
|
|
100
|
-
pages.push(relativePath.slice(0, -
|
|
100
|
+
pages.push(relativePath.slice(0, -PathUtils.extname(entry.path).length));
|
|
101
101
|
}
|
|
102
102
|
}
|
|
103
103
|
if (pages.length === 0) return;
|
package/dist/ui/base.d.ts
CHANGED
|
@@ -71,7 +71,7 @@ interface CreateAPIPageOptions {
|
|
|
71
71
|
*/
|
|
72
72
|
mediaAdapters?: Record<string, MediaAdapter>;
|
|
73
73
|
/**
|
|
74
|
-
*
|
|
74
|
+
* Customize page content
|
|
75
75
|
*/
|
|
76
76
|
content?: {
|
|
77
77
|
renderResponseTabs?: (tabs: ResponseTab[], ctx: RenderContext) => ReactNode;
|
|
@@ -133,7 +133,7 @@ interface CreateAPIPageOptions {
|
|
|
133
133
|
showExample?: boolean;
|
|
134
134
|
};
|
|
135
135
|
/**
|
|
136
|
-
*
|
|
136
|
+
* Customize API playground
|
|
137
137
|
*/
|
|
138
138
|
playground?: {
|
|
139
139
|
/**
|
|
@@ -10,7 +10,6 @@ import * as DialogPrimitive from "@radix-ui/react-dialog";
|
|
|
10
10
|
const Dialog = DialogPrimitive.Root;
|
|
11
11
|
const DialogTrigger = DialogPrimitive.Trigger;
|
|
12
12
|
const DialogPortal = DialogPrimitive.Portal;
|
|
13
|
-
DialogPrimitive.Close;
|
|
14
13
|
const DialogOverlay = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(DialogPrimitive.Overlay, {
|
|
15
14
|
ref,
|
|
16
15
|
className: cn("fixed inset-0 z-50 bg-black/30 backdrop-blur-sm data-[state=open]:animate-fd-fade-in data-[state=closed]:animate-fd-fade-out", className),
|
|
@@ -5,7 +5,6 @@ import { Check, ChevronDown, ChevronUp } from "lucide-react";
|
|
|
5
5
|
import * as SelectPrimitive from "@radix-ui/react-select";
|
|
6
6
|
//#region src/ui/components/select.tsx
|
|
7
7
|
const Select = SelectPrimitive.Root;
|
|
8
|
-
SelectPrimitive.Group;
|
|
9
8
|
const SelectValue = SelectPrimitive.Value;
|
|
10
9
|
const SelectTrigger = forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsxs(SelectPrimitive.Trigger, {
|
|
11
10
|
ref,
|
package/dist/ui/schema/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { I18nLabel } from "../client/i18n.js";
|
|
2
2
|
import { mergeAllOf } from "../../utils/schema/merge.js";
|
|
3
|
-
import {
|
|
3
|
+
import { schemaToString } from "../../utils/schema/to-string.js";
|
|
4
4
|
import { useMemo } from "react";
|
|
5
5
|
import { jsx } from "react/jsx-runtime";
|
|
6
6
|
//#region src/ui/schema/index.tsx
|
|
@@ -103,7 +103,7 @@ function generateSchemaUI(root, readOnly = false, writeOnly = false, ctx) {
|
|
|
103
103
|
description: schema.description ? ctx.renderMarkdown(schema.description) : void 0,
|
|
104
104
|
infoTags: generateInfoTags(schema),
|
|
105
105
|
typeName: schemaToString(schema, ctx.schema),
|
|
106
|
-
aliasName: schemaToString(schema, ctx.schema,
|
|
106
|
+
aliasName: schemaToString(schema, ctx.schema, 1),
|
|
107
107
|
deprecated: schema.deprecated
|
|
108
108
|
};
|
|
109
109
|
}
|
|
@@ -180,7 +180,7 @@ function generateSchemaUI(root, readOnly = false, writeOnly = false, ctx) {
|
|
|
180
180
|
});
|
|
181
181
|
out.items.push({
|
|
182
182
|
$type: key,
|
|
183
|
-
name: refs[itemId]?.aliasName ?? schemaToString(item, ctx.schema,
|
|
183
|
+
name: refs[itemId]?.aliasName ?? schemaToString(item, ctx.schema, 1)
|
|
184
184
|
});
|
|
185
185
|
}
|
|
186
186
|
return;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { bundle } from "../../node_modules/.pnpm/@scalar_json-magic@0.12.
|
|
2
|
-
import { upgrade } from "../../node_modules/.pnpm/@scalar_openapi-upgrader@0.2.
|
|
3
|
-
import { fetchUrls } from "../../node_modules/.pnpm/@scalar_json-magic@0.12.
|
|
4
|
-
import { readFiles } from "../../node_modules/.pnpm/@scalar_json-magic@0.12.
|
|
5
|
-
import "../../node_modules/.pnpm/@scalar_json-magic@0.12.
|
|
1
|
+
import { bundle } from "../../node_modules/.pnpm/@scalar_json-magic@0.12.7/node_modules/@scalar/json-magic/dist/bundle/bundle.js";
|
|
2
|
+
import { upgrade } from "../../node_modules/.pnpm/@scalar_openapi-upgrader@0.2.5/node_modules/@scalar/openapi-upgrader/dist/upgrade.js";
|
|
3
|
+
import { fetchUrls } from "../../node_modules/.pnpm/@scalar_json-magic@0.12.7/node_modules/@scalar/json-magic/dist/bundle/plugins/fetch-urls/index.js";
|
|
4
|
+
import { readFiles } from "../../node_modules/.pnpm/@scalar_json-magic@0.12.7/node_modules/@scalar/json-magic/dist/bundle/plugins/read-files/index.js";
|
|
5
|
+
import "../../node_modules/.pnpm/@scalar_json-magic@0.12.7/node_modules/@scalar/json-magic/dist/bundle/plugins/node.js";
|
|
6
6
|
import { dereferenceDocument } from "./dereference.js";
|
|
7
7
|
//#region src/utils/document/process.ts
|
|
8
8
|
/**
|
|
@@ -1,10 +1,5 @@
|
|
|
1
1
|
//#region src/utils/schema/to-string.ts
|
|
2
|
-
|
|
3
|
-
FormatFlags[FormatFlags["None"] = 0] = "None";
|
|
4
|
-
FormatFlags[FormatFlags["UseAlias"] = 1] = "UseAlias";
|
|
5
|
-
return FormatFlags;
|
|
6
|
-
}({});
|
|
7
|
-
function schemaToString(value, _resolver, flags = FormatFlags.None) {
|
|
2
|
+
function schemaToString(value, _resolver, flags = 0) {
|
|
8
3
|
const resolver = typeof _resolver === "function" ? _resolver : (schema) => {
|
|
9
4
|
const ref = _resolver && typeof schema === "object" ? _resolver.getRawRef(schema) : void 0;
|
|
10
5
|
return {
|
|
@@ -16,7 +11,7 @@ function schemaToString(value, _resolver, flags = FormatFlags.None) {
|
|
|
16
11
|
const members = /* @__PURE__ */ new Set();
|
|
17
12
|
let nullable = false;
|
|
18
13
|
for (const item of union) {
|
|
19
|
-
const result = run(item, flags |
|
|
14
|
+
const result = run(item, flags | 1);
|
|
20
15
|
if (result === "null") nullable = true;
|
|
21
16
|
else if (result !== "unknown") members.add(result);
|
|
22
17
|
}
|
|
@@ -27,7 +22,7 @@ function schemaToString(value, _resolver, flags = FormatFlags.None) {
|
|
|
27
22
|
const { dereferenced: schema, raw } = resolver(input);
|
|
28
23
|
if (schema === true) return "any";
|
|
29
24
|
else if (schema === false) return "never";
|
|
30
|
-
if ((flags &
|
|
25
|
+
if ((flags & 1) === 1) {
|
|
31
26
|
if (schema.title) return schema.title;
|
|
32
27
|
if (typeof raw === "object" && raw.$ref) {
|
|
33
28
|
const ref = raw.$ref.split("/");
|
|
@@ -38,7 +33,7 @@ function schemaToString(value, _resolver, flags = FormatFlags.None) {
|
|
|
38
33
|
...schema,
|
|
39
34
|
type
|
|
40
35
|
})), " | ", flags);
|
|
41
|
-
if (schema.type === "array") return `array<${schema.items ? run(schema.items, flags |
|
|
36
|
+
if (schema.type === "array") return `array<${schema.items ? run(schema.items, flags | 1) : "unknown"}>`;
|
|
42
37
|
const or = schema.oneOf ?? schema.anyOf;
|
|
43
38
|
if (schema.oneOf && schema.anyOf) return `(${union(schema.oneOf, " | ", flags)}) & (${union(schema.anyOf, " | ", flags)})`;
|
|
44
39
|
else if (or) return union(or, " | ", flags);
|
|
@@ -52,4 +47,4 @@ function schemaToString(value, _resolver, flags = FormatFlags.None) {
|
|
|
52
47
|
return run(value, flags);
|
|
53
48
|
}
|
|
54
49
|
//#endregion
|
|
55
|
-
export {
|
|
50
|
+
export { schemaToString };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "fumadocs-openapi",
|
|
3
|
-
"version": "10.
|
|
3
|
+
"version": "10.8.0",
|
|
4
4
|
"description": "Generate MDX docs for your OpenAPI spec",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"Docs",
|
|
@@ -64,23 +64,23 @@
|
|
|
64
64
|
},
|
|
65
65
|
"devDependencies": {
|
|
66
66
|
"@fastify/deepmerge": "^3.2.1",
|
|
67
|
-
"@scalar/api-client-react": "
|
|
68
|
-
"@scalar/json-magic": "^0.12.
|
|
69
|
-
"@scalar/openapi-upgrader": "^0.2.
|
|
67
|
+
"@scalar/api-client-react": "2.0.1",
|
|
68
|
+
"@scalar/json-magic": "^0.12.7",
|
|
69
|
+
"@scalar/openapi-upgrader": "^0.2.5",
|
|
70
70
|
"@types/js-yaml": "^4.0.9",
|
|
71
71
|
"@types/node": "25.6.0",
|
|
72
72
|
"@types/react": "^19.2.14",
|
|
73
73
|
"fast-content-type-parse": "^3.0.0",
|
|
74
74
|
"json-schema-typed": "^8.0.2",
|
|
75
75
|
"tailwindcss": "^4.2.2",
|
|
76
|
-
"tsdown": "0.21.
|
|
76
|
+
"tsdown": "0.21.9",
|
|
77
77
|
"@fumadocs/tailwind": "0.0.5",
|
|
78
|
-
"fumadocs-core": "16.
|
|
79
|
-
"fumadocs-ui": "16.
|
|
78
|
+
"fumadocs-core": "16.8.1",
|
|
79
|
+
"fumadocs-ui": "16.8.1",
|
|
80
80
|
"tsconfig": "0.0.0"
|
|
81
81
|
},
|
|
82
82
|
"peerDependencies": {
|
|
83
|
-
"@scalar/api-client-react": "2.
|
|
83
|
+
"@scalar/api-client-react": "2.0.1",
|
|
84
84
|
"@types/react": "*",
|
|
85
85
|
"fumadocs-core": "^16.7.15",
|
|
86
86
|
"fumadocs-ui": "^16.7.15",
|
|
@@ -101,9 +101,9 @@
|
|
|
101
101
|
},
|
|
102
102
|
"inlinedDependencies": {
|
|
103
103
|
"@fastify/deepmerge": "3.2.1",
|
|
104
|
-
"@scalar/helpers": "0.
|
|
105
|
-
"@scalar/json-magic": "0.12.
|
|
106
|
-
"@scalar/openapi-upgrader": "0.2.
|
|
104
|
+
"@scalar/helpers": "0.5.1",
|
|
105
|
+
"@scalar/json-magic": "0.12.7",
|
|
106
|
+
"@scalar/openapi-upgrader": "0.2.5",
|
|
107
107
|
"fast-content-type-parse": "3.0.0",
|
|
108
108
|
"pathe": "2.0.3",
|
|
109
109
|
"yaml": "2.8.3"
|
|
File without changes
|