@scalar/types 0.1.6 → 0.1.7
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 +7 -0
- package/dist/api-reference/api-reference-configuration.d.ts +143 -31
- package/dist/api-reference/api-reference-configuration.d.ts.map +1 -1
- package/dist/api-reference/api-reference-configuration.js +22 -9
- package/dist/api-reference/api-reference-plugin.d.ts +61 -0
- package/dist/api-reference/api-reference-plugin.d.ts.map +1 -0
- package/dist/api-reference/api-reference-plugin.js +25 -0
- package/dist/api-reference/index.d.ts +1 -0
- package/dist/api-reference/index.d.ts.map +1 -1
- package/dist/entities/security-scheme.d.ts +8 -8
- package/package.json +17 -17
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import type { AuthenticationConfiguration } from '
|
|
2
|
+
import type { AuthenticationConfiguration } from './authentication-configuration.ts';
|
|
3
3
|
/** Configuration for the OpenAPI/Swagger specification */
|
|
4
4
|
export declare const specConfigurationSchema: z.ZodObject<{
|
|
5
5
|
/**
|
|
@@ -56,7 +56,7 @@ export declare const specConfigurationSchema: z.ZodObject<{
|
|
|
56
56
|
*
|
|
57
57
|
* If none is passed, the title will be used.
|
|
58
58
|
*
|
|
59
|
-
* If no title is used, it
|
|
59
|
+
* If no title is used, it'll just use the index.
|
|
60
60
|
*
|
|
61
61
|
* @example 'scalar-galaxy'
|
|
62
62
|
*
|
|
@@ -85,7 +85,7 @@ export declare const apiClientConfigurationSchema: z.ZodObject<{
|
|
|
85
85
|
* Directly embed the OpenAPI document.
|
|
86
86
|
* Can be a string, object, function returning an object, or null.
|
|
87
87
|
*
|
|
88
|
-
* @remarks It
|
|
88
|
+
* @remarks It's recommended to pass a URL instead of content.
|
|
89
89
|
**/
|
|
90
90
|
content: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodRecord<z.ZodString, z.ZodAny>, z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodRecord<z.ZodString, z.ZodAny>>, z.ZodNull]>>;
|
|
91
91
|
/**
|
|
@@ -99,7 +99,7 @@ export declare const apiClientConfigurationSchema: z.ZodObject<{
|
|
|
99
99
|
*
|
|
100
100
|
* If none is passed, the title will be used.
|
|
101
101
|
*
|
|
102
|
-
* If no title is used, it
|
|
102
|
+
* If no title is used, it'll just use the index.
|
|
103
103
|
*
|
|
104
104
|
* @example 'scalar-galaxy'
|
|
105
105
|
*/
|
|
@@ -164,7 +164,7 @@ export declare const apiClientConfigurationSchema: z.ZodObject<{
|
|
|
164
164
|
*
|
|
165
165
|
* If none is passed, the title will be used.
|
|
166
166
|
*
|
|
167
|
-
* If no title is used, it
|
|
167
|
+
* If no title is used, it'll just use the index.
|
|
168
168
|
*
|
|
169
169
|
* @example 'scalar-galaxy'
|
|
170
170
|
*
|
|
@@ -206,6 +206,8 @@ export declare const apiClientConfigurationSchema: z.ZodObject<{
|
|
|
206
206
|
theme: z.ZodCatch<z.ZodDefault<z.ZodOptional<z.ZodEnum<["alternate", "default", "moon", "purple", "solarized", "bluePlanet", "deepSpace", "saturn", "kepler", "elysiajs", "fastify", "mars", "none"]>>>>;
|
|
207
207
|
/** Integration type identifier */
|
|
208
208
|
_integration: z.ZodOptional<z.ZodNullable<z.ZodEnum<["adonisjs", "docusaurus", "dotnet", "elysiajs", "express", "fastapi", "fastify", "go", "hono", "html", "laravel", "litestar", "nestjs", "nextjs", "nitro", "nuxt", "platformatic", "react", "rust", "vue"]>>>;
|
|
209
|
+
/** onRequestSent is fired when a request is sent */
|
|
210
|
+
onRequestSent: z.ZodOptional<z.ZodFunction<z.ZodTuple<[z.ZodString], z.ZodUnknown>, z.ZodVoid>>;
|
|
209
211
|
}, "strip", z.ZodTypeAny, {
|
|
210
212
|
hideClientButton: boolean;
|
|
211
213
|
showSidebar: boolean;
|
|
@@ -223,9 +225,10 @@ export declare const apiClientConfigurationSchema: z.ZodObject<{
|
|
|
223
225
|
authentication?: any;
|
|
224
226
|
baseServerURL?: string | undefined;
|
|
225
227
|
proxyUrl?: string | undefined;
|
|
226
|
-
searchHotKey?: "
|
|
228
|
+
searchHotKey?: "c" | "r" | "o" | "n" | "a" | "b" | "d" | "e" | "f" | "g" | "h" | "i" | "j" | "k" | "l" | "m" | "p" | "q" | "s" | "t" | "u" | "v" | "w" | "x" | "y" | "z" | undefined;
|
|
227
229
|
servers?: any[] | undefined;
|
|
228
230
|
_integration?: "go" | "elysiajs" | "fastify" | "adonisjs" | "docusaurus" | "dotnet" | "express" | "fastapi" | "hono" | "html" | "laravel" | "litestar" | "nestjs" | "nextjs" | "nitro" | "nuxt" | "platformatic" | "react" | "rust" | "vue" | null | undefined;
|
|
231
|
+
onRequestSent?: ((args_0: string, ...args: unknown[]) => void) | undefined;
|
|
229
232
|
}, {
|
|
230
233
|
url?: string | undefined;
|
|
231
234
|
content?: string | Record<string, any> | ((...args: unknown[]) => Record<string, any>) | null | undefined;
|
|
@@ -241,11 +244,12 @@ export declare const apiClientConfigurationSchema: z.ZodObject<{
|
|
|
241
244
|
baseServerURL?: string | undefined;
|
|
242
245
|
hideClientButton?: unknown;
|
|
243
246
|
proxyUrl?: string | undefined;
|
|
244
|
-
searchHotKey?: "
|
|
247
|
+
searchHotKey?: "c" | "r" | "o" | "n" | "a" | "b" | "d" | "e" | "f" | "g" | "h" | "i" | "j" | "k" | "l" | "m" | "p" | "q" | "s" | "t" | "u" | "v" | "w" | "x" | "y" | "z" | undefined;
|
|
245
248
|
servers?: any[] | undefined;
|
|
246
249
|
showSidebar?: unknown;
|
|
247
250
|
theme?: unknown;
|
|
248
251
|
_integration?: "go" | "elysiajs" | "fastify" | "adonisjs" | "docusaurus" | "dotnet" | "express" | "fastapi" | "hono" | "html" | "laravel" | "litestar" | "nestjs" | "nextjs" | "nitro" | "nuxt" | "platformatic" | "react" | "rust" | "vue" | null | undefined;
|
|
252
|
+
onRequestSent?: ((args_0: string, ...args: unknown[]) => void) | undefined;
|
|
249
253
|
}>;
|
|
250
254
|
export type ApiClientConfiguration = z.infer<typeof apiClientConfigurationSchema>;
|
|
251
255
|
/** Configuration for the Api Client without the transform since it cannot be merged */
|
|
@@ -258,7 +262,7 @@ declare const _apiReferenceConfigurationSchema: z.ZodObject<z.objectUtil.extendS
|
|
|
258
262
|
* Directly embed the OpenAPI document.
|
|
259
263
|
* Can be a string, object, function returning an object, or null.
|
|
260
264
|
*
|
|
261
|
-
* @remarks It
|
|
265
|
+
* @remarks It's recommended to pass a URL instead of content.
|
|
262
266
|
**/
|
|
263
267
|
content: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodRecord<z.ZodString, z.ZodAny>, z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodRecord<z.ZodString, z.ZodAny>>, z.ZodNull]>>;
|
|
264
268
|
/**
|
|
@@ -272,7 +276,7 @@ declare const _apiReferenceConfigurationSchema: z.ZodObject<z.objectUtil.extendS
|
|
|
272
276
|
*
|
|
273
277
|
* If none is passed, the title will be used.
|
|
274
278
|
*
|
|
275
|
-
* If no title is used, it
|
|
279
|
+
* If no title is used, it'll just use the index.
|
|
276
280
|
*
|
|
277
281
|
* @example 'scalar-galaxy'
|
|
278
282
|
*/
|
|
@@ -337,7 +341,7 @@ declare const _apiReferenceConfigurationSchema: z.ZodObject<z.objectUtil.extendS
|
|
|
337
341
|
*
|
|
338
342
|
* If none is passed, the title will be used.
|
|
339
343
|
*
|
|
340
|
-
* If no title is used, it
|
|
344
|
+
* If no title is used, it'll just use the index.
|
|
341
345
|
*
|
|
342
346
|
* @example 'scalar-galaxy'
|
|
343
347
|
*
|
|
@@ -379,6 +383,8 @@ declare const _apiReferenceConfigurationSchema: z.ZodObject<z.objectUtil.extendS
|
|
|
379
383
|
theme: z.ZodCatch<z.ZodDefault<z.ZodOptional<z.ZodEnum<["alternate", "default", "moon", "purple", "solarized", "bluePlanet", "deepSpace", "saturn", "kepler", "elysiajs", "fastify", "mars", "none"]>>>>;
|
|
380
384
|
/** Integration type identifier */
|
|
381
385
|
_integration: z.ZodOptional<z.ZodNullable<z.ZodEnum<["adonisjs", "docusaurus", "dotnet", "elysiajs", "express", "fastapi", "fastify", "go", "hono", "html", "laravel", "litestar", "nestjs", "nextjs", "nitro", "nuxt", "platformatic", "react", "rust", "vue"]>>>;
|
|
386
|
+
/** onRequestSent is fired when a request is sent */
|
|
387
|
+
onRequestSent: z.ZodOptional<z.ZodFunction<z.ZodTuple<[z.ZodString], z.ZodUnknown>, z.ZodVoid>>;
|
|
382
388
|
}, {
|
|
383
389
|
/**
|
|
384
390
|
* The layout to use for the references
|
|
@@ -390,6 +396,34 @@ declare const _apiReferenceConfigurationSchema: z.ZodObject<z.objectUtil.extendS
|
|
|
390
396
|
* @deprecated Use proxyUrl instead
|
|
391
397
|
*/
|
|
392
398
|
proxy: z.ZodOptional<z.ZodString>;
|
|
399
|
+
/**
|
|
400
|
+
* Plugins for the API reference
|
|
401
|
+
*/
|
|
402
|
+
plugins: z.ZodOptional<z.ZodArray<z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodObject<{
|
|
403
|
+
name: z.ZodString;
|
|
404
|
+
extensions: z.ZodArray<z.ZodObject<{
|
|
405
|
+
name: z.ZodString;
|
|
406
|
+
component: z.ZodUnknown;
|
|
407
|
+
}, "strip", z.ZodTypeAny, {
|
|
408
|
+
name: string;
|
|
409
|
+
component?: unknown;
|
|
410
|
+
}, {
|
|
411
|
+
name: string;
|
|
412
|
+
component?: unknown;
|
|
413
|
+
}>, "many">;
|
|
414
|
+
}, "strip", z.ZodTypeAny, {
|
|
415
|
+
name: string;
|
|
416
|
+
extensions: {
|
|
417
|
+
name: string;
|
|
418
|
+
component?: unknown;
|
|
419
|
+
}[];
|
|
420
|
+
}, {
|
|
421
|
+
name: string;
|
|
422
|
+
extensions: {
|
|
423
|
+
name: string;
|
|
424
|
+
component?: unknown;
|
|
425
|
+
}[];
|
|
426
|
+
}>>, "many">>;
|
|
393
427
|
/**
|
|
394
428
|
* Whether the spec input should show
|
|
395
429
|
* @default false
|
|
@@ -447,13 +481,13 @@ declare const _apiReferenceConfigurationSchema: z.ZodObject<z.objectUtil.extendS
|
|
|
447
481
|
hiddenClients: z.ZodOptional<z.ZodUnion<[z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodBoolean, z.ZodArray<z.ZodString, "many">]>>, z.ZodArray<z.ZodString, "many">, z.ZodLiteral<true>]>>;
|
|
448
482
|
/** Determine the HTTP client that's selected by default */
|
|
449
483
|
defaultHttpClient: z.ZodOptional<z.ZodObject<{
|
|
450
|
-
targetKey: z.ZodType<"
|
|
484
|
+
targetKey: z.ZodType<"c" | "clojure" | "csharp" | "go" | "http" | "java" | "js" | "kotlin" | "node" | "objc" | "ocaml" | "php" | "powershell" | "python" | "r" | "ruby" | "shell" | "swift" | "dart", z.ZodTypeDef, "c" | "clojure" | "csharp" | "go" | "http" | "java" | "js" | "kotlin" | "node" | "objc" | "ocaml" | "php" | "powershell" | "python" | "r" | "ruby" | "shell" | "swift" | "dart">;
|
|
451
485
|
clientKey: z.ZodString;
|
|
452
486
|
}, "strip", z.ZodTypeAny, {
|
|
453
|
-
targetKey: "
|
|
487
|
+
targetKey: "c" | "clojure" | "csharp" | "go" | "http" | "java" | "js" | "kotlin" | "node" | "objc" | "ocaml" | "php" | "powershell" | "python" | "r" | "ruby" | "shell" | "swift" | "dart";
|
|
454
488
|
clientKey: string;
|
|
455
489
|
}, {
|
|
456
|
-
targetKey: "
|
|
490
|
+
targetKey: "c" | "clojure" | "csharp" | "go" | "http" | "java" | "js" | "kotlin" | "node" | "objc" | "ocaml" | "php" | "powershell" | "python" | "r" | "ruby" | "shell" | "swift" | "dart";
|
|
457
491
|
clientKey: string;
|
|
458
492
|
}>>;
|
|
459
493
|
/** Custom CSS to be added to the page */
|
|
@@ -631,17 +665,25 @@ declare const _apiReferenceConfigurationSchema: z.ZodObject<z.objectUtil.extendS
|
|
|
631
665
|
authentication?: any;
|
|
632
666
|
baseServerURL?: string | undefined;
|
|
633
667
|
proxyUrl?: string | undefined;
|
|
634
|
-
searchHotKey?: "
|
|
668
|
+
searchHotKey?: "c" | "r" | "o" | "n" | "a" | "b" | "d" | "e" | "f" | "g" | "h" | "i" | "j" | "k" | "l" | "m" | "p" | "q" | "s" | "t" | "u" | "v" | "w" | "x" | "y" | "z" | undefined;
|
|
635
669
|
servers?: any[] | undefined;
|
|
636
670
|
_integration?: "go" | "elysiajs" | "fastify" | "adonisjs" | "docusaurus" | "dotnet" | "express" | "fastapi" | "hono" | "html" | "laravel" | "litestar" | "nestjs" | "nextjs" | "nitro" | "nuxt" | "platformatic" | "react" | "rust" | "vue" | null | undefined;
|
|
671
|
+
onRequestSent?: ((args_0: string, ...args: unknown[]) => void) | undefined;
|
|
637
672
|
proxy?: string | undefined;
|
|
673
|
+
plugins?: ((...args: unknown[]) => {
|
|
674
|
+
name: string;
|
|
675
|
+
extensions: {
|
|
676
|
+
name: string;
|
|
677
|
+
component?: unknown;
|
|
678
|
+
}[];
|
|
679
|
+
})[] | undefined;
|
|
638
680
|
darkMode?: boolean | undefined;
|
|
639
681
|
forceDarkModeState?: "dark" | "light" | undefined;
|
|
640
682
|
metaData?: any;
|
|
641
683
|
favicon?: string | undefined;
|
|
642
684
|
hiddenClients?: true | string[] | Record<string, boolean | string[]> | undefined;
|
|
643
685
|
defaultHttpClient?: {
|
|
644
|
-
targetKey: "
|
|
686
|
+
targetKey: "c" | "clojure" | "csharp" | "go" | "http" | "java" | "js" | "kotlin" | "node" | "objc" | "ocaml" | "php" | "powershell" | "python" | "r" | "ruby" | "shell" | "swift" | "dart";
|
|
645
687
|
clientKey: string;
|
|
646
688
|
} | undefined;
|
|
647
689
|
customCss?: string | undefined;
|
|
@@ -692,13 +734,21 @@ declare const _apiReferenceConfigurationSchema: z.ZodObject<z.objectUtil.extendS
|
|
|
692
734
|
baseServerURL?: string | undefined;
|
|
693
735
|
hideClientButton?: unknown;
|
|
694
736
|
proxyUrl?: string | undefined;
|
|
695
|
-
searchHotKey?: "
|
|
737
|
+
searchHotKey?: "c" | "r" | "o" | "n" | "a" | "b" | "d" | "e" | "f" | "g" | "h" | "i" | "j" | "k" | "l" | "m" | "p" | "q" | "s" | "t" | "u" | "v" | "w" | "x" | "y" | "z" | undefined;
|
|
696
738
|
servers?: any[] | undefined;
|
|
697
739
|
showSidebar?: unknown;
|
|
698
740
|
theme?: unknown;
|
|
699
741
|
_integration?: "go" | "elysiajs" | "fastify" | "adonisjs" | "docusaurus" | "dotnet" | "express" | "fastapi" | "hono" | "html" | "laravel" | "litestar" | "nestjs" | "nextjs" | "nitro" | "nuxt" | "platformatic" | "react" | "rust" | "vue" | null | undefined;
|
|
742
|
+
onRequestSent?: ((args_0: string, ...args: unknown[]) => void) | undefined;
|
|
700
743
|
layout?: unknown;
|
|
701
744
|
proxy?: string | undefined;
|
|
745
|
+
plugins?: ((...args: unknown[]) => {
|
|
746
|
+
name: string;
|
|
747
|
+
extensions: {
|
|
748
|
+
name: string;
|
|
749
|
+
component?: unknown;
|
|
750
|
+
}[];
|
|
751
|
+
})[] | undefined;
|
|
702
752
|
isEditable?: unknown;
|
|
703
753
|
isLoading?: unknown;
|
|
704
754
|
hideModels?: unknown;
|
|
@@ -712,7 +762,7 @@ declare const _apiReferenceConfigurationSchema: z.ZodObject<z.objectUtil.extendS
|
|
|
712
762
|
favicon?: string | undefined;
|
|
713
763
|
hiddenClients?: true | string[] | Record<string, boolean | string[]> | undefined;
|
|
714
764
|
defaultHttpClient?: {
|
|
715
|
-
targetKey: "
|
|
765
|
+
targetKey: "c" | "clojure" | "csharp" | "go" | "http" | "java" | "js" | "kotlin" | "node" | "objc" | "ocaml" | "php" | "powershell" | "python" | "r" | "ruby" | "shell" | "swift" | "dart";
|
|
716
766
|
clientKey: string;
|
|
717
767
|
} | undefined;
|
|
718
768
|
customCss?: string | undefined;
|
|
@@ -760,7 +810,7 @@ export declare const apiReferenceConfigurationSchema: z.ZodEffects<z.ZodObject<z
|
|
|
760
810
|
* Directly embed the OpenAPI document.
|
|
761
811
|
* Can be a string, object, function returning an object, or null.
|
|
762
812
|
*
|
|
763
|
-
* @remarks It
|
|
813
|
+
* @remarks It's recommended to pass a URL instead of content.
|
|
764
814
|
**/
|
|
765
815
|
content: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodRecord<z.ZodString, z.ZodAny>, z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodRecord<z.ZodString, z.ZodAny>>, z.ZodNull]>>;
|
|
766
816
|
/**
|
|
@@ -774,7 +824,7 @@ export declare const apiReferenceConfigurationSchema: z.ZodEffects<z.ZodObject<z
|
|
|
774
824
|
*
|
|
775
825
|
* If none is passed, the title will be used.
|
|
776
826
|
*
|
|
777
|
-
* If no title is used, it
|
|
827
|
+
* If no title is used, it'll just use the index.
|
|
778
828
|
*
|
|
779
829
|
* @example 'scalar-galaxy'
|
|
780
830
|
*/
|
|
@@ -839,7 +889,7 @@ export declare const apiReferenceConfigurationSchema: z.ZodEffects<z.ZodObject<z
|
|
|
839
889
|
*
|
|
840
890
|
* If none is passed, the title will be used.
|
|
841
891
|
*
|
|
842
|
-
* If no title is used, it
|
|
892
|
+
* If no title is used, it'll just use the index.
|
|
843
893
|
*
|
|
844
894
|
* @example 'scalar-galaxy'
|
|
845
895
|
*
|
|
@@ -881,6 +931,8 @@ export declare const apiReferenceConfigurationSchema: z.ZodEffects<z.ZodObject<z
|
|
|
881
931
|
theme: z.ZodCatch<z.ZodDefault<z.ZodOptional<z.ZodEnum<["alternate", "default", "moon", "purple", "solarized", "bluePlanet", "deepSpace", "saturn", "kepler", "elysiajs", "fastify", "mars", "none"]>>>>;
|
|
882
932
|
/** Integration type identifier */
|
|
883
933
|
_integration: z.ZodOptional<z.ZodNullable<z.ZodEnum<["adonisjs", "docusaurus", "dotnet", "elysiajs", "express", "fastapi", "fastify", "go", "hono", "html", "laravel", "litestar", "nestjs", "nextjs", "nitro", "nuxt", "platformatic", "react", "rust", "vue"]>>>;
|
|
934
|
+
/** onRequestSent is fired when a request is sent */
|
|
935
|
+
onRequestSent: z.ZodOptional<z.ZodFunction<z.ZodTuple<[z.ZodString], z.ZodUnknown>, z.ZodVoid>>;
|
|
884
936
|
}, {
|
|
885
937
|
/**
|
|
886
938
|
* The layout to use for the references
|
|
@@ -892,6 +944,34 @@ export declare const apiReferenceConfigurationSchema: z.ZodEffects<z.ZodObject<z
|
|
|
892
944
|
* @deprecated Use proxyUrl instead
|
|
893
945
|
*/
|
|
894
946
|
proxy: z.ZodOptional<z.ZodString>;
|
|
947
|
+
/**
|
|
948
|
+
* Plugins for the API reference
|
|
949
|
+
*/
|
|
950
|
+
plugins: z.ZodOptional<z.ZodArray<z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodObject<{
|
|
951
|
+
name: z.ZodString;
|
|
952
|
+
extensions: z.ZodArray<z.ZodObject<{
|
|
953
|
+
name: z.ZodString;
|
|
954
|
+
component: z.ZodUnknown;
|
|
955
|
+
}, "strip", z.ZodTypeAny, {
|
|
956
|
+
name: string;
|
|
957
|
+
component?: unknown;
|
|
958
|
+
}, {
|
|
959
|
+
name: string;
|
|
960
|
+
component?: unknown;
|
|
961
|
+
}>, "many">;
|
|
962
|
+
}, "strip", z.ZodTypeAny, {
|
|
963
|
+
name: string;
|
|
964
|
+
extensions: {
|
|
965
|
+
name: string;
|
|
966
|
+
component?: unknown;
|
|
967
|
+
}[];
|
|
968
|
+
}, {
|
|
969
|
+
name: string;
|
|
970
|
+
extensions: {
|
|
971
|
+
name: string;
|
|
972
|
+
component?: unknown;
|
|
973
|
+
}[];
|
|
974
|
+
}>>, "many">>;
|
|
895
975
|
/**
|
|
896
976
|
* Whether the spec input should show
|
|
897
977
|
* @default false
|
|
@@ -949,13 +1029,13 @@ export declare const apiReferenceConfigurationSchema: z.ZodEffects<z.ZodObject<z
|
|
|
949
1029
|
hiddenClients: z.ZodOptional<z.ZodUnion<[z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodBoolean, z.ZodArray<z.ZodString, "many">]>>, z.ZodArray<z.ZodString, "many">, z.ZodLiteral<true>]>>;
|
|
950
1030
|
/** Determine the HTTP client that's selected by default */
|
|
951
1031
|
defaultHttpClient: z.ZodOptional<z.ZodObject<{
|
|
952
|
-
targetKey: z.ZodType<"
|
|
1032
|
+
targetKey: z.ZodType<"c" | "clojure" | "csharp" | "go" | "http" | "java" | "js" | "kotlin" | "node" | "objc" | "ocaml" | "php" | "powershell" | "python" | "r" | "ruby" | "shell" | "swift" | "dart", z.ZodTypeDef, "c" | "clojure" | "csharp" | "go" | "http" | "java" | "js" | "kotlin" | "node" | "objc" | "ocaml" | "php" | "powershell" | "python" | "r" | "ruby" | "shell" | "swift" | "dart">;
|
|
953
1033
|
clientKey: z.ZodString;
|
|
954
1034
|
}, "strip", z.ZodTypeAny, {
|
|
955
|
-
targetKey: "
|
|
1035
|
+
targetKey: "c" | "clojure" | "csharp" | "go" | "http" | "java" | "js" | "kotlin" | "node" | "objc" | "ocaml" | "php" | "powershell" | "python" | "r" | "ruby" | "shell" | "swift" | "dart";
|
|
956
1036
|
clientKey: string;
|
|
957
1037
|
}, {
|
|
958
|
-
targetKey: "
|
|
1038
|
+
targetKey: "c" | "clojure" | "csharp" | "go" | "http" | "java" | "js" | "kotlin" | "node" | "objc" | "ocaml" | "php" | "powershell" | "python" | "r" | "ruby" | "shell" | "swift" | "dart";
|
|
959
1039
|
clientKey: string;
|
|
960
1040
|
}>>;
|
|
961
1041
|
/** Custom CSS to be added to the page */
|
|
@@ -1133,17 +1213,25 @@ export declare const apiReferenceConfigurationSchema: z.ZodEffects<z.ZodObject<z
|
|
|
1133
1213
|
authentication?: any;
|
|
1134
1214
|
baseServerURL?: string | undefined;
|
|
1135
1215
|
proxyUrl?: string | undefined;
|
|
1136
|
-
searchHotKey?: "
|
|
1216
|
+
searchHotKey?: "c" | "r" | "o" | "n" | "a" | "b" | "d" | "e" | "f" | "g" | "h" | "i" | "j" | "k" | "l" | "m" | "p" | "q" | "s" | "t" | "u" | "v" | "w" | "x" | "y" | "z" | undefined;
|
|
1137
1217
|
servers?: any[] | undefined;
|
|
1138
1218
|
_integration?: "go" | "elysiajs" | "fastify" | "adonisjs" | "docusaurus" | "dotnet" | "express" | "fastapi" | "hono" | "html" | "laravel" | "litestar" | "nestjs" | "nextjs" | "nitro" | "nuxt" | "platformatic" | "react" | "rust" | "vue" | null | undefined;
|
|
1219
|
+
onRequestSent?: ((args_0: string, ...args: unknown[]) => void) | undefined;
|
|
1139
1220
|
proxy?: string | undefined;
|
|
1221
|
+
plugins?: ((...args: unknown[]) => {
|
|
1222
|
+
name: string;
|
|
1223
|
+
extensions: {
|
|
1224
|
+
name: string;
|
|
1225
|
+
component?: unknown;
|
|
1226
|
+
}[];
|
|
1227
|
+
})[] | undefined;
|
|
1140
1228
|
darkMode?: boolean | undefined;
|
|
1141
1229
|
forceDarkModeState?: "dark" | "light" | undefined;
|
|
1142
1230
|
metaData?: any;
|
|
1143
1231
|
favicon?: string | undefined;
|
|
1144
1232
|
hiddenClients?: true | string[] | Record<string, boolean | string[]> | undefined;
|
|
1145
1233
|
defaultHttpClient?: {
|
|
1146
|
-
targetKey: "
|
|
1234
|
+
targetKey: "c" | "clojure" | "csharp" | "go" | "http" | "java" | "js" | "kotlin" | "node" | "objc" | "ocaml" | "php" | "powershell" | "python" | "r" | "ruby" | "shell" | "swift" | "dart";
|
|
1147
1235
|
clientKey: string;
|
|
1148
1236
|
} | undefined;
|
|
1149
1237
|
customCss?: string | undefined;
|
|
@@ -1194,13 +1282,21 @@ export declare const apiReferenceConfigurationSchema: z.ZodEffects<z.ZodObject<z
|
|
|
1194
1282
|
baseServerURL?: string | undefined;
|
|
1195
1283
|
hideClientButton?: unknown;
|
|
1196
1284
|
proxyUrl?: string | undefined;
|
|
1197
|
-
searchHotKey?: "
|
|
1285
|
+
searchHotKey?: "c" | "r" | "o" | "n" | "a" | "b" | "d" | "e" | "f" | "g" | "h" | "i" | "j" | "k" | "l" | "m" | "p" | "q" | "s" | "t" | "u" | "v" | "w" | "x" | "y" | "z" | undefined;
|
|
1198
1286
|
servers?: any[] | undefined;
|
|
1199
1287
|
showSidebar?: unknown;
|
|
1200
1288
|
theme?: unknown;
|
|
1201
1289
|
_integration?: "go" | "elysiajs" | "fastify" | "adonisjs" | "docusaurus" | "dotnet" | "express" | "fastapi" | "hono" | "html" | "laravel" | "litestar" | "nestjs" | "nextjs" | "nitro" | "nuxt" | "platformatic" | "react" | "rust" | "vue" | null | undefined;
|
|
1290
|
+
onRequestSent?: ((args_0: string, ...args: unknown[]) => void) | undefined;
|
|
1202
1291
|
layout?: unknown;
|
|
1203
1292
|
proxy?: string | undefined;
|
|
1293
|
+
plugins?: ((...args: unknown[]) => {
|
|
1294
|
+
name: string;
|
|
1295
|
+
extensions: {
|
|
1296
|
+
name: string;
|
|
1297
|
+
component?: unknown;
|
|
1298
|
+
}[];
|
|
1299
|
+
})[] | undefined;
|
|
1204
1300
|
isEditable?: unknown;
|
|
1205
1301
|
isLoading?: unknown;
|
|
1206
1302
|
hideModels?: unknown;
|
|
@@ -1214,7 +1310,7 @@ export declare const apiReferenceConfigurationSchema: z.ZodEffects<z.ZodObject<z
|
|
|
1214
1310
|
favicon?: string | undefined;
|
|
1215
1311
|
hiddenClients?: true | string[] | Record<string, boolean | string[]> | undefined;
|
|
1216
1312
|
defaultHttpClient?: {
|
|
1217
|
-
targetKey: "
|
|
1313
|
+
targetKey: "c" | "clojure" | "csharp" | "go" | "http" | "java" | "js" | "kotlin" | "node" | "objc" | "ocaml" | "php" | "powershell" | "python" | "r" | "ruby" | "shell" | "swift" | "dart";
|
|
1218
1314
|
clientKey: string;
|
|
1219
1315
|
} | undefined;
|
|
1220
1316
|
customCss?: string | undefined;
|
|
@@ -1277,17 +1373,25 @@ export declare const apiReferenceConfigurationSchema: z.ZodEffects<z.ZodObject<z
|
|
|
1277
1373
|
authentication?: any;
|
|
1278
1374
|
baseServerURL?: string | undefined;
|
|
1279
1375
|
proxyUrl?: string | undefined;
|
|
1280
|
-
searchHotKey?: "
|
|
1376
|
+
searchHotKey?: "c" | "r" | "o" | "n" | "a" | "b" | "d" | "e" | "f" | "g" | "h" | "i" | "j" | "k" | "l" | "m" | "p" | "q" | "s" | "t" | "u" | "v" | "w" | "x" | "y" | "z" | undefined;
|
|
1281
1377
|
servers?: any[] | undefined;
|
|
1282
1378
|
_integration?: "go" | "elysiajs" | "fastify" | "adonisjs" | "docusaurus" | "dotnet" | "express" | "fastapi" | "hono" | "html" | "laravel" | "litestar" | "nestjs" | "nextjs" | "nitro" | "nuxt" | "platformatic" | "react" | "rust" | "vue" | null | undefined;
|
|
1379
|
+
onRequestSent?: ((args_0: string, ...args: unknown[]) => void) | undefined;
|
|
1283
1380
|
proxy?: string | undefined;
|
|
1381
|
+
plugins?: ((...args: unknown[]) => {
|
|
1382
|
+
name: string;
|
|
1383
|
+
extensions: {
|
|
1384
|
+
name: string;
|
|
1385
|
+
component?: unknown;
|
|
1386
|
+
}[];
|
|
1387
|
+
})[] | undefined;
|
|
1284
1388
|
darkMode?: boolean | undefined;
|
|
1285
1389
|
forceDarkModeState?: "dark" | "light" | undefined;
|
|
1286
1390
|
metaData?: any;
|
|
1287
1391
|
favicon?: string | undefined;
|
|
1288
1392
|
hiddenClients?: true | string[] | Record<string, boolean | string[]> | undefined;
|
|
1289
1393
|
defaultHttpClient?: {
|
|
1290
|
-
targetKey: "
|
|
1394
|
+
targetKey: "c" | "clojure" | "csharp" | "go" | "http" | "java" | "js" | "kotlin" | "node" | "objc" | "ocaml" | "php" | "powershell" | "python" | "r" | "ruby" | "shell" | "swift" | "dart";
|
|
1291
1395
|
clientKey: string;
|
|
1292
1396
|
} | undefined;
|
|
1293
1397
|
customCss?: string | undefined;
|
|
@@ -1338,13 +1442,21 @@ export declare const apiReferenceConfigurationSchema: z.ZodEffects<z.ZodObject<z
|
|
|
1338
1442
|
baseServerURL?: string | undefined;
|
|
1339
1443
|
hideClientButton?: unknown;
|
|
1340
1444
|
proxyUrl?: string | undefined;
|
|
1341
|
-
searchHotKey?: "
|
|
1445
|
+
searchHotKey?: "c" | "r" | "o" | "n" | "a" | "b" | "d" | "e" | "f" | "g" | "h" | "i" | "j" | "k" | "l" | "m" | "p" | "q" | "s" | "t" | "u" | "v" | "w" | "x" | "y" | "z" | undefined;
|
|
1342
1446
|
servers?: any[] | undefined;
|
|
1343
1447
|
showSidebar?: unknown;
|
|
1344
1448
|
theme?: unknown;
|
|
1345
1449
|
_integration?: "go" | "elysiajs" | "fastify" | "adonisjs" | "docusaurus" | "dotnet" | "express" | "fastapi" | "hono" | "html" | "laravel" | "litestar" | "nestjs" | "nextjs" | "nitro" | "nuxt" | "platformatic" | "react" | "rust" | "vue" | null | undefined;
|
|
1450
|
+
onRequestSent?: ((args_0: string, ...args: unknown[]) => void) | undefined;
|
|
1346
1451
|
layout?: unknown;
|
|
1347
1452
|
proxy?: string | undefined;
|
|
1453
|
+
plugins?: ((...args: unknown[]) => {
|
|
1454
|
+
name: string;
|
|
1455
|
+
extensions: {
|
|
1456
|
+
name: string;
|
|
1457
|
+
component?: unknown;
|
|
1458
|
+
}[];
|
|
1459
|
+
})[] | undefined;
|
|
1348
1460
|
isEditable?: unknown;
|
|
1349
1461
|
isLoading?: unknown;
|
|
1350
1462
|
hideModels?: unknown;
|
|
@@ -1358,7 +1470,7 @@ export declare const apiReferenceConfigurationSchema: z.ZodEffects<z.ZodObject<z
|
|
|
1358
1470
|
favicon?: string | undefined;
|
|
1359
1471
|
hiddenClients?: true | string[] | Record<string, boolean | string[]> | undefined;
|
|
1360
1472
|
defaultHttpClient?: {
|
|
1361
|
-
targetKey: "
|
|
1473
|
+
targetKey: "c" | "clojure" | "csharp" | "go" | "http" | "java" | "js" | "kotlin" | "node" | "objc" | "ocaml" | "php" | "powershell" | "python" | "r" | "ruby" | "shell" | "swift" | "dart";
|
|
1362
1474
|
clientKey: string;
|
|
1363
1475
|
} | undefined;
|
|
1364
1476
|
customCss?: string | undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"api-reference-configuration.d.ts","sourceRoot":"","sources":["../../src/api-reference/api-reference-configuration.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;
|
|
1
|
+
{"version":3,"file":"api-reference-configuration.d.ts","sourceRoot":"","sources":["../../src/api-reference/api-reference-configuration.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAIvB,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,mCAAmC,CAAA;AA2EpF,0DAA0D;AAC1D,eAAO,MAAM,uBAAuB;IAClC;;;;;;;;;;;;;;;;;QAiBI;;IAEJ;;;;;;;;;;;;;;;;;;;;QAoBI;;IAEJ;;;;;;OAMG;;IAEH;;;;;;;;;;OAUG;;;;;;;;;;;;EAEH,CAAA;AACF,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,uBAAuB,CAAC,CAAA;AAQvE,uCAAuC;AACvC,eAAO,MAAM,4BAA4B;IACvC;;QAEI;;IAEJ;;;;;QAKI;;IAEJ;;;;OAIG;;IAEH;;;;;;;;OAQG;;IAEH;;;;QAII;;QAvGJ;;;;;;;;;;;;;;;;;YAiBI;;QAEJ;;;;;;;;;;;;;;;;;;;;YAoBI;;QAEJ;;;;;;WAMG;;QAEH;;;;;;;;;;WAUG;;;;;;;;;;;;;IA8CH,6BAA6B;;IAE7B,kCAAkC;;IAElC;;;OAGG;;IAEH,gDAAgD;;IAEhD,mFAAmF;;IAEnF,qCAAqC;;IAErC;;;OAGG;;IAEH,+CAA+C;;IAE/C,kCAAkC;;IAElC,oDAAoD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAEpD,CAAA;AAEF,MAAM,MAAM,sBAAsB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,4BAA4B,CAAC,CAAA;AAKjF,uFAAuF;AACvF,QAAA,M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import { ApiReferencePluginSchema } from './api-reference-plugin.js';
|
|
2
3
|
import { migrateThemeVariables } from './helpers/migrate-theme-variables.js';
|
|
3
4
|
|
|
4
5
|
/** Available theme presets for the API reference */
|
|
@@ -127,7 +128,7 @@ const specConfigurationSchema = z.object({
|
|
|
127
128
|
*
|
|
128
129
|
* If none is passed, the title will be used.
|
|
129
130
|
*
|
|
130
|
-
* If no title is used, it
|
|
131
|
+
* If no title is used, it'll just use the index.
|
|
131
132
|
*
|
|
132
133
|
* @example 'scalar-galaxy'
|
|
133
134
|
*
|
|
@@ -150,7 +151,7 @@ const apiClientConfigurationSchema = z.object({
|
|
|
150
151
|
* Directly embed the OpenAPI document.
|
|
151
152
|
* Can be a string, object, function returning an object, or null.
|
|
152
153
|
*
|
|
153
|
-
* @remarks It
|
|
154
|
+
* @remarks It's recommended to pass a URL instead of content.
|
|
154
155
|
**/
|
|
155
156
|
content: z.union([z.string(), z.record(z.any()), z.function().returns(z.record(z.any())), z.null()]).optional(),
|
|
156
157
|
/**
|
|
@@ -164,7 +165,7 @@ const apiClientConfigurationSchema = z.object({
|
|
|
164
165
|
*
|
|
165
166
|
* If none is passed, the title will be used.
|
|
166
167
|
*
|
|
167
|
-
* If no title is used, it
|
|
168
|
+
* If no title is used, it'll just use the index.
|
|
168
169
|
*
|
|
169
170
|
* @example 'scalar-galaxy'
|
|
170
171
|
*/
|
|
@@ -199,6 +200,8 @@ const apiClientConfigurationSchema = z.object({
|
|
|
199
200
|
theme: themeIdEnum.optional().default('default').catch('default'),
|
|
200
201
|
/** Integration type identifier */
|
|
201
202
|
_integration: integrationEnum.optional(),
|
|
203
|
+
/** onRequestSent is fired when a request is sent */
|
|
204
|
+
onRequestSent: z.function().args(z.string()).returns(z.void()).optional(),
|
|
202
205
|
});
|
|
203
206
|
const OLD_PROXY_URL = 'https://api.scalar.com/request-proxy';
|
|
204
207
|
const NEW_PROXY_URL = 'https://proxy.scalar.com';
|
|
@@ -214,6 +217,10 @@ const _apiReferenceConfigurationSchema = apiClientConfigurationSchema.merge(z.ob
|
|
|
214
217
|
* @deprecated Use proxyUrl instead
|
|
215
218
|
*/
|
|
216
219
|
proxy: z.string().optional(),
|
|
220
|
+
/**
|
|
221
|
+
* Plugins for the API reference
|
|
222
|
+
*/
|
|
223
|
+
plugins: z.array(ApiReferencePluginSchema).optional(),
|
|
217
224
|
/**
|
|
218
225
|
* Whether the spec input should show
|
|
219
226
|
* @default false
|
|
@@ -313,7 +320,9 @@ const _apiReferenceConfigurationSchema = apiClientConfigurationSchema.merge(z.ob
|
|
|
313
320
|
*/
|
|
314
321
|
generateHeadingSlug: z
|
|
315
322
|
.function()
|
|
316
|
-
.args(z.object({
|
|
323
|
+
.args(z.object({
|
|
324
|
+
slug: z.string().default('headingSlug'),
|
|
325
|
+
}))
|
|
317
326
|
.returns(z.string())
|
|
318
327
|
.optional(),
|
|
319
328
|
/**
|
|
@@ -324,7 +333,9 @@ const _apiReferenceConfigurationSchema = apiClientConfigurationSchema.merge(z.ob
|
|
|
324
333
|
*/
|
|
325
334
|
generateModelSlug: z
|
|
326
335
|
.function()
|
|
327
|
-
.args(z.object({
|
|
336
|
+
.args(z.object({
|
|
337
|
+
name: z.string().default('modelName'),
|
|
338
|
+
}))
|
|
328
339
|
.returns(z.string())
|
|
329
340
|
.optional(),
|
|
330
341
|
/**
|
|
@@ -335,7 +346,9 @@ const _apiReferenceConfigurationSchema = apiClientConfigurationSchema.merge(z.ob
|
|
|
335
346
|
*/
|
|
336
347
|
generateTagSlug: z
|
|
337
348
|
.function()
|
|
338
|
-
.args(z.object({
|
|
349
|
+
.args(z.object({
|
|
350
|
+
name: z.string().default('tagName'),
|
|
351
|
+
}))
|
|
339
352
|
.returns(z.string())
|
|
340
353
|
.optional(),
|
|
341
354
|
/**
|
|
@@ -414,12 +427,12 @@ const migrateConfiguration = (_configuration) => {
|
|
|
414
427
|
const configuration = { ..._configuration };
|
|
415
428
|
// Remove the spec prefix
|
|
416
429
|
if (configuration.spec?.url) {
|
|
417
|
-
console.warn(`[DEPRECATED] You
|
|
430
|
+
console.warn(`[DEPRECATED] You're using the deprecated 'spec.url' attribute. Remove the spec prefix and move the 'url' attribute to the top level.`);
|
|
418
431
|
configuration.url = configuration.spec.url;
|
|
419
432
|
delete configuration.spec;
|
|
420
433
|
}
|
|
421
434
|
if (configuration.spec?.content) {
|
|
422
|
-
console.warn(`[DEPRECATED] You
|
|
435
|
+
console.warn(`[DEPRECATED] You're using the deprecated 'spec.content' attribute. Remove the spec prefix and move the 'content' attribute to the top level.`);
|
|
423
436
|
configuration.content = configuration.spec.content;
|
|
424
437
|
delete configuration.spec;
|
|
425
438
|
}
|
|
@@ -429,7 +442,7 @@ const migrateConfiguration = (_configuration) => {
|
|
|
429
442
|
}
|
|
430
443
|
// Migrate proxy URL
|
|
431
444
|
if (configuration.proxy) {
|
|
432
|
-
console.warn(`[DEPRECATED] You
|
|
445
|
+
console.warn(`[DEPRECATED] You're using the deprecated 'proxy' attribute, rename it to 'proxyUrl' or update the package.`);
|
|
433
446
|
if (!configuration.proxyUrl) {
|
|
434
447
|
configuration.proxyUrl = configuration.proxy;
|
|
435
448
|
}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const OpenApiExtensionSchema: z.ZodObject<{
|
|
3
|
+
/**
|
|
4
|
+
* Name of specification extension property. Has to start with `x-`.
|
|
5
|
+
*
|
|
6
|
+
* @example
|
|
7
|
+
* ```yaml
|
|
8
|
+
* x-custom-extension: foobar
|
|
9
|
+
* ```
|
|
10
|
+
*/
|
|
11
|
+
name: z.ZodString;
|
|
12
|
+
/**
|
|
13
|
+
* Vue component to render the OpenAPI extension
|
|
14
|
+
*/
|
|
15
|
+
component: z.ZodUnknown;
|
|
16
|
+
}, "strip", z.ZodTypeAny, {
|
|
17
|
+
name: string;
|
|
18
|
+
component?: unknown;
|
|
19
|
+
}, {
|
|
20
|
+
name: string;
|
|
21
|
+
component?: unknown;
|
|
22
|
+
}>;
|
|
23
|
+
export declare const ApiReferencePluginSchema: z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodObject<{
|
|
24
|
+
name: z.ZodString;
|
|
25
|
+
extensions: z.ZodArray<z.ZodObject<{
|
|
26
|
+
/**
|
|
27
|
+
* Name of specification extension property. Has to start with `x-`.
|
|
28
|
+
*
|
|
29
|
+
* @example
|
|
30
|
+
* ```yaml
|
|
31
|
+
* x-custom-extension: foobar
|
|
32
|
+
* ```
|
|
33
|
+
*/
|
|
34
|
+
name: z.ZodString;
|
|
35
|
+
/**
|
|
36
|
+
* Vue component to render the OpenAPI extension
|
|
37
|
+
*/
|
|
38
|
+
component: z.ZodUnknown;
|
|
39
|
+
}, "strip", z.ZodTypeAny, {
|
|
40
|
+
name: string;
|
|
41
|
+
component?: unknown;
|
|
42
|
+
}, {
|
|
43
|
+
name: string;
|
|
44
|
+
component?: unknown;
|
|
45
|
+
}>, "many">;
|
|
46
|
+
}, "strip", z.ZodTypeAny, {
|
|
47
|
+
name: string;
|
|
48
|
+
extensions: {
|
|
49
|
+
name: string;
|
|
50
|
+
component?: unknown;
|
|
51
|
+
}[];
|
|
52
|
+
}, {
|
|
53
|
+
name: string;
|
|
54
|
+
extensions: {
|
|
55
|
+
name: string;
|
|
56
|
+
component?: unknown;
|
|
57
|
+
}[];
|
|
58
|
+
}>>;
|
|
59
|
+
export type SpecificationExtension = z.infer<typeof OpenApiExtensionSchema>;
|
|
60
|
+
export type ApiReferencePlugin = z.infer<typeof ApiReferencePluginSchema>;
|
|
61
|
+
//# sourceMappingURL=api-reference-plugin.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"api-reference-plugin.d.ts","sourceRoot":"","sources":["../../src/api-reference/api-reference-plugin.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAEvB,eAAO,MAAM,sBAAsB;IACjC;;;;;;;OAOG;;IAEH;;OAEG;;;;;;;;EAEH,CAAA;AAEF,eAAO,MAAM,wBAAwB;;;QAfnC;;;;;;;WAOG;;QAEH;;WAEG;;;;;;;;;;;;;;;;;;;;;GASJ,CAAA;AAGD,MAAM,MAAM,sBAAsB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,sBAAsB,CAAC,CAAA;AAC3E,MAAM,MAAM,kBAAkB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,wBAAwB,CAAC,CAAA"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
|
|
3
|
+
// TODO: Oh, do we really want to make this a dependency?
|
|
4
|
+
// import type { Component } from 'vue'
|
|
5
|
+
const OpenApiExtensionSchema = z.object({
|
|
6
|
+
/**
|
|
7
|
+
* Name of specification extension property. Has to start with `x-`.
|
|
8
|
+
*
|
|
9
|
+
* @example
|
|
10
|
+
* ```yaml
|
|
11
|
+
* x-custom-extension: foobar
|
|
12
|
+
* ```
|
|
13
|
+
*/
|
|
14
|
+
name: z.string().regex(/^x-/),
|
|
15
|
+
/**
|
|
16
|
+
* Vue component to render the OpenAPI extension
|
|
17
|
+
*/
|
|
18
|
+
component: z.unknown(),
|
|
19
|
+
});
|
|
20
|
+
const ApiReferencePluginSchema = z.function().returns(z.object({
|
|
21
|
+
name: z.string(),
|
|
22
|
+
extensions: z.array(OpenApiExtensionSchema),
|
|
23
|
+
}));
|
|
24
|
+
|
|
25
|
+
export { ApiReferencePluginSchema, OpenApiExtensionSchema };
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
export { type ApiClientConfiguration, type ApiReferenceConfiguration, type ApiReferenceConfigurationWithSources, type AnyApiReferenceConfiguration, type SpecConfiguration, apiClientConfigurationSchema, apiReferenceConfigurationSchema, specConfigurationSchema, isConfigurationWithSources, } from './api-reference-configuration.ts';
|
|
2
2
|
export { type HtmlRenderingConfiguration, htmlRenderingConfigurationSchema, } from './html-rendering-configuration.ts';
|
|
3
3
|
export { migrateThemeVariables } from './helpers/migrate-theme-variables.ts';
|
|
4
|
+
export type { SpecificationExtension, ApiReferencePlugin, } from './api-reference-plugin.ts';
|
|
4
5
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/api-reference/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,sBAAsB,EAC3B,KAAK,yBAAyB,EAC9B,KAAK,oCAAoC,EACzC,KAAK,4BAA4B,EACjC,KAAK,iBAAiB,EACtB,4BAA4B,EAC5B,+BAA+B,EAC/B,uBAAuB,EACvB,0BAA0B,GAC3B,MAAM,kCAAkC,CAAA;AAEzC,OAAO,EACL,KAAK,0BAA0B,EAC/B,gCAAgC,GACjC,MAAM,mCAAmC,CAAA;AAE1C,OAAO,EAAE,qBAAqB,EAAE,MAAM,sCAAsC,CAAA"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/api-reference/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,sBAAsB,EAC3B,KAAK,yBAAyB,EAC9B,KAAK,oCAAoC,EACzC,KAAK,4BAA4B,EACjC,KAAK,iBAAiB,EACtB,4BAA4B,EAC5B,+BAA+B,EAC/B,uBAAuB,EACvB,0BAA0B,GAC3B,MAAM,kCAAkC,CAAA;AAEzC,OAAO,EACL,KAAK,0BAA0B,EAC/B,gCAAgC,GACjC,MAAM,mCAAmC,CAAA;AAE1C,OAAO,EAAE,qBAAqB,EAAE,MAAM,sCAAsC,CAAA;AAE5E,YAAY,EACV,sBAAsB,EACtB,kBAAkB,GACnB,MAAM,2BAA2B,CAAA"}
|
|
@@ -15,20 +15,20 @@ export declare const securityApiKeySchema: z.ZodObject<z.objectUtil.extendShape<
|
|
|
15
15
|
}>, {
|
|
16
16
|
value: z.ZodDefault<z.ZodString>;
|
|
17
17
|
}>, "strip", z.ZodTypeAny, {
|
|
18
|
+
name: string;
|
|
18
19
|
type: "apiKey";
|
|
19
20
|
value: string;
|
|
20
21
|
uid: string & z.BRAND<"securityScheme">;
|
|
21
22
|
nameKey: string;
|
|
22
|
-
name: string;
|
|
23
23
|
in: "cookie" | "query" | "header";
|
|
24
24
|
description?: string | undefined;
|
|
25
25
|
}, {
|
|
26
26
|
type: "apiKey";
|
|
27
|
+
name?: string | undefined;
|
|
27
28
|
value?: string | undefined;
|
|
28
29
|
description?: string | undefined;
|
|
29
30
|
uid?: string | undefined;
|
|
30
31
|
nameKey?: string | undefined;
|
|
31
|
-
name?: string | undefined;
|
|
32
32
|
in?: unknown;
|
|
33
33
|
}>;
|
|
34
34
|
export type SecuritySchemeApiKey = z.infer<typeof securityApiKeySchema>;
|
|
@@ -520,14 +520,14 @@ export declare const oasSecuritySchemeSchema: z.ZodUnion<[z.ZodObject<z.objectUt
|
|
|
520
520
|
/** REQUIRED. The location of the API key. Valid values are "query", "header" or "cookie". */
|
|
521
521
|
in: z.ZodCatch<z.ZodDefault<z.ZodOptional<z.ZodEnum<["query", "header", "cookie"]>>>>;
|
|
522
522
|
}>, "strip", z.ZodTypeAny, {
|
|
523
|
-
type: "apiKey";
|
|
524
523
|
name: string;
|
|
524
|
+
type: "apiKey";
|
|
525
525
|
in: "cookie" | "query" | "header";
|
|
526
526
|
description?: string | undefined;
|
|
527
527
|
}, {
|
|
528
528
|
type: "apiKey";
|
|
529
|
-
description?: string | undefined;
|
|
530
529
|
name?: string | undefined;
|
|
530
|
+
description?: string | undefined;
|
|
531
531
|
in?: unknown;
|
|
532
532
|
}>, z.ZodObject<z.objectUtil.extendShape<{
|
|
533
533
|
description: z.ZodOptional<z.ZodString>;
|
|
@@ -967,20 +967,20 @@ export declare const securitySchemeSchema: z.ZodEffects<z.ZodUnion<[z.ZodObject<
|
|
|
967
967
|
}>, {
|
|
968
968
|
value: z.ZodDefault<z.ZodString>;
|
|
969
969
|
}>, "strip", z.ZodTypeAny, {
|
|
970
|
+
name: string;
|
|
970
971
|
type: "apiKey";
|
|
971
972
|
value: string;
|
|
972
973
|
uid: string & z.BRAND<"securityScheme">;
|
|
973
974
|
nameKey: string;
|
|
974
|
-
name: string;
|
|
975
975
|
in: "cookie" | "query" | "header";
|
|
976
976
|
description?: string | undefined;
|
|
977
977
|
}, {
|
|
978
978
|
type: "apiKey";
|
|
979
|
+
name?: string | undefined;
|
|
979
980
|
value?: string | undefined;
|
|
980
981
|
description?: string | undefined;
|
|
981
982
|
uid?: string | undefined;
|
|
982
983
|
nameKey?: string | undefined;
|
|
983
|
-
name?: string | undefined;
|
|
984
984
|
in?: unknown;
|
|
985
985
|
}>, z.ZodObject<z.objectUtil.extendShape<z.objectUtil.extendShape<z.objectUtil.extendShape<{
|
|
986
986
|
description: z.ZodOptional<z.ZodString>;
|
|
@@ -1438,11 +1438,11 @@ export declare const securitySchemeSchema: z.ZodEffects<z.ZodUnion<[z.ZodObject<
|
|
|
1438
1438
|
} | undefined;
|
|
1439
1439
|
} | undefined;
|
|
1440
1440
|
}>]>, {
|
|
1441
|
+
name: string;
|
|
1441
1442
|
type: "apiKey";
|
|
1442
1443
|
value: string;
|
|
1443
1444
|
uid: string & z.BRAND<"securityScheme">;
|
|
1444
1445
|
nameKey: string;
|
|
1445
|
-
name: string;
|
|
1446
1446
|
in: "cookie" | "query" | "header";
|
|
1447
1447
|
description?: string | undefined;
|
|
1448
1448
|
} | {
|
|
@@ -1516,11 +1516,11 @@ export declare const securitySchemeSchema: z.ZodEffects<z.ZodUnion<[z.ZodObject<
|
|
|
1516
1516
|
'x-default-scopes'?: string | string[] | undefined;
|
|
1517
1517
|
}, {
|
|
1518
1518
|
type: "apiKey";
|
|
1519
|
+
name?: string | undefined;
|
|
1519
1520
|
value?: string | undefined;
|
|
1520
1521
|
description?: string | undefined;
|
|
1521
1522
|
uid?: string | undefined;
|
|
1522
1523
|
nameKey?: string | undefined;
|
|
1523
|
-
name?: string | undefined;
|
|
1524
1524
|
in?: unknown;
|
|
1525
1525
|
} | {
|
|
1526
1526
|
type: "http";
|
package/package.json
CHANGED
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
"scalar",
|
|
17
17
|
"references"
|
|
18
18
|
],
|
|
19
|
-
"version": "0.1.
|
|
19
|
+
"version": "0.1.7",
|
|
20
20
|
"engines": {
|
|
21
21
|
"node": ">=18"
|
|
22
22
|
},
|
|
@@ -28,30 +28,30 @@
|
|
|
28
28
|
"types": "./dist/index.d.ts",
|
|
29
29
|
"default": "./dist/index.js"
|
|
30
30
|
},
|
|
31
|
-
"./
|
|
32
|
-
"import": "./dist/
|
|
33
|
-
"types": "./dist/
|
|
34
|
-
"default": "./dist/
|
|
31
|
+
"./api-reference": {
|
|
32
|
+
"import": "./dist/api-reference/index.js",
|
|
33
|
+
"types": "./dist/api-reference/index.d.ts",
|
|
34
|
+
"default": "./dist/api-reference/index.js"
|
|
35
35
|
},
|
|
36
|
-
"./
|
|
37
|
-
"import": "./dist/
|
|
38
|
-
"types": "./dist/
|
|
39
|
-
"default": "./dist/
|
|
36
|
+
"./entities": {
|
|
37
|
+
"import": "./dist/entities/index.js",
|
|
38
|
+
"types": "./dist/entities/index.d.ts",
|
|
39
|
+
"default": "./dist/entities/index.js"
|
|
40
40
|
},
|
|
41
41
|
"./legacy": {
|
|
42
42
|
"import": "./dist/legacy/index.js",
|
|
43
43
|
"types": "./dist/legacy/index.d.ts",
|
|
44
44
|
"default": "./dist/legacy/index.js"
|
|
45
45
|
},
|
|
46
|
-
"./
|
|
47
|
-
"import": "./dist/
|
|
48
|
-
"types": "./dist/
|
|
49
|
-
"default": "./dist/
|
|
46
|
+
"./snippetz": {
|
|
47
|
+
"import": "./dist/snippetz/index.js",
|
|
48
|
+
"types": "./dist/snippetz/index.d.ts",
|
|
49
|
+
"default": "./dist/snippetz/index.js"
|
|
50
50
|
},
|
|
51
|
-
"./
|
|
52
|
-
"import": "./dist/
|
|
53
|
-
"types": "./dist/
|
|
54
|
-
"default": "./dist/
|
|
51
|
+
"./utils": {
|
|
52
|
+
"import": "./dist/utils/index.js",
|
|
53
|
+
"types": "./dist/utils/index.d.ts",
|
|
54
|
+
"default": "./dist/utils/index.js"
|
|
55
55
|
}
|
|
56
56
|
},
|
|
57
57
|
"files": [
|