@elysiajs/openapi 1.3.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/LICENSE +7 -0
- package/README.md +101 -0
- package/bun.lock +537 -0
- package/bunfig.toml +2 -0
- package/dist/cjs/gen/index.js +127 -0
- package/dist/cjs/index.d.ts +35 -0
- package/dist/cjs/index.js +639 -0
- package/dist/cjs/openapi.d.ts +25 -0
- package/dist/cjs/openapi.js +285 -0
- package/dist/cjs/scalar/index.js +183 -0
- package/dist/cjs/swagger/index.js +129 -0
- package/dist/cjs/swagger/types.js +18 -0
- package/dist/cjs/types.d.ts +137 -0
- package/dist/cjs/types.js +18 -0
- package/dist/gen/index.d.ts +36 -0
- package/dist/gen/index.mjs +108 -0
- package/dist/index.d.ts +35 -0
- package/dist/index.mjs +612 -0
- package/dist/openapi.d.ts +25 -0
- package/dist/openapi.mjs +257 -0
- package/dist/scalar/index.d.ts +3 -0
- package/dist/scalar/index.mjs +158 -0
- package/dist/swagger/index.d.ts +7 -0
- package/dist/swagger/index.mjs +103 -0
- package/dist/swagger/types.d.ts +274 -0
- package/dist/swagger/types.mjs +0 -0
- package/dist/types.d.ts +137 -0
- package/dist/types.mjs +0 -0
- package/package.json +92 -0
|
@@ -0,0 +1,274 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Swagger UI type because swagger-ui doesn't export an interface so here's copy paste
|
|
3
|
+
*
|
|
4
|
+
* @see swagger-ui/index.d.ts
|
|
5
|
+
**/
|
|
6
|
+
export interface SwaggerUIOptions {
|
|
7
|
+
/**
|
|
8
|
+
* URL to fetch external configuration document from.
|
|
9
|
+
*/
|
|
10
|
+
configUrl?: string | undefined;
|
|
11
|
+
/**
|
|
12
|
+
* REQUIRED if domNode is not provided. The ID of a DOM element inside which SwaggerUI will put its user interface.
|
|
13
|
+
*/
|
|
14
|
+
dom_id?: string | undefined;
|
|
15
|
+
/**
|
|
16
|
+
* A JavaScript object describing the OpenAPI definition. When used, the url parameter will not be parsed. This is useful for testing manually-generated definitions without hosting them
|
|
17
|
+
*/
|
|
18
|
+
spec?: {
|
|
19
|
+
[propName: string]: any;
|
|
20
|
+
} | undefined;
|
|
21
|
+
/**
|
|
22
|
+
* The URL pointing to API definition (normally swagger.json or swagger.yaml). Will be ignored if urls or spec is used.
|
|
23
|
+
*/
|
|
24
|
+
url?: string | undefined;
|
|
25
|
+
/**
|
|
26
|
+
* An array of API definition objects ([{url: "<url1>", name: "<name1>"},{url: "<url2>", name: "<name2>"}])
|
|
27
|
+
* used by Topbar plugin. When used and Topbar plugin is enabled, the url parameter will not be parsed.
|
|
28
|
+
* Names and URLs must be unique among all items in this array, since they're used as identifiers.
|
|
29
|
+
*/
|
|
30
|
+
urls?: Array<{
|
|
31
|
+
url: string;
|
|
32
|
+
name: string;
|
|
33
|
+
}> | undefined;
|
|
34
|
+
/**
|
|
35
|
+
* The name of a component available via the plugin system to use as the top-level layout
|
|
36
|
+
* for Swagger UI.
|
|
37
|
+
*/
|
|
38
|
+
layout?: string | undefined;
|
|
39
|
+
/**
|
|
40
|
+
* A Javascript object to configure plugin integration and behaviors
|
|
41
|
+
*/
|
|
42
|
+
pluginsOptions?: PluginsOptions;
|
|
43
|
+
/**
|
|
44
|
+
* An array of plugin functions to use in Swagger UI.
|
|
45
|
+
*/
|
|
46
|
+
plugins?: SwaggerUIPlugin[] | undefined;
|
|
47
|
+
/**
|
|
48
|
+
* An array of presets to use in Swagger UI.
|
|
49
|
+
* Usually, you'll want to include ApisPreset if you use this option.
|
|
50
|
+
*/
|
|
51
|
+
presets?: SwaggerUIPlugin[] | undefined;
|
|
52
|
+
/**
|
|
53
|
+
* If set to true, enables deep linking for tags and operations.
|
|
54
|
+
* See the Deep Linking documentation for more information.
|
|
55
|
+
*/
|
|
56
|
+
deepLinking?: boolean | undefined;
|
|
57
|
+
/**
|
|
58
|
+
* Controls the display of operationId in operations list. The default is false.
|
|
59
|
+
*/
|
|
60
|
+
displayOperationId?: boolean | undefined;
|
|
61
|
+
/**
|
|
62
|
+
* The default expansion depth for models (set to -1 completely hide the models).
|
|
63
|
+
*/
|
|
64
|
+
defaultModelsExpandDepth?: number | undefined;
|
|
65
|
+
/**
|
|
66
|
+
* The default expansion depth for the model on the model-example section.
|
|
67
|
+
*/
|
|
68
|
+
defaultModelExpandDepth?: number | undefined;
|
|
69
|
+
/**
|
|
70
|
+
* Controls how the model is shown when the API is first rendered.
|
|
71
|
+
* (The user can always switch the rendering for a given model by clicking the
|
|
72
|
+
* 'Model' and 'Example Value' links.)
|
|
73
|
+
*/
|
|
74
|
+
defaultModelRendering?: 'example' | 'model' | undefined;
|
|
75
|
+
/**
|
|
76
|
+
* Controls the display of the request duration (in milliseconds) for "Try it out" requests.
|
|
77
|
+
*/
|
|
78
|
+
displayRequestDuration?: boolean | undefined;
|
|
79
|
+
/**
|
|
80
|
+
* Controls the default expansion setting for the operations and tags.
|
|
81
|
+
* It can be 'list' (expands only the tags), 'full' (expands the tags and operations)
|
|
82
|
+
* or 'none' (expands nothing).
|
|
83
|
+
*/
|
|
84
|
+
docExpansion?: 'list' | 'full' | 'none' | undefined;
|
|
85
|
+
/**
|
|
86
|
+
* If set, enables filtering.
|
|
87
|
+
* The top bar will show an edit box that you can use to filter the tagged operations that are shown.
|
|
88
|
+
* Can be Boolean to enable or disable, or a string, in which case filtering will be enabled
|
|
89
|
+
* using that string as the filter expression.
|
|
90
|
+
* Filtering is case sensitive matching the filter expression anywhere inside the tag.
|
|
91
|
+
*/
|
|
92
|
+
filter?: boolean | string | undefined;
|
|
93
|
+
/**
|
|
94
|
+
* If set, limits the number of tagged operations displayed to at most this many.
|
|
95
|
+
* The default is to show all operations.
|
|
96
|
+
*/
|
|
97
|
+
maxDisplayedTags?: number | undefined;
|
|
98
|
+
/**
|
|
99
|
+
* Apply a sort to the operation list of each API.
|
|
100
|
+
* It can be 'alpha' (sort by paths alphanumerically),
|
|
101
|
+
* 'method' (sort by HTTP method) or a function (see Array.prototype.sort() to know how sort function works).
|
|
102
|
+
* Default is the order returned by the server unchanged.
|
|
103
|
+
*/
|
|
104
|
+
operationsSorter?: SorterLike | undefined;
|
|
105
|
+
/**
|
|
106
|
+
* Controls the display of vendor extension (x-) fields and values for Operations,
|
|
107
|
+
* Parameters, Responses, and Schema.
|
|
108
|
+
*/
|
|
109
|
+
showExtensions?: boolean | undefined;
|
|
110
|
+
/**
|
|
111
|
+
* Controls the display of extensions (pattern, maxLength, minLength, maximum, minimum) fields
|
|
112
|
+
* and values for Parameters.
|
|
113
|
+
*/
|
|
114
|
+
showCommonExtensions?: boolean | undefined;
|
|
115
|
+
/**
|
|
116
|
+
* Apply a sort to the tag list of each API.
|
|
117
|
+
* It can be 'alpha' (sort by paths alphanumerically)
|
|
118
|
+
* or a function (see Array.prototype.sort() to learn how to write a sort function).
|
|
119
|
+
* Two tag name strings are passed to the sorter for each pass.
|
|
120
|
+
* Default is the order determined by Swagger UI.
|
|
121
|
+
*/
|
|
122
|
+
tagsSorter?: SorterLike | undefined;
|
|
123
|
+
/**
|
|
124
|
+
* When enabled, sanitizer will leave style, class and data-* attributes untouched
|
|
125
|
+
* on all HTML Elements declared inside markdown strings.
|
|
126
|
+
* This parameter is Deprecated and will be removed in 4.0.0.
|
|
127
|
+
* @deprecated
|
|
128
|
+
*/
|
|
129
|
+
useUnsafeMarkdown?: boolean | undefined;
|
|
130
|
+
/**
|
|
131
|
+
* Provides a mechanism to be notified when Swagger UI has finished rendering a newly provided definition.
|
|
132
|
+
*/
|
|
133
|
+
onComplete?: (() => any) | undefined;
|
|
134
|
+
/**
|
|
135
|
+
* Set to false to deactivate syntax highlighting of payloads and cURL command,
|
|
136
|
+
* can be otherwise an object with the activate and theme properties.
|
|
137
|
+
*/
|
|
138
|
+
syntaxHighlight?: false | {
|
|
139
|
+
/**
|
|
140
|
+
* Whether syntax highlighting should be activated or not.
|
|
141
|
+
*/
|
|
142
|
+
activate?: boolean | undefined;
|
|
143
|
+
/**
|
|
144
|
+
* Highlight.js syntax coloring theme to use. (Only these 6 styles are available.)
|
|
145
|
+
*/
|
|
146
|
+
theme?: 'agate' | 'arta' | 'idea' | 'monokai' | 'nord' | 'obsidian' | 'tomorrow-night' | undefined;
|
|
147
|
+
} | undefined;
|
|
148
|
+
/**
|
|
149
|
+
* Controls whether the "Try it out" section should be enabled by default.
|
|
150
|
+
*/
|
|
151
|
+
tryItOutEnabled?: boolean | undefined;
|
|
152
|
+
/**
|
|
153
|
+
* This is the default configuration section for the the requestSnippets plugin.
|
|
154
|
+
*/
|
|
155
|
+
requestSnippets?: {
|
|
156
|
+
generators?: {
|
|
157
|
+
[genName: string]: {
|
|
158
|
+
title: string;
|
|
159
|
+
syntax: string;
|
|
160
|
+
};
|
|
161
|
+
} | undefined;
|
|
162
|
+
defaultExpanded?: boolean | undefined;
|
|
163
|
+
/**
|
|
164
|
+
* e.g. only show curl bash = ["curl_bash"]
|
|
165
|
+
*/
|
|
166
|
+
languagesMask?: string[] | undefined;
|
|
167
|
+
} | undefined;
|
|
168
|
+
/**
|
|
169
|
+
* OAuth redirect URL.
|
|
170
|
+
*/
|
|
171
|
+
oauth2RedirectUrl?: string | undefined;
|
|
172
|
+
/**
|
|
173
|
+
* MUST be a function. Function to intercept remote definition,
|
|
174
|
+
* "Try it out", and OAuth 2.0 requests.
|
|
175
|
+
* Accepts one argument requestInterceptor(request) and must return the modified request,
|
|
176
|
+
* or a Promise that resolves to the modified request.
|
|
177
|
+
*/
|
|
178
|
+
requestInterceptor?: ((a: Request) => Request | Promise<Request>) | undefined;
|
|
179
|
+
/**
|
|
180
|
+
* MUST be a function. Function to intercept remote definition,
|
|
181
|
+
* "Try it out", and OAuth 2.0 responses.
|
|
182
|
+
* Accepts one argument responseInterceptor(response) and must return the modified response,
|
|
183
|
+
* or a Promise that resolves to the modified response.
|
|
184
|
+
*/
|
|
185
|
+
responseInterceptor?: ((a: Response) => Response | Promise<Response>) | undefined;
|
|
186
|
+
/**
|
|
187
|
+
* If set to true, uses the mutated request returned from a requestInterceptor
|
|
188
|
+
* to produce the curl command in the UI, otherwise the request
|
|
189
|
+
* beforethe requestInterceptor was applied is used.
|
|
190
|
+
*/
|
|
191
|
+
showMutatedRequest?: boolean | undefined;
|
|
192
|
+
/**
|
|
193
|
+
* List of HTTP methods that have the "Try it out" feature enabled.
|
|
194
|
+
* An empty array disables "Try it out" for all operations.
|
|
195
|
+
* This does not filter the operations from the display.
|
|
196
|
+
*/
|
|
197
|
+
supportedSubmitMethods?: SupportedHTTPMethods[] | undefined;
|
|
198
|
+
/**
|
|
199
|
+
* By default, Swagger UI attempts to validate specs against swagger.io's online validator.
|
|
200
|
+
* You can use this parameter to set a different validator URL,
|
|
201
|
+
* for example for locally deployed validators (Validator Badge).
|
|
202
|
+
* Setting it to either none, 127.0.0.1 or localhost will disable validation.
|
|
203
|
+
*/
|
|
204
|
+
validatorUrl?: string | undefined;
|
|
205
|
+
/**
|
|
206
|
+
* If set to true, enables passing credentials, as defined in the Fetch standard,
|
|
207
|
+
* in CORS requests that are sent by the browser.
|
|
208
|
+
* Note that Swagger UI cannot currently set cookies cross-domain (see swagger-js#1163)
|
|
209
|
+
* - as a result, you will have to rely on browser-supplied
|
|
210
|
+
* cookies (which this setting enables sending) that Swagger UI cannot control.
|
|
211
|
+
*/
|
|
212
|
+
withCredentials?: boolean | undefined;
|
|
213
|
+
/**
|
|
214
|
+
* Function to set default values to each property in model.
|
|
215
|
+
* Accepts one argument modelPropertyMacro(property), property is immutable
|
|
216
|
+
*/
|
|
217
|
+
modelPropertyMacro?: ((propName: Readonly<any>) => any) | undefined;
|
|
218
|
+
/**
|
|
219
|
+
* Function to set default value to parameters.
|
|
220
|
+
* Accepts two arguments parameterMacro(operation, parameter).
|
|
221
|
+
* Operation and parameter are objects passed for context, both remain immutable
|
|
222
|
+
*/
|
|
223
|
+
parameterMacro?: ((operation: Readonly<any>, parameter: Readonly<any>) => any) | undefined;
|
|
224
|
+
/**
|
|
225
|
+
* If set to true, it persists authorization data and it would not be lost on browser close/refresh
|
|
226
|
+
*/
|
|
227
|
+
persistAuthorization?: boolean | undefined;
|
|
228
|
+
}
|
|
229
|
+
interface PluginsOptions {
|
|
230
|
+
/**
|
|
231
|
+
* Control behavior of plugins when targeting the same component with wrapComponent.<br/>
|
|
232
|
+
* - `legacy` (default) : last plugin takes precedence over the others<br/>
|
|
233
|
+
* - `chain` : chain wrapComponents when targeting the same core component,
|
|
234
|
+
* allowing multiple plugins to wrap the same component
|
|
235
|
+
* @default 'legacy'
|
|
236
|
+
*/
|
|
237
|
+
pluginLoadType?: PluginLoadType;
|
|
238
|
+
}
|
|
239
|
+
type PluginLoadType = 'legacy' | 'chain';
|
|
240
|
+
type SupportedHTTPMethods = 'get' | 'put' | 'post' | 'delete' | 'options' | 'head' | 'patch' | 'trace';
|
|
241
|
+
type SorterLike = 'alpha' | 'method' | {
|
|
242
|
+
(name1: string, name2: string): number;
|
|
243
|
+
};
|
|
244
|
+
interface Request {
|
|
245
|
+
[prop: string]: any;
|
|
246
|
+
}
|
|
247
|
+
interface Response {
|
|
248
|
+
[prop: string]: any;
|
|
249
|
+
}
|
|
250
|
+
/**
|
|
251
|
+
* See https://swagger.io/docs/open-source-tools/swagger-ui/customization/plugin-api/
|
|
252
|
+
*/
|
|
253
|
+
interface SwaggerUIPlugin {
|
|
254
|
+
(system: any): {
|
|
255
|
+
statePlugins?: {
|
|
256
|
+
[stateKey: string]: {
|
|
257
|
+
actions?: Indexable | undefined;
|
|
258
|
+
reducers?: Indexable | undefined;
|
|
259
|
+
selectors?: Indexable | undefined;
|
|
260
|
+
wrapActions?: Indexable | undefined;
|
|
261
|
+
wrapSelectors?: Indexable | undefined;
|
|
262
|
+
};
|
|
263
|
+
} | undefined;
|
|
264
|
+
components?: Indexable | undefined;
|
|
265
|
+
wrapComponents?: Indexable | undefined;
|
|
266
|
+
rootInjects?: Indexable | undefined;
|
|
267
|
+
afterLoad?: ((system: any) => any) | undefined;
|
|
268
|
+
fn?: Indexable | undefined;
|
|
269
|
+
};
|
|
270
|
+
}
|
|
271
|
+
interface Indexable {
|
|
272
|
+
[index: string]: any;
|
|
273
|
+
}
|
|
274
|
+
export {};
|
|
File without changes
|
package/dist/types.d.ts
ADDED
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
import type { TSchema } from 'elysia';
|
|
2
|
+
import type { OpenAPIV3 } from 'openapi-types';
|
|
3
|
+
import type { ApiReferenceConfiguration } from '@scalar/types';
|
|
4
|
+
import type { SwaggerUIOptions } from './swagger/types';
|
|
5
|
+
export type OpenAPIProvider = 'scalar' | 'swagger-ui' | null;
|
|
6
|
+
type MaybeArray<T> = T | T[];
|
|
7
|
+
export type AdditionalReference = {
|
|
8
|
+
[path in string]: {
|
|
9
|
+
[method in string]: {
|
|
10
|
+
params: TSchema;
|
|
11
|
+
query: TSchema;
|
|
12
|
+
headers: TSchema;
|
|
13
|
+
body: TSchema;
|
|
14
|
+
response: {
|
|
15
|
+
[status in number]: TSchema;
|
|
16
|
+
};
|
|
17
|
+
};
|
|
18
|
+
};
|
|
19
|
+
};
|
|
20
|
+
export type AdditionalReferences = MaybeArray<AdditionalReference | undefined | (() => AdditionalReference | undefined)>;
|
|
21
|
+
export interface ElysiaOpenAPIConfig<Enabled extends boolean = true, Path extends string = '/swagger', Provider extends OpenAPIProvider = 'scalar'> {
|
|
22
|
+
/**
|
|
23
|
+
* @default true
|
|
24
|
+
*/
|
|
25
|
+
enabled?: Enabled;
|
|
26
|
+
/**
|
|
27
|
+
* OpenAPI config
|
|
28
|
+
*
|
|
29
|
+
* @see https://spec.openapis.org/oas/v3.0.3.html
|
|
30
|
+
*/
|
|
31
|
+
documentation?: Omit<Partial<OpenAPIV3.Document>, 'x-express-openapi-additional-middleware' | 'x-express-openapi-validation-strict'>;
|
|
32
|
+
exclude?: {
|
|
33
|
+
/**
|
|
34
|
+
* Exclude methods from OpenAPI
|
|
35
|
+
*/
|
|
36
|
+
methods?: string[];
|
|
37
|
+
/**
|
|
38
|
+
* Paths to exclude from OpenAPI endpoint
|
|
39
|
+
*
|
|
40
|
+
* @default []
|
|
41
|
+
*/
|
|
42
|
+
paths?: string | RegExp | (string | RegExp)[];
|
|
43
|
+
/**
|
|
44
|
+
* Determine if OpenAPI should exclude static files.
|
|
45
|
+
*
|
|
46
|
+
* @default true
|
|
47
|
+
*/
|
|
48
|
+
staticFile?: boolean;
|
|
49
|
+
/**
|
|
50
|
+
* Exclude tags from OpenAPI
|
|
51
|
+
*/
|
|
52
|
+
tags?: string[];
|
|
53
|
+
};
|
|
54
|
+
/**
|
|
55
|
+
* The endpoint to expose OpenAPI Documentation
|
|
56
|
+
*
|
|
57
|
+
* @default '/openapi'
|
|
58
|
+
*/
|
|
59
|
+
path?: Path;
|
|
60
|
+
/**
|
|
61
|
+
* Choose your provider, Scalar or Swagger UI
|
|
62
|
+
*
|
|
63
|
+
* @default 'scalar'
|
|
64
|
+
* @see https://github.com/scalar/scalar
|
|
65
|
+
* @see https://github.com/swagger-api/swagger-ui
|
|
66
|
+
*/
|
|
67
|
+
provider?: Provider;
|
|
68
|
+
/**
|
|
69
|
+
* Additional reference for each endpoint
|
|
70
|
+
*/
|
|
71
|
+
references?: AdditionalReferences;
|
|
72
|
+
/**
|
|
73
|
+
* Scalar configuration to customize scalar
|
|
74
|
+
*'
|
|
75
|
+
* @see https://github.com/scalar/scalar/blob/main/documentation/configuration.md
|
|
76
|
+
*/
|
|
77
|
+
scalar?: ApiReferenceConfiguration & {
|
|
78
|
+
/**
|
|
79
|
+
* Version to use for Scalar cdn bundle
|
|
80
|
+
*
|
|
81
|
+
* @default 'latest'
|
|
82
|
+
* @see https://github.com/scalar/scalar
|
|
83
|
+
*/
|
|
84
|
+
version?: string;
|
|
85
|
+
/**
|
|
86
|
+
* Optional override to specifying the path for the Scalar bundle
|
|
87
|
+
*
|
|
88
|
+
* Custom URL or path to locally hosted Scalar bundle
|
|
89
|
+
*
|
|
90
|
+
* Lease blank to use default jsdeliver.net CDN
|
|
91
|
+
*
|
|
92
|
+
* @default ''
|
|
93
|
+
* @example 'https://unpkg.com/@scalar/api-reference@1.13.10/dist/browser/standalone.js'
|
|
94
|
+
* @example '/public/standalone.js'
|
|
95
|
+
* @see https://github.com/scalar/scalar
|
|
96
|
+
*/
|
|
97
|
+
cdn?: string;
|
|
98
|
+
};
|
|
99
|
+
/**
|
|
100
|
+
* The endpoint to expose OpenAPI JSON specification
|
|
101
|
+
*
|
|
102
|
+
* @default '/${path}/json'
|
|
103
|
+
*/
|
|
104
|
+
specPath?: string;
|
|
105
|
+
/**
|
|
106
|
+
* Options to send to SwaggerUIBundle
|
|
107
|
+
* Currently, options that are defined as functions such as requestInterceptor
|
|
108
|
+
* and onComplete are not supported.
|
|
109
|
+
*/
|
|
110
|
+
swagger?: Omit<Partial<SwaggerUIOptions>, 'dom_id' | 'dom_node' | 'spec' | 'url' | 'urls' | 'layout' | 'pluginsOptions' | 'plugins' | 'presets' | 'onComplete' | 'requestInterceptor' | 'responseInterceptor' | 'modelPropertyMacro' | 'parameterMacro'> & {
|
|
111
|
+
/**
|
|
112
|
+
* Custom Swagger CSS
|
|
113
|
+
*/
|
|
114
|
+
theme?: string | {
|
|
115
|
+
light: string;
|
|
116
|
+
dark: string;
|
|
117
|
+
};
|
|
118
|
+
/**
|
|
119
|
+
* Version to use for swagger cdn bundle
|
|
120
|
+
*
|
|
121
|
+
* @see unpkg.com/swagger-ui-dist
|
|
122
|
+
*
|
|
123
|
+
* @default 4.18.2
|
|
124
|
+
*/
|
|
125
|
+
version?: string;
|
|
126
|
+
/**
|
|
127
|
+
* Using poor man dark mode ðŸ˜
|
|
128
|
+
*/
|
|
129
|
+
autoDarkMode?: boolean;
|
|
130
|
+
/**
|
|
131
|
+
* Optional override to specifying the path for the Swagger UI bundle
|
|
132
|
+
* Custom URL or path to locally hosted Swagger UI bundle
|
|
133
|
+
*/
|
|
134
|
+
cdn?: string;
|
|
135
|
+
};
|
|
136
|
+
}
|
|
137
|
+
export {};
|
package/dist/types.mjs
ADDED
|
File without changes
|
package/package.json
ADDED
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@elysiajs/openapi",
|
|
3
|
+
"version": "1.3.2",
|
|
4
|
+
"description": "Plugin for Elysia to auto-generate API documentation",
|
|
5
|
+
"author": {
|
|
6
|
+
"name": "saltyAom",
|
|
7
|
+
"url": "https://github.com/SaltyAom",
|
|
8
|
+
"email": "saltyaom@gmail.com"
|
|
9
|
+
},
|
|
10
|
+
"main": "./dist/cjs/index.js",
|
|
11
|
+
"module": "./dist/index.mjs",
|
|
12
|
+
"types": "./dist/index.d.ts",
|
|
13
|
+
"exports": {
|
|
14
|
+
"./package.json": "./package.json",
|
|
15
|
+
".": {
|
|
16
|
+
"types": "./dist/index.d.ts",
|
|
17
|
+
"import": "./dist/index.mjs",
|
|
18
|
+
"require": "./dist/cjs/index.js"
|
|
19
|
+
},
|
|
20
|
+
"./gen": {
|
|
21
|
+
"types": "./dist/gen/index.d.ts",
|
|
22
|
+
"import": "./dist/gen/index.mjs",
|
|
23
|
+
"require": "./dist/cjs/gen/index.js"
|
|
24
|
+
},
|
|
25
|
+
"./openapi": {
|
|
26
|
+
"types": "./dist/openapi.d.ts",
|
|
27
|
+
"import": "./dist/openapi.mjs",
|
|
28
|
+
"require": "./dist/cjs/openapi.js"
|
|
29
|
+
},
|
|
30
|
+
"./scalar": {
|
|
31
|
+
"types": "./dist/scalar/index.d.ts",
|
|
32
|
+
"import": "./dist/scalar/index.mjs",
|
|
33
|
+
"require": "./dist/cjs/scalar/index.js"
|
|
34
|
+
},
|
|
35
|
+
"./scalar/theme": {
|
|
36
|
+
"types": "./dist/scalar/theme.d.ts",
|
|
37
|
+
"import": "./dist/scalar/theme.mjs",
|
|
38
|
+
"require": "./dist/cjs/scalar/theme.js"
|
|
39
|
+
},
|
|
40
|
+
"./swagger": {
|
|
41
|
+
"types": "./dist/swagger/index.d.ts",
|
|
42
|
+
"import": "./dist/swagger/index.mjs",
|
|
43
|
+
"require": "./dist/cjs/swagger/index.js"
|
|
44
|
+
},
|
|
45
|
+
"./swagger/types": {
|
|
46
|
+
"types": "./dist/swagger/types.d.ts",
|
|
47
|
+
"import": "./dist/swagger/types.mjs",
|
|
48
|
+
"require": "./dist/cjs/swagger/types.js"
|
|
49
|
+
},
|
|
50
|
+
"./types": {
|
|
51
|
+
"types": "./dist/types.d.ts",
|
|
52
|
+
"import": "./dist/types.mjs",
|
|
53
|
+
"require": "./dist/cjs/types.js"
|
|
54
|
+
}
|
|
55
|
+
},
|
|
56
|
+
"keywords": [
|
|
57
|
+
"elysia",
|
|
58
|
+
"openapi",
|
|
59
|
+
"swagger",
|
|
60
|
+
"scalar"
|
|
61
|
+
],
|
|
62
|
+
"homepage": "https://github.com/elysiajs/elysia-openapi",
|
|
63
|
+
"repository": {
|
|
64
|
+
"type": "git",
|
|
65
|
+
"url": "https://github.com/elysiajs/elysia-openapi"
|
|
66
|
+
},
|
|
67
|
+
"bugs": "https://github.com/elysiajs/elysia-openapi/issues",
|
|
68
|
+
"license": "MIT",
|
|
69
|
+
"scripts": {
|
|
70
|
+
"dev": "bun run --watch example/index.ts",
|
|
71
|
+
"test": "bun test && npm run test:node",
|
|
72
|
+
"test:node": "npm install --prefix ./test/node/cjs/ && npm install --prefix ./test/node/esm/ && node ./test/node/cjs/index.js && node ./test/node/esm/index.js",
|
|
73
|
+
"build": "bun build.ts",
|
|
74
|
+
"release": "npm run build && npm run test && npm publish --access public"
|
|
75
|
+
},
|
|
76
|
+
"peerDependencies": {
|
|
77
|
+
"elysia": ">= 1.3.0"
|
|
78
|
+
},
|
|
79
|
+
"devDependencies": {
|
|
80
|
+
"@apidevtools/swagger-parser": "^12.0.0",
|
|
81
|
+
"@types/bun": "1.2.20",
|
|
82
|
+
"@scalar/types": "^0.2.13",
|
|
83
|
+
"elysia": "1.3.21",
|
|
84
|
+
"eslint": "9.6.0",
|
|
85
|
+
"tsup": "^8.5.0",
|
|
86
|
+
"typescript": "^5.9.2"
|
|
87
|
+
},
|
|
88
|
+
"dependencies": {
|
|
89
|
+
"@sinclair/typemap": "^0.10.1",
|
|
90
|
+
"openapi-types": "^12.1.3"
|
|
91
|
+
}
|
|
92
|
+
}
|