fumadocs-openapi 3.2.0 → 4.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.
- package/dist/chunk-RSFOKBAM.js +115 -0
- package/dist/index.d.ts +9 -2
- package/dist/index.js +291 -58
- package/dist/playground-D8pYn13F.d.ts +52 -0
- package/dist/playground-XE3Y6DRJ.js +963 -0
- package/dist/ui/index.d.ts +46 -0
- package/dist/ui/index.js +197 -0
- package/package.json +39 -4
|
@@ -0,0 +1,52 @@
|
|
|
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 ObjectSchema extends BaseSchema {
|
|
26
|
+
type: 'object';
|
|
27
|
+
properties: Record<string, ReferenceSchema>;
|
|
28
|
+
/**
|
|
29
|
+
* Reference to schema, or true if it's `any`
|
|
30
|
+
*/
|
|
31
|
+
additionalProperties?: boolean | string;
|
|
32
|
+
}
|
|
33
|
+
interface SwitcherSchema extends BaseSchema {
|
|
34
|
+
type: 'switcher';
|
|
35
|
+
items: Record<string, ReferenceSchema | RequestSchema>;
|
|
36
|
+
}
|
|
37
|
+
interface NullSchema extends BaseSchema {
|
|
38
|
+
type: 'null';
|
|
39
|
+
}
|
|
40
|
+
type RequestSchema = PrimitiveSchema | ArraySchema | ObjectSchema | SwitcherSchema | NullSchema;
|
|
41
|
+
interface APIPlaygroundProps {
|
|
42
|
+
route: string;
|
|
43
|
+
method: string;
|
|
44
|
+
authorization?: PrimitiveRequestField;
|
|
45
|
+
path?: PrimitiveRequestField[];
|
|
46
|
+
query?: PrimitiveRequestField[];
|
|
47
|
+
header?: PrimitiveRequestField[];
|
|
48
|
+
body?: RequestSchema;
|
|
49
|
+
schemas: Record<string, RequestSchema>;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
export type { APIPlaygroundProps as A, PrimitiveRequestField as P, RequestSchema as R, ReferenceSchema as a };
|