fumadocs-openapi 9.3.11 → 9.3.13

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.
@@ -1 +1 @@
1
- {"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../src/render/schema.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAY,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AACjD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AACrD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAe7C,wBAAgB,MAAM,CAAC,EACrB,IAAI,EACJ,MAAM,EACN,QAAgB,EAChB,QAAgB,EAChB,SAAiB,EACjB,EAAe,EACf,GAAG,EAAE,aAAa,GACnB,EAAE;IACD,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,MAAM,EAAE,cAAc,CAAC;IACvB,EAAE,CAAC,EAAE,UAAU,GAAG,MAAM,CAAC;IAEzB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,GAAG,EAAE,aAAa,CAAC;CACpB,GAAG,SAAS,CA+TZ"}
1
+ {"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../src/render/schema.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAY,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AACjD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AACrD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAe7C,wBAAgB,MAAM,CAAC,EACrB,IAAI,EACJ,MAAM,EACN,QAAgB,EAChB,QAAgB,EAChB,SAAiB,EACjB,EAAe,EACf,GAAG,EAAE,aAAa,GACnB,EAAE;IACD,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,MAAM,EAAE,cAAc,CAAC;IACvB,EAAE,CAAC,EAAE,UAAU,GAAG,MAAM,CAAC;IAEzB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,GAAG,EAAE,aAAa,CAAC;CACpB,GAAG,SAAS,CA4UZ"}
@@ -95,6 +95,12 @@ export function Schema({ name, schema, required = false, readOnly = false, write
95
95
  key: 'Properties',
96
96
  value: range,
97
97
  });
98
+ range = getRange('items', schema.minItems, undefined, schema.maxItems, undefined);
99
+ if (range)
100
+ fields.push({
101
+ key: 'Items',
102
+ value: range,
103
+ });
98
104
  if (schema.enum) {
99
105
  fields.push({
100
106
  key: 'Value in',
@@ -1,10 +1,17 @@
1
1
  import type { PageTree } from 'fumadocs-core/server';
2
- import type { PageFile, PageTreeTransformer } from 'fumadocs-core/source';
2
+ import type { LoaderPlugin, PageFile, PageTreeTransformer } from 'fumadocs-core/source';
3
3
  /**
4
- * Source API Integration
4
+ * Fumadocs Source API integration, pass this to `plugins` array in `loader()`.
5
+ */
6
+ export declare function openapiPlugin(): LoaderPlugin;
7
+ /**
8
+ * Source API Integration, add this to page tree builder options.
5
9
  *
6
- * Add this to page tree builder options
10
+ * @deprecated use `openapiPlugin()`
7
11
  */
8
12
  export declare const attachFile: (node: PageTree.Item, file: PageFile | undefined) => PageTree.Item;
13
+ /**
14
+ * @deprecated use `openapiPlugin()`
15
+ */
9
16
  export declare function transformerOpenAPI(): PageTreeTransformer;
10
17
  //# sourceMappingURL=source-api.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"source-api.d.ts","sourceRoot":"","sources":["../../src/server/source-api.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,KAAK,EAAE,QAAQ,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAC;AAE1E;;;;GAIG;AACH,eAAO,MAAM,UAAU,GACrB,MAAM,QAAQ,CAAC,IAAI,EACnB,MAAM,QAAQ,GAAG,SAAS,KACzB,QAAQ,CAAC,IA4BX,CAAC;AAEF,wBAAgB,kBAAkB,IAAI,mBAAmB,CASxD"}
1
+ {"version":3,"file":"source-api.d.ts","sourceRoot":"","sources":["../../src/server/source-api.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,KAAK,EACV,YAAY,EACZ,QAAQ,EACR,mBAAmB,EACpB,MAAM,sBAAsB,CAAC;AAE9B;;GAEG;AACH,wBAAgB,aAAa,IAAI,YAAY,CAkC5C;AAED;;;;GAIG;AACH,eAAO,MAAM,UAAU,GACrB,MAAM,QAAQ,CAAC,IAAI,EACnB,MAAM,QAAQ,GAAG,SAAS,KACzB,QAAQ,CAAC,IA4BX,CAAC;AAEF;;GAEG;AACH,wBAAgB,kBAAkB,IAAI,mBAAmB,CAExD"}
@@ -1,9 +1,35 @@
1
1
  import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { MethodLabel } from '../ui/components/method-label.js';
3
3
  /**
4
- * Source API Integration
4
+ * Fumadocs Source API integration, pass this to `plugins` array in `loader()`.
5
+ */
6
+ export function openapiPlugin() {
7
+ return {
8
+ transformPageTree: {
9
+ file(node, filePath) {
10
+ if (!filePath)
11
+ return node;
12
+ const file = this.storage.read(filePath);
13
+ if (!file || file.format !== 'page')
14
+ return node;
15
+ const data = file.data;
16
+ let method;
17
+ if ('_openapi' in data && typeof data._openapi === 'object') {
18
+ const meta = data._openapi;
19
+ method = meta.method;
20
+ }
21
+ if (method) {
22
+ node.name = (_jsxs(_Fragment, { children: [node.name, ' ', _jsx(MethodLabel, { className: "ms-auto text-xs text-nowrap", children: method })] }));
23
+ }
24
+ return node;
25
+ },
26
+ },
27
+ };
28
+ }
29
+ /**
30
+ * Source API Integration, add this to page tree builder options.
5
31
  *
6
- * Add this to page tree builder options
32
+ * @deprecated use `openapiPlugin()`
7
33
  */
8
34
  export const attachFile = (node, file) => {
9
35
  if (!file)
@@ -22,13 +48,9 @@ export const attachFile = (node, file) => {
22
48
  }
23
49
  return node;
24
50
  };
51
+ /**
52
+ * @deprecated use `openapiPlugin()`
53
+ */
25
54
  export function transformerOpenAPI() {
26
- return {
27
- file(node, file) {
28
- if (!file)
29
- return node;
30
- const content = this.storage.read(file);
31
- return attachFile(node, content?.format === 'page' ? content : undefined);
32
- },
33
- };
55
+ return openapiPlugin().transformPageTree;
34
56
  }
@@ -1 +1 @@
1
- {"version":3,"file":"process-document.d.ts","sourceRoot":"","sources":["../../src/utils/process-document.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AACxC,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAClD,OAAO,KAAK,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAK5D,MAAM,MAAM,iBAAiB,GAAG;IAC9B;;OAEG;IACH,YAAY,EAAE,WAAW,CAAC,QAAQ,CAAC,CAAC;IAEpC;;OAEG;IACH,SAAS,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,MAAM,GAAG,SAAS,CAAC;IAE/C,OAAO,EAAE,QAAQ,CAAC;CACnB,CAAC;AAIF,wBAAsB,qBAAqB,CACzC,KAAK,EAAE,MAAM,GAAG,WAAW,CAAC,QAAQ,GAAG,SAAS,CAAC,QAAQ,GACxD,OAAO,CAAC,iBAAiB,CAAC,CAS5B;AAED;;GAEG;AACH,wBAAsB,eAAe,CACnC,KAAK,EAAE,MAAM,GAAG,WAAW,CAAC,QAAQ,GAAG,SAAS,CAAC,QAAQ,GACxD,OAAO,CAAC,iBAAiB,CAAC,CA+B5B"}
1
+ {"version":3,"file":"process-document.d.ts","sourceRoot":"","sources":["../../src/utils/process-document.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AACxC,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAClD,OAAO,KAAK,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAK5D,MAAM,MAAM,iBAAiB,GAAG;IAC9B;;OAEG;IACH,YAAY,EAAE,WAAW,CAAC,QAAQ,CAAC,CAAC;IAEpC;;OAEG;IACH,SAAS,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,MAAM,GAAG,SAAS,CAAC;IAE/C,OAAO,EAAE,QAAQ,CAAC;CACnB,CAAC;AAIF,wBAAsB,qBAAqB,CACzC,KAAK,EAAE,MAAM,GAAG,WAAW,CAAC,QAAQ,GAAG,SAAS,CAAC,QAAQ,GACxD,OAAO,CAAC,iBAAiB,CAAC,CAS5B;AAED;;GAEG;AACH,wBAAsB,eAAe,CACnC,KAAK,EAAE,MAAM,GAAG,WAAW,CAAC,QAAQ,GAAG,SAAS,CAAC,QAAQ,GACxD,OAAO,CAAC,iBAAiB,CAAC,CAqC5B"}
@@ -25,7 +25,13 @@ export async function processDocument(input) {
25
25
  throw new Error(`Failed to resolve ${node.$ref}`);
26
26
  },
27
27
  },
28
- }).then((v) => upgrade(v).specification);
28
+ })
29
+ .then((v) => upgrade(v).specification)
30
+ .catch((e) => {
31
+ throw new Error(`[OpenAPI] Failed to resolve input: ${input}`, {
32
+ cause: e,
33
+ });
34
+ });
29
35
  /**
30
36
  * Dereferenced value and its original `$ref` value
31
37
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fumadocs-openapi",
3
- "version": "9.3.11",
3
+ "version": "9.3.13",
4
4
  "description": "Generate MDX docs for your OpenAPI spec",
5
5
  "keywords": [
6
6
  "NextJs",
@@ -50,8 +50,8 @@
50
50
  "@radix-ui/react-dialog": "^1.1.15",
51
51
  "@radix-ui/react-select": "^2.2.6",
52
52
  "@radix-ui/react-slot": "^1.2.3",
53
- "@scalar/json-magic": "^0.4.2",
54
- "@scalar/openapi-parser": "0.20.5",
53
+ "@scalar/json-magic": "^0.5.2",
54
+ "@scalar/openapi-parser": "0.21.2",
55
55
  "ajv": "^8.17.1",
56
56
  "class-variance-authority": "^0.7.1",
57
57
  "github-slugger": "^2.0.0",
@@ -60,26 +60,26 @@
60
60
  "js-yaml": "^4.1.0",
61
61
  "next-themes": "^0.4.6",
62
62
  "openapi-sampler": "^1.6.1",
63
- "react-hook-form": "^7.62.0",
63
+ "react-hook-form": "^7.63.0",
64
64
  "remark": "^15.0.1",
65
65
  "remark-rehype": "^11.1.2",
66
66
  "tinyglobby": "^0.2.15",
67
67
  "xml-js": "^1.6.11",
68
- "fumadocs-core": "15.7.13",
69
- "fumadocs-ui": "15.7.13"
68
+ "fumadocs-core": "15.8.1",
69
+ "fumadocs-ui": "15.8.1"
70
70
  },
71
71
  "devDependencies": {
72
- "@scalar/api-client-react": "^1.3.37",
72
+ "@scalar/api-client-react": "^1.3.41",
73
73
  "@types/js-yaml": "^4.0.9",
74
- "@types/node": "24.3.3",
74
+ "@types/node": "24.5.2",
75
75
  "@types/openapi-sampler": "^1.0.3",
76
- "@types/react": "^19.1.13",
76
+ "@types/react": "^19.1.14",
77
77
  "json-schema-typed": "^8.0.1",
78
78
  "openapi-types": "^12.1.3",
79
79
  "tailwindcss": "^4.1.13",
80
80
  "tsc-alias": "^1.8.16",
81
- "tsconfig": "0.0.0",
82
- "eslint-config-custom": "0.0.0"
81
+ "eslint-config-custom": "0.0.0",
82
+ "tsconfig": "0.0.0"
83
83
  },
84
84
  "peerDependencies": {
85
85
  "@scalar/api-client-react": "*",