@scalar/types 0.0.1 → 0.0.2
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 +6 -0
- package/dist/external/httpsnippet-lite.d.ts +139 -0
- package/dist/external/httpsnippet-lite.d.ts.map +1 -0
- package/dist/external/index.d.ts +2 -0
- package/dist/external/index.d.ts.map +1 -0
- package/dist/external/index.js +1 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +1 -0
- package/dist/legacy/index.d.ts +2 -0
- package/dist/legacy/index.d.ts.map +1 -0
- package/dist/legacy/index.js +1 -0
- package/dist/legacy/reference-config.d.ts +320 -0
- package/dist/legacy/reference-config.d.ts.map +1 -0
- package/dist/utils/index.d.ts +2 -0
- package/dist/utils/index.d.ts.map +1 -0
- package/dist/utils/index.js +1 -0
- package/dist/utils/utility-types.d.ts +5 -0
- package/dist/utils/utility-types.d.ts.map +1 -0
- package/package.json +24 -5
- package/src/external/httpsnippet-lite.ts +0 -168
- package/src/external/index.ts +0 -1
- package/src/legacy/index.ts +0 -1
- package/src/legacy/reference-config.ts +0 -417
- package/src/utils/index.ts +0 -1
- package/src/utils/utility-types.ts +0 -4
package/CHANGELOG.md
CHANGED
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* These types are copied from httpsnippet-lite to reduce depenedencies
|
|
3
|
+
*/
|
|
4
|
+
export type Param = {
|
|
5
|
+
/** name of a posted parameter. */
|
|
6
|
+
name: string;
|
|
7
|
+
/** value of a posted parameter or content of a posted file */
|
|
8
|
+
value?: string | undefined;
|
|
9
|
+
/** name of a posted file. */
|
|
10
|
+
fileName?: string | undefined;
|
|
11
|
+
/** content type of a posted file. */
|
|
12
|
+
contentType?: string | undefined;
|
|
13
|
+
/** A comment provided by the user or the application */
|
|
14
|
+
comment?: string | undefined;
|
|
15
|
+
};
|
|
16
|
+
export type PostDataCommon = {
|
|
17
|
+
/** Mime type of posted data. */
|
|
18
|
+
mimeType: string;
|
|
19
|
+
/** A comment provided by the user or the application */
|
|
20
|
+
comment?: string | undefined;
|
|
21
|
+
};
|
|
22
|
+
type PostDataBase = PostDataCommon & {
|
|
23
|
+
text?: string;
|
|
24
|
+
params?: Param[];
|
|
25
|
+
};
|
|
26
|
+
export type Cookie = {
|
|
27
|
+
/** The name of the cookie. */
|
|
28
|
+
name: string;
|
|
29
|
+
/** The cookie value. */
|
|
30
|
+
value: string;
|
|
31
|
+
/** The path pertaining to the cookie. */
|
|
32
|
+
path?: string | undefined;
|
|
33
|
+
/** The host of the cookie. */
|
|
34
|
+
domain?: string | undefined;
|
|
35
|
+
/**
|
|
36
|
+
* Cookie expiration time.
|
|
37
|
+
* (ISO 8601 - `YYYY-MM-DDThh:mm:ss.sTZD`,
|
|
38
|
+
* e.g. `2009-07-24T19:20:30.123+02:00`).
|
|
39
|
+
*/
|
|
40
|
+
expires?: string | undefined;
|
|
41
|
+
/** Set to true if the cookie is HTTP only, false otherwise. */
|
|
42
|
+
httpOnly?: boolean | undefined;
|
|
43
|
+
/** True if the cookie was transmitted over ssl, false otherwise. */
|
|
44
|
+
secure?: boolean | undefined;
|
|
45
|
+
/** A comment provided by the user or the application */
|
|
46
|
+
comment?: string | undefined;
|
|
47
|
+
};
|
|
48
|
+
/**
|
|
49
|
+
* This object represents a headers (used in `request` and `response` objects).
|
|
50
|
+
*
|
|
51
|
+
* http://www.softwareishard.com/blog/har-12-spec/#headers
|
|
52
|
+
*/
|
|
53
|
+
export type Header = {
|
|
54
|
+
name: string;
|
|
55
|
+
value: string;
|
|
56
|
+
/** A comment provided by the user or the application */
|
|
57
|
+
comment?: string | undefined;
|
|
58
|
+
};
|
|
59
|
+
/**
|
|
60
|
+
* This object represents a parameter & value parsed from a query string,
|
|
61
|
+
* if any (embedded in `request` object).
|
|
62
|
+
*
|
|
63
|
+
* http://www.softwareishard.com/blog/har-12-spec/#queryString
|
|
64
|
+
*/
|
|
65
|
+
export type QueryString = {
|
|
66
|
+
name: string;
|
|
67
|
+
value: string;
|
|
68
|
+
/** A comment provided by the user or the application */
|
|
69
|
+
comment?: string | undefined;
|
|
70
|
+
};
|
|
71
|
+
/**
|
|
72
|
+
* Post data with `params` specified.
|
|
73
|
+
*/
|
|
74
|
+
export type PostDataParams = {
|
|
75
|
+
/**
|
|
76
|
+
* List of posted parameters (in case of URL encoded parameters).
|
|
77
|
+
*/
|
|
78
|
+
params: Param[];
|
|
79
|
+
/**
|
|
80
|
+
* _`params` and `text` fields are mutually exclusive._
|
|
81
|
+
*/
|
|
82
|
+
text?: never | undefined;
|
|
83
|
+
};
|
|
84
|
+
/**
|
|
85
|
+
* Post data with `text` specified.
|
|
86
|
+
*/
|
|
87
|
+
export type PostDataText = {
|
|
88
|
+
/**
|
|
89
|
+
* Plain text posted data
|
|
90
|
+
*/
|
|
91
|
+
text: string;
|
|
92
|
+
/**
|
|
93
|
+
* _`params` and `text` fields are mutually exclusive._
|
|
94
|
+
*/
|
|
95
|
+
params?: never | undefined;
|
|
96
|
+
};
|
|
97
|
+
/**
|
|
98
|
+
* This object describes posted data, if any (embedded in `request` object).
|
|
99
|
+
*
|
|
100
|
+
* http://www.softwareishard.com/blog/har-12-spec/#postData
|
|
101
|
+
*/
|
|
102
|
+
export type PostData = PostDataCommon & (PostDataParams | PostDataText);
|
|
103
|
+
export type Request = {
|
|
104
|
+
/** Request method (`GET`, `POST`, ...). */
|
|
105
|
+
method: string;
|
|
106
|
+
/** Absolute URL of the request (fragments are not included). */
|
|
107
|
+
url: string;
|
|
108
|
+
/** Request HTTP Version. */
|
|
109
|
+
httpVersion: string;
|
|
110
|
+
/** List of cookie objects. */
|
|
111
|
+
cookies: Cookie[];
|
|
112
|
+
/** List of header objects. */
|
|
113
|
+
headers: Header[];
|
|
114
|
+
/** List of query parameter objects. */
|
|
115
|
+
queryString: QueryString[];
|
|
116
|
+
/** Posted data info. */
|
|
117
|
+
postData?: PostData | undefined;
|
|
118
|
+
/**
|
|
119
|
+
* Total number of bytes from the start of the HTTP request message until
|
|
120
|
+
* (and including) the double CRLF before the body.
|
|
121
|
+
*
|
|
122
|
+
* Set to `-1` if the info is not available.
|
|
123
|
+
*/
|
|
124
|
+
headersSize: number;
|
|
125
|
+
/**
|
|
126
|
+
* Size of the request body (POST data payload) in bytes.
|
|
127
|
+
*
|
|
128
|
+
* Set to `-1` if the info is not available.
|
|
129
|
+
*/
|
|
130
|
+
bodySize: number;
|
|
131
|
+
/** A comment provided by the user or the application */
|
|
132
|
+
comment?: string | undefined;
|
|
133
|
+
};
|
|
134
|
+
export type HarRequest = Omit<Request, 'postData'> & {
|
|
135
|
+
postData?: PostDataBase;
|
|
136
|
+
};
|
|
137
|
+
export type TargetId = 'c' | 'clojure' | 'csharp' | 'go' | 'http' | 'java' | 'javascript' | 'kotlin' | 'node' | 'objc' | 'ocaml' | 'php' | 'powershell' | 'python' | 'r' | 'ruby' | 'shell' | 'swift';
|
|
138
|
+
export {};
|
|
139
|
+
//# sourceMappingURL=httpsnippet-lite.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"httpsnippet-lite.d.ts","sourceRoot":"","sources":["../../src/external/httpsnippet-lite.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,MAAM,MAAM,KAAK,GAAG;IAClB,kCAAkC;IAClC,IAAI,EAAE,MAAM,CAAA;IACZ,8DAA8D;IAC9D,KAAK,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;IAC1B,6BAA6B;IAC7B,QAAQ,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;IAC7B,qCAAqC;IACrC,WAAW,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;IAChC,yDAAyD;IACzD,OAAO,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;CAC7B,CAAA;AAED,MAAM,MAAM,cAAc,GAAG;IAC3B,gCAAgC;IAChC,QAAQ,EAAE,MAAM,CAAA;IAChB,yDAAyD;IACzD,OAAO,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ings":"AAAA,cAAc,oBAAoB,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAA"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/legacy/index.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1,320 @@
|
|
|
1
|
+
import type { OpenAPIV2, OpenAPIV3, OpenAPIV3_1 } from '@scalar/openapi-types';
|
|
2
|
+
import type { ThemeId } from '@scalar/themes';
|
|
3
|
+
import type { UseSeoMetaInput } from '@unhead/schema';
|
|
4
|
+
import type { HarRequest, TargetId } from '../external/index.js';
|
|
5
|
+
/**
|
|
6
|
+
* This re-export is needed due to a typescript issue
|
|
7
|
+
* @see https://github.com/microsoft/TypeScript/issues/42873
|
|
8
|
+
*/
|
|
9
|
+
export type { OpenAPIV2, OpenAPIV3, OpenAPIV3_1 } from '@scalar/openapi-types';
|
|
10
|
+
export type ClientInfo = {
|
|
11
|
+
key: string;
|
|
12
|
+
title: string;
|
|
13
|
+
link: string;
|
|
14
|
+
description: string;
|
|
15
|
+
};
|
|
16
|
+
export type TargetInfo = {
|
|
17
|
+
key: TargetId;
|
|
18
|
+
title: string;
|
|
19
|
+
extname: `.${string}` | null;
|
|
20
|
+
default: string;
|
|
21
|
+
};
|
|
22
|
+
export type HiddenClients = true | Partial<Record<TargetInfo['key'], boolean | ClientInfo['key'][]>> | ClientInfo['key'][];
|
|
23
|
+
type HttpClientState = {
|
|
24
|
+
targetKey: TargetId;
|
|
25
|
+
clientKey: string;
|
|
26
|
+
};
|
|
27
|
+
export type PathRouting = {
|
|
28
|
+
basePath: string;
|
|
29
|
+
};
|
|
30
|
+
export type ReferenceConfiguration = {
|
|
31
|
+
/** A string to use one of the color presets */
|
|
32
|
+
theme?: ThemeId;
|
|
33
|
+
/** The layout to use for the references */
|
|
34
|
+
layout?: 'modern' | 'classic';
|
|
35
|
+
/** The Swagger/OpenAPI spec to render */
|
|
36
|
+
spec?: SpecConfiguration;
|
|
37
|
+
/** URL to a request proxy for the API client */
|
|
38
|
+
proxy?: string;
|
|
39
|
+
/** Whether the spec input should show */
|
|
40
|
+
isEditable?: boolean;
|
|
41
|
+
/** Whether to show the sidebar */
|
|
42
|
+
showSidebar?: boolean;
|
|
43
|
+
/**
|
|
44
|
+
* Whether to show models in the sidebar, search, and content.
|
|
45
|
+
*
|
|
46
|
+
* @default false
|
|
47
|
+
*/
|
|
48
|
+
hideModels?: boolean;
|
|
49
|
+
/**
|
|
50
|
+
* Whether to show the "Download OpenAPI Specification" button
|
|
51
|
+
*
|
|
52
|
+
* @default false
|
|
53
|
+
*/
|
|
54
|
+
hideDownloadButton?: boolean;
|
|
55
|
+
/** Whether dark mode is on or off initially (light mode) */
|
|
56
|
+
darkMode?: boolean;
|
|
57
|
+
/** forceDarkModeState makes it always this state no matter what*/
|
|
58
|
+
forceDarkModeState?: 'dark' | 'light';
|
|
59
|
+
/** Whether to show the dark mode toggle */
|
|
60
|
+
hideDarkModeToggle?: boolean;
|
|
61
|
+
/** Key used with CTRL/CMD to open the search modal (defaults to 'k' e.g. CMD+k) */
|
|
62
|
+
searchHotKey?: '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';
|
|
63
|
+
/**
|
|
64
|
+
* If used, passed data will be added to the HTML header
|
|
65
|
+
* @see https://unhead.unjs.io/usage/composables/use-seo-meta
|
|
66
|
+
*/
|
|
67
|
+
metaData?: UseSeoMetaInput;
|
|
68
|
+
/**
|
|
69
|
+
* List of httpsnippet clients to hide from the clients menu
|
|
70
|
+
* By default hides Unirest, pass `[]` to show all clients
|
|
71
|
+
*/
|
|
72
|
+
hiddenClients?: HiddenClients;
|
|
73
|
+
/** Determine the HTTP client that’s selected by default */
|
|
74
|
+
defaultHttpClient?: HttpClientState;
|
|
75
|
+
/** Custom CSS to be added to the page */
|
|
76
|
+
customCss?: string;
|
|
77
|
+
/** onSpecUpdate is fired on spec/swagger content change */
|
|
78
|
+
onSpecUpdate?: (spec: string) => void;
|
|
79
|
+
/** Prefill authentication */
|
|
80
|
+
authentication?: Partial<AuthenticationState>;
|
|
81
|
+
/**
|
|
82
|
+
* Route using paths instead of hashes, your server MUST support this
|
|
83
|
+
* for example vue router needs a catch all so any subpaths are included
|
|
84
|
+
*
|
|
85
|
+
* @example
|
|
86
|
+
* '/standalone-api-reference/:custom(.*)?'
|
|
87
|
+
*
|
|
88
|
+
* @experimental
|
|
89
|
+
* @default undefined
|
|
90
|
+
*/
|
|
91
|
+
pathRouting?: PathRouting;
|
|
92
|
+
/**
|
|
93
|
+
* The baseServerURL is used when the spec servers are relative paths and we are using SSR.
|
|
94
|
+
* On the client we can grab the window.location.origin but on the server we need
|
|
95
|
+
* to use this prop.
|
|
96
|
+
*
|
|
97
|
+
* @default undefined
|
|
98
|
+
* @example 'http://localhost:3000'
|
|
99
|
+
*/
|
|
100
|
+
baseServerURL?: string;
|
|
101
|
+
/**
|
|
102
|
+
* List of servers to override the openapi spec servers
|
|
103
|
+
*
|
|
104
|
+
* @default undefined
|
|
105
|
+
* @example [{ url: 'https://api.scalar.com', description: 'Production server' }]
|
|
106
|
+
*/
|
|
107
|
+
servers?: Server[];
|
|
108
|
+
/**
|
|
109
|
+
* We’re using Inter and JetBrains Mono as the default fonts. If you want to use your own fonts, set this to false.
|
|
110
|
+
*
|
|
111
|
+
* @default true
|
|
112
|
+
*/
|
|
113
|
+
withDefaultFonts?: boolean;
|
|
114
|
+
/**
|
|
115
|
+
* By default we only open the relevant tag based on the url, however if you want all the tags open by default then set this configuration option :)
|
|
116
|
+
*
|
|
117
|
+
* @default false
|
|
118
|
+
*/
|
|
119
|
+
defaultOpenAllTags?: boolean;
|
|
120
|
+
/**
|
|
121
|
+
* Sort tags alphabetically or with a custom sort function
|
|
122
|
+
*/
|
|
123
|
+
tagsSorter?: 'alpha' | ((a: Tag, b: Tag) => number);
|
|
124
|
+
};
|
|
125
|
+
export type Server = OpenAPIV3.ServerObject | OpenAPIV3_1.ServerObject;
|
|
126
|
+
export type BaseParameter = {
|
|
127
|
+
name: string;
|
|
128
|
+
description?: string | null;
|
|
129
|
+
value: string | number | Record<string, any>;
|
|
130
|
+
required?: boolean;
|
|
131
|
+
enabled: boolean;
|
|
132
|
+
};
|
|
133
|
+
type OptionalCharset = string | null;
|
|
134
|
+
export type ContentType = `application/json${OptionalCharset}` | `application/xml${OptionalCharset}` | `text/plain${OptionalCharset}` | `text/html${OptionalCharset}` | `application/octet-stream${OptionalCharset}` | `application/x-www-form-urlencoded${OptionalCharset}` | `multipart/form-data${OptionalCharset}`;
|
|
135
|
+
export type Cookie = {
|
|
136
|
+
name: string;
|
|
137
|
+
value: string;
|
|
138
|
+
};
|
|
139
|
+
export type CustomRequestExample = {
|
|
140
|
+
lang: string;
|
|
141
|
+
label: string;
|
|
142
|
+
source: string;
|
|
143
|
+
};
|
|
144
|
+
export type HarRequestWithPath = HarRequest & {
|
|
145
|
+
path: string;
|
|
146
|
+
};
|
|
147
|
+
export type Header = {
|
|
148
|
+
name: string;
|
|
149
|
+
value: string;
|
|
150
|
+
};
|
|
151
|
+
export type Information = {
|
|
152
|
+
'description'?: string;
|
|
153
|
+
'operationId'?: string | number;
|
|
154
|
+
'parameters'?: Parameters[];
|
|
155
|
+
'responses'?: Record<string, ScalarResponse>;
|
|
156
|
+
'security'?: OpenAPIV3.SecurityRequirementObject[];
|
|
157
|
+
'requestBody'?: RequestBody;
|
|
158
|
+
'summary'?: string;
|
|
159
|
+
'tags'?: string[];
|
|
160
|
+
'deprecated'?: boolean;
|
|
161
|
+
/**
|
|
162
|
+
* Scalar
|
|
163
|
+
*/
|
|
164
|
+
'x-custom-examples'?: CustomRequestExample[];
|
|
165
|
+
/**
|
|
166
|
+
* Redocly, current
|
|
167
|
+
*/
|
|
168
|
+
'x-codeSamples'?: CustomRequestExample[];
|
|
169
|
+
/**
|
|
170
|
+
* Redocly, deprecated
|
|
171
|
+
*/
|
|
172
|
+
'x-code-samples'?: CustomRequestExample[];
|
|
173
|
+
};
|
|
174
|
+
export type Operation = {
|
|
175
|
+
httpVerb: 'GET' | 'HEAD' | 'PATCH' | 'POST' | 'PUT' | 'TRACE' | 'CONNECT' | 'DELETE' | 'OPTIONS';
|
|
176
|
+
path: string;
|
|
177
|
+
operationId?: string;
|
|
178
|
+
name?: string;
|
|
179
|
+
description?: string;
|
|
180
|
+
information?: Information;
|
|
181
|
+
};
|
|
182
|
+
export type Parameters = {
|
|
183
|
+
name: string;
|
|
184
|
+
in?: string;
|
|
185
|
+
description?: string;
|
|
186
|
+
required?: boolean;
|
|
187
|
+
deprecated?: boolean;
|
|
188
|
+
allowEmptyValue?: boolean;
|
|
189
|
+
style?: 'form' | 'simple';
|
|
190
|
+
explode?: boolean;
|
|
191
|
+
allowReserved?: boolean;
|
|
192
|
+
schema?: Schema;
|
|
193
|
+
example?: any;
|
|
194
|
+
examples?: Map<string, any>;
|
|
195
|
+
content?: RequestBodyMimeTypes;
|
|
196
|
+
};
|
|
197
|
+
export type Query = {
|
|
198
|
+
name: string;
|
|
199
|
+
value: string;
|
|
200
|
+
};
|
|
201
|
+
export type RequestBodyMimeTypes = {
|
|
202
|
+
[K in ContentType]?: {
|
|
203
|
+
schema?: any;
|
|
204
|
+
example?: any;
|
|
205
|
+
examples?: any;
|
|
206
|
+
};
|
|
207
|
+
};
|
|
208
|
+
export type ScalarResponse = {
|
|
209
|
+
description: string;
|
|
210
|
+
content: any;
|
|
211
|
+
};
|
|
212
|
+
export type RequestBody = {
|
|
213
|
+
description?: string;
|
|
214
|
+
required?: boolean;
|
|
215
|
+
content?: RequestBodyMimeTypes;
|
|
216
|
+
};
|
|
217
|
+
/** For providing a OAS spec object or url to be fetched */
|
|
218
|
+
export type SpecConfiguration = {
|
|
219
|
+
/** URL to a Swagger/OpenAPI file */
|
|
220
|
+
url?: string;
|
|
221
|
+
/** Swagger/Open API spec */
|
|
222
|
+
content?: string | Record<string, any> | (() => Record<string, any>);
|
|
223
|
+
};
|
|
224
|
+
export type Schema = {
|
|
225
|
+
type: string;
|
|
226
|
+
name?: string;
|
|
227
|
+
example?: any;
|
|
228
|
+
default?: any;
|
|
229
|
+
format?: string;
|
|
230
|
+
description?: string;
|
|
231
|
+
properties?: Record<string, Schema>;
|
|
232
|
+
};
|
|
233
|
+
export type TransformedOperation = Operation & {
|
|
234
|
+
pathParameters?: Parameters[];
|
|
235
|
+
};
|
|
236
|
+
export type CollapsedSidebarItems = Record<string, boolean>;
|
|
237
|
+
export type AuthenticationState = {
|
|
238
|
+
customSecurity: boolean;
|
|
239
|
+
preferredSecurityScheme: string | null;
|
|
240
|
+
securitySchemes?: OpenAPIV2.SecurityDefinitionsObject | OpenAPIV3.ComponentsObject['securitySchemes'] | OpenAPIV3_1.ComponentsObject['securitySchemes'];
|
|
241
|
+
http: {
|
|
242
|
+
basic: {
|
|
243
|
+
username: string;
|
|
244
|
+
password: string;
|
|
245
|
+
};
|
|
246
|
+
bearer: {
|
|
247
|
+
token: string;
|
|
248
|
+
};
|
|
249
|
+
};
|
|
250
|
+
apiKey: {
|
|
251
|
+
token: string;
|
|
252
|
+
};
|
|
253
|
+
oAuth2: {
|
|
254
|
+
clientId: string;
|
|
255
|
+
scopes: string[];
|
|
256
|
+
accessToken: string;
|
|
257
|
+
state: string;
|
|
258
|
+
username: string;
|
|
259
|
+
password: string;
|
|
260
|
+
};
|
|
261
|
+
};
|
|
262
|
+
export type Heading = {
|
|
263
|
+
depth: number;
|
|
264
|
+
value: string;
|
|
265
|
+
slug?: string;
|
|
266
|
+
};
|
|
267
|
+
export type CodeBlockSSRKey = `components-scalar-code-block${number}`;
|
|
268
|
+
export type DescriptionSectionSSRKey = `components-Content-Introduction-Description-sections${number}`;
|
|
269
|
+
export type ExampleRequestSSRKey = `components-Content-Operation-Example-Request${number}`;
|
|
270
|
+
export type ScalarState = {
|
|
271
|
+
'hash'?: string;
|
|
272
|
+
'useGlobalStore-authentication'?: AuthenticationState;
|
|
273
|
+
'useSidebarContent-collapsedSidebarItems'?: CollapsedSidebarItems;
|
|
274
|
+
[key: CodeBlockSSRKey]: string;
|
|
275
|
+
[key: DescriptionSectionSSRKey]: {
|
|
276
|
+
heading: Heading;
|
|
277
|
+
content: string;
|
|
278
|
+
}[];
|
|
279
|
+
[key: ExampleRequestSSRKey]: string;
|
|
280
|
+
};
|
|
281
|
+
export type SSRState = {
|
|
282
|
+
payload: {
|
|
283
|
+
data: ScalarState;
|
|
284
|
+
};
|
|
285
|
+
url: string;
|
|
286
|
+
};
|
|
287
|
+
export type Tag = {
|
|
288
|
+
'name': string;
|
|
289
|
+
'description': string;
|
|
290
|
+
'operations': TransformedOperation[];
|
|
291
|
+
'x-displayName'?: string;
|
|
292
|
+
};
|
|
293
|
+
export type TagGroup = {
|
|
294
|
+
name: string;
|
|
295
|
+
tags: string[];
|
|
296
|
+
};
|
|
297
|
+
export type Definitions = OpenAPIV2.DefinitionsObject;
|
|
298
|
+
export type Webhooks = Record<string, Record<OpenAPIV3_1.HttpMethods, TransformedOperation & {
|
|
299
|
+
'x-internal'?: boolean;
|
|
300
|
+
}>>;
|
|
301
|
+
export type Spec = {
|
|
302
|
+
'tags'?: Tag[];
|
|
303
|
+
'info': Partial<OpenAPIV2.Document['info']> | Partial<OpenAPIV3.Document['info']> | Partial<OpenAPIV3_1.Document['info']>;
|
|
304
|
+
'host'?: OpenAPIV2.Document['host'];
|
|
305
|
+
'basePath'?: OpenAPIV2.Document['basePath'];
|
|
306
|
+
'schemes'?: OpenAPIV2.Document['schemes'];
|
|
307
|
+
'externalDocs'?: {
|
|
308
|
+
url: string;
|
|
309
|
+
description?: string;
|
|
310
|
+
};
|
|
311
|
+
'servers'?: OpenAPIV3.Document['servers'] | OpenAPIV3_1.Document['servers'];
|
|
312
|
+
'components'?: OpenAPIV3.ComponentsObject | OpenAPIV3_1.ComponentsObject;
|
|
313
|
+
'webhooks'?: Webhooks;
|
|
314
|
+
'definitions'?: Definitions;
|
|
315
|
+
'swagger'?: OpenAPIV2.Document['swagger'];
|
|
316
|
+
'openapi'?: OpenAPIV3.Document['openapi'] | OpenAPIV3_1.Document['openapi'];
|
|
317
|
+
'x-tagGroups'?: TagGroup[];
|
|
318
|
+
'security'?: OpenAPIV3.SecurityRequirementObject[];
|
|
319
|
+
};
|
|
320
|
+
//# sourceMappingURL=reference-config.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"reference-config.d.ts","sourceRoot":"","sources":["../../src/legacy/reference-config.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAA;AAC9E,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAA;AAC7C,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAA;AAErD,OAAO,KAAK,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAA;AAEvD;;;GAGG;AACH,YAAY,EAAE,SAAS,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAA;AAE9E,MAAM,MAAM,UAAU,GAAG;IACvB,GAAG,EAAE,MAAM,CAAA;IACX,KAAK,EAAE,MAAM,CAAA;IACb,IAAI,EAAE,MAAM,CAAA;IACZ,WAAW,EAAE,MAAM,CAAA;CACpB,CAAA;AAED,MAAM,MAAM,UAAU,GAAG;IACvB,GAAG,EAAE,QAAQ,CAAA;IAC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AAW,CAAC,EAAE,MAAM,CAAA;KACrB,CAAA;IACD,SAAS,CAAC,EAAE,SAAS,CAAC,QAAQ,CAAC,SAAS,CAAC,GAAG,WAAW,CAAC,QAAQ,CAAC,SAAS,CAAC,CAAA;IAC3E,YAAY,CAAC,EAAE,SAAS,CAAC,gBAAgB,GAAG,WAAW,CAAC,gBAAgB,CAAA;IACxE,UAAU,CAAC,EAAE,QAAQ,CAAA;IACrB,aAAa,CAAC,EAAE,WAAW,CAAA;IAC3B,SAAS,CAAC,EAAE,SAAS,CAAC,QAAQ,CAAC,SAAS,CAAC,CAAA;IACzC,SAAS,CAAC,EAAE,SAAS,CAAC,QAAQ,CAAC,SAAS,CAAC,GAAG,WAAW,CAAC,QAAQ,CAAC,SAAS,CAAC,CAAA;IAC3E,aAAa,CAAC,EAAE,QAAQ,EAAE,CAAA;IAC1B,UAAU,CAAC,EAAE,SAAS,CAAC,yBAAyB,EAAE,CAAA;CACnD,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utility-types.d.ts","sourceRoot":"","sources":["../../src/utils/utility-types.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,MAAM,aAAa,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA"}
|
package/package.json
CHANGED
|
@@ -16,17 +16,31 @@
|
|
|
16
16
|
"scalar",
|
|
17
17
|
"references"
|
|
18
18
|
],
|
|
19
|
-
"version": "0.0.
|
|
19
|
+
"version": "0.0.2",
|
|
20
20
|
"engines": {
|
|
21
21
|
"node": ">=18"
|
|
22
22
|
},
|
|
23
23
|
"type": "module",
|
|
24
24
|
"exports": {
|
|
25
|
-
"
|
|
26
|
-
|
|
25
|
+
".": {
|
|
26
|
+
"import": "./dist/index.js",
|
|
27
|
+
"types": "./dist/index.d.ts"
|
|
28
|
+
},
|
|
29
|
+
"./utils": {
|
|
30
|
+
"import": "./dist/utils/index.js",
|
|
31
|
+
"types": "./dist/utils/index.d.ts"
|
|
32
|
+
},
|
|
33
|
+
"./legacy": {
|
|
34
|
+
"import": "./dist/legacy/index.js",
|
|
35
|
+
"types": "./dist/legacy/index.d.ts"
|
|
36
|
+
},
|
|
37
|
+
"./external": {
|
|
38
|
+
"import": "./dist/external/index.js",
|
|
39
|
+
"types": "./dist/external/index.d.ts"
|
|
40
|
+
}
|
|
27
41
|
},
|
|
28
42
|
"files": [
|
|
29
|
-
"
|
|
43
|
+
"dist",
|
|
30
44
|
"CHANGELOG.md"
|
|
31
45
|
],
|
|
32
46
|
"dependencies": {
|
|
@@ -34,9 +48,14 @@
|
|
|
34
48
|
"@scalar/openapi-types": "0.0.1",
|
|
35
49
|
"@scalar/themes": "0.9.25"
|
|
36
50
|
},
|
|
51
|
+
"devDependencies": {
|
|
52
|
+
"@scalar/build-tooling": "0.1.10"
|
|
53
|
+
},
|
|
37
54
|
"scripts": {
|
|
55
|
+
"build": "scalar-build-rollup",
|
|
38
56
|
"lint:check": "eslint .",
|
|
39
57
|
"lint:fix": "eslint . --fix",
|
|
40
|
-
"types:
|
|
58
|
+
"types:build": "scalar-types-build",
|
|
59
|
+
"types:check": "scalar-types-check"
|
|
41
60
|
}
|
|
42
61
|
}
|
|
@@ -1,168 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* These types are copied from httpsnippet-lite to reduce depenedencies
|
|
3
|
-
*/
|
|
4
|
-
|
|
5
|
-
export type Param = {
|
|
6
|
-
/** name of a posted parameter. */
|
|
7
|
-
name: string
|
|
8
|
-
/** value of a posted parameter or content of a posted file */
|
|
9
|
-
value?: string | undefined
|
|
10
|
-
/** name of a posted file. */
|
|
11
|
-
fileName?: string | undefined
|
|
12
|
-
/** content type of a posted file. */
|
|
13
|
-
contentType?: string | undefined
|
|
14
|
-
/** A comment provided by the user or the application */
|
|
15
|
-
comment?: string | undefined
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
export type PostDataCommon = {
|
|
19
|
-
/** Mime type of posted data. */
|
|
20
|
-
mimeType: string
|
|
21
|
-
/** A comment provided by the user or the application */
|
|
22
|
-
comment?: string | undefined
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
type PostDataBase = PostDataCommon & {
|
|
26
|
-
text?: string
|
|
27
|
-
params?: Param[]
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
export type Cookie = {
|
|
31
|
-
/** The name of the cookie. */
|
|
32
|
-
name: string
|
|
33
|
-
/** The cookie value. */
|
|
34
|
-
value: string
|
|
35
|
-
/** The path pertaining to the cookie. */
|
|
36
|
-
path?: string | undefined
|
|
37
|
-
/** The host of the cookie. */
|
|
38
|
-
domain?: string | undefined
|
|
39
|
-
/**
|
|
40
|
-
* Cookie expiration time.
|
|
41
|
-
* (ISO 8601 - `YYYY-MM-DDThh:mm:ss.sTZD`,
|
|
42
|
-
* e.g. `2009-07-24T19:20:30.123+02:00`).
|
|
43
|
-
*/
|
|
44
|
-
expires?: string | undefined
|
|
45
|
-
/** Set to true if the cookie is HTTP only, false otherwise. */
|
|
46
|
-
httpOnly?: boolean | undefined
|
|
47
|
-
/** True if the cookie was transmitted over ssl, false otherwise. */
|
|
48
|
-
secure?: boolean | undefined
|
|
49
|
-
/** A comment provided by the user or the application */
|
|
50
|
-
comment?: string | undefined
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
/**
|
|
54
|
-
* This object represents a headers (used in `request` and `response` objects).
|
|
55
|
-
*
|
|
56
|
-
* http://www.softwareishard.com/blog/har-12-spec/#headers
|
|
57
|
-
*/
|
|
58
|
-
export type Header = {
|
|
59
|
-
name: string
|
|
60
|
-
value: string
|
|
61
|
-
/** A comment provided by the user or the application */
|
|
62
|
-
comment?: string | undefined
|
|
63
|
-
}
|
|
64
|
-
/**
|
|
65
|
-
* This object represents a parameter & value parsed from a query string,
|
|
66
|
-
* if any (embedded in `request` object).
|
|
67
|
-
*
|
|
68
|
-
* http://www.softwareishard.com/blog/har-12-spec/#queryString
|
|
69
|
-
*/
|
|
70
|
-
export type QueryString = {
|
|
71
|
-
name: string
|
|
72
|
-
value: string
|
|
73
|
-
/** A comment provided by the user or the application */
|
|
74
|
-
comment?: string | undefined
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
/**
|
|
78
|
-
* Post data with `params` specified.
|
|
79
|
-
*/
|
|
80
|
-
export type PostDataParams = {
|
|
81
|
-
/**
|
|
82
|
-
* List of posted parameters (in case of URL encoded parameters).
|
|
83
|
-
*/
|
|
84
|
-
params: Param[]
|
|
85
|
-
|
|
86
|
-
/**
|
|
87
|
-
* _`params` and `text` fields are mutually exclusive._
|
|
88
|
-
*/
|
|
89
|
-
text?: never | undefined
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
/**
|
|
93
|
-
* Post data with `text` specified.
|
|
94
|
-
*/
|
|
95
|
-
export type PostDataText = {
|
|
96
|
-
/**
|
|
97
|
-
* Plain text posted data
|
|
98
|
-
*/
|
|
99
|
-
text: string
|
|
100
|
-
|
|
101
|
-
/**
|
|
102
|
-
* _`params` and `text` fields are mutually exclusive._
|
|
103
|
-
*/
|
|
104
|
-
params?: never | undefined
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
/**
|
|
108
|
-
* This object describes posted data, if any (embedded in `request` object).
|
|
109
|
-
*
|
|
110
|
-
* http://www.softwareishard.com/blog/har-12-spec/#postData
|
|
111
|
-
*/
|
|
112
|
-
export type PostData = PostDataCommon & (PostDataParams | PostDataText)
|
|
113
|
-
|
|
114
|
-
export type Request = {
|
|
115
|
-
/** Request method (`GET`, `POST`, ...). */
|
|
116
|
-
method: string
|
|
117
|
-
/** Absolute URL of the request (fragments are not included). */
|
|
118
|
-
url: string
|
|
119
|
-
/** Request HTTP Version. */
|
|
120
|
-
httpVersion: string
|
|
121
|
-
/** List of cookie objects. */
|
|
122
|
-
cookies: Cookie[]
|
|
123
|
-
/** List of header objects. */
|
|
124
|
-
headers: Header[]
|
|
125
|
-
/** List of query parameter objects. */
|
|
126
|
-
queryString: QueryString[]
|
|
127
|
-
/** Posted data info. */
|
|
128
|
-
postData?: PostData | undefined
|
|
129
|
-
/**
|
|
130
|
-
* Total number of bytes from the start of the HTTP request message until
|
|
131
|
-
* (and including) the double CRLF before the body.
|
|
132
|
-
*
|
|
133
|
-
* Set to `-1` if the info is not available.
|
|
134
|
-
*/
|
|
135
|
-
headersSize: number
|
|
136
|
-
/**
|
|
137
|
-
* Size of the request body (POST data payload) in bytes.
|
|
138
|
-
*
|
|
139
|
-
* Set to `-1` if the info is not available.
|
|
140
|
-
*/
|
|
141
|
-
bodySize: number
|
|
142
|
-
/** A comment provided by the user or the application */
|
|
143
|
-
comment?: string | undefined
|
|
144
|
-
}
|
|
145
|
-
|
|
146
|
-
export type HarRequest = Omit<Request, 'postData'> & {
|
|
147
|
-
postData?: PostDataBase
|
|
148
|
-
}
|
|
149
|
-
|
|
150
|
-
export type TargetId =
|
|
151
|
-
| 'c'
|
|
152
|
-
| 'clojure'
|
|
153
|
-
| 'csharp'
|
|
154
|
-
| 'go'
|
|
155
|
-
| 'http'
|
|
156
|
-
| 'java'
|
|
157
|
-
| 'javascript'
|
|
158
|
-
| 'kotlin'
|
|
159
|
-
| 'node'
|
|
160
|
-
| 'objc'
|
|
161
|
-
| 'ocaml'
|
|
162
|
-
| 'php'
|
|
163
|
-
| 'powershell'
|
|
164
|
-
| 'python'
|
|
165
|
-
| 'r'
|
|
166
|
-
| 'ruby'
|
|
167
|
-
| 'shell'
|
|
168
|
-
| 'swift'
|
package/src/external/index.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './httpsnippet-lite'
|
package/src/legacy/index.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './reference-config'
|
|
@@ -1,417 +0,0 @@
|
|
|
1
|
-
import type { OpenAPIV2, OpenAPIV3, OpenAPIV3_1 } from '@scalar/openapi-types'
|
|
2
|
-
import type { ThemeId } from '@scalar/themes'
|
|
3
|
-
import type { UseSeoMetaInput } from '@unhead/schema'
|
|
4
|
-
|
|
5
|
-
import type { HarRequest, TargetId } from '../external'
|
|
6
|
-
|
|
7
|
-
/**
|
|
8
|
-
* This re-export is needed due to a typescript issue
|
|
9
|
-
* @see https://github.com/microsoft/TypeScript/issues/42873
|
|
10
|
-
*/
|
|
11
|
-
export type { OpenAPIV2, OpenAPIV3, OpenAPIV3_1 } from '@scalar/openapi-types'
|
|
12
|
-
|
|
13
|
-
export type ClientInfo = {
|
|
14
|
-
key: string
|
|
15
|
-
title: string
|
|
16
|
-
link: string
|
|
17
|
-
description: string
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
export type TargetInfo = {
|
|
21
|
-
key: TargetId
|
|
22
|
-
title: string
|
|
23
|
-
extname: `.${string}` | null
|
|
24
|
-
default: string
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
export type HiddenClients =
|
|
28
|
-
// Just hide all
|
|
29
|
-
| true
|
|
30
|
-
// Exclude whole targets or just specific clients
|
|
31
|
-
| Partial<Record<TargetInfo['key'], boolean | ClientInfo['key'][]>>
|
|
32
|
-
// Backwards compatibility with the previous behavior ['fetch', 'xhr']
|
|
33
|
-
| ClientInfo['key'][]
|
|
34
|
-
|
|
35
|
-
type HttpClientState = { targetKey: TargetId; clientKey: string }
|
|
36
|
-
|
|
37
|
-
export type PathRouting = {
|
|
38
|
-
basePath: string
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
export type ReferenceConfiguration = {
|
|
42
|
-
/** A string to use one of the color presets */
|
|
43
|
-
theme?: ThemeId
|
|
44
|
-
/** The layout to use for the references */
|
|
45
|
-
layout?: 'modern' | 'classic'
|
|
46
|
-
/** The Swagger/OpenAPI spec to render */
|
|
47
|
-
spec?: SpecConfiguration
|
|
48
|
-
/** URL to a request proxy for the API client */
|
|
49
|
-
proxy?: string
|
|
50
|
-
/** Whether the spec input should show */
|
|
51
|
-
isEditable?: boolean
|
|
52
|
-
/** Whether to show the sidebar */
|
|
53
|
-
showSidebar?: boolean
|
|
54
|
-
/**
|
|
55
|
-
* Whether to show models in the sidebar, search, and content.
|
|
56
|
-
*
|
|
57
|
-
* @default false
|
|
58
|
-
*/
|
|
59
|
-
hideModels?: boolean
|
|
60
|
-
/**
|
|
61
|
-
* Whether to show the "Download OpenAPI Specification" button
|
|
62
|
-
*
|
|
63
|
-
* @default false
|
|
64
|
-
*/
|
|
65
|
-
hideDownloadButton?: boolean
|
|
66
|
-
/** Whether dark mode is on or off initially (light mode) */
|
|
67
|
-
darkMode?: boolean
|
|
68
|
-
/** forceDarkModeState makes it always this state no matter what*/
|
|
69
|
-
forceDarkModeState?: 'dark' | 'light'
|
|
70
|
-
/** Whether to show the dark mode toggle */
|
|
71
|
-
hideDarkModeToggle?: boolean
|
|
72
|
-
/** Key used with CTRL/CMD to open the search modal (defaults to 'k' e.g. CMD+k) */
|
|
73
|
-
searchHotKey?:
|
|
74
|
-
| 'a'
|
|
75
|
-
| 'b'
|
|
76
|
-
| 'c'
|
|
77
|
-
| 'd'
|
|
78
|
-
| 'e'
|
|
79
|
-
| 'f'
|
|
80
|
-
| 'g'
|
|
81
|
-
| 'h'
|
|
82
|
-
| 'i'
|
|
83
|
-
| 'j'
|
|
84
|
-
| 'k'
|
|
85
|
-
| 'l'
|
|
86
|
-
| 'm'
|
|
87
|
-
| 'n'
|
|
88
|
-
| 'o'
|
|
89
|
-
| 'p'
|
|
90
|
-
| 'q'
|
|
91
|
-
| 'r'
|
|
92
|
-
| 's'
|
|
93
|
-
| 't'
|
|
94
|
-
| 'u'
|
|
95
|
-
| 'v'
|
|
96
|
-
| 'w'
|
|
97
|
-
| 'x'
|
|
98
|
-
| 'y'
|
|
99
|
-
| 'z'
|
|
100
|
-
/**
|
|
101
|
-
* If used, passed data will be added to the HTML header
|
|
102
|
-
* @see https://unhead.unjs.io/usage/composables/use-seo-meta
|
|
103
|
-
*/
|
|
104
|
-
metaData?: UseSeoMetaInput
|
|
105
|
-
/**
|
|
106
|
-
* List of httpsnippet clients to hide from the clients menu
|
|
107
|
-
* By default hides Unirest, pass `[]` to show all clients
|
|
108
|
-
*/
|
|
109
|
-
hiddenClients?: HiddenClients
|
|
110
|
-
/** Determine the HTTP client that’s selected by default */
|
|
111
|
-
defaultHttpClient?: HttpClientState
|
|
112
|
-
/** Custom CSS to be added to the page */
|
|
113
|
-
customCss?: string
|
|
114
|
-
/** onSpecUpdate is fired on spec/swagger content change */
|
|
115
|
-
onSpecUpdate?: (spec: string) => void
|
|
116
|
-
/** Prefill authentication */
|
|
117
|
-
authentication?: Partial<AuthenticationState>
|
|
118
|
-
/**
|
|
119
|
-
* Route using paths instead of hashes, your server MUST support this
|
|
120
|
-
* for example vue router needs a catch all so any subpaths are included
|
|
121
|
-
*
|
|
122
|
-
* @example
|
|
123
|
-
* '/standalone-api-reference/:custom(.*)?'
|
|
124
|
-
*
|
|
125
|
-
* @experimental
|
|
126
|
-
* @default undefined
|
|
127
|
-
*/
|
|
128
|
-
pathRouting?: PathRouting
|
|
129
|
-
/**
|
|
130
|
-
* The baseServerURL is used when the spec servers are relative paths and we are using SSR.
|
|
131
|
-
* On the client we can grab the window.location.origin but on the server we need
|
|
132
|
-
* to use this prop.
|
|
133
|
-
*
|
|
134
|
-
* @default undefined
|
|
135
|
-
* @example 'http://localhost:3000'
|
|
136
|
-
*/
|
|
137
|
-
baseServerURL?: string
|
|
138
|
-
/**
|
|
139
|
-
* List of servers to override the openapi spec servers
|
|
140
|
-
*
|
|
141
|
-
* @default undefined
|
|
142
|
-
* @example [{ url: 'https://api.scalar.com', description: 'Production server' }]
|
|
143
|
-
*/
|
|
144
|
-
servers?: Server[]
|
|
145
|
-
/**
|
|
146
|
-
* We’re using Inter and JetBrains Mono as the default fonts. If you want to use your own fonts, set this to false.
|
|
147
|
-
*
|
|
148
|
-
* @default true
|
|
149
|
-
*/
|
|
150
|
-
withDefaultFonts?: boolean
|
|
151
|
-
/**
|
|
152
|
-
* By default we only open the relevant tag based on the url, however if you want all the tags open by default then set this configuration option :)
|
|
153
|
-
*
|
|
154
|
-
* @default false
|
|
155
|
-
*/
|
|
156
|
-
defaultOpenAllTags?: boolean
|
|
157
|
-
/**
|
|
158
|
-
* Sort tags alphabetically or with a custom sort function
|
|
159
|
-
*/
|
|
160
|
-
tagsSorter?: 'alpha' | ((a: Tag, b: Tag) => number)
|
|
161
|
-
}
|
|
162
|
-
|
|
163
|
-
export type Server = OpenAPIV3.ServerObject | OpenAPIV3_1.ServerObject
|
|
164
|
-
|
|
165
|
-
export type BaseParameter = {
|
|
166
|
-
name: string
|
|
167
|
-
description?: string | null
|
|
168
|
-
value: string | number | Record<string, any>
|
|
169
|
-
required?: boolean
|
|
170
|
-
enabled: boolean
|
|
171
|
-
}
|
|
172
|
-
|
|
173
|
-
type OptionalCharset = string | null
|
|
174
|
-
|
|
175
|
-
export type ContentType =
|
|
176
|
-
| `application/json${OptionalCharset}`
|
|
177
|
-
| `application/xml${OptionalCharset}`
|
|
178
|
-
| `text/plain${OptionalCharset}`
|
|
179
|
-
| `text/html${OptionalCharset}`
|
|
180
|
-
| `application/octet-stream${OptionalCharset}`
|
|
181
|
-
| `application/x-www-form-urlencoded${OptionalCharset}`
|
|
182
|
-
| `multipart/form-data${OptionalCharset}`
|
|
183
|
-
|
|
184
|
-
export type Cookie = {
|
|
185
|
-
name: string
|
|
186
|
-
value: string
|
|
187
|
-
}
|
|
188
|
-
|
|
189
|
-
export type CustomRequestExample = {
|
|
190
|
-
lang: string
|
|
191
|
-
label: string
|
|
192
|
-
source: string
|
|
193
|
-
}
|
|
194
|
-
|
|
195
|
-
export type HarRequestWithPath = HarRequest & {
|
|
196
|
-
path: string
|
|
197
|
-
}
|
|
198
|
-
|
|
199
|
-
export type Header = {
|
|
200
|
-
name: string
|
|
201
|
-
value: string
|
|
202
|
-
}
|
|
203
|
-
|
|
204
|
-
export type Information = {
|
|
205
|
-
'description'?: string
|
|
206
|
-
'operationId'?: string | number
|
|
207
|
-
'parameters'?: Parameters[]
|
|
208
|
-
'responses'?: Record<string, ScalarResponse>
|
|
209
|
-
'security'?: OpenAPIV3.SecurityRequirementObject[]
|
|
210
|
-
'requestBody'?: RequestBody
|
|
211
|
-
'summary'?: string
|
|
212
|
-
'tags'?: string[]
|
|
213
|
-
'deprecated'?: boolean
|
|
214
|
-
/**
|
|
215
|
-
* Scalar
|
|
216
|
-
*/
|
|
217
|
-
'x-custom-examples'?: CustomRequestExample[]
|
|
218
|
-
/**
|
|
219
|
-
* Redocly, current
|
|
220
|
-
*/
|
|
221
|
-
'x-codeSamples'?: CustomRequestExample[]
|
|
222
|
-
/**
|
|
223
|
-
* Redocly, deprecated
|
|
224
|
-
*/
|
|
225
|
-
'x-code-samples'?: CustomRequestExample[]
|
|
226
|
-
}
|
|
227
|
-
|
|
228
|
-
export type Operation = {
|
|
229
|
-
httpVerb:
|
|
230
|
-
| 'GET'
|
|
231
|
-
| 'HEAD'
|
|
232
|
-
| 'PATCH'
|
|
233
|
-
| 'POST'
|
|
234
|
-
| 'PUT'
|
|
235
|
-
| 'TRACE'
|
|
236
|
-
| 'CONNECT'
|
|
237
|
-
| 'DELETE'
|
|
238
|
-
| 'OPTIONS'
|
|
239
|
-
path: string
|
|
240
|
-
operationId?: string
|
|
241
|
-
name?: string
|
|
242
|
-
description?: string
|
|
243
|
-
information?: Information
|
|
244
|
-
}
|
|
245
|
-
export type Parameters = {
|
|
246
|
-
// Fixed Fields
|
|
247
|
-
name: string
|
|
248
|
-
in?: string
|
|
249
|
-
description?: string
|
|
250
|
-
required?: boolean
|
|
251
|
-
deprecated?: boolean
|
|
252
|
-
allowEmptyValue?: boolean
|
|
253
|
-
// Other
|
|
254
|
-
style?: 'form' | 'simple'
|
|
255
|
-
explode?: boolean
|
|
256
|
-
allowReserved?: boolean
|
|
257
|
-
schema?: Schema
|
|
258
|
-
example?: any
|
|
259
|
-
examples?: Map<string, any>
|
|
260
|
-
content?: RequestBodyMimeTypes
|
|
261
|
-
}
|
|
262
|
-
|
|
263
|
-
export type Query = {
|
|
264
|
-
name: string
|
|
265
|
-
value: string
|
|
266
|
-
}
|
|
267
|
-
|
|
268
|
-
// Create a mapped type to ensure keys are a subset of ContentType
|
|
269
|
-
export type RequestBodyMimeTypes = {
|
|
270
|
-
[K in ContentType]?: {
|
|
271
|
-
schema?: any
|
|
272
|
-
example?: any
|
|
273
|
-
examples?: any
|
|
274
|
-
}
|
|
275
|
-
}
|
|
276
|
-
|
|
277
|
-
export type ScalarResponse = {
|
|
278
|
-
description: string
|
|
279
|
-
content: any
|
|
280
|
-
}
|
|
281
|
-
|
|
282
|
-
export type RequestBody = {
|
|
283
|
-
description?: string
|
|
284
|
-
required?: boolean
|
|
285
|
-
content?: RequestBodyMimeTypes
|
|
286
|
-
}
|
|
287
|
-
|
|
288
|
-
/** For providing a OAS spec object or url to be fetched */
|
|
289
|
-
export type SpecConfiguration = {
|
|
290
|
-
/** URL to a Swagger/OpenAPI file */
|
|
291
|
-
url?: string
|
|
292
|
-
/** Swagger/Open API spec */
|
|
293
|
-
content?: string | Record<string, any> | (() => Record<string, any>)
|
|
294
|
-
}
|
|
295
|
-
|
|
296
|
-
export type Schema = {
|
|
297
|
-
type: string
|
|
298
|
-
name?: string
|
|
299
|
-
example?: any
|
|
300
|
-
default?: any
|
|
301
|
-
format?: string
|
|
302
|
-
description?: string
|
|
303
|
-
properties?: Record<string, Schema>
|
|
304
|
-
}
|
|
305
|
-
|
|
306
|
-
export type TransformedOperation = Operation & {
|
|
307
|
-
pathParameters?: Parameters[]
|
|
308
|
-
}
|
|
309
|
-
|
|
310
|
-
export type CollapsedSidebarItems = Record<string, boolean>
|
|
311
|
-
|
|
312
|
-
export type AuthenticationState = {
|
|
313
|
-
customSecurity: boolean
|
|
314
|
-
preferredSecurityScheme: string | null
|
|
315
|
-
securitySchemes?:
|
|
316
|
-
| OpenAPIV2.SecurityDefinitionsObject
|
|
317
|
-
| OpenAPIV3.ComponentsObject['securitySchemes']
|
|
318
|
-
| OpenAPIV3_1.ComponentsObject['securitySchemes']
|
|
319
|
-
http: {
|
|
320
|
-
basic: {
|
|
321
|
-
username: string
|
|
322
|
-
password: string
|
|
323
|
-
}
|
|
324
|
-
bearer: {
|
|
325
|
-
token: string
|
|
326
|
-
}
|
|
327
|
-
}
|
|
328
|
-
apiKey: {
|
|
329
|
-
token: string
|
|
330
|
-
}
|
|
331
|
-
oAuth2: {
|
|
332
|
-
clientId: string
|
|
333
|
-
scopes: string[]
|
|
334
|
-
accessToken: string
|
|
335
|
-
state: string
|
|
336
|
-
username: string
|
|
337
|
-
password: string
|
|
338
|
-
}
|
|
339
|
-
}
|
|
340
|
-
|
|
341
|
-
export type Heading = {
|
|
342
|
-
depth: number
|
|
343
|
-
value: string
|
|
344
|
-
slug?: string
|
|
345
|
-
}
|
|
346
|
-
|
|
347
|
-
export type CodeBlockSSRKey = `components-scalar-code-block${number}`
|
|
348
|
-
export type DescriptionSectionSSRKey =
|
|
349
|
-
`components-Content-Introduction-Description-sections${number}`
|
|
350
|
-
export type ExampleRequestSSRKey =
|
|
351
|
-
`components-Content-Operation-Example-Request${number}`
|
|
352
|
-
|
|
353
|
-
export type ScalarState = {
|
|
354
|
-
'hash'?: string
|
|
355
|
-
'useGlobalStore-authentication'?: AuthenticationState
|
|
356
|
-
'useSidebarContent-collapsedSidebarItems'?: CollapsedSidebarItems
|
|
357
|
-
[key: CodeBlockSSRKey]: string
|
|
358
|
-
[key: DescriptionSectionSSRKey]: {
|
|
359
|
-
heading: Heading
|
|
360
|
-
content: string
|
|
361
|
-
}[]
|
|
362
|
-
[key: ExampleRequestSSRKey]: string
|
|
363
|
-
}
|
|
364
|
-
|
|
365
|
-
export type SSRState = {
|
|
366
|
-
payload: {
|
|
367
|
-
data: ScalarState
|
|
368
|
-
}
|
|
369
|
-
url: string
|
|
370
|
-
}
|
|
371
|
-
|
|
372
|
-
export type Tag = {
|
|
373
|
-
'name': string
|
|
374
|
-
'description': string
|
|
375
|
-
'operations': TransformedOperation[]
|
|
376
|
-
'x-displayName'?: string
|
|
377
|
-
}
|
|
378
|
-
|
|
379
|
-
export type TagGroup = {
|
|
380
|
-
name: string
|
|
381
|
-
tags: string[]
|
|
382
|
-
}
|
|
383
|
-
|
|
384
|
-
export type Definitions = OpenAPIV2.DefinitionsObject
|
|
385
|
-
|
|
386
|
-
export type Webhooks = Record<
|
|
387
|
-
string,
|
|
388
|
-
Record<
|
|
389
|
-
OpenAPIV3_1.HttpMethods,
|
|
390
|
-
TransformedOperation & {
|
|
391
|
-
'x-internal'?: boolean
|
|
392
|
-
}
|
|
393
|
-
>
|
|
394
|
-
>
|
|
395
|
-
|
|
396
|
-
export type Spec = {
|
|
397
|
-
'tags'?: Tag[]
|
|
398
|
-
'info':
|
|
399
|
-
| Partial<OpenAPIV2.Document['info']>
|
|
400
|
-
| Partial<OpenAPIV3.Document['info']>
|
|
401
|
-
| Partial<OpenAPIV3_1.Document['info']>
|
|
402
|
-
'host'?: OpenAPIV2.Document['host']
|
|
403
|
-
'basePath'?: OpenAPIV2.Document['basePath']
|
|
404
|
-
'schemes'?: OpenAPIV2.Document['schemes']
|
|
405
|
-
'externalDocs'?: {
|
|
406
|
-
url: string
|
|
407
|
-
description?: string
|
|
408
|
-
}
|
|
409
|
-
'servers'?: OpenAPIV3.Document['servers'] | OpenAPIV3_1.Document['servers']
|
|
410
|
-
'components'?: OpenAPIV3.ComponentsObject | OpenAPIV3_1.ComponentsObject
|
|
411
|
-
'webhooks'?: Webhooks
|
|
412
|
-
'definitions'?: Definitions
|
|
413
|
-
'swagger'?: OpenAPIV2.Document['swagger']
|
|
414
|
-
'openapi'?: OpenAPIV3.Document['openapi'] | OpenAPIV3_1.Document['openapi']
|
|
415
|
-
'x-tagGroups'?: TagGroup[]
|
|
416
|
-
'security'?: OpenAPIV3.SecurityRequirementObject[]
|
|
417
|
-
}
|
package/src/utils/index.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './utility-types'
|