@elysiajs/openapi 1.4.0-exp.0 → 1.4.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/bun.lock +87 -92
- package/bunfig.toml +2 -0
- package/dist/cjs/gen/index.js +8299 -15
- package/dist/cjs/index.d.ts +1 -1
- package/dist/cjs/index.js +23 -24
- package/dist/cjs/openapi.d.ts +4 -6
- package/dist/cjs/openapi.js +19 -21
- package/dist/cjs/types.d.ts +18 -0
- package/dist/gen/index.mjs +8291 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.mjs +23 -24
- package/dist/openapi.d.ts +4 -6
- package/dist/openapi.mjs +19 -21
- package/dist/types.d.ts +18 -0
- package/package.json +92 -94
package/dist/index.d.ts
CHANGED
|
@@ -5,7 +5,7 @@ import type { ElysiaOpenAPIConfig, OpenAPIProvider } from './types';
|
|
|
5
5
|
*
|
|
6
6
|
* @see https://github.com/elysiajs/elysia-swagger
|
|
7
7
|
*/
|
|
8
|
-
export declare const openapi: <const Enabled extends boolean = true, const Path extends string = "/openapi", const Provider extends OpenAPIProvider = "scalar">({ enabled, path, provider, specPath, documentation, exclude, swagger, scalar, references }?: ElysiaOpenAPIConfig<Enabled, Path, Provider>) => Elysia<"", {
|
|
8
|
+
export declare const openapi: <const Enabled extends boolean = true, const Path extends string = "/openapi", const Provider extends OpenAPIProvider = "scalar">({ enabled, path, provider, specPath, documentation, exclude, swagger, scalar, references, mapJsonSchema }?: ElysiaOpenAPIConfig<Enabled, Path, Provider>) => Elysia<"", {
|
|
9
9
|
decorator: {};
|
|
10
10
|
store: {};
|
|
11
11
|
derive: {};
|
package/dist/index.mjs
CHANGED
|
@@ -268,7 +268,6 @@ var Hint = Symbol.for("TypeBox.Hint");
|
|
|
268
268
|
var Kind = Symbol.for("TypeBox.Kind");
|
|
269
269
|
|
|
270
270
|
// src/openapi.ts
|
|
271
|
-
import { toJsonSchema } from "xsschema";
|
|
272
271
|
var capitalize = (word) => word.charAt(0).toUpperCase() + word.slice(1);
|
|
273
272
|
var toRef = (name) => t.Ref(`#/components/schemas/${name}`);
|
|
274
273
|
var toOperationId = (method, paths) => {
|
|
@@ -297,14 +296,21 @@ var getLoosePath = (path) => {
|
|
|
297
296
|
return path.slice(0, path.length - 1);
|
|
298
297
|
return path + "/";
|
|
299
298
|
};
|
|
300
|
-
var unwrapSchema = (schema) => {
|
|
299
|
+
var unwrapSchema = (schema, mapJsonSchema) => {
|
|
301
300
|
if (!schema) return;
|
|
302
301
|
if (typeof schema === "string") schema = toRef(schema);
|
|
303
302
|
if (Kind in schema) return schema;
|
|
304
|
-
if (Kind in schema
|
|
305
|
-
|
|
303
|
+
if (Kind in schema || !schema?.["~standard"]) return;
|
|
304
|
+
const vendor = schema["~standard"].vendor;
|
|
305
|
+
if (mapJsonSchema?.[vendor] && typeof mapJsonSchema[vendor] === "function")
|
|
306
|
+
return mapJsonSchema[vendor](schema);
|
|
307
|
+
if (vendor === "zod" || vendor === "sury")
|
|
308
|
+
return schema.toJSONSchema?.();
|
|
309
|
+
if (vendor === "arktype")
|
|
310
|
+
return schema?.toJsonSchema?.();
|
|
311
|
+
return schema.toJSONSchema?.() ?? schema?.toJsonSchema?.();
|
|
306
312
|
};
|
|
307
|
-
|
|
313
|
+
function toOpenAPISchema(app, exclude, references, vendors) {
|
|
308
314
|
const {
|
|
309
315
|
methods: excludeMethods = ["OPTIONS"],
|
|
310
316
|
staticFile: excludeStaticFile = true,
|
|
@@ -357,8 +363,7 @@ async function toOpenAPISchema(app, exclude, references) {
|
|
|
357
363
|
};
|
|
358
364
|
const parameters = [];
|
|
359
365
|
if (hooks.params) {
|
|
360
|
-
|
|
361
|
-
if (params) params = await params;
|
|
366
|
+
const params = unwrapSchema(hooks.params, vendors);
|
|
362
367
|
if (params && params.type === "object" && params.properties)
|
|
363
368
|
for (const [paramName, paramSchema] of Object.entries(
|
|
364
369
|
params.properties
|
|
@@ -372,8 +377,7 @@ async function toOpenAPISchema(app, exclude, references) {
|
|
|
372
377
|
});
|
|
373
378
|
}
|
|
374
379
|
if (hooks.query) {
|
|
375
|
-
let query = unwrapSchema(hooks.query);
|
|
376
|
-
if (query) query = await query;
|
|
380
|
+
let query = unwrapSchema(hooks.query, vendors);
|
|
377
381
|
if (query && query.type === "object" && query.properties) {
|
|
378
382
|
const required = query.required || [];
|
|
379
383
|
for (const [queryName, querySchema] of Object.entries(
|
|
@@ -388,8 +392,7 @@ async function toOpenAPISchema(app, exclude, references) {
|
|
|
388
392
|
}
|
|
389
393
|
}
|
|
390
394
|
if (hooks.headers) {
|
|
391
|
-
|
|
392
|
-
if (headers) headers = await headers;
|
|
395
|
+
const headers = unwrapSchema(hooks.query, vendors);
|
|
393
396
|
if (headers && headers.type === "object" && headers.properties) {
|
|
394
397
|
const required = headers.required || [];
|
|
395
398
|
for (const [headerName, headerSchema] of Object.entries(
|
|
@@ -404,8 +407,7 @@ async function toOpenAPISchema(app, exclude, references) {
|
|
|
404
407
|
}
|
|
405
408
|
}
|
|
406
409
|
if (hooks.cookie) {
|
|
407
|
-
|
|
408
|
-
if (cookie) cookie = await cookie;
|
|
410
|
+
const cookie = unwrapSchema(hooks.cookie, vendors);
|
|
409
411
|
if (cookie && cookie.type === "object" && cookie.properties) {
|
|
410
412
|
const required = cookie.required || [];
|
|
411
413
|
for (const [cookieName, cookieSchema] of Object.entries(
|
|
@@ -421,8 +423,7 @@ async function toOpenAPISchema(app, exclude, references) {
|
|
|
421
423
|
}
|
|
422
424
|
if (parameters.length > 0) operation.parameters = parameters;
|
|
423
425
|
if (hooks.body && method !== "get" && method !== "head") {
|
|
424
|
-
|
|
425
|
-
if (body) body = await body;
|
|
426
|
+
const body = unwrapSchema(hooks.body, vendors);
|
|
426
427
|
if (body) {
|
|
427
428
|
const { type: _type, description, ...options } = body;
|
|
428
429
|
const type = _type;
|
|
@@ -484,8 +485,7 @@ async function toOpenAPISchema(app, exclude, references) {
|
|
|
484
485
|
operation.responses = {};
|
|
485
486
|
if (typeof hooks.response === "object" && !hooks.response.type && !hooks.response.$ref) {
|
|
486
487
|
for (let [status, schema] of Object.entries(hooks.response)) {
|
|
487
|
-
|
|
488
|
-
if (response) response = await response;
|
|
488
|
+
const response = unwrapSchema(schema, vendors);
|
|
489
489
|
if (!response) continue;
|
|
490
490
|
const { type: _type, description, ...options } = response;
|
|
491
491
|
const type = _type;
|
|
@@ -504,8 +504,7 @@ async function toOpenAPISchema(app, exclude, references) {
|
|
|
504
504
|
};
|
|
505
505
|
}
|
|
506
506
|
} else {
|
|
507
|
-
|
|
508
|
-
if (response) response = await response;
|
|
507
|
+
const response = unwrapSchema(hooks.response, vendors);
|
|
509
508
|
if (response) {
|
|
510
509
|
const { type: _type, description, ...options } = response;
|
|
511
510
|
const type = _type;
|
|
@@ -556,8 +555,7 @@ async function toOpenAPISchema(app, exclude, references) {
|
|
|
556
555
|
const schemas = /* @__PURE__ */ Object.create(null);
|
|
557
556
|
if (_schemas)
|
|
558
557
|
for (const [name, schema] of Object.entries(_schemas)) {
|
|
559
|
-
|
|
560
|
-
if (jsonSchema instanceof Promise) jsonSchema = await jsonSchema;
|
|
558
|
+
const jsonSchema = unwrapSchema(schema, vendors);
|
|
561
559
|
if (jsonSchema) schemas[name] = jsonSchema;
|
|
562
560
|
}
|
|
563
561
|
return {
|
|
@@ -581,7 +579,8 @@ var openapi = ({
|
|
|
581
579
|
exclude,
|
|
582
580
|
swagger,
|
|
583
581
|
scalar,
|
|
584
|
-
references
|
|
582
|
+
references,
|
|
583
|
+
mapJsonSchema
|
|
585
584
|
} = {}) => {
|
|
586
585
|
if (!enabled) return new Elysia({ name: "@elysiajs/openapi" });
|
|
587
586
|
const info = {
|
|
@@ -625,13 +624,13 @@ var openapi = ({
|
|
|
625
624
|
);
|
|
626
625
|
}).get(
|
|
627
626
|
specPath,
|
|
628
|
-
|
|
627
|
+
function openAPISchema() {
|
|
629
628
|
if (totalRoutes === app.routes.length) return cachedSchema;
|
|
630
629
|
totalRoutes = app.routes.length;
|
|
631
630
|
const {
|
|
632
631
|
paths,
|
|
633
632
|
components: { schemas }
|
|
634
|
-
} =
|
|
633
|
+
} = toOpenAPISchema(app, exclude, references, mapJsonSchema);
|
|
635
634
|
return cachedSchema = {
|
|
636
635
|
openapi: "3.0.3",
|
|
637
636
|
...documentation,
|
package/dist/openapi.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { type AnyElysia, type TSchema, type InputSchema } from 'elysia';
|
|
2
2
|
import type { OpenAPIV3 } from 'openapi-types';
|
|
3
3
|
import { type TProperties } from '@sinclair/typebox';
|
|
4
|
-
import type { AdditionalReferences, ElysiaOpenAPIConfig } from './types';
|
|
4
|
+
import type { AdditionalReferences, ElysiaOpenAPIConfig, MapJsonSchema } from './types';
|
|
5
5
|
export declare const capitalize: (word: string) => string;
|
|
6
6
|
/**
|
|
7
7
|
* Get all possible paths of a path with optional parameters
|
|
@@ -10,20 +10,18 @@ export declare const capitalize: (word: string) => string;
|
|
|
10
10
|
*/
|
|
11
11
|
export declare const getPossiblePath: (path: string) => string[];
|
|
12
12
|
export declare const getLoosePath: (path: string) => string;
|
|
13
|
-
|
|
14
|
-
export declare const unwrapSchema: (schema: InputSchema["body"]) => MaybePromise<OpenAPIV3.SchemaObject | undefined>;
|
|
13
|
+
export declare const unwrapSchema: (schema: InputSchema["body"], mapJsonSchema?: MapJsonSchema) => OpenAPIV3.SchemaObject | undefined;
|
|
15
14
|
/**
|
|
16
15
|
* Converts Elysia routes to OpenAPI 3.0.3 paths schema
|
|
17
16
|
* @param routes Array of Elysia route objects
|
|
18
17
|
* @returns OpenAPI paths object
|
|
19
18
|
*/
|
|
20
|
-
export declare function toOpenAPISchema(app: AnyElysia, exclude?: ElysiaOpenAPIConfig['exclude'], references?: AdditionalReferences):
|
|
19
|
+
export declare function toOpenAPISchema(app: AnyElysia, exclude?: ElysiaOpenAPIConfig['exclude'], references?: AdditionalReferences, vendors?: MapJsonSchema): {
|
|
21
20
|
components: {
|
|
22
21
|
schemas: any;
|
|
23
22
|
};
|
|
24
23
|
paths: OpenAPIV3.PathsObject<{}, {}>;
|
|
25
|
-
}
|
|
24
|
+
};
|
|
26
25
|
export declare const withHeaders: (schema: TSchema, headers: TProperties) => TSchema & {
|
|
27
26
|
headers: TProperties;
|
|
28
27
|
};
|
|
29
|
-
export {};
|
package/dist/openapi.mjs
CHANGED
|
@@ -9,7 +9,6 @@ var Hint = Symbol.for("TypeBox.Hint");
|
|
|
9
9
|
var Kind = Symbol.for("TypeBox.Kind");
|
|
10
10
|
|
|
11
11
|
// src/openapi.ts
|
|
12
|
-
import { toJsonSchema } from "xsschema";
|
|
13
12
|
var capitalize = (word) => word.charAt(0).toUpperCase() + word.slice(1);
|
|
14
13
|
var toRef = (name) => t.Ref(`#/components/schemas/${name}`);
|
|
15
14
|
var toOperationId = (method, paths) => {
|
|
@@ -38,14 +37,21 @@ var getLoosePath = (path) => {
|
|
|
38
37
|
return path.slice(0, path.length - 1);
|
|
39
38
|
return path + "/";
|
|
40
39
|
};
|
|
41
|
-
var unwrapSchema = (schema) => {
|
|
40
|
+
var unwrapSchema = (schema, mapJsonSchema) => {
|
|
42
41
|
if (!schema) return;
|
|
43
42
|
if (typeof schema === "string") schema = toRef(schema);
|
|
44
43
|
if (Kind in schema) return schema;
|
|
45
|
-
if (Kind in schema
|
|
46
|
-
|
|
44
|
+
if (Kind in schema || !schema?.["~standard"]) return;
|
|
45
|
+
const vendor = schema["~standard"].vendor;
|
|
46
|
+
if (mapJsonSchema?.[vendor] && typeof mapJsonSchema[vendor] === "function")
|
|
47
|
+
return mapJsonSchema[vendor](schema);
|
|
48
|
+
if (vendor === "zod" || vendor === "sury")
|
|
49
|
+
return schema.toJSONSchema?.();
|
|
50
|
+
if (vendor === "arktype")
|
|
51
|
+
return schema?.toJsonSchema?.();
|
|
52
|
+
return schema.toJSONSchema?.() ?? schema?.toJsonSchema?.();
|
|
47
53
|
};
|
|
48
|
-
|
|
54
|
+
function toOpenAPISchema(app, exclude, references, vendors) {
|
|
49
55
|
const {
|
|
50
56
|
methods: excludeMethods = ["OPTIONS"],
|
|
51
57
|
staticFile: excludeStaticFile = true,
|
|
@@ -98,8 +104,7 @@ async function toOpenAPISchema(app, exclude, references) {
|
|
|
98
104
|
};
|
|
99
105
|
const parameters = [];
|
|
100
106
|
if (hooks.params) {
|
|
101
|
-
|
|
102
|
-
if (params) params = await params;
|
|
107
|
+
const params = unwrapSchema(hooks.params, vendors);
|
|
103
108
|
if (params && params.type === "object" && params.properties)
|
|
104
109
|
for (const [paramName, paramSchema] of Object.entries(
|
|
105
110
|
params.properties
|
|
@@ -113,8 +118,7 @@ async function toOpenAPISchema(app, exclude, references) {
|
|
|
113
118
|
});
|
|
114
119
|
}
|
|
115
120
|
if (hooks.query) {
|
|
116
|
-
let query = unwrapSchema(hooks.query);
|
|
117
|
-
if (query) query = await query;
|
|
121
|
+
let query = unwrapSchema(hooks.query, vendors);
|
|
118
122
|
if (query && query.type === "object" && query.properties) {
|
|
119
123
|
const required = query.required || [];
|
|
120
124
|
for (const [queryName, querySchema] of Object.entries(
|
|
@@ -129,8 +133,7 @@ async function toOpenAPISchema(app, exclude, references) {
|
|
|
129
133
|
}
|
|
130
134
|
}
|
|
131
135
|
if (hooks.headers) {
|
|
132
|
-
|
|
133
|
-
if (headers) headers = await headers;
|
|
136
|
+
const headers = unwrapSchema(hooks.query, vendors);
|
|
134
137
|
if (headers && headers.type === "object" && headers.properties) {
|
|
135
138
|
const required = headers.required || [];
|
|
136
139
|
for (const [headerName, headerSchema] of Object.entries(
|
|
@@ -145,8 +148,7 @@ async function toOpenAPISchema(app, exclude, references) {
|
|
|
145
148
|
}
|
|
146
149
|
}
|
|
147
150
|
if (hooks.cookie) {
|
|
148
|
-
|
|
149
|
-
if (cookie) cookie = await cookie;
|
|
151
|
+
const cookie = unwrapSchema(hooks.cookie, vendors);
|
|
150
152
|
if (cookie && cookie.type === "object" && cookie.properties) {
|
|
151
153
|
const required = cookie.required || [];
|
|
152
154
|
for (const [cookieName, cookieSchema] of Object.entries(
|
|
@@ -162,8 +164,7 @@ async function toOpenAPISchema(app, exclude, references) {
|
|
|
162
164
|
}
|
|
163
165
|
if (parameters.length > 0) operation.parameters = parameters;
|
|
164
166
|
if (hooks.body && method !== "get" && method !== "head") {
|
|
165
|
-
|
|
166
|
-
if (body) body = await body;
|
|
167
|
+
const body = unwrapSchema(hooks.body, vendors);
|
|
167
168
|
if (body) {
|
|
168
169
|
const { type: _type, description, ...options } = body;
|
|
169
170
|
const type = _type;
|
|
@@ -225,8 +226,7 @@ async function toOpenAPISchema(app, exclude, references) {
|
|
|
225
226
|
operation.responses = {};
|
|
226
227
|
if (typeof hooks.response === "object" && !hooks.response.type && !hooks.response.$ref) {
|
|
227
228
|
for (let [status, schema] of Object.entries(hooks.response)) {
|
|
228
|
-
|
|
229
|
-
if (response) response = await response;
|
|
229
|
+
const response = unwrapSchema(schema, vendors);
|
|
230
230
|
if (!response) continue;
|
|
231
231
|
const { type: _type, description, ...options } = response;
|
|
232
232
|
const type = _type;
|
|
@@ -245,8 +245,7 @@ async function toOpenAPISchema(app, exclude, references) {
|
|
|
245
245
|
};
|
|
246
246
|
}
|
|
247
247
|
} else {
|
|
248
|
-
|
|
249
|
-
if (response) response = await response;
|
|
248
|
+
const response = unwrapSchema(hooks.response, vendors);
|
|
250
249
|
if (response) {
|
|
251
250
|
const { type: _type, description, ...options } = response;
|
|
252
251
|
const type = _type;
|
|
@@ -297,8 +296,7 @@ async function toOpenAPISchema(app, exclude, references) {
|
|
|
297
296
|
const schemas = /* @__PURE__ */ Object.create(null);
|
|
298
297
|
if (_schemas)
|
|
299
298
|
for (const [name, schema] of Object.entries(_schemas)) {
|
|
300
|
-
|
|
301
|
-
if (jsonSchema instanceof Promise) jsonSchema = await jsonSchema;
|
|
299
|
+
const jsonSchema = unwrapSchema(schema, vendors);
|
|
302
300
|
if (jsonSchema) schemas[name] = jsonSchema;
|
|
303
301
|
}
|
|
304
302
|
return {
|
package/dist/types.d.ts
CHANGED
|
@@ -4,6 +4,9 @@ import type { ApiReferenceConfiguration } from '@scalar/types';
|
|
|
4
4
|
import type { SwaggerUIOptions } from './swagger/types';
|
|
5
5
|
export type OpenAPIProvider = 'scalar' | 'swagger-ui' | null;
|
|
6
6
|
type MaybeArray<T> = T | T[];
|
|
7
|
+
export type MapJsonSchema = {
|
|
8
|
+
[vendor: string]: Function;
|
|
9
|
+
};
|
|
7
10
|
export type AdditionalReference = {
|
|
8
11
|
[path in string]: {
|
|
9
12
|
[method in string]: {
|
|
@@ -69,6 +72,21 @@ export interface ElysiaOpenAPIConfig<Enabled extends boolean = true, Path extend
|
|
|
69
72
|
* Additional reference for each endpoint
|
|
70
73
|
*/
|
|
71
74
|
references?: AdditionalReferences;
|
|
75
|
+
/**
|
|
76
|
+
* Mapping function from Standard schema to OpenAPI schema
|
|
77
|
+
*
|
|
78
|
+
* @example
|
|
79
|
+
* ```ts
|
|
80
|
+
* import { openapi } from '@elysiajs/openapi'
|
|
81
|
+
* import { toJsonSchema } from '@valibot/to-json-schema'
|
|
82
|
+
*
|
|
83
|
+
* openapi({
|
|
84
|
+
* vendors: {
|
|
85
|
+
* valibot: toJsonSchema
|
|
86
|
+
* }
|
|
87
|
+
* })
|
|
88
|
+
*/
|
|
89
|
+
mapJsonSchema?: MapJsonSchema;
|
|
72
90
|
/**
|
|
73
91
|
* Scalar configuration to customize scalar
|
|
74
92
|
*'
|
package/package.json
CHANGED
|
@@ -1,96 +1,94 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
"xsschema": ">= 0.4.0-beta.0"
|
|
95
|
-
}
|
|
2
|
+
"name": "@elysiajs/openapi",
|
|
3
|
+
"version": "1.4.1",
|
|
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
|
+
"dependencies": {},
|
|
77
|
+
"devDependencies": {
|
|
78
|
+
"@apidevtools/swagger-parser": "^12.0.0",
|
|
79
|
+
"@scalar/types": "^0.2.13",
|
|
80
|
+
"@sinclair/typemap": "^0.10.1",
|
|
81
|
+
"@types/bun": "1.2.20",
|
|
82
|
+
"elysia": "1.4.0",
|
|
83
|
+
"eslint": "9.6.0",
|
|
84
|
+
"openapi-types": "^12.1.3",
|
|
85
|
+
"tsup": "^8.5.0",
|
|
86
|
+
"typescript": "^5.9.2",
|
|
87
|
+
"xsschema": "^0.4.0-beta.3",
|
|
88
|
+
"zod": "^4.1.5"
|
|
89
|
+
},
|
|
90
|
+
"peerDependencies": {
|
|
91
|
+
"elysia": ">= 1.4.0",
|
|
92
|
+
"xsschema": ">= 0.4.0-beta.0"
|
|
93
|
+
}
|
|
96
94
|
}
|