@scalar/types 0.2.16 → 0.3.1
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 +19 -0
- package/dist/api-reference/api-client-configuration.d.ts +122 -0
- package/dist/api-reference/api-client-configuration.d.ts.map +1 -0
- package/dist/api-reference/api-client-configuration.js +7 -0
- package/dist/api-reference/api-client-configuration.js.map +7 -0
- package/dist/api-reference/api-client-plugin.d.ts +39 -0
- package/dist/api-reference/api-client-plugin.d.ts.map +1 -0
- package/dist/api-reference/api-client-plugin.js +34 -0
- package/dist/api-reference/api-client-plugin.js.map +7 -0
- package/dist/api-reference/api-reference-configuration.d.ts +177 -2144
- package/dist/api-reference/api-reference-configuration.d.ts.map +1 -1
- package/dist/api-reference/api-reference-configuration.js +263 -440
- package/dist/api-reference/api-reference-configuration.js.map +2 -2
- package/dist/api-reference/api-reference-plugin.d.ts +7 -65
- package/dist/api-reference/api-reference-plugin.d.ts.map +1 -1
- package/dist/api-reference/api-reference-plugin.js +8 -7
- package/dist/api-reference/api-reference-plugin.js.map +2 -2
- package/dist/api-reference/base-configuration.d.ts +118 -0
- package/dist/api-reference/base-configuration.d.ts.map +1 -0
- package/dist/api-reference/base-configuration.js +139 -0
- package/dist/api-reference/base-configuration.js.map +7 -0
- package/dist/api-reference/html-rendering-configuration.d.ts +3 -21
- package/dist/api-reference/html-rendering-configuration.d.ts.map +1 -1
- package/dist/api-reference/html-rendering-configuration.js.map +2 -2
- package/dist/api-reference/index.d.ts +6 -3
- package/dist/api-reference/index.d.ts.map +1 -1
- package/dist/api-reference/index.js +12 -3
- package/dist/api-reference/index.js.map +2 -2
- package/dist/api-reference/source-configuration.d.ts +18 -0
- package/dist/api-reference/source-configuration.d.ts.map +1 -0
- package/dist/api-reference/source-configuration.js +87 -0
- package/dist/api-reference/source-configuration.js.map +7 -0
- package/dist/entities/security-scheme.d.ts +220 -1641
- package/dist/entities/security-scheme.d.ts.map +1 -1
- package/dist/entities/security-scheme.js +11 -2
- package/dist/entities/security-scheme.js.map +2 -2
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +2 -2
- package/dist/snippetz/snippetz.d.ts +9 -3
- package/dist/snippetz/snippetz.d.ts.map +1 -1
- package/dist/snippetz/snippetz.js +1 -0
- package/dist/snippetz/snippetz.js.map +2 -2
- package/package.json +4 -4
- package/dist/api-client/api-client-plugin.d.ts +0 -172
- package/dist/api-client/api-client-plugin.d.ts.map +0 -1
- package/dist/api-client/api-client-plugin.js +0 -33
- package/dist/api-client/api-client-plugin.js.map +0 -7
- package/dist/api-client/index.d.ts +0 -2
- package/dist/api-client/index.d.ts.map +0 -1
- package/dist/api-client/index.js +0 -6
- package/dist/api-client/index.js.map +0 -7
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/api-reference/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/api-reference/index.ts"],"names":[],"mappings":"AACA,OAAO,EACL,KAAK,sBAAsB,EAC3B,4BAA4B,GAC7B,MAAM,4BAA4B,CAAA;AACnC,OAAO,EAAE,KAAK,eAAe,EAAE,qBAAqB,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAA;AAC9F,OAAO,EACL,KAAK,4BAA4B,EACjC,KAAK,yBAAyB,EAC9B,KAAK,oCAAoC,EACzC,KAAK,4CAA4C,EACjD,KAAK,mCAAmC,EACxC,+BAA+B,EAC/B,yCAAyC,EACzC,0BAA0B,GAC3B,MAAM,+BAA+B,CAAA;AACtC,YAAY,EACV,kBAAkB,EAClB,sBAAsB,GACvB,MAAM,wBAAwB,CAAA;AAC/B,YAAY,EAAE,oBAAoB,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAA;AAC1E,OAAO,EACL,KAAK,0BAA0B,EAC/B,gCAAgC,GACjC,MAAM,gCAAgC,CAAA;AACvC,OAAO,EACL,KAAK,mBAAmB,EACxB,yBAAyB,GAC1B,MAAM,wBAAwB,CAAA"}
|
|
@@ -1,17 +1,26 @@
|
|
|
1
1
|
import {
|
|
2
|
-
apiClientConfigurationSchema
|
|
2
|
+
apiClientConfigurationSchema
|
|
3
|
+
} from "./api-client-configuration.js";
|
|
4
|
+
import { apiClientPluginSchema, hooksSchema } from "./api-client-plugin.js";
|
|
5
|
+
import {
|
|
3
6
|
apiReferenceConfigurationSchema,
|
|
4
|
-
|
|
7
|
+
apiReferenceConfigurationWithSourceSchema,
|
|
5
8
|
isConfigurationWithSources
|
|
6
9
|
} from "./api-reference-configuration.js";
|
|
7
10
|
import {
|
|
8
11
|
htmlRenderingConfigurationSchema
|
|
9
12
|
} from "./html-rendering-configuration.js";
|
|
13
|
+
import {
|
|
14
|
+
sourceConfigurationSchema
|
|
15
|
+
} from "./source-configuration.js";
|
|
10
16
|
export {
|
|
11
17
|
apiClientConfigurationSchema,
|
|
18
|
+
apiClientPluginSchema,
|
|
12
19
|
apiReferenceConfigurationSchema,
|
|
20
|
+
apiReferenceConfigurationWithSourceSchema,
|
|
21
|
+
hooksSchema,
|
|
13
22
|
htmlRenderingConfigurationSchema,
|
|
14
23
|
isConfigurationWithSources,
|
|
15
|
-
|
|
24
|
+
sourceConfigurationSchema
|
|
16
25
|
};
|
|
17
26
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/api-reference/index.ts"],
|
|
4
|
-
"sourcesContent": ["
|
|
5
|
-
"mappings": "AAAA;AAAA,EAME;AAAA,EACA;AAAA,EACA;AAAA,
|
|
4
|
+
"sourcesContent": ["// biome-ignore lint/performance/noBarrelFile: exporting from a block\nexport {\n type ApiClientConfiguration,\n apiClientConfigurationSchema,\n} from './api-client-configuration'\nexport { type ApiClientPlugin, apiClientPluginSchema, hooksSchema } from './api-client-plugin'\nexport {\n type AnyApiReferenceConfiguration,\n type ApiReferenceConfiguration,\n type ApiReferenceConfigurationWithDefault,\n type ApiReferenceConfigurationWithMultipleSources,\n type ApiReferenceConfigurationWithSource,\n apiReferenceConfigurationSchema,\n apiReferenceConfigurationWithSourceSchema,\n isConfigurationWithSources,\n} from './api-reference-configuration'\nexport type {\n ApiReferencePlugin,\n SpecificationExtension,\n} from './api-reference-plugin'\nexport type { ApiReferenceInstance, CreateApiReference } from './html-api'\nexport {\n type HtmlRenderingConfiguration,\n htmlRenderingConfigurationSchema,\n} from './html-rendering-configuration'\nexport {\n type SourceConfiguration,\n sourceConfigurationSchema,\n} from './source-configuration'\n"],
|
|
5
|
+
"mappings": "AACA;AAAA,EAEE;AAAA,OACK;AACP,SAA+B,uBAAuB,mBAAmB;AACzE;AAAA,EAME;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAMP;AAAA,EAEE;AAAA,OACK;AACP;AAAA,EAEE;AAAA,OACK;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import z from 'zod';
|
|
2
|
+
/**
|
|
3
|
+
* A source is any potential document input used for API Reference
|
|
4
|
+
* and API Client integrations. Sources may be specified in the configuration
|
|
5
|
+
* or used independently. Some configurations may have multiple sources.
|
|
6
|
+
*/
|
|
7
|
+
export declare const sourceConfigurationSchema: z.ZodObject<{
|
|
8
|
+
url: z.ZodOptional<z.ZodString>;
|
|
9
|
+
content: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNull, z.ZodRecord<z.ZodString, z.ZodAny>, z.ZodFunction<z.ZodTuple<readonly [], null>, z.ZodRecord<z.ZodString, z.ZodAny>>]>>;
|
|
10
|
+
title: z.ZodOptional<z.ZodString>;
|
|
11
|
+
slug: z.ZodOptional<z.ZodString>;
|
|
12
|
+
spec: z.ZodOptional<z.ZodObject<{
|
|
13
|
+
url: z.ZodOptional<z.ZodString>;
|
|
14
|
+
content: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNull, z.ZodRecord<z.ZodString, z.ZodAny>, z.ZodFunction<z.ZodTuple<readonly [], null>, z.ZodRecord<z.ZodString, z.ZodAny>>]>>;
|
|
15
|
+
}, z.core.$strip>>;
|
|
16
|
+
}, z.core.$strip>;
|
|
17
|
+
export type SourceConfiguration = z.infer<typeof sourceConfigurationSchema>;
|
|
18
|
+
//# sourceMappingURL=source-configuration.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"source-configuration.d.ts","sourceRoot":"","sources":["../../src/api-reference/source-configuration.ts"],"names":[],"mappings":"AAAA,OAAO,CAAC,MAAM,KAAK,CAAA;AAEnB;;;;GAIG;AACH,eAAO,MAAM,yBAAyB;;;;;;;;;iBAuFpC,CAAA;AAEF,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,yBAAyB,CAAC,CAAA"}
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import z from "zod";
|
|
2
|
+
const sourceConfigurationSchema = z.object({
|
|
3
|
+
/**
|
|
4
|
+
* URL to an OpenAPI/Swagger document
|
|
5
|
+
* @example
|
|
6
|
+
* ```ts
|
|
7
|
+
* const oldConfiguration = {
|
|
8
|
+
* spec: {
|
|
9
|
+
* url: 'https://example.com/openapi.json',
|
|
10
|
+
* },
|
|
11
|
+
* }
|
|
12
|
+
*
|
|
13
|
+
* const newConfiguration = {
|
|
14
|
+
* url: 'https://example.com/openapi.json',
|
|
15
|
+
* }
|
|
16
|
+
* ```
|
|
17
|
+
**/
|
|
18
|
+
url: z.string().optional(),
|
|
19
|
+
/**
|
|
20
|
+
* Directly embed the OpenAPI document.
|
|
21
|
+
* Can be a string, object, function returning an object, or null.
|
|
22
|
+
*
|
|
23
|
+
* @remarks It's recommended to pass a URL instead of content.
|
|
24
|
+
* @example
|
|
25
|
+
* ```ts
|
|
26
|
+
* const oldConfiguration = {
|
|
27
|
+
* spec: {
|
|
28
|
+
* content: '…',
|
|
29
|
+
* },
|
|
30
|
+
* }
|
|
31
|
+
*
|
|
32
|
+
* const newConfiguration = {
|
|
33
|
+
* content: '…',
|
|
34
|
+
* }
|
|
35
|
+
* ```
|
|
36
|
+
**/
|
|
37
|
+
content: z.union([
|
|
38
|
+
z.string(),
|
|
39
|
+
z.null(),
|
|
40
|
+
z.record(z.string(), z.any()),
|
|
41
|
+
z.function({
|
|
42
|
+
input: [],
|
|
43
|
+
output: z.record(z.string(), z.any())
|
|
44
|
+
})
|
|
45
|
+
]).optional(),
|
|
46
|
+
/**
|
|
47
|
+
* The title of the OpenAPI document.
|
|
48
|
+
*
|
|
49
|
+
* @example 'Scalar Galaxy'
|
|
50
|
+
*
|
|
51
|
+
* @deprecated Please move `title` to the top level and remove the `spec` prefix.
|
|
52
|
+
*/
|
|
53
|
+
title: z.string().optional(),
|
|
54
|
+
/**
|
|
55
|
+
* The slug of the OpenAPI document used in the URL.
|
|
56
|
+
*
|
|
57
|
+
* If none is passed, the title will be used.
|
|
58
|
+
*
|
|
59
|
+
* If no title is used, it'll just use the index.
|
|
60
|
+
*
|
|
61
|
+
* @example 'scalar-galaxy'
|
|
62
|
+
*
|
|
63
|
+
* @deprecated Please move `slug` to the top level and remove the `spec` prefix.
|
|
64
|
+
*/
|
|
65
|
+
slug: z.string().optional(),
|
|
66
|
+
/**
|
|
67
|
+
* The OpenAPI/Swagger document to render
|
|
68
|
+
*
|
|
69
|
+
* @deprecated Use `url` and `content` on the top level instead.
|
|
70
|
+
**/
|
|
71
|
+
spec: z.object({
|
|
72
|
+
url: z.string().optional(),
|
|
73
|
+
content: z.union([
|
|
74
|
+
z.string(),
|
|
75
|
+
z.null(),
|
|
76
|
+
z.record(z.string(), z.any()),
|
|
77
|
+
z.function({
|
|
78
|
+
input: [],
|
|
79
|
+
output: z.record(z.string(), z.any())
|
|
80
|
+
})
|
|
81
|
+
]).optional()
|
|
82
|
+
}).optional()
|
|
83
|
+
});
|
|
84
|
+
export {
|
|
85
|
+
sourceConfigurationSchema
|
|
86
|
+
};
|
|
87
|
+
//# sourceMappingURL=source-configuration.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/api-reference/source-configuration.ts"],
|
|
4
|
+
"sourcesContent": ["import z from 'zod'\n\n/**\n * A source is any potential document input used for API Reference\n * and API Client integrations. Sources may be specified in the configuration\n * or used independently. Some configurations may have multiple sources.\n */\nexport const sourceConfigurationSchema = z.object({\n /**\n * URL to an OpenAPI/Swagger document\n * @example\n * ```ts\n * const oldConfiguration = {\n * spec: {\n * url: 'https://example.com/openapi.json',\n * },\n * }\n *\n * const newConfiguration = {\n * url: 'https://example.com/openapi.json',\n * }\n * ```\n **/\n url: z.string().optional(),\n /**\n * Directly embed the OpenAPI document.\n * Can be a string, object, function returning an object, or null.\n *\n * @remarks It's recommended to pass a URL instead of content.\n * @example\n * ```ts\n * const oldConfiguration = {\n * spec: {\n * content: '\u2026',\n * },\n * }\n *\n * const newConfiguration = {\n * content: '\u2026',\n * }\n * ```\n **/\n content: z\n .union([\n z.string(),\n z.null(),\n z.record(z.string(), z.any()),\n z.function({\n input: [],\n output: z.record(z.string(), z.any()),\n }),\n ])\n .optional(),\n /**\n * The title of the OpenAPI document.\n *\n * @example 'Scalar Galaxy'\n *\n * @deprecated Please move `title` to the top level and remove the `spec` prefix.\n */\n title: z.string().optional(),\n /**\n * The slug of the OpenAPI document used in the URL.\n *\n * If none is passed, the title will be used.\n *\n * If no title is used, it'll just use the index.\n *\n * @example 'scalar-galaxy'\n *\n * @deprecated Please move `slug` to the top level and remove the `spec` prefix.\n */\n slug: z.string().optional(),\n /**\n * The OpenAPI/Swagger document to render\n *\n * @deprecated Use `url` and `content` on the top level instead.\n **/\n spec: z\n .object({\n url: z.string().optional(),\n content: z\n .union([\n z.string(),\n z.null(),\n z.record(z.string(), z.any()),\n z.function({\n input: [],\n output: z.record(z.string(), z.any()),\n }),\n ])\n .optional(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