fumadocs-openapi 4.4.1 → 5.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.
@@ -1,56 +0,0 @@
1
- interface BaseRequestField {
2
- name: string;
3
- description?: string;
4
- }
5
- interface BaseSchema {
6
- description?: string;
7
- isRequired: boolean;
8
- }
9
- type PrimitiveRequestField = BaseRequestField & PrimitiveSchema;
10
- interface PrimitiveSchema extends BaseSchema {
11
- type: 'boolean' | 'string' | 'number';
12
- defaultValue: string;
13
- }
14
- interface ReferenceSchema extends BaseSchema {
15
- type: 'ref';
16
- schema: string;
17
- }
18
- interface ArraySchema extends BaseSchema {
19
- type: 'array';
20
- /**
21
- * Reference to item schema or the schema
22
- */
23
- items: string | RequestSchema;
24
- }
25
- interface FileSchema extends BaseSchema {
26
- type: 'file';
27
- }
28
- interface ObjectSchema extends BaseSchema {
29
- type: 'object';
30
- properties: Record<string, ReferenceSchema>;
31
- /**
32
- * Reference to schema, or true if it's `any`
33
- */
34
- additionalProperties?: boolean | string;
35
- }
36
- interface SwitcherSchema extends BaseSchema {
37
- type: 'switcher';
38
- items: Record<string, ReferenceSchema | RequestSchema>;
39
- }
40
- interface NullSchema extends BaseSchema {
41
- type: 'null';
42
- }
43
- type RequestSchema = PrimitiveSchema | ArraySchema | ObjectSchema | SwitcherSchema | NullSchema | FileSchema;
44
- interface APIPlaygroundProps {
45
- route: string;
46
- method: string;
47
- bodyType: 'json' | 'form-data';
48
- authorization?: PrimitiveRequestField;
49
- path?: PrimitiveRequestField[];
50
- query?: PrimitiveRequestField[];
51
- header?: PrimitiveRequestField[];
52
- body?: RequestSchema;
53
- schemas: Record<string, RequestSchema>;
54
- }
55
-
56
- export type { APIPlaygroundProps as A, PrimitiveRequestField as P, RequestSchema as R, ReferenceSchema as a };
@@ -1,10 +0,0 @@
1
- import { BuildPageTreeOptions } from 'fumadocs-core/source';
2
-
3
- /**
4
- * Source API Integration
5
- *
6
- * Add this to page tree builder options
7
- */
8
- declare const attachFile: BuildPageTreeOptions['attachFile'];
9
-
10
- export { attachFile };
@@ -1,39 +0,0 @@
1
- import {
2
- getBadgeColor
3
- } from "../chunk-UG2WFM5D.js";
4
-
5
- // src/source/index.ts
6
- import React from "react";
7
- import { cva } from "class-variance-authority";
8
- var attachFile = (node, file) => {
9
- if (!file) return node;
10
- const data = file.data.data;
11
- if ("method" in data && typeof data.method === "string") {
12
- node.name = [node.name, " ", ApiIndicator({ method: data.method })];
13
- }
14
- return node;
15
- };
16
- var badgeVariants = cva("rounded-full border px-1.5 text-xs font-medium", {
17
- variants: {
18
- color: {
19
- green: "bg-green-400/20 text-green-600 dark:text-green-400",
20
- yellow: "bg-yellow-400/20 text-yellow-600 dark:text-yellow-400",
21
- red: "bg-red-400/20 text-red-600 dark:text-red-400",
22
- blue: "bg-blue-400/20 text-blue-600 dark:text-blue-400",
23
- orange: "bg-orange-400/20 text-orange-600 dark:text-orange-400"
24
- }
25
- }
26
- });
27
- function ApiIndicator({ method }) {
28
- const color = getBadgeColor(method);
29
- return React.createElement(
30
- "span",
31
- {
32
- className: badgeVariants({ className: "ms-auto", color })
33
- },
34
- method
35
- );
36
- }
37
- export {
38
- attachFile
39
- };