@scalar/types 0.9.6 → 0.12.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 +25 -0
- package/dist/api-reference/api-reference-configuration.d.ts +15 -16
- package/dist/api-reference/api-reference-configuration.d.ts.map +1 -1
- package/dist/api-reference/api-reference-configuration.js +16 -2
- package/dist/api-reference/api-reference-plugin.d.ts +16 -16
- package/dist/api-reference/base-configuration.d.ts +4 -4
- package/dist/api-reference/html-api.d.ts +1 -1
- package/dist/api-reference/html-api.d.ts.map +1 -1
- package/dist/api-reference/html-rendering-configuration.d.ts +5 -10
- package/dist/api-reference/html-rendering-configuration.d.ts.map +1 -1
- package/dist/api-reference/html-rendering-configuration.js +1 -20
- package/dist/api-reference/index.d.ts +3 -8
- package/dist/api-reference/index.d.ts.map +1 -1
- package/dist/api-reference/index.js +1 -5
- package/dist/api-reference/types.d.ts +444 -0
- package/dist/api-reference/types.d.ts.map +1 -0
- package/dist/api-reference/types.js +2 -0
- package/dist/asyncapi/3.1/index.d.ts +2 -0
- package/dist/asyncapi/3.1/index.d.ts.map +1 -0
- package/dist/asyncapi/3.1/index.generated.d.ts +738 -0
- package/dist/asyncapi/3.1/index.generated.d.ts.map +1 -0
- package/dist/asyncapi/3.1/index.generated.js +6 -0
- package/dist/asyncapi/3.1/index.js +1 -0
- package/dist/entities/security-scheme.d.ts +5 -5
- package/dist/extensions/document/index.d.ts +222 -0
- package/dist/extensions/document/index.d.ts.map +1 -0
- package/dist/extensions/document/index.js +6 -0
- package/dist/extensions/example/index.d.ts +18 -0
- package/dist/extensions/example/index.d.ts.map +1 -0
- package/dist/extensions/example/index.js +6 -0
- package/dist/extensions/general/index.d.ts +90 -0
- package/dist/extensions/general/index.d.ts.map +1 -0
- package/dist/extensions/general/index.js +6 -0
- package/dist/extensions/index.d.ts +16 -0
- package/dist/extensions/index.d.ts.map +1 -0
- package/dist/extensions/index.js +6 -0
- package/dist/extensions/operation/index.d.ts +136 -0
- package/dist/extensions/operation/index.d.ts.map +1 -0
- package/dist/extensions/operation/index.js +6 -0
- package/dist/extensions/parameter/index.d.ts +18 -0
- package/dist/extensions/parameter/index.d.ts.map +1 -0
- package/dist/extensions/parameter/index.js +6 -0
- package/dist/extensions/schema/index.d.ts +75 -0
- package/dist/extensions/schema/index.d.ts.map +1 -0
- package/dist/extensions/schema/index.js +6 -0
- package/dist/extensions/security/index.d.ts +139 -0
- package/dist/extensions/security/index.d.ts.map +1 -0
- package/dist/extensions/security/index.js +6 -0
- package/dist/extensions/server/index.d.ts +18 -0
- package/dist/extensions/server/index.d.ts.map +1 -0
- package/dist/extensions/server/index.js +6 -0
- package/dist/extensions/tag/index.d.ts +55 -0
- package/dist/extensions/tag/index.d.ts.map +1 -0
- package/dist/extensions/tag/index.js +6 -0
- package/dist/extensions/workspace/index.d.ts +44 -0
- package/dist/extensions/workspace/index.d.ts.map +1 -0
- package/dist/extensions/workspace/index.js +6 -0
- package/dist/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/openapi/3.1/index.d.ts +4 -0
- package/dist/openapi/3.1/index.d.ts.map +1 -0
- package/dist/openapi/3.1/index.generated.d.ts +1199 -0
- package/dist/openapi/3.1/index.generated.d.ts.map +1 -0
- package/dist/openapi/3.1/index.generated.js +6 -0
- package/dist/openapi/3.1/index.js +1 -0
- package/dist/snippetz/snippetz.d.ts +1 -1
- package/package.json +67 -2
- package/dist/api-reference/api-client-configuration.d.ts +0 -141
- package/dist/api-reference/api-client-configuration.d.ts.map +0 -1
- package/dist/api-reference/api-client-configuration.js +0 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,30 @@
|
|
|
1
1
|
# @scalar/types
|
|
2
2
|
|
|
3
|
+
## 0.12.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [#9264](https://github.com/scalar/scalar/pull/9264): feat: add AsyncAPI 3.1 types and `@scalar/types/asyncapi/3.1` export
|
|
8
|
+
- [#9297](https://github.com/scalar/scalar/pull/9297): feat: add asyncapi extensions
|
|
9
|
+
|
|
10
|
+
### Patch Changes
|
|
11
|
+
|
|
12
|
+
- [#9169](https://github.com/scalar/scalar/pull/9169): feat: add `customFetch` to the api-reference configuration and forward it to the API client so requests (including "Test Request" calls) use the custom fetch — enabling things like `credentials: 'include'`. The previous `fetch` option is deprecated and migrated automatically with a console warning.
|
|
13
|
+
- [#9294](https://github.com/scalar/scalar/pull/9294): refactor: move the schemas to the schemas folder and generate the types from schemas
|
|
14
|
+
- [#9292](https://github.com/scalar/scalar/pull/9292): refactor: move extensions to the schema package
|
|
15
|
+
|
|
16
|
+
## 0.11.0
|
|
17
|
+
|
|
18
|
+
### Minor Changes
|
|
19
|
+
|
|
20
|
+
- [#9211](https://github.com/scalar/scalar/pull/9211): feat: write pure types without using the zod schemas
|
|
21
|
+
|
|
22
|
+
## 0.10.0
|
|
23
|
+
|
|
24
|
+
### Minor Changes
|
|
25
|
+
|
|
26
|
+
- [#8844](https://github.com/scalar/scalar/pull/8844): feat: write pure types without using the zod schemas
|
|
27
|
+
|
|
3
28
|
## 0.9.6
|
|
4
29
|
|
|
5
30
|
## 0.9.5
|
|
@@ -50,14 +50,14 @@ export declare const apiReferenceConfigurationSchema: z.ZodObject<{
|
|
|
50
50
|
servers: z.ZodOptional<z.ZodArray<z.ZodAny>>;
|
|
51
51
|
showSidebar: z.ZodCatch<z.ZodDefault<z.ZodOptional<z.ZodBoolean>>>;
|
|
52
52
|
showDeveloperTools: z.ZodCatch<z.ZodDefault<z.ZodOptional<z.ZodEnum<{
|
|
53
|
-
never: "never";
|
|
54
|
-
always: "always";
|
|
55
53
|
localhost: "localhost";
|
|
54
|
+
always: "always";
|
|
55
|
+
never: "never";
|
|
56
56
|
}>>>>;
|
|
57
57
|
showToolbar: z.ZodCatch<z.ZodDefault<z.ZodOptional<z.ZodEnum<{
|
|
58
|
-
never: "never";
|
|
59
|
-
always: "always";
|
|
60
58
|
localhost: "localhost";
|
|
59
|
+
always: "always";
|
|
60
|
+
never: "never";
|
|
61
61
|
}>>>>;
|
|
62
62
|
operationTitleSource: z.ZodCatch<z.ZodDefault<z.ZodOptional<z.ZodEnum<{
|
|
63
63
|
summary: "summary";
|
|
@@ -118,6 +118,7 @@ export declare const apiReferenceConfigurationSchema: z.ZodObject<{
|
|
|
118
118
|
}>>>>;
|
|
119
119
|
proxy: z.ZodOptional<z.ZodString>;
|
|
120
120
|
fetch: z.ZodOptional<z.ZodCustom<(input: string | URL | Request, init?: RequestInit) => Promise<Response>, (input: string | URL | Request, init?: RequestInit) => Promise<Response>>>;
|
|
121
|
+
customFetch: z.ZodOptional<z.ZodCustom<(input: string | URL | Request, init?: RequestInit) => Promise<Response>, (input: string | URL | Request, init?: RequestInit) => Promise<Response>>>;
|
|
121
122
|
plugins: z.ZodOptional<z.ZodArray<z.ZodFunction<z.ZodTuple<readonly [], null>, z.ZodObject<{
|
|
122
123
|
name: z.ZodString;
|
|
123
124
|
extensions: z.ZodArray<z.ZodObject<{
|
|
@@ -173,14 +174,14 @@ export declare const apiReferenceConfigurationSchema: z.ZodObject<{
|
|
|
173
174
|
servers: z.ZodOptional<z.ZodOptional<z.ZodArray<z.ZodAny>>>;
|
|
174
175
|
showSidebar: z.ZodOptional<z.ZodCatch<z.ZodDefault<z.ZodOptional<z.ZodBoolean>>>>;
|
|
175
176
|
showDeveloperTools: z.ZodOptional<z.ZodCatch<z.ZodDefault<z.ZodOptional<z.ZodEnum<{
|
|
176
|
-
never: "never";
|
|
177
|
-
always: "always";
|
|
178
177
|
localhost: "localhost";
|
|
178
|
+
always: "always";
|
|
179
|
+
never: "never";
|
|
179
180
|
}>>>>>;
|
|
180
181
|
showToolbar: z.ZodOptional<z.ZodCatch<z.ZodDefault<z.ZodOptional<z.ZodEnum<{
|
|
181
|
-
never: "never";
|
|
182
|
-
always: "always";
|
|
183
182
|
localhost: "localhost";
|
|
183
|
+
always: "always";
|
|
184
|
+
never: "never";
|
|
184
185
|
}>>>>>;
|
|
185
186
|
operationTitleSource: z.ZodOptional<z.ZodCatch<z.ZodDefault<z.ZodOptional<z.ZodEnum<{
|
|
186
187
|
summary: "summary";
|
|
@@ -301,14 +302,14 @@ export declare const apiReferenceConfigurationSchema: z.ZodObject<{
|
|
|
301
302
|
servers: z.ZodOptional<z.ZodOptional<z.ZodArray<z.ZodAny>>>;
|
|
302
303
|
showSidebar: z.ZodOptional<z.ZodCatch<z.ZodDefault<z.ZodOptional<z.ZodBoolean>>>>;
|
|
303
304
|
showDeveloperTools: z.ZodOptional<z.ZodCatch<z.ZodDefault<z.ZodOptional<z.ZodEnum<{
|
|
304
|
-
never: "never";
|
|
305
|
-
always: "always";
|
|
306
305
|
localhost: "localhost";
|
|
306
|
+
always: "always";
|
|
307
|
+
never: "never";
|
|
307
308
|
}>>>>>;
|
|
308
309
|
showToolbar: z.ZodOptional<z.ZodCatch<z.ZodDefault<z.ZodOptional<z.ZodEnum<{
|
|
309
|
-
never: "never";
|
|
310
|
-
always: "always";
|
|
311
310
|
localhost: "localhost";
|
|
311
|
+
always: "always";
|
|
312
|
+
never: "never";
|
|
312
313
|
}>>>>>;
|
|
313
314
|
operationTitleSource: z.ZodOptional<z.ZodCatch<z.ZodDefault<z.ZodOptional<z.ZodEnum<{
|
|
314
315
|
summary: "summary";
|
|
@@ -398,9 +399,9 @@ export declare const apiReferenceConfigurationSchema: z.ZodObject<{
|
|
|
398
399
|
hideModels: z.ZodCatch<z.ZodDefault<z.ZodOptional<z.ZodBoolean>>>;
|
|
399
400
|
documentDownloadType: z.ZodCatch<z.ZodDefault<z.ZodOptional<z.ZodEnum<{
|
|
400
401
|
none: "none";
|
|
402
|
+
both: "both";
|
|
401
403
|
yaml: "yaml";
|
|
402
404
|
json: "json";
|
|
403
|
-
both: "both";
|
|
404
405
|
direct: "direct";
|
|
405
406
|
}>>>>;
|
|
406
407
|
hideDownloadButton: z.ZodOptional<z.ZodBoolean>;
|
|
@@ -417,7 +418,7 @@ export declare const apiReferenceConfigurationSchema: z.ZodObject<{
|
|
|
417
418
|
favicon: z.ZodOptional<z.ZodString>;
|
|
418
419
|
hiddenClients: z.ZodOptional<z.ZodUnion<readonly [z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodBoolean, z.ZodArray<z.ZodString>]>>, z.ZodArray<z.ZodString>, z.ZodLiteral<true>]>>;
|
|
419
420
|
defaultHttpClient: z.ZodOptional<z.ZodObject<{
|
|
420
|
-
targetKey: z.ZodCustom<"
|
|
421
|
+
targetKey: z.ZodCustom<"http" | "c" | "r" | "go" | "rust" | "clojure" | "csharp" | "dart" | "fsharp" | "java" | "js" | "kotlin" | "node" | "objc" | "ocaml" | "php" | "powershell" | "python" | "ruby" | "shell" | "swift", "http" | "c" | "r" | "go" | "rust" | "clojure" | "csharp" | "dart" | "fsharp" | "java" | "js" | "kotlin" | "node" | "objc" | "ocaml" | "php" | "powershell" | "python" | "ruby" | "shell" | "swift">;
|
|
421
422
|
clientKey: z.ZodString;
|
|
422
423
|
}, z.core.$strip>>;
|
|
423
424
|
customCss: z.ZodOptional<z.ZodString>;
|
|
@@ -541,6 +542,4 @@ export type ApiReferenceConfigurationWithMultipleSources = ApiReferenceConfigura
|
|
|
541
542
|
};
|
|
542
543
|
/** Configuration for multiple Api References */
|
|
543
544
|
export type AnyApiReferenceConfiguration = Partial<ApiReferenceConfigurationWithSource> | Partial<ApiReferenceConfigurationWithMultipleSources> | Partial<ApiReferenceConfigurationWithSource>[] | Partial<ApiReferenceConfigurationWithMultipleSources>[];
|
|
544
|
-
/** Typeguard to check to narrow the configs to the one with sources */
|
|
545
|
-
export declare const isConfigurationWithSources: (config: AnyApiReferenceConfiguration) => config is Partial<ApiReferenceConfigurationWithMultipleSources>;
|
|
546
545
|
//# 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,KAAK,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAIrC,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,gCAAgC,CAAA;AAEjF,OAAO,EAAE,KAAK,mBAAmB,EAA6B,MAAM,wBAAwB,CAAA;AAK5F;;;;;;;;;GASG;AACH,eAAO,MAAM,+BAA+B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;6CAZH,MAAM,GAAG,GAAG,GAAG,OAAO,SAAS,WAAW,KAAK,OAAO,CAAC,QAAQ,CAAC,UAAhE,MAAM,GAAG,GAAG,GAAG,OAAO,SAAS,WAAW,KAAK,OAAO,CAAC,QAAQ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"api-reference-configuration.d.ts","sourceRoot":"","sources":["../../src/api-reference/api-reference-configuration.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAIrC,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,gCAAgC,CAAA;AAEjF,OAAO,EAAE,KAAK,mBAAmB,EAA6B,MAAM,wBAAwB,CAAA;AAK5F;;;;;;;;;GASG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AyB,EAAE,KAAK,GAAG,SAAS,CAAC,GAAG,mBAAmB,CA2ExE,CAAA;AAEF;;GAEG;AACH,MAAM,MAAM,mCAAmC,GAAG,IAAI,CACpD,CAAC,CAAC,KAAK,CAAC,OAAO,yCAAyC,CAAC,EAEzD,OAAO,GAAG,MAAM,GAAG,gBAAgB,GAAG,aAAa,CACpD,GAAG;IACF,cAAc,CAAC,EAAE,2BAA2B,CAAA;CAC7C,CAAA;AAED;;;GAGG;AACH,MAAM,MAAM,4CAA4C,GAAG,mCAAmC,GAAG;IAC/F,OAAO,EAAE,mBAAmB,EAAE,CAAA;CAC/B,CAAA;AAED,gDAAgD;AAChD,MAAM,MAAM,4BAA4B,GACpC,OAAO,CAAC,mCAAmC,CAAC,GAC5C,OAAO,CAAC,4CAA4C,CAAC,GACrD,OAAO,CAAC,mCAAmC,CAAC,EAAE,GAC9C,OAAO,CAAC,4CAA4C,CAAC,EAAE,CAAA"}
|
|
@@ -29,8 +29,16 @@ export const apiReferenceConfigurationSchema = baseConfigurationSchema.extend({
|
|
|
29
29
|
* Custom fetch function for custom logic
|
|
30
30
|
*
|
|
31
31
|
* Can be used to add custom headers, handle auth, etc.
|
|
32
|
+
*
|
|
33
|
+
* @deprecated Use `customFetch` instead.
|
|
32
34
|
*/
|
|
33
35
|
fetch: fetchLikeSchema.optional(),
|
|
36
|
+
/**
|
|
37
|
+
* Custom fetch function used both when loading the OpenAPI document and when sending requests from the API client.
|
|
38
|
+
*
|
|
39
|
+
* Can be used to add custom headers, attach credentials (for example `credentials: 'include'`), handle auth, etc.
|
|
40
|
+
*/
|
|
41
|
+
customFetch: fetchLikeSchema.optional(),
|
|
34
42
|
/**
|
|
35
43
|
* Plugins for the API reference
|
|
36
44
|
*/
|
|
@@ -397,6 +405,14 @@ export const apiReferenceConfigurationWithSourceSchema = apiReferenceConfigurati
|
|
|
397
405
|
}
|
|
398
406
|
delete configuration.proxy;
|
|
399
407
|
}
|
|
408
|
+
// Migrate fetch to customFetch
|
|
409
|
+
if (configuration.fetch) {
|
|
410
|
+
console.warn(`[DEPRECATED] You're using the deprecated 'fetch' attribute. Use 'customFetch' instead.`);
|
|
411
|
+
if (!configuration.customFetch) {
|
|
412
|
+
configuration.customFetch = configuration.fetch;
|
|
413
|
+
}
|
|
414
|
+
delete configuration.fetch;
|
|
415
|
+
}
|
|
400
416
|
if (configuration.proxyUrl === OLD_PROXY_URL) {
|
|
401
417
|
console.warn(`[DEPRECATED] Warning: configuration.proxyUrl points to our old proxy (${OLD_PROXY_URL}).`);
|
|
402
418
|
console.warn(`[DEPRECATED] We are overwriting the value and use the new proxy URL (${NEW_PROXY_URL}) instead.`);
|
|
@@ -412,5 +428,3 @@ export const apiReferenceConfigurationWithSourceSchema = apiReferenceConfigurati
|
|
|
412
428
|
}
|
|
413
429
|
return configuration;
|
|
414
430
|
});
|
|
415
|
-
/** Typeguard to check to narrow the configs to the one with sources */
|
|
416
|
-
export const isConfigurationWithSources = (config) => Boolean(!Array.isArray(config) && config && 'sources' in config && Array.isArray(config.sources));
|
|
@@ -50,14 +50,14 @@ declare const lifecycleHooksSchema: z.ZodObject<{
|
|
|
50
50
|
servers: z.ZodOptional<z.ZodOptional<z.ZodArray<z.ZodAny>>>;
|
|
51
51
|
showSidebar: z.ZodOptional<z.ZodCatch<z.ZodDefault<z.ZodOptional<z.ZodBoolean>>>>;
|
|
52
52
|
showDeveloperTools: z.ZodOptional<z.ZodCatch<z.ZodDefault<z.ZodOptional<z.ZodEnum<{
|
|
53
|
-
never: "never";
|
|
54
|
-
always: "always";
|
|
55
53
|
localhost: "localhost";
|
|
54
|
+
always: "always";
|
|
55
|
+
never: "never";
|
|
56
56
|
}>>>>>;
|
|
57
57
|
showToolbar: z.ZodOptional<z.ZodCatch<z.ZodDefault<z.ZodOptional<z.ZodEnum<{
|
|
58
|
-
never: "never";
|
|
59
|
-
always: "always";
|
|
60
58
|
localhost: "localhost";
|
|
59
|
+
always: "always";
|
|
60
|
+
never: "never";
|
|
61
61
|
}>>>>>;
|
|
62
62
|
operationTitleSource: z.ZodOptional<z.ZodCatch<z.ZodDefault<z.ZodOptional<z.ZodEnum<{
|
|
63
63
|
summary: "summary";
|
|
@@ -178,14 +178,14 @@ declare const lifecycleHooksSchema: z.ZodObject<{
|
|
|
178
178
|
servers: z.ZodOptional<z.ZodOptional<z.ZodArray<z.ZodAny>>>;
|
|
179
179
|
showSidebar: z.ZodOptional<z.ZodCatch<z.ZodDefault<z.ZodOptional<z.ZodBoolean>>>>;
|
|
180
180
|
showDeveloperTools: z.ZodOptional<z.ZodCatch<z.ZodDefault<z.ZodOptional<z.ZodEnum<{
|
|
181
|
-
never: "never";
|
|
182
|
-
always: "always";
|
|
183
181
|
localhost: "localhost";
|
|
182
|
+
always: "always";
|
|
183
|
+
never: "never";
|
|
184
184
|
}>>>>>;
|
|
185
185
|
showToolbar: z.ZodOptional<z.ZodCatch<z.ZodDefault<z.ZodOptional<z.ZodEnum<{
|
|
186
|
-
never: "never";
|
|
187
|
-
always: "always";
|
|
188
186
|
localhost: "localhost";
|
|
187
|
+
always: "always";
|
|
188
|
+
never: "never";
|
|
189
189
|
}>>>>>;
|
|
190
190
|
operationTitleSource: z.ZodOptional<z.ZodCatch<z.ZodDefault<z.ZodOptional<z.ZodEnum<{
|
|
191
191
|
summary: "summary";
|
|
@@ -323,14 +323,14 @@ export declare const apiReferencePluginSchema: z.ZodFunction<z.ZodTuple<readonly
|
|
|
323
323
|
servers: z.ZodOptional<z.ZodOptional<z.ZodArray<z.ZodAny>>>;
|
|
324
324
|
showSidebar: z.ZodOptional<z.ZodCatch<z.ZodDefault<z.ZodOptional<z.ZodBoolean>>>>;
|
|
325
325
|
showDeveloperTools: z.ZodOptional<z.ZodCatch<z.ZodDefault<z.ZodOptional<z.ZodEnum<{
|
|
326
|
-
never: "never";
|
|
327
|
-
always: "always";
|
|
328
326
|
localhost: "localhost";
|
|
327
|
+
always: "always";
|
|
328
|
+
never: "never";
|
|
329
329
|
}>>>>>;
|
|
330
330
|
showToolbar: z.ZodOptional<z.ZodCatch<z.ZodDefault<z.ZodOptional<z.ZodEnum<{
|
|
331
|
-
never: "never";
|
|
332
|
-
always: "always";
|
|
333
331
|
localhost: "localhost";
|
|
332
|
+
always: "always";
|
|
333
|
+
never: "never";
|
|
334
334
|
}>>>>>;
|
|
335
335
|
operationTitleSource: z.ZodOptional<z.ZodCatch<z.ZodDefault<z.ZodOptional<z.ZodEnum<{
|
|
336
336
|
summary: "summary";
|
|
@@ -451,14 +451,14 @@ export declare const apiReferencePluginSchema: z.ZodFunction<z.ZodTuple<readonly
|
|
|
451
451
|
servers: z.ZodOptional<z.ZodOptional<z.ZodArray<z.ZodAny>>>;
|
|
452
452
|
showSidebar: z.ZodOptional<z.ZodCatch<z.ZodDefault<z.ZodOptional<z.ZodBoolean>>>>;
|
|
453
453
|
showDeveloperTools: z.ZodOptional<z.ZodCatch<z.ZodDefault<z.ZodOptional<z.ZodEnum<{
|
|
454
|
-
never: "never";
|
|
455
|
-
always: "always";
|
|
456
454
|
localhost: "localhost";
|
|
455
|
+
always: "always";
|
|
456
|
+
never: "never";
|
|
457
457
|
}>>>>>;
|
|
458
458
|
showToolbar: z.ZodOptional<z.ZodCatch<z.ZodDefault<z.ZodOptional<z.ZodEnum<{
|
|
459
|
-
never: "never";
|
|
460
|
-
always: "always";
|
|
461
459
|
localhost: "localhost";
|
|
460
|
+
always: "always";
|
|
461
|
+
never: "never";
|
|
462
462
|
}>>>>>;
|
|
463
463
|
operationTitleSource: z.ZodOptional<z.ZodCatch<z.ZodDefault<z.ZodOptional<z.ZodEnum<{
|
|
464
464
|
summary: "summary";
|
|
@@ -49,14 +49,14 @@ export declare const baseConfigurationSchema: z.ZodObject<{
|
|
|
49
49
|
servers: z.ZodOptional<z.ZodArray<z.ZodAny>>;
|
|
50
50
|
showSidebar: z.ZodCatch<z.ZodDefault<z.ZodOptional<z.ZodBoolean>>>;
|
|
51
51
|
showDeveloperTools: z.ZodCatch<z.ZodDefault<z.ZodOptional<z.ZodEnum<{
|
|
52
|
-
never: "never";
|
|
53
|
-
always: "always";
|
|
54
52
|
localhost: "localhost";
|
|
53
|
+
always: "always";
|
|
54
|
+
never: "never";
|
|
55
55
|
}>>>>;
|
|
56
56
|
showToolbar: z.ZodCatch<z.ZodDefault<z.ZodOptional<z.ZodEnum<{
|
|
57
|
-
never: "never";
|
|
58
|
-
always: "always";
|
|
59
57
|
localhost: "localhost";
|
|
58
|
+
always: "always";
|
|
59
|
+
never: "never";
|
|
60
60
|
}>>>>;
|
|
61
61
|
operationTitleSource: z.ZodCatch<z.ZodDefault<z.ZodOptional<z.ZodEnum<{
|
|
62
62
|
summary: "summary";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { AnyApiReferenceConfiguration } from './
|
|
1
|
+
import type { AnyApiReferenceConfiguration } from './types.js';
|
|
2
2
|
/**
|
|
3
3
|
* This is a subset of the vue app type
|
|
4
4
|
* Didn't want to add vue as a dependency just for this type so we stub whatever we need for the html api
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"html-api.d.ts","sourceRoot":"","sources":["../../src/api-reference/html-api.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM
|
|
1
|
+
{"version":3,"file":"html-api.d.ts","sourceRoot":"","sources":["../../src/api-reference/html-api.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,SAAS,CAAA;AAE3D;;;GAGG;AACH,KAAK,GAAG,CAAC,WAAW,GAAG,GAAG,IAAI;IAC5B,KAAK,CAAC,aAAa,EAAE,WAAW,GAAG,MAAM,GAAG,OAAO,CAAA;IACnD,OAAO,IAAI,IAAI,CAAA;IACf,SAAS,CAAC,EAAE,EAAE,MAAM,IAAI,GAAG,IAAI,CAAA;CAChC,CAAA;AAED,wDAAwD;AACxD,MAAM,MAAM,oBAAoB,GAAG;IACjC,2BAA2B;IAC3B,GAAG,EAAE,GAAG,CAAC,OAAO,CAAC,CAAA;IACjB,iDAAiD;IACjD,OAAO,EAAE,MAAM,IAAI,CAAA;IACnB,uCAAuC;IACvC,gBAAgB,EAAE,MAAM,4BAA4B,CAAA;IACpD,kCAAkC;IAClC,mBAAmB,EAAE,CAAC,SAAS,EAAE,4BAA4B,KAAK,IAAI,CAAA;CACvE,CAAA;AAED,sFAAsF;AACtF,MAAM,MAAM,kBAAkB,GAAG;IAC/B,qCAAqC;IACrC,CAAC,aAAa,EAAE,4BAA4B,GAAG,oBAAoB,CAAA;IACnE,wDAAwD;IACxD,CAAC,iBAAiB,EAAE,OAAO,GAAG,MAAM,EAAE,aAAa,EAAE,4BAA4B,GAAG,oBAAoB,CAAA;CACzG,CAAA"}
|
|
@@ -1,16 +1,11 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import type { ApiReferenceConfigurationWithMultipleSources } from './api-reference-configuration.js';
|
|
3
|
-
/**
|
|
4
|
-
* Zod schema for HTML rendering configuration
|
|
5
|
-
*/
|
|
6
|
-
export declare const htmlRenderingConfigurationSchema: z.ZodObject<{
|
|
7
|
-
cdn: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
8
|
-
pageTitle: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
9
|
-
}, z.core.$strip>;
|
|
1
|
+
import type { ApiReferenceConfigurationWithMultipleSources } from './types.js';
|
|
10
2
|
/**
|
|
11
3
|
* The configuration for the static HTML rendering using the CDN.
|
|
12
4
|
*
|
|
13
5
|
* It's the ApiReferenceConfiguration, but extended with the `pageTitle` and `cdn` options.
|
|
14
6
|
*/
|
|
15
|
-
export type HtmlRenderingConfiguration = Partial<ApiReferenceConfigurationWithMultipleSources> &
|
|
7
|
+
export type HtmlRenderingConfiguration = Partial<ApiReferenceConfigurationWithMultipleSources> & {
|
|
8
|
+
pageTitle: string;
|
|
9
|
+
cdn: string;
|
|
10
|
+
};
|
|
16
11
|
//# sourceMappingURL=html-rendering-configuration.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"html-rendering-configuration.d.ts","sourceRoot":"","sources":["../../src/api-reference/html-rendering-configuration.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"html-rendering-configuration.d.ts","sourceRoot":"","sources":["../../src/api-reference/html-rendering-configuration.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,4CAA4C,EAAE,MAAM,SAAS,CAAA;AAE3E;;;;GAIG;AACH,MAAM,MAAM,0BAA0B,GAAG,OAAO,CAAC,4CAA4C,CAAC,GAAG;IAC/F,SAAS,EAAE,MAAM,CAAA;IACjB,GAAG,EAAE,MAAM,CAAA;CACZ,CAAA"}
|
|
@@ -1,20 +1 @@
|
|
|
1
|
-
|
|
2
|
-
/**
|
|
3
|
-
* Zod schema for HTML rendering configuration
|
|
4
|
-
*/
|
|
5
|
-
export const htmlRenderingConfigurationSchema = z.object({
|
|
6
|
-
/**
|
|
7
|
-
* The URL to the Scalar API Reference JS CDN.
|
|
8
|
-
*
|
|
9
|
-
* Use this to pin a specific version of the Scalar API Reference.
|
|
10
|
-
*
|
|
11
|
-
* @default https://cdn.jsdelivr.net/npm/@scalar/api-reference
|
|
12
|
-
*
|
|
13
|
-
* @example https://cdn.jsdelivr.net/npm/@scalar/api-reference@1.25.122
|
|
14
|
-
*/
|
|
15
|
-
cdn: z.string().optional().default('https://cdn.jsdelivr.net/npm/@scalar/api-reference'),
|
|
16
|
-
/**
|
|
17
|
-
* The title of the page.
|
|
18
|
-
*/
|
|
19
|
-
pageTitle: z.string().optional().default('Scalar API Reference'),
|
|
20
|
-
});
|
|
1
|
+
export {};
|
|
@@ -1,10 +1,5 @@
|
|
|
1
|
-
export { type ApiClientConfiguration, apiClientConfigurationSchema, } from './api-client-configuration.js';
|
|
2
|
-
export { type ApiClientPlugin, apiClientPluginSchema, hooksSchema } from './api-client-plugin.js';
|
|
3
|
-
export { type AnyApiReferenceConfiguration, type ApiReferenceConfiguration, type ApiReferenceConfigurationRaw, type ApiReferenceConfigurationWithMultipleSources, type ApiReferenceConfigurationWithSource, apiReferenceConfigurationSchema, apiReferenceConfigurationWithSourceSchema, isConfigurationWithSources, } from './api-reference-configuration.js';
|
|
4
|
-
export type { ApiReferencePlugin, LifecycleHooks, SpecificationExtension, ViewComponent, } from './api-reference-plugin.js';
|
|
5
|
-
export type { AuthenticationConfiguration } from './authentication-configuration.js';
|
|
6
|
-
export type { BaseConfiguration, ExternalUrls } from './base-configuration.js';
|
|
7
1
|
export type { ApiReferenceInstance, CreateApiReference } from './html-api.js';
|
|
8
|
-
export {
|
|
9
|
-
export {
|
|
2
|
+
export type { HtmlRenderingConfiguration } from './html-rendering-configuration.js';
|
|
3
|
+
export type { AnyApiReferenceConfiguration, ApiClientConfiguration, ApiReferenceConfiguration, ApiReferenceConfigurationRaw, ApiReferenceConfigurationWithMultipleSources, ApiReferenceConfigurationWithSource, ApiReferencePlugin, AuthenticationConfiguration, BaseConfiguration, ExternalUrls, LifecycleHooks, SecurityScheme, SecuritySchemeApiKey, SecuritySchemeHttp, SecuritySchemeOauth2, SecuritySchemeOpenIdConnect, SourceConfiguration, SpecificationExtension, ViewComponent, } from './types.js';
|
|
4
|
+
export { isConfigurationWithSources } from './types.js';
|
|
10
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,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/api-reference/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,oBAAoB,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAA;AAC1E,YAAY,EAAE,0BAA0B,EAAE,MAAM,gCAAgC,CAAA;AAChF,YAAY,EACV,4BAA4B,EAC5B,sBAAsB,EACtB,yBAAyB,EACzB,4BAA4B,EAC5B,4CAA4C,EAC5C,mCAAmC,EACnC,kBAAkB,EAClB,2BAA2B,EAC3B,iBAAiB,EACjB,YAAY,EACZ,cAAc,EACd,cAAc,EACd,oBAAoB,EACpB,kBAAkB,EAClB,oBAAoB,EACpB,2BAA2B,EAC3B,mBAAmB,EACnB,sBAAsB,EACtB,aAAa,GACd,MAAM,SAAS,CAAA;AAChB,OAAO,EAAE,0BAA0B,EAAE,MAAM,SAAS,CAAA"}
|
|
@@ -1,5 +1 @@
|
|
|
1
|
-
export {
|
|
2
|
-
export { apiClientPluginSchema, hooksSchema } from './api-client-plugin.js';
|
|
3
|
-
export { apiReferenceConfigurationSchema, apiReferenceConfigurationWithSourceSchema, isConfigurationWithSources, } from './api-reference-configuration.js';
|
|
4
|
-
export { htmlRenderingConfigurationSchema, } from './html-rendering-configuration.js';
|
|
5
|
-
export { sourceConfigurationSchema, } from './source-configuration.js';
|
|
1
|
+
export { isConfigurationWithSources } from './types.js';
|