vitepress-openapi 0.1.14 → 0.1.16
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 +23 -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-DjUt0cr5.js → useOpenapi-BCJnxIc0.js} +1576 -1530
- package/dist/{useOpenapi-DEPZ2jCp.cjs → useOpenapi-DDAB-v6S.cjs} +52 -52
- package/dist/vitepress-openapi.client.cjs.js +146 -146
- package/dist/vitepress-openapi.client.es.js +10249 -10190
- 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/Feature/OAOperationContext.vue +3 -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 +28 -11
- package/src/composables/useTheme.ts +71 -0
- package/src/lib/examples/getPropertyExample.ts +9 -1
- package/src/lib/operation/operationData.ts +4 -2
- 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>;
|
|
@@ -89,6 +94,9 @@ export interface ServerConfig {
|
|
|
89
94
|
allowCustomServer?: boolean;
|
|
90
95
|
getServers?: GetServersFunction | null;
|
|
91
96
|
}
|
|
97
|
+
export interface StorageConfig {
|
|
98
|
+
prefix?: string;
|
|
99
|
+
}
|
|
92
100
|
export interface OperationLinkConfig {
|
|
93
101
|
linkPrefix?: string;
|
|
94
102
|
transformHref?: (href: string) => string;
|
|
@@ -114,6 +122,7 @@ export interface UseThemeConfig {
|
|
|
114
122
|
codeSamples?: Partial<CodeSamplesConfig>;
|
|
115
123
|
linksPrefixes?: Partial<LinksPrefixesConfig>;
|
|
116
124
|
server?: Partial<ServerConfig>;
|
|
125
|
+
storage?: Partial<StorageConfig>;
|
|
117
126
|
markdown?: Partial<MarkdownConfig>;
|
|
118
127
|
}
|
|
119
128
|
export interface CodeSamplesConfig {
|
|
@@ -149,6 +158,7 @@ type GetServersFunction = ({ method, path, operation }: {
|
|
|
149
158
|
}) => string[] | null;
|
|
150
159
|
export declare const DEFAULT_OPERATION_SLOTS: OperationSlot[];
|
|
151
160
|
export declare const DEFAULT_BASE_URL = "http://localhost";
|
|
161
|
+
export declare const DEFAULT_STORAGE_PREFIX = "--oa";
|
|
152
162
|
export declare const availableLanguages: LanguageConfig[];
|
|
153
163
|
export declare function useTheme(initialConfig?: PartialUseThemeConfig): {
|
|
154
164
|
isDark: import("vue").WritableComputedRef<boolean, boolean>;
|
|
@@ -196,6 +206,10 @@ export declare function useTheme(initialConfig?: PartialUseThemeConfig): {
|
|
|
196
206
|
navigationBar?: boolean | undefined;
|
|
197
207
|
statusBar?: boolean | undefined;
|
|
198
208
|
} | undefined;
|
|
209
|
+
examples?: {
|
|
210
|
+
behavior?: PlaygroundExampleBehavior | undefined;
|
|
211
|
+
playgroundExampleBehavior?: PlaygroundExampleBehavior | undefined;
|
|
212
|
+
} | undefined;
|
|
199
213
|
} | undefined;
|
|
200
214
|
security?: {
|
|
201
215
|
defaultScheme?: string | null | undefined;
|
|
@@ -261,6 +275,9 @@ export declare function useTheme(initialConfig?: PartialUseThemeConfig): {
|
|
|
261
275
|
allowCustomServer?: boolean | undefined;
|
|
262
276
|
getServers?: {} | null | undefined;
|
|
263
277
|
} | undefined;
|
|
278
|
+
storage?: {
|
|
279
|
+
prefix?: string | undefined;
|
|
280
|
+
} | undefined;
|
|
264
281
|
markdown?: {
|
|
265
282
|
operationLink?: false | {
|
|
266
283
|
linkPrefix?: string | undefined;
|
|
@@ -307,6 +324,10 @@ export declare function useTheme(initialConfig?: PartialUseThemeConfig): {
|
|
|
307
324
|
setPlaygroundJsonEditorNavigationBar: (value: boolean) => void;
|
|
308
325
|
getPlaygroundJsonEditorStatusBar: () => boolean | undefined;
|
|
309
326
|
setPlaygroundJsonEditorStatusBar: (value: boolean) => void;
|
|
327
|
+
getPlaygroundExamplesBehavior: () => PlaygroundExampleBehavior;
|
|
328
|
+
setPlaygroundExamplesBehavior: (value: PlaygroundExampleBehavior) => void;
|
|
329
|
+
getPlaygroundXExampleBehavior: () => PlaygroundExampleBehavior;
|
|
330
|
+
setPlaygroundXExampleBehavior: (value: PlaygroundExampleBehavior) => void;
|
|
310
331
|
getSecurityDefaultScheme: () => string | null | undefined;
|
|
311
332
|
setSecurityDefaultScheme: (value: string | null) => void;
|
|
312
333
|
getOperationBadges: () => OperationBadges[];
|
|
@@ -341,5 +362,7 @@ export declare function useTheme(initialConfig?: PartialUseThemeConfig): {
|
|
|
341
362
|
getExternalLinksNewTab: () => boolean;
|
|
342
363
|
setMarkdownConfig: (config: Partial<UnwrapNestedRefs<MarkdownConfig>>) => void;
|
|
343
364
|
getOperationLinkConfig: () => OperationLinkConfig | false | undefined;
|
|
365
|
+
getStoragePrefix: () => string;
|
|
366
|
+
setStorageConfig: (config: Partial<StorageConfig>) => void;
|
|
344
367
|
};
|
|
345
368
|
export {};
|
|
@@ -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;
|