vitepress-openapi 0.1.14 → 0.1.15
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/types/src/components/Playground/OAPlaygroundBodyInput.vue.d.ts +3 -0
- package/dist/types/src/components/Playground/OAPlaygroundParameterInput.vue.d.ts +19 -0
- package/dist/types/src/components/Playground/OAPlaygroundParameters.vue.d.ts +19 -0
- package/dist/types/src/components/ui/select-with-custom-option/SelectWithCustomOption.vue.d.ts +1 -1
- package/dist/types/src/composables/useTheme.d.ts +13 -0
- package/dist/types/src/lib/examples/getPropertyExample.d.ts +2 -0
- package/dist/types/src/lib/playground/playgroundExampleBehavior.d.ts +5 -0
- package/dist/{useOpenapi-DEPZ2jCp.cjs → useOpenapi-DHJ6SAsR.cjs} +51 -51
- package/dist/{useOpenapi-DjUt0cr5.js → useOpenapi-DqKJozk7.js} +1507 -1477
- package/dist/vitepress-openapi.client.cjs.js +146 -146
- package/dist/vitepress-openapi.client.es.js +8860 -8801
- package/dist/vitepress-openapi.css +1 -1
- package/dist/vitepress-openapi.node.cjs.js +1 -1
- package/dist/vitepress-openapi.node.es.js +1 -1
- package/package.json +1 -1
- package/src/components/Playground/OAPlayground.vue +7 -1
- package/src/components/Playground/OAPlaygroundBodyInput.vue +10 -2
- package/src/components/Playground/OAPlaygroundParameterInput.vue +20 -5
- package/src/components/Playground/OAPlaygroundParameters.vue +23 -8
- package/src/composables/useTheme.ts +41 -0
- package/src/lib/examples/getPropertyExample.ts +9 -1
- package/src/lib/parser/getSchemaUi.ts +9 -6
- package/src/lib/playground/playgroundExampleBehavior.ts +48 -0
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { OpenAPIV3 } from '@scalar/openapi-types';
|
|
2
|
+
import type { PlaygroundExampleBehavior } from '../../composables/useTheme';
|
|
2
3
|
import type { OAExampleObject } from '../../types';
|
|
3
4
|
interface Props {
|
|
4
5
|
operationId: string;
|
|
@@ -9,6 +10,8 @@ interface Props {
|
|
|
9
10
|
examples?: {
|
|
10
11
|
[key: string]: OAExampleObject;
|
|
11
12
|
};
|
|
13
|
+
exampleBehavior?: PlaygroundExampleBehavior;
|
|
14
|
+
xExampleBehavior?: PlaygroundExampleBehavior;
|
|
12
15
|
}
|
|
13
16
|
declare const _default: import("vue").DefineComponent<Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
14
17
|
submit: () => any;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { PlaygroundExampleBehavior } from '../../composables/useTheme';
|
|
1
2
|
declare const _default: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
2
3
|
parameter: {
|
|
3
4
|
type: ObjectConstructor;
|
|
@@ -14,6 +15,14 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
14
15
|
type: StringConstructor;
|
|
15
16
|
required: true;
|
|
16
17
|
};
|
|
18
|
+
exampleBehavior: {
|
|
19
|
+
type: () => PlaygroundExampleBehavior;
|
|
20
|
+
default: string;
|
|
21
|
+
};
|
|
22
|
+
xExampleBehavior: {
|
|
23
|
+
type: () => PlaygroundExampleBehavior;
|
|
24
|
+
default: string;
|
|
25
|
+
};
|
|
17
26
|
enabled: {
|
|
18
27
|
type: BooleanConstructor;
|
|
19
28
|
default: boolean;
|
|
@@ -42,6 +51,14 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
42
51
|
type: StringConstructor;
|
|
43
52
|
required: true;
|
|
44
53
|
};
|
|
54
|
+
exampleBehavior: {
|
|
55
|
+
type: () => PlaygroundExampleBehavior;
|
|
56
|
+
default: string;
|
|
57
|
+
};
|
|
58
|
+
xExampleBehavior: {
|
|
59
|
+
type: () => PlaygroundExampleBehavior;
|
|
60
|
+
default: string;
|
|
61
|
+
};
|
|
45
62
|
enabled: {
|
|
46
63
|
type: BooleanConstructor;
|
|
47
64
|
default: boolean;
|
|
@@ -55,6 +72,8 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
55
72
|
onSubmit?: ((...args: any[]) => any) | undefined;
|
|
56
73
|
"onUpdate:enabled"?: ((...args: any[]) => any) | undefined;
|
|
57
74
|
}>, {
|
|
75
|
+
exampleBehavior: PlaygroundExampleBehavior;
|
|
76
|
+
xExampleBehavior: PlaygroundExampleBehavior;
|
|
58
77
|
enabled: boolean;
|
|
59
78
|
hideLabel: boolean;
|
|
60
79
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { OpenAPIV3 } from '@scalar/openapi-types';
|
|
2
|
+
import type { PlaygroundExampleBehavior } from '../../composables/useTheme';
|
|
2
3
|
import type { SecurityUiItem } from '../../types';
|
|
3
4
|
declare const _default: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
4
5
|
operationId: {
|
|
@@ -46,6 +47,14 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
46
47
|
type: ObjectConstructor;
|
|
47
48
|
required: false;
|
|
48
49
|
};
|
|
50
|
+
exampleBehavior: {
|
|
51
|
+
type: () => PlaygroundExampleBehavior;
|
|
52
|
+
default: string;
|
|
53
|
+
};
|
|
54
|
+
xExampleBehavior: {
|
|
55
|
+
type: () => PlaygroundExampleBehavior;
|
|
56
|
+
default: string;
|
|
57
|
+
};
|
|
49
58
|
requestBody: {
|
|
50
59
|
type: ObjectConstructor;
|
|
51
60
|
required: false;
|
|
@@ -98,6 +107,14 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
98
107
|
type: ObjectConstructor;
|
|
99
108
|
required: false;
|
|
100
109
|
};
|
|
110
|
+
exampleBehavior: {
|
|
111
|
+
type: () => PlaygroundExampleBehavior;
|
|
112
|
+
default: string;
|
|
113
|
+
};
|
|
114
|
+
xExampleBehavior: {
|
|
115
|
+
type: () => PlaygroundExampleBehavior;
|
|
116
|
+
default: string;
|
|
117
|
+
};
|
|
101
118
|
requestBody: {
|
|
102
119
|
type: ObjectConstructor;
|
|
103
120
|
required: false;
|
|
@@ -107,6 +124,8 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
107
124
|
}>, {
|
|
108
125
|
parameters: OpenAPIV3.ParameterObject[];
|
|
109
126
|
servers: unknown[];
|
|
127
|
+
exampleBehavior: PlaygroundExampleBehavior;
|
|
128
|
+
xExampleBehavior: PlaygroundExampleBehavior;
|
|
110
129
|
securityUi: Record<string, any>;
|
|
111
130
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
112
131
|
export default _default;
|
package/dist/types/src/components/ui/select-with-custom-option/SelectWithCustomOption.vue.d.ts
CHANGED
|
@@ -10,8 +10,8 @@ declare const _default: import("vue").DefineComponent<SelectWithCustomOptionProp
|
|
|
10
10
|
"onUpdate:customValue"?: ((value: string) => any) | undefined;
|
|
11
11
|
"onUpdate:isCustom"?: ((value: boolean) => any) | undefined;
|
|
12
12
|
}>, {
|
|
13
|
-
modelValue: string;
|
|
14
13
|
placeholder: string;
|
|
14
|
+
modelValue: string;
|
|
15
15
|
isCustom: boolean;
|
|
16
16
|
customValue: string;
|
|
17
17
|
defaultCustomValue: string;
|
|
@@ -44,6 +44,7 @@ export interface ResponseConfig {
|
|
|
44
44
|
defaultView?: Ref<BodyViewType>;
|
|
45
45
|
};
|
|
46
46
|
}
|
|
47
|
+
export type PlaygroundExampleBehavior = 'placeholder' | 'value' | 'ignore';
|
|
47
48
|
export interface PlaygroundConfig {
|
|
48
49
|
jsonEditor?: {
|
|
49
50
|
mode?: Ref<PlaygroundJsonEditorMode>;
|
|
@@ -51,6 +52,10 @@ export interface PlaygroundConfig {
|
|
|
51
52
|
navigationBar?: Ref<boolean>;
|
|
52
53
|
statusBar?: Ref<boolean>;
|
|
53
54
|
};
|
|
55
|
+
examples?: {
|
|
56
|
+
behavior?: Ref<PlaygroundExampleBehavior>;
|
|
57
|
+
playgroundExampleBehavior?: Ref<PlaygroundExampleBehavior>;
|
|
58
|
+
};
|
|
54
59
|
}
|
|
55
60
|
export interface SecurityConfig {
|
|
56
61
|
defaultScheme?: Ref<string | null>;
|
|
@@ -196,6 +201,10 @@ export declare function useTheme(initialConfig?: PartialUseThemeConfig): {
|
|
|
196
201
|
navigationBar?: boolean | undefined;
|
|
197
202
|
statusBar?: boolean | undefined;
|
|
198
203
|
} | undefined;
|
|
204
|
+
examples?: {
|
|
205
|
+
behavior?: PlaygroundExampleBehavior | undefined;
|
|
206
|
+
playgroundExampleBehavior?: PlaygroundExampleBehavior | undefined;
|
|
207
|
+
} | undefined;
|
|
199
208
|
} | undefined;
|
|
200
209
|
security?: {
|
|
201
210
|
defaultScheme?: string | null | undefined;
|
|
@@ -307,6 +316,10 @@ export declare function useTheme(initialConfig?: PartialUseThemeConfig): {
|
|
|
307
316
|
setPlaygroundJsonEditorNavigationBar: (value: boolean) => void;
|
|
308
317
|
getPlaygroundJsonEditorStatusBar: () => boolean | undefined;
|
|
309
318
|
setPlaygroundJsonEditorStatusBar: (value: boolean) => void;
|
|
319
|
+
getPlaygroundExamplesBehavior: () => PlaygroundExampleBehavior;
|
|
320
|
+
setPlaygroundExamplesBehavior: (value: PlaygroundExampleBehavior) => void;
|
|
321
|
+
getPlaygroundXExampleBehavior: () => PlaygroundExampleBehavior;
|
|
322
|
+
setPlaygroundXExampleBehavior: (value: PlaygroundExampleBehavior) => void;
|
|
310
323
|
getSecurityDefaultScheme: () => string | null | undefined;
|
|
311
324
|
setSecurityDefaultScheme: (value: string | null) => void;
|
|
312
325
|
getOperationBadges: () => OperationBadges[];
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { PlaygroundExampleBehavior } from '../../composables/useTheme';
|
|
2
|
+
export declare function useExampleForPlaceholder(behavior: PlaygroundExampleBehavior): boolean;
|
|
3
|
+
export declare function useExampleForValue(behavior: PlaygroundExampleBehavior): boolean;
|
|
4
|
+
export declare function resolveExampleForValue(property: any, behavior: PlaygroundExampleBehavior, xExampleBehavior?: PlaygroundExampleBehavior): any;
|
|
5
|
+
export declare function resolveExampleForPlaceholder(property: any, behavior: PlaygroundExampleBehavior, xExampleBehavior?: PlaygroundExampleBehavior): any;
|