@scalar/types 0.1.2 → 0.1.3
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 +20 -723
- 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/index.d.ts +1 -1
- package/dist/api-reference/index.d.ts.map +1 -1
- package/dist/api-reference/index.js +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -461,6 +461,8 @@ export declare const apiReferenceConfigurationSchema: z.ZodEffects<z.ZodObject<z
|
|
|
461
461
|
onSpecUpdate: z.ZodOptional<z.ZodFunction<z.ZodTuple<[z.ZodString], z.ZodUnknown>, z.ZodVoid>>;
|
|
462
462
|
/** onServerChange is fired on selected server change */
|
|
463
463
|
onServerChange: z.ZodOptional<z.ZodFunction<z.ZodTuple<[z.ZodString], z.ZodUnknown>, z.ZodVoid>>;
|
|
464
|
+
/** onDocumentSelect is fired when the config is selected */
|
|
465
|
+
onDocumentSelect: z.ZodOptional<z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodVoid>>;
|
|
464
466
|
/**
|
|
465
467
|
* Route using paths instead of hashes, your server MUST support this
|
|
466
468
|
* @example '/standalone-api-reference/:custom(.*)?'
|
|
@@ -634,6 +636,7 @@ export declare const apiReferenceConfigurationSchema: z.ZodEffects<z.ZodObject<z
|
|
|
634
636
|
customCss?: string | undefined;
|
|
635
637
|
onSpecUpdate?: ((args_0: string, ...args: unknown[]) => void) | undefined;
|
|
636
638
|
onServerChange?: ((args_0: string, ...args: unknown[]) => void) | undefined;
|
|
639
|
+
onDocumentSelect?: ((...args: unknown[]) => void) | undefined;
|
|
637
640
|
pathRouting?: {
|
|
638
641
|
basePath: string;
|
|
639
642
|
} | undefined;
|
|
@@ -702,6 +705,7 @@ export declare const apiReferenceConfigurationSchema: z.ZodEffects<z.ZodObject<z
|
|
|
702
705
|
customCss?: string | undefined;
|
|
703
706
|
onSpecUpdate?: ((args_0: string, ...args: unknown[]) => void) | undefined;
|
|
704
707
|
onServerChange?: ((args_0: string, ...args: unknown[]) => void) | undefined;
|
|
708
|
+
onDocumentSelect?: ((...args: unknown[]) => void) | undefined;
|
|
705
709
|
pathRouting?: {
|
|
706
710
|
basePath: string;
|
|
707
711
|
} | undefined;
|
|
@@ -772,6 +776,7 @@ export declare const apiReferenceConfigurationSchema: z.ZodEffects<z.ZodObject<z
|
|
|
772
776
|
customCss?: string | undefined;
|
|
773
777
|
onSpecUpdate?: ((args_0: string, ...args: unknown[]) => void) | undefined;
|
|
774
778
|
onServerChange?: ((args_0: string, ...args: unknown[]) => void) | undefined;
|
|
779
|
+
onDocumentSelect?: ((...args: unknown[]) => void) | undefined;
|
|
775
780
|
pathRouting?: {
|
|
776
781
|
basePath: string;
|
|
777
782
|
} | undefined;
|
|
@@ -840,6 +845,7 @@ export declare const apiReferenceConfigurationSchema: z.ZodEffects<z.ZodObject<z
|
|
|
840
845
|
customCss?: string | undefined;
|
|
841
846
|
onSpecUpdate?: ((args_0: string, ...args: unknown[]) => void) | undefined;
|
|
842
847
|
onServerChange?: ((args_0: string, ...args: unknown[]) => void) | undefined;
|
|
848
|
+
onDocumentSelect?: ((...args: unknown[]) => void) | undefined;
|
|
843
849
|
pathRouting?: {
|
|
844
850
|
basePath: string;
|
|
845
851
|
} | undefined;
|
|
@@ -871,729 +877,20 @@ export declare const apiReferenceConfigurationSchema: z.ZodEffects<z.ZodObject<z
|
|
|
871
877
|
}>;
|
|
872
878
|
/** Configuration after parsing, this is the main type */
|
|
873
879
|
export type ApiReferenceConfiguration = Omit<z.infer<typeof apiReferenceConfigurationSchema>, 'proxy' | 'spec'>;
|
|
874
|
-
/**
|
|
875
|
-
|
|
876
|
-
/**
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
**/
|
|
886
|
-
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]>>;
|
|
887
|
-
/**
|
|
888
|
-
* The title of the OpenAPI document.
|
|
889
|
-
*
|
|
890
|
-
* @example 'Scalar Galaxy'
|
|
891
|
-
*/
|
|
892
|
-
title: z.ZodOptional<z.ZodString>;
|
|
893
|
-
/**
|
|
894
|
-
* The slug of the OpenAPI document used in the URL.
|
|
895
|
-
*
|
|
896
|
-
* If none is passed, the title will be used.
|
|
897
|
-
*
|
|
898
|
-
* If no title is used, it’ll just use the index.
|
|
899
|
-
*
|
|
900
|
-
* @example 'scalar-galaxy'
|
|
901
|
-
*/
|
|
902
|
-
slug: z.ZodOptional<z.ZodString>;
|
|
903
|
-
/**
|
|
904
|
-
* The OpenAPI/Swagger document to render
|
|
905
|
-
*
|
|
906
|
-
* @deprecated Use `url` and `content` on the top level instead.
|
|
907
|
-
**/
|
|
908
|
-
spec: z.ZodOptional<z.ZodObject<{
|
|
909
|
-
/**
|
|
910
|
-
* URL to an OpenAPI/Swagger document
|
|
911
|
-
*
|
|
912
|
-
* @deprecated Please move `url` to the top level and remove the `spec` prefix.
|
|
913
|
-
*
|
|
914
|
-
* @example
|
|
915
|
-
* ```ts
|
|
916
|
-
* const oldConfiguration = {
|
|
917
|
-
* spec: {
|
|
918
|
-
* url: 'https://example.com/openapi.json',
|
|
919
|
-
* },
|
|
920
|
-
* }
|
|
921
|
-
*
|
|
922
|
-
* const newConfiguration = {
|
|
923
|
-
* url: 'https://example.com/openapi.json',
|
|
924
|
-
* }
|
|
925
|
-
* ```
|
|
926
|
-
**/
|
|
927
|
-
url: z.ZodOptional<z.ZodString>;
|
|
928
|
-
/**
|
|
929
|
-
* Directly embed the OpenAPI document.
|
|
930
|
-
* Can be a string, object, function returning an object, or null.
|
|
931
|
-
*
|
|
932
|
-
* @remarks It's recommended to pass a URL instead of content.
|
|
933
|
-
*
|
|
934
|
-
* @deprecated Please move `content` to the top level and remove the `spec` prefix.
|
|
935
|
-
*
|
|
936
|
-
* @example
|
|
937
|
-
* ```ts
|
|
938
|
-
* const oldConfiguration = {
|
|
939
|
-
* spec: {
|
|
940
|
-
* content: '…',
|
|
941
|
-
* },
|
|
942
|
-
* }
|
|
943
|
-
*
|
|
944
|
-
* const newConfiguration = {
|
|
945
|
-
* content: '…',
|
|
946
|
-
* }
|
|
947
|
-
* ```
|
|
948
|
-
**/
|
|
949
|
-
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]>>;
|
|
950
|
-
/**
|
|
951
|
-
* The title of the OpenAPI document.
|
|
952
|
-
*
|
|
953
|
-
* @example 'Scalar Galaxy'
|
|
954
|
-
*
|
|
955
|
-
* @deprecated Please move `title` to the top level and remove the `spec` prefix.
|
|
956
|
-
*/
|
|
957
|
-
title: z.ZodOptional<z.ZodString>;
|
|
958
|
-
/**
|
|
959
|
-
* The slug of the OpenAPI document used in the URL.
|
|
960
|
-
*
|
|
961
|
-
* If none is passed, the title will be used.
|
|
962
|
-
*
|
|
963
|
-
* If no title is used, it’ll just use the index.
|
|
964
|
-
*
|
|
965
|
-
* @example 'scalar-galaxy'
|
|
966
|
-
*
|
|
967
|
-
* @deprecated Please move `slug` to the top level and remove the `spec` prefix.
|
|
968
|
-
*/
|
|
969
|
-
slug: z.ZodOptional<z.ZodString>;
|
|
970
|
-
}, "strip", z.ZodTypeAny, {
|
|
971
|
-
url?: string | undefined;
|
|
972
|
-
content?: string | Record<string, any> | ((...args: unknown[]) => Record<string, any>) | null | undefined;
|
|
973
|
-
title?: string | undefined;
|
|
974
|
-
slug?: string | undefined;
|
|
975
|
-
}, {
|
|
976
|
-
url?: string | undefined;
|
|
977
|
-
content?: string | Record<string, any> | ((...args: unknown[]) => Record<string, any>) | null | undefined;
|
|
978
|
-
title?: string | undefined;
|
|
979
|
-
slug?: string | undefined;
|
|
980
|
-
}>>;
|
|
981
|
-
/** Prefill authentication */
|
|
982
|
-
authentication: z.ZodOptional<z.ZodAny>;
|
|
983
|
-
/** Base URL for the API server */
|
|
984
|
-
baseServerURL: z.ZodOptional<z.ZodString>;
|
|
985
|
-
/**
|
|
986
|
-
* Whether to hide the client button
|
|
987
|
-
* @default false
|
|
988
|
-
*/
|
|
989
|
-
hideClientButton: z.ZodCatch<z.ZodDefault<z.ZodOptional<z.ZodBoolean>>>;
|
|
990
|
-
/** URL to a request proxy for the API client */
|
|
991
|
-
proxyUrl: z.ZodOptional<z.ZodString>;
|
|
992
|
-
/** Key used with CTRL/CMD to open the search modal (defaults to 'k' e.g. CMD+k) */
|
|
993
|
-
searchHotKey: z.ZodOptional<z.ZodEnum<["a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z"]>>;
|
|
994
|
-
/** List of OpenAPI server objects */
|
|
995
|
-
servers: z.ZodOptional<z.ZodArray<z.ZodAny, "many">>;
|
|
996
|
-
/**
|
|
997
|
-
* Whether to show the sidebar
|
|
998
|
-
* @default true
|
|
999
|
-
*/
|
|
1000
|
-
showSidebar: z.ZodCatch<z.ZodDefault<z.ZodOptional<z.ZodBoolean>>>;
|
|
1001
|
-
/** A string to use one of the color presets */
|
|
1002
|
-
theme: z.ZodCatch<z.ZodDefault<z.ZodOptional<z.ZodEnum<["alternate", "default", "moon", "purple", "solarized", "bluePlanet", "deepSpace", "saturn", "kepler", "elysiajs", "fastify", "mars", "none"]>>>>;
|
|
1003
|
-
/** Integration type identifier */
|
|
1004
|
-
_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"]>>>;
|
|
1005
|
-
}, {
|
|
1006
|
-
/**
|
|
1007
|
-
* The layout to use for the references
|
|
1008
|
-
* @default 'modern'
|
|
1009
|
-
*/
|
|
1010
|
-
layout: z.ZodCatch<z.ZodDefault<z.ZodOptional<z.ZodEnum<["modern", "classic"]>>>>;
|
|
1011
|
-
/**
|
|
1012
|
-
* URL to a request proxy for the API client
|
|
1013
|
-
* @deprecated Use proxyUrl instead
|
|
1014
|
-
*/
|
|
1015
|
-
proxy: z.ZodOptional<z.ZodString>;
|
|
1016
|
-
/**
|
|
1017
|
-
* Whether the spec input should show
|
|
1018
|
-
* @default false
|
|
1019
|
-
*/
|
|
1020
|
-
isEditable: z.ZodCatch<z.ZodDefault<z.ZodOptional<z.ZodBoolean>>>;
|
|
1021
|
-
/**
|
|
1022
|
-
* Controls whether the references show a loading state in the intro
|
|
1023
|
-
* @default false
|
|
1024
|
-
*/
|
|
1025
|
-
isLoading: z.ZodCatch<z.ZodDefault<z.ZodOptional<z.ZodBoolean>>>;
|
|
1026
|
-
/**
|
|
1027
|
-
* Whether to show models in the sidebar, search, and content.
|
|
1028
|
-
* @default false
|
|
1029
|
-
*/
|
|
1030
|
-
hideModels: z.ZodCatch<z.ZodDefault<z.ZodOptional<z.ZodBoolean>>>;
|
|
1031
|
-
/**
|
|
1032
|
-
* Whether to show the "Download OpenAPI Document" button
|
|
1033
|
-
* @default false
|
|
1034
|
-
*/
|
|
1035
|
-
hideDownloadButton: z.ZodCatch<z.ZodDefault<z.ZodOptional<z.ZodBoolean>>>;
|
|
1036
|
-
/**
|
|
1037
|
-
* Whether to show the "Test Request" button
|
|
1038
|
-
* @default false
|
|
1039
|
-
*/
|
|
1040
|
-
hideTestRequestButton: z.ZodCatch<z.ZodDefault<z.ZodOptional<z.ZodBoolean>>>;
|
|
1041
|
-
/**
|
|
1042
|
-
* Whether to show the sidebar search bar
|
|
1043
|
-
* @default false
|
|
1044
|
-
*/
|
|
1045
|
-
hideSearch: z.ZodCatch<z.ZodDefault<z.ZodOptional<z.ZodBoolean>>>;
|
|
1046
|
-
/** Whether dark mode is on or off initially (light mode) */
|
|
1047
|
-
darkMode: z.ZodOptional<z.ZodBoolean>;
|
|
1048
|
-
/** forceDarkModeState makes it always this state no matter what */
|
|
1049
|
-
forceDarkModeState: z.ZodOptional<z.ZodEnum<["dark", "light"]>>;
|
|
1050
|
-
/**
|
|
1051
|
-
* Whether to show the dark mode toggle
|
|
1052
|
-
* @default false
|
|
1053
|
-
*/
|
|
1054
|
-
hideDarkModeToggle: z.ZodCatch<z.ZodDefault<z.ZodOptional<z.ZodBoolean>>>;
|
|
1055
|
-
/**
|
|
1056
|
-
* If used, passed data will be added to the HTML header
|
|
1057
|
-
* @see https://unhead.unjs.io/usage/composables/use-seo-meta
|
|
1058
|
-
*/
|
|
1059
|
-
metaData: z.ZodOptional<z.ZodAny>;
|
|
1060
|
-
/**
|
|
1061
|
-
* Path to a favicon image
|
|
1062
|
-
* @default undefined
|
|
1063
|
-
* @example '/favicon.svg'
|
|
1064
|
-
*/
|
|
1065
|
-
favicon: z.ZodOptional<z.ZodString>;
|
|
1066
|
-
/**
|
|
1067
|
-
* List of httpsnippet clients to hide from the clients menu
|
|
1068
|
-
* By default hides Unirest, pass `[]` to show all clients
|
|
1069
|
-
*/
|
|
1070
|
-
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>]>>;
|
|
1071
|
-
/** Determine the HTTP client that's selected by default */
|
|
1072
|
-
defaultHttpClient: z.ZodOptional<z.ZodObject<{
|
|
1073
|
-
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">;
|
|
1074
|
-
clientKey: z.ZodString;
|
|
1075
|
-
}, "strip", z.ZodTypeAny, {
|
|
1076
|
-
targetKey: "c" | "clojure" | "csharp" | "go" | "http" | "java" | "js" | "kotlin" | "node" | "objc" | "ocaml" | "php" | "powershell" | "python" | "r" | "ruby" | "shell" | "swift" | "dart";
|
|
1077
|
-
clientKey: string;
|
|
1078
|
-
}, {
|
|
1079
|
-
targetKey: "c" | "clojure" | "csharp" | "go" | "http" | "java" | "js" | "kotlin" | "node" | "objc" | "ocaml" | "php" | "powershell" | "python" | "r" | "ruby" | "shell" | "swift" | "dart";
|
|
1080
|
-
clientKey: string;
|
|
1081
|
-
}>>;
|
|
1082
|
-
/** Custom CSS to be added to the page */
|
|
1083
|
-
customCss: z.ZodOptional<z.ZodString>;
|
|
1084
|
-
/** onSpecUpdate is fired on spec/swagger content change */
|
|
1085
|
-
onSpecUpdate: z.ZodOptional<z.ZodFunction<z.ZodTuple<[z.ZodString], z.ZodUnknown>, z.ZodVoid>>;
|
|
1086
|
-
/** onServerChange is fired on selected server change */
|
|
1087
|
-
onServerChange: z.ZodOptional<z.ZodFunction<z.ZodTuple<[z.ZodString], z.ZodUnknown>, z.ZodVoid>>;
|
|
1088
|
-
/**
|
|
1089
|
-
* Route using paths instead of hashes, your server MUST support this
|
|
1090
|
-
* @example '/standalone-api-reference/:custom(.*)?'
|
|
1091
|
-
* @experimental
|
|
1092
|
-
* @default undefined
|
|
1093
|
-
*/
|
|
1094
|
-
pathRouting: z.ZodOptional<z.ZodObject<{
|
|
1095
|
-
/** Base path for the API reference */
|
|
1096
|
-
basePath: z.ZodString;
|
|
1097
|
-
}, "strip", z.ZodTypeAny, {
|
|
1098
|
-
basePath: string;
|
|
1099
|
-
}, {
|
|
1100
|
-
basePath: string;
|
|
1101
|
-
}>>;
|
|
1102
|
-
/**
|
|
1103
|
-
* Customize the heading portion of the hash
|
|
1104
|
-
* @param heading - The heading object
|
|
1105
|
-
* @returns A string ID used to generate the URL hash
|
|
1106
|
-
* @default (heading) => `#description/${heading.slug}`
|
|
1107
|
-
*/
|
|
1108
|
-
generateHeadingSlug: z.ZodOptional<z.ZodFunction<z.ZodTuple<[z.ZodObject<{
|
|
1109
|
-
slug: z.ZodDefault<z.ZodString>;
|
|
1110
|
-
}, "strip", z.ZodTypeAny, {
|
|
1111
|
-
slug: string;
|
|
1112
|
-
}, {
|
|
1113
|
-
slug?: string | undefined;
|
|
1114
|
-
}>], z.ZodUnknown>, z.ZodString>>;
|
|
1115
|
-
/**
|
|
1116
|
-
* Customize the model portion of the hash
|
|
1117
|
-
* @param model - The model object with a name property
|
|
1118
|
-
* @returns A string ID used to generate the URL hash
|
|
1119
|
-
* @default (model) => slug(model.name)
|
|
1120
|
-
*/
|
|
1121
|
-
generateModelSlug: z.ZodOptional<z.ZodFunction<z.ZodTuple<[z.ZodObject<{
|
|
1122
|
-
name: z.ZodDefault<z.ZodString>;
|
|
1123
|
-
}, "strip", z.ZodTypeAny, {
|
|
1124
|
-
name: string;
|
|
1125
|
-
}, {
|
|
1126
|
-
name?: string | undefined;
|
|
1127
|
-
}>], z.ZodUnknown>, z.ZodString>>;
|
|
1128
|
-
/**
|
|
1129
|
-
* Customize the tag portion of the hash
|
|
1130
|
-
* @param tag - The tag object
|
|
1131
|
-
* @returns A string ID used to generate the URL hash
|
|
1132
|
-
* @default (tag) => slug(tag.name)
|
|
1133
|
-
*/
|
|
1134
|
-
generateTagSlug: z.ZodOptional<z.ZodFunction<z.ZodTuple<[z.ZodObject<{
|
|
1135
|
-
name: z.ZodDefault<z.ZodString>;
|
|
1136
|
-
}, "strip", z.ZodTypeAny, {
|
|
1137
|
-
name: string;
|
|
1138
|
-
}, {
|
|
1139
|
-
name?: string | undefined;
|
|
1140
|
-
}>], z.ZodUnknown>, z.ZodString>>;
|
|
1141
|
-
/**
|
|
1142
|
-
* Customize the operation portion of the hash
|
|
1143
|
-
* @param operation - The operation object
|
|
1144
|
-
* @returns A string ID used to generate the URL hash
|
|
1145
|
-
* @default (operation) => `${operation.method}${operation.path}`
|
|
1146
|
-
*/
|
|
1147
|
-
generateOperationSlug: z.ZodOptional<z.ZodFunction<z.ZodTuple<[z.ZodObject<{
|
|
1148
|
-
path: z.ZodString;
|
|
1149
|
-
operationId: z.ZodOptional<z.ZodString>;
|
|
1150
|
-
method: z.ZodString;
|
|
1151
|
-
summary: z.ZodOptional<z.ZodString>;
|
|
1152
|
-
}, "strip", z.ZodTypeAny, {
|
|
1153
|
-
path: string;
|
|
1154
|
-
method: string;
|
|
1155
|
-
operationId?: string | undefined;
|
|
1156
|
-
summary?: string | undefined;
|
|
1157
|
-
}, {
|
|
1158
|
-
path: string;
|
|
1159
|
-
method: string;
|
|
1160
|
-
operationId?: string | undefined;
|
|
1161
|
-
summary?: string | undefined;
|
|
1162
|
-
}>], z.ZodUnknown>, z.ZodString>>;
|
|
1163
|
-
/**
|
|
1164
|
-
* Customize the webhook portion of the hash
|
|
1165
|
-
* @param webhook - The webhook object
|
|
1166
|
-
* @returns A string ID used to generate the URL hash
|
|
1167
|
-
* @default (webhook) => slug(webhook.name)
|
|
1168
|
-
*/
|
|
1169
|
-
generateWebhookSlug: z.ZodOptional<z.ZodFunction<z.ZodTuple<[z.ZodObject<{
|
|
1170
|
-
name: z.ZodString;
|
|
1171
|
-
method: z.ZodOptional<z.ZodString>;
|
|
1172
|
-
}, "strip", z.ZodTypeAny, {
|
|
1173
|
-
name: string;
|
|
1174
|
-
method?: string | undefined;
|
|
1175
|
-
}, {
|
|
1176
|
-
name: string;
|
|
1177
|
-
method?: string | undefined;
|
|
1178
|
-
}>], z.ZodUnknown>, z.ZodString>>;
|
|
1179
|
-
/** Callback fired when the reference is fully loaded */
|
|
1180
|
-
onLoaded: z.ZodOptional<z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodVoid>>;
|
|
1181
|
-
/**
|
|
1182
|
-
* To handle redirects, pass a function that will recieve:
|
|
1183
|
-
* - The current path with hash if pathRouting is enabled
|
|
1184
|
-
* - The current hash if hashRouting (default)
|
|
1185
|
-
* And then passes that to history.replaceState
|
|
1186
|
-
*
|
|
1187
|
-
* @example hashRouting (default)
|
|
1188
|
-
* ```ts
|
|
1189
|
-
* redirect: (hash: string) => hash.replace('#v1/old-path', '#v2/new-path')
|
|
1190
|
-
* ```
|
|
1191
|
-
* @example pathRouting
|
|
1192
|
-
* ```ts
|
|
1193
|
-
* redirect: (pathWithHash: string) => {
|
|
1194
|
-
* if (pathWithHash.includes('#')) {
|
|
1195
|
-
* return pathWithHash.replace('/v1/tags/user#operation/get-user', '/v1/tags/user/operation/get-user')
|
|
1196
|
-
* }
|
|
1197
|
-
* return null
|
|
1198
|
-
* }
|
|
1199
|
-
* ```
|
|
1200
|
-
*/
|
|
1201
|
-
redirect: z.ZodOptional<z.ZodFunction<z.ZodTuple<[z.ZodString], z.ZodUnknown>, z.ZodOptional<z.ZodNullable<z.ZodString>>>>;
|
|
1202
|
-
/**
|
|
1203
|
-
* Whether to include default fonts
|
|
1204
|
-
* @default true
|
|
1205
|
-
*/
|
|
1206
|
-
withDefaultFonts: z.ZodCatch<z.ZodDefault<z.ZodOptional<z.ZodBoolean>>>;
|
|
1207
|
-
/** Whether to expand all tags by default */
|
|
1208
|
-
defaultOpenAllTags: z.ZodOptional<z.ZodBoolean>;
|
|
1209
|
-
/**
|
|
1210
|
-
* Function to sort tags
|
|
1211
|
-
* @default 'alpha' for alphabetical sorting
|
|
1212
|
-
*/
|
|
1213
|
-
tagsSorter: z.ZodOptional<z.ZodUnion<[z.ZodLiteral<"alpha">, z.ZodFunction<z.ZodTuple<[z.ZodAny, z.ZodAny], z.ZodUnknown>, z.ZodNumber>]>>;
|
|
1214
|
-
/**
|
|
1215
|
-
* Function to sort operations
|
|
1216
|
-
* @default 'alpha' for alphabetical sorting
|
|
1217
|
-
*/
|
|
1218
|
-
operationsSorter: z.ZodOptional<z.ZodUnion<[z.ZodLiteral<"alpha">, z.ZodLiteral<"method">, z.ZodFunction<z.ZodTuple<[z.ZodAny, z.ZodAny], z.ZodUnknown>, z.ZodNumber>]>>;
|
|
1219
|
-
}>, {
|
|
1220
|
-
sources: z.ZodArray<z.ZodObject<{
|
|
1221
|
-
/**
|
|
1222
|
-
* URL to an OpenAPI/Swagger document
|
|
1223
|
-
*
|
|
1224
|
-
* @deprecated Please move `url` to the top level and remove the `spec` prefix.
|
|
1225
|
-
*
|
|
1226
|
-
* @example
|
|
1227
|
-
* ```ts
|
|
1228
|
-
* const oldConfiguration = {
|
|
1229
|
-
* spec: {
|
|
1230
|
-
* url: 'https://example.com/openapi.json',
|
|
1231
|
-
* },
|
|
1232
|
-
* }
|
|
1233
|
-
*
|
|
1234
|
-
* const newConfiguration = {
|
|
1235
|
-
* url: 'https://example.com/openapi.json',
|
|
1236
|
-
* }
|
|
1237
|
-
* ```
|
|
1238
|
-
**/
|
|
1239
|
-
url: z.ZodOptional<z.ZodString>;
|
|
1240
|
-
/**
|
|
1241
|
-
* Directly embed the OpenAPI document.
|
|
1242
|
-
* Can be a string, object, function returning an object, or null.
|
|
1243
|
-
*
|
|
1244
|
-
* @remarks It's recommended to pass a URL instead of content.
|
|
1245
|
-
*
|
|
1246
|
-
* @deprecated Please move `content` to the top level and remove the `spec` prefix.
|
|
1247
|
-
*
|
|
1248
|
-
* @example
|
|
1249
|
-
* ```ts
|
|
1250
|
-
* const oldConfiguration = {
|
|
1251
|
-
* spec: {
|
|
1252
|
-
* content: '…',
|
|
1253
|
-
* },
|
|
1254
|
-
* }
|
|
1255
|
-
*
|
|
1256
|
-
* const newConfiguration = {
|
|
1257
|
-
* content: '…',
|
|
1258
|
-
* }
|
|
1259
|
-
* ```
|
|
1260
|
-
**/
|
|
1261
|
-
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]>>;
|
|
1262
|
-
/**
|
|
1263
|
-
* The title of the OpenAPI document.
|
|
1264
|
-
*
|
|
1265
|
-
* @example 'Scalar Galaxy'
|
|
1266
|
-
*
|
|
1267
|
-
* @deprecated Please move `title` to the top level and remove the `spec` prefix.
|
|
1268
|
-
*/
|
|
1269
|
-
title: z.ZodOptional<z.ZodString>;
|
|
1270
|
-
/**
|
|
1271
|
-
* The slug of the OpenAPI document used in the URL.
|
|
1272
|
-
*
|
|
1273
|
-
* If none is passed, the title will be used.
|
|
1274
|
-
*
|
|
1275
|
-
* If no title is used, it’ll just use the index.
|
|
1276
|
-
*
|
|
1277
|
-
* @example 'scalar-galaxy'
|
|
1278
|
-
*
|
|
1279
|
-
* @deprecated Please move `slug` to the top level and remove the `spec` prefix.
|
|
1280
|
-
*/
|
|
1281
|
-
slug: z.ZodOptional<z.ZodString>;
|
|
1282
|
-
}, "strip", z.ZodTypeAny, {
|
|
1283
|
-
url?: string | undefined;
|
|
1284
|
-
content?: string | Record<string, any> | ((...args: unknown[]) => Record<string, any>) | null | undefined;
|
|
1285
|
-
title?: string | undefined;
|
|
1286
|
-
slug?: string | undefined;
|
|
1287
|
-
}, {
|
|
1288
|
-
url?: string | undefined;
|
|
1289
|
-
content?: string | Record<string, any> | ((...args: unknown[]) => Record<string, any>) | null | undefined;
|
|
1290
|
-
title?: string | undefined;
|
|
1291
|
-
slug?: string | undefined;
|
|
1292
|
-
}>, "many">;
|
|
1293
|
-
}>, "strip", z.ZodTypeAny, {
|
|
1294
|
-
hideClientButton: boolean;
|
|
1295
|
-
showSidebar: boolean;
|
|
1296
|
-
theme: "alternate" | "default" | "moon" | "purple" | "solarized" | "bluePlanet" | "deepSpace" | "saturn" | "kepler" | "elysiajs" | "fastify" | "mars" | "none";
|
|
1297
|
-
layout: "modern" | "classic";
|
|
1298
|
-
isEditable: boolean;
|
|
1299
|
-
isLoading: boolean;
|
|
1300
|
-
hideModels: boolean;
|
|
1301
|
-
hideDownloadButton: boolean;
|
|
1302
|
-
hideTestRequestButton: boolean;
|
|
1303
|
-
hideSearch: boolean;
|
|
1304
|
-
hideDarkModeToggle: boolean;
|
|
1305
|
-
withDefaultFonts: boolean;
|
|
1306
|
-
sources: {
|
|
1307
|
-
url?: string | undefined;
|
|
1308
|
-
content?: string | Record<string, any> | ((...args: unknown[]) => Record<string, any>) | null | undefined;
|
|
1309
|
-
title?: string | undefined;
|
|
1310
|
-
slug?: string | undefined;
|
|
1311
|
-
}[];
|
|
1312
|
-
url?: string | undefined;
|
|
1313
|
-
content?: string | Record<string, any> | ((...args: unknown[]) => Record<string, any>) | null | undefined;
|
|
1314
|
-
title?: string | undefined;
|
|
1315
|
-
slug?: string | undefined;
|
|
1316
|
-
spec?: {
|
|
1317
|
-
url?: string | undefined;
|
|
1318
|
-
content?: string | Record<string, any> | ((...args: unknown[]) => Record<string, any>) | null | undefined;
|
|
1319
|
-
title?: string | undefined;
|
|
1320
|
-
slug?: string | undefined;
|
|
1321
|
-
} | undefined;
|
|
1322
|
-
authentication?: any;
|
|
1323
|
-
baseServerURL?: string | undefined;
|
|
1324
|
-
proxyUrl?: string | undefined;
|
|
1325
|
-
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;
|
|
1326
|
-
servers?: any[] | undefined;
|
|
1327
|
-
_integration?: "go" | "elysiajs" | "fastify" | "adonisjs" | "docusaurus" | "dotnet" | "express" | "fastapi" | "hono" | "html" | "laravel" | "litestar" | "nestjs" | "nextjs" | "nitro" | "nuxt" | "platformatic" | "react" | "rust" | "vue" | null | undefined;
|
|
1328
|
-
proxy?: string | undefined;
|
|
1329
|
-
darkMode?: boolean | undefined;
|
|
1330
|
-
forceDarkModeState?: "dark" | "light" | undefined;
|
|
1331
|
-
metaData?: any;
|
|
1332
|
-
favicon?: string | undefined;
|
|
1333
|
-
hiddenClients?: true | string[] | Record<string, boolean | string[]> | undefined;
|
|
1334
|
-
defaultHttpClient?: {
|
|
1335
|
-
targetKey: "c" | "clojure" | "csharp" | "go" | "http" | "java" | "js" | "kotlin" | "node" | "objc" | "ocaml" | "php" | "powershell" | "python" | "r" | "ruby" | "shell" | "swift" | "dart";
|
|
1336
|
-
clientKey: string;
|
|
1337
|
-
} | undefined;
|
|
1338
|
-
customCss?: string | undefined;
|
|
1339
|
-
onSpecUpdate?: ((args_0: string, ...args: unknown[]) => void) | undefined;
|
|
1340
|
-
onServerChange?: ((args_0: string, ...args: unknown[]) => void) | undefined;
|
|
1341
|
-
pathRouting?: {
|
|
1342
|
-
basePath: string;
|
|
1343
|
-
} | undefined;
|
|
1344
|
-
generateHeadingSlug?: ((args_0: {
|
|
1345
|
-
slug?: string | undefined;
|
|
1346
|
-
}, ...args: unknown[]) => string) | undefined;
|
|
1347
|
-
generateModelSlug?: ((args_0: {
|
|
1348
|
-
name?: string | undefined;
|
|
1349
|
-
}, ...args: unknown[]) => string) | undefined;
|
|
1350
|
-
generateTagSlug?: ((args_0: {
|
|
1351
|
-
name?: string | undefined;
|
|
1352
|
-
}, ...args: unknown[]) => string) | undefined;
|
|
1353
|
-
generateOperationSlug?: ((args_0: {
|
|
1354
|
-
path: string;
|
|
1355
|
-
method: string;
|
|
1356
|
-
operationId?: string | undefined;
|
|
1357
|
-
summary?: string | undefined;
|
|
1358
|
-
}, ...args: unknown[]) => string) | undefined;
|
|
1359
|
-
generateWebhookSlug?: ((args_0: {
|
|
1360
|
-
name: string;
|
|
1361
|
-
method?: string | undefined;
|
|
1362
|
-
}, ...args: unknown[]) => string) | undefined;
|
|
1363
|
-
onLoaded?: ((...args: unknown[]) => void) | undefined;
|
|
1364
|
-
redirect?: ((args_0: string, ...args: unknown[]) => string | null | undefined) | undefined;
|
|
1365
|
-
defaultOpenAllTags?: boolean | undefined;
|
|
1366
|
-
tagsSorter?: "alpha" | ((args_0: any, args_1: any, ...args: unknown[]) => number) | undefined;
|
|
1367
|
-
operationsSorter?: "method" | "alpha" | ((args_0: any, args_1: any, ...args: unknown[]) => number) | undefined;
|
|
1368
|
-
}, {
|
|
1369
|
-
sources: {
|
|
1370
|
-
url?: string | undefined;
|
|
1371
|
-
content?: string | Record<string, any> | ((...args: unknown[]) => Record<string, any>) | null | undefined;
|
|
1372
|
-
title?: string | undefined;
|
|
1373
|
-
slug?: string | undefined;
|
|
1374
|
-
}[];
|
|
1375
|
-
url?: string | undefined;
|
|
1376
|
-
content?: string | Record<string, any> | ((...args: unknown[]) => Record<string, any>) | null | undefined;
|
|
1377
|
-
title?: string | undefined;
|
|
1378
|
-
slug?: string | undefined;
|
|
1379
|
-
spec?: {
|
|
1380
|
-
url?: string | undefined;
|
|
1381
|
-
content?: string | Record<string, any> | ((...args: unknown[]) => Record<string, any>) | null | undefined;
|
|
1382
|
-
title?: string | undefined;
|
|
1383
|
-
slug?: string | undefined;
|
|
1384
|
-
} | undefined;
|
|
1385
|
-
authentication?: any;
|
|
1386
|
-
baseServerURL?: string | undefined;
|
|
1387
|
-
hideClientButton?: unknown;
|
|
1388
|
-
proxyUrl?: string | undefined;
|
|
1389
|
-
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;
|
|
1390
|
-
servers?: any[] | undefined;
|
|
1391
|
-
showSidebar?: unknown;
|
|
1392
|
-
theme?: unknown;
|
|
1393
|
-
_integration?: "go" | "elysiajs" | "fastify" | "adonisjs" | "docusaurus" | "dotnet" | "express" | "fastapi" | "hono" | "html" | "laravel" | "litestar" | "nestjs" | "nextjs" | "nitro" | "nuxt" | "platformatic" | "react" | "rust" | "vue" | null | undefined;
|
|
1394
|
-
layout?: unknown;
|
|
1395
|
-
proxy?: string | undefined;
|
|
1396
|
-
isEditable?: unknown;
|
|
1397
|
-
isLoading?: unknown;
|
|
1398
|
-
hideModels?: unknown;
|
|
1399
|
-
hideDownloadButton?: unknown;
|
|
1400
|
-
hideTestRequestButton?: unknown;
|
|
1401
|
-
hideSearch?: unknown;
|
|
1402
|
-
darkMode?: boolean | undefined;
|
|
1403
|
-
forceDarkModeState?: "dark" | "light" | undefined;
|
|
1404
|
-
hideDarkModeToggle?: unknown;
|
|
1405
|
-
metaData?: any;
|
|
1406
|
-
favicon?: string | undefined;
|
|
1407
|
-
hiddenClients?: true | string[] | Record<string, boolean | string[]> | undefined;
|
|
1408
|
-
defaultHttpClient?: {
|
|
1409
|
-
targetKey: "c" | "clojure" | "csharp" | "go" | "http" | "java" | "js" | "kotlin" | "node" | "objc" | "ocaml" | "php" | "powershell" | "python" | "r" | "ruby" | "shell" | "swift" | "dart";
|
|
1410
|
-
clientKey: string;
|
|
1411
|
-
} | undefined;
|
|
1412
|
-
customCss?: string | undefined;
|
|
1413
|
-
onSpecUpdate?: ((args_0: string, ...args: unknown[]) => void) | undefined;
|
|
1414
|
-
onServerChange?: ((args_0: string, ...args: unknown[]) => void) | undefined;
|
|
1415
|
-
pathRouting?: {
|
|
1416
|
-
basePath: string;
|
|
1417
|
-
} | undefined;
|
|
1418
|
-
generateHeadingSlug?: ((args_0: {
|
|
1419
|
-
slug: string;
|
|
1420
|
-
}, ...args: unknown[]) => string) | undefined;
|
|
1421
|
-
generateModelSlug?: ((args_0: {
|
|
1422
|
-
name: string;
|
|
1423
|
-
}, ...args: unknown[]) => string) | undefined;
|
|
1424
|
-
generateTagSlug?: ((args_0: {
|
|
1425
|
-
name: string;
|
|
1426
|
-
}, ...args: unknown[]) => string) | undefined;
|
|
1427
|
-
generateOperationSlug?: ((args_0: {
|
|
1428
|
-
path: string;
|
|
1429
|
-
method: string;
|
|
1430
|
-
operationId?: string | undefined;
|
|
1431
|
-
summary?: string | undefined;
|
|
1432
|
-
}, ...args: unknown[]) => string) | undefined;
|
|
1433
|
-
generateWebhookSlug?: ((args_0: {
|
|
1434
|
-
name: string;
|
|
1435
|
-
method?: string | undefined;
|
|
1436
|
-
}, ...args: unknown[]) => string) | undefined;
|
|
1437
|
-
onLoaded?: ((...args: unknown[]) => void) | undefined;
|
|
1438
|
-
redirect?: ((args_0: string, ...args: unknown[]) => string | null | undefined) | undefined;
|
|
1439
|
-
withDefaultFonts?: unknown;
|
|
1440
|
-
defaultOpenAllTags?: boolean | undefined;
|
|
1441
|
-
tagsSorter?: "alpha" | ((args_0: any, args_1: any, ...args: unknown[]) => number) | undefined;
|
|
1442
|
-
operationsSorter?: "method" | "alpha" | ((args_0: any, args_1: any, ...args: unknown[]) => number) | undefined;
|
|
1443
|
-
}>, {
|
|
1444
|
-
hideClientButton: boolean;
|
|
1445
|
-
showSidebar: boolean;
|
|
1446
|
-
theme: "alternate" | "default" | "moon" | "purple" | "solarized" | "bluePlanet" | "deepSpace" | "saturn" | "kepler" | "elysiajs" | "fastify" | "mars" | "none";
|
|
1447
|
-
layout: "modern" | "classic";
|
|
1448
|
-
isEditable: boolean;
|
|
1449
|
-
isLoading: boolean;
|
|
1450
|
-
hideModels: boolean;
|
|
1451
|
-
hideDownloadButton: boolean;
|
|
1452
|
-
hideTestRequestButton: boolean;
|
|
1453
|
-
hideSearch: boolean;
|
|
1454
|
-
hideDarkModeToggle: boolean;
|
|
1455
|
-
withDefaultFonts: boolean;
|
|
1456
|
-
sources: {
|
|
1457
|
-
url?: string | undefined;
|
|
1458
|
-
content?: string | Record<string, any> | ((...args: unknown[]) => Record<string, any>) | null | undefined;
|
|
1459
|
-
title?: string | undefined;
|
|
1460
|
-
slug?: string | undefined;
|
|
1461
|
-
}[];
|
|
1462
|
-
url?: string | undefined;
|
|
1463
|
-
content?: string | Record<string, any> | ((...args: unknown[]) => Record<string, any>) | null | undefined;
|
|
1464
|
-
title?: string | undefined;
|
|
1465
|
-
slug?: string | undefined;
|
|
1466
|
-
spec?: {
|
|
1467
|
-
url?: string | undefined;
|
|
1468
|
-
content?: string | Record<string, any> | ((...args: unknown[]) => Record<string, any>) | null | undefined;
|
|
1469
|
-
title?: string | undefined;
|
|
1470
|
-
slug?: string | undefined;
|
|
1471
|
-
} | undefined;
|
|
1472
|
-
authentication?: any;
|
|
1473
|
-
baseServerURL?: string | undefined;
|
|
1474
|
-
proxyUrl?: string | undefined;
|
|
1475
|
-
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;
|
|
1476
|
-
servers?: any[] | undefined;
|
|
1477
|
-
_integration?: "go" | "elysiajs" | "fastify" | "adonisjs" | "docusaurus" | "dotnet" | "express" | "fastapi" | "hono" | "html" | "laravel" | "litestar" | "nestjs" | "nextjs" | "nitro" | "nuxt" | "platformatic" | "react" | "rust" | "vue" | null | undefined;
|
|
1478
|
-
proxy?: string | undefined;
|
|
1479
|
-
darkMode?: boolean | undefined;
|
|
1480
|
-
forceDarkModeState?: "dark" | "light" | undefined;
|
|
1481
|
-
metaData?: any;
|
|
1482
|
-
favicon?: string | undefined;
|
|
1483
|
-
hiddenClients?: true | string[] | Record<string, boolean | string[]> | undefined;
|
|
1484
|
-
defaultHttpClient?: {
|
|
1485
|
-
targetKey: "c" | "clojure" | "csharp" | "go" | "http" | "java" | "js" | "kotlin" | "node" | "objc" | "ocaml" | "php" | "powershell" | "python" | "r" | "ruby" | "shell" | "swift" | "dart";
|
|
1486
|
-
clientKey: string;
|
|
1487
|
-
} | undefined;
|
|
1488
|
-
customCss?: string | undefined;
|
|
1489
|
-
onSpecUpdate?: ((args_0: string, ...args: unknown[]) => void) | undefined;
|
|
1490
|
-
onServerChange?: ((args_0: string, ...args: unknown[]) => void) | undefined;
|
|
1491
|
-
pathRouting?: {
|
|
1492
|
-
basePath: string;
|
|
1493
|
-
} | undefined;
|
|
1494
|
-
generateHeadingSlug?: ((args_0: {
|
|
1495
|
-
slug?: string | undefined;
|
|
1496
|
-
}, ...args: unknown[]) => string) | undefined;
|
|
1497
|
-
generateModelSlug?: ((args_0: {
|
|
1498
|
-
name?: string | undefined;
|
|
1499
|
-
}, ...args: unknown[]) => string) | undefined;
|
|
1500
|
-
generateTagSlug?: ((args_0: {
|
|
1501
|
-
name?: string | undefined;
|
|
1502
|
-
}, ...args: unknown[]) => string) | undefined;
|
|
1503
|
-
generateOperationSlug?: ((args_0: {
|
|
1504
|
-
path: string;
|
|
1505
|
-
method: string;
|
|
1506
|
-
operationId?: string | undefined;
|
|
1507
|
-
summary?: string | undefined;
|
|
1508
|
-
}, ...args: unknown[]) => string) | undefined;
|
|
1509
|
-
generateWebhookSlug?: ((args_0: {
|
|
1510
|
-
name: string;
|
|
1511
|
-
method?: string | undefined;
|
|
1512
|
-
}, ...args: unknown[]) => string) | undefined;
|
|
1513
|
-
onLoaded?: ((...args: unknown[]) => void) | undefined;
|
|
1514
|
-
redirect?: ((args_0: string, ...args: unknown[]) => string | null | undefined) | undefined;
|
|
1515
|
-
defaultOpenAllTags?: boolean | undefined;
|
|
1516
|
-
tagsSorter?: "alpha" | ((args_0: any, args_1: any, ...args: unknown[]) => number) | undefined;
|
|
1517
|
-
operationsSorter?: "method" | "alpha" | ((args_0: any, args_1: any, ...args: unknown[]) => number) | undefined;
|
|
1518
|
-
}, {
|
|
1519
|
-
sources: {
|
|
1520
|
-
url?: string | undefined;
|
|
1521
|
-
content?: string | Record<string, any> | ((...args: unknown[]) => Record<string, any>) | null | undefined;
|
|
1522
|
-
title?: string | undefined;
|
|
1523
|
-
slug?: string | undefined;
|
|
1524
|
-
}[];
|
|
1525
|
-
url?: string | undefined;
|
|
1526
|
-
content?: string | Record<string, any> | ((...args: unknown[]) => Record<string, any>) | null | undefined;
|
|
1527
|
-
title?: string | undefined;
|
|
1528
|
-
slug?: string | undefined;
|
|
1529
|
-
spec?: {
|
|
1530
|
-
url?: string | undefined;
|
|
1531
|
-
content?: string | Record<string, any> | ((...args: unknown[]) => Record<string, any>) | null | undefined;
|
|
1532
|
-
title?: string | undefined;
|
|
1533
|
-
slug?: string | undefined;
|
|
1534
|
-
} | undefined;
|
|
1535
|
-
authentication?: any;
|
|
1536
|
-
baseServerURL?: string | undefined;
|
|
1537
|
-
hideClientButton?: unknown;
|
|
1538
|
-
proxyUrl?: string | undefined;
|
|
1539
|
-
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;
|
|
1540
|
-
servers?: any[] | undefined;
|
|
1541
|
-
showSidebar?: unknown;
|
|
1542
|
-
theme?: unknown;
|
|
1543
|
-
_integration?: "go" | "elysiajs" | "fastify" | "adonisjs" | "docusaurus" | "dotnet" | "express" | "fastapi" | "hono" | "html" | "laravel" | "litestar" | "nestjs" | "nextjs" | "nitro" | "nuxt" | "platformatic" | "react" | "rust" | "vue" | null | undefined;
|
|
1544
|
-
layout?: unknown;
|
|
1545
|
-
proxy?: string | undefined;
|
|
1546
|
-
isEditable?: unknown;
|
|
1547
|
-
isLoading?: unknown;
|
|
1548
|
-
hideModels?: unknown;
|
|
1549
|
-
hideDownloadButton?: unknown;
|
|
1550
|
-
hideTestRequestButton?: unknown;
|
|
1551
|
-
hideSearch?: unknown;
|
|
1552
|
-
darkMode?: boolean | undefined;
|
|
1553
|
-
forceDarkModeState?: "dark" | "light" | undefined;
|
|
1554
|
-
hideDarkModeToggle?: unknown;
|
|
1555
|
-
metaData?: any;
|
|
1556
|
-
favicon?: string | undefined;
|
|
1557
|
-
hiddenClients?: true | string[] | Record<string, boolean | string[]> | undefined;
|
|
1558
|
-
defaultHttpClient?: {
|
|
1559
|
-
targetKey: "c" | "clojure" | "csharp" | "go" | "http" | "java" | "js" | "kotlin" | "node" | "objc" | "ocaml" | "php" | "powershell" | "python" | "r" | "ruby" | "shell" | "swift" | "dart";
|
|
1560
|
-
clientKey: string;
|
|
1561
|
-
} | undefined;
|
|
1562
|
-
customCss?: string | undefined;
|
|
1563
|
-
onSpecUpdate?: ((args_0: string, ...args: unknown[]) => void) | undefined;
|
|
1564
|
-
onServerChange?: ((args_0: string, ...args: unknown[]) => void) | undefined;
|
|
1565
|
-
pathRouting?: {
|
|
1566
|
-
basePath: string;
|
|
1567
|
-
} | undefined;
|
|
1568
|
-
generateHeadingSlug?: ((args_0: {
|
|
1569
|
-
slug: string;
|
|
1570
|
-
}, ...args: unknown[]) => string) | undefined;
|
|
1571
|
-
generateModelSlug?: ((args_0: {
|
|
1572
|
-
name: string;
|
|
1573
|
-
}, ...args: unknown[]) => string) | undefined;
|
|
1574
|
-
generateTagSlug?: ((args_0: {
|
|
1575
|
-
name: string;
|
|
1576
|
-
}, ...args: unknown[]) => string) | undefined;
|
|
1577
|
-
generateOperationSlug?: ((args_0: {
|
|
1578
|
-
path: string;
|
|
1579
|
-
method: string;
|
|
1580
|
-
operationId?: string | undefined;
|
|
1581
|
-
summary?: string | undefined;
|
|
1582
|
-
}, ...args: unknown[]) => string) | undefined;
|
|
1583
|
-
generateWebhookSlug?: ((args_0: {
|
|
1584
|
-
name: string;
|
|
1585
|
-
method?: string | undefined;
|
|
1586
|
-
}, ...args: unknown[]) => string) | undefined;
|
|
1587
|
-
onLoaded?: ((...args: unknown[]) => void) | undefined;
|
|
1588
|
-
redirect?: ((args_0: string, ...args: unknown[]) => string | null | undefined) | undefined;
|
|
1589
|
-
withDefaultFonts?: unknown;
|
|
1590
|
-
defaultOpenAllTags?: boolean | undefined;
|
|
1591
|
-
tagsSorter?: "alpha" | ((args_0: any, args_1: any, ...args: unknown[]) => number) | undefined;
|
|
1592
|
-
operationsSorter?: "method" | "alpha" | ((args_0: any, args_1: any, ...args: unknown[]) => number) | undefined;
|
|
1593
|
-
}>;
|
|
1594
|
-
export type ApiReferenceConfigurationWithSources = Omit<z.infer<typeof apiReferenceConfigurationWithSourcesSchema>, 'proxy' | 'spec'>;
|
|
880
|
+
/** Api Config which includes the default config */
|
|
881
|
+
type ApiReferenceConfigurationWithDefault = ApiReferenceConfiguration & {
|
|
882
|
+
/** Whether to use this config as the default one */
|
|
883
|
+
default?: boolean;
|
|
884
|
+
};
|
|
885
|
+
/** Configuration for a single config with sources */
|
|
886
|
+
export type ApiReferenceConfigurationWithSources = Omit<ApiReferenceConfigurationWithDefault, 'default'> & {
|
|
887
|
+
sources: (SpecConfiguration & {
|
|
888
|
+
default?: boolean;
|
|
889
|
+
})[];
|
|
890
|
+
};
|
|
1595
891
|
/** Configuration for multiple Api References */
|
|
1596
|
-
export type
|
|
892
|
+
export type AnyApiReferenceConfiguration = Partial<ApiReferenceConfiguration> | Partial<ApiReferenceConfigurationWithSources> | Partial<ApiReferenceConfigurationWithDefault>[];
|
|
1597
893
|
/** Typeguard to check to narrow the configs to the one with sources */
|
|
1598
|
-
export declare const isConfigurationWithSources: (config:
|
|
894
|
+
export declare const isConfigurationWithSources: (config: AnyApiReferenceConfiguration) => config is Partial<ApiReferenceConfigurationWithSources>;
|
|
895
|
+
export {};
|
|
1599
896
|
//# sourceMappingURL=api-reference-configuration.d.ts.map
|
|
@@ -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;AA8EvB,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,eAA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: z.function().args(z.string()).returns(z.void()).optional(),
|
|
285
285
|
/** onServerChange is fired on selected server change */
|
|
286
286
|
onServerChange: z.function().args(z.string()).returns(z.void()).optional(),
|
|
287
|
+
/** onDocumentSelect is fired when the config is selected */
|
|
288
|
+
onDocumentSelect: z.function().returns(z.void()).optional(),
|
|
287
289
|
/**
|
|
288
290
|
* Route using paths instead of hashes, your server MUST support this
|
|
289
291
|
* @example '/standalone-api-reference/:custom(.*)?'
|
|
@@ -397,10 +399,6 @@ const _apiReferenceConfigurationSchema = apiClientConfigurationSchema.merge(z.ob
|
|
|
397
399
|
.union([z.literal('alpha'), z.literal('method'), z.function().args(z.any(), z.any()).returns(z.number())])
|
|
398
400
|
.optional(),
|
|
399
401
|
}));
|
|
400
|
-
/** Configuration for the Api Reference with sources before transforming */
|
|
401
|
-
const _apiReferenceConfigurationWithSourcesSchema = _apiReferenceConfigurationSchema.merge(z.object({
|
|
402
|
-
sources: z.array(specConfigurationSchema),
|
|
403
|
-
}));
|
|
404
402
|
/** Migrate the configuration through a transform */
|
|
405
403
|
const migrateConfiguration = (_configuration) => {
|
|
406
404
|
const configuration = { ..._configuration };
|
|
@@ -437,9 +435,7 @@ const migrateConfiguration = (_configuration) => {
|
|
|
437
435
|
};
|
|
438
436
|
/** Configuration for the Api Reference */
|
|
439
437
|
const apiReferenceConfigurationSchema = _apiReferenceConfigurationSchema.transform(migrateConfiguration);
|
|
440
|
-
/** Props for the ApiReference components, coming from user input */
|
|
441
|
-
const apiReferenceConfigurationWithSourcesSchema = _apiReferenceConfigurationWithSourcesSchema.transform(migrateConfiguration);
|
|
442
438
|
/** Typeguard to check to narrow the configs to the one with sources */
|
|
443
439
|
const isConfigurationWithSources = (config) => Boolean(!Array.isArray(config) && config && 'sources' in config && Array.isArray(config.sources));
|
|
444
440
|
|
|
445
|
-
export { apiClientConfigurationSchema, apiReferenceConfigurationSchema,
|
|
441
|
+
export { apiClientConfigurationSchema, apiReferenceConfigurationSchema, isConfigurationWithSources, specConfigurationSchema };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { type ApiClientConfiguration, type ApiReferenceConfiguration, type ApiReferenceConfigurationWithSources, type
|
|
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
4
|
//# 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,
|
|
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,3 +1,3 @@
|
|
|
1
|
-
export { apiClientConfigurationSchema, apiReferenceConfigurationSchema,
|
|
1
|
+
export { apiClientConfigurationSchema, apiReferenceConfigurationSchema, isConfigurationWithSources, specConfigurationSchema } from './api-reference-configuration.js';
|
|
2
2
|
export { htmlRenderingConfigurationSchema } from './html-rendering-configuration.js';
|
|
3
3
|
export { migrateThemeVariables } from './helpers/migrate-theme-variables.js';
|