@scalar/schemas 0.4.3 → 0.6.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/CHANGELOG.md +21 -0
- package/dist/api-reference/api-reference-configuration.d.ts +36 -4
- package/dist/api-reference/api-reference-configuration.d.ts.map +1 -1
- package/dist/api-reference/api-reference-configuration.js +3 -7
- package/dist/api-reference/api-reference-plugin.d.ts +13 -0
- package/dist/api-reference/api-reference-plugin.d.ts.map +1 -1
- package/dist/api-reference/api-reference-plugin.js +10 -1
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,26 @@
|
|
|
1
1
|
# @scalar/schemas
|
|
2
2
|
|
|
3
|
+
## 0.6.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [#9515](https://github.com/scalar/scalar/pull/9515): feat: add `requestBuilt` client plugin hook and `onRequestBuilt` configuration callback that receive the exact fetch `Request` that is sent over the wire
|
|
8
|
+
|
|
9
|
+
The hook runs after the request has been built, right before it is sent. Header mutations apply to the outgoing request and the body bytes match what the server receives, which makes request signing possible: hashing the body of a rebuilt `multipart/form-data` request would produce a different multipart boundary than the request that is actually sent.
|
|
10
|
+
|
|
11
|
+
## 0.5.0
|
|
12
|
+
|
|
13
|
+
### Minor Changes
|
|
14
|
+
|
|
15
|
+
- [#9478](https://github.com/scalar/scalar/pull/9478): Add `content.start` plugin view slot and `sidebar` visibility option for plugin view components.
|
|
16
|
+
- **`content.start`**: A new view slot that renders custom plugin components **before** the Introduction/Info section (at the top of the content area).
|
|
17
|
+
- **`sidebar` option on `ViewComponent`**: Plugins can now opt-in to display a sidebar entry for their custom views by providing `sidebar: { show: true, label: 'My Page' }`. Omitting `sidebar` or setting `show: false` hides the entry from the sidebar. The entry hooks into the existing navigation, so clicking it scrolls to the plugin view and it highlights as it scrolls into view.
|
|
18
|
+
|
|
19
|
+
### Patch Changes
|
|
20
|
+
|
|
21
|
+
- [#9529](https://github.com/scalar/scalar/pull/9529): Remove the unused `isLoading` configuration option. It was never wired to a consumer, so it had no effect on the rendered references.
|
|
22
|
+
- [#9528](https://github.com/scalar/scalar/pull/9528): Remove the unused `onSpecUpdate` configuration option. It was never wired to a consumer, so the callback never fired.
|
|
23
|
+
|
|
3
24
|
## 0.4.3
|
|
4
25
|
|
|
5
26
|
### Patch Changes
|
|
@@ -51,10 +51,23 @@ export declare const apiReferenceConfigurationSchema: import("@scalar/validation
|
|
|
51
51
|
renderer: import("@scalar/validation").OptionalSchema<import("@scalar/validation").UnknownSchema>;
|
|
52
52
|
}>>[];
|
|
53
53
|
views: import("@scalar/validation").Static<import("@scalar/validation").ObjectSchema<{
|
|
54
|
+
'content.start': import("@scalar/validation").OptionalSchema<import("@scalar/validation").ArraySchema<import("@scalar/validation").ObjectSchema<{
|
|
55
|
+
component: import("@scalar/validation").UnknownSchema;
|
|
56
|
+
renderer: import("@scalar/validation").OptionalSchema<import("@scalar/validation").UnknownSchema>;
|
|
57
|
+
props: import("@scalar/validation").OptionalSchema<import("@scalar/validation").RecordSchema<import("@scalar/validation").StringSchema, import("@scalar/validation").AnySchema>>;
|
|
58
|
+
sidebar: import("@scalar/validation").OptionalSchema<import("@scalar/validation").ObjectSchema<{
|
|
59
|
+
show: import("@scalar/validation").BooleanSchema;
|
|
60
|
+
label: import("@scalar/validation").StringSchema;
|
|
61
|
+
}>>;
|
|
62
|
+
}>>>;
|
|
54
63
|
'content.end': import("@scalar/validation").OptionalSchema<import("@scalar/validation").ArraySchema<import("@scalar/validation").ObjectSchema<{
|
|
55
64
|
component: import("@scalar/validation").UnknownSchema;
|
|
56
65
|
renderer: import("@scalar/validation").OptionalSchema<import("@scalar/validation").UnknownSchema>;
|
|
57
66
|
props: import("@scalar/validation").OptionalSchema<import("@scalar/validation").RecordSchema<import("@scalar/validation").StringSchema, import("@scalar/validation").AnySchema>>;
|
|
67
|
+
sidebar: import("@scalar/validation").OptionalSchema<import("@scalar/validation").ObjectSchema<{
|
|
68
|
+
show: import("@scalar/validation").BooleanSchema;
|
|
69
|
+
label: import("@scalar/validation").StringSchema;
|
|
70
|
+
}>>;
|
|
58
71
|
}>>>;
|
|
59
72
|
}>>;
|
|
60
73
|
hooks: import("@scalar/validation").Static<import("@scalar/validation").ObjectSchema<{
|
|
@@ -69,7 +82,6 @@ export declare const apiReferenceConfigurationSchema: import("@scalar/validation
|
|
|
69
82
|
apiClientPlugins: any[];
|
|
70
83
|
}>>>;
|
|
71
84
|
isEditable: import("@scalar/validation").BooleanSchema;
|
|
72
|
-
isLoading: import("@scalar/validation").BooleanSchema;
|
|
73
85
|
hideModels: import("@scalar/validation").BooleanSchema;
|
|
74
86
|
modelsSectionLabel: import("@scalar/validation").OptionalSchema<import("@scalar/validation").UnionSchema<readonly [import("@scalar/validation").LiteralSchema<"Models">, import("@scalar/validation").LiteralSchema<"Schemas">, import("@scalar/validation").StringSchema]>>;
|
|
75
87
|
documentDownloadType: import("@scalar/validation").UnionSchema<readonly [import("@scalar/validation").LiteralSchema<"both">, import("@scalar/validation").LiteralSchema<"yaml">, import("@scalar/validation").LiteralSchema<"json">, import("@scalar/validation").LiteralSchema<"direct">, import("@scalar/validation").LiteralSchema<"none">]>;
|
|
@@ -88,7 +100,6 @@ export declare const apiReferenceConfigurationSchema: import("@scalar/validation
|
|
|
88
100
|
clientKey: import("@scalar/validation").StringSchema;
|
|
89
101
|
}>>;
|
|
90
102
|
customCss: import("@scalar/validation").OptionalSchema<import("@scalar/validation").StringSchema>;
|
|
91
|
-
onSpecUpdate: import("@scalar/validation").OptionalSchema<import("@scalar/validation").FunctionSchema<(input: string) => void>>;
|
|
92
103
|
onServerChange: import("@scalar/validation").OptionalSchema<import("@scalar/validation").FunctionSchema<(input: string) => void>>;
|
|
93
104
|
onDocumentSelect: import("@scalar/validation").OptionalSchema<import("@scalar/validation").FunctionSchema<() => void>>;
|
|
94
105
|
onLoaded: import("@scalar/validation").OptionalSchema<import("@scalar/validation").FunctionSchema<(slug: string) => Promise<void> | void>>;
|
|
@@ -97,6 +108,11 @@ export declare const apiReferenceConfigurationSchema: import("@scalar/validation
|
|
|
97
108
|
requestBuilder: unknown;
|
|
98
109
|
envVariables: Record<string, string>;
|
|
99
110
|
}) => Promise<void> | void>>;
|
|
111
|
+
onRequestBuilt: import("@scalar/validation").OptionalSchema<import("@scalar/validation").FunctionSchema<(input: {
|
|
112
|
+
request: Request;
|
|
113
|
+
requestBuilder: unknown;
|
|
114
|
+
envVariables: Record<string, string>;
|
|
115
|
+
}) => Promise<void> | void>>;
|
|
100
116
|
onShowMore: import("@scalar/validation").OptionalSchema<import("@scalar/validation").FunctionSchema<(tagId: string) => Promise<void> | void>>;
|
|
101
117
|
onSidebarClick: import("@scalar/validation").OptionalSchema<import("@scalar/validation").FunctionSchema<(href: string) => Promise<void> | void>>;
|
|
102
118
|
pathRouting: import("@scalar/validation").OptionalSchema<import("@scalar/validation").ObjectSchema<{
|
|
@@ -190,7 +206,6 @@ export declare const apiReferenceConfigurationWithSourceSchema: (rawInput: unkno
|
|
|
190
206
|
} & {
|
|
191
207
|
layout: "modern" | "classic";
|
|
192
208
|
isEditable: boolean;
|
|
193
|
-
isLoading: boolean;
|
|
194
209
|
hideModels: boolean;
|
|
195
210
|
documentDownloadType: "none" | "both" | "yaml" | "json" | "direct";
|
|
196
211
|
hideTestRequestButton: boolean;
|
|
@@ -217,10 +232,23 @@ export declare const apiReferenceConfigurationWithSourceSchema: (rawInput: unkno
|
|
|
217
232
|
renderer: import("@scalar/validation").OptionalSchema<import("@scalar/validation").UnknownSchema>;
|
|
218
233
|
}>>[];
|
|
219
234
|
views: import("@scalar/validation").Static<import("@scalar/validation").ObjectSchema<{
|
|
235
|
+
'content.start': import("@scalar/validation").OptionalSchema<import("@scalar/validation").ArraySchema<import("@scalar/validation").ObjectSchema<{
|
|
236
|
+
component: import("@scalar/validation").UnknownSchema;
|
|
237
|
+
renderer: import("@scalar/validation").OptionalSchema<import("@scalar/validation").UnknownSchema>;
|
|
238
|
+
props: import("@scalar/validation").OptionalSchema<import("@scalar/validation").RecordSchema<import("@scalar/validation").StringSchema, import("@scalar/validation").AnySchema>>;
|
|
239
|
+
sidebar: import("@scalar/validation").OptionalSchema<import("@scalar/validation").ObjectSchema<{
|
|
240
|
+
show: import("@scalar/validation").BooleanSchema;
|
|
241
|
+
label: import("@scalar/validation").StringSchema;
|
|
242
|
+
}>>;
|
|
243
|
+
}>>>;
|
|
220
244
|
'content.end': import("@scalar/validation").OptionalSchema<import("@scalar/validation").ArraySchema<import("@scalar/validation").ObjectSchema<{
|
|
221
245
|
component: import("@scalar/validation").UnknownSchema;
|
|
222
246
|
renderer: import("@scalar/validation").OptionalSchema<import("@scalar/validation").UnknownSchema>;
|
|
223
247
|
props: import("@scalar/validation").OptionalSchema<import("@scalar/validation").RecordSchema<import("@scalar/validation").StringSchema, import("@scalar/validation").AnySchema>>;
|
|
248
|
+
sidebar: import("@scalar/validation").OptionalSchema<import("@scalar/validation").ObjectSchema<{
|
|
249
|
+
show: import("@scalar/validation").BooleanSchema;
|
|
250
|
+
label: import("@scalar/validation").StringSchema;
|
|
251
|
+
}>>;
|
|
224
252
|
}>>>;
|
|
225
253
|
}>>;
|
|
226
254
|
hooks: import("@scalar/validation").Static<import("@scalar/validation").ObjectSchema<{
|
|
@@ -246,7 +274,6 @@ export declare const apiReferenceConfigurationWithSourceSchema: (rawInput: unkno
|
|
|
246
274
|
clientKey: string;
|
|
247
275
|
} | undefined;
|
|
248
276
|
customCss?: string | undefined;
|
|
249
|
-
onSpecUpdate?: ((input: string) => void) | undefined;
|
|
250
277
|
onServerChange?: ((input: string) => void) | undefined;
|
|
251
278
|
onDocumentSelect?: (() => void) | undefined;
|
|
252
279
|
onLoaded?: ((slug: string) => Promise<void> | void) | undefined;
|
|
@@ -255,6 +282,11 @@ export declare const apiReferenceConfigurationWithSourceSchema: (rawInput: unkno
|
|
|
255
282
|
requestBuilder: unknown;
|
|
256
283
|
envVariables: Record<string, string>;
|
|
257
284
|
}) => Promise<void> | void) | undefined;
|
|
285
|
+
onRequestBuilt?: ((input: {
|
|
286
|
+
request: Request;
|
|
287
|
+
requestBuilder: unknown;
|
|
288
|
+
envVariables: Record<string, string>;
|
|
289
|
+
}) => Promise<void> | void) | undefined;
|
|
258
290
|
onShowMore?: ((tagId: string) => Promise<void> | void) | undefined;
|
|
259
291
|
onSidebarClick?: ((href: string) => Promise<void> | void) | undefined;
|
|
260
292
|
pathRouting?: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"api-reference-configuration.d.ts","sourceRoot":"","sources":["../../src/api-reference/api-reference-configuration.ts"],"names":[],"mappings":"AAqBA,eAAO,MAAM,+BAA+B
|
|
1
|
+
{"version":3,"file":"api-reference-configuration.d.ts","sourceRoot":"","sources":["../../src/api-reference/api-reference-configuration.ts"],"names":[],"mappings":"AAqBA,eAAO,MAAM,+BAA+B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;oHAyFJ,MAAM,KAAK,IAAI;oHAGf,IAAI;6GAGX,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI;qHAKhD;QACN,OAAO,EAAE,OAAO,CAAA;QAChB,cAAc,EAAE,OAAO,CAAA;QACvB,YAAY,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;KACrC,KAAK,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI;oHASlB;QACN,OAAO,EAAE,OAAO,CAAA;QAChB,cAAc,EAAE,OAAO,CAAA;QACvB,YAAY,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;KACrC,KAAK,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI;gHAOE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI;mHAG5B,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI;;;;;;;;;yHA4BzB;QAAE,IAAI,CAAC,EAAE,MAAM,CAAA;KAAE,KAAK,MAAM;uHAG9B;QAAE,IAAI,CAAC,EAAE,MAAM,CAAA;KAAE,KAAK,MAAM;qHAG9B;QAAE,IAAI,CAAC,EAAE,MAAM,CAAA;KAAE,KAAK,MAAM;2HAIpD;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,WAAW,CAAC,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAC;QAAC,OAAO,CAAC,EAAE,MAAM,CAAA;KAAE,KAAK,MAAM;yHAKvD;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,MAAM,CAAC,EAAE,MAAM,CAAA;KAAE,KAAK,MAAM;kHAGnD;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE;YAAE,KAAK,EAAE,MAAM,CAAC;YAAC,IAAI,EAAE,MAAM,CAAA;SAAE,CAAA;KAAE,KAAK,MAAM;8GAG3E,MAAM,KAAK,MAAM,GAAG,IAAI,GAAG,SAAS;;;;;;;oNA+Bb,GAAG,KAAK,GAAG,KAAK,MAAM;gRAGG,GAAG,KAAK,GAAG,KAAK,MAAM;;;IAWtG,CAAA;AAKF,eAAO,MAAM,yCAAyC,GAAI,UAAU,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;8BAzInC,MAAM,KAAK,IAAI;8BAGf,IAAI;uBAGX,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI;+BAKhD;QACN,OAAO,EAAE,OAAO,CAAA;QAChB,cAAc,EAAE,OAAO,CAAA;QACvB,YAAY,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;KACrC,KAAK,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI;8BASlB;QACN,OAAO,EAAE,OAAO,CAAA;QAChB,cAAc,EAAE,OAAO,CAAA;QACvB,YAAY,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;KACrC,KAAK,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI;0BAOE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI;6BAG5B,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI;;;;;;;;;mCA4BzB;QAAE,IAAI,CAAC,EAAE,MAAM,CAAA;KAAE,KAAK,MAAM;iCAG9B;QAAE,IAAI,CAAC,EAAE,MAAM,CAAA;KAAE,KAAK,MAAM;+BAG9B;QAAE,IAAI,CAAC,EAAE,MAAM,CAAA;KAAE,KAAK,MAAM;qCAIpD;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,WAAW,CAAC,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAC;QAAC,OAAO,CAAC,EAAE,MAAM,CAAA;KAAE,KAAK,MAAM;mCAKvD;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,MAAM,CAAC,EAAE,MAAM,CAAA;KAAE,KAAK,MAAM;4BAGnD;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE;YAAE,KAAK,EAAE,MAAM,CAAC;YAAC,IAAI,EAAE,MAAM,CAAA;SAAE,CAAA;KAAE,KAAK,MAAM;wBAG3E,MAAM,KAAK,MAAM,GAAG,IAAI,GAAG,SAAS;gCA+Bb,GAAG,KAAK,GAAG,KAAK,MAAM;iDAGG,GAAG,KAAK,GAAG,KAAK,MAAM;CAuFvG,CAAA"}
|
|
@@ -26,10 +26,6 @@ export const apiReferenceConfigurationSchema = intersection([
|
|
|
26
26
|
default: false,
|
|
27
27
|
typeComment: 'Allows the user to inject an editor for the spec',
|
|
28
28
|
}),
|
|
29
|
-
isLoading: boolean({
|
|
30
|
-
default: false,
|
|
31
|
-
typeComment: 'Controls whether the references show a loading state in the intro',
|
|
32
|
-
}),
|
|
33
29
|
hideModels: boolean({
|
|
34
30
|
default: false,
|
|
35
31
|
typeComment: 'Whether to show models in the sidebar, search, and content.',
|
|
@@ -83,9 +79,6 @@ export const apiReferenceConfigurationSchema = intersection([
|
|
|
83
79
|
customCss: optional(string(), {
|
|
84
80
|
typeComment: 'Custom CSS to be added to the page',
|
|
85
81
|
}),
|
|
86
|
-
onSpecUpdate: optional(fn(), {
|
|
87
|
-
typeComment: 'onSpecUpdate is fired on spec/swagger content change',
|
|
88
|
-
}),
|
|
89
82
|
onServerChange: optional(fn(), {
|
|
90
83
|
typeComment: 'onServerChange is fired on selected server change',
|
|
91
84
|
}),
|
|
@@ -98,6 +91,9 @@ export const apiReferenceConfigurationSchema = intersection([
|
|
|
98
91
|
onBeforeRequest: optional(fn(), {
|
|
99
92
|
typeComment: 'Fired before the outbound request is built; callback receives a mutable request builder. Experimental API.',
|
|
100
93
|
}),
|
|
94
|
+
onRequestBuilt: optional(fn(), {
|
|
95
|
+
typeComment: 'Fired right before the outbound request is sent; callback receives the exact fetch Request that goes over the wire. Experimental API.',
|
|
96
|
+
}),
|
|
101
97
|
onShowMore: optional(fn(), {
|
|
102
98
|
typeComment: 'onShowMore is fired when the user clicks the "Show more" button on the references',
|
|
103
99
|
}),
|
|
@@ -5,10 +5,23 @@ declare const openApiExtensionSchema: import("@scalar/validation").ObjectSchema<
|
|
|
5
5
|
renderer: import("@scalar/validation").OptionalSchema<import("@scalar/validation").UnknownSchema>;
|
|
6
6
|
}>;
|
|
7
7
|
declare const viewsSchema: import("@scalar/validation").ObjectSchema<{
|
|
8
|
+
'content.start': import("@scalar/validation").OptionalSchema<import("@scalar/validation").ArraySchema<import("@scalar/validation").ObjectSchema<{
|
|
9
|
+
component: import("@scalar/validation").UnknownSchema;
|
|
10
|
+
renderer: import("@scalar/validation").OptionalSchema<import("@scalar/validation").UnknownSchema>;
|
|
11
|
+
props: import("@scalar/validation").OptionalSchema<import("@scalar/validation").RecordSchema<import("@scalar/validation").StringSchema, import("@scalar/validation").AnySchema>>;
|
|
12
|
+
sidebar: import("@scalar/validation").OptionalSchema<import("@scalar/validation").ObjectSchema<{
|
|
13
|
+
show: import("@scalar/validation").BooleanSchema;
|
|
14
|
+
label: import("@scalar/validation").StringSchema;
|
|
15
|
+
}>>;
|
|
16
|
+
}>>>;
|
|
8
17
|
'content.end': import("@scalar/validation").OptionalSchema<import("@scalar/validation").ArraySchema<import("@scalar/validation").ObjectSchema<{
|
|
9
18
|
component: import("@scalar/validation").UnknownSchema;
|
|
10
19
|
renderer: import("@scalar/validation").OptionalSchema<import("@scalar/validation").UnknownSchema>;
|
|
11
20
|
props: import("@scalar/validation").OptionalSchema<import("@scalar/validation").RecordSchema<import("@scalar/validation").StringSchema, import("@scalar/validation").AnySchema>>;
|
|
21
|
+
sidebar: import("@scalar/validation").OptionalSchema<import("@scalar/validation").ObjectSchema<{
|
|
22
|
+
show: import("@scalar/validation").BooleanSchema;
|
|
23
|
+
label: import("@scalar/validation").StringSchema;
|
|
24
|
+
}>>;
|
|
12
25
|
}>>>;
|
|
13
26
|
}>;
|
|
14
27
|
declare const lifecycleHooksSchema: import("@scalar/validation").ObjectSchema<{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"api-reference-plugin.d.ts","sourceRoot":"","sources":["../../src/api-reference/api-reference-plugin.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,MAAM,
|
|
1
|
+
{"version":3,"file":"api-reference-plugin.d.ts","sourceRoot":"","sources":["../../src/api-reference/api-reference-plugin.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,MAAM,EAAsE,MAAM,oBAAoB,CAAA;AAEpH,QAAA,MAAM,sBAAsB;;;;EAY1B,CAAA;AAyBF,QAAA,MAAM,WAAW;;;;;;;;;;;;;;;;;;;EAOf,CAAA;AAEF,QAAA,MAAM,oBAAoB;iHACS;QAAE,MAAM,EAAE,GAAG,CAAA;KAAE,KAAK,IAAI;yHAChB;QAAE,MAAM,EAAE,GAAG,CAAA;KAAE,KAAK,IAAI;6GACpC,IAAI;EACjC,CAAA;AAEF,eAAO,MAAM,wBAAwB,oDAE3B;IACJ,IAAI,EAAE,MAAM,CAAA;IACZ,UAAU,EAAE,MAAM,CAAC,OAAO,sBAAsB,CAAC,EAAE,CAAA;IACnD,KAAK,EAAE,MAAM,CAAC,OAAO,WAAW,CAAC,CAAA;IACjC,KAAK,EAAE,MAAM,CAAC,OAAO,oBAAoB,CAAC,CAAA;IAC1C,gBAAgB,EAAE,GAAG,EAAE,CAAA;CACxB,CACA,CAAA"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { any, array, fn, object, optional, record, string, unknown } from '@scalar/validation';
|
|
1
|
+
import { any, array, boolean, fn, object, optional, record, string, unknown } from '@scalar/validation';
|
|
2
2
|
const openApiExtensionSchema = object({
|
|
3
3
|
name: string({
|
|
4
4
|
typeComment: 'Name of specification extension property. Has to start with \`x-\`.',
|
|
@@ -20,8 +20,17 @@ const viewComponentSchema = object({
|
|
|
20
20
|
props: optional(record(string(), any()), {
|
|
21
21
|
typeComment: 'Additional props to pass to the component',
|
|
22
22
|
}),
|
|
23
|
+
sidebar: optional(object({
|
|
24
|
+
show: boolean(),
|
|
25
|
+
label: string(),
|
|
26
|
+
}), {
|
|
27
|
+
typeComment: 'Sidebar configuration. Set show: true to display in sidebar.',
|
|
28
|
+
}),
|
|
23
29
|
});
|
|
24
30
|
const viewsSchema = object({
|
|
31
|
+
'content.start': optional(array(viewComponentSchema), {
|
|
32
|
+
typeComment: 'Components to render before the Introduction/Info section',
|
|
33
|
+
}),
|
|
25
34
|
'content.end': optional(array(viewComponentSchema), {
|
|
26
35
|
typeComment: 'Components to render at specific views in the API Reference',
|
|
27
36
|
}),
|
package/package.json
CHANGED
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
"schemas",
|
|
15
15
|
"scalar"
|
|
16
16
|
],
|
|
17
|
-
"version": "0.
|
|
17
|
+
"version": "0.6.0",
|
|
18
18
|
"engines": {
|
|
19
19
|
"node": ">=22"
|
|
20
20
|
},
|
|
@@ -46,7 +46,7 @@
|
|
|
46
46
|
},
|
|
47
47
|
"devDependencies": {
|
|
48
48
|
"vitest": "4.1.0",
|
|
49
|
-
"@scalar/types": "0.
|
|
49
|
+
"@scalar/types": "0.15.0"
|
|
50
50
|
},
|
|
51
51
|
"scripts": {
|
|
52
52
|
"build": "tsc -p tsconfig.build.json && tsc-alias -p tsconfig.build.json",
|